From 2634789769cf4f775d0d337b9442c4f9f57cf01d Mon Sep 17 00:00:00 2001 From: yoan <536464346@qq.com> Date: Thu, 26 Sep 2024 17:04:49 +0800 Subject: [PATCH] Add local deployer --- internal/deployer/deployer.go | 4 + internal/deployer/local.go | 106 +++ internal/domain/access.go | 1 + migrations/1727341442_collections_snapshot.go | 706 ++++++++++++++++++ .../{index-C_Xz8zGf.js => index-CnO7gXFE.js} | 66 +- ui/dist/imgs/providers/local.svg | 10 + ui/dist/index.html | 2 +- ui/public/imgs/providers/local.svg | 10 + ui/src/components/certimate/AccessEdit.tsx | 11 + .../components/certimate/AccessLocalForm.tsx | 223 ++++++ ui/src/domain/access.ts | 12 +- ui/src/domain/domain.ts | 1 + 12 files changed, 1117 insertions(+), 35 deletions(-) create mode 100644 internal/deployer/local.go create mode 100644 migrations/1727341442_collections_snapshot.go rename ui/dist/assets/{index-C_Xz8zGf.js => index-CnO7gXFE.js} (67%) create mode 100644 ui/dist/imgs/providers/local.svg create mode 100644 ui/public/imgs/providers/local.svg create mode 100644 ui/src/components/certimate/AccessLocalForm.tsx diff --git a/internal/deployer/deployer.go b/internal/deployer/deployer.go index 42ab59a2..71a171d5 100644 --- a/internal/deployer/deployer.go +++ b/internal/deployer/deployer.go @@ -21,6 +21,7 @@ const ( targetWebhook = "webhook" targetTencentCdn = "tencent-cdn" targetQiniuCdn = "qiniu-cdn" + targetLocal = "local" ) type DeployerOption struct { @@ -127,7 +128,10 @@ func getWithAccess(record *models.Record, cert *applicant.Certificate, access *m case targetTencentCdn: return NewTencentCdn(option) case targetQiniuCdn: + return NewQiNiu(option) + case targetLocal: + return NewLocal(option), nil } return nil, errors.New("not implemented") } diff --git a/internal/deployer/local.go b/internal/deployer/local.go new file mode 100644 index 00000000..4457423b --- /dev/null +++ b/internal/deployer/local.go @@ -0,0 +1,106 @@ +package deployer + +import ( + "context" + "encoding/json" + "fmt" + "os" + "os/exec" + "path/filepath" + "runtime" +) + +type localAccess struct { + Command string `json:"command"` + CertPath string `json:"certPath"` + KeyPath string `json:"keyPath"` +} + +type local struct { + option *DeployerOption + infos []string +} + +func NewLocal(option *DeployerOption) *local { + return &local{ + option: option, + infos: make([]string, 0), + } +} + +func (l *local) GetID() string { + return fmt.Sprintf("%s-%s", l.option.AceessRecord.GetString("name"), l.option.AceessRecord.Id) +} + +func (l *local) GetInfo() []string { + return []string{} +} + +func (l *local) Deploy(ctx context.Context) error { + access := &localAccess{} + if err := json.Unmarshal([]byte(l.option.Access), access); err != nil { + return err + } + // 复制文件 + if err := copyFile(l.option.Certificate.Certificate, access.CertPath); err != nil { + return fmt.Errorf("复制证书失败: %w", err) + } + + if err := copyFile(l.option.Certificate.PrivateKey, access.KeyPath); err != nil { + return fmt.Errorf("复制私钥失败: %w", err) + } + + // 执行命令 + + if err := execCmd(access.Command); err != nil { + return fmt.Errorf("执行命令失败: %w", err) + } + + return nil +} + +func execCmd(command string) error { + // 执行命令 + var cmd *exec.Cmd + + if runtime.GOOS == "windows" { + cmd = exec.Command("cmd", "/C", command) + } else { + cmd = exec.Command("sh", "-c", command) + } + + cmd.Stdout = os.Stdout + cmd.Stderr = os.Stderr + + err := cmd.Run() + if err != nil { + return fmt.Errorf("执行命令失败: %w", err) + } + + return nil +} + +func copyFile(content string, path string) error { + dir := filepath.Dir(path) + + // 如果目录不存在,创建目录 + err := os.MkdirAll(dir, os.ModePerm) + if err != nil { + return fmt.Errorf("创建目录失败: %w", err) + } + + // 创建或打开文件 + file, err := os.Create(path) + if err != nil { + return fmt.Errorf("创建文件失败: %w", err) + } + defer file.Close() + + // 写入内容到文件 + _, err = file.Write([]byte(content)) + if err != nil { + return fmt.Errorf("写入文件失败: %w", err) + } + + return nil +} diff --git a/internal/domain/access.go b/internal/domain/access.go index 2d24449f..b486e8dd 100644 --- a/internal/domain/access.go +++ b/internal/domain/access.go @@ -27,3 +27,4 @@ type GodaddyAccess struct { ApiKey string `json:"apiKey"` ApiSecret string `json:"apiSecret"` } + diff --git a/migrations/1727341442_collections_snapshot.go b/migrations/1727341442_collections_snapshot.go new file mode 100644 index 00000000..f3982d16 --- /dev/null +++ b/migrations/1727341442_collections_snapshot.go @@ -0,0 +1,706 @@ +package migrations + +import ( + "encoding/json" + + "github.com/pocketbase/dbx" + "github.com/pocketbase/pocketbase/daos" + m "github.com/pocketbase/pocketbase/migrations" + "github.com/pocketbase/pocketbase/models" +) + +func init() { + m.Register(func(db dbx.Builder) error { + jsonData := `[ + { + "id": "z3p974ainxjqlvs", + "created": "2024-07-29 10:02:48.334Z", + "updated": "2024-09-26 08:20:28.305Z", + "name": "domains", + "type": "base", + "system": false, + "schema": [ + { + "system": false, + "id": "iuaerpl2", + "name": "domain", + "type": "text", + "required": false, + "presentable": false, + "unique": false, + "options": { + "min": null, + "max": null, + "pattern": "" + } + }, + { + "system": false, + "id": "ukkhuw85", + "name": "email", + "type": "email", + "required": false, + "presentable": false, + "unique": false, + "options": { + "exceptDomains": null, + "onlyDomains": null + } + }, + { + "system": false, + "id": "v98eebqq", + "name": "crontab", + "type": "text", + "required": false, + "presentable": false, + "unique": false, + "options": { + "min": null, + "max": null, + "pattern": "" + } + }, + { + "system": false, + "id": "alc8e9ow", + "name": "access", + "type": "relation", + "required": false, + "presentable": false, + "unique": false, + "options": { + "collectionId": "4yzbv8urny5ja1e", + "cascadeDelete": false, + "minSelect": null, + "maxSelect": 1, + "displayFields": null + } + }, + { + "system": false, + "id": "topsc9bj", + "name": "certUrl", + "type": "text", + "required": false, + "presentable": false, + "unique": false, + "options": { + "min": null, + "max": null, + "pattern": "" + } + }, + { + "system": false, + "id": "vixgq072", + "name": "certStableUrl", + "type": "text", + "required": false, + "presentable": false, + "unique": false, + "options": { + "min": null, + "max": null, + "pattern": "" + } + }, + { + "system": false, + "id": "g3a3sza5", + "name": "privateKey", + "type": "text", + "required": false, + "presentable": false, + "unique": false, + "options": { + "min": null, + "max": null, + "pattern": "" + } + }, + { + "system": false, + "id": "gr6iouny", + "name": "certificate", + "type": "text", + "required": false, + "presentable": false, + "unique": false, + "options": { + "min": null, + "max": null, + "pattern": "" + } + }, + { + "system": false, + "id": "tk6vnrmn", + "name": "issuerCertificate", + "type": "text", + "required": false, + "presentable": false, + "unique": false, + "options": { + "min": null, + "max": null, + "pattern": "" + } + }, + { + "system": false, + "id": "sjo6ibse", + "name": "csr", + "type": "text", + "required": false, + "presentable": false, + "unique": false, + "options": { + "min": null, + "max": null, + "pattern": "" + } + }, + { + "system": false, + "id": "x03n1bkj", + "name": "expiredAt", + "type": "date", + "required": false, + "presentable": false, + "unique": false, + "options": { + "min": "", + "max": "" + } + }, + { + "system": false, + "id": "srybpixz", + "name": "targetType", + "type": "select", + "required": false, + "presentable": false, + "unique": false, + "options": { + "maxSelect": 1, + "values": [ + "aliyun-oss", + "aliyun-cdn", + "aliyun-dcdn", + "ssh", + "webhook", + "tencent-cdn", + "qiniu-cdn", + "local" + ] + } + }, + { + "system": false, + "id": "xy7yk0mb", + "name": "targetAccess", + "type": "relation", + "required": false, + "presentable": false, + "unique": false, + "options": { + "collectionId": "4yzbv8urny5ja1e", + "cascadeDelete": false, + "minSelect": null, + "maxSelect": 1, + "displayFields": null + } + }, + { + "system": false, + "id": "6jqeyggw", + "name": "enabled", + "type": "bool", + "required": false, + "presentable": false, + "unique": false, + "options": {} + }, + { + "system": false, + "id": "hdsjcchf", + "name": "deployed", + "type": "bool", + "required": false, + "presentable": false, + "unique": false, + "options": {} + }, + { + "system": false, + "id": "aiya3rev", + "name": "rightnow", + "type": "bool", + "required": false, + "presentable": false, + "unique": false, + "options": {} + }, + { + "system": false, + "id": "ixznmhzc", + "name": "lastDeployedAt", + "type": "date", + "required": false, + "presentable": false, + "unique": false, + "options": { + "min": "", + "max": "" + } + }, + { + "system": false, + "id": "ghtlkn5j", + "name": "lastDeployment", + "type": "relation", + "required": false, + "presentable": false, + "unique": false, + "options": { + "collectionId": "0a1o4e6sstp694f", + "cascadeDelete": false, + "minSelect": null, + "maxSelect": 1, + "displayFields": null + } + }, + { + "system": false, + "id": "zfnyj9he", + "name": "variables", + "type": "text", + "required": false, + "presentable": false, + "unique": false, + "options": { + "min": null, + "max": null, + "pattern": "" + } + }, + { + "system": false, + "id": "1bspzuku", + "name": "group", + "type": "relation", + "required": false, + "presentable": false, + "unique": false, + "options": { + "collectionId": "teolp9pl72dxlxq", + "cascadeDelete": false, + "minSelect": null, + "maxSelect": 1, + "displayFields": null + } + }, + { + "system": false, + "id": "g65gfh7a", + "name": "nameservers", + "type": "text", + "required": false, + "presentable": false, + "unique": false, + "options": { + "min": null, + "max": null, + "pattern": "" + } + } + ], + "indexes": [ + "CREATE UNIQUE INDEX ` + "`" + `idx_4ABO6EQ` + "`" + ` ON ` + "`" + `domains` + "`" + ` (` + "`" + `domain` + "`" + `)" + ], + "listRule": null, + "viewRule": null, + "createRule": null, + "updateRule": null, + "deleteRule": null, + "options": {} + }, + { + "id": "4yzbv8urny5ja1e", + "created": "2024-07-29 10:04:39.685Z", + "updated": "2024-09-26 08:36:59.632Z", + "name": "access", + "type": "base", + "system": false, + "schema": [ + { + "system": false, + "id": "geeur58v", + "name": "name", + "type": "text", + "required": false, + "presentable": false, + "unique": false, + "options": { + "min": null, + "max": null, + "pattern": "" + } + }, + { + "system": false, + "id": "iql7jpwx", + "name": "config", + "type": "json", + "required": false, + "presentable": false, + "unique": false, + "options": { + "maxSize": 2000000 + } + }, + { + "system": false, + "id": "hwy7m03o", + "name": "configType", + "type": "select", + "required": false, + "presentable": false, + "unique": false, + "options": { + "maxSelect": 1, + "values": [ + "aliyun", + "tencent", + "ssh", + "webhook", + "cloudflare", + "qiniu", + "namesilo", + "godaddy", + "local" + ] + } + }, + { + "system": false, + "id": "lr33hiwg", + "name": "deleted", + "type": "date", + "required": false, + "presentable": false, + "unique": false, + "options": { + "min": "", + "max": "" + } + }, + { + "system": false, + "id": "hsxcnlvd", + "name": "usage", + "type": "select", + "required": false, + "presentable": false, + "unique": false, + "options": { + "maxSelect": 1, + "values": [ + "apply", + "deploy", + "all" + ] + } + }, + { + "system": false, + "id": "c8egzzwj", + "name": "group", + "type": "relation", + "required": false, + "presentable": false, + "unique": false, + "options": { + "collectionId": "teolp9pl72dxlxq", + "cascadeDelete": false, + "minSelect": null, + "maxSelect": 1, + "displayFields": null + } + } + ], + "indexes": [ + "CREATE UNIQUE INDEX ` + "`" + `idx_wkoST0j` + "`" + ` ON ` + "`" + `access` + "`" + ` (` + "`" + `name` + "`" + `)" + ], + "listRule": null, + "viewRule": null, + "createRule": null, + "updateRule": null, + "deleteRule": null, + "options": {} + }, + { + "id": "0a1o4e6sstp694f", + "created": "2024-07-30 06:30:27.801Z", + "updated": "2024-09-24 14:44:48.041Z", + "name": "deployments", + "type": "base", + "system": false, + "schema": [ + { + "system": false, + "id": "farvlzk7", + "name": "domain", + "type": "relation", + "required": false, + "presentable": false, + "unique": false, + "options": { + "collectionId": "z3p974ainxjqlvs", + "cascadeDelete": false, + "minSelect": null, + "maxSelect": 1, + "displayFields": null + } + }, + { + "system": false, + "id": "jx5f69i3", + "name": "log", + "type": "json", + "required": false, + "presentable": false, + "unique": false, + "options": { + "maxSize": 2000000 + } + }, + { + "system": false, + "id": "qbxdtg9q", + "name": "phase", + "type": "select", + "required": false, + "presentable": false, + "unique": false, + "options": { + "maxSelect": 1, + "values": [ + "check", + "apply", + "deploy" + ] + } + }, + { + "system": false, + "id": "rglrp1hz", + "name": "phaseSuccess", + "type": "bool", + "required": false, + "presentable": false, + "unique": false, + "options": {} + }, + { + "system": false, + "id": "lt1g1blu", + "name": "deployedAt", + "type": "date", + "required": false, + "presentable": false, + "unique": false, + "options": { + "min": "", + "max": "" + } + }, + { + "system": false, + "id": "wledpzgb", + "name": "wholeSuccess", + "type": "bool", + "required": false, + "presentable": false, + "unique": false, + "options": {} + } + ], + "indexes": [], + "listRule": null, + "viewRule": null, + "createRule": null, + "updateRule": null, + "deleteRule": null, + "options": {} + }, + { + "id": "_pb_users_auth_", + "created": "2024-09-12 13:09:54.234Z", + "updated": "2024-09-24 14:44:48.041Z", + "name": "users", + "type": "auth", + "system": false, + "schema": [ + { + "system": false, + "id": "users_name", + "name": "name", + "type": "text", + "required": false, + "presentable": false, + "unique": false, + "options": { + "min": null, + "max": null, + "pattern": "" + } + }, + { + "system": false, + "id": "users_avatar", + "name": "avatar", + "type": "file", + "required": false, + "presentable": false, + "unique": false, + "options": { + "mimeTypes": [ + "image/jpeg", + "image/png", + "image/svg+xml", + "image/gif", + "image/webp" + ], + "thumbs": null, + "maxSelect": 1, + "maxSize": 5242880, + "protected": false + } + } + ], + "indexes": [], + "listRule": "id = @request.auth.id", + "viewRule": "id = @request.auth.id", + "createRule": "", + "updateRule": "id = @request.auth.id", + "deleteRule": "id = @request.auth.id", + "options": { + "allowEmailAuth": true, + "allowOAuth2Auth": true, + "allowUsernameAuth": true, + "exceptEmailDomains": null, + "manageRule": null, + "minPasswordLength": 8, + "onlyEmailDomains": null, + "onlyVerified": false, + "requireEmail": false + } + }, + { + "id": "dy6ccjb60spfy6p", + "created": "2024-09-12 23:12:21.677Z", + "updated": "2024-09-24 14:44:48.041Z", + "name": "settings", + "type": "base", + "system": false, + "schema": [ + { + "system": false, + "id": "1tcmdsdf", + "name": "name", + "type": "text", + "required": false, + "presentable": false, + "unique": false, + "options": { + "min": null, + "max": null, + "pattern": "" + } + }, + { + "system": false, + "id": "f9wyhypi", + "name": "content", + "type": "json", + "required": false, + "presentable": false, + "unique": false, + "options": { + "maxSize": 2000000 + } + } + ], + "indexes": [ + "CREATE UNIQUE INDEX ` + "`" + `idx_RO7X9Vw` + "`" + ` ON ` + "`" + `settings` + "`" + ` (` + "`" + `name` + "`" + `)" + ], + "listRule": null, + "viewRule": null, + "createRule": null, + "updateRule": null, + "deleteRule": null, + "options": {} + }, + { + "id": "teolp9pl72dxlxq", + "created": "2024-09-13 12:51:05.611Z", + "updated": "2024-09-24 14:44:48.041Z", + "name": "access_groups", + "type": "base", + "system": false, + "schema": [ + { + "system": false, + "id": "7sajiv6i", + "name": "name", + "type": "text", + "required": false, + "presentable": false, + "unique": false, + "options": { + "min": null, + "max": null, + "pattern": "" + } + }, + { + "system": false, + "id": "xp8admif", + "name": "access", + "type": "relation", + "required": false, + "presentable": false, + "unique": false, + "options": { + "collectionId": "4yzbv8urny5ja1e", + "cascadeDelete": false, + "minSelect": null, + "maxSelect": null, + "displayFields": null + } + } + ], + "indexes": [ + "CREATE UNIQUE INDEX ` + "`" + `idx_RgRXp0R` + "`" + ` ON ` + "`" + `access_groups` + "`" + ` (` + "`" + `name` + "`" + `)" + ], + "listRule": null, + "viewRule": null, + "createRule": null, + "updateRule": null, + "deleteRule": null, + "options": {} + } + ]` + + collections := []*models.Collection{} + if err := json.Unmarshal([]byte(jsonData), &collections); err != nil { + return err + } + + return daos.New(db).ImportCollections(collections, true, nil) + }, func(db dbx.Builder) error { + return nil + }) +} diff --git a/ui/dist/assets/index-C_Xz8zGf.js b/ui/dist/assets/index-CnO7gXFE.js similarity index 67% rename from ui/dist/assets/index-C_Xz8zGf.js rename to ui/dist/assets/index-CnO7gXFE.js index a782b973..972fe4ce 100644 --- a/ui/dist/assets/index-C_Xz8zGf.js +++ b/ui/dist/assets/index-CnO7gXFE.js @@ -1,4 +1,4 @@ -var cT=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var G$=cT((lV,qu)=>{function Tw(e,t){for(var r=0;rn[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&n(i)}).observe(document,{childList:!0,subtree:!0});function r(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(s){if(s.ep)return;s.ep=!0;const o=r(s);fetch(s.href,o)}})();var Zc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Fm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Rw={exports:{}},Qd={},Pw={exports:{}},tt={};/** +var cT=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Z$=cT((cV,qu)=>{function Tw(e,t){for(var r=0;rn[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&n(i)}).observe(document,{childList:!0,subtree:!0});function r(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(s){if(s.ep)return;s.ep=!0;const o=r(s);fetch(s.href,o)}})();var Zc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Fm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Rw={exports:{}},Qd={},Pw={exports:{}},tt={};/** * @license React * react.production.min.js * @@ -6,7 +6,7 @@ var cT=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var G$=cT((lV,qu) * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var yc=Symbol.for("react.element"),uT=Symbol.for("react.portal"),dT=Symbol.for("react.fragment"),fT=Symbol.for("react.strict_mode"),hT=Symbol.for("react.profiler"),pT=Symbol.for("react.provider"),mT=Symbol.for("react.context"),gT=Symbol.for("react.forward_ref"),vT=Symbol.for("react.suspense"),yT=Symbol.for("react.memo"),xT=Symbol.for("react.lazy"),Ky=Symbol.iterator;function wT(e){return e===null||typeof e!="object"?null:(e=Ky&&e[Ky]||e["@@iterator"],typeof e=="function"?e:null)}var Aw={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Dw=Object.assign,Ow={};function Sa(e,t,r){this.props=e,this.context=t,this.refs=Ow,this.updater=r||Aw}Sa.prototype.isReactComponent={};Sa.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Sa.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Mw(){}Mw.prototype=Sa.prototype;function zm(e,t,r){this.props=e,this.context=t,this.refs=Ow,this.updater=r||Aw}var Um=zm.prototype=new Mw;Um.constructor=zm;Dw(Um,Sa.prototype);Um.isPureReactComponent=!0;var Gy=Array.isArray,Iw=Object.prototype.hasOwnProperty,$m={current:null},Lw={key:!0,ref:!0,__self:!0,__source:!0};function Fw(e,t,r){var n,s={},o=null,i=null;if(t!=null)for(n in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(o=""+t.key),t)Iw.call(t,n)&&!Lw.hasOwnProperty(n)&&(s[n]=t[n]);var a=arguments.length-2;if(a===1)s.children=r;else if(1()=>(t||e((t={exports:{}}).exports,t),t.exports);var G$=cT((lV,qu) * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var CT=g,jT=Symbol.for("react.element"),ET=Symbol.for("react.fragment"),NT=Object.prototype.hasOwnProperty,TT=CT.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,RT={key:!0,ref:!0,__self:!0,__source:!0};function $w(e,t,r){var n,s={},o=null,i=null;r!==void 0&&(o=""+r),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(i=t.ref);for(n in t)NT.call(t,n)&&!RT.hasOwnProperty(n)&&(s[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)s[n]===void 0&&(s[n]=t[n]);return{$$typeof:jT,type:e,key:o,ref:i,props:s,_owner:TT.current}}Qd.Fragment=ET;Qd.jsx=$w;Qd.jsxs=$w;Rw.exports=Qd;var l=Rw.exports,ip={},Vw={exports:{}},Yr={},Bw={exports:{}},Ww={};/** + */var CT=g,jT=Symbol.for("react.element"),ET=Symbol.for("react.fragment"),NT=Object.prototype.hasOwnProperty,TT=CT.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,RT={key:!0,ref:!0,__self:!0,__source:!0};function $w(e,t,r){var n,s={},o=null,i=null;r!==void 0&&(o=""+r),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(i=t.ref);for(n in t)NT.call(t,n)&&!RT.hasOwnProperty(n)&&(s[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)s[n]===void 0&&(s[n]=t[n]);return{$$typeof:jT,type:e,key:o,ref:i,props:s,_owner:TT.current}}Qd.Fragment=ET;Qd.jsx=$w;Qd.jsxs=$w;Rw.exports=Qd;var a=Rw.exports,ip={},Vw={exports:{}},Kr={},Bw={exports:{}},Ww={};/** * @license React * scheduler.production.min.js * @@ -22,7 +22,7 @@ var cT=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var G$=cT((lV,qu) * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */(function(e){function t(K,I){var Q=K.length;K.push(I);e:for(;0>>1,$=K[z];if(0>>1;zs(se,Q))Oe<$&&0>s(pe,se)?(K[z]=pe,K[Oe]=Q,z=Oe):(K[z]=se,K[ne]=Q,z=ne);else if(Oe<$&&0>s(pe,Q))K[z]=pe,K[Oe]=Q,z=Oe;else break e}}return I}function s(K,I){var Q=K.sortIndex-I.sortIndex;return Q!==0?Q:K.id-I.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var i=Date,a=i.now();e.unstable_now=function(){return i.now()-a}}var c=[],u=[],d=1,f=null,m=3,v=!1,x=!1,y=!1,_=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,h=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(K){for(var I=r(u);I!==null;){if(I.callback===null)n(u);else if(I.startTime<=K)n(u),I.sortIndex=I.expirationTime,t(c,I);else break;I=r(u)}}function C(K){if(y=!1,w(K),!x)if(r(c)!==null)x=!0,te(j);else{var I=r(u);I!==null&&B(C,I.startTime-K)}}function j(K,I){x=!1,y&&(y=!1,p(P),P=-1),v=!0;var Q=m;try{for(w(I),f=r(c);f!==null&&(!(f.expirationTime>I)||K&&!q());){var z=f.callback;if(typeof z=="function"){f.callback=null,m=f.priorityLevel;var $=z(f.expirationTime<=I);I=e.unstable_now(),typeof $=="function"?f.callback=$:f===r(c)&&n(c),w(I)}else n(c);f=r(c)}if(f!==null)var he=!0;else{var ne=r(u);ne!==null&&B(C,ne.startTime-I),he=!1}return he}finally{f=null,m=Q,v=!1}}var E=!1,R=null,P=-1,A=5,L=-1;function q(){return!(e.unstable_now()-LK||125z?(K.sortIndex=Q,t(u,K),r(c)===null&&K===r(u)&&(y?(p(P),P=-1):y=!0,B(C,Q-z))):(K.sortIndex=$,t(c,K),x||v||(x=!0,te(j))),K},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(K){var I=m;return function(){var Q=m;m=I;try{return K.apply(this,arguments)}finally{m=Q}}}})(Ww);Bw.exports=Ww;var PT=Bw.exports;/** + */(function(e){function t(K,I){var Q=K.length;K.push(I);e:for(;0>>1,$=K[z];if(0>>1;zs(se,Q))Oe<$&&0>s(pe,se)?(K[z]=pe,K[Oe]=Q,z=Oe):(K[z]=se,K[ne]=Q,z=ne);else if(Oe<$&&0>s(pe,Q))K[z]=pe,K[Oe]=Q,z=Oe;else break e}}return I}function s(K,I){var Q=K.sortIndex-I.sortIndex;return Q!==0?Q:K.id-I.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var i=Date,l=i.now();e.unstable_now=function(){return i.now()-l}}var c=[],u=[],d=1,f=null,m=3,v=!1,x=!1,y=!1,_=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,h=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(K){for(var I=r(u);I!==null;){if(I.callback===null)n(u);else if(I.startTime<=K)n(u),I.sortIndex=I.expirationTime,t(c,I);else break;I=r(u)}}function C(K){if(y=!1,w(K),!x)if(r(c)!==null)x=!0,te(j);else{var I=r(u);I!==null&&B(C,I.startTime-K)}}function j(K,I){x=!1,y&&(y=!1,p(P),P=-1),v=!0;var Q=m;try{for(w(I),f=r(c);f!==null&&(!(f.expirationTime>I)||K&&!q());){var z=f.callback;if(typeof z=="function"){f.callback=null,m=f.priorityLevel;var $=z(f.expirationTime<=I);I=e.unstable_now(),typeof $=="function"?f.callback=$:f===r(c)&&n(c),w(I)}else n(c);f=r(c)}if(f!==null)var he=!0;else{var ne=r(u);ne!==null&&B(C,ne.startTime-I),he=!1}return he}finally{f=null,m=Q,v=!1}}var E=!1,R=null,P=-1,A=5,L=-1;function q(){return!(e.unstable_now()-LK||125z?(K.sortIndex=Q,t(u,K),r(c)===null&&K===r(u)&&(y?(p(P),P=-1):y=!0,B(C,Q-z))):(K.sortIndex=$,t(c,K),x||v||(x=!0,te(j))),K},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(K){var I=m;return function(){var Q=m;m=I;try{return K.apply(this,arguments)}finally{m=Q}}}})(Ww);Bw.exports=Ww;var PT=Bw.exports;/** * @license React * react-dom.production.min.js * @@ -30,14 +30,14 @@ var cT=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var G$=cT((lV,qu) * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var AT=g,Wr=PT;function ie(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ap=Object.prototype.hasOwnProperty,DT=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,qy={},Xy={};function OT(e){return ap.call(Xy,e)?!0:ap.call(qy,e)?!1:DT.test(e)?Xy[e]=!0:(qy[e]=!0,!1)}function MT(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function IT(e,t,r,n){if(t===null||typeof t>"u"||MT(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function xr(e,t,r,n,s,o,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=s,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=i}var nr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){nr[e]=new xr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];nr[t]=new xr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){nr[e]=new xr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){nr[e]=new xr(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){nr[e]=new xr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){nr[e]=new xr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){nr[e]=new xr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){nr[e]=new xr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){nr[e]=new xr(e,5,!1,e.toLowerCase(),null,!1,!1)});var Bm=/[\-:]([a-z])/g;function Wm(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Bm,Wm);nr[t]=new xr(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Bm,Wm);nr[t]=new xr(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Bm,Wm);nr[t]=new xr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){nr[e]=new xr(e,1,!1,e.toLowerCase(),null,!1,!1)});nr.xlinkHref=new xr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){nr[e]=new xr(e,1,!1,e.toLowerCase(),null,!0,!0)});function Hm(e,t,r,n){var s=nr.hasOwnProperty(t)?nr[t]:null;(s!==null?s.type!==0:n||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ap=Object.prototype.hasOwnProperty,DT=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,qy={},Xy={};function OT(e){return ap.call(Xy,e)?!0:ap.call(qy,e)?!1:DT.test(e)?Xy[e]=!0:(qy[e]=!0,!1)}function MT(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function IT(e,t,r,n){if(t===null||typeof t>"u"||MT(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function br(e,t,r,n,s,o,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=s,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=i}var nr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){nr[e]=new br(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];nr[t]=new br(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){nr[e]=new br(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){nr[e]=new br(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){nr[e]=new br(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){nr[e]=new br(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){nr[e]=new br(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){nr[e]=new br(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){nr[e]=new br(e,5,!1,e.toLowerCase(),null,!1,!1)});var Bm=/[\-:]([a-z])/g;function Wm(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Bm,Wm);nr[t]=new br(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Bm,Wm);nr[t]=new br(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Bm,Wm);nr[t]=new br(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){nr[e]=new br(e,1,!1,e.toLowerCase(),null,!1,!1)});nr.xlinkHref=new br("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){nr[e]=new br(e,1,!1,e.toLowerCase(),null,!0,!0)});function Hm(e,t,r,n){var s=nr.hasOwnProperty(t)?nr[t]:null;(s!==null?s.type!==0:n||!(2a||s[i]!==o[a]){var c=` -`+s[i].replace(" at new "," at ");return e.displayName&&c.includes("")&&(c=c.replace("",e.displayName)),c}while(1<=i&&0<=a);break}}}finally{fh=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?rl(e):""}function LT(e){switch(e.tag){case 5:return rl(e.type);case 16:return rl("Lazy");case 13:return rl("Suspense");case 19:return rl("SuspenseList");case 0:case 2:case 15:return e=hh(e.type,!1),e;case 11:return e=hh(e.type.render,!1),e;case 1:return e=hh(e.type,!0),e;default:return""}}function dp(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Pi:return"Fragment";case Ri:return"Portal";case lp:return"Profiler";case Ym:return"StrictMode";case cp:return"Suspense";case up:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Kw:return(e.displayName||"Context")+".Consumer";case Yw:return(e._context.displayName||"Context")+".Provider";case Km:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Gm:return t=e.displayName||null,t!==null?t:dp(e.type)||"Memo";case Ws:t=e._payload,e=e._init;try{return dp(e(t))}catch{}}return null}function FT(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return dp(t);case 8:return t===Ym?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ho(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Zw(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function zT(e){var t=Zw(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var s=r.get,o=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(i){n=""+i,o.call(this,i)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(i){n=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Qc(e){e._valueTracker||(e._valueTracker=zT(e))}function qw(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=Zw(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function Xu(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function fp(e,t){var r=t.checked;return Mt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Jy(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=ho(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Xw(e,t){t=t.checked,t!=null&&Hm(e,"checked",t,!1)}function hp(e,t){Xw(e,t);var r=ho(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?pp(e,t.type,r):t.hasOwnProperty("defaultValue")&&pp(e,t.type,ho(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function ex(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function pp(e,t,r){(t!=="number"||Xu(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var nl=Array.isArray;function Ki(e,t,r,n){if(e=e.options,t){t={};for(var s=0;s"+t.valueOf().toString()+"",t=Jc.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Rl(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var ml={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},UT=["Webkit","ms","Moz","O"];Object.keys(ml).forEach(function(e){UT.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ml[t]=ml[e]})});function t_(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||ml.hasOwnProperty(e)&&ml[e]?(""+t).trim():t+"px"}function r_(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,s=t_(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,s):e[r]=s}}var $T=Mt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function vp(e,t){if(t){if($T[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ie(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ie(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ie(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ie(62))}}function yp(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var xp=null;function Zm(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var wp=null,Gi=null,Zi=null;function nx(e){if(e=_c(e)){if(typeof wp!="function")throw Error(ie(280));var t=e.stateNode;t&&(t=nf(t),wp(e.stateNode,e.type,t))}}function n_(e){Gi?Zi?Zi.push(e):Zi=[e]:Gi=e}function s_(){if(Gi){var e=Gi,t=Zi;if(Zi=Gi=null,nx(e),t)for(e=0;e>>=0,e===0?32:31-(QT(e)/JT|0)|0}var eu=64,tu=4194304;function sl(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function td(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,s=e.suspendedLanes,o=e.pingedLanes,i=r&268435455;if(i!==0){var a=i&~s;a!==0?n=sl(a):(o&=i,o!==0&&(n=sl(o)))}else i=r&~s,i!==0?n=sl(i):o!==0&&(n=sl(o));if(n===0)return 0;if(t!==0&&t!==n&&!(t&s)&&(s=n&-n,o=t&-t,s>=o||s===16&&(o&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0r;r++)t.push(e);return t}function xc(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-xn(t),e[t]=r}function n2(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0=vl),fx=" ",hx=!1;function k_(e,t){switch(e){case"keyup":return P2.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function C_(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ai=!1;function D2(e,t){switch(e){case"compositionend":return C_(t);case"keypress":return t.which!==32?null:(hx=!0,fx);case"textInput":return e=t.data,e===fx&&hx?null:e;default:return null}}function O2(e,t){if(Ai)return e==="compositionend"||!ng&&k_(e,t)?(e=b_(),Ru=eg=Xs=null,Ai=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=vx(r)}}function T_(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?T_(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function R_(){for(var e=window,t=Xu();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Xu(e.document)}return t}function sg(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function B2(e){var t=R_(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&T_(r.ownerDocument.documentElement,r)){if(n!==null&&sg(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=r.textContent.length,o=Math.min(n.start,s);n=n.end===void 0?o:Math.min(n.end,s),!e.extend&&o>n&&(s=n,n=o,o=s),s=yx(r,o);var i=yx(r,n);s&&i&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),o>n?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,Di=null,jp=null,xl=null,Ep=!1;function xx(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Ep||Di==null||Di!==Xu(n)||(n=Di,"selectionStart"in n&&sg(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),xl&&Il(xl,n)||(xl=n,n=sd(jp,"onSelect"),0Ii||(e.current=Dp[Ii],Dp[Ii]=null,Ii--)}function wt(e,t){Ii++,Dp[Ii]=e.current,e.current=t}var po={},ur=ko(po),Nr=ko(!1),Xo=po;function ua(e,t){var r=e.type.contextTypes;if(!r)return po;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var s={},o;for(o in r)s[o]=t[o];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function Tr(e){return e=e.childContextTypes,e!=null}function id(){St(Nr),St(ur)}function jx(e,t,r){if(ur.current!==po)throw Error(ie(168));wt(ur,t),wt(Nr,r)}function z_(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var s in n)if(!(s in t))throw Error(ie(108,FT(e)||"Unknown",s));return Mt({},r,n)}function ad(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||po,Xo=ur.current,wt(ur,e),wt(Nr,Nr.current),!0}function Ex(e,t,r){var n=e.stateNode;if(!n)throw Error(ie(169));r?(e=z_(e,t,Xo),n.__reactInternalMemoizedMergedChildContext=e,St(Nr),St(ur),wt(ur,e)):St(Nr),wt(Nr,r)}var cs=null,sf=!1,Eh=!1;function U_(e){cs===null?cs=[e]:cs.push(e)}function tR(e){sf=!0,U_(e)}function Co(){if(!Eh&&cs!==null){Eh=!0;var e=0,t=mt;try{var r=cs;for(mt=1;e>=i,s-=i,us=1<<32-xn(t)+s|r<P?(A=R,R=null):A=R.sibling;var L=m(p,R,w[P],C);if(L===null){R===null&&(R=A);break}e&&R&&L.alternate===null&&t(p,R),h=o(L,h,P),E===null?j=L:E.sibling=L,E=L,R=A}if(P===w.length)return r(p,R),Tt&&Do(p,P),j;if(R===null){for(;PP?(A=R,R=null):A=R.sibling;var q=m(p,R,L.value,C);if(q===null){R===null&&(R=A);break}e&&R&&q.alternate===null&&t(p,R),h=o(q,h,P),E===null?j=q:E.sibling=q,E=q,R=A}if(L.done)return r(p,R),Tt&&Do(p,P),j;if(R===null){for(;!L.done;P++,L=w.next())L=f(p,L.value,C),L!==null&&(h=o(L,h,P),E===null?j=L:E.sibling=L,E=L);return Tt&&Do(p,P),j}for(R=n(p,R);!L.done;P++,L=w.next())L=v(R,p,P,L.value,C),L!==null&&(e&&L.alternate!==null&&R.delete(L.key===null?P:L.key),h=o(L,h,P),E===null?j=L:E.sibling=L,E=L);return e&&R.forEach(function(N){return t(p,N)}),Tt&&Do(p,P),j}function _(p,h,w,C){if(typeof w=="object"&&w!==null&&w.type===Pi&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Xc:e:{for(var j=w.key,E=h;E!==null;){if(E.key===j){if(j=w.type,j===Pi){if(E.tag===7){r(p,E.sibling),h=s(E,w.props.children),h.return=p,p=h;break e}}else if(E.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===Ws&&Rx(j)===E.type){r(p,E.sibling),h=s(E,w.props),h.ref=Ha(p,E,w),h.return=p,p=h;break e}r(p,E);break}else t(p,E);E=E.sibling}w.type===Pi?(h=Go(w.props.children,p.mode,C,w.key),h.return=p,p=h):(C=Fu(w.type,w.key,w.props,null,p.mode,C),C.ref=Ha(p,h,w),C.return=p,p=C)}return i(p);case Ri:e:{for(E=w.key;h!==null;){if(h.key===E)if(h.tag===4&&h.stateNode.containerInfo===w.containerInfo&&h.stateNode.implementation===w.implementation){r(p,h.sibling),h=s(h,w.children||[]),h.return=p,p=h;break e}else{r(p,h);break}else t(p,h);h=h.sibling}h=Mh(w,p.mode,C),h.return=p,p=h}return i(p);case Ws:return E=w._init,_(p,h,E(w._payload),C)}if(nl(w))return x(p,h,w,C);if(Ua(w))return y(p,h,w,C);lu(p,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,h!==null&&h.tag===6?(r(p,h.sibling),h=s(h,w),h.return=p,p=h):(r(p,h),h=Oh(w,p.mode,C),h.return=p,p=h),i(p)):r(p,h)}return _}var fa=W_(!0),H_=W_(!1),ud=ko(null),dd=null,zi=null,lg=null;function cg(){lg=zi=dd=null}function ug(e){var t=ud.current;St(ud),e._currentValue=t}function Ip(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function Xi(e,t){dd=e,lg=zi=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Er=!0),e.firstContext=null)}function sn(e){var t=e._currentValue;if(lg!==e)if(e={context:e,memoizedValue:t,next:null},zi===null){if(dd===null)throw Error(ie(308));zi=e,dd.dependencies={lanes:0,firstContext:e}}else zi=zi.next=e;return t}var zo=null;function dg(e){zo===null?zo=[e]:zo.push(e)}function Y_(e,t,r,n){var s=t.interleaved;return s===null?(r.next=r,dg(t)):(r.next=s.next,s.next=r),t.interleaved=r,ws(e,n)}function ws(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var Hs=!1;function fg(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function K_(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function ps(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function io(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,lt&2){var s=n.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),n.pending=t,ws(e,r)}return s=n.interleaved,s===null?(t.next=t,dg(n)):(t.next=s.next,s.next=t),n.interleaved=t,ws(e,r)}function Au(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Xm(e,r)}}function Px(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var s=null,o=null;if(r=r.firstBaseUpdate,r!==null){do{var i={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};o===null?s=o=i:o=o.next=i,r=r.next}while(r!==null);o===null?s=o=t:o=o.next=t}else s=o=t;r={baseState:n.baseState,firstBaseUpdate:s,lastBaseUpdate:o,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function fd(e,t,r,n){var s=e.updateQueue;Hs=!1;var o=s.firstBaseUpdate,i=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var c=a,u=c.next;c.next=null,i===null?o=u:i.next=u,i=c;var d=e.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==i&&(a===null?d.firstBaseUpdate=u:a.next=u,d.lastBaseUpdate=c))}if(o!==null){var f=s.baseState;i=0,d=u=c=null,a=o;do{var m=a.lane,v=a.eventTime;if((n&m)===m){d!==null&&(d=d.next={eventTime:v,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var x=e,y=a;switch(m=t,v=r,y.tag){case 1:if(x=y.payload,typeof x=="function"){f=x.call(v,f,m);break e}f=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=y.payload,m=typeof x=="function"?x.call(v,f,m):x,m==null)break e;f=Mt({},f,m);break e;case 2:Hs=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,m=s.effects,m===null?s.effects=[a]:m.push(a))}else v={eventTime:v,lane:m,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(u=d=v,c=f):d=d.next=v,i|=m;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;m=a,a=m.next,m.next=null,s.lastBaseUpdate=m,s.shared.pending=null}}while(!0);if(d===null&&(c=f),s.baseState=c,s.firstBaseUpdate=u,s.lastBaseUpdate=d,t=s.shared.interleaved,t!==null){s=t;do i|=s.lane,s=s.next;while(s!==t)}else o===null&&(s.shared.lanes=0);ei|=i,e.lanes=i,e.memoizedState=f}}function Ax(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var n=Th.transition;Th.transition={};try{e(!1),t()}finally{mt=r,Th.transition=n}}function u1(){return on().memoizedState}function oR(e,t,r){var n=lo(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},d1(e))f1(t,r);else if(r=Y_(e,t,r,n),r!==null){var s=gr();wn(r,e,n,s),h1(r,t,n)}}function iR(e,t,r){var n=lo(e),s={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(d1(e))f1(t,s);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var i=t.lastRenderedState,a=o(i,r);if(s.hasEagerState=!0,s.eagerState=a,bn(a,i)){var c=t.interleaved;c===null?(s.next=s,dg(t)):(s.next=c.next,c.next=s),t.interleaved=s;return}}catch{}finally{}r=Y_(e,t,s,n),r!==null&&(s=gr(),wn(r,e,n,s),h1(r,t,n))}}function d1(e){var t=e.alternate;return e===Ot||t!==null&&t===Ot}function f1(e,t){wl=pd=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function h1(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Xm(e,r)}}var md={readContext:sn,useCallback:ir,useContext:ir,useEffect:ir,useImperativeHandle:ir,useInsertionEffect:ir,useLayoutEffect:ir,useMemo:ir,useReducer:ir,useRef:ir,useState:ir,useDebugValue:ir,useDeferredValue:ir,useTransition:ir,useMutableSource:ir,useSyncExternalStore:ir,useId:ir,unstable_isNewReconciler:!1},aR={readContext:sn,useCallback:function(e,t){return Mn().memoizedState=[e,t===void 0?null:t],e},useContext:sn,useEffect:Ox,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Ou(4194308,4,o1.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Ou(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ou(4,2,e,t)},useMemo:function(e,t){var r=Mn();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=Mn();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=oR.bind(null,Ot,e),[n.memoizedState,e]},useRef:function(e){var t=Mn();return e={current:e},t.memoizedState=e},useState:Dx,useDebugValue:wg,useDeferredValue:function(e){return Mn().memoizedState=e},useTransition:function(){var e=Dx(!1),t=e[0];return e=sR.bind(null,e[1]),Mn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Ot,s=Mn();if(Tt){if(r===void 0)throw Error(ie(407));r=r()}else{if(r=t(),Qt===null)throw Error(ie(349));Jo&30||X_(n,t,r)}s.memoizedState=r;var o={value:r,getSnapshot:t};return s.queue=o,Ox(J_.bind(null,n,o,e),[e]),n.flags|=2048,Wl(9,Q_.bind(null,n,o,r,t),void 0,null),r},useId:function(){var e=Mn(),t=Qt.identifierPrefix;if(Tt){var r=ds,n=us;r=(n&~(1<<32-xn(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=Vl++,0l||s[i]!==o[l]){var c=` +`+s[i].replace(" at new "," at ");return e.displayName&&c.includes("")&&(c=c.replace("",e.displayName)),c}while(1<=i&&0<=l);break}}}finally{fh=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?nl(e):""}function LT(e){switch(e.tag){case 5:return nl(e.type);case 16:return nl("Lazy");case 13:return nl("Suspense");case 19:return nl("SuspenseList");case 0:case 2:case 15:return e=hh(e.type,!1),e;case 11:return e=hh(e.type.render,!1),e;case 1:return e=hh(e.type,!0),e;default:return""}}function dp(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Pi:return"Fragment";case Ri:return"Portal";case lp:return"Profiler";case Ym:return"StrictMode";case cp:return"Suspense";case up:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Kw:return(e.displayName||"Context")+".Consumer";case Yw:return(e._context.displayName||"Context")+".Provider";case Km:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Gm:return t=e.displayName||null,t!==null?t:dp(e.type)||"Memo";case Ks:t=e._payload,e=e._init;try{return dp(e(t))}catch{}}return null}function FT(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return dp(t);case 8:return t===Ym?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function go(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Zw(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function zT(e){var t=Zw(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var s=r.get,o=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(i){n=""+i,o.call(this,i)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(i){n=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Qc(e){e._valueTracker||(e._valueTracker=zT(e))}function qw(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=Zw(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function Xu(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function fp(e,t){var r=t.checked;return Mt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Jy(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=go(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Xw(e,t){t=t.checked,t!=null&&Hm(e,"checked",t,!1)}function hp(e,t){Xw(e,t);var r=go(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?pp(e,t.type,r):t.hasOwnProperty("defaultValue")&&pp(e,t.type,go(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function ex(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function pp(e,t,r){(t!=="number"||Xu(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var sl=Array.isArray;function Ki(e,t,r,n){if(e=e.options,t){t={};for(var s=0;s"+t.valueOf().toString()+"",t=Jc.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Pl(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var gl={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},UT=["Webkit","ms","Moz","O"];Object.keys(gl).forEach(function(e){UT.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),gl[t]=gl[e]})});function t_(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||gl.hasOwnProperty(e)&&gl[e]?(""+t).trim():t+"px"}function r_(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,s=t_(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,s):e[r]=s}}var $T=Mt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function vp(e,t){if(t){if($T[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ie(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ie(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ie(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ie(62))}}function yp(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var xp=null;function Zm(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var wp=null,Gi=null,Zi=null;function nx(e){if(e=_c(e)){if(typeof wp!="function")throw Error(ie(280));var t=e.stateNode;t&&(t=nf(t),wp(e.stateNode,e.type,t))}}function n_(e){Gi?Zi?Zi.push(e):Zi=[e]:Gi=e}function s_(){if(Gi){var e=Gi,t=Zi;if(Zi=Gi=null,nx(e),t)for(e=0;e>>=0,e===0?32:31-(QT(e)/JT|0)|0}var eu=64,tu=4194304;function ol(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function td(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,s=e.suspendedLanes,o=e.pingedLanes,i=r&268435455;if(i!==0){var l=i&~s;l!==0?n=ol(l):(o&=i,o!==0&&(n=ol(o)))}else i=r&~s,i!==0?n=ol(i):o!==0&&(n=ol(o));if(n===0)return 0;if(t!==0&&t!==n&&!(t&s)&&(s=n&-n,o=t&-t,s>=o||s===16&&(o&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0r;r++)t.push(e);return t}function xc(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-xn(t),e[t]=r}function n2(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0=yl),fx=" ",hx=!1;function k_(e,t){switch(e){case"keyup":return P2.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function C_(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ai=!1;function D2(e,t){switch(e){case"compositionend":return C_(t);case"keypress":return t.which!==32?null:(hx=!0,fx);case"textInput":return e=t.data,e===fx&&hx?null:e;default:return null}}function O2(e,t){if(Ai)return e==="compositionend"||!ng&&k_(e,t)?(e=b_(),Ru=eg=eo=null,Ai=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=vx(r)}}function T_(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?T_(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function R_(){for(var e=window,t=Xu();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Xu(e.document)}return t}function sg(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function B2(e){var t=R_(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&T_(r.ownerDocument.documentElement,r)){if(n!==null&&sg(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=r.textContent.length,o=Math.min(n.start,s);n=n.end===void 0?o:Math.min(n.end,s),!e.extend&&o>n&&(s=n,n=o,o=s),s=yx(r,o);var i=yx(r,n);s&&i&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),o>n?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,Di=null,jp=null,wl=null,Ep=!1;function xx(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Ep||Di==null||Di!==Xu(n)||(n=Di,"selectionStart"in n&&sg(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),wl&&Ll(wl,n)||(wl=n,n=sd(jp,"onSelect"),0Ii||(e.current=Dp[Ii],Dp[Ii]=null,Ii--)}function wt(e,t){Ii++,Dp[Ii]=e.current,e.current=t}var vo={},ur=Eo(vo),Nr=Eo(!1),Xo=vo;function ua(e,t){var r=e.type.contextTypes;if(!r)return vo;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var s={},o;for(o in r)s[o]=t[o];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function Tr(e){return e=e.childContextTypes,e!=null}function id(){St(Nr),St(ur)}function jx(e,t,r){if(ur.current!==vo)throw Error(ie(168));wt(ur,t),wt(Nr,r)}function z_(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var s in n)if(!(s in t))throw Error(ie(108,FT(e)||"Unknown",s));return Mt({},r,n)}function ad(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||vo,Xo=ur.current,wt(ur,e),wt(Nr,Nr.current),!0}function Ex(e,t,r){var n=e.stateNode;if(!n)throw Error(ie(169));r?(e=z_(e,t,Xo),n.__reactInternalMemoizedMergedChildContext=e,St(Nr),St(ur),wt(ur,e)):St(Nr),wt(Nr,r)}var cs=null,sf=!1,Eh=!1;function U_(e){cs===null?cs=[e]:cs.push(e)}function tR(e){sf=!0,U_(e)}function No(){if(!Eh&&cs!==null){Eh=!0;var e=0,t=mt;try{var r=cs;for(mt=1;e>=i,s-=i,us=1<<32-xn(t)+s|r<P?(A=R,R=null):A=R.sibling;var L=m(p,R,w[P],C);if(L===null){R===null&&(R=A);break}e&&R&&L.alternate===null&&t(p,R),h=o(L,h,P),E===null?j=L:E.sibling=L,E=L,R=A}if(P===w.length)return r(p,R),Tt&&Do(p,P),j;if(R===null){for(;PP?(A=R,R=null):A=R.sibling;var q=m(p,R,L.value,C);if(q===null){R===null&&(R=A);break}e&&R&&q.alternate===null&&t(p,R),h=o(q,h,P),E===null?j=q:E.sibling=q,E=q,R=A}if(L.done)return r(p,R),Tt&&Do(p,P),j;if(R===null){for(;!L.done;P++,L=w.next())L=f(p,L.value,C),L!==null&&(h=o(L,h,P),E===null?j=L:E.sibling=L,E=L);return Tt&&Do(p,P),j}for(R=n(p,R);!L.done;P++,L=w.next())L=v(R,p,P,L.value,C),L!==null&&(e&&L.alternate!==null&&R.delete(L.key===null?P:L.key),h=o(L,h,P),E===null?j=L:E.sibling=L,E=L);return e&&R.forEach(function(N){return t(p,N)}),Tt&&Do(p,P),j}function _(p,h,w,C){if(typeof w=="object"&&w!==null&&w.type===Pi&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Xc:e:{for(var j=w.key,E=h;E!==null;){if(E.key===j){if(j=w.type,j===Pi){if(E.tag===7){r(p,E.sibling),h=s(E,w.props.children),h.return=p,p=h;break e}}else if(E.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===Ks&&Rx(j)===E.type){r(p,E.sibling),h=s(E,w.props),h.ref=Ya(p,E,w),h.return=p,p=h;break e}r(p,E);break}else t(p,E);E=E.sibling}w.type===Pi?(h=Go(w.props.children,p.mode,C,w.key),h.return=p,p=h):(C=Fu(w.type,w.key,w.props,null,p.mode,C),C.ref=Ya(p,h,w),C.return=p,p=C)}return i(p);case Ri:e:{for(E=w.key;h!==null;){if(h.key===E)if(h.tag===4&&h.stateNode.containerInfo===w.containerInfo&&h.stateNode.implementation===w.implementation){r(p,h.sibling),h=s(h,w.children||[]),h.return=p,p=h;break e}else{r(p,h);break}else t(p,h);h=h.sibling}h=Mh(w,p.mode,C),h.return=p,p=h}return i(p);case Ks:return E=w._init,_(p,h,E(w._payload),C)}if(sl(w))return x(p,h,w,C);if($a(w))return y(p,h,w,C);lu(p,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,h!==null&&h.tag===6?(r(p,h.sibling),h=s(h,w),h.return=p,p=h):(r(p,h),h=Oh(w,p.mode,C),h.return=p,p=h),i(p)):r(p,h)}return _}var fa=W_(!0),H_=W_(!1),ud=Eo(null),dd=null,zi=null,lg=null;function cg(){lg=zi=dd=null}function ug(e){var t=ud.current;St(ud),e._currentValue=t}function Ip(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function Xi(e,t){dd=e,lg=zi=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Er=!0),e.firstContext=null)}function sn(e){var t=e._currentValue;if(lg!==e)if(e={context:e,memoizedValue:t,next:null},zi===null){if(dd===null)throw Error(ie(308));zi=e,dd.dependencies={lanes:0,firstContext:e}}else zi=zi.next=e;return t}var zo=null;function dg(e){zo===null?zo=[e]:zo.push(e)}function Y_(e,t,r,n){var s=t.interleaved;return s===null?(r.next=r,dg(t)):(r.next=s.next,s.next=r),t.interleaved=r,ws(e,n)}function ws(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var Gs=!1;function fg(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function K_(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function ps(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function co(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,lt&2){var s=n.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),n.pending=t,ws(e,r)}return s=n.interleaved,s===null?(t.next=t,dg(n)):(t.next=s.next,s.next=t),n.interleaved=t,ws(e,r)}function Au(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Xm(e,r)}}function Px(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var s=null,o=null;if(r=r.firstBaseUpdate,r!==null){do{var i={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};o===null?s=o=i:o=o.next=i,r=r.next}while(r!==null);o===null?s=o=t:o=o.next=t}else s=o=t;r={baseState:n.baseState,firstBaseUpdate:s,lastBaseUpdate:o,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function fd(e,t,r,n){var s=e.updateQueue;Gs=!1;var o=s.firstBaseUpdate,i=s.lastBaseUpdate,l=s.shared.pending;if(l!==null){s.shared.pending=null;var c=l,u=c.next;c.next=null,i===null?o=u:i.next=u,i=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==i&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(o!==null){var f=s.baseState;i=0,d=u=c=null,l=o;do{var m=l.lane,v=l.eventTime;if((n&m)===m){d!==null&&(d=d.next={eventTime:v,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var x=e,y=l;switch(m=t,v=r,y.tag){case 1:if(x=y.payload,typeof x=="function"){f=x.call(v,f,m);break e}f=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=y.payload,m=typeof x=="function"?x.call(v,f,m):x,m==null)break e;f=Mt({},f,m);break e;case 2:Gs=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,m=s.effects,m===null?s.effects=[l]:m.push(l))}else v={eventTime:v,lane:m,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=v,c=f):d=d.next=v,i|=m;if(l=l.next,l===null){if(l=s.shared.pending,l===null)break;m=l,l=m.next,m.next=null,s.lastBaseUpdate=m,s.shared.pending=null}}while(!0);if(d===null&&(c=f),s.baseState=c,s.firstBaseUpdate=u,s.lastBaseUpdate=d,t=s.shared.interleaved,t!==null){s=t;do i|=s.lane,s=s.next;while(s!==t)}else o===null&&(s.shared.lanes=0);ei|=i,e.lanes=i,e.memoizedState=f}}function Ax(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var n=Th.transition;Th.transition={};try{e(!1),t()}finally{mt=r,Th.transition=n}}function u1(){return on().memoizedState}function oR(e,t,r){var n=fo(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},d1(e))f1(t,r);else if(r=Y_(e,t,r,n),r!==null){var s=xr();wn(r,e,n,s),h1(r,t,n)}}function iR(e,t,r){var n=fo(e),s={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(d1(e))f1(t,s);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var i=t.lastRenderedState,l=o(i,r);if(s.hasEagerState=!0,s.eagerState=l,bn(l,i)){var c=t.interleaved;c===null?(s.next=s,dg(t)):(s.next=c.next,c.next=s),t.interleaved=s;return}}catch{}finally{}r=Y_(e,t,s,n),r!==null&&(s=xr(),wn(r,e,n,s),h1(r,t,n))}}function d1(e){var t=e.alternate;return e===Ot||t!==null&&t===Ot}function f1(e,t){_l=pd=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function h1(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Xm(e,r)}}var md={readContext:sn,useCallback:ir,useContext:ir,useEffect:ir,useImperativeHandle:ir,useInsertionEffect:ir,useLayoutEffect:ir,useMemo:ir,useReducer:ir,useRef:ir,useState:ir,useDebugValue:ir,useDeferredValue:ir,useTransition:ir,useMutableSource:ir,useSyncExternalStore:ir,useId:ir,unstable_isNewReconciler:!1},aR={readContext:sn,useCallback:function(e,t){return Mn().memoizedState=[e,t===void 0?null:t],e},useContext:sn,useEffect:Ox,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Ou(4194308,4,o1.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Ou(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ou(4,2,e,t)},useMemo:function(e,t){var r=Mn();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=Mn();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=oR.bind(null,Ot,e),[n.memoizedState,e]},useRef:function(e){var t=Mn();return e={current:e},t.memoizedState=e},useState:Dx,useDebugValue:wg,useDeferredValue:function(e){return Mn().memoizedState=e},useTransition:function(){var e=Dx(!1),t=e[0];return e=sR.bind(null,e[1]),Mn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Ot,s=Mn();if(Tt){if(r===void 0)throw Error(ie(407));r=r()}else{if(r=t(),Qt===null)throw Error(ie(349));Jo&30||X_(n,t,r)}s.memoizedState=r;var o={value:r,getSnapshot:t};return s.queue=o,Ox(J_.bind(null,n,o,e),[e]),n.flags|=2048,Hl(9,Q_.bind(null,n,o,r,t),void 0,null),r},useId:function(){var e=Mn(),t=Qt.identifierPrefix;if(Tt){var r=ds,n=us;r=(n&~(1<<32-xn(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=Bl++,0<\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=i.createElement(r,{is:n.is}):(e=i.createElement(r),r==="select"&&(i=e,n.multiple?i.multiple=!0:n.size&&(i.size=n.size))):e=i.createElementNS(e,r),e[In]=t,e[zl]=n,S1(e,t,!1,!1),t.stateNode=e;e:{switch(i=yp(r,n),r){case"dialog":bt("cancel",e),bt("close",e),s=n;break;case"iframe":case"object":case"embed":bt("load",e),s=n;break;case"video":case"audio":for(s=0;sma&&(t.flags|=128,n=!0,Ya(o,!1),t.lanes=4194304)}else{if(!n)if(e=hd(i),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Ya(o,!0),o.tail===null&&o.tailMode==="hidden"&&!i.alternate&&!Tt)return ar(t),null}else 2*Ut()-o.renderingStartTime>ma&&r!==1073741824&&(t.flags|=128,n=!0,Ya(o,!1),t.lanes=4194304);o.isBackwards?(i.sibling=t.child,t.child=i):(r=o.last,r!==null?r.sibling=i:t.child=i,o.last=i)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Ut(),t.sibling=null,r=At.current,wt(At,n?r&1|2:r&1),t):(ar(t),null);case 22:case 23:return jg(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?Mr&1073741824&&(ar(t),t.subtreeFlags&6&&(t.flags|=8192)):ar(t),null;case 24:return null;case 25:return null}throw Error(ie(156,t.tag))}function mR(e,t){switch(ig(t),t.tag){case 1:return Tr(t.type)&&id(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ha(),St(Nr),St(ur),mg(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return pg(t),null;case 13:if(St(At),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ie(340));da()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return St(At),null;case 4:return ha(),null;case 10:return ug(t.type._context),null;case 22:case 23:return jg(),null;case 24:return null;default:return null}}var uu=!1,lr=!1,gR=typeof WeakSet=="function"?WeakSet:Set,Se=null;function Ui(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Lt(e,t,n)}else r.current=null}function Hp(e,t,r){try{r()}catch(n){Lt(e,t,n)}}var Hx=!1;function vR(e,t){if(Np=rd,e=R_(),sg(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var s=n.anchorOffset,o=n.focusNode;n=n.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break e}var i=0,a=-1,c=-1,u=0,d=0,f=e,m=null;t:for(;;){for(var v;f!==r||s!==0&&f.nodeType!==3||(a=i+s),f!==o||n!==0&&f.nodeType!==3||(c=i+n),f.nodeType===3&&(i+=f.nodeValue.length),(v=f.firstChild)!==null;)m=f,f=v;for(;;){if(f===e)break t;if(m===r&&++u===s&&(a=i),m===o&&++d===n&&(c=i),(v=f.nextSibling)!==null)break;f=m,m=f.parentNode}f=v}r=a===-1||c===-1?null:{start:a,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(Tp={focusedElem:e,selectionRange:r},rd=!1,Se=t;Se!==null;)if(t=Se,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Se=e;else for(;Se!==null;){t=Se;try{var x=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var y=x.memoizedProps,_=x.memoizedState,p=t.stateNode,h=p.getSnapshotBeforeUpdate(t.elementType===t.type?y:dn(t.type,y),_);p.__reactInternalSnapshotBeforeUpdate=h}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ie(163))}}catch(C){Lt(t,t.return,C)}if(e=t.sibling,e!==null){e.return=t.return,Se=e;break}Se=t.return}return x=Hx,Hx=!1,x}function _l(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var s=n=n.next;do{if((s.tag&e)===e){var o=s.destroy;s.destroy=void 0,o!==void 0&&Hp(t,r,o)}s=s.next}while(s!==n)}}function lf(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function Yp(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function j1(e){var t=e.alternate;t!==null&&(e.alternate=null,j1(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[In],delete t[zl],delete t[Ap],delete t[J2],delete t[eR])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function E1(e){return e.tag===5||e.tag===3||e.tag===4}function Yx(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||E1(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Kp(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=od));else if(n!==4&&(e=e.child,e!==null))for(Kp(e,t,r),e=e.sibling;e!==null;)Kp(e,t,r),e=e.sibling}function Gp(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(Gp(e,t,r),e=e.sibling;e!==null;)Gp(e,t,r),e=e.sibling}var tr=null,fn=!1;function zs(e,t,r){for(r=r.child;r!==null;)N1(e,t,r),r=r.sibling}function N1(e,t,r){if(Vn&&typeof Vn.onCommitFiberUnmount=="function")try{Vn.onCommitFiberUnmount(Jd,r)}catch{}switch(r.tag){case 5:lr||Ui(r,t);case 6:var n=tr,s=fn;tr=null,zs(e,t,r),tr=n,fn=s,tr!==null&&(fn?(e=tr,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):tr.removeChild(r.stateNode));break;case 18:tr!==null&&(fn?(e=tr,r=r.stateNode,e.nodeType===8?jh(e.parentNode,r):e.nodeType===1&&jh(e,r),Ol(e)):jh(tr,r.stateNode));break;case 4:n=tr,s=fn,tr=r.stateNode.containerInfo,fn=!0,zs(e,t,r),tr=n,fn=s;break;case 0:case 11:case 14:case 15:if(!lr&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){s=n=n.next;do{var o=s,i=o.destroy;o=o.tag,i!==void 0&&(o&2||o&4)&&Hp(r,t,i),s=s.next}while(s!==n)}zs(e,t,r);break;case 1:if(!lr&&(Ui(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){Lt(r,t,a)}zs(e,t,r);break;case 21:zs(e,t,r);break;case 22:r.mode&1?(lr=(n=lr)||r.memoizedState!==null,zs(e,t,r),lr=n):zs(e,t,r);break;default:zs(e,t,r)}}function Kx(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new gR),t.forEach(function(n){var s=jR.bind(null,e,n);r.has(n)||(r.add(n),n.then(s,s))})}}function un(e,t){var r=t.deletions;if(r!==null)for(var n=0;ns&&(s=i),n&=~o}if(n=s,n=Ut()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*xR(n/1960))-n,10e?16:e,Qs===null)var n=!1;else{if(e=Qs,Qs=null,yd=0,lt&6)throw Error(ie(331));var s=lt;for(lt|=4,Se=e.current;Se!==null;){var o=Se,i=o.child;if(Se.flags&16){var a=o.deletions;if(a!==null){for(var c=0;cUt()-kg?Ko(e,0):Sg|=r),Rr(e,t)}function I1(e,t){t===0&&(e.mode&1?(t=tu,tu<<=1,!(tu&130023424)&&(tu=4194304)):t=1);var r=gr();e=ws(e,t),e!==null&&(xc(e,t,r),Rr(e,r))}function CR(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),I1(e,r)}function jR(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,s=e.memoizedState;s!==null&&(r=s.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(ie(314))}n!==null&&n.delete(t),I1(e,r)}var L1;L1=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Nr.current)Er=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Er=!1,hR(e,t,r);Er=!!(e.flags&131072)}else Er=!1,Tt&&t.flags&1048576&&$_(t,cd,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Mu(e,t),e=t.pendingProps;var s=ua(t,ur.current);Xi(t,r),s=vg(null,t,n,e,s,r);var o=yg();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Tr(n)?(o=!0,ad(t)):o=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,fg(t),s.updater=af,t.stateNode=s,s._reactInternals=t,Fp(t,n,e,r),t=$p(null,t,n,!0,o,r)):(t.tag=0,Tt&&o&&og(t),pr(null,t,s,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Mu(e,t),e=t.pendingProps,s=n._init,n=s(n._payload),t.type=n,s=t.tag=NR(n),e=dn(n,e),s){case 0:t=Up(null,t,n,e,r);break e;case 1:t=Vx(null,t,n,e,r);break e;case 11:t=Ux(null,t,n,e,r);break e;case 14:t=$x(null,t,n,dn(n.type,e),r);break e}throw Error(ie(306,n,""))}return t;case 0:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:dn(n,s),Up(e,t,n,s,r);case 1:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:dn(n,s),Vx(e,t,n,s,r);case 3:e:{if(w1(t),e===null)throw Error(ie(387));n=t.pendingProps,o=t.memoizedState,s=o.element,K_(e,t),fd(t,n,null,r);var i=t.memoizedState;if(n=i.element,o.isDehydrated)if(o={element:n,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){s=pa(Error(ie(423)),t),t=Bx(e,t,n,r,s);break e}else if(n!==s){s=pa(Error(ie(424)),t),t=Bx(e,t,n,r,s);break e}else for(Fr=oo(t.stateNode.containerInfo.firstChild),zr=t,Tt=!0,mn=null,r=H_(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(da(),n===s){t=_s(e,t,r);break e}pr(e,t,n,r)}t=t.child}return t;case 5:return G_(t),e===null&&Mp(t),n=t.type,s=t.pendingProps,o=e!==null?e.memoizedProps:null,i=s.children,Rp(n,s)?i=null:o!==null&&Rp(n,o)&&(t.flags|=32),x1(e,t),pr(e,t,i,r),t.child;case 6:return e===null&&Mp(t),null;case 13:return _1(e,t,r);case 4:return hg(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=fa(t,null,n,r):pr(e,t,n,r),t.child;case 11:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:dn(n,s),Ux(e,t,n,s,r);case 7:return pr(e,t,t.pendingProps,r),t.child;case 8:return pr(e,t,t.pendingProps.children,r),t.child;case 12:return pr(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,s=t.pendingProps,o=t.memoizedProps,i=s.value,wt(ud,n._currentValue),n._currentValue=i,o!==null)if(bn(o.value,i)){if(o.children===s.children&&!Nr.current){t=_s(e,t,r);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var a=o.dependencies;if(a!==null){i=o.child;for(var c=a.firstContext;c!==null;){if(c.context===n){if(o.tag===1){c=ps(-1,r&-r),c.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}o.lanes|=r,c=o.alternate,c!==null&&(c.lanes|=r),Ip(o.return,r,t),a.lanes|=r;break}c=c.next}}else if(o.tag===10)i=o.type===t.type?null:o.child;else if(o.tag===18){if(i=o.return,i===null)throw Error(ie(341));i.lanes|=r,a=i.alternate,a!==null&&(a.lanes|=r),Ip(i,r,t),i=o.sibling}else i=o.child;if(i!==null)i.return=o;else for(i=o;i!==null;){if(i===t){i=null;break}if(o=i.sibling,o!==null){o.return=i.return,i=o;break}i=i.return}o=i}pr(e,t,s.children,r),t=t.child}return t;case 9:return s=t.type,n=t.pendingProps.children,Xi(t,r),s=sn(s),n=n(s),t.flags|=1,pr(e,t,n,r),t.child;case 14:return n=t.type,s=dn(n,t.pendingProps),s=dn(n.type,s),$x(e,t,n,s,r);case 15:return v1(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:dn(n,s),Mu(e,t),t.tag=1,Tr(n)?(e=!0,ad(t)):e=!1,Xi(t,r),p1(t,n,s),Fp(t,n,s,r),$p(null,t,n,!0,e,r);case 19:return b1(e,t,r);case 22:return y1(e,t,r)}throw Error(ie(156,t.tag))};function F1(e,t){return d_(e,t)}function ER(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function tn(e,t,r,n){return new ER(e,t,r,n)}function Ng(e){return e=e.prototype,!(!e||!e.isReactComponent)}function NR(e){if(typeof e=="function")return Ng(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Km)return 11;if(e===Gm)return 14}return 2}function co(e,t){var r=e.alternate;return r===null?(r=tn(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Fu(e,t,r,n,s,o){var i=2;if(n=e,typeof e=="function")Ng(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case Pi:return Go(r.children,s,o,t);case Ym:i=8,s|=8;break;case lp:return e=tn(12,r,t,s|2),e.elementType=lp,e.lanes=o,e;case cp:return e=tn(13,r,t,s),e.elementType=cp,e.lanes=o,e;case up:return e=tn(19,r,t,s),e.elementType=up,e.lanes=o,e;case Gw:return uf(r,s,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Yw:i=10;break e;case Kw:i=9;break e;case Km:i=11;break e;case Gm:i=14;break e;case Ws:i=16,n=null;break e}throw Error(ie(130,e==null?e:typeof e,""))}return t=tn(i,r,t,s),t.elementType=e,t.type=n,t.lanes=o,t}function Go(e,t,r,n){return e=tn(7,e,n,t),e.lanes=r,e}function uf(e,t,r,n){return e=tn(22,e,n,t),e.elementType=Gw,e.lanes=r,e.stateNode={isHidden:!1},e}function Oh(e,t,r){return e=tn(6,e,null,t),e.lanes=r,e}function Mh(e,t,r){return t=tn(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function TR(e,t,r,n,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=mh(0),this.expirationTimes=mh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=mh(0),this.identifierPrefix=n,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Tg(e,t,r,n,s,o,i,a,c){return e=new TR(e,t,r,a,c),t===1?(t=1,o===!0&&(t|=8)):t=0,o=tn(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},fg(o),e}function RR(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(V1)}catch(e){console.error(e)}}V1(),Vw.exports=Yr;var Ts=Vw.exports;const B1=Fm(Ts),MR=Tw({__proto__:null,default:B1},[Ts]);var t0=Ts;ip.createRoot=t0.createRoot,ip.hydrateRoot=t0.hydrateRoot;/** +`+o.stack}return{value:e,source:t,stack:s,digest:null}}function Ah(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function zp(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var uR=typeof WeakMap=="function"?WeakMap:Map;function m1(e,t,r){r=ps(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){vd||(vd=!0,Zp=n),zp(e,t)},r}function g1(e,t,r){r=ps(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var s=t.value;r.payload=function(){return n(s)},r.callback=function(){zp(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(r.callback=function(){zp(e,t),typeof n!="function"&&(uo===null?uo=new Set([this]):uo.add(this));var i=t.stack;this.componentDidCatch(t.value,{componentStack:i!==null?i:""})}),r}function Lx(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new uR;var s=new Set;n.set(t,s)}else s=n.get(t),s===void 0&&(s=new Set,n.set(t,s));s.has(r)||(s.add(r),e=kR.bind(null,e,t,r),t.then(e,e))}function Fx(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function zx(e,t,r,n,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=ps(-1,1),t.tag=2,co(r,t,1))),r.lanes|=1),e)}var dR=Ns.ReactCurrentOwner,Er=!1;function vr(e,t,r,n){t.child=e===null?H_(t,null,r,n):fa(t,e.child,r,n)}function Ux(e,t,r,n,s){r=r.render;var o=t.ref;return Xi(t,s),n=vg(e,t,r,n,o,s),r=yg(),e!==null&&!Er?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,_s(e,t,s)):(Tt&&r&&og(t),t.flags|=1,vr(e,t,n,s),t.child)}function $x(e,t,r,n,s){if(e===null){var o=r.type;return typeof o=="function"&&!Ng(o)&&o.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=o,v1(e,t,o,n,s)):(e=Fu(r.type,null,n,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&s)){var i=o.memoizedProps;if(r=r.compare,r=r!==null?r:Ll,r(i,n)&&e.ref===t.ref)return _s(e,t,s)}return t.flags|=1,e=ho(o,n),e.ref=t.ref,e.return=t,t.child=e}function v1(e,t,r,n,s){if(e!==null){var o=e.memoizedProps;if(Ll(o,n)&&e.ref===t.ref)if(Er=!1,t.pendingProps=n=o,(e.lanes&s)!==0)e.flags&131072&&(Er=!0);else return t.lanes=e.lanes,_s(e,t,s)}return Up(e,t,r,n,s)}function y1(e,t,r){var n=t.pendingProps,s=n.children,o=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},wt($i,Ir),Ir|=r;else{if(!(r&1073741824))return e=o!==null?o.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,wt($i,Ir),Ir|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=o!==null?o.baseLanes:r,wt($i,Ir),Ir|=n}else o!==null?(n=o.baseLanes|r,t.memoizedState=null):n=r,wt($i,Ir),Ir|=n;return vr(e,t,s,r),t.child}function x1(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function Up(e,t,r,n,s){var o=Tr(r)?Xo:ur.current;return o=ua(t,o),Xi(t,s),r=vg(e,t,r,n,o,s),n=yg(),e!==null&&!Er?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,_s(e,t,s)):(Tt&&n&&og(t),t.flags|=1,vr(e,t,r,s),t.child)}function Vx(e,t,r,n,s){if(Tr(r)){var o=!0;ad(t)}else o=!1;if(Xi(t,s),t.stateNode===null)Mu(e,t),p1(t,r,n),Fp(t,r,n,s),n=!0;else if(e===null){var i=t.stateNode,l=t.memoizedProps;i.props=l;var c=i.context,u=r.contextType;typeof u=="object"&&u!==null?u=sn(u):(u=Tr(r)?Xo:ur.current,u=ua(t,u));var d=r.getDerivedStateFromProps,f=typeof d=="function"||typeof i.getSnapshotBeforeUpdate=="function";f||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(l!==n||c!==u)&&Ix(t,i,n,u),Gs=!1;var m=t.memoizedState;i.state=m,fd(t,n,i,s),c=t.memoizedState,l!==n||m!==c||Nr.current||Gs?(typeof d=="function"&&(Lp(t,r,d,n),c=t.memoizedState),(l=Gs||Mx(t,r,l,n,m,c,u))?(f||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=c),i.props=n,i.state=c,i.context=u,n=l):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{i=t.stateNode,K_(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:dn(t.type,l),i.props=u,f=t.pendingProps,m=i.context,c=r.contextType,typeof c=="object"&&c!==null?c=sn(c):(c=Tr(r)?Xo:ur.current,c=ua(t,c));var v=r.getDerivedStateFromProps;(d=typeof v=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(l!==f||m!==c)&&Ix(t,i,n,c),Gs=!1,m=t.memoizedState,i.state=m,fd(t,n,i,s);var x=t.memoizedState;l!==f||m!==x||Nr.current||Gs?(typeof v=="function"&&(Lp(t,r,v,n),x=t.memoizedState),(u=Gs||Mx(t,r,u,n,m,x,c)||!1)?(d||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(n,x,c),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(n,x,c)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||l===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=x),i.props=n,i.state=x,i.context=c,n=u):(typeof i.componentDidUpdate!="function"||l===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),n=!1)}return $p(e,t,r,n,o,s)}function $p(e,t,r,n,s,o){x1(e,t);var i=(t.flags&128)!==0;if(!n&&!i)return s&&Ex(t,r,!1),_s(e,t,o);n=t.stateNode,dR.current=t;var l=i&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&i?(t.child=fa(t,e.child,null,o),t.child=fa(t,null,l,o)):vr(e,t,l,o),t.memoizedState=n.state,s&&Ex(t,r,!0),t.child}function w1(e){var t=e.stateNode;t.pendingContext?jx(e,t.pendingContext,t.pendingContext!==t.context):t.context&&jx(e,t.context,!1),hg(e,t.containerInfo)}function Bx(e,t,r,n,s){return da(),ag(s),t.flags|=256,vr(e,t,r,n),t.child}var Vp={dehydrated:null,treeContext:null,retryLane:0};function Bp(e){return{baseLanes:e,cachePool:null,transitions:null}}function _1(e,t,r){var n=t.pendingProps,s=At.current,o=!1,i=(t.flags&128)!==0,l;if((l=i)||(l=e!==null&&e.memoizedState===null?!1:(s&2)!==0),l?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),wt(At,s&1),e===null)return Mp(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(i=n.children,e=n.fallback,o?(n=t.mode,o=t.child,i={mode:"hidden",children:i},!(n&1)&&o!==null?(o.childLanes=0,o.pendingProps=i):o=uf(i,n,0,null),e=Go(e,n,r,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=Bp(r),t.memoizedState=Vp,e):_g(t,i));if(s=e.memoizedState,s!==null&&(l=s.dehydrated,l!==null))return fR(e,t,i,n,l,s,r);if(o){o=n.fallback,i=t.mode,s=e.child,l=s.sibling;var c={mode:"hidden",children:n.children};return!(i&1)&&t.child!==s?(n=t.child,n.childLanes=0,n.pendingProps=c,t.deletions=null):(n=ho(s,c),n.subtreeFlags=s.subtreeFlags&14680064),l!==null?o=ho(l,o):(o=Go(o,i,r,null),o.flags|=2),o.return=t,n.return=t,n.sibling=o,t.child=n,n=o,o=t.child,i=e.child.memoizedState,i=i===null?Bp(r):{baseLanes:i.baseLanes|r,cachePool:null,transitions:i.transitions},o.memoizedState=i,o.childLanes=e.childLanes&~r,t.memoizedState=Vp,n}return o=e.child,e=o.sibling,n=ho(o,{mode:"visible",children:n.children}),!(t.mode&1)&&(n.lanes=r),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n}function _g(e,t){return t=uf({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function cu(e,t,r,n){return n!==null&&ag(n),fa(t,e.child,null,r),e=_g(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function fR(e,t,r,n,s,o,i){if(r)return t.flags&256?(t.flags&=-257,n=Ah(Error(ie(422))),cu(e,t,i,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=n.fallback,s=t.mode,n=uf({mode:"visible",children:n.children},s,0,null),o=Go(o,s,i,null),o.flags|=2,n.return=t,o.return=t,n.sibling=o,t.child=n,t.mode&1&&fa(t,e.child,null,i),t.child.memoizedState=Bp(i),t.memoizedState=Vp,o);if(!(t.mode&1))return cu(e,t,i,null);if(s.data==="$!"){if(n=s.nextSibling&&s.nextSibling.dataset,n)var l=n.dgst;return n=l,o=Error(ie(419)),n=Ah(o,n,void 0),cu(e,t,i,n)}if(l=(i&e.childLanes)!==0,Er||l){if(n=Qt,n!==null){switch(i&-i){case 4:s=2;break;case 16:s=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(n.suspendedLanes|i)?0:s,s!==0&&s!==o.retryLane&&(o.retryLane=s,ws(e,s),wn(n,e,s,-1))}return Eg(),n=Ah(Error(ie(421))),cu(e,t,i,n)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=CR.bind(null,e),s._reactRetry=t,null):(e=o.treeContext,zr=lo(s.nextSibling),Ur=t,Tt=!0,mn=null,e!==null&&(Qr[Jr++]=us,Qr[Jr++]=ds,Qr[Jr++]=Qo,us=e.id,ds=e.overflow,Qo=t),t=_g(t,n.children),t.flags|=4096,t)}function Wx(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),Ip(e.return,t,r)}function Dh(e,t,r,n,s){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:s}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=n,o.tail=r,o.tailMode=s)}function b1(e,t,r){var n=t.pendingProps,s=n.revealOrder,o=n.tail;if(vr(e,t,n.children,r),n=At.current,n&2)n=n&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Wx(e,r,t);else if(e.tag===19)Wx(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(wt(At,n),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(r=t.child,s=null;r!==null;)e=r.alternate,e!==null&&hd(e)===null&&(s=r),r=r.sibling;r=s,r===null?(s=t.child,t.child=null):(s=r.sibling,r.sibling=null),Dh(t,!1,s,r,o);break;case"backwards":for(r=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&hd(e)===null){t.child=s;break}e=s.sibling,s.sibling=r,r=s,s=e}Dh(t,!0,r,null,o);break;case"together":Dh(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Mu(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function _s(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),ei|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(ie(153));if(t.child!==null){for(e=t.child,r=ho(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=ho(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function hR(e,t,r){switch(t.tag){case 3:w1(t),da();break;case 5:G_(t);break;case 1:Tr(t.type)&&ad(t);break;case 4:hg(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,s=t.memoizedProps.value;wt(ud,n._currentValue),n._currentValue=s;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(wt(At,At.current&1),t.flags|=128,null):r&t.child.childLanes?_1(e,t,r):(wt(At,At.current&1),e=_s(e,t,r),e!==null?e.sibling:null);wt(At,At.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return b1(e,t,r);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),wt(At,At.current),n)break;return null;case 22:case 23:return t.lanes=0,y1(e,t,r)}return _s(e,t,r)}var S1,Wp,k1,C1;S1=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};Wp=function(){};k1=function(e,t,r,n){var s=e.memoizedProps;if(s!==n){e=t.stateNode,Uo(Bn.current);var o=null;switch(r){case"input":s=fp(e,s),n=fp(e,n),o=[];break;case"select":s=Mt({},s,{value:void 0}),n=Mt({},n,{value:void 0}),o=[];break;case"textarea":s=mp(e,s),n=mp(e,n),o=[];break;default:typeof s.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=od)}vp(r,n);var i;r=null;for(u in s)if(!n.hasOwnProperty(u)&&s.hasOwnProperty(u)&&s[u]!=null)if(u==="style"){var l=s[u];for(i in l)l.hasOwnProperty(i)&&(r||(r={}),r[i]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Rl.hasOwnProperty(u)?o||(o=[]):(o=o||[]).push(u,null));for(u in n){var c=n[u];if(l=s!=null?s[u]:void 0,n.hasOwnProperty(u)&&c!==l&&(c!=null||l!=null))if(u==="style")if(l){for(i in l)!l.hasOwnProperty(i)||c&&c.hasOwnProperty(i)||(r||(r={}),r[i]="");for(i in c)c.hasOwnProperty(i)&&l[i]!==c[i]&&(r||(r={}),r[i]=c[i])}else r||(o||(o=[]),o.push(u,r)),r=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(o=o||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(o=o||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Rl.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&bt("scroll",e),o||l===c||(o=[])):(o=o||[]).push(u,c))}r&&(o=o||[]).push("style",r);var u=o;(t.updateQueue=u)&&(t.flags|=4)}};C1=function(e,t,r,n){r!==n&&(t.flags|=4)};function Ka(e,t){if(!Tt)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function ar(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var s=e.child;s!==null;)r|=s.lanes|s.childLanes,n|=s.subtreeFlags&14680064,n|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)r|=s.lanes|s.childLanes,n|=s.subtreeFlags,n|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function pR(e,t,r){var n=t.pendingProps;switch(ig(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ar(t),null;case 1:return Tr(t.type)&&id(),ar(t),null;case 3:return n=t.stateNode,ha(),St(Nr),St(ur),mg(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(au(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,mn!==null&&(Qp(mn),mn=null))),Wp(e,t),ar(t),null;case 5:pg(t);var s=Uo(Vl.current);if(r=t.type,e!==null&&t.stateNode!=null)k1(e,t,r,n,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(ie(166));return ar(t),null}if(e=Uo(Bn.current),au(t)){n=t.stateNode,r=t.type;var o=t.memoizedProps;switch(n[In]=t,n[Ul]=o,e=(t.mode&1)!==0,r){case"dialog":bt("cancel",n),bt("close",n);break;case"iframe":case"object":case"embed":bt("load",n);break;case"video":case"audio":for(s=0;s<\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=i.createElement(r,{is:n.is}):(e=i.createElement(r),r==="select"&&(i=e,n.multiple?i.multiple=!0:n.size&&(i.size=n.size))):e=i.createElementNS(e,r),e[In]=t,e[Ul]=n,S1(e,t,!1,!1),t.stateNode=e;e:{switch(i=yp(r,n),r){case"dialog":bt("cancel",e),bt("close",e),s=n;break;case"iframe":case"object":case"embed":bt("load",e),s=n;break;case"video":case"audio":for(s=0;sma&&(t.flags|=128,n=!0,Ka(o,!1),t.lanes=4194304)}else{if(!n)if(e=hd(i),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Ka(o,!0),o.tail===null&&o.tailMode==="hidden"&&!i.alternate&&!Tt)return ar(t),null}else 2*Ut()-o.renderingStartTime>ma&&r!==1073741824&&(t.flags|=128,n=!0,Ka(o,!1),t.lanes=4194304);o.isBackwards?(i.sibling=t.child,t.child=i):(r=o.last,r!==null?r.sibling=i:t.child=i,o.last=i)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Ut(),t.sibling=null,r=At.current,wt(At,n?r&1|2:r&1),t):(ar(t),null);case 22:case 23:return jg(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?Ir&1073741824&&(ar(t),t.subtreeFlags&6&&(t.flags|=8192)):ar(t),null;case 24:return null;case 25:return null}throw Error(ie(156,t.tag))}function mR(e,t){switch(ig(t),t.tag){case 1:return Tr(t.type)&&id(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ha(),St(Nr),St(ur),mg(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return pg(t),null;case 13:if(St(At),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ie(340));da()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return St(At),null;case 4:return ha(),null;case 10:return ug(t.type._context),null;case 22:case 23:return jg(),null;case 24:return null;default:return null}}var uu=!1,lr=!1,gR=typeof WeakSet=="function"?WeakSet:Set,Ee=null;function Ui(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Lt(e,t,n)}else r.current=null}function Hp(e,t,r){try{r()}catch(n){Lt(e,t,n)}}var Hx=!1;function vR(e,t){if(Np=rd,e=R_(),sg(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var s=n.anchorOffset,o=n.focusNode;n=n.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break e}var i=0,l=-1,c=-1,u=0,d=0,f=e,m=null;t:for(;;){for(var v;f!==r||s!==0&&f.nodeType!==3||(l=i+s),f!==o||n!==0&&f.nodeType!==3||(c=i+n),f.nodeType===3&&(i+=f.nodeValue.length),(v=f.firstChild)!==null;)m=f,f=v;for(;;){if(f===e)break t;if(m===r&&++u===s&&(l=i),m===o&&++d===n&&(c=i),(v=f.nextSibling)!==null)break;f=m,m=f.parentNode}f=v}r=l===-1||c===-1?null:{start:l,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(Tp={focusedElem:e,selectionRange:r},rd=!1,Ee=t;Ee!==null;)if(t=Ee,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ee=e;else for(;Ee!==null;){t=Ee;try{var x=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var y=x.memoizedProps,_=x.memoizedState,p=t.stateNode,h=p.getSnapshotBeforeUpdate(t.elementType===t.type?y:dn(t.type,y),_);p.__reactInternalSnapshotBeforeUpdate=h}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ie(163))}}catch(C){Lt(t,t.return,C)}if(e=t.sibling,e!==null){e.return=t.return,Ee=e;break}Ee=t.return}return x=Hx,Hx=!1,x}function bl(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var s=n=n.next;do{if((s.tag&e)===e){var o=s.destroy;s.destroy=void 0,o!==void 0&&Hp(t,r,o)}s=s.next}while(s!==n)}}function lf(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function Yp(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function j1(e){var t=e.alternate;t!==null&&(e.alternate=null,j1(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[In],delete t[Ul],delete t[Ap],delete t[J2],delete t[eR])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function E1(e){return e.tag===5||e.tag===3||e.tag===4}function Yx(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||E1(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Kp(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=od));else if(n!==4&&(e=e.child,e!==null))for(Kp(e,t,r),e=e.sibling;e!==null;)Kp(e,t,r),e=e.sibling}function Gp(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(Gp(e,t,r),e=e.sibling;e!==null;)Gp(e,t,r),e=e.sibling}var tr=null,fn=!1;function Vs(e,t,r){for(r=r.child;r!==null;)N1(e,t,r),r=r.sibling}function N1(e,t,r){if(Vn&&typeof Vn.onCommitFiberUnmount=="function")try{Vn.onCommitFiberUnmount(Jd,r)}catch{}switch(r.tag){case 5:lr||Ui(r,t);case 6:var n=tr,s=fn;tr=null,Vs(e,t,r),tr=n,fn=s,tr!==null&&(fn?(e=tr,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):tr.removeChild(r.stateNode));break;case 18:tr!==null&&(fn?(e=tr,r=r.stateNode,e.nodeType===8?jh(e.parentNode,r):e.nodeType===1&&jh(e,r),Ml(e)):jh(tr,r.stateNode));break;case 4:n=tr,s=fn,tr=r.stateNode.containerInfo,fn=!0,Vs(e,t,r),tr=n,fn=s;break;case 0:case 11:case 14:case 15:if(!lr&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){s=n=n.next;do{var o=s,i=o.destroy;o=o.tag,i!==void 0&&(o&2||o&4)&&Hp(r,t,i),s=s.next}while(s!==n)}Vs(e,t,r);break;case 1:if(!lr&&(Ui(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(l){Lt(r,t,l)}Vs(e,t,r);break;case 21:Vs(e,t,r);break;case 22:r.mode&1?(lr=(n=lr)||r.memoizedState!==null,Vs(e,t,r),lr=n):Vs(e,t,r);break;default:Vs(e,t,r)}}function Kx(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new gR),t.forEach(function(n){var s=jR.bind(null,e,n);r.has(n)||(r.add(n),n.then(s,s))})}}function un(e,t){var r=t.deletions;if(r!==null)for(var n=0;ns&&(s=i),n&=~o}if(n=s,n=Ut()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*xR(n/1960))-n,10e?16:e,to===null)var n=!1;else{if(e=to,to=null,yd=0,lt&6)throw Error(ie(331));var s=lt;for(lt|=4,Ee=e.current;Ee!==null;){var o=Ee,i=o.child;if(Ee.flags&16){var l=o.deletions;if(l!==null){for(var c=0;cUt()-kg?Ko(e,0):Sg|=r),Rr(e,t)}function I1(e,t){t===0&&(e.mode&1?(t=tu,tu<<=1,!(tu&130023424)&&(tu=4194304)):t=1);var r=xr();e=ws(e,t),e!==null&&(xc(e,t,r),Rr(e,r))}function CR(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),I1(e,r)}function jR(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,s=e.memoizedState;s!==null&&(r=s.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(ie(314))}n!==null&&n.delete(t),I1(e,r)}var L1;L1=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Nr.current)Er=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Er=!1,hR(e,t,r);Er=!!(e.flags&131072)}else Er=!1,Tt&&t.flags&1048576&&$_(t,cd,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Mu(e,t),e=t.pendingProps;var s=ua(t,ur.current);Xi(t,r),s=vg(null,t,n,e,s,r);var o=yg();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Tr(n)?(o=!0,ad(t)):o=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,fg(t),s.updater=af,t.stateNode=s,s._reactInternals=t,Fp(t,n,e,r),t=$p(null,t,n,!0,o,r)):(t.tag=0,Tt&&o&&og(t),vr(null,t,s,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Mu(e,t),e=t.pendingProps,s=n._init,n=s(n._payload),t.type=n,s=t.tag=NR(n),e=dn(n,e),s){case 0:t=Up(null,t,n,e,r);break e;case 1:t=Vx(null,t,n,e,r);break e;case 11:t=Ux(null,t,n,e,r);break e;case 14:t=$x(null,t,n,dn(n.type,e),r);break e}throw Error(ie(306,n,""))}return t;case 0:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:dn(n,s),Up(e,t,n,s,r);case 1:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:dn(n,s),Vx(e,t,n,s,r);case 3:e:{if(w1(t),e===null)throw Error(ie(387));n=t.pendingProps,o=t.memoizedState,s=o.element,K_(e,t),fd(t,n,null,r);var i=t.memoizedState;if(n=i.element,o.isDehydrated)if(o={element:n,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){s=pa(Error(ie(423)),t),t=Bx(e,t,n,r,s);break e}else if(n!==s){s=pa(Error(ie(424)),t),t=Bx(e,t,n,r,s);break e}else for(zr=lo(t.stateNode.containerInfo.firstChild),Ur=t,Tt=!0,mn=null,r=H_(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(da(),n===s){t=_s(e,t,r);break e}vr(e,t,n,r)}t=t.child}return t;case 5:return G_(t),e===null&&Mp(t),n=t.type,s=t.pendingProps,o=e!==null?e.memoizedProps:null,i=s.children,Rp(n,s)?i=null:o!==null&&Rp(n,o)&&(t.flags|=32),x1(e,t),vr(e,t,i,r),t.child;case 6:return e===null&&Mp(t),null;case 13:return _1(e,t,r);case 4:return hg(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=fa(t,null,n,r):vr(e,t,n,r),t.child;case 11:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:dn(n,s),Ux(e,t,n,s,r);case 7:return vr(e,t,t.pendingProps,r),t.child;case 8:return vr(e,t,t.pendingProps.children,r),t.child;case 12:return vr(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,s=t.pendingProps,o=t.memoizedProps,i=s.value,wt(ud,n._currentValue),n._currentValue=i,o!==null)if(bn(o.value,i)){if(o.children===s.children&&!Nr.current){t=_s(e,t,r);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var l=o.dependencies;if(l!==null){i=o.child;for(var c=l.firstContext;c!==null;){if(c.context===n){if(o.tag===1){c=ps(-1,r&-r),c.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}o.lanes|=r,c=o.alternate,c!==null&&(c.lanes|=r),Ip(o.return,r,t),l.lanes|=r;break}c=c.next}}else if(o.tag===10)i=o.type===t.type?null:o.child;else if(o.tag===18){if(i=o.return,i===null)throw Error(ie(341));i.lanes|=r,l=i.alternate,l!==null&&(l.lanes|=r),Ip(i,r,t),i=o.sibling}else i=o.child;if(i!==null)i.return=o;else for(i=o;i!==null;){if(i===t){i=null;break}if(o=i.sibling,o!==null){o.return=i.return,i=o;break}i=i.return}o=i}vr(e,t,s.children,r),t=t.child}return t;case 9:return s=t.type,n=t.pendingProps.children,Xi(t,r),s=sn(s),n=n(s),t.flags|=1,vr(e,t,n,r),t.child;case 14:return n=t.type,s=dn(n,t.pendingProps),s=dn(n.type,s),$x(e,t,n,s,r);case 15:return v1(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:dn(n,s),Mu(e,t),t.tag=1,Tr(n)?(e=!0,ad(t)):e=!1,Xi(t,r),p1(t,n,s),Fp(t,n,s,r),$p(null,t,n,!0,e,r);case 19:return b1(e,t,r);case 22:return y1(e,t,r)}throw Error(ie(156,t.tag))};function F1(e,t){return d_(e,t)}function ER(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function tn(e,t,r,n){return new ER(e,t,r,n)}function Ng(e){return e=e.prototype,!(!e||!e.isReactComponent)}function NR(e){if(typeof e=="function")return Ng(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Km)return 11;if(e===Gm)return 14}return 2}function ho(e,t){var r=e.alternate;return r===null?(r=tn(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Fu(e,t,r,n,s,o){var i=2;if(n=e,typeof e=="function")Ng(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case Pi:return Go(r.children,s,o,t);case Ym:i=8,s|=8;break;case lp:return e=tn(12,r,t,s|2),e.elementType=lp,e.lanes=o,e;case cp:return e=tn(13,r,t,s),e.elementType=cp,e.lanes=o,e;case up:return e=tn(19,r,t,s),e.elementType=up,e.lanes=o,e;case Gw:return uf(r,s,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Yw:i=10;break e;case Kw:i=9;break e;case Km:i=11;break e;case Gm:i=14;break e;case Ks:i=16,n=null;break e}throw Error(ie(130,e==null?e:typeof e,""))}return t=tn(i,r,t,s),t.elementType=e,t.type=n,t.lanes=o,t}function Go(e,t,r,n){return e=tn(7,e,n,t),e.lanes=r,e}function uf(e,t,r,n){return e=tn(22,e,n,t),e.elementType=Gw,e.lanes=r,e.stateNode={isHidden:!1},e}function Oh(e,t,r){return e=tn(6,e,null,t),e.lanes=r,e}function Mh(e,t,r){return t=tn(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function TR(e,t,r,n,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=mh(0),this.expirationTimes=mh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=mh(0),this.identifierPrefix=n,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Tg(e,t,r,n,s,o,i,l,c){return e=new TR(e,t,r,l,c),t===1?(t=1,o===!0&&(t|=8)):t=0,o=tn(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},fg(o),e}function RR(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(V1)}catch(e){console.error(e)}}V1(),Vw.exports=Kr;var Ts=Vw.exports;const B1=Fm(Ts),MR=Tw({__proto__:null,default:B1},[Ts]);var t0=Ts;ip.createRoot=t0.createRoot,ip.hydrateRoot=t0.hydrateRoot;/** * @remix-run/router v1.18.0 * * Copyright (c) Remix Software Inc. @@ -46,9 +46,9 @@ Error generating stack: `+o.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function Pt(){return Pt=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function ri(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function LR(){return Math.random().toString(36).substr(2,8)}function n0(e,t){return{usr:e.state,key:e.key,idx:t}}function Yl(e,t,r,n){return r===void 0&&(r=null),Pt({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Rs(t):t,{state:r,key:t&&t.key||n||LR()})}function ni(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function Rs(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function FR(e,t,r,n){n===void 0&&(n={});let{window:s=document.defaultView,v5Compat:o=!1}=n,i=s.history,a=Vt.Pop,c=null,u=d();u==null&&(u=0,i.replaceState(Pt({},i.state,{idx:u}),""));function d(){return(i.state||{idx:null}).idx}function f(){a=Vt.Pop;let _=d(),p=_==null?null:_-u;u=_,c&&c({action:a,location:y.location,delta:p})}function m(_,p){a=Vt.Push;let h=Yl(y.location,_,p);r&&r(h,_),u=d()+1;let w=n0(h,u),C=y.createHref(h);try{i.pushState(w,"",C)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;s.location.assign(C)}o&&c&&c({action:a,location:y.location,delta:1})}function v(_,p){a=Vt.Replace;let h=Yl(y.location,_,p);r&&r(h,_),u=d();let w=n0(h,u),C=y.createHref(h);i.replaceState(w,"",C),o&&c&&c({action:a,location:y.location,delta:0})}function x(_){let p=s.location.origin!=="null"?s.location.origin:s.location.href,h=typeof _=="string"?_:ni(_);return h=h.replace(/ $/,"%20"),et(p,"No window.location.(origin|href) available to create URL for href: "+h),new URL(h,p)}let y={get action(){return a},get location(){return e(s,i)},listen(_){if(c)throw new Error("A history only accepts one active listener");return s.addEventListener(r0,f),c=_,()=>{s.removeEventListener(r0,f),c=null}},createHref(_){return t(s,_)},createURL:x,encodeLocation(_){let p=x(_);return{pathname:p.pathname,search:p.search,hash:p.hash}},push:m,replace:v,go(_){return i.go(_)}};return y}var xt;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(xt||(xt={}));const zR=new Set(["lazy","caseSensitive","path","id","index","children"]);function UR(e){return e.index===!0}function Kl(e,t,r,n){return r===void 0&&(r=[]),n===void 0&&(n={}),e.map((s,o)=>{let i=[...r,String(o)],a=typeof s.id=="string"?s.id:i.join("-");if(et(s.index!==!0||!s.children,"Cannot specify children on an index route"),et(!n[a],'Found a route id collision on id "'+a+`". Route id's must be globally unique within Data Router usages`),UR(s)){let c=Pt({},s,t(s),{id:a});return n[a]=c,c}else{let c=Pt({},s,t(s),{id:a,children:void 0});return n[a]=c,s.children&&(c.children=Kl(s.children,t,i,n)),c}})}function Mo(e,t,r){return r===void 0&&(r="/"),zu(e,t,r,!1)}function zu(e,t,r,n){let s=typeof t=="string"?Rs(t):t,o=ja(s.pathname||"/",r);if(o==null)return null;let i=W1(e);VR(i);let a=null;for(let c=0;a==null&&c{let c={relativePath:a===void 0?o.path||"":a,caseSensitive:o.caseSensitive===!0,childrenIndex:i,route:o};c.relativePath.startsWith("/")&&(et(c.relativePath.startsWith(n),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(n.length));let u=ms([n,c.relativePath]),d=r.concat(c);o.children&&o.children.length>0&&(et(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),W1(o.children,t,d,u)),!(o.path==null&&!o.index)&&t.push({path:u,score:ZR(u,o.index),routesMeta:d})};return e.forEach((o,i)=>{var a;if(o.path===""||!((a=o.path)!=null&&a.includes("?")))s(o,i);else for(let c of H1(o.path))s(o,i,c)}),t}function H1(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,s=r.endsWith("?"),o=r.replace(/\?$/,"");if(n.length===0)return s?[o,""]:[o];let i=H1(n.join("/")),a=[];return a.push(...i.map(c=>c===""?o:[o,c].join("/"))),s&&a.push(...i),a.map(c=>e.startsWith("/")&&c===""?"/":c)}function VR(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:qR(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const BR=/^:[\w-]+$/,WR=3,HR=2,YR=1,KR=10,GR=-2,s0=e=>e==="*";function ZR(e,t){let r=e.split("/"),n=r.length;return r.some(s0)&&(n+=GR),t&&(n+=HR),r.filter(s=>!s0(s)).reduce((s,o)=>s+(BR.test(o)?WR:o===""?YR:KR),n)}function qR(e,t){return e.length===t.length&&e.slice(0,-1).every((n,s)=>n===t[s])?e[e.length-1]-t[t.length-1]:0}function XR(e,t,r){r===void 0&&(r=!1);let{routesMeta:n}=e,s={},o="/",i=[];for(let a=0;a{let{paramName:m,isOptional:v}=d;if(m==="*"){let y=a[f]||"";i=o.slice(0,o.length-y.length).replace(/(.)\/+$/,"$1")}const x=a[f];return v&&!x?u[m]=void 0:u[m]=(x||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:i,pattern:e}}function QR(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),ri(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let n=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,a,c)=>(n.push({paramName:a,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),n]}function JR(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ri(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function ja(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}function eP(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:s=""}=typeof e=="string"?Rs(e):e;return{pathname:r?r.startsWith("/")?r:tP(r,t):t,search:nP(n),hash:sP(s)}}function tP(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?r.length>1&&r.pop():s!=="."&&r.push(s)}),r.length>1?r.join("/"):"/"}function Ih(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function Y1(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function mf(e,t){let r=Y1(e);return t?r.map((n,s)=>s===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function gf(e,t,r,n){n===void 0&&(n=!1);let s;typeof e=="string"?s=Rs(e):(s=Pt({},e),et(!s.pathname||!s.pathname.includes("?"),Ih("?","pathname","search",s)),et(!s.pathname||!s.pathname.includes("#"),Ih("#","pathname","hash",s)),et(!s.search||!s.search.includes("#"),Ih("#","search","hash",s)));let o=e===""||s.pathname==="",i=o?"/":s.pathname,a;if(i==null)a=r;else{let f=t.length-1;if(!n&&i.startsWith("..")){let m=i.split("/");for(;m[0]==="..";)m.shift(),f-=1;s.pathname=m.join("/")}a=f>=0?t[f]:"/"}let c=eP(s,a),u=i&&i!=="/"&&i.endsWith("/"),d=(o||i===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const ms=e=>e.join("/").replace(/\/\/+/g,"/"),rP=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),nP=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,sP=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class Dg{constructor(t,r,n,s){s===void 0&&(s=!1),this.status=t,this.statusText=r||"",this.internal=s,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}}function vf(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const K1=["post","put","patch","delete"],oP=new Set(K1),iP=["get",...K1],aP=new Set(iP),lP=new Set([301,302,303,307,308]),cP=new Set([307,308]),Lh={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},uP={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ga={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Og=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,dP=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),G1="remix-router-transitions";function fP(e){const t=e.window?e.window:typeof window<"u"?window:void 0,r=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",n=!r;et(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let s;if(e.mapRouteProperties)s=e.mapRouteProperties;else if(e.detectErrorBoundary){let U=e.detectErrorBoundary;s=W=>({hasErrorBoundary:U(W)})}else s=dP;let o={},i=Kl(e.routes,s,void 0,o),a,c=e.basename||"/",u=e.unstable_dataStrategy||vP,d=e.unstable_patchRoutesOnMiss,f=Pt({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),m=null,v=new Set,x=null,y=null,_=null,p=e.hydrationData!=null,h=Mo(i,e.history.location,c),w=null;if(h==null&&!d){let U=fr(404,{pathname:e.history.location.pathname}),{matches:W,route:Z}=m0(i);h=W,w={[Z.id]:U}}h&&d&&!e.hydrationData&&ch(h,i,e.history.location.pathname).active&&(h=null);let C;if(!h)C=!1,h=[];else if(h.some(U=>U.route.lazy))C=!1;else if(!h.some(U=>U.route.loader))C=!0;else if(f.v7_partialHydration){let U=e.hydrationData?e.hydrationData.loaderData:null,W=e.hydrationData?e.hydrationData.errors:null,Z=re=>re.route.loader?typeof re.route.loader=="function"&&re.route.loader.hydrate===!0?!1:U&&U[re.route.id]!==void 0||W&&W[re.route.id]!==void 0:!0;if(W){let re=h.findIndex(xe=>W[xe.route.id]!==void 0);C=h.slice(0,re+1).every(Z)}else C=h.every(Z)}else C=e.hydrationData!=null;let j,E={historyAction:e.history.action,location:e.history.location,matches:h,initialized:C,navigation:Lh,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||w,fetchers:new Map,blockers:new Map},R=Vt.Pop,P=!1,A,L=!1,q=new Map,N=null,F=!1,b=!1,V=[],te=[],B=new Map,K=0,I=-1,Q=new Map,z=new Set,$=new Map,he=new Map,ne=new Set,se=new Map,Oe=new Map,pe=new Map,ye=!1;function Ne(){if(m=e.history.listen(U=>{let{action:W,location:Z,delta:re}=U;if(ye){ye=!1;return}ri(Oe.size===0||re!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let xe=Wc({currentLocation:E.location,nextLocation:Z,historyAction:W});if(xe&&re!=null){ye=!0,e.history.go(re*-1),gi(xe,{state:"blocked",location:Z,proceed(){gi(xe,{state:"proceeding",proceed:void 0,reset:void 0,location:Z}),e.history.go(re)},reset(){let Ae=new Map(E.blockers);Ae.set(xe,Ga),Pe({blockers:Ae})}});return}return G(W,Z)}),r){RP(t,q);let U=()=>PP(t,q);t.addEventListener("pagehide",U),N=()=>t.removeEventListener("pagehide",U)}return E.initialized||G(Vt.Pop,E.location,{initialHydration:!0}),j}function Fe(){m&&m(),N&&N(),v.clear(),A&&A.abort(),E.fetchers.forEach((U,W)=>Ht(W)),E.blockers.forEach((U,W)=>Bc(W))}function Me(U){return v.add(U),()=>v.delete(U)}function Pe(U,W){W===void 0&&(W={}),E=Pt({},E,U);let Z=[],re=[];f.v7_fetcherPersist&&E.fetchers.forEach((xe,Ae)=>{xe.state==="idle"&&(ne.has(Ae)?re.push(Ae):Z.push(Ae))}),[...v].forEach(xe=>xe(E,{deletedFetchers:re,unstable_viewTransitionOpts:W.viewTransitionOpts,unstable_flushSync:W.flushSync===!0})),f.v7_fetcherPersist&&(Z.forEach(xe=>E.fetchers.delete(xe)),re.forEach(xe=>Ht(xe)))}function nt(U,W,Z){var re,xe;let{flushSync:Ae}=Z===void 0?{}:Z,Ve=E.actionData!=null&&E.navigation.formMethod!=null&&hn(E.navigation.formMethod)&&E.navigation.state==="loading"&&((re=U.state)==null?void 0:re._isRedirect)!==!0,fe;W.actionData?Object.keys(W.actionData).length>0?fe=W.actionData:fe=null:Ve?fe=E.actionData:fe=null;let Ze=W.loaderData?h0(E.loaderData,W.loaderData,W.matches||[],W.errors):E.loaderData,Le=E.blockers;Le.size>0&&(Le=new Map(Le),Le.forEach((pt,yt)=>Le.set(yt,Ga)));let ze=P===!0||E.navigation.formMethod!=null&&hn(E.navigation.formMethod)&&((xe=U.state)==null?void 0:xe._isRedirect)!==!0;a&&(i=a,a=void 0),F||R===Vt.Pop||(R===Vt.Push?e.history.push(U,U.state):R===Vt.Replace&&e.history.replace(U,U.state));let gt;if(R===Vt.Pop){let pt=q.get(E.location.pathname);pt&&pt.has(U.pathname)?gt={currentLocation:E.location,nextLocation:U}:q.has(U.pathname)&&(gt={currentLocation:U,nextLocation:E.location})}else if(L){let pt=q.get(E.location.pathname);pt?pt.add(U.pathname):(pt=new Set([U.pathname]),q.set(E.location.pathname,pt)),gt={currentLocation:E.location,nextLocation:U}}Pe(Pt({},W,{actionData:fe,loaderData:Ze,historyAction:R,location:U,initialized:!0,navigation:Lh,revalidation:"idle",restoreScrollPosition:Hy(U,W.matches||E.matches),preventScrollReset:ze,blockers:Le}),{viewTransitionOpts:gt,flushSync:Ae===!0}),R=Vt.Pop,P=!1,L=!1,F=!1,b=!1,V=[],te=[]}async function k(U,W){if(typeof U=="number"){e.history.go(U);return}let Z=Jp(E.location,E.matches,c,f.v7_prependBasename,U,f.v7_relativeSplatPath,W==null?void 0:W.fromRouteId,W==null?void 0:W.relative),{path:re,submission:xe,error:Ae}=i0(f.v7_normalizeFormMethod,!1,Z,W),Ve=E.location,fe=Yl(E.location,re,W&&W.state);fe=Pt({},fe,e.history.encodeLocation(fe));let Ze=W&&W.replace!=null?W.replace:void 0,Le=Vt.Push;Ze===!0?Le=Vt.Replace:Ze===!1||xe!=null&&hn(xe.formMethod)&&xe.formAction===E.location.pathname+E.location.search&&(Le=Vt.Replace);let ze=W&&"preventScrollReset"in W?W.preventScrollReset===!0:void 0,gt=(W&&W.unstable_flushSync)===!0,pt=Wc({currentLocation:Ve,nextLocation:fe,historyAction:Le});if(pt){gi(pt,{state:"blocked",location:fe,proceed(){gi(pt,{state:"proceeding",proceed:void 0,reset:void 0,location:fe}),k(U,W)},reset(){let yt=new Map(E.blockers);yt.set(pt,Ga),Pe({blockers:yt})}});return}return await G(Le,fe,{submission:xe,pendingError:Ae,preventScrollReset:ze,replace:W&&W.replace,enableViewTransition:W&&W.unstable_viewTransition,flushSync:gt})}function J(){if(Ye(),Pe({revalidation:"loading"}),E.navigation.state!=="submitting"){if(E.navigation.state==="idle"){G(E.historyAction,E.location,{startUninterruptedRevalidation:!0});return}G(R||E.historyAction,E.navigation.location,{overrideNavigation:E.navigation})}}async function G(U,W,Z){A&&A.abort(),A=null,R=U,F=(Z&&Z.startUninterruptedRevalidation)===!0,oT(E.location,E.matches),P=(Z&&Z.preventScrollReset)===!0,L=(Z&&Z.enableViewTransition)===!0;let re=a||i,xe=Z&&Z.overrideNavigation,Ae=Mo(re,W,c),Ve=(Z&&Z.flushSync)===!0,fe=ch(Ae,re,W.pathname);if(fe.active&&fe.matches&&(Ae=fe.matches),!Ae){let{error:dt,notFoundMatches:er,route:$t}=vi(W.pathname);nt(W,{matches:er,loaderData:{},errors:{[$t.id]:dt}},{flushSync:Ve});return}if(E.initialized&&!b&&SP(E.location,W)&&!(Z&&Z.submission&&hn(Z.submission.formMethod))){nt(W,{matches:Ae},{flushSync:Ve});return}A=new AbortController;let Ze=bi(e.history,W,A.signal,Z&&Z.submission),Le;if(Z&&Z.pendingError)Le=[Vi(Ae).route.id,{type:xt.error,error:Z.pendingError}];else if(Z&&Z.submission&&hn(Z.submission.formMethod)){let dt=await D(Ze,W,Z.submission,Ae,fe.active,{replace:Z.replace,flushSync:Ve});if(dt.shortCircuited)return;if(dt.pendingActionResult){let[er,$t]=dt.pendingActionResult;if(Ir($t)&&vf($t.error)&&$t.error.status===404){A=null,nt(W,{matches:dt.matches,loaderData:{},errors:{[er]:$t.error}});return}}Ae=dt.matches||Ae,Le=dt.pendingActionResult,xe=Fh(W,Z.submission),Ve=!1,fe.active=!1,Ze=bi(e.history,Ze.url,Ze.signal)}let{shortCircuited:ze,matches:gt,loaderData:pt,errors:yt}=await S(Ze,W,Ae,fe.active,xe,Z&&Z.submission,Z&&Z.fetcherSubmission,Z&&Z.replace,Z&&Z.initialHydration===!0,Ve,Le);ze||(A=null,nt(W,Pt({matches:gt||Ae},p0(Le),{loaderData:pt,errors:yt})))}async function D(U,W,Z,re,xe,Ae){Ae===void 0&&(Ae={}),Ye();let Ve=NP(W,Z);if(Pe({navigation:Ve},{flushSync:Ae.flushSync===!0}),xe){let Le=await Hc(re,W.pathname,U.signal);if(Le.type==="aborted")return{shortCircuited:!0};if(Le.type==="error"){let{boundaryId:ze,error:gt}=An(W.pathname,Le);return{matches:Le.partialMatches,pendingActionResult:[ze,{type:xt.error,error:gt}]}}else if(Le.matches)re=Le.matches;else{let{notFoundMatches:ze,error:gt,route:pt}=vi(W.pathname);return{matches:ze,pendingActionResult:[pt.id,{type:xt.error,error:gt}]}}}let fe,Ze=il(re,W);if(!Ze.route.action&&!Ze.route.lazy)fe={type:xt.error,error:fr(405,{method:U.method,pathname:W.pathname,routeId:Ze.route.id})};else if(fe=(await ee("action",U,[Ze],re))[0],U.signal.aborted)return{shortCircuited:!0};if(Vo(fe)){let Le;return Ae&&Ae.replace!=null?Le=Ae.replace:Le=u0(fe.response.headers.get("Location"),new URL(U.url),c)===E.location.pathname+E.location.search,await X(U,fe,{submission:Z,replace:Le}),{shortCircuited:!0}}if($o(fe))throw fr(400,{type:"defer-action"});if(Ir(fe)){let Le=Vi(re,Ze.route.id);return(Ae&&Ae.replace)!==!0&&(R=Vt.Push),{matches:re,pendingActionResult:[Le.route.id,fe]}}return{matches:re,pendingActionResult:[Ze.route.id,fe]}}async function S(U,W,Z,re,xe,Ae,Ve,fe,Ze,Le,ze){let gt=xe||Fh(W,Ae),pt=Ae||Ve||y0(gt),yt=!F&&(!f.v7_partialHydration||!Ze);if(re){if(yt){let It=T(ze);Pe(Pt({navigation:gt},It!==void 0?{actionData:It}:{}),{flushSync:Le})}let Qe=await Hc(Z,W.pathname,U.signal);if(Qe.type==="aborted")return{shortCircuited:!0};if(Qe.type==="error"){let{boundaryId:It,error:Ar}=An(W.pathname,Qe);return{matches:Qe.partialMatches,loaderData:{},errors:{[It]:Ar}}}else if(Qe.matches)Z=Qe.matches;else{let{error:It,notFoundMatches:Ar,route:Et}=vi(W.pathname);return{matches:Ar,loaderData:{},errors:{[Et.id]:It}}}}let dt=a||i,[er,$t]=a0(e.history,E,Z,pt,W,f.v7_partialHydration&&Ze===!0,f.v7_skipActionErrorRevalidation,b,V,te,ne,$,z,dt,c,ze);if(Ls(Qe=>!(Z&&Z.some(It=>It.route.id===Qe))||er&&er.some(It=>It.route.id===Qe)),I=++K,er.length===0&&$t.length===0){let Qe=es();return nt(W,Pt({matches:Z,loaderData:{},errors:ze&&Ir(ze[1])?{[ze[0]]:ze[1].error}:null},p0(ze),Qe?{fetchers:new Map(E.fetchers)}:{}),{flushSync:Le}),{shortCircuited:!0}}if(yt){let Qe={};if(!re){Qe.navigation=gt;let It=T(ze);It!==void 0&&(Qe.actionData=It)}$t.length>0&&(Qe.fetchers=O($t)),Pe(Qe,{flushSync:Le})}$t.forEach(Qe=>{B.has(Qe.key)&&at(Qe.key),Qe.controller&&B.set(Qe.key,Qe.controller)});let za=()=>$t.forEach(Qe=>at(Qe.key));A&&A.signal.addEventListener("abort",za);let{loaderResults:Fs,fetcherResults:yi}=await me(E.matches,Z,er,$t,U);if(U.signal.aborted)return{shortCircuited:!0};A&&A.signal.removeEventListener("abort",za),$t.forEach(Qe=>B.delete(Qe.key));let xi=g0([...Fs,...yi]);if(xi){if(xi.idx>=er.length){let Qe=$t[xi.idx-er.length].key;z.add(Qe)}return await X(U,xi.result,{replace:fe}),{shortCircuited:!0}}let{loaderData:wi,errors:Dn}=f0(E,Z,er,Fs,ze,$t,yi,se);se.forEach((Qe,It)=>{Qe.subscribe(Ar=>{(Ar||Qe.done)&&se.delete(It)})}),f.v7_partialHydration&&Ze&&E.errors&&Object.entries(E.errors).filter(Qe=>{let[It]=Qe;return!er.some(Ar=>Ar.route.id===It)}).forEach(Qe=>{let[It,Ar]=Qe;Dn=Object.assign(Dn||{},{[It]:Ar})});let Yc=es(),Kc=Xr(I),Gc=Yc||Kc||$t.length>0;return Pt({matches:Z,loaderData:wi,errors:Dn},Gc?{fetchers:new Map(E.fetchers)}:{})}function T(U){if(U&&!Ir(U[1]))return{[U[0]]:U[1].data};if(E.actionData)return Object.keys(E.actionData).length===0?null:E.actionData}function O(U){return U.forEach(W=>{let Z=E.fetchers.get(W.key),re=Za(void 0,Z?Z.data:void 0);E.fetchers.set(W.key,re)}),new Map(E.fetchers)}function Y(U,W,Z,re){if(n)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");B.has(U)&&at(U);let xe=(re&&re.unstable_flushSync)===!0,Ae=a||i,Ve=Jp(E.location,E.matches,c,f.v7_prependBasename,Z,f.v7_relativeSplatPath,W,re==null?void 0:re.relative),fe=Mo(Ae,Ve,c),Ze=ch(fe,Ae,Ve);if(Ze.active&&Ze.matches&&(fe=Ze.matches),!fe){jt(U,W,fr(404,{pathname:Ve}),{flushSync:xe});return}let{path:Le,submission:ze,error:gt}=i0(f.v7_normalizeFormMethod,!0,Ve,re);if(gt){jt(U,W,gt,{flushSync:xe});return}let pt=il(fe,Le);if(P=(re&&re.preventScrollReset)===!0,ze&&hn(ze.formMethod)){M(U,W,Le,pt,fe,Ze.active,xe,ze);return}$.set(U,{routeId:W,path:Le}),H(U,W,Le,pt,fe,Ze.active,xe,ze)}async function M(U,W,Z,re,xe,Ae,Ve,fe){Ye(),$.delete(U);function Ze(Et){if(!Et.route.action&&!Et.route.lazy){let ts=fr(405,{method:fe.formMethod,pathname:Z,routeId:W});return jt(U,W,ts,{flushSync:Ve}),!0}return!1}if(!Ae&&Ze(re))return;let Le=E.fetchers.get(U);Ue(U,TP(fe,Le),{flushSync:Ve});let ze=new AbortController,gt=bi(e.history,Z,ze.signal,fe);if(Ae){let Et=await Hc(xe,Z,gt.signal);if(Et.type==="aborted")return;if(Et.type==="error"){let{error:ts}=An(Z,Et);jt(U,W,ts,{flushSync:Ve});return}else if(Et.matches){if(xe=Et.matches,re=il(xe,Z),Ze(re))return}else{jt(U,W,fr(404,{pathname:Z}),{flushSync:Ve});return}}B.set(U,ze);let pt=K,dt=(await ee("action",gt,[re],xe))[0];if(gt.signal.aborted){B.get(U)===ze&&B.delete(U);return}if(f.v7_fetcherPersist&&ne.has(U)){if(Vo(dt)||Ir(dt)){Ue(U,Vs(void 0));return}}else{if(Vo(dt))if(B.delete(U),I>pt){Ue(U,Vs(void 0));return}else return z.add(U),Ue(U,Za(fe)),X(gt,dt,{fetcherSubmission:fe});if(Ir(dt)){jt(U,W,dt.error);return}}if($o(dt))throw fr(400,{type:"defer-action"});let er=E.navigation.location||E.location,$t=bi(e.history,er,ze.signal),za=a||i,Fs=E.navigation.state!=="idle"?Mo(za,E.navigation.location,c):E.matches;et(Fs,"Didn't find any matches after fetcher action");let yi=++K;Q.set(U,yi);let xi=Za(fe,dt.data);E.fetchers.set(U,xi);let[wi,Dn]=a0(e.history,E,Fs,fe,er,!1,f.v7_skipActionErrorRevalidation,b,V,te,ne,$,z,za,c,[re.route.id,dt]);Dn.filter(Et=>Et.key!==U).forEach(Et=>{let ts=Et.key,Yy=E.fetchers.get(ts),lT=Za(void 0,Yy?Yy.data:void 0);E.fetchers.set(ts,lT),B.has(ts)&&at(ts),Et.controller&&B.set(ts,Et.controller)}),Pe({fetchers:new Map(E.fetchers)});let Yc=()=>Dn.forEach(Et=>at(Et.key));ze.signal.addEventListener("abort",Yc);let{loaderResults:Kc,fetcherResults:Gc}=await me(E.matches,Fs,wi,Dn,$t);if(ze.signal.aborted)return;ze.signal.removeEventListener("abort",Yc),Q.delete(U),B.delete(U),Dn.forEach(Et=>B.delete(Et.key));let Qe=g0([...Kc,...Gc]);if(Qe){if(Qe.idx>=wi.length){let Et=Dn[Qe.idx-wi.length].key;z.add(Et)}return X($t,Qe.result)}let{loaderData:It,errors:Ar}=f0(E,E.matches,wi,Kc,void 0,Dn,Gc,se);if(E.fetchers.has(U)){let Et=Vs(dt.data);E.fetchers.set(U,Et)}Xr(yi),E.navigation.state==="loading"&&yi>I?(et(R,"Expected pending action"),A&&A.abort(),nt(E.navigation.location,{matches:Fs,loaderData:It,errors:Ar,fetchers:new Map(E.fetchers)})):(Pe({errors:Ar,loaderData:h0(E.loaderData,It,Fs,Ar),fetchers:new Map(E.fetchers)}),b=!1)}async function H(U,W,Z,re,xe,Ae,Ve,fe){let Ze=E.fetchers.get(U);Ue(U,Za(fe,Ze?Ze.data:void 0),{flushSync:Ve});let Le=new AbortController,ze=bi(e.history,Z,Le.signal);if(Ae){let dt=await Hc(xe,Z,ze.signal);if(dt.type==="aborted")return;if(dt.type==="error"){let{error:er}=An(Z,dt);jt(U,W,er,{flushSync:Ve});return}else if(dt.matches)xe=dt.matches,re=il(xe,Z);else{jt(U,W,fr(404,{pathname:Z}),{flushSync:Ve});return}}B.set(U,Le);let gt=K,yt=(await ee("loader",ze,[re],xe))[0];if($o(yt)&&(yt=await J1(yt,ze.signal,!0)||yt),B.get(U)===Le&&B.delete(U),!ze.signal.aborted){if(ne.has(U)){Ue(U,Vs(void 0));return}if(Vo(yt))if(I>gt){Ue(U,Vs(void 0));return}else{z.add(U),await X(ze,yt);return}if(Ir(yt)){jt(U,W,yt.error);return}et(!$o(yt),"Unhandled fetcher deferred data"),Ue(U,Vs(yt.data))}}async function X(U,W,Z){let{submission:re,fetcherSubmission:xe,replace:Ae}=Z===void 0?{}:Z;W.response.headers.has("X-Remix-Revalidate")&&(b=!0);let Ve=W.response.headers.get("Location");et(Ve,"Expected a Location header on the redirect Response"),Ve=u0(Ve,new URL(U.url),c);let fe=Yl(E.location,Ve,{_isRedirect:!0});if(r){let yt=!1;if(W.response.headers.has("X-Remix-Reload-Document"))yt=!0;else if(Og.test(Ve)){const dt=e.history.createURL(Ve);yt=dt.origin!==t.location.origin||ja(dt.pathname,c)==null}if(yt){Ae?t.location.replace(Ve):t.location.assign(Ve);return}}A=null;let Ze=Ae===!0?Vt.Replace:Vt.Push,{formMethod:Le,formAction:ze,formEncType:gt}=E.navigation;!re&&!xe&&Le&&ze&>&&(re=y0(E.navigation));let pt=re||xe;if(cP.has(W.response.status)&&pt&&hn(pt.formMethod))await G(Ze,fe,{submission:Pt({},pt,{formAction:Ve}),preventScrollReset:P});else{let yt=Fh(fe,re);await G(Ze,fe,{overrideNavigation:yt,fetcherSubmission:xe,preventScrollReset:P})}}async function ee(U,W,Z,re){try{let xe=await yP(u,U,W,Z,re,o,s);return await Promise.all(xe.map((Ae,Ve)=>{if(CP(Ae)){let fe=Ae.result;return{type:xt.redirect,response:_P(fe,W,Z[Ve].route.id,re,c,f.v7_relativeSplatPath)}}return wP(Ae)}))}catch(xe){return Z.map(()=>({type:xt.error,error:xe}))}}async function me(U,W,Z,re,xe){let[Ae,...Ve]=await Promise.all([Z.length?ee("loader",xe,Z,W):[],...re.map(fe=>{if(fe.matches&&fe.match&&fe.controller){let Ze=bi(e.history,fe.path,fe.controller.signal);return ee("loader",Ze,[fe.match],fe.matches).then(Le=>Le[0])}else return Promise.resolve({type:xt.error,error:fr(404,{pathname:fe.path})})})]);return await Promise.all([v0(U,Z,Ae,Ae.map(()=>xe.signal),!1,E.loaderData),v0(U,re.map(fe=>fe.match),Ve,re.map(fe=>fe.controller?fe.controller.signal:null),!0)]),{loaderResults:Ae,fetcherResults:Ve}}function Ye(){b=!0,V.push(...Ls()),$.forEach((U,W)=>{B.has(W)&&(te.push(W),at(W))})}function Ue(U,W,Z){Z===void 0&&(Z={}),E.fetchers.set(U,W),Pe({fetchers:new Map(E.fetchers)},{flushSync:(Z&&Z.flushSync)===!0})}function jt(U,W,Z,re){re===void 0&&(re={});let xe=Vi(E.matches,W);Ht(U),Pe({errors:{[xe.route.id]:Z},fetchers:new Map(E.fetchers)},{flushSync:(re&&re.flushSync)===!0})}function qr(U){return f.v7_fetcherPersist&&(he.set(U,(he.get(U)||0)+1),ne.has(U)&&ne.delete(U)),E.fetchers.get(U)||uP}function Ht(U){let W=E.fetchers.get(U);B.has(U)&&!(W&&W.state==="loading"&&Q.has(U))&&at(U),$.delete(U),Q.delete(U),z.delete(U),ne.delete(U),E.fetchers.delete(U)}function Qn(U){if(f.v7_fetcherPersist){let W=(he.get(U)||0)-1;W<=0?(he.delete(U),ne.add(U)):he.set(U,W)}else Ht(U);Pe({fetchers:new Map(E.fetchers)})}function at(U){let W=B.get(U);et(W,"Expected fetch controller: "+U),W.abort(),B.delete(U)}function Jn(U){for(let W of U){let Z=qr(W),re=Vs(Z.data);E.fetchers.set(W,re)}}function es(){let U=[],W=!1;for(let Z of z){let re=E.fetchers.get(Z);et(re,"Expected fetcher: "+Z),re.state==="loading"&&(z.delete(Z),U.push(Z),W=!0)}return Jn(U),W}function Xr(U){let W=[];for(let[Z,re]of Q)if(re0}function Vc(U,W){let Z=E.blockers.get(U)||Ga;return Oe.get(U)!==W&&Oe.set(U,W),Z}function Bc(U){E.blockers.delete(U),Oe.delete(U)}function gi(U,W){let Z=E.blockers.get(U)||Ga;et(Z.state==="unblocked"&&W.state==="blocked"||Z.state==="blocked"&&W.state==="blocked"||Z.state==="blocked"&&W.state==="proceeding"||Z.state==="blocked"&&W.state==="unblocked"||Z.state==="proceeding"&&W.state==="unblocked","Invalid blocker state transition: "+Z.state+" -> "+W.state);let re=new Map(E.blockers);re.set(U,W),Pe({blockers:re})}function Wc(U){let{currentLocation:W,nextLocation:Z,historyAction:re}=U;if(Oe.size===0)return;Oe.size>1&&ri(!1,"A router only supports one blocker at a time");let xe=Array.from(Oe.entries()),[Ae,Ve]=xe[xe.length-1],fe=E.blockers.get(Ae);if(!(fe&&fe.state==="proceeding")&&Ve({currentLocation:W,nextLocation:Z,historyAction:re}))return Ae}function vi(U){let W=fr(404,{pathname:U}),Z=a||i,{matches:re,route:xe}=m0(Z);return Ls(),{notFoundMatches:re,route:xe,error:W}}function An(U,W){return{boundaryId:Vi(W.partialMatches).route.id,error:fr(400,{type:"route-discovery",pathname:U,message:W.error!=null&&"message"in W.error?W.error:String(W.error)})}}function Ls(U){let W=[];return se.forEach((Z,re)=>{(!U||U(re))&&(Z.cancel(),W.push(re),se.delete(re))}),W}function sT(U,W,Z){if(x=U,_=W,y=Z||null,!p&&E.navigation===Lh){p=!0;let re=Hy(E.location,E.matches);re!=null&&Pe({restoreScrollPosition:re})}return()=>{x=null,_=null,y=null}}function Wy(U,W){return y&&y(U,W.map(re=>$R(re,E.loaderData)))||U.key}function oT(U,W){if(x&&_){let Z=Wy(U,W);x[Z]=_()}}function Hy(U,W){if(x){let Z=Wy(U,W),re=x[Z];if(typeof re=="number")return re}return null}function ch(U,W,Z){if(d)if(U){let re=U[U.length-1].route;if(re.path&&(re.path==="*"||re.path.endsWith("/*")))return{active:!0,matches:zu(W,Z,c,!0)}}else return{active:!0,matches:zu(W,Z,c,!0)||[]};return{active:!1,matches:null}}async function Hc(U,W,Z){let re=U,xe=re.length>0?re[re.length-1].route:null;for(;;){let Ae=a==null,Ve=a||i;try{await gP(d,W,re,Ve,o,s,pe,Z)}catch(ze){return{type:"error",error:ze,partialMatches:re}}finally{Ae&&(i=[...i])}if(Z.aborted)return{type:"aborted"};let fe=Mo(Ve,W,c),Ze=!1;if(fe){let ze=fe[fe.length-1].route;if(ze.index)return{type:"success",matches:fe};if(ze.path&&ze.path.length>0)if(ze.path==="*")Ze=!0;else return{type:"success",matches:fe}}let Le=zu(Ve,W,c,!0);if(!Le||re.map(ze=>ze.route.id).join("-")===Le.map(ze=>ze.route.id).join("-"))return{type:"success",matches:Ze?fe:null};if(re=Le,xe=re[re.length-1].route,xe.path==="*")return{type:"success",matches:re}}}function iT(U){o={},a=Kl(U,s,void 0,o)}function aT(U,W){let Z=a==null;q1(U,W,a||i,o,s),Z&&(i=[...i],Pe({}))}return j={get basename(){return c},get future(){return f},get state(){return E},get routes(){return i},get window(){return t},initialize:Ne,subscribe:Me,enableScrollRestoration:sT,navigate:k,fetch:Y,revalidate:J,createHref:U=>e.history.createHref(U),encodeLocation:U=>e.history.encodeLocation(U),getFetcher:qr,deleteFetcher:Qn,dispose:Fe,getBlocker:Vc,deleteBlocker:Bc,patchRoutes:aT,_internalFetchControllers:B,_internalActiveDeferreds:se,_internalSetRoutes:iT},j}function hP(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Jp(e,t,r,n,s,o,i,a){let c,u;if(i){c=[];for(let f of t)if(c.push(f),f.route.id===i){u=f;break}}else c=t,u=t[t.length-1];let d=gf(s||".",mf(c,o),ja(e.pathname,r)||e.pathname,a==="path");return s==null&&(d.search=e.search,d.hash=e.hash),(s==null||s===""||s===".")&&u&&u.route.index&&!Mg(d.search)&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),n&&r!=="/"&&(d.pathname=d.pathname==="/"?r:ms([r,d.pathname])),ni(d)}function i0(e,t,r,n){if(!n||!hP(n))return{path:r};if(n.formMethod&&!EP(n.formMethod))return{path:r,error:fr(405,{method:n.formMethod})};let s=()=>({path:r,error:fr(400,{type:"invalid-body"})}),o=n.formMethod||"get",i=e?o.toUpperCase():o.toLowerCase(),a=X1(r);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!hn(i))return s();let m=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((v,x)=>{let[y,_]=x;return""+v+y+"="+_+` -`},""):String(n.body);return{path:r,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:void 0,text:m}}}else if(n.formEncType==="application/json"){if(!hn(i))return s();try{let m=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:m,text:void 0}}}catch{return s()}}}et(typeof FormData=="function","FormData is not available in this environment");let c,u;if(n.formData)c=em(n.formData),u=n.formData;else if(n.body instanceof FormData)c=em(n.body),u=n.body;else if(n.body instanceof URLSearchParams)c=n.body,u=d0(c);else if(n.body==null)c=new URLSearchParams,u=new FormData;else try{c=new URLSearchParams(n.body),u=d0(c)}catch{return s()}let d={formMethod:i,formAction:a,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(hn(d.formMethod))return{path:r,submission:d};let f=Rs(r);return t&&f.search&&Mg(f.search)&&c.append("index",""),f.search="?"+c,{path:ni(f),submission:d}}function pP(e,t){let r=e;if(t){let n=e.findIndex(s=>s.route.id===t);n>=0&&(r=e.slice(0,n))}return r}function a0(e,t,r,n,s,o,i,a,c,u,d,f,m,v,x,y){let _=y?Ir(y[1])?y[1].error:y[1].data:void 0,p=e.createURL(t.location),h=e.createURL(s),w=y&&Ir(y[1])?y[0]:void 0,C=w?pP(r,w):r,j=y?y[1].statusCode:void 0,E=i&&j&&j>=400,R=C.filter((A,L)=>{let{route:q}=A;if(q.lazy)return!0;if(q.loader==null)return!1;if(o)return typeof q.loader!="function"||q.loader.hydrate?!0:t.loaderData[q.id]===void 0&&(!t.errors||t.errors[q.id]===void 0);if(mP(t.loaderData,t.matches[L],A)||c.some(b=>b===A.route.id))return!0;let N=t.matches[L],F=A;return l0(A,Pt({currentUrl:p,currentParams:N.params,nextUrl:h,nextParams:F.params},n,{actionResult:_,actionStatus:j,defaultShouldRevalidate:E?!1:a||p.pathname+p.search===h.pathname+h.search||p.search!==h.search||Z1(N,F)}))}),P=[];return f.forEach((A,L)=>{if(o||!r.some(V=>V.route.id===A.routeId)||d.has(L))return;let q=Mo(v,A.path,x);if(!q){P.push({key:L,routeId:A.routeId,path:A.path,matches:null,match:null,controller:null});return}let N=t.fetchers.get(L),F=il(q,A.path),b=!1;m.has(L)?b=!1:u.includes(L)?b=!0:N&&N.state!=="idle"&&N.data===void 0?b=a:b=l0(F,Pt({currentUrl:p,currentParams:t.matches[t.matches.length-1].params,nextUrl:h,nextParams:r[r.length-1].params},n,{actionResult:_,actionStatus:j,defaultShouldRevalidate:E?!1:a})),b&&P.push({key:L,routeId:A.routeId,path:A.path,matches:q,match:F,controller:new AbortController})}),[R,P]}function mP(e,t,r){let n=!t||r.route.id!==t.route.id,s=e[r.route.id]===void 0;return n||s}function Z1(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function l0(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}async function gP(e,t,r,n,s,o,i,a){let c=[t,...r.map(u=>u.route.id)].join("-");try{let u=i.get(c);u||(u=e({path:t,matches:r,patch:(d,f)=>{a.aborted||q1(d,f,n,s,o)}}),i.set(c,u)),u&&kP(u)&&await u}finally{i.delete(c)}}function q1(e,t,r,n,s){if(e){var o;let i=n[e];et(i,"No route found to patch children into: routeId = "+e);let a=Kl(t,s,[e,"patch",String(((o=i.children)==null?void 0:o.length)||"0")],n);i.children?i.children.push(...a):i.children=a}else{let i=Kl(t,s,["patch",String(r.length||"0")],n);r.push(...i)}}async function c0(e,t,r){if(!e.lazy)return;let n=await e.lazy();if(!e.lazy)return;let s=r[e.id];et(s,"No route found in manifest");let o={};for(let i in n){let c=s[i]!==void 0&&i!=="hasErrorBoundary";ri(!c,'Route "'+s.id+'" has a static property "'+i+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+i+'" will be ignored.')),!c&&!zR.has(i)&&(o[i]=n[i])}Object.assign(s,o),Object.assign(s,Pt({},t(s),{lazy:void 0}))}function vP(e){return Promise.all(e.matches.map(t=>t.resolve()))}async function yP(e,t,r,n,s,o,i,a){let c=n.reduce((f,m)=>f.add(m.route.id),new Set),u=new Set,d=await e({matches:s.map(f=>{let m=c.has(f.route.id);return Pt({},f,{shouldLoad:m,resolve:x=>(u.add(f.route.id),m?xP(t,r,f,o,i,x,a):Promise.resolve({type:xt.data,result:void 0}))})}),request:r,params:s[0].params,context:a});return s.forEach(f=>et(u.has(f.route.id),'`match.resolve()` was not called for route id "'+f.route.id+'". You must call `match.resolve()` on every match passed to `dataStrategy` to ensure all routes are properly loaded.')),d.filter((f,m)=>c.has(s[m].route.id))}async function xP(e,t,r,n,s,o,i){let a,c,u=d=>{let f,m=new Promise((y,_)=>f=_);c=()=>f(),t.signal.addEventListener("abort",c);let v=y=>typeof d!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+r.route.id+"]"))):d({request:t,params:r.params,context:i},...y!==void 0?[y]:[]),x;return o?x=o(y=>v(y)):x=(async()=>{try{return{type:"data",result:await v()}}catch(y){return{type:"error",result:y}}})(),Promise.race([x,m])};try{let d=r.route[e];if(r.route.lazy)if(d){let f,[m]=await Promise.all([u(d).catch(v=>{f=v}),c0(r.route,s,n)]);if(f!==void 0)throw f;a=m}else if(await c0(r.route,s,n),d=r.route[e],d)a=await u(d);else if(e==="action"){let f=new URL(t.url),m=f.pathname+f.search;throw fr(405,{method:t.method,pathname:m,routeId:r.route.id})}else return{type:xt.data,result:void 0};else if(d)a=await u(d);else{let f=new URL(t.url),m=f.pathname+f.search;throw fr(404,{pathname:m})}et(a.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+r.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(d){return{type:xt.error,result:d}}finally{c&&t.signal.removeEventListener("abort",c)}return a}async function wP(e){let{result:t,type:r,status:n}=e;if(Q1(t)){let i;try{let a=t.headers.get("Content-Type");a&&/\bapplication\/json\b/.test(a)?t.body==null?i=null:i=await t.json():i=await t.text()}catch(a){return{type:xt.error,error:a}}return r===xt.error?{type:xt.error,error:new Dg(t.status,t.statusText,i),statusCode:t.status,headers:t.headers}:{type:xt.data,data:i,statusCode:t.status,headers:t.headers}}if(r===xt.error)return{type:xt.error,error:t,statusCode:vf(t)?t.status:n};if(jP(t)){var s,o;return{type:xt.deferred,deferredData:t,statusCode:(s=t.init)==null?void 0:s.status,headers:((o=t.init)==null?void 0:o.headers)&&new Headers(t.init.headers)}}return{type:xt.data,data:t,statusCode:n}}function _P(e,t,r,n,s,o){let i=e.headers.get("Location");if(et(i,"Redirects returned/thrown from loaders/actions must have a Location header"),!Og.test(i)){let a=n.slice(0,n.findIndex(c=>c.route.id===r)+1);i=Jp(new URL(t.url),a,s,!0,i,o),e.headers.set("Location",i)}return e}function u0(e,t,r){if(Og.test(e)){let n=e,s=n.startsWith("//")?new URL(t.protocol+n):new URL(n),o=ja(s.pathname,r)!=null;if(s.origin===t.origin&&o)return s.pathname+s.search+s.hash}return e}function bi(e,t,r,n){let s=e.createURL(X1(t)).toString(),o={signal:r};if(n&&hn(n.formMethod)){let{formMethod:i,formEncType:a}=n;o.method=i.toUpperCase(),a==="application/json"?(o.headers=new Headers({"Content-Type":a}),o.body=JSON.stringify(n.json)):a==="text/plain"?o.body=n.text:a==="application/x-www-form-urlencoded"&&n.formData?o.body=em(n.formData):o.body=n.formData}return new Request(s,o)}function em(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,typeof n=="string"?n:n.name);return t}function d0(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function bP(e,t,r,n,s,o){let i={},a=null,c,u=!1,d={},f=n&&Ir(n[1])?n[1].error:void 0;return r.forEach((m,v)=>{let x=t[v].route.id;if(et(!Vo(m),"Cannot handle redirect results in processLoaderData"),Ir(m)){let y=m.error;f!==void 0&&(y=f,f=void 0),a=a||{};{let _=Vi(e,x);a[_.route.id]==null&&(a[_.route.id]=y)}i[x]=void 0,u||(u=!0,c=vf(m.error)?m.error.status:500),m.headers&&(d[x]=m.headers)}else $o(m)?(s.set(x,m.deferredData),i[x]=m.deferredData.data,m.statusCode!=null&&m.statusCode!==200&&!u&&(c=m.statusCode),m.headers&&(d[x]=m.headers)):(i[x]=m.data,m.statusCode&&m.statusCode!==200&&!u&&(c=m.statusCode),m.headers&&(d[x]=m.headers))}),f!==void 0&&n&&(a={[n[0]]:f},i[n[0]]=void 0),{loaderData:i,errors:a,statusCode:c||200,loaderHeaders:d}}function f0(e,t,r,n,s,o,i,a){let{loaderData:c,errors:u}=bP(t,r,n,s,a);for(let d=0;dn.route.id===t)+1):[...e]).reverse().find(n=>n.route.hasErrorBoundary===!0)||e[0]}function m0(e){let t=e.length===1?e[0]:e.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function fr(e,t){let{pathname:r,routeId:n,method:s,type:o,message:i}=t===void 0?{}:t,a="Unknown Server Error",c="Unknown @remix-run/router error";return e===400?(a="Bad Request",o==="route-discovery"?c='Unable to match URL "'+r+'" - the `unstable_patchRoutesOnMiss()` '+(`function threw the following error: -`+i):s&&r&&n?c="You made a "+s+' request to "'+r+'" but '+('did not provide a `loader` for route "'+n+'", ')+"so there is no way to handle the request.":o==="defer-action"?c="defer() is not supported in actions":o==="invalid-body"&&(c="Unable to encode submission body")):e===403?(a="Forbidden",c='Route "'+n+'" does not match URL "'+r+'"'):e===404?(a="Not Found",c='No route matches URL "'+r+'"'):e===405&&(a="Method Not Allowed",s&&r&&n?c="You made a "+s.toUpperCase()+' request to "'+r+'" but '+('did not provide an `action` for route "'+n+'", ')+"so there is no way to handle the request.":s&&(c='Invalid request method "'+s.toUpperCase()+'"')),new Dg(e||500,a,new Error(c),!0)}function g0(e){for(let t=e.length-1;t>=0;t--){let r=e[t];if(Vo(r))return{result:r,idx:t}}}function X1(e){let t=typeof e=="string"?Rs(e):e;return ni(Pt({},t,{hash:""}))}function SP(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function kP(e){return typeof e=="object"&&e!=null&&"then"in e}function CP(e){return Q1(e.result)&&lP.has(e.result.status)}function $o(e){return e.type===xt.deferred}function Ir(e){return e.type===xt.error}function Vo(e){return(e&&e.type)===xt.redirect}function jP(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function Q1(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function EP(e){return aP.has(e.toLowerCase())}function hn(e){return oP.has(e.toLowerCase())}async function v0(e,t,r,n,s,o){for(let i=0;if.route.id===c.route.id),d=u!=null&&!Z1(u,c)&&(o&&o[c.route.id])!==void 0;if($o(a)&&(s||d)){let f=n[i];et(f,"Expected an AbortSignal for revalidating fetcher deferred result"),await J1(a,f,s).then(m=>{m&&(r[i]=m||r[i])})}}}async function J1(e,t,r){if(r===void 0&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:xt.data,data:e.deferredData.unwrappedData}}catch(s){return{type:xt.error,error:s}}return{type:xt.data,data:e.deferredData.data}}}function Mg(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function il(e,t){let r=typeof t=="string"?Rs(t).search:t.search;if(e[e.length-1].route.index&&Mg(r||""))return e[e.length-1];let n=Y1(e);return n[n.length-1]}function y0(e){let{formMethod:t,formAction:r,formEncType:n,text:s,formData:o,json:i}=e;if(!(!t||!r||!n)){if(s!=null)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:s};if(o!=null)return{formMethod:t,formAction:r,formEncType:n,formData:o,json:void 0,text:void 0};if(i!==void 0)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:i,text:void 0}}}function Fh(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function NP(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Za(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function TP(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function Vs(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function RP(e,t){try{let r=e.sessionStorage.getItem(G1);if(r){let n=JSON.parse(r);for(let[s,o]of Object.entries(n||{}))o&&Array.isArray(o)&&t.set(s,new Set(o||[]))}}catch{}}function PP(e,t){if(t.size>0){let r={};for(let[n,s]of t)r[n]=[...s];try{e.sessionStorage.setItem(G1,JSON.stringify(r))}catch(n){ri(!1,"Failed to save applied view transitions in sessionStorage ("+n+").")}}}/** + */function Pt(){return Pt=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function ri(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function LR(){return Math.random().toString(36).substr(2,8)}function n0(e,t){return{usr:e.state,key:e.key,idx:t}}function Kl(e,t,r,n){return r===void 0&&(r=null),Pt({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Rs(t):t,{state:r,key:t&&t.key||n||LR()})}function ni(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function Rs(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function FR(e,t,r,n){n===void 0&&(n={});let{window:s=document.defaultView,v5Compat:o=!1}=n,i=s.history,l=Vt.Pop,c=null,u=d();u==null&&(u=0,i.replaceState(Pt({},i.state,{idx:u}),""));function d(){return(i.state||{idx:null}).idx}function f(){l=Vt.Pop;let _=d(),p=_==null?null:_-u;u=_,c&&c({action:l,location:y.location,delta:p})}function m(_,p){l=Vt.Push;let h=Kl(y.location,_,p);r&&r(h,_),u=d()+1;let w=n0(h,u),C=y.createHref(h);try{i.pushState(w,"",C)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;s.location.assign(C)}o&&c&&c({action:l,location:y.location,delta:1})}function v(_,p){l=Vt.Replace;let h=Kl(y.location,_,p);r&&r(h,_),u=d();let w=n0(h,u),C=y.createHref(h);i.replaceState(w,"",C),o&&c&&c({action:l,location:y.location,delta:0})}function x(_){let p=s.location.origin!=="null"?s.location.origin:s.location.href,h=typeof _=="string"?_:ni(_);return h=h.replace(/ $/,"%20"),et(p,"No window.location.(origin|href) available to create URL for href: "+h),new URL(h,p)}let y={get action(){return l},get location(){return e(s,i)},listen(_){if(c)throw new Error("A history only accepts one active listener");return s.addEventListener(r0,f),c=_,()=>{s.removeEventListener(r0,f),c=null}},createHref(_){return t(s,_)},createURL:x,encodeLocation(_){let p=x(_);return{pathname:p.pathname,search:p.search,hash:p.hash}},push:m,replace:v,go(_){return i.go(_)}};return y}var xt;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(xt||(xt={}));const zR=new Set(["lazy","caseSensitive","path","id","index","children"]);function UR(e){return e.index===!0}function Gl(e,t,r,n){return r===void 0&&(r=[]),n===void 0&&(n={}),e.map((s,o)=>{let i=[...r,String(o)],l=typeof s.id=="string"?s.id:i.join("-");if(et(s.index!==!0||!s.children,"Cannot specify children on an index route"),et(!n[l],'Found a route id collision on id "'+l+`". Route id's must be globally unique within Data Router usages`),UR(s)){let c=Pt({},s,t(s),{id:l});return n[l]=c,c}else{let c=Pt({},s,t(s),{id:l,children:void 0});return n[l]=c,s.children&&(c.children=Gl(s.children,t,i,n)),c}})}function Mo(e,t,r){return r===void 0&&(r="/"),zu(e,t,r,!1)}function zu(e,t,r,n){let s=typeof t=="string"?Rs(t):t,o=Ea(s.pathname||"/",r);if(o==null)return null;let i=W1(e);VR(i);let l=null;for(let c=0;l==null&&c{let c={relativePath:l===void 0?o.path||"":l,caseSensitive:o.caseSensitive===!0,childrenIndex:i,route:o};c.relativePath.startsWith("/")&&(et(c.relativePath.startsWith(n),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(n.length));let u=ms([n,c.relativePath]),d=r.concat(c);o.children&&o.children.length>0&&(et(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),W1(o.children,t,d,u)),!(o.path==null&&!o.index)&&t.push({path:u,score:ZR(u,o.index),routesMeta:d})};return e.forEach((o,i)=>{var l;if(o.path===""||!((l=o.path)!=null&&l.includes("?")))s(o,i);else for(let c of H1(o.path))s(o,i,c)}),t}function H1(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,s=r.endsWith("?"),o=r.replace(/\?$/,"");if(n.length===0)return s?[o,""]:[o];let i=H1(n.join("/")),l=[];return l.push(...i.map(c=>c===""?o:[o,c].join("/"))),s&&l.push(...i),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function VR(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:qR(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const BR=/^:[\w-]+$/,WR=3,HR=2,YR=1,KR=10,GR=-2,s0=e=>e==="*";function ZR(e,t){let r=e.split("/"),n=r.length;return r.some(s0)&&(n+=GR),t&&(n+=HR),r.filter(s=>!s0(s)).reduce((s,o)=>s+(BR.test(o)?WR:o===""?YR:KR),n)}function qR(e,t){return e.length===t.length&&e.slice(0,-1).every((n,s)=>n===t[s])?e[e.length-1]-t[t.length-1]:0}function XR(e,t,r){r===void 0&&(r=!1);let{routesMeta:n}=e,s={},o="/",i=[];for(let l=0;l{let{paramName:m,isOptional:v}=d;if(m==="*"){let y=l[f]||"";i=o.slice(0,o.length-y.length).replace(/(.)\/+$/,"$1")}const x=l[f];return v&&!x?u[m]=void 0:u[m]=(x||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:i,pattern:e}}function QR(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),ri(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let n=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,l,c)=>(n.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),n]}function JR(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ri(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Ea(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}function eP(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:s=""}=typeof e=="string"?Rs(e):e;return{pathname:r?r.startsWith("/")?r:tP(r,t):t,search:nP(n),hash:sP(s)}}function tP(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?r.length>1&&r.pop():s!=="."&&r.push(s)}),r.length>1?r.join("/"):"/"}function Ih(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function Y1(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function mf(e,t){let r=Y1(e);return t?r.map((n,s)=>s===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function gf(e,t,r,n){n===void 0&&(n=!1);let s;typeof e=="string"?s=Rs(e):(s=Pt({},e),et(!s.pathname||!s.pathname.includes("?"),Ih("?","pathname","search",s)),et(!s.pathname||!s.pathname.includes("#"),Ih("#","pathname","hash",s)),et(!s.search||!s.search.includes("#"),Ih("#","search","hash",s)));let o=e===""||s.pathname==="",i=o?"/":s.pathname,l;if(i==null)l=r;else{let f=t.length-1;if(!n&&i.startsWith("..")){let m=i.split("/");for(;m[0]==="..";)m.shift(),f-=1;s.pathname=m.join("/")}l=f>=0?t[f]:"/"}let c=eP(s,l),u=i&&i!=="/"&&i.endsWith("/"),d=(o||i===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const ms=e=>e.join("/").replace(/\/\/+/g,"/"),rP=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),nP=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,sP=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class Dg{constructor(t,r,n,s){s===void 0&&(s=!1),this.status=t,this.statusText=r||"",this.internal=s,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}}function vf(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const K1=["post","put","patch","delete"],oP=new Set(K1),iP=["get",...K1],aP=new Set(iP),lP=new Set([301,302,303,307,308]),cP=new Set([307,308]),Lh={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},uP={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Za={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Og=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,dP=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),G1="remix-router-transitions";function fP(e){const t=e.window?e.window:typeof window<"u"?window:void 0,r=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",n=!r;et(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let s;if(e.mapRouteProperties)s=e.mapRouteProperties;else if(e.detectErrorBoundary){let U=e.detectErrorBoundary;s=W=>({hasErrorBoundary:U(W)})}else s=dP;let o={},i=Gl(e.routes,s,void 0,o),l,c=e.basename||"/",u=e.unstable_dataStrategy||vP,d=e.unstable_patchRoutesOnMiss,f=Pt({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),m=null,v=new Set,x=null,y=null,_=null,p=e.hydrationData!=null,h=Mo(i,e.history.location,c),w=null;if(h==null&&!d){let U=mr(404,{pathname:e.history.location.pathname}),{matches:W,route:Z}=m0(i);h=W,w={[Z.id]:U}}h&&d&&!e.hydrationData&&ch(h,i,e.history.location.pathname).active&&(h=null);let C;if(!h)C=!1,h=[];else if(h.some(U=>U.route.lazy))C=!1;else if(!h.some(U=>U.route.loader))C=!0;else if(f.v7_partialHydration){let U=e.hydrationData?e.hydrationData.loaderData:null,W=e.hydrationData?e.hydrationData.errors:null,Z=re=>re.route.loader?typeof re.route.loader=="function"&&re.route.loader.hydrate===!0?!1:U&&U[re.route.id]!==void 0||W&&W[re.route.id]!==void 0:!0;if(W){let re=h.findIndex(ke=>W[ke.route.id]!==void 0);C=h.slice(0,re+1).every(Z)}else C=h.every(Z)}else C=e.hydrationData!=null;let j,E={historyAction:e.history.action,location:e.history.location,matches:h,initialized:C,navigation:Lh,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||w,fetchers:new Map,blockers:new Map},R=Vt.Pop,P=!1,A,L=!1,q=new Map,N=null,F=!1,b=!1,V=[],te=[],B=new Map,K=0,I=-1,Q=new Map,z=new Set,$=new Map,he=new Map,ne=new Set,se=new Map,Oe=new Map,pe=new Map,xe=!1;function Te(){if(m=e.history.listen(U=>{let{action:W,location:Z,delta:re}=U;if(xe){xe=!1;return}ri(Oe.size===0||re!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let ke=Wc({currentLocation:E.location,nextLocation:Z,historyAction:W});if(ke&&re!=null){xe=!0,e.history.go(re*-1),gi(ke,{state:"blocked",location:Z,proceed(){gi(ke,{state:"proceeding",proceed:void 0,reset:void 0,location:Z}),e.history.go(re)},reset(){let Ae=new Map(E.blockers);Ae.set(ke,Za),Pe({blockers:Ae})}});return}return G(W,Z)}),r){RP(t,q);let U=()=>PP(t,q);t.addEventListener("pagehide",U),N=()=>t.removeEventListener("pagehide",U)}return E.initialized||G(Vt.Pop,E.location,{initialHydration:!0}),j}function Fe(){m&&m(),N&&N(),v.clear(),A&&A.abort(),E.fetchers.forEach((U,W)=>Ht(W)),E.blockers.forEach((U,W)=>Bc(W))}function Me(U){return v.add(U),()=>v.delete(U)}function Pe(U,W){W===void 0&&(W={}),E=Pt({},E,U);let Z=[],re=[];f.v7_fetcherPersist&&E.fetchers.forEach((ke,Ae)=>{ke.state==="idle"&&(ne.has(Ae)?re.push(Ae):Z.push(Ae))}),[...v].forEach(ke=>ke(E,{deletedFetchers:re,unstable_viewTransitionOpts:W.viewTransitionOpts,unstable_flushSync:W.flushSync===!0})),f.v7_fetcherPersist&&(Z.forEach(ke=>E.fetchers.delete(ke)),re.forEach(ke=>Ht(ke)))}function nt(U,W,Z){var re,ke;let{flushSync:Ae}=Z===void 0?{}:Z,Ve=E.actionData!=null&&E.navigation.formMethod!=null&&hn(E.navigation.formMethod)&&E.navigation.state==="loading"&&((re=U.state)==null?void 0:re._isRedirect)!==!0,fe;W.actionData?Object.keys(W.actionData).length>0?fe=W.actionData:fe=null:Ve?fe=E.actionData:fe=null;let Ze=W.loaderData?h0(E.loaderData,W.loaderData,W.matches||[],W.errors):E.loaderData,Le=E.blockers;Le.size>0&&(Le=new Map(Le),Le.forEach((pt,yt)=>Le.set(yt,Za)));let ze=P===!0||E.navigation.formMethod!=null&&hn(E.navigation.formMethod)&&((ke=U.state)==null?void 0:ke._isRedirect)!==!0;l&&(i=l,l=void 0),F||R===Vt.Pop||(R===Vt.Push?e.history.push(U,U.state):R===Vt.Replace&&e.history.replace(U,U.state));let gt;if(R===Vt.Pop){let pt=q.get(E.location.pathname);pt&&pt.has(U.pathname)?gt={currentLocation:E.location,nextLocation:U}:q.has(U.pathname)&&(gt={currentLocation:U,nextLocation:E.location})}else if(L){let pt=q.get(E.location.pathname);pt?pt.add(U.pathname):(pt=new Set([U.pathname]),q.set(E.location.pathname,pt)),gt={currentLocation:E.location,nextLocation:U}}Pe(Pt({},W,{actionData:fe,loaderData:Ze,historyAction:R,location:U,initialized:!0,navigation:Lh,revalidation:"idle",restoreScrollPosition:Hy(U,W.matches||E.matches),preventScrollReset:ze,blockers:Le}),{viewTransitionOpts:gt,flushSync:Ae===!0}),R=Vt.Pop,P=!1,L=!1,F=!1,b=!1,V=[],te=[]}async function k(U,W){if(typeof U=="number"){e.history.go(U);return}let Z=Jp(E.location,E.matches,c,f.v7_prependBasename,U,f.v7_relativeSplatPath,W==null?void 0:W.fromRouteId,W==null?void 0:W.relative),{path:re,submission:ke,error:Ae}=i0(f.v7_normalizeFormMethod,!1,Z,W),Ve=E.location,fe=Kl(E.location,re,W&&W.state);fe=Pt({},fe,e.history.encodeLocation(fe));let Ze=W&&W.replace!=null?W.replace:void 0,Le=Vt.Push;Ze===!0?Le=Vt.Replace:Ze===!1||ke!=null&&hn(ke.formMethod)&&ke.formAction===E.location.pathname+E.location.search&&(Le=Vt.Replace);let ze=W&&"preventScrollReset"in W?W.preventScrollReset===!0:void 0,gt=(W&&W.unstable_flushSync)===!0,pt=Wc({currentLocation:Ve,nextLocation:fe,historyAction:Le});if(pt){gi(pt,{state:"blocked",location:fe,proceed(){gi(pt,{state:"proceeding",proceed:void 0,reset:void 0,location:fe}),k(U,W)},reset(){let yt=new Map(E.blockers);yt.set(pt,Za),Pe({blockers:yt})}});return}return await G(Le,fe,{submission:ke,pendingError:Ae,preventScrollReset:ze,replace:W&&W.replace,enableViewTransition:W&&W.unstable_viewTransition,flushSync:gt})}function J(){if(Ye(),Pe({revalidation:"loading"}),E.navigation.state!=="submitting"){if(E.navigation.state==="idle"){G(E.historyAction,E.location,{startUninterruptedRevalidation:!0});return}G(R||E.historyAction,E.navigation.location,{overrideNavigation:E.navigation})}}async function G(U,W,Z){A&&A.abort(),A=null,R=U,F=(Z&&Z.startUninterruptedRevalidation)===!0,oT(E.location,E.matches),P=(Z&&Z.preventScrollReset)===!0,L=(Z&&Z.enableViewTransition)===!0;let re=l||i,ke=Z&&Z.overrideNavigation,Ae=Mo(re,W,c),Ve=(Z&&Z.flushSync)===!0,fe=ch(Ae,re,W.pathname);if(fe.active&&fe.matches&&(Ae=fe.matches),!Ae){let{error:dt,notFoundMatches:er,route:$t}=vi(W.pathname);nt(W,{matches:er,loaderData:{},errors:{[$t.id]:dt}},{flushSync:Ve});return}if(E.initialized&&!b&&SP(E.location,W)&&!(Z&&Z.submission&&hn(Z.submission.formMethod))){nt(W,{matches:Ae},{flushSync:Ve});return}A=new AbortController;let Ze=bi(e.history,W,A.signal,Z&&Z.submission),Le;if(Z&&Z.pendingError)Le=[Vi(Ae).route.id,{type:xt.error,error:Z.pendingError}];else if(Z&&Z.submission&&hn(Z.submission.formMethod)){let dt=await D(Ze,W,Z.submission,Ae,fe.active,{replace:Z.replace,flushSync:Ve});if(dt.shortCircuited)return;if(dt.pendingActionResult){let[er,$t]=dt.pendingActionResult;if(Lr($t)&&vf($t.error)&&$t.error.status===404){A=null,nt(W,{matches:dt.matches,loaderData:{},errors:{[er]:$t.error}});return}}Ae=dt.matches||Ae,Le=dt.pendingActionResult,ke=Fh(W,Z.submission),Ve=!1,fe.active=!1,Ze=bi(e.history,Ze.url,Ze.signal)}let{shortCircuited:ze,matches:gt,loaderData:pt,errors:yt}=await S(Ze,W,Ae,fe.active,ke,Z&&Z.submission,Z&&Z.fetcherSubmission,Z&&Z.replace,Z&&Z.initialHydration===!0,Ve,Le);ze||(A=null,nt(W,Pt({matches:gt||Ae},p0(Le),{loaderData:pt,errors:yt})))}async function D(U,W,Z,re,ke,Ae){Ae===void 0&&(Ae={}),Ye();let Ve=NP(W,Z);if(Pe({navigation:Ve},{flushSync:Ae.flushSync===!0}),ke){let Le=await Hc(re,W.pathname,U.signal);if(Le.type==="aborted")return{shortCircuited:!0};if(Le.type==="error"){let{boundaryId:ze,error:gt}=An(W.pathname,Le);return{matches:Le.partialMatches,pendingActionResult:[ze,{type:xt.error,error:gt}]}}else if(Le.matches)re=Le.matches;else{let{notFoundMatches:ze,error:gt,route:pt}=vi(W.pathname);return{matches:ze,pendingActionResult:[pt.id,{type:xt.error,error:gt}]}}}let fe,Ze=al(re,W);if(!Ze.route.action&&!Ze.route.lazy)fe={type:xt.error,error:mr(405,{method:U.method,pathname:W.pathname,routeId:Ze.route.id})};else if(fe=(await ee("action",U,[Ze],re))[0],U.signal.aborted)return{shortCircuited:!0};if(Vo(fe)){let Le;return Ae&&Ae.replace!=null?Le=Ae.replace:Le=u0(fe.response.headers.get("Location"),new URL(U.url),c)===E.location.pathname+E.location.search,await X(U,fe,{submission:Z,replace:Le}),{shortCircuited:!0}}if($o(fe))throw mr(400,{type:"defer-action"});if(Lr(fe)){let Le=Vi(re,Ze.route.id);return(Ae&&Ae.replace)!==!0&&(R=Vt.Push),{matches:re,pendingActionResult:[Le.route.id,fe]}}return{matches:re,pendingActionResult:[Ze.route.id,fe]}}async function S(U,W,Z,re,ke,Ae,Ve,fe,Ze,Le,ze){let gt=ke||Fh(W,Ae),pt=Ae||Ve||y0(gt),yt=!F&&(!f.v7_partialHydration||!Ze);if(re){if(yt){let It=T(ze);Pe(Pt({navigation:gt},It!==void 0?{actionData:It}:{}),{flushSync:Le})}let Qe=await Hc(Z,W.pathname,U.signal);if(Qe.type==="aborted")return{shortCircuited:!0};if(Qe.type==="error"){let{boundaryId:It,error:Dr}=An(W.pathname,Qe);return{matches:Qe.partialMatches,loaderData:{},errors:{[It]:Dr}}}else if(Qe.matches)Z=Qe.matches;else{let{error:It,notFoundMatches:Dr,route:Et}=vi(W.pathname);return{matches:Dr,loaderData:{},errors:{[Et.id]:It}}}}let dt=l||i,[er,$t]=a0(e.history,E,Z,pt,W,f.v7_partialHydration&&Ze===!0,f.v7_skipActionErrorRevalidation,b,V,te,ne,$,z,dt,c,ze);if(Us(Qe=>!(Z&&Z.some(It=>It.route.id===Qe))||er&&er.some(It=>It.route.id===Qe)),I=++K,er.length===0&&$t.length===0){let Qe=es();return nt(W,Pt({matches:Z,loaderData:{},errors:ze&&Lr(ze[1])?{[ze[0]]:ze[1].error}:null},p0(ze),Qe?{fetchers:new Map(E.fetchers)}:{}),{flushSync:Le}),{shortCircuited:!0}}if(yt){let Qe={};if(!re){Qe.navigation=gt;let It=T(ze);It!==void 0&&(Qe.actionData=It)}$t.length>0&&(Qe.fetchers=O($t)),Pe(Qe,{flushSync:Le})}$t.forEach(Qe=>{B.has(Qe.key)&&at(Qe.key),Qe.controller&&B.set(Qe.key,Qe.controller)});let Ua=()=>$t.forEach(Qe=>at(Qe.key));A&&A.signal.addEventListener("abort",Ua);let{loaderResults:$s,fetcherResults:yi}=await me(E.matches,Z,er,$t,U);if(U.signal.aborted)return{shortCircuited:!0};A&&A.signal.removeEventListener("abort",Ua),$t.forEach(Qe=>B.delete(Qe.key));let xi=g0([...$s,...yi]);if(xi){if(xi.idx>=er.length){let Qe=$t[xi.idx-er.length].key;z.add(Qe)}return await X(U,xi.result,{replace:fe}),{shortCircuited:!0}}let{loaderData:wi,errors:Dn}=f0(E,Z,er,$s,ze,$t,yi,se);se.forEach((Qe,It)=>{Qe.subscribe(Dr=>{(Dr||Qe.done)&&se.delete(It)})}),f.v7_partialHydration&&Ze&&E.errors&&Object.entries(E.errors).filter(Qe=>{let[It]=Qe;return!er.some(Dr=>Dr.route.id===It)}).forEach(Qe=>{let[It,Dr]=Qe;Dn=Object.assign(Dn||{},{[It]:Dr})});let Yc=es(),Kc=Xr(I),Gc=Yc||Kc||$t.length>0;return Pt({matches:Z,loaderData:wi,errors:Dn},Gc?{fetchers:new Map(E.fetchers)}:{})}function T(U){if(U&&!Lr(U[1]))return{[U[0]]:U[1].data};if(E.actionData)return Object.keys(E.actionData).length===0?null:E.actionData}function O(U){return U.forEach(W=>{let Z=E.fetchers.get(W.key),re=qa(void 0,Z?Z.data:void 0);E.fetchers.set(W.key,re)}),new Map(E.fetchers)}function Y(U,W,Z,re){if(n)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");B.has(U)&&at(U);let ke=(re&&re.unstable_flushSync)===!0,Ae=l||i,Ve=Jp(E.location,E.matches,c,f.v7_prependBasename,Z,f.v7_relativeSplatPath,W,re==null?void 0:re.relative),fe=Mo(Ae,Ve,c),Ze=ch(fe,Ae,Ve);if(Ze.active&&Ze.matches&&(fe=Ze.matches),!fe){jt(U,W,mr(404,{pathname:Ve}),{flushSync:ke});return}let{path:Le,submission:ze,error:gt}=i0(f.v7_normalizeFormMethod,!0,Ve,re);if(gt){jt(U,W,gt,{flushSync:ke});return}let pt=al(fe,Le);if(P=(re&&re.preventScrollReset)===!0,ze&&hn(ze.formMethod)){M(U,W,Le,pt,fe,Ze.active,ke,ze);return}$.set(U,{routeId:W,path:Le}),H(U,W,Le,pt,fe,Ze.active,ke,ze)}async function M(U,W,Z,re,ke,Ae,Ve,fe){Ye(),$.delete(U);function Ze(Et){if(!Et.route.action&&!Et.route.lazy){let ts=mr(405,{method:fe.formMethod,pathname:Z,routeId:W});return jt(U,W,ts,{flushSync:Ve}),!0}return!1}if(!Ae&&Ze(re))return;let Le=E.fetchers.get(U);Ue(U,TP(fe,Le),{flushSync:Ve});let ze=new AbortController,gt=bi(e.history,Z,ze.signal,fe);if(Ae){let Et=await Hc(ke,Z,gt.signal);if(Et.type==="aborted")return;if(Et.type==="error"){let{error:ts}=An(Z,Et);jt(U,W,ts,{flushSync:Ve});return}else if(Et.matches){if(ke=Et.matches,re=al(ke,Z),Ze(re))return}else{jt(U,W,mr(404,{pathname:Z}),{flushSync:Ve});return}}B.set(U,ze);let pt=K,dt=(await ee("action",gt,[re],ke))[0];if(gt.signal.aborted){B.get(U)===ze&&B.delete(U);return}if(f.v7_fetcherPersist&&ne.has(U)){if(Vo(dt)||Lr(dt)){Ue(U,Hs(void 0));return}}else{if(Vo(dt))if(B.delete(U),I>pt){Ue(U,Hs(void 0));return}else return z.add(U),Ue(U,qa(fe)),X(gt,dt,{fetcherSubmission:fe});if(Lr(dt)){jt(U,W,dt.error);return}}if($o(dt))throw mr(400,{type:"defer-action"});let er=E.navigation.location||E.location,$t=bi(e.history,er,ze.signal),Ua=l||i,$s=E.navigation.state!=="idle"?Mo(Ua,E.navigation.location,c):E.matches;et($s,"Didn't find any matches after fetcher action");let yi=++K;Q.set(U,yi);let xi=qa(fe,dt.data);E.fetchers.set(U,xi);let[wi,Dn]=a0(e.history,E,$s,fe,er,!1,f.v7_skipActionErrorRevalidation,b,V,te,ne,$,z,Ua,c,[re.route.id,dt]);Dn.filter(Et=>Et.key!==U).forEach(Et=>{let ts=Et.key,Yy=E.fetchers.get(ts),lT=qa(void 0,Yy?Yy.data:void 0);E.fetchers.set(ts,lT),B.has(ts)&&at(ts),Et.controller&&B.set(ts,Et.controller)}),Pe({fetchers:new Map(E.fetchers)});let Yc=()=>Dn.forEach(Et=>at(Et.key));ze.signal.addEventListener("abort",Yc);let{loaderResults:Kc,fetcherResults:Gc}=await me(E.matches,$s,wi,Dn,$t);if(ze.signal.aborted)return;ze.signal.removeEventListener("abort",Yc),Q.delete(U),B.delete(U),Dn.forEach(Et=>B.delete(Et.key));let Qe=g0([...Kc,...Gc]);if(Qe){if(Qe.idx>=wi.length){let Et=Dn[Qe.idx-wi.length].key;z.add(Et)}return X($t,Qe.result)}let{loaderData:It,errors:Dr}=f0(E,E.matches,wi,Kc,void 0,Dn,Gc,se);if(E.fetchers.has(U)){let Et=Hs(dt.data);E.fetchers.set(U,Et)}Xr(yi),E.navigation.state==="loading"&&yi>I?(et(R,"Expected pending action"),A&&A.abort(),nt(E.navigation.location,{matches:$s,loaderData:It,errors:Dr,fetchers:new Map(E.fetchers)})):(Pe({errors:Dr,loaderData:h0(E.loaderData,It,$s,Dr),fetchers:new Map(E.fetchers)}),b=!1)}async function H(U,W,Z,re,ke,Ae,Ve,fe){let Ze=E.fetchers.get(U);Ue(U,qa(fe,Ze?Ze.data:void 0),{flushSync:Ve});let Le=new AbortController,ze=bi(e.history,Z,Le.signal);if(Ae){let dt=await Hc(ke,Z,ze.signal);if(dt.type==="aborted")return;if(dt.type==="error"){let{error:er}=An(Z,dt);jt(U,W,er,{flushSync:Ve});return}else if(dt.matches)ke=dt.matches,re=al(ke,Z);else{jt(U,W,mr(404,{pathname:Z}),{flushSync:Ve});return}}B.set(U,Le);let gt=K,yt=(await ee("loader",ze,[re],ke))[0];if($o(yt)&&(yt=await J1(yt,ze.signal,!0)||yt),B.get(U)===Le&&B.delete(U),!ze.signal.aborted){if(ne.has(U)){Ue(U,Hs(void 0));return}if(Vo(yt))if(I>gt){Ue(U,Hs(void 0));return}else{z.add(U),await X(ze,yt);return}if(Lr(yt)){jt(U,W,yt.error);return}et(!$o(yt),"Unhandled fetcher deferred data"),Ue(U,Hs(yt.data))}}async function X(U,W,Z){let{submission:re,fetcherSubmission:ke,replace:Ae}=Z===void 0?{}:Z;W.response.headers.has("X-Remix-Revalidate")&&(b=!0);let Ve=W.response.headers.get("Location");et(Ve,"Expected a Location header on the redirect Response"),Ve=u0(Ve,new URL(U.url),c);let fe=Kl(E.location,Ve,{_isRedirect:!0});if(r){let yt=!1;if(W.response.headers.has("X-Remix-Reload-Document"))yt=!0;else if(Og.test(Ve)){const dt=e.history.createURL(Ve);yt=dt.origin!==t.location.origin||Ea(dt.pathname,c)==null}if(yt){Ae?t.location.replace(Ve):t.location.assign(Ve);return}}A=null;let Ze=Ae===!0?Vt.Replace:Vt.Push,{formMethod:Le,formAction:ze,formEncType:gt}=E.navigation;!re&&!ke&&Le&&ze&>&&(re=y0(E.navigation));let pt=re||ke;if(cP.has(W.response.status)&&pt&&hn(pt.formMethod))await G(Ze,fe,{submission:Pt({},pt,{formAction:Ve}),preventScrollReset:P});else{let yt=Fh(fe,re);await G(Ze,fe,{overrideNavigation:yt,fetcherSubmission:ke,preventScrollReset:P})}}async function ee(U,W,Z,re){try{let ke=await yP(u,U,W,Z,re,o,s);return await Promise.all(ke.map((Ae,Ve)=>{if(CP(Ae)){let fe=Ae.result;return{type:xt.redirect,response:_P(fe,W,Z[Ve].route.id,re,c,f.v7_relativeSplatPath)}}return wP(Ae)}))}catch(ke){return Z.map(()=>({type:xt.error,error:ke}))}}async function me(U,W,Z,re,ke){let[Ae,...Ve]=await Promise.all([Z.length?ee("loader",ke,Z,W):[],...re.map(fe=>{if(fe.matches&&fe.match&&fe.controller){let Ze=bi(e.history,fe.path,fe.controller.signal);return ee("loader",Ze,[fe.match],fe.matches).then(Le=>Le[0])}else return Promise.resolve({type:xt.error,error:mr(404,{pathname:fe.path})})})]);return await Promise.all([v0(U,Z,Ae,Ae.map(()=>ke.signal),!1,E.loaderData),v0(U,re.map(fe=>fe.match),Ve,re.map(fe=>fe.controller?fe.controller.signal:null),!0)]),{loaderResults:Ae,fetcherResults:Ve}}function Ye(){b=!0,V.push(...Us()),$.forEach((U,W)=>{B.has(W)&&(te.push(W),at(W))})}function Ue(U,W,Z){Z===void 0&&(Z={}),E.fetchers.set(U,W),Pe({fetchers:new Map(E.fetchers)},{flushSync:(Z&&Z.flushSync)===!0})}function jt(U,W,Z,re){re===void 0&&(re={});let ke=Vi(E.matches,W);Ht(U),Pe({errors:{[ke.route.id]:Z},fetchers:new Map(E.fetchers)},{flushSync:(re&&re.flushSync)===!0})}function qr(U){return f.v7_fetcherPersist&&(he.set(U,(he.get(U)||0)+1),ne.has(U)&&ne.delete(U)),E.fetchers.get(U)||uP}function Ht(U){let W=E.fetchers.get(U);B.has(U)&&!(W&&W.state==="loading"&&Q.has(U))&&at(U),$.delete(U),Q.delete(U),z.delete(U),ne.delete(U),E.fetchers.delete(U)}function Qn(U){if(f.v7_fetcherPersist){let W=(he.get(U)||0)-1;W<=0?(he.delete(U),ne.add(U)):he.set(U,W)}else Ht(U);Pe({fetchers:new Map(E.fetchers)})}function at(U){let W=B.get(U);et(W,"Expected fetch controller: "+U),W.abort(),B.delete(U)}function Jn(U){for(let W of U){let Z=qr(W),re=Hs(Z.data);E.fetchers.set(W,re)}}function es(){let U=[],W=!1;for(let Z of z){let re=E.fetchers.get(Z);et(re,"Expected fetcher: "+Z),re.state==="loading"&&(z.delete(Z),U.push(Z),W=!0)}return Jn(U),W}function Xr(U){let W=[];for(let[Z,re]of Q)if(re0}function Vc(U,W){let Z=E.blockers.get(U)||Za;return Oe.get(U)!==W&&Oe.set(U,W),Z}function Bc(U){E.blockers.delete(U),Oe.delete(U)}function gi(U,W){let Z=E.blockers.get(U)||Za;et(Z.state==="unblocked"&&W.state==="blocked"||Z.state==="blocked"&&W.state==="blocked"||Z.state==="blocked"&&W.state==="proceeding"||Z.state==="blocked"&&W.state==="unblocked"||Z.state==="proceeding"&&W.state==="unblocked","Invalid blocker state transition: "+Z.state+" -> "+W.state);let re=new Map(E.blockers);re.set(U,W),Pe({blockers:re})}function Wc(U){let{currentLocation:W,nextLocation:Z,historyAction:re}=U;if(Oe.size===0)return;Oe.size>1&&ri(!1,"A router only supports one blocker at a time");let ke=Array.from(Oe.entries()),[Ae,Ve]=ke[ke.length-1],fe=E.blockers.get(Ae);if(!(fe&&fe.state==="proceeding")&&Ve({currentLocation:W,nextLocation:Z,historyAction:re}))return Ae}function vi(U){let W=mr(404,{pathname:U}),Z=l||i,{matches:re,route:ke}=m0(Z);return Us(),{notFoundMatches:re,route:ke,error:W}}function An(U,W){return{boundaryId:Vi(W.partialMatches).route.id,error:mr(400,{type:"route-discovery",pathname:U,message:W.error!=null&&"message"in W.error?W.error:String(W.error)})}}function Us(U){let W=[];return se.forEach((Z,re)=>{(!U||U(re))&&(Z.cancel(),W.push(re),se.delete(re))}),W}function sT(U,W,Z){if(x=U,_=W,y=Z||null,!p&&E.navigation===Lh){p=!0;let re=Hy(E.location,E.matches);re!=null&&Pe({restoreScrollPosition:re})}return()=>{x=null,_=null,y=null}}function Wy(U,W){return y&&y(U,W.map(re=>$R(re,E.loaderData)))||U.key}function oT(U,W){if(x&&_){let Z=Wy(U,W);x[Z]=_()}}function Hy(U,W){if(x){let Z=Wy(U,W),re=x[Z];if(typeof re=="number")return re}return null}function ch(U,W,Z){if(d)if(U){let re=U[U.length-1].route;if(re.path&&(re.path==="*"||re.path.endsWith("/*")))return{active:!0,matches:zu(W,Z,c,!0)}}else return{active:!0,matches:zu(W,Z,c,!0)||[]};return{active:!1,matches:null}}async function Hc(U,W,Z){let re=U,ke=re.length>0?re[re.length-1].route:null;for(;;){let Ae=l==null,Ve=l||i;try{await gP(d,W,re,Ve,o,s,pe,Z)}catch(ze){return{type:"error",error:ze,partialMatches:re}}finally{Ae&&(i=[...i])}if(Z.aborted)return{type:"aborted"};let fe=Mo(Ve,W,c),Ze=!1;if(fe){let ze=fe[fe.length-1].route;if(ze.index)return{type:"success",matches:fe};if(ze.path&&ze.path.length>0)if(ze.path==="*")Ze=!0;else return{type:"success",matches:fe}}let Le=zu(Ve,W,c,!0);if(!Le||re.map(ze=>ze.route.id).join("-")===Le.map(ze=>ze.route.id).join("-"))return{type:"success",matches:Ze?fe:null};if(re=Le,ke=re[re.length-1].route,ke.path==="*")return{type:"success",matches:re}}}function iT(U){o={},l=Gl(U,s,void 0,o)}function aT(U,W){let Z=l==null;q1(U,W,l||i,o,s),Z&&(i=[...i],Pe({}))}return j={get basename(){return c},get future(){return f},get state(){return E},get routes(){return i},get window(){return t},initialize:Te,subscribe:Me,enableScrollRestoration:sT,navigate:k,fetch:Y,revalidate:J,createHref:U=>e.history.createHref(U),encodeLocation:U=>e.history.encodeLocation(U),getFetcher:qr,deleteFetcher:Qn,dispose:Fe,getBlocker:Vc,deleteBlocker:Bc,patchRoutes:aT,_internalFetchControllers:B,_internalActiveDeferreds:se,_internalSetRoutes:iT},j}function hP(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Jp(e,t,r,n,s,o,i,l){let c,u;if(i){c=[];for(let f of t)if(c.push(f),f.route.id===i){u=f;break}}else c=t,u=t[t.length-1];let d=gf(s||".",mf(c,o),Ea(e.pathname,r)||e.pathname,l==="path");return s==null&&(d.search=e.search,d.hash=e.hash),(s==null||s===""||s===".")&&u&&u.route.index&&!Mg(d.search)&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),n&&r!=="/"&&(d.pathname=d.pathname==="/"?r:ms([r,d.pathname])),ni(d)}function i0(e,t,r,n){if(!n||!hP(n))return{path:r};if(n.formMethod&&!EP(n.formMethod))return{path:r,error:mr(405,{method:n.formMethod})};let s=()=>({path:r,error:mr(400,{type:"invalid-body"})}),o=n.formMethod||"get",i=e?o.toUpperCase():o.toLowerCase(),l=X1(r);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!hn(i))return s();let m=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((v,x)=>{let[y,_]=x;return""+v+y+"="+_+` +`},""):String(n.body);return{path:r,submission:{formMethod:i,formAction:l,formEncType:n.formEncType,formData:void 0,json:void 0,text:m}}}else if(n.formEncType==="application/json"){if(!hn(i))return s();try{let m=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:i,formAction:l,formEncType:n.formEncType,formData:void 0,json:m,text:void 0}}}catch{return s()}}}et(typeof FormData=="function","FormData is not available in this environment");let c,u;if(n.formData)c=em(n.formData),u=n.formData;else if(n.body instanceof FormData)c=em(n.body),u=n.body;else if(n.body instanceof URLSearchParams)c=n.body,u=d0(c);else if(n.body==null)c=new URLSearchParams,u=new FormData;else try{c=new URLSearchParams(n.body),u=d0(c)}catch{return s()}let d={formMethod:i,formAction:l,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(hn(d.formMethod))return{path:r,submission:d};let f=Rs(r);return t&&f.search&&Mg(f.search)&&c.append("index",""),f.search="?"+c,{path:ni(f),submission:d}}function pP(e,t){let r=e;if(t){let n=e.findIndex(s=>s.route.id===t);n>=0&&(r=e.slice(0,n))}return r}function a0(e,t,r,n,s,o,i,l,c,u,d,f,m,v,x,y){let _=y?Lr(y[1])?y[1].error:y[1].data:void 0,p=e.createURL(t.location),h=e.createURL(s),w=y&&Lr(y[1])?y[0]:void 0,C=w?pP(r,w):r,j=y?y[1].statusCode:void 0,E=i&&j&&j>=400,R=C.filter((A,L)=>{let{route:q}=A;if(q.lazy)return!0;if(q.loader==null)return!1;if(o)return typeof q.loader!="function"||q.loader.hydrate?!0:t.loaderData[q.id]===void 0&&(!t.errors||t.errors[q.id]===void 0);if(mP(t.loaderData,t.matches[L],A)||c.some(b=>b===A.route.id))return!0;let N=t.matches[L],F=A;return l0(A,Pt({currentUrl:p,currentParams:N.params,nextUrl:h,nextParams:F.params},n,{actionResult:_,actionStatus:j,defaultShouldRevalidate:E?!1:l||p.pathname+p.search===h.pathname+h.search||p.search!==h.search||Z1(N,F)}))}),P=[];return f.forEach((A,L)=>{if(o||!r.some(V=>V.route.id===A.routeId)||d.has(L))return;let q=Mo(v,A.path,x);if(!q){P.push({key:L,routeId:A.routeId,path:A.path,matches:null,match:null,controller:null});return}let N=t.fetchers.get(L),F=al(q,A.path),b=!1;m.has(L)?b=!1:u.includes(L)?b=!0:N&&N.state!=="idle"&&N.data===void 0?b=l:b=l0(F,Pt({currentUrl:p,currentParams:t.matches[t.matches.length-1].params,nextUrl:h,nextParams:r[r.length-1].params},n,{actionResult:_,actionStatus:j,defaultShouldRevalidate:E?!1:l})),b&&P.push({key:L,routeId:A.routeId,path:A.path,matches:q,match:F,controller:new AbortController})}),[R,P]}function mP(e,t,r){let n=!t||r.route.id!==t.route.id,s=e[r.route.id]===void 0;return n||s}function Z1(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function l0(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}async function gP(e,t,r,n,s,o,i,l){let c=[t,...r.map(u=>u.route.id)].join("-");try{let u=i.get(c);u||(u=e({path:t,matches:r,patch:(d,f)=>{l.aborted||q1(d,f,n,s,o)}}),i.set(c,u)),u&&kP(u)&&await u}finally{i.delete(c)}}function q1(e,t,r,n,s){if(e){var o;let i=n[e];et(i,"No route found to patch children into: routeId = "+e);let l=Gl(t,s,[e,"patch",String(((o=i.children)==null?void 0:o.length)||"0")],n);i.children?i.children.push(...l):i.children=l}else{let i=Gl(t,s,["patch",String(r.length||"0")],n);r.push(...i)}}async function c0(e,t,r){if(!e.lazy)return;let n=await e.lazy();if(!e.lazy)return;let s=r[e.id];et(s,"No route found in manifest");let o={};for(let i in n){let c=s[i]!==void 0&&i!=="hasErrorBoundary";ri(!c,'Route "'+s.id+'" has a static property "'+i+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+i+'" will be ignored.')),!c&&!zR.has(i)&&(o[i]=n[i])}Object.assign(s,o),Object.assign(s,Pt({},t(s),{lazy:void 0}))}function vP(e){return Promise.all(e.matches.map(t=>t.resolve()))}async function yP(e,t,r,n,s,o,i,l){let c=n.reduce((f,m)=>f.add(m.route.id),new Set),u=new Set,d=await e({matches:s.map(f=>{let m=c.has(f.route.id);return Pt({},f,{shouldLoad:m,resolve:x=>(u.add(f.route.id),m?xP(t,r,f,o,i,x,l):Promise.resolve({type:xt.data,result:void 0}))})}),request:r,params:s[0].params,context:l});return s.forEach(f=>et(u.has(f.route.id),'`match.resolve()` was not called for route id "'+f.route.id+'". You must call `match.resolve()` on every match passed to `dataStrategy` to ensure all routes are properly loaded.')),d.filter((f,m)=>c.has(s[m].route.id))}async function xP(e,t,r,n,s,o,i){let l,c,u=d=>{let f,m=new Promise((y,_)=>f=_);c=()=>f(),t.signal.addEventListener("abort",c);let v=y=>typeof d!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+r.route.id+"]"))):d({request:t,params:r.params,context:i},...y!==void 0?[y]:[]),x;return o?x=o(y=>v(y)):x=(async()=>{try{return{type:"data",result:await v()}}catch(y){return{type:"error",result:y}}})(),Promise.race([x,m])};try{let d=r.route[e];if(r.route.lazy)if(d){let f,[m]=await Promise.all([u(d).catch(v=>{f=v}),c0(r.route,s,n)]);if(f!==void 0)throw f;l=m}else if(await c0(r.route,s,n),d=r.route[e],d)l=await u(d);else if(e==="action"){let f=new URL(t.url),m=f.pathname+f.search;throw mr(405,{method:t.method,pathname:m,routeId:r.route.id})}else return{type:xt.data,result:void 0};else if(d)l=await u(d);else{let f=new URL(t.url),m=f.pathname+f.search;throw mr(404,{pathname:m})}et(l.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+r.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(d){return{type:xt.error,result:d}}finally{c&&t.signal.removeEventListener("abort",c)}return l}async function wP(e){let{result:t,type:r,status:n}=e;if(Q1(t)){let i;try{let l=t.headers.get("Content-Type");l&&/\bapplication\/json\b/.test(l)?t.body==null?i=null:i=await t.json():i=await t.text()}catch(l){return{type:xt.error,error:l}}return r===xt.error?{type:xt.error,error:new Dg(t.status,t.statusText,i),statusCode:t.status,headers:t.headers}:{type:xt.data,data:i,statusCode:t.status,headers:t.headers}}if(r===xt.error)return{type:xt.error,error:t,statusCode:vf(t)?t.status:n};if(jP(t)){var s,o;return{type:xt.deferred,deferredData:t,statusCode:(s=t.init)==null?void 0:s.status,headers:((o=t.init)==null?void 0:o.headers)&&new Headers(t.init.headers)}}return{type:xt.data,data:t,statusCode:n}}function _P(e,t,r,n,s,o){let i=e.headers.get("Location");if(et(i,"Redirects returned/thrown from loaders/actions must have a Location header"),!Og.test(i)){let l=n.slice(0,n.findIndex(c=>c.route.id===r)+1);i=Jp(new URL(t.url),l,s,!0,i,o),e.headers.set("Location",i)}return e}function u0(e,t,r){if(Og.test(e)){let n=e,s=n.startsWith("//")?new URL(t.protocol+n):new URL(n),o=Ea(s.pathname,r)!=null;if(s.origin===t.origin&&o)return s.pathname+s.search+s.hash}return e}function bi(e,t,r,n){let s=e.createURL(X1(t)).toString(),o={signal:r};if(n&&hn(n.formMethod)){let{formMethod:i,formEncType:l}=n;o.method=i.toUpperCase(),l==="application/json"?(o.headers=new Headers({"Content-Type":l}),o.body=JSON.stringify(n.json)):l==="text/plain"?o.body=n.text:l==="application/x-www-form-urlencoded"&&n.formData?o.body=em(n.formData):o.body=n.formData}return new Request(s,o)}function em(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,typeof n=="string"?n:n.name);return t}function d0(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function bP(e,t,r,n,s,o){let i={},l=null,c,u=!1,d={},f=n&&Lr(n[1])?n[1].error:void 0;return r.forEach((m,v)=>{let x=t[v].route.id;if(et(!Vo(m),"Cannot handle redirect results in processLoaderData"),Lr(m)){let y=m.error;f!==void 0&&(y=f,f=void 0),l=l||{};{let _=Vi(e,x);l[_.route.id]==null&&(l[_.route.id]=y)}i[x]=void 0,u||(u=!0,c=vf(m.error)?m.error.status:500),m.headers&&(d[x]=m.headers)}else $o(m)?(s.set(x,m.deferredData),i[x]=m.deferredData.data,m.statusCode!=null&&m.statusCode!==200&&!u&&(c=m.statusCode),m.headers&&(d[x]=m.headers)):(i[x]=m.data,m.statusCode&&m.statusCode!==200&&!u&&(c=m.statusCode),m.headers&&(d[x]=m.headers))}),f!==void 0&&n&&(l={[n[0]]:f},i[n[0]]=void 0),{loaderData:i,errors:l,statusCode:c||200,loaderHeaders:d}}function f0(e,t,r,n,s,o,i,l){let{loaderData:c,errors:u}=bP(t,r,n,s,l);for(let d=0;dn.route.id===t)+1):[...e]).reverse().find(n=>n.route.hasErrorBoundary===!0)||e[0]}function m0(e){let t=e.length===1?e[0]:e.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function mr(e,t){let{pathname:r,routeId:n,method:s,type:o,message:i}=t===void 0?{}:t,l="Unknown Server Error",c="Unknown @remix-run/router error";return e===400?(l="Bad Request",o==="route-discovery"?c='Unable to match URL "'+r+'" - the `unstable_patchRoutesOnMiss()` '+(`function threw the following error: +`+i):s&&r&&n?c="You made a "+s+' request to "'+r+'" but '+('did not provide a `loader` for route "'+n+'", ')+"so there is no way to handle the request.":o==="defer-action"?c="defer() is not supported in actions":o==="invalid-body"&&(c="Unable to encode submission body")):e===403?(l="Forbidden",c='Route "'+n+'" does not match URL "'+r+'"'):e===404?(l="Not Found",c='No route matches URL "'+r+'"'):e===405&&(l="Method Not Allowed",s&&r&&n?c="You made a "+s.toUpperCase()+' request to "'+r+'" but '+('did not provide an `action` for route "'+n+'", ')+"so there is no way to handle the request.":s&&(c='Invalid request method "'+s.toUpperCase()+'"')),new Dg(e||500,l,new Error(c),!0)}function g0(e){for(let t=e.length-1;t>=0;t--){let r=e[t];if(Vo(r))return{result:r,idx:t}}}function X1(e){let t=typeof e=="string"?Rs(e):e;return ni(Pt({},t,{hash:""}))}function SP(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function kP(e){return typeof e=="object"&&e!=null&&"then"in e}function CP(e){return Q1(e.result)&&lP.has(e.result.status)}function $o(e){return e.type===xt.deferred}function Lr(e){return e.type===xt.error}function Vo(e){return(e&&e.type)===xt.redirect}function jP(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function Q1(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function EP(e){return aP.has(e.toLowerCase())}function hn(e){return oP.has(e.toLowerCase())}async function v0(e,t,r,n,s,o){for(let i=0;if.route.id===c.route.id),d=u!=null&&!Z1(u,c)&&(o&&o[c.route.id])!==void 0;if($o(l)&&(s||d)){let f=n[i];et(f,"Expected an AbortSignal for revalidating fetcher deferred result"),await J1(l,f,s).then(m=>{m&&(r[i]=m||r[i])})}}}async function J1(e,t,r){if(r===void 0&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:xt.data,data:e.deferredData.unwrappedData}}catch(s){return{type:xt.error,error:s}}return{type:xt.data,data:e.deferredData.data}}}function Mg(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function al(e,t){let r=typeof t=="string"?Rs(t).search:t.search;if(e[e.length-1].route.index&&Mg(r||""))return e[e.length-1];let n=Y1(e);return n[n.length-1]}function y0(e){let{formMethod:t,formAction:r,formEncType:n,text:s,formData:o,json:i}=e;if(!(!t||!r||!n)){if(s!=null)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:s};if(o!=null)return{formMethod:t,formAction:r,formEncType:n,formData:o,json:void 0,text:void 0};if(i!==void 0)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:i,text:void 0}}}function Fh(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function NP(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function qa(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function TP(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function Hs(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function RP(e,t){try{let r=e.sessionStorage.getItem(G1);if(r){let n=JSON.parse(r);for(let[s,o]of Object.entries(n||{}))o&&Array.isArray(o)&&t.set(s,new Set(o||[]))}}catch{}}function PP(e,t){if(t.size>0){let r={};for(let[n,s]of t)r[n]=[...s];try{e.sessionStorage.setItem(G1,JSON.stringify(r))}catch(n){ri(!1,"Failed to save applied view transitions in sessionStorage ("+n+").")}}}/** * React Router v6.25.1 * * Copyright (c) Remix Software Inc. @@ -57,7 +57,7 @@ Error generating stack: `+o.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function _d(){return _d=Object.assign?Object.assign.bind():function(e){for(var t=1;t{a.current=!0}),g.useCallback(function(u,d){if(d===void 0&&(d={}),!a.current)return;if(typeof u=="number"){n.go(u);return}let f=gf(u,JSON.parse(i),o,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:ms([t,f.pathname])),(d.replace?n.replace:n.push)(f,d.state,d)},[t,n,i,o,e])}const OP=g.createContext(null);function MP(e){let t=g.useContext(Ps).outlet;return t&&g.createElement(OP.Provider,{value:e},t)}function nb(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=g.useContext(jo),{matches:s}=g.useContext(Ps),{pathname:o}=Nn(),i=JSON.stringify(mf(s,n.v7_relativeSplatPath));return g.useMemo(()=>gf(e,JSON.parse(i),o,r==="path"),[e,i,o,r])}function IP(e,t,r,n){Ea()||et(!1);let{navigator:s}=g.useContext(jo),{matches:o}=g.useContext(Ps),i=o[o.length-1],a=i?i.params:{};i&&i.pathname;let c=i?i.pathnameBase:"/";i&&i.route;let u=Nn(),d;d=u;let f=d.pathname||"/",m=f;if(c!=="/"){let y=c.replace(/^\//,"").split("/");m="/"+f.replace(/^\//,"").split("/").slice(y.length).join("/")}let v=Mo(e,{pathname:m});return $P(v&&v.map(y=>Object.assign({},y,{params:Object.assign({},a,y.params),pathname:ms([c,s.encodeLocation?s.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?c:ms([c,s.encodeLocation?s.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),o,r,n)}function LP(){let e=HP(),t=vf(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return g.createElement(g.Fragment,null,g.createElement("h2",null,"Unexpected Application Error!"),g.createElement("h3",{style:{fontStyle:"italic"}},t),r?g.createElement("pre",{style:s},r):null,null)}const FP=g.createElement(LP,null);class zP extends g.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?g.createElement(Ps.Provider,{value:this.props.routeContext},g.createElement(tb.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function UP(e){let{routeContext:t,match:r,children:n}=e,s=g.useContext(yf);return s&&s.static&&s.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=r.route.id),g.createElement(Ps.Provider,{value:t},n)}function $P(e,t,r,n){var s;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var o;if((o=r)!=null&&o.errors)e=r.matches;else return null}let i=e,a=(s=r)==null?void 0:s.errors;if(a!=null){let d=i.findIndex(f=>f.route.id&&(a==null?void 0:a[f.route.id])!==void 0);d>=0||et(!1),i=i.slice(0,Math.min(i.length,d+1))}let c=!1,u=-1;if(r&&n&&n.v7_partialHydration)for(let d=0;d=0?i=i.slice(0,u+1):i=[i[0]];break}}}return i.reduceRight((d,f,m)=>{let v,x=!1,y=null,_=null;r&&(v=a&&f.route.id?a[f.route.id]:void 0,y=f.route.errorElement||FP,c&&(u<0&&m===0?(KP("route-fallback"),x=!0,_=null):u===m&&(x=!0,_=f.route.hydrateFallbackElement||null)));let p=t.concat(i.slice(0,m+1)),h=()=>{let w;return v?w=y:x?w=_:f.route.Component?w=g.createElement(f.route.Component,null):f.route.element?w=f.route.element:w=d,g.createElement(UP,{match:f,routeContext:{outlet:d,matches:p,isDataRoute:r!=null},children:w})};return r&&(f.route.ErrorBoundary||f.route.errorElement||m===0)?g.createElement(zP,{location:r.location,revalidation:r.revalidation,component:y,error:v,children:h(),routeContext:{outlet:null,matches:p,isDataRoute:!0}}):h()},null)}var sb=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(sb||{}),bd=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(bd||{});function VP(e){let t=g.useContext(yf);return t||et(!1),t}function BP(e){let t=g.useContext(eb);return t||et(!1),t}function WP(e){let t=g.useContext(Ps);return t||et(!1),t}function ob(e){let t=WP(),r=t.matches[t.matches.length-1];return r.route.id||et(!1),r.route.id}function HP(){var e;let t=g.useContext(tb),r=BP(bd.UseRouteError),n=ob(bd.UseRouteError);return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function YP(){let{router:e}=VP(sb.UseNavigateStable),t=ob(bd.UseNavigateStable),r=g.useRef(!1);return rb(()=>{r.current=!0}),g.useCallback(function(s,o){o===void 0&&(o={}),r.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,_d({fromRouteId:t},o)))},[e,t])}const x0={};function KP(e,t,r){x0[e]||(x0[e]=!0)}function ib(e){let{to:t,replace:r,state:n,relative:s}=e;Ea()||et(!1);let{future:o,static:i}=g.useContext(jo),{matches:a}=g.useContext(Ps),{pathname:c}=Nn(),u=Pr(),d=gf(t,mf(a,o.v7_relativeSplatPath),c,s==="path"),f=JSON.stringify(d);return g.useEffect(()=>u(JSON.parse(f),{replace:r,state:n,relative:s}),[u,f,s,r,n]),null}function Lg(e){return MP(e.context)}function GP(e){let{basename:t="/",children:r=null,location:n,navigationType:s=Vt.Pop,navigator:o,static:i=!1,future:a}=e;Ea()&&et(!1);let c=t.replace(/^\/*/,"/"),u=g.useMemo(()=>({basename:c,navigator:o,static:i,future:_d({v7_relativeSplatPath:!1},a)}),[c,a,o,i]);typeof n=="string"&&(n=Rs(n));let{pathname:d="/",search:f="",hash:m="",state:v=null,key:x="default"}=n,y=g.useMemo(()=>{let _=ja(d,c);return _==null?null:{location:{pathname:_,search:f,hash:m,state:v,key:x},navigationType:s}},[c,d,f,m,v,x,s]);return y==null?null:g.createElement(jo.Provider,{value:u},g.createElement(Ig.Provider,{children:r,value:y}))}new Promise(()=>{});function ZP(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:g.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:g.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:g.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/** + */function _d(){return _d=Object.assign?Object.assign.bind():function(e){for(var t=1;t{l.current=!0}),g.useCallback(function(u,d){if(d===void 0&&(d={}),!l.current)return;if(typeof u=="number"){n.go(u);return}let f=gf(u,JSON.parse(i),o,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:ms([t,f.pathname])),(d.replace?n.replace:n.push)(f,d.state,d)},[t,n,i,o,e])}const OP=g.createContext(null);function MP(e){let t=g.useContext(Ps).outlet;return t&&g.createElement(OP.Provider,{value:e},t)}function nb(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=g.useContext(To),{matches:s}=g.useContext(Ps),{pathname:o}=Nn(),i=JSON.stringify(mf(s,n.v7_relativeSplatPath));return g.useMemo(()=>gf(e,JSON.parse(i),o,r==="path"),[e,i,o,r])}function IP(e,t,r,n){Na()||et(!1);let{navigator:s}=g.useContext(To),{matches:o}=g.useContext(Ps),i=o[o.length-1],l=i?i.params:{};i&&i.pathname;let c=i?i.pathnameBase:"/";i&&i.route;let u=Nn(),d;d=u;let f=d.pathname||"/",m=f;if(c!=="/"){let y=c.replace(/^\//,"").split("/");m="/"+f.replace(/^\//,"").split("/").slice(y.length).join("/")}let v=Mo(e,{pathname:m});return $P(v&&v.map(y=>Object.assign({},y,{params:Object.assign({},l,y.params),pathname:ms([c,s.encodeLocation?s.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?c:ms([c,s.encodeLocation?s.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),o,r,n)}function LP(){let e=HP(),t=vf(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return g.createElement(g.Fragment,null,g.createElement("h2",null,"Unexpected Application Error!"),g.createElement("h3",{style:{fontStyle:"italic"}},t),r?g.createElement("pre",{style:s},r):null,null)}const FP=g.createElement(LP,null);class zP extends g.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?g.createElement(Ps.Provider,{value:this.props.routeContext},g.createElement(tb.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function UP(e){let{routeContext:t,match:r,children:n}=e,s=g.useContext(yf);return s&&s.static&&s.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=r.route.id),g.createElement(Ps.Provider,{value:t},n)}function $P(e,t,r,n){var s;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var o;if((o=r)!=null&&o.errors)e=r.matches;else return null}let i=e,l=(s=r)==null?void 0:s.errors;if(l!=null){let d=i.findIndex(f=>f.route.id&&(l==null?void 0:l[f.route.id])!==void 0);d>=0||et(!1),i=i.slice(0,Math.min(i.length,d+1))}let c=!1,u=-1;if(r&&n&&n.v7_partialHydration)for(let d=0;d=0?i=i.slice(0,u+1):i=[i[0]];break}}}return i.reduceRight((d,f,m)=>{let v,x=!1,y=null,_=null;r&&(v=l&&f.route.id?l[f.route.id]:void 0,y=f.route.errorElement||FP,c&&(u<0&&m===0?(KP("route-fallback"),x=!0,_=null):u===m&&(x=!0,_=f.route.hydrateFallbackElement||null)));let p=t.concat(i.slice(0,m+1)),h=()=>{let w;return v?w=y:x?w=_:f.route.Component?w=g.createElement(f.route.Component,null):f.route.element?w=f.route.element:w=d,g.createElement(UP,{match:f,routeContext:{outlet:d,matches:p,isDataRoute:r!=null},children:w})};return r&&(f.route.ErrorBoundary||f.route.errorElement||m===0)?g.createElement(zP,{location:r.location,revalidation:r.revalidation,component:y,error:v,children:h(),routeContext:{outlet:null,matches:p,isDataRoute:!0}}):h()},null)}var sb=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(sb||{}),bd=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(bd||{});function VP(e){let t=g.useContext(yf);return t||et(!1),t}function BP(e){let t=g.useContext(eb);return t||et(!1),t}function WP(e){let t=g.useContext(Ps);return t||et(!1),t}function ob(e){let t=WP(),r=t.matches[t.matches.length-1];return r.route.id||et(!1),r.route.id}function HP(){var e;let t=g.useContext(tb),r=BP(bd.UseRouteError),n=ob(bd.UseRouteError);return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function YP(){let{router:e}=VP(sb.UseNavigateStable),t=ob(bd.UseNavigateStable),r=g.useRef(!1);return rb(()=>{r.current=!0}),g.useCallback(function(s,o){o===void 0&&(o={}),r.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,_d({fromRouteId:t},o)))},[e,t])}const x0={};function KP(e,t,r){x0[e]||(x0[e]=!0)}function ib(e){let{to:t,replace:r,state:n,relative:s}=e;Na()||et(!1);let{future:o,static:i}=g.useContext(To),{matches:l}=g.useContext(Ps),{pathname:c}=Nn(),u=Pr(),d=gf(t,mf(l,o.v7_relativeSplatPath),c,s==="path"),f=JSON.stringify(d);return g.useEffect(()=>u(JSON.parse(f),{replace:r,state:n,relative:s}),[u,f,s,r,n]),null}function Lg(e){return MP(e.context)}function GP(e){let{basename:t="/",children:r=null,location:n,navigationType:s=Vt.Pop,navigator:o,static:i=!1,future:l}=e;Na()&&et(!1);let c=t.replace(/^\/*/,"/"),u=g.useMemo(()=>({basename:c,navigator:o,static:i,future:_d({v7_relativeSplatPath:!1},l)}),[c,l,o,i]);typeof n=="string"&&(n=Rs(n));let{pathname:d="/",search:f="",hash:m="",state:v=null,key:x="default"}=n,y=g.useMemo(()=>{let _=Ea(d,c);return _==null?null:{location:{pathname:_,search:f,hash:m,state:v,key:x},navigationType:s}},[c,d,f,m,v,x,s]);return y==null?null:g.createElement(To.Provider,{value:u},g.createElement(Ig.Provider,{children:r,value:y}))}new Promise(()=>{});function ZP(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:g.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:g.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:g.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/** * React Router DOM v6.25.1 * * Copyright (c) Remix Software Inc. @@ -66,7 +66,7 @@ Error generating stack: `+o.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function Gl(){return Gl=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(r[s]=e[s]);return r}function XP(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function QP(e,t){return e.button===0&&(!t||t==="_self")&&!XP(e)}function tm(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(s=>[r,s]):[[r,n]])},[]))}function JP(e,t){let r=tm(e);return t&&t.forEach((n,s)=>{r.has(s)||t.getAll(s).forEach(o=>{r.append(s,o)})}),r}const eA=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],tA="6";try{window.__reactRouterVersion=tA}catch{}function rA(e,t){return fP({basename:void 0,future:Gl({},void 0,{v7_prependBasename:!0}),history:IR({window:void 0}),hydrationData:nA(),routes:e,mapRouteProperties:ZP,unstable_dataStrategy:void 0,unstable_patchRoutesOnMiss:void 0,window:void 0}).initialize()}function nA(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Gl({},t,{errors:sA(t.errors)})),t}function sA(e){if(!e)return null;let t=Object.entries(e),r={};for(let[n,s]of t)if(s&&s.__type==="RouteErrorResponse")r[n]=new Dg(s.status,s.statusText,s.data,s.internal===!0);else if(s&&s.__type==="Error"){if(s.__subType){let o=window[s.__subType];if(typeof o=="function")try{let i=new o(s.message);i.stack="",r[n]=i}catch{}}if(r[n]==null){let o=new Error(s.message);o.stack="",r[n]=o}}else r[n]=s;return r}const oA=g.createContext({isTransitioning:!1}),iA=g.createContext(new Map),aA="startTransition",w0=Uw[aA],lA="flushSync",_0=MR[lA];function cA(e){w0?w0(e):e()}function qa(e){_0?_0(e):e()}class uA{constructor(){this.status="pending",this.promise=new Promise((t,r)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",t(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",r(n))}})}}function dA(e){let{fallbackElement:t,router:r,future:n}=e,[s,o]=g.useState(r.state),[i,a]=g.useState(),[c,u]=g.useState({isTransitioning:!1}),[d,f]=g.useState(),[m,v]=g.useState(),[x,y]=g.useState(),_=g.useRef(new Map),{v7_startTransition:p}=n||{},h=g.useCallback(P=>{p?cA(P):P()},[p]),w=g.useCallback((P,A)=>{let{deletedFetchers:L,unstable_flushSync:q,unstable_viewTransitionOpts:N}=A;L.forEach(b=>_.current.delete(b)),P.fetchers.forEach((b,V)=>{b.data!==void 0&&_.current.set(V,b.data)});let F=r.window==null||r.window.document==null||typeof r.window.document.startViewTransition!="function";if(!N||F){q?qa(()=>o(P)):h(()=>o(P));return}if(q){qa(()=>{m&&(d&&d.resolve(),m.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:N.currentLocation,nextLocation:N.nextLocation})});let b=r.window.document.startViewTransition(()=>{qa(()=>o(P))});b.finished.finally(()=>{qa(()=>{f(void 0),v(void 0),a(void 0),u({isTransitioning:!1})})}),qa(()=>v(b));return}m?(d&&d.resolve(),m.skipTransition(),y({state:P,currentLocation:N.currentLocation,nextLocation:N.nextLocation})):(a(P),u({isTransitioning:!0,flushSync:!1,currentLocation:N.currentLocation,nextLocation:N.nextLocation}))},[r.window,m,d,_,h]);g.useLayoutEffect(()=>r.subscribe(w),[r,w]),g.useEffect(()=>{c.isTransitioning&&!c.flushSync&&f(new uA)},[c]),g.useEffect(()=>{if(d&&i&&r.window){let P=i,A=d.promise,L=r.window.document.startViewTransition(async()=>{h(()=>o(P)),await A});L.finished.finally(()=>{f(void 0),v(void 0),a(void 0),u({isTransitioning:!1})}),v(L)}},[h,i,d,r.window]),g.useEffect(()=>{d&&i&&s.location.key===i.location.key&&d.resolve()},[d,m,s.location,i]),g.useEffect(()=>{!c.isTransitioning&&x&&(a(x.state),u({isTransitioning:!0,flushSync:!1,currentLocation:x.currentLocation,nextLocation:x.nextLocation}),y(void 0))},[c.isTransitioning,x]),g.useEffect(()=>{},[]);let C=g.useMemo(()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:P=>r.navigate(P),push:(P,A,L)=>r.navigate(P,{state:A,preventScrollReset:L==null?void 0:L.preventScrollReset}),replace:(P,A,L)=>r.navigate(P,{replace:!0,state:A,preventScrollReset:L==null?void 0:L.preventScrollReset})}),[r]),j=r.basename||"/",E=g.useMemo(()=>({router:r,navigator:C,static:!1,basename:j}),[r,C,j]),R=g.useMemo(()=>({v7_relativeSplatPath:r.future.v7_relativeSplatPath}),[r.future.v7_relativeSplatPath]);return g.createElement(g.Fragment,null,g.createElement(yf.Provider,{value:E},g.createElement(eb.Provider,{value:s},g.createElement(iA.Provider,{value:_.current},g.createElement(oA.Provider,{value:c},g.createElement(GP,{basename:j,location:s.location,navigationType:s.historyAction,navigator:C,future:R},s.initialized||r.future.v7_partialHydration?g.createElement(fA,{routes:r.routes,future:r.future,state:s}):t))))),null)}const fA=g.memo(hA);function hA(e){let{routes:t,future:r,state:n}=e;return IP(t,void 0,n,r)}const pA=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",mA=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,hr=g.forwardRef(function(t,r){let{onClick:n,relative:s,reloadDocument:o,replace:i,state:a,target:c,to:u,preventScrollReset:d,unstable_viewTransition:f}=t,m=qP(t,eA),{basename:v}=g.useContext(jo),x,y=!1;if(typeof u=="string"&&mA.test(u)&&(x=u,pA))try{let w=new URL(window.location.href),C=u.startsWith("//")?new URL(w.protocol+u):new URL(u),j=ja(C.pathname,v);C.origin===w.origin&&j!=null?u=j+C.search+C.hash:y=!0}catch{}let _=AP(u,{relative:s}),p=gA(u,{replace:i,state:a,target:c,preventScrollReset:d,relative:s,unstable_viewTransition:f});function h(w){n&&n(w),w.defaultPrevented||p(w)}return g.createElement("a",Gl({},m,{href:x||_,onClick:y||o?n:h,ref:r,target:c}))});var b0;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(b0||(b0={}));var S0;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(S0||(S0={}));function gA(e,t){let{target:r,replace:n,state:s,preventScrollReset:o,relative:i,unstable_viewTransition:a}=t===void 0?{}:t,c=Pr(),u=Nn(),d=nb(e,{relative:i});return g.useCallback(f=>{if(QP(f,r)){f.preventDefault();let m=n!==void 0?n:ni(u)===ni(d);c(e,{replace:m,state:s,preventScrollReset:o,relative:i,unstable_viewTransition:a})}},[u,c,d,n,s,r,e,o,i,a])}function vA(e){let t=g.useRef(tm(e)),r=g.useRef(!1),n=Nn(),s=g.useMemo(()=>JP(n.search,r.current?null:t.current),[n.search]),o=Pr(),i=g.useCallback((a,c)=>{const u=tm(typeof a=="function"?a(s):a);r.current=!0,o("?"+u,c)},[o,s]);return[s,i]}/** + */function Zl(){return Zl=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(r[s]=e[s]);return r}function XP(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function QP(e,t){return e.button===0&&(!t||t==="_self")&&!XP(e)}function tm(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(s=>[r,s]):[[r,n]])},[]))}function JP(e,t){let r=tm(e);return t&&t.forEach((n,s)=>{r.has(s)||t.getAll(s).forEach(o=>{r.append(s,o)})}),r}const eA=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],tA="6";try{window.__reactRouterVersion=tA}catch{}function rA(e,t){return fP({basename:void 0,future:Zl({},void 0,{v7_prependBasename:!0}),history:IR({window:void 0}),hydrationData:nA(),routes:e,mapRouteProperties:ZP,unstable_dataStrategy:void 0,unstable_patchRoutesOnMiss:void 0,window:void 0}).initialize()}function nA(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Zl({},t,{errors:sA(t.errors)})),t}function sA(e){if(!e)return null;let t=Object.entries(e),r={};for(let[n,s]of t)if(s&&s.__type==="RouteErrorResponse")r[n]=new Dg(s.status,s.statusText,s.data,s.internal===!0);else if(s&&s.__type==="Error"){if(s.__subType){let o=window[s.__subType];if(typeof o=="function")try{let i=new o(s.message);i.stack="",r[n]=i}catch{}}if(r[n]==null){let o=new Error(s.message);o.stack="",r[n]=o}}else r[n]=s;return r}const oA=g.createContext({isTransitioning:!1}),iA=g.createContext(new Map),aA="startTransition",w0=Uw[aA],lA="flushSync",_0=MR[lA];function cA(e){w0?w0(e):e()}function Xa(e){_0?_0(e):e()}class uA{constructor(){this.status="pending",this.promise=new Promise((t,r)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",t(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",r(n))}})}}function dA(e){let{fallbackElement:t,router:r,future:n}=e,[s,o]=g.useState(r.state),[i,l]=g.useState(),[c,u]=g.useState({isTransitioning:!1}),[d,f]=g.useState(),[m,v]=g.useState(),[x,y]=g.useState(),_=g.useRef(new Map),{v7_startTransition:p}=n||{},h=g.useCallback(P=>{p?cA(P):P()},[p]),w=g.useCallback((P,A)=>{let{deletedFetchers:L,unstable_flushSync:q,unstable_viewTransitionOpts:N}=A;L.forEach(b=>_.current.delete(b)),P.fetchers.forEach((b,V)=>{b.data!==void 0&&_.current.set(V,b.data)});let F=r.window==null||r.window.document==null||typeof r.window.document.startViewTransition!="function";if(!N||F){q?Xa(()=>o(P)):h(()=>o(P));return}if(q){Xa(()=>{m&&(d&&d.resolve(),m.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:N.currentLocation,nextLocation:N.nextLocation})});let b=r.window.document.startViewTransition(()=>{Xa(()=>o(P))});b.finished.finally(()=>{Xa(()=>{f(void 0),v(void 0),l(void 0),u({isTransitioning:!1})})}),Xa(()=>v(b));return}m?(d&&d.resolve(),m.skipTransition(),y({state:P,currentLocation:N.currentLocation,nextLocation:N.nextLocation})):(l(P),u({isTransitioning:!0,flushSync:!1,currentLocation:N.currentLocation,nextLocation:N.nextLocation}))},[r.window,m,d,_,h]);g.useLayoutEffect(()=>r.subscribe(w),[r,w]),g.useEffect(()=>{c.isTransitioning&&!c.flushSync&&f(new uA)},[c]),g.useEffect(()=>{if(d&&i&&r.window){let P=i,A=d.promise,L=r.window.document.startViewTransition(async()=>{h(()=>o(P)),await A});L.finished.finally(()=>{f(void 0),v(void 0),l(void 0),u({isTransitioning:!1})}),v(L)}},[h,i,d,r.window]),g.useEffect(()=>{d&&i&&s.location.key===i.location.key&&d.resolve()},[d,m,s.location,i]),g.useEffect(()=>{!c.isTransitioning&&x&&(l(x.state),u({isTransitioning:!0,flushSync:!1,currentLocation:x.currentLocation,nextLocation:x.nextLocation}),y(void 0))},[c.isTransitioning,x]),g.useEffect(()=>{},[]);let C=g.useMemo(()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:P=>r.navigate(P),push:(P,A,L)=>r.navigate(P,{state:A,preventScrollReset:L==null?void 0:L.preventScrollReset}),replace:(P,A,L)=>r.navigate(P,{replace:!0,state:A,preventScrollReset:L==null?void 0:L.preventScrollReset})}),[r]),j=r.basename||"/",E=g.useMemo(()=>({router:r,navigator:C,static:!1,basename:j}),[r,C,j]),R=g.useMemo(()=>({v7_relativeSplatPath:r.future.v7_relativeSplatPath}),[r.future.v7_relativeSplatPath]);return g.createElement(g.Fragment,null,g.createElement(yf.Provider,{value:E},g.createElement(eb.Provider,{value:s},g.createElement(iA.Provider,{value:_.current},g.createElement(oA.Provider,{value:c},g.createElement(GP,{basename:j,location:s.location,navigationType:s.historyAction,navigator:C,future:R},s.initialized||r.future.v7_partialHydration?g.createElement(fA,{routes:r.routes,future:r.future,state:s}):t))))),null)}const fA=g.memo(hA);function hA(e){let{routes:t,future:r,state:n}=e;return IP(t,void 0,n,r)}const pA=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",mA=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,gr=g.forwardRef(function(t,r){let{onClick:n,relative:s,reloadDocument:o,replace:i,state:l,target:c,to:u,preventScrollReset:d,unstable_viewTransition:f}=t,m=qP(t,eA),{basename:v}=g.useContext(To),x,y=!1;if(typeof u=="string"&&mA.test(u)&&(x=u,pA))try{let w=new URL(window.location.href),C=u.startsWith("//")?new URL(w.protocol+u):new URL(u),j=Ea(C.pathname,v);C.origin===w.origin&&j!=null?u=j+C.search+C.hash:y=!0}catch{}let _=AP(u,{relative:s}),p=gA(u,{replace:i,state:l,target:c,preventScrollReset:d,relative:s,unstable_viewTransition:f});function h(w){n&&n(w),w.defaultPrevented||p(w)}return g.createElement("a",Zl({},m,{href:x||_,onClick:y||o?n:h,ref:r,target:c}))});var b0;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(b0||(b0={}));var S0;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(S0||(S0={}));function gA(e,t){let{target:r,replace:n,state:s,preventScrollReset:o,relative:i,unstable_viewTransition:l}=t===void 0?{}:t,c=Pr(),u=Nn(),d=nb(e,{relative:i});return g.useCallback(f=>{if(QP(f,r)){f.preventDefault();let m=n!==void 0?n:ni(u)===ni(d);c(e,{replace:m,state:s,preventScrollReset:o,relative:i,unstable_viewTransition:l})}},[u,c,d,n,s,r,e,o,i,l])}function vA(e){let t=g.useRef(tm(e)),r=g.useRef(!1),n=Nn(),s=g.useMemo(()=>JP(n.search,r.current?null:t.current),[n.search]),o=Pr(),i=g.useCallback((l,c)=>{const u=tm(typeof l=="function"?l(s):l);r.current=!0,o("?"+u,c)},[o,s]);return[s,i]}/** * @license lucide-react v0.417.0 - ISC * * This source code is licensed under the ISC license. @@ -81,7 +81,7 @@ Error generating stack: `+o.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const wA=g.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:s="",children:o,iconNode:i,...a},c)=>g.createElement("svg",{ref:c,...xA,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:ab("lucide",s),...a},[...i.map(([u,d])=>g.createElement(u,d)),...Array.isArray(o)?o:[o]]));/** + */const wA=g.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:s="",children:o,iconNode:i,...l},c)=>g.createElement("svg",{ref:c,...xA,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:ab("lucide",s),...l},[...i.map(([u,d])=>g.createElement(u,d)),...Array.isArray(o)?o:[o]]));/** * @license lucide-react v0.417.0 - ISC * * This source code is licensed under the ISC license. @@ -236,10 +236,10 @@ Error generating stack: `+o.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const zg=ht("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function zA(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function xf(...e){return t=>e.forEach(r=>zA(r,t))}function Ke(...e){return g.useCallback(xf(...e),e)}var bs=g.forwardRef((e,t)=>{const{children:r,...n}=e,s=g.Children.toArray(r),o=s.find(UA);if(o){const i=o.props.children,a=s.map(c=>c===o?g.Children.count(i)>1?g.Children.only(null):g.isValidElement(i)?i.props.children:null:c);return l.jsx(nm,{...n,ref:t,children:g.isValidElement(i)?g.cloneElement(i,void 0,a):null})}return l.jsx(nm,{...n,ref:t,children:r})});bs.displayName="Slot";var nm=g.forwardRef((e,t)=>{const{children:r,...n}=e;if(g.isValidElement(r)){const s=VA(r);return g.cloneElement(r,{...$A(n,r.props),ref:t?xf(t,s):s})}return g.Children.count(r)>1?g.Children.only(null):null});nm.displayName="SlotClone";var Ug=({children:e})=>l.jsx(l.Fragment,{children:e});function UA(e){return g.isValidElement(e)&&e.type===Ug}function $A(e,t){const r={...t};for(const n in t){const s=e[n],o=t[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...a)=>{o(...a),s(...a)}:s&&(r[n]=s):n==="style"?r[n]={...s,...o}:n==="className"&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}function VA(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function db(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;ttypeof e=="boolean"?"".concat(e):e===0?"0":e,R0=BA,Sc=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return R0(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:s,defaultVariants:o}=t,i=Object.keys(s).map(u=>{const d=r==null?void 0:r[u],f=o==null?void 0:o[u];if(d===null)return null;const m=T0(d)||T0(f);return s[u][m]}),a=r&&Object.entries(r).reduce((u,d)=>{let[f,m]=d;return m===void 0||(u[f]=m),u},{}),c=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((u,d)=>{let{class:f,className:m,...v}=d;return Object.entries(v).every(x=>{let[y,_]=x;return Array.isArray(_)?_.includes({...o,...a}[y]):{...o,...a}[y]===_})?[...u,f,m]:u},[]);return R0(e,i,c,r==null?void 0:r.class,r==null?void 0:r.className)};function fb(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;ta(o)))==null?void 0:i.classGroupId}const P0=/^\[(.+)\]$/;function YA(e){if(P0.test(e)){const t=P0.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}}function KA(e){const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return ZA(Object.entries(e.classGroups),r).forEach(([o,i])=>{sm(i,n,o,t)}),n}function sm(e,t,r,n){e.forEach(s=>{if(typeof s=="string"){const o=s===""?t:A0(t,s);o.classGroupId=r;return}if(typeof s=="function"){if(GA(s)){sm(s(n),t,r,n);return}t.validators.push({validator:s,classGroupId:r});return}Object.entries(s).forEach(([o,i])=>{sm(i,A0(t,o),r,n)})})}function A0(e,t){let r=e;return t.split($g).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r}function GA(e){return e.isThemeGetter}function ZA(e,t){return t?e.map(([r,n])=>{const s=n.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([i,a])=>[t+i,a])):o);return[r,s]}):e}function qA(e){if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;function s(o,i){r.set(o,i),t++,t>e&&(t=0,n=r,r=new Map)}return{get(o){let i=r.get(o);if(i!==void 0)return i;if((i=n.get(o))!==void 0)return s(o,i),i},set(o,i){r.has(o)?r.set(o,i):s(o,i)}}}const pb="!";function XA(e){const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,s=t[0],o=t.length;function i(a){const c=[];let u=0,d=0,f;for(let _=0;_d?f-d:void 0;return{modifiers:c,hasImportantModifier:v,baseClassName:x,maybePostfixModifierPosition:y}}return r?function(c){return r({className:c,parseClassName:i})}:i}function QA(e){if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t}function JA(e){return{cache:qA(e.cacheSize),parseClassName:XA(e),...HA(e)}}const eD=/\s+/;function tD(e,t){const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s}=t,o=new Set;return e.trim().split(eD).map(i=>{const{modifiers:a,hasImportantModifier:c,baseClassName:u,maybePostfixModifierPosition:d}=r(i);let f=!!d,m=n(f?u.substring(0,d):u);if(!m){if(!f)return{isTailwindClass:!1,originalClassName:i};if(m=n(u),!m)return{isTailwindClass:!1,originalClassName:i};f=!1}const v=QA(a).join(":");return{isTailwindClass:!0,modifierId:c?v+pb:v,classGroupId:m,originalClassName:i,hasPostfixModifier:f}}).reverse().filter(i=>{if(!i.isTailwindClass)return!0;const{modifierId:a,classGroupId:c,hasPostfixModifier:u}=i,d=a+c;return o.has(d)?!1:(o.add(d),s(c,u).forEach(f=>o.add(a+f)),!0)}).reverse().map(i=>i.originalClassName).join(" ")}function rD(){let e=0,t,r,n="";for(;ef(d),e());return r=JA(u),n=r.cache.get,s=r.cache.set,o=a,a(c)}function a(c){const u=n(c);if(u)return u;const d=tD(c,r);return s(c,d),d}return function(){return o(rD.apply(null,arguments))}}function _t(e){const t=r=>r[e]||[];return t.isThemeGetter=!0,t}const gb=/^\[(?:([a-z-]+):)?(.+)\]$/i,sD=/^\d+\/\d+$/,oD=new Set(["px","full","screen"]),iD=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,aD=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,lD=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,cD=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,uD=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function rs(e){return Bo(e)||oD.has(e)||sD.test(e)}function Us(e){return Na(e,"length",yD)}function Bo(e){return!!e&&!Number.isNaN(Number(e))}function hu(e){return Na(e,"number",Bo)}function Xa(e){return!!e&&Number.isInteger(Number(e))}function dD(e){return e.endsWith("%")&&Bo(e.slice(0,-1))}function qe(e){return gb.test(e)}function $s(e){return iD.test(e)}const fD=new Set(["length","size","percentage"]);function hD(e){return Na(e,fD,vb)}function pD(e){return Na(e,"position",vb)}const mD=new Set(["image","url"]);function gD(e){return Na(e,mD,wD)}function vD(e){return Na(e,"",xD)}function Qa(){return!0}function Na(e,t,r){const n=gb.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1}function yD(e){return aD.test(e)&&!lD.test(e)}function vb(){return!1}function xD(e){return cD.test(e)}function wD(e){return uD.test(e)}function _D(){const e=_t("colors"),t=_t("spacing"),r=_t("blur"),n=_t("brightness"),s=_t("borderColor"),o=_t("borderRadius"),i=_t("borderSpacing"),a=_t("borderWidth"),c=_t("contrast"),u=_t("grayscale"),d=_t("hueRotate"),f=_t("invert"),m=_t("gap"),v=_t("gradientColorStops"),x=_t("gradientColorStopPositions"),y=_t("inset"),_=_t("margin"),p=_t("opacity"),h=_t("padding"),w=_t("saturate"),C=_t("scale"),j=_t("sepia"),E=_t("skew"),R=_t("space"),P=_t("translate"),A=()=>["auto","contain","none"],L=()=>["auto","hidden","clip","visible","scroll"],q=()=>["auto",qe,t],N=()=>[qe,t],F=()=>["",rs,Us],b=()=>["auto",Bo,qe],V=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],te=()=>["solid","dashed","dotted","double","none"],B=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],K=()=>["start","end","center","between","around","evenly","stretch"],I=()=>["","0",qe],Q=()=>["auto","avoid","all","avoid-page","page","left","right","column"],z=()=>[Bo,hu],$=()=>[Bo,qe];return{cacheSize:500,separator:":",theme:{colors:[Qa],spacing:[rs,Us],blur:["none","",$s,qe],brightness:z(),borderColor:[e],borderRadius:["none","","full",$s,qe],borderSpacing:N(),borderWidth:F(),contrast:z(),grayscale:I(),hueRotate:$(),invert:I(),gap:N(),gradientColorStops:[e],gradientColorStopPositions:[dD,Us],inset:q(),margin:q(),opacity:z(),padding:N(),saturate:z(),scale:z(),sepia:I(),skew:$(),space:N(),translate:N()},classGroups:{aspect:[{aspect:["auto","square","video",qe]}],container:["container"],columns:[{columns:[$s]}],"break-after":[{"break-after":Q()}],"break-before":[{"break-before":Q()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...V(),qe]}],overflow:[{overflow:L()}],"overflow-x":[{"overflow-x":L()}],"overflow-y":[{"overflow-y":L()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Xa,qe]}],basis:[{basis:q()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",qe]}],grow:[{grow:I()}],shrink:[{shrink:I()}],order:[{order:["first","last","none",Xa,qe]}],"grid-cols":[{"grid-cols":[Qa]}],"col-start-end":[{col:["auto",{span:["full",Xa,qe]},qe]}],"col-start":[{"col-start":b()}],"col-end":[{"col-end":b()}],"grid-rows":[{"grid-rows":[Qa]}],"row-start-end":[{row:["auto",{span:[Xa,qe]},qe]}],"row-start":[{"row-start":b()}],"row-end":[{"row-end":b()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",qe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",qe]}],gap:[{gap:[m]}],"gap-x":[{"gap-x":[m]}],"gap-y":[{"gap-y":[m]}],"justify-content":[{justify:["normal",...K()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...K(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...K(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[h]}],px:[{px:[h]}],py:[{py:[h]}],ps:[{ps:[h]}],pe:[{pe:[h]}],pt:[{pt:[h]}],pr:[{pr:[h]}],pb:[{pb:[h]}],pl:[{pl:[h]}],m:[{m:[_]}],mx:[{mx:[_]}],my:[{my:[_]}],ms:[{ms:[_]}],me:[{me:[_]}],mt:[{mt:[_]}],mr:[{mr:[_]}],mb:[{mb:[_]}],ml:[{ml:[_]}],"space-x":[{"space-x":[R]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[R]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",qe,t]}],"min-w":[{"min-w":[qe,t,"min","max","fit"]}],"max-w":[{"max-w":[qe,t,"none","full","min","max","fit","prose",{screen:[$s]},$s]}],h:[{h:[qe,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[qe,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[qe,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[qe,t,"auto","min","max","fit"]}],"font-size":[{text:["base",$s,Us]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",hu]}],"font-family":[{font:[Qa]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",qe]}],"line-clamp":[{"line-clamp":["none",Bo,hu]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",rs,qe]}],"list-image":[{"list-image":["none",qe]}],"list-style-type":[{list:["none","disc","decimal",qe]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[p]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[p]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...te(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",rs,Us]}],"underline-offset":[{"underline-offset":["auto",rs,qe]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:N()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",qe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",qe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[p]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...V(),pD]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",hD]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},gD]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[x]}],"gradient-via-pos":[{via:[x]}],"gradient-to-pos":[{to:[x]}],"gradient-from":[{from:[v]}],"gradient-via":[{via:[v]}],"gradient-to":[{to:[v]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[p]}],"border-style":[{border:[...te(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[p]}],"divide-style":[{divide:te()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...te()]}],"outline-offset":[{"outline-offset":[rs,qe]}],"outline-w":[{outline:[rs,Us]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:F()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[p]}],"ring-offset-w":[{"ring-offset":[rs,Us]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",$s,vD]}],"shadow-color":[{shadow:[Qa]}],opacity:[{opacity:[p]}],"mix-blend":[{"mix-blend":[...B(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":B()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",$s,qe]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[w]}],sepia:[{sepia:[j]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[p]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[j]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",qe]}],duration:[{duration:$()}],ease:[{ease:["linear","in","out","in-out",qe]}],delay:[{delay:$()}],animate:[{animate:["none","spin","ping","pulse","bounce",qe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[C]}],"scale-x":[{"scale-x":[C]}],"scale-y":[{"scale-y":[C]}],rotate:[{rotate:[Xa,qe]}],"translate-x":[{"translate-x":[P]}],"translate-y":[{"translate-y":[P]}],"skew-x":[{"skew-x":[E]}],"skew-y":[{"skew-y":[E]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",qe]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",qe]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":N()}],"scroll-mx":[{"scroll-mx":N()}],"scroll-my":[{"scroll-my":N()}],"scroll-ms":[{"scroll-ms":N()}],"scroll-me":[{"scroll-me":N()}],"scroll-mt":[{"scroll-mt":N()}],"scroll-mr":[{"scroll-mr":N()}],"scroll-mb":[{"scroll-mb":N()}],"scroll-ml":[{"scroll-ml":N()}],"scroll-p":[{"scroll-p":N()}],"scroll-px":[{"scroll-px":N()}],"scroll-py":[{"scroll-py":N()}],"scroll-ps":[{"scroll-ps":N()}],"scroll-pe":[{"scroll-pe":N()}],"scroll-pt":[{"scroll-pt":N()}],"scroll-pr":[{"scroll-pr":N()}],"scroll-pb":[{"scroll-pb":N()}],"scroll-pl":[{"scroll-pl":N()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",qe]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[rs,Us,hu]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}const bD=nD(_D);function oe(...e){return bD(WA(e))}const wf=Sc("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),He=g.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...s},o)=>{const i=n?bs:"button";return l.jsx(i,{className:oe(wf({variant:t,size:r,className:e})),ref:o,...s})});He.displayName="Button";function ce(e,t,{checkForDefaultPrevented:r=!0}={}){return function(s){if(e==null||e(s),r===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function SD(e,t){const r=g.createContext(t);function n(o){const{children:i,...a}=o,c=g.useMemo(()=>a,Object.values(a));return l.jsx(r.Provider,{value:c,children:i})}function s(o){const i=g.useContext(r);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return n.displayName=e+"Provider",[n,s]}function sr(e,t=[]){let r=[];function n(o,i){const a=g.createContext(i),c=r.length;r=[...r,i];function u(f){const{scope:m,children:v,...x}=f,y=(m==null?void 0:m[e][c])||a,_=g.useMemo(()=>x,Object.values(x));return l.jsx(y.Provider,{value:_,children:v})}function d(f,m){const v=(m==null?void 0:m[e][c])||a,x=g.useContext(v);if(x)return x;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${o}\``)}return u.displayName=o+"Provider",[u,d]}const s=()=>{const o=r.map(i=>g.createContext(i));return function(a){const c=(a==null?void 0:a[e])||o;return g.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return s.scopeName=e,[n,kD(s,...t)]}function kD(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const i=n.reduce((a,{useScope:c,scopeName:u})=>{const f=c(o)[`__scope${u}`];return{...a,...f}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}function Dt(e){const t=g.useRef(e);return g.useEffect(()=>{t.current=e}),g.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function Hr({prop:e,defaultProp:t,onChange:r=()=>{}}){const[n,s]=CD({defaultProp:t,onChange:r}),o=e!==void 0,i=o?e:n,a=Dt(r),c=g.useCallback(u=>{if(o){const f=typeof u=="function"?u(e):u;f!==e&&a(f)}else s(u)},[o,e,s,a]);return[i,c]}function CD({defaultProp:e,onChange:t}){const r=g.useState(e),[n]=r,s=g.useRef(n),o=Dt(t);return g.useEffect(()=>{s.current!==n&&(o(n),s.current=n)},[n,s,o]),r}var jD=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Re=jD.reduce((e,t)=>{const r=g.forwardRef((n,s)=>{const{asChild:o,...i}=n,a=o?bs:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(a,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Vg(e,t){e&&Ts.flushSync(()=>e.dispatchEvent(t))}function kc(e){const t=e+"CollectionProvider",[r,n]=sr(t),[s,o]=r(t,{collectionRef:{current:null},itemMap:new Map}),i=v=>{const{scope:x,children:y}=v,_=Be.useRef(null),p=Be.useRef(new Map).current;return l.jsx(s,{scope:x,itemMap:p,collectionRef:_,children:y})};i.displayName=t;const a=e+"CollectionSlot",c=Be.forwardRef((v,x)=>{const{scope:y,children:_}=v,p=o(a,y),h=Ke(x,p.collectionRef);return l.jsx(bs,{ref:h,children:_})});c.displayName=a;const u=e+"CollectionItemSlot",d="data-radix-collection-item",f=Be.forwardRef((v,x)=>{const{scope:y,children:_,...p}=v,h=Be.useRef(null),w=Ke(x,h),C=o(u,y);return Be.useEffect(()=>(C.itemMap.set(h,{ref:h,...p}),()=>void C.itemMap.delete(h))),l.jsx(bs,{[d]:"",ref:w,children:_})});f.displayName=u;function m(v){const x=o(e+"CollectionConsumer",v);return Be.useCallback(()=>{const _=x.collectionRef.current;if(!_)return[];const p=Array.from(_.querySelectorAll(`[${d}]`));return Array.from(x.itemMap.values()).sort((C,j)=>p.indexOf(C.ref.current)-p.indexOf(j.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:i,Slot:c,ItemSlot:f},m,n]}var ED=g.createContext(void 0);function di(e){const t=g.useContext(ED);return e||t||"ltr"}function ND(e,t=globalThis==null?void 0:globalThis.document){const r=Dt(e);g.useEffect(()=>{const n=s=>{s.key==="Escape"&&r(s)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var TD="DismissableLayer",om="dismissableLayer.update",RD="dismissableLayer.pointerDownOutside",PD="dismissableLayer.focusOutside",D0,yb=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ta=g.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:i,onDismiss:a,...c}=e,u=g.useContext(yb),[d,f]=g.useState(null),m=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,v]=g.useState({}),x=Ke(t,R=>f(R)),y=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),p=y.indexOf(_),h=d?y.indexOf(d):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,C=h>=p,j=DD(R=>{const P=R.target,A=[...u.branches].some(L=>L.contains(P));!C||A||(s==null||s(R),i==null||i(R),R.defaultPrevented||a==null||a())},m),E=OD(R=>{const P=R.target;[...u.branches].some(L=>L.contains(P))||(o==null||o(R),i==null||i(R),R.defaultPrevented||a==null||a())},m);return ND(R=>{h===u.layers.size-1&&(n==null||n(R),!R.defaultPrevented&&a&&(R.preventDefault(),a()))},m),g.useEffect(()=>{if(d)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(D0=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),O0(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=D0)}},[d,m,r,u]),g.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),O0())},[d,u]),g.useEffect(()=>{const R=()=>v({});return document.addEventListener(om,R),()=>document.removeEventListener(om,R)},[]),l.jsx(Re.div,{...c,ref:x,style:{pointerEvents:w?C?"auto":"none":void 0,...e.style},onFocusCapture:ce(e.onFocusCapture,E.onFocusCapture),onBlurCapture:ce(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:ce(e.onPointerDownCapture,j.onPointerDownCapture)})});Ta.displayName=TD;var AD="DismissableLayerBranch",xb=g.forwardRef((e,t)=>{const r=g.useContext(yb),n=g.useRef(null),s=Ke(t,n);return g.useEffect(()=>{const o=n.current;if(o)return r.branches.add(o),()=>{r.branches.delete(o)}},[r.branches]),l.jsx(Re.div,{...e,ref:s})});xb.displayName=AD;function DD(e,t=globalThis==null?void 0:globalThis.document){const r=Dt(e),n=g.useRef(!1),s=g.useRef(()=>{});return g.useEffect(()=>{const o=a=>{if(a.target&&!n.current){let c=function(){wb(RD,r,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=c,t.addEventListener("click",s.current,{once:!0})):c()}else t.removeEventListener("click",s.current);n.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",o),t.removeEventListener("click",s.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function OD(e,t=globalThis==null?void 0:globalThis.document){const r=Dt(e),n=g.useRef(!1);return g.useEffect(()=>{const s=o=>{o.target&&!n.current&&wb(PD,r,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function O0(){const e=new CustomEvent(om);document.dispatchEvent(e)}function wb(e,t,r,{discrete:n}){const s=r.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),n?Vg(s,o):s.dispatchEvent(o)}var MD=Ta,ID=xb,zh=0;function Bg(){g.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??M0()),document.body.insertAdjacentElement("beforeend",e[1]??M0()),zh++,()=>{zh===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),zh--}},[])}function M0(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var Uh="focusScope.autoFocusOnMount",$h="focusScope.autoFocusOnUnmount",I0={bubbles:!1,cancelable:!0},LD="FocusScope",_f=g.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...i}=e,[a,c]=g.useState(null),u=Dt(s),d=Dt(o),f=g.useRef(null),m=Ke(t,y=>c(y)),v=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(n){let y=function(w){if(v.paused||!a)return;const C=w.target;a.contains(C)?f.current=C:Bs(f.current,{select:!0})},_=function(w){if(v.paused||!a)return;const C=w.relatedTarget;C!==null&&(a.contains(C)||Bs(f.current,{select:!0}))},p=function(w){if(document.activeElement===document.body)for(const j of w)j.removedNodes.length>0&&Bs(a)};document.addEventListener("focusin",y),document.addEventListener("focusout",_);const h=new MutationObserver(p);return a&&h.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",_),h.disconnect()}}},[n,a,v.paused]),g.useEffect(()=>{if(a){F0.add(v);const y=document.activeElement;if(!a.contains(y)){const p=new CustomEvent(Uh,I0);a.addEventListener(Uh,u),a.dispatchEvent(p),p.defaultPrevented||(FD(BD(_b(a)),{select:!0}),document.activeElement===y&&Bs(a))}return()=>{a.removeEventListener(Uh,u),setTimeout(()=>{const p=new CustomEvent($h,I0);a.addEventListener($h,d),a.dispatchEvent(p),p.defaultPrevented||Bs(y??document.body,{select:!0}),a.removeEventListener($h,d),F0.remove(v)},0)}}},[a,u,d,v]);const x=g.useCallback(y=>{if(!r&&!n||v.paused)return;const _=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,p=document.activeElement;if(_&&p){const h=y.currentTarget,[w,C]=zD(h);w&&C?!y.shiftKey&&p===C?(y.preventDefault(),r&&Bs(w,{select:!0})):y.shiftKey&&p===w&&(y.preventDefault(),r&&Bs(C,{select:!0})):p===h&&y.preventDefault()}},[r,n,v.paused]);return l.jsx(Re.div,{tabIndex:-1,...i,ref:m,onKeyDown:x})});_f.displayName=LD;function FD(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(Bs(n,{select:t}),document.activeElement!==r)return}function zD(e){const t=_b(e),r=L0(t,e),n=L0(t.reverse(),e);return[r,n]}function _b(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function L0(e,t){for(const r of e)if(!UD(r,{upTo:t}))return r}function UD(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function $D(e){return e instanceof HTMLInputElement&&"select"in e}function Bs(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&$D(e)&&t&&e.select()}}var F0=VD();function VD(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=z0(e,t),e.unshift(t)},remove(t){var r;e=z0(e,t),(r=e[0])==null||r.resume()}}}function z0(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function BD(e){return e.filter(t=>t.tagName!=="A")}var Jt=globalThis!=null&&globalThis.document?g.useLayoutEffect:()=>{},WD=Uw.useId||(()=>{}),HD=0;function Ur(e){const[t,r]=g.useState(WD());return Jt(()=>{r(n=>n??String(HD++))},[e]),t?`radix-${t}`:""}const YD=["top","right","bottom","left"],Un=Math.min,Lr=Math.max,Sd=Math.round,pu=Math.floor,mo=e=>({x:e,y:e}),KD={left:"right",right:"left",bottom:"top",top:"bottom"},GD={start:"end",end:"start"};function im(e,t,r){return Lr(e,Un(t,r))}function Ss(e,t){return typeof e=="function"?e(t):e}function ks(e){return e.split("-")[0]}function Ra(e){return e.split("-")[1]}function Wg(e){return e==="x"?"y":"x"}function Hg(e){return e==="y"?"height":"width"}function go(e){return["top","bottom"].includes(ks(e))?"y":"x"}function Yg(e){return Wg(go(e))}function ZD(e,t,r){r===void 0&&(r=!1);const n=Ra(e),s=Yg(e),o=Hg(s);let i=s==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(i=kd(i)),[i,kd(i)]}function qD(e){const t=kd(e);return[am(e),t,am(t)]}function am(e){return e.replace(/start|end/g,t=>GD[t])}function XD(e,t,r){const n=["left","right"],s=["right","left"],o=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return r?t?s:n:t?n:s;case"left":case"right":return t?o:i;default:return[]}}function QD(e,t,r,n){const s=Ra(e);let o=XD(ks(e),r==="start",n);return s&&(o=o.map(i=>i+"-"+s),t&&(o=o.concat(o.map(am)))),o}function kd(e){return e.replace(/left|right|bottom|top/g,t=>KD[t])}function JD(e){return{top:0,right:0,bottom:0,left:0,...e}}function bb(e){return typeof e!="number"?JD(e):{top:e,right:e,bottom:e,left:e}}function Cd(e){const{x:t,y:r,width:n,height:s}=e;return{width:n,height:s,top:r,left:t,right:t+n,bottom:r+s,x:t,y:r}}function U0(e,t,r){let{reference:n,floating:s}=e;const o=go(t),i=Yg(t),a=Hg(i),c=ks(t),u=o==="y",d=n.x+n.width/2-s.width/2,f=n.y+n.height/2-s.height/2,m=n[a]/2-s[a]/2;let v;switch(c){case"top":v={x:d,y:n.y-s.height};break;case"bottom":v={x:d,y:n.y+n.height};break;case"right":v={x:n.x+n.width,y:f};break;case"left":v={x:n.x-s.width,y:f};break;default:v={x:n.x,y:n.y}}switch(Ra(t)){case"start":v[i]-=m*(r&&u?-1:1);break;case"end":v[i]+=m*(r&&u?-1:1);break}return v}const eO=async(e,t,r)=>{const{placement:n="bottom",strategy:s="absolute",middleware:o=[],platform:i}=r,a=o.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t));let u=await i.getElementRects({reference:e,floating:t,strategy:s}),{x:d,y:f}=U0(u,n,c),m=n,v={},x=0;for(let y=0;y({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:s,rects:o,platform:i,elements:a,middlewareData:c}=t,{element:u,padding:d=0}=Ss(e,t)||{};if(u==null)return{};const f=bb(d),m={x:r,y:n},v=Yg(s),x=Hg(v),y=await i.getDimensions(u),_=v==="y",p=_?"top":"left",h=_?"bottom":"right",w=_?"clientHeight":"clientWidth",C=o.reference[x]+o.reference[v]-m[v]-o.floating[x],j=m[v]-o.reference[v],E=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let R=E?E[w]:0;(!R||!await(i.isElement==null?void 0:i.isElement(E)))&&(R=a.floating[w]||o.floating[x]);const P=C/2-j/2,A=R/2-y[x]/2-1,L=Un(f[p],A),q=Un(f[h],A),N=L,F=R-y[x]-q,b=R/2-y[x]/2+P,V=im(N,b,F),te=!c.arrow&&Ra(s)!=null&&b!==V&&o.reference[x]/2-(bb<=0)){var q,N;const b=(((q=o.flip)==null?void 0:q.index)||0)+1,V=R[b];if(V)return{data:{index:b,overflows:L},reset:{placement:V}};let te=(N=L.filter(B=>B.overflows[0]<=0).sort((B,K)=>B.overflows[1]-K.overflows[1])[0])==null?void 0:N.placement;if(!te)switch(v){case"bestFit":{var F;const B=(F=L.filter(K=>{if(E){const I=go(K.placement);return I===h||I==="y"}return!0}).map(K=>[K.placement,K.overflows.filter(I=>I>0).reduce((I,Q)=>I+Q,0)]).sort((K,I)=>K[1]-I[1])[0])==null?void 0:F[0];B&&(te=B);break}case"initialPlacement":te=a;break}if(s!==te)return{reset:{placement:te}}}return{}}}};function $0(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function V0(e){return YD.some(t=>e[t]>=0)}const nO=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...s}=Ss(e,t);switch(n){case"referenceHidden":{const o=await Zl(t,{...s,elementContext:"reference"}),i=$0(o,r.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:V0(i)}}}case"escaped":{const o=await Zl(t,{...s,altBoundary:!0}),i=$0(o,r.floating);return{data:{escapedOffsets:i,escaped:V0(i)}}}default:return{}}}}};async function sO(e,t){const{placement:r,platform:n,elements:s}=e,o=await(n.isRTL==null?void 0:n.isRTL(s.floating)),i=ks(r),a=Ra(r),c=go(r)==="y",u=["left","top"].includes(i)?-1:1,d=o&&c?-1:1,f=Ss(t,e);let{mainAxis:m,crossAxis:v,alignmentAxis:x}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&typeof x=="number"&&(v=a==="end"?x*-1:x),c?{x:v*d,y:m*u}:{x:m*u,y:v*d}}const oO=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:s,y:o,placement:i,middlewareData:a}=t,c=await sO(t,e);return i===((r=a.offset)==null?void 0:r.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:s+c.x,y:o+c.y,data:{...c,placement:i}}}}},iO=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:s}=t,{mainAxis:o=!0,crossAxis:i=!1,limiter:a={fn:_=>{let{x:p,y:h}=_;return{x:p,y:h}}},...c}=Ss(e,t),u={x:r,y:n},d=await Zl(t,c),f=go(ks(s)),m=Wg(f);let v=u[m],x=u[f];if(o){const _=m==="y"?"top":"left",p=m==="y"?"bottom":"right",h=v+d[_],w=v-d[p];v=im(h,v,w)}if(i){const _=f==="y"?"top":"left",p=f==="y"?"bottom":"right",h=x+d[_],w=x-d[p];x=im(h,x,w)}const y=a.fn({...t,[m]:v,[f]:x});return{...y,data:{x:y.x-r,y:y.y-n}}}}},aO=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:s,rects:o,middlewareData:i}=t,{offset:a=0,mainAxis:c=!0,crossAxis:u=!0}=Ss(e,t),d={x:r,y:n},f=go(s),m=Wg(f);let v=d[m],x=d[f];const y=Ss(a,t),_=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(c){const w=m==="y"?"height":"width",C=o.reference[m]-o.floating[w]+_.mainAxis,j=o.reference[m]+o.reference[w]-_.mainAxis;vj&&(v=j)}if(u){var p,h;const w=m==="y"?"width":"height",C=["top","left"].includes(ks(s)),j=o.reference[f]-o.floating[w]+(C&&((p=i.offset)==null?void 0:p[f])||0)+(C?0:_.crossAxis),E=o.reference[f]+o.reference[w]+(C?0:((h=i.offset)==null?void 0:h[f])||0)-(C?_.crossAxis:0);xE&&(x=E)}return{[m]:v,[f]:x}}}},lO=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:r,rects:n,platform:s,elements:o}=t,{apply:i=()=>{},...a}=Ss(e,t),c=await Zl(t,a),u=ks(r),d=Ra(r),f=go(r)==="y",{width:m,height:v}=n.floating;let x,y;u==="top"||u==="bottom"?(x=u,y=d===(await(s.isRTL==null?void 0:s.isRTL(o.floating))?"start":"end")?"left":"right"):(y=u,x=d==="end"?"top":"bottom");const _=v-c.top-c.bottom,p=m-c.left-c.right,h=Un(v-c[x],_),w=Un(m-c[y],p),C=!t.middlewareData.shift;let j=h,E=w;if(f?E=d||C?Un(w,p):p:j=d||C?Un(h,_):_,C&&!d){const P=Lr(c.left,0),A=Lr(c.right,0),L=Lr(c.top,0),q=Lr(c.bottom,0);f?E=m-2*(P!==0||A!==0?P+A:Lr(c.left,c.right)):j=v-2*(L!==0||q!==0?L+q:Lr(c.top,c.bottom))}await i({...t,availableWidth:E,availableHeight:j});const R=await s.getDimensions(o.floating);return m!==R.width||v!==R.height?{reset:{rects:!0}}:{}}}};function Pa(e){return Sb(e)?(e.nodeName||"").toLowerCase():"#document"}function $r(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function As(e){var t;return(t=(Sb(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Sb(e){return e instanceof Node||e instanceof $r(e).Node}function Sn(e){return e instanceof Element||e instanceof $r(e).Element}function Hn(e){return e instanceof HTMLElement||e instanceof $r(e).HTMLElement}function B0(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof $r(e).ShadowRoot}function Cc(e){const{overflow:t,overflowX:r,overflowY:n,display:s}=kn(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(s)}function cO(e){return["table","td","th"].includes(Pa(e))}function bf(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Kg(e){const t=Gg(),r=Sn(e)?kn(e):e;return r.transform!=="none"||r.perspective!=="none"||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function uO(e){let t=vo(e);for(;Hn(t)&&!ga(t);){if(Kg(t))return t;if(bf(t))return null;t=vo(t)}return null}function Gg(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ga(e){return["html","body","#document"].includes(Pa(e))}function kn(e){return $r(e).getComputedStyle(e)}function Sf(e){return Sn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function vo(e){if(Pa(e)==="html")return e;const t=e.assignedSlot||e.parentNode||B0(e)&&e.host||As(e);return B0(t)?t.host:t}function kb(e){const t=vo(e);return ga(t)?e.ownerDocument?e.ownerDocument.body:e.body:Hn(t)&&Cc(t)?t:kb(t)}function ql(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const s=kb(e),o=s===((n=e.ownerDocument)==null?void 0:n.body),i=$r(s);return o?t.concat(i,i.visualViewport||[],Cc(s)?s:[],i.frameElement&&r?ql(i.frameElement):[]):t.concat(s,ql(s,[],r))}function Cb(e){const t=kn(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const s=Hn(e),o=s?e.offsetWidth:r,i=s?e.offsetHeight:n,a=Sd(r)!==o||Sd(n)!==i;return a&&(r=o,n=i),{width:r,height:n,$:a}}function Zg(e){return Sn(e)?e:e.contextElement}function Ji(e){const t=Zg(e);if(!Hn(t))return mo(1);const r=t.getBoundingClientRect(),{width:n,height:s,$:o}=Cb(t);let i=(o?Sd(r.width):r.width)/n,a=(o?Sd(r.height):r.height)/s;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const dO=mo(0);function jb(e){const t=$r(e);return!Gg()||!t.visualViewport?dO:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function fO(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==$r(e)?!1:t}function si(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const s=e.getBoundingClientRect(),o=Zg(e);let i=mo(1);t&&(n?Sn(n)&&(i=Ji(n)):i=Ji(e));const a=fO(o,r,n)?jb(o):mo(0);let c=(s.left+a.x)/i.x,u=(s.top+a.y)/i.y,d=s.width/i.x,f=s.height/i.y;if(o){const m=$r(o),v=n&&Sn(n)?$r(n):n;let x=m,y=x.frameElement;for(;y&&n&&v!==x;){const _=Ji(y),p=y.getBoundingClientRect(),h=kn(y),w=p.left+(y.clientLeft+parseFloat(h.paddingLeft))*_.x,C=p.top+(y.clientTop+parseFloat(h.paddingTop))*_.y;c*=_.x,u*=_.y,d*=_.x,f*=_.y,c+=w,u+=C,x=$r(y),y=x.frameElement}}return Cd({width:d,height:f,x:c,y:u})}function hO(e){let{elements:t,rect:r,offsetParent:n,strategy:s}=e;const o=s==="fixed",i=As(n),a=t?bf(t.floating):!1;if(n===i||a&&o)return r;let c={scrollLeft:0,scrollTop:0},u=mo(1);const d=mo(0),f=Hn(n);if((f||!f&&!o)&&((Pa(n)!=="body"||Cc(i))&&(c=Sf(n)),Hn(n))){const m=si(n);u=Ji(n),d.x=m.x+n.clientLeft,d.y=m.y+n.clientTop}return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-c.scrollLeft*u.x+d.x,y:r.y*u.y-c.scrollTop*u.y+d.y}}function pO(e){return Array.from(e.getClientRects())}function Eb(e){return si(As(e)).left+Sf(e).scrollLeft}function mO(e){const t=As(e),r=Sf(e),n=e.ownerDocument.body,s=Lr(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=Lr(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+Eb(e);const a=-r.scrollTop;return kn(n).direction==="rtl"&&(i+=Lr(t.clientWidth,n.clientWidth)-s),{width:s,height:o,x:i,y:a}}function gO(e,t){const r=$r(e),n=As(e),s=r.visualViewport;let o=n.clientWidth,i=n.clientHeight,a=0,c=0;if(s){o=s.width,i=s.height;const u=Gg();(!u||u&&t==="fixed")&&(a=s.offsetLeft,c=s.offsetTop)}return{width:o,height:i,x:a,y:c}}function vO(e,t){const r=si(e,!0,t==="fixed"),n=r.top+e.clientTop,s=r.left+e.clientLeft,o=Hn(e)?Ji(e):mo(1),i=e.clientWidth*o.x,a=e.clientHeight*o.y,c=s*o.x,u=n*o.y;return{width:i,height:a,x:c,y:u}}function W0(e,t,r){let n;if(t==="viewport")n=gO(e,r);else if(t==="document")n=mO(As(e));else if(Sn(t))n=vO(t,r);else{const s=jb(e);n={...t,x:t.x-s.x,y:t.y-s.y}}return Cd(n)}function Nb(e,t){const r=vo(e);return r===t||!Sn(r)||ga(r)?!1:kn(r).position==="fixed"||Nb(r,t)}function yO(e,t){const r=t.get(e);if(r)return r;let n=ql(e,[],!1).filter(a=>Sn(a)&&Pa(a)!=="body"),s=null;const o=kn(e).position==="fixed";let i=o?vo(e):e;for(;Sn(i)&&!ga(i);){const a=kn(i),c=Kg(i);!c&&a.position==="fixed"&&(s=null),(o?!c&&!s:!c&&a.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||Cc(i)&&!c&&Nb(e,i))?n=n.filter(d=>d!==i):s=a,i=vo(i)}return t.set(e,n),n}function xO(e){let{element:t,boundary:r,rootBoundary:n,strategy:s}=e;const i=[...r==="clippingAncestors"?bf(t)?[]:yO(t,this._c):[].concat(r),n],a=i[0],c=i.reduce((u,d)=>{const f=W0(t,d,s);return u.top=Lr(f.top,u.top),u.right=Un(f.right,u.right),u.bottom=Un(f.bottom,u.bottom),u.left=Lr(f.left,u.left),u},W0(t,a,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function wO(e){const{width:t,height:r}=Cb(e);return{width:t,height:r}}function _O(e,t,r){const n=Hn(t),s=As(t),o=r==="fixed",i=si(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const c=mo(0);if(n||!n&&!o)if((Pa(t)!=="body"||Cc(s))&&(a=Sf(t)),n){const f=si(t,!0,o,t);c.x=f.x+t.clientLeft,c.y=f.y+t.clientTop}else s&&(c.x=Eb(s));const u=i.left+a.scrollLeft-c.x,d=i.top+a.scrollTop-c.y;return{x:u,y:d,width:i.width,height:i.height}}function Vh(e){return kn(e).position==="static"}function H0(e,t){return!Hn(e)||kn(e).position==="fixed"?null:t?t(e):e.offsetParent}function Tb(e,t){const r=$r(e);if(bf(e))return r;if(!Hn(e)){let s=vo(e);for(;s&&!ga(s);){if(Sn(s)&&!Vh(s))return s;s=vo(s)}return r}let n=H0(e,t);for(;n&&cO(n)&&Vh(n);)n=H0(n,t);return n&&ga(n)&&Vh(n)&&!Kg(n)?r:n||uO(e)||r}const bO=async function(e){const t=this.getOffsetParent||Tb,r=this.getDimensions,n=await r(e.floating);return{reference:_O(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function SO(e){return kn(e).direction==="rtl"}const kO={convertOffsetParentRelativeRectToViewportRelativeRect:hO,getDocumentElement:As,getClippingRect:xO,getOffsetParent:Tb,getElementRects:bO,getClientRects:pO,getDimensions:wO,getScale:Ji,isElement:Sn,isRTL:SO};function CO(e,t){let r=null,n;const s=As(e);function o(){var a;clearTimeout(n),(a=r)==null||a.disconnect(),r=null}function i(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),o();const{left:u,top:d,width:f,height:m}=e.getBoundingClientRect();if(a||t(),!f||!m)return;const v=pu(d),x=pu(s.clientWidth-(u+f)),y=pu(s.clientHeight-(d+m)),_=pu(u),h={rootMargin:-v+"px "+-x+"px "+-y+"px "+-_+"px",threshold:Lr(0,Un(1,c))||1};let w=!0;function C(j){const E=j[0].intersectionRatio;if(E!==c){if(!w)return i();E?i(!1,E):n=setTimeout(()=>{i(!1,1e-7)},1e3)}w=!1}try{r=new IntersectionObserver(C,{...h,root:s.ownerDocument})}catch{r=new IntersectionObserver(C,h)}r.observe(e)}return i(!0),o}function jO(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,u=Zg(e),d=s||o?[...u?ql(u):[],...ql(t)]:[];d.forEach(p=>{s&&p.addEventListener("scroll",r,{passive:!0}),o&&p.addEventListener("resize",r)});const f=u&&a?CO(u,r):null;let m=-1,v=null;i&&(v=new ResizeObserver(p=>{let[h]=p;h&&h.target===u&&v&&(v.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var w;(w=v)==null||w.observe(t)})),r()}),u&&!c&&v.observe(u),v.observe(t));let x,y=c?si(e):null;c&&_();function _(){const p=si(e);y&&(p.x!==y.x||p.y!==y.y||p.width!==y.width||p.height!==y.height)&&r(),y=p,x=requestAnimationFrame(_)}return r(),()=>{var p;d.forEach(h=>{s&&h.removeEventListener("scroll",r),o&&h.removeEventListener("resize",r)}),f==null||f(),(p=v)==null||p.disconnect(),v=null,c&&cancelAnimationFrame(x)}}const EO=oO,NO=iO,TO=rO,RO=lO,PO=nO,Y0=tO,AO=aO,DO=(e,t,r)=>{const n=new Map,s={platform:kO,...r},o={...s.platform,_c:n};return eO(e,t,{...s,platform:o})};var $u=typeof document<"u"?g.useLayoutEffect:g.useEffect;function jd(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!jd(e[n],t[n]))return!1;return!0}if(s=Object.keys(e),r=s.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,s[n]))return!1;for(n=r;n--!==0;){const o=s[n];if(!(o==="_owner"&&e.$$typeof)&&!jd(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Rb(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function K0(e,t){const r=Rb(e);return Math.round(t*r)/r}function G0(e){const t=g.useRef(e);return $u(()=>{t.current=e}),t}function OO(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:s,elements:{reference:o,floating:i}={},transform:a=!0,whileElementsMounted:c,open:u}=e,[d,f]=g.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,v]=g.useState(n);jd(m,n)||v(n);const[x,y]=g.useState(null),[_,p]=g.useState(null),h=g.useCallback(B=>{B!==E.current&&(E.current=B,y(B))},[]),w=g.useCallback(B=>{B!==R.current&&(R.current=B,p(B))},[]),C=o||x,j=i||_,E=g.useRef(null),R=g.useRef(null),P=g.useRef(d),A=c!=null,L=G0(c),q=G0(s),N=g.useCallback(()=>{if(!E.current||!R.current)return;const B={placement:t,strategy:r,middleware:m};q.current&&(B.platform=q.current),DO(E.current,R.current,B).then(K=>{const I={...K,isPositioned:!0};F.current&&!jd(P.current,I)&&(P.current=I,Ts.flushSync(()=>{f(I)}))})},[m,t,r,q]);$u(()=>{u===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,f(B=>({...B,isPositioned:!1})))},[u]);const F=g.useRef(!1);$u(()=>(F.current=!0,()=>{F.current=!1}),[]),$u(()=>{if(C&&(E.current=C),j&&(R.current=j),C&&j){if(L.current)return L.current(C,j,N);N()}},[C,j,N,L,A]);const b=g.useMemo(()=>({reference:E,floating:R,setReference:h,setFloating:w}),[h,w]),V=g.useMemo(()=>({reference:C,floating:j}),[C,j]),te=g.useMemo(()=>{const B={position:r,left:0,top:0};if(!V.floating)return B;const K=K0(V.floating,d.x),I=K0(V.floating,d.y);return a?{...B,transform:"translate("+K+"px, "+I+"px)",...Rb(V.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:K,top:I}},[r,a,V.floating,d.x,d.y]);return g.useMemo(()=>({...d,update:N,refs:b,elements:V,floatingStyles:te}),[d,N,b,V,te])}const MO=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:s}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?Y0({element:n.current,padding:s}).fn(r):{}:n?Y0({element:n,padding:s}).fn(r):{}}}},IO=(e,t)=>({...EO(e),options:[e,t]}),LO=(e,t)=>({...NO(e),options:[e,t]}),FO=(e,t)=>({...AO(e),options:[e,t]}),zO=(e,t)=>({...TO(e),options:[e,t]}),UO=(e,t)=>({...RO(e),options:[e,t]}),$O=(e,t)=>({...PO(e),options:[e,t]}),VO=(e,t)=>({...MO(e),options:[e,t]});var BO="Arrow",Pb=g.forwardRef((e,t)=>{const{children:r,width:n=10,height:s=5,...o}=e;return l.jsx(Re.svg,{...o,ref:t,width:n,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:l.jsx("polygon",{points:"0,0 30,0 15,10"})})});Pb.displayName=BO;var WO=Pb;function qg(e){const[t,r]=g.useState(void 0);return Jt(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const o=s[0];let i,a;if("borderBoxSize"in o){const c=o.borderBoxSize,u=Array.isArray(c)?c[0]:c;i=u.inlineSize,a=u.blockSize}else i=e.offsetWidth,a=e.offsetHeight;r({width:i,height:a})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var Xg="Popper",[Ab,Aa]=sr(Xg),[HO,Db]=Ab(Xg),Ob=e=>{const{__scopePopper:t,children:r}=e,[n,s]=g.useState(null);return l.jsx(HO,{scope:t,anchor:n,onAnchorChange:s,children:r})};Ob.displayName=Xg;var Mb="PopperAnchor",Ib=g.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...s}=e,o=Db(Mb,r),i=g.useRef(null),a=Ke(t,i);return g.useEffect(()=>{o.onAnchorChange((n==null?void 0:n.current)||i.current)}),n?null:l.jsx(Re.div,{...s,ref:a})});Ib.displayName=Mb;var Qg="PopperContent",[YO,KO]=Ab(Qg),Lb=g.forwardRef((e,t)=>{var pe,ye,Ne,Fe,Me,Pe;const{__scopePopper:r,side:n="bottom",sideOffset:s=0,align:o="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:m=!1,updatePositionStrategy:v="optimized",onPlaced:x,...y}=e,_=Db(Qg,r),[p,h]=g.useState(null),w=Ke(t,nt=>h(nt)),[C,j]=g.useState(null),E=qg(C),R=(E==null?void 0:E.width)??0,P=(E==null?void 0:E.height)??0,A=n+(o!=="center"?"-"+o:""),L=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},q=Array.isArray(u)?u:[u],N=q.length>0,F={padding:L,boundary:q.filter(ZO),altBoundary:N},{refs:b,floatingStyles:V,placement:te,isPositioned:B,middlewareData:K}=OO({strategy:"fixed",placement:A,whileElementsMounted:(...nt)=>jO(...nt,{animationFrame:v==="always"}),elements:{reference:_.anchor},middleware:[IO({mainAxis:s+P,alignmentAxis:i}),c&&LO({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?FO():void 0,...F}),c&&zO({...F}),UO({...F,apply:({elements:nt,rects:k,availableWidth:J,availableHeight:G})=>{const{width:D,height:S}=k.reference,T=nt.floating.style;T.setProperty("--radix-popper-available-width",`${J}px`),T.setProperty("--radix-popper-available-height",`${G}px`),T.setProperty("--radix-popper-anchor-width",`${D}px`),T.setProperty("--radix-popper-anchor-height",`${S}px`)}}),C&&VO({element:C,padding:a}),qO({arrowWidth:R,arrowHeight:P}),m&&$O({strategy:"referenceHidden",...F})]}),[I,Q]=Ub(te),z=Dt(x);Jt(()=>{B&&(z==null||z())},[B,z]);const $=(pe=K.arrow)==null?void 0:pe.x,he=(ye=K.arrow)==null?void 0:ye.y,ne=((Ne=K.arrow)==null?void 0:Ne.centerOffset)!==0,[se,Oe]=g.useState();return Jt(()=>{p&&Oe(window.getComputedStyle(p).zIndex)},[p]),l.jsx("div",{ref:b.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:B?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:se,"--radix-popper-transform-origin":[(Fe=K.transformOrigin)==null?void 0:Fe.x,(Me=K.transformOrigin)==null?void 0:Me.y].join(" "),...((Pe=K.hide)==null?void 0:Pe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(YO,{scope:r,placedSide:I,onArrowChange:j,arrowX:$,arrowY:he,shouldHideArrow:ne,children:l.jsx(Re.div,{"data-side":I,"data-align":Q,...y,ref:w,style:{...y.style,animation:B?void 0:"none"}})})})});Lb.displayName=Qg;var Fb="PopperArrow",GO={top:"bottom",right:"left",bottom:"top",left:"right"},zb=g.forwardRef(function(t,r){const{__scopePopper:n,...s}=t,o=KO(Fb,n),i=GO[o.placedSide];return l.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:l.jsx(WO,{...s,ref:r,style:{...s.style,display:"block"}})})});zb.displayName=Fb;function ZO(e){return e!==null}var qO=e=>({name:"transformOrigin",options:e,fn(t){var _,p,h;const{placement:r,rects:n,middlewareData:s}=t,i=((_=s.arrow)==null?void 0:_.centerOffset)!==0,a=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[u,d]=Ub(r),f={start:"0%",center:"50%",end:"100%"}[d],m=(((p=s.arrow)==null?void 0:p.x)??0)+a/2,v=(((h=s.arrow)==null?void 0:h.y)??0)+c/2;let x="",y="";return u==="bottom"?(x=i?f:`${m}px`,y=`${-c}px`):u==="top"?(x=i?f:`${m}px`,y=`${n.floating.height+c}px`):u==="right"?(x=`${-c}px`,y=i?f:`${v}px`):u==="left"&&(x=`${n.floating.width+c}px`,y=i?f:`${v}px`),{data:{x,y}}}});function Ub(e){const[t,r="center"]=e.split("-");return[t,r]}var Jg=Ob,ev=Ib,tv=Lb,rv=zb,XO="Portal",jc=g.forwardRef((e,t)=>{var a;const{container:r,...n}=e,[s,o]=g.useState(!1);Jt(()=>o(!0),[]);const i=r||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?B1.createPortal(l.jsx(Re.div,{...n,ref:t}),i):null});jc.displayName=XO;function QO(e,t){return g.useReducer((r,n)=>t[r][n]??r,e)}var or=e=>{const{present:t,children:r}=e,n=JO(t),s=typeof r=="function"?r({present:n.isPresent}):g.Children.only(r),o=Ke(n.ref,eM(s));return typeof r=="function"||n.isPresent?g.cloneElement(s,{ref:o}):null};or.displayName="Presence";function JO(e){const[t,r]=g.useState(),n=g.useRef({}),s=g.useRef(e),o=g.useRef("none"),i=e?"mounted":"unmounted",[a,c]=QO(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const u=mu(n.current);o.current=a==="mounted"?u:"none"},[a]),Jt(()=>{const u=n.current,d=s.current;if(d!==e){const m=o.current,v=mu(u);e?c("MOUNT"):v==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&m!==v?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,c]),Jt(()=>{if(t){const u=f=>{const v=mu(n.current).includes(f.animationName);f.target===t&&v&&Ts.flushSync(()=>c("ANIMATION_END"))},d=f=>{f.target===t&&(o.current=mu(n.current))};return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{t.removeEventListener("animationstart",d),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:g.useCallback(u=>{u&&(n.current=getComputedStyle(u)),r(u)},[])}}function mu(e){return(e==null?void 0:e.animationName)||"none"}function eM(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Bh="rovingFocusGroup.onEntryFocus",tM={bubbles:!1,cancelable:!0},kf="RovingFocusGroup",[lm,$b,rM]=kc(kf),[nM,Da]=sr(kf,[rM]),[sM,oM]=nM(kf),Vb=g.forwardRef((e,t)=>l.jsx(lm.Provider,{scope:e.__scopeRovingFocusGroup,children:l.jsx(lm.Slot,{scope:e.__scopeRovingFocusGroup,children:l.jsx(iM,{...e,ref:t})})}));Vb.displayName=kf;var iM=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:s=!1,dir:o,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...f}=e,m=g.useRef(null),v=Ke(t,m),x=di(o),[y=null,_]=Hr({prop:i,defaultProp:a,onChange:c}),[p,h]=g.useState(!1),w=Dt(u),C=$b(r),j=g.useRef(!1),[E,R]=g.useState(0);return g.useEffect(()=>{const P=m.current;if(P)return P.addEventListener(Bh,w),()=>P.removeEventListener(Bh,w)},[w]),l.jsx(sM,{scope:r,orientation:n,dir:x,loop:s,currentTabStopId:y,onItemFocus:g.useCallback(P=>_(P),[_]),onItemShiftTab:g.useCallback(()=>h(!0),[]),onFocusableItemAdd:g.useCallback(()=>R(P=>P+1),[]),onFocusableItemRemove:g.useCallback(()=>R(P=>P-1),[]),children:l.jsx(Re.div,{tabIndex:p||E===0?-1:0,"data-orientation":n,...f,ref:v,style:{outline:"none",...e.style},onMouseDown:ce(e.onMouseDown,()=>{j.current=!0}),onFocus:ce(e.onFocus,P=>{const A=!j.current;if(P.target===P.currentTarget&&A&&!p){const L=new CustomEvent(Bh,tM);if(P.currentTarget.dispatchEvent(L),!L.defaultPrevented){const q=C().filter(te=>te.focusable),N=q.find(te=>te.active),F=q.find(te=>te.id===y),V=[N,F,...q].filter(Boolean).map(te=>te.ref.current);Hb(V,d)}}j.current=!1}),onBlur:ce(e.onBlur,()=>h(!1))})})}),Bb="RovingFocusGroupItem",Wb=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:s=!1,tabStopId:o,...i}=e,a=Ur(),c=o||a,u=oM(Bb,r),d=u.currentTabStopId===c,f=$b(r),{onFocusableItemAdd:m,onFocusableItemRemove:v}=u;return g.useEffect(()=>{if(n)return m(),()=>v()},[n,m,v]),l.jsx(lm.ItemSlot,{scope:r,id:c,focusable:n,active:s,children:l.jsx(Re.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...i,ref:t,onMouseDown:ce(e.onMouseDown,x=>{n?u.onItemFocus(c):x.preventDefault()}),onFocus:ce(e.onFocus,()=>u.onItemFocus(c)),onKeyDown:ce(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){u.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const y=cM(x,u.orientation,u.dir);if(y!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let p=f().filter(h=>h.focusable).map(h=>h.ref.current);if(y==="last")p.reverse();else if(y==="prev"||y==="next"){y==="prev"&&p.reverse();const h=p.indexOf(x.currentTarget);p=u.loop?uM(p,h+1):p.slice(h+1)}setTimeout(()=>Hb(p))}})})})});Wb.displayName=Bb;var aM={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function lM(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function cM(e,t,r){const n=lM(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return aM[n]}function Hb(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function uM(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var nv=Vb,sv=Wb,dM=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Si=new WeakMap,gu=new WeakMap,vu={},Wh=0,Yb=function(e){return e&&(e.host||Yb(e.parentNode))},fM=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Yb(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},hM=function(e,t,r,n){var s=fM(t,Array.isArray(e)?e:[e]);vu[r]||(vu[r]=new WeakMap);var o=vu[r],i=[],a=new Set,c=new Set(s),u=function(f){!f||a.has(f)||(a.add(f),u(f.parentNode))};s.forEach(u);var d=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(m){if(a.has(m))d(m);else try{var v=m.getAttribute(n),x=v!==null&&v!=="false",y=(Si.get(m)||0)+1,_=(o.get(m)||0)+1;Si.set(m,y),o.set(m,_),i.push(m),y===1&&x&&gu.set(m,!0),_===1&&m.setAttribute(r,"true"),x||m.setAttribute(n,"true")}catch(p){console.error("aria-hidden: cannot operate on ",m,p)}})};return d(t),a.clear(),Wh++,function(){i.forEach(function(f){var m=Si.get(f)-1,v=o.get(f)-1;Si.set(f,m),o.set(f,v),m||(gu.has(f)||f.removeAttribute(n),gu.delete(f)),v||f.removeAttribute(r)}),Wh--,Wh||(Si=new WeakMap,Si=new WeakMap,gu=new WeakMap,vu={})}},ov=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),s=dM(e);return s?(n.push.apply(n,Array.from(s.querySelectorAll("[aria-live]"))),hM(n,s,r,"aria-hidden")):function(){return null}},Ln=function(){return Ln=Object.assign||function(t){for(var r,n=1,s=arguments.length;n"u")return RM;var t=PM(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},DM=qb(),ea="data-scroll-locked",OM=function(e,t,r,n){var s=e.left,o=e.top,i=e.right,a=e.gap;return r===void 0&&(r="margin"),` + */const zg=ht("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function zA(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function xf(...e){return t=>e.forEach(r=>zA(r,t))}function Ke(...e){return g.useCallback(xf(...e),e)}var bs=g.forwardRef((e,t)=>{const{children:r,...n}=e,s=g.Children.toArray(r),o=s.find(UA);if(o){const i=o.props.children,l=s.map(c=>c===o?g.Children.count(i)>1?g.Children.only(null):g.isValidElement(i)?i.props.children:null:c);return a.jsx(nm,{...n,ref:t,children:g.isValidElement(i)?g.cloneElement(i,void 0,l):null})}return a.jsx(nm,{...n,ref:t,children:r})});bs.displayName="Slot";var nm=g.forwardRef((e,t)=>{const{children:r,...n}=e;if(g.isValidElement(r)){const s=VA(r);return g.cloneElement(r,{...$A(n,r.props),ref:t?xf(t,s):s})}return g.Children.count(r)>1?g.Children.only(null):null});nm.displayName="SlotClone";var Ug=({children:e})=>a.jsx(a.Fragment,{children:e});function UA(e){return g.isValidElement(e)&&e.type===Ug}function $A(e,t){const r={...t};for(const n in t){const s=e[n],o=t[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...l)=>{o(...l),s(...l)}:s&&(r[n]=s):n==="style"?r[n]={...s,...o}:n==="className"&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}function VA(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function db(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;ttypeof e=="boolean"?"".concat(e):e===0?"0":e,R0=BA,Sc=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return R0(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:s,defaultVariants:o}=t,i=Object.keys(s).map(u=>{const d=r==null?void 0:r[u],f=o==null?void 0:o[u];if(d===null)return null;const m=T0(d)||T0(f);return s[u][m]}),l=r&&Object.entries(r).reduce((u,d)=>{let[f,m]=d;return m===void 0||(u[f]=m),u},{}),c=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((u,d)=>{let{class:f,className:m,...v}=d;return Object.entries(v).every(x=>{let[y,_]=x;return Array.isArray(_)?_.includes({...o,...l}[y]):{...o,...l}[y]===_})?[...u,f,m]:u},[]);return R0(e,i,c,r==null?void 0:r.class,r==null?void 0:r.className)};function fb(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;tl(o)))==null?void 0:i.classGroupId}const P0=/^\[(.+)\]$/;function YA(e){if(P0.test(e)){const t=P0.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}}function KA(e){const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return ZA(Object.entries(e.classGroups),r).forEach(([o,i])=>{sm(i,n,o,t)}),n}function sm(e,t,r,n){e.forEach(s=>{if(typeof s=="string"){const o=s===""?t:A0(t,s);o.classGroupId=r;return}if(typeof s=="function"){if(GA(s)){sm(s(n),t,r,n);return}t.validators.push({validator:s,classGroupId:r});return}Object.entries(s).forEach(([o,i])=>{sm(i,A0(t,o),r,n)})})}function A0(e,t){let r=e;return t.split($g).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r}function GA(e){return e.isThemeGetter}function ZA(e,t){return t?e.map(([r,n])=>{const s=n.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([i,l])=>[t+i,l])):o);return[r,s]}):e}function qA(e){if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;function s(o,i){r.set(o,i),t++,t>e&&(t=0,n=r,r=new Map)}return{get(o){let i=r.get(o);if(i!==void 0)return i;if((i=n.get(o))!==void 0)return s(o,i),i},set(o,i){r.has(o)?r.set(o,i):s(o,i)}}}const pb="!";function XA(e){const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,s=t[0],o=t.length;function i(l){const c=[];let u=0,d=0,f;for(let _=0;_d?f-d:void 0;return{modifiers:c,hasImportantModifier:v,baseClassName:x,maybePostfixModifierPosition:y}}return r?function(c){return r({className:c,parseClassName:i})}:i}function QA(e){if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t}function JA(e){return{cache:qA(e.cacheSize),parseClassName:XA(e),...HA(e)}}const eD=/\s+/;function tD(e,t){const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s}=t,o=new Set;return e.trim().split(eD).map(i=>{const{modifiers:l,hasImportantModifier:c,baseClassName:u,maybePostfixModifierPosition:d}=r(i);let f=!!d,m=n(f?u.substring(0,d):u);if(!m){if(!f)return{isTailwindClass:!1,originalClassName:i};if(m=n(u),!m)return{isTailwindClass:!1,originalClassName:i};f=!1}const v=QA(l).join(":");return{isTailwindClass:!0,modifierId:c?v+pb:v,classGroupId:m,originalClassName:i,hasPostfixModifier:f}}).reverse().filter(i=>{if(!i.isTailwindClass)return!0;const{modifierId:l,classGroupId:c,hasPostfixModifier:u}=i,d=l+c;return o.has(d)?!1:(o.add(d),s(c,u).forEach(f=>o.add(l+f)),!0)}).reverse().map(i=>i.originalClassName).join(" ")}function rD(){let e=0,t,r,n="";for(;ef(d),e());return r=JA(u),n=r.cache.get,s=r.cache.set,o=l,l(c)}function l(c){const u=n(c);if(u)return u;const d=tD(c,r);return s(c,d),d}return function(){return o(rD.apply(null,arguments))}}function _t(e){const t=r=>r[e]||[];return t.isThemeGetter=!0,t}const gb=/^\[(?:([a-z-]+):)?(.+)\]$/i,sD=/^\d+\/\d+$/,oD=new Set(["px","full","screen"]),iD=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,aD=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,lD=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,cD=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,uD=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function rs(e){return Bo(e)||oD.has(e)||sD.test(e)}function Bs(e){return Ta(e,"length",yD)}function Bo(e){return!!e&&!Number.isNaN(Number(e))}function hu(e){return Ta(e,"number",Bo)}function Qa(e){return!!e&&Number.isInteger(Number(e))}function dD(e){return e.endsWith("%")&&Bo(e.slice(0,-1))}function qe(e){return gb.test(e)}function Ws(e){return iD.test(e)}const fD=new Set(["length","size","percentage"]);function hD(e){return Ta(e,fD,vb)}function pD(e){return Ta(e,"position",vb)}const mD=new Set(["image","url"]);function gD(e){return Ta(e,mD,wD)}function vD(e){return Ta(e,"",xD)}function Ja(){return!0}function Ta(e,t,r){const n=gb.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1}function yD(e){return aD.test(e)&&!lD.test(e)}function vb(){return!1}function xD(e){return cD.test(e)}function wD(e){return uD.test(e)}function _D(){const e=_t("colors"),t=_t("spacing"),r=_t("blur"),n=_t("brightness"),s=_t("borderColor"),o=_t("borderRadius"),i=_t("borderSpacing"),l=_t("borderWidth"),c=_t("contrast"),u=_t("grayscale"),d=_t("hueRotate"),f=_t("invert"),m=_t("gap"),v=_t("gradientColorStops"),x=_t("gradientColorStopPositions"),y=_t("inset"),_=_t("margin"),p=_t("opacity"),h=_t("padding"),w=_t("saturate"),C=_t("scale"),j=_t("sepia"),E=_t("skew"),R=_t("space"),P=_t("translate"),A=()=>["auto","contain","none"],L=()=>["auto","hidden","clip","visible","scroll"],q=()=>["auto",qe,t],N=()=>[qe,t],F=()=>["",rs,Bs],b=()=>["auto",Bo,qe],V=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],te=()=>["solid","dashed","dotted","double","none"],B=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],K=()=>["start","end","center","between","around","evenly","stretch"],I=()=>["","0",qe],Q=()=>["auto","avoid","all","avoid-page","page","left","right","column"],z=()=>[Bo,hu],$=()=>[Bo,qe];return{cacheSize:500,separator:":",theme:{colors:[Ja],spacing:[rs,Bs],blur:["none","",Ws,qe],brightness:z(),borderColor:[e],borderRadius:["none","","full",Ws,qe],borderSpacing:N(),borderWidth:F(),contrast:z(),grayscale:I(),hueRotate:$(),invert:I(),gap:N(),gradientColorStops:[e],gradientColorStopPositions:[dD,Bs],inset:q(),margin:q(),opacity:z(),padding:N(),saturate:z(),scale:z(),sepia:I(),skew:$(),space:N(),translate:N()},classGroups:{aspect:[{aspect:["auto","square","video",qe]}],container:["container"],columns:[{columns:[Ws]}],"break-after":[{"break-after":Q()}],"break-before":[{"break-before":Q()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...V(),qe]}],overflow:[{overflow:L()}],"overflow-x":[{"overflow-x":L()}],"overflow-y":[{"overflow-y":L()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Qa,qe]}],basis:[{basis:q()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",qe]}],grow:[{grow:I()}],shrink:[{shrink:I()}],order:[{order:["first","last","none",Qa,qe]}],"grid-cols":[{"grid-cols":[Ja]}],"col-start-end":[{col:["auto",{span:["full",Qa,qe]},qe]}],"col-start":[{"col-start":b()}],"col-end":[{"col-end":b()}],"grid-rows":[{"grid-rows":[Ja]}],"row-start-end":[{row:["auto",{span:[Qa,qe]},qe]}],"row-start":[{"row-start":b()}],"row-end":[{"row-end":b()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",qe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",qe]}],gap:[{gap:[m]}],"gap-x":[{"gap-x":[m]}],"gap-y":[{"gap-y":[m]}],"justify-content":[{justify:["normal",...K()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...K(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...K(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[h]}],px:[{px:[h]}],py:[{py:[h]}],ps:[{ps:[h]}],pe:[{pe:[h]}],pt:[{pt:[h]}],pr:[{pr:[h]}],pb:[{pb:[h]}],pl:[{pl:[h]}],m:[{m:[_]}],mx:[{mx:[_]}],my:[{my:[_]}],ms:[{ms:[_]}],me:[{me:[_]}],mt:[{mt:[_]}],mr:[{mr:[_]}],mb:[{mb:[_]}],ml:[{ml:[_]}],"space-x":[{"space-x":[R]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[R]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",qe,t]}],"min-w":[{"min-w":[qe,t,"min","max","fit"]}],"max-w":[{"max-w":[qe,t,"none","full","min","max","fit","prose",{screen:[Ws]},Ws]}],h:[{h:[qe,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[qe,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[qe,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[qe,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ws,Bs]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",hu]}],"font-family":[{font:[Ja]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",qe]}],"line-clamp":[{"line-clamp":["none",Bo,hu]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",rs,qe]}],"list-image":[{"list-image":["none",qe]}],"list-style-type":[{list:["none","disc","decimal",qe]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[p]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[p]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...te(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",rs,Bs]}],"underline-offset":[{"underline-offset":["auto",rs,qe]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:N()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",qe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",qe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[p]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...V(),pD]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",hD]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},gD]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[x]}],"gradient-via-pos":[{via:[x]}],"gradient-to-pos":[{to:[x]}],"gradient-from":[{from:[v]}],"gradient-via":[{via:[v]}],"gradient-to":[{to:[v]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[p]}],"border-style":[{border:[...te(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[p]}],"divide-style":[{divide:te()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...te()]}],"outline-offset":[{"outline-offset":[rs,qe]}],"outline-w":[{outline:[rs,Bs]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:F()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[p]}],"ring-offset-w":[{"ring-offset":[rs,Bs]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ws,vD]}],"shadow-color":[{shadow:[Ja]}],opacity:[{opacity:[p]}],"mix-blend":[{"mix-blend":[...B(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":B()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Ws,qe]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[w]}],sepia:[{sepia:[j]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[p]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[j]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",qe]}],duration:[{duration:$()}],ease:[{ease:["linear","in","out","in-out",qe]}],delay:[{delay:$()}],animate:[{animate:["none","spin","ping","pulse","bounce",qe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[C]}],"scale-x":[{"scale-x":[C]}],"scale-y":[{"scale-y":[C]}],rotate:[{rotate:[Qa,qe]}],"translate-x":[{"translate-x":[P]}],"translate-y":[{"translate-y":[P]}],"skew-x":[{"skew-x":[E]}],"skew-y":[{"skew-y":[E]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",qe]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",qe]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":N()}],"scroll-mx":[{"scroll-mx":N()}],"scroll-my":[{"scroll-my":N()}],"scroll-ms":[{"scroll-ms":N()}],"scroll-me":[{"scroll-me":N()}],"scroll-mt":[{"scroll-mt":N()}],"scroll-mr":[{"scroll-mr":N()}],"scroll-mb":[{"scroll-mb":N()}],"scroll-ml":[{"scroll-ml":N()}],"scroll-p":[{"scroll-p":N()}],"scroll-px":[{"scroll-px":N()}],"scroll-py":[{"scroll-py":N()}],"scroll-ps":[{"scroll-ps":N()}],"scroll-pe":[{"scroll-pe":N()}],"scroll-pt":[{"scroll-pt":N()}],"scroll-pr":[{"scroll-pr":N()}],"scroll-pb":[{"scroll-pb":N()}],"scroll-pl":[{"scroll-pl":N()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",qe]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[rs,Bs,hu]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}const bD=nD(_D);function oe(...e){return bD(WA(e))}const wf=Sc("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),He=g.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...s},o)=>{const i=n?bs:"button";return a.jsx(i,{className:oe(wf({variant:t,size:r,className:e})),ref:o,...s})});He.displayName="Button";function ue(e,t,{checkForDefaultPrevented:r=!0}={}){return function(s){if(e==null||e(s),r===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function SD(e,t){const r=g.createContext(t);function n(o){const{children:i,...l}=o,c=g.useMemo(()=>l,Object.values(l));return a.jsx(r.Provider,{value:c,children:i})}function s(o){const i=g.useContext(r);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return n.displayName=e+"Provider",[n,s]}function sr(e,t=[]){let r=[];function n(o,i){const l=g.createContext(i),c=r.length;r=[...r,i];function u(f){const{scope:m,children:v,...x}=f,y=(m==null?void 0:m[e][c])||l,_=g.useMemo(()=>x,Object.values(x));return a.jsx(y.Provider,{value:_,children:v})}function d(f,m){const v=(m==null?void 0:m[e][c])||l,x=g.useContext(v);if(x)return x;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${o}\``)}return u.displayName=o+"Provider",[u,d]}const s=()=>{const o=r.map(i=>g.createContext(i));return function(l){const c=(l==null?void 0:l[e])||o;return g.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return s.scopeName=e,[n,kD(s,...t)]}function kD(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const i=n.reduce((l,{useScope:c,scopeName:u})=>{const f=c(o)[`__scope${u}`];return{...l,...f}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}function Dt(e){const t=g.useRef(e);return g.useEffect(()=>{t.current=e}),g.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function Yr({prop:e,defaultProp:t,onChange:r=()=>{}}){const[n,s]=CD({defaultProp:t,onChange:r}),o=e!==void 0,i=o?e:n,l=Dt(r),c=g.useCallback(u=>{if(o){const f=typeof u=="function"?u(e):u;f!==e&&l(f)}else s(u)},[o,e,s,l]);return[i,c]}function CD({defaultProp:e,onChange:t}){const r=g.useState(e),[n]=r,s=g.useRef(n),o=Dt(t);return g.useEffect(()=>{s.current!==n&&(o(n),s.current=n)},[n,s,o]),r}var jD=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Re=jD.reduce((e,t)=>{const r=g.forwardRef((n,s)=>{const{asChild:o,...i}=n,l=o?bs:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(l,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Vg(e,t){e&&Ts.flushSync(()=>e.dispatchEvent(t))}function kc(e){const t=e+"CollectionProvider",[r,n]=sr(t),[s,o]=r(t,{collectionRef:{current:null},itemMap:new Map}),i=v=>{const{scope:x,children:y}=v,_=Be.useRef(null),p=Be.useRef(new Map).current;return a.jsx(s,{scope:x,itemMap:p,collectionRef:_,children:y})};i.displayName=t;const l=e+"CollectionSlot",c=Be.forwardRef((v,x)=>{const{scope:y,children:_}=v,p=o(l,y),h=Ke(x,p.collectionRef);return a.jsx(bs,{ref:h,children:_})});c.displayName=l;const u=e+"CollectionItemSlot",d="data-radix-collection-item",f=Be.forwardRef((v,x)=>{const{scope:y,children:_,...p}=v,h=Be.useRef(null),w=Ke(x,h),C=o(u,y);return Be.useEffect(()=>(C.itemMap.set(h,{ref:h,...p}),()=>void C.itemMap.delete(h))),a.jsx(bs,{[d]:"",ref:w,children:_})});f.displayName=u;function m(v){const x=o(e+"CollectionConsumer",v);return Be.useCallback(()=>{const _=x.collectionRef.current;if(!_)return[];const p=Array.from(_.querySelectorAll(`[${d}]`));return Array.from(x.itemMap.values()).sort((C,j)=>p.indexOf(C.ref.current)-p.indexOf(j.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:i,Slot:c,ItemSlot:f},m,n]}var ED=g.createContext(void 0);function di(e){const t=g.useContext(ED);return e||t||"ltr"}function ND(e,t=globalThis==null?void 0:globalThis.document){const r=Dt(e);g.useEffect(()=>{const n=s=>{s.key==="Escape"&&r(s)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var TD="DismissableLayer",om="dismissableLayer.update",RD="dismissableLayer.pointerDownOutside",PD="dismissableLayer.focusOutside",D0,yb=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ra=g.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:i,onDismiss:l,...c}=e,u=g.useContext(yb),[d,f]=g.useState(null),m=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,v]=g.useState({}),x=Ke(t,R=>f(R)),y=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),p=y.indexOf(_),h=d?y.indexOf(d):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,C=h>=p,j=DD(R=>{const P=R.target,A=[...u.branches].some(L=>L.contains(P));!C||A||(s==null||s(R),i==null||i(R),R.defaultPrevented||l==null||l())},m),E=OD(R=>{const P=R.target;[...u.branches].some(L=>L.contains(P))||(o==null||o(R),i==null||i(R),R.defaultPrevented||l==null||l())},m);return ND(R=>{h===u.layers.size-1&&(n==null||n(R),!R.defaultPrevented&&l&&(R.preventDefault(),l()))},m),g.useEffect(()=>{if(d)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(D0=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),O0(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=D0)}},[d,m,r,u]),g.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),O0())},[d,u]),g.useEffect(()=>{const R=()=>v({});return document.addEventListener(om,R),()=>document.removeEventListener(om,R)},[]),a.jsx(Re.div,{...c,ref:x,style:{pointerEvents:w?C?"auto":"none":void 0,...e.style},onFocusCapture:ue(e.onFocusCapture,E.onFocusCapture),onBlurCapture:ue(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:ue(e.onPointerDownCapture,j.onPointerDownCapture)})});Ra.displayName=TD;var AD="DismissableLayerBranch",xb=g.forwardRef((e,t)=>{const r=g.useContext(yb),n=g.useRef(null),s=Ke(t,n);return g.useEffect(()=>{const o=n.current;if(o)return r.branches.add(o),()=>{r.branches.delete(o)}},[r.branches]),a.jsx(Re.div,{...e,ref:s})});xb.displayName=AD;function DD(e,t=globalThis==null?void 0:globalThis.document){const r=Dt(e),n=g.useRef(!1),s=g.useRef(()=>{});return g.useEffect(()=>{const o=l=>{if(l.target&&!n.current){let c=function(){wb(RD,r,u,{discrete:!0})};const u={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=c,t.addEventListener("click",s.current,{once:!0})):c()}else t.removeEventListener("click",s.current);n.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",o),t.removeEventListener("click",s.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function OD(e,t=globalThis==null?void 0:globalThis.document){const r=Dt(e),n=g.useRef(!1);return g.useEffect(()=>{const s=o=>{o.target&&!n.current&&wb(PD,r,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function O0(){const e=new CustomEvent(om);document.dispatchEvent(e)}function wb(e,t,r,{discrete:n}){const s=r.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),n?Vg(s,o):s.dispatchEvent(o)}var MD=Ra,ID=xb,zh=0;function Bg(){g.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??M0()),document.body.insertAdjacentElement("beforeend",e[1]??M0()),zh++,()=>{zh===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),zh--}},[])}function M0(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var Uh="focusScope.autoFocusOnMount",$h="focusScope.autoFocusOnUnmount",I0={bubbles:!1,cancelable:!0},LD="FocusScope",_f=g.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...i}=e,[l,c]=g.useState(null),u=Dt(s),d=Dt(o),f=g.useRef(null),m=Ke(t,y=>c(y)),v=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(n){let y=function(w){if(v.paused||!l)return;const C=w.target;l.contains(C)?f.current=C:Ys(f.current,{select:!0})},_=function(w){if(v.paused||!l)return;const C=w.relatedTarget;C!==null&&(l.contains(C)||Ys(f.current,{select:!0}))},p=function(w){if(document.activeElement===document.body)for(const j of w)j.removedNodes.length>0&&Ys(l)};document.addEventListener("focusin",y),document.addEventListener("focusout",_);const h=new MutationObserver(p);return l&&h.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",_),h.disconnect()}}},[n,l,v.paused]),g.useEffect(()=>{if(l){F0.add(v);const y=document.activeElement;if(!l.contains(y)){const p=new CustomEvent(Uh,I0);l.addEventListener(Uh,u),l.dispatchEvent(p),p.defaultPrevented||(FD(BD(_b(l)),{select:!0}),document.activeElement===y&&Ys(l))}return()=>{l.removeEventListener(Uh,u),setTimeout(()=>{const p=new CustomEvent($h,I0);l.addEventListener($h,d),l.dispatchEvent(p),p.defaultPrevented||Ys(y??document.body,{select:!0}),l.removeEventListener($h,d),F0.remove(v)},0)}}},[l,u,d,v]);const x=g.useCallback(y=>{if(!r&&!n||v.paused)return;const _=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,p=document.activeElement;if(_&&p){const h=y.currentTarget,[w,C]=zD(h);w&&C?!y.shiftKey&&p===C?(y.preventDefault(),r&&Ys(w,{select:!0})):y.shiftKey&&p===w&&(y.preventDefault(),r&&Ys(C,{select:!0})):p===h&&y.preventDefault()}},[r,n,v.paused]);return a.jsx(Re.div,{tabIndex:-1,...i,ref:m,onKeyDown:x})});_f.displayName=LD;function FD(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(Ys(n,{select:t}),document.activeElement!==r)return}function zD(e){const t=_b(e),r=L0(t,e),n=L0(t.reverse(),e);return[r,n]}function _b(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function L0(e,t){for(const r of e)if(!UD(r,{upTo:t}))return r}function UD(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function $D(e){return e instanceof HTMLInputElement&&"select"in e}function Ys(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&$D(e)&&t&&e.select()}}var F0=VD();function VD(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=z0(e,t),e.unshift(t)},remove(t){var r;e=z0(e,t),(r=e[0])==null||r.resume()}}}function z0(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function BD(e){return e.filter(t=>t.tagName!=="A")}var Jt=globalThis!=null&&globalThis.document?g.useLayoutEffect:()=>{},WD=Uw.useId||(()=>{}),HD=0;function $r(e){const[t,r]=g.useState(WD());return Jt(()=>{r(n=>n??String(HD++))},[e]),t?`radix-${t}`:""}const YD=["top","right","bottom","left"],Un=Math.min,Fr=Math.max,Sd=Math.round,pu=Math.floor,yo=e=>({x:e,y:e}),KD={left:"right",right:"left",bottom:"top",top:"bottom"},GD={start:"end",end:"start"};function im(e,t,r){return Fr(e,Un(t,r))}function Ss(e,t){return typeof e=="function"?e(t):e}function ks(e){return e.split("-")[0]}function Pa(e){return e.split("-")[1]}function Wg(e){return e==="x"?"y":"x"}function Hg(e){return e==="y"?"height":"width"}function xo(e){return["top","bottom"].includes(ks(e))?"y":"x"}function Yg(e){return Wg(xo(e))}function ZD(e,t,r){r===void 0&&(r=!1);const n=Pa(e),s=Yg(e),o=Hg(s);let i=s==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(i=kd(i)),[i,kd(i)]}function qD(e){const t=kd(e);return[am(e),t,am(t)]}function am(e){return e.replace(/start|end/g,t=>GD[t])}function XD(e,t,r){const n=["left","right"],s=["right","left"],o=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return r?t?s:n:t?n:s;case"left":case"right":return t?o:i;default:return[]}}function QD(e,t,r,n){const s=Pa(e);let o=XD(ks(e),r==="start",n);return s&&(o=o.map(i=>i+"-"+s),t&&(o=o.concat(o.map(am)))),o}function kd(e){return e.replace(/left|right|bottom|top/g,t=>KD[t])}function JD(e){return{top:0,right:0,bottom:0,left:0,...e}}function bb(e){return typeof e!="number"?JD(e):{top:e,right:e,bottom:e,left:e}}function Cd(e){const{x:t,y:r,width:n,height:s}=e;return{width:n,height:s,top:r,left:t,right:t+n,bottom:r+s,x:t,y:r}}function U0(e,t,r){let{reference:n,floating:s}=e;const o=xo(t),i=Yg(t),l=Hg(i),c=ks(t),u=o==="y",d=n.x+n.width/2-s.width/2,f=n.y+n.height/2-s.height/2,m=n[l]/2-s[l]/2;let v;switch(c){case"top":v={x:d,y:n.y-s.height};break;case"bottom":v={x:d,y:n.y+n.height};break;case"right":v={x:n.x+n.width,y:f};break;case"left":v={x:n.x-s.width,y:f};break;default:v={x:n.x,y:n.y}}switch(Pa(t)){case"start":v[i]-=m*(r&&u?-1:1);break;case"end":v[i]+=m*(r&&u?-1:1);break}return v}const eO=async(e,t,r)=>{const{placement:n="bottom",strategy:s="absolute",middleware:o=[],platform:i}=r,l=o.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t));let u=await i.getElementRects({reference:e,floating:t,strategy:s}),{x:d,y:f}=U0(u,n,c),m=n,v={},x=0;for(let y=0;y({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:s,rects:o,platform:i,elements:l,middlewareData:c}=t,{element:u,padding:d=0}=Ss(e,t)||{};if(u==null)return{};const f=bb(d),m={x:r,y:n},v=Yg(s),x=Hg(v),y=await i.getDimensions(u),_=v==="y",p=_?"top":"left",h=_?"bottom":"right",w=_?"clientHeight":"clientWidth",C=o.reference[x]+o.reference[v]-m[v]-o.floating[x],j=m[v]-o.reference[v],E=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let R=E?E[w]:0;(!R||!await(i.isElement==null?void 0:i.isElement(E)))&&(R=l.floating[w]||o.floating[x]);const P=C/2-j/2,A=R/2-y[x]/2-1,L=Un(f[p],A),q=Un(f[h],A),N=L,F=R-y[x]-q,b=R/2-y[x]/2+P,V=im(N,b,F),te=!c.arrow&&Pa(s)!=null&&b!==V&&o.reference[x]/2-(bb<=0)){var q,N;const b=(((q=o.flip)==null?void 0:q.index)||0)+1,V=R[b];if(V)return{data:{index:b,overflows:L},reset:{placement:V}};let te=(N=L.filter(B=>B.overflows[0]<=0).sort((B,K)=>B.overflows[1]-K.overflows[1])[0])==null?void 0:N.placement;if(!te)switch(v){case"bestFit":{var F;const B=(F=L.filter(K=>{if(E){const I=xo(K.placement);return I===h||I==="y"}return!0}).map(K=>[K.placement,K.overflows.filter(I=>I>0).reduce((I,Q)=>I+Q,0)]).sort((K,I)=>K[1]-I[1])[0])==null?void 0:F[0];B&&(te=B);break}case"initialPlacement":te=l;break}if(s!==te)return{reset:{placement:te}}}return{}}}};function $0(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function V0(e){return YD.some(t=>e[t]>=0)}const nO=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...s}=Ss(e,t);switch(n){case"referenceHidden":{const o=await ql(t,{...s,elementContext:"reference"}),i=$0(o,r.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:V0(i)}}}case"escaped":{const o=await ql(t,{...s,altBoundary:!0}),i=$0(o,r.floating);return{data:{escapedOffsets:i,escaped:V0(i)}}}default:return{}}}}};async function sO(e,t){const{placement:r,platform:n,elements:s}=e,o=await(n.isRTL==null?void 0:n.isRTL(s.floating)),i=ks(r),l=Pa(r),c=xo(r)==="y",u=["left","top"].includes(i)?-1:1,d=o&&c?-1:1,f=Ss(t,e);let{mainAxis:m,crossAxis:v,alignmentAxis:x}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return l&&typeof x=="number"&&(v=l==="end"?x*-1:x),c?{x:v*d,y:m*u}:{x:m*u,y:v*d}}const oO=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:s,y:o,placement:i,middlewareData:l}=t,c=await sO(t,e);return i===((r=l.offset)==null?void 0:r.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:s+c.x,y:o+c.y,data:{...c,placement:i}}}}},iO=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:s}=t,{mainAxis:o=!0,crossAxis:i=!1,limiter:l={fn:_=>{let{x:p,y:h}=_;return{x:p,y:h}}},...c}=Ss(e,t),u={x:r,y:n},d=await ql(t,c),f=xo(ks(s)),m=Wg(f);let v=u[m],x=u[f];if(o){const _=m==="y"?"top":"left",p=m==="y"?"bottom":"right",h=v+d[_],w=v-d[p];v=im(h,v,w)}if(i){const _=f==="y"?"top":"left",p=f==="y"?"bottom":"right",h=x+d[_],w=x-d[p];x=im(h,x,w)}const y=l.fn({...t,[m]:v,[f]:x});return{...y,data:{x:y.x-r,y:y.y-n}}}}},aO=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:s,rects:o,middlewareData:i}=t,{offset:l=0,mainAxis:c=!0,crossAxis:u=!0}=Ss(e,t),d={x:r,y:n},f=xo(s),m=Wg(f);let v=d[m],x=d[f];const y=Ss(l,t),_=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(c){const w=m==="y"?"height":"width",C=o.reference[m]-o.floating[w]+_.mainAxis,j=o.reference[m]+o.reference[w]-_.mainAxis;vj&&(v=j)}if(u){var p,h;const w=m==="y"?"width":"height",C=["top","left"].includes(ks(s)),j=o.reference[f]-o.floating[w]+(C&&((p=i.offset)==null?void 0:p[f])||0)+(C?0:_.crossAxis),E=o.reference[f]+o.reference[w]+(C?0:((h=i.offset)==null?void 0:h[f])||0)-(C?_.crossAxis:0);xE&&(x=E)}return{[m]:v,[f]:x}}}},lO=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:r,rects:n,platform:s,elements:o}=t,{apply:i=()=>{},...l}=Ss(e,t),c=await ql(t,l),u=ks(r),d=Pa(r),f=xo(r)==="y",{width:m,height:v}=n.floating;let x,y;u==="top"||u==="bottom"?(x=u,y=d===(await(s.isRTL==null?void 0:s.isRTL(o.floating))?"start":"end")?"left":"right"):(y=u,x=d==="end"?"top":"bottom");const _=v-c.top-c.bottom,p=m-c.left-c.right,h=Un(v-c[x],_),w=Un(m-c[y],p),C=!t.middlewareData.shift;let j=h,E=w;if(f?E=d||C?Un(w,p):p:j=d||C?Un(h,_):_,C&&!d){const P=Fr(c.left,0),A=Fr(c.right,0),L=Fr(c.top,0),q=Fr(c.bottom,0);f?E=m-2*(P!==0||A!==0?P+A:Fr(c.left,c.right)):j=v-2*(L!==0||q!==0?L+q:Fr(c.top,c.bottom))}await i({...t,availableWidth:E,availableHeight:j});const R=await s.getDimensions(o.floating);return m!==R.width||v!==R.height?{reset:{rects:!0}}:{}}}};function Aa(e){return Sb(e)?(e.nodeName||"").toLowerCase():"#document"}function Vr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function As(e){var t;return(t=(Sb(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Sb(e){return e instanceof Node||e instanceof Vr(e).Node}function Sn(e){return e instanceof Element||e instanceof Vr(e).Element}function Hn(e){return e instanceof HTMLElement||e instanceof Vr(e).HTMLElement}function B0(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Vr(e).ShadowRoot}function Cc(e){const{overflow:t,overflowX:r,overflowY:n,display:s}=kn(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(s)}function cO(e){return["table","td","th"].includes(Aa(e))}function bf(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Kg(e){const t=Gg(),r=Sn(e)?kn(e):e;return r.transform!=="none"||r.perspective!=="none"||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function uO(e){let t=wo(e);for(;Hn(t)&&!ga(t);){if(Kg(t))return t;if(bf(t))return null;t=wo(t)}return null}function Gg(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ga(e){return["html","body","#document"].includes(Aa(e))}function kn(e){return Vr(e).getComputedStyle(e)}function Sf(e){return Sn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function wo(e){if(Aa(e)==="html")return e;const t=e.assignedSlot||e.parentNode||B0(e)&&e.host||As(e);return B0(t)?t.host:t}function kb(e){const t=wo(e);return ga(t)?e.ownerDocument?e.ownerDocument.body:e.body:Hn(t)&&Cc(t)?t:kb(t)}function Xl(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const s=kb(e),o=s===((n=e.ownerDocument)==null?void 0:n.body),i=Vr(s);return o?t.concat(i,i.visualViewport||[],Cc(s)?s:[],i.frameElement&&r?Xl(i.frameElement):[]):t.concat(s,Xl(s,[],r))}function Cb(e){const t=kn(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const s=Hn(e),o=s?e.offsetWidth:r,i=s?e.offsetHeight:n,l=Sd(r)!==o||Sd(n)!==i;return l&&(r=o,n=i),{width:r,height:n,$:l}}function Zg(e){return Sn(e)?e:e.contextElement}function Ji(e){const t=Zg(e);if(!Hn(t))return yo(1);const r=t.getBoundingClientRect(),{width:n,height:s,$:o}=Cb(t);let i=(o?Sd(r.width):r.width)/n,l=(o?Sd(r.height):r.height)/s;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const dO=yo(0);function jb(e){const t=Vr(e);return!Gg()||!t.visualViewport?dO:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function fO(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Vr(e)?!1:t}function si(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const s=e.getBoundingClientRect(),o=Zg(e);let i=yo(1);t&&(n?Sn(n)&&(i=Ji(n)):i=Ji(e));const l=fO(o,r,n)?jb(o):yo(0);let c=(s.left+l.x)/i.x,u=(s.top+l.y)/i.y,d=s.width/i.x,f=s.height/i.y;if(o){const m=Vr(o),v=n&&Sn(n)?Vr(n):n;let x=m,y=x.frameElement;for(;y&&n&&v!==x;){const _=Ji(y),p=y.getBoundingClientRect(),h=kn(y),w=p.left+(y.clientLeft+parseFloat(h.paddingLeft))*_.x,C=p.top+(y.clientTop+parseFloat(h.paddingTop))*_.y;c*=_.x,u*=_.y,d*=_.x,f*=_.y,c+=w,u+=C,x=Vr(y),y=x.frameElement}}return Cd({width:d,height:f,x:c,y:u})}function hO(e){let{elements:t,rect:r,offsetParent:n,strategy:s}=e;const o=s==="fixed",i=As(n),l=t?bf(t.floating):!1;if(n===i||l&&o)return r;let c={scrollLeft:0,scrollTop:0},u=yo(1);const d=yo(0),f=Hn(n);if((f||!f&&!o)&&((Aa(n)!=="body"||Cc(i))&&(c=Sf(n)),Hn(n))){const m=si(n);u=Ji(n),d.x=m.x+n.clientLeft,d.y=m.y+n.clientTop}return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-c.scrollLeft*u.x+d.x,y:r.y*u.y-c.scrollTop*u.y+d.y}}function pO(e){return Array.from(e.getClientRects())}function Eb(e){return si(As(e)).left+Sf(e).scrollLeft}function mO(e){const t=As(e),r=Sf(e),n=e.ownerDocument.body,s=Fr(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=Fr(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+Eb(e);const l=-r.scrollTop;return kn(n).direction==="rtl"&&(i+=Fr(t.clientWidth,n.clientWidth)-s),{width:s,height:o,x:i,y:l}}function gO(e,t){const r=Vr(e),n=As(e),s=r.visualViewport;let o=n.clientWidth,i=n.clientHeight,l=0,c=0;if(s){o=s.width,i=s.height;const u=Gg();(!u||u&&t==="fixed")&&(l=s.offsetLeft,c=s.offsetTop)}return{width:o,height:i,x:l,y:c}}function vO(e,t){const r=si(e,!0,t==="fixed"),n=r.top+e.clientTop,s=r.left+e.clientLeft,o=Hn(e)?Ji(e):yo(1),i=e.clientWidth*o.x,l=e.clientHeight*o.y,c=s*o.x,u=n*o.y;return{width:i,height:l,x:c,y:u}}function W0(e,t,r){let n;if(t==="viewport")n=gO(e,r);else if(t==="document")n=mO(As(e));else if(Sn(t))n=vO(t,r);else{const s=jb(e);n={...t,x:t.x-s.x,y:t.y-s.y}}return Cd(n)}function Nb(e,t){const r=wo(e);return r===t||!Sn(r)||ga(r)?!1:kn(r).position==="fixed"||Nb(r,t)}function yO(e,t){const r=t.get(e);if(r)return r;let n=Xl(e,[],!1).filter(l=>Sn(l)&&Aa(l)!=="body"),s=null;const o=kn(e).position==="fixed";let i=o?wo(e):e;for(;Sn(i)&&!ga(i);){const l=kn(i),c=Kg(i);!c&&l.position==="fixed"&&(s=null),(o?!c&&!s:!c&&l.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||Cc(i)&&!c&&Nb(e,i))?n=n.filter(d=>d!==i):s=l,i=wo(i)}return t.set(e,n),n}function xO(e){let{element:t,boundary:r,rootBoundary:n,strategy:s}=e;const i=[...r==="clippingAncestors"?bf(t)?[]:yO(t,this._c):[].concat(r),n],l=i[0],c=i.reduce((u,d)=>{const f=W0(t,d,s);return u.top=Fr(f.top,u.top),u.right=Un(f.right,u.right),u.bottom=Un(f.bottom,u.bottom),u.left=Fr(f.left,u.left),u},W0(t,l,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function wO(e){const{width:t,height:r}=Cb(e);return{width:t,height:r}}function _O(e,t,r){const n=Hn(t),s=As(t),o=r==="fixed",i=si(e,!0,o,t);let l={scrollLeft:0,scrollTop:0};const c=yo(0);if(n||!n&&!o)if((Aa(t)!=="body"||Cc(s))&&(l=Sf(t)),n){const f=si(t,!0,o,t);c.x=f.x+t.clientLeft,c.y=f.y+t.clientTop}else s&&(c.x=Eb(s));const u=i.left+l.scrollLeft-c.x,d=i.top+l.scrollTop-c.y;return{x:u,y:d,width:i.width,height:i.height}}function Vh(e){return kn(e).position==="static"}function H0(e,t){return!Hn(e)||kn(e).position==="fixed"?null:t?t(e):e.offsetParent}function Tb(e,t){const r=Vr(e);if(bf(e))return r;if(!Hn(e)){let s=wo(e);for(;s&&!ga(s);){if(Sn(s)&&!Vh(s))return s;s=wo(s)}return r}let n=H0(e,t);for(;n&&cO(n)&&Vh(n);)n=H0(n,t);return n&&ga(n)&&Vh(n)&&!Kg(n)?r:n||uO(e)||r}const bO=async function(e){const t=this.getOffsetParent||Tb,r=this.getDimensions,n=await r(e.floating);return{reference:_O(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function SO(e){return kn(e).direction==="rtl"}const kO={convertOffsetParentRelativeRectToViewportRelativeRect:hO,getDocumentElement:As,getClippingRect:xO,getOffsetParent:Tb,getElementRects:bO,getClientRects:pO,getDimensions:wO,getScale:Ji,isElement:Sn,isRTL:SO};function CO(e,t){let r=null,n;const s=As(e);function o(){var l;clearTimeout(n),(l=r)==null||l.disconnect(),r=null}function i(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),o();const{left:u,top:d,width:f,height:m}=e.getBoundingClientRect();if(l||t(),!f||!m)return;const v=pu(d),x=pu(s.clientWidth-(u+f)),y=pu(s.clientHeight-(d+m)),_=pu(u),h={rootMargin:-v+"px "+-x+"px "+-y+"px "+-_+"px",threshold:Fr(0,Un(1,c))||1};let w=!0;function C(j){const E=j[0].intersectionRatio;if(E!==c){if(!w)return i();E?i(!1,E):n=setTimeout(()=>{i(!1,1e-7)},1e3)}w=!1}try{r=new IntersectionObserver(C,{...h,root:s.ownerDocument})}catch{r=new IntersectionObserver(C,h)}r.observe(e)}return i(!0),o}function jO(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,u=Zg(e),d=s||o?[...u?Xl(u):[],...Xl(t)]:[];d.forEach(p=>{s&&p.addEventListener("scroll",r,{passive:!0}),o&&p.addEventListener("resize",r)});const f=u&&l?CO(u,r):null;let m=-1,v=null;i&&(v=new ResizeObserver(p=>{let[h]=p;h&&h.target===u&&v&&(v.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var w;(w=v)==null||w.observe(t)})),r()}),u&&!c&&v.observe(u),v.observe(t));let x,y=c?si(e):null;c&&_();function _(){const p=si(e);y&&(p.x!==y.x||p.y!==y.y||p.width!==y.width||p.height!==y.height)&&r(),y=p,x=requestAnimationFrame(_)}return r(),()=>{var p;d.forEach(h=>{s&&h.removeEventListener("scroll",r),o&&h.removeEventListener("resize",r)}),f==null||f(),(p=v)==null||p.disconnect(),v=null,c&&cancelAnimationFrame(x)}}const EO=oO,NO=iO,TO=rO,RO=lO,PO=nO,Y0=tO,AO=aO,DO=(e,t,r)=>{const n=new Map,s={platform:kO,...r},o={...s.platform,_c:n};return eO(e,t,{...s,platform:o})};var $u=typeof document<"u"?g.useLayoutEffect:g.useEffect;function jd(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!jd(e[n],t[n]))return!1;return!0}if(s=Object.keys(e),r=s.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,s[n]))return!1;for(n=r;n--!==0;){const o=s[n];if(!(o==="_owner"&&e.$$typeof)&&!jd(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Rb(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function K0(e,t){const r=Rb(e);return Math.round(t*r)/r}function G0(e){const t=g.useRef(e);return $u(()=>{t.current=e}),t}function OO(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:s,elements:{reference:o,floating:i}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,f]=g.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,v]=g.useState(n);jd(m,n)||v(n);const[x,y]=g.useState(null),[_,p]=g.useState(null),h=g.useCallback(B=>{B!==E.current&&(E.current=B,y(B))},[]),w=g.useCallback(B=>{B!==R.current&&(R.current=B,p(B))},[]),C=o||x,j=i||_,E=g.useRef(null),R=g.useRef(null),P=g.useRef(d),A=c!=null,L=G0(c),q=G0(s),N=g.useCallback(()=>{if(!E.current||!R.current)return;const B={placement:t,strategy:r,middleware:m};q.current&&(B.platform=q.current),DO(E.current,R.current,B).then(K=>{const I={...K,isPositioned:!0};F.current&&!jd(P.current,I)&&(P.current=I,Ts.flushSync(()=>{f(I)}))})},[m,t,r,q]);$u(()=>{u===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,f(B=>({...B,isPositioned:!1})))},[u]);const F=g.useRef(!1);$u(()=>(F.current=!0,()=>{F.current=!1}),[]),$u(()=>{if(C&&(E.current=C),j&&(R.current=j),C&&j){if(L.current)return L.current(C,j,N);N()}},[C,j,N,L,A]);const b=g.useMemo(()=>({reference:E,floating:R,setReference:h,setFloating:w}),[h,w]),V=g.useMemo(()=>({reference:C,floating:j}),[C,j]),te=g.useMemo(()=>{const B={position:r,left:0,top:0};if(!V.floating)return B;const K=K0(V.floating,d.x),I=K0(V.floating,d.y);return l?{...B,transform:"translate("+K+"px, "+I+"px)",...Rb(V.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:K,top:I}},[r,l,V.floating,d.x,d.y]);return g.useMemo(()=>({...d,update:N,refs:b,elements:V,floatingStyles:te}),[d,N,b,V,te])}const MO=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:s}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?Y0({element:n.current,padding:s}).fn(r):{}:n?Y0({element:n,padding:s}).fn(r):{}}}},IO=(e,t)=>({...EO(e),options:[e,t]}),LO=(e,t)=>({...NO(e),options:[e,t]}),FO=(e,t)=>({...AO(e),options:[e,t]}),zO=(e,t)=>({...TO(e),options:[e,t]}),UO=(e,t)=>({...RO(e),options:[e,t]}),$O=(e,t)=>({...PO(e),options:[e,t]}),VO=(e,t)=>({...MO(e),options:[e,t]});var BO="Arrow",Pb=g.forwardRef((e,t)=>{const{children:r,width:n=10,height:s=5,...o}=e;return a.jsx(Re.svg,{...o,ref:t,width:n,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:a.jsx("polygon",{points:"0,0 30,0 15,10"})})});Pb.displayName=BO;var WO=Pb;function qg(e){const[t,r]=g.useState(void 0);return Jt(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const o=s[0];let i,l;if("borderBoxSize"in o){const c=o.borderBoxSize,u=Array.isArray(c)?c[0]:c;i=u.inlineSize,l=u.blockSize}else i=e.offsetWidth,l=e.offsetHeight;r({width:i,height:l})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var Xg="Popper",[Ab,Da]=sr(Xg),[HO,Db]=Ab(Xg),Ob=e=>{const{__scopePopper:t,children:r}=e,[n,s]=g.useState(null);return a.jsx(HO,{scope:t,anchor:n,onAnchorChange:s,children:r})};Ob.displayName=Xg;var Mb="PopperAnchor",Ib=g.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...s}=e,o=Db(Mb,r),i=g.useRef(null),l=Ke(t,i);return g.useEffect(()=>{o.onAnchorChange((n==null?void 0:n.current)||i.current)}),n?null:a.jsx(Re.div,{...s,ref:l})});Ib.displayName=Mb;var Qg="PopperContent",[YO,KO]=Ab(Qg),Lb=g.forwardRef((e,t)=>{var pe,xe,Te,Fe,Me,Pe;const{__scopePopper:r,side:n="bottom",sideOffset:s=0,align:o="center",alignOffset:i=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:m=!1,updatePositionStrategy:v="optimized",onPlaced:x,...y}=e,_=Db(Qg,r),[p,h]=g.useState(null),w=Ke(t,nt=>h(nt)),[C,j]=g.useState(null),E=qg(C),R=(E==null?void 0:E.width)??0,P=(E==null?void 0:E.height)??0,A=n+(o!=="center"?"-"+o:""),L=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},q=Array.isArray(u)?u:[u],N=q.length>0,F={padding:L,boundary:q.filter(ZO),altBoundary:N},{refs:b,floatingStyles:V,placement:te,isPositioned:B,middlewareData:K}=OO({strategy:"fixed",placement:A,whileElementsMounted:(...nt)=>jO(...nt,{animationFrame:v==="always"}),elements:{reference:_.anchor},middleware:[IO({mainAxis:s+P,alignmentAxis:i}),c&&LO({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?FO():void 0,...F}),c&&zO({...F}),UO({...F,apply:({elements:nt,rects:k,availableWidth:J,availableHeight:G})=>{const{width:D,height:S}=k.reference,T=nt.floating.style;T.setProperty("--radix-popper-available-width",`${J}px`),T.setProperty("--radix-popper-available-height",`${G}px`),T.setProperty("--radix-popper-anchor-width",`${D}px`),T.setProperty("--radix-popper-anchor-height",`${S}px`)}}),C&&VO({element:C,padding:l}),qO({arrowWidth:R,arrowHeight:P}),m&&$O({strategy:"referenceHidden",...F})]}),[I,Q]=Ub(te),z=Dt(x);Jt(()=>{B&&(z==null||z())},[B,z]);const $=(pe=K.arrow)==null?void 0:pe.x,he=(xe=K.arrow)==null?void 0:xe.y,ne=((Te=K.arrow)==null?void 0:Te.centerOffset)!==0,[se,Oe]=g.useState();return Jt(()=>{p&&Oe(window.getComputedStyle(p).zIndex)},[p]),a.jsx("div",{ref:b.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:B?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:se,"--radix-popper-transform-origin":[(Fe=K.transformOrigin)==null?void 0:Fe.x,(Me=K.transformOrigin)==null?void 0:Me.y].join(" "),...((Pe=K.hide)==null?void 0:Pe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(YO,{scope:r,placedSide:I,onArrowChange:j,arrowX:$,arrowY:he,shouldHideArrow:ne,children:a.jsx(Re.div,{"data-side":I,"data-align":Q,...y,ref:w,style:{...y.style,animation:B?void 0:"none"}})})})});Lb.displayName=Qg;var Fb="PopperArrow",GO={top:"bottom",right:"left",bottom:"top",left:"right"},zb=g.forwardRef(function(t,r){const{__scopePopper:n,...s}=t,o=KO(Fb,n),i=GO[o.placedSide];return a.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:a.jsx(WO,{...s,ref:r,style:{...s.style,display:"block"}})})});zb.displayName=Fb;function ZO(e){return e!==null}var qO=e=>({name:"transformOrigin",options:e,fn(t){var _,p,h;const{placement:r,rects:n,middlewareData:s}=t,i=((_=s.arrow)==null?void 0:_.centerOffset)!==0,l=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[u,d]=Ub(r),f={start:"0%",center:"50%",end:"100%"}[d],m=(((p=s.arrow)==null?void 0:p.x)??0)+l/2,v=(((h=s.arrow)==null?void 0:h.y)??0)+c/2;let x="",y="";return u==="bottom"?(x=i?f:`${m}px`,y=`${-c}px`):u==="top"?(x=i?f:`${m}px`,y=`${n.floating.height+c}px`):u==="right"?(x=`${-c}px`,y=i?f:`${v}px`):u==="left"&&(x=`${n.floating.width+c}px`,y=i?f:`${v}px`),{data:{x,y}}}});function Ub(e){const[t,r="center"]=e.split("-");return[t,r]}var Jg=Ob,ev=Ib,tv=Lb,rv=zb,XO="Portal",jc=g.forwardRef((e,t)=>{var l;const{container:r,...n}=e,[s,o]=g.useState(!1);Jt(()=>o(!0),[]);const i=r||s&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return i?B1.createPortal(a.jsx(Re.div,{...n,ref:t}),i):null});jc.displayName=XO;function QO(e,t){return g.useReducer((r,n)=>t[r][n]??r,e)}var or=e=>{const{present:t,children:r}=e,n=JO(t),s=typeof r=="function"?r({present:n.isPresent}):g.Children.only(r),o=Ke(n.ref,eM(s));return typeof r=="function"||n.isPresent?g.cloneElement(s,{ref:o}):null};or.displayName="Presence";function JO(e){const[t,r]=g.useState(),n=g.useRef({}),s=g.useRef(e),o=g.useRef("none"),i=e?"mounted":"unmounted",[l,c]=QO(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const u=mu(n.current);o.current=l==="mounted"?u:"none"},[l]),Jt(()=>{const u=n.current,d=s.current;if(d!==e){const m=o.current,v=mu(u);e?c("MOUNT"):v==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&m!==v?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,c]),Jt(()=>{if(t){const u=f=>{const v=mu(n.current).includes(f.animationName);f.target===t&&v&&Ts.flushSync(()=>c("ANIMATION_END"))},d=f=>{f.target===t&&(o.current=mu(n.current))};return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{t.removeEventListener("animationstart",d),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:g.useCallback(u=>{u&&(n.current=getComputedStyle(u)),r(u)},[])}}function mu(e){return(e==null?void 0:e.animationName)||"none"}function eM(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Bh="rovingFocusGroup.onEntryFocus",tM={bubbles:!1,cancelable:!0},kf="RovingFocusGroup",[lm,$b,rM]=kc(kf),[nM,Oa]=sr(kf,[rM]),[sM,oM]=nM(kf),Vb=g.forwardRef((e,t)=>a.jsx(lm.Provider,{scope:e.__scopeRovingFocusGroup,children:a.jsx(lm.Slot,{scope:e.__scopeRovingFocusGroup,children:a.jsx(iM,{...e,ref:t})})}));Vb.displayName=kf;var iM=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:s=!1,dir:o,currentTabStopId:i,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...f}=e,m=g.useRef(null),v=Ke(t,m),x=di(o),[y=null,_]=Yr({prop:i,defaultProp:l,onChange:c}),[p,h]=g.useState(!1),w=Dt(u),C=$b(r),j=g.useRef(!1),[E,R]=g.useState(0);return g.useEffect(()=>{const P=m.current;if(P)return P.addEventListener(Bh,w),()=>P.removeEventListener(Bh,w)},[w]),a.jsx(sM,{scope:r,orientation:n,dir:x,loop:s,currentTabStopId:y,onItemFocus:g.useCallback(P=>_(P),[_]),onItemShiftTab:g.useCallback(()=>h(!0),[]),onFocusableItemAdd:g.useCallback(()=>R(P=>P+1),[]),onFocusableItemRemove:g.useCallback(()=>R(P=>P-1),[]),children:a.jsx(Re.div,{tabIndex:p||E===0?-1:0,"data-orientation":n,...f,ref:v,style:{outline:"none",...e.style},onMouseDown:ue(e.onMouseDown,()=>{j.current=!0}),onFocus:ue(e.onFocus,P=>{const A=!j.current;if(P.target===P.currentTarget&&A&&!p){const L=new CustomEvent(Bh,tM);if(P.currentTarget.dispatchEvent(L),!L.defaultPrevented){const q=C().filter(te=>te.focusable),N=q.find(te=>te.active),F=q.find(te=>te.id===y),V=[N,F,...q].filter(Boolean).map(te=>te.ref.current);Hb(V,d)}}j.current=!1}),onBlur:ue(e.onBlur,()=>h(!1))})})}),Bb="RovingFocusGroupItem",Wb=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:s=!1,tabStopId:o,...i}=e,l=$r(),c=o||l,u=oM(Bb,r),d=u.currentTabStopId===c,f=$b(r),{onFocusableItemAdd:m,onFocusableItemRemove:v}=u;return g.useEffect(()=>{if(n)return m(),()=>v()},[n,m,v]),a.jsx(lm.ItemSlot,{scope:r,id:c,focusable:n,active:s,children:a.jsx(Re.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...i,ref:t,onMouseDown:ue(e.onMouseDown,x=>{n?u.onItemFocus(c):x.preventDefault()}),onFocus:ue(e.onFocus,()=>u.onItemFocus(c)),onKeyDown:ue(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){u.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const y=cM(x,u.orientation,u.dir);if(y!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let p=f().filter(h=>h.focusable).map(h=>h.ref.current);if(y==="last")p.reverse();else if(y==="prev"||y==="next"){y==="prev"&&p.reverse();const h=p.indexOf(x.currentTarget);p=u.loop?uM(p,h+1):p.slice(h+1)}setTimeout(()=>Hb(p))}})})})});Wb.displayName=Bb;var aM={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function lM(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function cM(e,t,r){const n=lM(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return aM[n]}function Hb(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function uM(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var nv=Vb,sv=Wb,dM=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Si=new WeakMap,gu=new WeakMap,vu={},Wh=0,Yb=function(e){return e&&(e.host||Yb(e.parentNode))},fM=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Yb(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},hM=function(e,t,r,n){var s=fM(t,Array.isArray(e)?e:[e]);vu[r]||(vu[r]=new WeakMap);var o=vu[r],i=[],l=new Set,c=new Set(s),u=function(f){!f||l.has(f)||(l.add(f),u(f.parentNode))};s.forEach(u);var d=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(m){if(l.has(m))d(m);else try{var v=m.getAttribute(n),x=v!==null&&v!=="false",y=(Si.get(m)||0)+1,_=(o.get(m)||0)+1;Si.set(m,y),o.set(m,_),i.push(m),y===1&&x&&gu.set(m,!0),_===1&&m.setAttribute(r,"true"),x||m.setAttribute(n,"true")}catch(p){console.error("aria-hidden: cannot operate on ",m,p)}})};return d(t),l.clear(),Wh++,function(){i.forEach(function(f){var m=Si.get(f)-1,v=o.get(f)-1;Si.set(f,m),o.set(f,v),m||(gu.has(f)||f.removeAttribute(n),gu.delete(f)),v||f.removeAttribute(r)}),Wh--,Wh||(Si=new WeakMap,Si=new WeakMap,gu=new WeakMap,vu={})}},ov=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),s=dM(e);return s?(n.push.apply(n,Array.from(s.querySelectorAll("[aria-live]"))),hM(n,s,r,"aria-hidden")):function(){return null}},Ln=function(){return Ln=Object.assign||function(t){for(var r,n=1,s=arguments.length;n"u")return RM;var t=PM(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},DM=qb(),ea="data-scroll-locked",OM=function(e,t,r,n){var s=e.left,o=e.top,i=e.right,l=e.gap;return r===void 0&&(r="margin"),` .`.concat(mM,` { overflow: hidden `).concat(n,`; - padding-right: `).concat(a,"px ").concat(n,`; + padding-right: `).concat(l,"px ").concat(n,`; } body[`).concat(ea,`] { overflow: hidden `).concat(n,`; @@ -250,16 +250,16 @@ Error generating stack: `+o.message+` padding-right: `).concat(i,`px; margin-left:0; margin-top:0; - margin-right: `).concat(a,"px ").concat(n,`; - `),r==="padding"&&"padding-right: ".concat(a,"px ").concat(n,";")].filter(Boolean).join(""),` + margin-right: `).concat(l,"px ").concat(n,`; + `),r==="padding"&&"padding-right: ".concat(l,"px ").concat(n,";")].filter(Boolean).join(""),` } .`).concat(Vu,` { - right: `).concat(a,"px ").concat(n,`; + right: `).concat(l,"px ").concat(n,`; } .`).concat(Bu,` { - margin-right: `).concat(a,"px ").concat(n,`; + margin-right: `).concat(l,"px ").concat(n,`; } .`).concat(Vu," .").concat(Vu,` { @@ -271,31 +271,31 @@ Error generating stack: `+o.message+` } body[`).concat(ea,`] { - `).concat(gM,": ").concat(a,`px; + `).concat(gM,": ").concat(l,`px; } -`)},q0=function(){var e=parseInt(document.body.getAttribute(ea)||"0",10);return isFinite(e)?e:0},MM=function(){g.useEffect(function(){return document.body.setAttribute(ea,(q0()+1).toString()),function(){var e=q0()-1;e<=0?document.body.removeAttribute(ea):document.body.setAttribute(ea,e.toString())}},[])},IM=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,s=n===void 0?"margin":n;MM();var o=g.useMemo(function(){return AM(s)},[s]);return g.createElement(DM,{styles:OM(o,!t,s,r?"":"!important")})},cm=!1;if(typeof window<"u")try{var yu=Object.defineProperty({},"passive",{get:function(){return cm=!0,!0}});window.addEventListener("test",yu,yu),window.removeEventListener("test",yu,yu)}catch{cm=!1}var ki=cm?{passive:!1}:!1,LM=function(e){return e.tagName==="TEXTAREA"},Xb=function(e,t){var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!LM(e)&&r[t]==="visible")},FM=function(e){return Xb(e,"overflowY")},zM=function(e){return Xb(e,"overflowX")},X0=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var s=Qb(e,n);if(s){var o=Jb(e,n),i=o[1],a=o[2];if(i>a)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},UM=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},$M=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},Qb=function(e,t){return e==="v"?FM(t):zM(t)},Jb=function(e,t){return e==="v"?UM(t):$M(t)},VM=function(e,t){return e==="h"&&t==="rtl"?-1:1},BM=function(e,t,r,n,s){var o=VM(e,window.getComputedStyle(t).direction),i=o*n,a=r.target,c=t.contains(a),u=!1,d=i>0,f=0,m=0;do{var v=Jb(e,a),x=v[0],y=v[1],_=v[2],p=y-_-o*x;(x||p)&&Qb(e,a)&&(f+=p,m+=x),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!c&&a!==document.body||c&&(t.contains(a)||t===a));return(d&&(Math.abs(f)<1||!s)||!d&&(Math.abs(m)<1||!s))&&(u=!0),u},xu=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Q0=function(e){return[e.deltaX,e.deltaY]},J0=function(e){return e&&"current"in e?e.current:e},WM=function(e,t){return e[0]===t[0]&&e[1]===t[1]},HM=function(e){return` +`)},q0=function(){var e=parseInt(document.body.getAttribute(ea)||"0",10);return isFinite(e)?e:0},MM=function(){g.useEffect(function(){return document.body.setAttribute(ea,(q0()+1).toString()),function(){var e=q0()-1;e<=0?document.body.removeAttribute(ea):document.body.setAttribute(ea,e.toString())}},[])},IM=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,s=n===void 0?"margin":n;MM();var o=g.useMemo(function(){return AM(s)},[s]);return g.createElement(DM,{styles:OM(o,!t,s,r?"":"!important")})},cm=!1;if(typeof window<"u")try{var yu=Object.defineProperty({},"passive",{get:function(){return cm=!0,!0}});window.addEventListener("test",yu,yu),window.removeEventListener("test",yu,yu)}catch{cm=!1}var ki=cm?{passive:!1}:!1,LM=function(e){return e.tagName==="TEXTAREA"},Xb=function(e,t){var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!LM(e)&&r[t]==="visible")},FM=function(e){return Xb(e,"overflowY")},zM=function(e){return Xb(e,"overflowX")},X0=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var s=Qb(e,n);if(s){var o=Jb(e,n),i=o[1],l=o[2];if(i>l)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},UM=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},$M=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},Qb=function(e,t){return e==="v"?FM(t):zM(t)},Jb=function(e,t){return e==="v"?UM(t):$M(t)},VM=function(e,t){return e==="h"&&t==="rtl"?-1:1},BM=function(e,t,r,n,s){var o=VM(e,window.getComputedStyle(t).direction),i=o*n,l=r.target,c=t.contains(l),u=!1,d=i>0,f=0,m=0;do{var v=Jb(e,l),x=v[0],y=v[1],_=v[2],p=y-_-o*x;(x||p)&&Qb(e,l)&&(f+=p,m+=x),l instanceof ShadowRoot?l=l.host:l=l.parentNode}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(d&&(Math.abs(f)<1||!s)||!d&&(Math.abs(m)<1||!s))&&(u=!0),u},xu=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Q0=function(e){return[e.deltaX,e.deltaY]},J0=function(e){return e&&"current"in e?e.current:e},WM=function(e,t){return e[0]===t[0]&&e[1]===t[1]},HM=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},YM=0,Ci=[];function KM(e){var t=g.useRef([]),r=g.useRef([0,0]),n=g.useRef(),s=g.useState(YM++)[0],o=g.useState(qb)[0],i=g.useRef(e);g.useEffect(function(){i.current=e},[e]),g.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var y=pM([e.lockRef.current],(e.shards||[]).map(J0),!0).filter(Boolean);return y.forEach(function(_){return _.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),y.forEach(function(_){return _.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var a=g.useCallback(function(y,_){if("touches"in y&&y.touches.length===2)return!i.current.allowPinchZoom;var p=xu(y),h=r.current,w="deltaX"in y?y.deltaX:h[0]-p[0],C="deltaY"in y?y.deltaY:h[1]-p[1],j,E=y.target,R=Math.abs(w)>Math.abs(C)?"h":"v";if("touches"in y&&R==="h"&&E.type==="range")return!1;var P=X0(R,E);if(!P)return!0;if(P?j=R:(j=R==="v"?"h":"v",P=X0(R,E)),!P)return!1;if(!n.current&&"changedTouches"in y&&(w||C)&&(n.current=j),!j)return!0;var A=n.current||j;return BM(A,_,y,A==="h"?w:C,!0)},[]),c=g.useCallback(function(y){var _=y;if(!(!Ci.length||Ci[Ci.length-1]!==o)){var p="deltaY"in _?Q0(_):xu(_),h=t.current.filter(function(j){return j.name===_.type&&(j.target===_.target||_.target===j.shadowParent)&&WM(j.delta,p)})[0];if(h&&h.should){_.cancelable&&_.preventDefault();return}if(!h){var w=(i.current.shards||[]).map(J0).filter(Boolean).filter(function(j){return j.contains(_.target)}),C=w.length>0?a(_,w[0]):!i.current.noIsolation;C&&_.cancelable&&_.preventDefault()}}},[]),u=g.useCallback(function(y,_,p,h){var w={name:y,delta:_,target:p,should:h,shadowParent:GM(p)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(C){return C!==w})},1)},[]),d=g.useCallback(function(y){r.current=xu(y),n.current=void 0},[]),f=g.useCallback(function(y){u(y.type,Q0(y),y.target,a(y,e.lockRef.current))},[]),m=g.useCallback(function(y){u(y.type,xu(y),y.target,a(y,e.lockRef.current))},[]);g.useEffect(function(){return Ci.push(o),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:m}),document.addEventListener("wheel",c,ki),document.addEventListener("touchmove",c,ki),document.addEventListener("touchstart",d,ki),function(){Ci=Ci.filter(function(y){return y!==o}),document.removeEventListener("wheel",c,ki),document.removeEventListener("touchmove",c,ki),document.removeEventListener("touchstart",d,ki)}},[]);var v=e.removeScrollBar,x=e.inert;return g.createElement(g.Fragment,null,x?g.createElement(o,{styles:HM(s)}):null,v?g.createElement(IM,{gapMode:e.gapMode}):null)}function GM(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const ZM=SM(Zb,KM);var jf=g.forwardRef(function(e,t){return g.createElement(Cf,Ln({},e,{ref:t,sideCar:ZM}))});jf.classNames=Cf.classNames;var um=["Enter"," "],qM=["ArrowDown","PageUp","Home"],eS=["ArrowUp","PageDown","End"],XM=[...qM,...eS],QM={ltr:[...um,"ArrowRight"],rtl:[...um,"ArrowLeft"]},JM={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Ec="Menu",[Xl,eI,tI]=kc(Ec),[fi,tS]=sr(Ec,[tI,Aa,Da]),Ef=Aa(),rS=Da(),[rI,hi]=fi(Ec),[nI,Nc]=fi(Ec),nS=e=>{const{__scopeMenu:t,open:r=!1,children:n,dir:s,onOpenChange:o,modal:i=!0}=e,a=Ef(t),[c,u]=g.useState(null),d=g.useRef(!1),f=Dt(o),m=di(s);return g.useEffect(()=>{const v=()=>{d.current=!0,document.addEventListener("pointerdown",x,{capture:!0,once:!0}),document.addEventListener("pointermove",x,{capture:!0,once:!0})},x=()=>d.current=!1;return document.addEventListener("keydown",v,{capture:!0}),()=>{document.removeEventListener("keydown",v,{capture:!0}),document.removeEventListener("pointerdown",x,{capture:!0}),document.removeEventListener("pointermove",x,{capture:!0})}},[]),l.jsx(Jg,{...a,children:l.jsx(rI,{scope:t,open:r,onOpenChange:f,content:c,onContentChange:u,children:l.jsx(nI,{scope:t,onClose:g.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:m,modal:i,children:n})})})};nS.displayName=Ec;var sI="MenuAnchor",iv=g.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,s=Ef(r);return l.jsx(ev,{...s,...n,ref:t})});iv.displayName=sI;var av="MenuPortal",[oI,sS]=fi(av,{forceMount:void 0}),oS=e=>{const{__scopeMenu:t,forceMount:r,children:n,container:s}=e,o=hi(av,t);return l.jsx(oI,{scope:t,forceMount:r,children:l.jsx(or,{present:r||o.open,children:l.jsx(jc,{asChild:!0,container:s,children:n})})})};oS.displayName=av;var nn="MenuContent",[iI,lv]=fi(nn),iS=g.forwardRef((e,t)=>{const r=sS(nn,e.__scopeMenu),{forceMount:n=r.forceMount,...s}=e,o=hi(nn,e.__scopeMenu),i=Nc(nn,e.__scopeMenu);return l.jsx(Xl.Provider,{scope:e.__scopeMenu,children:l.jsx(or,{present:n||o.open,children:l.jsx(Xl.Slot,{scope:e.__scopeMenu,children:i.modal?l.jsx(aI,{...s,ref:t}):l.jsx(lI,{...s,ref:t})})})})}),aI=g.forwardRef((e,t)=>{const r=hi(nn,e.__scopeMenu),n=g.useRef(null),s=Ke(t,n);return g.useEffect(()=>{const o=n.current;if(o)return ov(o)},[]),l.jsx(cv,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:ce(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),lI=g.forwardRef((e,t)=>{const r=hi(nn,e.__scopeMenu);return l.jsx(cv,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),cv=g.forwardRef((e,t)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:m,onDismiss:v,disableOutsideScroll:x,...y}=e,_=hi(nn,r),p=Nc(nn,r),h=Ef(r),w=rS(r),C=eI(r),[j,E]=g.useState(null),R=g.useRef(null),P=Ke(t,R,_.onContentChange),A=g.useRef(0),L=g.useRef(""),q=g.useRef(0),N=g.useRef(null),F=g.useRef("right"),b=g.useRef(0),V=x?jf:g.Fragment,te=x?{as:bs,allowPinchZoom:!0}:void 0,B=I=>{var pe,ye;const Q=L.current+I,z=C().filter(Ne=>!Ne.disabled),$=document.activeElement,he=(pe=z.find(Ne=>Ne.ref.current===$))==null?void 0:pe.textValue,ne=z.map(Ne=>Ne.textValue),se=wI(ne,Q,he),Oe=(ye=z.find(Ne=>Ne.textValue===se))==null?void 0:ye.ref.current;(function Ne(Fe){L.current=Fe,window.clearTimeout(A.current),Fe!==""&&(A.current=window.setTimeout(()=>Ne(""),1e3))})(Q),Oe&&setTimeout(()=>Oe.focus())};g.useEffect(()=>()=>window.clearTimeout(A.current),[]),Bg();const K=g.useCallback(I=>{var z,$;return F.current===((z=N.current)==null?void 0:z.side)&&bI(I,($=N.current)==null?void 0:$.area)},[]);return l.jsx(iI,{scope:r,searchRef:L,onItemEnter:g.useCallback(I=>{K(I)&&I.preventDefault()},[K]),onItemLeave:g.useCallback(I=>{var Q;K(I)||((Q=R.current)==null||Q.focus(),E(null))},[K]),onTriggerLeave:g.useCallback(I=>{K(I)&&I.preventDefault()},[K]),pointerGraceTimerRef:q,onPointerGraceIntentChange:g.useCallback(I=>{N.current=I},[]),children:l.jsx(V,{...te,children:l.jsx(_f,{asChild:!0,trapped:s,onMountAutoFocus:ce(o,I=>{var Q;I.preventDefault(),(Q=R.current)==null||Q.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:l.jsx(Ta,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:m,onDismiss:v,children:l.jsx(nv,{asChild:!0,...w,dir:p.dir,orientation:"vertical",loop:n,currentTabStopId:j,onCurrentTabStopIdChange:E,onEntryFocus:ce(c,I=>{p.isUsingKeyboardRef.current||I.preventDefault()}),preventScrollOnEntryFocus:!0,children:l.jsx(tv,{role:"menu","aria-orientation":"vertical","data-state":bS(_.open),"data-radix-menu-content":"",dir:p.dir,...h,...y,ref:P,style:{outline:"none",...y.style},onKeyDown:ce(y.onKeyDown,I=>{const z=I.target.closest("[data-radix-menu-content]")===I.currentTarget,$=I.ctrlKey||I.altKey||I.metaKey,he=I.key.length===1;z&&(I.key==="Tab"&&I.preventDefault(),!$&&he&&B(I.key));const ne=R.current;if(I.target!==ne||!XM.includes(I.key))return;I.preventDefault();const Oe=C().filter(pe=>!pe.disabled).map(pe=>pe.ref.current);eS.includes(I.key)&&Oe.reverse(),yI(Oe)}),onBlur:ce(e.onBlur,I=>{I.currentTarget.contains(I.target)||(window.clearTimeout(A.current),L.current="")}),onPointerMove:ce(e.onPointerMove,Ql(I=>{const Q=I.target,z=b.current!==I.clientX;if(I.currentTarget.contains(Q)&&z){const $=I.clientX>b.current?"right":"left";F.current=$,b.current=I.clientX}}))})})})})})})});iS.displayName=nn;var cI="MenuGroup",uv=g.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return l.jsx(Re.div,{role:"group",...n,ref:t})});uv.displayName=cI;var uI="MenuLabel",aS=g.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return l.jsx(Re.div,{...n,ref:t})});aS.displayName=uI;var Ed="MenuItem",ew="menu.itemSelect",Nf=g.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:n,...s}=e,o=g.useRef(null),i=Nc(Ed,e.__scopeMenu),a=lv(Ed,e.__scopeMenu),c=Ke(t,o),u=g.useRef(!1),d=()=>{const f=o.current;if(!r&&f){const m=new CustomEvent(ew,{bubbles:!0,cancelable:!0});f.addEventListener(ew,v=>n==null?void 0:n(v),{once:!0}),Vg(f,m),m.defaultPrevented?u.current=!1:i.onClose()}};return l.jsx(lS,{...s,ref:c,disabled:r,onClick:ce(e.onClick,d),onPointerDown:f=>{var m;(m=e.onPointerDown)==null||m.call(e,f),u.current=!0},onPointerUp:ce(e.onPointerUp,f=>{var m;u.current||(m=f.currentTarget)==null||m.click()}),onKeyDown:ce(e.onKeyDown,f=>{const m=a.searchRef.current!=="";r||m&&f.key===" "||um.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});Nf.displayName=Ed;var lS=g.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:n=!1,textValue:s,...o}=e,i=lv(Ed,r),a=rS(r),c=g.useRef(null),u=Ke(t,c),[d,f]=g.useState(!1),[m,v]=g.useState("");return g.useEffect(()=>{const x=c.current;x&&v((x.textContent??"").trim())},[o.children]),l.jsx(Xl.ItemSlot,{scope:r,disabled:n,textValue:s??m,children:l.jsx(sv,{asChild:!0,...a,focusable:!n,children:l.jsx(Re.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...o,ref:u,onPointerMove:ce(e.onPointerMove,Ql(x=>{n?i.onItemLeave(x):(i.onItemEnter(x),x.defaultPrevented||x.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ce(e.onPointerLeave,Ql(x=>i.onItemLeave(x))),onFocus:ce(e.onFocus,()=>f(!0)),onBlur:ce(e.onBlur,()=>f(!1))})})})}),dI="MenuCheckboxItem",cS=g.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:n,...s}=e;return l.jsx(pS,{scope:e.__scopeMenu,checked:r,children:l.jsx(Nf,{role:"menuitemcheckbox","aria-checked":Nd(r)?"mixed":r,...s,ref:t,"data-state":fv(r),onSelect:ce(s.onSelect,()=>n==null?void 0:n(Nd(r)?!0:!r),{checkForDefaultPrevented:!1})})})});cS.displayName=dI;var uS="MenuRadioGroup",[fI,hI]=fi(uS,{value:void 0,onValueChange:()=>{}}),dS=g.forwardRef((e,t)=>{const{value:r,onValueChange:n,...s}=e,o=Dt(n);return l.jsx(fI,{scope:e.__scopeMenu,value:r,onValueChange:o,children:l.jsx(uv,{...s,ref:t})})});dS.displayName=uS;var fS="MenuRadioItem",hS=g.forwardRef((e,t)=>{const{value:r,...n}=e,s=hI(fS,e.__scopeMenu),o=r===s.value;return l.jsx(pS,{scope:e.__scopeMenu,checked:o,children:l.jsx(Nf,{role:"menuitemradio","aria-checked":o,...n,ref:t,"data-state":fv(o),onSelect:ce(n.onSelect,()=>{var i;return(i=s.onValueChange)==null?void 0:i.call(s,r)},{checkForDefaultPrevented:!1})})})});hS.displayName=fS;var dv="MenuItemIndicator",[pS,pI]=fi(dv,{checked:!1}),mS=g.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:n,...s}=e,o=pI(dv,r);return l.jsx(or,{present:n||Nd(o.checked)||o.checked===!0,children:l.jsx(Re.span,{...s,ref:t,"data-state":fv(o.checked)})})});mS.displayName=dv;var mI="MenuSeparator",gS=g.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return l.jsx(Re.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});gS.displayName=mI;var gI="MenuArrow",vS=g.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,s=Ef(r);return l.jsx(rv,{...s,...n,ref:t})});vS.displayName=gI;var vI="MenuSub",[q$,yS]=fi(vI),al="MenuSubTrigger",xS=g.forwardRef((e,t)=>{const r=hi(al,e.__scopeMenu),n=Nc(al,e.__scopeMenu),s=yS(al,e.__scopeMenu),o=lv(al,e.__scopeMenu),i=g.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:c}=o,u={__scopeMenu:e.__scopeMenu},d=g.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return g.useEffect(()=>d,[d]),g.useEffect(()=>{const f=a.current;return()=>{window.clearTimeout(f),c(null)}},[a,c]),l.jsx(iv,{asChild:!0,...u,children:l.jsx(lS,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":s.contentId,"data-state":bS(r.open),...e,ref:xf(t,s.onTriggerChange),onClick:f=>{var m;(m=e.onClick)==null||m.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:ce(e.onPointerMove,Ql(f=>{o.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!r.open&&!i.current&&(o.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{r.onOpenChange(!0),d()},100))})),onPointerLeave:ce(e.onPointerLeave,Ql(f=>{var v,x;d();const m=(v=r.content)==null?void 0:v.getBoundingClientRect();if(m){const y=(x=r.content)==null?void 0:x.dataset.side,_=y==="right",p=_?-5:5,h=m[_?"left":"right"],w=m[_?"right":"left"];o.onPointerGraceIntentChange({area:[{x:f.clientX+p,y:f.clientY},{x:h,y:m.top},{x:w,y:m.top},{x:w,y:m.bottom},{x:h,y:m.bottom}],side:y}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(f),f.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:ce(e.onKeyDown,f=>{var v;const m=o.searchRef.current!=="";e.disabled||m&&f.key===" "||QM[n.dir].includes(f.key)&&(r.onOpenChange(!0),(v=r.content)==null||v.focus(),f.preventDefault())})})})});xS.displayName=al;var wS="MenuSubContent",_S=g.forwardRef((e,t)=>{const r=sS(nn,e.__scopeMenu),{forceMount:n=r.forceMount,...s}=e,o=hi(nn,e.__scopeMenu),i=Nc(nn,e.__scopeMenu),a=yS(wS,e.__scopeMenu),c=g.useRef(null),u=Ke(t,c);return l.jsx(Xl.Provider,{scope:e.__scopeMenu,children:l.jsx(or,{present:n||o.open,children:l.jsx(Xl.Slot,{scope:e.__scopeMenu,children:l.jsx(cv,{id:a.contentId,"aria-labelledby":a.triggerId,...s,ref:u,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var f;i.isUsingKeyboardRef.current&&((f=c.current)==null||f.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:ce(e.onFocusOutside,d=>{d.target!==a.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:ce(e.onEscapeKeyDown,d=>{i.onClose(),d.preventDefault()}),onKeyDown:ce(e.onKeyDown,d=>{var v;const f=d.currentTarget.contains(d.target),m=JM[i.dir].includes(d.key);f&&m&&(o.onOpenChange(!1),(v=a.trigger)==null||v.focus(),d.preventDefault())})})})})})});_S.displayName=wS;function bS(e){return e?"open":"closed"}function Nd(e){return e==="indeterminate"}function fv(e){return Nd(e)?"indeterminate":e?"checked":"unchecked"}function yI(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function xI(e,t){return e.map((r,n)=>e[(t+n)%e.length])}function wI(e,t,r){const s=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let i=xI(e,Math.max(o,0));s.length===1&&(i=i.filter(u=>u!==r));const c=i.find(u=>u.toLowerCase().startsWith(s.toLowerCase()));return c!==r?c:void 0}function _I(e,t){const{x:r,y:n}=e;let s=!1;for(let o=0,i=t.length-1;on!=d>n&&r<(u-a)*(n-c)/(d-c)+a&&(s=!s)}return s}function bI(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return _I(r,t)}function Ql(e){return t=>t.pointerType==="mouse"?e(t):void 0}var SI=nS,kI=iv,CI=oS,jI=iS,EI=uv,NI=aS,TI=Nf,RI=cS,PI=dS,AI=hS,DI=mS,OI=gS,MI=vS,II=xS,LI=_S,hv="DropdownMenu",[FI,X$]=sr(hv,[tS]),wr=tS(),[zI,SS]=FI(hv),kS=e=>{const{__scopeDropdownMenu:t,children:r,dir:n,open:s,defaultOpen:o,onOpenChange:i,modal:a=!0}=e,c=wr(t),u=g.useRef(null),[d=!1,f]=Hr({prop:s,defaultProp:o,onChange:i});return l.jsx(zI,{scope:t,triggerId:Ur(),triggerRef:u,contentId:Ur(),open:d,onOpenChange:f,onOpenToggle:g.useCallback(()=>f(m=>!m),[f]),modal:a,children:l.jsx(SI,{...c,open:d,onOpenChange:f,dir:n,modal:a,children:r})})};kS.displayName=hv;var CS="DropdownMenuTrigger",jS=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...s}=e,o=SS(CS,r),i=wr(r);return l.jsx(kI,{asChild:!0,...i,children:l.jsx(Re.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...s,ref:xf(t,o.triggerRef),onPointerDown:ce(e.onPointerDown,a=>{!n&&a.button===0&&a.ctrlKey===!1&&(o.onOpenToggle(),o.open||a.preventDefault())}),onKeyDown:ce(e.onKeyDown,a=>{n||(["Enter"," "].includes(a.key)&&o.onOpenToggle(),a.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});jS.displayName=CS;var UI="DropdownMenuPortal",ES=e=>{const{__scopeDropdownMenu:t,...r}=e,n=wr(t);return l.jsx(CI,{...n,...r})};ES.displayName=UI;var NS="DropdownMenuContent",TS=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=SS(NS,r),o=wr(r),i=g.useRef(!1);return l.jsx(jI,{id:s.contentId,"aria-labelledby":s.triggerId,...o,...n,ref:t,onCloseAutoFocus:ce(e.onCloseAutoFocus,a=>{var c;i.current||(c=s.triggerRef.current)==null||c.focus(),i.current=!1,a.preventDefault()}),onInteractOutside:ce(e.onInteractOutside,a=>{const c=a.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,d=c.button===2||u;(!s.modal||d)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});TS.displayName=NS;var $I="DropdownMenuGroup",VI=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=wr(r);return l.jsx(EI,{...s,...n,ref:t})});VI.displayName=$I;var BI="DropdownMenuLabel",RS=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=wr(r);return l.jsx(NI,{...s,...n,ref:t})});RS.displayName=BI;var WI="DropdownMenuItem",PS=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=wr(r);return l.jsx(TI,{...s,...n,ref:t})});PS.displayName=WI;var HI="DropdownMenuCheckboxItem",AS=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=wr(r);return l.jsx(RI,{...s,...n,ref:t})});AS.displayName=HI;var YI="DropdownMenuRadioGroup",KI=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=wr(r);return l.jsx(PI,{...s,...n,ref:t})});KI.displayName=YI;var GI="DropdownMenuRadioItem",DS=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=wr(r);return l.jsx(AI,{...s,...n,ref:t})});DS.displayName=GI;var ZI="DropdownMenuItemIndicator",OS=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=wr(r);return l.jsx(DI,{...s,...n,ref:t})});OS.displayName=ZI;var qI="DropdownMenuSeparator",MS=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=wr(r);return l.jsx(OI,{...s,...n,ref:t})});MS.displayName=qI;var XI="DropdownMenuArrow",QI=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=wr(r);return l.jsx(MI,{...s,...n,ref:t})});QI.displayName=XI;var JI="DropdownMenuSubTrigger",IS=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=wr(r);return l.jsx(II,{...s,...n,ref:t})});IS.displayName=JI;var eL="DropdownMenuSubContent",LS=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=wr(r);return l.jsx(LI,{...s,...n,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});LS.displayName=eL;var tL=kS,rL=jS,nL=ES,FS=TS,zS=RS,US=PS,$S=AS,VS=DS,BS=OS,WS=MS,HS=IS,YS=LS;const KS=tL,GS=rL,sL=g.forwardRef(({className:e,inset:t,children:r,...n},s)=>l.jsxs(HS,{ref:s,className:oe("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...n,children:[r,l.jsx(kA,{className:"ml-auto h-4 w-4"})]}));sL.displayName=HS.displayName;const oL=g.forwardRef(({className:e,...t},r)=>l.jsx(YS,{ref:r,className:oe("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));oL.displayName=YS.displayName;const pv=g.forwardRef(({className:e,sideOffset:t=4,...r},n)=>l.jsx(nL,{children:l.jsx(FS,{ref:n,sideOffset:t,className:oe("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));pv.displayName=FS.displayName;const ta=g.forwardRef(({className:e,inset:t,...r},n)=>l.jsx(US,{ref:n,className:oe("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...r}));ta.displayName=US.displayName;const iL=g.forwardRef(({className:e,children:t,checked:r,...n},s)=>l.jsxs($S,{ref:s,className:oe("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...n,children:[l.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:l.jsx(BS,{children:l.jsx(lb,{className:"h-4 w-4"})})}),t]}));iL.displayName=$S.displayName;const aL=g.forwardRef(({className:e,children:t,...r},n)=>l.jsxs(VS,{ref:n,className:oe("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[l.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:l.jsx(BS,{children:l.jsx(cb,{className:"h-2 w-2 fill-current"})})}),t]}));aL.displayName=VS.displayName;const ZS=g.forwardRef(({className:e,inset:t,...r},n)=>l.jsx(zS,{ref:n,className:oe("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}));ZS.displayName=zS.displayName;const qS=g.forwardRef(({className:e,...t},r)=>l.jsx(WS,{ref:r,className:oe("-mx-1 my-1 h-px bg-muted",e),...t}));qS.displayName=WS.displayName;var mv="Dialog",[XS,QS]=sr(mv),[lL,Tn]=XS(mv),JS=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:s,onOpenChange:o,modal:i=!0}=e,a=g.useRef(null),c=g.useRef(null),[u=!1,d]=Hr({prop:n,defaultProp:s,onChange:o});return l.jsx(lL,{scope:t,triggerRef:a,contentRef:c,contentId:Ur(),titleId:Ur(),descriptionId:Ur(),open:u,onOpenChange:d,onOpenToggle:g.useCallback(()=>d(f=>!f),[d]),modal:i,children:r})};JS.displayName=mv;var ek="DialogTrigger",tk=g.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=Tn(ek,r),o=Ke(t,s.triggerRef);return l.jsx(Re.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":yv(s.open),...n,ref:o,onClick:ce(e.onClick,s.onOpenToggle)})});tk.displayName=ek;var gv="DialogPortal",[cL,rk]=XS(gv,{forceMount:void 0}),nk=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:s}=e,o=Tn(gv,t);return l.jsx(cL,{scope:t,forceMount:r,children:g.Children.map(n,i=>l.jsx(or,{present:r||o.open,children:l.jsx(jc,{asChild:!0,container:s,children:i})}))})};nk.displayName=gv;var Td="DialogOverlay",sk=g.forwardRef((e,t)=>{const r=rk(Td,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,o=Tn(Td,e.__scopeDialog);return o.modal?l.jsx(or,{present:n||o.open,children:l.jsx(uL,{...s,ref:t})}):null});sk.displayName=Td;var uL=g.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=Tn(Td,r);return l.jsx(jf,{as:bs,allowPinchZoom:!0,shards:[s.contentRef],children:l.jsx(Re.div,{"data-state":yv(s.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),oi="DialogContent",ok=g.forwardRef((e,t)=>{const r=rk(oi,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,o=Tn(oi,e.__scopeDialog);return l.jsx(or,{present:n||o.open,children:o.modal?l.jsx(dL,{...s,ref:t}):l.jsx(fL,{...s,ref:t})})});ok.displayName=oi;var dL=g.forwardRef((e,t)=>{const r=Tn(oi,e.__scopeDialog),n=g.useRef(null),s=Ke(t,r.contentRef,n);return g.useEffect(()=>{const o=n.current;if(o)return ov(o)},[]),l.jsx(ik,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ce(e.onCloseAutoFocus,o=>{var i;o.preventDefault(),(i=r.triggerRef.current)==null||i.focus()}),onPointerDownOutside:ce(e.onPointerDownOutside,o=>{const i=o.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&o.preventDefault()}),onFocusOutside:ce(e.onFocusOutside,o=>o.preventDefault())})}),fL=g.forwardRef((e,t)=>{const r=Tn(oi,e.__scopeDialog),n=g.useRef(!1),s=g.useRef(!1);return l.jsx(ik,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var i,a;(i=e.onCloseAutoFocus)==null||i.call(e,o),o.defaultPrevented||(n.current||(a=r.triggerRef.current)==null||a.focus(),o.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:o=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,o),o.defaultPrevented||(n.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const i=o.target;((u=r.triggerRef.current)==null?void 0:u.contains(i))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),ik=g.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:o,...i}=e,a=Tn(oi,r),c=g.useRef(null),u=Ke(t,c);return Bg(),l.jsxs(l.Fragment,{children:[l.jsx(_f,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:o,children:l.jsx(Ta,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":yv(a.open),...i,ref:u,onDismiss:()=>a.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(pL,{titleId:a.titleId}),l.jsx(gL,{contentRef:c,descriptionId:a.descriptionId})]})]})}),vv="DialogTitle",ak=g.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=Tn(vv,r);return l.jsx(Re.h2,{id:s.titleId,...n,ref:t})});ak.displayName=vv;var lk="DialogDescription",ck=g.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=Tn(lk,r);return l.jsx(Re.p,{id:s.descriptionId,...n,ref:t})});ck.displayName=lk;var uk="DialogClose",dk=g.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=Tn(uk,r);return l.jsx(Re.button,{type:"button",...n,ref:t,onClick:ce(e.onClick,()=>s.onOpenChange(!1))})});dk.displayName=uk;function yv(e){return e?"open":"closed"}var fk="DialogTitleWarning",[hL,hk]=SD(fk,{contentName:oi,titleName:vv,docsSlug:"dialog"}),pL=({titleId:e})=>{const t=hk(fk),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. +`)},YM=0,Ci=[];function KM(e){var t=g.useRef([]),r=g.useRef([0,0]),n=g.useRef(),s=g.useState(YM++)[0],o=g.useState(qb)[0],i=g.useRef(e);g.useEffect(function(){i.current=e},[e]),g.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var y=pM([e.lockRef.current],(e.shards||[]).map(J0),!0).filter(Boolean);return y.forEach(function(_){return _.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),y.forEach(function(_){return _.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var l=g.useCallback(function(y,_){if("touches"in y&&y.touches.length===2)return!i.current.allowPinchZoom;var p=xu(y),h=r.current,w="deltaX"in y?y.deltaX:h[0]-p[0],C="deltaY"in y?y.deltaY:h[1]-p[1],j,E=y.target,R=Math.abs(w)>Math.abs(C)?"h":"v";if("touches"in y&&R==="h"&&E.type==="range")return!1;var P=X0(R,E);if(!P)return!0;if(P?j=R:(j=R==="v"?"h":"v",P=X0(R,E)),!P)return!1;if(!n.current&&"changedTouches"in y&&(w||C)&&(n.current=j),!j)return!0;var A=n.current||j;return BM(A,_,y,A==="h"?w:C,!0)},[]),c=g.useCallback(function(y){var _=y;if(!(!Ci.length||Ci[Ci.length-1]!==o)){var p="deltaY"in _?Q0(_):xu(_),h=t.current.filter(function(j){return j.name===_.type&&(j.target===_.target||_.target===j.shadowParent)&&WM(j.delta,p)})[0];if(h&&h.should){_.cancelable&&_.preventDefault();return}if(!h){var w=(i.current.shards||[]).map(J0).filter(Boolean).filter(function(j){return j.contains(_.target)}),C=w.length>0?l(_,w[0]):!i.current.noIsolation;C&&_.cancelable&&_.preventDefault()}}},[]),u=g.useCallback(function(y,_,p,h){var w={name:y,delta:_,target:p,should:h,shadowParent:GM(p)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(C){return C!==w})},1)},[]),d=g.useCallback(function(y){r.current=xu(y),n.current=void 0},[]),f=g.useCallback(function(y){u(y.type,Q0(y),y.target,l(y,e.lockRef.current))},[]),m=g.useCallback(function(y){u(y.type,xu(y),y.target,l(y,e.lockRef.current))},[]);g.useEffect(function(){return Ci.push(o),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:m}),document.addEventListener("wheel",c,ki),document.addEventListener("touchmove",c,ki),document.addEventListener("touchstart",d,ki),function(){Ci=Ci.filter(function(y){return y!==o}),document.removeEventListener("wheel",c,ki),document.removeEventListener("touchmove",c,ki),document.removeEventListener("touchstart",d,ki)}},[]);var v=e.removeScrollBar,x=e.inert;return g.createElement(g.Fragment,null,x?g.createElement(o,{styles:HM(s)}):null,v?g.createElement(IM,{gapMode:e.gapMode}):null)}function GM(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const ZM=SM(Zb,KM);var jf=g.forwardRef(function(e,t){return g.createElement(Cf,Ln({},e,{ref:t,sideCar:ZM}))});jf.classNames=Cf.classNames;var um=["Enter"," "],qM=["ArrowDown","PageUp","Home"],eS=["ArrowUp","PageDown","End"],XM=[...qM,...eS],QM={ltr:[...um,"ArrowRight"],rtl:[...um,"ArrowLeft"]},JM={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Ec="Menu",[Ql,eI,tI]=kc(Ec),[fi,tS]=sr(Ec,[tI,Da,Oa]),Ef=Da(),rS=Oa(),[rI,hi]=fi(Ec),[nI,Nc]=fi(Ec),nS=e=>{const{__scopeMenu:t,open:r=!1,children:n,dir:s,onOpenChange:o,modal:i=!0}=e,l=Ef(t),[c,u]=g.useState(null),d=g.useRef(!1),f=Dt(o),m=di(s);return g.useEffect(()=>{const v=()=>{d.current=!0,document.addEventListener("pointerdown",x,{capture:!0,once:!0}),document.addEventListener("pointermove",x,{capture:!0,once:!0})},x=()=>d.current=!1;return document.addEventListener("keydown",v,{capture:!0}),()=>{document.removeEventListener("keydown",v,{capture:!0}),document.removeEventListener("pointerdown",x,{capture:!0}),document.removeEventListener("pointermove",x,{capture:!0})}},[]),a.jsx(Jg,{...l,children:a.jsx(rI,{scope:t,open:r,onOpenChange:f,content:c,onContentChange:u,children:a.jsx(nI,{scope:t,onClose:g.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:m,modal:i,children:n})})})};nS.displayName=Ec;var sI="MenuAnchor",iv=g.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,s=Ef(r);return a.jsx(ev,{...s,...n,ref:t})});iv.displayName=sI;var av="MenuPortal",[oI,sS]=fi(av,{forceMount:void 0}),oS=e=>{const{__scopeMenu:t,forceMount:r,children:n,container:s}=e,o=hi(av,t);return a.jsx(oI,{scope:t,forceMount:r,children:a.jsx(or,{present:r||o.open,children:a.jsx(jc,{asChild:!0,container:s,children:n})})})};oS.displayName=av;var nn="MenuContent",[iI,lv]=fi(nn),iS=g.forwardRef((e,t)=>{const r=sS(nn,e.__scopeMenu),{forceMount:n=r.forceMount,...s}=e,o=hi(nn,e.__scopeMenu),i=Nc(nn,e.__scopeMenu);return a.jsx(Ql.Provider,{scope:e.__scopeMenu,children:a.jsx(or,{present:n||o.open,children:a.jsx(Ql.Slot,{scope:e.__scopeMenu,children:i.modal?a.jsx(aI,{...s,ref:t}):a.jsx(lI,{...s,ref:t})})})})}),aI=g.forwardRef((e,t)=>{const r=hi(nn,e.__scopeMenu),n=g.useRef(null),s=Ke(t,n);return g.useEffect(()=>{const o=n.current;if(o)return ov(o)},[]),a.jsx(cv,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:ue(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),lI=g.forwardRef((e,t)=>{const r=hi(nn,e.__scopeMenu);return a.jsx(cv,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),cv=g.forwardRef((e,t)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:m,onDismiss:v,disableOutsideScroll:x,...y}=e,_=hi(nn,r),p=Nc(nn,r),h=Ef(r),w=rS(r),C=eI(r),[j,E]=g.useState(null),R=g.useRef(null),P=Ke(t,R,_.onContentChange),A=g.useRef(0),L=g.useRef(""),q=g.useRef(0),N=g.useRef(null),F=g.useRef("right"),b=g.useRef(0),V=x?jf:g.Fragment,te=x?{as:bs,allowPinchZoom:!0}:void 0,B=I=>{var pe,xe;const Q=L.current+I,z=C().filter(Te=>!Te.disabled),$=document.activeElement,he=(pe=z.find(Te=>Te.ref.current===$))==null?void 0:pe.textValue,ne=z.map(Te=>Te.textValue),se=wI(ne,Q,he),Oe=(xe=z.find(Te=>Te.textValue===se))==null?void 0:xe.ref.current;(function Te(Fe){L.current=Fe,window.clearTimeout(A.current),Fe!==""&&(A.current=window.setTimeout(()=>Te(""),1e3))})(Q),Oe&&setTimeout(()=>Oe.focus())};g.useEffect(()=>()=>window.clearTimeout(A.current),[]),Bg();const K=g.useCallback(I=>{var z,$;return F.current===((z=N.current)==null?void 0:z.side)&&bI(I,($=N.current)==null?void 0:$.area)},[]);return a.jsx(iI,{scope:r,searchRef:L,onItemEnter:g.useCallback(I=>{K(I)&&I.preventDefault()},[K]),onItemLeave:g.useCallback(I=>{var Q;K(I)||((Q=R.current)==null||Q.focus(),E(null))},[K]),onTriggerLeave:g.useCallback(I=>{K(I)&&I.preventDefault()},[K]),pointerGraceTimerRef:q,onPointerGraceIntentChange:g.useCallback(I=>{N.current=I},[]),children:a.jsx(V,{...te,children:a.jsx(_f,{asChild:!0,trapped:s,onMountAutoFocus:ue(o,I=>{var Q;I.preventDefault(),(Q=R.current)==null||Q.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:a.jsx(Ra,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:m,onDismiss:v,children:a.jsx(nv,{asChild:!0,...w,dir:p.dir,orientation:"vertical",loop:n,currentTabStopId:j,onCurrentTabStopIdChange:E,onEntryFocus:ue(c,I=>{p.isUsingKeyboardRef.current||I.preventDefault()}),preventScrollOnEntryFocus:!0,children:a.jsx(tv,{role:"menu","aria-orientation":"vertical","data-state":bS(_.open),"data-radix-menu-content":"",dir:p.dir,...h,...y,ref:P,style:{outline:"none",...y.style},onKeyDown:ue(y.onKeyDown,I=>{const z=I.target.closest("[data-radix-menu-content]")===I.currentTarget,$=I.ctrlKey||I.altKey||I.metaKey,he=I.key.length===1;z&&(I.key==="Tab"&&I.preventDefault(),!$&&he&&B(I.key));const ne=R.current;if(I.target!==ne||!XM.includes(I.key))return;I.preventDefault();const Oe=C().filter(pe=>!pe.disabled).map(pe=>pe.ref.current);eS.includes(I.key)&&Oe.reverse(),yI(Oe)}),onBlur:ue(e.onBlur,I=>{I.currentTarget.contains(I.target)||(window.clearTimeout(A.current),L.current="")}),onPointerMove:ue(e.onPointerMove,Jl(I=>{const Q=I.target,z=b.current!==I.clientX;if(I.currentTarget.contains(Q)&&z){const $=I.clientX>b.current?"right":"left";F.current=$,b.current=I.clientX}}))})})})})})})});iS.displayName=nn;var cI="MenuGroup",uv=g.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return a.jsx(Re.div,{role:"group",...n,ref:t})});uv.displayName=cI;var uI="MenuLabel",aS=g.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return a.jsx(Re.div,{...n,ref:t})});aS.displayName=uI;var Ed="MenuItem",ew="menu.itemSelect",Nf=g.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:n,...s}=e,o=g.useRef(null),i=Nc(Ed,e.__scopeMenu),l=lv(Ed,e.__scopeMenu),c=Ke(t,o),u=g.useRef(!1),d=()=>{const f=o.current;if(!r&&f){const m=new CustomEvent(ew,{bubbles:!0,cancelable:!0});f.addEventListener(ew,v=>n==null?void 0:n(v),{once:!0}),Vg(f,m),m.defaultPrevented?u.current=!1:i.onClose()}};return a.jsx(lS,{...s,ref:c,disabled:r,onClick:ue(e.onClick,d),onPointerDown:f=>{var m;(m=e.onPointerDown)==null||m.call(e,f),u.current=!0},onPointerUp:ue(e.onPointerUp,f=>{var m;u.current||(m=f.currentTarget)==null||m.click()}),onKeyDown:ue(e.onKeyDown,f=>{const m=l.searchRef.current!=="";r||m&&f.key===" "||um.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});Nf.displayName=Ed;var lS=g.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:n=!1,textValue:s,...o}=e,i=lv(Ed,r),l=rS(r),c=g.useRef(null),u=Ke(t,c),[d,f]=g.useState(!1),[m,v]=g.useState("");return g.useEffect(()=>{const x=c.current;x&&v((x.textContent??"").trim())},[o.children]),a.jsx(Ql.ItemSlot,{scope:r,disabled:n,textValue:s??m,children:a.jsx(sv,{asChild:!0,...l,focusable:!n,children:a.jsx(Re.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...o,ref:u,onPointerMove:ue(e.onPointerMove,Jl(x=>{n?i.onItemLeave(x):(i.onItemEnter(x),x.defaultPrevented||x.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ue(e.onPointerLeave,Jl(x=>i.onItemLeave(x))),onFocus:ue(e.onFocus,()=>f(!0)),onBlur:ue(e.onBlur,()=>f(!1))})})})}),dI="MenuCheckboxItem",cS=g.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:n,...s}=e;return a.jsx(pS,{scope:e.__scopeMenu,checked:r,children:a.jsx(Nf,{role:"menuitemcheckbox","aria-checked":Nd(r)?"mixed":r,...s,ref:t,"data-state":fv(r),onSelect:ue(s.onSelect,()=>n==null?void 0:n(Nd(r)?!0:!r),{checkForDefaultPrevented:!1})})})});cS.displayName=dI;var uS="MenuRadioGroup",[fI,hI]=fi(uS,{value:void 0,onValueChange:()=>{}}),dS=g.forwardRef((e,t)=>{const{value:r,onValueChange:n,...s}=e,o=Dt(n);return a.jsx(fI,{scope:e.__scopeMenu,value:r,onValueChange:o,children:a.jsx(uv,{...s,ref:t})})});dS.displayName=uS;var fS="MenuRadioItem",hS=g.forwardRef((e,t)=>{const{value:r,...n}=e,s=hI(fS,e.__scopeMenu),o=r===s.value;return a.jsx(pS,{scope:e.__scopeMenu,checked:o,children:a.jsx(Nf,{role:"menuitemradio","aria-checked":o,...n,ref:t,"data-state":fv(o),onSelect:ue(n.onSelect,()=>{var i;return(i=s.onValueChange)==null?void 0:i.call(s,r)},{checkForDefaultPrevented:!1})})})});hS.displayName=fS;var dv="MenuItemIndicator",[pS,pI]=fi(dv,{checked:!1}),mS=g.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:n,...s}=e,o=pI(dv,r);return a.jsx(or,{present:n||Nd(o.checked)||o.checked===!0,children:a.jsx(Re.span,{...s,ref:t,"data-state":fv(o.checked)})})});mS.displayName=dv;var mI="MenuSeparator",gS=g.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return a.jsx(Re.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});gS.displayName=mI;var gI="MenuArrow",vS=g.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,s=Ef(r);return a.jsx(rv,{...s,...n,ref:t})});vS.displayName=gI;var vI="MenuSub",[X$,yS]=fi(vI),ll="MenuSubTrigger",xS=g.forwardRef((e,t)=>{const r=hi(ll,e.__scopeMenu),n=Nc(ll,e.__scopeMenu),s=yS(ll,e.__scopeMenu),o=lv(ll,e.__scopeMenu),i=g.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:c}=o,u={__scopeMenu:e.__scopeMenu},d=g.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return g.useEffect(()=>d,[d]),g.useEffect(()=>{const f=l.current;return()=>{window.clearTimeout(f),c(null)}},[l,c]),a.jsx(iv,{asChild:!0,...u,children:a.jsx(lS,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":s.contentId,"data-state":bS(r.open),...e,ref:xf(t,s.onTriggerChange),onClick:f=>{var m;(m=e.onClick)==null||m.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:ue(e.onPointerMove,Jl(f=>{o.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!r.open&&!i.current&&(o.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{r.onOpenChange(!0),d()},100))})),onPointerLeave:ue(e.onPointerLeave,Jl(f=>{var v,x;d();const m=(v=r.content)==null?void 0:v.getBoundingClientRect();if(m){const y=(x=r.content)==null?void 0:x.dataset.side,_=y==="right",p=_?-5:5,h=m[_?"left":"right"],w=m[_?"right":"left"];o.onPointerGraceIntentChange({area:[{x:f.clientX+p,y:f.clientY},{x:h,y:m.top},{x:w,y:m.top},{x:w,y:m.bottom},{x:h,y:m.bottom}],side:y}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(f),f.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:ue(e.onKeyDown,f=>{var v;const m=o.searchRef.current!=="";e.disabled||m&&f.key===" "||QM[n.dir].includes(f.key)&&(r.onOpenChange(!0),(v=r.content)==null||v.focus(),f.preventDefault())})})})});xS.displayName=ll;var wS="MenuSubContent",_S=g.forwardRef((e,t)=>{const r=sS(nn,e.__scopeMenu),{forceMount:n=r.forceMount,...s}=e,o=hi(nn,e.__scopeMenu),i=Nc(nn,e.__scopeMenu),l=yS(wS,e.__scopeMenu),c=g.useRef(null),u=Ke(t,c);return a.jsx(Ql.Provider,{scope:e.__scopeMenu,children:a.jsx(or,{present:n||o.open,children:a.jsx(Ql.Slot,{scope:e.__scopeMenu,children:a.jsx(cv,{id:l.contentId,"aria-labelledby":l.triggerId,...s,ref:u,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var f;i.isUsingKeyboardRef.current&&((f=c.current)==null||f.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:ue(e.onFocusOutside,d=>{d.target!==l.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:ue(e.onEscapeKeyDown,d=>{i.onClose(),d.preventDefault()}),onKeyDown:ue(e.onKeyDown,d=>{var v;const f=d.currentTarget.contains(d.target),m=JM[i.dir].includes(d.key);f&&m&&(o.onOpenChange(!1),(v=l.trigger)==null||v.focus(),d.preventDefault())})})})})})});_S.displayName=wS;function bS(e){return e?"open":"closed"}function Nd(e){return e==="indeterminate"}function fv(e){return Nd(e)?"indeterminate":e?"checked":"unchecked"}function yI(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function xI(e,t){return e.map((r,n)=>e[(t+n)%e.length])}function wI(e,t,r){const s=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let i=xI(e,Math.max(o,0));s.length===1&&(i=i.filter(u=>u!==r));const c=i.find(u=>u.toLowerCase().startsWith(s.toLowerCase()));return c!==r?c:void 0}function _I(e,t){const{x:r,y:n}=e;let s=!1;for(let o=0,i=t.length-1;on!=d>n&&r<(u-l)*(n-c)/(d-c)+l&&(s=!s)}return s}function bI(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return _I(r,t)}function Jl(e){return t=>t.pointerType==="mouse"?e(t):void 0}var SI=nS,kI=iv,CI=oS,jI=iS,EI=uv,NI=aS,TI=Nf,RI=cS,PI=dS,AI=hS,DI=mS,OI=gS,MI=vS,II=xS,LI=_S,hv="DropdownMenu",[FI,Q$]=sr(hv,[tS]),Sr=tS(),[zI,SS]=FI(hv),kS=e=>{const{__scopeDropdownMenu:t,children:r,dir:n,open:s,defaultOpen:o,onOpenChange:i,modal:l=!0}=e,c=Sr(t),u=g.useRef(null),[d=!1,f]=Yr({prop:s,defaultProp:o,onChange:i});return a.jsx(zI,{scope:t,triggerId:$r(),triggerRef:u,contentId:$r(),open:d,onOpenChange:f,onOpenToggle:g.useCallback(()=>f(m=>!m),[f]),modal:l,children:a.jsx(SI,{...c,open:d,onOpenChange:f,dir:n,modal:l,children:r})})};kS.displayName=hv;var CS="DropdownMenuTrigger",jS=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...s}=e,o=SS(CS,r),i=Sr(r);return a.jsx(kI,{asChild:!0,...i,children:a.jsx(Re.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...s,ref:xf(t,o.triggerRef),onPointerDown:ue(e.onPointerDown,l=>{!n&&l.button===0&&l.ctrlKey===!1&&(o.onOpenToggle(),o.open||l.preventDefault())}),onKeyDown:ue(e.onKeyDown,l=>{n||(["Enter"," "].includes(l.key)&&o.onOpenToggle(),l.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});jS.displayName=CS;var UI="DropdownMenuPortal",ES=e=>{const{__scopeDropdownMenu:t,...r}=e,n=Sr(t);return a.jsx(CI,{...n,...r})};ES.displayName=UI;var NS="DropdownMenuContent",TS=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=SS(NS,r),o=Sr(r),i=g.useRef(!1);return a.jsx(jI,{id:s.contentId,"aria-labelledby":s.triggerId,...o,...n,ref:t,onCloseAutoFocus:ue(e.onCloseAutoFocus,l=>{var c;i.current||(c=s.triggerRef.current)==null||c.focus(),i.current=!1,l.preventDefault()}),onInteractOutside:ue(e.onInteractOutside,l=>{const c=l.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,d=c.button===2||u;(!s.modal||d)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});TS.displayName=NS;var $I="DropdownMenuGroup",VI=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Sr(r);return a.jsx(EI,{...s,...n,ref:t})});VI.displayName=$I;var BI="DropdownMenuLabel",RS=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Sr(r);return a.jsx(NI,{...s,...n,ref:t})});RS.displayName=BI;var WI="DropdownMenuItem",PS=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Sr(r);return a.jsx(TI,{...s,...n,ref:t})});PS.displayName=WI;var HI="DropdownMenuCheckboxItem",AS=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Sr(r);return a.jsx(RI,{...s,...n,ref:t})});AS.displayName=HI;var YI="DropdownMenuRadioGroup",KI=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Sr(r);return a.jsx(PI,{...s,...n,ref:t})});KI.displayName=YI;var GI="DropdownMenuRadioItem",DS=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Sr(r);return a.jsx(AI,{...s,...n,ref:t})});DS.displayName=GI;var ZI="DropdownMenuItemIndicator",OS=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Sr(r);return a.jsx(DI,{...s,...n,ref:t})});OS.displayName=ZI;var qI="DropdownMenuSeparator",MS=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Sr(r);return a.jsx(OI,{...s,...n,ref:t})});MS.displayName=qI;var XI="DropdownMenuArrow",QI=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Sr(r);return a.jsx(MI,{...s,...n,ref:t})});QI.displayName=XI;var JI="DropdownMenuSubTrigger",IS=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Sr(r);return a.jsx(II,{...s,...n,ref:t})});IS.displayName=JI;var eL="DropdownMenuSubContent",LS=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Sr(r);return a.jsx(LI,{...s,...n,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});LS.displayName=eL;var tL=kS,rL=jS,nL=ES,FS=TS,zS=RS,US=PS,$S=AS,VS=DS,BS=OS,WS=MS,HS=IS,YS=LS;const KS=tL,GS=rL,sL=g.forwardRef(({className:e,inset:t,children:r,...n},s)=>a.jsxs(HS,{ref:s,className:oe("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...n,children:[r,a.jsx(kA,{className:"ml-auto h-4 w-4"})]}));sL.displayName=HS.displayName;const oL=g.forwardRef(({className:e,...t},r)=>a.jsx(YS,{ref:r,className:oe("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));oL.displayName=YS.displayName;const pv=g.forwardRef(({className:e,sideOffset:t=4,...r},n)=>a.jsx(nL,{children:a.jsx(FS,{ref:n,sideOffset:t,className:oe("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));pv.displayName=FS.displayName;const ta=g.forwardRef(({className:e,inset:t,...r},n)=>a.jsx(US,{ref:n,className:oe("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...r}));ta.displayName=US.displayName;const iL=g.forwardRef(({className:e,children:t,checked:r,...n},s)=>a.jsxs($S,{ref:s,className:oe("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...n,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(BS,{children:a.jsx(lb,{className:"h-4 w-4"})})}),t]}));iL.displayName=$S.displayName;const aL=g.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(VS,{ref:n,className:oe("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(BS,{children:a.jsx(cb,{className:"h-2 w-2 fill-current"})})}),t]}));aL.displayName=VS.displayName;const ZS=g.forwardRef(({className:e,inset:t,...r},n)=>a.jsx(zS,{ref:n,className:oe("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}));ZS.displayName=zS.displayName;const qS=g.forwardRef(({className:e,...t},r)=>a.jsx(WS,{ref:r,className:oe("-mx-1 my-1 h-px bg-muted",e),...t}));qS.displayName=WS.displayName;var mv="Dialog",[XS,QS]=sr(mv),[lL,Tn]=XS(mv),JS=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:s,onOpenChange:o,modal:i=!0}=e,l=g.useRef(null),c=g.useRef(null),[u=!1,d]=Yr({prop:n,defaultProp:s,onChange:o});return a.jsx(lL,{scope:t,triggerRef:l,contentRef:c,contentId:$r(),titleId:$r(),descriptionId:$r(),open:u,onOpenChange:d,onOpenToggle:g.useCallback(()=>d(f=>!f),[d]),modal:i,children:r})};JS.displayName=mv;var ek="DialogTrigger",tk=g.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=Tn(ek,r),o=Ke(t,s.triggerRef);return a.jsx(Re.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":yv(s.open),...n,ref:o,onClick:ue(e.onClick,s.onOpenToggle)})});tk.displayName=ek;var gv="DialogPortal",[cL,rk]=XS(gv,{forceMount:void 0}),nk=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:s}=e,o=Tn(gv,t);return a.jsx(cL,{scope:t,forceMount:r,children:g.Children.map(n,i=>a.jsx(or,{present:r||o.open,children:a.jsx(jc,{asChild:!0,container:s,children:i})}))})};nk.displayName=gv;var Td="DialogOverlay",sk=g.forwardRef((e,t)=>{const r=rk(Td,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,o=Tn(Td,e.__scopeDialog);return o.modal?a.jsx(or,{present:n||o.open,children:a.jsx(uL,{...s,ref:t})}):null});sk.displayName=Td;var uL=g.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=Tn(Td,r);return a.jsx(jf,{as:bs,allowPinchZoom:!0,shards:[s.contentRef],children:a.jsx(Re.div,{"data-state":yv(s.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),oi="DialogContent",ok=g.forwardRef((e,t)=>{const r=rk(oi,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,o=Tn(oi,e.__scopeDialog);return a.jsx(or,{present:n||o.open,children:o.modal?a.jsx(dL,{...s,ref:t}):a.jsx(fL,{...s,ref:t})})});ok.displayName=oi;var dL=g.forwardRef((e,t)=>{const r=Tn(oi,e.__scopeDialog),n=g.useRef(null),s=Ke(t,r.contentRef,n);return g.useEffect(()=>{const o=n.current;if(o)return ov(o)},[]),a.jsx(ik,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ue(e.onCloseAutoFocus,o=>{var i;o.preventDefault(),(i=r.triggerRef.current)==null||i.focus()}),onPointerDownOutside:ue(e.onPointerDownOutside,o=>{const i=o.detail.originalEvent,l=i.button===0&&i.ctrlKey===!0;(i.button===2||l)&&o.preventDefault()}),onFocusOutside:ue(e.onFocusOutside,o=>o.preventDefault())})}),fL=g.forwardRef((e,t)=>{const r=Tn(oi,e.__scopeDialog),n=g.useRef(!1),s=g.useRef(!1);return a.jsx(ik,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var i,l;(i=e.onCloseAutoFocus)==null||i.call(e,o),o.defaultPrevented||(n.current||(l=r.triggerRef.current)==null||l.focus(),o.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:o=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,o),o.defaultPrevented||(n.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const i=o.target;((u=r.triggerRef.current)==null?void 0:u.contains(i))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),ik=g.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:o,...i}=e,l=Tn(oi,r),c=g.useRef(null),u=Ke(t,c);return Bg(),a.jsxs(a.Fragment,{children:[a.jsx(_f,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:o,children:a.jsx(Ra,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":yv(l.open),...i,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(pL,{titleId:l.titleId}),a.jsx(gL,{contentRef:c,descriptionId:l.descriptionId})]})]})}),vv="DialogTitle",ak=g.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=Tn(vv,r);return a.jsx(Re.h2,{id:s.titleId,...n,ref:t})});ak.displayName=vv;var lk="DialogDescription",ck=g.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=Tn(lk,r);return a.jsx(Re.p,{id:s.descriptionId,...n,ref:t})});ck.displayName=lk;var uk="DialogClose",dk=g.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=Tn(uk,r);return a.jsx(Re.button,{type:"button",...n,ref:t,onClick:ue(e.onClick,()=>s.onOpenChange(!1))})});dk.displayName=uk;function yv(e){return e?"open":"closed"}var fk="DialogTitleWarning",[hL,hk]=SD(fk,{contentName:oi,titleName:vv,docsSlug:"dialog"}),pL=({titleId:e})=>{const t=hk(fk),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. -For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return g.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},mL="DialogDescriptionWarning",gL=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${hk(mL).contentName}}.`;return g.useEffect(()=>{var o;const s=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},xv=JS,wv=tk,_v=nk,Tc=sk,Rc=ok,Pc=ak,Ac=ck,Tf=dk;const bv=xv,Sv=wv,vL=_v,pk=g.forwardRef(({className:e,...t},r)=>l.jsx(Tc,{className:oe("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));pk.displayName=Tc.displayName;const yL=Sc("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),Rf=g.forwardRef(({side:e="right",className:t,children:r,...n},s)=>l.jsxs(vL,{children:[l.jsx(pk,{}),l.jsxs(Rc,{ref:s,className:oe(yL({side:e}),t),...n,children:[r,l.jsxs(Tf,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[l.jsx(zg,{className:"h-4 w-4 dark:text-stone-200"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Rf.displayName=Rc.displayName;const kv=({className:e,...t})=>l.jsx("div",{className:oe("flex flex-col space-y-2 text-center sm:text-left",e),...t});kv.displayName="SheetHeader";const Cv=g.forwardRef(({className:e,...t},r)=>l.jsx(Pc,{ref:r,className:oe("text-lg font-semibold text-foreground",e),...t}));Cv.displayName=Pc.displayName;const xL=g.forwardRef(({className:e,...t},r)=>l.jsx(Ac,{ref:r,className:oe("text-sm text-muted-foreground",e),...t}));xL.displayName=Ac.displayName;class Vr extends Error{constructor(t){var r,n,s,o;super("ClientResponseError"),this.url="",this.status=0,this.response={},this.isAbort=!1,this.originalError=null,Object.setPrototypeOf(this,Vr.prototype),t!==null&&typeof t=="object"&&(this.url=typeof t.url=="string"?t.url:"",this.status=typeof t.status=="number"?t.status:0,this.isAbort=!!t.isAbort,this.originalError=t.originalError,t.response!==null&&typeof t.response=="object"?this.response=t.response:t.data!==null&&typeof t.data=="object"?this.response=t.data:this.response={}),this.originalError||t instanceof Vr||(this.originalError=t),typeof DOMException<"u"&&t instanceof DOMException&&(this.isAbort=!0),this.name="ClientResponseError "+this.status,this.message=(r=this.response)==null?void 0:r.message,this.message||(this.isAbort?this.message="The request was autocancelled. You can find more info in https://github.com/pocketbase/js-sdk#auto-cancellation.":(o=(s=(n=this.originalError)==null?void 0:n.cause)==null?void 0:s.message)!=null&&o.includes("ECONNREFUSED ::1")?this.message="Failed to connect to the PocketBase server. Try changing the SDK URL from localhost to 127.0.0.1 (https://github.com/pocketbase/js-sdk/issues/21).":this.message="Something went wrong while processing your request.")}get data(){return this.response}toJSON(){return{...this}}}const wu=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function wL(e,t){const r={};if(typeof e!="string")return r;const n=Object.assign({},{}).decode||_L;let s=0;for(;s0&&(!r.exp||r.exp-t>Date.now()/1e3))}mk=typeof atob!="function"||SL?e=>{let t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(var r,n,s=0,o=0,i="";n=t.charAt(o++);~n&&(r=s%4?64*r+n:n,s++%4)?i+=String.fromCharCode(255&r>>(-2*s&6)):0)n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(n);return i}:atob;const rw="pb_auth";class kL{constructor(){this.baseToken="",this.baseModel=null,this._onChangeCallbacks=[]}get token(){return this.baseToken}get model(){return this.baseModel}get isValid(){return!gk(this.token)}get isAdmin(){return ra(this.token).type==="admin"}get isAuthRecord(){return ra(this.token).type==="authRecord"}save(t,r){this.baseToken=t||"",this.baseModel=r||null,this.triggerChange()}clear(){this.baseToken="",this.baseModel=null,this.triggerChange()}loadFromCookie(t,r=rw){const n=wL(t||"")[r]||"";let s={};try{s=JSON.parse(n),(typeof s===null||typeof s!="object"||Array.isArray(s))&&(s={})}catch{}this.save(s.token||"",s.model||null)}exportToCookie(t,r=rw){var c,u;const n={secure:!0,sameSite:!0,httpOnly:!0,path:"/"},s=ra(this.token);n.expires=s!=null&&s.exp?new Date(1e3*s.exp):new Date("1970-01-01"),t=Object.assign({},n,t);const o={token:this.token,model:this.model?JSON.parse(JSON.stringify(this.model)):null};let i=tw(r,JSON.stringify(o),t);const a=typeof Blob<"u"?new Blob([i]).size:i.length;if(o.model&&a>4096){o.model={id:(c=o==null?void 0:o.model)==null?void 0:c.id,email:(u=o==null?void 0:o.model)==null?void 0:u.email};const d=["collectionId","username","verified"];for(const f in this.model)d.includes(f)&&(o.model[f]=this.model[f]);i=tw(r,JSON.stringify(o),t)}return i}onChange(t,r=!1){return this._onChangeCallbacks.push(t),r&&t(this.token,this.model),()=>{for(let n=this._onChangeCallbacks.length-1;n>=0;n--)if(this._onChangeCallbacks[n]==t)return delete this._onChangeCallbacks[n],void this._onChangeCallbacks.splice(n,1)}}triggerChange(){for(const t of this._onChangeCallbacks)t&&t(this.token,this.model)}}class CL extends kL{constructor(t="pocketbase_auth"){super(),this.storageFallback={},this.storageKey=t,this._bindStorageEvent()}get token(){return(this._storageGet(this.storageKey)||{}).token||""}get model(){return(this._storageGet(this.storageKey)||{}).model||null}save(t,r){this._storageSet(this.storageKey,{token:t,model:r}),super.save(t,r)}clear(){this._storageRemove(this.storageKey),super.clear()}_storageGet(t){if(typeof window<"u"&&(window!=null&&window.localStorage)){const r=window.localStorage.getItem(t)||"";try{return JSON.parse(r)}catch{return r}}return this.storageFallback[t]}_storageSet(t,r){if(typeof window<"u"&&(window!=null&&window.localStorage)){let n=r;typeof r!="string"&&(n=JSON.stringify(r)),window.localStorage.setItem(t,n)}else this.storageFallback[t]=r}_storageRemove(t){var r;typeof window<"u"&&(window!=null&&window.localStorage)&&((r=window.localStorage)==null||r.removeItem(t)),delete this.storageFallback[t]}_bindStorageEvent(){typeof window<"u"&&(window!=null&&window.localStorage)&&window.addEventListener&&window.addEventListener("storage",t=>{if(t.key!=this.storageKey)return;const r=this._storageGet(this.storageKey)||{};super.save(r.token||"",r.model||null)})}}class pi{constructor(t){this.client=t}}class jL extends pi{async getAll(t){return t=Object.assign({method:"GET"},t),this.client.send("/api/settings",t)}async update(t,r){return r=Object.assign({method:"PATCH",body:t},r),this.client.send("/api/settings",r)}async testS3(t="storage",r){return r=Object.assign({method:"POST",body:{filesystem:t}},r),this.client.send("/api/settings/test/s3",r).then(()=>!0)}async testEmail(t,r,n){return n=Object.assign({method:"POST",body:{email:t,template:r}},n),this.client.send("/api/settings/test/email",n).then(()=>!0)}async generateAppleClientSecret(t,r,n,s,o,i){return i=Object.assign({method:"POST",body:{clientId:t,teamId:r,keyId:n,privateKey:s,duration:o}},i),this.client.send("/api/settings/apple/generate-client-secret",i)}}class jv extends pi{decode(t){return t}async getFullList(t,r){if(typeof t=="number")return this._getFullList(t,r);let n=500;return(r=Object.assign({},t,r)).batch&&(n=r.batch,delete r.batch),this._getFullList(n,r)}async getList(t=1,r=30,n){return(n=Object.assign({method:"GET"},n)).query=Object.assign({page:t,perPage:r},n.query),this.client.send(this.baseCrudPath,n).then(s=>{var o;return s.items=((o=s.items)==null?void 0:o.map(i=>this.decode(i)))||[],s})}async getFirstListItem(t,r){return(r=Object.assign({requestKey:"one_by_filter_"+this.baseCrudPath+"_"+t},r)).query=Object.assign({filter:t,skipTotal:1},r.query),this.getList(1,1,r).then(n=>{var s;if(!((s=n==null?void 0:n.items)!=null&&s.length))throw new Vr({status:404,response:{code:404,message:"The requested resource wasn't found.",data:{}}});return n.items[0]})}async getOne(t,r){if(!t)throw new Vr({url:this.client.buildUrl(this.baseCrudPath+"/"),status:404,response:{code:404,message:"Missing required record id.",data:{}}});return r=Object.assign({method:"GET"},r),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t),r).then(n=>this.decode(n))}async create(t,r){return r=Object.assign({method:"POST",body:t},r),this.client.send(this.baseCrudPath,r).then(n=>this.decode(n))}async update(t,r,n){return n=Object.assign({method:"PATCH",body:r},n),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t),n).then(s=>this.decode(s))}async delete(t,r){return r=Object.assign({method:"DELETE"},r),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t),r).then(()=>!0)}_getFullList(t=500,r){(r=r||{}).query=Object.assign({skipTotal:1},r.query);let n=[],s=async o=>this.getList(o,t||500,r).then(i=>{const a=i.items;return n=n.concat(a),a.length==i.perPage?s(o+1):n});return s(1)}}function Dr(e,t,r,n){const s=n!==void 0;return s||r!==void 0?s?(console.warn(e),t.body=Object.assign({},t.body,r),t.query=Object.assign({},t.query,n),t):Object.assign(t,r):t}function Gh(e){var t;(t=e._resetAutoRefresh)==null||t.call(e)}class EL extends jv{get baseCrudPath(){return"/api/admins"}async update(t,r,n){return super.update(t,r,n).then(s=>{var o,i;return((o=this.client.authStore.model)==null?void 0:o.id)===s.id&&((i=this.client.authStore.model)==null?void 0:i.collectionId)===void 0&&this.client.authStore.save(this.client.authStore.token,s),s})}async delete(t,r){return super.delete(t,r).then(n=>{var s,o;return n&&((s=this.client.authStore.model)==null?void 0:s.id)===t&&((o=this.client.authStore.model)==null?void 0:o.collectionId)===void 0&&this.client.authStore.clear(),n})}authResponse(t){const r=this.decode((t==null?void 0:t.admin)||{});return t!=null&&t.token&&(t!=null&&t.admin)&&this.client.authStore.save(t.token,r),Object.assign({},t,{token:(t==null?void 0:t.token)||"",admin:r})}async authWithPassword(t,r,n,s){let o={method:"POST",body:{identity:t,password:r}};o=Dr("This form of authWithPassword(email, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(email, pass, options?).",o,n,s);const i=o.autoRefreshThreshold;delete o.autoRefreshThreshold,o.autoRefresh||Gh(this.client);let a=await this.client.send(this.baseCrudPath+"/auth-with-password",o);return a=this.authResponse(a),i&&function(u,d,f,m){Gh(u);const v=u.beforeSend,x=u.authStore.model,y=u.authStore.onChange((_,p)=>{(!_||(p==null?void 0:p.id)!=(x==null?void 0:x.id)||(p!=null&&p.collectionId||x!=null&&x.collectionId)&&(p==null?void 0:p.collectionId)!=(x==null?void 0:x.collectionId))&&Gh(u)});u._resetAutoRefresh=function(){y(),u.beforeSend=v,delete u._resetAutoRefresh},u.beforeSend=async(_,p)=>{var j;const h=u.authStore.token;if((j=p.query)!=null&&j.autoRefresh)return v?v(_,p):{url:_,sendOptions:p};let w=u.authStore.isValid;if(w&&gk(u.authStore.token,d))try{await f()}catch{w=!1}w||await m();const C=p.headers||{};for(let E in C)if(E.toLowerCase()=="authorization"&&h==C[E]&&u.authStore.token){C[E]=u.authStore.token;break}return p.headers=C,v?v(_,p):{url:_,sendOptions:p}}}(this.client,i,()=>this.authRefresh({autoRefresh:!0}),()=>this.authWithPassword(t,r,Object.assign({autoRefresh:!0},o))),a}async authRefresh(t,r){let n={method:"POST"};return n=Dr("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",n,t,r),this.client.send(this.baseCrudPath+"/auth-refresh",n).then(this.authResponse.bind(this))}async requestPasswordReset(t,r,n){let s={method:"POST",body:{email:t}};return s=Dr("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",s,r,n),this.client.send(this.baseCrudPath+"/request-password-reset",s).then(()=>!0)}async confirmPasswordReset(t,r,n,s,o){let i={method:"POST",body:{token:t,password:r,passwordConfirm:n}};return i=Dr("This form of confirmPasswordReset(resetToken, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(resetToken, password, passwordConfirm, options?).",i,s,o),this.client.send(this.baseCrudPath+"/confirm-password-reset",i).then(()=>!0)}}const NL=["requestKey","$cancelKey","$autoCancel","fetch","headers","body","query","params","cache","credentials","headers","integrity","keepalive","method","mode","redirect","referrer","referrerPolicy","signal","window"];function vk(e){if(e){e.query=e.query||{};for(let t in e)NL.includes(t)||(e.query[t]=e[t],delete e[t])}}class yk extends pi{constructor(){super(...arguments),this.clientId="",this.eventSource=null,this.subscriptions={},this.lastSentSubscriptions=[],this.maxConnectTimeout=15e3,this.reconnectAttempts=0,this.maxReconnectAttempts=1/0,this.predefinedReconnectIntervals=[200,300,500,1e3,1200,1500,2e3],this.pendingConnects=[]}get isConnected(){return!!this.eventSource&&!!this.clientId&&!this.pendingConnects.length}async subscribe(t,r,n){var i;if(!t)throw new Error("topic must be set.");let s=t;if(n){vk(n);const a="options="+encodeURIComponent(JSON.stringify({query:n.query,headers:n.headers}));s+=(s.includes("?")?"&":"?")+a}const o=function(a){const c=a;let u;try{u=JSON.parse(c==null?void 0:c.data)}catch{}r(u||{})};return this.subscriptions[s]||(this.subscriptions[s]=[]),this.subscriptions[s].push(o),this.isConnected?this.subscriptions[s].length===1?await this.submitSubscriptions():(i=this.eventSource)==null||i.addEventListener(s,o):await this.connect(),async()=>this.unsubscribeByTopicAndListener(t,o)}async unsubscribe(t){var n;let r=!1;if(t){const s=this.getSubscriptionsByTopic(t);for(let o in s)if(this.hasSubscriptionListeners(o)){for(let i of this.subscriptions[o])(n=this.eventSource)==null||n.removeEventListener(o,i);delete this.subscriptions[o],r||(r=!0)}}else this.subscriptions={};this.hasSubscriptionListeners()?r&&await this.submitSubscriptions():this.disconnect()}async unsubscribeByPrefix(t){var n;let r=!1;for(let s in this.subscriptions)if((s+"?").startsWith(t)){r=!0;for(let o of this.subscriptions[s])(n=this.eventSource)==null||n.removeEventListener(s,o);delete this.subscriptions[s]}r&&(this.hasSubscriptionListeners()?await this.submitSubscriptions():this.disconnect())}async unsubscribeByTopicAndListener(t,r){var o;let n=!1;const s=this.getSubscriptionsByTopic(t);for(let i in s){if(!Array.isArray(this.subscriptions[i])||!this.subscriptions[i].length)continue;let a=!1;for(let c=this.subscriptions[i].length-1;c>=0;c--)this.subscriptions[i][c]===r&&(a=!0,delete this.subscriptions[i][c],this.subscriptions[i].splice(c,1),(o=this.eventSource)==null||o.removeEventListener(i,r));a&&(this.subscriptions[i].length||delete this.subscriptions[i],n||this.hasSubscriptionListeners(i)||(n=!0))}this.hasSubscriptionListeners()?n&&await this.submitSubscriptions():this.disconnect()}hasSubscriptionListeners(t){var r,n;if(this.subscriptions=this.subscriptions||{},t)return!!((r=this.subscriptions[t])!=null&&r.length);for(let s in this.subscriptions)if((n=this.subscriptions[s])!=null&&n.length)return!0;return!1}async submitSubscriptions(){if(this.clientId)return this.addAllSubscriptionListeners(),this.lastSentSubscriptions=this.getNonEmptySubscriptionKeys(),this.client.send("/api/realtime",{method:"POST",body:{clientId:this.clientId,subscriptions:this.lastSentSubscriptions},requestKey:this.getSubscriptionsCancelKey()}).catch(t=>{if(!(t!=null&&t.isAbort))throw t})}getSubscriptionsCancelKey(){return"realtime_"+this.clientId}getSubscriptionsByTopic(t){const r={};t=t.includes("?")?t:t+"?";for(let n in this.subscriptions)(n+"?").startsWith(t)&&(r[n]=this.subscriptions[n]);return r}getNonEmptySubscriptionKeys(){const t=[];for(let r in this.subscriptions)this.subscriptions[r].length&&t.push(r);return t}addAllSubscriptionListeners(){if(this.eventSource){this.removeAllSubscriptionListeners();for(let t in this.subscriptions)for(let r of this.subscriptions[t])this.eventSource.addEventListener(t,r)}}removeAllSubscriptionListeners(){if(this.eventSource)for(let t in this.subscriptions)for(let r of this.subscriptions[t])this.eventSource.removeEventListener(t,r)}async connect(){if(!(this.reconnectAttempts>0))return new Promise((t,r)=>{this.pendingConnects.push({resolve:t,reject:r}),this.pendingConnects.length>1||this.initConnect()})}initConnect(){this.disconnect(!0),clearTimeout(this.connectTimeoutId),this.connectTimeoutId=setTimeout(()=>{this.connectErrorHandler(new Error("EventSource connect took too long."))},this.maxConnectTimeout),this.eventSource=new EventSource(this.client.buildUrl("/api/realtime")),this.eventSource.onerror=t=>{this.connectErrorHandler(new Error("Failed to establish realtime connection."))},this.eventSource.addEventListener("PB_CONNECT",t=>{const r=t;this.clientId=r==null?void 0:r.lastEventId,this.submitSubscriptions().then(async()=>{let n=3;for(;this.hasUnsentSubscriptions()&&n>0;)n--,await this.submitSubscriptions()}).then(()=>{for(let s of this.pendingConnects)s.resolve();this.pendingConnects=[],this.reconnectAttempts=0,clearTimeout(this.reconnectTimeoutId),clearTimeout(this.connectTimeoutId);const n=this.getSubscriptionsByTopic("PB_CONNECT");for(let s in n)for(let o of n[s])o(t)}).catch(n=>{this.clientId="",this.connectErrorHandler(n)})})}hasUnsentSubscriptions(){const t=this.getNonEmptySubscriptionKeys();if(t.length!=this.lastSentSubscriptions.length)return!0;for(const r of t)if(!this.lastSentSubscriptions.includes(r))return!0;return!1}connectErrorHandler(t){if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),!this.clientId&&!this.reconnectAttempts||this.reconnectAttempts>this.maxReconnectAttempts){for(let n of this.pendingConnects)n.reject(new Vr(t));return this.pendingConnects=[],void this.disconnect()}this.disconnect(!0);const r=this.predefinedReconnectIntervals[this.reconnectAttempts]||this.predefinedReconnectIntervals[this.predefinedReconnectIntervals.length-1];this.reconnectAttempts++,this.reconnectTimeoutId=setTimeout(()=>{this.initConnect()},r)}disconnect(t=!1){var r;if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),this.removeAllSubscriptionListeners(),this.client.cancelRequest(this.getSubscriptionsCancelKey()),(r=this.eventSource)==null||r.close(),this.eventSource=null,this.clientId="",!t){this.reconnectAttempts=0;for(let n of this.pendingConnects)n.resolve();this.pendingConnects=[]}}}class TL extends jv{constructor(t,r){super(t),this.collectionIdOrName=r}get baseCrudPath(){return this.baseCollectionPath+"/records"}get baseCollectionPath(){return"/api/collections/"+encodeURIComponent(this.collectionIdOrName)}async subscribe(t,r,n){if(!t)throw new Error("Missing topic.");if(!r)throw new Error("Missing subscription callback.");return this.client.realtime.subscribe(this.collectionIdOrName+"/"+t,r,n)}async unsubscribe(t){return t?this.client.realtime.unsubscribe(this.collectionIdOrName+"/"+t):this.client.realtime.unsubscribeByPrefix(this.collectionIdOrName)}async getFullList(t,r){if(typeof t=="number")return super.getFullList(t,r);const n=Object.assign({},t,r);return super.getFullList(n)}async getList(t=1,r=30,n){return super.getList(t,r,n)}async getFirstListItem(t,r){return super.getFirstListItem(t,r)}async getOne(t,r){return super.getOne(t,r)}async create(t,r){return super.create(t,r)}async update(t,r,n){return super.update(t,r,n).then(s=>{var o,i,a;return((o=this.client.authStore.model)==null?void 0:o.id)!==(s==null?void 0:s.id)||((i=this.client.authStore.model)==null?void 0:i.collectionId)!==this.collectionIdOrName&&((a=this.client.authStore.model)==null?void 0:a.collectionName)!==this.collectionIdOrName||this.client.authStore.save(this.client.authStore.token,s),s})}async delete(t,r){return super.delete(t,r).then(n=>{var s,o,i;return!n||((s=this.client.authStore.model)==null?void 0:s.id)!==t||((o=this.client.authStore.model)==null?void 0:o.collectionId)!==this.collectionIdOrName&&((i=this.client.authStore.model)==null?void 0:i.collectionName)!==this.collectionIdOrName||this.client.authStore.clear(),n})}authResponse(t){const r=this.decode((t==null?void 0:t.record)||{});return this.client.authStore.save(t==null?void 0:t.token,r),Object.assign({},t,{token:(t==null?void 0:t.token)||"",record:r})}async listAuthMethods(t){return t=Object.assign({method:"GET"},t),this.client.send(this.baseCollectionPath+"/auth-methods",t).then(r=>Object.assign({},r,{usernamePassword:!!(r!=null&&r.usernamePassword),emailPassword:!!(r!=null&&r.emailPassword),authProviders:Array.isArray(r==null?void 0:r.authProviders)?r==null?void 0:r.authProviders:[]}))}async authWithPassword(t,r,n,s){let o={method:"POST",body:{identity:t,password:r}};return o=Dr("This form of authWithPassword(usernameOrEmail, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(usernameOrEmail, pass, options?).",o,n,s),this.client.send(this.baseCollectionPath+"/auth-with-password",o).then(i=>this.authResponse(i))}async authWithOAuth2Code(t,r,n,s,o,i,a){let c={method:"POST",body:{provider:t,code:r,codeVerifier:n,redirectUrl:s,createData:o}};return c=Dr("This form of authWithOAuth2Code(provider, code, codeVerifier, redirectUrl, createData?, body?, query?) is deprecated. Consider replacing it with authWithOAuth2Code(provider, code, codeVerifier, redirectUrl, createData?, options?).",c,i,a),this.client.send(this.baseCollectionPath+"/auth-with-oauth2",c).then(u=>this.authResponse(u))}authWithOAuth2(...t){if(t.length>1||typeof(t==null?void 0:t[0])=="string")return console.warn("PocketBase: This form of authWithOAuth2() is deprecated and may get removed in the future. Please replace with authWithOAuth2Code() OR use the authWithOAuth2() realtime form as shown in https://pocketbase.io/docs/authentication/#oauth2-integration."),this.authWithOAuth2Code((t==null?void 0:t[0])||"",(t==null?void 0:t[1])||"",(t==null?void 0:t[2])||"",(t==null?void 0:t[3])||"",(t==null?void 0:t[4])||{},(t==null?void 0:t[5])||{},(t==null?void 0:t[6])||{});const r=(t==null?void 0:t[0])||{};let n=null;r.urlCallback||(n=nw(void 0));const s=new yk(this.client);function o(){n==null||n.close(),s.unsubscribe()}const i={},a=r.requestKey;return a&&(i.requestKey=a),this.listAuthMethods(i).then(c=>{var m;const u=c.authProviders.find(v=>v.name===r.provider);if(!u)throw new Vr(new Error(`Missing or invalid provider "${r.provider}".`));const d=this.client.buildUrl("/api/oauth2-redirect"),f=a?(m=this.client.cancelControllers)==null?void 0:m[a]:void 0;return f&&(f.signal.onabort=()=>{o()}),new Promise(async(v,x)=>{var y;try{await s.subscribe("@oauth2",async w=>{var j;const C=s.clientId;try{if(!w.state||C!==w.state)throw new Error("State parameters don't match.");if(w.error||!w.code)throw new Error("OAuth2 redirect error or missing code: "+w.error);const E=Object.assign({},r);delete E.provider,delete E.scopes,delete E.createData,delete E.urlCallback,(j=f==null?void 0:f.signal)!=null&&j.onabort&&(f.signal.onabort=null);const R=await this.authWithOAuth2Code(u.name,w.code,u.codeVerifier,d,r.createData,E);v(R)}catch(E){x(new Vr(E))}o()});const _={state:s.clientId};(y=r.scopes)!=null&&y.length&&(_.scope=r.scopes.join(" "));const p=this._replaceQueryParams(u.authUrl+d,_);await(r.urlCallback||function(w){n?n.location.href=w:n=nw(w)})(p)}catch(_){o(),x(new Vr(_))}})}).catch(c=>{throw o(),c})}async authRefresh(t,r){let n={method:"POST"};return n=Dr("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",n,t,r),this.client.send(this.baseCollectionPath+"/auth-refresh",n).then(s=>this.authResponse(s))}async requestPasswordReset(t,r,n){let s={method:"POST",body:{email:t}};return s=Dr("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",s,r,n),this.client.send(this.baseCollectionPath+"/request-password-reset",s).then(()=>!0)}async confirmPasswordReset(t,r,n,s,o){let i={method:"POST",body:{token:t,password:r,passwordConfirm:n}};return i=Dr("This form of confirmPasswordReset(token, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(token, password, passwordConfirm, options?).",i,s,o),this.client.send(this.baseCollectionPath+"/confirm-password-reset",i).then(()=>!0)}async requestVerification(t,r,n){let s={method:"POST",body:{email:t}};return s=Dr("This form of requestVerification(email, body?, query?) is deprecated. Consider replacing it with requestVerification(email, options?).",s,r,n),this.client.send(this.baseCollectionPath+"/request-verification",s).then(()=>!0)}async confirmVerification(t,r,n){let s={method:"POST",body:{token:t}};return s=Dr("This form of confirmVerification(token, body?, query?) is deprecated. Consider replacing it with confirmVerification(token, options?).",s,r,n),this.client.send(this.baseCollectionPath+"/confirm-verification",s).then(()=>{const o=ra(t),i=this.client.authStore.model;return i&&!i.verified&&i.id===o.id&&i.collectionId===o.collectionId&&(i.verified=!0,this.client.authStore.save(this.client.authStore.token,i)),!0})}async requestEmailChange(t,r,n){let s={method:"POST",body:{newEmail:t}};return s=Dr("This form of requestEmailChange(newEmail, body?, query?) is deprecated. Consider replacing it with requestEmailChange(newEmail, options?).",s,r,n),this.client.send(this.baseCollectionPath+"/request-email-change",s).then(()=>!0)}async confirmEmailChange(t,r,n,s){let o={method:"POST",body:{token:t,password:r}};return o=Dr("This form of confirmEmailChange(token, password, body?, query?) is deprecated. Consider replacing it with confirmEmailChange(token, password, options?).",o,n,s),this.client.send(this.baseCollectionPath+"/confirm-email-change",o).then(()=>{const i=ra(t),a=this.client.authStore.model;return a&&a.id===i.id&&a.collectionId===i.collectionId&&this.client.authStore.clear(),!0})}async listExternalAuths(t,r){return r=Object.assign({method:"GET"},r),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t)+"/external-auths",r)}async unlinkExternalAuth(t,r,n){return n=Object.assign({method:"DELETE"},n),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t)+"/external-auths/"+encodeURIComponent(r),n).then(()=>!0)}_replaceQueryParams(t,r={}){let n=t,s="";t.indexOf("?")>=0&&(n=t.substring(0,t.indexOf("?")),s=t.substring(t.indexOf("?")+1));const o={},i=s.split("&");for(const a of i){if(a=="")continue;const c=a.split("=");o[decodeURIComponent(c[0].replace(/\+/g," "))]=decodeURIComponent((c[1]||"").replace(/\+/g," "))}for(let a in r)r.hasOwnProperty(a)&&(r[a]==null?delete o[a]:o[a]=r[a]);s="";for(let a in o)o.hasOwnProperty(a)&&(s!=""&&(s+="&"),s+=encodeURIComponent(a.replace(/%20/g,"+"))+"="+encodeURIComponent(o[a].replace(/%20/g,"+")));return s!=""?n+"?"+s:n}}function nw(e){if(typeof window>"u"||!(window!=null&&window.open))throw new Vr(new Error("Not in a browser context - please pass a custom urlCallback function."));let t=1024,r=768,n=window.innerWidth,s=window.innerHeight;t=t>n?n:t,r=r>s?s:r;let o=n/2-t/2,i=s/2-r/2;return window.open(e,"popup_window","width="+t+",height="+r+",top="+i+",left="+o+",resizable,menubar=no")}class RL extends jv{get baseCrudPath(){return"/api/collections"}async import(t,r=!1,n){return n=Object.assign({method:"PUT",body:{collections:t,deleteMissing:r}},n),this.client.send(this.baseCrudPath+"/import",n).then(()=>!0)}}class PL extends pi{async getList(t=1,r=30,n){return(n=Object.assign({method:"GET"},n)).query=Object.assign({page:t,perPage:r},n.query),this.client.send("/api/logs",n)}async getOne(t,r){if(!t)throw new Vr({url:this.client.buildUrl("/api/logs/"),status:404,response:{code:404,message:"Missing required log id.",data:{}}});return r=Object.assign({method:"GET"},r),this.client.send("/api/logs/"+encodeURIComponent(t),r)}async getStats(t){return t=Object.assign({method:"GET"},t),this.client.send("/api/logs/stats",t)}}class AL extends pi{async check(t){return t=Object.assign({method:"GET"},t),this.client.send("/api/health",t)}}class DL extends pi{getUrl(t,r,n={}){if(!r||!(t!=null&&t.id)||!(t!=null&&t.collectionId)&&!(t!=null&&t.collectionName))return"";const s=[];s.push("api"),s.push("files"),s.push(encodeURIComponent(t.collectionId||t.collectionName)),s.push(encodeURIComponent(t.id)),s.push(encodeURIComponent(r));let o=this.client.buildUrl(s.join("/"));if(Object.keys(n).length){n.download===!1&&delete n.download;const i=new URLSearchParams(n);o+=(o.includes("?")?"&":"?")+i}return o}async getToken(t){return t=Object.assign({method:"POST"},t),this.client.send("/api/files/token",t).then(r=>(r==null?void 0:r.token)||"")}}class OL extends pi{async getFullList(t){return t=Object.assign({method:"GET"},t),this.client.send("/api/backups",t)}async create(t,r){return r=Object.assign({method:"POST",body:{name:t}},r),this.client.send("/api/backups",r).then(()=>!0)}async upload(t,r){return r=Object.assign({method:"POST",body:t},r),this.client.send("/api/backups/upload",r).then(()=>!0)}async delete(t,r){return r=Object.assign({method:"DELETE"},r),this.client.send(`/api/backups/${encodeURIComponent(t)}`,r).then(()=>!0)}async restore(t,r){return r=Object.assign({method:"POST"},r),this.client.send(`/api/backups/${encodeURIComponent(t)}/restore`,r).then(()=>!0)}getDownloadUrl(t,r){return this.client.buildUrl(`/api/backups/${encodeURIComponent(r)}?token=${encodeURIComponent(t)}`)}}class ML{constructor(t="/",r,n="en-US"){this.cancelControllers={},this.recordServices={},this.enableAutoCancellation=!0,this.baseUrl=t,this.lang=n,this.authStore=r||new CL,this.admins=new EL(this),this.collections=new RL(this),this.files=new DL(this),this.logs=new PL(this),this.settings=new jL(this),this.realtime=new yk(this),this.health=new AL(this),this.backups=new OL(this)}collection(t){return this.recordServices[t]||(this.recordServices[t]=new TL(this,t)),this.recordServices[t]}autoCancellation(t){return this.enableAutoCancellation=!!t,this}cancelRequest(t){return this.cancelControllers[t]&&(this.cancelControllers[t].abort(),delete this.cancelControllers[t]),this}cancelAllRequests(){for(let t in this.cancelControllers)this.cancelControllers[t].abort();return this.cancelControllers={},this}filter(t,r){if(!r)return t;for(let n in r){let s=r[n];switch(typeof s){case"boolean":case"number":s=""+s;break;case"string":s="'"+s.replace(/'/g,"\\'")+"'";break;default:s=s===null?"null":s instanceof Date?"'"+s.toISOString().replace("T"," ")+"'":"'"+JSON.stringify(s).replace(/'/g,"\\'")+"'"}t=t.replaceAll("{:"+n+"}",s)}return t}getFileUrl(t,r,n={}){return this.files.getUrl(t,r,n)}buildUrl(t){var n;let r=this.baseUrl;return typeof window>"u"||!window.location||r.startsWith("https://")||r.startsWith("http://")||(r=(n=window.location.origin)!=null&&n.endsWith("/")?window.location.origin.substring(0,window.location.origin.length-1):window.location.origin||"",this.baseUrl.startsWith("/")||(r+=window.location.pathname||"/",r+=r.endsWith("/")?"":"/"),r+=this.baseUrl),t&&(r+=r.endsWith("/")?"":"/",r+=t.startsWith("/")?t.substring(1):t),r}async send(t,r){r=this.initSendOptions(t,r);let n=this.buildUrl(t);if(this.beforeSend){const s=Object.assign({},await this.beforeSend(n,r));s.url!==void 0||s.options!==void 0?(n=s.url||n,r=s.options||r):Object.keys(s).length&&(r=s,console!=null&&console.warn&&console.warn("Deprecated format of beforeSend return: please use `return { url, options }`, instead of `return options`."))}if(r.query!==void 0){const s=this.serializeQueryParams(r.query);s&&(n+=(n.includes("?")?"&":"?")+s),delete r.query}return this.getHeader(r.headers,"Content-Type")=="application/json"&&r.body&&typeof r.body!="string"&&(r.body=JSON.stringify(r.body)),(r.fetch||fetch)(n,r).then(async s=>{let o={};try{o=await s.json()}catch{}if(this.afterSend&&(o=await this.afterSend(s,o)),s.status>=400)throw new Vr({url:s.url,status:s.status,data:o});return o}).catch(s=>{throw new Vr(s)})}initSendOptions(t,r){if((r=Object.assign({method:"GET"},r)).body=this.convertToFormDataIfNeeded(r.body),vk(r),r.query=Object.assign({},r.params,r.query),r.requestKey===void 0&&(r.$autoCancel===!1||r.query.$autoCancel===!1?r.requestKey=null:(r.$cancelKey||r.query.$cancelKey)&&(r.requestKey=r.$cancelKey||r.query.$cancelKey)),delete r.$autoCancel,delete r.query.$autoCancel,delete r.$cancelKey,delete r.query.$cancelKey,this.getHeader(r.headers,"Content-Type")!==null||this.isFormData(r.body)||(r.headers=Object.assign({},r.headers,{"Content-Type":"application/json"})),this.getHeader(r.headers,"Accept-Language")===null&&(r.headers=Object.assign({},r.headers,{"Accept-Language":this.lang})),this.authStore.token&&this.getHeader(r.headers,"Authorization")===null&&(r.headers=Object.assign({},r.headers,{Authorization:this.authStore.token})),this.enableAutoCancellation&&r.requestKey!==null){const n=r.requestKey||(r.method||"GET")+t;delete r.requestKey,this.cancelRequest(n);const s=new AbortController;this.cancelControllers[n]=s,r.signal=s.signal}return r}convertToFormDataIfNeeded(t){if(typeof FormData>"u"||t===void 0||typeof t!="object"||t===null||this.isFormData(t)||!this.hasBlobField(t))return t;const r=new FormData;for(const n in t){const s=t[n];if(typeof s!="object"||this.hasBlobField({data:s})){const o=Array.isArray(s)?s:[s];for(let i of o)r.append(n,i)}else{let o={};o[n]=s,r.append("@jsonPayload",JSON.stringify(o))}}return r}hasBlobField(t){for(const r in t){const n=Array.isArray(t[r])?t[r]:[t[r]];for(const s of n)if(typeof Blob<"u"&&s instanceof Blob||typeof File<"u"&&s instanceof File)return!0}return!1}getHeader(t,r){t=t||{},r=r.toLowerCase();for(let n in t)if(n.toLowerCase()==r)return t[n];return null}isFormData(t){return t&&(t.constructor.name==="FormData"||typeof FormData<"u"&&t instanceof FormData)}serializeQueryParams(t){const r=[];for(const n in t){if(t[n]===null)continue;const s=t[n],o=encodeURIComponent(n);if(Array.isArray(s))for(const i of s)r.push(o+"="+encodeURIComponent(i));else s instanceof Date?r.push(o+"="+encodeURIComponent(s.toISOString())):typeof s!==null&&typeof s=="object"?r.push(o+"="+encodeURIComponent(JSON.stringify(s))):r.push(o+"="+encodeURIComponent(s))}return r.join("&")}}var IL={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};const LL=IL.VITE_API_DOMAIN;console.log(LL);let _u;const st=()=>_u||(_u=new ML("/"),_u);//! moment.js +For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return g.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},mL="DialogDescriptionWarning",gL=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${hk(mL).contentName}}.`;return g.useEffect(()=>{var o;const s=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},xv=JS,wv=tk,_v=nk,Tc=sk,Rc=ok,Pc=ak,Ac=ck,Tf=dk;const bv=xv,Sv=wv,vL=_v,pk=g.forwardRef(({className:e,...t},r)=>a.jsx(Tc,{className:oe("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));pk.displayName=Tc.displayName;const yL=Sc("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),Rf=g.forwardRef(({side:e="right",className:t,children:r,...n},s)=>a.jsxs(vL,{children:[a.jsx(pk,{}),a.jsxs(Rc,{ref:s,className:oe(yL({side:e}),t),...n,children:[r,a.jsxs(Tf,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[a.jsx(zg,{className:"h-4 w-4 dark:text-stone-200"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Rf.displayName=Rc.displayName;const kv=({className:e,...t})=>a.jsx("div",{className:oe("flex flex-col space-y-2 text-center sm:text-left",e),...t});kv.displayName="SheetHeader";const Cv=g.forwardRef(({className:e,...t},r)=>a.jsx(Pc,{ref:r,className:oe("text-lg font-semibold text-foreground",e),...t}));Cv.displayName=Pc.displayName;const xL=g.forwardRef(({className:e,...t},r)=>a.jsx(Ac,{ref:r,className:oe("text-sm text-muted-foreground",e),...t}));xL.displayName=Ac.displayName;class Br extends Error{constructor(t){var r,n,s,o;super("ClientResponseError"),this.url="",this.status=0,this.response={},this.isAbort=!1,this.originalError=null,Object.setPrototypeOf(this,Br.prototype),t!==null&&typeof t=="object"&&(this.url=typeof t.url=="string"?t.url:"",this.status=typeof t.status=="number"?t.status:0,this.isAbort=!!t.isAbort,this.originalError=t.originalError,t.response!==null&&typeof t.response=="object"?this.response=t.response:t.data!==null&&typeof t.data=="object"?this.response=t.data:this.response={}),this.originalError||t instanceof Br||(this.originalError=t),typeof DOMException<"u"&&t instanceof DOMException&&(this.isAbort=!0),this.name="ClientResponseError "+this.status,this.message=(r=this.response)==null?void 0:r.message,this.message||(this.isAbort?this.message="The request was autocancelled. You can find more info in https://github.com/pocketbase/js-sdk#auto-cancellation.":(o=(s=(n=this.originalError)==null?void 0:n.cause)==null?void 0:s.message)!=null&&o.includes("ECONNREFUSED ::1")?this.message="Failed to connect to the PocketBase server. Try changing the SDK URL from localhost to 127.0.0.1 (https://github.com/pocketbase/js-sdk/issues/21).":this.message="Something went wrong while processing your request.")}get data(){return this.response}toJSON(){return{...this}}}const wu=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function wL(e,t){const r={};if(typeof e!="string")return r;const n=Object.assign({},{}).decode||_L;let s=0;for(;s0&&(!r.exp||r.exp-t>Date.now()/1e3))}mk=typeof atob!="function"||SL?e=>{let t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(var r,n,s=0,o=0,i="";n=t.charAt(o++);~n&&(r=s%4?64*r+n:n,s++%4)?i+=String.fromCharCode(255&r>>(-2*s&6)):0)n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(n);return i}:atob;const rw="pb_auth";class kL{constructor(){this.baseToken="",this.baseModel=null,this._onChangeCallbacks=[]}get token(){return this.baseToken}get model(){return this.baseModel}get isValid(){return!gk(this.token)}get isAdmin(){return ra(this.token).type==="admin"}get isAuthRecord(){return ra(this.token).type==="authRecord"}save(t,r){this.baseToken=t||"",this.baseModel=r||null,this.triggerChange()}clear(){this.baseToken="",this.baseModel=null,this.triggerChange()}loadFromCookie(t,r=rw){const n=wL(t||"")[r]||"";let s={};try{s=JSON.parse(n),(typeof s===null||typeof s!="object"||Array.isArray(s))&&(s={})}catch{}this.save(s.token||"",s.model||null)}exportToCookie(t,r=rw){var c,u;const n={secure:!0,sameSite:!0,httpOnly:!0,path:"/"},s=ra(this.token);n.expires=s!=null&&s.exp?new Date(1e3*s.exp):new Date("1970-01-01"),t=Object.assign({},n,t);const o={token:this.token,model:this.model?JSON.parse(JSON.stringify(this.model)):null};let i=tw(r,JSON.stringify(o),t);const l=typeof Blob<"u"?new Blob([i]).size:i.length;if(o.model&&l>4096){o.model={id:(c=o==null?void 0:o.model)==null?void 0:c.id,email:(u=o==null?void 0:o.model)==null?void 0:u.email};const d=["collectionId","username","verified"];for(const f in this.model)d.includes(f)&&(o.model[f]=this.model[f]);i=tw(r,JSON.stringify(o),t)}return i}onChange(t,r=!1){return this._onChangeCallbacks.push(t),r&&t(this.token,this.model),()=>{for(let n=this._onChangeCallbacks.length-1;n>=0;n--)if(this._onChangeCallbacks[n]==t)return delete this._onChangeCallbacks[n],void this._onChangeCallbacks.splice(n,1)}}triggerChange(){for(const t of this._onChangeCallbacks)t&&t(this.token,this.model)}}class CL extends kL{constructor(t="pocketbase_auth"){super(),this.storageFallback={},this.storageKey=t,this._bindStorageEvent()}get token(){return(this._storageGet(this.storageKey)||{}).token||""}get model(){return(this._storageGet(this.storageKey)||{}).model||null}save(t,r){this._storageSet(this.storageKey,{token:t,model:r}),super.save(t,r)}clear(){this._storageRemove(this.storageKey),super.clear()}_storageGet(t){if(typeof window<"u"&&(window!=null&&window.localStorage)){const r=window.localStorage.getItem(t)||"";try{return JSON.parse(r)}catch{return r}}return this.storageFallback[t]}_storageSet(t,r){if(typeof window<"u"&&(window!=null&&window.localStorage)){let n=r;typeof r!="string"&&(n=JSON.stringify(r)),window.localStorage.setItem(t,n)}else this.storageFallback[t]=r}_storageRemove(t){var r;typeof window<"u"&&(window!=null&&window.localStorage)&&((r=window.localStorage)==null||r.removeItem(t)),delete this.storageFallback[t]}_bindStorageEvent(){typeof window<"u"&&(window!=null&&window.localStorage)&&window.addEventListener&&window.addEventListener("storage",t=>{if(t.key!=this.storageKey)return;const r=this._storageGet(this.storageKey)||{};super.save(r.token||"",r.model||null)})}}class pi{constructor(t){this.client=t}}class jL extends pi{async getAll(t){return t=Object.assign({method:"GET"},t),this.client.send("/api/settings",t)}async update(t,r){return r=Object.assign({method:"PATCH",body:t},r),this.client.send("/api/settings",r)}async testS3(t="storage",r){return r=Object.assign({method:"POST",body:{filesystem:t}},r),this.client.send("/api/settings/test/s3",r).then(()=>!0)}async testEmail(t,r,n){return n=Object.assign({method:"POST",body:{email:t,template:r}},n),this.client.send("/api/settings/test/email",n).then(()=>!0)}async generateAppleClientSecret(t,r,n,s,o,i){return i=Object.assign({method:"POST",body:{clientId:t,teamId:r,keyId:n,privateKey:s,duration:o}},i),this.client.send("/api/settings/apple/generate-client-secret",i)}}class jv extends pi{decode(t){return t}async getFullList(t,r){if(typeof t=="number")return this._getFullList(t,r);let n=500;return(r=Object.assign({},t,r)).batch&&(n=r.batch,delete r.batch),this._getFullList(n,r)}async getList(t=1,r=30,n){return(n=Object.assign({method:"GET"},n)).query=Object.assign({page:t,perPage:r},n.query),this.client.send(this.baseCrudPath,n).then(s=>{var o;return s.items=((o=s.items)==null?void 0:o.map(i=>this.decode(i)))||[],s})}async getFirstListItem(t,r){return(r=Object.assign({requestKey:"one_by_filter_"+this.baseCrudPath+"_"+t},r)).query=Object.assign({filter:t,skipTotal:1},r.query),this.getList(1,1,r).then(n=>{var s;if(!((s=n==null?void 0:n.items)!=null&&s.length))throw new Br({status:404,response:{code:404,message:"The requested resource wasn't found.",data:{}}});return n.items[0]})}async getOne(t,r){if(!t)throw new Br({url:this.client.buildUrl(this.baseCrudPath+"/"),status:404,response:{code:404,message:"Missing required record id.",data:{}}});return r=Object.assign({method:"GET"},r),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t),r).then(n=>this.decode(n))}async create(t,r){return r=Object.assign({method:"POST",body:t},r),this.client.send(this.baseCrudPath,r).then(n=>this.decode(n))}async update(t,r,n){return n=Object.assign({method:"PATCH",body:r},n),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t),n).then(s=>this.decode(s))}async delete(t,r){return r=Object.assign({method:"DELETE"},r),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t),r).then(()=>!0)}_getFullList(t=500,r){(r=r||{}).query=Object.assign({skipTotal:1},r.query);let n=[],s=async o=>this.getList(o,t||500,r).then(i=>{const l=i.items;return n=n.concat(l),l.length==i.perPage?s(o+1):n});return s(1)}}function Or(e,t,r,n){const s=n!==void 0;return s||r!==void 0?s?(console.warn(e),t.body=Object.assign({},t.body,r),t.query=Object.assign({},t.query,n),t):Object.assign(t,r):t}function Gh(e){var t;(t=e._resetAutoRefresh)==null||t.call(e)}class EL extends jv{get baseCrudPath(){return"/api/admins"}async update(t,r,n){return super.update(t,r,n).then(s=>{var o,i;return((o=this.client.authStore.model)==null?void 0:o.id)===s.id&&((i=this.client.authStore.model)==null?void 0:i.collectionId)===void 0&&this.client.authStore.save(this.client.authStore.token,s),s})}async delete(t,r){return super.delete(t,r).then(n=>{var s,o;return n&&((s=this.client.authStore.model)==null?void 0:s.id)===t&&((o=this.client.authStore.model)==null?void 0:o.collectionId)===void 0&&this.client.authStore.clear(),n})}authResponse(t){const r=this.decode((t==null?void 0:t.admin)||{});return t!=null&&t.token&&(t!=null&&t.admin)&&this.client.authStore.save(t.token,r),Object.assign({},t,{token:(t==null?void 0:t.token)||"",admin:r})}async authWithPassword(t,r,n,s){let o={method:"POST",body:{identity:t,password:r}};o=Or("This form of authWithPassword(email, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(email, pass, options?).",o,n,s);const i=o.autoRefreshThreshold;delete o.autoRefreshThreshold,o.autoRefresh||Gh(this.client);let l=await this.client.send(this.baseCrudPath+"/auth-with-password",o);return l=this.authResponse(l),i&&function(u,d,f,m){Gh(u);const v=u.beforeSend,x=u.authStore.model,y=u.authStore.onChange((_,p)=>{(!_||(p==null?void 0:p.id)!=(x==null?void 0:x.id)||(p!=null&&p.collectionId||x!=null&&x.collectionId)&&(p==null?void 0:p.collectionId)!=(x==null?void 0:x.collectionId))&&Gh(u)});u._resetAutoRefresh=function(){y(),u.beforeSend=v,delete u._resetAutoRefresh},u.beforeSend=async(_,p)=>{var j;const h=u.authStore.token;if((j=p.query)!=null&&j.autoRefresh)return v?v(_,p):{url:_,sendOptions:p};let w=u.authStore.isValid;if(w&&gk(u.authStore.token,d))try{await f()}catch{w=!1}w||await m();const C=p.headers||{};for(let E in C)if(E.toLowerCase()=="authorization"&&h==C[E]&&u.authStore.token){C[E]=u.authStore.token;break}return p.headers=C,v?v(_,p):{url:_,sendOptions:p}}}(this.client,i,()=>this.authRefresh({autoRefresh:!0}),()=>this.authWithPassword(t,r,Object.assign({autoRefresh:!0},o))),l}async authRefresh(t,r){let n={method:"POST"};return n=Or("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",n,t,r),this.client.send(this.baseCrudPath+"/auth-refresh",n).then(this.authResponse.bind(this))}async requestPasswordReset(t,r,n){let s={method:"POST",body:{email:t}};return s=Or("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",s,r,n),this.client.send(this.baseCrudPath+"/request-password-reset",s).then(()=>!0)}async confirmPasswordReset(t,r,n,s,o){let i={method:"POST",body:{token:t,password:r,passwordConfirm:n}};return i=Or("This form of confirmPasswordReset(resetToken, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(resetToken, password, passwordConfirm, options?).",i,s,o),this.client.send(this.baseCrudPath+"/confirm-password-reset",i).then(()=>!0)}}const NL=["requestKey","$cancelKey","$autoCancel","fetch","headers","body","query","params","cache","credentials","headers","integrity","keepalive","method","mode","redirect","referrer","referrerPolicy","signal","window"];function vk(e){if(e){e.query=e.query||{};for(let t in e)NL.includes(t)||(e.query[t]=e[t],delete e[t])}}class yk extends pi{constructor(){super(...arguments),this.clientId="",this.eventSource=null,this.subscriptions={},this.lastSentSubscriptions=[],this.maxConnectTimeout=15e3,this.reconnectAttempts=0,this.maxReconnectAttempts=1/0,this.predefinedReconnectIntervals=[200,300,500,1e3,1200,1500,2e3],this.pendingConnects=[]}get isConnected(){return!!this.eventSource&&!!this.clientId&&!this.pendingConnects.length}async subscribe(t,r,n){var i;if(!t)throw new Error("topic must be set.");let s=t;if(n){vk(n);const l="options="+encodeURIComponent(JSON.stringify({query:n.query,headers:n.headers}));s+=(s.includes("?")?"&":"?")+l}const o=function(l){const c=l;let u;try{u=JSON.parse(c==null?void 0:c.data)}catch{}r(u||{})};return this.subscriptions[s]||(this.subscriptions[s]=[]),this.subscriptions[s].push(o),this.isConnected?this.subscriptions[s].length===1?await this.submitSubscriptions():(i=this.eventSource)==null||i.addEventListener(s,o):await this.connect(),async()=>this.unsubscribeByTopicAndListener(t,o)}async unsubscribe(t){var n;let r=!1;if(t){const s=this.getSubscriptionsByTopic(t);for(let o in s)if(this.hasSubscriptionListeners(o)){for(let i of this.subscriptions[o])(n=this.eventSource)==null||n.removeEventListener(o,i);delete this.subscriptions[o],r||(r=!0)}}else this.subscriptions={};this.hasSubscriptionListeners()?r&&await this.submitSubscriptions():this.disconnect()}async unsubscribeByPrefix(t){var n;let r=!1;for(let s in this.subscriptions)if((s+"?").startsWith(t)){r=!0;for(let o of this.subscriptions[s])(n=this.eventSource)==null||n.removeEventListener(s,o);delete this.subscriptions[s]}r&&(this.hasSubscriptionListeners()?await this.submitSubscriptions():this.disconnect())}async unsubscribeByTopicAndListener(t,r){var o;let n=!1;const s=this.getSubscriptionsByTopic(t);for(let i in s){if(!Array.isArray(this.subscriptions[i])||!this.subscriptions[i].length)continue;let l=!1;for(let c=this.subscriptions[i].length-1;c>=0;c--)this.subscriptions[i][c]===r&&(l=!0,delete this.subscriptions[i][c],this.subscriptions[i].splice(c,1),(o=this.eventSource)==null||o.removeEventListener(i,r));l&&(this.subscriptions[i].length||delete this.subscriptions[i],n||this.hasSubscriptionListeners(i)||(n=!0))}this.hasSubscriptionListeners()?n&&await this.submitSubscriptions():this.disconnect()}hasSubscriptionListeners(t){var r,n;if(this.subscriptions=this.subscriptions||{},t)return!!((r=this.subscriptions[t])!=null&&r.length);for(let s in this.subscriptions)if((n=this.subscriptions[s])!=null&&n.length)return!0;return!1}async submitSubscriptions(){if(this.clientId)return this.addAllSubscriptionListeners(),this.lastSentSubscriptions=this.getNonEmptySubscriptionKeys(),this.client.send("/api/realtime",{method:"POST",body:{clientId:this.clientId,subscriptions:this.lastSentSubscriptions},requestKey:this.getSubscriptionsCancelKey()}).catch(t=>{if(!(t!=null&&t.isAbort))throw t})}getSubscriptionsCancelKey(){return"realtime_"+this.clientId}getSubscriptionsByTopic(t){const r={};t=t.includes("?")?t:t+"?";for(let n in this.subscriptions)(n+"?").startsWith(t)&&(r[n]=this.subscriptions[n]);return r}getNonEmptySubscriptionKeys(){const t=[];for(let r in this.subscriptions)this.subscriptions[r].length&&t.push(r);return t}addAllSubscriptionListeners(){if(this.eventSource){this.removeAllSubscriptionListeners();for(let t in this.subscriptions)for(let r of this.subscriptions[t])this.eventSource.addEventListener(t,r)}}removeAllSubscriptionListeners(){if(this.eventSource)for(let t in this.subscriptions)for(let r of this.subscriptions[t])this.eventSource.removeEventListener(t,r)}async connect(){if(!(this.reconnectAttempts>0))return new Promise((t,r)=>{this.pendingConnects.push({resolve:t,reject:r}),this.pendingConnects.length>1||this.initConnect()})}initConnect(){this.disconnect(!0),clearTimeout(this.connectTimeoutId),this.connectTimeoutId=setTimeout(()=>{this.connectErrorHandler(new Error("EventSource connect took too long."))},this.maxConnectTimeout),this.eventSource=new EventSource(this.client.buildUrl("/api/realtime")),this.eventSource.onerror=t=>{this.connectErrorHandler(new Error("Failed to establish realtime connection."))},this.eventSource.addEventListener("PB_CONNECT",t=>{const r=t;this.clientId=r==null?void 0:r.lastEventId,this.submitSubscriptions().then(async()=>{let n=3;for(;this.hasUnsentSubscriptions()&&n>0;)n--,await this.submitSubscriptions()}).then(()=>{for(let s of this.pendingConnects)s.resolve();this.pendingConnects=[],this.reconnectAttempts=0,clearTimeout(this.reconnectTimeoutId),clearTimeout(this.connectTimeoutId);const n=this.getSubscriptionsByTopic("PB_CONNECT");for(let s in n)for(let o of n[s])o(t)}).catch(n=>{this.clientId="",this.connectErrorHandler(n)})})}hasUnsentSubscriptions(){const t=this.getNonEmptySubscriptionKeys();if(t.length!=this.lastSentSubscriptions.length)return!0;for(const r of t)if(!this.lastSentSubscriptions.includes(r))return!0;return!1}connectErrorHandler(t){if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),!this.clientId&&!this.reconnectAttempts||this.reconnectAttempts>this.maxReconnectAttempts){for(let n of this.pendingConnects)n.reject(new Br(t));return this.pendingConnects=[],void this.disconnect()}this.disconnect(!0);const r=this.predefinedReconnectIntervals[this.reconnectAttempts]||this.predefinedReconnectIntervals[this.predefinedReconnectIntervals.length-1];this.reconnectAttempts++,this.reconnectTimeoutId=setTimeout(()=>{this.initConnect()},r)}disconnect(t=!1){var r;if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),this.removeAllSubscriptionListeners(),this.client.cancelRequest(this.getSubscriptionsCancelKey()),(r=this.eventSource)==null||r.close(),this.eventSource=null,this.clientId="",!t){this.reconnectAttempts=0;for(let n of this.pendingConnects)n.resolve();this.pendingConnects=[]}}}class TL extends jv{constructor(t,r){super(t),this.collectionIdOrName=r}get baseCrudPath(){return this.baseCollectionPath+"/records"}get baseCollectionPath(){return"/api/collections/"+encodeURIComponent(this.collectionIdOrName)}async subscribe(t,r,n){if(!t)throw new Error("Missing topic.");if(!r)throw new Error("Missing subscription callback.");return this.client.realtime.subscribe(this.collectionIdOrName+"/"+t,r,n)}async unsubscribe(t){return t?this.client.realtime.unsubscribe(this.collectionIdOrName+"/"+t):this.client.realtime.unsubscribeByPrefix(this.collectionIdOrName)}async getFullList(t,r){if(typeof t=="number")return super.getFullList(t,r);const n=Object.assign({},t,r);return super.getFullList(n)}async getList(t=1,r=30,n){return super.getList(t,r,n)}async getFirstListItem(t,r){return super.getFirstListItem(t,r)}async getOne(t,r){return super.getOne(t,r)}async create(t,r){return super.create(t,r)}async update(t,r,n){return super.update(t,r,n).then(s=>{var o,i,l;return((o=this.client.authStore.model)==null?void 0:o.id)!==(s==null?void 0:s.id)||((i=this.client.authStore.model)==null?void 0:i.collectionId)!==this.collectionIdOrName&&((l=this.client.authStore.model)==null?void 0:l.collectionName)!==this.collectionIdOrName||this.client.authStore.save(this.client.authStore.token,s),s})}async delete(t,r){return super.delete(t,r).then(n=>{var s,o,i;return!n||((s=this.client.authStore.model)==null?void 0:s.id)!==t||((o=this.client.authStore.model)==null?void 0:o.collectionId)!==this.collectionIdOrName&&((i=this.client.authStore.model)==null?void 0:i.collectionName)!==this.collectionIdOrName||this.client.authStore.clear(),n})}authResponse(t){const r=this.decode((t==null?void 0:t.record)||{});return this.client.authStore.save(t==null?void 0:t.token,r),Object.assign({},t,{token:(t==null?void 0:t.token)||"",record:r})}async listAuthMethods(t){return t=Object.assign({method:"GET"},t),this.client.send(this.baseCollectionPath+"/auth-methods",t).then(r=>Object.assign({},r,{usernamePassword:!!(r!=null&&r.usernamePassword),emailPassword:!!(r!=null&&r.emailPassword),authProviders:Array.isArray(r==null?void 0:r.authProviders)?r==null?void 0:r.authProviders:[]}))}async authWithPassword(t,r,n,s){let o={method:"POST",body:{identity:t,password:r}};return o=Or("This form of authWithPassword(usernameOrEmail, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(usernameOrEmail, pass, options?).",o,n,s),this.client.send(this.baseCollectionPath+"/auth-with-password",o).then(i=>this.authResponse(i))}async authWithOAuth2Code(t,r,n,s,o,i,l){let c={method:"POST",body:{provider:t,code:r,codeVerifier:n,redirectUrl:s,createData:o}};return c=Or("This form of authWithOAuth2Code(provider, code, codeVerifier, redirectUrl, createData?, body?, query?) is deprecated. Consider replacing it with authWithOAuth2Code(provider, code, codeVerifier, redirectUrl, createData?, options?).",c,i,l),this.client.send(this.baseCollectionPath+"/auth-with-oauth2",c).then(u=>this.authResponse(u))}authWithOAuth2(...t){if(t.length>1||typeof(t==null?void 0:t[0])=="string")return console.warn("PocketBase: This form of authWithOAuth2() is deprecated and may get removed in the future. Please replace with authWithOAuth2Code() OR use the authWithOAuth2() realtime form as shown in https://pocketbase.io/docs/authentication/#oauth2-integration."),this.authWithOAuth2Code((t==null?void 0:t[0])||"",(t==null?void 0:t[1])||"",(t==null?void 0:t[2])||"",(t==null?void 0:t[3])||"",(t==null?void 0:t[4])||{},(t==null?void 0:t[5])||{},(t==null?void 0:t[6])||{});const r=(t==null?void 0:t[0])||{};let n=null;r.urlCallback||(n=nw(void 0));const s=new yk(this.client);function o(){n==null||n.close(),s.unsubscribe()}const i={},l=r.requestKey;return l&&(i.requestKey=l),this.listAuthMethods(i).then(c=>{var m;const u=c.authProviders.find(v=>v.name===r.provider);if(!u)throw new Br(new Error(`Missing or invalid provider "${r.provider}".`));const d=this.client.buildUrl("/api/oauth2-redirect"),f=l?(m=this.client.cancelControllers)==null?void 0:m[l]:void 0;return f&&(f.signal.onabort=()=>{o()}),new Promise(async(v,x)=>{var y;try{await s.subscribe("@oauth2",async w=>{var j;const C=s.clientId;try{if(!w.state||C!==w.state)throw new Error("State parameters don't match.");if(w.error||!w.code)throw new Error("OAuth2 redirect error or missing code: "+w.error);const E=Object.assign({},r);delete E.provider,delete E.scopes,delete E.createData,delete E.urlCallback,(j=f==null?void 0:f.signal)!=null&&j.onabort&&(f.signal.onabort=null);const R=await this.authWithOAuth2Code(u.name,w.code,u.codeVerifier,d,r.createData,E);v(R)}catch(E){x(new Br(E))}o()});const _={state:s.clientId};(y=r.scopes)!=null&&y.length&&(_.scope=r.scopes.join(" "));const p=this._replaceQueryParams(u.authUrl+d,_);await(r.urlCallback||function(w){n?n.location.href=w:n=nw(w)})(p)}catch(_){o(),x(new Br(_))}})}).catch(c=>{throw o(),c})}async authRefresh(t,r){let n={method:"POST"};return n=Or("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",n,t,r),this.client.send(this.baseCollectionPath+"/auth-refresh",n).then(s=>this.authResponse(s))}async requestPasswordReset(t,r,n){let s={method:"POST",body:{email:t}};return s=Or("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",s,r,n),this.client.send(this.baseCollectionPath+"/request-password-reset",s).then(()=>!0)}async confirmPasswordReset(t,r,n,s,o){let i={method:"POST",body:{token:t,password:r,passwordConfirm:n}};return i=Or("This form of confirmPasswordReset(token, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(token, password, passwordConfirm, options?).",i,s,o),this.client.send(this.baseCollectionPath+"/confirm-password-reset",i).then(()=>!0)}async requestVerification(t,r,n){let s={method:"POST",body:{email:t}};return s=Or("This form of requestVerification(email, body?, query?) is deprecated. Consider replacing it with requestVerification(email, options?).",s,r,n),this.client.send(this.baseCollectionPath+"/request-verification",s).then(()=>!0)}async confirmVerification(t,r,n){let s={method:"POST",body:{token:t}};return s=Or("This form of confirmVerification(token, body?, query?) is deprecated. Consider replacing it with confirmVerification(token, options?).",s,r,n),this.client.send(this.baseCollectionPath+"/confirm-verification",s).then(()=>{const o=ra(t),i=this.client.authStore.model;return i&&!i.verified&&i.id===o.id&&i.collectionId===o.collectionId&&(i.verified=!0,this.client.authStore.save(this.client.authStore.token,i)),!0})}async requestEmailChange(t,r,n){let s={method:"POST",body:{newEmail:t}};return s=Or("This form of requestEmailChange(newEmail, body?, query?) is deprecated. Consider replacing it with requestEmailChange(newEmail, options?).",s,r,n),this.client.send(this.baseCollectionPath+"/request-email-change",s).then(()=>!0)}async confirmEmailChange(t,r,n,s){let o={method:"POST",body:{token:t,password:r}};return o=Or("This form of confirmEmailChange(token, password, body?, query?) is deprecated. Consider replacing it with confirmEmailChange(token, password, options?).",o,n,s),this.client.send(this.baseCollectionPath+"/confirm-email-change",o).then(()=>{const i=ra(t),l=this.client.authStore.model;return l&&l.id===i.id&&l.collectionId===i.collectionId&&this.client.authStore.clear(),!0})}async listExternalAuths(t,r){return r=Object.assign({method:"GET"},r),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t)+"/external-auths",r)}async unlinkExternalAuth(t,r,n){return n=Object.assign({method:"DELETE"},n),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t)+"/external-auths/"+encodeURIComponent(r),n).then(()=>!0)}_replaceQueryParams(t,r={}){let n=t,s="";t.indexOf("?")>=0&&(n=t.substring(0,t.indexOf("?")),s=t.substring(t.indexOf("?")+1));const o={},i=s.split("&");for(const l of i){if(l=="")continue;const c=l.split("=");o[decodeURIComponent(c[0].replace(/\+/g," "))]=decodeURIComponent((c[1]||"").replace(/\+/g," "))}for(let l in r)r.hasOwnProperty(l)&&(r[l]==null?delete o[l]:o[l]=r[l]);s="";for(let l in o)o.hasOwnProperty(l)&&(s!=""&&(s+="&"),s+=encodeURIComponent(l.replace(/%20/g,"+"))+"="+encodeURIComponent(o[l].replace(/%20/g,"+")));return s!=""?n+"?"+s:n}}function nw(e){if(typeof window>"u"||!(window!=null&&window.open))throw new Br(new Error("Not in a browser context - please pass a custom urlCallback function."));let t=1024,r=768,n=window.innerWidth,s=window.innerHeight;t=t>n?n:t,r=r>s?s:r;let o=n/2-t/2,i=s/2-r/2;return window.open(e,"popup_window","width="+t+",height="+r+",top="+i+",left="+o+",resizable,menubar=no")}class RL extends jv{get baseCrudPath(){return"/api/collections"}async import(t,r=!1,n){return n=Object.assign({method:"PUT",body:{collections:t,deleteMissing:r}},n),this.client.send(this.baseCrudPath+"/import",n).then(()=>!0)}}class PL extends pi{async getList(t=1,r=30,n){return(n=Object.assign({method:"GET"},n)).query=Object.assign({page:t,perPage:r},n.query),this.client.send("/api/logs",n)}async getOne(t,r){if(!t)throw new Br({url:this.client.buildUrl("/api/logs/"),status:404,response:{code:404,message:"Missing required log id.",data:{}}});return r=Object.assign({method:"GET"},r),this.client.send("/api/logs/"+encodeURIComponent(t),r)}async getStats(t){return t=Object.assign({method:"GET"},t),this.client.send("/api/logs/stats",t)}}class AL extends pi{async check(t){return t=Object.assign({method:"GET"},t),this.client.send("/api/health",t)}}class DL extends pi{getUrl(t,r,n={}){if(!r||!(t!=null&&t.id)||!(t!=null&&t.collectionId)&&!(t!=null&&t.collectionName))return"";const s=[];s.push("api"),s.push("files"),s.push(encodeURIComponent(t.collectionId||t.collectionName)),s.push(encodeURIComponent(t.id)),s.push(encodeURIComponent(r));let o=this.client.buildUrl(s.join("/"));if(Object.keys(n).length){n.download===!1&&delete n.download;const i=new URLSearchParams(n);o+=(o.includes("?")?"&":"?")+i}return o}async getToken(t){return t=Object.assign({method:"POST"},t),this.client.send("/api/files/token",t).then(r=>(r==null?void 0:r.token)||"")}}class OL extends pi{async getFullList(t){return t=Object.assign({method:"GET"},t),this.client.send("/api/backups",t)}async create(t,r){return r=Object.assign({method:"POST",body:{name:t}},r),this.client.send("/api/backups",r).then(()=>!0)}async upload(t,r){return r=Object.assign({method:"POST",body:t},r),this.client.send("/api/backups/upload",r).then(()=>!0)}async delete(t,r){return r=Object.assign({method:"DELETE"},r),this.client.send(`/api/backups/${encodeURIComponent(t)}`,r).then(()=>!0)}async restore(t,r){return r=Object.assign({method:"POST"},r),this.client.send(`/api/backups/${encodeURIComponent(t)}/restore`,r).then(()=>!0)}getDownloadUrl(t,r){return this.client.buildUrl(`/api/backups/${encodeURIComponent(r)}?token=${encodeURIComponent(t)}`)}}class ML{constructor(t="/",r,n="en-US"){this.cancelControllers={},this.recordServices={},this.enableAutoCancellation=!0,this.baseUrl=t,this.lang=n,this.authStore=r||new CL,this.admins=new EL(this),this.collections=new RL(this),this.files=new DL(this),this.logs=new PL(this),this.settings=new jL(this),this.realtime=new yk(this),this.health=new AL(this),this.backups=new OL(this)}collection(t){return this.recordServices[t]||(this.recordServices[t]=new TL(this,t)),this.recordServices[t]}autoCancellation(t){return this.enableAutoCancellation=!!t,this}cancelRequest(t){return this.cancelControllers[t]&&(this.cancelControllers[t].abort(),delete this.cancelControllers[t]),this}cancelAllRequests(){for(let t in this.cancelControllers)this.cancelControllers[t].abort();return this.cancelControllers={},this}filter(t,r){if(!r)return t;for(let n in r){let s=r[n];switch(typeof s){case"boolean":case"number":s=""+s;break;case"string":s="'"+s.replace(/'/g,"\\'")+"'";break;default:s=s===null?"null":s instanceof Date?"'"+s.toISOString().replace("T"," ")+"'":"'"+JSON.stringify(s).replace(/'/g,"\\'")+"'"}t=t.replaceAll("{:"+n+"}",s)}return t}getFileUrl(t,r,n={}){return this.files.getUrl(t,r,n)}buildUrl(t){var n;let r=this.baseUrl;return typeof window>"u"||!window.location||r.startsWith("https://")||r.startsWith("http://")||(r=(n=window.location.origin)!=null&&n.endsWith("/")?window.location.origin.substring(0,window.location.origin.length-1):window.location.origin||"",this.baseUrl.startsWith("/")||(r+=window.location.pathname||"/",r+=r.endsWith("/")?"":"/"),r+=this.baseUrl),t&&(r+=r.endsWith("/")?"":"/",r+=t.startsWith("/")?t.substring(1):t),r}async send(t,r){r=this.initSendOptions(t,r);let n=this.buildUrl(t);if(this.beforeSend){const s=Object.assign({},await this.beforeSend(n,r));s.url!==void 0||s.options!==void 0?(n=s.url||n,r=s.options||r):Object.keys(s).length&&(r=s,console!=null&&console.warn&&console.warn("Deprecated format of beforeSend return: please use `return { url, options }`, instead of `return options`."))}if(r.query!==void 0){const s=this.serializeQueryParams(r.query);s&&(n+=(n.includes("?")?"&":"?")+s),delete r.query}return this.getHeader(r.headers,"Content-Type")=="application/json"&&r.body&&typeof r.body!="string"&&(r.body=JSON.stringify(r.body)),(r.fetch||fetch)(n,r).then(async s=>{let o={};try{o=await s.json()}catch{}if(this.afterSend&&(o=await this.afterSend(s,o)),s.status>=400)throw new Br({url:s.url,status:s.status,data:o});return o}).catch(s=>{throw new Br(s)})}initSendOptions(t,r){if((r=Object.assign({method:"GET"},r)).body=this.convertToFormDataIfNeeded(r.body),vk(r),r.query=Object.assign({},r.params,r.query),r.requestKey===void 0&&(r.$autoCancel===!1||r.query.$autoCancel===!1?r.requestKey=null:(r.$cancelKey||r.query.$cancelKey)&&(r.requestKey=r.$cancelKey||r.query.$cancelKey)),delete r.$autoCancel,delete r.query.$autoCancel,delete r.$cancelKey,delete r.query.$cancelKey,this.getHeader(r.headers,"Content-Type")!==null||this.isFormData(r.body)||(r.headers=Object.assign({},r.headers,{"Content-Type":"application/json"})),this.getHeader(r.headers,"Accept-Language")===null&&(r.headers=Object.assign({},r.headers,{"Accept-Language":this.lang})),this.authStore.token&&this.getHeader(r.headers,"Authorization")===null&&(r.headers=Object.assign({},r.headers,{Authorization:this.authStore.token})),this.enableAutoCancellation&&r.requestKey!==null){const n=r.requestKey||(r.method||"GET")+t;delete r.requestKey,this.cancelRequest(n);const s=new AbortController;this.cancelControllers[n]=s,r.signal=s.signal}return r}convertToFormDataIfNeeded(t){if(typeof FormData>"u"||t===void 0||typeof t!="object"||t===null||this.isFormData(t)||!this.hasBlobField(t))return t;const r=new FormData;for(const n in t){const s=t[n];if(typeof s!="object"||this.hasBlobField({data:s})){const o=Array.isArray(s)?s:[s];for(let i of o)r.append(n,i)}else{let o={};o[n]=s,r.append("@jsonPayload",JSON.stringify(o))}}return r}hasBlobField(t){for(const r in t){const n=Array.isArray(t[r])?t[r]:[t[r]];for(const s of n)if(typeof Blob<"u"&&s instanceof Blob||typeof File<"u"&&s instanceof File)return!0}return!1}getHeader(t,r){t=t||{},r=r.toLowerCase();for(let n in t)if(n.toLowerCase()==r)return t[n];return null}isFormData(t){return t&&(t.constructor.name==="FormData"||typeof FormData<"u"&&t instanceof FormData)}serializeQueryParams(t){const r=[];for(const n in t){if(t[n]===null)continue;const s=t[n],o=encodeURIComponent(n);if(Array.isArray(s))for(const i of s)r.push(o+"="+encodeURIComponent(i));else s instanceof Date?r.push(o+"="+encodeURIComponent(s.toISOString())):typeof s!==null&&typeof s=="object"?r.push(o+"="+encodeURIComponent(JSON.stringify(s))):r.push(o+"="+encodeURIComponent(s))}return r.join("&")}}var IL={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};const LL=IL.VITE_API_DOMAIN;console.log(LL);let _u;const st=()=>_u||(_u=new ML("/"),_u);//! moment.js //! version : 2.30.1 //! authors : Tim Wood, Iskren Chernev, Moment.js contributors //! license : MIT //! momentjs.com -var xk;function ve(){return xk.apply(null,arguments)}function FL(e){xk=e}function Cn(e){return e instanceof Array||Object.prototype.toString.call(e)==="[object Array]"}function Zo(e){return e!=null&&Object.prototype.toString.call(e)==="[object Object]"}function ct(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Ev(e){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(e).length===0;var t;for(t in e)if(ct(e,t))return!1;return!0}function kr(e){return e===void 0}function Cs(e){return typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]"}function Dc(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function wk(e,t){var r=[],n,s=e.length;for(n=0;n>>0,n;for(n=0;n0)for(r=0;r>>0,n;for(n=0;n0)for(r=0;r=0;return(o?r?"+":"":"-")+Math.pow(10,Math.max(0,s)).toString().substr(1)+n}var Pv=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,bu=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,qh={},na={};function Ie(e,t,r,n){var s=n;typeof n=="string"&&(s=function(){return this[n]()}),e&&(na[e]=s),t&&(na[t[0]]=function(){return Yn(s.apply(this,arguments),t[1],t[2])}),r&&(na[r]=function(){return this.localeData().ordinal(s.apply(this,arguments),e)})}function BL(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function WL(e){var t=e.match(Pv),r,n;for(r=0,n=t.length;r=0&&bu.test(e);)e=e.replace(bu,n),bu.lastIndex=0,r-=1;return e}var HL={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function YL(e){var t=this._longDateFormat[e],r=this._longDateFormat[e.toUpperCase()];return t||!r?t:(this._longDateFormat[e]=r.match(Pv).map(function(n){return n==="MMMM"||n==="MM"||n==="DD"||n==="dddd"?n.slice(1):n}).join(""),this._longDateFormat[e])}var KL="Invalid date";function GL(){return this._invalidDate}var ZL="%d",qL=/\d{1,2}/;function XL(e){return this._ordinal.replace("%d",e)}var QL={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function JL(e,t,r,n){var s=this._relativeTime[r];return qn(s)?s(e,t,r,n):s.replace(/%d/i,e)}function e4(e,t){var r=this._relativeTime[e>0?"future":"past"];return qn(r)?r(t):r.replace(/%s/i,t)}var iw={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function ln(e){return typeof e=="string"?iw[e]||iw[e.toLowerCase()]:void 0}function Av(e){var t={},r,n;for(n in e)ct(e,n)&&(r=ln(n),r&&(t[r]=e[n]));return t}var t4={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function r4(e){var t=[],r;for(r in e)ct(e,r)&&t.push({unit:r,priority:t4[r]});return t.sort(function(n,s){return n.priority-s.priority}),t}var kk=/\d/,Gr=/\d\d/,Ck=/\d{3}/,Dv=/\d{4}/,Af=/[+-]?\d{6}/,Ct=/\d\d?/,jk=/\d\d\d\d?/,Ek=/\d\d\d\d\d\d?/,Df=/\d{1,3}/,Ov=/\d{1,4}/,Of=/[+-]?\d{1,6}/,Oa=/\d+/,Mf=/[+-]?\d+/,n4=/Z|[+-]\d\d:?\d\d/gi,If=/Z|[+-]\d\d(?::?\d\d)?/gi,s4=/[+-]?\d+(\.\d{1,3})?/,Mc=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Ma=/^[1-9]\d?/,Mv=/^([1-9]\d|\d)/,Rd;Rd={};function be(e,t,r){Rd[e]=qn(t)?t:function(n,s){return n&&r?r:t}}function o4(e,t){return ct(Rd,e)?Rd[e](t._strict,t._locale):new RegExp(i4(e))}function i4(e){return gs(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,r,n,s,o){return r||n||s||o}))}function gs(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function en(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function rt(e){var t=+e,r=0;return t!==0&&isFinite(t)&&(r=en(t)),r}var pm={};function vt(e,t){var r,n=t,s;for(typeof e=="string"&&(e=[e]),Cs(t)&&(n=function(o,i){i[t]=rt(o)}),s=e.length,r=0;r68?1900:2e3)};var Nk=Ia("FullYear",!0);function u4(){return Lf(this.year())}function Ia(e,t){return function(r){return r!=null?(Tk(this,e,r),ve.updateOffset(this,t),this):Jl(this,e)}}function Jl(e,t){if(!e.isValid())return NaN;var r=e._d,n=e._isUTC;switch(t){case"Milliseconds":return n?r.getUTCMilliseconds():r.getMilliseconds();case"Seconds":return n?r.getUTCSeconds():r.getSeconds();case"Minutes":return n?r.getUTCMinutes():r.getMinutes();case"Hours":return n?r.getUTCHours():r.getHours();case"Date":return n?r.getUTCDate():r.getDate();case"Day":return n?r.getUTCDay():r.getDay();case"Month":return n?r.getUTCMonth():r.getMonth();case"FullYear":return n?r.getUTCFullYear():r.getFullYear();default:return NaN}}function Tk(e,t,r){var n,s,o,i,a;if(!(!e.isValid()||isNaN(r))){switch(n=e._d,s=e._isUTC,t){case"Milliseconds":return void(s?n.setUTCMilliseconds(r):n.setMilliseconds(r));case"Seconds":return void(s?n.setUTCSeconds(r):n.setSeconds(r));case"Minutes":return void(s?n.setUTCMinutes(r):n.setMinutes(r));case"Hours":return void(s?n.setUTCHours(r):n.setHours(r));case"Date":return void(s?n.setUTCDate(r):n.setDate(r));case"FullYear":break;default:return}o=r,i=e.month(),a=e.date(),a=a===29&&i===1&&!Lf(o)?28:a,s?n.setUTCFullYear(o,i,a):n.setFullYear(o,i,a)}}function d4(e){return e=ln(e),qn(this[e])?this[e]():this}function f4(e,t){if(typeof e=="object"){e=Av(e);var r=r4(e),n,s=r.length;for(n=0;n=0?(a=new Date(e+400,t,r,n,s,o,i),isFinite(a.getFullYear())&&a.setFullYear(e)):a=new Date(e,t,r,n,s,o,i),a}function ec(e){var t,r;return e<100&&e>=0?(r=Array.prototype.slice.call(arguments),r[0]=e+400,t=new Date(Date.UTC.apply(null,r)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function Pd(e,t,r){var n=7+t-r,s=(7+ec(e,0,n).getUTCDay()-t)%7;return-s+n-1}function Mk(e,t,r,n,s){var o=(7+r-n)%7,i=Pd(e,n,s),a=1+7*(t-1)+o+i,c,u;return a<=0?(c=e-1,u=kl(c)+a):a>kl(e)?(c=e+1,u=a-kl(e)):(c=e,u=a),{year:c,dayOfYear:u}}function tc(e,t,r){var n=Pd(e.year(),t,r),s=Math.floor((e.dayOfYear()-n-1)/7)+1,o,i;return s<1?(i=e.year()-1,o=s+vs(i,t,r)):s>vs(e.year(),t,r)?(o=s-vs(e.year(),t,r),i=e.year()+1):(i=e.year(),o=s),{week:o,year:i}}function vs(e,t,r){var n=Pd(e,t,r),s=Pd(e+1,t,r);return(kl(e)-n+s)/7}Ie("w",["ww",2],"wo","week");Ie("W",["WW",2],"Wo","isoWeek");be("w",Ct,Ma);be("ww",Ct,Gr);be("W",Ct,Ma);be("WW",Ct,Gr);Ic(["w","ww","W","WW"],function(e,t,r,n){t[n.substr(0,1)]=rt(e)});function C4(e){return tc(e,this._week.dow,this._week.doy).week}var j4={dow:0,doy:6};function E4(){return this._week.dow}function N4(){return this._week.doy}function T4(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,"d")}function R4(e){var t=tc(this,1,4).week;return e==null?t:this.add((e-t)*7,"d")}Ie("d",0,"do","day");Ie("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)});Ie("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)});Ie("dddd",0,0,function(e){return this.localeData().weekdays(this,e)});Ie("e",0,0,"weekday");Ie("E",0,0,"isoWeekday");be("d",Ct);be("e",Ct);be("E",Ct);be("dd",function(e,t){return t.weekdaysMinRegex(e)});be("ddd",function(e,t){return t.weekdaysShortRegex(e)});be("dddd",function(e,t){return t.weekdaysRegex(e)});Ic(["dd","ddd","dddd"],function(e,t,r,n){var s=r._locale.weekdaysParse(e,n,r._strict);s!=null?t.d=s:Xe(r).invalidWeekday=e});Ic(["d","e","E"],function(e,t,r,n){t[n]=rt(e)});function P4(e,t){return typeof e!="string"?e:isNaN(e)?(e=t.weekdaysParse(e),typeof e=="number"?e:null):parseInt(e,10)}function A4(e,t){return typeof e=="string"?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function Lv(e,t){return e.slice(t,7).concat(e.slice(0,t))}var D4="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Ik="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),O4="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),M4=Mc,I4=Mc,L4=Mc;function F4(e,t){var r=Cn(this._weekdays)?this._weekdays:this._weekdays[e&&e!==!0&&this._weekdays.isFormat.test(t)?"format":"standalone"];return e===!0?Lv(r,this._week.dow):e?r[e.day()]:r}function z4(e){return e===!0?Lv(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function U4(e){return e===!0?Lv(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function $4(e,t,r){var n,s,o,i=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)o=Zn([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(o,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(o,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(o,"").toLocaleLowerCase();return r?t==="dddd"?(s=zt.call(this._weekdaysParse,i),s!==-1?s:null):t==="ddd"?(s=zt.call(this._shortWeekdaysParse,i),s!==-1?s:null):(s=zt.call(this._minWeekdaysParse,i),s!==-1?s:null):t==="dddd"?(s=zt.call(this._weekdaysParse,i),s!==-1||(s=zt.call(this._shortWeekdaysParse,i),s!==-1)?s:(s=zt.call(this._minWeekdaysParse,i),s!==-1?s:null)):t==="ddd"?(s=zt.call(this._shortWeekdaysParse,i),s!==-1||(s=zt.call(this._weekdaysParse,i),s!==-1)?s:(s=zt.call(this._minWeekdaysParse,i),s!==-1?s:null)):(s=zt.call(this._minWeekdaysParse,i),s!==-1||(s=zt.call(this._weekdaysParse,i),s!==-1)?s:(s=zt.call(this._shortWeekdaysParse,i),s!==-1?s:null))}function V4(e,t,r){var n,s,o;if(this._weekdaysParseExact)return $4.call(this,e,t,r);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(s=Zn([2e3,1]).day(n),r&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(s,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(s,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(s,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(o="^"+this.weekdays(s,"")+"|^"+this.weekdaysShort(s,"")+"|^"+this.weekdaysMin(s,""),this._weekdaysParse[n]=new RegExp(o.replace(".",""),"i")),r&&t==="dddd"&&this._fullWeekdaysParse[n].test(e))return n;if(r&&t==="ddd"&&this._shortWeekdaysParse[n].test(e))return n;if(r&&t==="dd"&&this._minWeekdaysParse[n].test(e))return n;if(!r&&this._weekdaysParse[n].test(e))return n}}function B4(e){if(!this.isValid())return e!=null?this:NaN;var t=Jl(this,"Day");return e!=null?(e=P4(e,this.localeData()),this.add(e-t,"d")):t}function W4(e){if(!this.isValid())return e!=null?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return e==null?t:this.add(e-t,"d")}function H4(e){if(!this.isValid())return e!=null?this:NaN;if(e!=null){var t=A4(e,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function Y4(e){return this._weekdaysParseExact?(ct(this,"_weekdaysRegex")||Fv.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(ct(this,"_weekdaysRegex")||(this._weekdaysRegex=M4),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function K4(e){return this._weekdaysParseExact?(ct(this,"_weekdaysRegex")||Fv.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(ct(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=I4),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function G4(e){return this._weekdaysParseExact?(ct(this,"_weekdaysRegex")||Fv.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(ct(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=L4),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Fv(){function e(d,f){return f.length-d.length}var t=[],r=[],n=[],s=[],o,i,a,c,u;for(o=0;o<7;o++)i=Zn([2e3,1]).day(o),a=gs(this.weekdaysMin(i,"")),c=gs(this.weekdaysShort(i,"")),u=gs(this.weekdays(i,"")),t.push(a),r.push(c),n.push(u),s.push(a),s.push(c),s.push(u);t.sort(e),r.sort(e),n.sort(e),s.sort(e),this._weekdaysRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+t.join("|")+")","i")}function zv(){return this.hours()%12||12}function Z4(){return this.hours()||24}Ie("H",["HH",2],0,"hour");Ie("h",["hh",2],0,zv);Ie("k",["kk",2],0,Z4);Ie("hmm",0,0,function(){return""+zv.apply(this)+Yn(this.minutes(),2)});Ie("hmmss",0,0,function(){return""+zv.apply(this)+Yn(this.minutes(),2)+Yn(this.seconds(),2)});Ie("Hmm",0,0,function(){return""+this.hours()+Yn(this.minutes(),2)});Ie("Hmmss",0,0,function(){return""+this.hours()+Yn(this.minutes(),2)+Yn(this.seconds(),2)});function Lk(e,t){Ie(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}Lk("a",!0);Lk("A",!1);function Fk(e,t){return t._meridiemParse}be("a",Fk);be("A",Fk);be("H",Ct,Mv);be("h",Ct,Ma);be("k",Ct,Ma);be("HH",Ct,Gr);be("hh",Ct,Gr);be("kk",Ct,Gr);be("hmm",jk);be("hmmss",Ek);be("Hmm",jk);be("Hmmss",Ek);vt(["H","HH"],Zt);vt(["k","kk"],function(e,t,r){var n=rt(e);t[Zt]=n===24?0:n});vt(["a","A"],function(e,t,r){r._isPm=r._locale.isPM(e),r._meridiem=e});vt(["h","hh"],function(e,t,r){t[Zt]=rt(e),Xe(r).bigHour=!0});vt("hmm",function(e,t,r){var n=e.length-2;t[Zt]=rt(e.substr(0,n)),t[vn]=rt(e.substr(n)),Xe(r).bigHour=!0});vt("hmmss",function(e,t,r){var n=e.length-4,s=e.length-2;t[Zt]=rt(e.substr(0,n)),t[vn]=rt(e.substr(n,2)),t[hs]=rt(e.substr(s)),Xe(r).bigHour=!0});vt("Hmm",function(e,t,r){var n=e.length-2;t[Zt]=rt(e.substr(0,n)),t[vn]=rt(e.substr(n))});vt("Hmmss",function(e,t,r){var n=e.length-4,s=e.length-2;t[Zt]=rt(e.substr(0,n)),t[vn]=rt(e.substr(n,2)),t[hs]=rt(e.substr(s))});function q4(e){return(e+"").toLowerCase().charAt(0)==="p"}var X4=/[ap]\.?m?\.?/i,Q4=Ia("Hours",!0);function J4(e,t,r){return e>11?r?"pm":"PM":r?"am":"AM"}var zk={calendar:$L,longDateFormat:HL,invalidDate:KL,ordinal:ZL,dayOfMonthOrdinalParse:qL,relativeTime:QL,months:p4,monthsShort:Rk,week:j4,weekdays:D4,weekdaysMin:O4,weekdaysShort:Ik,meridiemParse:X4},Nt={},Ja={},rc;function e5(e,t){var r,n=Math.min(e.length,t.length);for(r=0;r0;){if(s=Ff(o.slice(0,r).join("-")),s)return s;if(n&&n.length>=r&&e5(o,n)>=r-1)break;r--}t++}return rc}function r5(e){return!!(e&&e.match("^[^/\\\\]*$"))}function Ff(e){var t=null,r;if(Nt[e]===void 0&&typeof qu<"u"&&qu&&qu.exports&&r5(e))try{t=rc._abbr,r=require,r("./locale/"+e),uo(t)}catch{Nt[e]=null}return Nt[e]}function uo(e,t){var r;return e&&(kr(t)?r=Ds(e):r=Uv(e,t),r?rc=r:typeof console<"u"&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),rc._abbr}function Uv(e,t){if(t!==null){var r,n=zk;if(t.abbr=e,Nt[e]!=null)bk("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=Nt[e]._config;else if(t.parentLocale!=null)if(Nt[t.parentLocale]!=null)n=Nt[t.parentLocale]._config;else if(r=Ff(t.parentLocale),r!=null)n=r._config;else return Ja[t.parentLocale]||(Ja[t.parentLocale]=[]),Ja[t.parentLocale].push({name:e,config:t}),null;return Nt[e]=new Rv(fm(n,t)),Ja[e]&&Ja[e].forEach(function(s){Uv(s.name,s.config)}),uo(e),Nt[e]}else return delete Nt[e],null}function n5(e,t){if(t!=null){var r,n,s=zk;Nt[e]!=null&&Nt[e].parentLocale!=null?Nt[e].set(fm(Nt[e]._config,t)):(n=Ff(e),n!=null&&(s=n._config),t=fm(s,t),n==null&&(t.abbr=e),r=new Rv(t),r.parentLocale=Nt[e],Nt[e]=r),uo(e)}else Nt[e]!=null&&(Nt[e].parentLocale!=null?(Nt[e]=Nt[e].parentLocale,e===uo()&&uo(e)):Nt[e]!=null&&delete Nt[e]);return Nt[e]}function Ds(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return rc;if(!Cn(e)){if(t=Ff(e),t)return t;e=[e]}return t5(e)}function s5(){return hm(Nt)}function $v(e){var t,r=e._a;return r&&Xe(e).overflow===-2&&(t=r[fs]<0||r[fs]>11?fs:r[Fn]<1||r[Fn]>Iv(r[cr],r[fs])?Fn:r[Zt]<0||r[Zt]>24||r[Zt]===24&&(r[vn]!==0||r[hs]!==0||r[Wo]!==0)?Zt:r[vn]<0||r[vn]>59?vn:r[hs]<0||r[hs]>59?hs:r[Wo]<0||r[Wo]>999?Wo:-1,Xe(e)._overflowDayOfYear&&(tFn)&&(t=Fn),Xe(e)._overflowWeeks&&t===-1&&(t=l4),Xe(e)._overflowWeekday&&t===-1&&(t=c4),Xe(e).overflow=t),e}var o5=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,i5=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,a5=/Z|[+-]\d\d(?::?\d\d)?/,Su=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Xh=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],l5=/^\/?Date\((-?\d+)/i,c5=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,u5={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Uk(e){var t,r,n=e._i,s=o5.exec(n)||i5.exec(n),o,i,a,c,u=Su.length,d=Xh.length;if(s){for(Xe(e).iso=!0,t=0,r=u;tkl(i)||e._dayOfYear===0)&&(Xe(e)._overflowDayOfYear=!0),r=ec(i,0,e._dayOfYear),e._a[fs]=r.getUTCMonth(),e._a[Fn]=r.getUTCDate()),t=0;t<3&&e._a[t]==null;++t)e._a[t]=n[t]=s[t];for(;t<7;t++)e._a[t]=n[t]=e._a[t]==null?t===2?1:0:e._a[t];e._a[Zt]===24&&e._a[vn]===0&&e._a[hs]===0&&e._a[Wo]===0&&(e._nextDay=!0,e._a[Zt]=0),e._d=(e._useUTC?ec:k4).apply(null,n),o=e._useUTC?e._d.getUTCDay():e._d.getDay(),e._tzm!=null&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[Zt]=24),e._w&&typeof e._w.d<"u"&&e._w.d!==o&&(Xe(e).weekdayMismatch=!0)}}function y5(e){var t,r,n,s,o,i,a,c,u;t=e._w,t.GG!=null||t.W!=null||t.E!=null?(o=1,i=4,r=Ni(t.GG,e._a[cr],tc(kt(),1,4).year),n=Ni(t.W,1),s=Ni(t.E,1),(s<1||s>7)&&(c=!0)):(o=e._locale._week.dow,i=e._locale._week.doy,u=tc(kt(),o,i),r=Ni(t.gg,e._a[cr],u.year),n=Ni(t.w,u.week),t.d!=null?(s=t.d,(s<0||s>6)&&(c=!0)):t.e!=null?(s=t.e+o,(t.e<0||t.e>6)&&(c=!0)):s=o),n<1||n>vs(r,o,i)?Xe(e)._overflowWeeks=!0:c!=null?Xe(e)._overflowWeekday=!0:(a=Mk(r,n,s,o,i),e._a[cr]=a.year,e._dayOfYear=a.dayOfYear)}ve.ISO_8601=function(){};ve.RFC_2822=function(){};function Bv(e){if(e._f===ve.ISO_8601){Uk(e);return}if(e._f===ve.RFC_2822){$k(e);return}e._a=[],Xe(e).empty=!0;var t=""+e._i,r,n,s,o,i,a=t.length,c=0,u,d;for(s=Sk(e._f,e._locale).match(Pv)||[],d=s.length,r=0;r0&&Xe(e).unusedInput.push(i),t=t.slice(t.indexOf(n)+n.length),c+=n.length),na[o]?(n?Xe(e).empty=!1:Xe(e).unusedTokens.push(o),a4(o,n,e)):e._strict&&!n&&Xe(e).unusedTokens.push(o);Xe(e).charsLeftOver=a-c,t.length>0&&Xe(e).unusedInput.push(t),e._a[Zt]<=12&&Xe(e).bigHour===!0&&e._a[Zt]>0&&(Xe(e).bigHour=void 0),Xe(e).parsedDateParts=e._a.slice(0),Xe(e).meridiem=e._meridiem,e._a[Zt]=x5(e._locale,e._a[Zt],e._meridiem),u=Xe(e).era,u!==null&&(e._a[cr]=e._locale.erasConvertYear(u,e._a[cr])),Vv(e),$v(e)}function x5(e,t,r){var n;return r==null?t:e.meridiemHour!=null?e.meridiemHour(t,r):(e.isPM!=null&&(n=e.isPM(r),n&&t<12&&(t+=12),!n&&t===12&&(t=0)),t)}function w5(e){var t,r,n,s,o,i,a=!1,c=e._f.length;if(c===0){Xe(e).invalidFormat=!0,e._d=new Date(NaN);return}for(s=0;sthis?this:e:Pf()});function Wk(e,t){var r,n;if(t.length===1&&Cn(t[0])&&(t=t[0]),!t.length)return kt();for(r=t[0],n=1;nthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function $5(){if(!kr(this._isDSTShifted))return this._isDSTShifted;var e={},t;return Tv(e,this),e=Vk(e),e._a?(t=e._isUTC?Zn(e._a):kt(e._a),this._isDSTShifted=this.isValid()&&A5(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function V5(){return this.isValid()?!this._isUTC:!1}function B5(){return this.isValid()?this._isUTC:!1}function Yk(){return this.isValid()?this._isUTC&&this._offset===0:!1}var W5=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,H5=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Rn(e,t){var r=e,n=null,s,o,i;return Hu(e)?r={ms:e._milliseconds,d:e._days,M:e._months}:Cs(e)||!isNaN(+e)?(r={},t?r[t]=+e:r.milliseconds=+e):(n=W5.exec(e))?(s=n[1]==="-"?-1:1,r={y:0,d:rt(n[Fn])*s,h:rt(n[Zt])*s,m:rt(n[vn])*s,s:rt(n[hs])*s,ms:rt(mm(n[Wo]*1e3))*s}):(n=H5.exec(e))?(s=n[1]==="-"?-1:1,r={y:Ao(n[2],s),M:Ao(n[3],s),w:Ao(n[4],s),d:Ao(n[5],s),h:Ao(n[6],s),m:Ao(n[7],s),s:Ao(n[8],s)}):r==null?r={}:typeof r=="object"&&("from"in r||"to"in r)&&(i=Y5(kt(r.from),kt(r.to)),r={},r.ms=i.milliseconds,r.M=i.months),o=new zf(r),Hu(e)&&ct(e,"_locale")&&(o._locale=e._locale),Hu(e)&&ct(e,"_isValid")&&(o._isValid=e._isValid),o}Rn.fn=zf.prototype;Rn.invalid=P5;function Ao(e,t){var r=e&&parseFloat(e.replace(",","."));return(isNaN(r)?0:r)*t}function lw(e,t){var r={};return r.months=t.month()-e.month()+(t.year()-e.year())*12,e.clone().add(r.months,"M").isAfter(t)&&--r.months,r.milliseconds=+t-+e.clone().add(r.months,"M"),r}function Y5(e,t){var r;return e.isValid()&&t.isValid()?(t=Hv(t,e),e.isBefore(t)?r=lw(e,t):(r=lw(t,e),r.milliseconds=-r.milliseconds,r.months=-r.months),r):{milliseconds:0,months:0}}function Kk(e,t){return function(r,n){var s,o;return n!==null&&!isNaN(+n)&&(bk(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),o=r,r=n,n=o),s=Rn(r,n),Gk(this,s,e),this}}function Gk(e,t,r,n){var s=t._milliseconds,o=mm(t._days),i=mm(t._months);e.isValid()&&(n=n??!0,i&&Ak(e,Jl(e,"Month")+i*r),o&&Tk(e,"Date",Jl(e,"Date")+o*r),s&&e._d.setTime(e._d.valueOf()+s*r),n&&ve.updateOffset(e,o||i))}var K5=Kk(1,"add"),G5=Kk(-1,"subtract");function Zk(e){return typeof e=="string"||e instanceof String}function Z5(e){return jn(e)||Dc(e)||Zk(e)||Cs(e)||X5(e)||q5(e)||e===null||e===void 0}function q5(e){var t=Zo(e)&&!Ev(e),r=!1,n=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],s,o,i=n.length;for(s=0;sr.valueOf():r.valueOf()9999?Wu(r,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):qn(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Wu(r,"Z")):Wu(r,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function dF(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="",r,n,s,o;return this.isLocal()||(e=this.utcOffset()===0?"moment.utc":"moment.parseZone",t="Z"),r="["+e+'("]',n=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",s="-MM-DD[T]HH:mm:ss.SSS",o=t+'[")]',this.format(r+n+s+o)}function fF(e){e||(e=this.isUtc()?ve.defaultFormatUtc:ve.defaultFormat);var t=Wu(this,e);return this.localeData().postformat(t)}function hF(e,t){return this.isValid()&&(jn(e)&&e.isValid()||kt(e).isValid())?Rn({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function pF(e){return this.from(kt(),e)}function mF(e,t){return this.isValid()&&(jn(e)&&e.isValid()||kt(e).isValid())?Rn({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function gF(e){return this.to(kt(),e)}function qk(e){var t;return e===void 0?this._locale._abbr:(t=Ds(e),t!=null&&(this._locale=t),this)}var Xk=an("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return e===void 0?this.localeData():this.locale(e)});function Qk(){return this._locale}var Ad=1e3,sa=60*Ad,Dd=60*sa,Jk=(365*400+97)*24*Dd;function oa(e,t){return(e%t+t)%t}function eC(e,t,r){return e<100&&e>=0?new Date(e+400,t,r)-Jk:new Date(e,t,r).valueOf()}function tC(e,t,r){return e<100&&e>=0?Date.UTC(e+400,t,r)-Jk:Date.UTC(e,t,r)}function vF(e){var t,r;if(e=ln(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(r=this._isUTC?tC:eC,e){case"year":t=r(this.year(),0,1);break;case"quarter":t=r(this.year(),this.month()-this.month()%3,1);break;case"month":t=r(this.year(),this.month(),1);break;case"week":t=r(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=r(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=oa(t+(this._isUTC?0:this.utcOffset()*sa),Dd);break;case"minute":t=this._d.valueOf(),t-=oa(t,sa);break;case"second":t=this._d.valueOf(),t-=oa(t,Ad);break}return this._d.setTime(t),ve.updateOffset(this,!0),this}function yF(e){var t,r;if(e=ln(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(r=this._isUTC?tC:eC,e){case"year":t=r(this.year()+1,0,1)-1;break;case"quarter":t=r(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=r(this.year(),this.month()+1,1)-1;break;case"week":t=r(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=r(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=Dd-oa(t+(this._isUTC?0:this.utcOffset()*sa),Dd)-1;break;case"minute":t=this._d.valueOf(),t+=sa-oa(t,sa)-1;break;case"second":t=this._d.valueOf(),t+=Ad-oa(t,Ad)-1;break}return this._d.setTime(t),ve.updateOffset(this,!0),this}function xF(){return this._d.valueOf()-(this._offset||0)*6e4}function wF(){return Math.floor(this.valueOf()/1e3)}function _F(){return new Date(this.valueOf())}function bF(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function SF(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function kF(){return this.isValid()?this.toISOString():null}function CF(){return Nv(this)}function jF(){return Js({},Xe(this))}function EF(){return Xe(this).overflow}function NF(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}Ie("N",0,0,"eraAbbr");Ie("NN",0,0,"eraAbbr");Ie("NNN",0,0,"eraAbbr");Ie("NNNN",0,0,"eraName");Ie("NNNNN",0,0,"eraNarrow");Ie("y",["y",1],"yo","eraYear");Ie("y",["yy",2],0,"eraYear");Ie("y",["yyy",3],0,"eraYear");Ie("y",["yyyy",4],0,"eraYear");be("N",Yv);be("NN",Yv);be("NNN",Yv);be("NNNN",zF);be("NNNNN",UF);vt(["N","NN","NNN","NNNN","NNNNN"],function(e,t,r,n){var s=r._locale.erasParse(e,n,r._strict);s?Xe(r).era=s:Xe(r).invalidEra=e});be("y",Oa);be("yy",Oa);be("yyy",Oa);be("yyyy",Oa);be("yo",$F);vt(["y","yy","yyy","yyyy"],cr);vt(["yo"],function(e,t,r,n){var s;r._locale._eraYearOrdinalRegex&&(s=e.match(r._locale._eraYearOrdinalRegex)),r._locale.eraYearOrdinalParse?t[cr]=r._locale.eraYearOrdinalParse(e,s):t[cr]=parseInt(e,10)});function TF(e,t){var r,n,s,o=this._eras||Ds("en")._eras;for(r=0,n=o.length;r=0)return o[n]}function PF(e,t){var r=e.since<=e.until?1:-1;return t===void 0?ve(e.since).year():ve(e.since).year()+(t-e.offset)*r}function AF(){var e,t,r,n=this.localeData().eras();for(e=0,t=n.length;eo&&(t=o),GF.call(this,e,t,r,n,s))}function GF(e,t,r,n,s){var o=Mk(e,t,r,n,s),i=ec(o.year,0,o.dayOfYear);return this.year(i.getUTCFullYear()),this.month(i.getUTCMonth()),this.date(i.getUTCDate()),this}Ie("Q",0,"Qo","quarter");be("Q",kk);vt("Q",function(e,t){t[fs]=(rt(e)-1)*3});function ZF(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}Ie("D",["DD",2],"Do","date");be("D",Ct,Ma);be("DD",Ct,Gr);be("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient});vt(["D","DD"],Fn);vt("Do",function(e,t){t[Fn]=rt(e.match(Ct)[0])});var nC=Ia("Date",!0);Ie("DDD",["DDDD",3],"DDDo","dayOfYear");be("DDD",Df);be("DDDD",Ck);vt(["DDD","DDDD"],function(e,t,r){r._dayOfYear=rt(e)});function qF(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return e==null?t:this.add(e-t,"d")}Ie("m",["mm",2],0,"minute");be("m",Ct,Mv);be("mm",Ct,Gr);vt(["m","mm"],vn);var XF=Ia("Minutes",!1);Ie("s",["ss",2],0,"second");be("s",Ct,Mv);be("ss",Ct,Gr);vt(["s","ss"],hs);var QF=Ia("Seconds",!1);Ie("S",0,0,function(){return~~(this.millisecond()/100)});Ie(0,["SS",2],0,function(){return~~(this.millisecond()/10)});Ie(0,["SSS",3],0,"millisecond");Ie(0,["SSSS",4],0,function(){return this.millisecond()*10});Ie(0,["SSSSS",5],0,function(){return this.millisecond()*100});Ie(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3});Ie(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4});Ie(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5});Ie(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6});be("S",Df,kk);be("SS",Df,Gr);be("SSS",Df,Ck);var eo,sC;for(eo="SSSS";eo.length<=9;eo+="S")be(eo,Oa);function JF(e,t){t[Wo]=rt(("0."+e)*1e3)}for(eo="S";eo.length<=9;eo+="S")vt(eo,JF);sC=Ia("Milliseconds",!1);Ie("z",0,0,"zoneAbbr");Ie("zz",0,0,"zoneName");function e3(){return this._isUTC?"UTC":""}function t3(){return this._isUTC?"Coordinated Universal Time":""}var le=Oc.prototype;le.add=K5;le.calendar=eF;le.clone=tF;le.diff=lF;le.endOf=yF;le.format=fF;le.from=hF;le.fromNow=pF;le.to=mF;le.toNow=gF;le.get=d4;le.invalidAt=EF;le.isAfter=rF;le.isBefore=nF;le.isBetween=sF;le.isSame=oF;le.isSameOrAfter=iF;le.isSameOrBefore=aF;le.isValid=CF;le.lang=Xk;le.locale=qk;le.localeData=Qk;le.max=C5;le.min=k5;le.parsingFlags=jF;le.set=f4;le.startOf=vF;le.subtract=G5;le.toArray=bF;le.toObject=SF;le.toDate=_F;le.toISOString=uF;le.inspect=dF;typeof Symbol<"u"&&Symbol.for!=null&&(le[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"});le.toJSON=kF;le.toString=cF;le.unix=wF;le.valueOf=xF;le.creationData=NF;le.eraName=AF;le.eraNarrow=DF;le.eraAbbr=OF;le.eraYear=MF;le.year=Nk;le.isLeapYear=u4;le.weekYear=VF;le.isoWeekYear=BF;le.quarter=le.quarters=ZF;le.month=Dk;le.daysInMonth=_4;le.week=le.weeks=T4;le.isoWeek=le.isoWeeks=R4;le.weeksInYear=YF;le.weeksInWeekYear=KF;le.isoWeeksInYear=WF;le.isoWeeksInISOWeekYear=HF;le.date=nC;le.day=le.days=B4;le.weekday=W4;le.isoWeekday=H4;le.dayOfYear=qF;le.hour=le.hours=Q4;le.minute=le.minutes=XF;le.second=le.seconds=QF;le.millisecond=le.milliseconds=sC;le.utcOffset=O5;le.utc=I5;le.local=L5;le.parseZone=F5;le.hasAlignedHourOffset=z5;le.isDST=U5;le.isLocal=V5;le.isUtcOffset=B5;le.isUtc=Yk;le.isUTC=Yk;le.zoneAbbr=e3;le.zoneName=t3;le.dates=an("dates accessor is deprecated. Use date instead.",nC);le.months=an("months accessor is deprecated. Use month instead",Dk);le.years=an("years accessor is deprecated. Use year instead",Nk);le.zone=an("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",M5);le.isDSTShifted=an("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",$5);function r3(e){return kt(e*1e3)}function n3(){return kt.apply(null,arguments).parseZone()}function oC(e){return e}var ut=Rv.prototype;ut.calendar=VL;ut.longDateFormat=YL;ut.invalidDate=GL;ut.ordinal=XL;ut.preparse=oC;ut.postformat=oC;ut.relativeTime=JL;ut.pastFuture=e4;ut.set=UL;ut.eras=TF;ut.erasParse=RF;ut.erasConvertYear=PF;ut.erasAbbrRegex=LF;ut.erasNameRegex=IF;ut.erasNarrowRegex=FF;ut.months=v4;ut.monthsShort=y4;ut.monthsParse=w4;ut.monthsRegex=S4;ut.monthsShortRegex=b4;ut.week=C4;ut.firstDayOfYear=N4;ut.firstDayOfWeek=E4;ut.weekdays=F4;ut.weekdaysMin=U4;ut.weekdaysShort=z4;ut.weekdaysParse=V4;ut.weekdaysRegex=Y4;ut.weekdaysShortRegex=K4;ut.weekdaysMinRegex=G4;ut.isPM=q4;ut.meridiem=J4;function Od(e,t,r,n){var s=Ds(),o=Zn().set(n,t);return s[r](o,e)}function iC(e,t,r){if(Cs(e)&&(t=e,e=void 0),e=e||"",t!=null)return Od(e,t,r,"month");var n,s=[];for(n=0;n<12;n++)s[n]=Od(e,n,r,"month");return s}function Gv(e,t,r,n){typeof e=="boolean"?(Cs(t)&&(r=t,t=void 0),t=t||""):(t=e,r=t,e=!1,Cs(t)&&(r=t,t=void 0),t=t||"");var s=Ds(),o=e?s._week.dow:0,i,a=[];if(r!=null)return Od(t,(r+o)%7,n,"day");for(i=0;i<7;i++)a[i]=Od(t,(i+o)%7,n,"day");return a}function s3(e,t){return iC(e,t,"months")}function o3(e,t){return iC(e,t,"monthsShort")}function i3(e,t,r){return Gv(e,t,r,"weekdays")}function a3(e,t,r){return Gv(e,t,r,"weekdaysShort")}function l3(e,t,r){return Gv(e,t,r,"weekdaysMin")}uo("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,r=rt(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return e+r}});ve.lang=an("moment.lang is deprecated. Use moment.locale instead.",uo);ve.langData=an("moment.langData is deprecated. Use moment.localeData instead.",Ds);var ns=Math.abs;function c3(){var e=this._data;return this._milliseconds=ns(this._milliseconds),this._days=ns(this._days),this._months=ns(this._months),e.milliseconds=ns(e.milliseconds),e.seconds=ns(e.seconds),e.minutes=ns(e.minutes),e.hours=ns(e.hours),e.months=ns(e.months),e.years=ns(e.years),this}function aC(e,t,r,n){var s=Rn(t,r);return e._milliseconds+=n*s._milliseconds,e._days+=n*s._days,e._months+=n*s._months,e._bubble()}function u3(e,t){return aC(this,e,t,1)}function d3(e,t){return aC(this,e,t,-1)}function cw(e){return e<0?Math.floor(e):Math.ceil(e)}function f3(){var e=this._milliseconds,t=this._days,r=this._months,n=this._data,s,o,i,a,c;return e>=0&&t>=0&&r>=0||e<=0&&t<=0&&r<=0||(e+=cw(vm(r)+t)*864e5,t=0,r=0),n.milliseconds=e%1e3,s=en(e/1e3),n.seconds=s%60,o=en(s/60),n.minutes=o%60,i=en(o/60),n.hours=i%24,t+=en(i/24),c=en(lC(t)),r+=c,t-=cw(vm(c)),a=en(r/12),r%=12,n.days=t,n.months=r,n.years=a,this}function lC(e){return e*4800/146097}function vm(e){return e*146097/4800}function h3(e){if(!this.isValid())return NaN;var t,r,n=this._milliseconds;if(e=ln(e),e==="month"||e==="quarter"||e==="year")switch(t=this._days+n/864e5,r=this._months+lC(t),e){case"month":return r;case"quarter":return r/3;case"year":return r/12}else switch(t=this._days+Math.round(vm(this._months)),e){case"week":return t/7+n/6048e5;case"day":return t+n/864e5;case"hour":return t*24+n/36e5;case"minute":return t*1440+n/6e4;case"second":return t*86400+n/1e3;case"millisecond":return Math.floor(t*864e5)+n;default:throw new Error("Unknown unit "+e)}}function Os(e){return function(){return this.as(e)}}var cC=Os("ms"),p3=Os("s"),m3=Os("m"),g3=Os("h"),v3=Os("d"),y3=Os("w"),x3=Os("M"),w3=Os("Q"),_3=Os("y"),b3=cC;function S3(){return Rn(this)}function k3(e){return e=ln(e),this.isValid()?this[e+"s"]():NaN}function mi(e){return function(){return this.isValid()?this._data[e]:NaN}}var C3=mi("milliseconds"),j3=mi("seconds"),E3=mi("minutes"),N3=mi("hours"),T3=mi("days"),R3=mi("months"),P3=mi("years");function A3(){return en(this.days()/7)}var as=Math.round,Bi={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function D3(e,t,r,n,s){return s.relativeTime(t||1,!!r,e,n)}function O3(e,t,r,n){var s=Rn(e).abs(),o=as(s.as("s")),i=as(s.as("m")),a=as(s.as("h")),c=as(s.as("d")),u=as(s.as("M")),d=as(s.as("w")),f=as(s.as("y")),m=o<=r.ss&&["s",o]||o0,m[4]=n,D3.apply(null,m)}function M3(e){return e===void 0?as:typeof e=="function"?(as=e,!0):!1}function I3(e,t){return Bi[e]===void 0?!1:t===void 0?Bi[e]:(Bi[e]=t,e==="s"&&(Bi.ss=t-1),!0)}function L3(e,t){if(!this.isValid())return this.localeData().invalidDate();var r=!1,n=Bi,s,o;return typeof e=="object"&&(t=e,e=!1),typeof e=="boolean"&&(r=e),typeof t=="object"&&(n=Object.assign({},Bi,t),t.s!=null&&t.ss==null&&(n.ss=t.s-1)),s=this.localeData(),o=O3(this,!r,n,s),r&&(o=s.pastFuture(+this,o)),s.postformat(o)}var Qh=Math.abs;function ji(e){return(e>0)-(e<0)||+e}function $f(){if(!this.isValid())return this.localeData().invalidDate();var e=Qh(this._milliseconds)/1e3,t=Qh(this._days),r=Qh(this._months),n,s,o,i,a=this.asSeconds(),c,u,d,f;return a?(n=en(e/60),s=en(n/60),e%=60,n%=60,o=en(r/12),r%=12,i=e?e.toFixed(3).replace(/\.?0+$/,""):"",c=a<0?"-":"",u=ji(this._months)!==ji(a)?"-":"",d=ji(this._days)!==ji(a)?"-":"",f=ji(this._milliseconds)!==ji(a)?"-":"",c+"P"+(o?u+o+"Y":"")+(r?u+r+"M":"")+(t?d+t+"D":"")+(s||n||e?"T":"")+(s?f+s+"H":"")+(n?f+n+"M":"")+(e?f+i+"S":"")):"P0D"}var it=zf.prototype;it.isValid=R5;it.abs=c3;it.add=u3;it.subtract=d3;it.as=h3;it.asMilliseconds=cC;it.asSeconds=p3;it.asMinutes=m3;it.asHours=g3;it.asDays=v3;it.asWeeks=y3;it.asMonths=x3;it.asQuarters=w3;it.asYears=_3;it.valueOf=b3;it._bubble=f3;it.clone=S3;it.get=k3;it.milliseconds=C3;it.seconds=j3;it.minutes=E3;it.hours=N3;it.days=T3;it.weeks=A3;it.months=R3;it.years=P3;it.humanize=L3;it.toISOString=$f;it.toString=$f;it.toJSON=$f;it.locale=qk;it.localeData=Qk;it.toIsoString=an("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",$f);it.lang=Xk;Ie("X",0,0,"unix");Ie("x",0,0,"valueOf");be("x",Mf);be("X",s4);vt("X",function(e,t,r){r._d=new Date(parseFloat(e)*1e3)});vt("x",function(e,t,r){r._d=new Date(rt(e))});//! moment.js -ve.version="2.30.1";FL(kt);ve.fn=le;ve.min=j5;ve.max=E5;ve.now=N5;ve.utc=Zn;ve.unix=r3;ve.months=s3;ve.isDate=Dc;ve.locale=uo;ve.invalid=Pf;ve.duration=Rn;ve.isMoment=jn;ve.weekdays=i3;ve.parseZone=n3;ve.localeData=Ds;ve.isDuration=Hu;ve.monthsShort=o3;ve.weekdaysMin=l3;ve.defineLocale=Uv;ve.updateLocale=n5;ve.locales=s5;ve.weekdaysShort=a3;ve.normalizeUnits=ln;ve.relativeTimeRounding=M3;ve.relativeTimeThreshold=I3;ve.calendarFormat=J5;ve.prototype=le;ve.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};const F3=async()=>await st().collection("access").getFullList({sort:"-created",filter:"deleted = null"}),Eo=async e=>e.id?await st().collection("access").update(e.id,e):await st().collection("access").create(e),z3=async e=>(e.deleted=ve.utc().format("YYYY-MM-DD HH:mm:ss"),await st().collection("access").update(e.id,e)),uw=async()=>await st().collection("access_groups").getFullList({sort:"-created",expand:"access"}),U3=async e=>{const t=st();if((await t.collection("access").getList(1,1,{filter:`group='${e}' && deleted=null`})).items.length>0)throw new Error("该分组下有授权配置,无法删除");await t.collection("access_groups").delete(e)},$3=async e=>{const t=st();return e.id?await t.collection("access_groups").update(e.id,e):await t.collection("access_groups").create(e)},dw=async e=>await st().collection("access_groups").update(e.id,e),V3=(e,t)=>{switch(t.type){case"SET_ACCESSES":return{...e,accesses:t.payload};case"ADD_ACCESS":return{...e,accesses:[t.payload,...e.accesses]};case"DELETE_ACCESS":return{...e,accesses:e.accesses.filter(r=>r.id!==t.payload)};case"UPDATE_ACCESS":return{...e,accesses:e.accesses.map(r=>r.id===t.payload.id?t.payload:r)};case"SET_EMAILS":return{...e,emails:t.payload};case"ADD_EMAIL":return{...e,emails:{...e.emails,content:{emails:[...e.emails.content.emails,t.payload]}}};case"SET_ACCESS_GROUPS":return{...e,accessGroups:t.payload};default:return e}},B3=async()=>{try{return await st().collection("settings").getFirstListItem("name='emails'")}catch{return{content:{emails:[]}}}},Zv=async e=>{try{return await st().collection("settings").getFirstListItem(`name='${e}'`)}catch{return{name:e}}},La=async e=>{const t=st();let r;return e.id?r=await t.collection("settings").update(e.id,e):r=await t.collection("settings").create(e),r},uC=g.createContext({}),Zr=()=>g.useContext(uC),W3=({children:e})=>{const[t,r]=g.useReducer(V3,{accesses:[],emails:{content:{emails:[]}},accessGroups:[]});g.useEffect(()=>{(async()=>{const d=await F3();r({type:"SET_ACCESSES",payload:d})})()},[]),g.useEffect(()=>{(async()=>{const d=await B3();r({type:"SET_EMAILS",payload:d})})()},[]),g.useEffect(()=>{(async()=>{const d=await uw();r({type:"SET_ACCESS_GROUPS",payload:d})})()},[]);const n=g.useCallback(async()=>{const u=await uw();r({type:"SET_ACCESS_GROUPS",payload:u})},[]),s=g.useCallback(u=>{r({type:"SET_EMAILS",payload:u})},[]),o=g.useCallback(u=>{r({type:"DELETE_ACCESS",payload:u})},[]),i=g.useCallback(u=>{r({type:"ADD_ACCESS",payload:u})},[]),a=g.useCallback(u=>{r({type:"UPDATE_ACCESS",payload:u})},[]),c=g.useCallback(u=>{r({type:"SET_ACCESS_GROUPS",payload:u})},[]);return l.jsx(uC.Provider,{value:{config:{accesses:t.accesses,emails:t.emails,accessGroups:t.accessGroups},deleteAccess:o,addAccess:i,setEmails:s,updateAccess:a,setAccessGroups:c,reloadAccessGroups:n},children:e&&e})},H3={theme:"system",setTheme:()=>null},dC=g.createContext(H3);function Y3({children:e,defaultTheme:t="system",storageKey:r="vite-ui-theme",...n}){const[s,o]=g.useState(()=>localStorage.getItem(r)||t);g.useEffect(()=>{const a=window.document.documentElement;if(a.classList.remove("light","dark"),s==="system"){const c=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";a.classList.add(c);return}a.classList.add(s)},[s]);const i={theme:s,setTheme:a=>{localStorage.setItem(r,a),o(a)}};return l.jsx(dC.Provider,{...n,value:i,children:e})}const K3=()=>{const e=g.useContext(dC);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};function G3(){const{setTheme:e}=K3();return l.jsxs(KS,{children:[l.jsx(GS,{asChild:!0,children:l.jsxs(He,{variant:"outline",size:"icon",children:[l.jsx(LA,{className:"h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),l.jsx(OA,{className:"absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100 dark:text-white"}),l.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),l.jsxs(pv,{align:"end",children:[l.jsx(ta,{onClick:()=>e("light"),children:"浅色"}),l.jsx(ta,{onClick:()=>e("dark"),children:"暗黑"}),l.jsx(ta,{onClick:()=>e("system"),children:"系统"})]})]})}var Z3="Separator",fw="horizontal",q3=["horizontal","vertical"],fC=g.forwardRef((e,t)=>{const{decorative:r,orientation:n=fw,...s}=e,o=X3(n)?n:fw,a=r?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return l.jsx(Re.div,{"data-orientation":o,...a,...s,ref:t})});fC.displayName=Z3;function X3(e){return q3.includes(e)}var hC=fC;const Bt=g.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...n},s)=>l.jsx(hC,{ref:s,decorative:r,orientation:t,className:oe("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...n}));Bt.displayName=hC.displayName;const Q3="Certimate v0.1.11",pC=()=>l.jsxs("div",{className:"fixed right-0 bottom-0 w-full flex justify-between p-5",children:[l.jsx("div",{className:""}),l.jsxs("div",{className:"text-muted-foreground text-sm hover:text-stone-900 dark:hover:text-stone-200 flex",children:[l.jsxs("a",{href:"https://docs.certimate.me",target:"_blank",className:"flex items-center",children:[l.jsx(bA,{size:16}),l.jsx("div",{className:"ml-1",children:"文档"})]}),l.jsx(Bt,{orientation:"vertical",className:"mx-2"}),l.jsx("a",{href:"https://github.com/usual2970/certimate/releases",target:"_blank",children:Q3})]})]});function J3(){const e=Pr(),t=Nn();if(!st().authStore.isValid||!st().authStore.isAdmin)return l.jsx(ib,{to:"/login"});const r=t.pathname,n=i=>(console.log(r),i==r?"bg-muted text-primary":"text-muted-foreground"),s=()=>{st().authStore.clear(),e("/login")},o=()=>{e("/setting/account")};return l.jsx(l.Fragment,{children:l.jsx(W3,{children:l.jsxs("div",{className:"grid min-h-screen w-full md:grid-cols-[180px_1fr] lg:grid-cols-[200px_1fr] 2xl:md:grid-cols-[280px_1fr] ",children:[l.jsx("div",{className:"hidden border-r dark:border-stone-500 bg-muted/40 md:block",children:l.jsxs("div",{className:"flex h-full max-h-screen flex-col gap-2",children:[l.jsx("div",{className:"flex h-14 items-center border-b dark:border-stone-500 px-4 lg:h-[60px] lg:px-6",children:l.jsxs(hr,{to:"/",className:"flex items-center gap-2 font-semibold",children:[l.jsx("img",{src:"/vite.svg",className:"w-[36px] h-[36px]"}),l.jsx("span",{className:"dark:text-white",children:"Certimate"})]})}),l.jsx("div",{className:"flex-1",children:l.jsxs("nav",{className:"grid items-start px-2 text-sm font-medium lg:px-4",children:[l.jsxs(hr,{to:"/",className:oe("flex items-center gap-3 rounded-lg px-3 py-2 transition-all hover:text-primary",n("/")),children:[l.jsx(E0,{className:"h-4 w-4"}),"控制面板"]}),l.jsxs(hr,{to:"/domains",className:oe("flex items-center gap-3 rounded-lg px-3 py-2 transition-all hover:text-primary",n("/domains")),children:[l.jsx(rm,{className:"h-4 w-4"}),"域名列表"]}),l.jsxs(hr,{to:"/access",className:oe("flex items-center gap-3 rounded-lg px-3 py-2 transition-all hover:text-primary",n("/access")),children:[l.jsx(N0,{className:"h-4 w-4"}),"授权管理"]}),l.jsxs(hr,{to:"/history",className:oe("flex items-center gap-3 rounded-lg px-3 py-2 transition-all hover:text-primary",n("/history")),children:[l.jsx(j0,{className:"h-4 w-4"}),"部署历史"]})]})})]})}),l.jsxs("div",{className:"flex flex-col",children:[l.jsxs("header",{className:"flex h-14 items-center gap-4 border-b dark:border-stone-500 bg-muted/40 px-4 lg:h-[60px] lg:px-6",children:[l.jsxs(bv,{children:[l.jsx(Sv,{asChild:!0,children:l.jsxs(He,{variant:"outline",size:"icon",className:"shrink-0 md:hidden",children:[l.jsx(DA,{className:"h-5 w-5 dark:text-white"}),l.jsx("span",{className:"sr-only",children:"Toggle navigation menu"})]})}),l.jsx(Rf,{side:"left",className:"flex flex-col",children:l.jsxs("nav",{className:"grid gap-2 text-lg font-medium",children:[l.jsxs(hr,{to:"/",className:"flex items-center gap-2 text-lg font-semibold",children:[l.jsx("img",{src:"/vite.svg",className:"w-[36px] h-[36px]"}),l.jsx("span",{className:"dark:text-white",children:"Certimate"}),l.jsx("span",{className:"sr-only",children:"Certimate"})]}),l.jsxs(hr,{to:"/",className:oe("mx-[-0.65rem] flex items-center gap-4 rounded-xl px-3 py-2 hover:text-foreground",n("/")),children:[l.jsx(E0,{className:"h-5 w-5"}),"控制面板"]}),l.jsxs(hr,{to:"/domains",className:oe("mx-[-0.65rem] flex items-center gap-4 rounded-xl px-3 py-2 hover:text-foreground",n("/domains")),children:[l.jsx(rm,{className:"h-5 w-5"}),"域名列表"]}),l.jsxs(hr,{to:"/access",className:oe("mx-[-0.65rem] flex items-center gap-4 rounded-xl px-3 py-2 hover:text-foreground",n("/access")),children:[l.jsx(N0,{className:"h-5 w-5"}),"授权管理"]}),l.jsxs(hr,{to:"/history",className:oe("mx-[-0.65rem] flex items-center gap-4 rounded-xl px-3 py-2 hover:text-foreground",n("/history")),children:[l.jsx(j0,{className:"h-5 w-5"}),"部署历史"]})]})})]}),l.jsx("div",{className:"w-full flex-1"}),l.jsx(G3,{}),l.jsxs(KS,{children:[l.jsx(GS,{asChild:!0,children:l.jsxs(He,{variant:"secondary",size:"icon",className:"rounded-full",children:[l.jsx(EA,{className:"h-5 w-5"}),l.jsx("span",{className:"sr-only",children:"Toggle user menu"})]})}),l.jsxs(pv,{align:"end",children:[l.jsx(ZS,{children:"账户"}),l.jsx(qS,{}),l.jsx(ta,{onClick:o,children:"偏好设置"}),l.jsx(ta,{onClick:s,children:"退出"})]})]})]}),l.jsxs("main",{className:"flex flex-1 flex-col gap-4 p-4 lg:gap-6 lg:p-6 relative",children:[l.jsx(Lg,{}),l.jsx(pC,{})]})]})]})})})}const qv=({phase:e,phaseSuccess:t})=>{let r=l.jsx(l.Fragment,{children:" "});return e==="check"&&(t?r=l.jsxs("div",{className:"flex items-center",children:[l.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"检查 "}),l.jsx(Bt,{className:"h-1 grow"}),l.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"获取"}),l.jsx(Bt,{className:"h-1 grow"}),l.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"部署"})]}):r=l.jsxs("div",{className:"flex items-center",children:[l.jsx("div",{className:"text-xs text-nowrap text-red-600",children:"检查 "}),l.jsx(Bt,{className:"h-1 grow"}),l.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"获取"}),l.jsx(Bt,{className:"h-1 grow"}),l.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"部署"})]})),e==="apply"&&(t?r=l.jsxs("div",{className:"flex items-center",children:[l.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"检查 "}),l.jsx(Bt,{className:"h-1 grow bg-green-600"}),l.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"获取"}),l.jsx(Bt,{className:"h-1 grow"}),l.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"部署"})]}):r=l.jsxs("div",{className:"flex items-center",children:[l.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"检查 "}),l.jsx(Bt,{className:"h-1 grow bg-green-600"}),l.jsx("div",{className:"text-xs text-nowrap text-red-600",children:"获取"}),l.jsx(Bt,{className:"h-1 grow"}),l.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"部署"})]})),e==="deploy"&&(t?r=l.jsxs("div",{className:"flex items-center",children:[l.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"检查 "}),l.jsx(Bt,{className:"h-1 grow bg-green-600"}),l.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"获取"}),l.jsx(Bt,{className:"h-1 grow bg-green-600"}),l.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"部署"})]}):r=l.jsxs("div",{className:"flex items-center",children:[l.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"检查 "}),l.jsx(Bt,{className:"h-1 grow bg-green-600"}),l.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"获取"}),l.jsx(Bt,{className:"h-1 grow bg-green-600"}),l.jsx("div",{className:"text-xs text-nowrap text-red-600",children:"部署"})]})),r};var e6="VisuallyHidden",Lc=g.forwardRef((e,t)=>l.jsx(Re.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));Lc.displayName=e6;var t6=Lc,[Vf,Q$]=sr("Tooltip",[Aa]),Bf=Aa(),mC="TooltipProvider",r6=700,ym="tooltip.open",[n6,Xv]=Vf(mC),Qv=e=>{const{__scopeTooltip:t,delayDuration:r=r6,skipDelayDuration:n=300,disableHoverableContent:s=!1,children:o}=e,[i,a]=g.useState(!0),c=g.useRef(!1),u=g.useRef(0);return g.useEffect(()=>{const d=u.current;return()=>window.clearTimeout(d)},[]),l.jsx(n6,{scope:t,isOpenDelayed:i,delayDuration:r,onOpen:g.useCallback(()=>{window.clearTimeout(u.current),a(!1)},[]),onClose:g.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>a(!0),n)},[n]),isPointerInTransitRef:c,onPointerInTransitChange:g.useCallback(d=>{c.current=d},[]),disableHoverableContent:s,children:o})};Qv.displayName=mC;var Wf="Tooltip",[s6,Hf]=Vf(Wf),gC=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:s=!1,onOpenChange:o,disableHoverableContent:i,delayDuration:a}=e,c=Xv(Wf,e.__scopeTooltip),u=Bf(t),[d,f]=g.useState(null),m=Ur(),v=g.useRef(0),x=i??c.disableHoverableContent,y=a??c.delayDuration,_=g.useRef(!1),[p=!1,h]=Hr({prop:n,defaultProp:s,onChange:R=>{R?(c.onOpen(),document.dispatchEvent(new CustomEvent(ym))):c.onClose(),o==null||o(R)}}),w=g.useMemo(()=>p?_.current?"delayed-open":"instant-open":"closed",[p]),C=g.useCallback(()=>{window.clearTimeout(v.current),_.current=!1,h(!0)},[h]),j=g.useCallback(()=>{window.clearTimeout(v.current),h(!1)},[h]),E=g.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>{_.current=!0,h(!0)},y)},[y,h]);return g.useEffect(()=>()=>window.clearTimeout(v.current),[]),l.jsx(Jg,{...u,children:l.jsx(s6,{scope:t,contentId:m,open:p,stateAttribute:w,trigger:d,onTriggerChange:f,onTriggerEnter:g.useCallback(()=>{c.isOpenDelayed?E():C()},[c.isOpenDelayed,E,C]),onTriggerLeave:g.useCallback(()=>{x?j():window.clearTimeout(v.current)},[j,x]),onOpen:C,onClose:j,disableHoverableContent:x,children:r})})};gC.displayName=Wf;var xm="TooltipTrigger",vC=g.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=Hf(xm,r),o=Xv(xm,r),i=Bf(r),a=g.useRef(null),c=Ke(t,a,s.onTriggerChange),u=g.useRef(!1),d=g.useRef(!1),f=g.useCallback(()=>u.current=!1,[]);return g.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),l.jsx(ev,{asChild:!0,...i,children:l.jsx(Re.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...n,ref:c,onPointerMove:ce(e.onPointerMove,m=>{m.pointerType!=="touch"&&!d.current&&!o.isPointerInTransitRef.current&&(s.onTriggerEnter(),d.current=!0)}),onPointerLeave:ce(e.onPointerLeave,()=>{s.onTriggerLeave(),d.current=!1}),onPointerDown:ce(e.onPointerDown,()=>{u.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:ce(e.onFocus,()=>{u.current||s.onOpen()}),onBlur:ce(e.onBlur,s.onClose),onClick:ce(e.onClick,s.onClose)})})});vC.displayName=xm;var o6="TooltipPortal",[J$,i6]=Vf(o6,{forceMount:void 0}),va="TooltipContent",Jv=g.forwardRef((e,t)=>{const r=i6(va,e.__scopeTooltip),{forceMount:n=r.forceMount,side:s="top",...o}=e,i=Hf(va,e.__scopeTooltip);return l.jsx(or,{present:n||i.open,children:i.disableHoverableContent?l.jsx(yC,{side:s,...o,ref:t}):l.jsx(a6,{side:s,...o,ref:t})})}),a6=g.forwardRef((e,t)=>{const r=Hf(va,e.__scopeTooltip),n=Xv(va,e.__scopeTooltip),s=g.useRef(null),o=Ke(t,s),[i,a]=g.useState(null),{trigger:c,onClose:u}=r,d=s.current,{onPointerInTransitChange:f}=n,m=g.useCallback(()=>{a(null),f(!1)},[f]),v=g.useCallback((x,y)=>{const _=x.currentTarget,p={x:x.clientX,y:x.clientY},h=d6(p,_.getBoundingClientRect()),w=f6(p,h),C=h6(y.getBoundingClientRect()),j=m6([...w,...C]);a(j),f(!0)},[f]);return g.useEffect(()=>()=>m(),[m]),g.useEffect(()=>{if(c&&d){const x=_=>v(_,d),y=_=>v(_,c);return c.addEventListener("pointerleave",x),d.addEventListener("pointerleave",y),()=>{c.removeEventListener("pointerleave",x),d.removeEventListener("pointerleave",y)}}},[c,d,v,m]),g.useEffect(()=>{if(i){const x=y=>{const _=y.target,p={x:y.clientX,y:y.clientY},h=(c==null?void 0:c.contains(_))||(d==null?void 0:d.contains(_)),w=!p6(p,i);h?m():w&&(m(),u())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[c,d,i,u,m]),l.jsx(yC,{...e,ref:o})}),[l6,c6]=Vf(Wf,{isInside:!1}),yC=g.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":s,onEscapeKeyDown:o,onPointerDownOutside:i,...a}=e,c=Hf(va,r),u=Bf(r),{onClose:d}=c;return g.useEffect(()=>(document.addEventListener(ym,d),()=>document.removeEventListener(ym,d)),[d]),g.useEffect(()=>{if(c.trigger){const f=m=>{const v=m.target;v!=null&&v.contains(c.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[c.trigger,d]),l.jsx(Ta,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:f=>f.preventDefault(),onDismiss:d,children:l.jsxs(tv,{"data-state":c.stateAttribute,...u,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[l.jsx(Ug,{children:n}),l.jsx(l6,{scope:r,isInside:!0,children:l.jsx(t6,{id:c.contentId,role:"tooltip",children:s||n})})]})})});Jv.displayName=va;var xC="TooltipArrow",u6=g.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=Bf(r);return c6(xC,r).isInside?null:l.jsx(rv,{...s,...n,ref:t})});u6.displayName=xC;function d6(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(r,n,s,o)){case o:return"left";case s:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function f6(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function h6(e){const{top:t,right:r,bottom:n,left:s}=e;return[{x:s,y:t},{x:r,y:t},{x:r,y:n},{x:s,y:n}]}function p6(e,t){const{x:r,y:n}=e;let s=!1;for(let o=0,i=t.length-1;on!=d>n&&r<(u-a)*(n-c)/(d-c)+a&&(s=!s)}return s}function m6(e){const t=e.slice();return t.sort((r,n)=>r.xn.x?1:r.yn.y?1:0),g6(t)}function g6(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n=2;){const o=t[t.length-1],i=t[t.length-2];if((o.x-i.x)*(s.y-i.y)>=(o.y-i.y)*(s.x-i.x))t.pop();else break}t.push(s)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const s=e[n];for(;r.length>=2;){const o=r[r.length-1],i=r[r.length-2];if((o.x-i.x)*(s.y-i.y)>=(o.y-i.y)*(s.x-i.x))r.pop();else break}r.push(s)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var v6=Qv,y6=gC,x6=vC,wC=Jv;const w6=v6,_C=y6,bC=x6,SC=g.forwardRef(({className:e,sideOffset:t=4,...r},n)=>l.jsx(wC,{ref:n,sideOffset:t,className:oe("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));SC.displayName=wC.displayName;const ey=({deployment:e})=>{const t=r=>e.log[r]?e.log[r][e.log[r].length-1].error:"";return l.jsx(l.Fragment,{children:e.phase==="deploy"&&e.phaseSuccess||e.wholeSuccess?l.jsx(jA,{size:16,className:"text-green-700"}):l.jsx(l.Fragment,{children:t(e.phase).length?l.jsx(w6,{children:l.jsxs(_C,{children:[l.jsx(bC,{asChild:!0,className:"cursor-pointer",children:l.jsx(k0,{size:16,className:"text-red-700"})}),l.jsx(SC,{className:"max-w-[35em]",children:t(e.phase)})]})}):l.jsx(k0,{size:16,className:"text-red-700"})})})},kC=({className:e,...t})=>l.jsx("nav",{role:"navigation","aria-label":"pagination",className:oe("mx-auto flex w-full justify-center",e),...t});kC.displayName="Pagination";const CC=g.forwardRef(({className:e,...t},r)=>l.jsx("ul",{ref:r,className:oe("flex flex-row items-center gap-1",e),...t}));CC.displayName="PaginationContent";const wm=g.forwardRef(({className:e,...t},r)=>l.jsx("li",{ref:r,className:oe("",e),...t}));wm.displayName="PaginationItem";const jC=({className:e,isActive:t,size:r="icon",...n})=>l.jsx("a",{"aria-current":t?"page":void 0,className:oe(wf({variant:t?"outline":"ghost",size:r}),e),...n});jC.displayName="PaginationLink";const EC=({className:e,...t})=>l.jsxs("span",{"aria-hidden":!0,className:oe("flex h-9 w-9 items-center justify-center",e),...t,children:[l.jsx(NA,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"More pages"})]});EC.displayName="PaginationEllipsis";const NC=({totalPages:e,currentPage:t,onPageChange:r})=>{const s=()=>{if(e>7){let u=[];const d=Math.max(2,t-1),f=Math.min(e-1,t+1),m=e-1;return u=o(d,f),t>3&&u.unshift("..."),t{let d=a;const f=[];for(;d<=c;)f.push(d),d+=u;return f},i=s();return l.jsx(l.Fragment,{children:l.jsx(kC,{className:"dark:text-stone-200 justify-end mt-3",children:l.jsx(CC,{children:i.map((a,c)=>a==="..."?l.jsx(wm,{children:l.jsx(EC,{})},c):l.jsx(wm,{children:l.jsx(jC,{href:"#",isActive:t==a,onClick:u=>{u.preventDefault(),r(a)},children:a})},c))})})})},ia=({when:e,children:t,fallback:r})=>e?t:r;var TC="AlertDialog",[_6,eV]=sr(TC,[QS]),Ms=QS(),RC=e=>{const{__scopeAlertDialog:t,...r}=e,n=Ms(t);return l.jsx(xv,{...n,...r,modal:!0})};RC.displayName=TC;var b6="AlertDialogTrigger",PC=g.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ms(r);return l.jsx(wv,{...s,...n,ref:t})});PC.displayName=b6;var S6="AlertDialogPortal",AC=e=>{const{__scopeAlertDialog:t,...r}=e,n=Ms(t);return l.jsx(_v,{...n,...r})};AC.displayName=S6;var k6="AlertDialogOverlay",DC=g.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ms(r);return l.jsx(Tc,{...s,...n,ref:t})});DC.displayName=k6;var aa="AlertDialogContent",[C6,j6]=_6(aa),OC=g.forwardRef((e,t)=>{const{__scopeAlertDialog:r,children:n,...s}=e,o=Ms(r),i=g.useRef(null),a=Ke(t,i),c=g.useRef(null);return l.jsx(hL,{contentName:aa,titleName:MC,docsSlug:"alert-dialog",children:l.jsx(C6,{scope:r,cancelRef:c,children:l.jsxs(Rc,{role:"alertdialog",...o,...s,ref:a,onOpenAutoFocus:ce(s.onOpenAutoFocus,u=>{var d;u.preventDefault(),(d=c.current)==null||d.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[l.jsx(Ug,{children:n}),l.jsx(N6,{contentRef:i})]})})})});OC.displayName=aa;var MC="AlertDialogTitle",IC=g.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ms(r);return l.jsx(Pc,{...s,...n,ref:t})});IC.displayName=MC;var LC="AlertDialogDescription",FC=g.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ms(r);return l.jsx(Ac,{...s,...n,ref:t})});FC.displayName=LC;var E6="AlertDialogAction",zC=g.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ms(r);return l.jsx(Tf,{...s,...n,ref:t})});zC.displayName=E6;var UC="AlertDialogCancel",$C=g.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,{cancelRef:s}=j6(UC,r),o=Ms(r),i=Ke(t,s);return l.jsx(Tf,{...o,...n,ref:i})});$C.displayName=UC;var N6=({contentRef:e})=>{const t=`\`${aa}\` requires a description for the component to be accessible for screen reader users. +`+new Error().stack),r=!1}return t.apply(this,arguments)},t)}var ow={};function bk(e,t){ye.deprecationHandler!=null&&ye.deprecationHandler(e,t),ow[e]||(_k(t),ow[e]=!0)}ye.suppressDeprecationWarnings=!1;ye.deprecationHandler=null;function qn(e){return typeof Function<"u"&&e instanceof Function||Object.prototype.toString.call(e)==="[object Function]"}function UL(e){var t,r;for(r in e)ct(e,r)&&(t=e[r],qn(t)?this[r]=t:this["_"+r]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function fm(e,t){var r=ro({},e),n;for(n in t)ct(t,n)&&(Zo(e[n])&&Zo(t[n])?(r[n]={},ro(r[n],e[n]),ro(r[n],t[n])):t[n]!=null?r[n]=t[n]:delete r[n]);for(n in e)ct(e,n)&&!ct(t,n)&&Zo(e[n])&&(r[n]=ro({},r[n]));return r}function Rv(e){e!=null&&this.set(e)}var hm;Object.keys?hm=Object.keys:hm=function(e){var t,r=[];for(t in e)ct(e,t)&&r.push(t);return r};var $L={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function VL(e,t,r){var n=this._calendar[e]||this._calendar.sameElse;return qn(n)?n.call(t,r):n}function Yn(e,t,r){var n=""+Math.abs(e),s=t-n.length,o=e>=0;return(o?r?"+":"":"-")+Math.pow(10,Math.max(0,s)).toString().substr(1)+n}var Pv=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,bu=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,qh={},na={};function Ie(e,t,r,n){var s=n;typeof n=="string"&&(s=function(){return this[n]()}),e&&(na[e]=s),t&&(na[t[0]]=function(){return Yn(s.apply(this,arguments),t[1],t[2])}),r&&(na[r]=function(){return this.localeData().ordinal(s.apply(this,arguments),e)})}function BL(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function WL(e){var t=e.match(Pv),r,n;for(r=0,n=t.length;r=0&&bu.test(e);)e=e.replace(bu,n),bu.lastIndex=0,r-=1;return e}var HL={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function YL(e){var t=this._longDateFormat[e],r=this._longDateFormat[e.toUpperCase()];return t||!r?t:(this._longDateFormat[e]=r.match(Pv).map(function(n){return n==="MMMM"||n==="MM"||n==="DD"||n==="dddd"?n.slice(1):n}).join(""),this._longDateFormat[e])}var KL="Invalid date";function GL(){return this._invalidDate}var ZL="%d",qL=/\d{1,2}/;function XL(e){return this._ordinal.replace("%d",e)}var QL={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function JL(e,t,r,n){var s=this._relativeTime[r];return qn(s)?s(e,t,r,n):s.replace(/%d/i,e)}function e4(e,t){var r=this._relativeTime[e>0?"future":"past"];return qn(r)?r(t):r.replace(/%s/i,t)}var iw={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function ln(e){return typeof e=="string"?iw[e]||iw[e.toLowerCase()]:void 0}function Av(e){var t={},r,n;for(n in e)ct(e,n)&&(r=ln(n),r&&(t[r]=e[n]));return t}var t4={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function r4(e){var t=[],r;for(r in e)ct(e,r)&&t.push({unit:r,priority:t4[r]});return t.sort(function(n,s){return n.priority-s.priority}),t}var kk=/\d/,Zr=/\d\d/,Ck=/\d{3}/,Dv=/\d{4}/,Af=/[+-]?\d{6}/,Ct=/\d\d?/,jk=/\d\d\d\d?/,Ek=/\d\d\d\d\d\d?/,Df=/\d{1,3}/,Ov=/\d{1,4}/,Of=/[+-]?\d{1,6}/,Ma=/\d+/,Mf=/[+-]?\d+/,n4=/Z|[+-]\d\d:?\d\d/gi,If=/Z|[+-]\d\d(?::?\d\d)?/gi,s4=/[+-]?\d+(\.\d{1,3})?/,Mc=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Ia=/^[1-9]\d?/,Mv=/^([1-9]\d|\d)/,Rd;Rd={};function je(e,t,r){Rd[e]=qn(t)?t:function(n,s){return n&&r?r:t}}function o4(e,t){return ct(Rd,e)?Rd[e](t._strict,t._locale):new RegExp(i4(e))}function i4(e){return gs(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,r,n,s,o){return r||n||s||o}))}function gs(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function en(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function rt(e){var t=+e,r=0;return t!==0&&isFinite(t)&&(r=en(t)),r}var pm={};function vt(e,t){var r,n=t,s;for(typeof e=="string"&&(e=[e]),Cs(t)&&(n=function(o,i){i[t]=rt(o)}),s=e.length,r=0;r68?1900:2e3)};var Nk=La("FullYear",!0);function u4(){return Lf(this.year())}function La(e,t){return function(r){return r!=null?(Tk(this,e,r),ye.updateOffset(this,t),this):ec(this,e)}}function ec(e,t){if(!e.isValid())return NaN;var r=e._d,n=e._isUTC;switch(t){case"Milliseconds":return n?r.getUTCMilliseconds():r.getMilliseconds();case"Seconds":return n?r.getUTCSeconds():r.getSeconds();case"Minutes":return n?r.getUTCMinutes():r.getMinutes();case"Hours":return n?r.getUTCHours():r.getHours();case"Date":return n?r.getUTCDate():r.getDate();case"Day":return n?r.getUTCDay():r.getDay();case"Month":return n?r.getUTCMonth():r.getMonth();case"FullYear":return n?r.getUTCFullYear():r.getFullYear();default:return NaN}}function Tk(e,t,r){var n,s,o,i,l;if(!(!e.isValid()||isNaN(r))){switch(n=e._d,s=e._isUTC,t){case"Milliseconds":return void(s?n.setUTCMilliseconds(r):n.setMilliseconds(r));case"Seconds":return void(s?n.setUTCSeconds(r):n.setSeconds(r));case"Minutes":return void(s?n.setUTCMinutes(r):n.setMinutes(r));case"Hours":return void(s?n.setUTCHours(r):n.setHours(r));case"Date":return void(s?n.setUTCDate(r):n.setDate(r));case"FullYear":break;default:return}o=r,i=e.month(),l=e.date(),l=l===29&&i===1&&!Lf(o)?28:l,s?n.setUTCFullYear(o,i,l):n.setFullYear(o,i,l)}}function d4(e){return e=ln(e),qn(this[e])?this[e]():this}function f4(e,t){if(typeof e=="object"){e=Av(e);var r=r4(e),n,s=r.length;for(n=0;n=0?(l=new Date(e+400,t,r,n,s,o,i),isFinite(l.getFullYear())&&l.setFullYear(e)):l=new Date(e,t,r,n,s,o,i),l}function tc(e){var t,r;return e<100&&e>=0?(r=Array.prototype.slice.call(arguments),r[0]=e+400,t=new Date(Date.UTC.apply(null,r)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function Pd(e,t,r){var n=7+t-r,s=(7+tc(e,0,n).getUTCDay()-t)%7;return-s+n-1}function Mk(e,t,r,n,s){var o=(7+r-n)%7,i=Pd(e,n,s),l=1+7*(t-1)+o+i,c,u;return l<=0?(c=e-1,u=Cl(c)+l):l>Cl(e)?(c=e+1,u=l-Cl(e)):(c=e,u=l),{year:c,dayOfYear:u}}function rc(e,t,r){var n=Pd(e.year(),t,r),s=Math.floor((e.dayOfYear()-n-1)/7)+1,o,i;return s<1?(i=e.year()-1,o=s+vs(i,t,r)):s>vs(e.year(),t,r)?(o=s-vs(e.year(),t,r),i=e.year()+1):(i=e.year(),o=s),{week:o,year:i}}function vs(e,t,r){var n=Pd(e,t,r),s=Pd(e+1,t,r);return(Cl(e)-n+s)/7}Ie("w",["ww",2],"wo","week");Ie("W",["WW",2],"Wo","isoWeek");je("w",Ct,Ia);je("ww",Ct,Zr);je("W",Ct,Ia);je("WW",Ct,Zr);Ic(["w","ww","W","WW"],function(e,t,r,n){t[n.substr(0,1)]=rt(e)});function C4(e){return rc(e,this._week.dow,this._week.doy).week}var j4={dow:0,doy:6};function E4(){return this._week.dow}function N4(){return this._week.doy}function T4(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,"d")}function R4(e){var t=rc(this,1,4).week;return e==null?t:this.add((e-t)*7,"d")}Ie("d",0,"do","day");Ie("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)});Ie("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)});Ie("dddd",0,0,function(e){return this.localeData().weekdays(this,e)});Ie("e",0,0,"weekday");Ie("E",0,0,"isoWeekday");je("d",Ct);je("e",Ct);je("E",Ct);je("dd",function(e,t){return t.weekdaysMinRegex(e)});je("ddd",function(e,t){return t.weekdaysShortRegex(e)});je("dddd",function(e,t){return t.weekdaysRegex(e)});Ic(["dd","ddd","dddd"],function(e,t,r,n){var s=r._locale.weekdaysParse(e,n,r._strict);s!=null?t.d=s:Xe(r).invalidWeekday=e});Ic(["d","e","E"],function(e,t,r,n){t[n]=rt(e)});function P4(e,t){return typeof e!="string"?e:isNaN(e)?(e=t.weekdaysParse(e),typeof e=="number"?e:null):parseInt(e,10)}function A4(e,t){return typeof e=="string"?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function Lv(e,t){return e.slice(t,7).concat(e.slice(0,t))}var D4="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Ik="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),O4="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),M4=Mc,I4=Mc,L4=Mc;function F4(e,t){var r=Cn(this._weekdays)?this._weekdays:this._weekdays[e&&e!==!0&&this._weekdays.isFormat.test(t)?"format":"standalone"];return e===!0?Lv(r,this._week.dow):e?r[e.day()]:r}function z4(e){return e===!0?Lv(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function U4(e){return e===!0?Lv(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function $4(e,t,r){var n,s,o,i=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)o=Zn([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(o,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(o,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(o,"").toLocaleLowerCase();return r?t==="dddd"?(s=zt.call(this._weekdaysParse,i),s!==-1?s:null):t==="ddd"?(s=zt.call(this._shortWeekdaysParse,i),s!==-1?s:null):(s=zt.call(this._minWeekdaysParse,i),s!==-1?s:null):t==="dddd"?(s=zt.call(this._weekdaysParse,i),s!==-1||(s=zt.call(this._shortWeekdaysParse,i),s!==-1)?s:(s=zt.call(this._minWeekdaysParse,i),s!==-1?s:null)):t==="ddd"?(s=zt.call(this._shortWeekdaysParse,i),s!==-1||(s=zt.call(this._weekdaysParse,i),s!==-1)?s:(s=zt.call(this._minWeekdaysParse,i),s!==-1?s:null)):(s=zt.call(this._minWeekdaysParse,i),s!==-1||(s=zt.call(this._weekdaysParse,i),s!==-1)?s:(s=zt.call(this._shortWeekdaysParse,i),s!==-1?s:null))}function V4(e,t,r){var n,s,o;if(this._weekdaysParseExact)return $4.call(this,e,t,r);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(s=Zn([2e3,1]).day(n),r&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(s,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(s,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(s,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(o="^"+this.weekdays(s,"")+"|^"+this.weekdaysShort(s,"")+"|^"+this.weekdaysMin(s,""),this._weekdaysParse[n]=new RegExp(o.replace(".",""),"i")),r&&t==="dddd"&&this._fullWeekdaysParse[n].test(e))return n;if(r&&t==="ddd"&&this._shortWeekdaysParse[n].test(e))return n;if(r&&t==="dd"&&this._minWeekdaysParse[n].test(e))return n;if(!r&&this._weekdaysParse[n].test(e))return n}}function B4(e){if(!this.isValid())return e!=null?this:NaN;var t=ec(this,"Day");return e!=null?(e=P4(e,this.localeData()),this.add(e-t,"d")):t}function W4(e){if(!this.isValid())return e!=null?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return e==null?t:this.add(e-t,"d")}function H4(e){if(!this.isValid())return e!=null?this:NaN;if(e!=null){var t=A4(e,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function Y4(e){return this._weekdaysParseExact?(ct(this,"_weekdaysRegex")||Fv.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(ct(this,"_weekdaysRegex")||(this._weekdaysRegex=M4),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function K4(e){return this._weekdaysParseExact?(ct(this,"_weekdaysRegex")||Fv.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(ct(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=I4),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function G4(e){return this._weekdaysParseExact?(ct(this,"_weekdaysRegex")||Fv.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(ct(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=L4),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Fv(){function e(d,f){return f.length-d.length}var t=[],r=[],n=[],s=[],o,i,l,c,u;for(o=0;o<7;o++)i=Zn([2e3,1]).day(o),l=gs(this.weekdaysMin(i,"")),c=gs(this.weekdaysShort(i,"")),u=gs(this.weekdays(i,"")),t.push(l),r.push(c),n.push(u),s.push(l),s.push(c),s.push(u);t.sort(e),r.sort(e),n.sort(e),s.sort(e),this._weekdaysRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+t.join("|")+")","i")}function zv(){return this.hours()%12||12}function Z4(){return this.hours()||24}Ie("H",["HH",2],0,"hour");Ie("h",["hh",2],0,zv);Ie("k",["kk",2],0,Z4);Ie("hmm",0,0,function(){return""+zv.apply(this)+Yn(this.minutes(),2)});Ie("hmmss",0,0,function(){return""+zv.apply(this)+Yn(this.minutes(),2)+Yn(this.seconds(),2)});Ie("Hmm",0,0,function(){return""+this.hours()+Yn(this.minutes(),2)});Ie("Hmmss",0,0,function(){return""+this.hours()+Yn(this.minutes(),2)+Yn(this.seconds(),2)});function Lk(e,t){Ie(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}Lk("a",!0);Lk("A",!1);function Fk(e,t){return t._meridiemParse}je("a",Fk);je("A",Fk);je("H",Ct,Mv);je("h",Ct,Ia);je("k",Ct,Ia);je("HH",Ct,Zr);je("hh",Ct,Zr);je("kk",Ct,Zr);je("hmm",jk);je("hmmss",Ek);je("Hmm",jk);je("Hmmss",Ek);vt(["H","HH"],Zt);vt(["k","kk"],function(e,t,r){var n=rt(e);t[Zt]=n===24?0:n});vt(["a","A"],function(e,t,r){r._isPm=r._locale.isPM(e),r._meridiem=e});vt(["h","hh"],function(e,t,r){t[Zt]=rt(e),Xe(r).bigHour=!0});vt("hmm",function(e,t,r){var n=e.length-2;t[Zt]=rt(e.substr(0,n)),t[vn]=rt(e.substr(n)),Xe(r).bigHour=!0});vt("hmmss",function(e,t,r){var n=e.length-4,s=e.length-2;t[Zt]=rt(e.substr(0,n)),t[vn]=rt(e.substr(n,2)),t[hs]=rt(e.substr(s)),Xe(r).bigHour=!0});vt("Hmm",function(e,t,r){var n=e.length-2;t[Zt]=rt(e.substr(0,n)),t[vn]=rt(e.substr(n))});vt("Hmmss",function(e,t,r){var n=e.length-4,s=e.length-2;t[Zt]=rt(e.substr(0,n)),t[vn]=rt(e.substr(n,2)),t[hs]=rt(e.substr(s))});function q4(e){return(e+"").toLowerCase().charAt(0)==="p"}var X4=/[ap]\.?m?\.?/i,Q4=La("Hours",!0);function J4(e,t,r){return e>11?r?"pm":"PM":r?"am":"AM"}var zk={calendar:$L,longDateFormat:HL,invalidDate:KL,ordinal:ZL,dayOfMonthOrdinalParse:qL,relativeTime:QL,months:p4,monthsShort:Rk,week:j4,weekdays:D4,weekdaysMin:O4,weekdaysShort:Ik,meridiemParse:X4},Nt={},el={},nc;function e5(e,t){var r,n=Math.min(e.length,t.length);for(r=0;r0;){if(s=Ff(o.slice(0,r).join("-")),s)return s;if(n&&n.length>=r&&e5(o,n)>=r-1)break;r--}t++}return nc}function r5(e){return!!(e&&e.match("^[^/\\\\]*$"))}function Ff(e){var t=null,r;if(Nt[e]===void 0&&typeof qu<"u"&&qu&&qu.exports&&r5(e))try{t=nc._abbr,r=require,r("./locale/"+e),po(t)}catch{Nt[e]=null}return Nt[e]}function po(e,t){var r;return e&&(kr(t)?r=Ds(e):r=Uv(e,t),r?nc=r:typeof console<"u"&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),nc._abbr}function Uv(e,t){if(t!==null){var r,n=zk;if(t.abbr=e,Nt[e]!=null)bk("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=Nt[e]._config;else if(t.parentLocale!=null)if(Nt[t.parentLocale]!=null)n=Nt[t.parentLocale]._config;else if(r=Ff(t.parentLocale),r!=null)n=r._config;else return el[t.parentLocale]||(el[t.parentLocale]=[]),el[t.parentLocale].push({name:e,config:t}),null;return Nt[e]=new Rv(fm(n,t)),el[e]&&el[e].forEach(function(s){Uv(s.name,s.config)}),po(e),Nt[e]}else return delete Nt[e],null}function n5(e,t){if(t!=null){var r,n,s=zk;Nt[e]!=null&&Nt[e].parentLocale!=null?Nt[e].set(fm(Nt[e]._config,t)):(n=Ff(e),n!=null&&(s=n._config),t=fm(s,t),n==null&&(t.abbr=e),r=new Rv(t),r.parentLocale=Nt[e],Nt[e]=r),po(e)}else Nt[e]!=null&&(Nt[e].parentLocale!=null?(Nt[e]=Nt[e].parentLocale,e===po()&&po(e)):Nt[e]!=null&&delete Nt[e]);return Nt[e]}function Ds(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return nc;if(!Cn(e)){if(t=Ff(e),t)return t;e=[e]}return t5(e)}function s5(){return hm(Nt)}function $v(e){var t,r=e._a;return r&&Xe(e).overflow===-2&&(t=r[fs]<0||r[fs]>11?fs:r[Fn]<1||r[Fn]>Iv(r[cr],r[fs])?Fn:r[Zt]<0||r[Zt]>24||r[Zt]===24&&(r[vn]!==0||r[hs]!==0||r[Wo]!==0)?Zt:r[vn]<0||r[vn]>59?vn:r[hs]<0||r[hs]>59?hs:r[Wo]<0||r[Wo]>999?Wo:-1,Xe(e)._overflowDayOfYear&&(tFn)&&(t=Fn),Xe(e)._overflowWeeks&&t===-1&&(t=l4),Xe(e)._overflowWeekday&&t===-1&&(t=c4),Xe(e).overflow=t),e}var o5=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,i5=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,a5=/Z|[+-]\d\d(?::?\d\d)?/,Su=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Xh=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],l5=/^\/?Date\((-?\d+)/i,c5=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,u5={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Uk(e){var t,r,n=e._i,s=o5.exec(n)||i5.exec(n),o,i,l,c,u=Su.length,d=Xh.length;if(s){for(Xe(e).iso=!0,t=0,r=u;tCl(i)||e._dayOfYear===0)&&(Xe(e)._overflowDayOfYear=!0),r=tc(i,0,e._dayOfYear),e._a[fs]=r.getUTCMonth(),e._a[Fn]=r.getUTCDate()),t=0;t<3&&e._a[t]==null;++t)e._a[t]=n[t]=s[t];for(;t<7;t++)e._a[t]=n[t]=e._a[t]==null?t===2?1:0:e._a[t];e._a[Zt]===24&&e._a[vn]===0&&e._a[hs]===0&&e._a[Wo]===0&&(e._nextDay=!0,e._a[Zt]=0),e._d=(e._useUTC?tc:k4).apply(null,n),o=e._useUTC?e._d.getUTCDay():e._d.getDay(),e._tzm!=null&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[Zt]=24),e._w&&typeof e._w.d<"u"&&e._w.d!==o&&(Xe(e).weekdayMismatch=!0)}}function y5(e){var t,r,n,s,o,i,l,c,u;t=e._w,t.GG!=null||t.W!=null||t.E!=null?(o=1,i=4,r=Ni(t.GG,e._a[cr],rc(kt(),1,4).year),n=Ni(t.W,1),s=Ni(t.E,1),(s<1||s>7)&&(c=!0)):(o=e._locale._week.dow,i=e._locale._week.doy,u=rc(kt(),o,i),r=Ni(t.gg,e._a[cr],u.year),n=Ni(t.w,u.week),t.d!=null?(s=t.d,(s<0||s>6)&&(c=!0)):t.e!=null?(s=t.e+o,(t.e<0||t.e>6)&&(c=!0)):s=o),n<1||n>vs(r,o,i)?Xe(e)._overflowWeeks=!0:c!=null?Xe(e)._overflowWeekday=!0:(l=Mk(r,n,s,o,i),e._a[cr]=l.year,e._dayOfYear=l.dayOfYear)}ye.ISO_8601=function(){};ye.RFC_2822=function(){};function Bv(e){if(e._f===ye.ISO_8601){Uk(e);return}if(e._f===ye.RFC_2822){$k(e);return}e._a=[],Xe(e).empty=!0;var t=""+e._i,r,n,s,o,i,l=t.length,c=0,u,d;for(s=Sk(e._f,e._locale).match(Pv)||[],d=s.length,r=0;r0&&Xe(e).unusedInput.push(i),t=t.slice(t.indexOf(n)+n.length),c+=n.length),na[o]?(n?Xe(e).empty=!1:Xe(e).unusedTokens.push(o),a4(o,n,e)):e._strict&&!n&&Xe(e).unusedTokens.push(o);Xe(e).charsLeftOver=l-c,t.length>0&&Xe(e).unusedInput.push(t),e._a[Zt]<=12&&Xe(e).bigHour===!0&&e._a[Zt]>0&&(Xe(e).bigHour=void 0),Xe(e).parsedDateParts=e._a.slice(0),Xe(e).meridiem=e._meridiem,e._a[Zt]=x5(e._locale,e._a[Zt],e._meridiem),u=Xe(e).era,u!==null&&(e._a[cr]=e._locale.erasConvertYear(u,e._a[cr])),Vv(e),$v(e)}function x5(e,t,r){var n;return r==null?t:e.meridiemHour!=null?e.meridiemHour(t,r):(e.isPM!=null&&(n=e.isPM(r),n&&t<12&&(t+=12),!n&&t===12&&(t=0)),t)}function w5(e){var t,r,n,s,o,i,l=!1,c=e._f.length;if(c===0){Xe(e).invalidFormat=!0,e._d=new Date(NaN);return}for(s=0;sthis?this:e:Pf()});function Wk(e,t){var r,n;if(t.length===1&&Cn(t[0])&&(t=t[0]),!t.length)return kt();for(r=t[0],n=1;nthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function $5(){if(!kr(this._isDSTShifted))return this._isDSTShifted;var e={},t;return Tv(e,this),e=Vk(e),e._a?(t=e._isUTC?Zn(e._a):kt(e._a),this._isDSTShifted=this.isValid()&&A5(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function V5(){return this.isValid()?!this._isUTC:!1}function B5(){return this.isValid()?this._isUTC:!1}function Yk(){return this.isValid()?this._isUTC&&this._offset===0:!1}var W5=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,H5=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Rn(e,t){var r=e,n=null,s,o,i;return Hu(e)?r={ms:e._milliseconds,d:e._days,M:e._months}:Cs(e)||!isNaN(+e)?(r={},t?r[t]=+e:r.milliseconds=+e):(n=W5.exec(e))?(s=n[1]==="-"?-1:1,r={y:0,d:rt(n[Fn])*s,h:rt(n[Zt])*s,m:rt(n[vn])*s,s:rt(n[hs])*s,ms:rt(mm(n[Wo]*1e3))*s}):(n=H5.exec(e))?(s=n[1]==="-"?-1:1,r={y:Ao(n[2],s),M:Ao(n[3],s),w:Ao(n[4],s),d:Ao(n[5],s),h:Ao(n[6],s),m:Ao(n[7],s),s:Ao(n[8],s)}):r==null?r={}:typeof r=="object"&&("from"in r||"to"in r)&&(i=Y5(kt(r.from),kt(r.to)),r={},r.ms=i.milliseconds,r.M=i.months),o=new zf(r),Hu(e)&&ct(e,"_locale")&&(o._locale=e._locale),Hu(e)&&ct(e,"_isValid")&&(o._isValid=e._isValid),o}Rn.fn=zf.prototype;Rn.invalid=P5;function Ao(e,t){var r=e&&parseFloat(e.replace(",","."));return(isNaN(r)?0:r)*t}function lw(e,t){var r={};return r.months=t.month()-e.month()+(t.year()-e.year())*12,e.clone().add(r.months,"M").isAfter(t)&&--r.months,r.milliseconds=+t-+e.clone().add(r.months,"M"),r}function Y5(e,t){var r;return e.isValid()&&t.isValid()?(t=Hv(t,e),e.isBefore(t)?r=lw(e,t):(r=lw(t,e),r.milliseconds=-r.milliseconds,r.months=-r.months),r):{milliseconds:0,months:0}}function Kk(e,t){return function(r,n){var s,o;return n!==null&&!isNaN(+n)&&(bk(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),o=r,r=n,n=o),s=Rn(r,n),Gk(this,s,e),this}}function Gk(e,t,r,n){var s=t._milliseconds,o=mm(t._days),i=mm(t._months);e.isValid()&&(n=n??!0,i&&Ak(e,ec(e,"Month")+i*r),o&&Tk(e,"Date",ec(e,"Date")+o*r),s&&e._d.setTime(e._d.valueOf()+s*r),n&&ye.updateOffset(e,o||i))}var K5=Kk(1,"add"),G5=Kk(-1,"subtract");function Zk(e){return typeof e=="string"||e instanceof String}function Z5(e){return jn(e)||Dc(e)||Zk(e)||Cs(e)||X5(e)||q5(e)||e===null||e===void 0}function q5(e){var t=Zo(e)&&!Ev(e),r=!1,n=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],s,o,i=n.length;for(s=0;sr.valueOf():r.valueOf()9999?Wu(r,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):qn(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Wu(r,"Z")):Wu(r,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function dF(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="",r,n,s,o;return this.isLocal()||(e=this.utcOffset()===0?"moment.utc":"moment.parseZone",t="Z"),r="["+e+'("]',n=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",s="-MM-DD[T]HH:mm:ss.SSS",o=t+'[")]',this.format(r+n+s+o)}function fF(e){e||(e=this.isUtc()?ye.defaultFormatUtc:ye.defaultFormat);var t=Wu(this,e);return this.localeData().postformat(t)}function hF(e,t){return this.isValid()&&(jn(e)&&e.isValid()||kt(e).isValid())?Rn({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function pF(e){return this.from(kt(),e)}function mF(e,t){return this.isValid()&&(jn(e)&&e.isValid()||kt(e).isValid())?Rn({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function gF(e){return this.to(kt(),e)}function qk(e){var t;return e===void 0?this._locale._abbr:(t=Ds(e),t!=null&&(this._locale=t),this)}var Xk=an("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return e===void 0?this.localeData():this.locale(e)});function Qk(){return this._locale}var Ad=1e3,sa=60*Ad,Dd=60*sa,Jk=(365*400+97)*24*Dd;function oa(e,t){return(e%t+t)%t}function eC(e,t,r){return e<100&&e>=0?new Date(e+400,t,r)-Jk:new Date(e,t,r).valueOf()}function tC(e,t,r){return e<100&&e>=0?Date.UTC(e+400,t,r)-Jk:Date.UTC(e,t,r)}function vF(e){var t,r;if(e=ln(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(r=this._isUTC?tC:eC,e){case"year":t=r(this.year(),0,1);break;case"quarter":t=r(this.year(),this.month()-this.month()%3,1);break;case"month":t=r(this.year(),this.month(),1);break;case"week":t=r(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=r(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=oa(t+(this._isUTC?0:this.utcOffset()*sa),Dd);break;case"minute":t=this._d.valueOf(),t-=oa(t,sa);break;case"second":t=this._d.valueOf(),t-=oa(t,Ad);break}return this._d.setTime(t),ye.updateOffset(this,!0),this}function yF(e){var t,r;if(e=ln(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(r=this._isUTC?tC:eC,e){case"year":t=r(this.year()+1,0,1)-1;break;case"quarter":t=r(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=r(this.year(),this.month()+1,1)-1;break;case"week":t=r(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=r(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=Dd-oa(t+(this._isUTC?0:this.utcOffset()*sa),Dd)-1;break;case"minute":t=this._d.valueOf(),t+=sa-oa(t,sa)-1;break;case"second":t=this._d.valueOf(),t+=Ad-oa(t,Ad)-1;break}return this._d.setTime(t),ye.updateOffset(this,!0),this}function xF(){return this._d.valueOf()-(this._offset||0)*6e4}function wF(){return Math.floor(this.valueOf()/1e3)}function _F(){return new Date(this.valueOf())}function bF(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function SF(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function kF(){return this.isValid()?this.toISOString():null}function CF(){return Nv(this)}function jF(){return ro({},Xe(this))}function EF(){return Xe(this).overflow}function NF(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}Ie("N",0,0,"eraAbbr");Ie("NN",0,0,"eraAbbr");Ie("NNN",0,0,"eraAbbr");Ie("NNNN",0,0,"eraName");Ie("NNNNN",0,0,"eraNarrow");Ie("y",["y",1],"yo","eraYear");Ie("y",["yy",2],0,"eraYear");Ie("y",["yyy",3],0,"eraYear");Ie("y",["yyyy",4],0,"eraYear");je("N",Yv);je("NN",Yv);je("NNN",Yv);je("NNNN",zF);je("NNNNN",UF);vt(["N","NN","NNN","NNNN","NNNNN"],function(e,t,r,n){var s=r._locale.erasParse(e,n,r._strict);s?Xe(r).era=s:Xe(r).invalidEra=e});je("y",Ma);je("yy",Ma);je("yyy",Ma);je("yyyy",Ma);je("yo",$F);vt(["y","yy","yyy","yyyy"],cr);vt(["yo"],function(e,t,r,n){var s;r._locale._eraYearOrdinalRegex&&(s=e.match(r._locale._eraYearOrdinalRegex)),r._locale.eraYearOrdinalParse?t[cr]=r._locale.eraYearOrdinalParse(e,s):t[cr]=parseInt(e,10)});function TF(e,t){var r,n,s,o=this._eras||Ds("en")._eras;for(r=0,n=o.length;r=0)return o[n]}function PF(e,t){var r=e.since<=e.until?1:-1;return t===void 0?ye(e.since).year():ye(e.since).year()+(t-e.offset)*r}function AF(){var e,t,r,n=this.localeData().eras();for(e=0,t=n.length;eo&&(t=o),GF.call(this,e,t,r,n,s))}function GF(e,t,r,n,s){var o=Mk(e,t,r,n,s),i=tc(o.year,0,o.dayOfYear);return this.year(i.getUTCFullYear()),this.month(i.getUTCMonth()),this.date(i.getUTCDate()),this}Ie("Q",0,"Qo","quarter");je("Q",kk);vt("Q",function(e,t){t[fs]=(rt(e)-1)*3});function ZF(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}Ie("D",["DD",2],"Do","date");je("D",Ct,Ia);je("DD",Ct,Zr);je("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient});vt(["D","DD"],Fn);vt("Do",function(e,t){t[Fn]=rt(e.match(Ct)[0])});var nC=La("Date",!0);Ie("DDD",["DDDD",3],"DDDo","dayOfYear");je("DDD",Df);je("DDDD",Ck);vt(["DDD","DDDD"],function(e,t,r){r._dayOfYear=rt(e)});function qF(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return e==null?t:this.add(e-t,"d")}Ie("m",["mm",2],0,"minute");je("m",Ct,Mv);je("mm",Ct,Zr);vt(["m","mm"],vn);var XF=La("Minutes",!1);Ie("s",["ss",2],0,"second");je("s",Ct,Mv);je("ss",Ct,Zr);vt(["s","ss"],hs);var QF=La("Seconds",!1);Ie("S",0,0,function(){return~~(this.millisecond()/100)});Ie(0,["SS",2],0,function(){return~~(this.millisecond()/10)});Ie(0,["SSS",3],0,"millisecond");Ie(0,["SSSS",4],0,function(){return this.millisecond()*10});Ie(0,["SSSSS",5],0,function(){return this.millisecond()*100});Ie(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3});Ie(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4});Ie(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5});Ie(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6});je("S",Df,kk);je("SS",Df,Zr);je("SSS",Df,Ck);var no,sC;for(no="SSSS";no.length<=9;no+="S")je(no,Ma);function JF(e,t){t[Wo]=rt(("0."+e)*1e3)}for(no="S";no.length<=9;no+="S")vt(no,JF);sC=La("Milliseconds",!1);Ie("z",0,0,"zoneAbbr");Ie("zz",0,0,"zoneName");function e3(){return this._isUTC?"UTC":""}function t3(){return this._isUTC?"Coordinated Universal Time":""}var le=Oc.prototype;le.add=K5;le.calendar=eF;le.clone=tF;le.diff=lF;le.endOf=yF;le.format=fF;le.from=hF;le.fromNow=pF;le.to=mF;le.toNow=gF;le.get=d4;le.invalidAt=EF;le.isAfter=rF;le.isBefore=nF;le.isBetween=sF;le.isSame=oF;le.isSameOrAfter=iF;le.isSameOrBefore=aF;le.isValid=CF;le.lang=Xk;le.locale=qk;le.localeData=Qk;le.max=C5;le.min=k5;le.parsingFlags=jF;le.set=f4;le.startOf=vF;le.subtract=G5;le.toArray=bF;le.toObject=SF;le.toDate=_F;le.toISOString=uF;le.inspect=dF;typeof Symbol<"u"&&Symbol.for!=null&&(le[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"});le.toJSON=kF;le.toString=cF;le.unix=wF;le.valueOf=xF;le.creationData=NF;le.eraName=AF;le.eraNarrow=DF;le.eraAbbr=OF;le.eraYear=MF;le.year=Nk;le.isLeapYear=u4;le.weekYear=VF;le.isoWeekYear=BF;le.quarter=le.quarters=ZF;le.month=Dk;le.daysInMonth=_4;le.week=le.weeks=T4;le.isoWeek=le.isoWeeks=R4;le.weeksInYear=YF;le.weeksInWeekYear=KF;le.isoWeeksInYear=WF;le.isoWeeksInISOWeekYear=HF;le.date=nC;le.day=le.days=B4;le.weekday=W4;le.isoWeekday=H4;le.dayOfYear=qF;le.hour=le.hours=Q4;le.minute=le.minutes=XF;le.second=le.seconds=QF;le.millisecond=le.milliseconds=sC;le.utcOffset=O5;le.utc=I5;le.local=L5;le.parseZone=F5;le.hasAlignedHourOffset=z5;le.isDST=U5;le.isLocal=V5;le.isUtcOffset=B5;le.isUtc=Yk;le.isUTC=Yk;le.zoneAbbr=e3;le.zoneName=t3;le.dates=an("dates accessor is deprecated. Use date instead.",nC);le.months=an("months accessor is deprecated. Use month instead",Dk);le.years=an("years accessor is deprecated. Use year instead",Nk);le.zone=an("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",M5);le.isDSTShifted=an("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",$5);function r3(e){return kt(e*1e3)}function n3(){return kt.apply(null,arguments).parseZone()}function oC(e){return e}var ut=Rv.prototype;ut.calendar=VL;ut.longDateFormat=YL;ut.invalidDate=GL;ut.ordinal=XL;ut.preparse=oC;ut.postformat=oC;ut.relativeTime=JL;ut.pastFuture=e4;ut.set=UL;ut.eras=TF;ut.erasParse=RF;ut.erasConvertYear=PF;ut.erasAbbrRegex=LF;ut.erasNameRegex=IF;ut.erasNarrowRegex=FF;ut.months=v4;ut.monthsShort=y4;ut.monthsParse=w4;ut.monthsRegex=S4;ut.monthsShortRegex=b4;ut.week=C4;ut.firstDayOfYear=N4;ut.firstDayOfWeek=E4;ut.weekdays=F4;ut.weekdaysMin=U4;ut.weekdaysShort=z4;ut.weekdaysParse=V4;ut.weekdaysRegex=Y4;ut.weekdaysShortRegex=K4;ut.weekdaysMinRegex=G4;ut.isPM=q4;ut.meridiem=J4;function Od(e,t,r,n){var s=Ds(),o=Zn().set(n,t);return s[r](o,e)}function iC(e,t,r){if(Cs(e)&&(t=e,e=void 0),e=e||"",t!=null)return Od(e,t,r,"month");var n,s=[];for(n=0;n<12;n++)s[n]=Od(e,n,r,"month");return s}function Gv(e,t,r,n){typeof e=="boolean"?(Cs(t)&&(r=t,t=void 0),t=t||""):(t=e,r=t,e=!1,Cs(t)&&(r=t,t=void 0),t=t||"");var s=Ds(),o=e?s._week.dow:0,i,l=[];if(r!=null)return Od(t,(r+o)%7,n,"day");for(i=0;i<7;i++)l[i]=Od(t,(i+o)%7,n,"day");return l}function s3(e,t){return iC(e,t,"months")}function o3(e,t){return iC(e,t,"monthsShort")}function i3(e,t,r){return Gv(e,t,r,"weekdays")}function a3(e,t,r){return Gv(e,t,r,"weekdaysShort")}function l3(e,t,r){return Gv(e,t,r,"weekdaysMin")}po("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,r=rt(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return e+r}});ye.lang=an("moment.lang is deprecated. Use moment.locale instead.",po);ye.langData=an("moment.langData is deprecated. Use moment.localeData instead.",Ds);var ns=Math.abs;function c3(){var e=this._data;return this._milliseconds=ns(this._milliseconds),this._days=ns(this._days),this._months=ns(this._months),e.milliseconds=ns(e.milliseconds),e.seconds=ns(e.seconds),e.minutes=ns(e.minutes),e.hours=ns(e.hours),e.months=ns(e.months),e.years=ns(e.years),this}function aC(e,t,r,n){var s=Rn(t,r);return e._milliseconds+=n*s._milliseconds,e._days+=n*s._days,e._months+=n*s._months,e._bubble()}function u3(e,t){return aC(this,e,t,1)}function d3(e,t){return aC(this,e,t,-1)}function cw(e){return e<0?Math.floor(e):Math.ceil(e)}function f3(){var e=this._milliseconds,t=this._days,r=this._months,n=this._data,s,o,i,l,c;return e>=0&&t>=0&&r>=0||e<=0&&t<=0&&r<=0||(e+=cw(vm(r)+t)*864e5,t=0,r=0),n.milliseconds=e%1e3,s=en(e/1e3),n.seconds=s%60,o=en(s/60),n.minutes=o%60,i=en(o/60),n.hours=i%24,t+=en(i/24),c=en(lC(t)),r+=c,t-=cw(vm(c)),l=en(r/12),r%=12,n.days=t,n.months=r,n.years=l,this}function lC(e){return e*4800/146097}function vm(e){return e*146097/4800}function h3(e){if(!this.isValid())return NaN;var t,r,n=this._milliseconds;if(e=ln(e),e==="month"||e==="quarter"||e==="year")switch(t=this._days+n/864e5,r=this._months+lC(t),e){case"month":return r;case"quarter":return r/3;case"year":return r/12}else switch(t=this._days+Math.round(vm(this._months)),e){case"week":return t/7+n/6048e5;case"day":return t+n/864e5;case"hour":return t*24+n/36e5;case"minute":return t*1440+n/6e4;case"second":return t*86400+n/1e3;case"millisecond":return Math.floor(t*864e5)+n;default:throw new Error("Unknown unit "+e)}}function Os(e){return function(){return this.as(e)}}var cC=Os("ms"),p3=Os("s"),m3=Os("m"),g3=Os("h"),v3=Os("d"),y3=Os("w"),x3=Os("M"),w3=Os("Q"),_3=Os("y"),b3=cC;function S3(){return Rn(this)}function k3(e){return e=ln(e),this.isValid()?this[e+"s"]():NaN}function mi(e){return function(){return this.isValid()?this._data[e]:NaN}}var C3=mi("milliseconds"),j3=mi("seconds"),E3=mi("minutes"),N3=mi("hours"),T3=mi("days"),R3=mi("months"),P3=mi("years");function A3(){return en(this.days()/7)}var as=Math.round,Bi={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function D3(e,t,r,n,s){return s.relativeTime(t||1,!!r,e,n)}function O3(e,t,r,n){var s=Rn(e).abs(),o=as(s.as("s")),i=as(s.as("m")),l=as(s.as("h")),c=as(s.as("d")),u=as(s.as("M")),d=as(s.as("w")),f=as(s.as("y")),m=o<=r.ss&&["s",o]||o0,m[4]=n,D3.apply(null,m)}function M3(e){return e===void 0?as:typeof e=="function"?(as=e,!0):!1}function I3(e,t){return Bi[e]===void 0?!1:t===void 0?Bi[e]:(Bi[e]=t,e==="s"&&(Bi.ss=t-1),!0)}function L3(e,t){if(!this.isValid())return this.localeData().invalidDate();var r=!1,n=Bi,s,o;return typeof e=="object"&&(t=e,e=!1),typeof e=="boolean"&&(r=e),typeof t=="object"&&(n=Object.assign({},Bi,t),t.s!=null&&t.ss==null&&(n.ss=t.s-1)),s=this.localeData(),o=O3(this,!r,n,s),r&&(o=s.pastFuture(+this,o)),s.postformat(o)}var Qh=Math.abs;function ji(e){return(e>0)-(e<0)||+e}function $f(){if(!this.isValid())return this.localeData().invalidDate();var e=Qh(this._milliseconds)/1e3,t=Qh(this._days),r=Qh(this._months),n,s,o,i,l=this.asSeconds(),c,u,d,f;return l?(n=en(e/60),s=en(n/60),e%=60,n%=60,o=en(r/12),r%=12,i=e?e.toFixed(3).replace(/\.?0+$/,""):"",c=l<0?"-":"",u=ji(this._months)!==ji(l)?"-":"",d=ji(this._days)!==ji(l)?"-":"",f=ji(this._milliseconds)!==ji(l)?"-":"",c+"P"+(o?u+o+"Y":"")+(r?u+r+"M":"")+(t?d+t+"D":"")+(s||n||e?"T":"")+(s?f+s+"H":"")+(n?f+n+"M":"")+(e?f+i+"S":"")):"P0D"}var it=zf.prototype;it.isValid=R5;it.abs=c3;it.add=u3;it.subtract=d3;it.as=h3;it.asMilliseconds=cC;it.asSeconds=p3;it.asMinutes=m3;it.asHours=g3;it.asDays=v3;it.asWeeks=y3;it.asMonths=x3;it.asQuarters=w3;it.asYears=_3;it.valueOf=b3;it._bubble=f3;it.clone=S3;it.get=k3;it.milliseconds=C3;it.seconds=j3;it.minutes=E3;it.hours=N3;it.days=T3;it.weeks=A3;it.months=R3;it.years=P3;it.humanize=L3;it.toISOString=$f;it.toString=$f;it.toJSON=$f;it.locale=qk;it.localeData=Qk;it.toIsoString=an("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",$f);it.lang=Xk;Ie("X",0,0,"unix");Ie("x",0,0,"valueOf");je("x",Mf);je("X",s4);vt("X",function(e,t,r){r._d=new Date(parseFloat(e)*1e3)});vt("x",function(e,t,r){r._d=new Date(rt(e))});//! moment.js +ye.version="2.30.1";FL(kt);ye.fn=le;ye.min=j5;ye.max=E5;ye.now=N5;ye.utc=Zn;ye.unix=r3;ye.months=s3;ye.isDate=Dc;ye.locale=po;ye.invalid=Pf;ye.duration=Rn;ye.isMoment=jn;ye.weekdays=i3;ye.parseZone=n3;ye.localeData=Ds;ye.isDuration=Hu;ye.monthsShort=o3;ye.weekdaysMin=l3;ye.defineLocale=Uv;ye.updateLocale=n5;ye.locales=s5;ye.weekdaysShort=a3;ye.normalizeUnits=ln;ye.relativeTimeRounding=M3;ye.relativeTimeThreshold=I3;ye.calendarFormat=J5;ye.prototype=le;ye.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};const F3=async()=>await st().collection("access").getFullList({sort:"-created",filter:"deleted = null"}),Ms=async e=>e.id?await st().collection("access").update(e.id,e):await st().collection("access").create(e),z3=async e=>(e.deleted=ye.utc().format("YYYY-MM-DD HH:mm:ss"),await st().collection("access").update(e.id,e)),uw=async()=>await st().collection("access_groups").getFullList({sort:"-created",expand:"access"}),U3=async e=>{const t=st();if((await t.collection("access").getList(1,1,{filter:`group='${e}' && deleted=null`})).items.length>0)throw new Error("该分组下有授权配置,无法删除");await t.collection("access_groups").delete(e)},$3=async e=>{const t=st();return e.id?await t.collection("access_groups").update(e.id,e):await t.collection("access_groups").create(e)},dw=async e=>await st().collection("access_groups").update(e.id,e),V3=(e,t)=>{switch(t.type){case"SET_ACCESSES":return{...e,accesses:t.payload};case"ADD_ACCESS":return{...e,accesses:[t.payload,...e.accesses]};case"DELETE_ACCESS":return{...e,accesses:e.accesses.filter(r=>r.id!==t.payload)};case"UPDATE_ACCESS":return{...e,accesses:e.accesses.map(r=>r.id===t.payload.id?t.payload:r)};case"SET_EMAILS":return{...e,emails:t.payload};case"ADD_EMAIL":return{...e,emails:{...e.emails,content:{emails:[...e.emails.content.emails,t.payload]}}};case"SET_ACCESS_GROUPS":return{...e,accessGroups:t.payload};default:return e}},B3=async()=>{try{return await st().collection("settings").getFirstListItem("name='emails'")}catch{return{content:{emails:[]}}}},Zv=async e=>{try{return await st().collection("settings").getFirstListItem(`name='${e}'`)}catch{return{name:e}}},Fa=async e=>{const t=st();let r;return e.id?r=await t.collection("settings").update(e.id,e):r=await t.collection("settings").create(e),r},uC=g.createContext({}),Ar=()=>g.useContext(uC),W3=({children:e})=>{const[t,r]=g.useReducer(V3,{accesses:[],emails:{content:{emails:[]}},accessGroups:[]});g.useEffect(()=>{(async()=>{const d=await F3();r({type:"SET_ACCESSES",payload:d})})()},[]),g.useEffect(()=>{(async()=>{const d=await B3();r({type:"SET_EMAILS",payload:d})})()},[]),g.useEffect(()=>{(async()=>{const d=await uw();r({type:"SET_ACCESS_GROUPS",payload:d})})()},[]);const n=g.useCallback(async()=>{const u=await uw();r({type:"SET_ACCESS_GROUPS",payload:u})},[]),s=g.useCallback(u=>{r({type:"SET_EMAILS",payload:u})},[]),o=g.useCallback(u=>{r({type:"DELETE_ACCESS",payload:u})},[]),i=g.useCallback(u=>{r({type:"ADD_ACCESS",payload:u})},[]),l=g.useCallback(u=>{r({type:"UPDATE_ACCESS",payload:u})},[]),c=g.useCallback(u=>{r({type:"SET_ACCESS_GROUPS",payload:u})},[]);return a.jsx(uC.Provider,{value:{config:{accesses:t.accesses,emails:t.emails,accessGroups:t.accessGroups},deleteAccess:o,addAccess:i,setEmails:s,updateAccess:l,setAccessGroups:c,reloadAccessGroups:n},children:e&&e})},H3={theme:"system",setTheme:()=>null},dC=g.createContext(H3);function Y3({children:e,defaultTheme:t="system",storageKey:r="vite-ui-theme",...n}){const[s,o]=g.useState(()=>localStorage.getItem(r)||t);g.useEffect(()=>{const l=window.document.documentElement;if(l.classList.remove("light","dark"),s==="system"){const c=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";l.classList.add(c);return}l.classList.add(s)},[s]);const i={theme:s,setTheme:l=>{localStorage.setItem(r,l),o(l)}};return a.jsx(dC.Provider,{...n,value:i,children:e})}const K3=()=>{const e=g.useContext(dC);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};function G3(){const{setTheme:e}=K3();return a.jsxs(KS,{children:[a.jsx(GS,{asChild:!0,children:a.jsxs(He,{variant:"outline",size:"icon",children:[a.jsx(LA,{className:"h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),a.jsx(OA,{className:"absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100 dark:text-white"}),a.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),a.jsxs(pv,{align:"end",children:[a.jsx(ta,{onClick:()=>e("light"),children:"浅色"}),a.jsx(ta,{onClick:()=>e("dark"),children:"暗黑"}),a.jsx(ta,{onClick:()=>e("system"),children:"系统"})]})]})}var Z3="Separator",fw="horizontal",q3=["horizontal","vertical"],fC=g.forwardRef((e,t)=>{const{decorative:r,orientation:n=fw,...s}=e,o=X3(n)?n:fw,l=r?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return a.jsx(Re.div,{"data-orientation":o,...l,...s,ref:t})});fC.displayName=Z3;function X3(e){return q3.includes(e)}var hC=fC;const Bt=g.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...n},s)=>a.jsx(hC,{ref:s,decorative:r,orientation:t,className:oe("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...n}));Bt.displayName=hC.displayName;const Q3="Certimate v0.1.11",pC=()=>a.jsxs("div",{className:"fixed right-0 bottom-0 w-full flex justify-between p-5",children:[a.jsx("div",{className:""}),a.jsxs("div",{className:"text-muted-foreground text-sm hover:text-stone-900 dark:hover:text-stone-200 flex",children:[a.jsxs("a",{href:"https://docs.certimate.me",target:"_blank",className:"flex items-center",children:[a.jsx(bA,{size:16}),a.jsx("div",{className:"ml-1",children:"文档"})]}),a.jsx(Bt,{orientation:"vertical",className:"mx-2"}),a.jsx("a",{href:"https://github.com/usual2970/certimate/releases",target:"_blank",children:Q3})]})]});function J3(){const e=Pr(),t=Nn();if(!st().authStore.isValid||!st().authStore.isAdmin)return a.jsx(ib,{to:"/login"});const r=t.pathname,n=i=>(console.log(r),i==r?"bg-muted text-primary":"text-muted-foreground"),s=()=>{st().authStore.clear(),e("/login")},o=()=>{e("/setting/account")};return a.jsx(a.Fragment,{children:a.jsx(W3,{children:a.jsxs("div",{className:"grid min-h-screen w-full md:grid-cols-[180px_1fr] lg:grid-cols-[200px_1fr] 2xl:md:grid-cols-[280px_1fr] ",children:[a.jsx("div",{className:"hidden border-r dark:border-stone-500 bg-muted/40 md:block",children:a.jsxs("div",{className:"flex h-full max-h-screen flex-col gap-2",children:[a.jsx("div",{className:"flex h-14 items-center border-b dark:border-stone-500 px-4 lg:h-[60px] lg:px-6",children:a.jsxs(gr,{to:"/",className:"flex items-center gap-2 font-semibold",children:[a.jsx("img",{src:"/vite.svg",className:"w-[36px] h-[36px]"}),a.jsx("span",{className:"dark:text-white",children:"Certimate"})]})}),a.jsx("div",{className:"flex-1",children:a.jsxs("nav",{className:"grid items-start px-2 text-sm font-medium lg:px-4",children:[a.jsxs(gr,{to:"/",className:oe("flex items-center gap-3 rounded-lg px-3 py-2 transition-all hover:text-primary",n("/")),children:[a.jsx(E0,{className:"h-4 w-4"}),"控制面板"]}),a.jsxs(gr,{to:"/domains",className:oe("flex items-center gap-3 rounded-lg px-3 py-2 transition-all hover:text-primary",n("/domains")),children:[a.jsx(rm,{className:"h-4 w-4"}),"域名列表"]}),a.jsxs(gr,{to:"/access",className:oe("flex items-center gap-3 rounded-lg px-3 py-2 transition-all hover:text-primary",n("/access")),children:[a.jsx(N0,{className:"h-4 w-4"}),"授权管理"]}),a.jsxs(gr,{to:"/history",className:oe("flex items-center gap-3 rounded-lg px-3 py-2 transition-all hover:text-primary",n("/history")),children:[a.jsx(j0,{className:"h-4 w-4"}),"部署历史"]})]})})]})}),a.jsxs("div",{className:"flex flex-col",children:[a.jsxs("header",{className:"flex h-14 items-center gap-4 border-b dark:border-stone-500 bg-muted/40 px-4 lg:h-[60px] lg:px-6",children:[a.jsxs(bv,{children:[a.jsx(Sv,{asChild:!0,children:a.jsxs(He,{variant:"outline",size:"icon",className:"shrink-0 md:hidden",children:[a.jsx(DA,{className:"h-5 w-5 dark:text-white"}),a.jsx("span",{className:"sr-only",children:"Toggle navigation menu"})]})}),a.jsx(Rf,{side:"left",className:"flex flex-col",children:a.jsxs("nav",{className:"grid gap-2 text-lg font-medium",children:[a.jsxs(gr,{to:"/",className:"flex items-center gap-2 text-lg font-semibold",children:[a.jsx("img",{src:"/vite.svg",className:"w-[36px] h-[36px]"}),a.jsx("span",{className:"dark:text-white",children:"Certimate"}),a.jsx("span",{className:"sr-only",children:"Certimate"})]}),a.jsxs(gr,{to:"/",className:oe("mx-[-0.65rem] flex items-center gap-4 rounded-xl px-3 py-2 hover:text-foreground",n("/")),children:[a.jsx(E0,{className:"h-5 w-5"}),"控制面板"]}),a.jsxs(gr,{to:"/domains",className:oe("mx-[-0.65rem] flex items-center gap-4 rounded-xl px-3 py-2 hover:text-foreground",n("/domains")),children:[a.jsx(rm,{className:"h-5 w-5"}),"域名列表"]}),a.jsxs(gr,{to:"/access",className:oe("mx-[-0.65rem] flex items-center gap-4 rounded-xl px-3 py-2 hover:text-foreground",n("/access")),children:[a.jsx(N0,{className:"h-5 w-5"}),"授权管理"]}),a.jsxs(gr,{to:"/history",className:oe("mx-[-0.65rem] flex items-center gap-4 rounded-xl px-3 py-2 hover:text-foreground",n("/history")),children:[a.jsx(j0,{className:"h-5 w-5"}),"部署历史"]})]})})]}),a.jsx("div",{className:"w-full flex-1"}),a.jsx(G3,{}),a.jsxs(KS,{children:[a.jsx(GS,{asChild:!0,children:a.jsxs(He,{variant:"secondary",size:"icon",className:"rounded-full",children:[a.jsx(EA,{className:"h-5 w-5"}),a.jsx("span",{className:"sr-only",children:"Toggle user menu"})]})}),a.jsxs(pv,{align:"end",children:[a.jsx(ZS,{children:"账户"}),a.jsx(qS,{}),a.jsx(ta,{onClick:o,children:"偏好设置"}),a.jsx(ta,{onClick:s,children:"退出"})]})]})]}),a.jsxs("main",{className:"flex flex-1 flex-col gap-4 p-4 lg:gap-6 lg:p-6 relative",children:[a.jsx(Lg,{}),a.jsx(pC,{})]})]})]})})})}const qv=({phase:e,phaseSuccess:t})=>{let r=a.jsx(a.Fragment,{children:" "});return e==="check"&&(t?r=a.jsxs("div",{className:"flex items-center",children:[a.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"检查 "}),a.jsx(Bt,{className:"h-1 grow"}),a.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"获取"}),a.jsx(Bt,{className:"h-1 grow"}),a.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"部署"})]}):r=a.jsxs("div",{className:"flex items-center",children:[a.jsx("div",{className:"text-xs text-nowrap text-red-600",children:"检查 "}),a.jsx(Bt,{className:"h-1 grow"}),a.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"获取"}),a.jsx(Bt,{className:"h-1 grow"}),a.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"部署"})]})),e==="apply"&&(t?r=a.jsxs("div",{className:"flex items-center",children:[a.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"检查 "}),a.jsx(Bt,{className:"h-1 grow bg-green-600"}),a.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"获取"}),a.jsx(Bt,{className:"h-1 grow"}),a.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"部署"})]}):r=a.jsxs("div",{className:"flex items-center",children:[a.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"检查 "}),a.jsx(Bt,{className:"h-1 grow bg-green-600"}),a.jsx("div",{className:"text-xs text-nowrap text-red-600",children:"获取"}),a.jsx(Bt,{className:"h-1 grow"}),a.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"部署"})]})),e==="deploy"&&(t?r=a.jsxs("div",{className:"flex items-center",children:[a.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"检查 "}),a.jsx(Bt,{className:"h-1 grow bg-green-600"}),a.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"获取"}),a.jsx(Bt,{className:"h-1 grow bg-green-600"}),a.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"部署"})]}):r=a.jsxs("div",{className:"flex items-center",children:[a.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"检查 "}),a.jsx(Bt,{className:"h-1 grow bg-green-600"}),a.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"获取"}),a.jsx(Bt,{className:"h-1 grow bg-green-600"}),a.jsx("div",{className:"text-xs text-nowrap text-red-600",children:"部署"})]})),r};var e6="VisuallyHidden",Lc=g.forwardRef((e,t)=>a.jsx(Re.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));Lc.displayName=e6;var t6=Lc,[Vf,J$]=sr("Tooltip",[Da]),Bf=Da(),mC="TooltipProvider",r6=700,ym="tooltip.open",[n6,Xv]=Vf(mC),Qv=e=>{const{__scopeTooltip:t,delayDuration:r=r6,skipDelayDuration:n=300,disableHoverableContent:s=!1,children:o}=e,[i,l]=g.useState(!0),c=g.useRef(!1),u=g.useRef(0);return g.useEffect(()=>{const d=u.current;return()=>window.clearTimeout(d)},[]),a.jsx(n6,{scope:t,isOpenDelayed:i,delayDuration:r,onOpen:g.useCallback(()=>{window.clearTimeout(u.current),l(!1)},[]),onClose:g.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>l(!0),n)},[n]),isPointerInTransitRef:c,onPointerInTransitChange:g.useCallback(d=>{c.current=d},[]),disableHoverableContent:s,children:o})};Qv.displayName=mC;var Wf="Tooltip",[s6,Hf]=Vf(Wf),gC=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:s=!1,onOpenChange:o,disableHoverableContent:i,delayDuration:l}=e,c=Xv(Wf,e.__scopeTooltip),u=Bf(t),[d,f]=g.useState(null),m=$r(),v=g.useRef(0),x=i??c.disableHoverableContent,y=l??c.delayDuration,_=g.useRef(!1),[p=!1,h]=Yr({prop:n,defaultProp:s,onChange:R=>{R?(c.onOpen(),document.dispatchEvent(new CustomEvent(ym))):c.onClose(),o==null||o(R)}}),w=g.useMemo(()=>p?_.current?"delayed-open":"instant-open":"closed",[p]),C=g.useCallback(()=>{window.clearTimeout(v.current),_.current=!1,h(!0)},[h]),j=g.useCallback(()=>{window.clearTimeout(v.current),h(!1)},[h]),E=g.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>{_.current=!0,h(!0)},y)},[y,h]);return g.useEffect(()=>()=>window.clearTimeout(v.current),[]),a.jsx(Jg,{...u,children:a.jsx(s6,{scope:t,contentId:m,open:p,stateAttribute:w,trigger:d,onTriggerChange:f,onTriggerEnter:g.useCallback(()=>{c.isOpenDelayed?E():C()},[c.isOpenDelayed,E,C]),onTriggerLeave:g.useCallback(()=>{x?j():window.clearTimeout(v.current)},[j,x]),onOpen:C,onClose:j,disableHoverableContent:x,children:r})})};gC.displayName=Wf;var xm="TooltipTrigger",vC=g.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=Hf(xm,r),o=Xv(xm,r),i=Bf(r),l=g.useRef(null),c=Ke(t,l,s.onTriggerChange),u=g.useRef(!1),d=g.useRef(!1),f=g.useCallback(()=>u.current=!1,[]);return g.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),a.jsx(ev,{asChild:!0,...i,children:a.jsx(Re.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...n,ref:c,onPointerMove:ue(e.onPointerMove,m=>{m.pointerType!=="touch"&&!d.current&&!o.isPointerInTransitRef.current&&(s.onTriggerEnter(),d.current=!0)}),onPointerLeave:ue(e.onPointerLeave,()=>{s.onTriggerLeave(),d.current=!1}),onPointerDown:ue(e.onPointerDown,()=>{u.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:ue(e.onFocus,()=>{u.current||s.onOpen()}),onBlur:ue(e.onBlur,s.onClose),onClick:ue(e.onClick,s.onClose)})})});vC.displayName=xm;var o6="TooltipPortal",[eV,i6]=Vf(o6,{forceMount:void 0}),va="TooltipContent",Jv=g.forwardRef((e,t)=>{const r=i6(va,e.__scopeTooltip),{forceMount:n=r.forceMount,side:s="top",...o}=e,i=Hf(va,e.__scopeTooltip);return a.jsx(or,{present:n||i.open,children:i.disableHoverableContent?a.jsx(yC,{side:s,...o,ref:t}):a.jsx(a6,{side:s,...o,ref:t})})}),a6=g.forwardRef((e,t)=>{const r=Hf(va,e.__scopeTooltip),n=Xv(va,e.__scopeTooltip),s=g.useRef(null),o=Ke(t,s),[i,l]=g.useState(null),{trigger:c,onClose:u}=r,d=s.current,{onPointerInTransitChange:f}=n,m=g.useCallback(()=>{l(null),f(!1)},[f]),v=g.useCallback((x,y)=>{const _=x.currentTarget,p={x:x.clientX,y:x.clientY},h=d6(p,_.getBoundingClientRect()),w=f6(p,h),C=h6(y.getBoundingClientRect()),j=m6([...w,...C]);l(j),f(!0)},[f]);return g.useEffect(()=>()=>m(),[m]),g.useEffect(()=>{if(c&&d){const x=_=>v(_,d),y=_=>v(_,c);return c.addEventListener("pointerleave",x),d.addEventListener("pointerleave",y),()=>{c.removeEventListener("pointerleave",x),d.removeEventListener("pointerleave",y)}}},[c,d,v,m]),g.useEffect(()=>{if(i){const x=y=>{const _=y.target,p={x:y.clientX,y:y.clientY},h=(c==null?void 0:c.contains(_))||(d==null?void 0:d.contains(_)),w=!p6(p,i);h?m():w&&(m(),u())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[c,d,i,u,m]),a.jsx(yC,{...e,ref:o})}),[l6,c6]=Vf(Wf,{isInside:!1}),yC=g.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":s,onEscapeKeyDown:o,onPointerDownOutside:i,...l}=e,c=Hf(va,r),u=Bf(r),{onClose:d}=c;return g.useEffect(()=>(document.addEventListener(ym,d),()=>document.removeEventListener(ym,d)),[d]),g.useEffect(()=>{if(c.trigger){const f=m=>{const v=m.target;v!=null&&v.contains(c.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[c.trigger,d]),a.jsx(Ra,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:f=>f.preventDefault(),onDismiss:d,children:a.jsxs(tv,{"data-state":c.stateAttribute,...u,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[a.jsx(Ug,{children:n}),a.jsx(l6,{scope:r,isInside:!0,children:a.jsx(t6,{id:c.contentId,role:"tooltip",children:s||n})})]})})});Jv.displayName=va;var xC="TooltipArrow",u6=g.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=Bf(r);return c6(xC,r).isInside?null:a.jsx(rv,{...s,...n,ref:t})});u6.displayName=xC;function d6(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(r,n,s,o)){case o:return"left";case s:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function f6(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function h6(e){const{top:t,right:r,bottom:n,left:s}=e;return[{x:s,y:t},{x:r,y:t},{x:r,y:n},{x:s,y:n}]}function p6(e,t){const{x:r,y:n}=e;let s=!1;for(let o=0,i=t.length-1;on!=d>n&&r<(u-l)*(n-c)/(d-c)+l&&(s=!s)}return s}function m6(e){const t=e.slice();return t.sort((r,n)=>r.xn.x?1:r.yn.y?1:0),g6(t)}function g6(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n=2;){const o=t[t.length-1],i=t[t.length-2];if((o.x-i.x)*(s.y-i.y)>=(o.y-i.y)*(s.x-i.x))t.pop();else break}t.push(s)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const s=e[n];for(;r.length>=2;){const o=r[r.length-1],i=r[r.length-2];if((o.x-i.x)*(s.y-i.y)>=(o.y-i.y)*(s.x-i.x))r.pop();else break}r.push(s)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var v6=Qv,y6=gC,x6=vC,wC=Jv;const w6=v6,_C=y6,bC=x6,SC=g.forwardRef(({className:e,sideOffset:t=4,...r},n)=>a.jsx(wC,{ref:n,sideOffset:t,className:oe("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));SC.displayName=wC.displayName;const ey=({deployment:e})=>{const t=r=>e.log[r]?e.log[r][e.log[r].length-1].error:"";return a.jsx(a.Fragment,{children:e.phase==="deploy"&&e.phaseSuccess||e.wholeSuccess?a.jsx(jA,{size:16,className:"text-green-700"}):a.jsx(a.Fragment,{children:t(e.phase).length?a.jsx(w6,{children:a.jsxs(_C,{children:[a.jsx(bC,{asChild:!0,className:"cursor-pointer",children:a.jsx(k0,{size:16,className:"text-red-700"})}),a.jsx(SC,{className:"max-w-[35em]",children:t(e.phase)})]})}):a.jsx(k0,{size:16,className:"text-red-700"})})})},kC=({className:e,...t})=>a.jsx("nav",{role:"navigation","aria-label":"pagination",className:oe("mx-auto flex w-full justify-center",e),...t});kC.displayName="Pagination";const CC=g.forwardRef(({className:e,...t},r)=>a.jsx("ul",{ref:r,className:oe("flex flex-row items-center gap-1",e),...t}));CC.displayName="PaginationContent";const wm=g.forwardRef(({className:e,...t},r)=>a.jsx("li",{ref:r,className:oe("",e),...t}));wm.displayName="PaginationItem";const jC=({className:e,isActive:t,size:r="icon",...n})=>a.jsx("a",{"aria-current":t?"page":void 0,className:oe(wf({variant:t?"outline":"ghost",size:r}),e),...n});jC.displayName="PaginationLink";const EC=({className:e,...t})=>a.jsxs("span",{"aria-hidden":!0,className:oe("flex h-9 w-9 items-center justify-center",e),...t,children:[a.jsx(NA,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"More pages"})]});EC.displayName="PaginationEllipsis";const NC=({totalPages:e,currentPage:t,onPageChange:r})=>{const s=()=>{if(e>7){let u=[];const d=Math.max(2,t-1),f=Math.min(e-1,t+1),m=e-1;return u=o(d,f),t>3&&u.unshift("..."),t{let d=l;const f=[];for(;d<=c;)f.push(d),d+=u;return f},i=s();return a.jsx(a.Fragment,{children:a.jsx(kC,{className:"dark:text-stone-200 justify-end mt-3",children:a.jsx(CC,{children:i.map((l,c)=>l==="..."?a.jsx(wm,{children:a.jsx(EC,{})},c):a.jsx(wm,{children:a.jsx(jC,{href:"#",isActive:t==l,onClick:u=>{u.preventDefault(),r(l)},children:l})},c))})})})},ia=({when:e,children:t,fallback:r})=>e?t:r;var TC="AlertDialog",[_6,tV]=sr(TC,[QS]),Is=QS(),RC=e=>{const{__scopeAlertDialog:t,...r}=e,n=Is(t);return a.jsx(xv,{...n,...r,modal:!0})};RC.displayName=TC;var b6="AlertDialogTrigger",PC=g.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Is(r);return a.jsx(wv,{...s,...n,ref:t})});PC.displayName=b6;var S6="AlertDialogPortal",AC=e=>{const{__scopeAlertDialog:t,...r}=e,n=Is(t);return a.jsx(_v,{...n,...r})};AC.displayName=S6;var k6="AlertDialogOverlay",DC=g.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Is(r);return a.jsx(Tc,{...s,...n,ref:t})});DC.displayName=k6;var aa="AlertDialogContent",[C6,j6]=_6(aa),OC=g.forwardRef((e,t)=>{const{__scopeAlertDialog:r,children:n,...s}=e,o=Is(r),i=g.useRef(null),l=Ke(t,i),c=g.useRef(null);return a.jsx(hL,{contentName:aa,titleName:MC,docsSlug:"alert-dialog",children:a.jsx(C6,{scope:r,cancelRef:c,children:a.jsxs(Rc,{role:"alertdialog",...o,...s,ref:l,onOpenAutoFocus:ue(s.onOpenAutoFocus,u=>{var d;u.preventDefault(),(d=c.current)==null||d.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[a.jsx(Ug,{children:n}),a.jsx(N6,{contentRef:i})]})})})});OC.displayName=aa;var MC="AlertDialogTitle",IC=g.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Is(r);return a.jsx(Pc,{...s,...n,ref:t})});IC.displayName=MC;var LC="AlertDialogDescription",FC=g.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Is(r);return a.jsx(Ac,{...s,...n,ref:t})});FC.displayName=LC;var E6="AlertDialogAction",zC=g.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Is(r);return a.jsx(Tf,{...s,...n,ref:t})});zC.displayName=E6;var UC="AlertDialogCancel",$C=g.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,{cancelRef:s}=j6(UC,r),o=Is(r),i=Ke(t,s);return a.jsx(Tf,{...o,...n,ref:i})});$C.displayName=UC;var N6=({contentRef:e})=>{const t=`\`${aa}\` requires a description for the component to be accessible for screen reader users. You can add a description to the \`${aa}\` by passing a \`${LC}\` component as a child, which also benefits sighted users by adding visible context to the dialog. Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${aa}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. -For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return g.useEffect(()=>{var n;document.getElementById((n=e.current)==null?void 0:n.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},T6=RC,R6=PC,P6=AC,VC=DC,BC=OC,WC=zC,HC=$C,YC=IC,KC=FC;const GC=T6,ZC=R6,A6=P6,qC=g.forwardRef(({className:e,...t},r)=>l.jsx(VC,{className:oe("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));qC.displayName=VC.displayName;const ty=g.forwardRef(({className:e,...t},r)=>l.jsxs(A6,{children:[l.jsx(qC,{}),l.jsx(BC,{ref:r,className:oe("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));ty.displayName=BC.displayName;const ry=({className:e,...t})=>l.jsx("div",{className:oe("flex flex-col space-y-2 text-center sm:text-left",e),...t});ry.displayName="AlertDialogHeader";const ny=({className:e,...t})=>l.jsx("div",{className:oe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});ny.displayName="AlertDialogFooter";const sy=g.forwardRef(({className:e,...t},r)=>l.jsx(YC,{ref:r,className:oe("text-lg font-semibold",e),...t}));sy.displayName=YC.displayName;const oy=g.forwardRef(({className:e,...t},r)=>l.jsx(KC,{ref:r,className:oe("text-sm text-muted-foreground",e),...t}));oy.displayName=KC.displayName;const iy=g.forwardRef(({className:e,...t},r)=>l.jsx(WC,{ref:r,className:oe(wf(),e),...t}));iy.displayName=WC.displayName;const ay=g.forwardRef(({className:e,...t},r)=>l.jsx(HC,{ref:r,className:oe(wf({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));ay.displayName=HC.displayName;function ly(e){const t=g.useRef({value:e,previous:e});return g.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var cy="Switch",[D6,tV]=sr(cy),[O6,M6]=D6(cy),XC=g.forwardRef((e,t)=>{const{__scopeSwitch:r,name:n,checked:s,defaultChecked:o,required:i,disabled:a,value:c="on",onCheckedChange:u,...d}=e,[f,m]=g.useState(null),v=Ke(t,h=>m(h)),x=g.useRef(!1),y=f?!!f.closest("form"):!0,[_=!1,p]=Hr({prop:s,defaultProp:o,onChange:u});return l.jsxs(O6,{scope:r,checked:_,disabled:a,children:[l.jsx(Re.button,{type:"button",role:"switch","aria-checked":_,"aria-required":i,"data-state":ej(_),"data-disabled":a?"":void 0,disabled:a,value:c,...d,ref:v,onClick:ce(e.onClick,h=>{p(w=>!w),y&&(x.current=h.isPropagationStopped(),x.current||h.stopPropagation())})}),y&&l.jsx(I6,{control:f,bubbles:!x.current,name:n,value:c,checked:_,required:i,disabled:a,style:{transform:"translateX(-100%)"}})]})});XC.displayName=cy;var QC="SwitchThumb",JC=g.forwardRef((e,t)=>{const{__scopeSwitch:r,...n}=e,s=M6(QC,r);return l.jsx(Re.span,{"data-state":ej(s.checked),"data-disabled":s.disabled?"":void 0,...n,ref:t})});JC.displayName=QC;var I6=e=>{const{control:t,checked:r,bubbles:n=!0,...s}=e,o=g.useRef(null),i=ly(r),a=qg(t);return g.useEffect(()=>{const c=o.current,u=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(u,"checked").set;if(i!==r&&f){const m=new Event("click",{bubbles:n});f.call(c,r),c.dispatchEvent(m)}},[i,r,n]),l.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...s,tabIndex:-1,ref:o,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function ej(e){return e?"checked":"unchecked"}var tj=XC,L6=JC;const Fc=g.forwardRef(({className:e,...t},r)=>l.jsx(tj,{className:oe("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:r,children:l.jsx(L6,{className:oe("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));Fc.displayName=tj.displayName;var uy="ToastProvider",[dy,F6,z6]=kc("Toast"),[rj,rV]=sr("Toast",[z6]),[U6,Yf]=rj(uy),nj=e=>{const{__scopeToast:t,label:r="Notification",duration:n=5e3,swipeDirection:s="right",swipeThreshold:o=50,children:i}=e,[a,c]=g.useState(null),[u,d]=g.useState(0),f=g.useRef(!1),m=g.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${uy}\`. Expected non-empty \`string\`.`),l.jsx(dy.Provider,{scope:t,children:l.jsx(U6,{scope:t,label:r,duration:n,swipeDirection:s,swipeThreshold:o,toastCount:u,viewport:a,onViewportChange:c,onToastAdd:g.useCallback(()=>d(v=>v+1),[]),onToastRemove:g.useCallback(()=>d(v=>v-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:m,children:i})})};nj.displayName=uy;var sj="ToastViewport",$6=["F8"],_m="toast.viewportPause",bm="toast.viewportResume",oj=g.forwardRef((e,t)=>{const{__scopeToast:r,hotkey:n=$6,label:s="Notifications ({hotkey})",...o}=e,i=Yf(sj,r),a=F6(r),c=g.useRef(null),u=g.useRef(null),d=g.useRef(null),f=g.useRef(null),m=Ke(t,f,i.onViewportChange),v=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),x=i.toastCount>0;g.useEffect(()=>{const _=p=>{var w;n.every(C=>p[C]||p.code===C)&&((w=f.current)==null||w.focus())};return document.addEventListener("keydown",_),()=>document.removeEventListener("keydown",_)},[n]),g.useEffect(()=>{const _=c.current,p=f.current;if(x&&_&&p){const h=()=>{if(!i.isClosePausedRef.current){const E=new CustomEvent(_m);p.dispatchEvent(E),i.isClosePausedRef.current=!0}},w=()=>{if(i.isClosePausedRef.current){const E=new CustomEvent(bm);p.dispatchEvent(E),i.isClosePausedRef.current=!1}},C=E=>{!_.contains(E.relatedTarget)&&w()},j=()=>{_.contains(document.activeElement)||w()};return _.addEventListener("focusin",h),_.addEventListener("focusout",C),_.addEventListener("pointermove",h),_.addEventListener("pointerleave",j),window.addEventListener("blur",h),window.addEventListener("focus",w),()=>{_.removeEventListener("focusin",h),_.removeEventListener("focusout",C),_.removeEventListener("pointermove",h),_.removeEventListener("pointerleave",j),window.removeEventListener("blur",h),window.removeEventListener("focus",w)}}},[x,i.isClosePausedRef]);const y=g.useCallback(({tabbingDirection:_})=>{const h=a().map(w=>{const C=w.ref.current,j=[C,...ez(C)];return _==="forwards"?j:j.reverse()});return(_==="forwards"?h.reverse():h).flat()},[a]);return g.useEffect(()=>{const _=f.current;if(_){const p=h=>{var j,E,R;const w=h.altKey||h.ctrlKey||h.metaKey;if(h.key==="Tab"&&!w){const P=document.activeElement,A=h.shiftKey;if(h.target===_&&A){(j=u.current)==null||j.focus();return}const N=y({tabbingDirection:A?"backwards":"forwards"}),F=N.findIndex(b=>b===P);Jh(N.slice(F+1))?h.preventDefault():A?(E=u.current)==null||E.focus():(R=d.current)==null||R.focus()}};return _.addEventListener("keydown",p),()=>_.removeEventListener("keydown",p)}},[a,y]),l.jsxs(ID,{ref:c,role:"region","aria-label":s.replace("{hotkey}",v),tabIndex:-1,style:{pointerEvents:x?void 0:"none"},children:[x&&l.jsx(Sm,{ref:u,onFocusFromOutsideViewport:()=>{const _=y({tabbingDirection:"forwards"});Jh(_)}}),l.jsx(dy.Slot,{scope:r,children:l.jsx(Re.ol,{tabIndex:-1,...o,ref:m})}),x&&l.jsx(Sm,{ref:d,onFocusFromOutsideViewport:()=>{const _=y({tabbingDirection:"backwards"});Jh(_)}})]})});oj.displayName=sj;var ij="ToastFocusProxy",Sm=g.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...s}=e,o=Yf(ij,r);return l.jsx(Lc,{"aria-hidden":!0,tabIndex:0,...s,ref:t,style:{position:"fixed"},onFocus:i=>{var u;const a=i.relatedTarget;!((u=o.viewport)!=null&&u.contains(a))&&n()}})});Sm.displayName=ij;var Kf="Toast",V6="toast.swipeStart",B6="toast.swipeMove",W6="toast.swipeCancel",H6="toast.swipeEnd",aj=g.forwardRef((e,t)=>{const{forceMount:r,open:n,defaultOpen:s,onOpenChange:o,...i}=e,[a=!0,c]=Hr({prop:n,defaultProp:s,onChange:o});return l.jsx(or,{present:r||a,children:l.jsx(G6,{open:a,...i,ref:t,onClose:()=>c(!1),onPause:Dt(e.onPause),onResume:Dt(e.onResume),onSwipeStart:ce(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:ce(e.onSwipeMove,u=>{const{x:d,y:f}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${f}px`)}),onSwipeCancel:ce(e.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:ce(e.onSwipeEnd,u=>{const{x:d,y:f}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${f}px`),c(!1)})})})});aj.displayName=Kf;var[Y6,K6]=rj(Kf,{onClose(){}}),G6=g.forwardRef((e,t)=>{const{__scopeToast:r,type:n="foreground",duration:s,open:o,onClose:i,onEscapeKeyDown:a,onPause:c,onResume:u,onSwipeStart:d,onSwipeMove:f,onSwipeCancel:m,onSwipeEnd:v,...x}=e,y=Yf(Kf,r),[_,p]=g.useState(null),h=Ke(t,b=>p(b)),w=g.useRef(null),C=g.useRef(null),j=s||y.duration,E=g.useRef(0),R=g.useRef(j),P=g.useRef(0),{onToastAdd:A,onToastRemove:L}=y,q=Dt(()=>{var V;(_==null?void 0:_.contains(document.activeElement))&&((V=y.viewport)==null||V.focus()),i()}),N=g.useCallback(b=>{!b||b===1/0||(window.clearTimeout(P.current),E.current=new Date().getTime(),P.current=window.setTimeout(q,b))},[q]);g.useEffect(()=>{const b=y.viewport;if(b){const V=()=>{N(R.current),u==null||u()},te=()=>{const B=new Date().getTime()-E.current;R.current=R.current-B,window.clearTimeout(P.current),c==null||c()};return b.addEventListener(_m,te),b.addEventListener(bm,V),()=>{b.removeEventListener(_m,te),b.removeEventListener(bm,V)}}},[y.viewport,j,c,u,N]),g.useEffect(()=>{o&&!y.isClosePausedRef.current&&N(j)},[o,j,y.isClosePausedRef,N]),g.useEffect(()=>(A(),()=>L()),[A,L]);const F=g.useMemo(()=>_?pj(_):null,[_]);return y.viewport?l.jsxs(l.Fragment,{children:[F&&l.jsx(Z6,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:F}),l.jsx(Y6,{scope:r,onClose:q,children:Ts.createPortal(l.jsx(dy.ItemSlot,{scope:r,children:l.jsx(MD,{asChild:!0,onEscapeKeyDown:ce(a,()=>{y.isFocusedToastEscapeKeyDownRef.current||q(),y.isFocusedToastEscapeKeyDownRef.current=!1}),children:l.jsx(Re.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":o?"open":"closed","data-swipe-direction":y.swipeDirection,...x,ref:h,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:ce(e.onKeyDown,b=>{b.key==="Escape"&&(a==null||a(b.nativeEvent),b.nativeEvent.defaultPrevented||(y.isFocusedToastEscapeKeyDownRef.current=!0,q()))}),onPointerDown:ce(e.onPointerDown,b=>{b.button===0&&(w.current={x:b.clientX,y:b.clientY})}),onPointerMove:ce(e.onPointerMove,b=>{if(!w.current)return;const V=b.clientX-w.current.x,te=b.clientY-w.current.y,B=!!C.current,K=["left","right"].includes(y.swipeDirection),I=["left","up"].includes(y.swipeDirection)?Math.min:Math.max,Q=K?I(0,V):0,z=K?0:I(0,te),$=b.pointerType==="touch"?10:2,he={x:Q,y:z},ne={originalEvent:b,delta:he};B?(C.current=he,ku(B6,f,ne,{discrete:!1})):hw(he,y.swipeDirection,$)?(C.current=he,ku(V6,d,ne,{discrete:!1}),b.target.setPointerCapture(b.pointerId)):(Math.abs(V)>$||Math.abs(te)>$)&&(w.current=null)}),onPointerUp:ce(e.onPointerUp,b=>{const V=C.current,te=b.target;if(te.hasPointerCapture(b.pointerId)&&te.releasePointerCapture(b.pointerId),C.current=null,w.current=null,V){const B=b.currentTarget,K={originalEvent:b,delta:V};hw(V,y.swipeDirection,y.swipeThreshold)?ku(H6,v,K,{discrete:!0}):ku(W6,m,K,{discrete:!0}),B.addEventListener("click",I=>I.preventDefault(),{once:!0})}})})})}),y.viewport)})]}):null}),Z6=e=>{const{__scopeToast:t,children:r,...n}=e,s=Yf(Kf,t),[o,i]=g.useState(!1),[a,c]=g.useState(!1);return Q6(()=>i(!0)),g.useEffect(()=>{const u=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(u)},[]),a?null:l.jsx(jc,{asChild:!0,children:l.jsx(Lc,{...n,children:o&&l.jsxs(l.Fragment,{children:[s.label," ",r]})})})},q6="ToastTitle",lj=g.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return l.jsx(Re.div,{...n,ref:t})});lj.displayName=q6;var X6="ToastDescription",cj=g.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return l.jsx(Re.div,{...n,ref:t})});cj.displayName=X6;var uj="ToastAction",dj=g.forwardRef((e,t)=>{const{altText:r,...n}=e;return r.trim()?l.jsx(hj,{altText:r,asChild:!0,children:l.jsx(fy,{...n,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${uj}\`. Expected non-empty \`string\`.`),null)});dj.displayName=uj;var fj="ToastClose",fy=g.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e,s=K6(fj,r);return l.jsx(hj,{asChild:!0,children:l.jsx(Re.button,{type:"button",...n,ref:t,onClick:ce(e.onClick,s.onClose)})})});fy.displayName=fj;var hj=g.forwardRef((e,t)=>{const{__scopeToast:r,altText:n,...s}=e;return l.jsx(Re.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...s,ref:t})});function pj(e){const t=[];return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),J6(n)){const s=n.ariaHidden||n.hidden||n.style.display==="none",o=n.dataset.radixToastAnnounceExclude==="";if(!s)if(o){const i=n.dataset.radixToastAnnounceAlt;i&&t.push(i)}else t.push(...pj(n))}}),t}function ku(e,t,r,{discrete:n}){const s=r.originalEvent.currentTarget,o=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),n?Vg(s,o):s.dispatchEvent(o)}var hw=(e,t,r=0)=>{const n=Math.abs(e.x),s=Math.abs(e.y),o=n>s;return t==="left"||t==="right"?o&&n>r:!o&&s>r};function Q6(e=()=>{}){const t=Dt(e);Jt(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[t])}function J6(e){return e.nodeType===e.ELEMENT_NODE}function ez(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Jh(e){const t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}var tz=nj,mj=oj,gj=aj,vj=lj,yj=cj,xj=dj,wj=fy;const rz=tz,_j=g.forwardRef(({className:e,...t},r)=>l.jsx(mj,{ref:r,className:oe("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));_j.displayName=mj.displayName;const nz=Sc("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),bj=g.forwardRef(({className:e,variant:t,...r},n)=>l.jsx(gj,{ref:n,className:oe(nz({variant:t}),e),...r}));bj.displayName=gj.displayName;const sz=g.forwardRef(({className:e,...t},r)=>l.jsx(xj,{ref:r,className:oe("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));sz.displayName=xj.displayName;const Sj=g.forwardRef(({className:e,...t},r)=>l.jsx(wj,{ref:r,className:oe("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:l.jsx(zg,{className:"h-4 w-4"})}));Sj.displayName=wj.displayName;const kj=g.forwardRef(({className:e,...t},r)=>l.jsx(vj,{ref:r,className:oe("text-sm font-semibold",e),...t}));kj.displayName=vj.displayName;const Cj=g.forwardRef(({className:e,...t},r)=>l.jsx(yj,{ref:r,className:oe("text-sm opacity-90",e),...t}));Cj.displayName=yj.displayName;const oz=1,iz=1e6;let ep=0;function az(){return ep=(ep+1)%Number.MAX_SAFE_INTEGER,ep.toString()}const tp=new Map,pw=e=>{if(tp.has(e))return;const t=setTimeout(()=>{tp.delete(e),Cl({type:"REMOVE_TOAST",toastId:e})},iz);tp.set(e,t)},lz=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,oz)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(r=>r.id===t.toast.id?{...r,...t.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=t;return r?pw(r):e.toasts.forEach(n=>{pw(n.id)}),{...e,toasts:e.toasts.map(n=>n.id===r||r===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(r=>r.id!==t.toastId)}}},Ku=[];let Gu={toasts:[]};function Cl(e){Gu=lz(Gu,e),Ku.forEach(t=>{t(Gu)})}function cz({...e}){const t=az(),r=s=>Cl({type:"UPDATE_TOAST",toast:{...s,id:t}}),n=()=>Cl({type:"DISMISS_TOAST",toastId:t});return Cl({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:s=>{s||n()}}}),{id:t,dismiss:n,update:r}}function Pn(){const[e,t]=g.useState(Gu);return g.useEffect(()=>(Ku.push(t),()=>{const r=Ku.indexOf(t);r>-1&&Ku.splice(r,1)}),[e]),{...e,toast:cz,dismiss:r=>Cl({type:"DISMISS_TOAST",toastId:r})}}function hy(){const{toasts:e}=Pn();return l.jsxs(rz,{children:[e.map(function({id:t,title:r,description:n,action:s,...o}){return l.jsxs(bj,{...o,children:[l.jsxs("div",{className:"grid gap-1",children:[r&&l.jsx(kj,{children:r}),n&&l.jsx(Cj,{children:n})]}),s,l.jsx(Sj,{})]},t)}),l.jsx(_j,{})]})}function Cu(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var jj={exports:{}};/*! +For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return g.useEffect(()=>{var n;document.getElementById((n=e.current)==null?void 0:n.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},T6=RC,R6=PC,P6=AC,VC=DC,BC=OC,WC=zC,HC=$C,YC=IC,KC=FC;const GC=T6,ZC=R6,A6=P6,qC=g.forwardRef(({className:e,...t},r)=>a.jsx(VC,{className:oe("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));qC.displayName=VC.displayName;const ty=g.forwardRef(({className:e,...t},r)=>a.jsxs(A6,{children:[a.jsx(qC,{}),a.jsx(BC,{ref:r,className:oe("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));ty.displayName=BC.displayName;const ry=({className:e,...t})=>a.jsx("div",{className:oe("flex flex-col space-y-2 text-center sm:text-left",e),...t});ry.displayName="AlertDialogHeader";const ny=({className:e,...t})=>a.jsx("div",{className:oe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});ny.displayName="AlertDialogFooter";const sy=g.forwardRef(({className:e,...t},r)=>a.jsx(YC,{ref:r,className:oe("text-lg font-semibold",e),...t}));sy.displayName=YC.displayName;const oy=g.forwardRef(({className:e,...t},r)=>a.jsx(KC,{ref:r,className:oe("text-sm text-muted-foreground",e),...t}));oy.displayName=KC.displayName;const iy=g.forwardRef(({className:e,...t},r)=>a.jsx(WC,{ref:r,className:oe(wf(),e),...t}));iy.displayName=WC.displayName;const ay=g.forwardRef(({className:e,...t},r)=>a.jsx(HC,{ref:r,className:oe(wf({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));ay.displayName=HC.displayName;function ly(e){const t=g.useRef({value:e,previous:e});return g.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var cy="Switch",[D6,rV]=sr(cy),[O6,M6]=D6(cy),XC=g.forwardRef((e,t)=>{const{__scopeSwitch:r,name:n,checked:s,defaultChecked:o,required:i,disabled:l,value:c="on",onCheckedChange:u,...d}=e,[f,m]=g.useState(null),v=Ke(t,h=>m(h)),x=g.useRef(!1),y=f?!!f.closest("form"):!0,[_=!1,p]=Yr({prop:s,defaultProp:o,onChange:u});return a.jsxs(O6,{scope:r,checked:_,disabled:l,children:[a.jsx(Re.button,{type:"button",role:"switch","aria-checked":_,"aria-required":i,"data-state":ej(_),"data-disabled":l?"":void 0,disabled:l,value:c,...d,ref:v,onClick:ue(e.onClick,h=>{p(w=>!w),y&&(x.current=h.isPropagationStopped(),x.current||h.stopPropagation())})}),y&&a.jsx(I6,{control:f,bubbles:!x.current,name:n,value:c,checked:_,required:i,disabled:l,style:{transform:"translateX(-100%)"}})]})});XC.displayName=cy;var QC="SwitchThumb",JC=g.forwardRef((e,t)=>{const{__scopeSwitch:r,...n}=e,s=M6(QC,r);return a.jsx(Re.span,{"data-state":ej(s.checked),"data-disabled":s.disabled?"":void 0,...n,ref:t})});JC.displayName=QC;var I6=e=>{const{control:t,checked:r,bubbles:n=!0,...s}=e,o=g.useRef(null),i=ly(r),l=qg(t);return g.useEffect(()=>{const c=o.current,u=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(u,"checked").set;if(i!==r&&f){const m=new Event("click",{bubbles:n});f.call(c,r),c.dispatchEvent(m)}},[i,r,n]),a.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...s,tabIndex:-1,ref:o,style:{...e.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function ej(e){return e?"checked":"unchecked"}var tj=XC,L6=JC;const Fc=g.forwardRef(({className:e,...t},r)=>a.jsx(tj,{className:oe("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:r,children:a.jsx(L6,{className:oe("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));Fc.displayName=tj.displayName;var uy="ToastProvider",[dy,F6,z6]=kc("Toast"),[rj,nV]=sr("Toast",[z6]),[U6,Yf]=rj(uy),nj=e=>{const{__scopeToast:t,label:r="Notification",duration:n=5e3,swipeDirection:s="right",swipeThreshold:o=50,children:i}=e,[l,c]=g.useState(null),[u,d]=g.useState(0),f=g.useRef(!1),m=g.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${uy}\`. Expected non-empty \`string\`.`),a.jsx(dy.Provider,{scope:t,children:a.jsx(U6,{scope:t,label:r,duration:n,swipeDirection:s,swipeThreshold:o,toastCount:u,viewport:l,onViewportChange:c,onToastAdd:g.useCallback(()=>d(v=>v+1),[]),onToastRemove:g.useCallback(()=>d(v=>v-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:m,children:i})})};nj.displayName=uy;var sj="ToastViewport",$6=["F8"],_m="toast.viewportPause",bm="toast.viewportResume",oj=g.forwardRef((e,t)=>{const{__scopeToast:r,hotkey:n=$6,label:s="Notifications ({hotkey})",...o}=e,i=Yf(sj,r),l=F6(r),c=g.useRef(null),u=g.useRef(null),d=g.useRef(null),f=g.useRef(null),m=Ke(t,f,i.onViewportChange),v=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),x=i.toastCount>0;g.useEffect(()=>{const _=p=>{var w;n.every(C=>p[C]||p.code===C)&&((w=f.current)==null||w.focus())};return document.addEventListener("keydown",_),()=>document.removeEventListener("keydown",_)},[n]),g.useEffect(()=>{const _=c.current,p=f.current;if(x&&_&&p){const h=()=>{if(!i.isClosePausedRef.current){const E=new CustomEvent(_m);p.dispatchEvent(E),i.isClosePausedRef.current=!0}},w=()=>{if(i.isClosePausedRef.current){const E=new CustomEvent(bm);p.dispatchEvent(E),i.isClosePausedRef.current=!1}},C=E=>{!_.contains(E.relatedTarget)&&w()},j=()=>{_.contains(document.activeElement)||w()};return _.addEventListener("focusin",h),_.addEventListener("focusout",C),_.addEventListener("pointermove",h),_.addEventListener("pointerleave",j),window.addEventListener("blur",h),window.addEventListener("focus",w),()=>{_.removeEventListener("focusin",h),_.removeEventListener("focusout",C),_.removeEventListener("pointermove",h),_.removeEventListener("pointerleave",j),window.removeEventListener("blur",h),window.removeEventListener("focus",w)}}},[x,i.isClosePausedRef]);const y=g.useCallback(({tabbingDirection:_})=>{const h=l().map(w=>{const C=w.ref.current,j=[C,...ez(C)];return _==="forwards"?j:j.reverse()});return(_==="forwards"?h.reverse():h).flat()},[l]);return g.useEffect(()=>{const _=f.current;if(_){const p=h=>{var j,E,R;const w=h.altKey||h.ctrlKey||h.metaKey;if(h.key==="Tab"&&!w){const P=document.activeElement,A=h.shiftKey;if(h.target===_&&A){(j=u.current)==null||j.focus();return}const N=y({tabbingDirection:A?"backwards":"forwards"}),F=N.findIndex(b=>b===P);Jh(N.slice(F+1))?h.preventDefault():A?(E=u.current)==null||E.focus():(R=d.current)==null||R.focus()}};return _.addEventListener("keydown",p),()=>_.removeEventListener("keydown",p)}},[l,y]),a.jsxs(ID,{ref:c,role:"region","aria-label":s.replace("{hotkey}",v),tabIndex:-1,style:{pointerEvents:x?void 0:"none"},children:[x&&a.jsx(Sm,{ref:u,onFocusFromOutsideViewport:()=>{const _=y({tabbingDirection:"forwards"});Jh(_)}}),a.jsx(dy.Slot,{scope:r,children:a.jsx(Re.ol,{tabIndex:-1,...o,ref:m})}),x&&a.jsx(Sm,{ref:d,onFocusFromOutsideViewport:()=>{const _=y({tabbingDirection:"backwards"});Jh(_)}})]})});oj.displayName=sj;var ij="ToastFocusProxy",Sm=g.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...s}=e,o=Yf(ij,r);return a.jsx(Lc,{"aria-hidden":!0,tabIndex:0,...s,ref:t,style:{position:"fixed"},onFocus:i=>{var u;const l=i.relatedTarget;!((u=o.viewport)!=null&&u.contains(l))&&n()}})});Sm.displayName=ij;var Kf="Toast",V6="toast.swipeStart",B6="toast.swipeMove",W6="toast.swipeCancel",H6="toast.swipeEnd",aj=g.forwardRef((e,t)=>{const{forceMount:r,open:n,defaultOpen:s,onOpenChange:o,...i}=e,[l=!0,c]=Yr({prop:n,defaultProp:s,onChange:o});return a.jsx(or,{present:r||l,children:a.jsx(G6,{open:l,...i,ref:t,onClose:()=>c(!1),onPause:Dt(e.onPause),onResume:Dt(e.onResume),onSwipeStart:ue(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:ue(e.onSwipeMove,u=>{const{x:d,y:f}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${f}px`)}),onSwipeCancel:ue(e.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:ue(e.onSwipeEnd,u=>{const{x:d,y:f}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${f}px`),c(!1)})})})});aj.displayName=Kf;var[Y6,K6]=rj(Kf,{onClose(){}}),G6=g.forwardRef((e,t)=>{const{__scopeToast:r,type:n="foreground",duration:s,open:o,onClose:i,onEscapeKeyDown:l,onPause:c,onResume:u,onSwipeStart:d,onSwipeMove:f,onSwipeCancel:m,onSwipeEnd:v,...x}=e,y=Yf(Kf,r),[_,p]=g.useState(null),h=Ke(t,b=>p(b)),w=g.useRef(null),C=g.useRef(null),j=s||y.duration,E=g.useRef(0),R=g.useRef(j),P=g.useRef(0),{onToastAdd:A,onToastRemove:L}=y,q=Dt(()=>{var V;(_==null?void 0:_.contains(document.activeElement))&&((V=y.viewport)==null||V.focus()),i()}),N=g.useCallback(b=>{!b||b===1/0||(window.clearTimeout(P.current),E.current=new Date().getTime(),P.current=window.setTimeout(q,b))},[q]);g.useEffect(()=>{const b=y.viewport;if(b){const V=()=>{N(R.current),u==null||u()},te=()=>{const B=new Date().getTime()-E.current;R.current=R.current-B,window.clearTimeout(P.current),c==null||c()};return b.addEventListener(_m,te),b.addEventListener(bm,V),()=>{b.removeEventListener(_m,te),b.removeEventListener(bm,V)}}},[y.viewport,j,c,u,N]),g.useEffect(()=>{o&&!y.isClosePausedRef.current&&N(j)},[o,j,y.isClosePausedRef,N]),g.useEffect(()=>(A(),()=>L()),[A,L]);const F=g.useMemo(()=>_?pj(_):null,[_]);return y.viewport?a.jsxs(a.Fragment,{children:[F&&a.jsx(Z6,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:F}),a.jsx(Y6,{scope:r,onClose:q,children:Ts.createPortal(a.jsx(dy.ItemSlot,{scope:r,children:a.jsx(MD,{asChild:!0,onEscapeKeyDown:ue(l,()=>{y.isFocusedToastEscapeKeyDownRef.current||q(),y.isFocusedToastEscapeKeyDownRef.current=!1}),children:a.jsx(Re.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":o?"open":"closed","data-swipe-direction":y.swipeDirection,...x,ref:h,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:ue(e.onKeyDown,b=>{b.key==="Escape"&&(l==null||l(b.nativeEvent),b.nativeEvent.defaultPrevented||(y.isFocusedToastEscapeKeyDownRef.current=!0,q()))}),onPointerDown:ue(e.onPointerDown,b=>{b.button===0&&(w.current={x:b.clientX,y:b.clientY})}),onPointerMove:ue(e.onPointerMove,b=>{if(!w.current)return;const V=b.clientX-w.current.x,te=b.clientY-w.current.y,B=!!C.current,K=["left","right"].includes(y.swipeDirection),I=["left","up"].includes(y.swipeDirection)?Math.min:Math.max,Q=K?I(0,V):0,z=K?0:I(0,te),$=b.pointerType==="touch"?10:2,he={x:Q,y:z},ne={originalEvent:b,delta:he};B?(C.current=he,ku(B6,f,ne,{discrete:!1})):hw(he,y.swipeDirection,$)?(C.current=he,ku(V6,d,ne,{discrete:!1}),b.target.setPointerCapture(b.pointerId)):(Math.abs(V)>$||Math.abs(te)>$)&&(w.current=null)}),onPointerUp:ue(e.onPointerUp,b=>{const V=C.current,te=b.target;if(te.hasPointerCapture(b.pointerId)&&te.releasePointerCapture(b.pointerId),C.current=null,w.current=null,V){const B=b.currentTarget,K={originalEvent:b,delta:V};hw(V,y.swipeDirection,y.swipeThreshold)?ku(H6,v,K,{discrete:!0}):ku(W6,m,K,{discrete:!0}),B.addEventListener("click",I=>I.preventDefault(),{once:!0})}})})})}),y.viewport)})]}):null}),Z6=e=>{const{__scopeToast:t,children:r,...n}=e,s=Yf(Kf,t),[o,i]=g.useState(!1),[l,c]=g.useState(!1);return Q6(()=>i(!0)),g.useEffect(()=>{const u=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(u)},[]),l?null:a.jsx(jc,{asChild:!0,children:a.jsx(Lc,{...n,children:o&&a.jsxs(a.Fragment,{children:[s.label," ",r]})})})},q6="ToastTitle",lj=g.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return a.jsx(Re.div,{...n,ref:t})});lj.displayName=q6;var X6="ToastDescription",cj=g.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return a.jsx(Re.div,{...n,ref:t})});cj.displayName=X6;var uj="ToastAction",dj=g.forwardRef((e,t)=>{const{altText:r,...n}=e;return r.trim()?a.jsx(hj,{altText:r,asChild:!0,children:a.jsx(fy,{...n,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${uj}\`. Expected non-empty \`string\`.`),null)});dj.displayName=uj;var fj="ToastClose",fy=g.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e,s=K6(fj,r);return a.jsx(hj,{asChild:!0,children:a.jsx(Re.button,{type:"button",...n,ref:t,onClick:ue(e.onClick,s.onClose)})})});fy.displayName=fj;var hj=g.forwardRef((e,t)=>{const{__scopeToast:r,altText:n,...s}=e;return a.jsx(Re.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...s,ref:t})});function pj(e){const t=[];return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),J6(n)){const s=n.ariaHidden||n.hidden||n.style.display==="none",o=n.dataset.radixToastAnnounceExclude==="";if(!s)if(o){const i=n.dataset.radixToastAnnounceAlt;i&&t.push(i)}else t.push(...pj(n))}}),t}function ku(e,t,r,{discrete:n}){const s=r.originalEvent.currentTarget,o=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),n?Vg(s,o):s.dispatchEvent(o)}var hw=(e,t,r=0)=>{const n=Math.abs(e.x),s=Math.abs(e.y),o=n>s;return t==="left"||t==="right"?o&&n>r:!o&&s>r};function Q6(e=()=>{}){const t=Dt(e);Jt(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[t])}function J6(e){return e.nodeType===e.ELEMENT_NODE}function ez(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Jh(e){const t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}var tz=nj,mj=oj,gj=aj,vj=lj,yj=cj,xj=dj,wj=fy;const rz=tz,_j=g.forwardRef(({className:e,...t},r)=>a.jsx(mj,{ref:r,className:oe("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));_j.displayName=mj.displayName;const nz=Sc("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),bj=g.forwardRef(({className:e,variant:t,...r},n)=>a.jsx(gj,{ref:n,className:oe(nz({variant:t}),e),...r}));bj.displayName=gj.displayName;const sz=g.forwardRef(({className:e,...t},r)=>a.jsx(xj,{ref:r,className:oe("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));sz.displayName=xj.displayName;const Sj=g.forwardRef(({className:e,...t},r)=>a.jsx(wj,{ref:r,className:oe("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:a.jsx(zg,{className:"h-4 w-4"})}));Sj.displayName=wj.displayName;const kj=g.forwardRef(({className:e,...t},r)=>a.jsx(vj,{ref:r,className:oe("text-sm font-semibold",e),...t}));kj.displayName=vj.displayName;const Cj=g.forwardRef(({className:e,...t},r)=>a.jsx(yj,{ref:r,className:oe("text-sm opacity-90",e),...t}));Cj.displayName=yj.displayName;const oz=1,iz=1e6;let ep=0;function az(){return ep=(ep+1)%Number.MAX_SAFE_INTEGER,ep.toString()}const tp=new Map,pw=e=>{if(tp.has(e))return;const t=setTimeout(()=>{tp.delete(e),jl({type:"REMOVE_TOAST",toastId:e})},iz);tp.set(e,t)},lz=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,oz)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(r=>r.id===t.toast.id?{...r,...t.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=t;return r?pw(r):e.toasts.forEach(n=>{pw(n.id)}),{...e,toasts:e.toasts.map(n=>n.id===r||r===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(r=>r.id!==t.toastId)}}},Ku=[];let Gu={toasts:[]};function jl(e){Gu=lz(Gu,e),Ku.forEach(t=>{t(Gu)})}function cz({...e}){const t=az(),r=s=>jl({type:"UPDATE_TOAST",toast:{...s,id:t}}),n=()=>jl({type:"DISMISS_TOAST",toastId:t});return jl({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:s=>{s||n()}}}),{id:t,dismiss:n,update:r}}function Pn(){const[e,t]=g.useState(Gu);return g.useEffect(()=>(Ku.push(t),()=>{const r=Ku.indexOf(t);r>-1&&Ku.splice(r,1)}),[e]),{...e,toast:cz,dismiss:r=>jl({type:"DISMISS_TOAST",toastId:r})}}function hy(){const{toasts:e}=Pn();return a.jsxs(rz,{children:[e.map(function({id:t,title:r,description:n,action:s,...o}){return a.jsxs(bj,{...o,children:[a.jsxs("div",{className:"grid gap-1",children:[r&&a.jsx(kj,{children:r}),n&&a.jsx(Cj,{children:n})]}),s,a.jsx(Sj,{})]},t)}),a.jsx(_j,{})]})}function Cu(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var jj={exports:{}};/*! JSZip v3.10.1 - A JavaScript class for generating and reading zip files @@ -305,9 +305,9 @@ Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/js JSZip uses the library pako released under the MIT license : https://github.com/nodeca/pako/blob/main/LICENSE -*/(function(e,t){(function(r){e.exports=r()})(function(){return function r(n,s,o){function i(u,d){if(!s[u]){if(!n[u]){var f=typeof Cu=="function"&&Cu;if(!d&&f)return f(u,!0);if(a)return a(u,!0);var m=new Error("Cannot find module '"+u+"'");throw m.code="MODULE_NOT_FOUND",m}var v=s[u]={exports:{}};n[u][0].call(v.exports,function(x){var y=n[u][1][x];return i(y||x)},v,v.exports,r,n,s,o)}return s[u].exports}for(var a=typeof Cu=="function"&&Cu,c=0;c>2,v=(3&u)<<4|d>>4,x=1>6:64,y=2>4,d=(15&m)<<4|(v=a.indexOf(c.charAt(y++)))>>2,f=(3&v)<<6|(x=a.indexOf(c.charAt(y++))),h[_++]=u,v!==64&&(h[_++]=d),x!==64&&(h[_++]=f);return h}},{"./support":30,"./utils":32}],2:[function(r,n,s){var o=r("./external"),i=r("./stream/DataWorker"),a=r("./stream/Crc32Probe"),c=r("./stream/DataLengthProbe");function u(d,f,m,v,x){this.compressedSize=d,this.uncompressedSize=f,this.crc32=m,this.compression=v,this.compressedContent=x}u.prototype={getContentWorker:function(){var d=new i(o.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new c("data_length")),f=this;return d.on("end",function(){if(this.streamInfo.data_length!==f.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),d},getCompressedWorker:function(){return new i(o.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},u.createWorkerFrom=function(d,f,m){return d.pipe(new a).pipe(new c("uncompressedSize")).pipe(f.compressWorker(m)).pipe(new c("compressedSize")).withStreamInfo("compression",f)},n.exports=u},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(r,n,s){var o=r("./stream/GenericWorker");s.STORE={magic:"\0\0",compressWorker:function(){return new o("STORE compression")},uncompressWorker:function(){return new o("STORE decompression")}},s.DEFLATE=r("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(r,n,s){var o=r("./utils"),i=function(){for(var a,c=[],u=0;u<256;u++){a=u;for(var d=0;d<8;d++)a=1&a?3988292384^a>>>1:a>>>1;c[u]=a}return c}();n.exports=function(a,c){return a!==void 0&&a.length?o.getTypeOf(a)!=="string"?function(u,d,f,m){var v=i,x=m+f;u^=-1;for(var y=m;y>>8^v[255&(u^d[y])];return-1^u}(0|c,a,a.length,0):function(u,d,f,m){var v=i,x=m+f;u^=-1;for(var y=m;y>>8^v[255&(u^d.charCodeAt(y))];return-1^u}(0|c,a,a.length,0):0}},{"./utils":32}],5:[function(r,n,s){s.base64=!1,s.binary=!1,s.dir=!1,s.createFolders=!0,s.date=null,s.compression=null,s.compressionOptions=null,s.comment=null,s.unixPermissions=null,s.dosPermissions=null},{}],6:[function(r,n,s){var o=null;o=typeof Promise<"u"?Promise:r("lie"),n.exports={Promise:o}},{lie:37}],7:[function(r,n,s){var o=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",i=r("pako"),a=r("./utils"),c=r("./stream/GenericWorker"),u=o?"uint8array":"array";function d(f,m){c.call(this,"FlateWorker/"+f),this._pako=null,this._pakoAction=f,this._pakoOptions=m,this.meta={}}s.magic="\b\0",a.inherits(d,c),d.prototype.processChunk=function(f){this.meta=f.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(u,f.data),!1)},d.prototype.flush=function(){c.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},d.prototype.cleanUp=function(){c.prototype.cleanUp.call(this),this._pako=null},d.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var f=this;this._pako.onData=function(m){f.push({data:m,meta:f.meta})}},s.compressWorker=function(f){return new d("Deflate",f)},s.uncompressWorker=function(){return new d("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(r,n,s){function o(v,x){var y,_="";for(y=0;y>>=8;return _}function i(v,x,y,_,p,h){var w,C,j=v.file,E=v.compression,R=h!==u.utf8encode,P=a.transformTo("string",h(j.name)),A=a.transformTo("string",u.utf8encode(j.name)),L=j.comment,q=a.transformTo("string",h(L)),N=a.transformTo("string",u.utf8encode(L)),F=A.length!==j.name.length,b=N.length!==L.length,V="",te="",B="",K=j.dir,I=j.date,Q={crc32:0,compressedSize:0,uncompressedSize:0};x&&!y||(Q.crc32=v.crc32,Q.compressedSize=v.compressedSize,Q.uncompressedSize=v.uncompressedSize);var z=0;x&&(z|=8),R||!F&&!b||(z|=2048);var $=0,he=0;K&&($|=16),p==="UNIX"?(he=798,$|=function(se,Oe){var pe=se;return se||(pe=Oe?16893:33204),(65535&pe)<<16}(j.unixPermissions,K)):(he=20,$|=function(se){return 63&(se||0)}(j.dosPermissions)),w=I.getUTCHours(),w<<=6,w|=I.getUTCMinutes(),w<<=5,w|=I.getUTCSeconds()/2,C=I.getUTCFullYear()-1980,C<<=4,C|=I.getUTCMonth()+1,C<<=5,C|=I.getUTCDate(),F&&(te=o(1,1)+o(d(P),4)+A,V+="up"+o(te.length,2)+te),b&&(B=o(1,1)+o(d(q),4)+N,V+="uc"+o(B.length,2)+B);var ne="";return ne+=` -\0`,ne+=o(z,2),ne+=E.magic,ne+=o(w,2),ne+=o(C,2),ne+=o(Q.crc32,4),ne+=o(Q.compressedSize,4),ne+=o(Q.uncompressedSize,4),ne+=o(P.length,2),ne+=o(V.length,2),{fileRecord:f.LOCAL_FILE_HEADER+ne+P+V,dirRecord:f.CENTRAL_FILE_HEADER+o(he,2)+ne+o(q.length,2)+"\0\0\0\0"+o($,4)+o(_,4)+P+V+q}}var a=r("../utils"),c=r("../stream/GenericWorker"),u=r("../utf8"),d=r("../crc32"),f=r("../signature");function m(v,x,y,_){c.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=x,this.zipPlatform=y,this.encodeFileName=_,this.streamFiles=v,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(m,c),m.prototype.push=function(v){var x=v.meta.percent||0,y=this.entriesCount,_=this._sources.length;this.accumulate?this.contentBuffer.push(v):(this.bytesWritten+=v.data.length,c.prototype.push.call(this,{data:v.data,meta:{currentFile:this.currentFile,percent:y?(x+100*(y-_-1))/y:100}}))},m.prototype.openedSource=function(v){this.currentSourceOffset=this.bytesWritten,this.currentFile=v.file.name;var x=this.streamFiles&&!v.file.dir;if(x){var y=i(v,x,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:y.fileRecord,meta:{percent:0}})}else this.accumulate=!0},m.prototype.closedSource=function(v){this.accumulate=!1;var x=this.streamFiles&&!v.file.dir,y=i(v,x,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(y.dirRecord),x)this.push({data:function(_){return f.DATA_DESCRIPTOR+o(_.crc32,4)+o(_.compressedSize,4)+o(_.uncompressedSize,4)}(v),meta:{percent:100}});else for(this.push({data:y.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},m.prototype.flush=function(){for(var v=this.bytesWritten,x=0;x=this.index;c--)u=(u<<8)+this.byteAt(c);return this.index+=a,u},readString:function(a){return o.transformTo("string",this.readData(a))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var a=this.readInt(4);return new Date(Date.UTC(1980+(a>>25&127),(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1))}},n.exports=i},{"../utils":32}],19:[function(r,n,s){var o=r("./Uint8ArrayReader");function i(a){o.call(this,a)}r("../utils").inherits(i,o),i.prototype.readData=function(a){this.checkOffset(a);var c=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,c},n.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(r,n,s){var o=r("./DataReader");function i(a){o.call(this,a)}r("../utils").inherits(i,o),i.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+a)},i.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero},i.prototype.readAndCheckSignature=function(a){return a===this.readData(4)},i.prototype.readData=function(a){this.checkOffset(a);var c=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,c},n.exports=i},{"../utils":32,"./DataReader":18}],21:[function(r,n,s){var o=r("./ArrayReader");function i(a){o.call(this,a)}r("../utils").inherits(i,o),i.prototype.readData=function(a){if(this.checkOffset(a),a===0)return new Uint8Array(0);var c=this.data.subarray(this.zero+this.index,this.zero+this.index+a);return this.index+=a,c},n.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(r,n,s){var o=r("../utils"),i=r("../support"),a=r("./ArrayReader"),c=r("./StringReader"),u=r("./NodeBufferReader"),d=r("./Uint8ArrayReader");n.exports=function(f){var m=o.getTypeOf(f);return o.checkSupport(m),m!=="string"||i.uint8array?m==="nodebuffer"?new u(f):i.uint8array?new d(o.transformTo("uint8array",f)):new a(o.transformTo("array",f)):new c(f)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(r,n,s){s.LOCAL_FILE_HEADER="PK",s.CENTRAL_FILE_HEADER="PK",s.CENTRAL_DIRECTORY_END="PK",s.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",s.ZIP64_CENTRAL_DIRECTORY_END="PK",s.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(r,n,s){var o=r("./GenericWorker"),i=r("../utils");function a(c){o.call(this,"ConvertWorker to "+c),this.destType=c}i.inherits(a,o),a.prototype.processChunk=function(c){this.push({data:i.transformTo(this.destType,c.data),meta:c.meta})},n.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(r,n,s){var o=r("./GenericWorker"),i=r("../crc32");function a(){o.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}r("../utils").inherits(a,o),a.prototype.processChunk=function(c){this.streamInfo.crc32=i(c.data,this.streamInfo.crc32||0),this.push(c)},n.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(r,n,s){var o=r("../utils"),i=r("./GenericWorker");function a(c){i.call(this,"DataLengthProbe for "+c),this.propName=c,this.withStreamInfo(c,0)}o.inherits(a,i),a.prototype.processChunk=function(c){if(c){var u=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=u+c.data.length}i.prototype.processChunk.call(this,c)},n.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(r,n,s){var o=r("../utils"),i=r("./GenericWorker");function a(c){i.call(this,"DataWorker");var u=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,c.then(function(d){u.dataIsReady=!0,u.data=d,u.max=d&&d.length||0,u.type=o.getTypeOf(d),u.isPaused||u._tickAndRepeat()},function(d){u.error(d)})}o.inherits(a,i),a.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,o.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(o.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var c=null,u=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":c=this.data.substring(this.index,u);break;case"uint8array":c=this.data.subarray(this.index,u);break;case"array":case"nodebuffer":c=this.data.slice(this.index,u)}return this.index=u,this.push({data:c,meta:{percent:this.max?this.index/this.max*100:0}})},n.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(r,n,s){function o(i){this.name=i||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}o.prototype={push:function(i){this.emit("data",i)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(i){this.emit("error",i)}return!0},error:function(i){return!this.isFinished&&(this.isPaused?this.generatedError=i:(this.isFinished=!0,this.emit("error",i),this.previous&&this.previous.error(i),this.cleanUp()),!0)},on:function(i,a){return this._listeners[i].push(a),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(i,a){if(this._listeners[i])for(var c=0;c "+i:i}},n.exports=o},{}],29:[function(r,n,s){var o=r("../utils"),i=r("./ConvertWorker"),a=r("./GenericWorker"),c=r("../base64"),u=r("../support"),d=r("../external"),f=null;if(u.nodestream)try{f=r("../nodejs/NodejsStreamOutputAdapter")}catch{}function m(x,y){return new d.Promise(function(_,p){var h=[],w=x._internalType,C=x._outputType,j=x._mimeType;x.on("data",function(E,R){h.push(E),y&&y(R)}).on("error",function(E){h=[],p(E)}).on("end",function(){try{var E=function(R,P,A){switch(R){case"blob":return o.newBlob(o.transformTo("arraybuffer",P),A);case"base64":return c.encode(P);default:return o.transformTo(R,P)}}(C,function(R,P){var A,L=0,q=null,N=0;for(A=0;A"u")s.blob=!1;else{var o=new ArrayBuffer(0);try{s.blob=new Blob([o],{type:"application/zip"}).size===0}catch{try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);i.append(o),s.blob=i.getBlob("application/zip").size===0}catch{s.blob=!1}}}try{s.nodestream=!!r("readable-stream").Readable}catch{s.nodestream=!1}},{"readable-stream":16}],31:[function(r,n,s){for(var o=r("./utils"),i=r("./support"),a=r("./nodejsUtils"),c=r("./stream/GenericWorker"),u=new Array(256),d=0;d<256;d++)u[d]=252<=d?6:248<=d?5:240<=d?4:224<=d?3:192<=d?2:1;u[254]=u[254]=1;function f(){c.call(this,"utf-8 decode"),this.leftOver=null}function m(){c.call(this,"utf-8 encode")}s.utf8encode=function(v){return i.nodebuffer?a.newBufferFrom(v,"utf-8"):function(x){var y,_,p,h,w,C=x.length,j=0;for(h=0;h>>6:(_<65536?y[w++]=224|_>>>12:(y[w++]=240|_>>>18,y[w++]=128|_>>>12&63),y[w++]=128|_>>>6&63),y[w++]=128|63&_);return y}(v)},s.utf8decode=function(v){return i.nodebuffer?o.transformTo("nodebuffer",v).toString("utf-8"):function(x){var y,_,p,h,w=x.length,C=new Array(2*w);for(y=_=0;y>10&1023,C[_++]=56320|1023&p)}return C.length!==_&&(C.subarray?C=C.subarray(0,_):C.length=_),o.applyFromCharCode(C)}(v=o.transformTo(i.uint8array?"uint8array":"array",v))},o.inherits(f,c),f.prototype.processChunk=function(v){var x=o.transformTo(i.uint8array?"uint8array":"array",v.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var y=x;(x=new Uint8Array(y.length+this.leftOver.length)).set(this.leftOver,0),x.set(y,this.leftOver.length)}else x=this.leftOver.concat(x);this.leftOver=null}var _=function(h,w){var C;for((w=w||h.length)>h.length&&(w=h.length),C=w-1;0<=C&&(192&h[C])==128;)C--;return C<0||C===0?w:C+u[h[C]]>w?C:w}(x),p=x;_!==x.length&&(i.uint8array?(p=x.subarray(0,_),this.leftOver=x.subarray(_,x.length)):(p=x.slice(0,_),this.leftOver=x.slice(_,x.length))),this.push({data:s.utf8decode(p),meta:v.meta})},f.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:s.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},s.Utf8DecodeWorker=f,o.inherits(m,c),m.prototype.processChunk=function(v){this.push({data:s.utf8encode(v.data),meta:v.meta})},s.Utf8EncodeWorker=m},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(r,n,s){var o=r("./support"),i=r("./base64"),a=r("./nodejsUtils"),c=r("./external");function u(y){return y}function d(y,_){for(var p=0;p>8;this.dir=!!(16&this.externalFileAttributes),v==0&&(this.dosPermissions=63&this.externalFileAttributes),v==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var v=o(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=v.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=v.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=v.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=v.readInt(4))}},readExtraFields:function(v){var x,y,_,p=v.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});v.index+4>>6:(v<65536?m[_++]=224|v>>>12:(m[_++]=240|v>>>18,m[_++]=128|v>>>12&63),m[_++]=128|v>>>6&63),m[_++]=128|63&v);return m},s.buf2binstring=function(f){return d(f,f.length)},s.binstring2buf=function(f){for(var m=new o.Buf8(f.length),v=0,x=m.length;v>10&1023,h[x++]=56320|1023&y)}return d(h,x)},s.utf8border=function(f,m){var v;for((m=m||f.length)>f.length&&(m=f.length),v=m-1;0<=v&&(192&f[v])==128;)v--;return v<0||v===0?m:v+c[f[v]]>m?v:m}},{"./common":41}],43:[function(r,n,s){n.exports=function(o,i,a,c){for(var u=65535&o|0,d=o>>>16&65535|0,f=0;a!==0;){for(a-=f=2e3>>1:i>>>1;a[c]=i}return a}();n.exports=function(i,a,c,u){var d=o,f=u+c;i^=-1;for(var m=u;m>>8^d[255&(i^a[m])];return-1^i}},{}],46:[function(r,n,s){var o,i=r("../utils/common"),a=r("./trees"),c=r("./adler32"),u=r("./crc32"),d=r("./messages"),f=0,m=4,v=0,x=-2,y=-1,_=4,p=2,h=8,w=9,C=286,j=30,E=19,R=2*C+1,P=15,A=3,L=258,q=L+A+1,N=42,F=113,b=1,V=2,te=3,B=4;function K(k,J){return k.msg=d[J],J}function I(k){return(k<<1)-(4k.avail_out&&(G=k.avail_out),G!==0&&(i.arraySet(k.output,J.pending_buf,J.pending_out,G,k.next_out),k.next_out+=G,J.pending_out+=G,k.total_out+=G,k.avail_out-=G,J.pending-=G,J.pending===0&&(J.pending_out=0))}function $(k,J){a._tr_flush_block(k,0<=k.block_start?k.block_start:-1,k.strstart-k.block_start,J),k.block_start=k.strstart,z(k.strm)}function he(k,J){k.pending_buf[k.pending++]=J}function ne(k,J){k.pending_buf[k.pending++]=J>>>8&255,k.pending_buf[k.pending++]=255&J}function se(k,J){var G,D,S=k.max_chain_length,T=k.strstart,O=k.prev_length,Y=k.nice_match,M=k.strstart>k.w_size-q?k.strstart-(k.w_size-q):0,H=k.window,X=k.w_mask,ee=k.prev,me=k.strstart+L,Ye=H[T+O-1],Ue=H[T+O];k.prev_length>=k.good_match&&(S>>=2),Y>k.lookahead&&(Y=k.lookahead);do if(H[(G=J)+O]===Ue&&H[G+O-1]===Ye&&H[G]===H[T]&&H[++G]===H[T+1]){T+=2,G++;do;while(H[++T]===H[++G]&&H[++T]===H[++G]&&H[++T]===H[++G]&&H[++T]===H[++G]&&H[++T]===H[++G]&&H[++T]===H[++G]&&H[++T]===H[++G]&&H[++T]===H[++G]&&TM&&--S!=0);return O<=k.lookahead?O:k.lookahead}function Oe(k){var J,G,D,S,T,O,Y,M,H,X,ee=k.w_size;do{if(S=k.window_size-k.lookahead-k.strstart,k.strstart>=ee+(ee-q)){for(i.arraySet(k.window,k.window,ee,ee,0),k.match_start-=ee,k.strstart-=ee,k.block_start-=ee,J=G=k.hash_size;D=k.head[--J],k.head[J]=ee<=D?D-ee:0,--G;);for(J=G=ee;D=k.prev[--J],k.prev[J]=ee<=D?D-ee:0,--G;);S+=ee}if(k.strm.avail_in===0)break;if(O=k.strm,Y=k.window,M=k.strstart+k.lookahead,H=S,X=void 0,X=O.avail_in,H=A)for(T=k.strstart-k.insert,k.ins_h=k.window[T],k.ins_h=(k.ins_h<=A&&(k.ins_h=(k.ins_h<=A)if(D=a._tr_tally(k,k.strstart-k.match_start,k.match_length-A),k.lookahead-=k.match_length,k.match_length<=k.max_lazy_match&&k.lookahead>=A){for(k.match_length--;k.strstart++,k.ins_h=(k.ins_h<=A&&(k.ins_h=(k.ins_h<=A&&k.match_length<=k.prev_length){for(S=k.strstart+k.lookahead-A,D=a._tr_tally(k,k.strstart-1-k.prev_match,k.prev_length-A),k.lookahead-=k.prev_length-1,k.prev_length-=2;++k.strstart<=S&&(k.ins_h=(k.ins_h<k.pending_buf_size-5&&(G=k.pending_buf_size-5);;){if(k.lookahead<=1){if(Oe(k),k.lookahead===0&&J===f)return b;if(k.lookahead===0)break}k.strstart+=k.lookahead,k.lookahead=0;var D=k.block_start+G;if((k.strstart===0||k.strstart>=D)&&(k.lookahead=k.strstart-D,k.strstart=D,$(k,!1),k.strm.avail_out===0)||k.strstart-k.block_start>=k.w_size-q&&($(k,!1),k.strm.avail_out===0))return b}return k.insert=0,J===m?($(k,!0),k.strm.avail_out===0?te:B):(k.strstart>k.block_start&&($(k,!1),k.strm.avail_out),b)}),new Ne(4,4,8,4,pe),new Ne(4,5,16,8,pe),new Ne(4,6,32,32,pe),new Ne(4,4,16,16,ye),new Ne(8,16,32,32,ye),new Ne(8,16,128,128,ye),new Ne(8,32,128,256,ye),new Ne(32,128,258,1024,ye),new Ne(32,258,258,4096,ye)],s.deflateInit=function(k,J){return nt(k,J,h,15,8,0)},s.deflateInit2=nt,s.deflateReset=Pe,s.deflateResetKeep=Me,s.deflateSetHeader=function(k,J){return k&&k.state?k.state.wrap!==2?x:(k.state.gzhead=J,v):x},s.deflate=function(k,J){var G,D,S,T;if(!k||!k.state||5>8&255),he(D,D.gzhead.time>>16&255),he(D,D.gzhead.time>>24&255),he(D,D.level===9?2:2<=D.strategy||D.level<2?4:0),he(D,255&D.gzhead.os),D.gzhead.extra&&D.gzhead.extra.length&&(he(D,255&D.gzhead.extra.length),he(D,D.gzhead.extra.length>>8&255)),D.gzhead.hcrc&&(k.adler=u(k.adler,D.pending_buf,D.pending,0)),D.gzindex=0,D.status=69):(he(D,0),he(D,0),he(D,0),he(D,0),he(D,0),he(D,D.level===9?2:2<=D.strategy||D.level<2?4:0),he(D,3),D.status=F);else{var O=h+(D.w_bits-8<<4)<<8;O|=(2<=D.strategy||D.level<2?0:D.level<6?1:D.level===6?2:3)<<6,D.strstart!==0&&(O|=32),O+=31-O%31,D.status=F,ne(D,O),D.strstart!==0&&(ne(D,k.adler>>>16),ne(D,65535&k.adler)),k.adler=1}if(D.status===69)if(D.gzhead.extra){for(S=D.pending;D.gzindex<(65535&D.gzhead.extra.length)&&(D.pending!==D.pending_buf_size||(D.gzhead.hcrc&&D.pending>S&&(k.adler=u(k.adler,D.pending_buf,D.pending-S,S)),z(k),S=D.pending,D.pending!==D.pending_buf_size));)he(D,255&D.gzhead.extra[D.gzindex]),D.gzindex++;D.gzhead.hcrc&&D.pending>S&&(k.adler=u(k.adler,D.pending_buf,D.pending-S,S)),D.gzindex===D.gzhead.extra.length&&(D.gzindex=0,D.status=73)}else D.status=73;if(D.status===73)if(D.gzhead.name){S=D.pending;do{if(D.pending===D.pending_buf_size&&(D.gzhead.hcrc&&D.pending>S&&(k.adler=u(k.adler,D.pending_buf,D.pending-S,S)),z(k),S=D.pending,D.pending===D.pending_buf_size)){T=1;break}T=D.gzindexS&&(k.adler=u(k.adler,D.pending_buf,D.pending-S,S)),T===0&&(D.gzindex=0,D.status=91)}else D.status=91;if(D.status===91)if(D.gzhead.comment){S=D.pending;do{if(D.pending===D.pending_buf_size&&(D.gzhead.hcrc&&D.pending>S&&(k.adler=u(k.adler,D.pending_buf,D.pending-S,S)),z(k),S=D.pending,D.pending===D.pending_buf_size)){T=1;break}T=D.gzindexS&&(k.adler=u(k.adler,D.pending_buf,D.pending-S,S)),T===0&&(D.status=103)}else D.status=103;if(D.status===103&&(D.gzhead.hcrc?(D.pending+2>D.pending_buf_size&&z(k),D.pending+2<=D.pending_buf_size&&(he(D,255&k.adler),he(D,k.adler>>8&255),k.adler=0,D.status=F)):D.status=F),D.pending!==0){if(z(k),k.avail_out===0)return D.last_flush=-1,v}else if(k.avail_in===0&&I(J)<=I(G)&&J!==m)return K(k,-5);if(D.status===666&&k.avail_in!==0)return K(k,-5);if(k.avail_in!==0||D.lookahead!==0||J!==f&&D.status!==666){var Y=D.strategy===2?function(M,H){for(var X;;){if(M.lookahead===0&&(Oe(M),M.lookahead===0)){if(H===f)return b;break}if(M.match_length=0,X=a._tr_tally(M,0,M.window[M.strstart]),M.lookahead--,M.strstart++,X&&($(M,!1),M.strm.avail_out===0))return b}return M.insert=0,H===m?($(M,!0),M.strm.avail_out===0?te:B):M.last_lit&&($(M,!1),M.strm.avail_out===0)?b:V}(D,J):D.strategy===3?function(M,H){for(var X,ee,me,Ye,Ue=M.window;;){if(M.lookahead<=L){if(Oe(M),M.lookahead<=L&&H===f)return b;if(M.lookahead===0)break}if(M.match_length=0,M.lookahead>=A&&0M.lookahead&&(M.match_length=M.lookahead)}if(M.match_length>=A?(X=a._tr_tally(M,1,M.match_length-A),M.lookahead-=M.match_length,M.strstart+=M.match_length,M.match_length=0):(X=a._tr_tally(M,0,M.window[M.strstart]),M.lookahead--,M.strstart++),X&&($(M,!1),M.strm.avail_out===0))return b}return M.insert=0,H===m?($(M,!0),M.strm.avail_out===0?te:B):M.last_lit&&($(M,!1),M.strm.avail_out===0)?b:V}(D,J):o[D.level].func(D,J);if(Y!==te&&Y!==B||(D.status=666),Y===b||Y===te)return k.avail_out===0&&(D.last_flush=-1),v;if(Y===V&&(J===1?a._tr_align(D):J!==5&&(a._tr_stored_block(D,0,0,!1),J===3&&(Q(D.head),D.lookahead===0&&(D.strstart=0,D.block_start=0,D.insert=0))),z(k),k.avail_out===0))return D.last_flush=-1,v}return J!==m?v:D.wrap<=0?1:(D.wrap===2?(he(D,255&k.adler),he(D,k.adler>>8&255),he(D,k.adler>>16&255),he(D,k.adler>>24&255),he(D,255&k.total_in),he(D,k.total_in>>8&255),he(D,k.total_in>>16&255),he(D,k.total_in>>24&255)):(ne(D,k.adler>>>16),ne(D,65535&k.adler)),z(k),0=G.w_size&&(T===0&&(Q(G.head),G.strstart=0,G.block_start=0,G.insert=0),H=new i.Buf8(G.w_size),i.arraySet(H,J,X-G.w_size,G.w_size,0),J=H,X=G.w_size),O=k.avail_in,Y=k.next_in,M=k.input,k.avail_in=X,k.next_in=0,k.input=J,Oe(G);G.lookahead>=A;){for(D=G.strstart,S=G.lookahead-(A-1);G.ins_h=(G.ins_h<>>=A=P>>>24,w-=A,(A=P>>>16&255)===0)V[d++]=65535&P;else{if(!(16&A)){if(!(64&A)){P=C[(65535&P)+(h&(1<>>=A,w-=A),w<15&&(h+=b[c++]<>>=A=P>>>24,w-=A,!(16&(A=P>>>16&255))){if(!(64&A)){P=j[(65535&P)+(h&(1<>>=A,w-=A,(A=d-f)>3,h&=(1<<(w-=L<<3))-1,o.next_in=c,o.next_out=d,o.avail_in=c>>24&255)+(N>>>8&65280)+((65280&N)<<8)+((255&N)<<24)}function h(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new o.Buf16(320),this.work=new o.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function w(N){var F;return N&&N.state?(F=N.state,N.total_in=N.total_out=F.total=0,N.msg="",F.wrap&&(N.adler=1&F.wrap),F.mode=x,F.last=0,F.havedict=0,F.dmax=32768,F.head=null,F.hold=0,F.bits=0,F.lencode=F.lendyn=new o.Buf32(y),F.distcode=F.distdyn=new o.Buf32(_),F.sane=1,F.back=-1,m):v}function C(N){var F;return N&&N.state?((F=N.state).wsize=0,F.whave=0,F.wnext=0,w(N)):v}function j(N,F){var b,V;return N&&N.state?(V=N.state,F<0?(b=0,F=-F):(b=1+(F>>4),F<48&&(F&=15)),F&&(F<8||15=B.wsize?(o.arraySet(B.window,F,b-B.wsize,B.wsize,0),B.wnext=0,B.whave=B.wsize):(V<(te=B.wsize-B.wnext)&&(te=V),o.arraySet(B.window,F,b-V,te,B.wnext),(V-=te)?(o.arraySet(B.window,F,b-V,V,0),B.wnext=V,B.whave=B.wsize):(B.wnext+=te,B.wnext===B.wsize&&(B.wnext=0),B.whave>>8&255,b.check=a(b.check,T,2,0),$=z=0,b.mode=2;break}if(b.flags=0,b.head&&(b.head.done=!1),!(1&b.wrap)||(((255&z)<<8)+(z>>8))%31){N.msg="incorrect header check",b.mode=30;break}if((15&z)!=8){N.msg="unknown compression method",b.mode=30;break}if($-=4,k=8+(15&(z>>>=4)),b.wbits===0)b.wbits=k;else if(k>b.wbits){N.msg="invalid window size",b.mode=30;break}b.dmax=1<>8&1),512&b.flags&&(T[0]=255&z,T[1]=z>>>8&255,b.check=a(b.check,T,2,0)),$=z=0,b.mode=3;case 3:for(;$<32;){if(I===0)break e;I--,z+=V[B++]<<$,$+=8}b.head&&(b.head.time=z),512&b.flags&&(T[0]=255&z,T[1]=z>>>8&255,T[2]=z>>>16&255,T[3]=z>>>24&255,b.check=a(b.check,T,4,0)),$=z=0,b.mode=4;case 4:for(;$<16;){if(I===0)break e;I--,z+=V[B++]<<$,$+=8}b.head&&(b.head.xflags=255&z,b.head.os=z>>8),512&b.flags&&(T[0]=255&z,T[1]=z>>>8&255,b.check=a(b.check,T,2,0)),$=z=0,b.mode=5;case 5:if(1024&b.flags){for(;$<16;){if(I===0)break e;I--,z+=V[B++]<<$,$+=8}b.length=z,b.head&&(b.head.extra_len=z),512&b.flags&&(T[0]=255&z,T[1]=z>>>8&255,b.check=a(b.check,T,2,0)),$=z=0}else b.head&&(b.head.extra=null);b.mode=6;case 6:if(1024&b.flags&&(I<(se=b.length)&&(se=I),se&&(b.head&&(k=b.head.extra_len-b.length,b.head.extra||(b.head.extra=new Array(b.head.extra_len)),o.arraySet(b.head.extra,V,B,se,k)),512&b.flags&&(b.check=a(b.check,V,se,B)),I-=se,B+=se,b.length-=se),b.length))break e;b.length=0,b.mode=7;case 7:if(2048&b.flags){if(I===0)break e;for(se=0;k=V[B+se++],b.head&&k&&b.length<65536&&(b.head.name+=String.fromCharCode(k)),k&&se>9&1,b.head.done=!0),N.adler=b.check=0,b.mode=12;break;case 10:for(;$<32;){if(I===0)break e;I--,z+=V[B++]<<$,$+=8}N.adler=b.check=p(z),$=z=0,b.mode=11;case 11:if(b.havedict===0)return N.next_out=K,N.avail_out=Q,N.next_in=B,N.avail_in=I,b.hold=z,b.bits=$,2;N.adler=b.check=1,b.mode=12;case 12:if(F===5||F===6)break e;case 13:if(b.last){z>>>=7&$,$-=7&$,b.mode=27;break}for(;$<3;){if(I===0)break e;I--,z+=V[B++]<<$,$+=8}switch(b.last=1&z,$-=1,3&(z>>>=1)){case 0:b.mode=14;break;case 1:if(L(b),b.mode=20,F!==6)break;z>>>=2,$-=2;break e;case 2:b.mode=17;break;case 3:N.msg="invalid block type",b.mode=30}z>>>=2,$-=2;break;case 14:for(z>>>=7&$,$-=7&$;$<32;){if(I===0)break e;I--,z+=V[B++]<<$,$+=8}if((65535&z)!=(z>>>16^65535)){N.msg="invalid stored block lengths",b.mode=30;break}if(b.length=65535&z,$=z=0,b.mode=15,F===6)break e;case 15:b.mode=16;case 16:if(se=b.length){if(I>>=5,$-=5,b.ndist=1+(31&z),z>>>=5,$-=5,b.ncode=4+(15&z),z>>>=4,$-=4,286>>=3,$-=3}for(;b.have<19;)b.lens[O[b.have++]]=0;if(b.lencode=b.lendyn,b.lenbits=7,G={bits:b.lenbits},J=u(0,b.lens,0,19,b.lencode,0,b.work,G),b.lenbits=G.bits,J){N.msg="invalid code lengths set",b.mode=30;break}b.have=0,b.mode=19;case 19:for(;b.have>>16&255,Fe=65535&S,!((ye=S>>>24)<=$);){if(I===0)break e;I--,z+=V[B++]<<$,$+=8}if(Fe<16)z>>>=ye,$-=ye,b.lens[b.have++]=Fe;else{if(Fe===16){for(D=ye+2;$>>=ye,$-=ye,b.have===0){N.msg="invalid bit length repeat",b.mode=30;break}k=b.lens[b.have-1],se=3+(3&z),z>>>=2,$-=2}else if(Fe===17){for(D=ye+3;$>>=ye)),z>>>=3,$-=3}else{for(D=ye+7;$>>=ye)),z>>>=7,$-=7}if(b.have+se>b.nlen+b.ndist){N.msg="invalid bit length repeat",b.mode=30;break}for(;se--;)b.lens[b.have++]=k}}if(b.mode===30)break;if(b.lens[256]===0){N.msg="invalid code -- missing end-of-block",b.mode=30;break}if(b.lenbits=9,G={bits:b.lenbits},J=u(d,b.lens,0,b.nlen,b.lencode,0,b.work,G),b.lenbits=G.bits,J){N.msg="invalid literal/lengths set",b.mode=30;break}if(b.distbits=6,b.distcode=b.distdyn,G={bits:b.distbits},J=u(f,b.lens,b.nlen,b.ndist,b.distcode,0,b.work,G),b.distbits=G.bits,J){N.msg="invalid distances set",b.mode=30;break}if(b.mode=20,F===6)break e;case 20:b.mode=21;case 21:if(6<=I&&258<=Q){N.next_out=K,N.avail_out=Q,N.next_in=B,N.avail_in=I,b.hold=z,b.bits=$,c(N,ne),K=N.next_out,te=N.output,Q=N.avail_out,B=N.next_in,V=N.input,I=N.avail_in,z=b.hold,$=b.bits,b.mode===12&&(b.back=-1);break}for(b.back=0;Ne=(S=b.lencode[z&(1<>>16&255,Fe=65535&S,!((ye=S>>>24)<=$);){if(I===0)break e;I--,z+=V[B++]<<$,$+=8}if(Ne&&!(240&Ne)){for(Me=ye,Pe=Ne,nt=Fe;Ne=(S=b.lencode[nt+((z&(1<>Me)])>>>16&255,Fe=65535&S,!(Me+(ye=S>>>24)<=$);){if(I===0)break e;I--,z+=V[B++]<<$,$+=8}z>>>=Me,$-=Me,b.back+=Me}if(z>>>=ye,$-=ye,b.back+=ye,b.length=Fe,Ne===0){b.mode=26;break}if(32&Ne){b.back=-1,b.mode=12;break}if(64&Ne){N.msg="invalid literal/length code",b.mode=30;break}b.extra=15&Ne,b.mode=22;case 22:if(b.extra){for(D=b.extra;$>>=b.extra,$-=b.extra,b.back+=b.extra}b.was=b.length,b.mode=23;case 23:for(;Ne=(S=b.distcode[z&(1<>>16&255,Fe=65535&S,!((ye=S>>>24)<=$);){if(I===0)break e;I--,z+=V[B++]<<$,$+=8}if(!(240&Ne)){for(Me=ye,Pe=Ne,nt=Fe;Ne=(S=b.distcode[nt+((z&(1<>Me)])>>>16&255,Fe=65535&S,!(Me+(ye=S>>>24)<=$);){if(I===0)break e;I--,z+=V[B++]<<$,$+=8}z>>>=Me,$-=Me,b.back+=Me}if(z>>>=ye,$-=ye,b.back+=ye,64&Ne){N.msg="invalid distance code",b.mode=30;break}b.offset=Fe,b.extra=15&Ne,b.mode=24;case 24:if(b.extra){for(D=b.extra;$>>=b.extra,$-=b.extra,b.back+=b.extra}if(b.offset>b.dmax){N.msg="invalid distance too far back",b.mode=30;break}b.mode=25;case 25:if(Q===0)break e;if(se=ne-Q,b.offset>se){if((se=b.offset-se)>b.whave&&b.sane){N.msg="invalid distance too far back",b.mode=30;break}Oe=se>b.wnext?(se-=b.wnext,b.wsize-se):b.wnext-se,se>b.length&&(se=b.length),pe=b.window}else pe=te,Oe=K-b.offset,se=b.length;for(QR?(A=Oe[pe+_[F]],$[he+_[F]]):(A=96,0),h=1<>K)+(w-=h)]=P<<24|A<<16|L|0,w!==0;);for(h=1<>=1;if(h!==0?(z&=h-1,z+=h):z=0,F++,--ne[N]==0){if(N===V)break;N=f[m+_[F]]}if(te>>7)]}function he(S,T){S.pending_buf[S.pending++]=255&T,S.pending_buf[S.pending++]=T>>>8&255}function ne(S,T,O){S.bi_valid>p-O?(S.bi_buf|=T<>p-S.bi_valid,S.bi_valid+=O-p):(S.bi_buf|=T<>>=1,O<<=1,0<--T;);return O>>>1}function pe(S,T,O){var Y,M,H=new Array(_+1),X=0;for(Y=1;Y<=_;Y++)H[Y]=X=X+O[Y-1]<<1;for(M=0;M<=T;M++){var ee=S[2*M+1];ee!==0&&(S[2*M]=Oe(H[ee]++,ee))}}function ye(S){var T;for(T=0;T>1;1<=O;O--)Me(S,H,O);for(M=me;O=S.heap[1],S.heap[1]=S.heap[S.heap_len--],Me(S,H,1),Y=S.heap[1],S.heap[--S.heap_max]=O,S.heap[--S.heap_max]=Y,H[2*M]=H[2*O]+H[2*Y],S.depth[M]=(S.depth[O]>=S.depth[Y]?S.depth[O]:S.depth[Y])+1,H[2*O+1]=H[2*Y+1]=M,S.heap[1]=M++,Me(S,H,1),2<=S.heap_len;);S.heap[--S.heap_max]=S.heap[1],function(Ue,jt){var qr,Ht,Qn,at,Jn,es,Xr=jt.dyn_tree,Vc=jt.max_code,Bc=jt.stat_desc.static_tree,gi=jt.stat_desc.has_stree,Wc=jt.stat_desc.extra_bits,vi=jt.stat_desc.extra_base,An=jt.stat_desc.max_length,Ls=0;for(at=0;at<=_;at++)Ue.bl_count[at]=0;for(Xr[2*Ue.heap[Ue.heap_max]+1]=0,qr=Ue.heap_max+1;qr>=7;M>>=1)if(1&Ye&&ee.dyn_ltree[2*me]!==0)return i;if(ee.dyn_ltree[18]!==0||ee.dyn_ltree[20]!==0||ee.dyn_ltree[26]!==0)return a;for(me=32;me>>3,(H=S.static_len+3+7>>>3)<=M&&(M=H)):M=H=O+5,O+4<=M&&T!==-1?D(S,T,O,Y):S.strategy===4||H===M?(ne(S,2+(Y?1:0),3),Pe(S,q,N)):(ne(S,4+(Y?1:0),3),function(ee,me,Ye,Ue){var jt;for(ne(ee,me-257,5),ne(ee,Ye-1,5),ne(ee,Ue-4,4),jt=0;jt>>8&255,S.pending_buf[S.d_buf+2*S.last_lit+1]=255&T,S.pending_buf[S.l_buf+S.last_lit]=255&O,S.last_lit++,T===0?S.dyn_ltree[2*O]++:(S.matches++,T--,S.dyn_ltree[2*(b[O]+f+1)]++,S.dyn_dtree[2*$(T)]++),S.last_lit===S.lit_bufsize-1},s._tr_align=function(S){ne(S,2,3),se(S,w,q),function(T){T.bi_valid===16?(he(T,T.bi_buf),T.bi_buf=0,T.bi_valid=0):8<=T.bi_valid&&(T.pending_buf[T.pending++]=255&T.bi_buf,T.bi_buf>>=8,T.bi_valid-=8)}(S)}},{"../utils/common":41}],53:[function(r,n,s){n.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(r,n,s){(function(o){(function(i,a){if(!i.setImmediate){var c,u,d,f,m=1,v={},x=!1,y=i.document,_=Object.getPrototypeOf&&Object.getPrototypeOf(i);_=_&&_.setTimeout?_:i,c={}.toString.call(i.process)==="[object process]"?function(C){process.nextTick(function(){h(C)})}:function(){if(i.postMessage&&!i.importScripts){var C=!0,j=i.onmessage;return i.onmessage=function(){C=!1},i.postMessage("","*"),i.onmessage=j,C}}()?(f="setImmediate$"+Math.random()+"$",i.addEventListener?i.addEventListener("message",w,!1):i.attachEvent("onmessage",w),function(C){i.postMessage(f+C,"*")}):i.MessageChannel?((d=new MessageChannel).port1.onmessage=function(C){h(C.data)},function(C){d.port2.postMessage(C)}):y&&"onreadystatechange"in y.createElement("script")?(u=y.documentElement,function(C){var j=y.createElement("script");j.onreadystatechange=function(){h(C),j.onreadystatechange=null,u.removeChild(j),j=null},u.appendChild(j)}):function(C){setTimeout(h,0,C)},_.setImmediate=function(C){typeof C!="function"&&(C=new Function(""+C));for(var j=new Array(arguments.length-1),E=0;E"u"?o===void 0?this:o:self)}).call(this,typeof Zc<"u"?Zc:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(jj);var uz=jj.exports;const dz=Fm(uz);function fz(e){return new Promise((t,r)=>{const n=new FileReader;n.onload=()=>{n.result?t(n.result.toString()):r("No content found")},n.onerror=()=>r(n.error),n.readAsText(e)})}const hz=async(e,t)=>{const r=new dz;t.forEach(o=>{r.file(o.name,o.content)});const n=await r.generateAsync({type:"blob"}),s=document.createElement("a");s.href=URL.createObjectURL(n),s.download=e,s.click()},ya=e=>{const t=new Date(e);return new Intl.DateTimeFormat("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1,timeZone:"Asia/Shanghai"}).format(t)},pz=e=>ya(e).split(" ")[0];function Ej(e){const t=new Date;t.setUTCDate(t.getUTCDate()+e);const r=t.getUTCFullYear(),n=String(t.getUTCMonth()+1).padStart(2,"0"),s=String(t.getUTCDate()).padStart(2,"0"),o=String(t.getUTCHours()).padStart(2,"0"),i=String(t.getUTCMinutes()).padStart(2,"0"),a=String(t.getUTCSeconds()).padStart(2,"0");return`${r}-${n}-${s} ${o}:${i}:${a}`}const mz=async e=>{let t=1;e.page&&(t=e.page);let r=2;e.perPage&&(r=e.perPage);const n=st();let s="";return e.state==="enabled"?s="enabled=true":e.state==="disabled"?s="enabled=false":e.state==="expired"&&(s=n.filter("expiredAt<{:expiredAt}",{expiredAt:Ej(15)})),n.collection("domains").getList(t,r,{sort:"-created",expand:"lastDeployment",filter:s})},gz=async()=>{const e=st(),t=await e.collection("domains").getList(1,1,{}),r=await e.collection("domains").getList(1,1,{filter:e.filter("expiredAt<{:expiredAt}",{expiredAt:Ej(15)})}),n=await e.collection("domains").getList(1,1,{filter:"enabled=true"}),s=await e.collection("domains").getList(1,1,{filter:"enabled=false"});return{total:t.totalItems,expired:r.totalItems,enabled:n.totalItems,disabled:s.totalItems}},vz=async e=>await st().collection("domains").getOne(e),km=async e=>e.id?await st().collection("domains").update(e.id,e):await st().collection("domains").create(e),yz=async e=>await st().collection("domains").delete(e),xz=(e,t)=>st().collection("domains").subscribe(e,r=>{r.action==="update"&&t(r.record)},{expand:"lastDeployment"}),wz=e=>{st().collection("domains").unsubscribe(e)},_z=()=>{const e=Pn(),t=Pr(),r=Nn(),n=new URLSearchParams(r.search),s=n.get("page"),o=n.get("state"),[i,a]=g.useState(0),c=()=>{t("/edit")},u=w=>{n.set("page",w.toString()),t(`?${n.toString()}`)},d=w=>{t(`/edit?id=${w}`)},f=w=>{t(`/history?domain=${w}`)},m=async w=>{try{await yz(w),x(v.filter(C=>C.id!==w))}catch(C){console.error("Error deleting domain:",C)}},[v,x]=g.useState([]);g.useEffect(()=>{(async()=>{const C=await mz({page:s?Number(s):1,perPage:10,state:o||""});x(C.items),a(C.totalPages)})()},[s,o]);const y=async w=>{const C=v.filter(P=>P.id===w),j=C[0].enabled,E=C[0];E.enabled=!j,await km(E);const R=v.map(P=>P.id===w?{...P,checked:!j}:P);x(R)},_=async w=>{try{wz(w.id),xz(w.id,C=>{console.log(C);const j=v.map(E=>E.id===C.id?{...C}:E);x(j)}),w.rightnow=!0,await km(w),e.toast({title:"操作成功",description:"已发起部署,请稍后查看部署日志。"})}catch{e.toast({title:"执行失败",description:l.jsxs(l.Fragment,{children:["执行失败,请查看",l.jsx(hr,{to:`/history?domain=${w.id}`,className:"underline text-blue-500",children:"部署日志"}),"查看详情。"]}),variant:"destructive"})}},p=async w=>{await _({...w,deployed:!1})},h=async w=>{const C=`${w.id}-${w.domain}.zip`,j=[{name:`${w.domain}.pem`,content:w.certificate?w.certificate:""},{name:`${w.domain}.key`,content:w.privateKey?w.privateKey:""}];await hz(C,j)};return l.jsx(l.Fragment,{children:l.jsxs("div",{className:"",children:[l.jsx(hy,{}),l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsx("div",{className:"text-muted-foreground",children:"域名列表"}),l.jsx(He,{onClick:c,children:"新增域名"})]}),v.length?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"hidden sm:flex sm:flex-row text-muted-foreground text-sm border-b dark:border-stone-500 sm:p-2 mt-5",children:[l.jsx("div",{className:"w-36",children:"域名"}),l.jsx("div",{className:"w-40",children:"有效期限"}),l.jsx("div",{className:"w-32",children:"最近执行状态"}),l.jsx("div",{className:"w-64",children:"最近执行阶段"}),l.jsx("div",{className:"w-40 sm:ml-2",children:"最近执行时间"}),l.jsx("div",{className:"w-24",children:"是否启用"}),l.jsx("div",{className:"grow",children:"操作"})]}),l.jsx("div",{className:"sm:hidden flex text-sm text-muted-foreground",children:"域名"}),v.map(w=>{var C,j,E,R;return l.jsxs("div",{className:"flex flex-col sm:flex-row text-secondary-foreground border-b dark:border-stone-500 sm:p-2 hover:bg-muted/50 text-sm",children:[l.jsx("div",{className:"sm:w-36 w-full pt-1 sm:pt-0 flex items-center",children:w.domain}),l.jsx("div",{className:"sm:w-40 w-full pt-1 sm:pt-0 flex items-center",children:l.jsx("div",{children:w.expiredAt?l.jsxs(l.Fragment,{children:[l.jsx("div",{children:"有效期90天"}),l.jsxs("div",{children:[pz(w.expiredAt),"到期"]})]}):"---"})}),l.jsx("div",{className:"sm:w-32 w-full pt-1 sm:pt-0 flex items-center",children:w.lastDeployedAt&&((C=w.expand)!=null&&C.lastDeployment)?l.jsx(l.Fragment,{children:l.jsx(ey,{deployment:w.expand.lastDeployment})}):"---"}),l.jsx("div",{className:"sm:w-64 w-full pt-1 sm:pt-0 flex items-center",children:w.lastDeployedAt&&((j=w.expand)!=null&&j.lastDeployment)?l.jsx(qv,{phase:(E=w.expand.lastDeployment)==null?void 0:E.phase,phaseSuccess:(R=w.expand.lastDeployment)==null?void 0:R.phaseSuccess}):"---"}),l.jsx("div",{className:"sm:w-40 pt-1 sm:pt-0 sm:ml-2 flex items-center",children:w.lastDeployedAt?ya(w.lastDeployedAt):"---"}),l.jsx("div",{className:"sm:w-24 flex items-center",children:l.jsx(Qv,{children:l.jsxs(_C,{children:[l.jsx(bC,{children:l.jsx(Fc,{checked:w.enabled,onCheckedChange:()=>{y(w.id)}})}),l.jsx(Jv,{children:l.jsx("div",{className:"border rounded-sm px-3 bg-background text-muted-foreground text-xs",children:w.enabled?"禁用":"启用"})})]})})}),l.jsxs("div",{className:"flex items-center grow justify-start pt-1 sm:pt-0",children:[l.jsx(He,{variant:"link",className:"p-0",onClick:()=>f(w.id),children:"部署历史"}),l.jsxs(ia,{when:!!w.enabled,children:[l.jsx(Bt,{orientation:"vertical",className:"h-4 mx-2"}),l.jsx(He,{variant:"link",className:"p-0",onClick:()=>_(w),children:"立即部署"})]}),l.jsxs(ia,{when:!!(w.enabled&&w.deployed),children:[l.jsx(Bt,{orientation:"vertical",className:"h-4 mx-2"}),l.jsx(He,{variant:"link",className:"p-0",onClick:()=>p(w),children:"强行部署"})]}),l.jsxs(ia,{when:!!w.expiredAt,children:[l.jsx(Bt,{orientation:"vertical",className:"h-4 mx-2"}),l.jsx(He,{variant:"link",className:"p-0",onClick:()=>h(w),children:"下载"})]}),!w.enabled&&l.jsxs(l.Fragment,{children:[l.jsx(Bt,{orientation:"vertical",className:"h-4 mx-2"}),l.jsxs(GC,{children:[l.jsx(ZC,{asChild:!0,children:l.jsx(He,{variant:"link",className:"p-0",children:"删除"})}),l.jsxs(ty,{children:[l.jsxs(ry,{children:[l.jsx(sy,{children:"删除域名"}),l.jsx(oy,{children:"确定要删除域名吗?"})]}),l.jsxs(ny,{children:[l.jsx(ay,{children:"取消"}),l.jsx(iy,{onClick:()=>{m(w.id)},children:"确认"})]})]})]}),l.jsx(Bt,{orientation:"vertical",className:"h-4 mx-2"}),l.jsx(He,{variant:"link",className:"p-0",onClick:()=>d(w.id),children:"编辑"})]})]})]},w.id)}),l.jsx(NC,{totalPages:i,currentPage:s?Number(s):1,onPageChange:w=>{u(w)}})]}):l.jsx(l.Fragment,{children:l.jsxs("div",{className:"flex flex-col items-center mt-10",children:[l.jsx("span",{className:"bg-orange-100 p-5 rounded-full",children:l.jsx(rm,{size:40,className:"text-primary"})}),l.jsx("div",{className:"text-center text-sm text-muted-foreground mt-3",children:"请添加域名开始部署证书吧。"}),l.jsx(He,{onClick:c,className:"mt-3",children:"添加域名"})]})})]})})},Te=g.forwardRef(({className:e,type:t,...r},n)=>l.jsx("input",{type:t,className:oe("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...r}));Te.displayName="Input";var zc=e=>e.type==="checkbox",Wi=e=>e instanceof Date,mr=e=>e==null;const Nj=e=>typeof e=="object";var qt=e=>!mr(e)&&!Array.isArray(e)&&Nj(e)&&!Wi(e),Tj=e=>qt(e)&&e.target?zc(e.target)?e.target.checked:e.target.value:e,bz=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,Rj=(e,t)=>e.has(bz(t)),Sz=e=>{const t=e.constructor&&e.constructor.prototype;return qt(t)&&t.hasOwnProperty("isPrototypeOf")},py=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Cr(e){let t;const r=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(py&&(e instanceof Blob||e instanceof FileList))&&(r||qt(e)))if(t=r?[]:{},!r&&!Sz(e))t=e;else for(const n in e)e.hasOwnProperty(n)&&(t[n]=Cr(e[n]));else return e;return t}var Gf=e=>Array.isArray(e)?e.filter(Boolean):[],Ft=e=>e===void 0,ue=(e,t,r)=>{if(!t||!qt(e))return r;const n=Gf(t.split(/[,[\].]+?/)).reduce((s,o)=>mr(s)?s:s[o],e);return Ft(n)||n===e?Ft(e[t])?r:e[t]:n},zn=e=>typeof e=="boolean",my=e=>/^\w*$/.test(e),Pj=e=>Gf(e.replace(/["|']|\]/g,"").split(/\.|\[/)),ft=(e,t,r)=>{let n=-1;const s=my(t)?[t]:Pj(t),o=s.length,i=o-1;for(;++nBe.useContext(Aj),kz=e=>{const{children:t,...r}=e;return Be.createElement(Aj.Provider,{value:r},t)};var Dj=(e,t,r,n=!0)=>{const s={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(s,o,{get:()=>{const i=o;return t._proxyFormState[i]!==gn.all&&(t._proxyFormState[i]=!n||gn.all),r&&(r[i]=!0),e[i]}});return s},Or=e=>qt(e)&&!Object.keys(e).length,Oj=(e,t,r,n)=>{r(e);const{name:s,...o}=e;return Or(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(i=>t[i]===(!n||gn.all))},jl=e=>Array.isArray(e)?e:[e],Mj=(e,t,r)=>!e||!t||e===t||jl(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n)));function gy(e){const t=Be.useRef(e);t.current=e,Be.useEffect(()=>{const r=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{r&&r.unsubscribe()}},[e.disabled])}function Cz(e){const t=Zf(),{control:r=t.control,disabled:n,name:s,exact:o}=e||{},[i,a]=Be.useState(r._formState),c=Be.useRef(!0),u=Be.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),d=Be.useRef(s);return d.current=s,gy({disabled:n,next:f=>c.current&&Mj(d.current,f.name,o)&&Oj(f,u.current,r._updateFormState)&&a({...r._formState,...f}),subject:r._subjects.state}),Be.useEffect(()=>(c.current=!0,u.current.isValid&&r._updateValid(!0),()=>{c.current=!1}),[r]),Dj(i,r,u.current,!1)}var $n=e=>typeof e=="string",Ij=(e,t,r,n,s)=>$n(e)?(n&&t.watch.add(e),ue(r,e,s)):Array.isArray(e)?e.map(o=>(n&&t.watch.add(o),ue(r,o))):(n&&(t.watchAll=!0),r);function jz(e){const t=Zf(),{control:r=t.control,name:n,defaultValue:s,disabled:o,exact:i}=e||{},a=Be.useRef(n);a.current=n,gy({disabled:o,subject:r._subjects.values,next:d=>{Mj(a.current,d.name,i)&&u(Cr(Ij(a.current,r._names,d.values||r._formValues,!1,s)))}});const[c,u]=Be.useState(r._getWatch(n,s));return Be.useEffect(()=>r._removeUnmounted()),c}function Ez(e){const t=Zf(),{name:r,disabled:n,control:s=t.control,shouldUnregister:o}=e,i=Rj(s._names.array,r),a=jz({control:s,name:r,defaultValue:ue(s._formValues,r,ue(s._defaultValues,r,e.defaultValue)),exact:!0}),c=Cz({control:s,name:r}),u=Be.useRef(s.register(r,{...e.rules,value:a,...zn(e.disabled)?{disabled:e.disabled}:{}}));return Be.useEffect(()=>{const d=s._options.shouldUnregister||o,f=(m,v)=>{const x=ue(s._fields,m);x&&x._f&&(x._f.mount=v)};if(f(r,!0),d){const m=Cr(ue(s._options.defaultValues,r));ft(s._defaultValues,r,m),Ft(ue(s._formValues,r))&&ft(s._formValues,r,m)}return()=>{(i?d&&!s._state.action:d)?s.unregister(r):f(r,!1)}},[r,s,i,o]),Be.useEffect(()=>{ue(s._fields,r)&&s._updateDisabledField({disabled:n,fields:s._fields,name:r,value:ue(s._fields,r)._f.value})},[n,r,s]),{field:{name:r,value:a,...zn(n)||c.disabled?{disabled:c.disabled||n}:{},onChange:Be.useCallback(d=>u.current.onChange({target:{value:Tj(d),name:r},type:Md.CHANGE}),[r]),onBlur:Be.useCallback(()=>u.current.onBlur({target:{value:ue(s._formValues,r),name:r},type:Md.BLUR}),[r,s]),ref:d=>{const f=ue(s._fields,r);f&&d&&(f._f.ref={focus:()=>d.focus(),select:()=>d.select(),setCustomValidity:m=>d.setCustomValidity(m),reportValidity:()=>d.reportValidity()})}},formState:c,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!ue(c.errors,r)},isDirty:{enumerable:!0,get:()=>!!ue(c.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!ue(c.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!ue(c.validatingFields,r)},error:{enumerable:!0,get:()=>ue(c.errors,r)}})}}const Nz=e=>e.render(Ez(e));var Lj=(e,t,r,n,s)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:s||!0}}:{},mw=e=>({isOnSubmit:!e||e===gn.onSubmit,isOnBlur:e===gn.onBlur,isOnChange:e===gn.onChange,isOnAll:e===gn.all,isOnTouch:e===gn.onTouched}),gw=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const El=(e,t,r,n)=>{for(const s of r||Object.keys(e)){const o=ue(e,s);if(o){const{_f:i,...a}=o;if(i){if(i.refs&&i.refs[0]&&t(i.refs[0],s)&&!n)break;if(i.ref&&t(i.ref,i.name)&&!n)break;El(a,t)}else qt(a)&&El(a,t)}}};var Tz=(e,t,r)=>{const n=jl(ue(e,r));return ft(n,"root",t[r]),ft(e,r,n),e},vy=e=>e.type==="file",to=e=>typeof e=="function",Id=e=>{if(!py)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Zu=e=>$n(e),yy=e=>e.type==="radio",Ld=e=>e instanceof RegExp;const vw={value:!1,isValid:!1},yw={value:!0,isValid:!0};var Fj=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Ft(e[0].attributes.value)?Ft(e[0].value)||e[0].value===""?yw:{value:e[0].value,isValid:!0}:yw:vw}return vw};const xw={isValid:!1,value:null};var zj=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,xw):xw;function ww(e,t,r="validate"){if(Zu(e)||Array.isArray(e)&&e.every(Zu)||zn(e)&&!e)return{type:r,message:Zu(e)?e:"",ref:t}}var Ei=e=>qt(e)&&!Ld(e)?e:{value:e,message:""},_w=async(e,t,r,n,s)=>{const{ref:o,refs:i,required:a,maxLength:c,minLength:u,min:d,max:f,pattern:m,validate:v,name:x,valueAsNumber:y,mount:_,disabled:p}=e._f,h=ue(t,x);if(!_||p)return{};const w=i?i[0]:o,C=N=>{n&&w.reportValidity&&(w.setCustomValidity(zn(N)?"":N||""),w.reportValidity())},j={},E=yy(o),R=zc(o),P=E||R,A=(y||vy(o))&&Ft(o.value)&&Ft(h)||Id(o)&&o.value===""||h===""||Array.isArray(h)&&!h.length,L=Lj.bind(null,x,r,j),q=(N,F,b,V=ss.maxLength,te=ss.minLength)=>{const B=N?F:b;j[x]={type:N?V:te,message:B,ref:o,...L(N?V:te,B)}};if(s?!Array.isArray(h)||!h.length:a&&(!P&&(A||mr(h))||zn(h)&&!h||R&&!Fj(i).isValid||E&&!zj(i).isValid)){const{value:N,message:F}=Zu(a)?{value:!!a,message:a}:Ei(a);if(N&&(j[x]={type:ss.required,message:F,ref:w,...L(ss.required,F)},!r))return C(F),j}if(!A&&(!mr(d)||!mr(f))){let N,F;const b=Ei(f),V=Ei(d);if(!mr(h)&&!isNaN(h)){const te=o.valueAsNumber||h&&+h;mr(b.value)||(N=te>b.value),mr(V.value)||(F=tenew Date(new Date().toDateString()+" "+Q),K=o.type=="time",I=o.type=="week";$n(b.value)&&h&&(N=K?B(h)>B(b.value):I?h>b.value:te>new Date(b.value)),$n(V.value)&&h&&(F=K?B(h)+N.value,V=!mr(F.value)&&h.length<+F.value;if((b||V)&&(q(b,N.message,F.message),!r))return C(j[x].message),j}if(m&&!A&&$n(h)){const{value:N,message:F}=Ei(m);if(Ld(N)&&!h.match(N)&&(j[x]={type:ss.pattern,message:F,ref:o,...L(ss.pattern,F)},!r))return C(F),j}if(v){if(to(v)){const N=await v(h,t),F=ww(N,w);if(F&&(j[x]={...F,...L(ss.validate,F.message)},!r))return C(F.message),j}else if(qt(v)){let N={};for(const F in v){if(!Or(N)&&!r)break;const b=ww(await v[F](h,t),w,F);b&&(N={...b,...L(F,b.message)},C(b.message),r&&(j[x]=N))}if(!Or(N)&&(j[x]={ref:w,...N},!r))return j}}return C(!0),j};function Rz(e,t){const r=t.slice(0,-1).length;let n=0;for(;n{let e=[];return{get observers(){return e},next:s=>{for(const o of e)o.next&&o.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(o=>o!==s)}}),unsubscribe:()=>{e=[]}}},Fd=e=>mr(e)||!Nj(e);function Ho(e,t){if(Fd(e)||Fd(t))return e===t;if(Wi(e)&&Wi(t))return e.getTime()===t.getTime();const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(const s of r){const o=e[s];if(!n.includes(s))return!1;if(s!=="ref"){const i=t[s];if(Wi(o)&&Wi(i)||qt(o)&&qt(i)||Array.isArray(o)&&Array.isArray(i)?!Ho(o,i):o!==i)return!1}}return!0}var Uj=e=>e.type==="select-multiple",Az=e=>yy(e)||zc(e),np=e=>Id(e)&&e.isConnected,$j=e=>{for(const t in e)if(to(e[t]))return!0;return!1};function zd(e,t={}){const r=Array.isArray(e);if(qt(e)||r)for(const n in e)Array.isArray(e[n])||qt(e[n])&&!$j(e[n])?(t[n]=Array.isArray(e[n])?[]:{},zd(e[n],t[n])):mr(e[n])||(t[n]=!0);return t}function Vj(e,t,r){const n=Array.isArray(e);if(qt(e)||n)for(const s in e)Array.isArray(e[s])||qt(e[s])&&!$j(e[s])?Ft(t)||Fd(r[s])?r[s]=Array.isArray(e[s])?zd(e[s],[]):{...zd(e[s])}:Vj(e[s],mr(t)?{}:t[s],r[s]):r[s]=!Ho(e[s],t[s]);return r}var ju=(e,t)=>Vj(e,t,zd(t)),Bj=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Ft(e)?e:t?e===""?NaN:e&&+e:r&&$n(e)?new Date(e):n?n(e):e;function sp(e){const t=e.ref;if(!(e.refs?e.refs.every(r=>r.disabled):t.disabled))return vy(t)?t.files:yy(t)?zj(e.refs).value:Uj(t)?[...t.selectedOptions].map(({value:r})=>r):zc(t)?Fj(e.refs).value:Bj(Ft(t.value)?e.ref.value:t.value,e)}var Dz=(e,t,r,n)=>{const s={};for(const o of e){const i=ue(t,o);i&&ft(s,o,i._f)}return{criteriaMode:r,names:[...e],fields:s,shouldUseNativeValidation:n}},tl=e=>Ft(e)?e:Ld(e)?e.source:qt(e)?Ld(e.value)?e.value.source:e.value:e,Oz=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function bw(e,t,r){const n=ue(e,r);if(n||my(r))return{error:n,name:r};const s=r.split(".");for(;s.length;){const o=s.join("."),i=ue(t,o),a=ue(e,o);if(i&&!Array.isArray(i)&&r!==o)return{name:r};if(a&&a.type)return{name:o,error:a};s.pop()}return{name:r}}var Mz=(e,t,r,n,s)=>s.isOnAll?!1:!r&&s.isOnTouch?!(t||e):(r?n.isOnBlur:s.isOnBlur)?!e:(r?n.isOnChange:s.isOnChange)?e:!0,Iz=(e,t)=>!Gf(ue(e,t)).length&&Yt(e,t);const Lz={mode:gn.onSubmit,reValidateMode:gn.onChange,shouldFocusError:!0};function Fz(e={}){let t={...Lz,...e},r={submitCount:0,isDirty:!1,isLoading:to(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},n={},s=qt(t.defaultValues)||qt(t.values)?Cr(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:Cr(s),i={action:!1,mount:!1,watch:!1},a={mount:new Set,unMount:new Set,array:new Set,watch:new Set},c,u=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},f={values:rp(),array:rp(),state:rp()},m=mw(t.mode),v=mw(t.reValidateMode),x=t.criteriaMode===gn.all,y=S=>T=>{clearTimeout(u),u=setTimeout(S,T)},_=async S=>{if(d.isValid||S){const T=t.resolver?Or((await P()).errors):await L(n,!0);T!==r.isValid&&f.state.next({isValid:T})}},p=(S,T)=>{(d.isValidating||d.validatingFields)&&((S||Array.from(a.mount)).forEach(O=>{O&&(T?ft(r.validatingFields,O,T):Yt(r.validatingFields,O))}),f.state.next({validatingFields:r.validatingFields,isValidating:!Or(r.validatingFields)}))},h=(S,T=[],O,Y,M=!0,H=!0)=>{if(Y&&O){if(i.action=!0,H&&Array.isArray(ue(n,S))){const X=O(ue(n,S),Y.argA,Y.argB);M&&ft(n,S,X)}if(H&&Array.isArray(ue(r.errors,S))){const X=O(ue(r.errors,S),Y.argA,Y.argB);M&&ft(r.errors,S,X),Iz(r.errors,S)}if(d.touchedFields&&H&&Array.isArray(ue(r.touchedFields,S))){const X=O(ue(r.touchedFields,S),Y.argA,Y.argB);M&&ft(r.touchedFields,S,X)}d.dirtyFields&&(r.dirtyFields=ju(s,o)),f.state.next({name:S,isDirty:N(S,T),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else ft(o,S,T)},w=(S,T)=>{ft(r.errors,S,T),f.state.next({errors:r.errors})},C=S=>{r.errors=S,f.state.next({errors:r.errors,isValid:!1})},j=(S,T,O,Y)=>{const M=ue(n,S);if(M){const H=ue(o,S,Ft(O)?ue(s,S):O);Ft(H)||Y&&Y.defaultChecked||T?ft(o,S,T?H:sp(M._f)):V(S,H),i.mount&&_()}},E=(S,T,O,Y,M)=>{let H=!1,X=!1;const ee={name:S},me=!!(ue(n,S)&&ue(n,S)._f&&ue(n,S)._f.disabled);if(!O||Y){d.isDirty&&(X=r.isDirty,r.isDirty=ee.isDirty=N(),H=X!==ee.isDirty);const Ye=me||Ho(ue(s,S),T);X=!!(!me&&ue(r.dirtyFields,S)),Ye||me?Yt(r.dirtyFields,S):ft(r.dirtyFields,S,!0),ee.dirtyFields=r.dirtyFields,H=H||d.dirtyFields&&X!==!Ye}if(O){const Ye=ue(r.touchedFields,S);Ye||(ft(r.touchedFields,S,O),ee.touchedFields=r.touchedFields,H=H||d.touchedFields&&Ye!==O)}return H&&M&&f.state.next(ee),H?ee:{}},R=(S,T,O,Y)=>{const M=ue(r.errors,S),H=d.isValid&&zn(T)&&r.isValid!==T;if(e.delayError&&O?(c=y(()=>w(S,O)),c(e.delayError)):(clearTimeout(u),c=null,O?ft(r.errors,S,O):Yt(r.errors,S)),(O?!Ho(M,O):M)||!Or(Y)||H){const X={...Y,...H&&zn(T)?{isValid:T}:{},errors:r.errors,name:S};r={...r,...X},f.state.next(X)}},P=async S=>{p(S,!0);const T=await t.resolver(o,t.context,Dz(S||a.mount,n,t.criteriaMode,t.shouldUseNativeValidation));return p(S),T},A=async S=>{const{errors:T}=await P(S);if(S)for(const O of S){const Y=ue(T,O);Y?ft(r.errors,O,Y):Yt(r.errors,O)}else r.errors=T;return T},L=async(S,T,O={valid:!0})=>{for(const Y in S){const M=S[Y];if(M){const{_f:H,...X}=M;if(H){const ee=a.array.has(H.name);p([Y],!0);const me=await _w(M,o,x,t.shouldUseNativeValidation&&!T,ee);if(p([Y]),me[H.name]&&(O.valid=!1,T))break;!T&&(ue(me,H.name)?ee?Tz(r.errors,me,H.name):ft(r.errors,H.name,me[H.name]):Yt(r.errors,H.name))}X&&await L(X,T,O)}}return O.valid},q=()=>{for(const S of a.unMount){const T=ue(n,S);T&&(T._f.refs?T._f.refs.every(O=>!np(O)):!np(T._f.ref))&&Oe(S)}a.unMount=new Set},N=(S,T)=>(S&&T&&ft(o,S,T),!Ho(z(),s)),F=(S,T,O)=>Ij(S,a,{...i.mount?o:Ft(T)?s:$n(S)?{[S]:T}:T},O,T),b=S=>Gf(ue(i.mount?o:s,S,e.shouldUnregister?ue(s,S,[]):[])),V=(S,T,O={})=>{const Y=ue(n,S);let M=T;if(Y){const H=Y._f;H&&(!H.disabled&&ft(o,S,Bj(T,H)),M=Id(H.ref)&&mr(T)?"":T,Uj(H.ref)?[...H.ref.options].forEach(X=>X.selected=M.includes(X.value)):H.refs?zc(H.ref)?H.refs.length>1?H.refs.forEach(X=>(!X.defaultChecked||!X.disabled)&&(X.checked=Array.isArray(M)?!!M.find(ee=>ee===X.value):M===X.value)):H.refs[0]&&(H.refs[0].checked=!!M):H.refs.forEach(X=>X.checked=X.value===M):vy(H.ref)?H.ref.value="":(H.ref.value=M,H.ref.type||f.values.next({name:S,values:{...o}})))}(O.shouldDirty||O.shouldTouch)&&E(S,M,O.shouldTouch,O.shouldDirty,!0),O.shouldValidate&&Q(S)},te=(S,T,O)=>{for(const Y in T){const M=T[Y],H=`${S}.${Y}`,X=ue(n,H);(a.array.has(S)||!Fd(M)||X&&!X._f)&&!Wi(M)?te(H,M,O):V(H,M,O)}},B=(S,T,O={})=>{const Y=ue(n,S),M=a.array.has(S),H=Cr(T);ft(o,S,H),M?(f.array.next({name:S,values:{...o}}),(d.isDirty||d.dirtyFields)&&O.shouldDirty&&f.state.next({name:S,dirtyFields:ju(s,o),isDirty:N(S,H)})):Y&&!Y._f&&!mr(H)?te(S,H,O):V(S,H,O),gw(S,a)&&f.state.next({...r}),f.values.next({name:i.mount?S:void 0,values:{...o}})},K=async S=>{i.mount=!0;const T=S.target;let O=T.name,Y=!0;const M=ue(n,O),H=()=>T.type?sp(M._f):Tj(S),X=ee=>{Y=Number.isNaN(ee)||ee===ue(o,O,ee)};if(M){let ee,me;const Ye=H(),Ue=S.type===Md.BLUR||S.type===Md.FOCUS_OUT,jt=!Oz(M._f)&&!t.resolver&&!ue(r.errors,O)&&!M._f.deps||Mz(Ue,ue(r.touchedFields,O),r.isSubmitted,v,m),qr=gw(O,a,Ue);ft(o,O,Ye),Ue?(M._f.onBlur&&M._f.onBlur(S),c&&c(0)):M._f.onChange&&M._f.onChange(S);const Ht=E(O,Ye,Ue,!1),Qn=!Or(Ht)||qr;if(!Ue&&f.values.next({name:O,type:S.type,values:{...o}}),jt)return d.isValid&&_(),Qn&&f.state.next({name:O,...qr?{}:Ht});if(!Ue&&qr&&f.state.next({...r}),t.resolver){const{errors:at}=await P([O]);if(X(Ye),Y){const Jn=bw(r.errors,n,O),es=bw(at,n,Jn.name||O);ee=es.error,O=es.name,me=Or(at)}}else p([O],!0),ee=(await _w(M,o,x,t.shouldUseNativeValidation))[O],p([O]),X(Ye),Y&&(ee?me=!1:d.isValid&&(me=await L(n,!0)));Y&&(M._f.deps&&Q(M._f.deps),R(O,me,ee,Ht))}},I=(S,T)=>{if(ue(r.errors,T)&&S.focus)return S.focus(),1},Q=async(S,T={})=>{let O,Y;const M=jl(S);if(t.resolver){const H=await A(Ft(S)?S:M);O=Or(H),Y=S?!M.some(X=>ue(H,X)):O}else S?(Y=(await Promise.all(M.map(async H=>{const X=ue(n,H);return await L(X&&X._f?{[H]:X}:X)}))).every(Boolean),!(!Y&&!r.isValid)&&_()):Y=O=await L(n);return f.state.next({...!$n(S)||d.isValid&&O!==r.isValid?{}:{name:S},...t.resolver||!S?{isValid:O}:{},errors:r.errors}),T.shouldFocus&&!Y&&El(n,I,S?M:a.mount),Y},z=S=>{const T={...i.mount?o:s};return Ft(S)?T:$n(S)?ue(T,S):S.map(O=>ue(T,O))},$=(S,T)=>({invalid:!!ue((T||r).errors,S),isDirty:!!ue((T||r).dirtyFields,S),error:ue((T||r).errors,S),isValidating:!!ue(r.validatingFields,S),isTouched:!!ue((T||r).touchedFields,S)}),he=S=>{S&&jl(S).forEach(T=>Yt(r.errors,T)),f.state.next({errors:S?r.errors:{}})},ne=(S,T,O)=>{const Y=(ue(n,S,{_f:{}})._f||{}).ref,M=ue(r.errors,S)||{},{ref:H,message:X,type:ee,...me}=M;ft(r.errors,S,{...me,...T,ref:Y}),f.state.next({name:S,errors:r.errors,isValid:!1}),O&&O.shouldFocus&&Y&&Y.focus&&Y.focus()},se=(S,T)=>to(S)?f.values.subscribe({next:O=>S(F(void 0,T),O)}):F(S,T,!0),Oe=(S,T={})=>{for(const O of S?jl(S):a.mount)a.mount.delete(O),a.array.delete(O),T.keepValue||(Yt(n,O),Yt(o,O)),!T.keepError&&Yt(r.errors,O),!T.keepDirty&&Yt(r.dirtyFields,O),!T.keepTouched&&Yt(r.touchedFields,O),!T.keepIsValidating&&Yt(r.validatingFields,O),!t.shouldUnregister&&!T.keepDefaultValue&&Yt(s,O);f.values.next({values:{...o}}),f.state.next({...r,...T.keepDirty?{isDirty:N()}:{}}),!T.keepIsValid&&_()},pe=({disabled:S,name:T,field:O,fields:Y,value:M})=>{if(zn(S)&&i.mount||S){const H=S?void 0:Ft(M)?sp(O?O._f:ue(Y,T)._f):M;ft(o,T,H),E(T,H,!1,!1,!0)}},ye=(S,T={})=>{let O=ue(n,S);const Y=zn(T.disabled);return ft(n,S,{...O||{},_f:{...O&&O._f?O._f:{ref:{name:S}},name:S,mount:!0,...T}}),a.mount.add(S),O?pe({field:O,disabled:T.disabled,name:S,value:T.value}):j(S,!0,T.value),{...Y?{disabled:T.disabled}:{},...t.progressive?{required:!!T.required,min:tl(T.min),max:tl(T.max),minLength:tl(T.minLength),maxLength:tl(T.maxLength),pattern:tl(T.pattern)}:{},name:S,onChange:K,onBlur:K,ref:M=>{if(M){ye(S,T),O=ue(n,S);const H=Ft(M.value)&&M.querySelectorAll&&M.querySelectorAll("input,select,textarea")[0]||M,X=Az(H),ee=O._f.refs||[];if(X?ee.find(me=>me===H):H===O._f.ref)return;ft(n,S,{_f:{...O._f,...X?{refs:[...ee.filter(np),H,...Array.isArray(ue(s,S))?[{}]:[]],ref:{type:H.type,name:S}}:{ref:H}}}),j(S,!1,void 0,H)}else O=ue(n,S,{}),O._f&&(O._f.mount=!1),(t.shouldUnregister||T.shouldUnregister)&&!(Rj(a.array,S)&&i.action)&&a.unMount.add(S)}}},Ne=()=>t.shouldFocusError&&El(n,I,a.mount),Fe=S=>{zn(S)&&(f.state.next({disabled:S}),El(n,(T,O)=>{const Y=ue(n,O);Y&&(T.disabled=Y._f.disabled||S,Array.isArray(Y._f.refs)&&Y._f.refs.forEach(M=>{M.disabled=Y._f.disabled||S}))},0,!1))},Me=(S,T)=>async O=>{let Y;O&&(O.preventDefault&&O.preventDefault(),O.persist&&O.persist());let M=Cr(o);if(f.state.next({isSubmitting:!0}),t.resolver){const{errors:H,values:X}=await P();r.errors=H,M=X}else await L(n);if(Yt(r.errors,"root"),Or(r.errors)){f.state.next({errors:{}});try{await S(M,O)}catch(H){Y=H}}else T&&await T({...r.errors},O),Ne(),setTimeout(Ne);if(f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Or(r.errors)&&!Y,submitCount:r.submitCount+1,errors:r.errors}),Y)throw Y},Pe=(S,T={})=>{ue(n,S)&&(Ft(T.defaultValue)?B(S,Cr(ue(s,S))):(B(S,T.defaultValue),ft(s,S,Cr(T.defaultValue))),T.keepTouched||Yt(r.touchedFields,S),T.keepDirty||(Yt(r.dirtyFields,S),r.isDirty=T.defaultValue?N(S,Cr(ue(s,S))):N()),T.keepError||(Yt(r.errors,S),d.isValid&&_()),f.state.next({...r}))},nt=(S,T={})=>{const O=S?Cr(S):s,Y=Cr(O),M=Or(S),H=M?s:Y;if(T.keepDefaultValues||(s=O),!T.keepValues){if(T.keepDirtyValues)for(const X of a.mount)ue(r.dirtyFields,X)?ft(H,X,ue(o,X)):B(X,ue(H,X));else{if(py&&Ft(S))for(const X of a.mount){const ee=ue(n,X);if(ee&&ee._f){const me=Array.isArray(ee._f.refs)?ee._f.refs[0]:ee._f.ref;if(Id(me)){const Ye=me.closest("form");if(Ye){Ye.reset();break}}}}n={}}o=e.shouldUnregister?T.keepDefaultValues?Cr(s):{}:Cr(H),f.array.next({values:{...H}}),f.values.next({values:{...H}})}a={mount:T.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!d.isValid||!!T.keepIsValid||!!T.keepDirtyValues,i.watch=!!e.shouldUnregister,f.state.next({submitCount:T.keepSubmitCount?r.submitCount:0,isDirty:M?!1:T.keepDirty?r.isDirty:!!(T.keepDefaultValues&&!Ho(S,s)),isSubmitted:T.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:M?{}:T.keepDirtyValues?T.keepDefaultValues&&o?ju(s,o):r.dirtyFields:T.keepDefaultValues&&S?ju(s,S):T.keepDirty?r.dirtyFields:{},touchedFields:T.keepTouched?r.touchedFields:{},errors:T.keepErrors?r.errors:{},isSubmitSuccessful:T.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},k=(S,T)=>nt(to(S)?S(o):S,T);return{control:{register:ye,unregister:Oe,getFieldState:$,handleSubmit:Me,setError:ne,_executeSchema:P,_getWatch:F,_getDirty:N,_updateValid:_,_removeUnmounted:q,_updateFieldArray:h,_updateDisabledField:pe,_getFieldArray:b,_reset:nt,_resetDefaultValues:()=>to(t.defaultValues)&&t.defaultValues().then(S=>{k(S,t.resetOptions),f.state.next({isLoading:!1})}),_updateFormState:S=>{r={...r,...S}},_disableForm:Fe,_subjects:f,_proxyFormState:d,_setErrors:C,get _fields(){return n},get _formValues(){return o},get _state(){return i},set _state(S){i=S},get _defaultValues(){return s},get _names(){return a},set _names(S){a=S},get _formState(){return r},set _formState(S){r=S},get _options(){return t},set _options(S){t={...t,...S}}},trigger:Q,register:ye,handleSubmit:Me,watch:se,setValue:B,getValues:z,reset:k,resetField:Pe,clearErrors:he,unregister:Oe,setError:ne,setFocus:(S,T={})=>{const O=ue(n,S),Y=O&&O._f;if(Y){const M=Y.refs?Y.refs[0]:Y.ref;M.focus&&(M.focus(),T.shouldSelect&&M.select())}},getFieldState:$}}function _r(e={}){const t=Be.useRef(),r=Be.useRef(),[n,s]=Be.useState({isDirty:!1,isValidating:!1,isLoading:to(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:to(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...Fz(e),formState:n});const o=t.current.control;return o._options=e,gy({subject:o._subjects.state,next:i=>{Oj(i,o._proxyFormState,o._updateFormState,!0)&&s({...o._formState})}}),Be.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),Be.useEffect(()=>{if(o._proxyFormState.isDirty){const i=o._getDirty();i!==n.isDirty&&o._subjects.state.next({isDirty:i})}},[o,n.isDirty]),Be.useEffect(()=>{e.values&&!Ho(e.values,r.current)?(o._reset(e.values,o._options.resetOptions),r.current=e.values,s(i=>({...i}))):o._resetDefaultValues()},[e.values,o]),Be.useEffect(()=>{e.errors&&o._setErrors(e.errors)},[e.errors,o]),Be.useEffect(()=>{o._state.mount||(o._updateValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),Be.useEffect(()=>{e.shouldUnregister&&o._subjects.values.next({values:o._getWatch()})},[e.shouldUnregister,o]),t.current.formState=Dj(n,o),t.current}const Sw=(e,t,r)=>{if(e&&"reportValidity"in e){const n=ue(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},Wj=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?Sw(n.ref,r,e):n.refs&&n.refs.forEach(s=>Sw(s,r,e))}},zz=(e,t)=>{t.shouldUseNativeValidation&&Wj(e,t);const r={};for(const n in e){const s=ue(t.fields,n),o=Object.assign(e[n]||{},{ref:s&&s.ref});if(Uz(t.names||Object.keys(e),n)){const i=Object.assign({},ue(r,n));ft(i,"root",o),ft(r,n,i)}else ft(r,n,o)}return r},Uz=(e,t)=>e.some(r=>r.startsWith(t+"."));var $z=function(e,t){for(var r={};e.length;){var n=e[0],s=n.code,o=n.message,i=n.path.join(".");if(!r[i])if("unionErrors"in n){var a=n.unionErrors[0].errors[0];r[i]={message:a.message,type:a.code}}else r[i]={message:o,type:s};if("unionErrors"in n&&n.unionErrors.forEach(function(d){return d.errors.forEach(function(f){return e.push(f)})}),t){var c=r[i].types,u=c&&c[n.code];r[i]=Lj(i,t,r,s,u?[].concat(u,n.message):n.message)}e.shift()}return r},br=function(e,t,r){return r===void 0&&(r={}),function(n,s,o){try{return Promise.resolve(function(i,a){try{var c=Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](n,t)).then(function(u){return o.shouldUseNativeValidation&&Wj({},o),{errors:{},values:r.raw?n:u}})}catch(u){return a(u)}return c&&c.then?c.then(void 0,a):c}(0,function(i){if(function(a){return Array.isArray(a==null?void 0:a.errors)}(i))return{values:{},errors:zz($z(i.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw i}))}catch(i){return Promise.reject(i)}}},ot;(function(e){e.assertEqual=s=>s;function t(s){}e.assertIs=t;function r(s){throw new Error}e.assertNever=r,e.arrayToEnum=s=>{const o={};for(const i of s)o[i]=i;return o},e.getValidEnumValues=s=>{const o=e.objectKeys(s).filter(a=>typeof s[s[a]]!="number"),i={};for(const a of o)i[a]=s[a];return e.objectValues(i)},e.objectValues=s=>e.objectKeys(s).map(function(o){return s[o]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const o=[];for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&o.push(i);return o},e.find=(s,o)=>{for(const i of s)if(o(i))return i},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function n(s,o=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(o)}e.joinValues=n,e.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(ot||(ot={}));var Cm;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(Cm||(Cm={}));const we=ot.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Gs=e=>{switch(typeof e){case"undefined":return we.undefined;case"string":return we.string;case"number":return isNaN(e)?we.nan:we.number;case"boolean":return we.boolean;case"function":return we.function;case"bigint":return we.bigint;case"symbol":return we.symbol;case"object":return Array.isArray(e)?we.array:e===null?we.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?we.promise:typeof Map<"u"&&e instanceof Map?we.map:typeof Set<"u"&&e instanceof Set?we.set:typeof Date<"u"&&e instanceof Date?we.date:we.object;default:return we.unknown}},ae=ot.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Vz=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Br extends Error{constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const r=t||function(o){return o.message},n={_errors:[]},s=o=>{for(const i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)n._errors.push(r(i));else{let a=n,c=0;for(;cr.message){const r={},n=[];for(const s of this.issues)s.path.length>0?(r[s.path[0]]=r[s.path[0]]||[],r[s.path[0]].push(t(s))):n.push(t(s));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}Br.create=e=>new Br(e);const xa=(e,t)=>{let r;switch(e.code){case ae.invalid_type:e.received===we.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case ae.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,ot.jsonStringifyReplacer)}`;break;case ae.unrecognized_keys:r=`Unrecognized key(s) in object: ${ot.joinValues(e.keys,", ")}`;break;case ae.invalid_union:r="Invalid input";break;case ae.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${ot.joinValues(e.options)}`;break;case ae.invalid_enum_value:r=`Invalid enum value. Expected ${ot.joinValues(e.options)}, received '${e.received}'`;break;case ae.invalid_arguments:r="Invalid function arguments";break;case ae.invalid_return_type:r="Invalid function return type";break;case ae.invalid_date:r="Invalid date";break;case ae.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:ot.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case ae.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case ae.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case ae.custom:r="Invalid input";break;case ae.invalid_intersection_types:r="Intersection results could not be merged";break;case ae.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case ae.not_finite:r="Number must be finite";break;default:r=t.defaultError,ot.assertNever(e)}return{message:r}};let Hj=xa;function Bz(e){Hj=e}function Ud(){return Hj}const $d=e=>{const{data:t,path:r,errorMaps:n,issueData:s}=e,o=[...r,...s.path||[]],i={...s,path:o};if(s.message!==void 0)return{...s,path:o,message:s.message};let a="";const c=n.filter(u=>!!u).slice().reverse();for(const u of c)a=u(i,{data:t,defaultError:a}).message;return{...s,path:o,message:a}},Wz=[];function ge(e,t){const r=Ud(),n=$d({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===xa?void 0:xa].filter(s=>!!s)});e.common.issues.push(n)}class dr{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){const n=[];for(const s of r){if(s.status==="aborted")return We;s.status==="dirty"&&t.dirty(),n.push(s.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){const n=[];for(const s of r){const o=await s.key,i=await s.value;n.push({key:o,value:i})}return dr.mergeObjectSync(t,n)}static mergeObjectSync(t,r){const n={};for(const s of r){const{key:o,value:i}=s;if(o.status==="aborted"||i.status==="aborted")return We;o.status==="dirty"&&t.dirty(),i.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof i.value<"u"||s.alwaysSet)&&(n[o.value]=i.value)}return{status:t.value,value:n}}}const We=Object.freeze({status:"aborted"}),Hi=e=>({status:"dirty",value:e}),vr=e=>({status:"valid",value:e}),jm=e=>e.status==="aborted",Em=e=>e.status==="dirty",nc=e=>e.status==="valid",sc=e=>typeof Promise<"u"&&e instanceof Promise;function Vd(e,t,r,n){if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function Yj(e,t,r,n,s){if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,r),r}var De;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(De||(De={}));var ll,cl;class Kn{constructor(t,r,n,s){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const kw=(e,t)=>{if(nc(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new Br(e.common.issues);return this._error=r,this._error}}};function Ge(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:s}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:(i,a)=>{var c,u;const{message:d}=e;return i.code==="invalid_enum_value"?{message:d??a.defaultError}:typeof a.data>"u"?{message:(c=d??n)!==null&&c!==void 0?c:a.defaultError}:i.code!=="invalid_type"?{message:a.defaultError}:{message:(u=d??r)!==null&&u!==void 0?u:a.defaultError}},description:s}}class Je{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return Gs(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Gs(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new dr,ctx:{common:t.parent.common,data:t.data,parsedType:Gs(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(sc(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){const r=this._parse(t);return Promise.resolve(r)}parse(t,r){const n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){var n;const s={common:{issues:[],async:(n=r==null?void 0:r.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Gs(t)},o=this._parseSync({data:t,path:s.path,parent:s});return kw(s,o)}async parseAsync(t,r){const n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){const n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Gs(t)},s=this._parse({data:t,path:n.path,parent:n}),o=await(sc(s)?s:Promise.resolve(s));return kw(n,o)}refine(t,r){const n=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,o)=>{const i=t(s),a=()=>o.addIssue({code:ae.custom,...n(s)});return typeof Promise<"u"&&i instanceof Promise?i.then(c=>c?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(t,r){return this._refinement((n,s)=>t(n)?!0:(s.addIssue(typeof r=="function"?r(n,s):r),!1))}_refinement(t){return new En({schema:this,typeName:$e.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Wn.create(this,this._def)}nullable(){return _o.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return _n.create(this,this._def)}promise(){return _a.create(this,this._def)}or(t){return lc.create([this,t],this._def)}and(t){return cc.create(this,t,this._def)}transform(t){return new En({...Ge(this._def),schema:this,typeName:$e.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r=typeof t=="function"?t:()=>t;return new pc({...Ge(this._def),innerType:this,defaultValue:r,typeName:$e.ZodDefault})}brand(){return new xy({typeName:$e.ZodBranded,type:this,...Ge(this._def)})}catch(t){const r=typeof t=="function"?t:()=>t;return new mc({...Ge(this._def),innerType:this,catchValue:r,typeName:$e.ZodCatch})}describe(t){const r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Uc.create(this,t)}readonly(){return gc.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Hz=/^c[^\s-]{8,}$/i,Yz=/^[0-9a-z]+$/,Kz=/^[0-9A-HJKMNP-TV-Z]{26}$/,Gz=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Zz=/^[a-z0-9_-]{21}$/i,qz=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Xz=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Qz="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let op;const Jz=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,e8=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,t8=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Kj="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",r8=new RegExp(`^${Kj}$`);function Gj(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function n8(e){return new RegExp(`^${Gj(e)}$`)}function Zj(e){let t=`${Kj}T${Gj(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function s8(e,t){return!!((t==="v4"||!t)&&Jz.test(e)||(t==="v6"||!t)&&e8.test(e))}class yn extends Je{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==we.string){const o=this._getOrReturnCtx(t);return ge(o,{code:ae.invalid_type,expected:we.string,received:o.parsedType}),We}const n=new dr;let s;for(const o of this._def.checks)if(o.kind==="min")t.data.lengtho.value&&(s=this._getOrReturnCtx(t,s),ge(s,{code:ae.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){const i=t.data.length>o.value,a=t.data.lengtht.test(s),{validation:r,code:ae.invalid_string,...De.errToObj(n)})}_addCheck(t){return new yn({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...De.errToObj(t)})}url(t){return this._addCheck({kind:"url",...De.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...De.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...De.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...De.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...De.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...De.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...De.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...De.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...De.errToObj(t)})}datetime(t){var r,n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(r=t==null?void 0:t.offset)!==null&&r!==void 0?r:!1,local:(n=t==null?void 0:t.local)!==null&&n!==void 0?n:!1,...De.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...De.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...De.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...De.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...De.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...De.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...De.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...De.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...De.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...De.errToObj(r)})}nonempty(t){return this.min(1,De.errToObj(t))}trim(){return new yn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new yn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new yn({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value{var t;return new yn({checks:[],typeName:$e.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Ge(e)})};function o8(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,s=r>n?r:n,o=parseInt(e.toFixed(s).replace(".","")),i=parseInt(t.toFixed(s).replace(".",""));return o%i/Math.pow(10,s)}class yo extends Je{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==we.number){const o=this._getOrReturnCtx(t);return ge(o,{code:ae.invalid_type,expected:we.number,received:o.parsedType}),We}let n;const s=new dr;for(const o of this._def.checks)o.kind==="int"?ot.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),ge(n,{code:ae.invalid_type,expected:"integer",received:"float",message:o.message}),s.dirty()):o.kind==="min"?(o.inclusive?t.datao.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),ge(n,{code:ae.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="multipleOf"?o8(t.data,o.value)!==0&&(n=this._getOrReturnCtx(t,n),ge(n,{code:ae.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),ge(n,{code:ae.not_finite,message:o.message}),s.dirty()):ot.assertNever(o);return{status:s.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,De.toString(r))}gt(t,r){return this.setLimit("min",t,!1,De.toString(r))}lte(t,r){return this.setLimit("max",t,!0,De.toString(r))}lt(t,r){return this.setLimit("max",t,!1,De.toString(r))}setLimit(t,r,n,s){return new yo({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:De.toString(s)}]})}_addCheck(t){return new yo({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:De.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:De.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:De.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:De.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:De.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:De.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:De.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:De.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:De.toString(t)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuet.kind==="int"||t.kind==="multipleOf"&&ot.isInteger(t.value))}get isFinite(){let t=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.valuenew yo({checks:[],typeName:$e.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Ge(e)});class xo extends Je{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==we.bigint){const o=this._getOrReturnCtx(t);return ge(o,{code:ae.invalid_type,expected:we.bigint,received:o.parsedType}),We}let n;const s=new dr;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.datao.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),ge(n,{code:ae.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),ge(n,{code:ae.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):ot.assertNever(o);return{status:s.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,De.toString(r))}gt(t,r){return this.setLimit("min",t,!1,De.toString(r))}lte(t,r){return this.setLimit("max",t,!0,De.toString(r))}lt(t,r){return this.setLimit("max",t,!1,De.toString(r))}setLimit(t,r,n,s){return new xo({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:De.toString(s)}]})}_addCheck(t){return new xo({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:De.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:De.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:De.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:De.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:De.toString(r)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value{var t;return new xo({checks:[],typeName:$e.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Ge(e)})};class oc extends Je{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==we.boolean){const n=this._getOrReturnCtx(t);return ge(n,{code:ae.invalid_type,expected:we.boolean,received:n.parsedType}),We}return vr(t.data)}}oc.create=e=>new oc({typeName:$e.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Ge(e)});class ii extends Je{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==we.date){const o=this._getOrReturnCtx(t);return ge(o,{code:ae.invalid_type,expected:we.date,received:o.parsedType}),We}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return ge(o,{code:ae.invalid_date}),We}const n=new dr;let s;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()o.value&&(s=this._getOrReturnCtx(t,s),ge(s,{code:ae.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):ot.assertNever(o);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new ii({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:De.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:De.toString(r)})}get minDate(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuenew ii({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:$e.ZodDate,...Ge(e)});class Bd extends Je{_parse(t){if(this._getType(t)!==we.symbol){const n=this._getOrReturnCtx(t);return ge(n,{code:ae.invalid_type,expected:we.symbol,received:n.parsedType}),We}return vr(t.data)}}Bd.create=e=>new Bd({typeName:$e.ZodSymbol,...Ge(e)});class ic extends Je{_parse(t){if(this._getType(t)!==we.undefined){const n=this._getOrReturnCtx(t);return ge(n,{code:ae.invalid_type,expected:we.undefined,received:n.parsedType}),We}return vr(t.data)}}ic.create=e=>new ic({typeName:$e.ZodUndefined,...Ge(e)});class ac extends Je{_parse(t){if(this._getType(t)!==we.null){const n=this._getOrReturnCtx(t);return ge(n,{code:ae.invalid_type,expected:we.null,received:n.parsedType}),We}return vr(t.data)}}ac.create=e=>new ac({typeName:$e.ZodNull,...Ge(e)});class wa extends Je{constructor(){super(...arguments),this._any=!0}_parse(t){return vr(t.data)}}wa.create=e=>new wa({typeName:$e.ZodAny,...Ge(e)});class qo extends Je{constructor(){super(...arguments),this._unknown=!0}_parse(t){return vr(t.data)}}qo.create=e=>new qo({typeName:$e.ZodUnknown,...Ge(e)});class js extends Je{_parse(t){const r=this._getOrReturnCtx(t);return ge(r,{code:ae.invalid_type,expected:we.never,received:r.parsedType}),We}}js.create=e=>new js({typeName:$e.ZodNever,...Ge(e)});class Wd extends Je{_parse(t){if(this._getType(t)!==we.undefined){const n=this._getOrReturnCtx(t);return ge(n,{code:ae.invalid_type,expected:we.void,received:n.parsedType}),We}return vr(t.data)}}Wd.create=e=>new Wd({typeName:$e.ZodVoid,...Ge(e)});class _n extends Je{_parse(t){const{ctx:r,status:n}=this._processInputParams(t),s=this._def;if(r.parsedType!==we.array)return ge(r,{code:ae.invalid_type,expected:we.array,received:r.parsedType}),We;if(s.exactLength!==null){const i=r.data.length>s.exactLength.value,a=r.data.lengths.maxLength.value&&(ge(r,{code:ae.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((i,a)=>s.type._parseAsync(new Kn(r,i,r.path,a)))).then(i=>dr.mergeArray(n,i));const o=[...r.data].map((i,a)=>s.type._parseSync(new Kn(r,i,r.path,a)));return dr.mergeArray(n,o)}get element(){return this._def.type}min(t,r){return new _n({...this._def,minLength:{value:t,message:De.toString(r)}})}max(t,r){return new _n({...this._def,maxLength:{value:t,message:De.toString(r)}})}length(t,r){return new _n({...this._def,exactLength:{value:t,message:De.toString(r)}})}nonempty(t){return this.min(1,t)}}_n.create=(e,t)=>new _n({type:e,minLength:null,maxLength:null,exactLength:null,typeName:$e.ZodArray,...Ge(t)});function Ti(e){if(e instanceof Rt){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=Wn.create(Ti(n))}return new Rt({...e._def,shape:()=>t})}else return e instanceof _n?new _n({...e._def,type:Ti(e.element)}):e instanceof Wn?Wn.create(Ti(e.unwrap())):e instanceof _o?_o.create(Ti(e.unwrap())):e instanceof Gn?Gn.create(e.items.map(t=>Ti(t))):e}class Rt extends Je{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),r=ot.objectKeys(t);return this._cached={shape:t,keys:r}}_parse(t){if(this._getType(t)!==we.object){const u=this._getOrReturnCtx(t);return ge(u,{code:ae.invalid_type,expected:we.object,received:u.parsedType}),We}const{status:n,ctx:s}=this._processInputParams(t),{shape:o,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof js&&this._def.unknownKeys==="strip"))for(const u in s.data)i.includes(u)||a.push(u);const c=[];for(const u of i){const d=o[u],f=s.data[u];c.push({key:{status:"valid",value:u},value:d._parse(new Kn(s,f,s.path,u)),alwaysSet:u in s.data})}if(this._def.catchall instanceof js){const u=this._def.unknownKeys;if(u==="passthrough")for(const d of a)c.push({key:{status:"valid",value:d},value:{status:"valid",value:s.data[d]}});else if(u==="strict")a.length>0&&(ge(s,{code:ae.unrecognized_keys,keys:a}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const d of a){const f=s.data[d];c.push({key:{status:"valid",value:d},value:u._parse(new Kn(s,f,s.path,d)),alwaysSet:d in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const u=[];for(const d of c){const f=await d.key,m=await d.value;u.push({key:f,value:m,alwaysSet:d.alwaysSet})}return u}).then(u=>dr.mergeObjectSync(n,u)):dr.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(t){return De.errToObj,new Rt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var s,o,i,a;const c=(i=(o=(s=this._def).errorMap)===null||o===void 0?void 0:o.call(s,r,n).message)!==null&&i!==void 0?i:n.defaultError;return r.code==="unrecognized_keys"?{message:(a=De.errToObj(t).message)!==null&&a!==void 0?a:c}:{message:c}}}:{}})}strip(){return new Rt({...this._def,unknownKeys:"strip"})}passthrough(){return new Rt({...this._def,unknownKeys:"passthrough"})}extend(t){return new Rt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Rt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:$e.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new Rt({...this._def,catchall:t})}pick(t){const r={};return ot.objectKeys(t).forEach(n=>{t[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new Rt({...this._def,shape:()=>r})}omit(t){const r={};return ot.objectKeys(this.shape).forEach(n=>{t[n]||(r[n]=this.shape[n])}),new Rt({...this._def,shape:()=>r})}deepPartial(){return Ti(this)}partial(t){const r={};return ot.objectKeys(this.shape).forEach(n=>{const s=this.shape[n];t&&!t[n]?r[n]=s:r[n]=s.optional()}),new Rt({...this._def,shape:()=>r})}required(t){const r={};return ot.objectKeys(this.shape).forEach(n=>{if(t&&!t[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof Wn;)o=o._def.innerType;r[n]=o}}),new Rt({...this._def,shape:()=>r})}keyof(){return qj(ot.objectKeys(this.shape))}}Rt.create=(e,t)=>new Rt({shape:()=>e,unknownKeys:"strip",catchall:js.create(),typeName:$e.ZodObject,...Ge(t)});Rt.strictCreate=(e,t)=>new Rt({shape:()=>e,unknownKeys:"strict",catchall:js.create(),typeName:$e.ZodObject,...Ge(t)});Rt.lazycreate=(e,t)=>new Rt({shape:e,unknownKeys:"strip",catchall:js.create(),typeName:$e.ZodObject,...Ge(t)});class lc extends Je{_parse(t){const{ctx:r}=this._processInputParams(t),n=this._def.options;function s(o){for(const a of o)if(a.result.status==="valid")return a.result;for(const a of o)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;const i=o.map(a=>new Br(a.ctx.common.issues));return ge(r,{code:ae.invalid_union,unionErrors:i}),We}if(r.common.async)return Promise.all(n.map(async o=>{const i={...r,common:{...r.common,issues:[]},parent:null};return{result:await o._parseAsync({data:r.data,path:r.path,parent:i}),ctx:i}})).then(s);{let o;const i=[];for(const c of n){const u={...r,common:{...r.common,issues:[]},parent:null},d=c._parseSync({data:r.data,path:r.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!o&&(o={result:d,ctx:u}),u.common.issues.length&&i.push(u.common.issues)}if(o)return r.common.issues.push(...o.ctx.common.issues),o.result;const a=i.map(c=>new Br(c));return ge(r,{code:ae.invalid_union,unionErrors:a}),We}}get options(){return this._def.options}}lc.create=(e,t)=>new lc({options:e,typeName:$e.ZodUnion,...Ge(t)});const os=e=>e instanceof dc?os(e.schema):e instanceof En?os(e.innerType()):e instanceof fc?[e.value]:e instanceof wo?e.options:e instanceof hc?ot.objectValues(e.enum):e instanceof pc?os(e._def.innerType):e instanceof ic?[void 0]:e instanceof ac?[null]:e instanceof Wn?[void 0,...os(e.unwrap())]:e instanceof _o?[null,...os(e.unwrap())]:e instanceof xy||e instanceof gc?os(e.unwrap()):e instanceof mc?os(e._def.innerType):[];class qf extends Je{_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==we.object)return ge(r,{code:ae.invalid_type,expected:we.object,received:r.parsedType}),We;const n=this.discriminator,s=r.data[n],o=this.optionsMap.get(s);return o?r.common.async?o._parseAsync({data:r.data,path:r.path,parent:r}):o._parseSync({data:r.data,path:r.path,parent:r}):(ge(r,{code:ae.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),We)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){const s=new Map;for(const o of r){const i=os(o.shape[t]);if(!i.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of i){if(s.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);s.set(a,o)}}return new qf({typeName:$e.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:s,...Ge(n)})}}function Nm(e,t){const r=Gs(e),n=Gs(t);if(e===t)return{valid:!0,data:e};if(r===we.object&&n===we.object){const s=ot.objectKeys(t),o=ot.objectKeys(e).filter(a=>s.indexOf(a)!==-1),i={...e,...t};for(const a of o){const c=Nm(e[a],t[a]);if(!c.valid)return{valid:!1};i[a]=c.data}return{valid:!0,data:i}}else if(r===we.array&&n===we.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let o=0;o{if(jm(o)||jm(i))return We;const a=Nm(o.value,i.value);return a.valid?((Em(o)||Em(i))&&r.dirty(),{status:r.value,value:a.data}):(ge(n,{code:ae.invalid_intersection_types}),We)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([o,i])=>s(o,i)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}cc.create=(e,t,r)=>new cc({left:e,right:t,typeName:$e.ZodIntersection,...Ge(r)});class Gn extends Je{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==we.array)return ge(n,{code:ae.invalid_type,expected:we.array,received:n.parsedType}),We;if(n.data.lengththis._def.items.length&&(ge(n,{code:ae.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const o=[...n.data].map((i,a)=>{const c=this._def.items[a]||this._def.rest;return c?c._parse(new Kn(n,i,n.path,a)):null}).filter(i=>!!i);return n.common.async?Promise.all(o).then(i=>dr.mergeArray(r,i)):dr.mergeArray(r,o)}get items(){return this._def.items}rest(t){return new Gn({...this._def,rest:t})}}Gn.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Gn({items:e,typeName:$e.ZodTuple,rest:null,...Ge(t)})};class uc extends Je{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==we.object)return ge(n,{code:ae.invalid_type,expected:we.object,received:n.parsedType}),We;const s=[],o=this._def.keyType,i=this._def.valueType;for(const a in n.data)s.push({key:o._parse(new Kn(n,a,n.path,a)),value:i._parse(new Kn(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?dr.mergeObjectAsync(r,s):dr.mergeObjectSync(r,s)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof Je?new uc({keyType:t,valueType:r,typeName:$e.ZodRecord,...Ge(n)}):new uc({keyType:yn.create(),valueType:t,typeName:$e.ZodRecord,...Ge(r)})}}class Hd extends Je{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==we.map)return ge(n,{code:ae.invalid_type,expected:we.map,received:n.parsedType}),We;const s=this._def.keyType,o=this._def.valueType,i=[...n.data.entries()].map(([a,c],u)=>({key:s._parse(new Kn(n,a,n.path,[u,"key"])),value:o._parse(new Kn(n,c,n.path,[u,"value"]))}));if(n.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const c of i){const u=await c.key,d=await c.value;if(u.status==="aborted"||d.status==="aborted")return We;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),a.set(u.value,d.value)}return{status:r.value,value:a}})}else{const a=new Map;for(const c of i){const u=c.key,d=c.value;if(u.status==="aborted"||d.status==="aborted")return We;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),a.set(u.value,d.value)}return{status:r.value,value:a}}}}Hd.create=(e,t,r)=>new Hd({valueType:t,keyType:e,typeName:$e.ZodMap,...Ge(r)});class ai extends Je{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==we.set)return ge(n,{code:ae.invalid_type,expected:we.set,received:n.parsedType}),We;const s=this._def;s.minSize!==null&&n.data.sizes.maxSize.value&&(ge(n,{code:ae.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());const o=this._def.valueType;function i(c){const u=new Set;for(const d of c){if(d.status==="aborted")return We;d.status==="dirty"&&r.dirty(),u.add(d.value)}return{status:r.value,value:u}}const a=[...n.data.values()].map((c,u)=>o._parse(new Kn(n,c,n.path,u)));return n.common.async?Promise.all(a).then(c=>i(c)):i(a)}min(t,r){return new ai({...this._def,minSize:{value:t,message:De.toString(r)}})}max(t,r){return new ai({...this._def,maxSize:{value:t,message:De.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}}ai.create=(e,t)=>new ai({valueType:e,minSize:null,maxSize:null,typeName:$e.ZodSet,...Ge(t)});class la extends Je{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==we.function)return ge(r,{code:ae.invalid_type,expected:we.function,received:r.parsedType}),We;function n(a,c){return $d({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Ud(),xa].filter(u=>!!u),issueData:{code:ae.invalid_arguments,argumentsError:c}})}function s(a,c){return $d({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Ud(),xa].filter(u=>!!u),issueData:{code:ae.invalid_return_type,returnTypeError:c}})}const o={errorMap:r.common.contextualErrorMap},i=r.data;if(this._def.returns instanceof _a){const a=this;return vr(async function(...c){const u=new Br([]),d=await a._def.args.parseAsync(c,o).catch(v=>{throw u.addIssue(n(c,v)),u}),f=await Reflect.apply(i,this,d);return await a._def.returns._def.type.parseAsync(f,o).catch(v=>{throw u.addIssue(s(f,v)),u})})}else{const a=this;return vr(function(...c){const u=a._def.args.safeParse(c,o);if(!u.success)throw new Br([n(c,u.error)]);const d=Reflect.apply(i,this,u.data),f=a._def.returns.safeParse(d,o);if(!f.success)throw new Br([s(d,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new la({...this._def,args:Gn.create(t).rest(qo.create())})}returns(t){return new la({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new la({args:t||Gn.create([]).rest(qo.create()),returns:r||qo.create(),typeName:$e.ZodFunction,...Ge(n)})}}class dc extends Je{get schema(){return this._def.getter()}_parse(t){const{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}dc.create=(e,t)=>new dc({getter:e,typeName:$e.ZodLazy,...Ge(t)});class fc extends Je{_parse(t){if(t.data!==this._def.value){const r=this._getOrReturnCtx(t);return ge(r,{received:r.data,code:ae.invalid_literal,expected:this._def.value}),We}return{status:"valid",value:t.data}}get value(){return this._def.value}}fc.create=(e,t)=>new fc({value:e,typeName:$e.ZodLiteral,...Ge(t)});function qj(e,t){return new wo({values:e,typeName:$e.ZodEnum,...Ge(t)})}class wo extends Je{constructor(){super(...arguments),ll.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),n=this._def.values;return ge(r,{expected:ot.joinValues(n),received:r.parsedType,code:ae.invalid_type}),We}if(Vd(this,ll)||Yj(this,ll,new Set(this._def.values)),!Vd(this,ll).has(t.data)){const r=this._getOrReturnCtx(t),n=this._def.values;return ge(r,{received:r.data,code:ae.invalid_enum_value,options:n}),We}return vr(t.data)}get options(){return this._def.values}get enum(){const t={};for(const r of this._def.values)t[r]=r;return t}get Values(){const t={};for(const r of this._def.values)t[r]=r;return t}get Enum(){const t={};for(const r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return wo.create(t,{...this._def,...r})}exclude(t,r=this._def){return wo.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}}ll=new WeakMap;wo.create=qj;class hc extends Je{constructor(){super(...arguments),cl.set(this,void 0)}_parse(t){const r=ot.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==we.string&&n.parsedType!==we.number){const s=ot.objectValues(r);return ge(n,{expected:ot.joinValues(s),received:n.parsedType,code:ae.invalid_type}),We}if(Vd(this,cl)||Yj(this,cl,new Set(ot.getValidEnumValues(this._def.values))),!Vd(this,cl).has(t.data)){const s=ot.objectValues(r);return ge(n,{received:n.data,code:ae.invalid_enum_value,options:s}),We}return vr(t.data)}get enum(){return this._def.values}}cl=new WeakMap;hc.create=(e,t)=>new hc({values:e,typeName:$e.ZodNativeEnum,...Ge(t)});class _a extends Je{unwrap(){return this._def.type}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==we.promise&&r.common.async===!1)return ge(r,{code:ae.invalid_type,expected:we.promise,received:r.parsedType}),We;const n=r.parsedType===we.promise?r.data:Promise.resolve(r.data);return vr(n.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}}_a.create=(e,t)=>new _a({type:e,typeName:$e.ZodPromise,...Ge(t)});class En extends Je{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===$e.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:r,ctx:n}=this._processInputParams(t),s=this._def.effect||null,o={addIssue:i=>{ge(n,i),i.fatal?r.abort():r.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),s.type==="preprocess"){const i=s.transform(n.data,o);if(n.common.async)return Promise.resolve(i).then(async a=>{if(r.value==="aborted")return We;const c=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return c.status==="aborted"?We:c.status==="dirty"||r.value==="dirty"?Hi(c.value):c});{if(r.value==="aborted")return We;const a=this._def.schema._parseSync({data:i,path:n.path,parent:n});return a.status==="aborted"?We:a.status==="dirty"||r.value==="dirty"?Hi(a.value):a}}if(s.type==="refinement"){const i=a=>{const c=s.refinement(a,o);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){const a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?We:(a.status==="dirty"&&r.dirty(),i(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?We:(a.status==="dirty"&&r.dirty(),i(a.value).then(()=>({status:r.value,value:a.value}))))}if(s.type==="transform")if(n.common.async===!1){const i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!nc(i))return i;const a=s.transform(i.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>nc(i)?Promise.resolve(s.transform(i.value,o)).then(a=>({status:r.value,value:a})):i);ot.assertNever(s)}}En.create=(e,t,r)=>new En({schema:e,typeName:$e.ZodEffects,effect:t,...Ge(r)});En.createWithPreprocess=(e,t,r)=>new En({schema:t,effect:{type:"preprocess",transform:e},typeName:$e.ZodEffects,...Ge(r)});class Wn extends Je{_parse(t){return this._getType(t)===we.undefined?vr(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Wn.create=(e,t)=>new Wn({innerType:e,typeName:$e.ZodOptional,...Ge(t)});class _o extends Je{_parse(t){return this._getType(t)===we.null?vr(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}_o.create=(e,t)=>new _o({innerType:e,typeName:$e.ZodNullable,...Ge(t)});class pc extends Je{_parse(t){const{ctx:r}=this._processInputParams(t);let n=r.data;return r.parsedType===we.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}pc.create=(e,t)=>new pc({innerType:e,typeName:$e.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Ge(t)});class mc extends Je{_parse(t){const{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return sc(s)?s.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Br(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Br(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}mc.create=(e,t)=>new mc({innerType:e,typeName:$e.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Ge(t)});class Yd extends Je{_parse(t){if(this._getType(t)!==we.nan){const n=this._getOrReturnCtx(t);return ge(n,{code:ae.invalid_type,expected:we.nan,received:n.parsedType}),We}return{status:"valid",value:t.data}}}Yd.create=e=>new Yd({typeName:$e.ZodNaN,...Ge(e)});const i8=Symbol("zod_brand");class xy extends Je{_parse(t){const{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class Uc extends Je{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?We:o.status==="dirty"?(r.dirty(),Hi(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{const s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?We:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(t,r){return new Uc({in:t,out:r,typeName:$e.ZodPipeline})}}class gc extends Je{_parse(t){const r=this._def.innerType._parse(t),n=s=>(nc(s)&&(s.value=Object.freeze(s.value)),s);return sc(r)?r.then(s=>n(s)):n(r)}unwrap(){return this._def.innerType}}gc.create=(e,t)=>new gc({innerType:e,typeName:$e.ZodReadonly,...Ge(t)});function Xj(e,t={},r){return e?wa.create().superRefine((n,s)=>{var o,i;if(!e(n)){const a=typeof t=="function"?t(n):typeof t=="string"?{message:t}:t,c=(i=(o=a.fatal)!==null&&o!==void 0?o:r)!==null&&i!==void 0?i:!0,u=typeof a=="string"?{message:a}:a;s.addIssue({code:"custom",...u,fatal:c})}}):wa.create()}const a8={object:Rt.lazycreate};var $e;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})($e||($e={}));const l8=(e,t={message:`Input not instance of ${e.name}`})=>Xj(r=>r instanceof e,t),Qj=yn.create,Jj=yo.create,c8=Yd.create,u8=xo.create,eE=oc.create,d8=ii.create,f8=Bd.create,h8=ic.create,p8=ac.create,m8=wa.create,g8=qo.create,v8=js.create,y8=Wd.create,x8=_n.create,w8=Rt.create,_8=Rt.strictCreate,b8=lc.create,S8=qf.create,k8=cc.create,C8=Gn.create,j8=uc.create,E8=Hd.create,N8=ai.create,T8=la.create,R8=dc.create,P8=fc.create,A8=wo.create,D8=hc.create,O8=_a.create,Cw=En.create,M8=Wn.create,I8=_o.create,L8=En.createWithPreprocess,F8=Uc.create,z8=()=>Qj().optional(),U8=()=>Jj().optional(),$8=()=>eE().optional(),V8={string:e=>yn.create({...e,coerce:!0}),number:e=>yo.create({...e,coerce:!0}),boolean:e=>oc.create({...e,coerce:!0}),bigint:e=>xo.create({...e,coerce:!0}),date:e=>ii.create({...e,coerce:!0})},B8=We;var de=Object.freeze({__proto__:null,defaultErrorMap:xa,setErrorMap:Bz,getErrorMap:Ud,makeIssue:$d,EMPTY_PATH:Wz,addIssueToContext:ge,ParseStatus:dr,INVALID:We,DIRTY:Hi,OK:vr,isAborted:jm,isDirty:Em,isValid:nc,isAsync:sc,get util(){return ot},get objectUtil(){return Cm},ZodParsedType:we,getParsedType:Gs,ZodType:Je,datetimeRegex:Zj,ZodString:yn,ZodNumber:yo,ZodBigInt:xo,ZodBoolean:oc,ZodDate:ii,ZodSymbol:Bd,ZodUndefined:ic,ZodNull:ac,ZodAny:wa,ZodUnknown:qo,ZodNever:js,ZodVoid:Wd,ZodArray:_n,ZodObject:Rt,ZodUnion:lc,ZodDiscriminatedUnion:qf,ZodIntersection:cc,ZodTuple:Gn,ZodRecord:uc,ZodMap:Hd,ZodSet:ai,ZodFunction:la,ZodLazy:dc,ZodLiteral:fc,ZodEnum:wo,ZodNativeEnum:hc,ZodPromise:_a,ZodEffects:En,ZodTransformer:En,ZodOptional:Wn,ZodNullable:_o,ZodDefault:pc,ZodCatch:mc,ZodNaN:Yd,BRAND:i8,ZodBranded:xy,ZodPipeline:Uc,ZodReadonly:gc,custom:Xj,Schema:Je,ZodSchema:Je,late:a8,get ZodFirstPartyTypeKind(){return $e},coerce:V8,any:m8,array:x8,bigint:u8,boolean:eE,date:d8,discriminatedUnion:S8,effect:Cw,enum:A8,function:T8,instanceof:l8,intersection:k8,lazy:R8,literal:P8,map:E8,nan:c8,nativeEnum:D8,never:v8,null:p8,nullable:I8,number:Jj,object:w8,oboolean:$8,onumber:U8,optional:M8,ostring:z8,pipeline:F8,preprocess:L8,promise:O8,record:j8,set:N8,strictObject:_8,string:Qj,symbol:f8,transformer:Cw,tuple:C8,undefined:h8,union:b8,unknown:g8,void:y8,NEVER:B8,ZodIssueCode:ae,quotelessJson:Vz,ZodError:Br}),W8="Label",tE=g.forwardRef((e,t)=>l.jsx(Re.label,{...e,ref:t,onMouseDown:r=>{var s;r.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));tE.displayName=W8;var rE=tE;const H8=Sc("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),bo=g.forwardRef(({className:e,...t},r)=>l.jsx(rE,{ref:r,className:oe(H8(),e),...t}));bo.displayName=rE.displayName;const Sr=kz,nE=g.createContext({}),Ee=({...e})=>l.jsx(nE.Provider,{value:{name:e.name},children:l.jsx(Nz,{...e})}),Xf=()=>{const e=g.useContext(nE),t=g.useContext(sE),{getFieldState:r,formState:n}=Zf(),s=r(e.name,n);if(!e)throw new Error("useFormField should be used within ");const{id:o}=t;return{id:o,name:e.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...s}},sE=g.createContext({}),ke=g.forwardRef(({className:e,...t},r)=>{const n=g.useId();return l.jsx(sE.Provider,{value:{id:n},children:l.jsx("div",{ref:r,className:oe("space-y-2",e),...t})})});ke.displayName="FormItem";const Ce=g.forwardRef(({className:e,...t},r)=>{const{error:n,formItemId:s}=Xf();return l.jsx(bo,{ref:r,className:oe(n&&"text-destructive",e),htmlFor:s,...t})});Ce.displayName="FormLabel";const je=g.forwardRef(({...e},t)=>{const{error:r,formItemId:n,formDescriptionId:s,formMessageId:o}=Xf();return l.jsx(bs,{ref:t,id:n,"aria-describedby":r?`${s} ${o}`:`${s}`,"aria-invalid":!!r,...e})});je.displayName="FormControl";const Y8=g.forwardRef(({className:e,...t},r)=>{const{formDescriptionId:n}=Xf();return l.jsx("p",{ref:r,id:n,className:oe("text-sm text-muted-foreground",e),...t})});Y8.displayName="FormDescription";const _e=g.forwardRef(({className:e,children:t,...r},n)=>{const{error:s,formMessageId:o}=Xf(),i=s?String(s==null?void 0:s.message):t;return i?l.jsx("p",{ref:n,id:o,className:oe("text-sm font-medium text-destructive",e),...r,children:i}):null});_e.displayName="FormMessage";function Tm(e,[t,r]){return Math.min(r,Math.max(t,e))}var K8=[" ","Enter","ArrowUp","ArrowDown"],G8=[" ","Enter"],$c="Select",[Qf,Jf,Z8]=kc($c),[Fa,nV]=sr($c,[Z8,Aa]),eh=Aa(),[q8,No]=Fa($c),[X8,Q8]=Fa($c),oE=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:s,onOpenChange:o,value:i,defaultValue:a,onValueChange:c,dir:u,name:d,autoComplete:f,disabled:m,required:v}=e,x=eh(t),[y,_]=g.useState(null),[p,h]=g.useState(null),[w,C]=g.useState(!1),j=di(u),[E=!1,R]=Hr({prop:n,defaultProp:s,onChange:o}),[P,A]=Hr({prop:i,defaultProp:a,onChange:c}),L=g.useRef(null),q=y?!!y.closest("form"):!0,[N,F]=g.useState(new Set),b=Array.from(N).map(V=>V.props.value).join(";");return l.jsx(Jg,{...x,children:l.jsxs(q8,{required:v,scope:t,trigger:y,onTriggerChange:_,valueNode:p,onValueNodeChange:h,valueNodeHasChildren:w,onValueNodeHasChildrenChange:C,contentId:Ur(),value:P,onValueChange:A,open:E,onOpenChange:R,dir:j,triggerPointerDownPosRef:L,disabled:m,children:[l.jsx(Qf.Provider,{scope:t,children:l.jsx(X8,{scope:e.__scopeSelect,onNativeOptionAdd:g.useCallback(V=>{F(te=>new Set(te).add(V))},[]),onNativeOptionRemove:g.useCallback(V=>{F(te=>{const B=new Set(te);return B.delete(V),B})},[]),children:r})}),q?l.jsxs(PE,{"aria-hidden":!0,required:v,tabIndex:-1,name:d,autoComplete:f,value:P,onChange:V=>A(V.target.value),disabled:m,children:[P===void 0?l.jsx("option",{value:""}):null,Array.from(N)]},b):null]})})};oE.displayName=$c;var iE="SelectTrigger",aE=g.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...s}=e,o=eh(r),i=No(iE,r),a=i.disabled||n,c=Ke(t,i.onTriggerChange),u=Jf(r),[d,f,m]=AE(x=>{const y=u().filter(h=>!h.disabled),_=y.find(h=>h.value===i.value),p=DE(y,x,_);p!==void 0&&i.onValueChange(p.value)}),v=()=>{a||(i.onOpenChange(!0),m())};return l.jsx(ev,{asChild:!0,...o,children:l.jsx(Re.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":RE(i.value)?"":void 0,...s,ref:c,onClick:ce(s.onClick,x=>{x.currentTarget.focus()}),onPointerDown:ce(s.onPointerDown,x=>{const y=x.target;y.hasPointerCapture(x.pointerId)&&y.releasePointerCapture(x.pointerId),x.button===0&&x.ctrlKey===!1&&(v(),i.triggerPointerDownPosRef.current={x:Math.round(x.pageX),y:Math.round(x.pageY)},x.preventDefault())}),onKeyDown:ce(s.onKeyDown,x=>{const y=d.current!=="";!(x.ctrlKey||x.altKey||x.metaKey)&&x.key.length===1&&f(x.key),!(y&&x.key===" ")&&K8.includes(x.key)&&(v(),x.preventDefault())})})})});aE.displayName=iE;var lE="SelectValue",cE=g.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,children:o,placeholder:i="",...a}=e,c=No(lE,r),{onValueNodeHasChildrenChange:u}=c,d=o!==void 0,f=Ke(t,c.onValueNodeChange);return Jt(()=>{u(d)},[u,d]),l.jsx(Re.span,{...a,ref:f,style:{pointerEvents:"none"},children:RE(c.value)?l.jsx(l.Fragment,{children:i}):o})});cE.displayName=lE;var J8="SelectIcon",uE=g.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...s}=e;return l.jsx(Re.span,{"aria-hidden":!0,...s,ref:t,children:n||"▼"})});uE.displayName=J8;var eU="SelectPortal",dE=e=>l.jsx(jc,{asChild:!0,...e});dE.displayName=eU;var li="SelectContent",fE=g.forwardRef((e,t)=>{const r=No(li,e.__scopeSelect),[n,s]=g.useState();if(Jt(()=>{s(new DocumentFragment)},[]),!r.open){const o=n;return o?Ts.createPortal(l.jsx(hE,{scope:e.__scopeSelect,children:l.jsx(Qf.Slot,{scope:e.__scopeSelect,children:l.jsx("div",{children:e.children})})}),o):null}return l.jsx(pE,{...e,ref:t})});fE.displayName=li;var ls=10,[hE,To]=Fa(li),tU="SelectContentImpl",pE=g.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:o,onPointerDownOutside:i,side:a,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:m,collisionPadding:v,sticky:x,hideWhenDetached:y,avoidCollisions:_,...p}=e,h=No(li,r),[w,C]=g.useState(null),[j,E]=g.useState(null),R=Ke(t,pe=>C(pe)),[P,A]=g.useState(null),[L,q]=g.useState(null),N=Jf(r),[F,b]=g.useState(!1),V=g.useRef(!1);g.useEffect(()=>{if(w)return ov(w)},[w]),Bg();const te=g.useCallback(pe=>{const[ye,...Ne]=N().map(Pe=>Pe.ref.current),[Fe]=Ne.slice(-1),Me=document.activeElement;for(const Pe of pe)if(Pe===Me||(Pe==null||Pe.scrollIntoView({block:"nearest"}),Pe===ye&&j&&(j.scrollTop=0),Pe===Fe&&j&&(j.scrollTop=j.scrollHeight),Pe==null||Pe.focus(),document.activeElement!==Me))return},[N,j]),B=g.useCallback(()=>te([P,w]),[te,P,w]);g.useEffect(()=>{F&&B()},[F,B]);const{onOpenChange:K,triggerPointerDownPosRef:I}=h;g.useEffect(()=>{if(w){let pe={x:0,y:0};const ye=Fe=>{var Me,Pe;pe={x:Math.abs(Math.round(Fe.pageX)-(((Me=I.current)==null?void 0:Me.x)??0)),y:Math.abs(Math.round(Fe.pageY)-(((Pe=I.current)==null?void 0:Pe.y)??0))}},Ne=Fe=>{pe.x<=10&&pe.y<=10?Fe.preventDefault():w.contains(Fe.target)||K(!1),document.removeEventListener("pointermove",ye),I.current=null};return I.current!==null&&(document.addEventListener("pointermove",ye),document.addEventListener("pointerup",Ne,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ye),document.removeEventListener("pointerup",Ne,{capture:!0})}}},[w,K,I]),g.useEffect(()=>{const pe=()=>K(!1);return window.addEventListener("blur",pe),window.addEventListener("resize",pe),()=>{window.removeEventListener("blur",pe),window.removeEventListener("resize",pe)}},[K]);const[Q,z]=AE(pe=>{const ye=N().filter(Me=>!Me.disabled),Ne=ye.find(Me=>Me.ref.current===document.activeElement),Fe=DE(ye,pe,Ne);Fe&&setTimeout(()=>Fe.ref.current.focus())}),$=g.useCallback((pe,ye,Ne)=>{const Fe=!V.current&&!Ne;(h.value!==void 0&&h.value===ye||Fe)&&(A(pe),Fe&&(V.current=!0))},[h.value]),he=g.useCallback(()=>w==null?void 0:w.focus(),[w]),ne=g.useCallback((pe,ye,Ne)=>{const Fe=!V.current&&!Ne;(h.value!==void 0&&h.value===ye||Fe)&&q(pe)},[h.value]),se=n==="popper"?Rm:mE,Oe=se===Rm?{side:a,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:m,collisionPadding:v,sticky:x,hideWhenDetached:y,avoidCollisions:_}:{};return l.jsx(hE,{scope:r,content:w,viewport:j,onViewportChange:E,itemRefCallback:$,selectedItem:P,onItemLeave:he,itemTextRefCallback:ne,focusSelectedItem:B,selectedItemText:L,position:n,isPositioned:F,searchRef:Q,children:l.jsx(jf,{as:bs,allowPinchZoom:!0,children:l.jsx(_f,{asChild:!0,trapped:h.open,onMountAutoFocus:pe=>{pe.preventDefault()},onUnmountAutoFocus:ce(s,pe=>{var ye;(ye=h.trigger)==null||ye.focus({preventScroll:!0}),pe.preventDefault()}),children:l.jsx(Ta,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:pe=>pe.preventDefault(),onDismiss:()=>h.onOpenChange(!1),children:l.jsx(se,{role:"listbox",id:h.contentId,"data-state":h.open?"open":"closed",dir:h.dir,onContextMenu:pe=>pe.preventDefault(),...p,...Oe,onPlaced:()=>b(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...p.style},onKeyDown:ce(p.onKeyDown,pe=>{const ye=pe.ctrlKey||pe.altKey||pe.metaKey;if(pe.key==="Tab"&&pe.preventDefault(),!ye&&pe.key.length===1&&z(pe.key),["ArrowUp","ArrowDown","Home","End"].includes(pe.key)){let Fe=N().filter(Me=>!Me.disabled).map(Me=>Me.ref.current);if(["ArrowUp","End"].includes(pe.key)&&(Fe=Fe.slice().reverse()),["ArrowUp","ArrowDown"].includes(pe.key)){const Me=pe.target,Pe=Fe.indexOf(Me);Fe=Fe.slice(Pe+1)}setTimeout(()=>te(Fe)),pe.preventDefault()}})})})})})})});pE.displayName=tU;var rU="SelectItemAlignedPosition",mE=g.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...s}=e,o=No(li,r),i=To(li,r),[a,c]=g.useState(null),[u,d]=g.useState(null),f=Ke(t,R=>d(R)),m=Jf(r),v=g.useRef(!1),x=g.useRef(!0),{viewport:y,selectedItem:_,selectedItemText:p,focusSelectedItem:h}=i,w=g.useCallback(()=>{if(o.trigger&&o.valueNode&&a&&u&&y&&_&&p){const R=o.trigger.getBoundingClientRect(),P=u.getBoundingClientRect(),A=o.valueNode.getBoundingClientRect(),L=p.getBoundingClientRect();if(o.dir!=="rtl"){const Me=L.left-P.left,Pe=A.left-Me,nt=R.left-Pe,k=R.width+nt,J=Math.max(k,P.width),G=window.innerWidth-ls,D=Tm(Pe,[ls,G-J]);a.style.minWidth=k+"px",a.style.left=D+"px"}else{const Me=P.right-L.right,Pe=window.innerWidth-A.right-Me,nt=window.innerWidth-R.right-Pe,k=R.width+nt,J=Math.max(k,P.width),G=window.innerWidth-ls,D=Tm(Pe,[ls,G-J]);a.style.minWidth=k+"px",a.style.right=D+"px"}const q=m(),N=window.innerHeight-ls*2,F=y.scrollHeight,b=window.getComputedStyle(u),V=parseInt(b.borderTopWidth,10),te=parseInt(b.paddingTop,10),B=parseInt(b.borderBottomWidth,10),K=parseInt(b.paddingBottom,10),I=V+te+F+K+B,Q=Math.min(_.offsetHeight*5,I),z=window.getComputedStyle(y),$=parseInt(z.paddingTop,10),he=parseInt(z.paddingBottom,10),ne=R.top+R.height/2-ls,se=N-ne,Oe=_.offsetHeight/2,pe=_.offsetTop+Oe,ye=V+te+pe,Ne=I-ye;if(ye<=ne){const Me=_===q[q.length-1].ref.current;a.style.bottom="0px";const Pe=u.clientHeight-y.offsetTop-y.offsetHeight,nt=Math.max(se,Oe+(Me?he:0)+Pe+B),k=ye+nt;a.style.height=k+"px"}else{const Me=_===q[0].ref.current;a.style.top="0px";const nt=Math.max(ne,V+y.offsetTop+(Me?$:0)+Oe)+Ne;a.style.height=nt+"px",y.scrollTop=ye-ne+y.offsetTop}a.style.margin=`${ls}px 0`,a.style.minHeight=Q+"px",a.style.maxHeight=N+"px",n==null||n(),requestAnimationFrame(()=>v.current=!0)}},[m,o.trigger,o.valueNode,a,u,y,_,p,o.dir,n]);Jt(()=>w(),[w]);const[C,j]=g.useState();Jt(()=>{u&&j(window.getComputedStyle(u).zIndex)},[u]);const E=g.useCallback(R=>{R&&x.current===!0&&(w(),h==null||h(),x.current=!1)},[w,h]);return l.jsx(sU,{scope:r,contentWrapper:a,shouldExpandOnScrollRef:v,onScrollButtonChange:E,children:l.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:l.jsx(Re.div,{...s,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});mE.displayName=rU;var nU="SelectPopperPosition",Rm=g.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:s=ls,...o}=e,i=eh(r);return l.jsx(tv,{...i,...o,ref:t,align:n,collisionPadding:s,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Rm.displayName=nU;var[sU,wy]=Fa(li,{}),Pm="SelectViewport",gE=g.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...s}=e,o=To(Pm,r),i=wy(Pm,r),a=Ke(t,o.onViewportChange),c=g.useRef(0);return l.jsxs(l.Fragment,{children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),l.jsx(Qf.Slot,{scope:r,children:l.jsx(Re.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:a,style:{position:"relative",flex:1,overflow:"auto",...s.style},onScroll:ce(s.onScroll,u=>{const d=u.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:m}=i;if(m!=null&&m.current&&f){const v=Math.abs(c.current-d.scrollTop);if(v>0){const x=window.innerHeight-ls*2,y=parseFloat(f.style.minHeight),_=parseFloat(f.style.height),p=Math.max(y,_);if(p0?C:0,f.style.justifyContent="flex-end")}}}c.current=d.scrollTop})})})]})});gE.displayName=Pm;var vE="SelectGroup",[oU,iU]=Fa(vE),yE=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=Ur();return l.jsx(oU,{scope:r,id:s,children:l.jsx(Re.div,{role:"group","aria-labelledby":s,...n,ref:t})})});yE.displayName=vE;var xE="SelectLabel",wE=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=iU(xE,r);return l.jsx(Re.div,{id:s.id,...n,ref:t})});wE.displayName=xE;var Kd="SelectItem",[aU,_E]=Fa(Kd),bE=g.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:s=!1,textValue:o,...i}=e,a=No(Kd,r),c=To(Kd,r),u=a.value===n,[d,f]=g.useState(o??""),[m,v]=g.useState(!1),x=Ke(t,p=>{var h;return(h=c.itemRefCallback)==null?void 0:h.call(c,p,n,s)}),y=Ur(),_=()=>{s||(a.onValueChange(n),a.onOpenChange(!1))};if(n==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return l.jsx(aU,{scope:r,value:n,disabled:s,textId:y,isSelected:u,onItemTextChange:g.useCallback(p=>{f(h=>h||((p==null?void 0:p.textContent)??"").trim())},[]),children:l.jsx(Qf.ItemSlot,{scope:r,value:n,disabled:s,textValue:d,children:l.jsx(Re.div,{role:"option","aria-labelledby":y,"data-highlighted":m?"":void 0,"aria-selected":u&&m,"data-state":u?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...i,ref:x,onFocus:ce(i.onFocus,()=>v(!0)),onBlur:ce(i.onBlur,()=>v(!1)),onPointerUp:ce(i.onPointerUp,_),onPointerMove:ce(i.onPointerMove,p=>{var h;s?(h=c.onItemLeave)==null||h.call(c):p.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ce(i.onPointerLeave,p=>{var h;p.currentTarget===document.activeElement&&((h=c.onItemLeave)==null||h.call(c))}),onKeyDown:ce(i.onKeyDown,p=>{var w;((w=c.searchRef)==null?void 0:w.current)!==""&&p.key===" "||(G8.includes(p.key)&&_(),p.key===" "&&p.preventDefault())})})})})});bE.displayName=Kd;var ul="SelectItemText",SE=g.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,...o}=e,i=No(ul,r),a=To(ul,r),c=_E(ul,r),u=Q8(ul,r),[d,f]=g.useState(null),m=Ke(t,p=>f(p),c.onItemTextChange,p=>{var h;return(h=a.itemTextRefCallback)==null?void 0:h.call(a,p,c.value,c.disabled)}),v=d==null?void 0:d.textContent,x=g.useMemo(()=>l.jsx("option",{value:c.value,disabled:c.disabled,children:v},c.value),[c.disabled,c.value,v]),{onNativeOptionAdd:y,onNativeOptionRemove:_}=u;return Jt(()=>(y(x),()=>_(x)),[y,_,x]),l.jsxs(l.Fragment,{children:[l.jsx(Re.span,{id:c.textId,...o,ref:m}),c.isSelected&&i.valueNode&&!i.valueNodeHasChildren?Ts.createPortal(o.children,i.valueNode):null]})});SE.displayName=ul;var kE="SelectItemIndicator",CE=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return _E(kE,r).isSelected?l.jsx(Re.span,{"aria-hidden":!0,...n,ref:t}):null});CE.displayName=kE;var Am="SelectScrollUpButton",jE=g.forwardRef((e,t)=>{const r=To(Am,e.__scopeSelect),n=wy(Am,e.__scopeSelect),[s,o]=g.useState(!1),i=Ke(t,n.onScrollButtonChange);return Jt(()=>{if(r.viewport&&r.isPositioned){let a=function(){const u=c.scrollTop>0;o(u)};const c=r.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[r.viewport,r.isPositioned]),s?l.jsx(NE,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=r;a&&c&&(a.scrollTop=a.scrollTop-c.offsetHeight)}}):null});jE.displayName=Am;var Dm="SelectScrollDownButton",EE=g.forwardRef((e,t)=>{const r=To(Dm,e.__scopeSelect),n=wy(Dm,e.__scopeSelect),[s,o]=g.useState(!1),i=Ke(t,n.onScrollButtonChange);return Jt(()=>{if(r.viewport&&r.isPositioned){let a=function(){const u=c.scrollHeight-c.clientHeight,d=Math.ceil(c.scrollTop)c.removeEventListener("scroll",a)}},[r.viewport,r.isPositioned]),s?l.jsx(NE,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=r;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});EE.displayName=Dm;var NE=g.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...s}=e,o=To("SelectScrollButton",r),i=g.useRef(null),a=Jf(r),c=g.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return g.useEffect(()=>()=>c(),[c]),Jt(()=>{var d;const u=a().find(f=>f.ref.current===document.activeElement);(d=u==null?void 0:u.ref.current)==null||d.scrollIntoView({block:"nearest"})},[a]),l.jsx(Re.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:ce(s.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(n,50))}),onPointerMove:ce(s.onPointerMove,()=>{var u;(u=o.onItemLeave)==null||u.call(o),i.current===null&&(i.current=window.setInterval(n,50))}),onPointerLeave:ce(s.onPointerLeave,()=>{c()})})}),lU="SelectSeparator",TE=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return l.jsx(Re.div,{"aria-hidden":!0,...n,ref:t})});TE.displayName=lU;var Om="SelectArrow",cU=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=eh(r),o=No(Om,r),i=To(Om,r);return o.open&&i.position==="popper"?l.jsx(rv,{...s,...n,ref:t}):null});cU.displayName=Om;function RE(e){return e===""||e===void 0}var PE=g.forwardRef((e,t)=>{const{value:r,...n}=e,s=g.useRef(null),o=Ke(t,s),i=ly(r);return g.useEffect(()=>{const a=s.current,c=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(i!==r&&d){const f=new Event("change",{bubbles:!0});d.call(a,r),a.dispatchEvent(f)}},[i,r]),l.jsx(Lc,{asChild:!0,children:l.jsx("select",{...n,ref:o,defaultValue:r})})});PE.displayName="BubbleSelect";function AE(e){const t=Dt(e),r=g.useRef(""),n=g.useRef(0),s=g.useCallback(i=>{const a=r.current+i;t(a),function c(u){r.current=u,window.clearTimeout(n.current),u!==""&&(n.current=window.setTimeout(()=>c(""),1e3))}(a)},[t]),o=g.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return g.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,s,o]}function DE(e,t,r){const s=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let i=uU(e,Math.max(o,0));s.length===1&&(i=i.filter(u=>u!==r));const c=i.find(u=>u.textValue.toLowerCase().startsWith(s.toLowerCase()));return c!==r?c:void 0}function uU(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var dU=oE,OE=aE,fU=cE,hU=uE,pU=dE,ME=fE,mU=gE,gU=yE,IE=wE,LE=bE,vU=SE,yU=CE,FE=jE,zE=EE,UE=TE;const Io=dU,dl=gU,Lo=fU,Zs=g.forwardRef(({className:e,children:t,...r},n)=>l.jsxs(OE,{ref:n,className:oe("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[t,l.jsx(hU,{asChild:!0,children:l.jsx(Fg,{className:"h-4 w-4 opacity-50"})})]}));Zs.displayName=OE.displayName;const $E=g.forwardRef(({className:e,...t},r)=>l.jsx(FE,{ref:r,className:oe("flex cursor-default items-center justify-center py-1",e),...t,children:l.jsx(CA,{className:"h-4 w-4"})}));$E.displayName=FE.displayName;const VE=g.forwardRef(({className:e,...t},r)=>l.jsx(zE,{ref:r,className:oe("flex cursor-default items-center justify-center py-1",e),...t,children:l.jsx(Fg,{className:"h-4 w-4"})}));VE.displayName=zE.displayName;const qs=g.forwardRef(({className:e,children:t,position:r="popper",...n},s)=>l.jsx(pU,{children:l.jsxs(ME,{ref:s,className:oe("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:[l.jsx($E,{}),l.jsx(mU,{className:oe("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),l.jsx(VE,{})]})}));qs.displayName=ME.displayName;const Yi=g.forwardRef(({className:e,...t},r)=>l.jsx(IE,{ref:r,className:oe("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Yi.displayName=IE.displayName;const pn=g.forwardRef(({className:e,children:t,...r},n)=>l.jsxs(LE,{ref:n,className:oe("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[l.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:l.jsx(yU,{children:l.jsx(lb,{className:"h-4 w-4"})})}),l.jsx(vU,{children:t})]}));pn.displayName=LE.displayName;const xU=g.forwardRef(({className:e,...t},r)=>l.jsx(UE,{ref:r,className:oe("-mx-1 my-1 h-px bg-muted",e),...t}));xU.displayName=UE.displayName;const Mm=new Map([["aliyun-cdn",["阿里云-CDN","/imgs/providers/aliyun.svg"]],["aliyun-oss",["阿里云-OSS","/imgs/providers/aliyun.svg"]],["aliyun-dcdn",["阿里云-DCDN","/imgs/providers/aliyun.svg"]],["tencent-cdn",["腾讯云-CDN","/imgs/providers/tencent.svg"]],["ssh",["SSH部署","/imgs/providers/ssh.svg"]],["qiniu-cdn",["七牛云-CDN","/imgs/providers/qiniu.svg"]],["webhook",["Webhook","/imgs/providers/webhook.svg"]]]),wU=Array.from(Mm.keys()),_y=xv,by=wv,_U=_v,BE=g.forwardRef(({className:e,...t},r)=>l.jsx(Tc,{ref:r,className:oe("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));BE.displayName=Tc.displayName;const th=g.forwardRef(({className:e,children:t,...r},n)=>l.jsxs(_U,{children:[l.jsx(BE,{}),l.jsxs(Rc,{ref:n,className:oe("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r,children:[t,l.jsxs(Tf,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[l.jsx(zg,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));th.displayName=Rc.displayName;const rh=({className:e,...t})=>l.jsx("div",{className:oe("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});rh.displayName="DialogHeader";const nh=g.forwardRef(({className:e,...t},r)=>l.jsx(Pc,{ref:r,className:oe("text-lg font-semibold leading-none tracking-tight",e),...t}));nh.displayName=Pc.displayName;const bU=g.forwardRef(({className:e,...t},r)=>l.jsx(Ac,{ref:r,className:oe("text-sm text-muted-foreground",e),...t}));bU.displayName=Ac.displayName;function SU(e,t){return g.useReducer((r,n)=>t[r][n]??r,e)}var Sy="ScrollArea",[WE,sV]=sr(Sy),[kU,cn]=WE(Sy),HE=g.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:n="hover",dir:s,scrollHideDelay:o=600,...i}=e,[a,c]=g.useState(null),[u,d]=g.useState(null),[f,m]=g.useState(null),[v,x]=g.useState(null),[y,_]=g.useState(null),[p,h]=g.useState(0),[w,C]=g.useState(0),[j,E]=g.useState(!1),[R,P]=g.useState(!1),A=Ke(t,q=>c(q)),L=di(s);return l.jsx(kU,{scope:r,type:n,dir:L,scrollHideDelay:o,scrollArea:a,viewport:u,onViewportChange:d,content:f,onContentChange:m,scrollbarX:v,onScrollbarXChange:x,scrollbarXEnabled:j,onScrollbarXEnabledChange:E,scrollbarY:y,onScrollbarYChange:_,scrollbarYEnabled:R,onScrollbarYEnabledChange:P,onCornerWidthChange:h,onCornerHeightChange:C,children:l.jsx(Re.div,{dir:L,...i,ref:A,style:{position:"relative","--radix-scroll-area-corner-width":p+"px","--radix-scroll-area-corner-height":w+"px",...e.style}})})});HE.displayName=Sy;var YE="ScrollAreaViewport",KE=g.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:n,nonce:s,...o}=e,i=cn(YE,r),a=g.useRef(null),c=Ke(t,a,i.onViewportChange);return l.jsxs(l.Fragment,{children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),l.jsx(Re.div,{"data-radix-scroll-area-viewport":"",...o,ref:c,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style},children:l.jsx("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});KE.displayName=YE;var Xn="ScrollAreaScrollbar",ky=g.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=cn(Xn,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:i}=s,a=e.orientation==="horizontal";return g.useEffect(()=>(a?o(!0):i(!0),()=>{a?o(!1):i(!1)}),[a,o,i]),s.type==="hover"?l.jsx(CU,{...n,ref:t,forceMount:r}):s.type==="scroll"?l.jsx(jU,{...n,ref:t,forceMount:r}):s.type==="auto"?l.jsx(GE,{...n,ref:t,forceMount:r}):s.type==="always"?l.jsx(Cy,{...n,ref:t}):null});ky.displayName=Xn;var CU=g.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=cn(Xn,e.__scopeScrollArea),[o,i]=g.useState(!1);return g.useEffect(()=>{const a=s.scrollArea;let c=0;if(a){const u=()=>{window.clearTimeout(c),i(!0)},d=()=>{c=window.setTimeout(()=>i(!1),s.scrollHideDelay)};return a.addEventListener("pointerenter",u),a.addEventListener("pointerleave",d),()=>{window.clearTimeout(c),a.removeEventListener("pointerenter",u),a.removeEventListener("pointerleave",d)}}},[s.scrollArea,s.scrollHideDelay]),l.jsx(or,{present:r||o,children:l.jsx(GE,{"data-state":o?"visible":"hidden",...n,ref:t})})}),jU=g.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=cn(Xn,e.__scopeScrollArea),o=e.orientation==="horizontal",i=oh(()=>c("SCROLL_END"),100),[a,c]=SU("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return g.useEffect(()=>{if(a==="idle"){const u=window.setTimeout(()=>c("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(u)}},[a,s.scrollHideDelay,c]),g.useEffect(()=>{const u=s.viewport,d=o?"scrollLeft":"scrollTop";if(u){let f=u[d];const m=()=>{const v=u[d];f!==v&&(c("SCROLL"),i()),f=v};return u.addEventListener("scroll",m),()=>u.removeEventListener("scroll",m)}},[s.viewport,o,c,i]),l.jsx(or,{present:r||a!=="hidden",children:l.jsx(Cy,{"data-state":a==="hidden"?"hidden":"visible",...n,ref:t,onPointerEnter:ce(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:ce(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),GE=g.forwardRef((e,t)=>{const r=cn(Xn,e.__scopeScrollArea),{forceMount:n,...s}=e,[o,i]=g.useState(!1),a=e.orientation==="horizontal",c=oh(()=>{if(r.viewport){const u=r.viewport.offsetWidth{const{orientation:r="vertical",...n}=e,s=cn(Xn,e.__scopeScrollArea),o=g.useRef(null),i=g.useRef(0),[a,c]=g.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=JE(a.viewport,a.content),d={...n,sizes:a,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:m=>o.current=m,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:m=>i.current=m};function f(m,v){return AU(m,i.current,a,v)}return r==="horizontal"?l.jsx(EU,{...d,ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const m=s.viewport.scrollLeft,v=jw(m,a,s.dir);o.current.style.transform=`translate3d(${v}px, 0, 0)`}},onWheelScroll:m=>{s.viewport&&(s.viewport.scrollLeft=m)},onDragScroll:m=>{s.viewport&&(s.viewport.scrollLeft=f(m,s.dir))}}):r==="vertical"?l.jsx(NU,{...d,ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const m=s.viewport.scrollTop,v=jw(m,a);o.current.style.transform=`translate3d(0, ${v}px, 0)`}},onWheelScroll:m=>{s.viewport&&(s.viewport.scrollTop=m)},onDragScroll:m=>{s.viewport&&(s.viewport.scrollTop=f(m))}}):null}),EU=g.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...s}=e,o=cn(Xn,e.__scopeScrollArea),[i,a]=g.useState(),c=g.useRef(null),u=Ke(t,c,o.onScrollbarXChange);return g.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),l.jsx(qE,{"data-orientation":"horizontal",...s,ref:u,sizes:r,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":sh(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,f)=>{if(o.viewport){const m=o.viewport.scrollLeft+d.deltaX;e.onWheelScroll(m),tN(m,f)&&d.preventDefault()}},onResize:()=>{c.current&&o.viewport&&i&&n({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:Zd(i.paddingLeft),paddingEnd:Zd(i.paddingRight)}})}})}),NU=g.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...s}=e,o=cn(Xn,e.__scopeScrollArea),[i,a]=g.useState(),c=g.useRef(null),u=Ke(t,c,o.onScrollbarYChange);return g.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),l.jsx(qE,{"data-orientation":"vertical",...s,ref:u,sizes:r,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":sh(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,f)=>{if(o.viewport){const m=o.viewport.scrollTop+d.deltaY;e.onWheelScroll(m),tN(m,f)&&d.preventDefault()}},onResize:()=>{c.current&&o.viewport&&i&&n({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:Zd(i.paddingTop),paddingEnd:Zd(i.paddingBottom)}})}})}),[TU,ZE]=WE(Xn),qE=g.forwardRef((e,t)=>{const{__scopeScrollArea:r,sizes:n,hasThumb:s,onThumbChange:o,onThumbPointerUp:i,onThumbPointerDown:a,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:d,onResize:f,...m}=e,v=cn(Xn,r),[x,y]=g.useState(null),_=Ke(t,A=>y(A)),p=g.useRef(null),h=g.useRef(""),w=v.viewport,C=n.content-n.viewport,j=Dt(d),E=Dt(c),R=oh(f,10);function P(A){if(p.current){const L=A.clientX-p.current.left,q=A.clientY-p.current.top;u({x:L,y:q})}}return g.useEffect(()=>{const A=L=>{const q=L.target;(x==null?void 0:x.contains(q))&&j(L,C)};return document.addEventListener("wheel",A,{passive:!1}),()=>document.removeEventListener("wheel",A,{passive:!1})},[w,x,C,j]),g.useEffect(E,[n,E]),ba(x,R),ba(v.content,R),l.jsx(TU,{scope:r,scrollbar:x,hasThumb:s,onThumbChange:Dt(o),onThumbPointerUp:Dt(i),onThumbPositionChange:E,onThumbPointerDown:Dt(a),children:l.jsx(Re.div,{...m,ref:_,style:{position:"absolute",...m.style},onPointerDown:ce(e.onPointerDown,A=>{A.button===0&&(A.target.setPointerCapture(A.pointerId),p.current=x.getBoundingClientRect(),h.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",v.viewport&&(v.viewport.style.scrollBehavior="auto"),P(A))}),onPointerMove:ce(e.onPointerMove,P),onPointerUp:ce(e.onPointerUp,A=>{const L=A.target;L.hasPointerCapture(A.pointerId)&&L.releasePointerCapture(A.pointerId),document.body.style.webkitUserSelect=h.current,v.viewport&&(v.viewport.style.scrollBehavior=""),p.current=null})})})}),Gd="ScrollAreaThumb",XE=g.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=ZE(Gd,e.__scopeScrollArea);return l.jsx(or,{present:r||s.hasThumb,children:l.jsx(RU,{ref:t,...n})})}),RU=g.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:n,...s}=e,o=cn(Gd,r),i=ZE(Gd,r),{onThumbPositionChange:a}=i,c=Ke(t,f=>i.onThumbChange(f)),u=g.useRef(),d=oh(()=>{u.current&&(u.current(),u.current=void 0)},100);return g.useEffect(()=>{const f=o.viewport;if(f){const m=()=>{if(d(),!u.current){const v=DU(f,a);u.current=v,a()}};return a(),f.addEventListener("scroll",m),()=>f.removeEventListener("scroll",m)}},[o.viewport,d,a]),l.jsx(Re.div,{"data-state":i.hasThumb?"visible":"hidden",...s,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:ce(e.onPointerDownCapture,f=>{const v=f.target.getBoundingClientRect(),x=f.clientX-v.left,y=f.clientY-v.top;i.onThumbPointerDown({x,y})}),onPointerUp:ce(e.onPointerUp,i.onThumbPointerUp)})});XE.displayName=Gd;var jy="ScrollAreaCorner",QE=g.forwardRef((e,t)=>{const r=cn(jy,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?l.jsx(PU,{...e,ref:t}):null});QE.displayName=jy;var PU=g.forwardRef((e,t)=>{const{__scopeScrollArea:r,...n}=e,s=cn(jy,r),[o,i]=g.useState(0),[a,c]=g.useState(0),u=!!(o&&a);return ba(s.scrollbarX,()=>{var f;const d=((f=s.scrollbarX)==null?void 0:f.offsetHeight)||0;s.onCornerHeightChange(d),c(d)}),ba(s.scrollbarY,()=>{var f;const d=((f=s.scrollbarY)==null?void 0:f.offsetWidth)||0;s.onCornerWidthChange(d),i(d)}),u?l.jsx(Re.div,{...n,ref:t,style:{width:o,height:a,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Zd(e){return e?parseInt(e,10):0}function JE(e,t){const r=e/t;return isNaN(r)?0:r}function sh(e){const t=JE(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function AU(e,t,r,n="ltr"){const s=sh(r),o=s/2,i=t||o,a=s-i,c=r.scrollbar.paddingStart+i,u=r.scrollbar.size-r.scrollbar.paddingEnd-a,d=r.content-r.viewport,f=n==="ltr"?[0,d]:[d*-1,0];return eN([c,u],f)(e)}function jw(e,t,r="ltr"){const n=sh(t),s=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-s,i=t.content-t.viewport,a=o-n,c=r==="ltr"?[0,i]:[i*-1,0],u=Tm(e,c);return eN([0,i],[0,a])(u)}function eN(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function tN(e,t){return e>0&&e{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function s(){const o={left:e.scrollLeft,top:e.scrollTop},i=r.left!==o.left,a=r.top!==o.top;(i||a)&&t(),r=o,n=window.requestAnimationFrame(s)}(),()=>window.cancelAnimationFrame(n)};function oh(e,t){const r=Dt(e),n=g.useRef(0);return g.useEffect(()=>()=>window.clearTimeout(n.current),[]),g.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function ba(e,t){const r=Dt(t);Jt(()=>{let n=0;if(e){const s=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return s.observe(e),()=>{window.cancelAnimationFrame(n),s.unobserve(e)}}},[e,r])}var rN=HE,OU=KE,MU=QE;const ih=g.forwardRef(({className:e,children:t,...r},n)=>l.jsxs(rN,{ref:n,className:oe("relative overflow-hidden",e),...r,children:[l.jsx(OU,{className:"h-full w-full rounded-[inherit]",children:t}),l.jsx(nN,{}),l.jsx(MU,{})]}));ih.displayName=rN.displayName;const nN=g.forwardRef(({className:e,orientation:t="vertical",...r},n)=>l.jsx(ky,{ref:n,orientation:t,className:oe("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...r,children:l.jsx(XE,{className:"relative flex-1 rounded-full bg-border"})}));nN.displayName=ky.displayName;const fo=new Map([["tencent",["腾讯云","/imgs/providers/tencent.svg"]],["aliyun",["阿里云","/imgs/providers/aliyun.svg"]],["cloudflare",["Cloudflare","/imgs/providers/cloudflare.svg"]],["namesilo",["Namesilo","/imgs/providers/namesilo.svg"]],["godaddy",["GoDaddy","/imgs/providers/godaddy.svg"]],["qiniu",["七牛云","/imgs/providers/qiniu.svg"]],["ssh",["SSH部署","/imgs/providers/ssh.svg"]],["webhook",["Webhook","/imgs/providers/webhook.svg"]]]),Ew=e=>fo.get(e),Ro=de.union([de.literal("aliyun"),de.literal("tencent"),de.literal("ssh"),de.literal("webhook"),de.literal("cloudflare"),de.literal("qiniu"),de.literal("namesilo"),de.literal("godaddy")],{message:"请选择云服务商"}),Po=e=>{switch(e){case"aliyun":case"tencent":return"all";case"ssh":case"webhook":case"qiniu":return"deploy";case"cloudflare":case"namesilo":case"godaddy":return"apply";default:return"all"}},IU=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=Zr(),s=de.object({id:de.string().optional(),name:de.string().min(1).max(64),configType:Ro,secretId:de.string().min(1).max(64),secretKey:de.string().min(1).max(64)});let o={secretId:"",secretKey:""};e&&(o=e.config);const i=_r({resolver:br(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"tencent",secretId:o.secretId,secretKey:o.secretKey}}),a=async c=>{const u={id:c.id,name:c.name,configType:c.configType,usage:Po(c.configType),config:{secretId:c.secretId,secretKey:c.secretKey}};try{const d=await Eo(u);if(t(),u.id=d.id,u.created=d.created,u.updated=d.updated,c.id){n(u);return}r(u)}catch(d){Object.entries(d.response.data).forEach(([m,v])=>{i.setError(m,{type:"manual",message:v.message})})}};return l.jsx(l.Fragment,{children:l.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:l.jsx(Sr,{...i,children:l.jsxs("form",{onSubmit:c=>{c.stopPropagation(),i.handleSubmit(a)(c)},className:"space-y-8",children:[l.jsx(Ee,{control:i.control,name:"name",render:({field:c})=>l.jsxs(ke,{children:[l.jsx(Ce,{children:"名称"}),l.jsx(je,{children:l.jsx(Te,{placeholder:"请输入授权名称",...c})}),l.jsx(_e,{})]})}),l.jsx(Ee,{control:i.control,name:"id",render:({field:c})=>l.jsxs(ke,{className:"hidden",children:[l.jsx(Ce,{children:"配置类型"}),l.jsx(je,{children:l.jsx(Te,{...c})}),l.jsx(_e,{})]})}),l.jsx(Ee,{control:i.control,name:"configType",render:({field:c})=>l.jsxs(ke,{className:"hidden",children:[l.jsx(Ce,{children:"配置类型"}),l.jsx(je,{children:l.jsx(Te,{...c})}),l.jsx(_e,{})]})}),l.jsx(Ee,{control:i.control,name:"secretId",render:({field:c})=>l.jsxs(ke,{children:[l.jsx(Ce,{children:"SecretId"}),l.jsx(je,{children:l.jsx(Te,{placeholder:"请输入SecretId",...c})}),l.jsx(_e,{})]})}),l.jsx(Ee,{control:i.control,name:"secretKey",render:({field:c})=>l.jsxs(ke,{children:[l.jsx(Ce,{children:"SecretKey"}),l.jsx(je,{children:l.jsx(Te,{placeholder:"请输入SecretKey",...c})}),l.jsx(_e,{})]})}),l.jsx("div",{className:"flex justify-end",children:l.jsx(He,{type:"submit",children:"保存"})})]})})})})},LU=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=Zr(),s=de.object({id:de.string().optional(),name:de.string().min(1).max(64),configType:Ro,accessKeyId:de.string().min(1).max(64),accessSecretId:de.string().min(1).max(64)});let o={accessKeyId:"",accessKeySecret:""};e&&(o=e.config);const i=_r({resolver:br(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"aliyun",accessKeyId:o.accessKeyId,accessSecretId:o.accessKeySecret}}),a=async c=>{const u={id:c.id,name:c.name,configType:c.configType,usage:Po(c.configType),config:{accessKeyId:c.accessKeyId,accessKeySecret:c.accessSecretId}};try{const d=await Eo(u);if(t(),u.id=d.id,u.created=d.created,u.updated=d.updated,c.id){n(u);return}r(u)}catch(d){Object.entries(d.response.data).forEach(([m,v])=>{i.setError(m,{type:"manual",message:v.message})});return}};return l.jsx(l.Fragment,{children:l.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:l.jsx(Sr,{...i,children:l.jsxs("form",{onSubmit:c=>{c.stopPropagation(),i.handleSubmit(a)(c)},className:"space-y-8",children:[l.jsx(Ee,{control:i.control,name:"name",render:({field:c})=>l.jsxs(ke,{children:[l.jsx(Ce,{children:"名称"}),l.jsx(je,{children:l.jsx(Te,{placeholder:"请输入授权名称",...c})}),l.jsx(_e,{})]})}),l.jsx(Ee,{control:i.control,name:"id",render:({field:c})=>l.jsxs(ke,{className:"hidden",children:[l.jsx(Ce,{children:"配置类型"}),l.jsx(je,{children:l.jsx(Te,{...c})}),l.jsx(_e,{})]})}),l.jsx(Ee,{control:i.control,name:"configType",render:({field:c})=>l.jsxs(ke,{className:"hidden",children:[l.jsx(Ce,{children:"配置类型"}),l.jsx(je,{children:l.jsx(Te,{...c})}),l.jsx(_e,{})]})}),l.jsx(Ee,{control:i.control,name:"accessKeyId",render:({field:c})=>l.jsxs(ke,{children:[l.jsx(Ce,{children:"AccessKeyId"}),l.jsx(je,{children:l.jsx(Te,{placeholder:"请输入AccessKeyId",...c})}),l.jsx(_e,{})]})}),l.jsx(Ee,{control:i.control,name:"accessSecretId",render:({field:c})=>l.jsxs(ke,{children:[l.jsx(Ce,{children:"AccessKeySecret"}),l.jsx(je,{children:l.jsx(Te,{placeholder:"请输入AccessKeySecret",...c})}),l.jsx(_e,{})]})}),l.jsx(_e,{}),l.jsx("div",{className:"flex justify-end",children:l.jsx(He,{type:"submit",children:"保存"})})]})})})})},vc=g.forwardRef(({className:e,...t},r)=>l.jsx("textarea",{className:oe("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...t}));vc.displayName="Textarea";const Ey=({className:e,trigger:t})=>{const{reloadAccessGroups:r}=Zr(),[n,s]=g.useState(!1),o=de.object({name:de.string().min(1).max(64)}),i=_r({resolver:br(o),defaultValues:{name:""}}),a=async c=>{try{await $3({name:c.name}),r(),s(!1)}catch(u){Object.entries(u.response.data).forEach(([f,m])=>{i.setError(f,{type:"manual",message:m.message})})}};return l.jsxs(_y,{onOpenChange:s,open:n,children:[l.jsx(by,{asChild:!0,className:oe(e),children:t}),l.jsxs(th,{className:"sm:max-w-[600px] w-full dark:text-stone-200",children:[l.jsx(rh,{children:l.jsx(nh,{children:"添加分组"})}),l.jsx("div",{className:"container py-3",children:l.jsx(Sr,{...i,children:l.jsxs("form",{onSubmit:c=>{console.log(c),c.stopPropagation(),i.handleSubmit(a)(c)},className:"space-y-8",children:[l.jsx(Ee,{control:i.control,name:"name",render:({field:c})=>l.jsxs(ke,{children:[l.jsx(Ce,{children:"组名"}),l.jsx(je,{children:l.jsx(Te,{placeholder:"请输入组名",...c,type:"text"})}),l.jsx(_e,{})]})}),l.jsx("div",{className:"flex justify-end",children:l.jsx(He,{type:"submit",children:"保存"})})]})})})]})]})},FU=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n,reloadAccessGroups:s,config:{accessGroups:o}}=Zr(),i=g.useRef(null),[a,c]=g.useState(""),u=e&&e.group?e.group:"",d=/^(?:\*\.)?([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}$/,f=/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,m=de.object({id:de.string().optional(),name:de.string().min(1).max(64),configType:Ro,host:de.string().refine(h=>f.test(h)||d.test(h),{message:"请输入正确的域名或IP"}),group:de.string().optional(),port:de.string().min(1).max(5),username:de.string().min(1).max(64),password:de.string().min(0).max(64),key:de.string().min(0).max(20480),keyFile:de.any().optional(),command:de.string().min(1).max(2048),certPath:de.string().min(0).max(2048),keyPath:de.string().min(0).max(2048)});let v={host:"127.0.0.1",port:"22",username:"root",password:"",key:"",keyFile:"",command:"sudo service nginx restart",certPath:"/etc/nginx/ssl/certificate.crt",keyPath:"/etc/nginx/ssl/private.key"};e&&(v=e.config);const x=_r({resolver:br(m),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"ssh",group:e==null?void 0:e.group,host:v.host,port:v.port,username:v.username,password:v.password,key:v.key,keyFile:v.keyFile,certPath:v.certPath,keyPath:v.keyPath,command:v.command}}),y=async h=>{console.log(h);let w=h.group;w=="emptyId"&&(w="");const C={id:h.id,name:h.name,configType:h.configType,usage:Po(h.configType),group:w,config:{host:h.host,port:h.port,username:h.username,password:h.password,key:h.key,command:h.command,certPath:h.certPath,keyPath:h.keyPath}};try{const j=await Eo(C);t(),C.id=j.id,C.created=j.created,C.updated=j.updated,h.id?n(C):r(C),w!=u&&(u&&await dw({id:u,"access-":C.id}),w&&await dw({id:w,"access+":C.id})),s()}catch(j){Object.entries(j.response.data).forEach(([R,P])=>{x.setError(R,{type:"manual",message:P.message})});return}},_=async h=>{var E;const w=(E=h.target.files)==null?void 0:E[0];if(!w)return;const C=w;c(C.name);const j=await fz(C);x.setValue("key",j)},p=()=>{var h;console.log(i.current),(h=i.current)==null||h.click()};return l.jsx(l.Fragment,{children:l.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:l.jsx(Sr,{...x,children:l.jsxs("form",{onSubmit:h=>{h.stopPropagation(),x.handleSubmit(y)(h)},className:"space-y-3",children:[l.jsx(Ee,{control:x.control,name:"name",render:({field:h})=>l.jsxs(ke,{children:[l.jsx(Ce,{children:"名称"}),l.jsx(je,{children:l.jsx(Te,{placeholder:"请输入授权名称",...h})}),l.jsx(_e,{})]})}),l.jsx(Ee,{control:x.control,name:"group",render:({field:h})=>l.jsxs(ke,{children:[l.jsxs(Ce,{className:"w-full flex justify-between",children:[l.jsx("div",{children:"授权配置组(用于将一个域名证书部署到多个 ssh 主机)"}),l.jsx(Ey,{trigger:l.jsxs("div",{className:"font-normal text-primary hover:underline cursor-pointer flex items-center",children:[l.jsx(Uu,{size:14}),"新增"]})})]}),l.jsx(je,{children:l.jsxs(Io,{...h,value:h.value,defaultValue:"emptyId",onValueChange:w=>{x.setValue("group",w)},children:[l.jsx(Zs,{children:l.jsx(Lo,{placeholder:"请选择分组"})}),l.jsxs(qs,{children:[l.jsx(pn,{value:"emptyId",children:l.jsx("div",{className:oe("flex items-center space-x-2 rounded cursor-pointer"),children:"--"})}),o.map(w=>l.jsx(pn,{value:w.id?w.id:"",children:l.jsx("div",{className:oe("flex items-center space-x-2 rounded cursor-pointer"),children:w.name})},w.id))]})]})}),l.jsx(_e,{})]})}),l.jsx(Ee,{control:x.control,name:"id",render:({field:h})=>l.jsxs(ke,{className:"hidden",children:[l.jsx(Ce,{children:"配置类型"}),l.jsx(je,{children:l.jsx(Te,{...h})}),l.jsx(_e,{})]})}),l.jsx(Ee,{control:x.control,name:"configType",render:({field:h})=>l.jsxs(ke,{className:"hidden",children:[l.jsx(Ce,{children:"配置类型"}),l.jsx(je,{children:l.jsx(Te,{...h})}),l.jsx(_e,{})]})}),l.jsxs("div",{className:"flex space-x-2",children:[l.jsx(Ee,{control:x.control,name:"host",render:({field:h})=>l.jsxs(ke,{className:"grow",children:[l.jsx(Ce,{children:"服务器HOST"}),l.jsx(je,{children:l.jsx(Te,{placeholder:"请输入Host",...h})}),l.jsx(_e,{})]})}),l.jsx(Ee,{control:x.control,name:"port",render:({field:h})=>l.jsxs(ke,{children:[l.jsx(Ce,{children:"SSH端口"}),l.jsx(je,{children:l.jsx(Te,{placeholder:"请输入Port",...h,type:"number"})}),l.jsx(_e,{})]})})]}),l.jsx(Ee,{control:x.control,name:"username",render:({field:h})=>l.jsxs(ke,{children:[l.jsx(Ce,{children:"用户名"}),l.jsx(je,{children:l.jsx(Te,{placeholder:"请输入用户名",...h})}),l.jsx(_e,{})]})}),l.jsx(Ee,{control:x.control,name:"password",render:({field:h})=>l.jsxs(ke,{children:[l.jsx(Ce,{children:"密码"}),l.jsx(je,{children:l.jsx(Te,{placeholder:"请输入密码",...h,type:"password"})}),l.jsx(_e,{})]})}),l.jsx(Ee,{control:x.control,name:"key",render:({field:h})=>l.jsxs(ke,{hidden:!0,children:[l.jsx(Ce,{children:"Key(使用证书登录)"}),l.jsx(je,{children:l.jsx(Te,{placeholder:"请输入Key",...h})}),l.jsx(_e,{})]})}),l.jsx(Ee,{control:x.control,name:"keyFile",render:({field:h})=>l.jsxs(ke,{children:[l.jsx(Ce,{children:"Key(使用证书登录)"}),l.jsx(je,{children:l.jsxs("div",{children:[l.jsx(He,{type:"button",variant:"secondary",size:"sm",className:"w-48",onClick:p,children:a||"请选择文件"}),l.jsx(Te,{placeholder:"请输入Key",...h,ref:i,className:"hidden",hidden:!0,type:"file",onChange:_})]})}),l.jsx(_e,{})]})}),l.jsx(Ee,{control:x.control,name:"certPath",render:({field:h})=>l.jsxs(ke,{children:[l.jsx(Ce,{children:"证书上传路径"}),l.jsx(je,{children:l.jsx(Te,{placeholder:"请输入证书上传路径",...h})}),l.jsx(_e,{})]})}),l.jsx(Ee,{control:x.control,name:"keyPath",render:({field:h})=>l.jsxs(ke,{children:[l.jsx(Ce,{children:"私钥上传路径"}),l.jsx(je,{children:l.jsx(Te,{placeholder:"请输入私钥上传路径",...h})}),l.jsx(_e,{})]})}),l.jsx(Ee,{control:x.control,name:"command",render:({field:h})=>l.jsxs(ke,{children:[l.jsx(Ce,{children:"Command"}),l.jsx(je,{children:l.jsx(vc,{placeholder:"请输入要执行的命令",...h})}),l.jsx(_e,{})]})}),l.jsx(_e,{}),l.jsx("div",{className:"flex justify-end",children:l.jsx(He,{type:"submit",children:"保存"})})]})})})})},zU=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=Zr(),s=de.object({id:de.string().optional(),name:de.string().min(1).max(64),configType:Ro,url:de.string().url()});let o={url:""};e&&(o=e.config);const i=_r({resolver:br(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"webhook",url:o.url}}),a=async c=>{console.log(c);const u={id:c.id,name:c.name,configType:c.configType,usage:Po(c.configType),config:{url:c.url}};try{const d=await Eo(u);if(t(),u.id=d.id,u.created=d.created,u.updated=d.updated,c.id){n(u);return}r(u)}catch(d){Object.entries(d.response.data).forEach(([m,v])=>{i.setError(m,{type:"manual",message:v.message})})}};return l.jsx(l.Fragment,{children:l.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:l.jsx(Sr,{...i,children:l.jsxs("form",{onSubmit:c=>{console.log(c),c.stopPropagation(),i.handleSubmit(a)(c)},className:"space-y-8",children:[l.jsx(Ee,{control:i.control,name:"name",render:({field:c})=>l.jsxs(ke,{children:[l.jsx(Ce,{children:"名称"}),l.jsx(je,{children:l.jsx(Te,{placeholder:"请输入授权名称",...c})}),l.jsx(_e,{})]})}),l.jsx(Ee,{control:i.control,name:"id",render:({field:c})=>l.jsxs(ke,{className:"hidden",children:[l.jsx(Ce,{children:"配置类型"}),l.jsx(je,{children:l.jsx(Te,{...c})}),l.jsx(_e,{})]})}),l.jsx(Ee,{control:i.control,name:"configType",render:({field:c})=>l.jsxs(ke,{className:"hidden",children:[l.jsx(Ce,{children:"配置类型"}),l.jsx(je,{children:l.jsx(Te,{...c})}),l.jsx(_e,{})]})}),l.jsx(Ee,{control:i.control,name:"url",render:({field:c})=>l.jsxs(ke,{children:[l.jsx(Ce,{children:"Webhook Url"}),l.jsx(je,{children:l.jsx(Te,{placeholder:"请输入Webhook Url",...c})}),l.jsx(_e,{})]})}),l.jsx("div",{className:"flex justify-end",children:l.jsx(He,{type:"submit",children:"保存"})})]})})})})},UU=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=Zr(),s=de.object({id:de.string().optional(),name:de.string().min(1).max(64),configType:Ro,dnsApiToken:de.string().min(1).max(64)});let o={dnsApiToken:""};e&&(o=e.config);const i=_r({resolver:br(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"cloudflare",dnsApiToken:o.dnsApiToken}}),a=async c=>{console.log(c);const u={id:c.id,name:c.name,configType:c.configType,usage:Po(c.configType),config:{dnsApiToken:c.dnsApiToken}};try{const d=await Eo(u);if(t(),u.id=d.id,u.created=d.created,u.updated=d.updated,c.id){n(u);return}r(u)}catch(d){Object.entries(d.response.data).forEach(([m,v])=>{i.setError(m,{type:"manual",message:v.message})})}};return l.jsx(l.Fragment,{children:l.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:l.jsx(Sr,{...i,children:l.jsxs("form",{onSubmit:c=>{console.log(c),c.stopPropagation(),i.handleSubmit(a)(c)},className:"space-y-8",children:[l.jsx(Ee,{control:i.control,name:"name",render:({field:c})=>l.jsxs(ke,{children:[l.jsx(Ce,{children:"名称"}),l.jsx(je,{children:l.jsx(Te,{placeholder:"请输入授权名称",...c})}),l.jsx(_e,{})]})}),l.jsx(Ee,{control:i.control,name:"id",render:({field:c})=>l.jsxs(ke,{className:"hidden",children:[l.jsx(Ce,{children:"配置类型"}),l.jsx(je,{children:l.jsx(Te,{...c})}),l.jsx(_e,{})]})}),l.jsx(Ee,{control:i.control,name:"configType",render:({field:c})=>l.jsxs(ke,{className:"hidden",children:[l.jsx(Ce,{children:"配置类型"}),l.jsx(je,{children:l.jsx(Te,{...c})}),l.jsx(_e,{})]})}),l.jsx(Ee,{control:i.control,name:"dnsApiToken",render:({field:c})=>l.jsxs(ke,{children:[l.jsx(Ce,{children:"CLOUD_DNS_API_TOKEN"}),l.jsx(je,{children:l.jsx(Te,{placeholder:"请输入CLOUD_DNS_API_TOKEN",...c})}),l.jsx(_e,{})]})}),l.jsx("div",{className:"flex justify-end",children:l.jsx(He,{type:"submit",children:"保存"})})]})})})})},$U=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=Zr(),s=de.object({id:de.string().optional(),name:de.string().min(1).max(64),configType:Ro,accessKey:de.string().min(1).max(64),secretKey:de.string().min(1).max(64)});let o={accessKey:"",secretKey:""};e&&(o=e.config);const i=_r({resolver:br(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"qiniu",accessKey:o.accessKey,secretKey:o.secretKey}}),a=async c=>{const u={id:c.id,name:c.name,configType:c.configType,usage:Po(c.configType),config:{accessKey:c.accessKey,secretKey:c.secretKey}};try{const d=await Eo(u);if(t(),u.id=d.id,u.created=d.created,u.updated=d.updated,c.id){n(u);return}r(u)}catch(d){Object.entries(d.response.data).forEach(([m,v])=>{i.setError(m,{type:"manual",message:v.message})});return}};return l.jsx(l.Fragment,{children:l.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:l.jsx(Sr,{...i,children:l.jsxs("form",{onSubmit:c=>{c.stopPropagation(),i.handleSubmit(a)(c)},className:"space-y-8",children:[l.jsx(Ee,{control:i.control,name:"name",render:({field:c})=>l.jsxs(ke,{children:[l.jsx(Ce,{children:"名称"}),l.jsx(je,{children:l.jsx(Te,{placeholder:"请输入授权名称",...c})}),l.jsx(_e,{})]})}),l.jsx(Ee,{control:i.control,name:"id",render:({field:c})=>l.jsxs(ke,{className:"hidden",children:[l.jsx(Ce,{children:"配置类型"}),l.jsx(je,{children:l.jsx(Te,{...c})}),l.jsx(_e,{})]})}),l.jsx(Ee,{control:i.control,name:"configType",render:({field:c})=>l.jsxs(ke,{className:"hidden",children:[l.jsx(Ce,{children:"配置类型"}),l.jsx(je,{children:l.jsx(Te,{...c})}),l.jsx(_e,{})]})}),l.jsx(Ee,{control:i.control,name:"accessKey",render:({field:c})=>l.jsxs(ke,{children:[l.jsx(Ce,{children:"AccessKey"}),l.jsx(je,{children:l.jsx(Te,{placeholder:"请输入AccessKey",...c})}),l.jsx(_e,{})]})}),l.jsx(Ee,{control:i.control,name:"secretKey",render:({field:c})=>l.jsxs(ke,{children:[l.jsx(Ce,{children:"SecretKey"}),l.jsx(je,{children:l.jsx(Te,{placeholder:"请输入SecretKey",...c})}),l.jsx(_e,{})]})}),l.jsx(_e,{}),l.jsx("div",{className:"flex justify-end",children:l.jsx(He,{type:"submit",children:"保存"})})]})})})})},VU=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=Zr(),s=de.object({id:de.string().optional(),name:de.string().min(1).max(64),configType:Ro,apiKey:de.string().min(1).max(64)});let o={apiKey:""};e&&(o=e.config);const i=_r({resolver:br(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"namesilo",apiKey:o.apiKey}}),a=async c=>{console.log(c);const u={id:c.id,name:c.name,configType:c.configType,usage:Po(c.configType),config:{apiKey:c.apiKey}};try{const d=await Eo(u);if(t(),u.id=d.id,u.created=d.created,u.updated=d.updated,c.id){n(u);return}r(u)}catch(d){Object.entries(d.response.data).forEach(([m,v])=>{i.setError(m,{type:"manual",message:v.message})})}};return l.jsx(l.Fragment,{children:l.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:l.jsx(Sr,{...i,children:l.jsxs("form",{onSubmit:c=>{console.log(c),c.stopPropagation(),i.handleSubmit(a)(c)},className:"space-y-8",children:[l.jsx(Ee,{control:i.control,name:"name",render:({field:c})=>l.jsxs(ke,{children:[l.jsx(Ce,{children:"名称"}),l.jsx(je,{children:l.jsx(Te,{placeholder:"请输入授权名称",...c})}),l.jsx(_e,{})]})}),l.jsx(Ee,{control:i.control,name:"id",render:({field:c})=>l.jsxs(ke,{className:"hidden",children:[l.jsx(Ce,{children:"配置类型"}),l.jsx(je,{children:l.jsx(Te,{...c})}),l.jsx(_e,{})]})}),l.jsx(Ee,{control:i.control,name:"configType",render:({field:c})=>l.jsxs(ke,{className:"hidden",children:[l.jsx(Ce,{children:"配置类型"}),l.jsx(je,{children:l.jsx(Te,{...c})}),l.jsx(_e,{})]})}),l.jsx(Ee,{control:i.control,name:"apiKey",render:({field:c})=>l.jsxs(ke,{children:[l.jsx(Ce,{children:"NAMESILO_API_KEY"}),l.jsx(je,{children:l.jsx(Te,{placeholder:"请输入NAMESILO_API_KEY",...c})}),l.jsx(_e,{})]})}),l.jsx("div",{className:"flex justify-end",children:l.jsx(He,{type:"submit",children:"保存"})})]})})})})},BU=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=Zr(),s=de.object({id:de.string().optional(),name:de.string().min(1).max(64),configType:Ro,apiKey:de.string().min(1).max(64),apiSecret:de.string().min(1).max(64)});let o={apiKey:"",apiSecret:""};e&&(o=e.config);const i=_r({resolver:br(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"godaddy",apiKey:o.apiKey,apiSecret:o.apiSecret}}),a=async c=>{console.log(c);const u={id:c.id,name:c.name,configType:c.configType,usage:Po(c.configType),config:{apiKey:c.apiKey,apiSecret:c.apiSecret}};try{const d=await Eo(u);if(t(),u.id=d.id,u.created=d.created,u.updated=d.updated,c.id){n(u);return}r(u)}catch(d){Object.entries(d.response.data).forEach(([m,v])=>{i.setError(m,{type:"manual",message:v.message})})}};return l.jsx(l.Fragment,{children:l.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:l.jsx(Sr,{...i,children:l.jsxs("form",{onSubmit:c=>{console.log(c),c.stopPropagation(),i.handleSubmit(a)(c)},className:"space-y-8",children:[l.jsx(Ee,{control:i.control,name:"name",render:({field:c})=>l.jsxs(ke,{children:[l.jsx(Ce,{children:"名称"}),l.jsx(je,{children:l.jsx(Te,{placeholder:"请输入授权名称",...c})}),l.jsx(_e,{})]})}),l.jsx(Ee,{control:i.control,name:"id",render:({field:c})=>l.jsxs(ke,{className:"hidden",children:[l.jsx(Ce,{children:"配置类型"}),l.jsx(je,{children:l.jsx(Te,{...c})}),l.jsx(_e,{})]})}),l.jsx(Ee,{control:i.control,name:"configType",render:({field:c})=>l.jsxs(ke,{className:"hidden",children:[l.jsx(Ce,{children:"配置类型"}),l.jsx(je,{children:l.jsx(Te,{...c})}),l.jsx(_e,{})]})}),l.jsx(Ee,{control:i.control,name:"apiKey",render:({field:c})=>l.jsxs(ke,{children:[l.jsx(Ce,{children:"GODADDY_API_KEY"}),l.jsx(je,{children:l.jsx(Te,{placeholder:"请输入GODADDY_API_KEY",...c})}),l.jsx(_e,{})]})}),l.jsx(Ee,{control:i.control,name:"apiSecret",render:({field:c})=>l.jsxs(ke,{children:[l.jsx(Ce,{children:"GODADDY_API_SECRET"}),l.jsx(je,{children:l.jsx(Te,{placeholder:"请输入GODADDY_API_SECRET",...c})}),l.jsx(_e,{})]})}),l.jsx("div",{className:"flex justify-end",children:l.jsx(He,{type:"submit",children:"保存"})})]})})})})};function Nl({trigger:e,op:t,data:r,className:n}){const[s,o]=g.useState(!1),i=Array.from(fo.keys()),[a,c]=g.useState((r==null?void 0:r.configType)||"");let u=l.jsx(l.Fragment,{children:" "});switch(a){case"tencent":u=l.jsx(IU,{data:r,onAfterReq:()=>{o(!1)}});break;case"aliyun":u=l.jsx(LU,{data:r,onAfterReq:()=>{o(!1)}});break;case"ssh":u=l.jsx(FU,{data:r,onAfterReq:()=>{o(!1)}});break;case"webhook":u=l.jsx(zU,{data:r,onAfterReq:()=>{o(!1)}});break;case"cloudflare":u=l.jsx(UU,{data:r,onAfterReq:()=>{o(!1)}});break;case"qiniu":u=l.jsx($U,{data:r,onAfterReq:()=>{o(!1)}});break;case"namesilo":u=l.jsx(VU,{data:r,onAfterReq:()=>{o(!1)}});break;case"godaddy":u=l.jsx(BU,{data:r,onAfterReq:()=>{o(!1)}});break}const d=f=>f==a?"border-primary":"";return l.jsxs(_y,{onOpenChange:o,open:s,children:[l.jsx(by,{asChild:!0,className:oe(n),children:e}),l.jsxs(th,{className:"sm:max-w-[600px] w-full dark:text-stone-200",children:[l.jsx(rh,{children:l.jsxs(nh,{children:[t=="add"?"添加":"编辑","授权"]})}),l.jsx(ih,{className:"max-h-[80vh]",children:l.jsxs("div",{className:"container py-3",children:[l.jsx(bo,{children:"服务商"}),l.jsxs(Io,{onValueChange:f=>{console.log(f),c(f)},defaultValue:a,children:[l.jsx(Zs,{className:"mt-3",children:l.jsx(Lo,{placeholder:"请选择服务商"})}),l.jsx(qs,{children:l.jsxs(dl,{children:[l.jsx(Yi,{children:"服务商"}),i.map(f=>{var m,v;return l.jsx(pn,{value:f,children:l.jsxs("div",{className:oe("flex items-center space-x-2 rounded cursor-pointer",d(f)),children:[l.jsx("img",{src:(m=fo.get(f))==null?void 0:m[1],className:"h-6 w-6"}),l.jsx("div",{children:(v=fo.get(f))==null?void 0:v[0]})]})},f)})]})})]}),u]})})]})]})}const WU=({className:e,trigger:t})=>{const{config:{emails:r},setEmails:n}=Zr(),[s,o]=g.useState(!1),i=de.object({email:de.string().email()}),a=_r({resolver:br(i),defaultValues:{email:""}}),c=async u=>{if(r.content.emails.includes(u.email)){a.setError("email",{message:"邮箱已存在"});return}const d=[...r.content.emails,u.email];try{const f=await La({...r,name:"emails",content:{emails:d}});n(f),a.reset(),a.clearErrors(),o(!1)}catch(f){Object.entries(f.response.data).forEach(([v,x])=>{a.setError(v,{type:"manual",message:x.message})})}};return l.jsxs(_y,{onOpenChange:o,open:s,children:[l.jsx(by,{asChild:!0,className:oe(e),children:t}),l.jsxs(th,{className:"sm:max-w-[600px] w-full dark:text-stone-200",children:[l.jsx(rh,{children:l.jsx(nh,{children:"添加邮箱"})}),l.jsx("div",{className:"container py-3",children:l.jsx(Sr,{...a,children:l.jsxs("form",{onSubmit:u=>{console.log(u),u.stopPropagation(),a.handleSubmit(c)(u)},className:"space-y-8",children:[l.jsx(Ee,{control:a.control,name:"email",render:({field:u})=>l.jsxs(ke,{children:[l.jsx(Ce,{children:"邮箱"}),l.jsx(je,{children:l.jsx(Te,{placeholder:"请输入邮箱",...u,type:"email"})}),l.jsx(_e,{})]})}),l.jsx("div",{className:"flex justify-end",children:l.jsx(He,{type:"submit",children:"保存"})})]})})})]})]})},HU=()=>{const{config:{accesses:e,emails:t,accessGroups:r}}=Zr(),[n,s]=g.useState(),o=Nn(),[i,a]=g.useState("base"),[c,u]=g.useState(n?n.targetType:"");g.useEffect(()=>{const p=new URLSearchParams(o.search).get("id");p&&(async()=>{const w=await vz(p);s(w),u(w.targetType)})()},[o.search]);const d=de.object({id:de.string().optional(),domain:de.string().regex(/^(?:\*\.)?([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}$/,{message:"请输入正确的域名"}),email:de.string().email().optional(),access:de.string().regex(/^[a-zA-Z0-9]+$/,{message:"请选择DNS服务商授权配置"}),targetAccess:de.string().optional(),targetType:de.string().regex(/^[a-zA-Z0-9-]+$/,{message:"请选择部署服务类型"}),variables:de.string().optional(),group:de.string().optional(),nameservers:de.string().optional()}),f=_r({resolver:br(d),defaultValues:{id:"",domain:"",email:"",access:"",targetAccess:"",targetType:"",variables:"",group:"",nameservers:""}});g.useEffect(()=>{n&&f.reset({id:n.id,domain:n.domain,email:n.email,access:n.access,targetAccess:n.targetAccess,targetType:n.targetType,variables:n.variables,group:n.group,nameservers:n.nameservers})},[n,f]);const m=e.filter(_=>{if(_.usage=="apply")return!1;if(c=="")return!0;const p=c.split("-");return _.configType===p[0]}),{toast:v}=Pn(),x=Pr(),y=async _=>{const p=_.group=="emptyId"?"":_.group,h=_.targetAccess==="emptyId"?"":_.targetAccess;if(p==""&&h==""){f.setError("group",{type:"manual",message:"部署授权和部署授权组至少选一个"}),f.setError("targetAccess",{type:"manual",message:"部署授权和部署授权组至少选一个"});return}const w={id:_.id,crontab:"0 0 * * *",domain:_.domain,email:_.email,access:_.access,group:p,targetAccess:h,targetType:_.targetType,variables:_.variables,nameservers:_.nameservers};try{await km(w);let C="域名编辑成功";w.id==""&&(C="域名添加成功"),v({title:"成功",description:C}),x("/domains")}catch(C){Object.entries(C.response.data).forEach(([E,R])=>{f.setError(E,{type:"manual",message:R.message})});return}};return l.jsx(l.Fragment,{children:l.jsxs("div",{className:"",children:[l.jsx(hy,{}),l.jsxs("div",{className:" h-5 text-muted-foreground",children:[n!=null&&n.id?"编辑":"新增","域名"]}),l.jsxs("div",{className:"mt-5 flex w-full justify-center md:space-x-10 flex-col md:flex-row",children:[l.jsxs("div",{className:"w-full md:w-[200px] text-muted-foreground space-x-3 md:space-y-3 flex-row md:flex-col flex",children:[l.jsx("div",{className:oe("cursor-pointer text-right",i==="base"?"text-primary":""),onClick:()=>{a("base")},children:"基础设置"}),l.jsx("div",{className:oe("cursor-pointer text-right",i==="advance"?"text-primary":""),onClick:()=>{a("advance")},children:"高级设置"})]}),l.jsx("div",{className:"w-full md:w-[35em] bg-gray-100 dark:bg-gray-900 p-5 rounded mt-3 md:mt-0",children:l.jsx(Sr,{...f,children:l.jsxs("form",{onSubmit:f.handleSubmit(y),className:"space-y-8 dark:text-stone-200",children:[l.jsx(Ee,{control:f.control,name:"domain",render:({field:_})=>l.jsxs(ke,{hidden:i!="base",children:[l.jsx(Ce,{children:"域名"}),l.jsx(je,{children:l.jsx(Te,{placeholder:"请输入域名",..._})}),l.jsx(_e,{})]})}),l.jsx(Ee,{control:f.control,name:"email",render:({field:_})=>l.jsxs(ke,{hidden:i!="base",children:[l.jsxs(Ce,{className:"flex w-full justify-between",children:[l.jsx("div",{children:"Email(申请证书需要提供邮箱)"}),l.jsx(WU,{trigger:l.jsxs("div",{className:"font-normal text-primary hover:underline cursor-pointer flex items-center",children:[l.jsx(Uu,{size:14}),"新增"]})})]}),l.jsx(je,{children:l.jsxs(Io,{..._,value:_.value,onValueChange:p=>{f.setValue("email",p)},children:[l.jsx(Zs,{children:l.jsx(Lo,{placeholder:"请选择邮箱"})}),l.jsx(qs,{children:l.jsxs(dl,{children:[l.jsx(Yi,{children:"邮箱列表"}),t.content.emails.map(p=>l.jsx(pn,{value:p,children:l.jsx("div",{children:p})},p))]})})]})}),l.jsx(_e,{})]})}),l.jsx(Ee,{control:f.control,name:"access",render:({field:_})=>l.jsxs(ke,{hidden:i!="base",children:[l.jsxs(Ce,{className:"flex w-full justify-between",children:[l.jsx("div",{children:"DNS 服务商授权配置"}),l.jsx(Nl,{trigger:l.jsxs("div",{className:"font-normal text-primary hover:underline cursor-pointer flex items-center",children:[l.jsx(Uu,{size:14}),"新增"]}),op:"add"})]}),l.jsx(je,{children:l.jsxs(Io,{..._,value:_.value,onValueChange:p=>{f.setValue("access",p)},children:[l.jsx(Zs,{children:l.jsx(Lo,{placeholder:"请选择授权配置"})}),l.jsx(qs,{children:l.jsxs(dl,{children:[l.jsx(Yi,{children:"服务商授权配置"}),e.filter(p=>p.usage!="deploy").map(p=>{var h;return l.jsx(pn,{value:p.id,children:l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx("img",{className:"w-6",src:(h=fo.get(p.configType))==null?void 0:h[1]}),l.jsx("div",{children:p.name})]})},p.id)})]})})]})}),l.jsx(_e,{})]})}),l.jsx(Ee,{control:f.control,name:"targetType",render:({field:_})=>l.jsxs(ke,{hidden:i!="base",children:[l.jsx(Ce,{children:"部署服务类型"}),l.jsx(je,{children:l.jsxs(Io,{..._,onValueChange:p=>{u(p),f.setValue("targetType",p)},children:[l.jsx(Zs,{children:l.jsx(Lo,{placeholder:"请选择部署服务类型"})}),l.jsx(qs,{children:l.jsxs(dl,{children:[l.jsx(Yi,{children:"部署服务类型"}),wU.map(p=>{var h,w;return l.jsx(pn,{value:p,children:l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx("img",{className:"w-6",src:(h=Mm.get(p))==null?void 0:h[1]}),l.jsx("div",{children:(w=Mm.get(p))==null?void 0:w[0]})]})},p)})]})})]})}),l.jsx(_e,{})]})}),l.jsx(Ee,{control:f.control,name:"targetAccess",render:({field:_})=>l.jsxs(ke,{hidden:i!="base",children:[l.jsxs(Ce,{className:"w-full flex justify-between",children:[l.jsx("div",{children:"部署服务商授权配置"}),l.jsx(Nl,{trigger:l.jsxs("div",{className:"font-normal text-primary hover:underline cursor-pointer flex items-center",children:[l.jsx(Uu,{size:14}),"新增"]}),op:"add"})]}),l.jsx(je,{children:l.jsxs(Io,{..._,onValueChange:p=>{f.setValue("targetAccess",p)},children:[l.jsx(Zs,{children:l.jsx(Lo,{placeholder:"请选择授权配置"})}),l.jsx(qs,{children:l.jsxs(dl,{children:[l.jsxs(Yi,{children:["服务商授权配置",f.getValues().targetAccess]}),l.jsx(pn,{value:"emptyId",children:l.jsx("div",{className:"flex items-center space-x-2",children:"--"})}),m.map(p=>{var h;return l.jsx(pn,{value:p.id,children:l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx("img",{className:"w-6",src:(h=fo.get(p.configType))==null?void 0:h[1]}),l.jsx("div",{children:p.name})]})},p.id)})]})})]})}),l.jsx(_e,{})]})}),l.jsx(Ee,{control:f.control,name:"group",render:({field:_})=>l.jsxs(ke,{hidden:i!="advance"||c!="ssh",children:[l.jsx(Ce,{className:"w-full flex justify-between",children:l.jsx("div",{children:"部署配置组(用于将一个域名证书部署到多个 ssh 主机)"})}),l.jsx(je,{children:l.jsxs(Io,{..._,value:_.value,defaultValue:"emptyId",onValueChange:p=>{f.setValue("group",p)},children:[l.jsx(Zs,{children:l.jsx(Lo,{placeholder:"请选择分组"})}),l.jsxs(qs,{children:[l.jsx(pn,{value:"emptyId",children:l.jsx("div",{className:oe("flex items-center space-x-2 rounded cursor-pointer"),children:"--"})}),r.filter(p=>{var h;return p.expand&&((h=p.expand)==null?void 0:h.access.length)>0}).map(p=>l.jsx(pn,{value:p.id?p.id:"",children:l.jsx("div",{className:oe("flex items-center space-x-2 rounded cursor-pointer"),children:p.name})},p.id))]})]})}),l.jsx(_e,{})]})}),l.jsx(Ee,{control:f.control,name:"variables",render:({field:_})=>l.jsxs(ke,{hidden:i!="advance",children:[l.jsx(Ce,{children:"变量"}),l.jsx(je,{children:l.jsx(vc,{placeholder:`可在SSH部署中使用,形如: +*/(function(e,t){(function(r){e.exports=r()})(function(){return function r(n,s,o){function i(u,d){if(!s[u]){if(!n[u]){var f=typeof Cu=="function"&&Cu;if(!d&&f)return f(u,!0);if(l)return l(u,!0);var m=new Error("Cannot find module '"+u+"'");throw m.code="MODULE_NOT_FOUND",m}var v=s[u]={exports:{}};n[u][0].call(v.exports,function(x){var y=n[u][1][x];return i(y||x)},v,v.exports,r,n,s,o)}return s[u].exports}for(var l=typeof Cu=="function"&&Cu,c=0;c>2,v=(3&u)<<4|d>>4,x=1>6:64,y=2>4,d=(15&m)<<4|(v=l.indexOf(c.charAt(y++)))>>2,f=(3&v)<<6|(x=l.indexOf(c.charAt(y++))),h[_++]=u,v!==64&&(h[_++]=d),x!==64&&(h[_++]=f);return h}},{"./support":30,"./utils":32}],2:[function(r,n,s){var o=r("./external"),i=r("./stream/DataWorker"),l=r("./stream/Crc32Probe"),c=r("./stream/DataLengthProbe");function u(d,f,m,v,x){this.compressedSize=d,this.uncompressedSize=f,this.crc32=m,this.compression=v,this.compressedContent=x}u.prototype={getContentWorker:function(){var d=new i(o.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new c("data_length")),f=this;return d.on("end",function(){if(this.streamInfo.data_length!==f.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),d},getCompressedWorker:function(){return new i(o.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},u.createWorkerFrom=function(d,f,m){return d.pipe(new l).pipe(new c("uncompressedSize")).pipe(f.compressWorker(m)).pipe(new c("compressedSize")).withStreamInfo("compression",f)},n.exports=u},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(r,n,s){var o=r("./stream/GenericWorker");s.STORE={magic:"\0\0",compressWorker:function(){return new o("STORE compression")},uncompressWorker:function(){return new o("STORE decompression")}},s.DEFLATE=r("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(r,n,s){var o=r("./utils"),i=function(){for(var l,c=[],u=0;u<256;u++){l=u;for(var d=0;d<8;d++)l=1&l?3988292384^l>>>1:l>>>1;c[u]=l}return c}();n.exports=function(l,c){return l!==void 0&&l.length?o.getTypeOf(l)!=="string"?function(u,d,f,m){var v=i,x=m+f;u^=-1;for(var y=m;y>>8^v[255&(u^d[y])];return-1^u}(0|c,l,l.length,0):function(u,d,f,m){var v=i,x=m+f;u^=-1;for(var y=m;y>>8^v[255&(u^d.charCodeAt(y))];return-1^u}(0|c,l,l.length,0):0}},{"./utils":32}],5:[function(r,n,s){s.base64=!1,s.binary=!1,s.dir=!1,s.createFolders=!0,s.date=null,s.compression=null,s.compressionOptions=null,s.comment=null,s.unixPermissions=null,s.dosPermissions=null},{}],6:[function(r,n,s){var o=null;o=typeof Promise<"u"?Promise:r("lie"),n.exports={Promise:o}},{lie:37}],7:[function(r,n,s){var o=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",i=r("pako"),l=r("./utils"),c=r("./stream/GenericWorker"),u=o?"uint8array":"array";function d(f,m){c.call(this,"FlateWorker/"+f),this._pako=null,this._pakoAction=f,this._pakoOptions=m,this.meta={}}s.magic="\b\0",l.inherits(d,c),d.prototype.processChunk=function(f){this.meta=f.meta,this._pako===null&&this._createPako(),this._pako.push(l.transformTo(u,f.data),!1)},d.prototype.flush=function(){c.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},d.prototype.cleanUp=function(){c.prototype.cleanUp.call(this),this._pako=null},d.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var f=this;this._pako.onData=function(m){f.push({data:m,meta:f.meta})}},s.compressWorker=function(f){return new d("Deflate",f)},s.uncompressWorker=function(){return new d("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(r,n,s){function o(v,x){var y,_="";for(y=0;y>>=8;return _}function i(v,x,y,_,p,h){var w,C,j=v.file,E=v.compression,R=h!==u.utf8encode,P=l.transformTo("string",h(j.name)),A=l.transformTo("string",u.utf8encode(j.name)),L=j.comment,q=l.transformTo("string",h(L)),N=l.transformTo("string",u.utf8encode(L)),F=A.length!==j.name.length,b=N.length!==L.length,V="",te="",B="",K=j.dir,I=j.date,Q={crc32:0,compressedSize:0,uncompressedSize:0};x&&!y||(Q.crc32=v.crc32,Q.compressedSize=v.compressedSize,Q.uncompressedSize=v.uncompressedSize);var z=0;x&&(z|=8),R||!F&&!b||(z|=2048);var $=0,he=0;K&&($|=16),p==="UNIX"?(he=798,$|=function(se,Oe){var pe=se;return se||(pe=Oe?16893:33204),(65535&pe)<<16}(j.unixPermissions,K)):(he=20,$|=function(se){return 63&(se||0)}(j.dosPermissions)),w=I.getUTCHours(),w<<=6,w|=I.getUTCMinutes(),w<<=5,w|=I.getUTCSeconds()/2,C=I.getUTCFullYear()-1980,C<<=4,C|=I.getUTCMonth()+1,C<<=5,C|=I.getUTCDate(),F&&(te=o(1,1)+o(d(P),4)+A,V+="up"+o(te.length,2)+te),b&&(B=o(1,1)+o(d(q),4)+N,V+="uc"+o(B.length,2)+B);var ne="";return ne+=` +\0`,ne+=o(z,2),ne+=E.magic,ne+=o(w,2),ne+=o(C,2),ne+=o(Q.crc32,4),ne+=o(Q.compressedSize,4),ne+=o(Q.uncompressedSize,4),ne+=o(P.length,2),ne+=o(V.length,2),{fileRecord:f.LOCAL_FILE_HEADER+ne+P+V,dirRecord:f.CENTRAL_FILE_HEADER+o(he,2)+ne+o(q.length,2)+"\0\0\0\0"+o($,4)+o(_,4)+P+V+q}}var l=r("../utils"),c=r("../stream/GenericWorker"),u=r("../utf8"),d=r("../crc32"),f=r("../signature");function m(v,x,y,_){c.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=x,this.zipPlatform=y,this.encodeFileName=_,this.streamFiles=v,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}l.inherits(m,c),m.prototype.push=function(v){var x=v.meta.percent||0,y=this.entriesCount,_=this._sources.length;this.accumulate?this.contentBuffer.push(v):(this.bytesWritten+=v.data.length,c.prototype.push.call(this,{data:v.data,meta:{currentFile:this.currentFile,percent:y?(x+100*(y-_-1))/y:100}}))},m.prototype.openedSource=function(v){this.currentSourceOffset=this.bytesWritten,this.currentFile=v.file.name;var x=this.streamFiles&&!v.file.dir;if(x){var y=i(v,x,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:y.fileRecord,meta:{percent:0}})}else this.accumulate=!0},m.prototype.closedSource=function(v){this.accumulate=!1;var x=this.streamFiles&&!v.file.dir,y=i(v,x,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(y.dirRecord),x)this.push({data:function(_){return f.DATA_DESCRIPTOR+o(_.crc32,4)+o(_.compressedSize,4)+o(_.uncompressedSize,4)}(v),meta:{percent:100}});else for(this.push({data:y.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},m.prototype.flush=function(){for(var v=this.bytesWritten,x=0;x=this.index;c--)u=(u<<8)+this.byteAt(c);return this.index+=l,u},readString:function(l){return o.transformTo("string",this.readData(l))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var l=this.readInt(4);return new Date(Date.UTC(1980+(l>>25&127),(l>>21&15)-1,l>>16&31,l>>11&31,l>>5&63,(31&l)<<1))}},n.exports=i},{"../utils":32}],19:[function(r,n,s){var o=r("./Uint8ArrayReader");function i(l){o.call(this,l)}r("../utils").inherits(i,o),i.prototype.readData=function(l){this.checkOffset(l);var c=this.data.slice(this.zero+this.index,this.zero+this.index+l);return this.index+=l,c},n.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(r,n,s){var o=r("./DataReader");function i(l){o.call(this,l)}r("../utils").inherits(i,o),i.prototype.byteAt=function(l){return this.data.charCodeAt(this.zero+l)},i.prototype.lastIndexOfSignature=function(l){return this.data.lastIndexOf(l)-this.zero},i.prototype.readAndCheckSignature=function(l){return l===this.readData(4)},i.prototype.readData=function(l){this.checkOffset(l);var c=this.data.slice(this.zero+this.index,this.zero+this.index+l);return this.index+=l,c},n.exports=i},{"../utils":32,"./DataReader":18}],21:[function(r,n,s){var o=r("./ArrayReader");function i(l){o.call(this,l)}r("../utils").inherits(i,o),i.prototype.readData=function(l){if(this.checkOffset(l),l===0)return new Uint8Array(0);var c=this.data.subarray(this.zero+this.index,this.zero+this.index+l);return this.index+=l,c},n.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(r,n,s){var o=r("../utils"),i=r("../support"),l=r("./ArrayReader"),c=r("./StringReader"),u=r("./NodeBufferReader"),d=r("./Uint8ArrayReader");n.exports=function(f){var m=o.getTypeOf(f);return o.checkSupport(m),m!=="string"||i.uint8array?m==="nodebuffer"?new u(f):i.uint8array?new d(o.transformTo("uint8array",f)):new l(o.transformTo("array",f)):new c(f)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(r,n,s){s.LOCAL_FILE_HEADER="PK",s.CENTRAL_FILE_HEADER="PK",s.CENTRAL_DIRECTORY_END="PK",s.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",s.ZIP64_CENTRAL_DIRECTORY_END="PK",s.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(r,n,s){var o=r("./GenericWorker"),i=r("../utils");function l(c){o.call(this,"ConvertWorker to "+c),this.destType=c}i.inherits(l,o),l.prototype.processChunk=function(c){this.push({data:i.transformTo(this.destType,c.data),meta:c.meta})},n.exports=l},{"../utils":32,"./GenericWorker":28}],25:[function(r,n,s){var o=r("./GenericWorker"),i=r("../crc32");function l(){o.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}r("../utils").inherits(l,o),l.prototype.processChunk=function(c){this.streamInfo.crc32=i(c.data,this.streamInfo.crc32||0),this.push(c)},n.exports=l},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(r,n,s){var o=r("../utils"),i=r("./GenericWorker");function l(c){i.call(this,"DataLengthProbe for "+c),this.propName=c,this.withStreamInfo(c,0)}o.inherits(l,i),l.prototype.processChunk=function(c){if(c){var u=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=u+c.data.length}i.prototype.processChunk.call(this,c)},n.exports=l},{"../utils":32,"./GenericWorker":28}],27:[function(r,n,s){var o=r("../utils"),i=r("./GenericWorker");function l(c){i.call(this,"DataWorker");var u=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,c.then(function(d){u.dataIsReady=!0,u.data=d,u.max=d&&d.length||0,u.type=o.getTypeOf(d),u.isPaused||u._tickAndRepeat()},function(d){u.error(d)})}o.inherits(l,i),l.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},l.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,o.delay(this._tickAndRepeat,[],this)),!0)},l.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(o.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},l.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var c=null,u=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":c=this.data.substring(this.index,u);break;case"uint8array":c=this.data.subarray(this.index,u);break;case"array":case"nodebuffer":c=this.data.slice(this.index,u)}return this.index=u,this.push({data:c,meta:{percent:this.max?this.index/this.max*100:0}})},n.exports=l},{"../utils":32,"./GenericWorker":28}],28:[function(r,n,s){function o(i){this.name=i||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}o.prototype={push:function(i){this.emit("data",i)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(i){this.emit("error",i)}return!0},error:function(i){return!this.isFinished&&(this.isPaused?this.generatedError=i:(this.isFinished=!0,this.emit("error",i),this.previous&&this.previous.error(i),this.cleanUp()),!0)},on:function(i,l){return this._listeners[i].push(l),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(i,l){if(this._listeners[i])for(var c=0;c "+i:i}},n.exports=o},{}],29:[function(r,n,s){var o=r("../utils"),i=r("./ConvertWorker"),l=r("./GenericWorker"),c=r("../base64"),u=r("../support"),d=r("../external"),f=null;if(u.nodestream)try{f=r("../nodejs/NodejsStreamOutputAdapter")}catch{}function m(x,y){return new d.Promise(function(_,p){var h=[],w=x._internalType,C=x._outputType,j=x._mimeType;x.on("data",function(E,R){h.push(E),y&&y(R)}).on("error",function(E){h=[],p(E)}).on("end",function(){try{var E=function(R,P,A){switch(R){case"blob":return o.newBlob(o.transformTo("arraybuffer",P),A);case"base64":return c.encode(P);default:return o.transformTo(R,P)}}(C,function(R,P){var A,L=0,q=null,N=0;for(A=0;A"u")s.blob=!1;else{var o=new ArrayBuffer(0);try{s.blob=new Blob([o],{type:"application/zip"}).size===0}catch{try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);i.append(o),s.blob=i.getBlob("application/zip").size===0}catch{s.blob=!1}}}try{s.nodestream=!!r("readable-stream").Readable}catch{s.nodestream=!1}},{"readable-stream":16}],31:[function(r,n,s){for(var o=r("./utils"),i=r("./support"),l=r("./nodejsUtils"),c=r("./stream/GenericWorker"),u=new Array(256),d=0;d<256;d++)u[d]=252<=d?6:248<=d?5:240<=d?4:224<=d?3:192<=d?2:1;u[254]=u[254]=1;function f(){c.call(this,"utf-8 decode"),this.leftOver=null}function m(){c.call(this,"utf-8 encode")}s.utf8encode=function(v){return i.nodebuffer?l.newBufferFrom(v,"utf-8"):function(x){var y,_,p,h,w,C=x.length,j=0;for(h=0;h>>6:(_<65536?y[w++]=224|_>>>12:(y[w++]=240|_>>>18,y[w++]=128|_>>>12&63),y[w++]=128|_>>>6&63),y[w++]=128|63&_);return y}(v)},s.utf8decode=function(v){return i.nodebuffer?o.transformTo("nodebuffer",v).toString("utf-8"):function(x){var y,_,p,h,w=x.length,C=new Array(2*w);for(y=_=0;y>10&1023,C[_++]=56320|1023&p)}return C.length!==_&&(C.subarray?C=C.subarray(0,_):C.length=_),o.applyFromCharCode(C)}(v=o.transformTo(i.uint8array?"uint8array":"array",v))},o.inherits(f,c),f.prototype.processChunk=function(v){var x=o.transformTo(i.uint8array?"uint8array":"array",v.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var y=x;(x=new Uint8Array(y.length+this.leftOver.length)).set(this.leftOver,0),x.set(y,this.leftOver.length)}else x=this.leftOver.concat(x);this.leftOver=null}var _=function(h,w){var C;for((w=w||h.length)>h.length&&(w=h.length),C=w-1;0<=C&&(192&h[C])==128;)C--;return C<0||C===0?w:C+u[h[C]]>w?C:w}(x),p=x;_!==x.length&&(i.uint8array?(p=x.subarray(0,_),this.leftOver=x.subarray(_,x.length)):(p=x.slice(0,_),this.leftOver=x.slice(_,x.length))),this.push({data:s.utf8decode(p),meta:v.meta})},f.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:s.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},s.Utf8DecodeWorker=f,o.inherits(m,c),m.prototype.processChunk=function(v){this.push({data:s.utf8encode(v.data),meta:v.meta})},s.Utf8EncodeWorker=m},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(r,n,s){var o=r("./support"),i=r("./base64"),l=r("./nodejsUtils"),c=r("./external");function u(y){return y}function d(y,_){for(var p=0;p>8;this.dir=!!(16&this.externalFileAttributes),v==0&&(this.dosPermissions=63&this.externalFileAttributes),v==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var v=o(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=v.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=v.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=v.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=v.readInt(4))}},readExtraFields:function(v){var x,y,_,p=v.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});v.index+4>>6:(v<65536?m[_++]=224|v>>>12:(m[_++]=240|v>>>18,m[_++]=128|v>>>12&63),m[_++]=128|v>>>6&63),m[_++]=128|63&v);return m},s.buf2binstring=function(f){return d(f,f.length)},s.binstring2buf=function(f){for(var m=new o.Buf8(f.length),v=0,x=m.length;v>10&1023,h[x++]=56320|1023&y)}return d(h,x)},s.utf8border=function(f,m){var v;for((m=m||f.length)>f.length&&(m=f.length),v=m-1;0<=v&&(192&f[v])==128;)v--;return v<0||v===0?m:v+c[f[v]]>m?v:m}},{"./common":41}],43:[function(r,n,s){n.exports=function(o,i,l,c){for(var u=65535&o|0,d=o>>>16&65535|0,f=0;l!==0;){for(l-=f=2e3>>1:i>>>1;l[c]=i}return l}();n.exports=function(i,l,c,u){var d=o,f=u+c;i^=-1;for(var m=u;m>>8^d[255&(i^l[m])];return-1^i}},{}],46:[function(r,n,s){var o,i=r("../utils/common"),l=r("./trees"),c=r("./adler32"),u=r("./crc32"),d=r("./messages"),f=0,m=4,v=0,x=-2,y=-1,_=4,p=2,h=8,w=9,C=286,j=30,E=19,R=2*C+1,P=15,A=3,L=258,q=L+A+1,N=42,F=113,b=1,V=2,te=3,B=4;function K(k,J){return k.msg=d[J],J}function I(k){return(k<<1)-(4k.avail_out&&(G=k.avail_out),G!==0&&(i.arraySet(k.output,J.pending_buf,J.pending_out,G,k.next_out),k.next_out+=G,J.pending_out+=G,k.total_out+=G,k.avail_out-=G,J.pending-=G,J.pending===0&&(J.pending_out=0))}function $(k,J){l._tr_flush_block(k,0<=k.block_start?k.block_start:-1,k.strstart-k.block_start,J),k.block_start=k.strstart,z(k.strm)}function he(k,J){k.pending_buf[k.pending++]=J}function ne(k,J){k.pending_buf[k.pending++]=J>>>8&255,k.pending_buf[k.pending++]=255&J}function se(k,J){var G,D,S=k.max_chain_length,T=k.strstart,O=k.prev_length,Y=k.nice_match,M=k.strstart>k.w_size-q?k.strstart-(k.w_size-q):0,H=k.window,X=k.w_mask,ee=k.prev,me=k.strstart+L,Ye=H[T+O-1],Ue=H[T+O];k.prev_length>=k.good_match&&(S>>=2),Y>k.lookahead&&(Y=k.lookahead);do if(H[(G=J)+O]===Ue&&H[G+O-1]===Ye&&H[G]===H[T]&&H[++G]===H[T+1]){T+=2,G++;do;while(H[++T]===H[++G]&&H[++T]===H[++G]&&H[++T]===H[++G]&&H[++T]===H[++G]&&H[++T]===H[++G]&&H[++T]===H[++G]&&H[++T]===H[++G]&&H[++T]===H[++G]&&TM&&--S!=0);return O<=k.lookahead?O:k.lookahead}function Oe(k){var J,G,D,S,T,O,Y,M,H,X,ee=k.w_size;do{if(S=k.window_size-k.lookahead-k.strstart,k.strstart>=ee+(ee-q)){for(i.arraySet(k.window,k.window,ee,ee,0),k.match_start-=ee,k.strstart-=ee,k.block_start-=ee,J=G=k.hash_size;D=k.head[--J],k.head[J]=ee<=D?D-ee:0,--G;);for(J=G=ee;D=k.prev[--J],k.prev[J]=ee<=D?D-ee:0,--G;);S+=ee}if(k.strm.avail_in===0)break;if(O=k.strm,Y=k.window,M=k.strstart+k.lookahead,H=S,X=void 0,X=O.avail_in,H=A)for(T=k.strstart-k.insert,k.ins_h=k.window[T],k.ins_h=(k.ins_h<=A&&(k.ins_h=(k.ins_h<=A)if(D=l._tr_tally(k,k.strstart-k.match_start,k.match_length-A),k.lookahead-=k.match_length,k.match_length<=k.max_lazy_match&&k.lookahead>=A){for(k.match_length--;k.strstart++,k.ins_h=(k.ins_h<=A&&(k.ins_h=(k.ins_h<=A&&k.match_length<=k.prev_length){for(S=k.strstart+k.lookahead-A,D=l._tr_tally(k,k.strstart-1-k.prev_match,k.prev_length-A),k.lookahead-=k.prev_length-1,k.prev_length-=2;++k.strstart<=S&&(k.ins_h=(k.ins_h<k.pending_buf_size-5&&(G=k.pending_buf_size-5);;){if(k.lookahead<=1){if(Oe(k),k.lookahead===0&&J===f)return b;if(k.lookahead===0)break}k.strstart+=k.lookahead,k.lookahead=0;var D=k.block_start+G;if((k.strstart===0||k.strstart>=D)&&(k.lookahead=k.strstart-D,k.strstart=D,$(k,!1),k.strm.avail_out===0)||k.strstart-k.block_start>=k.w_size-q&&($(k,!1),k.strm.avail_out===0))return b}return k.insert=0,J===m?($(k,!0),k.strm.avail_out===0?te:B):(k.strstart>k.block_start&&($(k,!1),k.strm.avail_out),b)}),new Te(4,4,8,4,pe),new Te(4,5,16,8,pe),new Te(4,6,32,32,pe),new Te(4,4,16,16,xe),new Te(8,16,32,32,xe),new Te(8,16,128,128,xe),new Te(8,32,128,256,xe),new Te(32,128,258,1024,xe),new Te(32,258,258,4096,xe)],s.deflateInit=function(k,J){return nt(k,J,h,15,8,0)},s.deflateInit2=nt,s.deflateReset=Pe,s.deflateResetKeep=Me,s.deflateSetHeader=function(k,J){return k&&k.state?k.state.wrap!==2?x:(k.state.gzhead=J,v):x},s.deflate=function(k,J){var G,D,S,T;if(!k||!k.state||5>8&255),he(D,D.gzhead.time>>16&255),he(D,D.gzhead.time>>24&255),he(D,D.level===9?2:2<=D.strategy||D.level<2?4:0),he(D,255&D.gzhead.os),D.gzhead.extra&&D.gzhead.extra.length&&(he(D,255&D.gzhead.extra.length),he(D,D.gzhead.extra.length>>8&255)),D.gzhead.hcrc&&(k.adler=u(k.adler,D.pending_buf,D.pending,0)),D.gzindex=0,D.status=69):(he(D,0),he(D,0),he(D,0),he(D,0),he(D,0),he(D,D.level===9?2:2<=D.strategy||D.level<2?4:0),he(D,3),D.status=F);else{var O=h+(D.w_bits-8<<4)<<8;O|=(2<=D.strategy||D.level<2?0:D.level<6?1:D.level===6?2:3)<<6,D.strstart!==0&&(O|=32),O+=31-O%31,D.status=F,ne(D,O),D.strstart!==0&&(ne(D,k.adler>>>16),ne(D,65535&k.adler)),k.adler=1}if(D.status===69)if(D.gzhead.extra){for(S=D.pending;D.gzindex<(65535&D.gzhead.extra.length)&&(D.pending!==D.pending_buf_size||(D.gzhead.hcrc&&D.pending>S&&(k.adler=u(k.adler,D.pending_buf,D.pending-S,S)),z(k),S=D.pending,D.pending!==D.pending_buf_size));)he(D,255&D.gzhead.extra[D.gzindex]),D.gzindex++;D.gzhead.hcrc&&D.pending>S&&(k.adler=u(k.adler,D.pending_buf,D.pending-S,S)),D.gzindex===D.gzhead.extra.length&&(D.gzindex=0,D.status=73)}else D.status=73;if(D.status===73)if(D.gzhead.name){S=D.pending;do{if(D.pending===D.pending_buf_size&&(D.gzhead.hcrc&&D.pending>S&&(k.adler=u(k.adler,D.pending_buf,D.pending-S,S)),z(k),S=D.pending,D.pending===D.pending_buf_size)){T=1;break}T=D.gzindexS&&(k.adler=u(k.adler,D.pending_buf,D.pending-S,S)),T===0&&(D.gzindex=0,D.status=91)}else D.status=91;if(D.status===91)if(D.gzhead.comment){S=D.pending;do{if(D.pending===D.pending_buf_size&&(D.gzhead.hcrc&&D.pending>S&&(k.adler=u(k.adler,D.pending_buf,D.pending-S,S)),z(k),S=D.pending,D.pending===D.pending_buf_size)){T=1;break}T=D.gzindexS&&(k.adler=u(k.adler,D.pending_buf,D.pending-S,S)),T===0&&(D.status=103)}else D.status=103;if(D.status===103&&(D.gzhead.hcrc?(D.pending+2>D.pending_buf_size&&z(k),D.pending+2<=D.pending_buf_size&&(he(D,255&k.adler),he(D,k.adler>>8&255),k.adler=0,D.status=F)):D.status=F),D.pending!==0){if(z(k),k.avail_out===0)return D.last_flush=-1,v}else if(k.avail_in===0&&I(J)<=I(G)&&J!==m)return K(k,-5);if(D.status===666&&k.avail_in!==0)return K(k,-5);if(k.avail_in!==0||D.lookahead!==0||J!==f&&D.status!==666){var Y=D.strategy===2?function(M,H){for(var X;;){if(M.lookahead===0&&(Oe(M),M.lookahead===0)){if(H===f)return b;break}if(M.match_length=0,X=l._tr_tally(M,0,M.window[M.strstart]),M.lookahead--,M.strstart++,X&&($(M,!1),M.strm.avail_out===0))return b}return M.insert=0,H===m?($(M,!0),M.strm.avail_out===0?te:B):M.last_lit&&($(M,!1),M.strm.avail_out===0)?b:V}(D,J):D.strategy===3?function(M,H){for(var X,ee,me,Ye,Ue=M.window;;){if(M.lookahead<=L){if(Oe(M),M.lookahead<=L&&H===f)return b;if(M.lookahead===0)break}if(M.match_length=0,M.lookahead>=A&&0M.lookahead&&(M.match_length=M.lookahead)}if(M.match_length>=A?(X=l._tr_tally(M,1,M.match_length-A),M.lookahead-=M.match_length,M.strstart+=M.match_length,M.match_length=0):(X=l._tr_tally(M,0,M.window[M.strstart]),M.lookahead--,M.strstart++),X&&($(M,!1),M.strm.avail_out===0))return b}return M.insert=0,H===m?($(M,!0),M.strm.avail_out===0?te:B):M.last_lit&&($(M,!1),M.strm.avail_out===0)?b:V}(D,J):o[D.level].func(D,J);if(Y!==te&&Y!==B||(D.status=666),Y===b||Y===te)return k.avail_out===0&&(D.last_flush=-1),v;if(Y===V&&(J===1?l._tr_align(D):J!==5&&(l._tr_stored_block(D,0,0,!1),J===3&&(Q(D.head),D.lookahead===0&&(D.strstart=0,D.block_start=0,D.insert=0))),z(k),k.avail_out===0))return D.last_flush=-1,v}return J!==m?v:D.wrap<=0?1:(D.wrap===2?(he(D,255&k.adler),he(D,k.adler>>8&255),he(D,k.adler>>16&255),he(D,k.adler>>24&255),he(D,255&k.total_in),he(D,k.total_in>>8&255),he(D,k.total_in>>16&255),he(D,k.total_in>>24&255)):(ne(D,k.adler>>>16),ne(D,65535&k.adler)),z(k),0=G.w_size&&(T===0&&(Q(G.head),G.strstart=0,G.block_start=0,G.insert=0),H=new i.Buf8(G.w_size),i.arraySet(H,J,X-G.w_size,G.w_size,0),J=H,X=G.w_size),O=k.avail_in,Y=k.next_in,M=k.input,k.avail_in=X,k.next_in=0,k.input=J,Oe(G);G.lookahead>=A;){for(D=G.strstart,S=G.lookahead-(A-1);G.ins_h=(G.ins_h<>>=A=P>>>24,w-=A,(A=P>>>16&255)===0)V[d++]=65535&P;else{if(!(16&A)){if(!(64&A)){P=C[(65535&P)+(h&(1<>>=A,w-=A),w<15&&(h+=b[c++]<>>=A=P>>>24,w-=A,!(16&(A=P>>>16&255))){if(!(64&A)){P=j[(65535&P)+(h&(1<>>=A,w-=A,(A=d-f)>3,h&=(1<<(w-=L<<3))-1,o.next_in=c,o.next_out=d,o.avail_in=c>>24&255)+(N>>>8&65280)+((65280&N)<<8)+((255&N)<<24)}function h(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new o.Buf16(320),this.work=new o.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function w(N){var F;return N&&N.state?(F=N.state,N.total_in=N.total_out=F.total=0,N.msg="",F.wrap&&(N.adler=1&F.wrap),F.mode=x,F.last=0,F.havedict=0,F.dmax=32768,F.head=null,F.hold=0,F.bits=0,F.lencode=F.lendyn=new o.Buf32(y),F.distcode=F.distdyn=new o.Buf32(_),F.sane=1,F.back=-1,m):v}function C(N){var F;return N&&N.state?((F=N.state).wsize=0,F.whave=0,F.wnext=0,w(N)):v}function j(N,F){var b,V;return N&&N.state?(V=N.state,F<0?(b=0,F=-F):(b=1+(F>>4),F<48&&(F&=15)),F&&(F<8||15=B.wsize?(o.arraySet(B.window,F,b-B.wsize,B.wsize,0),B.wnext=0,B.whave=B.wsize):(V<(te=B.wsize-B.wnext)&&(te=V),o.arraySet(B.window,F,b-V,te,B.wnext),(V-=te)?(o.arraySet(B.window,F,b-V,V,0),B.wnext=V,B.whave=B.wsize):(B.wnext+=te,B.wnext===B.wsize&&(B.wnext=0),B.whave>>8&255,b.check=l(b.check,T,2,0),$=z=0,b.mode=2;break}if(b.flags=0,b.head&&(b.head.done=!1),!(1&b.wrap)||(((255&z)<<8)+(z>>8))%31){N.msg="incorrect header check",b.mode=30;break}if((15&z)!=8){N.msg="unknown compression method",b.mode=30;break}if($-=4,k=8+(15&(z>>>=4)),b.wbits===0)b.wbits=k;else if(k>b.wbits){N.msg="invalid window size",b.mode=30;break}b.dmax=1<>8&1),512&b.flags&&(T[0]=255&z,T[1]=z>>>8&255,b.check=l(b.check,T,2,0)),$=z=0,b.mode=3;case 3:for(;$<32;){if(I===0)break e;I--,z+=V[B++]<<$,$+=8}b.head&&(b.head.time=z),512&b.flags&&(T[0]=255&z,T[1]=z>>>8&255,T[2]=z>>>16&255,T[3]=z>>>24&255,b.check=l(b.check,T,4,0)),$=z=0,b.mode=4;case 4:for(;$<16;){if(I===0)break e;I--,z+=V[B++]<<$,$+=8}b.head&&(b.head.xflags=255&z,b.head.os=z>>8),512&b.flags&&(T[0]=255&z,T[1]=z>>>8&255,b.check=l(b.check,T,2,0)),$=z=0,b.mode=5;case 5:if(1024&b.flags){for(;$<16;){if(I===0)break e;I--,z+=V[B++]<<$,$+=8}b.length=z,b.head&&(b.head.extra_len=z),512&b.flags&&(T[0]=255&z,T[1]=z>>>8&255,b.check=l(b.check,T,2,0)),$=z=0}else b.head&&(b.head.extra=null);b.mode=6;case 6:if(1024&b.flags&&(I<(se=b.length)&&(se=I),se&&(b.head&&(k=b.head.extra_len-b.length,b.head.extra||(b.head.extra=new Array(b.head.extra_len)),o.arraySet(b.head.extra,V,B,se,k)),512&b.flags&&(b.check=l(b.check,V,se,B)),I-=se,B+=se,b.length-=se),b.length))break e;b.length=0,b.mode=7;case 7:if(2048&b.flags){if(I===0)break e;for(se=0;k=V[B+se++],b.head&&k&&b.length<65536&&(b.head.name+=String.fromCharCode(k)),k&&se>9&1,b.head.done=!0),N.adler=b.check=0,b.mode=12;break;case 10:for(;$<32;){if(I===0)break e;I--,z+=V[B++]<<$,$+=8}N.adler=b.check=p(z),$=z=0,b.mode=11;case 11:if(b.havedict===0)return N.next_out=K,N.avail_out=Q,N.next_in=B,N.avail_in=I,b.hold=z,b.bits=$,2;N.adler=b.check=1,b.mode=12;case 12:if(F===5||F===6)break e;case 13:if(b.last){z>>>=7&$,$-=7&$,b.mode=27;break}for(;$<3;){if(I===0)break e;I--,z+=V[B++]<<$,$+=8}switch(b.last=1&z,$-=1,3&(z>>>=1)){case 0:b.mode=14;break;case 1:if(L(b),b.mode=20,F!==6)break;z>>>=2,$-=2;break e;case 2:b.mode=17;break;case 3:N.msg="invalid block type",b.mode=30}z>>>=2,$-=2;break;case 14:for(z>>>=7&$,$-=7&$;$<32;){if(I===0)break e;I--,z+=V[B++]<<$,$+=8}if((65535&z)!=(z>>>16^65535)){N.msg="invalid stored block lengths",b.mode=30;break}if(b.length=65535&z,$=z=0,b.mode=15,F===6)break e;case 15:b.mode=16;case 16:if(se=b.length){if(I>>=5,$-=5,b.ndist=1+(31&z),z>>>=5,$-=5,b.ncode=4+(15&z),z>>>=4,$-=4,286>>=3,$-=3}for(;b.have<19;)b.lens[O[b.have++]]=0;if(b.lencode=b.lendyn,b.lenbits=7,G={bits:b.lenbits},J=u(0,b.lens,0,19,b.lencode,0,b.work,G),b.lenbits=G.bits,J){N.msg="invalid code lengths set",b.mode=30;break}b.have=0,b.mode=19;case 19:for(;b.have>>16&255,Fe=65535&S,!((xe=S>>>24)<=$);){if(I===0)break e;I--,z+=V[B++]<<$,$+=8}if(Fe<16)z>>>=xe,$-=xe,b.lens[b.have++]=Fe;else{if(Fe===16){for(D=xe+2;$>>=xe,$-=xe,b.have===0){N.msg="invalid bit length repeat",b.mode=30;break}k=b.lens[b.have-1],se=3+(3&z),z>>>=2,$-=2}else if(Fe===17){for(D=xe+3;$>>=xe)),z>>>=3,$-=3}else{for(D=xe+7;$>>=xe)),z>>>=7,$-=7}if(b.have+se>b.nlen+b.ndist){N.msg="invalid bit length repeat",b.mode=30;break}for(;se--;)b.lens[b.have++]=k}}if(b.mode===30)break;if(b.lens[256]===0){N.msg="invalid code -- missing end-of-block",b.mode=30;break}if(b.lenbits=9,G={bits:b.lenbits},J=u(d,b.lens,0,b.nlen,b.lencode,0,b.work,G),b.lenbits=G.bits,J){N.msg="invalid literal/lengths set",b.mode=30;break}if(b.distbits=6,b.distcode=b.distdyn,G={bits:b.distbits},J=u(f,b.lens,b.nlen,b.ndist,b.distcode,0,b.work,G),b.distbits=G.bits,J){N.msg="invalid distances set",b.mode=30;break}if(b.mode=20,F===6)break e;case 20:b.mode=21;case 21:if(6<=I&&258<=Q){N.next_out=K,N.avail_out=Q,N.next_in=B,N.avail_in=I,b.hold=z,b.bits=$,c(N,ne),K=N.next_out,te=N.output,Q=N.avail_out,B=N.next_in,V=N.input,I=N.avail_in,z=b.hold,$=b.bits,b.mode===12&&(b.back=-1);break}for(b.back=0;Te=(S=b.lencode[z&(1<>>16&255,Fe=65535&S,!((xe=S>>>24)<=$);){if(I===0)break e;I--,z+=V[B++]<<$,$+=8}if(Te&&!(240&Te)){for(Me=xe,Pe=Te,nt=Fe;Te=(S=b.lencode[nt+((z&(1<>Me)])>>>16&255,Fe=65535&S,!(Me+(xe=S>>>24)<=$);){if(I===0)break e;I--,z+=V[B++]<<$,$+=8}z>>>=Me,$-=Me,b.back+=Me}if(z>>>=xe,$-=xe,b.back+=xe,b.length=Fe,Te===0){b.mode=26;break}if(32&Te){b.back=-1,b.mode=12;break}if(64&Te){N.msg="invalid literal/length code",b.mode=30;break}b.extra=15&Te,b.mode=22;case 22:if(b.extra){for(D=b.extra;$>>=b.extra,$-=b.extra,b.back+=b.extra}b.was=b.length,b.mode=23;case 23:for(;Te=(S=b.distcode[z&(1<>>16&255,Fe=65535&S,!((xe=S>>>24)<=$);){if(I===0)break e;I--,z+=V[B++]<<$,$+=8}if(!(240&Te)){for(Me=xe,Pe=Te,nt=Fe;Te=(S=b.distcode[nt+((z&(1<>Me)])>>>16&255,Fe=65535&S,!(Me+(xe=S>>>24)<=$);){if(I===0)break e;I--,z+=V[B++]<<$,$+=8}z>>>=Me,$-=Me,b.back+=Me}if(z>>>=xe,$-=xe,b.back+=xe,64&Te){N.msg="invalid distance code",b.mode=30;break}b.offset=Fe,b.extra=15&Te,b.mode=24;case 24:if(b.extra){for(D=b.extra;$>>=b.extra,$-=b.extra,b.back+=b.extra}if(b.offset>b.dmax){N.msg="invalid distance too far back",b.mode=30;break}b.mode=25;case 25:if(Q===0)break e;if(se=ne-Q,b.offset>se){if((se=b.offset-se)>b.whave&&b.sane){N.msg="invalid distance too far back",b.mode=30;break}Oe=se>b.wnext?(se-=b.wnext,b.wsize-se):b.wnext-se,se>b.length&&(se=b.length),pe=b.window}else pe=te,Oe=K-b.offset,se=b.length;for(QR?(A=Oe[pe+_[F]],$[he+_[F]]):(A=96,0),h=1<>K)+(w-=h)]=P<<24|A<<16|L|0,w!==0;);for(h=1<>=1;if(h!==0?(z&=h-1,z+=h):z=0,F++,--ne[N]==0){if(N===V)break;N=f[m+_[F]]}if(te>>7)]}function he(S,T){S.pending_buf[S.pending++]=255&T,S.pending_buf[S.pending++]=T>>>8&255}function ne(S,T,O){S.bi_valid>p-O?(S.bi_buf|=T<>p-S.bi_valid,S.bi_valid+=O-p):(S.bi_buf|=T<>>=1,O<<=1,0<--T;);return O>>>1}function pe(S,T,O){var Y,M,H=new Array(_+1),X=0;for(Y=1;Y<=_;Y++)H[Y]=X=X+O[Y-1]<<1;for(M=0;M<=T;M++){var ee=S[2*M+1];ee!==0&&(S[2*M]=Oe(H[ee]++,ee))}}function xe(S){var T;for(T=0;T>1;1<=O;O--)Me(S,H,O);for(M=me;O=S.heap[1],S.heap[1]=S.heap[S.heap_len--],Me(S,H,1),Y=S.heap[1],S.heap[--S.heap_max]=O,S.heap[--S.heap_max]=Y,H[2*M]=H[2*O]+H[2*Y],S.depth[M]=(S.depth[O]>=S.depth[Y]?S.depth[O]:S.depth[Y])+1,H[2*O+1]=H[2*Y+1]=M,S.heap[1]=M++,Me(S,H,1),2<=S.heap_len;);S.heap[--S.heap_max]=S.heap[1],function(Ue,jt){var qr,Ht,Qn,at,Jn,es,Xr=jt.dyn_tree,Vc=jt.max_code,Bc=jt.stat_desc.static_tree,gi=jt.stat_desc.has_stree,Wc=jt.stat_desc.extra_bits,vi=jt.stat_desc.extra_base,An=jt.stat_desc.max_length,Us=0;for(at=0;at<=_;at++)Ue.bl_count[at]=0;for(Xr[2*Ue.heap[Ue.heap_max]+1]=0,qr=Ue.heap_max+1;qr>=7;M>>=1)if(1&Ye&&ee.dyn_ltree[2*me]!==0)return i;if(ee.dyn_ltree[18]!==0||ee.dyn_ltree[20]!==0||ee.dyn_ltree[26]!==0)return l;for(me=32;me>>3,(H=S.static_len+3+7>>>3)<=M&&(M=H)):M=H=O+5,O+4<=M&&T!==-1?D(S,T,O,Y):S.strategy===4||H===M?(ne(S,2+(Y?1:0),3),Pe(S,q,N)):(ne(S,4+(Y?1:0),3),function(ee,me,Ye,Ue){var jt;for(ne(ee,me-257,5),ne(ee,Ye-1,5),ne(ee,Ue-4,4),jt=0;jt>>8&255,S.pending_buf[S.d_buf+2*S.last_lit+1]=255&T,S.pending_buf[S.l_buf+S.last_lit]=255&O,S.last_lit++,T===0?S.dyn_ltree[2*O]++:(S.matches++,T--,S.dyn_ltree[2*(b[O]+f+1)]++,S.dyn_dtree[2*$(T)]++),S.last_lit===S.lit_bufsize-1},s._tr_align=function(S){ne(S,2,3),se(S,w,q),function(T){T.bi_valid===16?(he(T,T.bi_buf),T.bi_buf=0,T.bi_valid=0):8<=T.bi_valid&&(T.pending_buf[T.pending++]=255&T.bi_buf,T.bi_buf>>=8,T.bi_valid-=8)}(S)}},{"../utils/common":41}],53:[function(r,n,s){n.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(r,n,s){(function(o){(function(i,l){if(!i.setImmediate){var c,u,d,f,m=1,v={},x=!1,y=i.document,_=Object.getPrototypeOf&&Object.getPrototypeOf(i);_=_&&_.setTimeout?_:i,c={}.toString.call(i.process)==="[object process]"?function(C){process.nextTick(function(){h(C)})}:function(){if(i.postMessage&&!i.importScripts){var C=!0,j=i.onmessage;return i.onmessage=function(){C=!1},i.postMessage("","*"),i.onmessage=j,C}}()?(f="setImmediate$"+Math.random()+"$",i.addEventListener?i.addEventListener("message",w,!1):i.attachEvent("onmessage",w),function(C){i.postMessage(f+C,"*")}):i.MessageChannel?((d=new MessageChannel).port1.onmessage=function(C){h(C.data)},function(C){d.port2.postMessage(C)}):y&&"onreadystatechange"in y.createElement("script")?(u=y.documentElement,function(C){var j=y.createElement("script");j.onreadystatechange=function(){h(C),j.onreadystatechange=null,u.removeChild(j),j=null},u.appendChild(j)}):function(C){setTimeout(h,0,C)},_.setImmediate=function(C){typeof C!="function"&&(C=new Function(""+C));for(var j=new Array(arguments.length-1),E=0;E"u"?o===void 0?this:o:self)}).call(this,typeof Zc<"u"?Zc:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(jj);var uz=jj.exports;const dz=Fm(uz);function fz(e){return new Promise((t,r)=>{const n=new FileReader;n.onload=()=>{n.result?t(n.result.toString()):r("No content found")},n.onerror=()=>r(n.error),n.readAsText(e)})}const hz=async(e,t)=>{const r=new dz;t.forEach(o=>{r.file(o.name,o.content)});const n=await r.generateAsync({type:"blob"}),s=document.createElement("a");s.href=URL.createObjectURL(n),s.download=e,s.click()},ya=e=>{const t=new Date(e);return new Intl.DateTimeFormat("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1,timeZone:"Asia/Shanghai"}).format(t)},pz=e=>ya(e).split(" ")[0];function Ej(e){const t=new Date;t.setUTCDate(t.getUTCDate()+e);const r=t.getUTCFullYear(),n=String(t.getUTCMonth()+1).padStart(2,"0"),s=String(t.getUTCDate()).padStart(2,"0"),o=String(t.getUTCHours()).padStart(2,"0"),i=String(t.getUTCMinutes()).padStart(2,"0"),l=String(t.getUTCSeconds()).padStart(2,"0");return`${r}-${n}-${s} ${o}:${i}:${l}`}const mz=async e=>{let t=1;e.page&&(t=e.page);let r=2;e.perPage&&(r=e.perPage);const n=st();let s="";return e.state==="enabled"?s="enabled=true":e.state==="disabled"?s="enabled=false":e.state==="expired"&&(s=n.filter("expiredAt<{:expiredAt}",{expiredAt:Ej(15)})),n.collection("domains").getList(t,r,{sort:"-created",expand:"lastDeployment",filter:s})},gz=async()=>{const e=st(),t=await e.collection("domains").getList(1,1,{}),r=await e.collection("domains").getList(1,1,{filter:e.filter("expiredAt<{:expiredAt}",{expiredAt:Ej(15)})}),n=await e.collection("domains").getList(1,1,{filter:"enabled=true"}),s=await e.collection("domains").getList(1,1,{filter:"enabled=false"});return{total:t.totalItems,expired:r.totalItems,enabled:n.totalItems,disabled:s.totalItems}},vz=async e=>await st().collection("domains").getOne(e),km=async e=>e.id?await st().collection("domains").update(e.id,e):await st().collection("domains").create(e),yz=async e=>await st().collection("domains").delete(e),xz=(e,t)=>st().collection("domains").subscribe(e,r=>{r.action==="update"&&t(r.record)},{expand:"lastDeployment"}),wz=e=>{st().collection("domains").unsubscribe(e)},_z=()=>{const e=Pn(),t=Pr(),r=Nn(),n=new URLSearchParams(r.search),s=n.get("page"),o=n.get("state"),[i,l]=g.useState(0),c=()=>{t("/edit")},u=w=>{n.set("page",w.toString()),t(`?${n.toString()}`)},d=w=>{t(`/edit?id=${w}`)},f=w=>{t(`/history?domain=${w}`)},m=async w=>{try{await yz(w),x(v.filter(C=>C.id!==w))}catch(C){console.error("Error deleting domain:",C)}},[v,x]=g.useState([]);g.useEffect(()=>{(async()=>{const C=await mz({page:s?Number(s):1,perPage:10,state:o||""});x(C.items),l(C.totalPages)})()},[s,o]);const y=async w=>{const C=v.filter(P=>P.id===w),j=C[0].enabled,E=C[0];E.enabled=!j,await km(E);const R=v.map(P=>P.id===w?{...P,checked:!j}:P);x(R)},_=async w=>{try{wz(w.id),xz(w.id,C=>{console.log(C);const j=v.map(E=>E.id===C.id?{...C}:E);x(j)}),w.rightnow=!0,await km(w),e.toast({title:"操作成功",description:"已发起部署,请稍后查看部署日志。"})}catch{e.toast({title:"执行失败",description:a.jsxs(a.Fragment,{children:["执行失败,请查看",a.jsx(gr,{to:`/history?domain=${w.id}`,className:"underline text-blue-500",children:"部署日志"}),"查看详情。"]}),variant:"destructive"})}},p=async w=>{await _({...w,deployed:!1})},h=async w=>{const C=`${w.id}-${w.domain}.zip`,j=[{name:`${w.domain}.pem`,content:w.certificate?w.certificate:""},{name:`${w.domain}.key`,content:w.privateKey?w.privateKey:""}];await hz(C,j)};return a.jsx(a.Fragment,{children:a.jsxs("div",{className:"",children:[a.jsx(hy,{}),a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("div",{className:"text-muted-foreground",children:"域名列表"}),a.jsx(He,{onClick:c,children:"新增域名"})]}),v.length?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"hidden sm:flex sm:flex-row text-muted-foreground text-sm border-b dark:border-stone-500 sm:p-2 mt-5",children:[a.jsx("div",{className:"w-36",children:"域名"}),a.jsx("div",{className:"w-40",children:"有效期限"}),a.jsx("div",{className:"w-32",children:"最近执行状态"}),a.jsx("div",{className:"w-64",children:"最近执行阶段"}),a.jsx("div",{className:"w-40 sm:ml-2",children:"最近执行时间"}),a.jsx("div",{className:"w-24",children:"是否启用"}),a.jsx("div",{className:"grow",children:"操作"})]}),a.jsx("div",{className:"sm:hidden flex text-sm text-muted-foreground",children:"域名"}),v.map(w=>{var C,j,E,R;return a.jsxs("div",{className:"flex flex-col sm:flex-row text-secondary-foreground border-b dark:border-stone-500 sm:p-2 hover:bg-muted/50 text-sm",children:[a.jsx("div",{className:"sm:w-36 w-full pt-1 sm:pt-0 flex items-center",children:w.domain}),a.jsx("div",{className:"sm:w-40 w-full pt-1 sm:pt-0 flex items-center",children:a.jsx("div",{children:w.expiredAt?a.jsxs(a.Fragment,{children:[a.jsx("div",{children:"有效期90天"}),a.jsxs("div",{children:[pz(w.expiredAt),"到期"]})]}):"---"})}),a.jsx("div",{className:"sm:w-32 w-full pt-1 sm:pt-0 flex items-center",children:w.lastDeployedAt&&((C=w.expand)!=null&&C.lastDeployment)?a.jsx(a.Fragment,{children:a.jsx(ey,{deployment:w.expand.lastDeployment})}):"---"}),a.jsx("div",{className:"sm:w-64 w-full pt-1 sm:pt-0 flex items-center",children:w.lastDeployedAt&&((j=w.expand)!=null&&j.lastDeployment)?a.jsx(qv,{phase:(E=w.expand.lastDeployment)==null?void 0:E.phase,phaseSuccess:(R=w.expand.lastDeployment)==null?void 0:R.phaseSuccess}):"---"}),a.jsx("div",{className:"sm:w-40 pt-1 sm:pt-0 sm:ml-2 flex items-center",children:w.lastDeployedAt?ya(w.lastDeployedAt):"---"}),a.jsx("div",{className:"sm:w-24 flex items-center",children:a.jsx(Qv,{children:a.jsxs(_C,{children:[a.jsx(bC,{children:a.jsx(Fc,{checked:w.enabled,onCheckedChange:()=>{y(w.id)}})}),a.jsx(Jv,{children:a.jsx("div",{className:"border rounded-sm px-3 bg-background text-muted-foreground text-xs",children:w.enabled?"禁用":"启用"})})]})})}),a.jsxs("div",{className:"flex items-center grow justify-start pt-1 sm:pt-0",children:[a.jsx(He,{variant:"link",className:"p-0",onClick:()=>f(w.id),children:"部署历史"}),a.jsxs(ia,{when:!!w.enabled,children:[a.jsx(Bt,{orientation:"vertical",className:"h-4 mx-2"}),a.jsx(He,{variant:"link",className:"p-0",onClick:()=>_(w),children:"立即部署"})]}),a.jsxs(ia,{when:!!(w.enabled&&w.deployed),children:[a.jsx(Bt,{orientation:"vertical",className:"h-4 mx-2"}),a.jsx(He,{variant:"link",className:"p-0",onClick:()=>p(w),children:"强行部署"})]}),a.jsxs(ia,{when:!!w.expiredAt,children:[a.jsx(Bt,{orientation:"vertical",className:"h-4 mx-2"}),a.jsx(He,{variant:"link",className:"p-0",onClick:()=>h(w),children:"下载"})]}),!w.enabled&&a.jsxs(a.Fragment,{children:[a.jsx(Bt,{orientation:"vertical",className:"h-4 mx-2"}),a.jsxs(GC,{children:[a.jsx(ZC,{asChild:!0,children:a.jsx(He,{variant:"link",className:"p-0",children:"删除"})}),a.jsxs(ty,{children:[a.jsxs(ry,{children:[a.jsx(sy,{children:"删除域名"}),a.jsx(oy,{children:"确定要删除域名吗?"})]}),a.jsxs(ny,{children:[a.jsx(ay,{children:"取消"}),a.jsx(iy,{onClick:()=>{m(w.id)},children:"确认"})]})]})]}),a.jsx(Bt,{orientation:"vertical",className:"h-4 mx-2"}),a.jsx(He,{variant:"link",className:"p-0",onClick:()=>d(w.id),children:"编辑"})]})]})]},w.id)}),a.jsx(NC,{totalPages:i,currentPage:s?Number(s):1,onPageChange:w=>{u(w)}})]}):a.jsx(a.Fragment,{children:a.jsxs("div",{className:"flex flex-col items-center mt-10",children:[a.jsx("span",{className:"bg-orange-100 p-5 rounded-full",children:a.jsx(rm,{size:40,className:"text-primary"})}),a.jsx("div",{className:"text-center text-sm text-muted-foreground mt-3",children:"请添加域名开始部署证书吧。"}),a.jsx(He,{onClick:c,className:"mt-3",children:"添加域名"})]})})]})})},Ne=g.forwardRef(({className:e,type:t,...r},n)=>a.jsx("input",{type:t,className:oe("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...r}));Ne.displayName="Input";var zc=e=>e.type==="checkbox",Wi=e=>e instanceof Date,yr=e=>e==null;const Nj=e=>typeof e=="object";var qt=e=>!yr(e)&&!Array.isArray(e)&&Nj(e)&&!Wi(e),Tj=e=>qt(e)&&e.target?zc(e.target)?e.target.checked:e.target.value:e,bz=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,Rj=(e,t)=>e.has(bz(t)),Sz=e=>{const t=e.constructor&&e.constructor.prototype;return qt(t)&&t.hasOwnProperty("isPrototypeOf")},py=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Cr(e){let t;const r=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(py&&(e instanceof Blob||e instanceof FileList))&&(r||qt(e)))if(t=r?[]:{},!r&&!Sz(e))t=e;else for(const n in e)e.hasOwnProperty(n)&&(t[n]=Cr(e[n]));else return e;return t}var Gf=e=>Array.isArray(e)?e.filter(Boolean):[],Ft=e=>e===void 0,de=(e,t,r)=>{if(!t||!qt(e))return r;const n=Gf(t.split(/[,[\].]+?/)).reduce((s,o)=>yr(s)?s:s[o],e);return Ft(n)||n===e?Ft(e[t])?r:e[t]:n},zn=e=>typeof e=="boolean",my=e=>/^\w*$/.test(e),Pj=e=>Gf(e.replace(/["|']|\]/g,"").split(/\.|\[/)),ft=(e,t,r)=>{let n=-1;const s=my(t)?[t]:Pj(t),o=s.length,i=o-1;for(;++nBe.useContext(Aj),kz=e=>{const{children:t,...r}=e;return Be.createElement(Aj.Provider,{value:r},t)};var Dj=(e,t,r,n=!0)=>{const s={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(s,o,{get:()=>{const i=o;return t._proxyFormState[i]!==gn.all&&(t._proxyFormState[i]=!n||gn.all),r&&(r[i]=!0),e[i]}});return s},Mr=e=>qt(e)&&!Object.keys(e).length,Oj=(e,t,r,n)=>{r(e);const{name:s,...o}=e;return Mr(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(i=>t[i]===(!n||gn.all))},El=e=>Array.isArray(e)?e:[e],Mj=(e,t,r)=>!e||!t||e===t||El(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n)));function gy(e){const t=Be.useRef(e);t.current=e,Be.useEffect(()=>{const r=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{r&&r.unsubscribe()}},[e.disabled])}function Cz(e){const t=Zf(),{control:r=t.control,disabled:n,name:s,exact:o}=e||{},[i,l]=Be.useState(r._formState),c=Be.useRef(!0),u=Be.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),d=Be.useRef(s);return d.current=s,gy({disabled:n,next:f=>c.current&&Mj(d.current,f.name,o)&&Oj(f,u.current,r._updateFormState)&&l({...r._formState,...f}),subject:r._subjects.state}),Be.useEffect(()=>(c.current=!0,u.current.isValid&&r._updateValid(!0),()=>{c.current=!1}),[r]),Dj(i,r,u.current,!1)}var $n=e=>typeof e=="string",Ij=(e,t,r,n,s)=>$n(e)?(n&&t.watch.add(e),de(r,e,s)):Array.isArray(e)?e.map(o=>(n&&t.watch.add(o),de(r,o))):(n&&(t.watchAll=!0),r);function jz(e){const t=Zf(),{control:r=t.control,name:n,defaultValue:s,disabled:o,exact:i}=e||{},l=Be.useRef(n);l.current=n,gy({disabled:o,subject:r._subjects.values,next:d=>{Mj(l.current,d.name,i)&&u(Cr(Ij(l.current,r._names,d.values||r._formValues,!1,s)))}});const[c,u]=Be.useState(r._getWatch(n,s));return Be.useEffect(()=>r._removeUnmounted()),c}function Ez(e){const t=Zf(),{name:r,disabled:n,control:s=t.control,shouldUnregister:o}=e,i=Rj(s._names.array,r),l=jz({control:s,name:r,defaultValue:de(s._formValues,r,de(s._defaultValues,r,e.defaultValue)),exact:!0}),c=Cz({control:s,name:r}),u=Be.useRef(s.register(r,{...e.rules,value:l,...zn(e.disabled)?{disabled:e.disabled}:{}}));return Be.useEffect(()=>{const d=s._options.shouldUnregister||o,f=(m,v)=>{const x=de(s._fields,m);x&&x._f&&(x._f.mount=v)};if(f(r,!0),d){const m=Cr(de(s._options.defaultValues,r));ft(s._defaultValues,r,m),Ft(de(s._formValues,r))&&ft(s._formValues,r,m)}return()=>{(i?d&&!s._state.action:d)?s.unregister(r):f(r,!1)}},[r,s,i,o]),Be.useEffect(()=>{de(s._fields,r)&&s._updateDisabledField({disabled:n,fields:s._fields,name:r,value:de(s._fields,r)._f.value})},[n,r,s]),{field:{name:r,value:l,...zn(n)||c.disabled?{disabled:c.disabled||n}:{},onChange:Be.useCallback(d=>u.current.onChange({target:{value:Tj(d),name:r},type:Md.CHANGE}),[r]),onBlur:Be.useCallback(()=>u.current.onBlur({target:{value:de(s._formValues,r),name:r},type:Md.BLUR}),[r,s]),ref:d=>{const f=de(s._fields,r);f&&d&&(f._f.ref={focus:()=>d.focus(),select:()=>d.select(),setCustomValidity:m=>d.setCustomValidity(m),reportValidity:()=>d.reportValidity()})}},formState:c,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!de(c.errors,r)},isDirty:{enumerable:!0,get:()=>!!de(c.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!de(c.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!de(c.validatingFields,r)},error:{enumerable:!0,get:()=>de(c.errors,r)}})}}const Nz=e=>e.render(Ez(e));var Lj=(e,t,r,n,s)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:s||!0}}:{},mw=e=>({isOnSubmit:!e||e===gn.onSubmit,isOnBlur:e===gn.onBlur,isOnChange:e===gn.onChange,isOnAll:e===gn.all,isOnTouch:e===gn.onTouched}),gw=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const Nl=(e,t,r,n)=>{for(const s of r||Object.keys(e)){const o=de(e,s);if(o){const{_f:i,...l}=o;if(i){if(i.refs&&i.refs[0]&&t(i.refs[0],s)&&!n)break;if(i.ref&&t(i.ref,i.name)&&!n)break;Nl(l,t)}else qt(l)&&Nl(l,t)}}};var Tz=(e,t,r)=>{const n=El(de(e,r));return ft(n,"root",t[r]),ft(e,r,n),e},vy=e=>e.type==="file",so=e=>typeof e=="function",Id=e=>{if(!py)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Zu=e=>$n(e),yy=e=>e.type==="radio",Ld=e=>e instanceof RegExp;const vw={value:!1,isValid:!1},yw={value:!0,isValid:!0};var Fj=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Ft(e[0].attributes.value)?Ft(e[0].value)||e[0].value===""?yw:{value:e[0].value,isValid:!0}:yw:vw}return vw};const xw={isValid:!1,value:null};var zj=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,xw):xw;function ww(e,t,r="validate"){if(Zu(e)||Array.isArray(e)&&e.every(Zu)||zn(e)&&!e)return{type:r,message:Zu(e)?e:"",ref:t}}var Ei=e=>qt(e)&&!Ld(e)?e:{value:e,message:""},_w=async(e,t,r,n,s)=>{const{ref:o,refs:i,required:l,maxLength:c,minLength:u,min:d,max:f,pattern:m,validate:v,name:x,valueAsNumber:y,mount:_,disabled:p}=e._f,h=de(t,x);if(!_||p)return{};const w=i?i[0]:o,C=N=>{n&&w.reportValidity&&(w.setCustomValidity(zn(N)?"":N||""),w.reportValidity())},j={},E=yy(o),R=zc(o),P=E||R,A=(y||vy(o))&&Ft(o.value)&&Ft(h)||Id(o)&&o.value===""||h===""||Array.isArray(h)&&!h.length,L=Lj.bind(null,x,r,j),q=(N,F,b,V=ss.maxLength,te=ss.minLength)=>{const B=N?F:b;j[x]={type:N?V:te,message:B,ref:o,...L(N?V:te,B)}};if(s?!Array.isArray(h)||!h.length:l&&(!P&&(A||yr(h))||zn(h)&&!h||R&&!Fj(i).isValid||E&&!zj(i).isValid)){const{value:N,message:F}=Zu(l)?{value:!!l,message:l}:Ei(l);if(N&&(j[x]={type:ss.required,message:F,ref:w,...L(ss.required,F)},!r))return C(F),j}if(!A&&(!yr(d)||!yr(f))){let N,F;const b=Ei(f),V=Ei(d);if(!yr(h)&&!isNaN(h)){const te=o.valueAsNumber||h&&+h;yr(b.value)||(N=te>b.value),yr(V.value)||(F=tenew Date(new Date().toDateString()+" "+Q),K=o.type=="time",I=o.type=="week";$n(b.value)&&h&&(N=K?B(h)>B(b.value):I?h>b.value:te>new Date(b.value)),$n(V.value)&&h&&(F=K?B(h)+N.value,V=!yr(F.value)&&h.length<+F.value;if((b||V)&&(q(b,N.message,F.message),!r))return C(j[x].message),j}if(m&&!A&&$n(h)){const{value:N,message:F}=Ei(m);if(Ld(N)&&!h.match(N)&&(j[x]={type:ss.pattern,message:F,ref:o,...L(ss.pattern,F)},!r))return C(F),j}if(v){if(so(v)){const N=await v(h,t),F=ww(N,w);if(F&&(j[x]={...F,...L(ss.validate,F.message)},!r))return C(F.message),j}else if(qt(v)){let N={};for(const F in v){if(!Mr(N)&&!r)break;const b=ww(await v[F](h,t),w,F);b&&(N={...b,...L(F,b.message)},C(b.message),r&&(j[x]=N))}if(!Mr(N)&&(j[x]={ref:w,...N},!r))return j}}return C(!0),j};function Rz(e,t){const r=t.slice(0,-1).length;let n=0;for(;n{let e=[];return{get observers(){return e},next:s=>{for(const o of e)o.next&&o.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(o=>o!==s)}}),unsubscribe:()=>{e=[]}}},Fd=e=>yr(e)||!Nj(e);function Ho(e,t){if(Fd(e)||Fd(t))return e===t;if(Wi(e)&&Wi(t))return e.getTime()===t.getTime();const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(const s of r){const o=e[s];if(!n.includes(s))return!1;if(s!=="ref"){const i=t[s];if(Wi(o)&&Wi(i)||qt(o)&&qt(i)||Array.isArray(o)&&Array.isArray(i)?!Ho(o,i):o!==i)return!1}}return!0}var Uj=e=>e.type==="select-multiple",Az=e=>yy(e)||zc(e),np=e=>Id(e)&&e.isConnected,$j=e=>{for(const t in e)if(so(e[t]))return!0;return!1};function zd(e,t={}){const r=Array.isArray(e);if(qt(e)||r)for(const n in e)Array.isArray(e[n])||qt(e[n])&&!$j(e[n])?(t[n]=Array.isArray(e[n])?[]:{},zd(e[n],t[n])):yr(e[n])||(t[n]=!0);return t}function Vj(e,t,r){const n=Array.isArray(e);if(qt(e)||n)for(const s in e)Array.isArray(e[s])||qt(e[s])&&!$j(e[s])?Ft(t)||Fd(r[s])?r[s]=Array.isArray(e[s])?zd(e[s],[]):{...zd(e[s])}:Vj(e[s],yr(t)?{}:t[s],r[s]):r[s]=!Ho(e[s],t[s]);return r}var ju=(e,t)=>Vj(e,t,zd(t)),Bj=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Ft(e)?e:t?e===""?NaN:e&&+e:r&&$n(e)?new Date(e):n?n(e):e;function sp(e){const t=e.ref;if(!(e.refs?e.refs.every(r=>r.disabled):t.disabled))return vy(t)?t.files:yy(t)?zj(e.refs).value:Uj(t)?[...t.selectedOptions].map(({value:r})=>r):zc(t)?Fj(e.refs).value:Bj(Ft(t.value)?e.ref.value:t.value,e)}var Dz=(e,t,r,n)=>{const s={};for(const o of e){const i=de(t,o);i&&ft(s,o,i._f)}return{criteriaMode:r,names:[...e],fields:s,shouldUseNativeValidation:n}},rl=e=>Ft(e)?e:Ld(e)?e.source:qt(e)?Ld(e.value)?e.value.source:e.value:e,Oz=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function bw(e,t,r){const n=de(e,r);if(n||my(r))return{error:n,name:r};const s=r.split(".");for(;s.length;){const o=s.join("."),i=de(t,o),l=de(e,o);if(i&&!Array.isArray(i)&&r!==o)return{name:r};if(l&&l.type)return{name:o,error:l};s.pop()}return{name:r}}var Mz=(e,t,r,n,s)=>s.isOnAll?!1:!r&&s.isOnTouch?!(t||e):(r?n.isOnBlur:s.isOnBlur)?!e:(r?n.isOnChange:s.isOnChange)?e:!0,Iz=(e,t)=>!Gf(de(e,t)).length&&Yt(e,t);const Lz={mode:gn.onSubmit,reValidateMode:gn.onChange,shouldFocusError:!0};function Fz(e={}){let t={...Lz,...e},r={submitCount:0,isDirty:!1,isLoading:so(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},n={},s=qt(t.defaultValues)||qt(t.values)?Cr(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:Cr(s),i={action:!1,mount:!1,watch:!1},l={mount:new Set,unMount:new Set,array:new Set,watch:new Set},c,u=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},f={values:rp(),array:rp(),state:rp()},m=mw(t.mode),v=mw(t.reValidateMode),x=t.criteriaMode===gn.all,y=S=>T=>{clearTimeout(u),u=setTimeout(S,T)},_=async S=>{if(d.isValid||S){const T=t.resolver?Mr((await P()).errors):await L(n,!0);T!==r.isValid&&f.state.next({isValid:T})}},p=(S,T)=>{(d.isValidating||d.validatingFields)&&((S||Array.from(l.mount)).forEach(O=>{O&&(T?ft(r.validatingFields,O,T):Yt(r.validatingFields,O))}),f.state.next({validatingFields:r.validatingFields,isValidating:!Mr(r.validatingFields)}))},h=(S,T=[],O,Y,M=!0,H=!0)=>{if(Y&&O){if(i.action=!0,H&&Array.isArray(de(n,S))){const X=O(de(n,S),Y.argA,Y.argB);M&&ft(n,S,X)}if(H&&Array.isArray(de(r.errors,S))){const X=O(de(r.errors,S),Y.argA,Y.argB);M&&ft(r.errors,S,X),Iz(r.errors,S)}if(d.touchedFields&&H&&Array.isArray(de(r.touchedFields,S))){const X=O(de(r.touchedFields,S),Y.argA,Y.argB);M&&ft(r.touchedFields,S,X)}d.dirtyFields&&(r.dirtyFields=ju(s,o)),f.state.next({name:S,isDirty:N(S,T),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else ft(o,S,T)},w=(S,T)=>{ft(r.errors,S,T),f.state.next({errors:r.errors})},C=S=>{r.errors=S,f.state.next({errors:r.errors,isValid:!1})},j=(S,T,O,Y)=>{const M=de(n,S);if(M){const H=de(o,S,Ft(O)?de(s,S):O);Ft(H)||Y&&Y.defaultChecked||T?ft(o,S,T?H:sp(M._f)):V(S,H),i.mount&&_()}},E=(S,T,O,Y,M)=>{let H=!1,X=!1;const ee={name:S},me=!!(de(n,S)&&de(n,S)._f&&de(n,S)._f.disabled);if(!O||Y){d.isDirty&&(X=r.isDirty,r.isDirty=ee.isDirty=N(),H=X!==ee.isDirty);const Ye=me||Ho(de(s,S),T);X=!!(!me&&de(r.dirtyFields,S)),Ye||me?Yt(r.dirtyFields,S):ft(r.dirtyFields,S,!0),ee.dirtyFields=r.dirtyFields,H=H||d.dirtyFields&&X!==!Ye}if(O){const Ye=de(r.touchedFields,S);Ye||(ft(r.touchedFields,S,O),ee.touchedFields=r.touchedFields,H=H||d.touchedFields&&Ye!==O)}return H&&M&&f.state.next(ee),H?ee:{}},R=(S,T,O,Y)=>{const M=de(r.errors,S),H=d.isValid&&zn(T)&&r.isValid!==T;if(e.delayError&&O?(c=y(()=>w(S,O)),c(e.delayError)):(clearTimeout(u),c=null,O?ft(r.errors,S,O):Yt(r.errors,S)),(O?!Ho(M,O):M)||!Mr(Y)||H){const X={...Y,...H&&zn(T)?{isValid:T}:{},errors:r.errors,name:S};r={...r,...X},f.state.next(X)}},P=async S=>{p(S,!0);const T=await t.resolver(o,t.context,Dz(S||l.mount,n,t.criteriaMode,t.shouldUseNativeValidation));return p(S),T},A=async S=>{const{errors:T}=await P(S);if(S)for(const O of S){const Y=de(T,O);Y?ft(r.errors,O,Y):Yt(r.errors,O)}else r.errors=T;return T},L=async(S,T,O={valid:!0})=>{for(const Y in S){const M=S[Y];if(M){const{_f:H,...X}=M;if(H){const ee=l.array.has(H.name);p([Y],!0);const me=await _w(M,o,x,t.shouldUseNativeValidation&&!T,ee);if(p([Y]),me[H.name]&&(O.valid=!1,T))break;!T&&(de(me,H.name)?ee?Tz(r.errors,me,H.name):ft(r.errors,H.name,me[H.name]):Yt(r.errors,H.name))}X&&await L(X,T,O)}}return O.valid},q=()=>{for(const S of l.unMount){const T=de(n,S);T&&(T._f.refs?T._f.refs.every(O=>!np(O)):!np(T._f.ref))&&Oe(S)}l.unMount=new Set},N=(S,T)=>(S&&T&&ft(o,S,T),!Ho(z(),s)),F=(S,T,O)=>Ij(S,l,{...i.mount?o:Ft(T)?s:$n(S)?{[S]:T}:T},O,T),b=S=>Gf(de(i.mount?o:s,S,e.shouldUnregister?de(s,S,[]):[])),V=(S,T,O={})=>{const Y=de(n,S);let M=T;if(Y){const H=Y._f;H&&(!H.disabled&&ft(o,S,Bj(T,H)),M=Id(H.ref)&&yr(T)?"":T,Uj(H.ref)?[...H.ref.options].forEach(X=>X.selected=M.includes(X.value)):H.refs?zc(H.ref)?H.refs.length>1?H.refs.forEach(X=>(!X.defaultChecked||!X.disabled)&&(X.checked=Array.isArray(M)?!!M.find(ee=>ee===X.value):M===X.value)):H.refs[0]&&(H.refs[0].checked=!!M):H.refs.forEach(X=>X.checked=X.value===M):vy(H.ref)?H.ref.value="":(H.ref.value=M,H.ref.type||f.values.next({name:S,values:{...o}})))}(O.shouldDirty||O.shouldTouch)&&E(S,M,O.shouldTouch,O.shouldDirty,!0),O.shouldValidate&&Q(S)},te=(S,T,O)=>{for(const Y in T){const M=T[Y],H=`${S}.${Y}`,X=de(n,H);(l.array.has(S)||!Fd(M)||X&&!X._f)&&!Wi(M)?te(H,M,O):V(H,M,O)}},B=(S,T,O={})=>{const Y=de(n,S),M=l.array.has(S),H=Cr(T);ft(o,S,H),M?(f.array.next({name:S,values:{...o}}),(d.isDirty||d.dirtyFields)&&O.shouldDirty&&f.state.next({name:S,dirtyFields:ju(s,o),isDirty:N(S,H)})):Y&&!Y._f&&!yr(H)?te(S,H,O):V(S,H,O),gw(S,l)&&f.state.next({...r}),f.values.next({name:i.mount?S:void 0,values:{...o}})},K=async S=>{i.mount=!0;const T=S.target;let O=T.name,Y=!0;const M=de(n,O),H=()=>T.type?sp(M._f):Tj(S),X=ee=>{Y=Number.isNaN(ee)||ee===de(o,O,ee)};if(M){let ee,me;const Ye=H(),Ue=S.type===Md.BLUR||S.type===Md.FOCUS_OUT,jt=!Oz(M._f)&&!t.resolver&&!de(r.errors,O)&&!M._f.deps||Mz(Ue,de(r.touchedFields,O),r.isSubmitted,v,m),qr=gw(O,l,Ue);ft(o,O,Ye),Ue?(M._f.onBlur&&M._f.onBlur(S),c&&c(0)):M._f.onChange&&M._f.onChange(S);const Ht=E(O,Ye,Ue,!1),Qn=!Mr(Ht)||qr;if(!Ue&&f.values.next({name:O,type:S.type,values:{...o}}),jt)return d.isValid&&_(),Qn&&f.state.next({name:O,...qr?{}:Ht});if(!Ue&&qr&&f.state.next({...r}),t.resolver){const{errors:at}=await P([O]);if(X(Ye),Y){const Jn=bw(r.errors,n,O),es=bw(at,n,Jn.name||O);ee=es.error,O=es.name,me=Mr(at)}}else p([O],!0),ee=(await _w(M,o,x,t.shouldUseNativeValidation))[O],p([O]),X(Ye),Y&&(ee?me=!1:d.isValid&&(me=await L(n,!0)));Y&&(M._f.deps&&Q(M._f.deps),R(O,me,ee,Ht))}},I=(S,T)=>{if(de(r.errors,T)&&S.focus)return S.focus(),1},Q=async(S,T={})=>{let O,Y;const M=El(S);if(t.resolver){const H=await A(Ft(S)?S:M);O=Mr(H),Y=S?!M.some(X=>de(H,X)):O}else S?(Y=(await Promise.all(M.map(async H=>{const X=de(n,H);return await L(X&&X._f?{[H]:X}:X)}))).every(Boolean),!(!Y&&!r.isValid)&&_()):Y=O=await L(n);return f.state.next({...!$n(S)||d.isValid&&O!==r.isValid?{}:{name:S},...t.resolver||!S?{isValid:O}:{},errors:r.errors}),T.shouldFocus&&!Y&&Nl(n,I,S?M:l.mount),Y},z=S=>{const T={...i.mount?o:s};return Ft(S)?T:$n(S)?de(T,S):S.map(O=>de(T,O))},$=(S,T)=>({invalid:!!de((T||r).errors,S),isDirty:!!de((T||r).dirtyFields,S),error:de((T||r).errors,S),isValidating:!!de(r.validatingFields,S),isTouched:!!de((T||r).touchedFields,S)}),he=S=>{S&&El(S).forEach(T=>Yt(r.errors,T)),f.state.next({errors:S?r.errors:{}})},ne=(S,T,O)=>{const Y=(de(n,S,{_f:{}})._f||{}).ref,M=de(r.errors,S)||{},{ref:H,message:X,type:ee,...me}=M;ft(r.errors,S,{...me,...T,ref:Y}),f.state.next({name:S,errors:r.errors,isValid:!1}),O&&O.shouldFocus&&Y&&Y.focus&&Y.focus()},se=(S,T)=>so(S)?f.values.subscribe({next:O=>S(F(void 0,T),O)}):F(S,T,!0),Oe=(S,T={})=>{for(const O of S?El(S):l.mount)l.mount.delete(O),l.array.delete(O),T.keepValue||(Yt(n,O),Yt(o,O)),!T.keepError&&Yt(r.errors,O),!T.keepDirty&&Yt(r.dirtyFields,O),!T.keepTouched&&Yt(r.touchedFields,O),!T.keepIsValidating&&Yt(r.validatingFields,O),!t.shouldUnregister&&!T.keepDefaultValue&&Yt(s,O);f.values.next({values:{...o}}),f.state.next({...r,...T.keepDirty?{isDirty:N()}:{}}),!T.keepIsValid&&_()},pe=({disabled:S,name:T,field:O,fields:Y,value:M})=>{if(zn(S)&&i.mount||S){const H=S?void 0:Ft(M)?sp(O?O._f:de(Y,T)._f):M;ft(o,T,H),E(T,H,!1,!1,!0)}},xe=(S,T={})=>{let O=de(n,S);const Y=zn(T.disabled);return ft(n,S,{...O||{},_f:{...O&&O._f?O._f:{ref:{name:S}},name:S,mount:!0,...T}}),l.mount.add(S),O?pe({field:O,disabled:T.disabled,name:S,value:T.value}):j(S,!0,T.value),{...Y?{disabled:T.disabled}:{},...t.progressive?{required:!!T.required,min:rl(T.min),max:rl(T.max),minLength:rl(T.minLength),maxLength:rl(T.maxLength),pattern:rl(T.pattern)}:{},name:S,onChange:K,onBlur:K,ref:M=>{if(M){xe(S,T),O=de(n,S);const H=Ft(M.value)&&M.querySelectorAll&&M.querySelectorAll("input,select,textarea")[0]||M,X=Az(H),ee=O._f.refs||[];if(X?ee.find(me=>me===H):H===O._f.ref)return;ft(n,S,{_f:{...O._f,...X?{refs:[...ee.filter(np),H,...Array.isArray(de(s,S))?[{}]:[]],ref:{type:H.type,name:S}}:{ref:H}}}),j(S,!1,void 0,H)}else O=de(n,S,{}),O._f&&(O._f.mount=!1),(t.shouldUnregister||T.shouldUnregister)&&!(Rj(l.array,S)&&i.action)&&l.unMount.add(S)}}},Te=()=>t.shouldFocusError&&Nl(n,I,l.mount),Fe=S=>{zn(S)&&(f.state.next({disabled:S}),Nl(n,(T,O)=>{const Y=de(n,O);Y&&(T.disabled=Y._f.disabled||S,Array.isArray(Y._f.refs)&&Y._f.refs.forEach(M=>{M.disabled=Y._f.disabled||S}))},0,!1))},Me=(S,T)=>async O=>{let Y;O&&(O.preventDefault&&O.preventDefault(),O.persist&&O.persist());let M=Cr(o);if(f.state.next({isSubmitting:!0}),t.resolver){const{errors:H,values:X}=await P();r.errors=H,M=X}else await L(n);if(Yt(r.errors,"root"),Mr(r.errors)){f.state.next({errors:{}});try{await S(M,O)}catch(H){Y=H}}else T&&await T({...r.errors},O),Te(),setTimeout(Te);if(f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Mr(r.errors)&&!Y,submitCount:r.submitCount+1,errors:r.errors}),Y)throw Y},Pe=(S,T={})=>{de(n,S)&&(Ft(T.defaultValue)?B(S,Cr(de(s,S))):(B(S,T.defaultValue),ft(s,S,Cr(T.defaultValue))),T.keepTouched||Yt(r.touchedFields,S),T.keepDirty||(Yt(r.dirtyFields,S),r.isDirty=T.defaultValue?N(S,Cr(de(s,S))):N()),T.keepError||(Yt(r.errors,S),d.isValid&&_()),f.state.next({...r}))},nt=(S,T={})=>{const O=S?Cr(S):s,Y=Cr(O),M=Mr(S),H=M?s:Y;if(T.keepDefaultValues||(s=O),!T.keepValues){if(T.keepDirtyValues)for(const X of l.mount)de(r.dirtyFields,X)?ft(H,X,de(o,X)):B(X,de(H,X));else{if(py&&Ft(S))for(const X of l.mount){const ee=de(n,X);if(ee&&ee._f){const me=Array.isArray(ee._f.refs)?ee._f.refs[0]:ee._f.ref;if(Id(me)){const Ye=me.closest("form");if(Ye){Ye.reset();break}}}}n={}}o=e.shouldUnregister?T.keepDefaultValues?Cr(s):{}:Cr(H),f.array.next({values:{...H}}),f.values.next({values:{...H}})}l={mount:T.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!d.isValid||!!T.keepIsValid||!!T.keepDirtyValues,i.watch=!!e.shouldUnregister,f.state.next({submitCount:T.keepSubmitCount?r.submitCount:0,isDirty:M?!1:T.keepDirty?r.isDirty:!!(T.keepDefaultValues&&!Ho(S,s)),isSubmitted:T.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:M?{}:T.keepDirtyValues?T.keepDefaultValues&&o?ju(s,o):r.dirtyFields:T.keepDefaultValues&&S?ju(s,S):T.keepDirty?r.dirtyFields:{},touchedFields:T.keepTouched?r.touchedFields:{},errors:T.keepErrors?r.errors:{},isSubmitSuccessful:T.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},k=(S,T)=>nt(so(S)?S(o):S,T);return{control:{register:xe,unregister:Oe,getFieldState:$,handleSubmit:Me,setError:ne,_executeSchema:P,_getWatch:F,_getDirty:N,_updateValid:_,_removeUnmounted:q,_updateFieldArray:h,_updateDisabledField:pe,_getFieldArray:b,_reset:nt,_resetDefaultValues:()=>so(t.defaultValues)&&t.defaultValues().then(S=>{k(S,t.resetOptions),f.state.next({isLoading:!1})}),_updateFormState:S=>{r={...r,...S}},_disableForm:Fe,_subjects:f,_proxyFormState:d,_setErrors:C,get _fields(){return n},get _formValues(){return o},get _state(){return i},set _state(S){i=S},get _defaultValues(){return s},get _names(){return l},set _names(S){l=S},get _formState(){return r},set _formState(S){r=S},get _options(){return t},set _options(S){t={...t,...S}}},trigger:Q,register:xe,handleSubmit:Me,watch:se,setValue:B,getValues:z,reset:k,resetField:Pe,clearErrors:he,unregister:Oe,setError:ne,setFocus:(S,T={})=>{const O=de(n,S),Y=O&&O._f;if(Y){const M=Y.refs?Y.refs[0]:Y.ref;M.focus&&(M.focus(),T.shouldSelect&&M.select())}},getFieldState:$}}function fr(e={}){const t=Be.useRef(),r=Be.useRef(),[n,s]=Be.useState({isDirty:!1,isValidating:!1,isLoading:so(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:so(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...Fz(e),formState:n});const o=t.current.control;return o._options=e,gy({subject:o._subjects.state,next:i=>{Oj(i,o._proxyFormState,o._updateFormState,!0)&&s({...o._formState})}}),Be.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),Be.useEffect(()=>{if(o._proxyFormState.isDirty){const i=o._getDirty();i!==n.isDirty&&o._subjects.state.next({isDirty:i})}},[o,n.isDirty]),Be.useEffect(()=>{e.values&&!Ho(e.values,r.current)?(o._reset(e.values,o._options.resetOptions),r.current=e.values,s(i=>({...i}))):o._resetDefaultValues()},[e.values,o]),Be.useEffect(()=>{e.errors&&o._setErrors(e.errors)},[e.errors,o]),Be.useEffect(()=>{o._state.mount||(o._updateValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),Be.useEffect(()=>{e.shouldUnregister&&o._subjects.values.next({values:o._getWatch()})},[e.shouldUnregister,o]),t.current.formState=Dj(n,o),t.current}const Sw=(e,t,r)=>{if(e&&"reportValidity"in e){const n=de(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},Wj=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?Sw(n.ref,r,e):n.refs&&n.refs.forEach(s=>Sw(s,r,e))}},zz=(e,t)=>{t.shouldUseNativeValidation&&Wj(e,t);const r={};for(const n in e){const s=de(t.fields,n),o=Object.assign(e[n]||{},{ref:s&&s.ref});if(Uz(t.names||Object.keys(e),n)){const i=Object.assign({},de(r,n));ft(i,"root",o),ft(r,n,i)}else ft(r,n,o)}return r},Uz=(e,t)=>e.some(r=>r.startsWith(t+"."));var $z=function(e,t){for(var r={};e.length;){var n=e[0],s=n.code,o=n.message,i=n.path.join(".");if(!r[i])if("unionErrors"in n){var l=n.unionErrors[0].errors[0];r[i]={message:l.message,type:l.code}}else r[i]={message:o,type:s};if("unionErrors"in n&&n.unionErrors.forEach(function(d){return d.errors.forEach(function(f){return e.push(f)})}),t){var c=r[i].types,u=c&&c[n.code];r[i]=Lj(i,t,r,s,u?[].concat(u,n.message):n.message)}e.shift()}return r},hr=function(e,t,r){return r===void 0&&(r={}),function(n,s,o){try{return Promise.resolve(function(i,l){try{var c=Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](n,t)).then(function(u){return o.shouldUseNativeValidation&&Wj({},o),{errors:{},values:r.raw?n:u}})}catch(u){return l(u)}return c&&c.then?c.then(void 0,l):c}(0,function(i){if(function(l){return Array.isArray(l==null?void 0:l.errors)}(i))return{values:{},errors:zz($z(i.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw i}))}catch(i){return Promise.reject(i)}}},ot;(function(e){e.assertEqual=s=>s;function t(s){}e.assertIs=t;function r(s){throw new Error}e.assertNever=r,e.arrayToEnum=s=>{const o={};for(const i of s)o[i]=i;return o},e.getValidEnumValues=s=>{const o=e.objectKeys(s).filter(l=>typeof s[s[l]]!="number"),i={};for(const l of o)i[l]=s[l];return e.objectValues(i)},e.objectValues=s=>e.objectKeys(s).map(function(o){return s[o]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const o=[];for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&o.push(i);return o},e.find=(s,o)=>{for(const i of s)if(o(i))return i},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function n(s,o=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(o)}e.joinValues=n,e.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(ot||(ot={}));var Cm;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(Cm||(Cm={}));const Ce=ot.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Xs=e=>{switch(typeof e){case"undefined":return Ce.undefined;case"string":return Ce.string;case"number":return isNaN(e)?Ce.nan:Ce.number;case"boolean":return Ce.boolean;case"function":return Ce.function;case"bigint":return Ce.bigint;case"symbol":return Ce.symbol;case"object":return Array.isArray(e)?Ce.array:e===null?Ce.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Ce.promise:typeof Map<"u"&&e instanceof Map?Ce.map:typeof Set<"u"&&e instanceof Set?Ce.set:typeof Date<"u"&&e instanceof Date?Ce.date:Ce.object;default:return Ce.unknown}},ae=ot.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Vz=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Wr extends Error{constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const r=t||function(o){return o.message},n={_errors:[]},s=o=>{for(const i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)n._errors.push(r(i));else{let l=n,c=0;for(;cr.message){const r={},n=[];for(const s of this.issues)s.path.length>0?(r[s.path[0]]=r[s.path[0]]||[],r[s.path[0]].push(t(s))):n.push(t(s));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}Wr.create=e=>new Wr(e);const xa=(e,t)=>{let r;switch(e.code){case ae.invalid_type:e.received===Ce.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case ae.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,ot.jsonStringifyReplacer)}`;break;case ae.unrecognized_keys:r=`Unrecognized key(s) in object: ${ot.joinValues(e.keys,", ")}`;break;case ae.invalid_union:r="Invalid input";break;case ae.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${ot.joinValues(e.options)}`;break;case ae.invalid_enum_value:r=`Invalid enum value. Expected ${ot.joinValues(e.options)}, received '${e.received}'`;break;case ae.invalid_arguments:r="Invalid function arguments";break;case ae.invalid_return_type:r="Invalid function return type";break;case ae.invalid_date:r="Invalid date";break;case ae.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:ot.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case ae.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case ae.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case ae.custom:r="Invalid input";break;case ae.invalid_intersection_types:r="Intersection results could not be merged";break;case ae.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case ae.not_finite:r="Number must be finite";break;default:r=t.defaultError,ot.assertNever(e)}return{message:r}};let Hj=xa;function Bz(e){Hj=e}function Ud(){return Hj}const $d=e=>{const{data:t,path:r,errorMaps:n,issueData:s}=e,o=[...r,...s.path||[]],i={...s,path:o};if(s.message!==void 0)return{...s,path:o,message:s.message};let l="";const c=n.filter(u=>!!u).slice().reverse();for(const u of c)l=u(i,{data:t,defaultError:l}).message;return{...s,path:o,message:l}},Wz=[];function ve(e,t){const r=Ud(),n=$d({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===xa?void 0:xa].filter(s=>!!s)});e.common.issues.push(n)}class dr{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){const n=[];for(const s of r){if(s.status==="aborted")return We;s.status==="dirty"&&t.dirty(),n.push(s.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){const n=[];for(const s of r){const o=await s.key,i=await s.value;n.push({key:o,value:i})}return dr.mergeObjectSync(t,n)}static mergeObjectSync(t,r){const n={};for(const s of r){const{key:o,value:i}=s;if(o.status==="aborted"||i.status==="aborted")return We;o.status==="dirty"&&t.dirty(),i.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof i.value<"u"||s.alwaysSet)&&(n[o.value]=i.value)}return{status:t.value,value:n}}}const We=Object.freeze({status:"aborted"}),Hi=e=>({status:"dirty",value:e}),wr=e=>({status:"valid",value:e}),jm=e=>e.status==="aborted",Em=e=>e.status==="dirty",sc=e=>e.status==="valid",oc=e=>typeof Promise<"u"&&e instanceof Promise;function Vd(e,t,r,n){if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function Yj(e,t,r,n,s){if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,r),r}var De;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(De||(De={}));var cl,ul;class Kn{constructor(t,r,n,s){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const kw=(e,t)=>{if(sc(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new Wr(e.common.issues);return this._error=r,this._error}}};function Ge(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:s}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:(i,l)=>{var c,u;const{message:d}=e;return i.code==="invalid_enum_value"?{message:d??l.defaultError}:typeof l.data>"u"?{message:(c=d??n)!==null&&c!==void 0?c:l.defaultError}:i.code!=="invalid_type"?{message:l.defaultError}:{message:(u=d??r)!==null&&u!==void 0?u:l.defaultError}},description:s}}class Je{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return Xs(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Xs(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new dr,ctx:{common:t.parent.common,data:t.data,parsedType:Xs(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(oc(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){const r=this._parse(t);return Promise.resolve(r)}parse(t,r){const n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){var n;const s={common:{issues:[],async:(n=r==null?void 0:r.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Xs(t)},o=this._parseSync({data:t,path:s.path,parent:s});return kw(s,o)}async parseAsync(t,r){const n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){const n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Xs(t)},s=this._parse({data:t,path:n.path,parent:n}),o=await(oc(s)?s:Promise.resolve(s));return kw(n,o)}refine(t,r){const n=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,o)=>{const i=t(s),l=()=>o.addIssue({code:ae.custom,...n(s)});return typeof Promise<"u"&&i instanceof Promise?i.then(c=>c?!0:(l(),!1)):i?!0:(l(),!1)})}refinement(t,r){return this._refinement((n,s)=>t(n)?!0:(s.addIssue(typeof r=="function"?r(n,s):r),!1))}_refinement(t){return new En({schema:this,typeName:$e.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Wn.create(this,this._def)}nullable(){return ko.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return _n.create(this,this._def)}promise(){return _a.create(this,this._def)}or(t){return cc.create([this,t],this._def)}and(t){return uc.create(this,t,this._def)}transform(t){return new En({...Ge(this._def),schema:this,typeName:$e.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r=typeof t=="function"?t:()=>t;return new mc({...Ge(this._def),innerType:this,defaultValue:r,typeName:$e.ZodDefault})}brand(){return new xy({typeName:$e.ZodBranded,type:this,...Ge(this._def)})}catch(t){const r=typeof t=="function"?t:()=>t;return new gc({...Ge(this._def),innerType:this,catchValue:r,typeName:$e.ZodCatch})}describe(t){const r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Uc.create(this,t)}readonly(){return vc.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Hz=/^c[^\s-]{8,}$/i,Yz=/^[0-9a-z]+$/,Kz=/^[0-9A-HJKMNP-TV-Z]{26}$/,Gz=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Zz=/^[a-z0-9_-]{21}$/i,qz=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Xz=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Qz="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let op;const Jz=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,e8=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,t8=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Kj="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",r8=new RegExp(`^${Kj}$`);function Gj(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function n8(e){return new RegExp(`^${Gj(e)}$`)}function Zj(e){let t=`${Kj}T${Gj(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function s8(e,t){return!!((t==="v4"||!t)&&Jz.test(e)||(t==="v6"||!t)&&e8.test(e))}class yn extends Je{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Ce.string){const o=this._getOrReturnCtx(t);return ve(o,{code:ae.invalid_type,expected:Ce.string,received:o.parsedType}),We}const n=new dr;let s;for(const o of this._def.checks)if(o.kind==="min")t.data.lengtho.value&&(s=this._getOrReturnCtx(t,s),ve(s,{code:ae.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){const i=t.data.length>o.value,l=t.data.lengtht.test(s),{validation:r,code:ae.invalid_string,...De.errToObj(n)})}_addCheck(t){return new yn({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...De.errToObj(t)})}url(t){return this._addCheck({kind:"url",...De.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...De.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...De.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...De.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...De.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...De.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...De.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...De.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...De.errToObj(t)})}datetime(t){var r,n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(r=t==null?void 0:t.offset)!==null&&r!==void 0?r:!1,local:(n=t==null?void 0:t.local)!==null&&n!==void 0?n:!1,...De.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...De.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...De.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...De.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...De.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...De.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...De.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...De.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...De.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...De.errToObj(r)})}nonempty(t){return this.min(1,De.errToObj(t))}trim(){return new yn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new yn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new yn({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value{var t;return new yn({checks:[],typeName:$e.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Ge(e)})};function o8(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,s=r>n?r:n,o=parseInt(e.toFixed(s).replace(".","")),i=parseInt(t.toFixed(s).replace(".",""));return o%i/Math.pow(10,s)}class _o extends Je{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Ce.number){const o=this._getOrReturnCtx(t);return ve(o,{code:ae.invalid_type,expected:Ce.number,received:o.parsedType}),We}let n;const s=new dr;for(const o of this._def.checks)o.kind==="int"?ot.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),ve(n,{code:ae.invalid_type,expected:"integer",received:"float",message:o.message}),s.dirty()):o.kind==="min"?(o.inclusive?t.datao.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),ve(n,{code:ae.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="multipleOf"?o8(t.data,o.value)!==0&&(n=this._getOrReturnCtx(t,n),ve(n,{code:ae.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),ve(n,{code:ae.not_finite,message:o.message}),s.dirty()):ot.assertNever(o);return{status:s.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,De.toString(r))}gt(t,r){return this.setLimit("min",t,!1,De.toString(r))}lte(t,r){return this.setLimit("max",t,!0,De.toString(r))}lt(t,r){return this.setLimit("max",t,!1,De.toString(r))}setLimit(t,r,n,s){return new _o({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:De.toString(s)}]})}_addCheck(t){return new _o({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:De.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:De.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:De.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:De.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:De.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:De.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:De.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:De.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:De.toString(t)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuet.kind==="int"||t.kind==="multipleOf"&&ot.isInteger(t.value))}get isFinite(){let t=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.valuenew _o({checks:[],typeName:$e.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Ge(e)});class bo extends Je{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==Ce.bigint){const o=this._getOrReturnCtx(t);return ve(o,{code:ae.invalid_type,expected:Ce.bigint,received:o.parsedType}),We}let n;const s=new dr;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.datao.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),ve(n,{code:ae.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),ve(n,{code:ae.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):ot.assertNever(o);return{status:s.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,De.toString(r))}gt(t,r){return this.setLimit("min",t,!1,De.toString(r))}lte(t,r){return this.setLimit("max",t,!0,De.toString(r))}lt(t,r){return this.setLimit("max",t,!1,De.toString(r))}setLimit(t,r,n,s){return new bo({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:De.toString(s)}]})}_addCheck(t){return new bo({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:De.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:De.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:De.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:De.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:De.toString(r)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value{var t;return new bo({checks:[],typeName:$e.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Ge(e)})};class ic extends Je{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Ce.boolean){const n=this._getOrReturnCtx(t);return ve(n,{code:ae.invalid_type,expected:Ce.boolean,received:n.parsedType}),We}return wr(t.data)}}ic.create=e=>new ic({typeName:$e.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Ge(e)});class ii extends Je{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Ce.date){const o=this._getOrReturnCtx(t);return ve(o,{code:ae.invalid_type,expected:Ce.date,received:o.parsedType}),We}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return ve(o,{code:ae.invalid_date}),We}const n=new dr;let s;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()o.value&&(s=this._getOrReturnCtx(t,s),ve(s,{code:ae.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):ot.assertNever(o);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new ii({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:De.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:De.toString(r)})}get minDate(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuenew ii({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:$e.ZodDate,...Ge(e)});class Bd extends Je{_parse(t){if(this._getType(t)!==Ce.symbol){const n=this._getOrReturnCtx(t);return ve(n,{code:ae.invalid_type,expected:Ce.symbol,received:n.parsedType}),We}return wr(t.data)}}Bd.create=e=>new Bd({typeName:$e.ZodSymbol,...Ge(e)});class ac extends Je{_parse(t){if(this._getType(t)!==Ce.undefined){const n=this._getOrReturnCtx(t);return ve(n,{code:ae.invalid_type,expected:Ce.undefined,received:n.parsedType}),We}return wr(t.data)}}ac.create=e=>new ac({typeName:$e.ZodUndefined,...Ge(e)});class lc extends Je{_parse(t){if(this._getType(t)!==Ce.null){const n=this._getOrReturnCtx(t);return ve(n,{code:ae.invalid_type,expected:Ce.null,received:n.parsedType}),We}return wr(t.data)}}lc.create=e=>new lc({typeName:$e.ZodNull,...Ge(e)});class wa extends Je{constructor(){super(...arguments),this._any=!0}_parse(t){return wr(t.data)}}wa.create=e=>new wa({typeName:$e.ZodAny,...Ge(e)});class qo extends Je{constructor(){super(...arguments),this._unknown=!0}_parse(t){return wr(t.data)}}qo.create=e=>new qo({typeName:$e.ZodUnknown,...Ge(e)});class js extends Je{_parse(t){const r=this._getOrReturnCtx(t);return ve(r,{code:ae.invalid_type,expected:Ce.never,received:r.parsedType}),We}}js.create=e=>new js({typeName:$e.ZodNever,...Ge(e)});class Wd extends Je{_parse(t){if(this._getType(t)!==Ce.undefined){const n=this._getOrReturnCtx(t);return ve(n,{code:ae.invalid_type,expected:Ce.void,received:n.parsedType}),We}return wr(t.data)}}Wd.create=e=>new Wd({typeName:$e.ZodVoid,...Ge(e)});class _n extends Je{_parse(t){const{ctx:r,status:n}=this._processInputParams(t),s=this._def;if(r.parsedType!==Ce.array)return ve(r,{code:ae.invalid_type,expected:Ce.array,received:r.parsedType}),We;if(s.exactLength!==null){const i=r.data.length>s.exactLength.value,l=r.data.lengths.maxLength.value&&(ve(r,{code:ae.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((i,l)=>s.type._parseAsync(new Kn(r,i,r.path,l)))).then(i=>dr.mergeArray(n,i));const o=[...r.data].map((i,l)=>s.type._parseSync(new Kn(r,i,r.path,l)));return dr.mergeArray(n,o)}get element(){return this._def.type}min(t,r){return new _n({...this._def,minLength:{value:t,message:De.toString(r)}})}max(t,r){return new _n({...this._def,maxLength:{value:t,message:De.toString(r)}})}length(t,r){return new _n({...this._def,exactLength:{value:t,message:De.toString(r)}})}nonempty(t){return this.min(1,t)}}_n.create=(e,t)=>new _n({type:e,minLength:null,maxLength:null,exactLength:null,typeName:$e.ZodArray,...Ge(t)});function Ti(e){if(e instanceof Rt){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=Wn.create(Ti(n))}return new Rt({...e._def,shape:()=>t})}else return e instanceof _n?new _n({...e._def,type:Ti(e.element)}):e instanceof Wn?Wn.create(Ti(e.unwrap())):e instanceof ko?ko.create(Ti(e.unwrap())):e instanceof Gn?Gn.create(e.items.map(t=>Ti(t))):e}class Rt extends Je{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),r=ot.objectKeys(t);return this._cached={shape:t,keys:r}}_parse(t){if(this._getType(t)!==Ce.object){const u=this._getOrReturnCtx(t);return ve(u,{code:ae.invalid_type,expected:Ce.object,received:u.parsedType}),We}const{status:n,ctx:s}=this._processInputParams(t),{shape:o,keys:i}=this._getCached(),l=[];if(!(this._def.catchall instanceof js&&this._def.unknownKeys==="strip"))for(const u in s.data)i.includes(u)||l.push(u);const c=[];for(const u of i){const d=o[u],f=s.data[u];c.push({key:{status:"valid",value:u},value:d._parse(new Kn(s,f,s.path,u)),alwaysSet:u in s.data})}if(this._def.catchall instanceof js){const u=this._def.unknownKeys;if(u==="passthrough")for(const d of l)c.push({key:{status:"valid",value:d},value:{status:"valid",value:s.data[d]}});else if(u==="strict")l.length>0&&(ve(s,{code:ae.unrecognized_keys,keys:l}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const d of l){const f=s.data[d];c.push({key:{status:"valid",value:d},value:u._parse(new Kn(s,f,s.path,d)),alwaysSet:d in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const u=[];for(const d of c){const f=await d.key,m=await d.value;u.push({key:f,value:m,alwaysSet:d.alwaysSet})}return u}).then(u=>dr.mergeObjectSync(n,u)):dr.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(t){return De.errToObj,new Rt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var s,o,i,l;const c=(i=(o=(s=this._def).errorMap)===null||o===void 0?void 0:o.call(s,r,n).message)!==null&&i!==void 0?i:n.defaultError;return r.code==="unrecognized_keys"?{message:(l=De.errToObj(t).message)!==null&&l!==void 0?l:c}:{message:c}}}:{}})}strip(){return new Rt({...this._def,unknownKeys:"strip"})}passthrough(){return new Rt({...this._def,unknownKeys:"passthrough"})}extend(t){return new Rt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Rt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:$e.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new Rt({...this._def,catchall:t})}pick(t){const r={};return ot.objectKeys(t).forEach(n=>{t[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new Rt({...this._def,shape:()=>r})}omit(t){const r={};return ot.objectKeys(this.shape).forEach(n=>{t[n]||(r[n]=this.shape[n])}),new Rt({...this._def,shape:()=>r})}deepPartial(){return Ti(this)}partial(t){const r={};return ot.objectKeys(this.shape).forEach(n=>{const s=this.shape[n];t&&!t[n]?r[n]=s:r[n]=s.optional()}),new Rt({...this._def,shape:()=>r})}required(t){const r={};return ot.objectKeys(this.shape).forEach(n=>{if(t&&!t[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof Wn;)o=o._def.innerType;r[n]=o}}),new Rt({...this._def,shape:()=>r})}keyof(){return qj(ot.objectKeys(this.shape))}}Rt.create=(e,t)=>new Rt({shape:()=>e,unknownKeys:"strip",catchall:js.create(),typeName:$e.ZodObject,...Ge(t)});Rt.strictCreate=(e,t)=>new Rt({shape:()=>e,unknownKeys:"strict",catchall:js.create(),typeName:$e.ZodObject,...Ge(t)});Rt.lazycreate=(e,t)=>new Rt({shape:e,unknownKeys:"strip",catchall:js.create(),typeName:$e.ZodObject,...Ge(t)});class cc extends Je{_parse(t){const{ctx:r}=this._processInputParams(t),n=this._def.options;function s(o){for(const l of o)if(l.result.status==="valid")return l.result;for(const l of o)if(l.result.status==="dirty")return r.common.issues.push(...l.ctx.common.issues),l.result;const i=o.map(l=>new Wr(l.ctx.common.issues));return ve(r,{code:ae.invalid_union,unionErrors:i}),We}if(r.common.async)return Promise.all(n.map(async o=>{const i={...r,common:{...r.common,issues:[]},parent:null};return{result:await o._parseAsync({data:r.data,path:r.path,parent:i}),ctx:i}})).then(s);{let o;const i=[];for(const c of n){const u={...r,common:{...r.common,issues:[]},parent:null},d=c._parseSync({data:r.data,path:r.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!o&&(o={result:d,ctx:u}),u.common.issues.length&&i.push(u.common.issues)}if(o)return r.common.issues.push(...o.ctx.common.issues),o.result;const l=i.map(c=>new Wr(c));return ve(r,{code:ae.invalid_union,unionErrors:l}),We}}get options(){return this._def.options}}cc.create=(e,t)=>new cc({options:e,typeName:$e.ZodUnion,...Ge(t)});const os=e=>e instanceof fc?os(e.schema):e instanceof En?os(e.innerType()):e instanceof hc?[e.value]:e instanceof So?e.options:e instanceof pc?ot.objectValues(e.enum):e instanceof mc?os(e._def.innerType):e instanceof ac?[void 0]:e instanceof lc?[null]:e instanceof Wn?[void 0,...os(e.unwrap())]:e instanceof ko?[null,...os(e.unwrap())]:e instanceof xy||e instanceof vc?os(e.unwrap()):e instanceof gc?os(e._def.innerType):[];class qf extends Je{_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==Ce.object)return ve(r,{code:ae.invalid_type,expected:Ce.object,received:r.parsedType}),We;const n=this.discriminator,s=r.data[n],o=this.optionsMap.get(s);return o?r.common.async?o._parseAsync({data:r.data,path:r.path,parent:r}):o._parseSync({data:r.data,path:r.path,parent:r}):(ve(r,{code:ae.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),We)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){const s=new Map;for(const o of r){const i=os(o.shape[t]);if(!i.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const l of i){if(s.has(l))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(l)}`);s.set(l,o)}}return new qf({typeName:$e.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:s,...Ge(n)})}}function Nm(e,t){const r=Xs(e),n=Xs(t);if(e===t)return{valid:!0,data:e};if(r===Ce.object&&n===Ce.object){const s=ot.objectKeys(t),o=ot.objectKeys(e).filter(l=>s.indexOf(l)!==-1),i={...e,...t};for(const l of o){const c=Nm(e[l],t[l]);if(!c.valid)return{valid:!1};i[l]=c.data}return{valid:!0,data:i}}else if(r===Ce.array&&n===Ce.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let o=0;o{if(jm(o)||jm(i))return We;const l=Nm(o.value,i.value);return l.valid?((Em(o)||Em(i))&&r.dirty(),{status:r.value,value:l.data}):(ve(n,{code:ae.invalid_intersection_types}),We)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([o,i])=>s(o,i)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}uc.create=(e,t,r)=>new uc({left:e,right:t,typeName:$e.ZodIntersection,...Ge(r)});class Gn extends Je{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Ce.array)return ve(n,{code:ae.invalid_type,expected:Ce.array,received:n.parsedType}),We;if(n.data.lengththis._def.items.length&&(ve(n,{code:ae.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const o=[...n.data].map((i,l)=>{const c=this._def.items[l]||this._def.rest;return c?c._parse(new Kn(n,i,n.path,l)):null}).filter(i=>!!i);return n.common.async?Promise.all(o).then(i=>dr.mergeArray(r,i)):dr.mergeArray(r,o)}get items(){return this._def.items}rest(t){return new Gn({...this._def,rest:t})}}Gn.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Gn({items:e,typeName:$e.ZodTuple,rest:null,...Ge(t)})};class dc extends Je{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Ce.object)return ve(n,{code:ae.invalid_type,expected:Ce.object,received:n.parsedType}),We;const s=[],o=this._def.keyType,i=this._def.valueType;for(const l in n.data)s.push({key:o._parse(new Kn(n,l,n.path,l)),value:i._parse(new Kn(n,n.data[l],n.path,l)),alwaysSet:l in n.data});return n.common.async?dr.mergeObjectAsync(r,s):dr.mergeObjectSync(r,s)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof Je?new dc({keyType:t,valueType:r,typeName:$e.ZodRecord,...Ge(n)}):new dc({keyType:yn.create(),valueType:t,typeName:$e.ZodRecord,...Ge(r)})}}class Hd extends Je{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Ce.map)return ve(n,{code:ae.invalid_type,expected:Ce.map,received:n.parsedType}),We;const s=this._def.keyType,o=this._def.valueType,i=[...n.data.entries()].map(([l,c],u)=>({key:s._parse(new Kn(n,l,n.path,[u,"key"])),value:o._parse(new Kn(n,c,n.path,[u,"value"]))}));if(n.common.async){const l=new Map;return Promise.resolve().then(async()=>{for(const c of i){const u=await c.key,d=await c.value;if(u.status==="aborted"||d.status==="aborted")return We;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),l.set(u.value,d.value)}return{status:r.value,value:l}})}else{const l=new Map;for(const c of i){const u=c.key,d=c.value;if(u.status==="aborted"||d.status==="aborted")return We;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),l.set(u.value,d.value)}return{status:r.value,value:l}}}}Hd.create=(e,t,r)=>new Hd({valueType:t,keyType:e,typeName:$e.ZodMap,...Ge(r)});class ai extends Je{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Ce.set)return ve(n,{code:ae.invalid_type,expected:Ce.set,received:n.parsedType}),We;const s=this._def;s.minSize!==null&&n.data.sizes.maxSize.value&&(ve(n,{code:ae.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());const o=this._def.valueType;function i(c){const u=new Set;for(const d of c){if(d.status==="aborted")return We;d.status==="dirty"&&r.dirty(),u.add(d.value)}return{status:r.value,value:u}}const l=[...n.data.values()].map((c,u)=>o._parse(new Kn(n,c,n.path,u)));return n.common.async?Promise.all(l).then(c=>i(c)):i(l)}min(t,r){return new ai({...this._def,minSize:{value:t,message:De.toString(r)}})}max(t,r){return new ai({...this._def,maxSize:{value:t,message:De.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}}ai.create=(e,t)=>new ai({valueType:e,minSize:null,maxSize:null,typeName:$e.ZodSet,...Ge(t)});class la extends Je{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==Ce.function)return ve(r,{code:ae.invalid_type,expected:Ce.function,received:r.parsedType}),We;function n(l,c){return $d({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Ud(),xa].filter(u=>!!u),issueData:{code:ae.invalid_arguments,argumentsError:c}})}function s(l,c){return $d({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Ud(),xa].filter(u=>!!u),issueData:{code:ae.invalid_return_type,returnTypeError:c}})}const o={errorMap:r.common.contextualErrorMap},i=r.data;if(this._def.returns instanceof _a){const l=this;return wr(async function(...c){const u=new Wr([]),d=await l._def.args.parseAsync(c,o).catch(v=>{throw u.addIssue(n(c,v)),u}),f=await Reflect.apply(i,this,d);return await l._def.returns._def.type.parseAsync(f,o).catch(v=>{throw u.addIssue(s(f,v)),u})})}else{const l=this;return wr(function(...c){const u=l._def.args.safeParse(c,o);if(!u.success)throw new Wr([n(c,u.error)]);const d=Reflect.apply(i,this,u.data),f=l._def.returns.safeParse(d,o);if(!f.success)throw new Wr([s(d,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new la({...this._def,args:Gn.create(t).rest(qo.create())})}returns(t){return new la({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new la({args:t||Gn.create([]).rest(qo.create()),returns:r||qo.create(),typeName:$e.ZodFunction,...Ge(n)})}}class fc extends Je{get schema(){return this._def.getter()}_parse(t){const{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}fc.create=(e,t)=>new fc({getter:e,typeName:$e.ZodLazy,...Ge(t)});class hc extends Je{_parse(t){if(t.data!==this._def.value){const r=this._getOrReturnCtx(t);return ve(r,{received:r.data,code:ae.invalid_literal,expected:this._def.value}),We}return{status:"valid",value:t.data}}get value(){return this._def.value}}hc.create=(e,t)=>new hc({value:e,typeName:$e.ZodLiteral,...Ge(t)});function qj(e,t){return new So({values:e,typeName:$e.ZodEnum,...Ge(t)})}class So extends Je{constructor(){super(...arguments),cl.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),n=this._def.values;return ve(r,{expected:ot.joinValues(n),received:r.parsedType,code:ae.invalid_type}),We}if(Vd(this,cl)||Yj(this,cl,new Set(this._def.values)),!Vd(this,cl).has(t.data)){const r=this._getOrReturnCtx(t),n=this._def.values;return ve(r,{received:r.data,code:ae.invalid_enum_value,options:n}),We}return wr(t.data)}get options(){return this._def.values}get enum(){const t={};for(const r of this._def.values)t[r]=r;return t}get Values(){const t={};for(const r of this._def.values)t[r]=r;return t}get Enum(){const t={};for(const r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return So.create(t,{...this._def,...r})}exclude(t,r=this._def){return So.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}}cl=new WeakMap;So.create=qj;class pc extends Je{constructor(){super(...arguments),ul.set(this,void 0)}_parse(t){const r=ot.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==Ce.string&&n.parsedType!==Ce.number){const s=ot.objectValues(r);return ve(n,{expected:ot.joinValues(s),received:n.parsedType,code:ae.invalid_type}),We}if(Vd(this,ul)||Yj(this,ul,new Set(ot.getValidEnumValues(this._def.values))),!Vd(this,ul).has(t.data)){const s=ot.objectValues(r);return ve(n,{received:n.data,code:ae.invalid_enum_value,options:s}),We}return wr(t.data)}get enum(){return this._def.values}}ul=new WeakMap;pc.create=(e,t)=>new pc({values:e,typeName:$e.ZodNativeEnum,...Ge(t)});class _a extends Je{unwrap(){return this._def.type}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==Ce.promise&&r.common.async===!1)return ve(r,{code:ae.invalid_type,expected:Ce.promise,received:r.parsedType}),We;const n=r.parsedType===Ce.promise?r.data:Promise.resolve(r.data);return wr(n.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}}_a.create=(e,t)=>new _a({type:e,typeName:$e.ZodPromise,...Ge(t)});class En extends Je{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===$e.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:r,ctx:n}=this._processInputParams(t),s=this._def.effect||null,o={addIssue:i=>{ve(n,i),i.fatal?r.abort():r.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),s.type==="preprocess"){const i=s.transform(n.data,o);if(n.common.async)return Promise.resolve(i).then(async l=>{if(r.value==="aborted")return We;const c=await this._def.schema._parseAsync({data:l,path:n.path,parent:n});return c.status==="aborted"?We:c.status==="dirty"||r.value==="dirty"?Hi(c.value):c});{if(r.value==="aborted")return We;const l=this._def.schema._parseSync({data:i,path:n.path,parent:n});return l.status==="aborted"?We:l.status==="dirty"||r.value==="dirty"?Hi(l.value):l}}if(s.type==="refinement"){const i=l=>{const c=s.refinement(l,o);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(n.common.async===!1){const l=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return l.status==="aborted"?We:(l.status==="dirty"&&r.dirty(),i(l.value),{status:r.value,value:l.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(l=>l.status==="aborted"?We:(l.status==="dirty"&&r.dirty(),i(l.value).then(()=>({status:r.value,value:l.value}))))}if(s.type==="transform")if(n.common.async===!1){const i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!sc(i))return i;const l=s.transform(i.value,o);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:l}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>sc(i)?Promise.resolve(s.transform(i.value,o)).then(l=>({status:r.value,value:l})):i);ot.assertNever(s)}}En.create=(e,t,r)=>new En({schema:e,typeName:$e.ZodEffects,effect:t,...Ge(r)});En.createWithPreprocess=(e,t,r)=>new En({schema:t,effect:{type:"preprocess",transform:e},typeName:$e.ZodEffects,...Ge(r)});class Wn extends Je{_parse(t){return this._getType(t)===Ce.undefined?wr(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Wn.create=(e,t)=>new Wn({innerType:e,typeName:$e.ZodOptional,...Ge(t)});class ko extends Je{_parse(t){return this._getType(t)===Ce.null?wr(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ko.create=(e,t)=>new ko({innerType:e,typeName:$e.ZodNullable,...Ge(t)});class mc extends Je{_parse(t){const{ctx:r}=this._processInputParams(t);let n=r.data;return r.parsedType===Ce.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}mc.create=(e,t)=>new mc({innerType:e,typeName:$e.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Ge(t)});class gc extends Je{_parse(t){const{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return oc(s)?s.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Wr(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Wr(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}gc.create=(e,t)=>new gc({innerType:e,typeName:$e.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Ge(t)});class Yd extends Je{_parse(t){if(this._getType(t)!==Ce.nan){const n=this._getOrReturnCtx(t);return ve(n,{code:ae.invalid_type,expected:Ce.nan,received:n.parsedType}),We}return{status:"valid",value:t.data}}}Yd.create=e=>new Yd({typeName:$e.ZodNaN,...Ge(e)});const i8=Symbol("zod_brand");class xy extends Je{_parse(t){const{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class Uc extends Je{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?We:o.status==="dirty"?(r.dirty(),Hi(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{const s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?We:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(t,r){return new Uc({in:t,out:r,typeName:$e.ZodPipeline})}}class vc extends Je{_parse(t){const r=this._def.innerType._parse(t),n=s=>(sc(s)&&(s.value=Object.freeze(s.value)),s);return oc(r)?r.then(s=>n(s)):n(r)}unwrap(){return this._def.innerType}}vc.create=(e,t)=>new vc({innerType:e,typeName:$e.ZodReadonly,...Ge(t)});function Xj(e,t={},r){return e?wa.create().superRefine((n,s)=>{var o,i;if(!e(n)){const l=typeof t=="function"?t(n):typeof t=="string"?{message:t}:t,c=(i=(o=l.fatal)!==null&&o!==void 0?o:r)!==null&&i!==void 0?i:!0,u=typeof l=="string"?{message:l}:l;s.addIssue({code:"custom",...u,fatal:c})}}):wa.create()}const a8={object:Rt.lazycreate};var $e;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})($e||($e={}));const l8=(e,t={message:`Input not instance of ${e.name}`})=>Xj(r=>r instanceof e,t),Qj=yn.create,Jj=_o.create,c8=Yd.create,u8=bo.create,eE=ic.create,d8=ii.create,f8=Bd.create,h8=ac.create,p8=lc.create,m8=wa.create,g8=qo.create,v8=js.create,y8=Wd.create,x8=_n.create,w8=Rt.create,_8=Rt.strictCreate,b8=cc.create,S8=qf.create,k8=uc.create,C8=Gn.create,j8=dc.create,E8=Hd.create,N8=ai.create,T8=la.create,R8=fc.create,P8=hc.create,A8=So.create,D8=pc.create,O8=_a.create,Cw=En.create,M8=Wn.create,I8=ko.create,L8=En.createWithPreprocess,F8=Uc.create,z8=()=>Qj().optional(),U8=()=>Jj().optional(),$8=()=>eE().optional(),V8={string:e=>yn.create({...e,coerce:!0}),number:e=>_o.create({...e,coerce:!0}),boolean:e=>ic.create({...e,coerce:!0}),bigint:e=>bo.create({...e,coerce:!0}),date:e=>ii.create({...e,coerce:!0})},B8=We;var ce=Object.freeze({__proto__:null,defaultErrorMap:xa,setErrorMap:Bz,getErrorMap:Ud,makeIssue:$d,EMPTY_PATH:Wz,addIssueToContext:ve,ParseStatus:dr,INVALID:We,DIRTY:Hi,OK:wr,isAborted:jm,isDirty:Em,isValid:sc,isAsync:oc,get util(){return ot},get objectUtil(){return Cm},ZodParsedType:Ce,getParsedType:Xs,ZodType:Je,datetimeRegex:Zj,ZodString:yn,ZodNumber:_o,ZodBigInt:bo,ZodBoolean:ic,ZodDate:ii,ZodSymbol:Bd,ZodUndefined:ac,ZodNull:lc,ZodAny:wa,ZodUnknown:qo,ZodNever:js,ZodVoid:Wd,ZodArray:_n,ZodObject:Rt,ZodUnion:cc,ZodDiscriminatedUnion:qf,ZodIntersection:uc,ZodTuple:Gn,ZodRecord:dc,ZodMap:Hd,ZodSet:ai,ZodFunction:la,ZodLazy:fc,ZodLiteral:hc,ZodEnum:So,ZodNativeEnum:pc,ZodPromise:_a,ZodEffects:En,ZodTransformer:En,ZodOptional:Wn,ZodNullable:ko,ZodDefault:mc,ZodCatch:gc,ZodNaN:Yd,BRAND:i8,ZodBranded:xy,ZodPipeline:Uc,ZodReadonly:vc,custom:Xj,Schema:Je,ZodSchema:Je,late:a8,get ZodFirstPartyTypeKind(){return $e},coerce:V8,any:m8,array:x8,bigint:u8,boolean:eE,date:d8,discriminatedUnion:S8,effect:Cw,enum:A8,function:T8,instanceof:l8,intersection:k8,lazy:R8,literal:P8,map:E8,nan:c8,nativeEnum:D8,never:v8,null:p8,nullable:I8,number:Jj,object:w8,oboolean:$8,onumber:U8,optional:M8,ostring:z8,pipeline:F8,preprocess:L8,promise:O8,record:j8,set:N8,strictObject:_8,string:Qj,symbol:f8,transformer:Cw,tuple:C8,undefined:h8,union:b8,unknown:g8,void:y8,NEVER:B8,ZodIssueCode:ae,quotelessJson:Vz,ZodError:Wr}),W8="Label",tE=g.forwardRef((e,t)=>a.jsx(Re.label,{...e,ref:t,onMouseDown:r=>{var s;r.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));tE.displayName=W8;var rE=tE;const H8=Sc("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Co=g.forwardRef(({className:e,...t},r)=>a.jsx(rE,{ref:r,className:oe(H8(),e),...t}));Co.displayName=rE.displayName;const pr=kz,nE=g.createContext({}),Se=({...e})=>a.jsx(nE.Provider,{value:{name:e.name},children:a.jsx(Nz,{...e})}),Xf=()=>{const e=g.useContext(nE),t=g.useContext(sE),{getFieldState:r,formState:n}=Zf(),s=r(e.name,n);if(!e)throw new Error("useFormField should be used within ");const{id:o}=t;return{id:o,name:e.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...s}},sE=g.createContext({}),we=g.forwardRef(({className:e,...t},r)=>{const n=g.useId();return a.jsx(sE.Provider,{value:{id:n},children:a.jsx("div",{ref:r,className:oe("space-y-2",e),...t})})});we.displayName="FormItem";const _e=g.forwardRef(({className:e,...t},r)=>{const{error:n,formItemId:s}=Xf();return a.jsx(Co,{ref:r,className:oe(n&&"text-destructive",e),htmlFor:s,...t})});_e.displayName="FormLabel";const be=g.forwardRef(({...e},t)=>{const{error:r,formItemId:n,formDescriptionId:s,formMessageId:o}=Xf();return a.jsx(bs,{ref:t,id:n,"aria-describedby":r?`${s} ${o}`:`${s}`,"aria-invalid":!!r,...e})});be.displayName="FormControl";const Y8=g.forwardRef(({className:e,...t},r)=>{const{formDescriptionId:n}=Xf();return a.jsx("p",{ref:r,id:n,className:oe("text-sm text-muted-foreground",e),...t})});Y8.displayName="FormDescription";const ge=g.forwardRef(({className:e,children:t,...r},n)=>{const{error:s,formMessageId:o}=Xf(),i=s?String(s==null?void 0:s.message):t;return i?a.jsx("p",{ref:n,id:o,className:oe("text-sm font-medium text-destructive",e),...r,children:i}):null});ge.displayName="FormMessage";function Tm(e,[t,r]){return Math.min(r,Math.max(t,e))}var K8=[" ","Enter","ArrowUp","ArrowDown"],G8=[" ","Enter"],$c="Select",[Qf,Jf,Z8]=kc($c),[za,sV]=sr($c,[Z8,Da]),eh=Da(),[q8,Ro]=za($c),[X8,Q8]=za($c),oE=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:s,onOpenChange:o,value:i,defaultValue:l,onValueChange:c,dir:u,name:d,autoComplete:f,disabled:m,required:v}=e,x=eh(t),[y,_]=g.useState(null),[p,h]=g.useState(null),[w,C]=g.useState(!1),j=di(u),[E=!1,R]=Yr({prop:n,defaultProp:s,onChange:o}),[P,A]=Yr({prop:i,defaultProp:l,onChange:c}),L=g.useRef(null),q=y?!!y.closest("form"):!0,[N,F]=g.useState(new Set),b=Array.from(N).map(V=>V.props.value).join(";");return a.jsx(Jg,{...x,children:a.jsxs(q8,{required:v,scope:t,trigger:y,onTriggerChange:_,valueNode:p,onValueNodeChange:h,valueNodeHasChildren:w,onValueNodeHasChildrenChange:C,contentId:$r(),value:P,onValueChange:A,open:E,onOpenChange:R,dir:j,triggerPointerDownPosRef:L,disabled:m,children:[a.jsx(Qf.Provider,{scope:t,children:a.jsx(X8,{scope:e.__scopeSelect,onNativeOptionAdd:g.useCallback(V=>{F(te=>new Set(te).add(V))},[]),onNativeOptionRemove:g.useCallback(V=>{F(te=>{const B=new Set(te);return B.delete(V),B})},[]),children:r})}),q?a.jsxs(PE,{"aria-hidden":!0,required:v,tabIndex:-1,name:d,autoComplete:f,value:P,onChange:V=>A(V.target.value),disabled:m,children:[P===void 0?a.jsx("option",{value:""}):null,Array.from(N)]},b):null]})})};oE.displayName=$c;var iE="SelectTrigger",aE=g.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...s}=e,o=eh(r),i=Ro(iE,r),l=i.disabled||n,c=Ke(t,i.onTriggerChange),u=Jf(r),[d,f,m]=AE(x=>{const y=u().filter(h=>!h.disabled),_=y.find(h=>h.value===i.value),p=DE(y,x,_);p!==void 0&&i.onValueChange(p.value)}),v=()=>{l||(i.onOpenChange(!0),m())};return a.jsx(ev,{asChild:!0,...o,children:a.jsx(Re.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":RE(i.value)?"":void 0,...s,ref:c,onClick:ue(s.onClick,x=>{x.currentTarget.focus()}),onPointerDown:ue(s.onPointerDown,x=>{const y=x.target;y.hasPointerCapture(x.pointerId)&&y.releasePointerCapture(x.pointerId),x.button===0&&x.ctrlKey===!1&&(v(),i.triggerPointerDownPosRef.current={x:Math.round(x.pageX),y:Math.round(x.pageY)},x.preventDefault())}),onKeyDown:ue(s.onKeyDown,x=>{const y=d.current!=="";!(x.ctrlKey||x.altKey||x.metaKey)&&x.key.length===1&&f(x.key),!(y&&x.key===" ")&&K8.includes(x.key)&&(v(),x.preventDefault())})})})});aE.displayName=iE;var lE="SelectValue",cE=g.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,children:o,placeholder:i="",...l}=e,c=Ro(lE,r),{onValueNodeHasChildrenChange:u}=c,d=o!==void 0,f=Ke(t,c.onValueNodeChange);return Jt(()=>{u(d)},[u,d]),a.jsx(Re.span,{...l,ref:f,style:{pointerEvents:"none"},children:RE(c.value)?a.jsx(a.Fragment,{children:i}):o})});cE.displayName=lE;var J8="SelectIcon",uE=g.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...s}=e;return a.jsx(Re.span,{"aria-hidden":!0,...s,ref:t,children:n||"▼"})});uE.displayName=J8;var eU="SelectPortal",dE=e=>a.jsx(jc,{asChild:!0,...e});dE.displayName=eU;var li="SelectContent",fE=g.forwardRef((e,t)=>{const r=Ro(li,e.__scopeSelect),[n,s]=g.useState();if(Jt(()=>{s(new DocumentFragment)},[]),!r.open){const o=n;return o?Ts.createPortal(a.jsx(hE,{scope:e.__scopeSelect,children:a.jsx(Qf.Slot,{scope:e.__scopeSelect,children:a.jsx("div",{children:e.children})})}),o):null}return a.jsx(pE,{...e,ref:t})});fE.displayName=li;var ls=10,[hE,Po]=za(li),tU="SelectContentImpl",pE=g.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:o,onPointerDownOutside:i,side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:m,collisionPadding:v,sticky:x,hideWhenDetached:y,avoidCollisions:_,...p}=e,h=Ro(li,r),[w,C]=g.useState(null),[j,E]=g.useState(null),R=Ke(t,pe=>C(pe)),[P,A]=g.useState(null),[L,q]=g.useState(null),N=Jf(r),[F,b]=g.useState(!1),V=g.useRef(!1);g.useEffect(()=>{if(w)return ov(w)},[w]),Bg();const te=g.useCallback(pe=>{const[xe,...Te]=N().map(Pe=>Pe.ref.current),[Fe]=Te.slice(-1),Me=document.activeElement;for(const Pe of pe)if(Pe===Me||(Pe==null||Pe.scrollIntoView({block:"nearest"}),Pe===xe&&j&&(j.scrollTop=0),Pe===Fe&&j&&(j.scrollTop=j.scrollHeight),Pe==null||Pe.focus(),document.activeElement!==Me))return},[N,j]),B=g.useCallback(()=>te([P,w]),[te,P,w]);g.useEffect(()=>{F&&B()},[F,B]);const{onOpenChange:K,triggerPointerDownPosRef:I}=h;g.useEffect(()=>{if(w){let pe={x:0,y:0};const xe=Fe=>{var Me,Pe;pe={x:Math.abs(Math.round(Fe.pageX)-(((Me=I.current)==null?void 0:Me.x)??0)),y:Math.abs(Math.round(Fe.pageY)-(((Pe=I.current)==null?void 0:Pe.y)??0))}},Te=Fe=>{pe.x<=10&&pe.y<=10?Fe.preventDefault():w.contains(Fe.target)||K(!1),document.removeEventListener("pointermove",xe),I.current=null};return I.current!==null&&(document.addEventListener("pointermove",xe),document.addEventListener("pointerup",Te,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",xe),document.removeEventListener("pointerup",Te,{capture:!0})}}},[w,K,I]),g.useEffect(()=>{const pe=()=>K(!1);return window.addEventListener("blur",pe),window.addEventListener("resize",pe),()=>{window.removeEventListener("blur",pe),window.removeEventListener("resize",pe)}},[K]);const[Q,z]=AE(pe=>{const xe=N().filter(Me=>!Me.disabled),Te=xe.find(Me=>Me.ref.current===document.activeElement),Fe=DE(xe,pe,Te);Fe&&setTimeout(()=>Fe.ref.current.focus())}),$=g.useCallback((pe,xe,Te)=>{const Fe=!V.current&&!Te;(h.value!==void 0&&h.value===xe||Fe)&&(A(pe),Fe&&(V.current=!0))},[h.value]),he=g.useCallback(()=>w==null?void 0:w.focus(),[w]),ne=g.useCallback((pe,xe,Te)=>{const Fe=!V.current&&!Te;(h.value!==void 0&&h.value===xe||Fe)&&q(pe)},[h.value]),se=n==="popper"?Rm:mE,Oe=se===Rm?{side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:m,collisionPadding:v,sticky:x,hideWhenDetached:y,avoidCollisions:_}:{};return a.jsx(hE,{scope:r,content:w,viewport:j,onViewportChange:E,itemRefCallback:$,selectedItem:P,onItemLeave:he,itemTextRefCallback:ne,focusSelectedItem:B,selectedItemText:L,position:n,isPositioned:F,searchRef:Q,children:a.jsx(jf,{as:bs,allowPinchZoom:!0,children:a.jsx(_f,{asChild:!0,trapped:h.open,onMountAutoFocus:pe=>{pe.preventDefault()},onUnmountAutoFocus:ue(s,pe=>{var xe;(xe=h.trigger)==null||xe.focus({preventScroll:!0}),pe.preventDefault()}),children:a.jsx(Ra,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:pe=>pe.preventDefault(),onDismiss:()=>h.onOpenChange(!1),children:a.jsx(se,{role:"listbox",id:h.contentId,"data-state":h.open?"open":"closed",dir:h.dir,onContextMenu:pe=>pe.preventDefault(),...p,...Oe,onPlaced:()=>b(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...p.style},onKeyDown:ue(p.onKeyDown,pe=>{const xe=pe.ctrlKey||pe.altKey||pe.metaKey;if(pe.key==="Tab"&&pe.preventDefault(),!xe&&pe.key.length===1&&z(pe.key),["ArrowUp","ArrowDown","Home","End"].includes(pe.key)){let Fe=N().filter(Me=>!Me.disabled).map(Me=>Me.ref.current);if(["ArrowUp","End"].includes(pe.key)&&(Fe=Fe.slice().reverse()),["ArrowUp","ArrowDown"].includes(pe.key)){const Me=pe.target,Pe=Fe.indexOf(Me);Fe=Fe.slice(Pe+1)}setTimeout(()=>te(Fe)),pe.preventDefault()}})})})})})})});pE.displayName=tU;var rU="SelectItemAlignedPosition",mE=g.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...s}=e,o=Ro(li,r),i=Po(li,r),[l,c]=g.useState(null),[u,d]=g.useState(null),f=Ke(t,R=>d(R)),m=Jf(r),v=g.useRef(!1),x=g.useRef(!0),{viewport:y,selectedItem:_,selectedItemText:p,focusSelectedItem:h}=i,w=g.useCallback(()=>{if(o.trigger&&o.valueNode&&l&&u&&y&&_&&p){const R=o.trigger.getBoundingClientRect(),P=u.getBoundingClientRect(),A=o.valueNode.getBoundingClientRect(),L=p.getBoundingClientRect();if(o.dir!=="rtl"){const Me=L.left-P.left,Pe=A.left-Me,nt=R.left-Pe,k=R.width+nt,J=Math.max(k,P.width),G=window.innerWidth-ls,D=Tm(Pe,[ls,G-J]);l.style.minWidth=k+"px",l.style.left=D+"px"}else{const Me=P.right-L.right,Pe=window.innerWidth-A.right-Me,nt=window.innerWidth-R.right-Pe,k=R.width+nt,J=Math.max(k,P.width),G=window.innerWidth-ls,D=Tm(Pe,[ls,G-J]);l.style.minWidth=k+"px",l.style.right=D+"px"}const q=m(),N=window.innerHeight-ls*2,F=y.scrollHeight,b=window.getComputedStyle(u),V=parseInt(b.borderTopWidth,10),te=parseInt(b.paddingTop,10),B=parseInt(b.borderBottomWidth,10),K=parseInt(b.paddingBottom,10),I=V+te+F+K+B,Q=Math.min(_.offsetHeight*5,I),z=window.getComputedStyle(y),$=parseInt(z.paddingTop,10),he=parseInt(z.paddingBottom,10),ne=R.top+R.height/2-ls,se=N-ne,Oe=_.offsetHeight/2,pe=_.offsetTop+Oe,xe=V+te+pe,Te=I-xe;if(xe<=ne){const Me=_===q[q.length-1].ref.current;l.style.bottom="0px";const Pe=u.clientHeight-y.offsetTop-y.offsetHeight,nt=Math.max(se,Oe+(Me?he:0)+Pe+B),k=xe+nt;l.style.height=k+"px"}else{const Me=_===q[0].ref.current;l.style.top="0px";const nt=Math.max(ne,V+y.offsetTop+(Me?$:0)+Oe)+Te;l.style.height=nt+"px",y.scrollTop=xe-ne+y.offsetTop}l.style.margin=`${ls}px 0`,l.style.minHeight=Q+"px",l.style.maxHeight=N+"px",n==null||n(),requestAnimationFrame(()=>v.current=!0)}},[m,o.trigger,o.valueNode,l,u,y,_,p,o.dir,n]);Jt(()=>w(),[w]);const[C,j]=g.useState();Jt(()=>{u&&j(window.getComputedStyle(u).zIndex)},[u]);const E=g.useCallback(R=>{R&&x.current===!0&&(w(),h==null||h(),x.current=!1)},[w,h]);return a.jsx(sU,{scope:r,contentWrapper:l,shouldExpandOnScrollRef:v,onScrollButtonChange:E,children:a.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:a.jsx(Re.div,{...s,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});mE.displayName=rU;var nU="SelectPopperPosition",Rm=g.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:s=ls,...o}=e,i=eh(r);return a.jsx(tv,{...i,...o,ref:t,align:n,collisionPadding:s,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Rm.displayName=nU;var[sU,wy]=za(li,{}),Pm="SelectViewport",gE=g.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...s}=e,o=Po(Pm,r),i=wy(Pm,r),l=Ke(t,o.onViewportChange),c=g.useRef(0);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),a.jsx(Qf.Slot,{scope:r,children:a.jsx(Re.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:l,style:{position:"relative",flex:1,overflow:"auto",...s.style},onScroll:ue(s.onScroll,u=>{const d=u.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:m}=i;if(m!=null&&m.current&&f){const v=Math.abs(c.current-d.scrollTop);if(v>0){const x=window.innerHeight-ls*2,y=parseFloat(f.style.minHeight),_=parseFloat(f.style.height),p=Math.max(y,_);if(p0?C:0,f.style.justifyContent="flex-end")}}}c.current=d.scrollTop})})})]})});gE.displayName=Pm;var vE="SelectGroup",[oU,iU]=za(vE),yE=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=$r();return a.jsx(oU,{scope:r,id:s,children:a.jsx(Re.div,{role:"group","aria-labelledby":s,...n,ref:t})})});yE.displayName=vE;var xE="SelectLabel",wE=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=iU(xE,r);return a.jsx(Re.div,{id:s.id,...n,ref:t})});wE.displayName=xE;var Kd="SelectItem",[aU,_E]=za(Kd),bE=g.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:s=!1,textValue:o,...i}=e,l=Ro(Kd,r),c=Po(Kd,r),u=l.value===n,[d,f]=g.useState(o??""),[m,v]=g.useState(!1),x=Ke(t,p=>{var h;return(h=c.itemRefCallback)==null?void 0:h.call(c,p,n,s)}),y=$r(),_=()=>{s||(l.onValueChange(n),l.onOpenChange(!1))};if(n==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return a.jsx(aU,{scope:r,value:n,disabled:s,textId:y,isSelected:u,onItemTextChange:g.useCallback(p=>{f(h=>h||((p==null?void 0:p.textContent)??"").trim())},[]),children:a.jsx(Qf.ItemSlot,{scope:r,value:n,disabled:s,textValue:d,children:a.jsx(Re.div,{role:"option","aria-labelledby":y,"data-highlighted":m?"":void 0,"aria-selected":u&&m,"data-state":u?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...i,ref:x,onFocus:ue(i.onFocus,()=>v(!0)),onBlur:ue(i.onBlur,()=>v(!1)),onPointerUp:ue(i.onPointerUp,_),onPointerMove:ue(i.onPointerMove,p=>{var h;s?(h=c.onItemLeave)==null||h.call(c):p.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ue(i.onPointerLeave,p=>{var h;p.currentTarget===document.activeElement&&((h=c.onItemLeave)==null||h.call(c))}),onKeyDown:ue(i.onKeyDown,p=>{var w;((w=c.searchRef)==null?void 0:w.current)!==""&&p.key===" "||(G8.includes(p.key)&&_(),p.key===" "&&p.preventDefault())})})})})});bE.displayName=Kd;var dl="SelectItemText",SE=g.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,...o}=e,i=Ro(dl,r),l=Po(dl,r),c=_E(dl,r),u=Q8(dl,r),[d,f]=g.useState(null),m=Ke(t,p=>f(p),c.onItemTextChange,p=>{var h;return(h=l.itemTextRefCallback)==null?void 0:h.call(l,p,c.value,c.disabled)}),v=d==null?void 0:d.textContent,x=g.useMemo(()=>a.jsx("option",{value:c.value,disabled:c.disabled,children:v},c.value),[c.disabled,c.value,v]),{onNativeOptionAdd:y,onNativeOptionRemove:_}=u;return Jt(()=>(y(x),()=>_(x)),[y,_,x]),a.jsxs(a.Fragment,{children:[a.jsx(Re.span,{id:c.textId,...o,ref:m}),c.isSelected&&i.valueNode&&!i.valueNodeHasChildren?Ts.createPortal(o.children,i.valueNode):null]})});SE.displayName=dl;var kE="SelectItemIndicator",CE=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return _E(kE,r).isSelected?a.jsx(Re.span,{"aria-hidden":!0,...n,ref:t}):null});CE.displayName=kE;var Am="SelectScrollUpButton",jE=g.forwardRef((e,t)=>{const r=Po(Am,e.__scopeSelect),n=wy(Am,e.__scopeSelect),[s,o]=g.useState(!1),i=Ke(t,n.onScrollButtonChange);return Jt(()=>{if(r.viewport&&r.isPositioned){let l=function(){const u=c.scrollTop>0;o(u)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),s?a.jsx(NE,{...e,ref:i,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});jE.displayName=Am;var Dm="SelectScrollDownButton",EE=g.forwardRef((e,t)=>{const r=Po(Dm,e.__scopeSelect),n=wy(Dm,e.__scopeSelect),[s,o]=g.useState(!1),i=Ke(t,n.onScrollButtonChange);return Jt(()=>{if(r.viewport&&r.isPositioned){let l=function(){const u=c.scrollHeight-c.clientHeight,d=Math.ceil(c.scrollTop)c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),s?a.jsx(NE,{...e,ref:i,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});EE.displayName=Dm;var NE=g.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...s}=e,o=Po("SelectScrollButton",r),i=g.useRef(null),l=Jf(r),c=g.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return g.useEffect(()=>()=>c(),[c]),Jt(()=>{var d;const u=l().find(f=>f.ref.current===document.activeElement);(d=u==null?void 0:u.ref.current)==null||d.scrollIntoView({block:"nearest"})},[l]),a.jsx(Re.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:ue(s.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(n,50))}),onPointerMove:ue(s.onPointerMove,()=>{var u;(u=o.onItemLeave)==null||u.call(o),i.current===null&&(i.current=window.setInterval(n,50))}),onPointerLeave:ue(s.onPointerLeave,()=>{c()})})}),lU="SelectSeparator",TE=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return a.jsx(Re.div,{"aria-hidden":!0,...n,ref:t})});TE.displayName=lU;var Om="SelectArrow",cU=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=eh(r),o=Ro(Om,r),i=Po(Om,r);return o.open&&i.position==="popper"?a.jsx(rv,{...s,...n,ref:t}):null});cU.displayName=Om;function RE(e){return e===""||e===void 0}var PE=g.forwardRef((e,t)=>{const{value:r,...n}=e,s=g.useRef(null),o=Ke(t,s),i=ly(r);return g.useEffect(()=>{const l=s.current,c=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(i!==r&&d){const f=new Event("change",{bubbles:!0});d.call(l,r),l.dispatchEvent(f)}},[i,r]),a.jsx(Lc,{asChild:!0,children:a.jsx("select",{...n,ref:o,defaultValue:r})})});PE.displayName="BubbleSelect";function AE(e){const t=Dt(e),r=g.useRef(""),n=g.useRef(0),s=g.useCallback(i=>{const l=r.current+i;t(l),function c(u){r.current=u,window.clearTimeout(n.current),u!==""&&(n.current=window.setTimeout(()=>c(""),1e3))}(l)},[t]),o=g.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return g.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,s,o]}function DE(e,t,r){const s=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let i=uU(e,Math.max(o,0));s.length===1&&(i=i.filter(u=>u!==r));const c=i.find(u=>u.textValue.toLowerCase().startsWith(s.toLowerCase()));return c!==r?c:void 0}function uU(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var dU=oE,OE=aE,fU=cE,hU=uE,pU=dE,ME=fE,mU=gE,gU=yE,IE=wE,LE=bE,vU=SE,yU=CE,FE=jE,zE=EE,UE=TE;const Io=dU,fl=gU,Lo=fU,Qs=g.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(OE,{ref:n,className:oe("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[t,a.jsx(hU,{asChild:!0,children:a.jsx(Fg,{className:"h-4 w-4 opacity-50"})})]}));Qs.displayName=OE.displayName;const $E=g.forwardRef(({className:e,...t},r)=>a.jsx(FE,{ref:r,className:oe("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(CA,{className:"h-4 w-4"})}));$E.displayName=FE.displayName;const VE=g.forwardRef(({className:e,...t},r)=>a.jsx(zE,{ref:r,className:oe("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(Fg,{className:"h-4 w-4"})}));VE.displayName=zE.displayName;const Js=g.forwardRef(({className:e,children:t,position:r="popper",...n},s)=>a.jsx(pU,{children:a.jsxs(ME,{ref:s,className:oe("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:[a.jsx($E,{}),a.jsx(mU,{className:oe("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),a.jsx(VE,{})]})}));Js.displayName=ME.displayName;const Yi=g.forwardRef(({className:e,...t},r)=>a.jsx(IE,{ref:r,className:oe("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Yi.displayName=IE.displayName;const pn=g.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(LE,{ref:n,className:oe("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(yU,{children:a.jsx(lb,{className:"h-4 w-4"})})}),a.jsx(vU,{children:t})]}));pn.displayName=LE.displayName;const xU=g.forwardRef(({className:e,...t},r)=>a.jsx(UE,{ref:r,className:oe("-mx-1 my-1 h-px bg-muted",e),...t}));xU.displayName=UE.displayName;const Mm=new Map([["aliyun-cdn",["阿里云-CDN","/imgs/providers/aliyun.svg"]],["aliyun-oss",["阿里云-OSS","/imgs/providers/aliyun.svg"]],["aliyun-dcdn",["阿里云-DCDN","/imgs/providers/aliyun.svg"]],["tencent-cdn",["腾讯云-CDN","/imgs/providers/tencent.svg"]],["ssh",["SSH部署","/imgs/providers/ssh.svg"]],["qiniu-cdn",["七牛云-CDN","/imgs/providers/qiniu.svg"]],["webhook",["Webhook","/imgs/providers/webhook.svg"]],["local",["本地部署","/imgs/providers/local.svg"]]]),wU=Array.from(Mm.keys()),_y=xv,by=wv,_U=_v,BE=g.forwardRef(({className:e,...t},r)=>a.jsx(Tc,{ref:r,className:oe("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));BE.displayName=Tc.displayName;const th=g.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(_U,{children:[a.jsx(BE,{}),a.jsxs(Rc,{ref:n,className:oe("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r,children:[t,a.jsxs(Tf,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[a.jsx(zg,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));th.displayName=Rc.displayName;const rh=({className:e,...t})=>a.jsx("div",{className:oe("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});rh.displayName="DialogHeader";const nh=g.forwardRef(({className:e,...t},r)=>a.jsx(Pc,{ref:r,className:oe("text-lg font-semibold leading-none tracking-tight",e),...t}));nh.displayName=Pc.displayName;const bU=g.forwardRef(({className:e,...t},r)=>a.jsx(Ac,{ref:r,className:oe("text-sm text-muted-foreground",e),...t}));bU.displayName=Ac.displayName;function SU(e,t){return g.useReducer((r,n)=>t[r][n]??r,e)}var Sy="ScrollArea",[WE,oV]=sr(Sy),[kU,cn]=WE(Sy),HE=g.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:n="hover",dir:s,scrollHideDelay:o=600,...i}=e,[l,c]=g.useState(null),[u,d]=g.useState(null),[f,m]=g.useState(null),[v,x]=g.useState(null),[y,_]=g.useState(null),[p,h]=g.useState(0),[w,C]=g.useState(0),[j,E]=g.useState(!1),[R,P]=g.useState(!1),A=Ke(t,q=>c(q)),L=di(s);return a.jsx(kU,{scope:r,type:n,dir:L,scrollHideDelay:o,scrollArea:l,viewport:u,onViewportChange:d,content:f,onContentChange:m,scrollbarX:v,onScrollbarXChange:x,scrollbarXEnabled:j,onScrollbarXEnabledChange:E,scrollbarY:y,onScrollbarYChange:_,scrollbarYEnabled:R,onScrollbarYEnabledChange:P,onCornerWidthChange:h,onCornerHeightChange:C,children:a.jsx(Re.div,{dir:L,...i,ref:A,style:{position:"relative","--radix-scroll-area-corner-width":p+"px","--radix-scroll-area-corner-height":w+"px",...e.style}})})});HE.displayName=Sy;var YE="ScrollAreaViewport",KE=g.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:n,nonce:s,...o}=e,i=cn(YE,r),l=g.useRef(null),c=Ke(t,l,i.onViewportChange);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),a.jsx(Re.div,{"data-radix-scroll-area-viewport":"",...o,ref:c,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style},children:a.jsx("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});KE.displayName=YE;var Xn="ScrollAreaScrollbar",ky=g.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=cn(Xn,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:i}=s,l=e.orientation==="horizontal";return g.useEffect(()=>(l?o(!0):i(!0),()=>{l?o(!1):i(!1)}),[l,o,i]),s.type==="hover"?a.jsx(CU,{...n,ref:t,forceMount:r}):s.type==="scroll"?a.jsx(jU,{...n,ref:t,forceMount:r}):s.type==="auto"?a.jsx(GE,{...n,ref:t,forceMount:r}):s.type==="always"?a.jsx(Cy,{...n,ref:t}):null});ky.displayName=Xn;var CU=g.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=cn(Xn,e.__scopeScrollArea),[o,i]=g.useState(!1);return g.useEffect(()=>{const l=s.scrollArea;let c=0;if(l){const u=()=>{window.clearTimeout(c),i(!0)},d=()=>{c=window.setTimeout(()=>i(!1),s.scrollHideDelay)};return l.addEventListener("pointerenter",u),l.addEventListener("pointerleave",d),()=>{window.clearTimeout(c),l.removeEventListener("pointerenter",u),l.removeEventListener("pointerleave",d)}}},[s.scrollArea,s.scrollHideDelay]),a.jsx(or,{present:r||o,children:a.jsx(GE,{"data-state":o?"visible":"hidden",...n,ref:t})})}),jU=g.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=cn(Xn,e.__scopeScrollArea),o=e.orientation==="horizontal",i=oh(()=>c("SCROLL_END"),100),[l,c]=SU("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return g.useEffect(()=>{if(l==="idle"){const u=window.setTimeout(()=>c("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(u)}},[l,s.scrollHideDelay,c]),g.useEffect(()=>{const u=s.viewport,d=o?"scrollLeft":"scrollTop";if(u){let f=u[d];const m=()=>{const v=u[d];f!==v&&(c("SCROLL"),i()),f=v};return u.addEventListener("scroll",m),()=>u.removeEventListener("scroll",m)}},[s.viewport,o,c,i]),a.jsx(or,{present:r||l!=="hidden",children:a.jsx(Cy,{"data-state":l==="hidden"?"hidden":"visible",...n,ref:t,onPointerEnter:ue(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:ue(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),GE=g.forwardRef((e,t)=>{const r=cn(Xn,e.__scopeScrollArea),{forceMount:n,...s}=e,[o,i]=g.useState(!1),l=e.orientation==="horizontal",c=oh(()=>{if(r.viewport){const u=r.viewport.offsetWidth{const{orientation:r="vertical",...n}=e,s=cn(Xn,e.__scopeScrollArea),o=g.useRef(null),i=g.useRef(0),[l,c]=g.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=JE(l.viewport,l.content),d={...n,sizes:l,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:m=>o.current=m,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:m=>i.current=m};function f(m,v){return AU(m,i.current,l,v)}return r==="horizontal"?a.jsx(EU,{...d,ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const m=s.viewport.scrollLeft,v=jw(m,l,s.dir);o.current.style.transform=`translate3d(${v}px, 0, 0)`}},onWheelScroll:m=>{s.viewport&&(s.viewport.scrollLeft=m)},onDragScroll:m=>{s.viewport&&(s.viewport.scrollLeft=f(m,s.dir))}}):r==="vertical"?a.jsx(NU,{...d,ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const m=s.viewport.scrollTop,v=jw(m,l);o.current.style.transform=`translate3d(0, ${v}px, 0)`}},onWheelScroll:m=>{s.viewport&&(s.viewport.scrollTop=m)},onDragScroll:m=>{s.viewport&&(s.viewport.scrollTop=f(m))}}):null}),EU=g.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...s}=e,o=cn(Xn,e.__scopeScrollArea),[i,l]=g.useState(),c=g.useRef(null),u=Ke(t,c,o.onScrollbarXChange);return g.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),a.jsx(qE,{"data-orientation":"horizontal",...s,ref:u,sizes:r,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":sh(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,f)=>{if(o.viewport){const m=o.viewport.scrollLeft+d.deltaX;e.onWheelScroll(m),tN(m,f)&&d.preventDefault()}},onResize:()=>{c.current&&o.viewport&&i&&n({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:Zd(i.paddingLeft),paddingEnd:Zd(i.paddingRight)}})}})}),NU=g.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...s}=e,o=cn(Xn,e.__scopeScrollArea),[i,l]=g.useState(),c=g.useRef(null),u=Ke(t,c,o.onScrollbarYChange);return g.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),a.jsx(qE,{"data-orientation":"vertical",...s,ref:u,sizes:r,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":sh(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,f)=>{if(o.viewport){const m=o.viewport.scrollTop+d.deltaY;e.onWheelScroll(m),tN(m,f)&&d.preventDefault()}},onResize:()=>{c.current&&o.viewport&&i&&n({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:Zd(i.paddingTop),paddingEnd:Zd(i.paddingBottom)}})}})}),[TU,ZE]=WE(Xn),qE=g.forwardRef((e,t)=>{const{__scopeScrollArea:r,sizes:n,hasThumb:s,onThumbChange:o,onThumbPointerUp:i,onThumbPointerDown:l,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:d,onResize:f,...m}=e,v=cn(Xn,r),[x,y]=g.useState(null),_=Ke(t,A=>y(A)),p=g.useRef(null),h=g.useRef(""),w=v.viewport,C=n.content-n.viewport,j=Dt(d),E=Dt(c),R=oh(f,10);function P(A){if(p.current){const L=A.clientX-p.current.left,q=A.clientY-p.current.top;u({x:L,y:q})}}return g.useEffect(()=>{const A=L=>{const q=L.target;(x==null?void 0:x.contains(q))&&j(L,C)};return document.addEventListener("wheel",A,{passive:!1}),()=>document.removeEventListener("wheel",A,{passive:!1})},[w,x,C,j]),g.useEffect(E,[n,E]),ba(x,R),ba(v.content,R),a.jsx(TU,{scope:r,scrollbar:x,hasThumb:s,onThumbChange:Dt(o),onThumbPointerUp:Dt(i),onThumbPositionChange:E,onThumbPointerDown:Dt(l),children:a.jsx(Re.div,{...m,ref:_,style:{position:"absolute",...m.style},onPointerDown:ue(e.onPointerDown,A=>{A.button===0&&(A.target.setPointerCapture(A.pointerId),p.current=x.getBoundingClientRect(),h.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",v.viewport&&(v.viewport.style.scrollBehavior="auto"),P(A))}),onPointerMove:ue(e.onPointerMove,P),onPointerUp:ue(e.onPointerUp,A=>{const L=A.target;L.hasPointerCapture(A.pointerId)&&L.releasePointerCapture(A.pointerId),document.body.style.webkitUserSelect=h.current,v.viewport&&(v.viewport.style.scrollBehavior=""),p.current=null})})})}),Gd="ScrollAreaThumb",XE=g.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=ZE(Gd,e.__scopeScrollArea);return a.jsx(or,{present:r||s.hasThumb,children:a.jsx(RU,{ref:t,...n})})}),RU=g.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:n,...s}=e,o=cn(Gd,r),i=ZE(Gd,r),{onThumbPositionChange:l}=i,c=Ke(t,f=>i.onThumbChange(f)),u=g.useRef(),d=oh(()=>{u.current&&(u.current(),u.current=void 0)},100);return g.useEffect(()=>{const f=o.viewport;if(f){const m=()=>{if(d(),!u.current){const v=DU(f,l);u.current=v,l()}};return l(),f.addEventListener("scroll",m),()=>f.removeEventListener("scroll",m)}},[o.viewport,d,l]),a.jsx(Re.div,{"data-state":i.hasThumb?"visible":"hidden",...s,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:ue(e.onPointerDownCapture,f=>{const v=f.target.getBoundingClientRect(),x=f.clientX-v.left,y=f.clientY-v.top;i.onThumbPointerDown({x,y})}),onPointerUp:ue(e.onPointerUp,i.onThumbPointerUp)})});XE.displayName=Gd;var jy="ScrollAreaCorner",QE=g.forwardRef((e,t)=>{const r=cn(jy,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?a.jsx(PU,{...e,ref:t}):null});QE.displayName=jy;var PU=g.forwardRef((e,t)=>{const{__scopeScrollArea:r,...n}=e,s=cn(jy,r),[o,i]=g.useState(0),[l,c]=g.useState(0),u=!!(o&&l);return ba(s.scrollbarX,()=>{var f;const d=((f=s.scrollbarX)==null?void 0:f.offsetHeight)||0;s.onCornerHeightChange(d),c(d)}),ba(s.scrollbarY,()=>{var f;const d=((f=s.scrollbarY)==null?void 0:f.offsetWidth)||0;s.onCornerWidthChange(d),i(d)}),u?a.jsx(Re.div,{...n,ref:t,style:{width:o,height:l,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Zd(e){return e?parseInt(e,10):0}function JE(e,t){const r=e/t;return isNaN(r)?0:r}function sh(e){const t=JE(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function AU(e,t,r,n="ltr"){const s=sh(r),o=s/2,i=t||o,l=s-i,c=r.scrollbar.paddingStart+i,u=r.scrollbar.size-r.scrollbar.paddingEnd-l,d=r.content-r.viewport,f=n==="ltr"?[0,d]:[d*-1,0];return eN([c,u],f)(e)}function jw(e,t,r="ltr"){const n=sh(t),s=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-s,i=t.content-t.viewport,l=o-n,c=r==="ltr"?[0,i]:[i*-1,0],u=Tm(e,c);return eN([0,i],[0,l])(u)}function eN(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function tN(e,t){return e>0&&e{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function s(){const o={left:e.scrollLeft,top:e.scrollTop},i=r.left!==o.left,l=r.top!==o.top;(i||l)&&t(),r=o,n=window.requestAnimationFrame(s)}(),()=>window.cancelAnimationFrame(n)};function oh(e,t){const r=Dt(e),n=g.useRef(0);return g.useEffect(()=>()=>window.clearTimeout(n.current),[]),g.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function ba(e,t){const r=Dt(t);Jt(()=>{let n=0;if(e){const s=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return s.observe(e),()=>{window.cancelAnimationFrame(n),s.unobserve(e)}}},[e,r])}var rN=HE,OU=KE,MU=QE;const ih=g.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(rN,{ref:n,className:oe("relative overflow-hidden",e),...r,children:[a.jsx(OU,{className:"h-full w-full rounded-[inherit]",children:t}),a.jsx(nN,{}),a.jsx(MU,{})]}));ih.displayName=rN.displayName;const nN=g.forwardRef(({className:e,orientation:t="vertical",...r},n)=>a.jsx(ky,{ref:n,orientation:t,className:oe("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...r,children:a.jsx(XE,{className:"relative flex-1 rounded-full bg-border"})}));nN.displayName=ky.displayName;const mo=new Map([["tencent",["腾讯云","/imgs/providers/tencent.svg"]],["aliyun",["阿里云","/imgs/providers/aliyun.svg"]],["cloudflare",["Cloudflare","/imgs/providers/cloudflare.svg"]],["namesilo",["Namesilo","/imgs/providers/namesilo.svg"]],["godaddy",["GoDaddy","/imgs/providers/godaddy.svg"]],["qiniu",["七牛云","/imgs/providers/qiniu.svg"]],["ssh",["SSH部署","/imgs/providers/ssh.svg"]],["webhook",["Webhook","/imgs/providers/webhook.svg"]],["local",["本地部署","/imgs/providers/local.svg"]]]),Ew=e=>mo.get(e),Ls=ce.union([ce.literal("aliyun"),ce.literal("tencent"),ce.literal("ssh"),ce.literal("webhook"),ce.literal("cloudflare"),ce.literal("qiniu"),ce.literal("namesilo"),ce.literal("godaddy"),ce.literal("local")],{message:"请选择云服务商"}),Fs=e=>{switch(e){case"aliyun":case"tencent":return"all";case"ssh":case"webhook":case"qiniu":case"local":return"deploy";case"cloudflare":case"namesilo":case"godaddy":return"apply";default:return"all"}},IU=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=Ar(),s=ce.object({id:ce.string().optional(),name:ce.string().min(1).max(64),configType:Ls,secretId:ce.string().min(1).max(64),secretKey:ce.string().min(1).max(64)});let o={secretId:"",secretKey:""};e&&(o=e.config);const i=fr({resolver:hr(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"tencent",secretId:o.secretId,secretKey:o.secretKey}}),l=async c=>{const u={id:c.id,name:c.name,configType:c.configType,usage:Fs(c.configType),config:{secretId:c.secretId,secretKey:c.secretKey}};try{const d=await Ms(u);if(t(),u.id=d.id,u.created=d.created,u.updated=d.updated,c.id){n(u);return}r(u)}catch(d){Object.entries(d.response.data).forEach(([m,v])=>{i.setError(m,{type:"manual",message:v.message})})}};return a.jsx(a.Fragment,{children:a.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:a.jsx(pr,{...i,children:a.jsxs("form",{onSubmit:c=>{c.stopPropagation(),i.handleSubmit(l)(c)},className:"space-y-8",children:[a.jsx(Se,{control:i.control,name:"name",render:({field:c})=>a.jsxs(we,{children:[a.jsx(_e,{children:"名称"}),a.jsx(be,{children:a.jsx(Ne,{placeholder:"请输入授权名称",...c})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:i.control,name:"id",render:({field:c})=>a.jsxs(we,{className:"hidden",children:[a.jsx(_e,{children:"配置类型"}),a.jsx(be,{children:a.jsx(Ne,{...c})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:i.control,name:"configType",render:({field:c})=>a.jsxs(we,{className:"hidden",children:[a.jsx(_e,{children:"配置类型"}),a.jsx(be,{children:a.jsx(Ne,{...c})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:i.control,name:"secretId",render:({field:c})=>a.jsxs(we,{children:[a.jsx(_e,{children:"SecretId"}),a.jsx(be,{children:a.jsx(Ne,{placeholder:"请输入SecretId",...c})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:i.control,name:"secretKey",render:({field:c})=>a.jsxs(we,{children:[a.jsx(_e,{children:"SecretKey"}),a.jsx(be,{children:a.jsx(Ne,{placeholder:"请输入SecretKey",...c})}),a.jsx(ge,{})]})}),a.jsx("div",{className:"flex justify-end",children:a.jsx(He,{type:"submit",children:"保存"})})]})})})})},LU=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=Ar(),s=ce.object({id:ce.string().optional(),name:ce.string().min(1).max(64),configType:Ls,accessKeyId:ce.string().min(1).max(64),accessSecretId:ce.string().min(1).max(64)});let o={accessKeyId:"",accessKeySecret:""};e&&(o=e.config);const i=fr({resolver:hr(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"aliyun",accessKeyId:o.accessKeyId,accessSecretId:o.accessKeySecret}}),l=async c=>{const u={id:c.id,name:c.name,configType:c.configType,usage:Fs(c.configType),config:{accessKeyId:c.accessKeyId,accessKeySecret:c.accessSecretId}};try{const d=await Ms(u);if(t(),u.id=d.id,u.created=d.created,u.updated=d.updated,c.id){n(u);return}r(u)}catch(d){Object.entries(d.response.data).forEach(([m,v])=>{i.setError(m,{type:"manual",message:v.message})});return}};return a.jsx(a.Fragment,{children:a.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:a.jsx(pr,{...i,children:a.jsxs("form",{onSubmit:c=>{c.stopPropagation(),i.handleSubmit(l)(c)},className:"space-y-8",children:[a.jsx(Se,{control:i.control,name:"name",render:({field:c})=>a.jsxs(we,{children:[a.jsx(_e,{children:"名称"}),a.jsx(be,{children:a.jsx(Ne,{placeholder:"请输入授权名称",...c})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:i.control,name:"id",render:({field:c})=>a.jsxs(we,{className:"hidden",children:[a.jsx(_e,{children:"配置类型"}),a.jsx(be,{children:a.jsx(Ne,{...c})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:i.control,name:"configType",render:({field:c})=>a.jsxs(we,{className:"hidden",children:[a.jsx(_e,{children:"配置类型"}),a.jsx(be,{children:a.jsx(Ne,{...c})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:i.control,name:"accessKeyId",render:({field:c})=>a.jsxs(we,{children:[a.jsx(_e,{children:"AccessKeyId"}),a.jsx(be,{children:a.jsx(Ne,{placeholder:"请输入AccessKeyId",...c})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:i.control,name:"accessSecretId",render:({field:c})=>a.jsxs(we,{children:[a.jsx(_e,{children:"AccessKeySecret"}),a.jsx(be,{children:a.jsx(Ne,{placeholder:"请输入AccessKeySecret",...c})}),a.jsx(ge,{})]})}),a.jsx(ge,{}),a.jsx("div",{className:"flex justify-end",children:a.jsx(He,{type:"submit",children:"保存"})})]})})})})},Sa=g.forwardRef(({className:e,...t},r)=>a.jsx("textarea",{className:oe("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...t}));Sa.displayName="Textarea";const Ey=({className:e,trigger:t})=>{const{reloadAccessGroups:r}=Ar(),[n,s]=g.useState(!1),o=ce.object({name:ce.string().min(1).max(64)}),i=fr({resolver:hr(o),defaultValues:{name:""}}),l=async c=>{try{await $3({name:c.name}),r(),s(!1)}catch(u){Object.entries(u.response.data).forEach(([f,m])=>{i.setError(f,{type:"manual",message:m.message})})}};return a.jsxs(_y,{onOpenChange:s,open:n,children:[a.jsx(by,{asChild:!0,className:oe(e),children:t}),a.jsxs(th,{className:"sm:max-w-[600px] w-full dark:text-stone-200",children:[a.jsx(rh,{children:a.jsx(nh,{children:"添加分组"})}),a.jsx("div",{className:"container py-3",children:a.jsx(pr,{...i,children:a.jsxs("form",{onSubmit:c=>{console.log(c),c.stopPropagation(),i.handleSubmit(l)(c)},className:"space-y-8",children:[a.jsx(Se,{control:i.control,name:"name",render:({field:c})=>a.jsxs(we,{children:[a.jsx(_e,{children:"组名"}),a.jsx(be,{children:a.jsx(Ne,{placeholder:"请输入组名",...c,type:"text"})}),a.jsx(ge,{})]})}),a.jsx("div",{className:"flex justify-end",children:a.jsx(He,{type:"submit",children:"保存"})})]})})})]})]})},FU=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n,reloadAccessGroups:s,config:{accessGroups:o}}=Ar(),i=g.useRef(null),[l,c]=g.useState(""),u=e&&e.group?e.group:"",d=/^(?:\*\.)?([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}$/,f=/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,m=ce.object({id:ce.string().optional(),name:ce.string().min(1).max(64),configType:Ls,host:ce.string().refine(h=>f.test(h)||d.test(h),{message:"请输入正确的域名或IP"}),group:ce.string().optional(),port:ce.string().min(1).max(5),username:ce.string().min(1).max(64),password:ce.string().min(0).max(64),key:ce.string().min(0).max(20480),keyFile:ce.any().optional(),command:ce.string().min(1).max(2048),certPath:ce.string().min(0).max(2048),keyPath:ce.string().min(0).max(2048)});let v={host:"127.0.0.1",port:"22",username:"root",password:"",key:"",keyFile:"",command:"sudo service nginx restart",certPath:"/etc/nginx/ssl/certificate.crt",keyPath:"/etc/nginx/ssl/private.key"};e&&(v=e.config);const x=fr({resolver:hr(m),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"ssh",group:e==null?void 0:e.group,host:v.host,port:v.port,username:v.username,password:v.password,key:v.key,keyFile:v.keyFile,certPath:v.certPath,keyPath:v.keyPath,command:v.command}}),y=async h=>{console.log(h);let w=h.group;w=="emptyId"&&(w="");const C={id:h.id,name:h.name,configType:h.configType,usage:Fs(h.configType),group:w,config:{host:h.host,port:h.port,username:h.username,password:h.password,key:h.key,command:h.command,certPath:h.certPath,keyPath:h.keyPath}};try{const j=await Ms(C);t(),C.id=j.id,C.created=j.created,C.updated=j.updated,h.id?n(C):r(C),w!=u&&(u&&await dw({id:u,"access-":C.id}),w&&await dw({id:w,"access+":C.id})),s()}catch(j){Object.entries(j.response.data).forEach(([R,P])=>{x.setError(R,{type:"manual",message:P.message})});return}},_=async h=>{var E;const w=(E=h.target.files)==null?void 0:E[0];if(!w)return;const C=w;c(C.name);const j=await fz(C);x.setValue("key",j)},p=()=>{var h;console.log(i.current),(h=i.current)==null||h.click()};return a.jsx(a.Fragment,{children:a.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:a.jsx(pr,{...x,children:a.jsxs("form",{onSubmit:h=>{h.stopPropagation(),x.handleSubmit(y)(h)},className:"space-y-3",children:[a.jsx(Se,{control:x.control,name:"name",render:({field:h})=>a.jsxs(we,{children:[a.jsx(_e,{children:"名称"}),a.jsx(be,{children:a.jsx(Ne,{placeholder:"请输入授权名称",...h})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:x.control,name:"group",render:({field:h})=>a.jsxs(we,{children:[a.jsxs(_e,{className:"w-full flex justify-between",children:[a.jsx("div",{children:"授权配置组(用于将一个域名证书部署到多个 ssh 主机)"}),a.jsx(Ey,{trigger:a.jsxs("div",{className:"font-normal text-primary hover:underline cursor-pointer flex items-center",children:[a.jsx(Uu,{size:14}),"新增"]})})]}),a.jsx(be,{children:a.jsxs(Io,{...h,value:h.value,defaultValue:"emptyId",onValueChange:w=>{x.setValue("group",w)},children:[a.jsx(Qs,{children:a.jsx(Lo,{placeholder:"请选择分组"})}),a.jsxs(Js,{children:[a.jsx(pn,{value:"emptyId",children:a.jsx("div",{className:oe("flex items-center space-x-2 rounded cursor-pointer"),children:"--"})}),o.map(w=>a.jsx(pn,{value:w.id?w.id:"",children:a.jsx("div",{className:oe("flex items-center space-x-2 rounded cursor-pointer"),children:w.name})},w.id))]})]})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:x.control,name:"id",render:({field:h})=>a.jsxs(we,{className:"hidden",children:[a.jsx(_e,{children:"配置类型"}),a.jsx(be,{children:a.jsx(Ne,{...h})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:x.control,name:"configType",render:({field:h})=>a.jsxs(we,{className:"hidden",children:[a.jsx(_e,{children:"配置类型"}),a.jsx(be,{children:a.jsx(Ne,{...h})}),a.jsx(ge,{})]})}),a.jsxs("div",{className:"flex space-x-2",children:[a.jsx(Se,{control:x.control,name:"host",render:({field:h})=>a.jsxs(we,{className:"grow",children:[a.jsx(_e,{children:"服务器HOST"}),a.jsx(be,{children:a.jsx(Ne,{placeholder:"请输入Host",...h})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:x.control,name:"port",render:({field:h})=>a.jsxs(we,{children:[a.jsx(_e,{children:"SSH端口"}),a.jsx(be,{children:a.jsx(Ne,{placeholder:"请输入Port",...h,type:"number"})}),a.jsx(ge,{})]})})]}),a.jsx(Se,{control:x.control,name:"username",render:({field:h})=>a.jsxs(we,{children:[a.jsx(_e,{children:"用户名"}),a.jsx(be,{children:a.jsx(Ne,{placeholder:"请输入用户名",...h})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:x.control,name:"password",render:({field:h})=>a.jsxs(we,{children:[a.jsx(_e,{children:"密码"}),a.jsx(be,{children:a.jsx(Ne,{placeholder:"请输入密码",...h,type:"password"})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:x.control,name:"key",render:({field:h})=>a.jsxs(we,{hidden:!0,children:[a.jsx(_e,{children:"Key(使用证书登录)"}),a.jsx(be,{children:a.jsx(Ne,{placeholder:"请输入Key",...h})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:x.control,name:"keyFile",render:({field:h})=>a.jsxs(we,{children:[a.jsx(_e,{children:"Key(使用证书登录)"}),a.jsx(be,{children:a.jsxs("div",{children:[a.jsx(He,{type:"button",variant:"secondary",size:"sm",className:"w-48",onClick:p,children:l||"请选择文件"}),a.jsx(Ne,{placeholder:"请输入Key",...h,ref:i,className:"hidden",hidden:!0,type:"file",onChange:_})]})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:x.control,name:"certPath",render:({field:h})=>a.jsxs(we,{children:[a.jsx(_e,{children:"证书上传路径"}),a.jsx(be,{children:a.jsx(Ne,{placeholder:"请输入证书上传路径",...h})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:x.control,name:"keyPath",render:({field:h})=>a.jsxs(we,{children:[a.jsx(_e,{children:"私钥上传路径"}),a.jsx(be,{children:a.jsx(Ne,{placeholder:"请输入私钥上传路径",...h})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:x.control,name:"command",render:({field:h})=>a.jsxs(we,{children:[a.jsx(_e,{children:"Command"}),a.jsx(be,{children:a.jsx(Sa,{placeholder:"请输入要执行的命令",...h})}),a.jsx(ge,{})]})}),a.jsx(ge,{}),a.jsx("div",{className:"flex justify-end",children:a.jsx(He,{type:"submit",children:"保存"})})]})})})})},zU=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=Ar(),s=ce.object({id:ce.string().optional(),name:ce.string().min(1).max(64),configType:Ls,url:ce.string().url()});let o={url:""};e&&(o=e.config);const i=fr({resolver:hr(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"webhook",url:o.url}}),l=async c=>{console.log(c);const u={id:c.id,name:c.name,configType:c.configType,usage:Fs(c.configType),config:{url:c.url}};try{const d=await Ms(u);if(t(),u.id=d.id,u.created=d.created,u.updated=d.updated,c.id){n(u);return}r(u)}catch(d){Object.entries(d.response.data).forEach(([m,v])=>{i.setError(m,{type:"manual",message:v.message})})}};return a.jsx(a.Fragment,{children:a.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:a.jsx(pr,{...i,children:a.jsxs("form",{onSubmit:c=>{console.log(c),c.stopPropagation(),i.handleSubmit(l)(c)},className:"space-y-8",children:[a.jsx(Se,{control:i.control,name:"name",render:({field:c})=>a.jsxs(we,{children:[a.jsx(_e,{children:"名称"}),a.jsx(be,{children:a.jsx(Ne,{placeholder:"请输入授权名称",...c})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:i.control,name:"id",render:({field:c})=>a.jsxs(we,{className:"hidden",children:[a.jsx(_e,{children:"配置类型"}),a.jsx(be,{children:a.jsx(Ne,{...c})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:i.control,name:"configType",render:({field:c})=>a.jsxs(we,{className:"hidden",children:[a.jsx(_e,{children:"配置类型"}),a.jsx(be,{children:a.jsx(Ne,{...c})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:i.control,name:"url",render:({field:c})=>a.jsxs(we,{children:[a.jsx(_e,{children:"Webhook Url"}),a.jsx(be,{children:a.jsx(Ne,{placeholder:"请输入Webhook Url",...c})}),a.jsx(ge,{})]})}),a.jsx("div",{className:"flex justify-end",children:a.jsx(He,{type:"submit",children:"保存"})})]})})})})},UU=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=Ar(),s=ce.object({id:ce.string().optional(),name:ce.string().min(1).max(64),configType:Ls,dnsApiToken:ce.string().min(1).max(64)});let o={dnsApiToken:""};e&&(o=e.config);const i=fr({resolver:hr(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"cloudflare",dnsApiToken:o.dnsApiToken}}),l=async c=>{console.log(c);const u={id:c.id,name:c.name,configType:c.configType,usage:Fs(c.configType),config:{dnsApiToken:c.dnsApiToken}};try{const d=await Ms(u);if(t(),u.id=d.id,u.created=d.created,u.updated=d.updated,c.id){n(u);return}r(u)}catch(d){Object.entries(d.response.data).forEach(([m,v])=>{i.setError(m,{type:"manual",message:v.message})})}};return a.jsx(a.Fragment,{children:a.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:a.jsx(pr,{...i,children:a.jsxs("form",{onSubmit:c=>{console.log(c),c.stopPropagation(),i.handleSubmit(l)(c)},className:"space-y-8",children:[a.jsx(Se,{control:i.control,name:"name",render:({field:c})=>a.jsxs(we,{children:[a.jsx(_e,{children:"名称"}),a.jsx(be,{children:a.jsx(Ne,{placeholder:"请输入授权名称",...c})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:i.control,name:"id",render:({field:c})=>a.jsxs(we,{className:"hidden",children:[a.jsx(_e,{children:"配置类型"}),a.jsx(be,{children:a.jsx(Ne,{...c})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:i.control,name:"configType",render:({field:c})=>a.jsxs(we,{className:"hidden",children:[a.jsx(_e,{children:"配置类型"}),a.jsx(be,{children:a.jsx(Ne,{...c})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:i.control,name:"dnsApiToken",render:({field:c})=>a.jsxs(we,{children:[a.jsx(_e,{children:"CLOUD_DNS_API_TOKEN"}),a.jsx(be,{children:a.jsx(Ne,{placeholder:"请输入CLOUD_DNS_API_TOKEN",...c})}),a.jsx(ge,{})]})}),a.jsx("div",{className:"flex justify-end",children:a.jsx(He,{type:"submit",children:"保存"})})]})})})})},$U=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=Ar(),s=ce.object({id:ce.string().optional(),name:ce.string().min(1).max(64),configType:Ls,accessKey:ce.string().min(1).max(64),secretKey:ce.string().min(1).max(64)});let o={accessKey:"",secretKey:""};e&&(o=e.config);const i=fr({resolver:hr(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"qiniu",accessKey:o.accessKey,secretKey:o.secretKey}}),l=async c=>{const u={id:c.id,name:c.name,configType:c.configType,usage:Fs(c.configType),config:{accessKey:c.accessKey,secretKey:c.secretKey}};try{const d=await Ms(u);if(t(),u.id=d.id,u.created=d.created,u.updated=d.updated,c.id){n(u);return}r(u)}catch(d){Object.entries(d.response.data).forEach(([m,v])=>{i.setError(m,{type:"manual",message:v.message})});return}};return a.jsx(a.Fragment,{children:a.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:a.jsx(pr,{...i,children:a.jsxs("form",{onSubmit:c=>{c.stopPropagation(),i.handleSubmit(l)(c)},className:"space-y-8",children:[a.jsx(Se,{control:i.control,name:"name",render:({field:c})=>a.jsxs(we,{children:[a.jsx(_e,{children:"名称"}),a.jsx(be,{children:a.jsx(Ne,{placeholder:"请输入授权名称",...c})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:i.control,name:"id",render:({field:c})=>a.jsxs(we,{className:"hidden",children:[a.jsx(_e,{children:"配置类型"}),a.jsx(be,{children:a.jsx(Ne,{...c})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:i.control,name:"configType",render:({field:c})=>a.jsxs(we,{className:"hidden",children:[a.jsx(_e,{children:"配置类型"}),a.jsx(be,{children:a.jsx(Ne,{...c})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:i.control,name:"accessKey",render:({field:c})=>a.jsxs(we,{children:[a.jsx(_e,{children:"AccessKey"}),a.jsx(be,{children:a.jsx(Ne,{placeholder:"请输入AccessKey",...c})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:i.control,name:"secretKey",render:({field:c})=>a.jsxs(we,{children:[a.jsx(_e,{children:"SecretKey"}),a.jsx(be,{children:a.jsx(Ne,{placeholder:"请输入SecretKey",...c})}),a.jsx(ge,{})]})}),a.jsx(ge,{}),a.jsx("div",{className:"flex justify-end",children:a.jsx(He,{type:"submit",children:"保存"})})]})})})})},VU=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=Ar(),s=ce.object({id:ce.string().optional(),name:ce.string().min(1).max(64),configType:Ls,apiKey:ce.string().min(1).max(64)});let o={apiKey:""};e&&(o=e.config);const i=fr({resolver:hr(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"namesilo",apiKey:o.apiKey}}),l=async c=>{console.log(c);const u={id:c.id,name:c.name,configType:c.configType,usage:Fs(c.configType),config:{apiKey:c.apiKey}};try{const d=await Ms(u);if(t(),u.id=d.id,u.created=d.created,u.updated=d.updated,c.id){n(u);return}r(u)}catch(d){Object.entries(d.response.data).forEach(([m,v])=>{i.setError(m,{type:"manual",message:v.message})})}};return a.jsx(a.Fragment,{children:a.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:a.jsx(pr,{...i,children:a.jsxs("form",{onSubmit:c=>{console.log(c),c.stopPropagation(),i.handleSubmit(l)(c)},className:"space-y-8",children:[a.jsx(Se,{control:i.control,name:"name",render:({field:c})=>a.jsxs(we,{children:[a.jsx(_e,{children:"名称"}),a.jsx(be,{children:a.jsx(Ne,{placeholder:"请输入授权名称",...c})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:i.control,name:"id",render:({field:c})=>a.jsxs(we,{className:"hidden",children:[a.jsx(_e,{children:"配置类型"}),a.jsx(be,{children:a.jsx(Ne,{...c})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:i.control,name:"configType",render:({field:c})=>a.jsxs(we,{className:"hidden",children:[a.jsx(_e,{children:"配置类型"}),a.jsx(be,{children:a.jsx(Ne,{...c})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:i.control,name:"apiKey",render:({field:c})=>a.jsxs(we,{children:[a.jsx(_e,{children:"NAMESILO_API_KEY"}),a.jsx(be,{children:a.jsx(Ne,{placeholder:"请输入NAMESILO_API_KEY",...c})}),a.jsx(ge,{})]})}),a.jsx("div",{className:"flex justify-end",children:a.jsx(He,{type:"submit",children:"保存"})})]})})})})},BU=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=Ar(),s=ce.object({id:ce.string().optional(),name:ce.string().min(1).max(64),configType:Ls,apiKey:ce.string().min(1).max(64),apiSecret:ce.string().min(1).max(64)});let o={apiKey:"",apiSecret:""};e&&(o=e.config);const i=fr({resolver:hr(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"godaddy",apiKey:o.apiKey,apiSecret:o.apiSecret}}),l=async c=>{console.log(c);const u={id:c.id,name:c.name,configType:c.configType,usage:Fs(c.configType),config:{apiKey:c.apiKey,apiSecret:c.apiSecret}};try{const d=await Ms(u);if(t(),u.id=d.id,u.created=d.created,u.updated=d.updated,c.id){n(u);return}r(u)}catch(d){Object.entries(d.response.data).forEach(([m,v])=>{i.setError(m,{type:"manual",message:v.message})})}};return a.jsx(a.Fragment,{children:a.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:a.jsx(pr,{...i,children:a.jsxs("form",{onSubmit:c=>{console.log(c),c.stopPropagation(),i.handleSubmit(l)(c)},className:"space-y-8",children:[a.jsx(Se,{control:i.control,name:"name",render:({field:c})=>a.jsxs(we,{children:[a.jsx(_e,{children:"名称"}),a.jsx(be,{children:a.jsx(Ne,{placeholder:"请输入授权名称",...c})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:i.control,name:"id",render:({field:c})=>a.jsxs(we,{className:"hidden",children:[a.jsx(_e,{children:"配置类型"}),a.jsx(be,{children:a.jsx(Ne,{...c})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:i.control,name:"configType",render:({field:c})=>a.jsxs(we,{className:"hidden",children:[a.jsx(_e,{children:"配置类型"}),a.jsx(be,{children:a.jsx(Ne,{...c})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:i.control,name:"apiKey",render:({field:c})=>a.jsxs(we,{children:[a.jsx(_e,{children:"GODADDY_API_KEY"}),a.jsx(be,{children:a.jsx(Ne,{placeholder:"请输入GODADDY_API_KEY",...c})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:i.control,name:"apiSecret",render:({field:c})=>a.jsxs(we,{children:[a.jsx(_e,{children:"GODADDY_API_SECRET"}),a.jsx(be,{children:a.jsx(Ne,{placeholder:"请输入GODADDY_API_SECRET",...c})}),a.jsx(ge,{})]})}),a.jsx("div",{className:"flex justify-end",children:a.jsx(He,{type:"submit",children:"保存"})})]})})})})},WU=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n,reloadAccessGroups:s}=Ar(),o=ce.object({id:ce.string().optional(),name:ce.string().min(1).max(64),configType:Ls,command:ce.string().min(1).max(2048),certPath:ce.string().min(0).max(2048),keyPath:ce.string().min(0).max(2048)});let i={command:"sudo service nginx restart",certPath:"/etc/nginx/ssl/certificate.crt",keyPath:"/etc/nginx/ssl/private.key"};e&&(i=e.config);const l=fr({resolver:hr(o),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"local",certPath:i.certPath,keyPath:i.keyPath,command:i.command}}),c=async u=>{const d={id:u.id,name:u.name,configType:u.configType,usage:Fs(u.configType),config:{command:u.command,certPath:u.certPath,keyPath:u.keyPath}};try{const f=await Ms(d);t(),d.id=f.id,d.created=f.created,d.updated=f.updated,u.id?n(d):r(d),s()}catch(f){Object.entries(f.response.data).forEach(([v,x])=>{l.setError(v,{type:"manual",message:x.message})});return}};return a.jsx(a.Fragment,{children:a.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:a.jsx(pr,{...l,children:a.jsxs("form",{onSubmit:u=>{u.stopPropagation(),l.handleSubmit(c)(u)},className:"space-y-3",children:[a.jsx(Se,{control:l.control,name:"name",render:({field:u})=>a.jsxs(we,{children:[a.jsx(_e,{children:"名称"}),a.jsx(be,{children:a.jsx(Ne,{placeholder:"请输入授权名称",...u})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:l.control,name:"id",render:({field:u})=>a.jsxs(we,{className:"hidden",children:[a.jsx(_e,{children:"配置类型"}),a.jsx(be,{children:a.jsx(Ne,{...u})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:l.control,name:"configType",render:({field:u})=>a.jsxs(we,{className:"hidden",children:[a.jsx(_e,{children:"配置类型"}),a.jsx(be,{children:a.jsx(Ne,{...u})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:l.control,name:"certPath",render:({field:u})=>a.jsxs(we,{children:[a.jsx(_e,{children:"证书保存路径"}),a.jsx(be,{children:a.jsx(Ne,{placeholder:"请输入证书上传路径",...u})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:l.control,name:"keyPath",render:({field:u})=>a.jsxs(we,{children:[a.jsx(_e,{children:"私钥保存路径"}),a.jsx(be,{children:a.jsx(Ne,{placeholder:"请输入私钥上传路径",...u})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:l.control,name:"command",render:({field:u})=>a.jsxs(we,{children:[a.jsx(_e,{children:"Command"}),a.jsx(be,{children:a.jsx(Sa,{placeholder:"请输入要执行的命令",...u})}),a.jsx(ge,{})]})}),a.jsx(ge,{}),a.jsx("div",{className:"flex justify-end",children:a.jsx(He,{type:"submit",children:"保存"})})]})})})})};function Tl({trigger:e,op:t,data:r,className:n}){const[s,o]=g.useState(!1),i=Array.from(mo.keys()),[l,c]=g.useState((r==null?void 0:r.configType)||"");let u=a.jsx(a.Fragment,{children:" "});switch(l){case"tencent":u=a.jsx(IU,{data:r,onAfterReq:()=>{o(!1)}});break;case"aliyun":u=a.jsx(LU,{data:r,onAfterReq:()=>{o(!1)}});break;case"ssh":u=a.jsx(FU,{data:r,onAfterReq:()=>{o(!1)}});break;case"webhook":u=a.jsx(zU,{data:r,onAfterReq:()=>{o(!1)}});break;case"cloudflare":u=a.jsx(UU,{data:r,onAfterReq:()=>{o(!1)}});break;case"qiniu":u=a.jsx($U,{data:r,onAfterReq:()=>{o(!1)}});break;case"namesilo":u=a.jsx(VU,{data:r,onAfterReq:()=>{o(!1)}});break;case"godaddy":u=a.jsx(BU,{data:r,onAfterReq:()=>{o(!1)}});break;case"local":u=a.jsx(WU,{data:r,onAfterReq:()=>{o(!1)}});break}const d=f=>f==l?"border-primary":"";return a.jsxs(_y,{onOpenChange:o,open:s,children:[a.jsx(by,{asChild:!0,className:oe(n),children:e}),a.jsxs(th,{className:"sm:max-w-[600px] w-full dark:text-stone-200",children:[a.jsx(rh,{children:a.jsxs(nh,{children:[t=="add"?"添加":"编辑","授权"]})}),a.jsx(ih,{className:"max-h-[80vh]",children:a.jsxs("div",{className:"container py-3",children:[a.jsx(Co,{children:"服务商"}),a.jsxs(Io,{onValueChange:f=>{console.log(f),c(f)},defaultValue:l,children:[a.jsx(Qs,{className:"mt-3",children:a.jsx(Lo,{placeholder:"请选择服务商"})}),a.jsx(Js,{children:a.jsxs(fl,{children:[a.jsx(Yi,{children:"服务商"}),i.map(f=>{var m,v;return a.jsx(pn,{value:f,children:a.jsxs("div",{className:oe("flex items-center space-x-2 rounded cursor-pointer",d(f)),children:[a.jsx("img",{src:(m=mo.get(f))==null?void 0:m[1],className:"h-6 w-6"}),a.jsx("div",{children:(v=mo.get(f))==null?void 0:v[0]})]})},f)})]})})]}),u]})})]})]})}const HU=({className:e,trigger:t})=>{const{config:{emails:r},setEmails:n}=Ar(),[s,o]=g.useState(!1),i=ce.object({email:ce.string().email()}),l=fr({resolver:hr(i),defaultValues:{email:""}}),c=async u=>{if(r.content.emails.includes(u.email)){l.setError("email",{message:"邮箱已存在"});return}const d=[...r.content.emails,u.email];try{const f=await Fa({...r,name:"emails",content:{emails:d}});n(f),l.reset(),l.clearErrors(),o(!1)}catch(f){Object.entries(f.response.data).forEach(([v,x])=>{l.setError(v,{type:"manual",message:x.message})})}};return a.jsxs(_y,{onOpenChange:o,open:s,children:[a.jsx(by,{asChild:!0,className:oe(e),children:t}),a.jsxs(th,{className:"sm:max-w-[600px] w-full dark:text-stone-200",children:[a.jsx(rh,{children:a.jsx(nh,{children:"添加邮箱"})}),a.jsx("div",{className:"container py-3",children:a.jsx(pr,{...l,children:a.jsxs("form",{onSubmit:u=>{console.log(u),u.stopPropagation(),l.handleSubmit(c)(u)},className:"space-y-8",children:[a.jsx(Se,{control:l.control,name:"email",render:({field:u})=>a.jsxs(we,{children:[a.jsx(_e,{children:"邮箱"}),a.jsx(be,{children:a.jsx(Ne,{placeholder:"请输入邮箱",...u,type:"email"})}),a.jsx(ge,{})]})}),a.jsx("div",{className:"flex justify-end",children:a.jsx(He,{type:"submit",children:"保存"})})]})})})]})]})},YU=()=>{const{config:{accesses:e,emails:t,accessGroups:r}}=Ar(),[n,s]=g.useState(),o=Nn(),[i,l]=g.useState("base"),[c,u]=g.useState(n?n.targetType:"");g.useEffect(()=>{const p=new URLSearchParams(o.search).get("id");p&&(async()=>{const w=await vz(p);s(w),u(w.targetType)})()},[o.search]);const d=ce.object({id:ce.string().optional(),domain:ce.string().regex(/^(?:\*\.)?([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}$/,{message:"请输入正确的域名"}),email:ce.string().email().optional(),access:ce.string().regex(/^[a-zA-Z0-9]+$/,{message:"请选择DNS服务商授权配置"}),targetAccess:ce.string().optional(),targetType:ce.string().regex(/^[a-zA-Z0-9-]+$/,{message:"请选择部署服务类型"}),variables:ce.string().optional(),group:ce.string().optional(),nameservers:ce.string().optional()}),f=fr({resolver:hr(d),defaultValues:{id:"",domain:"",email:"",access:"",targetAccess:"",targetType:"",variables:"",group:"",nameservers:""}});g.useEffect(()=>{n&&f.reset({id:n.id,domain:n.domain,email:n.email,access:n.access,targetAccess:n.targetAccess,targetType:n.targetType,variables:n.variables,group:n.group,nameservers:n.nameservers})},[n,f]);const m=e.filter(_=>{if(_.usage=="apply")return!1;if(c=="")return!0;const p=c.split("-");return _.configType===p[0]}),{toast:v}=Pn(),x=Pr(),y=async _=>{const p=_.group=="emptyId"?"":_.group,h=_.targetAccess==="emptyId"?"":_.targetAccess;if(p==""&&h==""){f.setError("group",{type:"manual",message:"部署授权和部署授权组至少选一个"}),f.setError("targetAccess",{type:"manual",message:"部署授权和部署授权组至少选一个"});return}const w={id:_.id,crontab:"0 0 * * *",domain:_.domain,email:_.email,access:_.access,group:p,targetAccess:h,targetType:_.targetType,variables:_.variables,nameservers:_.nameservers};try{await km(w);let C="域名编辑成功";w.id==""&&(C="域名添加成功"),v({title:"成功",description:C}),x("/domains")}catch(C){Object.entries(C.response.data).forEach(([E,R])=>{f.setError(E,{type:"manual",message:R.message})});return}};return a.jsx(a.Fragment,{children:a.jsxs("div",{className:"",children:[a.jsx(hy,{}),a.jsxs("div",{className:" h-5 text-muted-foreground",children:[n!=null&&n.id?"编辑":"新增","域名"]}),a.jsxs("div",{className:"mt-5 flex w-full justify-center md:space-x-10 flex-col md:flex-row",children:[a.jsxs("div",{className:"w-full md:w-[200px] text-muted-foreground space-x-3 md:space-y-3 flex-row md:flex-col flex",children:[a.jsx("div",{className:oe("cursor-pointer text-right",i==="base"?"text-primary":""),onClick:()=>{l("base")},children:"基础设置"}),a.jsx("div",{className:oe("cursor-pointer text-right",i==="advance"?"text-primary":""),onClick:()=>{l("advance")},children:"高级设置"})]}),a.jsx("div",{className:"w-full md:w-[35em] bg-gray-100 dark:bg-gray-900 p-5 rounded mt-3 md:mt-0",children:a.jsx(pr,{...f,children:a.jsxs("form",{onSubmit:f.handleSubmit(y),className:"space-y-8 dark:text-stone-200",children:[a.jsx(Se,{control:f.control,name:"domain",render:({field:_})=>a.jsxs(we,{hidden:i!="base",children:[a.jsx(_e,{children:"域名"}),a.jsx(be,{children:a.jsx(Ne,{placeholder:"请输入域名",..._})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:f.control,name:"email",render:({field:_})=>a.jsxs(we,{hidden:i!="base",children:[a.jsxs(_e,{className:"flex w-full justify-between",children:[a.jsx("div",{children:"Email(申请证书需要提供邮箱)"}),a.jsx(HU,{trigger:a.jsxs("div",{className:"font-normal text-primary hover:underline cursor-pointer flex items-center",children:[a.jsx(Uu,{size:14}),"新增"]})})]}),a.jsx(be,{children:a.jsxs(Io,{..._,value:_.value,onValueChange:p=>{f.setValue("email",p)},children:[a.jsx(Qs,{children:a.jsx(Lo,{placeholder:"请选择邮箱"})}),a.jsx(Js,{children:a.jsxs(fl,{children:[a.jsx(Yi,{children:"邮箱列表"}),t.content.emails.map(p=>a.jsx(pn,{value:p,children:a.jsx("div",{children:p})},p))]})})]})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:f.control,name:"access",render:({field:_})=>a.jsxs(we,{hidden:i!="base",children:[a.jsxs(_e,{className:"flex w-full justify-between",children:[a.jsx("div",{children:"DNS 服务商授权配置"}),a.jsx(Tl,{trigger:a.jsxs("div",{className:"font-normal text-primary hover:underline cursor-pointer flex items-center",children:[a.jsx(Uu,{size:14}),"新增"]}),op:"add"})]}),a.jsx(be,{children:a.jsxs(Io,{..._,value:_.value,onValueChange:p=>{f.setValue("access",p)},children:[a.jsx(Qs,{children:a.jsx(Lo,{placeholder:"请选择授权配置"})}),a.jsx(Js,{children:a.jsxs(fl,{children:[a.jsx(Yi,{children:"服务商授权配置"}),e.filter(p=>p.usage!="deploy").map(p=>{var h;return a.jsx(pn,{value:p.id,children:a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("img",{className:"w-6",src:(h=mo.get(p.configType))==null?void 0:h[1]}),a.jsx("div",{children:p.name})]})},p.id)})]})})]})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:f.control,name:"targetType",render:({field:_})=>a.jsxs(we,{hidden:i!="base",children:[a.jsx(_e,{children:"部署服务类型"}),a.jsx(be,{children:a.jsxs(Io,{..._,onValueChange:p=>{u(p),f.setValue("targetType",p)},children:[a.jsx(Qs,{children:a.jsx(Lo,{placeholder:"请选择部署服务类型"})}),a.jsx(Js,{children:a.jsxs(fl,{children:[a.jsx(Yi,{children:"部署服务类型"}),wU.map(p=>{var h,w;return a.jsx(pn,{value:p,children:a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("img",{className:"w-6",src:(h=Mm.get(p))==null?void 0:h[1]}),a.jsx("div",{children:(w=Mm.get(p))==null?void 0:w[0]})]})},p)})]})})]})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:f.control,name:"targetAccess",render:({field:_})=>a.jsxs(we,{hidden:i!="base",children:[a.jsxs(_e,{className:"w-full flex justify-between",children:[a.jsx("div",{children:"部署服务商授权配置"}),a.jsx(Tl,{trigger:a.jsxs("div",{className:"font-normal text-primary hover:underline cursor-pointer flex items-center",children:[a.jsx(Uu,{size:14}),"新增"]}),op:"add"})]}),a.jsx(be,{children:a.jsxs(Io,{..._,onValueChange:p=>{f.setValue("targetAccess",p)},children:[a.jsx(Qs,{children:a.jsx(Lo,{placeholder:"请选择授权配置"})}),a.jsx(Js,{children:a.jsxs(fl,{children:[a.jsxs(Yi,{children:["服务商授权配置",f.getValues().targetAccess]}),a.jsx(pn,{value:"emptyId",children:a.jsx("div",{className:"flex items-center space-x-2",children:"--"})}),m.map(p=>{var h;return a.jsx(pn,{value:p.id,children:a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("img",{className:"w-6",src:(h=mo.get(p.configType))==null?void 0:h[1]}),a.jsx("div",{children:p.name})]})},p.id)})]})})]})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:f.control,name:"group",render:({field:_})=>a.jsxs(we,{hidden:i!="advance"||c!="ssh",children:[a.jsx(_e,{className:"w-full flex justify-between",children:a.jsx("div",{children:"部署配置组(用于将一个域名证书部署到多个 ssh 主机)"})}),a.jsx(be,{children:a.jsxs(Io,{..._,value:_.value,defaultValue:"emptyId",onValueChange:p=>{f.setValue("group",p)},children:[a.jsx(Qs,{children:a.jsx(Lo,{placeholder:"请选择分组"})}),a.jsxs(Js,{children:[a.jsx(pn,{value:"emptyId",children:a.jsx("div",{className:oe("flex items-center space-x-2 rounded cursor-pointer"),children:"--"})}),r.filter(p=>{var h;return p.expand&&((h=p.expand)==null?void 0:h.access.length)>0}).map(p=>a.jsx(pn,{value:p.id?p.id:"",children:a.jsx("div",{className:oe("flex items-center space-x-2 rounded cursor-pointer"),children:p.name})},p.id))]})]})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:f.control,name:"variables",render:({field:_})=>a.jsxs(we,{hidden:i!="advance",children:[a.jsx(_e,{children:"变量"}),a.jsx(be,{children:a.jsx(Sa,{placeholder:`可在SSH部署中使用,形如: key=val; -key2=val2;`,..._,className:"placeholder:whitespace-pre-wrap"})}),l.jsx(_e,{})]})}),l.jsx(Ee,{control:f.control,name:"nameservers",render:({field:_})=>l.jsxs(ke,{hidden:i!="advance",children:[l.jsx(Ce,{children:"域名服务器"}),l.jsx(je,{children:l.jsx(vc,{placeholder:`自定义域名服务器,多个用分号隔开,如: +key2=val2;`,..._,className:"placeholder:whitespace-pre-wrap"})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:f.control,name:"nameservers",render:({field:_})=>a.jsxs(we,{hidden:i!="advance",children:[a.jsx(_e,{children:"域名服务器"}),a.jsx(be,{children:a.jsx(Sa,{placeholder:`自定义域名服务器,多个用分号隔开,如: 8.8.8.8; -8.8.4.4;`,..._,className:"placeholder:whitespace-pre-wrap"})}),l.jsx(_e,{})]})}),l.jsx("div",{className:"flex justify-end",children:l.jsx(He,{type:"submit",children:"保存"})})]})})})]})]})})},sN=g.forwardRef(({className:e,...t},r)=>l.jsx("div",{ref:r,className:oe("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));sN.displayName="Card";const oN=g.forwardRef(({className:e,...t},r)=>l.jsx("div",{ref:r,className:oe("flex flex-col space-y-1.5 p-6",e),...t}));oN.displayName="CardHeader";const iN=g.forwardRef(({className:e,...t},r)=>l.jsx("h3",{ref:r,className:oe("text-2xl font-semibold leading-none tracking-tight",e),...t}));iN.displayName="CardTitle";const aN=g.forwardRef(({className:e,...t},r)=>l.jsx("p",{ref:r,className:oe("text-sm text-muted-foreground",e),...t}));aN.displayName="CardDescription";const lN=g.forwardRef(({className:e,...t},r)=>l.jsx("div",{ref:r,className:oe("p-6 pt-0",e),...t}));lN.displayName="CardContent";const cN=g.forwardRef(({className:e,...t},r)=>l.jsx("div",{ref:r,className:oe("flex items-center p-6 pt-0",e),...t}));cN.displayName="CardFooter";const Es=e=>e instanceof Error?e.message:typeof e=="object"&&e!==null&&"message"in e?String(e.message):typeof e=="string"?e:"Something went wrong",YU=()=>{const{config:{accessGroups:e},reloadAccessGroups:t}=Zr(),{toast:r}=Pn(),n=Pr(),s=async i=>{try{await U3(i),t()}catch(a){r({title:"删除失败",description:Es(a),variant:"destructive"});return}},o=()=>{n("/access")};return l.jsxs("div",{className:"mt-10",children:[l.jsx(ia,{when:e.length==0,children:l.jsx(l.Fragment,{children:l.jsxs("div",{className:"flex flex-col items-center mt-10",children:[l.jsx("span",{className:"bg-orange-100 p-5 rounded-full",children:l.jsx(C0,{size:40,className:"text-primary"})}),l.jsx("div",{className:"text-center text-sm text-muted-foreground mt-3",children:"请添加域名开始部署证书吧。"}),l.jsx(Ey,{trigger:l.jsx(He,{children:"新增授权组"}),className:"mt-3"})]})})}),l.jsx(ih,{className:"h-[75vh] overflow-hidden",children:l.jsx("div",{className:"flex gap-5 flex-wrap",children:e.map(i=>l.jsxs(sN,{className:"w-full md:w-[350px]",children:[l.jsxs(oN,{children:[l.jsx(iN,{children:i.name}),l.jsxs(aN,{children:["共有",i.expand?i.expand.access.length:0,"个部署授权配置"]})]}),l.jsx(lN,{className:"min-h-[180px]",children:i.expand?l.jsx(l.Fragment,{children:i.expand.access.slice(0,3).map(a=>l.jsx("div",{className:"flex flex-col mb-3",children:l.jsxs("div",{className:"flex items-center",children:[l.jsx("div",{className:"",children:l.jsx("img",{src:Ew(a.configType)[1],alt:"provider",className:"w-8 h-8"})}),l.jsxs("div",{className:"ml-3",children:[l.jsx("div",{className:"text-sm font-semibold text-gray-700 dark:text-gray-200",children:a.name}),l.jsx("div",{className:"text-xs text-muted-foreground",children:Ew(a.configType)[0]})]})]})},a.id))}):l.jsx(l.Fragment,{children:l.jsxs("div",{className:"flex text-gray-700 dark:text-gray-200 items-center",children:[l.jsx("div",{children:l.jsx(C0,{size:40})}),l.jsx("div",{className:"ml-2",children:"暂无部署授权配置,请添加后开始使用吧"})]})})}),l.jsx(cN,{children:l.jsxs("div",{className:"flex justify-end w-full",children:[l.jsx(ia,{when:!!(i.expand&&i.expand.access.length>0),children:l.jsx("div",{children:l.jsx(He,{size:"sm",variant:"link",onClick:()=>{n(`/access?accessGroupId=${i.id}&tab=access`,{replace:!0})},children:"所有授权"})})}),l.jsx(ia,{when:!i.expand||i.expand.access.length==0,children:l.jsx("div",{children:l.jsx(He,{size:"sm",onClick:o,children:"新增授权"})})}),l.jsx("div",{className:"ml-3",children:l.jsxs(GC,{children:[l.jsx(ZC,{asChild:!0,children:l.jsx(He,{variant:"destructive",size:"sm",children:"删除"})}),l.jsxs(ty,{children:[l.jsxs(ry,{children:[l.jsx(sy,{className:"dark:text-gray-200",children:"删除组"}),l.jsx(oy,{children:"确定要删除部署授权组吗?"})]}),l.jsxs(ny,{children:[l.jsx(ay,{className:"dark:text-gray-200",children:"取消"}),l.jsx(iy,{onClick:()=>{s(i.id?i.id:"")},children:"确认"})]})]})]})})]})})]}))})})]})};var Ny="Tabs",[KU,oV]=sr(Ny,[Da]),uN=Da(),[GU,Ty]=KU(Ny),dN=g.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:s,defaultValue:o,orientation:i="horizontal",dir:a,activationMode:c="automatic",...u}=e,d=di(a),[f,m]=Hr({prop:n,onChange:s,defaultProp:o});return l.jsx(GU,{scope:r,baseId:Ur(),value:f,onValueChange:m,orientation:i,dir:d,activationMode:c,children:l.jsx(Re.div,{dir:d,"data-orientation":i,...u,ref:t})})});dN.displayName=Ny;var fN="TabsList",hN=g.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...s}=e,o=Ty(fN,r),i=uN(r);return l.jsx(nv,{asChild:!0,...i,orientation:o.orientation,dir:o.dir,loop:n,children:l.jsx(Re.div,{role:"tablist","aria-orientation":o.orientation,...s,ref:t})})});hN.displayName=fN;var pN="TabsTrigger",mN=g.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:s=!1,...o}=e,i=Ty(pN,r),a=uN(r),c=yN(i.baseId,n),u=xN(i.baseId,n),d=n===i.value;return l.jsx(sv,{asChild:!0,...a,focusable:!s,active:d,children:l.jsx(Re.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:c,...o,ref:t,onMouseDown:ce(e.onMouseDown,f=>{!s&&f.button===0&&f.ctrlKey===!1?i.onValueChange(n):f.preventDefault()}),onKeyDown:ce(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&i.onValueChange(n)}),onFocus:ce(e.onFocus,()=>{const f=i.activationMode!=="manual";!d&&!s&&f&&i.onValueChange(n)})})})});mN.displayName=pN;var gN="TabsContent",vN=g.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:s,children:o,...i}=e,a=Ty(gN,r),c=yN(a.baseId,n),u=xN(a.baseId,n),d=n===a.value,f=g.useRef(d);return g.useEffect(()=>{const m=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(m)},[]),l.jsx(or,{present:s||d,children:({present:m})=>l.jsx(Re.div,{"data-state":d?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":c,hidden:!m,id:u,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:m&&o})})});vN.displayName=gN;function yN(e,t){return`${e}-trigger-${t}`}function xN(e,t){return`${e}-content-${t}`}var ZU=dN,wN=hN,_N=mN,bN=vN;const SN=ZU,Ry=g.forwardRef(({className:e,...t},r)=>l.jsx(wN,{ref:r,className:oe("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Ry.displayName=wN.displayName;const Yo=g.forwardRef(({className:e,...t},r)=>l.jsx(_N,{ref:r,className:oe("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));Yo.displayName=_N.displayName;const qd=g.forwardRef(({className:e,...t},r)=>l.jsx(bN,{ref:r,className:oe("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));qd.displayName=bN.displayName;const qU=()=>{const{config:e,deleteAccess:t}=Zr(),{accesses:r}=e,n=10,s=Math.ceil(r.length/n),o=Pr(),i=Nn(),a=new URLSearchParams(i.search),c=a.get("page"),u=c?Number(c):1,d=a.get("tab"),f=a.get("accessGroupId"),m=(u-1)*n,v=m+n,x=async _=>{const p=await z3(_);t(p.id)},y=_=>{a.set("tab",_),o({search:a.toString()})};return l.jsxs("div",{className:"",children:[l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsx("div",{className:"text-muted-foreground",children:"授权管理"}),d!="access_group"?l.jsx(Nl,{trigger:l.jsx(He,{children:"添加授权"}),op:"add"}):l.jsx(Ey,{trigger:l.jsx(He,{children:"添加授权组"})})]}),l.jsxs(SN,{defaultValue:d||"access",value:d||"access",className:"w-full mt-5",children:[l.jsxs(Ry,{className:"space-x-5 px-3",children:[l.jsx(Yo,{value:"access",onClick:()=>{y("access")},children:"授权管理"}),l.jsx(Yo,{value:"access_group",onClick:()=>{y("access_group")},children:"授权组管理"})]}),l.jsx(qd,{value:"access",children:r.length===0?l.jsxs("div",{className:"flex flex-col items-center mt-10",children:[l.jsx("span",{className:"bg-orange-100 p-5 rounded-full",children:l.jsx(RA,{size:40,className:"text-primary"})}),l.jsx("div",{className:"text-center text-sm text-muted-foreground mt-3",children:"请添加授权开始部署证书吧。"}),l.jsx(Nl,{trigger:l.jsx(He,{children:"添加授权"}),op:"add",className:"mt-3"})]}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"hidden sm:flex sm:flex-row text-muted-foreground text-sm border-b dark:border-stone-500 sm:p-2 mt-5",children:[l.jsx("div",{className:"w-48",children:"名称"}),l.jsx("div",{className:"w-48",children:"服务商"}),l.jsx("div",{className:"w-52",children:"创建时间"}),l.jsx("div",{className:"w-52",children:"更新时间"}),l.jsx("div",{className:"grow",children:"操作"})]}),l.jsx("div",{className:"sm:hidden flex text-sm text-muted-foreground",children:"授权列表"}),r.filter(_=>f?_.group==f:!0).slice(m,v).map(_=>{var p,h;return l.jsxs("div",{className:"flex flex-col sm:flex-row text-secondary-foreground border-b dark:border-stone-500 sm:p-2 hover:bg-muted/50 text-sm",children:[l.jsx("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center",children:_.name}),l.jsxs("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center space-x-2",children:[l.jsx("img",{src:(p=fo.get(_.configType))==null?void 0:p[1],className:"w-6"}),l.jsx("div",{children:(h=fo.get(_.configType))==null?void 0:h[0]})]}),l.jsxs("div",{className:"sm:w-52 w-full pt-1 sm:pt-0 flex items-center",children:["创建于"," ",_.created&&ya(_.created)]}),l.jsxs("div",{className:"sm:w-52 w-full pt-1 sm:pt-0 flex items-center",children:["更新于"," ",_.updated&&ya(_.updated)]}),l.jsxs("div",{className:"flex items-center grow justify-start pt-1 sm:pt-0",children:[l.jsx(Nl,{trigger:l.jsx(He,{variant:"link",className:"p-0",children:"编辑"}),op:"edit",data:_}),l.jsx(Bt,{orientation:"vertical",className:"h-4 mx-2"}),l.jsx(He,{variant:"link",className:"p-0",onClick:()=>{x(_)},children:"删除"})]})]},_.id)}),l.jsx(NC,{totalPages:s,currentPage:u,onPageChange:_=>{a.set("page",_.toString()),o({search:a.toString()})}})]})}),l.jsx(qd,{value:"access_group",children:l.jsx(YU,{})})]})]})},XU=Sc("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),Py=g.forwardRef(({className:e,variant:t,...r},n)=>l.jsx("div",{ref:n,role:"alert",className:oe(XU({variant:t}),e),...r}));Py.displayName="Alert";const Ay=g.forwardRef(({className:e,...t},r)=>l.jsx("h5",{ref:r,className:oe("mb-1 font-medium leading-none tracking-tight",e),...t}));Ay.displayName="AlertTitle";const Dy=g.forwardRef(({className:e,...t},r)=>l.jsx("div",{ref:r,className:oe("text-sm [&_p]:leading-relaxed",e),...t}));Dy.displayName="AlertDescription";const kN=async e=>{let t=1;e.page&&(t=e.page);let r=50;e.perPage&&(r=e.perPage);let n="domain!=null";return e.domain&&(n=`domain="${e.domain}"`),await st().collection("deployments").getList(t,r,{filter:n,sort:"-deployedAt",expand:"domain"})},QU=()=>{const e=Pr(),[t,r]=g.useState(),[n]=vA(),s=n.get("domain");return g.useEffect(()=>{(async()=>{const i={};s&&(i.domain=s);const a=await kN(i);r(a.items)})()},[s]),l.jsxs(ih,{className:"h-[80vh] overflow-hidden",children:[l.jsx("div",{className:"text-muted-foreground",children:"部署历史"}),t!=null&&t.length?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"hidden sm:flex sm:flex-row text-muted-foreground text-sm border-b dark:border-stone-500 sm:p-2 mt-5",children:[l.jsx("div",{className:"w-48",children:"域名"}),l.jsx("div",{className:"w-24",children:"状态"}),l.jsx("div",{className:"w-56",children:"阶段"}),l.jsx("div",{className:"w-56 sm:ml-2 text-center",children:"最近执行时间"}),l.jsx("div",{className:"grow",children:"操作"})]}),l.jsx("div",{className:"sm:hidden flex text-sm text-muted-foreground",children:"部署历史"}),t==null?void 0:t.map(o=>{var i,a;return l.jsxs("div",{className:"flex flex-col sm:flex-row text-secondary-foreground border-b dark:border-stone-500 sm:p-2 hover:bg-muted/50 text-sm",children:[l.jsx("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center",children:(i=o.expand.domain)==null?void 0:i.domain}),l.jsx("div",{className:"sm:w-24 w-full pt-1 sm:pt-0 flex items-center",children:l.jsx(ey,{deployment:o})}),l.jsx("div",{className:"sm:w-56 w-full pt-1 sm:pt-0 flex items-center",children:l.jsx(qv,{phase:o.phase,phaseSuccess:o.phaseSuccess})}),l.jsx("div",{className:"sm:w-56 w-full pt-1 sm:pt-0 flex items-center sm:justify-center",children:ya(o.deployedAt)}),l.jsx("div",{className:"flex items-center grow justify-start pt-1 sm:pt-0 sm:ml-2",children:l.jsxs(bv,{children:[l.jsx(Sv,{asChild:!0,children:l.jsx(He,{variant:"link",className:"p-0",children:"日志"})}),l.jsxs(Rf,{className:"sm:max-w-5xl",children:[l.jsx(kv,{children:l.jsxs(Cv,{children:[(a=o.expand.domain)==null?void 0:a.domain,"-",o.id,"部署详情"]})}),l.jsxs("div",{className:"bg-gray-950 text-stone-100 p-5 text-sm h-[80dvh]",children:[o.log.check&&l.jsx(l.Fragment,{children:o.log.check.map(c=>l.jsxs("div",{className:"flex flex-col mt-2",children:[l.jsxs("div",{className:"flex",children:[l.jsxs("div",{children:["[",c.time,"]"]}),l.jsx("div",{className:"ml-2",children:c.message})]}),c.error&&l.jsx("div",{className:"mt-1 text-red-600",children:c.error})]}))}),o.log.apply&&l.jsx(l.Fragment,{children:o.log.apply.map(c=>l.jsxs("div",{className:"flex flex-col mt-2",children:[l.jsxs("div",{className:"flex",children:[l.jsxs("div",{children:["[",c.time,"]"]}),l.jsx("div",{className:"ml-2",children:c.message})]}),c.info&&c.info.map(u=>l.jsx("div",{className:"mt-1 text-green-600",children:u})),c.error&&l.jsx("div",{className:"mt-1 text-red-600",children:c.error})]}))}),o.log.deploy&&l.jsx(l.Fragment,{children:o.log.deploy.map(c=>l.jsxs("div",{className:"flex flex-col mt-2",children:[l.jsxs("div",{className:"flex",children:[l.jsxs("div",{children:["[",c.time,"]"]}),l.jsx("div",{className:"ml-2",children:c.message})]}),c.error&&l.jsx("div",{className:"mt-1 text-red-600",children:c.error})]}))})]})]})]})})]},o.id)})]}):l.jsx(l.Fragment,{children:l.jsxs(Py,{className:"max-w-[40em] mx-auto mt-20",children:[l.jsx(Ay,{children:"暂无数据"}),l.jsxs(Dy,{children:[l.jsxs("div",{className:"flex items-center mt-5",children:[l.jsx("div",{children:l.jsx(ub,{className:"text-yellow-400",size:36})}),l.jsxs("div",{className:"ml-2",children:[" ","你暂未创建任何部署,请先添加域名进行部署吧!"]})]}),l.jsx("div",{className:"mt-2 flex justify-end",children:l.jsx(He,{onClick:()=>{e("/")},children:"添加域名"})})]})]})})]})},JU=de.object({username:de.string().email({message:"请输入正确的邮箱地址"}),password:de.string().min(10,{message:"密码至少10个字符"})}),e$=()=>{const e=_r({resolver:br(JU),defaultValues:{username:"",password:""}}),t=async n=>{try{await st().admins.authWithPassword(n.username,n.password),r("/")}catch(s){const o=Es(s);e.setError("username",{message:o}),e.setError("password",{message:o})}},r=Pr();return l.jsxs("div",{className:"max-w-[35em] border dark:border-stone-500 mx-auto mt-32 p-10 rounded-md shadow-md",children:[l.jsx("div",{className:"flex justify-center mb-10",children:l.jsx("img",{src:"/vite.svg",className:"w-16"})}),l.jsx(Sr,{...e,children:l.jsxs("form",{onSubmit:e.handleSubmit(t),className:"space-y-8 dark:text-stone-200",children:[l.jsx(Ee,{control:e.control,name:"username",render:({field:n})=>l.jsxs(ke,{children:[l.jsx(Ce,{children:"用户名"}),l.jsx(je,{children:l.jsx(Te,{placeholder:"email",...n})}),l.jsx(_e,{})]})}),l.jsx(Ee,{control:e.control,name:"password",render:({field:n})=>l.jsxs(ke,{children:[l.jsx(Ce,{children:"密码"}),l.jsx(je,{children:l.jsx(Te,{placeholder:"shadcn",...n,type:"password"})}),l.jsx(_e,{})]})}),l.jsx("div",{className:"flex justify-end",children:l.jsx(He,{type:"submit",children:"登录"})})]})})]})},t$=()=>st().authStore.isValid&&st().authStore.isAdmin?l.jsx(ib,{to:"/"}):l.jsxs("div",{className:"container",children:[l.jsx(Lg,{}),l.jsx(pC,{})]}),r$=de.object({oldPassword:de.string().min(10,{message:"密码至少10个字符"}),newPassword:de.string().min(10,{message:"密码至少10个字符"}),confirmPassword:de.string().min(10,{message:"密码至少10个字符"})}).refine(e=>e.newPassword===e.confirmPassword,{message:"两次密码不一致",path:["confirmPassword"]}),n$=()=>{const{toast:e}=Pn(),t=Pr(),r=_r({resolver:br(r$),defaultValues:{oldPassword:"",newPassword:"",confirmPassword:""}}),n=async s=>{var o,i;try{await st().admins.authWithPassword((o=st().authStore.model)==null?void 0:o.email,s.oldPassword)}catch(a){const c=Es(a);r.setError("oldPassword",{message:c})}try{await st().admins.update((i=st().authStore.model)==null?void 0:i.id,{password:s.newPassword,passwordConfirm:s.confirmPassword}),st().authStore.clear(),e({title:"修改密码成功",description:"请重新登录"}),setTimeout(()=>{t("/login")},500)}catch(a){const c=Es(a);e({title:"修改密码失败",description:c,variant:"destructive"})}};return l.jsx(l.Fragment,{children:l.jsx("div",{className:"w-full md:max-w-[35em]",children:l.jsx(Sr,{...r,children:l.jsxs("form",{onSubmit:r.handleSubmit(n),className:"space-y-8 dark:text-stone-200",children:[l.jsx(Ee,{control:r.control,name:"oldPassword",render:({field:s})=>l.jsxs(ke,{children:[l.jsx(Ce,{children:"当前密码"}),l.jsx(je,{children:l.jsx(Te,{placeholder:"当前密码",...s,type:"password"})}),l.jsx(_e,{})]})}),l.jsx(Ee,{control:r.control,name:"newPassword",render:({field:s})=>l.jsxs(ke,{children:[l.jsx(Ce,{children:"新密码"}),l.jsx(je,{children:l.jsx(Te,{placeholder:"newPassword",...s,type:"password"})}),l.jsx(_e,{})]})}),l.jsx(Ee,{control:r.control,name:"confirmPassword",render:({field:s})=>l.jsxs(ke,{children:[l.jsx(Ce,{children:"确认密码"}),l.jsx(je,{children:l.jsx(Te,{placeholder:"confirmPassword",...s,type:"password"})}),l.jsx(_e,{})]})}),l.jsx("div",{className:"flex justify-end",children:l.jsx(He,{type:"submit",children:"确认修改"})})]})})})})},s$=()=>{const e=Nn(),[t,r]=g.useState("account"),n=Pr();return g.useEffect(()=>{const o=e.pathname.split("/")[2];r(o)},[e]),l.jsxs("div",{children:[l.jsx(hy,{}),l.jsx("div",{className:"text-muted-foreground border-b dark:border-stone-500 py-5",children:"偏好设置"}),l.jsx("div",{className:"w-full mt-5 p-0 md:p-3 flex justify-center",children:l.jsxs(SN,{defaultValue:"account",className:"w-full",value:t,children:[l.jsxs(Ry,{className:"mx-auto",children:[l.jsxs(Yo,{value:"account",onClick:()=>{n("/setting/account")},className:"px-5",children:[l.jsx(FA,{size:14}),l.jsx("div",{className:"ml-1",children:"账户"})]}),l.jsxs(Yo,{value:"password",onClick:()=>{n("/setting/password")},className:"px-5",children:[l.jsx(TA,{size:14}),l.jsx("div",{className:"ml-1",children:"密码"})]}),l.jsxs(Yo,{value:"notify",onClick:()=>{n("/setting/notify")},className:"px-5",children:[l.jsx(AA,{size:14}),l.jsx("div",{className:"ml-1",children:"消息推送"})]}),l.jsxs(Yo,{value:"ssl-provider",onClick:()=>{n("/setting/ssl-provider")},className:"px-5",children:[l.jsx(MA,{size:14}),l.jsx("div",{className:"ml-1",children:"证书厂商"})]})]}),l.jsx(qd,{value:t,children:l.jsx("div",{className:"mt-5 w-full md:w-[45em]",children:l.jsx(Lg,{})})})]})})]})},o$=()=>{const[e,t]=g.useState(),[r,n]=g.useState(),s=Pr();return g.useEffect(()=>{(async()=>{const i=await gz();t(i)})()},[]),g.useEffect(()=>{(async()=>{const a=await kN({perPage:8});n(a.items)})()},[]),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("div",{className:"flex justify-between items-center",children:l.jsx("div",{className:"text-muted-foreground",children:"控制面板"})}),l.jsxs("div",{className:"flex mt-10 gap-5 flex-col flex-wrap md:flex-row",children:[l.jsxs("div",{className:"w-full md:w-[250px] 3xl:w-[300px] flex items-center rounded-md p-3 shadow-lg border",children:[l.jsx("div",{className:"p-3",children:l.jsx(IA,{size:48,strokeWidth:1,className:"text-blue-400"})}),l.jsxs("div",{children:[l.jsx("div",{className:"text-muted-foreground font-semibold",children:"所有"}),l.jsxs("div",{className:"flex items-baseline",children:[l.jsx("div",{className:"text-3xl text-stone-700 dark:text-stone-200",children:e!=null&&e.total?l.jsx(hr,{to:"/domains",className:"hover:underline",children:e==null?void 0:e.total}):0}),l.jsx("div",{className:"ml-1 text-stone-700 dark:text-stone-200",children:"个"})]})]})]}),l.jsxs("div",{className:"w-full md:w-[250px] 3xl:w-[300px] flex items-center rounded-md p-3 shadow-lg border",children:[l.jsx("div",{className:"p-3",children:l.jsx(SA,{size:48,strokeWidth:1,className:"text-red-400"})}),l.jsxs("div",{children:[l.jsx("div",{className:"text-muted-foreground font-semibold",children:"即将过期"}),l.jsxs("div",{className:"flex items-baseline",children:[l.jsx("div",{className:"text-3xl text-stone-700 dark:text-stone-200",children:e!=null&&e.expired?l.jsx(hr,{to:"/domains?state=expired",className:"hover:underline",children:e==null?void 0:e.expired}):0}),l.jsx("div",{className:"ml-1 text-stone-700 dark:text-stone-200",children:"个"})]})]})]}),l.jsxs("div",{className:"border w-full md:w-[250px] 3xl:w-[300px] flex items-center rounded-md p-3 shadow-lg",children:[l.jsx("div",{className:"p-3",children:l.jsx(PA,{size:48,strokeWidth:1,className:"text-green-400"})}),l.jsxs("div",{children:[l.jsx("div",{className:"text-muted-foreground font-semibold",children:"启用中"}),l.jsxs("div",{className:"flex items-baseline",children:[l.jsx("div",{className:"text-3xl text-stone-700 dark:text-stone-200",children:e!=null&&e.enabled?l.jsx(hr,{to:"/domains?state=enabled",className:"hover:underline",children:e==null?void 0:e.enabled}):0}),l.jsx("div",{className:"ml-1 text-stone-700 dark:text-stone-200",children:"个"})]})]})]}),l.jsxs("div",{className:"border w-full md:w-[250px] 3xl:w-[300px] flex items-center rounded-md p-3 shadow-lg",children:[l.jsx("div",{className:"p-3",children:l.jsx(_A,{size:48,strokeWidth:1,className:"text-gray-400"})}),l.jsxs("div",{children:[l.jsx("div",{className:"text-muted-foreground font-semibold",children:"未启用"}),l.jsxs("div",{className:"flex items-baseline",children:[l.jsx("div",{className:"text-3xl text-stone-700 dark:text-stone-200",children:e!=null&&e.disabled?l.jsx(hr,{to:"/domains?state=disabled",className:"hover:underline",children:e==null?void 0:e.disabled}):0}),l.jsx("div",{className:"ml-1 text-stone-700 dark:text-stone-200",children:"个"})]})]})]})]}),l.jsxs("div",{children:[l.jsx("div",{className:"text-muted-foreground mt-5 text-sm",children:"部署历史"}),(r==null?void 0:r.length)==0?l.jsx(l.Fragment,{children:l.jsxs(Py,{className:"max-w-[40em] mt-10",children:[l.jsx(Ay,{children:"暂无数据"}),l.jsxs(Dy,{children:[l.jsxs("div",{className:"flex items-center mt-5",children:[l.jsx("div",{children:l.jsx(ub,{className:"text-yellow-400",size:36})}),l.jsxs("div",{className:"ml-2",children:[" ","你暂未创建任何部署,请先添加域名进行部署吧!"]})]}),l.jsx("div",{className:"mt-2 flex justify-end",children:l.jsx(He,{onClick:()=>{s("/edit")},children:"添加域名"})})]})]})}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"hidden sm:flex sm:flex-row text-muted-foreground text-sm border-b dark:border-stone-500 sm:p-2 mt-5",children:[l.jsx("div",{className:"w-48",children:"域名"}),l.jsx("div",{className:"w-24",children:"状态"}),l.jsx("div",{className:"w-56",children:"阶段"}),l.jsx("div",{className:"w-56 sm:ml-2 text-center",children:"最近执行时间"}),l.jsx("div",{className:"grow",children:"操作"})]}),l.jsx("div",{className:"sm:hidden flex text-sm text-muted-foreground",children:"部署历史"}),r==null?void 0:r.map(o=>{var i,a;return l.jsxs("div",{className:"flex flex-col sm:flex-row text-secondary-foreground border-b dark:border-stone-500 sm:p-2 hover:bg-muted/50 text-sm",children:[l.jsx("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center",children:(i=o.expand.domain)==null?void 0:i.domain}),l.jsx("div",{className:"sm:w-24 w-full pt-1 sm:pt-0 flex items-center",children:l.jsx(ey,{deployment:o})}),l.jsx("div",{className:"sm:w-56 w-full pt-1 sm:pt-0 flex items-center",children:l.jsx(qv,{phase:o.phase,phaseSuccess:o.phaseSuccess})}),l.jsx("div",{className:"sm:w-56 w-full pt-1 sm:pt-0 flex items-center sm:justify-center",children:ya(o.deployedAt)}),l.jsx("div",{className:"flex items-center grow justify-start pt-1 sm:pt-0 sm:ml-2",children:l.jsxs(bv,{children:[l.jsx(Sv,{asChild:!0,children:l.jsx(He,{variant:"link",className:"p-0",children:"日志"})}),l.jsxs(Rf,{className:"sm:max-w-5xl",children:[l.jsx(kv,{children:l.jsxs(Cv,{children:[(a=o.expand.domain)==null?void 0:a.domain,"-",o.id,"部署详情"]})}),l.jsxs("div",{className:"bg-gray-950 text-stone-100 p-5 text-sm h-[80dvh]",children:[o.log.check&&l.jsx(l.Fragment,{children:o.log.check.map(c=>l.jsxs("div",{className:"flex flex-col mt-2",children:[l.jsxs("div",{className:"flex",children:[l.jsxs("div",{children:["[",c.time,"]"]}),l.jsx("div",{className:"ml-2",children:c.message})]}),c.error&&l.jsx("div",{className:"mt-1 text-red-600",children:c.error})]}))}),o.log.apply&&l.jsx(l.Fragment,{children:o.log.apply.map(c=>l.jsxs("div",{className:"flex flex-col mt-2",children:[l.jsxs("div",{className:"flex",children:[l.jsxs("div",{children:["[",c.time,"]"]}),l.jsx("div",{className:"ml-2",children:c.message})]}),c.info&&c.info.map(u=>l.jsx("div",{className:"mt-1 text-green-600",children:u})),c.error&&l.jsx("div",{className:"mt-1 text-red-600",children:c.error})]}))}),o.log.deploy&&l.jsx(l.Fragment,{children:o.log.deploy.map(c=>l.jsxs("div",{className:"flex flex-col mt-2",children:[l.jsxs("div",{className:"flex",children:[l.jsxs("div",{children:["[",c.time,"]"]}),l.jsx("div",{className:"ml-2",children:c.message})]}),c.error&&l.jsx("div",{className:"mt-1 text-red-600",children:c.error})]}))})]})]})]})})]},o.id)})]})]})]})},i$=de.object({email:de.string().email("请输入正确的邮箱")}),a$=()=>{var i;const{toast:e}=Pn(),t=Pr(),[r,n]=g.useState(!1),s=_r({resolver:br(i$),defaultValues:{email:(i=st().authStore.model)==null?void 0:i.email}}),o=async a=>{var c;try{await st().admins.update((c=st().authStore.model)==null?void 0:c.id,{email:a.email}),st().authStore.clear(),e({title:"修改账户邮箱功",description:"请重新登录"}),setTimeout(()=>{t("/login")},500)}catch(u){const d=Es(u);e({title:"修改账户邮箱失败",description:d,variant:"destructive"})}};return l.jsx(l.Fragment,{children:l.jsx("div",{className:"w-full md:max-w-[35em]",children:l.jsx(Sr,{...s,children:l.jsxs("form",{onSubmit:s.handleSubmit(o),className:"space-y-8 dark:text-stone-200",children:[l.jsx(Ee,{control:s.control,name:"email",render:({field:a})=>l.jsxs(ke,{children:[l.jsx(Ce,{children:"邮箱"}),l.jsx(je,{children:l.jsx(Te,{placeholder:"请输入邮箱",...a,type:"email",onChange:c=>{n(!0),s.setValue("email",c.target.value)}})}),l.jsx(_e,{})]})}),l.jsx("div",{className:"flex justify-end",children:r?l.jsx(He,{type:"submit",children:"确认修改"}):l.jsx(He,{type:"submit",disabled:!0,variant:"secondary",children:"确认修改"})})]})})})})},l$=(e,t)=>{switch(t.type){case"SET_CHANNEL":{const r=t.payload.channel;return{...e,content:{...e.content,[r]:t.payload.data}}}case"SET_CHANNELS":return{...t.payload};default:return e}},CN=g.createContext({}),Oy=()=>g.useContext(CN),c$=({children:e})=>{const[t,r]=g.useReducer(l$,{});g.useEffect(()=>{(async()=>{const i=await Zv("notifyChannels");r({type:"SET_CHANNELS",payload:i})})()},[]);const n=g.useCallback(o=>{r({type:"SET_CHANNEL",payload:o})},[]),s=g.useCallback(o=>{r({type:"SET_CHANNELS",payload:o})},[]);return l.jsx(CN.Provider,{value:{config:t,setChannel:n,setChannels:s},children:e})},u$=()=>{const{config:e,setChannels:t}=Oy(),[r,n]=g.useState({id:e.id??"",name:"notifyChannels",data:{accessToken:"",secret:"",enabled:!1}});g.useEffect(()=>{const a=(()=>{const c={accessToken:"",secret:"",enabled:!1};if(!e.content)return c;const u=e.content;return u.dingtalk?u.dingtalk:c})();n({id:e.id??"",name:"dingtalk",data:a})},[e]);const{toast:s}=Pn(),o=async()=>{try{const i=await La({...e,name:"notifyChannels",content:{...e.content,dingtalk:{...r.data}}});t(i),s({title:"保存成功",description:"配置保存成功"})}catch(i){const a=Es(i);s({title:"保存失败",description:"配置保存失败:"+a,variant:"destructive"})}};return l.jsxs("div",{children:[l.jsx(Te,{placeholder:"AccessToken",value:r.data.accessToken,onChange:i=>{n({...r,data:{...r.data,accessToken:i.target.value}})}}),l.jsx(Te,{placeholder:"加签的签名",className:"mt-2",value:r.data.secret,onChange:i=>{n({...r,data:{...r.data,secret:i.target.value}})}}),l.jsxs("div",{className:"flex items-center space-x-1 mt-2",children:[l.jsx(Fc,{id:"airplane-mode",checked:r.data.enabled,onCheckedChange:()=>{n({...r,data:{...r.data,enabled:!r.data.enabled}})}}),l.jsx(bo,{htmlFor:"airplane-mode",children:"是否启用"})]}),l.jsx("div",{className:"flex justify-end mt-2",children:l.jsx(He,{onClick:()=>{o()},children:"保存"})})]})},d$={title:"您有{COUNT}张证书即将过期",content:"有{COUNT}张证书即将过期,域名分别为{DOMAINS},请保持关注!"},f$=()=>{const[e,t]=g.useState(""),[r,n]=g.useState([d$]),{toast:s}=Pn();g.useEffect(()=>{(async()=>{const u=await Zv("templates");u.content&&(n(u.content.notifyTemplates),t(u.id?u.id:""))})()},[]);const o=c=>{const u=r[0];n([{...u,title:c}])},i=c=>{const u=r[0];n([{...u,content:c}])},a=async()=>{const c=await La({id:e,content:{notifyTemplates:r},name:"templates"});c.id&&t(c.id),s({title:"保存成功",description:"通知模板保存成功"})};return l.jsxs("div",{children:[l.jsx(Te,{value:r[0].title,onChange:c=>{o(c.target.value)}}),l.jsx("div",{className:"text-muted-foreground text-sm mt-1",children:"可选的变量, COUNT:即将过期张数"}),l.jsx(vc,{className:"mt-2",value:r[0].content,onChange:c=>{i(c.target.value)}}),l.jsx("div",{className:"text-muted-foreground text-sm mt-1",children:"可选的变量, COUNT:即将过期张数,DOMAINS:域名列表"}),l.jsx("div",{className:"flex justify-end mt-2",children:l.jsx(He,{onClick:a,children:"保存"})})]})},h$=()=>{const{config:e,setChannels:t}=Oy(),[r,n]=g.useState({id:e.id??"",name:"notifyChannels",data:{apiToken:"",chatId:"",enabled:!1}});g.useEffect(()=>{const a=(()=>{const c={apiToken:"",chatId:"",enabled:!1};if(!e.content)return c;const u=e.content;return u.telegram?u.telegram:c})();n({id:e.id??"",name:"telegram",data:a})},[e]);const{toast:s}=Pn(),o=async()=>{try{const i=await La({...e,name:"notifyChannels",content:{...e.content,telegram:{...r.data}}});t(i),s({title:"保存成功",description:"配置保存成功"})}catch(i){const a=Es(i);s({title:"保存失败",description:"配置保存失败:"+a,variant:"destructive"})}};return l.jsxs("div",{children:[l.jsx(Te,{placeholder:"ApiToken",value:r.data.apiToken,onChange:i=>{n({...r,data:{...r.data,apiToken:i.target.value}})}}),l.jsx(Te,{placeholder:"ChatId",value:r.data.chatId,onChange:i=>{n({...r,data:{...r.data,chatId:i.target.value}})}}),l.jsxs("div",{className:"flex items-center space-x-1 mt-2",children:[l.jsx(Fc,{id:"airplane-mode",checked:r.data.enabled,onCheckedChange:()=>{n({...r,data:{...r.data,enabled:!r.data.enabled}})}}),l.jsx(bo,{htmlFor:"airplane-mode",children:"是否启用"})]}),l.jsx("div",{className:"flex justify-end mt-2",children:l.jsx(He,{onClick:()=>{o()},children:"保存"})})]})};function p$(e){try{return new URL(e),!0}catch{return!1}}const m$=()=>{const{config:e,setChannels:t}=Oy(),[r,n]=g.useState({id:e.id??"",name:"notifyChannels",data:{url:"",enabled:!1}});g.useEffect(()=>{const a=(()=>{const c={url:"",enabled:!1};if(!e.content)return c;const u=e.content;return u.webhook?u.webhook:c})();n({id:e.id??"",name:"webhook",data:a})},[e]);const{toast:s}=Pn(),o=async()=>{try{if(r.data.url=r.data.url.trim(),!p$(r.data.url)){s({title:"保存失败",description:"Url格式不正确",variant:"destructive"});return}const i=await La({...e,name:"notifyChannels",content:{...e.content,webhook:{...r.data}}});t(i),s({title:"保存成功",description:"配置保存成功"})}catch(i){const a=Es(i);s({title:"保存失败",description:"配置保存失败:"+a,variant:"destructive"})}};return l.jsxs("div",{children:[l.jsx(Te,{placeholder:"Url",value:r.data.url,onChange:i=>{n({...r,data:{...r.data,url:i.target.value}})}}),l.jsxs("div",{className:"flex items-center space-x-1 mt-2",children:[l.jsx(Fc,{id:"airplane-mode",checked:r.data.enabled,onCheckedChange:()=>{n({...r,data:{...r.data,enabled:!r.data.enabled}})}}),l.jsx(bo,{htmlFor:"airplane-mode",children:"是否启用"})]}),l.jsx("div",{className:"flex justify-end mt-2",children:l.jsx(He,{onClick:()=>{o()},children:"保存"})})]})};var My="Collapsible",[g$,jN]=sr(My),[v$,Iy]=g$(My),EN=g.forwardRef((e,t)=>{const{__scopeCollapsible:r,open:n,defaultOpen:s,disabled:o,onOpenChange:i,...a}=e,[c=!1,u]=Hr({prop:n,defaultProp:s,onChange:i});return l.jsx(v$,{scope:r,disabled:o,contentId:Ur(),open:c,onOpenToggle:g.useCallback(()=>u(d=>!d),[u]),children:l.jsx(Re.div,{"data-state":Fy(c),"data-disabled":o?"":void 0,...a,ref:t})})});EN.displayName=My;var NN="CollapsibleTrigger",TN=g.forwardRef((e,t)=>{const{__scopeCollapsible:r,...n}=e,s=Iy(NN,r);return l.jsx(Re.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":Fy(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...n,ref:t,onClick:ce(e.onClick,s.onOpenToggle)})});TN.displayName=NN;var Ly="CollapsibleContent",RN=g.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=Iy(Ly,e.__scopeCollapsible);return l.jsx(or,{present:r||s.open,children:({present:o})=>l.jsx(y$,{...n,ref:t,present:o})})});RN.displayName=Ly;var y$=g.forwardRef((e,t)=>{const{__scopeCollapsible:r,present:n,children:s,...o}=e,i=Iy(Ly,r),[a,c]=g.useState(n),u=g.useRef(null),d=Ke(t,u),f=g.useRef(0),m=f.current,v=g.useRef(0),x=v.current,y=i.open||a,_=g.useRef(y),p=g.useRef();return g.useEffect(()=>{const h=requestAnimationFrame(()=>_.current=!1);return()=>cancelAnimationFrame(h)},[]),Jt(()=>{const h=u.current;if(h){p.current=p.current||{transitionDuration:h.style.transitionDuration,animationName:h.style.animationName},h.style.transitionDuration="0s",h.style.animationName="none";const w=h.getBoundingClientRect();f.current=w.height,v.current=w.width,_.current||(h.style.transitionDuration=p.current.transitionDuration,h.style.animationName=p.current.animationName),c(n)}},[i.open,n]),l.jsx(Re.div,{"data-state":Fy(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!y,...o,ref:d,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":x?`${x}px`:void 0,...e.style},children:y&&s})});function Fy(e){return e?"open":"closed"}var x$=EN,w$=TN,_$=RN,Is="Accordion",b$=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[zy,S$,k$]=kc(Is),[ah,iV]=sr(Is,[k$,jN]),Uy=jN(),PN=Be.forwardRef((e,t)=>{const{type:r,...n}=e,s=n,o=n;return l.jsx(zy.Provider,{scope:e.__scopeAccordion,children:r==="multiple"?l.jsx(N$,{...o,ref:t}):l.jsx(E$,{...s,ref:t})})});PN.displayName=Is;var[AN,C$]=ah(Is),[DN,j$]=ah(Is,{collapsible:!1}),E$=Be.forwardRef((e,t)=>{const{value:r,defaultValue:n,onValueChange:s=()=>{},collapsible:o=!1,...i}=e,[a,c]=Hr({prop:r,defaultProp:n,onChange:s});return l.jsx(AN,{scope:e.__scopeAccordion,value:a?[a]:[],onItemOpen:c,onItemClose:Be.useCallback(()=>o&&c(""),[o,c]),children:l.jsx(DN,{scope:e.__scopeAccordion,collapsible:o,children:l.jsx(ON,{...i,ref:t})})})}),N$=Be.forwardRef((e,t)=>{const{value:r,defaultValue:n,onValueChange:s=()=>{},...o}=e,[i=[],a]=Hr({prop:r,defaultProp:n,onChange:s}),c=Be.useCallback(d=>a((f=[])=>[...f,d]),[a]),u=Be.useCallback(d=>a((f=[])=>f.filter(m=>m!==d)),[a]);return l.jsx(AN,{scope:e.__scopeAccordion,value:i,onItemOpen:c,onItemClose:u,children:l.jsx(DN,{scope:e.__scopeAccordion,collapsible:!0,children:l.jsx(ON,{...o,ref:t})})})}),[T$,lh]=ah(Is),ON=Be.forwardRef((e,t)=>{const{__scopeAccordion:r,disabled:n,dir:s,orientation:o="vertical",...i}=e,a=Be.useRef(null),c=Ke(a,t),u=S$(r),f=di(s)==="ltr",m=ce(e.onKeyDown,v=>{var P;if(!b$.includes(v.key))return;const x=v.target,y=u().filter(A=>{var L;return!((L=A.ref.current)!=null&&L.disabled)}),_=y.findIndex(A=>A.ref.current===x),p=y.length;if(_===-1)return;v.preventDefault();let h=_;const w=0,C=p-1,j=()=>{h=_+1,h>C&&(h=w)},E=()=>{h=_-1,h{const{__scopeAccordion:r,value:n,...s}=e,o=lh(Xd,r),i=C$(Xd,r),a=Uy(r),c=Ur(),u=n&&i.value.includes(n)||!1,d=o.disabled||e.disabled;return l.jsx(R$,{scope:r,open:u,disabled:d,triggerId:c,children:l.jsx(x$,{"data-orientation":o.orientation,"data-state":$N(u),...a,...s,ref:t,disabled:d,open:u,onOpenChange:f=>{f?i.onItemOpen(n):i.onItemClose(n)}})})});MN.displayName=Xd;var IN="AccordionHeader",LN=Be.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,s=lh(Is,r),o=$y(IN,r);return l.jsx(Re.h3,{"data-orientation":s.orientation,"data-state":$N(o.open),"data-disabled":o.disabled?"":void 0,...n,ref:t})});LN.displayName=IN;var Im="AccordionTrigger",FN=Be.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,s=lh(Is,r),o=$y(Im,r),i=j$(Im,r),a=Uy(r);return l.jsx(zy.ItemSlot,{scope:r,children:l.jsx(w$,{"aria-disabled":o.open&&!i.collapsible||void 0,"data-orientation":s.orientation,id:o.triggerId,...a,...n,ref:t})})});FN.displayName=Im;var zN="AccordionContent",UN=Be.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,s=lh(Is,r),o=$y(zN,r),i=Uy(r);return l.jsx(_$,{role:"region","aria-labelledby":o.triggerId,"data-orientation":s.orientation,...i,...n,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});UN.displayName=zN;function $N(e){return e?"open":"closed"}var P$=PN,A$=MN,D$=LN,VN=FN,BN=UN;const Nw=P$,fl=g.forwardRef(({className:e,...t},r)=>l.jsx(A$,{ref:r,className:oe("border-b",e),...t}));fl.displayName="AccordionItem";const hl=g.forwardRef(({className:e,children:t,...r},n)=>l.jsx(D$,{className:"flex",children:l.jsxs(VN,{ref:n,className:oe("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...r,children:[t,l.jsx(Fg,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));hl.displayName=VN.displayName;const pl=g.forwardRef(({className:e,children:t,...r},n)=>l.jsx(BN,{ref:n,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...r,children:l.jsx("div",{className:oe("pb-4 pt-0",e),children:t})}));pl.displayName=BN.displayName;const O$=()=>l.jsx(l.Fragment,{children:l.jsxs(c$,{children:[l.jsx("div",{className:"border rounded-sm p-5 shadow-lg",children:l.jsx(Nw,{type:"multiple",className:"dark:text-stone-200",children:l.jsxs(fl,{value:"item-1",className:"dark:border-stone-200",children:[l.jsx(hl,{children:"模板"}),l.jsx(pl,{children:l.jsx(f$,{})})]})})}),l.jsx("div",{className:"border rounded-md p-5 mt-7 shadow-lg",children:l.jsxs(Nw,{type:"single",className:"dark:text-stone-200",children:[l.jsxs(fl,{value:"item-2",className:"dark:border-stone-200",children:[l.jsx(hl,{children:"钉钉"}),l.jsx(pl,{children:l.jsx(u$,{})})]}),l.jsxs(fl,{value:"item-4",className:"dark:border-stone-200",children:[l.jsx(hl,{children:"Telegram"}),l.jsx(pl,{children:l.jsx(h$,{})})]}),l.jsxs(fl,{value:"item-5",className:"dark:border-stone-200",children:[l.jsx(hl,{children:"Webhook"}),l.jsx(pl,{children:l.jsx(m$,{})})]})]})})]})});var Vy="Radio",[M$,WN]=sr(Vy),[I$,L$]=M$(Vy),HN=g.forwardRef((e,t)=>{const{__scopeRadio:r,name:n,checked:s=!1,required:o,disabled:i,value:a="on",onCheck:c,...u}=e,[d,f]=g.useState(null),m=Ke(t,y=>f(y)),v=g.useRef(!1),x=d?!!d.closest("form"):!0;return l.jsxs(I$,{scope:r,checked:s,disabled:i,children:[l.jsx(Re.button,{type:"button",role:"radio","aria-checked":s,"data-state":GN(s),"data-disabled":i?"":void 0,disabled:i,value:a,...u,ref:m,onClick:ce(e.onClick,y=>{s||c==null||c(),x&&(v.current=y.isPropagationStopped(),v.current||y.stopPropagation())})}),x&&l.jsx(F$,{control:d,bubbles:!v.current,name:n,value:a,checked:s,required:o,disabled:i,style:{transform:"translateX(-100%)"}})]})});HN.displayName=Vy;var YN="RadioIndicator",KN=g.forwardRef((e,t)=>{const{__scopeRadio:r,forceMount:n,...s}=e,o=L$(YN,r);return l.jsx(or,{present:n||o.checked,children:l.jsx(Re.span,{"data-state":GN(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:t})})});KN.displayName=YN;var F$=e=>{const{control:t,checked:r,bubbles:n=!0,...s}=e,o=g.useRef(null),i=ly(r),a=qg(t);return g.useEffect(()=>{const c=o.current,u=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(u,"checked").set;if(i!==r&&f){const m=new Event("click",{bubbles:n});f.call(c,r),c.dispatchEvent(m)}},[i,r,n]),l.jsx("input",{type:"radio","aria-hidden":!0,defaultChecked:r,...s,tabIndex:-1,ref:o,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function GN(e){return e?"checked":"unchecked"}var z$=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],By="RadioGroup",[U$,aV]=sr(By,[Da,WN]),ZN=Da(),qN=WN(),[$$,V$]=U$(By),XN=g.forwardRef((e,t)=>{const{__scopeRadioGroup:r,name:n,defaultValue:s,value:o,required:i=!1,disabled:a=!1,orientation:c,dir:u,loop:d=!0,onValueChange:f,...m}=e,v=ZN(r),x=di(u),[y,_]=Hr({prop:o,defaultProp:s,onChange:f});return l.jsx($$,{scope:r,name:n,required:i,disabled:a,value:y,onValueChange:_,children:l.jsx(nv,{asChild:!0,...v,orientation:c,dir:x,loop:d,children:l.jsx(Re.div,{role:"radiogroup","aria-required":i,"aria-orientation":c,"data-disabled":a?"":void 0,dir:x,...m,ref:t})})})});XN.displayName=By;var QN="RadioGroupItem",JN=g.forwardRef((e,t)=>{const{__scopeRadioGroup:r,disabled:n,...s}=e,o=V$(QN,r),i=o.disabled||n,a=ZN(r),c=qN(r),u=g.useRef(null),d=Ke(t,u),f=o.value===s.value,m=g.useRef(!1);return g.useEffect(()=>{const v=y=>{z$.includes(y.key)&&(m.current=!0)},x=()=>m.current=!1;return document.addEventListener("keydown",v),document.addEventListener("keyup",x),()=>{document.removeEventListener("keydown",v),document.removeEventListener("keyup",x)}},[]),l.jsx(sv,{asChild:!0,...a,focusable:!i,active:f,children:l.jsx(HN,{disabled:i,required:o.required,checked:f,...c,...s,name:o.name,ref:d,onCheck:()=>o.onValueChange(s.value),onKeyDown:ce(v=>{v.key==="Enter"&&v.preventDefault()}),onFocus:ce(s.onFocus,()=>{var v;m.current&&((v=u.current)==null||v.click())})})})});JN.displayName=QN;var B$="RadioGroupIndicator",eT=g.forwardRef((e,t)=>{const{__scopeRadioGroup:r,...n}=e,s=qN(r);return l.jsx(KN,{...s,...n,ref:t})});eT.displayName=B$;var tT=XN,rT=JN,W$=eT;const nT=g.forwardRef(({className:e,...t},r)=>l.jsx(tT,{className:oe("grid gap-2",e),...t,ref:r}));nT.displayName=tT.displayName;const Lm=g.forwardRef(({className:e,...t},r)=>l.jsx(rT,{ref:r,className:oe("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:l.jsx(W$,{className:"flex items-center justify-center",children:l.jsx(cb,{className:"h-2.5 w-2.5 fill-current text-current"})})}));Lm.displayName=rT.displayName;const H$=de.object({provider:de.enum(["letsencrypt","zerossl"],{message:"请选择SSL提供商"}),eabKid:de.string().optional(),eabHmacKey:de.string().optional()}),Y$=()=>{const e=_r({resolver:br(H$),defaultValues:{provider:"letsencrypt"}}),[t,r]=g.useState("letsencrypt"),[n,s]=g.useState(),{toast:o}=Pn();g.useEffect(()=>{(async()=>{const u=await Zv("ssl-provider");if(u){s(u);const d=u.content;e.setValue("provider",d.provider),e.setValue("eabKid",d.config[d.provider].eabKid),e.setValue("eabHmacKey",d.config[d.provider].eabHmacKey),r(d.provider)}else e.setValue("provider","letsencrypt"),r("letsencrypt")})()},[]);const i=c=>t===c?"border-primary":"",a=async c=>{if(c.provider==="zerossl"&&(c.eabKid||e.setError("eabKid",{message:"请输入EAB_KID和EAB_HMAC_KEY"}),c.eabHmacKey||e.setError("eabHmacKey",{message:"请输入EAB_KID和EAB_HMAC_KEY"}),!c.eabKid||!c.eabHmacKey))return;const u={id:n==null?void 0:n.id,name:"ssl-provider",content:{provider:c.provider,config:{letsencrypt:{},zerossl:{eabKid:c.eabKid??"",eabHmacKey:c.eabHmacKey??""}}}};try{await La(u),o({title:"修改成功",description:"修改成功"})}catch(d){const f=Es(d);o({title:"修改失败",description:f,variant:"destructive"})}};return l.jsx(l.Fragment,{children:l.jsx("div",{className:"w-full md:max-w-[35em]",children:l.jsx(Sr,{...e,children:l.jsxs("form",{onSubmit:e.handleSubmit(a),className:"space-y-8 dark:text-stone-200",children:[l.jsx(Ee,{control:e.control,name:"provider",render:({field:c})=>l.jsxs(ke,{children:[l.jsx(Ce,{children:"证书厂商"}),l.jsx(je,{children:l.jsxs(nT,{...c,className:"flex",onValueChange:u=>{r(u),e.setValue("provider",u)},value:t,children:[l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx(Lm,{value:"letsencrypt",id:"letsencrypt"}),l.jsx(bo,{htmlFor:"letsencrypt",children:l.jsxs("div",{className:oe("flex items-center space-x-2 border p-2 rounded cursor-pointer",i("letsencrypt")),children:[l.jsx("img",{src:"/imgs/providers/letsencrypt.svg",className:"h-6"}),l.jsx("div",{children:"Let's Encrypt"})]})})]}),l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx(Lm,{value:"zerossl",id:"zerossl"}),l.jsx(bo,{htmlFor:"zerossl",children:l.jsxs("div",{className:oe("flex items-center space-x-2 border p-2 rounded cursor-pointer",i("zerossl")),children:[l.jsx("img",{src:"/imgs/providers/zerossl.svg",className:"h-6"}),l.jsx("div",{children:"ZeroSSL"})]})})]})]})}),l.jsx(Ee,{control:e.control,name:"eabKid",render:({field:u})=>l.jsxs(ke,{hidden:t!=="zerossl",children:[l.jsx(Ce,{children:"EAB_KID"}),l.jsx(je,{children:l.jsx(Te,{placeholder:"请输入EAB_KID",...u,type:"text"})}),l.jsx(_e,{})]})}),l.jsx(Ee,{control:e.control,name:"eabHmacKey",render:({field:u})=>l.jsxs(ke,{hidden:t!=="zerossl",children:[l.jsx(Ce,{children:"EAB_HMAC_KEY"}),l.jsx(je,{children:l.jsx(Te,{placeholder:"请输入EAB_HMAC_KEY",...u,type:"text"})}),l.jsx(_e,{})]})}),l.jsx(_e,{})]})}),l.jsx("div",{className:"flex justify-end",children:l.jsx(He,{type:"submit",children:"确认修改"})})]})})})})},K$=rA([{path:"/",element:l.jsx(J3,{}),children:[{path:"/",element:l.jsx(o$,{})},{path:"/domains",element:l.jsx(_z,{})},{path:"/edit",element:l.jsx(HU,{})},{path:"/access",element:l.jsx(qU,{})},{path:"/history",element:l.jsx(QU,{})},{path:"/setting",element:l.jsx(s$,{}),children:[{path:"/setting/password",element:l.jsx(n$,{})},{path:"/setting/account",element:l.jsx(a$,{})},{path:"/setting/notify",element:l.jsx(O$,{})},{path:"/setting/ssl-provider",element:l.jsx(Y$,{})}]}]},{path:"/login",element:l.jsx(t$,{}),children:[{path:"/login",element:l.jsx(e$,{})}]},{path:"/about",element:l.jsx("div",{children:"About"})}]);ip.createRoot(document.getElementById("root")).render(l.jsx(Be.StrictMode,{children:l.jsx(Y3,{defaultTheme:"system",storageKey:"vite-ui-theme",children:l.jsx(dA,{router:K$})})}))});export default G$(); +8.8.4.4;`,..._,className:"placeholder:whitespace-pre-wrap"})}),a.jsx(ge,{})]})}),a.jsx("div",{className:"flex justify-end",children:a.jsx(He,{type:"submit",children:"保存"})})]})})})]})]})})},sN=g.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:oe("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));sN.displayName="Card";const oN=g.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:oe("flex flex-col space-y-1.5 p-6",e),...t}));oN.displayName="CardHeader";const iN=g.forwardRef(({className:e,...t},r)=>a.jsx("h3",{ref:r,className:oe("text-2xl font-semibold leading-none tracking-tight",e),...t}));iN.displayName="CardTitle";const aN=g.forwardRef(({className:e,...t},r)=>a.jsx("p",{ref:r,className:oe("text-sm text-muted-foreground",e),...t}));aN.displayName="CardDescription";const lN=g.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:oe("p-6 pt-0",e),...t}));lN.displayName="CardContent";const cN=g.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:oe("flex items-center p-6 pt-0",e),...t}));cN.displayName="CardFooter";const Es=e=>e instanceof Error?e.message:typeof e=="object"&&e!==null&&"message"in e?String(e.message):typeof e=="string"?e:"Something went wrong",KU=()=>{const{config:{accessGroups:e},reloadAccessGroups:t}=Ar(),{toast:r}=Pn(),n=Pr(),s=async i=>{try{await U3(i),t()}catch(l){r({title:"删除失败",description:Es(l),variant:"destructive"});return}},o=()=>{n("/access")};return a.jsxs("div",{className:"mt-10",children:[a.jsx(ia,{when:e.length==0,children:a.jsx(a.Fragment,{children:a.jsxs("div",{className:"flex flex-col items-center mt-10",children:[a.jsx("span",{className:"bg-orange-100 p-5 rounded-full",children:a.jsx(C0,{size:40,className:"text-primary"})}),a.jsx("div",{className:"text-center text-sm text-muted-foreground mt-3",children:"请添加域名开始部署证书吧。"}),a.jsx(Ey,{trigger:a.jsx(He,{children:"新增授权组"}),className:"mt-3"})]})})}),a.jsx(ih,{className:"h-[75vh] overflow-hidden",children:a.jsx("div",{className:"flex gap-5 flex-wrap",children:e.map(i=>a.jsxs(sN,{className:"w-full md:w-[350px]",children:[a.jsxs(oN,{children:[a.jsx(iN,{children:i.name}),a.jsxs(aN,{children:["共有",i.expand?i.expand.access.length:0,"个部署授权配置"]})]}),a.jsx(lN,{className:"min-h-[180px]",children:i.expand?a.jsx(a.Fragment,{children:i.expand.access.slice(0,3).map(l=>a.jsx("div",{className:"flex flex-col mb-3",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx("div",{className:"",children:a.jsx("img",{src:Ew(l.configType)[1],alt:"provider",className:"w-8 h-8"})}),a.jsxs("div",{className:"ml-3",children:[a.jsx("div",{className:"text-sm font-semibold text-gray-700 dark:text-gray-200",children:l.name}),a.jsx("div",{className:"text-xs text-muted-foreground",children:Ew(l.configType)[0]})]})]})},l.id))}):a.jsx(a.Fragment,{children:a.jsxs("div",{className:"flex text-gray-700 dark:text-gray-200 items-center",children:[a.jsx("div",{children:a.jsx(C0,{size:40})}),a.jsx("div",{className:"ml-2",children:"暂无部署授权配置,请添加后开始使用吧"})]})})}),a.jsx(cN,{children:a.jsxs("div",{className:"flex justify-end w-full",children:[a.jsx(ia,{when:!!(i.expand&&i.expand.access.length>0),children:a.jsx("div",{children:a.jsx(He,{size:"sm",variant:"link",onClick:()=>{n(`/access?accessGroupId=${i.id}&tab=access`,{replace:!0})},children:"所有授权"})})}),a.jsx(ia,{when:!i.expand||i.expand.access.length==0,children:a.jsx("div",{children:a.jsx(He,{size:"sm",onClick:o,children:"新增授权"})})}),a.jsx("div",{className:"ml-3",children:a.jsxs(GC,{children:[a.jsx(ZC,{asChild:!0,children:a.jsx(He,{variant:"destructive",size:"sm",children:"删除"})}),a.jsxs(ty,{children:[a.jsxs(ry,{children:[a.jsx(sy,{className:"dark:text-gray-200",children:"删除组"}),a.jsx(oy,{children:"确定要删除部署授权组吗?"})]}),a.jsxs(ny,{children:[a.jsx(ay,{className:"dark:text-gray-200",children:"取消"}),a.jsx(iy,{onClick:()=>{s(i.id?i.id:"")},children:"确认"})]})]})]})})]})})]}))})})]})};var Ny="Tabs",[GU,iV]=sr(Ny,[Oa]),uN=Oa(),[ZU,Ty]=GU(Ny),dN=g.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:s,defaultValue:o,orientation:i="horizontal",dir:l,activationMode:c="automatic",...u}=e,d=di(l),[f,m]=Yr({prop:n,onChange:s,defaultProp:o});return a.jsx(ZU,{scope:r,baseId:$r(),value:f,onValueChange:m,orientation:i,dir:d,activationMode:c,children:a.jsx(Re.div,{dir:d,"data-orientation":i,...u,ref:t})})});dN.displayName=Ny;var fN="TabsList",hN=g.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...s}=e,o=Ty(fN,r),i=uN(r);return a.jsx(nv,{asChild:!0,...i,orientation:o.orientation,dir:o.dir,loop:n,children:a.jsx(Re.div,{role:"tablist","aria-orientation":o.orientation,...s,ref:t})})});hN.displayName=fN;var pN="TabsTrigger",mN=g.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:s=!1,...o}=e,i=Ty(pN,r),l=uN(r),c=yN(i.baseId,n),u=xN(i.baseId,n),d=n===i.value;return a.jsx(sv,{asChild:!0,...l,focusable:!s,active:d,children:a.jsx(Re.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:c,...o,ref:t,onMouseDown:ue(e.onMouseDown,f=>{!s&&f.button===0&&f.ctrlKey===!1?i.onValueChange(n):f.preventDefault()}),onKeyDown:ue(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&i.onValueChange(n)}),onFocus:ue(e.onFocus,()=>{const f=i.activationMode!=="manual";!d&&!s&&f&&i.onValueChange(n)})})})});mN.displayName=pN;var gN="TabsContent",vN=g.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:s,children:o,...i}=e,l=Ty(gN,r),c=yN(l.baseId,n),u=xN(l.baseId,n),d=n===l.value,f=g.useRef(d);return g.useEffect(()=>{const m=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(m)},[]),a.jsx(or,{present:s||d,children:({present:m})=>a.jsx(Re.div,{"data-state":d?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!m,id:u,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:m&&o})})});vN.displayName=gN;function yN(e,t){return`${e}-trigger-${t}`}function xN(e,t){return`${e}-content-${t}`}var qU=dN,wN=hN,_N=mN,bN=vN;const SN=qU,Ry=g.forwardRef(({className:e,...t},r)=>a.jsx(wN,{ref:r,className:oe("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Ry.displayName=wN.displayName;const Yo=g.forwardRef(({className:e,...t},r)=>a.jsx(_N,{ref:r,className:oe("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));Yo.displayName=_N.displayName;const qd=g.forwardRef(({className:e,...t},r)=>a.jsx(bN,{ref:r,className:oe("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));qd.displayName=bN.displayName;const XU=()=>{const{config:e,deleteAccess:t}=Ar(),{accesses:r}=e,n=10,s=Math.ceil(r.length/n),o=Pr(),i=Nn(),l=new URLSearchParams(i.search),c=l.get("page"),u=c?Number(c):1,d=l.get("tab"),f=l.get("accessGroupId"),m=(u-1)*n,v=m+n,x=async _=>{const p=await z3(_);t(p.id)},y=_=>{l.set("tab",_),o({search:l.toString()})};return a.jsxs("div",{className:"",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("div",{className:"text-muted-foreground",children:"授权管理"}),d!="access_group"?a.jsx(Tl,{trigger:a.jsx(He,{children:"添加授权"}),op:"add"}):a.jsx(Ey,{trigger:a.jsx(He,{children:"添加授权组"})})]}),a.jsxs(SN,{defaultValue:d||"access",value:d||"access",className:"w-full mt-5",children:[a.jsxs(Ry,{className:"space-x-5 px-3",children:[a.jsx(Yo,{value:"access",onClick:()=>{y("access")},children:"授权管理"}),a.jsx(Yo,{value:"access_group",onClick:()=>{y("access_group")},children:"授权组管理"})]}),a.jsx(qd,{value:"access",children:r.length===0?a.jsxs("div",{className:"flex flex-col items-center mt-10",children:[a.jsx("span",{className:"bg-orange-100 p-5 rounded-full",children:a.jsx(RA,{size:40,className:"text-primary"})}),a.jsx("div",{className:"text-center text-sm text-muted-foreground mt-3",children:"请添加授权开始部署证书吧。"}),a.jsx(Tl,{trigger:a.jsx(He,{children:"添加授权"}),op:"add",className:"mt-3"})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"hidden sm:flex sm:flex-row text-muted-foreground text-sm border-b dark:border-stone-500 sm:p-2 mt-5",children:[a.jsx("div",{className:"w-48",children:"名称"}),a.jsx("div",{className:"w-48",children:"服务商"}),a.jsx("div",{className:"w-52",children:"创建时间"}),a.jsx("div",{className:"w-52",children:"更新时间"}),a.jsx("div",{className:"grow",children:"操作"})]}),a.jsx("div",{className:"sm:hidden flex text-sm text-muted-foreground",children:"授权列表"}),r.filter(_=>f?_.group==f:!0).slice(m,v).map(_=>{var p,h;return a.jsxs("div",{className:"flex flex-col sm:flex-row text-secondary-foreground border-b dark:border-stone-500 sm:p-2 hover:bg-muted/50 text-sm",children:[a.jsx("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center",children:_.name}),a.jsxs("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center space-x-2",children:[a.jsx("img",{src:(p=mo.get(_.configType))==null?void 0:p[1],className:"w-6"}),a.jsx("div",{children:(h=mo.get(_.configType))==null?void 0:h[0]})]}),a.jsxs("div",{className:"sm:w-52 w-full pt-1 sm:pt-0 flex items-center",children:["创建于"," ",_.created&&ya(_.created)]}),a.jsxs("div",{className:"sm:w-52 w-full pt-1 sm:pt-0 flex items-center",children:["更新于"," ",_.updated&&ya(_.updated)]}),a.jsxs("div",{className:"flex items-center grow justify-start pt-1 sm:pt-0",children:[a.jsx(Tl,{trigger:a.jsx(He,{variant:"link",className:"p-0",children:"编辑"}),op:"edit",data:_}),a.jsx(Bt,{orientation:"vertical",className:"h-4 mx-2"}),a.jsx(He,{variant:"link",className:"p-0",onClick:()=>{x(_)},children:"删除"})]})]},_.id)}),a.jsx(NC,{totalPages:s,currentPage:u,onPageChange:_=>{l.set("page",_.toString()),o({search:l.toString()})}})]})}),a.jsx(qd,{value:"access_group",children:a.jsx(KU,{})})]})]})},QU=Sc("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),Py=g.forwardRef(({className:e,variant:t,...r},n)=>a.jsx("div",{ref:n,role:"alert",className:oe(QU({variant:t}),e),...r}));Py.displayName="Alert";const Ay=g.forwardRef(({className:e,...t},r)=>a.jsx("h5",{ref:r,className:oe("mb-1 font-medium leading-none tracking-tight",e),...t}));Ay.displayName="AlertTitle";const Dy=g.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:oe("text-sm [&_p]:leading-relaxed",e),...t}));Dy.displayName="AlertDescription";const kN=async e=>{let t=1;e.page&&(t=e.page);let r=50;e.perPage&&(r=e.perPage);let n="domain!=null";return e.domain&&(n=`domain="${e.domain}"`),await st().collection("deployments").getList(t,r,{filter:n,sort:"-deployedAt",expand:"domain"})},JU=()=>{const e=Pr(),[t,r]=g.useState(),[n]=vA(),s=n.get("domain");return g.useEffect(()=>{(async()=>{const i={};s&&(i.domain=s);const l=await kN(i);r(l.items)})()},[s]),a.jsxs(ih,{className:"h-[80vh] overflow-hidden",children:[a.jsx("div",{className:"text-muted-foreground",children:"部署历史"}),t!=null&&t.length?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"hidden sm:flex sm:flex-row text-muted-foreground text-sm border-b dark:border-stone-500 sm:p-2 mt-5",children:[a.jsx("div",{className:"w-48",children:"域名"}),a.jsx("div",{className:"w-24",children:"状态"}),a.jsx("div",{className:"w-56",children:"阶段"}),a.jsx("div",{className:"w-56 sm:ml-2 text-center",children:"最近执行时间"}),a.jsx("div",{className:"grow",children:"操作"})]}),a.jsx("div",{className:"sm:hidden flex text-sm text-muted-foreground",children:"部署历史"}),t==null?void 0:t.map(o=>{var i,l;return a.jsxs("div",{className:"flex flex-col sm:flex-row text-secondary-foreground border-b dark:border-stone-500 sm:p-2 hover:bg-muted/50 text-sm",children:[a.jsx("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center",children:(i=o.expand.domain)==null?void 0:i.domain}),a.jsx("div",{className:"sm:w-24 w-full pt-1 sm:pt-0 flex items-center",children:a.jsx(ey,{deployment:o})}),a.jsx("div",{className:"sm:w-56 w-full pt-1 sm:pt-0 flex items-center",children:a.jsx(qv,{phase:o.phase,phaseSuccess:o.phaseSuccess})}),a.jsx("div",{className:"sm:w-56 w-full pt-1 sm:pt-0 flex items-center sm:justify-center",children:ya(o.deployedAt)}),a.jsx("div",{className:"flex items-center grow justify-start pt-1 sm:pt-0 sm:ml-2",children:a.jsxs(bv,{children:[a.jsx(Sv,{asChild:!0,children:a.jsx(He,{variant:"link",className:"p-0",children:"日志"})}),a.jsxs(Rf,{className:"sm:max-w-5xl",children:[a.jsx(kv,{children:a.jsxs(Cv,{children:[(l=o.expand.domain)==null?void 0:l.domain,"-",o.id,"部署详情"]})}),a.jsxs("div",{className:"bg-gray-950 text-stone-100 p-5 text-sm h-[80dvh]",children:[o.log.check&&a.jsx(a.Fragment,{children:o.log.check.map(c=>a.jsxs("div",{className:"flex flex-col mt-2",children:[a.jsxs("div",{className:"flex",children:[a.jsxs("div",{children:["[",c.time,"]"]}),a.jsx("div",{className:"ml-2",children:c.message})]}),c.error&&a.jsx("div",{className:"mt-1 text-red-600",children:c.error})]}))}),o.log.apply&&a.jsx(a.Fragment,{children:o.log.apply.map(c=>a.jsxs("div",{className:"flex flex-col mt-2",children:[a.jsxs("div",{className:"flex",children:[a.jsxs("div",{children:["[",c.time,"]"]}),a.jsx("div",{className:"ml-2",children:c.message})]}),c.info&&c.info.map(u=>a.jsx("div",{className:"mt-1 text-green-600",children:u})),c.error&&a.jsx("div",{className:"mt-1 text-red-600",children:c.error})]}))}),o.log.deploy&&a.jsx(a.Fragment,{children:o.log.deploy.map(c=>a.jsxs("div",{className:"flex flex-col mt-2",children:[a.jsxs("div",{className:"flex",children:[a.jsxs("div",{children:["[",c.time,"]"]}),a.jsx("div",{className:"ml-2",children:c.message})]}),c.error&&a.jsx("div",{className:"mt-1 text-red-600",children:c.error})]}))})]})]})]})})]},o.id)})]}):a.jsx(a.Fragment,{children:a.jsxs(Py,{className:"max-w-[40em] mx-auto mt-20",children:[a.jsx(Ay,{children:"暂无数据"}),a.jsxs(Dy,{children:[a.jsxs("div",{className:"flex items-center mt-5",children:[a.jsx("div",{children:a.jsx(ub,{className:"text-yellow-400",size:36})}),a.jsxs("div",{className:"ml-2",children:[" ","你暂未创建任何部署,请先添加域名进行部署吧!"]})]}),a.jsx("div",{className:"mt-2 flex justify-end",children:a.jsx(He,{onClick:()=>{e("/")},children:"添加域名"})})]})]})})]})},e$=ce.object({username:ce.string().email({message:"请输入正确的邮箱地址"}),password:ce.string().min(10,{message:"密码至少10个字符"})}),t$=()=>{const e=fr({resolver:hr(e$),defaultValues:{username:"",password:""}}),t=async n=>{try{await st().admins.authWithPassword(n.username,n.password),r("/")}catch(s){const o=Es(s);e.setError("username",{message:o}),e.setError("password",{message:o})}},r=Pr();return a.jsxs("div",{className:"max-w-[35em] border dark:border-stone-500 mx-auto mt-32 p-10 rounded-md shadow-md",children:[a.jsx("div",{className:"flex justify-center mb-10",children:a.jsx("img",{src:"/vite.svg",className:"w-16"})}),a.jsx(pr,{...e,children:a.jsxs("form",{onSubmit:e.handleSubmit(t),className:"space-y-8 dark:text-stone-200",children:[a.jsx(Se,{control:e.control,name:"username",render:({field:n})=>a.jsxs(we,{children:[a.jsx(_e,{children:"用户名"}),a.jsx(be,{children:a.jsx(Ne,{placeholder:"email",...n})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:e.control,name:"password",render:({field:n})=>a.jsxs(we,{children:[a.jsx(_e,{children:"密码"}),a.jsx(be,{children:a.jsx(Ne,{placeholder:"shadcn",...n,type:"password"})}),a.jsx(ge,{})]})}),a.jsx("div",{className:"flex justify-end",children:a.jsx(He,{type:"submit",children:"登录"})})]})})]})},r$=()=>st().authStore.isValid&&st().authStore.isAdmin?a.jsx(ib,{to:"/"}):a.jsxs("div",{className:"container",children:[a.jsx(Lg,{}),a.jsx(pC,{})]}),n$=ce.object({oldPassword:ce.string().min(10,{message:"密码至少10个字符"}),newPassword:ce.string().min(10,{message:"密码至少10个字符"}),confirmPassword:ce.string().min(10,{message:"密码至少10个字符"})}).refine(e=>e.newPassword===e.confirmPassword,{message:"两次密码不一致",path:["confirmPassword"]}),s$=()=>{const{toast:e}=Pn(),t=Pr(),r=fr({resolver:hr(n$),defaultValues:{oldPassword:"",newPassword:"",confirmPassword:""}}),n=async s=>{var o,i;try{await st().admins.authWithPassword((o=st().authStore.model)==null?void 0:o.email,s.oldPassword)}catch(l){const c=Es(l);r.setError("oldPassword",{message:c})}try{await st().admins.update((i=st().authStore.model)==null?void 0:i.id,{password:s.newPassword,passwordConfirm:s.confirmPassword}),st().authStore.clear(),e({title:"修改密码成功",description:"请重新登录"}),setTimeout(()=>{t("/login")},500)}catch(l){const c=Es(l);e({title:"修改密码失败",description:c,variant:"destructive"})}};return a.jsx(a.Fragment,{children:a.jsx("div",{className:"w-full md:max-w-[35em]",children:a.jsx(pr,{...r,children:a.jsxs("form",{onSubmit:r.handleSubmit(n),className:"space-y-8 dark:text-stone-200",children:[a.jsx(Se,{control:r.control,name:"oldPassword",render:({field:s})=>a.jsxs(we,{children:[a.jsx(_e,{children:"当前密码"}),a.jsx(be,{children:a.jsx(Ne,{placeholder:"当前密码",...s,type:"password"})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:r.control,name:"newPassword",render:({field:s})=>a.jsxs(we,{children:[a.jsx(_e,{children:"新密码"}),a.jsx(be,{children:a.jsx(Ne,{placeholder:"newPassword",...s,type:"password"})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:r.control,name:"confirmPassword",render:({field:s})=>a.jsxs(we,{children:[a.jsx(_e,{children:"确认密码"}),a.jsx(be,{children:a.jsx(Ne,{placeholder:"confirmPassword",...s,type:"password"})}),a.jsx(ge,{})]})}),a.jsx("div",{className:"flex justify-end",children:a.jsx(He,{type:"submit",children:"确认修改"})})]})})})})},o$=()=>{const e=Nn(),[t,r]=g.useState("account"),n=Pr();return g.useEffect(()=>{const o=e.pathname.split("/")[2];r(o)},[e]),a.jsxs("div",{children:[a.jsx(hy,{}),a.jsx("div",{className:"text-muted-foreground border-b dark:border-stone-500 py-5",children:"偏好设置"}),a.jsx("div",{className:"w-full mt-5 p-0 md:p-3 flex justify-center",children:a.jsxs(SN,{defaultValue:"account",className:"w-full",value:t,children:[a.jsxs(Ry,{className:"mx-auto",children:[a.jsxs(Yo,{value:"account",onClick:()=>{n("/setting/account")},className:"px-5",children:[a.jsx(FA,{size:14}),a.jsx("div",{className:"ml-1",children:"账户"})]}),a.jsxs(Yo,{value:"password",onClick:()=>{n("/setting/password")},className:"px-5",children:[a.jsx(TA,{size:14}),a.jsx("div",{className:"ml-1",children:"密码"})]}),a.jsxs(Yo,{value:"notify",onClick:()=>{n("/setting/notify")},className:"px-5",children:[a.jsx(AA,{size:14}),a.jsx("div",{className:"ml-1",children:"消息推送"})]}),a.jsxs(Yo,{value:"ssl-provider",onClick:()=>{n("/setting/ssl-provider")},className:"px-5",children:[a.jsx(MA,{size:14}),a.jsx("div",{className:"ml-1",children:"证书厂商"})]})]}),a.jsx(qd,{value:t,children:a.jsx("div",{className:"mt-5 w-full md:w-[45em]",children:a.jsx(Lg,{})})})]})})]})},i$=()=>{const[e,t]=g.useState(),[r,n]=g.useState(),s=Pr();return g.useEffect(()=>{(async()=>{const i=await gz();t(i)})()},[]),g.useEffect(()=>{(async()=>{const l=await kN({perPage:8});n(l.items)})()},[]),a.jsxs("div",{className:"flex flex-col",children:[a.jsx("div",{className:"flex justify-between items-center",children:a.jsx("div",{className:"text-muted-foreground",children:"控制面板"})}),a.jsxs("div",{className:"flex mt-10 gap-5 flex-col flex-wrap md:flex-row",children:[a.jsxs("div",{className:"w-full md:w-[250px] 3xl:w-[300px] flex items-center rounded-md p-3 shadow-lg border",children:[a.jsx("div",{className:"p-3",children:a.jsx(IA,{size:48,strokeWidth:1,className:"text-blue-400"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-muted-foreground font-semibold",children:"所有"}),a.jsxs("div",{className:"flex items-baseline",children:[a.jsx("div",{className:"text-3xl text-stone-700 dark:text-stone-200",children:e!=null&&e.total?a.jsx(gr,{to:"/domains",className:"hover:underline",children:e==null?void 0:e.total}):0}),a.jsx("div",{className:"ml-1 text-stone-700 dark:text-stone-200",children:"个"})]})]})]}),a.jsxs("div",{className:"w-full md:w-[250px] 3xl:w-[300px] flex items-center rounded-md p-3 shadow-lg border",children:[a.jsx("div",{className:"p-3",children:a.jsx(SA,{size:48,strokeWidth:1,className:"text-red-400"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-muted-foreground font-semibold",children:"即将过期"}),a.jsxs("div",{className:"flex items-baseline",children:[a.jsx("div",{className:"text-3xl text-stone-700 dark:text-stone-200",children:e!=null&&e.expired?a.jsx(gr,{to:"/domains?state=expired",className:"hover:underline",children:e==null?void 0:e.expired}):0}),a.jsx("div",{className:"ml-1 text-stone-700 dark:text-stone-200",children:"个"})]})]})]}),a.jsxs("div",{className:"border w-full md:w-[250px] 3xl:w-[300px] flex items-center rounded-md p-3 shadow-lg",children:[a.jsx("div",{className:"p-3",children:a.jsx(PA,{size:48,strokeWidth:1,className:"text-green-400"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-muted-foreground font-semibold",children:"启用中"}),a.jsxs("div",{className:"flex items-baseline",children:[a.jsx("div",{className:"text-3xl text-stone-700 dark:text-stone-200",children:e!=null&&e.enabled?a.jsx(gr,{to:"/domains?state=enabled",className:"hover:underline",children:e==null?void 0:e.enabled}):0}),a.jsx("div",{className:"ml-1 text-stone-700 dark:text-stone-200",children:"个"})]})]})]}),a.jsxs("div",{className:"border w-full md:w-[250px] 3xl:w-[300px] flex items-center rounded-md p-3 shadow-lg",children:[a.jsx("div",{className:"p-3",children:a.jsx(_A,{size:48,strokeWidth:1,className:"text-gray-400"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-muted-foreground font-semibold",children:"未启用"}),a.jsxs("div",{className:"flex items-baseline",children:[a.jsx("div",{className:"text-3xl text-stone-700 dark:text-stone-200",children:e!=null&&e.disabled?a.jsx(gr,{to:"/domains?state=disabled",className:"hover:underline",children:e==null?void 0:e.disabled}):0}),a.jsx("div",{className:"ml-1 text-stone-700 dark:text-stone-200",children:"个"})]})]})]})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-muted-foreground mt-5 text-sm",children:"部署历史"}),(r==null?void 0:r.length)==0?a.jsx(a.Fragment,{children:a.jsxs(Py,{className:"max-w-[40em] mt-10",children:[a.jsx(Ay,{children:"暂无数据"}),a.jsxs(Dy,{children:[a.jsxs("div",{className:"flex items-center mt-5",children:[a.jsx("div",{children:a.jsx(ub,{className:"text-yellow-400",size:36})}),a.jsxs("div",{className:"ml-2",children:[" ","你暂未创建任何部署,请先添加域名进行部署吧!"]})]}),a.jsx("div",{className:"mt-2 flex justify-end",children:a.jsx(He,{onClick:()=>{s("/edit")},children:"添加域名"})})]})]})}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"hidden sm:flex sm:flex-row text-muted-foreground text-sm border-b dark:border-stone-500 sm:p-2 mt-5",children:[a.jsx("div",{className:"w-48",children:"域名"}),a.jsx("div",{className:"w-24",children:"状态"}),a.jsx("div",{className:"w-56",children:"阶段"}),a.jsx("div",{className:"w-56 sm:ml-2 text-center",children:"最近执行时间"}),a.jsx("div",{className:"grow",children:"操作"})]}),a.jsx("div",{className:"sm:hidden flex text-sm text-muted-foreground",children:"部署历史"}),r==null?void 0:r.map(o=>{var i,l;return a.jsxs("div",{className:"flex flex-col sm:flex-row text-secondary-foreground border-b dark:border-stone-500 sm:p-2 hover:bg-muted/50 text-sm",children:[a.jsx("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center",children:(i=o.expand.domain)==null?void 0:i.domain}),a.jsx("div",{className:"sm:w-24 w-full pt-1 sm:pt-0 flex items-center",children:a.jsx(ey,{deployment:o})}),a.jsx("div",{className:"sm:w-56 w-full pt-1 sm:pt-0 flex items-center",children:a.jsx(qv,{phase:o.phase,phaseSuccess:o.phaseSuccess})}),a.jsx("div",{className:"sm:w-56 w-full pt-1 sm:pt-0 flex items-center sm:justify-center",children:ya(o.deployedAt)}),a.jsx("div",{className:"flex items-center grow justify-start pt-1 sm:pt-0 sm:ml-2",children:a.jsxs(bv,{children:[a.jsx(Sv,{asChild:!0,children:a.jsx(He,{variant:"link",className:"p-0",children:"日志"})}),a.jsxs(Rf,{className:"sm:max-w-5xl",children:[a.jsx(kv,{children:a.jsxs(Cv,{children:[(l=o.expand.domain)==null?void 0:l.domain,"-",o.id,"部署详情"]})}),a.jsxs("div",{className:"bg-gray-950 text-stone-100 p-5 text-sm h-[80dvh]",children:[o.log.check&&a.jsx(a.Fragment,{children:o.log.check.map(c=>a.jsxs("div",{className:"flex flex-col mt-2",children:[a.jsxs("div",{className:"flex",children:[a.jsxs("div",{children:["[",c.time,"]"]}),a.jsx("div",{className:"ml-2",children:c.message})]}),c.error&&a.jsx("div",{className:"mt-1 text-red-600",children:c.error})]}))}),o.log.apply&&a.jsx(a.Fragment,{children:o.log.apply.map(c=>a.jsxs("div",{className:"flex flex-col mt-2",children:[a.jsxs("div",{className:"flex",children:[a.jsxs("div",{children:["[",c.time,"]"]}),a.jsx("div",{className:"ml-2",children:c.message})]}),c.info&&c.info.map(u=>a.jsx("div",{className:"mt-1 text-green-600",children:u})),c.error&&a.jsx("div",{className:"mt-1 text-red-600",children:c.error})]}))}),o.log.deploy&&a.jsx(a.Fragment,{children:o.log.deploy.map(c=>a.jsxs("div",{className:"flex flex-col mt-2",children:[a.jsxs("div",{className:"flex",children:[a.jsxs("div",{children:["[",c.time,"]"]}),a.jsx("div",{className:"ml-2",children:c.message})]}),c.error&&a.jsx("div",{className:"mt-1 text-red-600",children:c.error})]}))})]})]})]})})]},o.id)})]})]})]})},a$=ce.object({email:ce.string().email("请输入正确的邮箱")}),l$=()=>{var i;const{toast:e}=Pn(),t=Pr(),[r,n]=g.useState(!1),s=fr({resolver:hr(a$),defaultValues:{email:(i=st().authStore.model)==null?void 0:i.email}}),o=async l=>{var c;try{await st().admins.update((c=st().authStore.model)==null?void 0:c.id,{email:l.email}),st().authStore.clear(),e({title:"修改账户邮箱功",description:"请重新登录"}),setTimeout(()=>{t("/login")},500)}catch(u){const d=Es(u);e({title:"修改账户邮箱失败",description:d,variant:"destructive"})}};return a.jsx(a.Fragment,{children:a.jsx("div",{className:"w-full md:max-w-[35em]",children:a.jsx(pr,{...s,children:a.jsxs("form",{onSubmit:s.handleSubmit(o),className:"space-y-8 dark:text-stone-200",children:[a.jsx(Se,{control:s.control,name:"email",render:({field:l})=>a.jsxs(we,{children:[a.jsx(_e,{children:"邮箱"}),a.jsx(be,{children:a.jsx(Ne,{placeholder:"请输入邮箱",...l,type:"email",onChange:c=>{n(!0),s.setValue("email",c.target.value)}})}),a.jsx(ge,{})]})}),a.jsx("div",{className:"flex justify-end",children:r?a.jsx(He,{type:"submit",children:"确认修改"}):a.jsx(He,{type:"submit",disabled:!0,variant:"secondary",children:"确认修改"})})]})})})})},c$=(e,t)=>{switch(t.type){case"SET_CHANNEL":{const r=t.payload.channel;return{...e,content:{...e.content,[r]:t.payload.data}}}case"SET_CHANNELS":return{...t.payload};default:return e}},CN=g.createContext({}),Oy=()=>g.useContext(CN),u$=({children:e})=>{const[t,r]=g.useReducer(c$,{});g.useEffect(()=>{(async()=>{const i=await Zv("notifyChannels");r({type:"SET_CHANNELS",payload:i})})()},[]);const n=g.useCallback(o=>{r({type:"SET_CHANNEL",payload:o})},[]),s=g.useCallback(o=>{r({type:"SET_CHANNELS",payload:o})},[]);return a.jsx(CN.Provider,{value:{config:t,setChannel:n,setChannels:s},children:e})},d$=()=>{const{config:e,setChannels:t}=Oy(),[r,n]=g.useState({id:e.id??"",name:"notifyChannels",data:{accessToken:"",secret:"",enabled:!1}});g.useEffect(()=>{const l=(()=>{const c={accessToken:"",secret:"",enabled:!1};if(!e.content)return c;const u=e.content;return u.dingtalk?u.dingtalk:c})();n({id:e.id??"",name:"dingtalk",data:l})},[e]);const{toast:s}=Pn(),o=async()=>{try{const i=await Fa({...e,name:"notifyChannels",content:{...e.content,dingtalk:{...r.data}}});t(i),s({title:"保存成功",description:"配置保存成功"})}catch(i){const l=Es(i);s({title:"保存失败",description:"配置保存失败:"+l,variant:"destructive"})}};return a.jsxs("div",{children:[a.jsx(Ne,{placeholder:"AccessToken",value:r.data.accessToken,onChange:i=>{n({...r,data:{...r.data,accessToken:i.target.value}})}}),a.jsx(Ne,{placeholder:"加签的签名",className:"mt-2",value:r.data.secret,onChange:i=>{n({...r,data:{...r.data,secret:i.target.value}})}}),a.jsxs("div",{className:"flex items-center space-x-1 mt-2",children:[a.jsx(Fc,{id:"airplane-mode",checked:r.data.enabled,onCheckedChange:()=>{n({...r,data:{...r.data,enabled:!r.data.enabled}})}}),a.jsx(Co,{htmlFor:"airplane-mode",children:"是否启用"})]}),a.jsx("div",{className:"flex justify-end mt-2",children:a.jsx(He,{onClick:()=>{o()},children:"保存"})})]})},f$={title:"您有{COUNT}张证书即将过期",content:"有{COUNT}张证书即将过期,域名分别为{DOMAINS},请保持关注!"},h$=()=>{const[e,t]=g.useState(""),[r,n]=g.useState([f$]),{toast:s}=Pn();g.useEffect(()=>{(async()=>{const u=await Zv("templates");u.content&&(n(u.content.notifyTemplates),t(u.id?u.id:""))})()},[]);const o=c=>{const u=r[0];n([{...u,title:c}])},i=c=>{const u=r[0];n([{...u,content:c}])},l=async()=>{const c=await Fa({id:e,content:{notifyTemplates:r},name:"templates"});c.id&&t(c.id),s({title:"保存成功",description:"通知模板保存成功"})};return a.jsxs("div",{children:[a.jsx(Ne,{value:r[0].title,onChange:c=>{o(c.target.value)}}),a.jsx("div",{className:"text-muted-foreground text-sm mt-1",children:"可选的变量, COUNT:即将过期张数"}),a.jsx(Sa,{className:"mt-2",value:r[0].content,onChange:c=>{i(c.target.value)}}),a.jsx("div",{className:"text-muted-foreground text-sm mt-1",children:"可选的变量, COUNT:即将过期张数,DOMAINS:域名列表"}),a.jsx("div",{className:"flex justify-end mt-2",children:a.jsx(He,{onClick:l,children:"保存"})})]})},p$=()=>{const{config:e,setChannels:t}=Oy(),[r,n]=g.useState({id:e.id??"",name:"notifyChannels",data:{apiToken:"",chatId:"",enabled:!1}});g.useEffect(()=>{const l=(()=>{const c={apiToken:"",chatId:"",enabled:!1};if(!e.content)return c;const u=e.content;return u.telegram?u.telegram:c})();n({id:e.id??"",name:"telegram",data:l})},[e]);const{toast:s}=Pn(),o=async()=>{try{const i=await Fa({...e,name:"notifyChannels",content:{...e.content,telegram:{...r.data}}});t(i),s({title:"保存成功",description:"配置保存成功"})}catch(i){const l=Es(i);s({title:"保存失败",description:"配置保存失败:"+l,variant:"destructive"})}};return a.jsxs("div",{children:[a.jsx(Ne,{placeholder:"ApiToken",value:r.data.apiToken,onChange:i=>{n({...r,data:{...r.data,apiToken:i.target.value}})}}),a.jsx(Ne,{placeholder:"ChatId",value:r.data.chatId,onChange:i=>{n({...r,data:{...r.data,chatId:i.target.value}})}}),a.jsxs("div",{className:"flex items-center space-x-1 mt-2",children:[a.jsx(Fc,{id:"airplane-mode",checked:r.data.enabled,onCheckedChange:()=>{n({...r,data:{...r.data,enabled:!r.data.enabled}})}}),a.jsx(Co,{htmlFor:"airplane-mode",children:"是否启用"})]}),a.jsx("div",{className:"flex justify-end mt-2",children:a.jsx(He,{onClick:()=>{o()},children:"保存"})})]})};function m$(e){try{return new URL(e),!0}catch{return!1}}const g$=()=>{const{config:e,setChannels:t}=Oy(),[r,n]=g.useState({id:e.id??"",name:"notifyChannels",data:{url:"",enabled:!1}});g.useEffect(()=>{const l=(()=>{const c={url:"",enabled:!1};if(!e.content)return c;const u=e.content;return u.webhook?u.webhook:c})();n({id:e.id??"",name:"webhook",data:l})},[e]);const{toast:s}=Pn(),o=async()=>{try{if(r.data.url=r.data.url.trim(),!m$(r.data.url)){s({title:"保存失败",description:"Url格式不正确",variant:"destructive"});return}const i=await Fa({...e,name:"notifyChannels",content:{...e.content,webhook:{...r.data}}});t(i),s({title:"保存成功",description:"配置保存成功"})}catch(i){const l=Es(i);s({title:"保存失败",description:"配置保存失败:"+l,variant:"destructive"})}};return a.jsxs("div",{children:[a.jsx(Ne,{placeholder:"Url",value:r.data.url,onChange:i=>{n({...r,data:{...r.data,url:i.target.value}})}}),a.jsxs("div",{className:"flex items-center space-x-1 mt-2",children:[a.jsx(Fc,{id:"airplane-mode",checked:r.data.enabled,onCheckedChange:()=>{n({...r,data:{...r.data,enabled:!r.data.enabled}})}}),a.jsx(Co,{htmlFor:"airplane-mode",children:"是否启用"})]}),a.jsx("div",{className:"flex justify-end mt-2",children:a.jsx(He,{onClick:()=>{o()},children:"保存"})})]})};var My="Collapsible",[v$,jN]=sr(My),[y$,Iy]=v$(My),EN=g.forwardRef((e,t)=>{const{__scopeCollapsible:r,open:n,defaultOpen:s,disabled:o,onOpenChange:i,...l}=e,[c=!1,u]=Yr({prop:n,defaultProp:s,onChange:i});return a.jsx(y$,{scope:r,disabled:o,contentId:$r(),open:c,onOpenToggle:g.useCallback(()=>u(d=>!d),[u]),children:a.jsx(Re.div,{"data-state":Fy(c),"data-disabled":o?"":void 0,...l,ref:t})})});EN.displayName=My;var NN="CollapsibleTrigger",TN=g.forwardRef((e,t)=>{const{__scopeCollapsible:r,...n}=e,s=Iy(NN,r);return a.jsx(Re.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":Fy(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...n,ref:t,onClick:ue(e.onClick,s.onOpenToggle)})});TN.displayName=NN;var Ly="CollapsibleContent",RN=g.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=Iy(Ly,e.__scopeCollapsible);return a.jsx(or,{present:r||s.open,children:({present:o})=>a.jsx(x$,{...n,ref:t,present:o})})});RN.displayName=Ly;var x$=g.forwardRef((e,t)=>{const{__scopeCollapsible:r,present:n,children:s,...o}=e,i=Iy(Ly,r),[l,c]=g.useState(n),u=g.useRef(null),d=Ke(t,u),f=g.useRef(0),m=f.current,v=g.useRef(0),x=v.current,y=i.open||l,_=g.useRef(y),p=g.useRef();return g.useEffect(()=>{const h=requestAnimationFrame(()=>_.current=!1);return()=>cancelAnimationFrame(h)},[]),Jt(()=>{const h=u.current;if(h){p.current=p.current||{transitionDuration:h.style.transitionDuration,animationName:h.style.animationName},h.style.transitionDuration="0s",h.style.animationName="none";const w=h.getBoundingClientRect();f.current=w.height,v.current=w.width,_.current||(h.style.transitionDuration=p.current.transitionDuration,h.style.animationName=p.current.animationName),c(n)}},[i.open,n]),a.jsx(Re.div,{"data-state":Fy(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!y,...o,ref:d,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":x?`${x}px`:void 0,...e.style},children:y&&s})});function Fy(e){return e?"open":"closed"}var w$=EN,_$=TN,b$=RN,zs="Accordion",S$=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[zy,k$,C$]=kc(zs),[ah,aV]=sr(zs,[C$,jN]),Uy=jN(),PN=Be.forwardRef((e,t)=>{const{type:r,...n}=e,s=n,o=n;return a.jsx(zy.Provider,{scope:e.__scopeAccordion,children:r==="multiple"?a.jsx(T$,{...o,ref:t}):a.jsx(N$,{...s,ref:t})})});PN.displayName=zs;var[AN,j$]=ah(zs),[DN,E$]=ah(zs,{collapsible:!1}),N$=Be.forwardRef((e,t)=>{const{value:r,defaultValue:n,onValueChange:s=()=>{},collapsible:o=!1,...i}=e,[l,c]=Yr({prop:r,defaultProp:n,onChange:s});return a.jsx(AN,{scope:e.__scopeAccordion,value:l?[l]:[],onItemOpen:c,onItemClose:Be.useCallback(()=>o&&c(""),[o,c]),children:a.jsx(DN,{scope:e.__scopeAccordion,collapsible:o,children:a.jsx(ON,{...i,ref:t})})})}),T$=Be.forwardRef((e,t)=>{const{value:r,defaultValue:n,onValueChange:s=()=>{},...o}=e,[i=[],l]=Yr({prop:r,defaultProp:n,onChange:s}),c=Be.useCallback(d=>l((f=[])=>[...f,d]),[l]),u=Be.useCallback(d=>l((f=[])=>f.filter(m=>m!==d)),[l]);return a.jsx(AN,{scope:e.__scopeAccordion,value:i,onItemOpen:c,onItemClose:u,children:a.jsx(DN,{scope:e.__scopeAccordion,collapsible:!0,children:a.jsx(ON,{...o,ref:t})})})}),[R$,lh]=ah(zs),ON=Be.forwardRef((e,t)=>{const{__scopeAccordion:r,disabled:n,dir:s,orientation:o="vertical",...i}=e,l=Be.useRef(null),c=Ke(l,t),u=k$(r),f=di(s)==="ltr",m=ue(e.onKeyDown,v=>{var P;if(!S$.includes(v.key))return;const x=v.target,y=u().filter(A=>{var L;return!((L=A.ref.current)!=null&&L.disabled)}),_=y.findIndex(A=>A.ref.current===x),p=y.length;if(_===-1)return;v.preventDefault();let h=_;const w=0,C=p-1,j=()=>{h=_+1,h>C&&(h=w)},E=()=>{h=_-1,h{const{__scopeAccordion:r,value:n,...s}=e,o=lh(Xd,r),i=j$(Xd,r),l=Uy(r),c=$r(),u=n&&i.value.includes(n)||!1,d=o.disabled||e.disabled;return a.jsx(P$,{scope:r,open:u,disabled:d,triggerId:c,children:a.jsx(w$,{"data-orientation":o.orientation,"data-state":$N(u),...l,...s,ref:t,disabled:d,open:u,onOpenChange:f=>{f?i.onItemOpen(n):i.onItemClose(n)}})})});MN.displayName=Xd;var IN="AccordionHeader",LN=Be.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,s=lh(zs,r),o=$y(IN,r);return a.jsx(Re.h3,{"data-orientation":s.orientation,"data-state":$N(o.open),"data-disabled":o.disabled?"":void 0,...n,ref:t})});LN.displayName=IN;var Im="AccordionTrigger",FN=Be.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,s=lh(zs,r),o=$y(Im,r),i=E$(Im,r),l=Uy(r);return a.jsx(zy.ItemSlot,{scope:r,children:a.jsx(_$,{"aria-disabled":o.open&&!i.collapsible||void 0,"data-orientation":s.orientation,id:o.triggerId,...l,...n,ref:t})})});FN.displayName=Im;var zN="AccordionContent",UN=Be.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,s=lh(zs,r),o=$y(zN,r),i=Uy(r);return a.jsx(b$,{role:"region","aria-labelledby":o.triggerId,"data-orientation":s.orientation,...i,...n,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});UN.displayName=zN;function $N(e){return e?"open":"closed"}var A$=PN,D$=MN,O$=LN,VN=FN,BN=UN;const Nw=A$,hl=g.forwardRef(({className:e,...t},r)=>a.jsx(D$,{ref:r,className:oe("border-b",e),...t}));hl.displayName="AccordionItem";const pl=g.forwardRef(({className:e,children:t,...r},n)=>a.jsx(O$,{className:"flex",children:a.jsxs(VN,{ref:n,className:oe("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...r,children:[t,a.jsx(Fg,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));pl.displayName=VN.displayName;const ml=g.forwardRef(({className:e,children:t,...r},n)=>a.jsx(BN,{ref:n,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...r,children:a.jsx("div",{className:oe("pb-4 pt-0",e),children:t})}));ml.displayName=BN.displayName;const M$=()=>a.jsx(a.Fragment,{children:a.jsxs(u$,{children:[a.jsx("div",{className:"border rounded-sm p-5 shadow-lg",children:a.jsx(Nw,{type:"multiple",className:"dark:text-stone-200",children:a.jsxs(hl,{value:"item-1",className:"dark:border-stone-200",children:[a.jsx(pl,{children:"模板"}),a.jsx(ml,{children:a.jsx(h$,{})})]})})}),a.jsx("div",{className:"border rounded-md p-5 mt-7 shadow-lg",children:a.jsxs(Nw,{type:"single",className:"dark:text-stone-200",children:[a.jsxs(hl,{value:"item-2",className:"dark:border-stone-200",children:[a.jsx(pl,{children:"钉钉"}),a.jsx(ml,{children:a.jsx(d$,{})})]}),a.jsxs(hl,{value:"item-4",className:"dark:border-stone-200",children:[a.jsx(pl,{children:"Telegram"}),a.jsx(ml,{children:a.jsx(p$,{})})]}),a.jsxs(hl,{value:"item-5",className:"dark:border-stone-200",children:[a.jsx(pl,{children:"Webhook"}),a.jsx(ml,{children:a.jsx(g$,{})})]})]})})]})});var Vy="Radio",[I$,WN]=sr(Vy),[L$,F$]=I$(Vy),HN=g.forwardRef((e,t)=>{const{__scopeRadio:r,name:n,checked:s=!1,required:o,disabled:i,value:l="on",onCheck:c,...u}=e,[d,f]=g.useState(null),m=Ke(t,y=>f(y)),v=g.useRef(!1),x=d?!!d.closest("form"):!0;return a.jsxs(L$,{scope:r,checked:s,disabled:i,children:[a.jsx(Re.button,{type:"button",role:"radio","aria-checked":s,"data-state":GN(s),"data-disabled":i?"":void 0,disabled:i,value:l,...u,ref:m,onClick:ue(e.onClick,y=>{s||c==null||c(),x&&(v.current=y.isPropagationStopped(),v.current||y.stopPropagation())})}),x&&a.jsx(z$,{control:d,bubbles:!v.current,name:n,value:l,checked:s,required:o,disabled:i,style:{transform:"translateX(-100%)"}})]})});HN.displayName=Vy;var YN="RadioIndicator",KN=g.forwardRef((e,t)=>{const{__scopeRadio:r,forceMount:n,...s}=e,o=F$(YN,r);return a.jsx(or,{present:n||o.checked,children:a.jsx(Re.span,{"data-state":GN(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:t})})});KN.displayName=YN;var z$=e=>{const{control:t,checked:r,bubbles:n=!0,...s}=e,o=g.useRef(null),i=ly(r),l=qg(t);return g.useEffect(()=>{const c=o.current,u=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(u,"checked").set;if(i!==r&&f){const m=new Event("click",{bubbles:n});f.call(c,r),c.dispatchEvent(m)}},[i,r,n]),a.jsx("input",{type:"radio","aria-hidden":!0,defaultChecked:r,...s,tabIndex:-1,ref:o,style:{...e.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function GN(e){return e?"checked":"unchecked"}var U$=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],By="RadioGroup",[$$,lV]=sr(By,[Oa,WN]),ZN=Oa(),qN=WN(),[V$,B$]=$$(By),XN=g.forwardRef((e,t)=>{const{__scopeRadioGroup:r,name:n,defaultValue:s,value:o,required:i=!1,disabled:l=!1,orientation:c,dir:u,loop:d=!0,onValueChange:f,...m}=e,v=ZN(r),x=di(u),[y,_]=Yr({prop:o,defaultProp:s,onChange:f});return a.jsx(V$,{scope:r,name:n,required:i,disabled:l,value:y,onValueChange:_,children:a.jsx(nv,{asChild:!0,...v,orientation:c,dir:x,loop:d,children:a.jsx(Re.div,{role:"radiogroup","aria-required":i,"aria-orientation":c,"data-disabled":l?"":void 0,dir:x,...m,ref:t})})})});XN.displayName=By;var QN="RadioGroupItem",JN=g.forwardRef((e,t)=>{const{__scopeRadioGroup:r,disabled:n,...s}=e,o=B$(QN,r),i=o.disabled||n,l=ZN(r),c=qN(r),u=g.useRef(null),d=Ke(t,u),f=o.value===s.value,m=g.useRef(!1);return g.useEffect(()=>{const v=y=>{U$.includes(y.key)&&(m.current=!0)},x=()=>m.current=!1;return document.addEventListener("keydown",v),document.addEventListener("keyup",x),()=>{document.removeEventListener("keydown",v),document.removeEventListener("keyup",x)}},[]),a.jsx(sv,{asChild:!0,...l,focusable:!i,active:f,children:a.jsx(HN,{disabled:i,required:o.required,checked:f,...c,...s,name:o.name,ref:d,onCheck:()=>o.onValueChange(s.value),onKeyDown:ue(v=>{v.key==="Enter"&&v.preventDefault()}),onFocus:ue(s.onFocus,()=>{var v;m.current&&((v=u.current)==null||v.click())})})})});JN.displayName=QN;var W$="RadioGroupIndicator",eT=g.forwardRef((e,t)=>{const{__scopeRadioGroup:r,...n}=e,s=qN(r);return a.jsx(KN,{...s,...n,ref:t})});eT.displayName=W$;var tT=XN,rT=JN,H$=eT;const nT=g.forwardRef(({className:e,...t},r)=>a.jsx(tT,{className:oe("grid gap-2",e),...t,ref:r}));nT.displayName=tT.displayName;const Lm=g.forwardRef(({className:e,...t},r)=>a.jsx(rT,{ref:r,className:oe("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:a.jsx(H$,{className:"flex items-center justify-center",children:a.jsx(cb,{className:"h-2.5 w-2.5 fill-current text-current"})})}));Lm.displayName=rT.displayName;const Y$=ce.object({provider:ce.enum(["letsencrypt","zerossl"],{message:"请选择SSL提供商"}),eabKid:ce.string().optional(),eabHmacKey:ce.string().optional()}),K$=()=>{const e=fr({resolver:hr(Y$),defaultValues:{provider:"letsencrypt"}}),[t,r]=g.useState("letsencrypt"),[n,s]=g.useState(),{toast:o}=Pn();g.useEffect(()=>{(async()=>{const u=await Zv("ssl-provider");if(u){s(u);const d=u.content;e.setValue("provider",d.provider),e.setValue("eabKid",d.config[d.provider].eabKid),e.setValue("eabHmacKey",d.config[d.provider].eabHmacKey),r(d.provider)}else e.setValue("provider","letsencrypt"),r("letsencrypt")})()},[]);const i=c=>t===c?"border-primary":"",l=async c=>{if(c.provider==="zerossl"&&(c.eabKid||e.setError("eabKid",{message:"请输入EAB_KID和EAB_HMAC_KEY"}),c.eabHmacKey||e.setError("eabHmacKey",{message:"请输入EAB_KID和EAB_HMAC_KEY"}),!c.eabKid||!c.eabHmacKey))return;const u={id:n==null?void 0:n.id,name:"ssl-provider",content:{provider:c.provider,config:{letsencrypt:{},zerossl:{eabKid:c.eabKid??"",eabHmacKey:c.eabHmacKey??""}}}};try{await Fa(u),o({title:"修改成功",description:"修改成功"})}catch(d){const f=Es(d);o({title:"修改失败",description:f,variant:"destructive"})}};return a.jsx(a.Fragment,{children:a.jsx("div",{className:"w-full md:max-w-[35em]",children:a.jsx(pr,{...e,children:a.jsxs("form",{onSubmit:e.handleSubmit(l),className:"space-y-8 dark:text-stone-200",children:[a.jsx(Se,{control:e.control,name:"provider",render:({field:c})=>a.jsxs(we,{children:[a.jsx(_e,{children:"证书厂商"}),a.jsx(be,{children:a.jsxs(nT,{...c,className:"flex",onValueChange:u=>{r(u),e.setValue("provider",u)},value:t,children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Lm,{value:"letsencrypt",id:"letsencrypt"}),a.jsx(Co,{htmlFor:"letsencrypt",children:a.jsxs("div",{className:oe("flex items-center space-x-2 border p-2 rounded cursor-pointer",i("letsencrypt")),children:[a.jsx("img",{src:"/imgs/providers/letsencrypt.svg",className:"h-6"}),a.jsx("div",{children:"Let's Encrypt"})]})})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Lm,{value:"zerossl",id:"zerossl"}),a.jsx(Co,{htmlFor:"zerossl",children:a.jsxs("div",{className:oe("flex items-center space-x-2 border p-2 rounded cursor-pointer",i("zerossl")),children:[a.jsx("img",{src:"/imgs/providers/zerossl.svg",className:"h-6"}),a.jsx("div",{children:"ZeroSSL"})]})})]})]})}),a.jsx(Se,{control:e.control,name:"eabKid",render:({field:u})=>a.jsxs(we,{hidden:t!=="zerossl",children:[a.jsx(_e,{children:"EAB_KID"}),a.jsx(be,{children:a.jsx(Ne,{placeholder:"请输入EAB_KID",...u,type:"text"})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:e.control,name:"eabHmacKey",render:({field:u})=>a.jsxs(we,{hidden:t!=="zerossl",children:[a.jsx(_e,{children:"EAB_HMAC_KEY"}),a.jsx(be,{children:a.jsx(Ne,{placeholder:"请输入EAB_HMAC_KEY",...u,type:"text"})}),a.jsx(ge,{})]})}),a.jsx(ge,{})]})}),a.jsx("div",{className:"flex justify-end",children:a.jsx(He,{type:"submit",children:"确认修改"})})]})})})})},G$=rA([{path:"/",element:a.jsx(J3,{}),children:[{path:"/",element:a.jsx(i$,{})},{path:"/domains",element:a.jsx(_z,{})},{path:"/edit",element:a.jsx(YU,{})},{path:"/access",element:a.jsx(XU,{})},{path:"/history",element:a.jsx(JU,{})},{path:"/setting",element:a.jsx(o$,{}),children:[{path:"/setting/password",element:a.jsx(s$,{})},{path:"/setting/account",element:a.jsx(l$,{})},{path:"/setting/notify",element:a.jsx(M$,{})},{path:"/setting/ssl-provider",element:a.jsx(K$,{})}]}]},{path:"/login",element:a.jsx(r$,{}),children:[{path:"/login",element:a.jsx(t$,{})}]},{path:"/about",element:a.jsx("div",{children:"About"})}]);ip.createRoot(document.getElementById("root")).render(a.jsx(Be.StrictMode,{children:a.jsx(Y3,{defaultTheme:"system",storageKey:"vite-ui-theme",children:a.jsx(dA,{router:G$})})}))});export default Z$(); diff --git a/ui/dist/imgs/providers/local.svg b/ui/dist/imgs/providers/local.svg new file mode 100644 index 00000000..46cfc247 --- /dev/null +++ b/ui/dist/imgs/providers/local.svg @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/ui/dist/index.html b/ui/dist/index.html index 0e365541..49f74186 100644 --- a/ui/dist/index.html +++ b/ui/dist/index.html @@ -5,7 +5,7 @@ Certimate - Your Trusted SSL Automation Partner - + diff --git a/ui/public/imgs/providers/local.svg b/ui/public/imgs/providers/local.svg new file mode 100644 index 00000000..46cfc247 --- /dev/null +++ b/ui/public/imgs/providers/local.svg @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/ui/src/components/certimate/AccessEdit.tsx b/ui/src/components/certimate/AccessEdit.tsx index f21b079f..fe9d4c97 100644 --- a/ui/src/components/certimate/AccessEdit.tsx +++ b/ui/src/components/certimate/AccessEdit.tsx @@ -32,6 +32,7 @@ import AccessCloudflareForm from "./AccessCloudflareForm"; import AccessQiniuForm from "./AccessQiniuForm"; import AccessNamesiloForm from "./AccessNamesiloForm"; import AccessGodaddyFrom from "./AccessGodaddyForm"; +import AccessLocalForm from "./AccessLocalForm"; type TargetConfigEditProps = { op: "add" | "edit"; @@ -133,6 +134,16 @@ export function AccessEdit({ /> ); break; + case "local": + form = ( + { + setOpen(false); + }} + /> + ); + break; } const getOptionCls = (val: string) => { diff --git a/ui/src/components/certimate/AccessLocalForm.tsx b/ui/src/components/certimate/AccessLocalForm.tsx new file mode 100644 index 00000000..2befd418 --- /dev/null +++ b/ui/src/components/certimate/AccessLocalForm.tsx @@ -0,0 +1,223 @@ +import { + Access, + accessFormType, + getUsageByConfigType, + LocalConfig, + SSHConfig, +} from "@/domain/access"; +import { useConfig } from "@/providers/config"; +import { zodResolver } from "@hookform/resolvers/zod"; +import { useForm } from "react-hook-form"; +import { z } from "zod"; +import { + Form, + FormControl, + FormField, + FormItem, + FormLabel, + FormMessage, +} from "../ui/form"; +import { Input } from "../ui/input"; +import { Button } from "../ui/button"; +import { Textarea } from "../ui/textarea"; +import { save } from "@/repository/access"; +import { ClientResponseError } from "pocketbase"; +import { PbErrorData } from "@/domain/base"; + +const AccessLocalForm = ({ + data, + onAfterReq, +}: { + data?: Access; + onAfterReq: () => void; +}) => { + const { addAccess, updateAccess, reloadAccessGroups } = useConfig(); + + const formSchema = z.object({ + id: z.string().optional(), + name: z.string().min(1).max(64), + configType: accessFormType, + + command: z.string().min(1).max(2048), + certPath: z.string().min(0).max(2048), + keyPath: z.string().min(0).max(2048), + }); + + let config: LocalConfig = { + command: "sudo service nginx restart", + certPath: "/etc/nginx/ssl/certificate.crt", + keyPath: "/etc/nginx/ssl/private.key", + }; + if (data) config = data.config as SSHConfig; + + const form = useForm>({ + resolver: zodResolver(formSchema), + defaultValues: { + id: data?.id, + name: data?.name, + configType: "local", + certPath: config.certPath, + keyPath: config.keyPath, + command: config.command, + }, + }); + + const onSubmit = async (data: z.infer) => { + const req: Access = { + id: data.id as string, + name: data.name, + configType: data.configType, + usage: getUsageByConfigType(data.configType), + + config: { + command: data.command, + certPath: data.certPath, + keyPath: data.keyPath, + }, + }; + + try { + const rs = await save(req); + + onAfterReq(); + + req.id = rs.id; + req.created = rs.created; + req.updated = rs.updated; + if (data.id) { + updateAccess(req); + } else { + addAccess(req); + } + + reloadAccessGroups(); + } catch (e) { + const err = e as ClientResponseError; + + Object.entries(err.response.data as PbErrorData).forEach( + ([key, value]) => { + form.setError(key as keyof z.infer, { + type: "manual", + message: value.message, + }); + } + ); + + return; + } + }; + + return ( + <> +
+
+ { + e.stopPropagation(); + form.handleSubmit(onSubmit)(e); + }} + className="space-y-3" + > + ( + + 名称 + + + + + + + )} + /> + + ( + + 配置类型 + + + + + + + )} + /> + + ( + + 配置类型 + + + + + + + )} + /> + + ( + + 证书保存路径 + + + + + + + )} + /> + + ( + + 私钥保存路径 + + + + + + + )} + /> + + ( + + Command + +