@octo-cyber/ai 0.5.6 → 0.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/BranchDecisionEngine.d.ts +73 -0
- package/dist/BranchDecisionEngine.d.ts.map +1 -0
- package/dist/BranchDecisionEngine.js +195 -0
- package/dist/BranchDecisionEngine.js.map +1 -0
- package/dist/agent/coding-tools.d.ts +7 -0
- package/dist/agent/coding-tools.d.ts.map +1 -0
- package/dist/agent/coding-tools.js +181 -0
- package/dist/agent/coding-tools.js.map +1 -0
- package/dist/ai.module.d.ts +16 -0
- package/dist/ai.module.d.ts.map +1 -0
- package/dist/ai.module.js +106 -0
- package/dist/ai.module.js.map +1 -0
- package/dist/cli/adapters/antigravity.adapter.d.ts +31 -0
- package/dist/cli/adapters/antigravity.adapter.d.ts.map +1 -0
- package/dist/cli/adapters/antigravity.adapter.js +248 -0
- package/dist/cli/adapters/antigravity.adapter.js.map +1 -0
- package/dist/cli/adapters/claude-cli.adapter.d.ts +23 -0
- package/dist/cli/adapters/claude-cli.adapter.d.ts.map +1 -0
- package/dist/cli/adapters/claude-cli.adapter.js +81 -0
- package/dist/cli/adapters/claude-cli.adapter.js.map +1 -0
- package/dist/cli/adapters/cli-proxy-api.adapter.d.ts +32 -0
- package/dist/cli/adapters/cli-proxy-api.adapter.d.ts.map +1 -0
- package/dist/cli/adapters/cli-proxy-api.adapter.js +239 -0
- package/dist/cli/adapters/cli-proxy-api.adapter.js.map +1 -0
- package/dist/cli/adapters/codex-cli.adapter.d.ts +22 -0
- package/dist/cli/adapters/codex-cli.adapter.d.ts.map +1 -0
- package/dist/cli/adapters/codex-cli.adapter.js +76 -0
- package/dist/cli/adapters/codex-cli.adapter.js.map +1 -0
- package/dist/cli/adapters/detect-cli.d.ts +11 -0
- package/dist/cli/adapters/detect-cli.d.ts.map +1 -0
- package/dist/cli/adapters/detect-cli.js +40 -0
- package/dist/cli/adapters/detect-cli.js.map +1 -0
- package/dist/cli/adapters/gemini-cli.adapter.d.ts +21 -0
- package/dist/cli/adapters/gemini-cli.adapter.d.ts.map +1 -0
- package/dist/cli/adapters/gemini-cli.adapter.js +72 -0
- package/dist/cli/adapters/gemini-cli.adapter.js.map +1 -0
- package/dist/cli/adapters/index.d.ts +4 -0
- package/dist/cli/adapters/index.d.ts.map +1 -0
- package/dist/cli/adapters/index.js +10 -0
- package/dist/cli/adapters/index.js.map +1 -0
- package/dist/cli/cli-executor.service.d.ts +25 -0
- package/dist/cli/cli-executor.service.d.ts.map +1 -0
- package/dist/cli/cli-executor.service.js +170 -0
- package/dist/cli/cli-executor.service.js.map +1 -0
- package/dist/cli/cli-registry.service.d.ts +38 -0
- package/dist/cli/cli-registry.service.d.ts.map +1 -0
- package/dist/cli/cli-registry.service.js +114 -0
- package/dist/cli/cli-registry.service.js.map +1 -0
- package/dist/cli/controllers/ai-cli.controller.d.ts +40 -0
- package/dist/cli/controllers/ai-cli.controller.d.ts.map +1 -0
- package/dist/cli/controllers/ai-cli.controller.js +208 -0
- package/dist/cli/controllers/ai-cli.controller.js.map +1 -0
- package/dist/cli/index.d.ts +8 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +17 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/types.d.ts +153 -0
- package/dist/cli/types.d.ts.map +1 -0
- package/dist/cli/types.js +9 -0
- package/dist/cli/types.js.map +1 -0
- package/dist/cli/workspace.service.d.ts +42 -0
- package/dist/cli/workspace.service.d.ts.map +1 -0
- package/dist/cli/workspace.service.js +249 -0
- package/dist/cli/workspace.service.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +44 -0
- package/dist/index.js.map +1 -0
- package/dist/session/claude-code-session-manager.service.d.ts +28 -0
- package/dist/session/claude-code-session-manager.service.d.ts.map +1 -0
- package/dist/session/claude-code-session-manager.service.js +177 -0
- package/dist/session/claude-code-session-manager.service.js.map +1 -0
- package/dist/skill/controllers/skill-market.controller.d.ts +18 -0
- package/dist/skill/controllers/skill-market.controller.d.ts.map +1 -0
- package/dist/skill/controllers/skill-market.controller.js +128 -0
- package/dist/skill/controllers/skill-market.controller.js.map +1 -0
- package/dist/skill/controllers/skill.controller.d.ts +37 -0
- package/dist/skill/controllers/skill.controller.d.ts.map +1 -0
- package/dist/skill/controllers/skill.controller.js +295 -0
- package/dist/skill/controllers/skill.controller.js.map +1 -0
- package/dist/skill/entities/octo-skill.entity.d.ts +22 -0
- package/dist/skill/entities/octo-skill.entity.d.ts.map +1 -0
- package/dist/skill/entities/octo-skill.entity.js +91 -0
- package/dist/skill/entities/octo-skill.entity.js.map +1 -0
- package/dist/skill/index.d.ts +9 -0
- package/dist/skill/index.d.ts.map +1 -0
- package/dist/skill/index.js +21 -0
- package/dist/skill/index.js.map +1 -0
- package/dist/skill/services/skill-generator.service.d.ts +47 -0
- package/dist/skill/services/skill-generator.service.d.ts.map +1 -0
- package/dist/skill/services/skill-generator.service.js +232 -0
- package/dist/skill/services/skill-generator.service.js.map +1 -0
- package/dist/skill/services/skill-installer.service.d.ts +65 -0
- package/dist/skill/services/skill-installer.service.d.ts.map +1 -0
- package/dist/skill/services/skill-installer.service.js +258 -0
- package/dist/skill/services/skill-installer.service.js.map +1 -0
- package/dist/skill/services/skill-market.service.d.ts +60 -0
- package/dist/skill/services/skill-market.service.d.ts.map +1 -0
- package/dist/skill/services/skill-market.service.js +244 -0
- package/dist/skill/services/skill-market.service.js.map +1 -0
- package/dist/skill/services/skill-registry.service.d.ts +61 -0
- package/dist/skill/services/skill-registry.service.d.ts.map +1 -0
- package/dist/skill/services/skill-registry.service.js +159 -0
- package/dist/skill/services/skill-registry.service.js.map +1 -0
- package/dist/skill/types.d.ts +76 -0
- package/dist/skill/types.d.ts.map +1 -0
- package/dist/skill/types.js +6 -0
- package/dist/skill/types.js.map +1 -0
- package/dist/src/agent/agent-run-persistence.service.d.ts +82 -0
- package/dist/src/agent/agent-run-persistence.service.d.ts.map +1 -0
- package/dist/src/agent/agent-run-persistence.service.js +171 -0
- package/dist/src/agent/agent-run-persistence.service.js.map +1 -0
- package/dist/src/agent/agent-run-step.entity.d.ts +23 -0
- package/dist/src/agent/agent-run-step.entity.d.ts.map +1 -0
- package/dist/src/agent/agent-run-step.entity.js +76 -0
- package/dist/src/agent/agent-run-step.entity.js.map +1 -0
- package/dist/src/skill/services/skill-market-utils.d.ts +25 -0
- package/dist/src/skill/services/skill-market-utils.d.ts.map +1 -0
- package/dist/src/skill/services/skill-market-utils.js +22 -0
- package/dist/src/skill/services/skill-market-utils.js.map +1 -0
- package/dist/src/workflow-design/WorkflowAssembler.d.ts +10 -0
- package/dist/src/workflow-design/WorkflowAssembler.d.ts.map +1 -0
- package/dist/src/workflow-design/WorkflowAssembler.js +81 -0
- package/dist/src/workflow-design/WorkflowAssembler.js.map +1 -0
- package/dist/src/workflow-design/n8n-node-templates-data.d.ts +4 -0
- package/dist/src/workflow-design/n8n-node-templates-data.d.ts.map +1 -0
- package/dist/src/workflow-design/n8n-node-templates-data.js +290 -0
- package/dist/src/workflow-design/n8n-node-templates-data.js.map +1 -0
- package/dist/workflow-design/DocumentExtractorAgent.d.ts +47 -0
- package/dist/workflow-design/DocumentExtractorAgent.d.ts.map +1 -0
- package/dist/workflow-design/DocumentExtractorAgent.js +118 -0
- package/dist/workflow-design/DocumentExtractorAgent.js.map +1 -0
- package/dist/workflow-design/N8nNodeKnowledgeBase.d.ts +26 -0
- package/dist/workflow-design/N8nNodeKnowledgeBase.d.ts.map +1 -0
- package/dist/workflow-design/N8nNodeKnowledgeBase.js +320 -0
- package/dist/workflow-design/N8nNodeKnowledgeBase.js.map +1 -0
- package/dist/workflow-design/OctoAgentClient.d.ts +42 -0
- package/dist/workflow-design/OctoAgentClient.d.ts.map +1 -0
- package/dist/workflow-design/OctoAgentClient.js +166 -0
- package/dist/workflow-design/OctoAgentClient.js.map +1 -0
- package/dist/workflow-design/WorkflowDesignOrchestrator.d.ts +45 -0
- package/dist/workflow-design/WorkflowDesignOrchestrator.d.ts.map +1 -0
- package/dist/workflow-design/WorkflowDesignOrchestrator.js +265 -0
- package/dist/workflow-design/WorkflowDesignOrchestrator.js.map +1 -0
- package/dist/workflow-design/agents/ActionChainAgent.d.ts +9 -0
- package/dist/workflow-design/agents/ActionChainAgent.d.ts.map +1 -0
- package/dist/workflow-design/agents/ActionChainAgent.js +79 -0
- package/dist/workflow-design/agents/ActionChainAgent.js.map +1 -0
- package/dist/workflow-design/agents/CodeScriptAgent.d.ts +15 -0
- package/dist/workflow-design/agents/CodeScriptAgent.d.ts.map +1 -0
- package/dist/workflow-design/agents/CodeScriptAgent.js +96 -0
- package/dist/workflow-design/agents/CodeScriptAgent.js.map +1 -0
- package/dist/workflow-design/agents/LogicFlowAgent.d.ts +9 -0
- package/dist/workflow-design/agents/LogicFlowAgent.d.ts.map +1 -0
- package/dist/workflow-design/agents/LogicFlowAgent.js +78 -0
- package/dist/workflow-design/agents/LogicFlowAgent.js.map +1 -0
- package/dist/workflow-design/agents/TriggerAnalystAgent.d.ts +9 -0
- package/dist/workflow-design/agents/TriggerAnalystAgent.d.ts.map +1 -0
- package/dist/workflow-design/agents/TriggerAnalystAgent.js +65 -0
- package/dist/workflow-design/agents/TriggerAnalystAgent.js.map +1 -0
- package/dist/workflow-design/agents/WorkflowValidatorAgent.d.ts +9 -0
- package/dist/workflow-design/agents/WorkflowValidatorAgent.d.ts.map +1 -0
- package/dist/workflow-design/agents/WorkflowValidatorAgent.js +117 -0
- package/dist/workflow-design/agents/WorkflowValidatorAgent.js.map +1 -0
- package/dist/workflow-design/index.d.ts +12 -0
- package/dist/workflow-design/index.d.ts.map +1 -0
- package/dist/workflow-design/index.js +23 -0
- package/dist/workflow-design/index.js.map +1 -0
- package/dist/workflow-design/types.d.ts +155 -0
- package/dist/workflow-design/types.d.ts.map +1 -0
- package/dist/workflow-design/types.js +6 -0
- package/dist/workflow-design/types.js.map +1 -0
- package/package.json +2 -1
- package/web/dist/module.iife.js +254 -0
- package/web/dynamic-entry.tsx +94 -0
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
var Kx=Object.defineProperty;var Zx=(S,Ge,St)=>Ge in S?Kx(S,Ge,{enumerable:!0,configurable:!0,writable:!0,value:St}):S[Ge]=St;var we=(S,Ge,St)=>Zx(S,typeof Ge!="symbol"?Ge+"":Ge,St);(function(S,Ge){"use strict";function St(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const h=St(S),xn=St(Ge);var wn={exports:{}},tn={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Ls;function $d(){if(Ls)return tn;Ls=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,o,a){var i=null;if(a!==void 0&&(i=""+a),o.key!==void 0&&(i=""+o.key),"key"in o){a={};for(var c in o)c!=="key"&&(a[c]=o[c])}else a=o;return o=a.ref,{$$typeof:e,type:r,key:i,ref:o!==void 0?o:null,props:a}}return tn.Fragment=t,tn.jsx=n,tn.jsxs=n,tn}var nn={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.development.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var Hs;function Wd(){return Hs||(Hs=1,process.env.NODE_ENV!=="production"&&(function(){function e(T){if(T==null)return null;if(typeof T=="function")return T.$$typeof===q?null:T.displayName||T.name||null;if(typeof T=="string")return T;switch(T){case v:return"Fragment";case y:return"Profiler";case x:return"StrictMode";case j:return"Suspense";case R:return"SuspenseList";case M:return"Activity"}if(typeof T=="object")switch(typeof T.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),T.$$typeof){case p:return"Portal";case E:return T.displayName||"Context";case w:return(T._context.displayName||"Context")+".Consumer";case N:var z=T.render;return T=T.displayName,T||(T=z.displayName||z.name||"",T=T!==""?"ForwardRef("+T+")":"ForwardRef"),T;case _:return z=T.displayName||null,z!==null?z:e(T.type)||"Memo";case I:z=T._payload,T=T._init;try{return e(T(z))}catch{}}return null}function t(T){return""+T}function n(T){try{t(T);var z=!1}catch{z=!0}if(z){z=console;var ie=z.error,se=typeof Symbol=="function"&&Symbol.toStringTag&&T[Symbol.toStringTag]||T.constructor.name||"Object";return ie.call(z,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",se),t(T)}}function r(T){if(T===v)return"<>";if(typeof T=="object"&&T!==null&&T.$$typeof===I)return"<...>";try{var z=e(T);return z?"<"+z+">":"<...>"}catch{return"<...>"}}function o(){var T=U.A;return T===null?null:T.getOwner()}function a(){return Error("react-stack-top-frame")}function i(T){if(X.call(T,"key")){var z=Object.getOwnPropertyDescriptor(T,"key").get;if(z&&z.isReactWarning)return!1}return T.key!==void 0}function c(T,z){function ie(){F||(F=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",z))}ie.isReactWarning=!0,Object.defineProperty(T,"key",{get:ie,configurable:!0})}function l(){var T=e(this.type);return K[T]||(K[T]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),T=this.props.ref,T!==void 0?T:null}function u(T,z,ie,se,me,ce){var k=ie.ref;return T={$$typeof:b,type:T,key:z,props:ie,_owner:se},(k!==void 0?k:null)!==null?Object.defineProperty(T,"ref",{enumerable:!1,get:l}):Object.defineProperty(T,"ref",{enumerable:!1,value:null}),T._store={},Object.defineProperty(T._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(T,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(T,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:me}),Object.defineProperty(T,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ce}),Object.freeze&&(Object.freeze(T.props),Object.freeze(T)),T}function f(T,z,ie,se,me,ce){var k=z.children;if(k!==void 0)if(se)if(Q(k)){for(se=0;se<k.length;se++)d(k[se]);Object.freeze&&Object.freeze(k)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else d(k);if(X.call(z,"key")){k=e(T);var te=Object.keys(z).filter(function(le){return le!=="key"});se=0<te.length?"{key: someKey, "+te.join(": ..., ")+": ...}":"{key: someKey}",O[k+se]||(te=0<te.length?"{"+te.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
|
+
let props = %s;
|
|
19
|
+
<%s {...props} />
|
|
20
|
+
React keys must be passed directly to JSX without using spread:
|
|
21
|
+
let props = %s;
|
|
22
|
+
<%s key={someKey} {...props} />`,se,k,te,k),O[k+se]=!0)}if(k=null,ie!==void 0&&(n(ie),k=""+ie),i(z)&&(n(z.key),k=""+z.key),"key"in z){ie={};for(var $ in z)$!=="key"&&(ie[$]=z[$])}else ie=z;return k&&c(ie,typeof T=="function"?T.displayName||T.name||"Unknown":T),u(T,k,ie,o(),me,ce)}function d(T){m(T)?T._store&&(T._store.validated=1):typeof T=="object"&&T!==null&&T.$$typeof===I&&(T._payload.status==="fulfilled"?m(T._payload.value)&&T._payload.value._store&&(T._payload.value._store.validated=1):T._store&&(T._store.validated=1))}function m(T){return typeof T=="object"&&T!==null&&T.$$typeof===b}var g=S,b=Symbol.for("react.transitional.element"),p=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),y=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),E=Symbol.for("react.context"),N=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),M=Symbol.for("react.activity"),q=Symbol.for("react.client.reference"),U=g.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=Object.prototype.hasOwnProperty,Q=Array.isArray,oe=console.createTask?console.createTask:function(){return null};g={react_stack_bottom_frame:function(T){return T()}};var F,K={},G=g.react_stack_bottom_frame.bind(g,a)(),D=oe(r(a)),O={};nn.Fragment=v,nn.jsx=function(T,z,ie){var se=1e4>U.recentlyCreatedOwnerStacks++;return f(T,z,ie,!1,se?Error("react-stack-top-frame"):G,se?oe(r(T)):D)},nn.jsxs=function(T,z,ie){var se=1e4>U.recentlyCreatedOwnerStacks++;return f(T,z,ie,!0,se?Error("react-stack-top-frame"):G,se?oe(r(T)):D)}})()),nn}var Bs;function Vd(){return Bs||(Bs=1,process.env.NODE_ENV==="production"?wn.exports=$d():wn.exports=Wd()),wn.exports}var s=Vd();function En(e,t){const n=t&&t.cache?t.cache:Jd,r=t&&t.serializer?t.serializer:Zd;return(t&&t.strategy?t.strategy:Yd)(e,{cache:n,serializer:r})}function qd(e){return e==null||typeof e=="number"||typeof e=="boolean"}function Xd(e,t,n,r){const o=qd(r)?r:n(r);let a=t.get(o);return typeof a>"u"&&(a=e.call(this,r),t.set(o,a)),a}function Fs(e,t,n){const r=Array.prototype.slice.call(arguments,3),o=n(r);let a=t.get(o);return typeof a>"u"&&(a=e.apply(this,r),t.set(o,a)),a}function Us(e,t,n,r,o){return n.bind(t,e,r,o)}function Yd(e,t){const n=e.length===1?Xd:Fs;return Us(e,this,n,t.cache.create(),t.serializer)}function Kd(e,t){return Us(e,this,Fs,t.cache.create(),t.serializer)}const Zd=function(){return JSON.stringify(arguments)};class Qd{constructor(){we(this,"cache");this.cache=Object.create(null)}get(t){return this.cache[t]}set(t,n){this.cache[t]=n}}const Jd={create:function(){return new Qd}},_n={variadic:Kd};class lt extends Error{constructor(t,n){let r=t;n&&(r+=": "+n),super(r),this.code=t,n&&(this.originalMessage=n)}}var ze=(function(e){return e.MISSING_MESSAGE="MISSING_MESSAGE",e.MISSING_FORMAT="MISSING_FORMAT",e.ENVIRONMENT_FALLBACK="ENVIRONMENT_FALLBACK",e.INSUFFICIENT_PATH="INSUFFICIENT_PATH",e.INVALID_MESSAGE="INVALID_MESSAGE",e.INVALID_KEY="INVALID_KEY",e.FORMATTING_ERROR="FORMATTING_ERROR",e})(ze||{});function ef(e,t){return En(e,{cache:(n=t,{create:()=>({get:r=>n[r],set(r,o){n[r]=o}})}),strategy:_n.variadic});var n}const tf=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;function nf(e){const t={};return e.replace(tf,n=>{const r=n.length;switch(n[0]){case"G":t.era=r===4?"long":r===5?"narrow":"short";break;case"y":t.year=r===2?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":t.month=["numeric","2-digit","short","long","narrow"][r-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":t.day=["numeric","2-digit"][r-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":t.weekday=r===4?"long":r===5?"narrow":"short";break;case"e":if(r<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][r-4];break;case"c":if(r<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][r-4];break;case"a":t.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":t.hourCycle="h12",t.hour=["numeric","2-digit"][r-1];break;case"H":t.hourCycle="h23",t.hour=["numeric","2-digit"][r-1];break;case"K":t.hourCycle="h11",t.hour=["numeric","2-digit"][r-1];break;case"k":t.hourCycle="h24",t.hour=["numeric","2-digit"][r-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":t.minute=["numeric","2-digit"][r-1];break;case"s":t.second=["numeric","2-digit"][r-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":t.timeZoneName=r<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""}),t}const rf=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;function of(e){if(e.length===0)throw new Error("Number skeleton cannot be empty");const t=e.split(rf).filter(r=>r.length>0),n=[];for(const r of t){let o=r.split("/");if(o.length===0)throw new Error("Invalid number skeleton");const[a,...i]=o;for(const c of i)if(c.length===0)throw new Error("Invalid number skeleton");n.push({stem:a,options:i})}return n}function sf(e){return e.replace(/^(.*?)-/,"")}const Gs=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,zs=/^(@+)?(\+|#+)?[rs]?$/g,af=/(\*)(0+)|(#+)(0+)|(0+)/g,$s=/^(0+)$/;function Ws(e){const t={};return e[e.length-1]==="r"?t.roundingPriority="morePrecision":e[e.length-1]==="s"&&(t.roundingPriority="lessPrecision"),e.replace(zs,function(n,r,o){return typeof o!="string"?(t.minimumSignificantDigits=r.length,t.maximumSignificantDigits=r.length):o==="+"?t.minimumSignificantDigits=r.length:r[0]==="#"?t.maximumSignificantDigits=r.length:(t.minimumSignificantDigits=r.length,t.maximumSignificantDigits=r.length+(typeof o=="string"?o.length:0)),""}),t}function Vs(e){switch(e){case"sign-auto":return{signDisplay:"auto"};case"sign-accounting":case"()":return{currencySign:"accounting"};case"sign-always":case"+!":return{signDisplay:"always"};case"sign-accounting-always":case"()!":return{signDisplay:"always",currencySign:"accounting"};case"sign-except-zero":case"+?":return{signDisplay:"exceptZero"};case"sign-accounting-except-zero":case"()?":return{signDisplay:"exceptZero",currencySign:"accounting"};case"sign-never":case"+_":return{signDisplay:"never"}}}function cf(e){let t;if(e[0]==="E"&&e[1]==="E"?(t={notation:"engineering"},e=e.slice(2)):e[0]==="E"&&(t={notation:"scientific"},e=e.slice(1)),t){const n=e.slice(0,2);if(n==="+!"?(t.signDisplay="always",e=e.slice(2)):n==="+?"&&(t.signDisplay="exceptZero",e=e.slice(2)),!$s.test(e))throw new Error("Malformed concise eng/scientific notation");t.minimumIntegerDigits=e.length}return t}function qs(e){const t={},n=Vs(e);return n||t}function lf(e){let t={};for(const n of e){switch(n.stem){case"percent":case"%":t.style="percent";continue;case"%x100":t.style="percent",t.scale=100;continue;case"currency":t.style="currency",t.currency=n.options[0];continue;case"group-off":case",_":t.useGrouping=!1;continue;case"precision-integer":case".":t.maximumFractionDigits=0;continue;case"measure-unit":case"unit":t.style="unit",t.unit=sf(n.options[0]);continue;case"compact-short":case"K":t.notation="compact",t.compactDisplay="short";continue;case"compact-long":case"KK":t.notation="compact",t.compactDisplay="long";continue;case"scientific":t={...t,notation:"scientific",...n.options.reduce((a,i)=>({...a,...qs(i)}),{})};continue;case"engineering":t={...t,notation:"engineering",...n.options.reduce((a,i)=>({...a,...qs(i)}),{})};continue;case"notation-simple":t.notation="standard";continue;case"unit-width-narrow":t.currencyDisplay="narrowSymbol",t.unitDisplay="narrow";continue;case"unit-width-short":t.currencyDisplay="code",t.unitDisplay="short";continue;case"unit-width-full-name":t.currencyDisplay="name",t.unitDisplay="long";continue;case"unit-width-iso-code":t.currencyDisplay="symbol";continue;case"scale":t.scale=parseFloat(n.options[0]);continue;case"rounding-mode-floor":t.roundingMode="floor";continue;case"rounding-mode-ceiling":t.roundingMode="ceil";continue;case"rounding-mode-down":t.roundingMode="trunc";continue;case"rounding-mode-up":t.roundingMode="expand";continue;case"rounding-mode-half-even":t.roundingMode="halfEven";continue;case"rounding-mode-half-down":t.roundingMode="halfTrunc";continue;case"rounding-mode-half-up":t.roundingMode="halfExpand";continue;case"integer-width":if(n.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");n.options[0].replace(af,function(a,i,c,l,u,f){if(i)t.minimumIntegerDigits=c.length;else{if(l&&u)throw new Error("We currently do not support maximum integer digits");if(f)throw new Error("We currently do not support exact integer digits")}return""});continue}if($s.test(n.stem)){t.minimumIntegerDigits=n.stem.length;continue}if(Gs.test(n.stem)){if(n.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");n.stem.replace(Gs,function(i,c,l,u,f,d){return l==="*"?t.minimumFractionDigits=c.length:u&&u[0]==="#"?t.maximumFractionDigits=u.length:f&&d?(t.minimumFractionDigits=f.length,t.maximumFractionDigits=f.length+d.length):(t.minimumFractionDigits=c.length,t.maximumFractionDigits=c.length),""});const a=n.options[0];a==="w"?t={...t,trailingZeroDisplay:"stripIfInteger"}:a&&(t={...t,...Ws(a)});continue}if(zs.test(n.stem)){t={...t,...Ws(n.stem)};continue}const r=Vs(n.stem);r&&(t={...t,...r});const o=cf(n.stem);o&&(t={...t,...o})}return t}let Se=(function(e){return e[e.literal=0]="literal",e[e.argument=1]="argument",e[e.number=2]="number",e[e.date=3]="date",e[e.time=4]="time",e[e.select=5]="select",e[e.plural=6]="plural",e[e.pound=7]="pound",e[e.tag=8]="tag",e})({}),Sn=(function(e){return e[e.number=0]="number",e[e.dateTime=1]="dateTime",e})({});function Xs(e){return e.type===Se.literal}function uf(e){return e.type===Se.argument}function Ys(e){return e.type===Se.number}function Ks(e){return e.type===Se.date}function Zs(e){return e.type===Se.time}function Qs(e){return e.type===Se.select}function Js(e){return e.type===Se.plural}function df(e){return e.type===Se.pound}function ea(e){return e.type===Se.tag}function ta(e){return!!(e&&typeof e=="object"&&e.type===Sn.number)}function $r(e){return!!(e&&typeof e=="object"&&e.type===Sn.dateTime)}let he=(function(e){return e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",e[e.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",e[e.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",e[e.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",e[e.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",e[e.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",e[e.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",e[e.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",e[e.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",e[e.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",e[e.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",e[e.INVALID_TAG=23]="INVALID_TAG",e[e.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",e[e.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG",e})({});const na=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,Nn={"001":["H","h"],419:["h","H","hB","hb"],AC:["H","h","hb","hB"],AD:["H","hB"],AE:["h","hB","hb","H"],AF:["H","hb","hB","h"],AG:["h","hb","H","hB"],AI:["H","h","hb","hB"],AL:["h","H","hB"],AM:["H","hB"],AO:["H","hB"],AR:["h","H","hB","hb"],AS:["h","H"],AT:["H","hB"],AU:["h","hb","H","hB"],AW:["H","hB"],AX:["H"],AZ:["H","hB","h"],BA:["H","hB","h"],BB:["h","hb","H","hB"],BD:["h","hB","H"],BE:["H","hB"],BF:["H","hB"],BG:["H","hB","h"],BH:["h","hB","hb","H"],BI:["H","h"],BJ:["H","hB"],BL:["H","hB"],BM:["h","hb","H","hB"],BN:["hb","hB","h","H"],BO:["h","H","hB","hb"],BQ:["H"],BR:["H","hB"],BS:["h","hb","H","hB"],BT:["h","H"],BW:["H","h","hb","hB"],BY:["H","h"],BZ:["H","h","hb","hB"],CA:["h","hb","H","hB"],CC:["H","h","hb","hB"],CD:["hB","H"],CF:["H","h","hB"],CG:["H","hB"],CH:["H","hB","h"],CI:["H","hB"],CK:["H","h","hb","hB"],CL:["h","H","hB","hb"],CM:["H","h","hB"],CN:["H","hB","hb","h"],CO:["h","H","hB","hb"],CP:["H"],CR:["h","H","hB","hb"],CU:["h","H","hB","hb"],CV:["H","hB"],CW:["H","hB"],CX:["H","h","hb","hB"],CY:["h","H","hb","hB"],CZ:["H"],DE:["H","hB"],DG:["H","h","hb","hB"],DJ:["h","H"],DK:["H"],DM:["h","hb","H","hB"],DO:["h","H","hB","hb"],DZ:["h","hB","hb","H"],EA:["H","h","hB","hb"],EC:["h","H","hB","hb"],EE:["H","hB"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],ER:["h","H"],ES:["H","hB","h","hb"],ET:["hB","hb","h","H"],FI:["H"],FJ:["h","hb","H","hB"],FK:["H","h","hb","hB"],FM:["h","hb","H","hB"],FO:["H","h"],FR:["H","hB"],GA:["H","hB"],GB:["H","h","hb","hB"],GD:["h","hb","H","hB"],GE:["H","hB","h"],GF:["H","hB"],GG:["H","h","hb","hB"],GH:["h","H"],GI:["H","h","hb","hB"],GL:["H","h"],GM:["h","hb","H","hB"],GN:["H","hB"],GP:["H","hB"],GQ:["H","hB","h","hb"],GR:["h","H","hb","hB"],GS:["H","h","hb","hB"],GT:["h","H","hB","hb"],GU:["h","hb","H","hB"],GW:["H","hB"],GY:["h","hb","H","hB"],HK:["h","hB","hb","H"],HN:["h","H","hB","hb"],HR:["H","hB"],HU:["H","h"],IC:["H","h","hB","hb"],ID:["H"],IE:["H","h","hb","hB"],IL:["H","hB"],IM:["H","h","hb","hB"],IN:["h","H"],IO:["H","h","hb","hB"],IQ:["h","hB","hb","H"],IR:["hB","H"],IS:["H"],IT:["H","hB"],JE:["H","h","hb","hB"],JM:["h","hb","H","hB"],JO:["h","hB","hb","H"],JP:["H","K","h"],KE:["hB","hb","H","h"],KG:["H","h","hB","hb"],KH:["hB","h","H","hb"],KI:["h","hb","H","hB"],KM:["H","h","hB","hb"],KN:["h","hb","H","hB"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],KW:["h","hB","hb","H"],KY:["h","hb","H","hB"],KZ:["H","hB"],LA:["H","hb","hB","h"],LB:["h","hB","hb","H"],LC:["h","hb","H","hB"],LI:["H","hB","h"],LK:["H","h","hB","hb"],LR:["h","hb","H","hB"],LS:["h","H"],LT:["H","h","hb","hB"],LU:["H","h","hB"],LV:["H","hB","hb","h"],LY:["h","hB","hb","H"],MA:["H","h","hB","hb"],MC:["H","hB"],MD:["H","hB"],ME:["H","hB","h"],MF:["H","hB"],MG:["H","h"],MH:["h","hb","H","hB"],MK:["H","h","hb","hB"],ML:["H"],MM:["hB","hb","H","h"],MN:["H","h","hb","hB"],MO:["h","hB","hb","H"],MP:["h","hb","H","hB"],MQ:["H","hB"],MR:["h","hB","hb","H"],MS:["H","h","hb","hB"],MT:["H","h"],MU:["H","h"],MV:["H","h"],MW:["h","hb","H","hB"],MX:["h","H","hB","hb"],MY:["hb","hB","h","H"],MZ:["H","hB"],NA:["h","H","hB","hb"],NC:["H","hB"],NE:["H"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NI:["h","H","hB","hb"],NL:["H","hB"],NO:["H","h"],NP:["H","h","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],NZ:["h","hb","H","hB"],OM:["h","hB","hb","H"],PA:["h","H","hB","hb"],PE:["h","H","hB","hb"],PF:["H","h","hB"],PG:["h","H"],PH:["h","hB","hb","H"],PK:["h","hB","H"],PL:["H","h"],PM:["H","hB"],PN:["H","h","hb","hB"],PR:["h","H","hB","hb"],PS:["h","hB","hb","H"],PT:["H","hB"],PW:["h","H"],PY:["h","H","hB","hb"],QA:["h","hB","hb","H"],RE:["H","hB"],RO:["H","hB"],RS:["H","hB","h"],RU:["H"],RW:["H","h"],SA:["h","hB","hb","H"],SB:["h","hb","H","hB"],SC:["H","h","hB"],SD:["h","hB","hb","H"],SE:["H"],SG:["h","hb","H","hB"],SH:["H","h","hb","hB"],SI:["H","hB"],SJ:["H"],SK:["H"],SL:["h","hb","H","hB"],SM:["H","h","hB"],SN:["H","h","hB"],SO:["h","H"],SR:["H","hB"],SS:["h","hb","H","hB"],ST:["H","hB"],SV:["h","H","hB","hb"],SX:["H","h","hb","hB"],SY:["h","hB","hb","H"],SZ:["h","hb","H","hB"],TA:["H","h","hb","hB"],TC:["h","hb","H","hB"],TD:["h","H","hB"],TF:["H","h","hB"],TG:["H","hB"],TH:["H","h"],TJ:["H","h"],TL:["H","hB","hb","h"],TM:["H","h"],TN:["h","hB","hb","H"],TO:["h","H"],TR:["H","hB"],TT:["h","hb","H","hB"],TW:["hB","hb","h","H"],TZ:["hB","hb","H","h"],UA:["H","hB","h"],UG:["hB","hb","H","h"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],UY:["h","H","hB","hb"],UZ:["H","hB","h"],VA:["H","h","hB"],VC:["h","hb","H","hB"],VE:["h","H","hB","hb"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],VN:["H","h"],VU:["h","H"],WF:["H","hB"],WS:["h","H"],XK:["H","hB","h"],YE:["h","hB","hb","H"],YT:["H","hB"],ZA:["H","h","hb","hB"],ZM:["h","hb","H","hB"],ZW:["H","h"],"af-ZA":["H","h","hB","hb"],"ar-001":["h","hB","hb","H"],"ca-ES":["H","h","hB"],"en-001":["h","hb","H","hB"],"en-HK":["h","hb","H","hB"],"en-IL":["H","h","hb","hB"],"en-MY":["h","hb","H","hB"],"es-BR":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"gu-IN":["hB","hb","h","H"],"hi-IN":["hB","h","H"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],"kn-IN":["hB","h","H"],"ku-SY":["H","hB"],"ml-IN":["hB","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],"ta-IN":["hB","h","hb","H"],"te-IN":["hB","h","H"],"zu-ZA":["H","hB","hb","h"]};function ff(e,t){let n="";for(let r=0;r<e.length;r++){const o=e.charAt(r);if(o==="j"){let a=0;for(;r+1<e.length&&e.charAt(r+1)===o;)a++,r++;let i=1+(a&1),c=a<2?1:3+(a>>1),l="a",u=hf(t);for((u=="H"||u=="k")&&(c=0);c-- >0;)n+=l;for(;i-- >0;)n=u+n}else o==="J"?n+="H":n+=o}return n}function hf(e){let t=e.hourCycle;if(t===void 0&&e.hourCycles&&e.hourCycles.length&&(t=e.hourCycles[0]),t)switch(t){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}const n=e.language;let r;return n!=="root"&&(r=e.maximize().region),(Nn[r||""]||Nn[n||""]||Nn[`${n}-001`]||Nn["001"])[0]}const mf=new RegExp(`^${na.source}*`),pf=new RegExp(`${na.source}*$`);function fe(e,t){return{start:e,end:t}}const gf=!!Object.fromEntries,bf=!!String.prototype.trimStart,vf=!!String.prototype.trimEnd,ra=gf?Object.fromEntries:function(t){const n={};for(const[r,o]of t)n[r]=o;return n},yf=bf?function(t){return t.trimStart()}:function(t){return t.replace(mf,"")},xf=vf?function(t){return t.trimEnd()}:function(t){return t.replace(pf,"")},oa=new RegExp("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");function wf(e,t){return oa.lastIndex=t,oa.exec(e)[1]??""}class Ef{constructor(t,n={}){we(this,"message");we(this,"position");we(this,"locale");we(this,"ignoreTag");we(this,"requiresOtherClause");we(this,"shouldParseSkeletons");this.message=t,this.position={offset:0,line:1,column:1},this.ignoreTag=!!n.ignoreTag,this.locale=n.locale,this.requiresOtherClause=!!n.requiresOtherClause,this.shouldParseSkeletons=!!n.shouldParseSkeletons}parse(){if(this.offset()!==0)throw Error("parser can only be used once");return this.parseMessage(0,"",!1)}parseMessage(t,n,r){let o=[];for(;!this.isEOF();){const a=this.char();if(a===123){const i=this.parseArgument(t,r);if(i.err)return i;o.push(i.val)}else{if(a===125&&t>0)break;if(a===35&&(n==="plural"||n==="selectordinal")){const i=this.clonePosition();this.bump(),o.push({type:Se.pound,location:fe(i,this.clonePosition())})}else if(a===60&&!this.ignoreTag&&this.peek()===47){if(r)break;return this.error(he.UNMATCHED_CLOSING_TAG,fe(this.clonePosition(),this.clonePosition()))}else if(a===60&&!this.ignoreTag&&Wr(this.peek()||0)){const i=this.parseTag(t,n);if(i.err)return i;o.push(i.val)}else{const i=this.parseLiteral(t,n);if(i.err)return i;o.push(i.val)}}}return{val:o,err:null}}parseTag(t,n){const r=this.clonePosition();this.bump();const o=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:Se.literal,value:`<${o}/>`,location:fe(r,this.clonePosition())},err:null};if(this.bumpIf(">")){const a=this.parseMessage(t+1,n,!0);if(a.err)return a;const i=a.val,c=this.clonePosition();if(this.bumpIf("</")){if(this.isEOF()||!Wr(this.char()))return this.error(he.INVALID_TAG,fe(c,this.clonePosition()));const l=this.clonePosition(),u=this.parseTagName();return o!==u?this.error(he.UNMATCHED_CLOSING_TAG,fe(l,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:Se.tag,value:o,children:i,location:fe(r,this.clonePosition())},err:null}:this.error(he.INVALID_TAG,fe(c,this.clonePosition())))}else return this.error(he.UNCLOSED_TAG,fe(r,this.clonePosition()))}else return this.error(he.INVALID_TAG,fe(r,this.clonePosition()))}parseTagName(){const t=this.offset();for(this.bump();!this.isEOF()&&Sf(this.char());)this.bump();return this.message.slice(t,this.offset())}parseLiteral(t,n){const r=this.clonePosition();let o="";for(;;){const i=this.tryParseQuote(n);if(i){o+=i;continue}const c=this.tryParseUnquoted(t,n);if(c){o+=c;continue}const l=this.tryParseLeftAngleBracket();if(l){o+=l;continue}break}const a=fe(r,this.clonePosition());return{val:{type:Se.literal,value:o,location:a},err:null}}tryParseLeftAngleBracket(){return!this.isEOF()&&this.char()===60&&(this.ignoreTag||!_f(this.peek()||0))?(this.bump(),"<"):null}tryParseQuote(t){if(this.isEOF()||this.char()!==39)return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if(t==="plural"||t==="selectordinal")break;return null;default:return null}this.bump();const n=[this.char()];for(this.bump();!this.isEOF();){const r=this.char();if(r===39)if(this.peek()===39)n.push(39),this.bump();else{this.bump();break}else n.push(r);this.bump()}return String.fromCodePoint(...n)}tryParseUnquoted(t,n){if(this.isEOF())return null;const r=this.char();return r===60||r===123||r===35&&(n==="plural"||n==="selectordinal")||r===125&&t>0?null:(this.bump(),String.fromCodePoint(r))}parseArgument(t,n){const r=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(he.EXPECT_ARGUMENT_CLOSING_BRACE,fe(r,this.clonePosition()));if(this.char()===125)return this.bump(),this.error(he.EMPTY_ARGUMENT,fe(r,this.clonePosition()));let o=this.parseIdentifierIfPossible().value;if(!o)return this.error(he.MALFORMED_ARGUMENT,fe(r,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(he.EXPECT_ARGUMENT_CLOSING_BRACE,fe(r,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:Se.argument,value:o,location:fe(r,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(he.EXPECT_ARGUMENT_CLOSING_BRACE,fe(r,this.clonePosition())):this.parseArgumentOptions(t,n,o,r);default:return this.error(he.MALFORMED_ARGUMENT,fe(r,this.clonePosition()))}}parseIdentifierIfPossible(){const t=this.clonePosition(),n=this.offset(),r=wf(this.message,n),o=n+r.length;this.bumpTo(o);const a=this.clonePosition(),i=fe(t,a);return{value:r,location:i}}parseArgumentOptions(t,n,r,o){let a=this.clonePosition(),i=this.parseIdentifierIfPossible().value,c=this.clonePosition();switch(i){case"":return this.error(he.EXPECT_ARGUMENT_TYPE,fe(a,c));case"number":case"date":case"time":{this.bumpSpace();let l=null;if(this.bumpIf(",")){this.bumpSpace();const d=this.clonePosition(),m=this.parseSimpleArgStyleIfPossible();if(m.err)return m;const g=xf(m.val);if(g.length===0)return this.error(he.EXPECT_ARGUMENT_STYLE,fe(this.clonePosition(),this.clonePosition()));const b=fe(d,this.clonePosition());l={style:g,styleLocation:b}}const u=this.tryParseArgumentClose(o);if(u.err)return u;const f=fe(o,this.clonePosition());if(l&&l.style.startsWith("::")){let d=yf(l.style.slice(2));if(i==="number"){const m=this.parseNumberSkeletonFromString(d,l.styleLocation);return m.err?m:{val:{type:Se.number,value:r,location:f,style:m.val},err:null}}else{if(d.length===0)return this.error(he.EXPECT_DATE_TIME_SKELETON,f);let m=d;this.locale&&(m=ff(d,this.locale));const g={type:Sn.dateTime,pattern:m,location:l.styleLocation,parsedOptions:this.shouldParseSkeletons?nf(m):{}};return{val:{type:i==="date"?Se.date:Se.time,value:r,location:f,style:g},err:null}}}return{val:{type:i==="number"?Se.number:i==="date"?Se.date:Se.time,value:r,location:f,style:(l==null?void 0:l.style)??null},err:null}}case"plural":case"selectordinal":case"select":{const l=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(he.EXPECT_SELECT_ARGUMENT_OPTIONS,fe(l,{...l}));this.bumpSpace();let u=this.parseIdentifierIfPossible(),f=0;if(i!=="select"&&u.value==="offset"){if(!this.bumpIf(":"))return this.error(he.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,fe(this.clonePosition(),this.clonePosition()));this.bumpSpace();const b=this.tryParseDecimalInteger(he.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,he.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(b.err)return b;this.bumpSpace(),u=this.parseIdentifierIfPossible(),f=b.val}const d=this.tryParsePluralOrSelectOptions(t,i,n,u);if(d.err)return d;const m=this.tryParseArgumentClose(o);if(m.err)return m;const g=fe(o,this.clonePosition());return i==="select"?{val:{type:Se.select,value:r,options:ra(d.val),location:g},err:null}:{val:{type:Se.plural,value:r,options:ra(d.val),offset:f,pluralType:i==="plural"?"cardinal":"ordinal",location:g},err:null}}default:return this.error(he.INVALID_ARGUMENT_TYPE,fe(a,c))}}tryParseArgumentClose(t){return this.isEOF()||this.char()!==125?this.error(he.EXPECT_ARGUMENT_CLOSING_BRACE,fe(t,this.clonePosition())):(this.bump(),{val:!0,err:null})}parseSimpleArgStyleIfPossible(){let t=0;const n=this.clonePosition();for(;!this.isEOF();)switch(this.char()){case 39:{this.bump();let o=this.clonePosition();if(!this.bumpUntil("'"))return this.error(he.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,fe(o,this.clonePosition()));this.bump();break}case 123:{t+=1,this.bump();break}case 125:{if(t>0)t-=1;else return{val:this.message.slice(n.offset,this.offset()),err:null};break}default:this.bump();break}return{val:this.message.slice(n.offset,this.offset()),err:null}}parseNumberSkeletonFromString(t,n){let r=[];try{r=of(t)}catch{return this.error(he.INVALID_NUMBER_SKELETON,n)}return{val:{type:Sn.number,tokens:r,location:n,parsedOptions:this.shouldParseSkeletons?lf(r):{}},err:null}}tryParsePluralOrSelectOptions(t,n,r,o){let a=!1;const i=[],c=new Set;let{value:l,location:u}=o;for(;;){if(l.length===0){const g=this.clonePosition();if(n!=="select"&&this.bumpIf("=")){const b=this.tryParseDecimalInteger(he.EXPECT_PLURAL_ARGUMENT_SELECTOR,he.INVALID_PLURAL_ARGUMENT_SELECTOR);if(b.err)return b;u=fe(g,this.clonePosition()),l=this.message.slice(g.offset,this.offset())}else break}if(c.has(l))return this.error(n==="select"?he.DUPLICATE_SELECT_ARGUMENT_SELECTOR:he.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,u);l==="other"&&(a=!0),this.bumpSpace();const f=this.clonePosition();if(!this.bumpIf("{"))return this.error(n==="select"?he.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:he.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,fe(this.clonePosition(),this.clonePosition()));const d=this.parseMessage(t+1,n,r);if(d.err)return d;const m=this.tryParseArgumentClose(f);if(m.err)return m;i.push([l,{value:d.val,location:fe(f,this.clonePosition())}]),c.add(l),this.bumpSpace(),{value:l,location:u}=this.parseIdentifierIfPossible()}return i.length===0?this.error(n==="select"?he.EXPECT_SELECT_ARGUMENT_SELECTOR:he.EXPECT_PLURAL_ARGUMENT_SELECTOR,fe(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!a?this.error(he.MISSING_OTHER_CLAUSE,fe(this.clonePosition(),this.clonePosition())):{val:i,err:null}}tryParseDecimalInteger(t,n){let r=1;const o=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(r=-1);let a=!1,i=0;for(;!this.isEOF();){const l=this.char();if(l>=48&&l<=57)a=!0,i=i*10+(l-48),this.bump();else break}const c=fe(o,this.clonePosition());return a?(i*=r,Number.isSafeInteger(i)?{val:i,err:null}:this.error(n,c)):this.error(t,c)}offset(){return this.position.offset}isEOF(){return this.offset()===this.message.length}clonePosition(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}}char(){const t=this.position.offset;if(t>=this.message.length)throw Error("out of bound");const n=this.message.codePointAt(t);if(n===void 0)throw Error(`Offset ${t} is at invalid UTF-16 code unit boundary`);return n}error(t,n){return{val:null,err:{kind:t,message:this.message,location:n}}}bump(){if(this.isEOF())return;const t=this.char();t===10?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=t<65536?1:2)}bumpIf(t){if(this.message.startsWith(t,this.offset())){for(let n=0;n<t.length;n++)this.bump();return!0}return!1}bumpUntil(t){const n=this.offset(),r=this.message.indexOf(t,n);return r>=0?(this.bumpTo(r),!0):(this.bumpTo(this.message.length),!1)}bumpTo(t){if(this.offset()>t)throw Error(`targetOffset ${t} must be greater than or equal to the current offset ${this.offset()}`);for(t=Math.min(t,this.message.length);;){const n=this.offset();if(n===t)break;if(n>t)throw Error(`targetOffset ${t} is at invalid UTF-16 code unit boundary`);if(this.bump(),this.isEOF())break}}bumpSpace(){for(;!this.isEOF()&&Nf(this.char());)this.bump()}peek(){if(this.isEOF())return null;const t=this.char(),n=this.offset();return this.message.charCodeAt(n+(t>=65536?2:1))??null}}function Wr(e){return e>=97&&e<=122||e>=65&&e<=90}function _f(e){return Wr(e)||e===47}function Sf(e){return e===45||e===46||e>=48&&e<=57||e===95||e>=97&&e<=122||e>=65&&e<=90||e==183||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}function Nf(e){return e>=9&&e<=13||e===32||e===133||e>=8206&&e<=8207||e===8232||e===8233}function Vr(e){e.forEach(t=>{if(delete t.location,Qs(t)||Js(t))for(const n in t.options)delete t.options[n].location,Vr(t.options[n].value);else Ys(t)&&ta(t.style)||(Ks(t)||Zs(t))&&$r(t.style)?delete t.style.location:ea(t)&&Vr(t.children)})}function Rf(e,t={}){t={shouldParseSkeletons:!0,requiresOtherClause:!0,...t};const n=new Ef(e,t).parse();if(n.err){const r=SyntaxError(he[n.err.kind]);throw r.location=n.err.location,r.originalMessage=n.err.message,r}return t!=null&&t.captureLocation||Vr(n.val),n.val}let Rn=(function(e){return e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API",e})({});class Cn extends Error{constructor(n,r,o){super(n);we(this,"code");we(this,"originalMessage");this.code=r,this.originalMessage=o}toString(){return`[formatjs Error: ${this.code}] ${this.message}`}}class sa extends Cn{constructor(t,n,r,o){super(`Invalid values for "${t}": "${n}". Options are "${Object.keys(r).join('", "')}"`,Rn.INVALID_VALUE,o)}}class Cf extends Cn{constructor(t,n,r){super(`Value for "${t}" must be of type ${n}`,Rn.INVALID_VALUE,r)}}class Tf extends Cn{constructor(t,n){super(`The intl string context variable "${t}" was not provided to the string "${n}"`,Rn.MISSING_VALUE,n)}}let Oe=(function(e){return e[e.literal=0]="literal",e[e.object=1]="object",e})({});function jf(e){return e.length<2?e:e.reduce((t,n)=>{const r=t[t.length-1];return!r||r.type!==Oe.literal||n.type!==Oe.literal?t.push(n):r.value+=n.value,t},[])}function Af(e){return typeof e=="function"}function Tn(e,t,n,r,o,a,i){if(e.length===1&&Xs(e[0]))return[{type:Oe.literal,value:e[0].value}];const c=[];for(const l of e){if(Xs(l)){c.push({type:Oe.literal,value:l.value});continue}if(df(l)){typeof a=="number"&&c.push({type:Oe.literal,value:n.getNumberFormat(t).format(a)});continue}const{value:u}=l;if(!(o&&u in o))throw new Tf(u,i);let f=o[u];if(uf(l)){(!f||typeof f=="string"||typeof f=="number"||typeof f=="bigint")&&(f=typeof f=="string"||typeof f=="number"||typeof f=="bigint"?String(f):""),c.push({type:typeof f=="string"?Oe.literal:Oe.object,value:f});continue}if(Ks(l)){const d=typeof l.style=="string"?r.date[l.style]:$r(l.style)?l.style.parsedOptions:void 0;c.push({type:Oe.literal,value:n.getDateTimeFormat(t,d).format(f)});continue}if(Zs(l)){const d=typeof l.style=="string"?r.time[l.style]:$r(l.style)?l.style.parsedOptions:r.time.medium;c.push({type:Oe.literal,value:n.getDateTimeFormat(t,d).format(f)});continue}if(Ys(l)){const d=typeof l.style=="string"?r.number[l.style]:ta(l.style)?l.style.parsedOptions:void 0;if(d&&d.scale){const m=d.scale||1;if(typeof f=="bigint"){if(!Number.isInteger(m))throw new TypeError(`Cannot apply fractional scale ${m} to bigint value. Scale must be an integer when formatting bigint.`);f=f*BigInt(m)}else f=f*m}c.push({type:Oe.literal,value:n.getNumberFormat(t,d).format(f)});continue}if(ea(l)){const{children:d,value:m}=l,g=o[m];if(!Af(g))throw new Cf(m,"function",i);const b=Tn(d,t,n,r,o,a);let p=g(b.map(v=>v.value));Array.isArray(p)||(p=[p]),c.push(...p.map(v=>({type:typeof v=="string"?Oe.literal:Oe.object,value:v})))}if(Qs(l)){const d=f,m=(Object.prototype.hasOwnProperty.call(l.options,d)?l.options[d]:void 0)||l.options.other;if(!m)throw new sa(l.value,f,Object.keys(l.options),i);c.push(...Tn(m.value,t,n,r,o));continue}if(Js(l)){const d=`=${f}`;let m=Object.prototype.hasOwnProperty.call(l.options,d)?l.options[d]:void 0;if(!m){if(!Intl.PluralRules)throw new Cn(`Intl.PluralRules is not available in this environment.
|
|
23
|
+
Try polyfilling it using "@formatjs/intl-pluralrules"
|
|
24
|
+
`,Rn.MISSING_INTL_API,i);const b=typeof f=="bigint"?Number(f):f,p=n.getPluralRules(t,{type:l.pluralType}).select(b-(l.offset||0));m=(Object.prototype.hasOwnProperty.call(l.options,p)?l.options[p]:void 0)||l.options.other}if(!m)throw new sa(l.value,f,Object.keys(l.options),i);const g=typeof f=="bigint"?Number(f):f;c.push(...Tn(m.value,t,n,r,o,g-(l.offset||0)));continue}}return jf(c)}function Pf(e,t){return t?{...e,...t,...Object.keys(e).reduce((n,r)=>(n[r]={...e[r],...t[r]},n),{})}:e}function Of(e,t){return t?Object.keys(e).reduce((n,r)=>(n[r]=Pf(e[r],t[r]),n),{...e}):e}function qr(e){return{create(){return{get(t){return e[t]},set(t,n){e[t]=n}}}}}function kf(e={number:{},dateTime:{},pluralRules:{}}){return{getNumberFormat:En((...t)=>new Intl.NumberFormat(...t),{cache:qr(e.number),strategy:_n.variadic}),getDateTimeFormat:En((...t)=>new Intl.DateTimeFormat(...t),{cache:qr(e.dateTime),strategy:_n.variadic}),getPluralRules:En((...t)=>new Intl.PluralRules(...t),{cache:qr(e.pluralRules),strategy:_n.variadic})}}const Pe=class Pe{constructor(t,n=Pe.defaultLocale,r,o){we(this,"ast");we(this,"locales");we(this,"resolvedLocale");we(this,"formatters");we(this,"formats");we(this,"message");we(this,"formatterCache",{number:{},dateTime:{},pluralRules:{}});we(this,"format",t=>{const n=this.formatToParts(t);if(n.length===1)return n[0].value;const r=n.reduce((o,a)=>(!o.length||a.type!==Oe.literal||typeof o[o.length-1]!="string"?o.push(a.value):o[o.length-1]+=a.value,o),[]);return r.length<=1?r[0]||"":r});we(this,"formatToParts",t=>Tn(this.ast,this.locales,this.formatters,this.formats,t,void 0,this.message));we(this,"resolvedOptions",()=>{var t;return{locale:((t=this.resolvedLocale)==null?void 0:t.toString())||Intl.NumberFormat.supportedLocalesOf(this.locales)[0]}});we(this,"getAst",()=>this.ast);if(this.locales=n,this.resolvedLocale=Pe.resolveLocale(n),typeof t=="string"){if(this.message=t,!Pe.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");const{...a}=o||{};this.ast=Pe.__parse(t,{...a,locale:this.resolvedLocale})}else this.ast=t;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");this.formats=Of(Pe.formats,r),this.formatters=o&&o.formatters||kf(this.formatterCache)}static get defaultLocale(){return Pe.memoizedDefaultLocale||(Pe.memoizedDefaultLocale=new Intl.NumberFormat().resolvedOptions().locale),Pe.memoizedDefaultLocale}};we(Pe,"memoizedDefaultLocale",null),we(Pe,"resolveLocale",t=>{if(typeof Intl.Locale>"u")return;const n=Intl.NumberFormat.supportedLocalesOf(t);return n.length>0?new Intl.Locale(n[0]):new Intl.Locale(typeof t=="string"?t:t[0])}),we(Pe,"__parse",Rf),we(Pe,"formats",{number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}});let rn=Pe;function aa(...[e,t,n,r]){if(Array.isArray(t))throw new lt(ze.INVALID_MESSAGE,void 0);if(typeof t=="object")throw new lt(ze.INSUFFICIENT_PATH,void 0);if(typeof t=="string"){const m=(function(g,b){return b||/'[{}]/.test(g)?void 0:g})(t,n);if(m)return m}const{cache:o,formats:a,formatters:i,globalFormats:c,locale:l,timeZone:u}=r;let f;i.getMessageFormat||(i.getMessageFormat=(function(m,g){return ef(((...b)=>new rn(b[0],b[1],b[2],{formatters:g,...b[3]})),m.message)})(o,i));try{f=i.getMessageFormat(t,l,(function(m,g,b){const p=rn.formats.date,v=rn.formats.time,x={...m==null?void 0:m.dateTime,...g==null?void 0:g.dateTime},y={date:{...p,...x},time:{...v,...x},number:{...m==null?void 0:m.number,...g==null?void 0:g.number}};return b&&["date","time"].forEach((w=>{const E=y[w];for(const[N,j]of Object.entries(E))E[N]={timeZone:b,...j}})),y})(c,a,u),{formatters:{...i,getDateTimeFormat:(m,g)=>i.getDateTimeFormat(m,{...g,timeZone:(g==null?void 0:g.timeZone)??u})}})}catch{throw new lt(ze.INVALID_MESSAGE,void 0)}const d=f.format(n);return S.isValidElement(d)||Array.isArray(d)||typeof d=="string"?d:String(d)}aa.raw=!0;function Xr(...e){return e.filter(Boolean).join(".")}function Df(e){return Xr(e.namespace,e.key)}function jn(e,t,n,r){const o=Xr(r,n);if(!t)throw new Error(o);let a=t;return n.split(".").forEach((i=>{const c=a[i];if(i==null||c==null)throw new Error(o+` (${e})`);a=c})),a}function If(e){const t=(function(n,r,o){try{if(!r)throw new Error(void 0);const a=o?jn(n,r,o):r;if(!a)throw new Error(o);return a}catch(a){return new lt(ze.MISSING_MESSAGE,a.message)}})(e.locale,e.messages,e.namespace);return(function({cache:n,formats:r,formatters:o,getMessageFallback:a=Df,locale:i,messagesOrError:c,namespace:l,onError:u,timeZone:f}){const d=c instanceof lt;function m(p,v,x,y){const w=new lt(v,x);return u(w),y??a({error:w,key:p,namespace:l})}function g(p,v,x,y){const w=y;let E;if(d){if(!w)return u(c),a({error:c,key:p,namespace:l});E=w}else{const N=c;try{E=jn(i,N,p,l)}catch(j){if(!w)return m(p,ze.MISSING_MESSAGE,j.message,w);E=w}}try{const N=Xr(l,p);return aa(N,E,v&&(function(j){const R={};return Object.keys(j).forEach((_=>{let I=0;const M=j[_];let q;q=typeof M=="function"?U=>{const X=M(U);return S.isValidElement(X)?S.cloneElement(X,{key:_+I++}):X}:M,R[_]=q})),R})(v),{cache:n,formatters:o,globalFormats:r,formats:x,locale:i,timeZone:f})}catch(N){let j,R;return N instanceof lt?(j=N.code,R=N.originalMessage):(j=ze.FORMATTING_ERROR,R=N.message),m(p,j,R,w)}}function b(p,v,x,y){const w=g(p,v,x,y);return typeof w!="string"?m(p,ze.INVALID_MESSAGE,void 0):w}return b.rich=g,b.markup=(p,v,x,y)=>g(p,v,x,y),b.raw=p=>{if(d)return u(c),a({error:c,key:p,namespace:l});const v=c;try{return jn(i,v,p,l)}catch(x){return m(p,ze.MISSING_MESSAGE,x.message)}},b.has=p=>{if(d)return!1;try{return jn(i,c,p,l),!0}catch{return!1}},b})({...e,messagesOrError:t})}function Mf(e,t){return e===t?void 0:e.slice((t+".").length)}const Lf=S.createContext(void 0);function ia(){const e=S.useContext(Lf);if(!e)throw new Error(void 0);return e}let ca=!1;const Hf=typeof window>"u";function Bf(e){return(function(t,n,r){const{cache:o,formats:a,formatters:i,getMessageFallback:c,locale:l,onError:u,timeZone:f}=ia(),d=t[r],m=Mf(n,r);return f||ca||!Hf||(ca=!0,u(new lt(ze.ENVIRONMENT_FALLBACK,void 0))),S.useMemo((()=>If({cache:o,formatters:i,getMessageFallback:c,messages:d,namespace:m,onError:u,formats:a,locale:l,timeZone:f})),[o,i,c,d,m,u,a,l,f])})({"!":ia().messages},e?`!.${e}`:"!","!")}function Ff(e,t){return(...n)=>{try{return t(...n)}catch{throw new Error(void 0)}}}const J=Ff(0,Bf);function Uf(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}Array(12).fill(0);let Yr=1;class Gf{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...o}=t,a=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:Yr++,i=this.toasts.find(l=>l.id===a),c=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),i?this.toasts=this.toasts.map(l=>l.id===a?(this.publish({...l,...t,id:a,title:r}),{...l,...t,id:a,dismissible:c,title:r}):l):this.addToast({title:r,...o,dismissible:c,id:a}),a},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const o=Promise.resolve(t instanceof Function?t():t);let a=r!==void 0,i;const c=o.then(async u=>{if(i=["resolve",u],S.isValidElement(u))a=!1,this.create({id:r,type:"default",message:u});else if($f(u)&&!u.ok){a=!1;const d=typeof n.error=="function"?await n.error(`HTTP error! status: ${u.status}`):n.error,m=typeof n.description=="function"?await n.description(`HTTP error! status: ${u.status}`):n.description,b=typeof d=="object"&&!S.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:m,...b})}else if(u instanceof Error){a=!1;const d=typeof n.error=="function"?await n.error(u):n.error,m=typeof n.description=="function"?await n.description(u):n.description,b=typeof d=="object"&&!S.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:m,...b})}else if(n.success!==void 0){a=!1;const d=typeof n.success=="function"?await n.success(u):n.success,m=typeof n.description=="function"?await n.description(u):n.description,b=typeof d=="object"&&!S.isValidElement(d)?d:{message:d};this.create({id:r,type:"success",description:m,...b})}}).catch(async u=>{if(i=["reject",u],n.error!==void 0){a=!1;const f=typeof n.error=="function"?await n.error(u):n.error,d=typeof n.description=="function"?await n.description(u):n.description,g=typeof f=="object"&&!S.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:d,...g})}}).finally(()=>{a&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),l=()=>new Promise((u,f)=>c.then(()=>i[0]==="reject"?f(i[1]):u(i[1])).catch(f));return typeof r!="string"&&typeof r!="number"?{unwrap:l}:Object.assign(r,{unwrap:l})},this.custom=(t,n)=>{const r=(n==null?void 0:n.id)||Yr++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Ie=new Gf,zf=(e,t)=>{const n=(t==null?void 0:t.id)||Yr++;return Ie.addToast({title:e,...t,id:n}),n},$f=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Wf=zf,Vf=()=>Ie.toasts,qf=()=>Ie.getActiveToasts(),W=Object.assign(Wf,{success:Ie.success,info:Ie.info,warning:Ie.warning,error:Ie.error,custom:Ie.custom,message:Ie.message,promise:Ie.promise,dismiss:Ie.dismiss,loading:Ie.loading},{getHistory:Vf,getToasts:qf});Uf("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");/**
|
|
25
|
+
* @license lucide-react v0.577.0 - ISC
|
|
26
|
+
*
|
|
27
|
+
* This source code is licensed under the ISC license.
|
|
28
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
29
|
+
*/const la=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
|
|
30
|
+
* @license lucide-react v0.577.0 - ISC
|
|
31
|
+
*
|
|
32
|
+
* This source code is licensed under the ISC license.
|
|
33
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
34
|
+
*/const Xf=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
35
|
+
* @license lucide-react v0.577.0 - ISC
|
|
36
|
+
*
|
|
37
|
+
* This source code is licensed under the ISC license.
|
|
38
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
39
|
+
*/const Yf=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
|
|
40
|
+
* @license lucide-react v0.577.0 - ISC
|
|
41
|
+
*
|
|
42
|
+
* This source code is licensed under the ISC license.
|
|
43
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
44
|
+
*/const ua=e=>{const t=Yf(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
|
|
45
|
+
* @license lucide-react v0.577.0 - ISC
|
|
46
|
+
*
|
|
47
|
+
* This source code is licensed under the ISC license.
|
|
48
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
49
|
+
*/var Kf={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
50
|
+
* @license lucide-react v0.577.0 - ISC
|
|
51
|
+
*
|
|
52
|
+
* This source code is licensed under the ISC license.
|
|
53
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
54
|
+
*/const Zf=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/**
|
|
55
|
+
* @license lucide-react v0.577.0 - ISC
|
|
56
|
+
*
|
|
57
|
+
* This source code is licensed under the ISC license.
|
|
58
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
59
|
+
*/const Qf=S.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:a,iconNode:i,...c},l)=>S.createElement("svg",{ref:l,...Kf,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:la("lucide",o),...!a&&!Zf(c)&&{"aria-hidden":"true"},...c},[...i.map(([u,f])=>S.createElement(u,f)),...Array.isArray(a)?a:[a]]));/**
|
|
60
|
+
* @license lucide-react v0.577.0 - ISC
|
|
61
|
+
*
|
|
62
|
+
* This source code is licensed under the ISC license.
|
|
63
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
64
|
+
*/const be=(e,t)=>{const n=S.forwardRef(({className:r,...o},a)=>S.createElement(Qf,{ref:a,iconNode:t,className:la(`lucide-${Xf(ua(e))}`,`lucide-${e}`,r),...o}));return n.displayName=ua(e),n};/**
|
|
65
|
+
* @license lucide-react v0.577.0 - ISC
|
|
66
|
+
*
|
|
67
|
+
* This source code is licensed under the ISC license.
|
|
68
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
69
|
+
*/const Kr=be("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
70
|
+
* @license lucide-react v0.577.0 - ISC
|
|
71
|
+
*
|
|
72
|
+
* This source code is licensed under the ISC license.
|
|
73
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
74
|
+
*/const An=be("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
75
|
+
* @license lucide-react v0.577.0 - ISC
|
|
76
|
+
*
|
|
77
|
+
* This source code is licensed under the ISC license.
|
|
78
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
79
|
+
*/const Pn=be("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
80
|
+
* @license lucide-react v0.577.0 - ISC
|
|
81
|
+
*
|
|
82
|
+
* This source code is licensed under the ISC license.
|
|
83
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
84
|
+
*/const Jf=be("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
|
|
85
|
+
* @license lucide-react v0.577.0 - ISC
|
|
86
|
+
*
|
|
87
|
+
* This source code is licensed under the ISC license.
|
|
88
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
89
|
+
*/const Zr=be("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
90
|
+
* @license lucide-react v0.577.0 - ISC
|
|
91
|
+
*
|
|
92
|
+
* This source code is licensed under the ISC license.
|
|
93
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
94
|
+
*/const da=be("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
|
|
95
|
+
* @license lucide-react v0.577.0 - ISC
|
|
96
|
+
*
|
|
97
|
+
* This source code is licensed under the ISC license.
|
|
98
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
99
|
+
*/const eh=be("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);/**
|
|
100
|
+
* @license lucide-react v0.577.0 - ISC
|
|
101
|
+
*
|
|
102
|
+
* This source code is licensed under the ISC license.
|
|
103
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
104
|
+
*/const th=be("ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
|
|
105
|
+
* @license lucide-react v0.577.0 - ISC
|
|
106
|
+
*
|
|
107
|
+
* This source code is licensed under the ISC license.
|
|
108
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
109
|
+
*/const Qr=be("folder-open",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
|
|
110
|
+
* @license lucide-react v0.577.0 - ISC
|
|
111
|
+
*
|
|
112
|
+
* This source code is licensed under the ISC license.
|
|
113
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
114
|
+
*/const fa=be("git-branch",[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]]);/**
|
|
115
|
+
* @license lucide-react v0.577.0 - ISC
|
|
116
|
+
*
|
|
117
|
+
* This source code is licensed under the ISC license.
|
|
118
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
119
|
+
*/const nh=be("git-pull-request",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["line",{x1:"6",x2:"6",y1:"9",y2:"21",key:"rroup"}]]);/**
|
|
120
|
+
* @license lucide-react v0.577.0 - ISC
|
|
121
|
+
*
|
|
122
|
+
* This source code is licensed under the ISC license.
|
|
123
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
124
|
+
*/const ha=be("github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);/**
|
|
125
|
+
* @license lucide-react v0.577.0 - ISC
|
|
126
|
+
*
|
|
127
|
+
* This source code is licensed under the ISC license.
|
|
128
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
129
|
+
*/const rh=be("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
|
|
130
|
+
* @license lucide-react v0.577.0 - ISC
|
|
131
|
+
*
|
|
132
|
+
* This source code is licensed under the ISC license.
|
|
133
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
134
|
+
*/const ve=be("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
135
|
+
* @license lucide-react v0.577.0 - ISC
|
|
136
|
+
*
|
|
137
|
+
* This source code is licensed under the ISC license.
|
|
138
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
139
|
+
*/const on=be("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]);/**
|
|
140
|
+
* @license lucide-react v0.577.0 - ISC
|
|
141
|
+
*
|
|
142
|
+
* This source code is licensed under the ISC license.
|
|
143
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
144
|
+
*/const On=be("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
145
|
+
* @license lucide-react v0.577.0 - ISC
|
|
146
|
+
*
|
|
147
|
+
* This source code is licensed under the ISC license.
|
|
148
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
149
|
+
*/const et=be("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
|
|
150
|
+
* @license lucide-react v0.577.0 - ISC
|
|
151
|
+
*
|
|
152
|
+
* This source code is licensed under the ISC license.
|
|
153
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
154
|
+
*/const oh=be("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);/**
|
|
155
|
+
* @license lucide-react v0.577.0 - ISC
|
|
156
|
+
*
|
|
157
|
+
* This source code is licensed under the ISC license.
|
|
158
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
159
|
+
*/const Jr=be("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]);/**
|
|
160
|
+
* @license lucide-react v0.577.0 - ISC
|
|
161
|
+
*
|
|
162
|
+
* This source code is licensed under the ISC license.
|
|
163
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
164
|
+
*/const sh=be("square-pen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/**
|
|
165
|
+
* @license lucide-react v0.577.0 - ISC
|
|
166
|
+
*
|
|
167
|
+
* This source code is licensed under the ISC license.
|
|
168
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
169
|
+
*/const ah=be("star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/**
|
|
170
|
+
* @license lucide-react v0.577.0 - ISC
|
|
171
|
+
*
|
|
172
|
+
* This source code is licensed under the ISC license.
|
|
173
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
174
|
+
*/const ih=be("store",[["path",{d:"M15 21v-5a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v5",key:"slp6dd"}],["path",{d:"M17.774 10.31a1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.451 0 1.12 1.12 0 0 0-1.548 0 2.5 2.5 0 0 1-3.452 0 1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.77-3.248l2.889-4.184A2 2 0 0 1 7 2h10a2 2 0 0 1 1.653.873l2.895 4.192a2.5 2.5 0 0 1-3.774 3.244",key:"o0xfot"}],["path",{d:"M4 10.95V19a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8.05",key:"wn3emo"}]]);/**
|
|
175
|
+
* @license lucide-react v0.577.0 - ISC
|
|
176
|
+
*
|
|
177
|
+
* This source code is licensed under the ISC license.
|
|
178
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
179
|
+
*/const ch=be("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);/**
|
|
180
|
+
* @license lucide-react v0.577.0 - ISC
|
|
181
|
+
*
|
|
182
|
+
* This source code is licensed under the ISC license.
|
|
183
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
184
|
+
*/const lh=be("toggle-left",[["circle",{cx:"9",cy:"12",r:"3",key:"u3jwor"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]]);/**
|
|
185
|
+
* @license lucide-react v0.577.0 - ISC
|
|
186
|
+
*
|
|
187
|
+
* This source code is licensed under the ISC license.
|
|
188
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
189
|
+
*/const uh=be("toggle-right",[["circle",{cx:"15",cy:"12",r:"3",key:"1afu0r"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]]);/**
|
|
190
|
+
* @license lucide-react v0.577.0 - ISC
|
|
191
|
+
*
|
|
192
|
+
* This source code is licensed under the ISC license.
|
|
193
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
194
|
+
*/const eo=be("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);/**
|
|
195
|
+
* @license lucide-react v0.577.0 - ISC
|
|
196
|
+
*
|
|
197
|
+
* This source code is licensed under the ISC license.
|
|
198
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
199
|
+
*/const ma=be("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function $e({title:e,description:t,children:n}){return s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-baseline gap-3",children:[s.jsx("h2",{className:"text-xl font-semibold tracking-tight",children:e}),t&&s.jsx("p",{className:"text-sm text-muted-foreground",children:t})]}),n&&s.jsx("div",{className:"flex items-center space-x-2",children:n})]})}function pa(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function sn(...e){return t=>{let n=!1;const r=e.map(o=>{const a=pa(o,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let o=0;o<r.length;o++){const a=r[o];typeof a=="function"?a():pa(e[o],null)}}}}function pe(...e){return h.useCallback(sn(...e),e)}var dh=Symbol.for("react.lazy"),kn=h[" use ".trim().toString()];function fh(e){return typeof e=="object"&&e!==null&&"then"in e}function ga(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===dh&&"_payload"in e&&fh(e._payload)}function hh(e){const t=ph(e),n=h.forwardRef((r,o)=>{let{children:a,...i}=r;ga(a)&&typeof kn=="function"&&(a=kn(a._payload));const c=h.Children.toArray(a),l=c.find(bh);if(l){const u=l.props.children,f=c.map(d=>d===l?h.Children.count(u)>1?h.Children.only(null):h.isValidElement(u)?u.props.children:null:d);return s.jsx(t,{...i,ref:o,children:h.isValidElement(u)?h.cloneElement(u,void 0,f):null})}return s.jsx(t,{...i,ref:o,children:a})});return n.displayName=`${e}.Slot`,n}var mh=hh("Slot");function ph(e){const t=h.forwardRef((n,r)=>{let{children:o,...a}=n;if(ga(o)&&typeof kn=="function"&&(o=kn(o._payload)),h.isValidElement(o)){const i=yh(o),c=vh(a,o.props);return o.type!==h.Fragment&&(c.ref=r?sn(r,i):i),h.cloneElement(o,c)}return h.Children.count(o)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var gh=Symbol("radix.slottable");function bh(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===gh}function vh(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...c)=>{const l=a(...c);return o(...c),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...a}:r==="className"&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}function yh(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function ba(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=ba(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function va(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=ba(e))&&(r&&(r+=" "),r+=t);return r}const ya=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,xa=va,wa=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return xa(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:a}=t,i=Object.keys(o).map(u=>{const f=n==null?void 0:n[u],d=a==null?void 0:a[u];if(f===null)return null;const m=ya(f)||ya(d);return o[u][m]}),c=n&&Object.entries(n).reduce((u,f)=>{let[d,m]=f;return m===void 0||(u[d]=m),u},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,f)=>{let{class:d,className:m,...g}=f;return Object.entries(g).every(b=>{let[p,v]=b;return Array.isArray(v)?v.includes({...a,...c}[p]):{...a,...c}[p]===v})?[...u,d,m]:u},[]);return xa(e,i,l,n==null?void 0:n.class,n==null?void 0:n.className)},xh=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},wh=(e,t)=>({classGroupId:e,validator:t}),Ea=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Dn="-",_a=[],Eh="arbitrary..",_h=e=>{const t=Nh(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return Sh(i);const c=i.split(Dn),l=c[0]===""&&c.length>1?1:0;return Sa(c,l,t)},getConflictingClassGroupIds:(i,c)=>{if(c){const l=r[i],u=n[i];return l?u?xh(u,l):l:u||_a}return n[i]||_a}}},Sa=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],a=n.nextPart.get(o);if(a){const u=Sa(e,t+1,a);if(u)return u}const i=n.validators;if(i===null)return;const c=t===0?e.join(Dn):e.slice(t).join(Dn),l=i.length;for(let u=0;u<l;u++){const f=i[u];if(f.validator(c))return f.classGroupId}},Sh=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?Eh+r:void 0})(),Nh=e=>{const{theme:t,classGroups:n}=e;return Rh(n,t)},Rh=(e,t)=>{const n=Ea();for(const r in e){const o=e[r];to(o,n,r,t)}return n},to=(e,t,n,r)=>{const o=e.length;for(let a=0;a<o;a++){const i=e[a];Ch(i,t,n,r)}},Ch=(e,t,n,r)=>{if(typeof e=="string"){Th(e,t,n);return}if(typeof e=="function"){jh(e,t,n,r);return}Ah(e,t,n,r)},Th=(e,t,n)=>{const r=e===""?t:Na(t,e);r.classGroupId=n},jh=(e,t,n,r)=>{if(Ph(e)){to(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(wh(n,e))},Ah=(e,t,n,r)=>{const o=Object.entries(e),a=o.length;for(let i=0;i<a;i++){const[c,l]=o[i];to(l,Na(t,c),n,r)}},Na=(e,t)=>{let n=e;const r=t.split(Dn),o=r.length;for(let a=0;a<o;a++){const i=r[a];let c=n.nextPart.get(i);c||(c=Ea(),n.nextPart.set(i,c)),n=c}return n},Ph=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Oh=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const o=(a,i)=>{n[a]=i,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(a){let i=n[a];if(i!==void 0)return i;if((i=r[a])!==void 0)return o(a,i),i},set(a,i){a in n?n[a]=i:o(a,i)}}},no="!",Ra=":",kh=[],Ca=(e,t,n,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),Dh=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const a=[];let i=0,c=0,l=0,u;const f=o.length;for(let p=0;p<f;p++){const v=o[p];if(i===0&&c===0){if(v===Ra){a.push(o.slice(l,p)),l=p+1;continue}if(v==="/"){u=p;continue}}v==="["?i++:v==="]"?i--:v==="("?c++:v===")"&&c--}const d=a.length===0?o:o.slice(l);let m=d,g=!1;d.endsWith(no)?(m=d.slice(0,-1),g=!0):d.startsWith(no)&&(m=d.slice(1),g=!0);const b=u&&u>l?u-l:void 0;return Ca(a,g,m,b)};if(t){const o=t+Ra,a=r;r=i=>i.startsWith(o)?a(i.slice(o.length)):Ca(kh,!1,i,void 0,!0)}if(n){const o=r;r=a=>n({className:a,parseClassName:o})}return r},Ih=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let o=[];for(let a=0;a<n.length;a++){const i=n[a],c=i[0]==="[",l=t.has(i);c||l?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(i)):o.push(i)}return o.length>0&&(o.sort(),r.push(...o)),r}},Mh=e=>({cache:Oh(e.cacheSize),parseClassName:Dh(e),sortModifiers:Ih(e),..._h(e)}),Lh=/\s+/,Hh=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:a}=t,i=[],c=e.trim().split(Lh);let l="";for(let u=c.length-1;u>=0;u-=1){const f=c[u],{isExternal:d,modifiers:m,hasImportantModifier:g,baseClassName:b,maybePostfixModifierPosition:p}=n(f);if(d){l=f+(l.length>0?" "+l:l);continue}let v=!!p,x=r(v?b.substring(0,p):b);if(!x){if(!v){l=f+(l.length>0?" "+l:l);continue}if(x=r(b),!x){l=f+(l.length>0?" "+l:l);continue}v=!1}const y=m.length===0?"":m.length===1?m[0]:a(m).join(":"),w=g?y+no:y,E=w+x;if(i.indexOf(E)>-1)continue;i.push(E);const N=o(x,v);for(let j=0;j<N.length;++j){const R=N[j];i.push(w+R)}l=f+(l.length>0?" "+l:l)}return l},Bh=(...e)=>{let t=0,n,r,o="";for(;t<e.length;)(n=e[t++])&&(r=Ta(n))&&(o&&(o+=" "),o+=r);return o},Ta=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Ta(e[r]))&&(n&&(n+=" "),n+=t);return n},Fh=(e,...t)=>{let n,r,o,a;const i=l=>{const u=t.reduce((f,d)=>d(f),e());return n=Mh(u),r=n.cache.get,o=n.cache.set,a=c,c(l)},c=l=>{const u=r(l);if(u)return u;const f=Hh(l,n);return o(l,f),f};return a=i,(...l)=>a(Bh(...l))},Uh=[],Re=e=>{const t=n=>n[e]||Uh;return t.isThemeGetter=!0,t},ja=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Aa=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Gh=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,zh=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,$h=/\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$/,Wh=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Vh=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,qh=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ut=e=>Gh.test(e),ae=e=>!!e&&!Number.isNaN(Number(e)),dt=e=>!!e&&Number.isInteger(Number(e)),ro=e=>e.endsWith("%")&&ae(e.slice(0,-1)),tt=e=>zh.test(e),Pa=()=>!0,Xh=e=>$h.test(e)&&!Wh.test(e),oo=()=>!1,Yh=e=>Vh.test(e),Kh=e=>qh.test(e),Zh=e=>!L(e)&&!H(e),Qh=e=>ft(e,La,oo),L=e=>ja.test(e),Nt=e=>ft(e,Ha,Xh),Oa=e=>ft(e,am,ae),Jh=e=>ft(e,Fa,Pa),em=e=>ft(e,Ba,oo),ka=e=>ft(e,Ia,oo),tm=e=>ft(e,Ma,Kh),In=e=>ft(e,Ua,Yh),H=e=>Aa.test(e),an=e=>Rt(e,Ha),nm=e=>Rt(e,Ba),Da=e=>Rt(e,Ia),rm=e=>Rt(e,La),om=e=>Rt(e,Ma),Mn=e=>Rt(e,Ua,!0),sm=e=>Rt(e,Fa,!0),ft=(e,t,n)=>{const r=ja.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Rt=(e,t,n=!1)=>{const r=Aa.exec(e);return r?r[1]?t(r[1]):n:!1},Ia=e=>e==="position"||e==="percentage",Ma=e=>e==="image"||e==="url",La=e=>e==="length"||e==="size"||e==="bg-size",Ha=e=>e==="length",am=e=>e==="number",Ba=e=>e==="family-name",Fa=e=>e==="number"||e==="weight",Ua=e=>e==="shadow",im=Fh(()=>{const e=Re("color"),t=Re("font"),n=Re("text"),r=Re("font-weight"),o=Re("tracking"),a=Re("leading"),i=Re("breakpoint"),c=Re("container"),l=Re("spacing"),u=Re("radius"),f=Re("shadow"),d=Re("inset-shadow"),m=Re("text-shadow"),g=Re("drop-shadow"),b=Re("blur"),p=Re("perspective"),v=Re("aspect"),x=Re("ease"),y=Re("animate"),w=()=>["auto","avoid","all","avoid-page","page","left","right","column"],E=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],N=()=>[...E(),H,L],j=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto","contain","none"],_=()=>[H,L,l],I=()=>[ut,"full","auto",..._()],M=()=>[dt,"none","subgrid",H,L],q=()=>["auto",{span:["full",dt,H,L]},dt,H,L],U=()=>[dt,"auto",H,L],X=()=>["auto","min","max","fr",H,L],Q=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],oe=()=>["start","end","center","stretch","center-safe","end-safe"],F=()=>["auto",..._()],K=()=>[ut,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",..._()],G=()=>[ut,"screen","full","dvw","lvw","svw","min","max","fit",..._()],D=()=>[ut,"screen","full","lh","dvh","lvh","svh","min","max","fit",..._()],O=()=>[e,H,L],T=()=>[...E(),Da,ka,{position:[H,L]}],z=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ie=()=>["auto","cover","contain",rm,Qh,{size:[H,L]}],se=()=>[ro,an,Nt],me=()=>["","none","full",u,H,L],ce=()=>["",ae,an,Nt],k=()=>["solid","dashed","dotted","double"],te=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],$=()=>[ae,ro,Da,ka],le=()=>["","none",b,H,L],ue=()=>["none",ae,H,L],de=()=>["none",ae,H,L],ye=()=>[ae,H,L],Te=()=>[ut,"full",..._()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[tt],breakpoint:[tt],color:[Pa],container:[tt],"drop-shadow":[tt],ease:["in","out","in-out"],font:[Zh],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[tt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[tt],shadow:[tt],spacing:["px",ae],text:[tt],"text-shadow":[tt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ut,L,H,v]}],container:["container"],columns:[{columns:[ae,L,H,c]}],"break-after":[{"break-after":w()}],"break-before":[{"break-before":w()}],"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"],sr:["sr-only","not-sr-only"],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:N()}],overflow:[{overflow:j()}],"overflow-x":[{"overflow-x":j()}],"overflow-y":[{"overflow-y":j()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:I()}],"inset-x":[{"inset-x":I()}],"inset-y":[{"inset-y":I()}],start:[{"inset-s":I(),start:I()}],end:[{"inset-e":I(),end:I()}],"inset-bs":[{"inset-bs":I()}],"inset-be":[{"inset-be":I()}],top:[{top:I()}],right:[{right:I()}],bottom:[{bottom:I()}],left:[{left:I()}],visibility:["visible","invisible","collapse"],z:[{z:[dt,"auto",H,L]}],basis:[{basis:[ut,"full","auto",c,..._()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ae,ut,"auto","initial","none",L]}],grow:[{grow:["",ae,H,L]}],shrink:[{shrink:["",ae,H,L]}],order:[{order:[dt,"first","last","none",H,L]}],"grid-cols":[{"grid-cols":M()}],"col-start-end":[{col:q()}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":M()}],"row-start-end":[{row:q()}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":X()}],"auto-rows":[{"auto-rows":X()}],gap:[{gap:_()}],"gap-x":[{"gap-x":_()}],"gap-y":[{"gap-y":_()}],"justify-content":[{justify:[...Q(),"normal"]}],"justify-items":[{"justify-items":[...oe(),"normal"]}],"justify-self":[{"justify-self":["auto",...oe()]}],"align-content":[{content:["normal",...Q()]}],"align-items":[{items:[...oe(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...oe(),{baseline:["","last"]}]}],"place-content":[{"place-content":Q()}],"place-items":[{"place-items":[...oe(),"baseline"]}],"place-self":[{"place-self":["auto",...oe()]}],p:[{p:_()}],px:[{px:_()}],py:[{py:_()}],ps:[{ps:_()}],pe:[{pe:_()}],pbs:[{pbs:_()}],pbe:[{pbe:_()}],pt:[{pt:_()}],pr:[{pr:_()}],pb:[{pb:_()}],pl:[{pl:_()}],m:[{m:F()}],mx:[{mx:F()}],my:[{my:F()}],ms:[{ms:F()}],me:[{me:F()}],mbs:[{mbs:F()}],mbe:[{mbe:F()}],mt:[{mt:F()}],mr:[{mr:F()}],mb:[{mb:F()}],ml:[{ml:F()}],"space-x":[{"space-x":_()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":_()}],"space-y-reverse":["space-y-reverse"],size:[{size:K()}],"inline-size":[{inline:["auto",...G()]}],"min-inline-size":[{"min-inline":["auto",...G()]}],"max-inline-size":[{"max-inline":["none",...G()]}],"block-size":[{block:["auto",...D()]}],"min-block-size":[{"min-block":["auto",...D()]}],"max-block-size":[{"max-block":["none",...D()]}],w:[{w:[c,"screen",...K()]}],"min-w":[{"min-w":[c,"screen","none",...K()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[i]},...K()]}],h:[{h:["screen","lh",...K()]}],"min-h":[{"min-h":["screen","lh","none",...K()]}],"max-h":[{"max-h":["screen","lh",...K()]}],"font-size":[{text:["base",n,an,Nt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,sm,Jh]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ro,L]}],"font-family":[{font:[nm,em,t]}],"font-features":[{"font-features":[L]}],"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-fractions"],tracking:[{tracking:[o,H,L]}],"line-clamp":[{"line-clamp":[ae,"none",H,Oa]}],leading:[{leading:[a,..._()]}],"list-image":[{"list-image":["none",H,L]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",H,L]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:O()}],"text-color":[{text:O()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...k(),"wavy"]}],"text-decoration-thickness":[{decoration:[ae,"from-font","auto",H,Nt]}],"text-decoration-color":[{decoration:O()}],"underline-offset":[{"underline-offset":[ae,"auto",H,L]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:_()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",H,L]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",H,L]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:T()}],"bg-repeat":[{bg:z()}],"bg-size":[{bg:ie()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},dt,H,L],radial:["",H,L],conic:[dt,H,L]},om,tm]}],"bg-color":[{bg:O()}],"gradient-from-pos":[{from:se()}],"gradient-via-pos":[{via:se()}],"gradient-to-pos":[{to:se()}],"gradient-from":[{from:O()}],"gradient-via":[{via:O()}],"gradient-to":[{to:O()}],rounded:[{rounded:me()}],"rounded-s":[{"rounded-s":me()}],"rounded-e":[{"rounded-e":me()}],"rounded-t":[{"rounded-t":me()}],"rounded-r":[{"rounded-r":me()}],"rounded-b":[{"rounded-b":me()}],"rounded-l":[{"rounded-l":me()}],"rounded-ss":[{"rounded-ss":me()}],"rounded-se":[{"rounded-se":me()}],"rounded-ee":[{"rounded-ee":me()}],"rounded-es":[{"rounded-es":me()}],"rounded-tl":[{"rounded-tl":me()}],"rounded-tr":[{"rounded-tr":me()}],"rounded-br":[{"rounded-br":me()}],"rounded-bl":[{"rounded-bl":me()}],"border-w":[{border:ce()}],"border-w-x":[{"border-x":ce()}],"border-w-y":[{"border-y":ce()}],"border-w-s":[{"border-s":ce()}],"border-w-e":[{"border-e":ce()}],"border-w-bs":[{"border-bs":ce()}],"border-w-be":[{"border-be":ce()}],"border-w-t":[{"border-t":ce()}],"border-w-r":[{"border-r":ce()}],"border-w-b":[{"border-b":ce()}],"border-w-l":[{"border-l":ce()}],"divide-x":[{"divide-x":ce()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ce()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...k(),"hidden","none"]}],"divide-style":[{divide:[...k(),"hidden","none"]}],"border-color":[{border:O()}],"border-color-x":[{"border-x":O()}],"border-color-y":[{"border-y":O()}],"border-color-s":[{"border-s":O()}],"border-color-e":[{"border-e":O()}],"border-color-bs":[{"border-bs":O()}],"border-color-be":[{"border-be":O()}],"border-color-t":[{"border-t":O()}],"border-color-r":[{"border-r":O()}],"border-color-b":[{"border-b":O()}],"border-color-l":[{"border-l":O()}],"divide-color":[{divide:O()}],"outline-style":[{outline:[...k(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ae,H,L]}],"outline-w":[{outline:["",ae,an,Nt]}],"outline-color":[{outline:O()}],shadow:[{shadow:["","none",f,Mn,In]}],"shadow-color":[{shadow:O()}],"inset-shadow":[{"inset-shadow":["none",d,Mn,In]}],"inset-shadow-color":[{"inset-shadow":O()}],"ring-w":[{ring:ce()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:O()}],"ring-offset-w":[{"ring-offset":[ae,Nt]}],"ring-offset-color":[{"ring-offset":O()}],"inset-ring-w":[{"inset-ring":ce()}],"inset-ring-color":[{"inset-ring":O()}],"text-shadow":[{"text-shadow":["none",m,Mn,In]}],"text-shadow-color":[{"text-shadow":O()}],opacity:[{opacity:[ae,H,L]}],"mix-blend":[{"mix-blend":[...te(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":te()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[ae]}],"mask-image-linear-from-pos":[{"mask-linear-from":$()}],"mask-image-linear-to-pos":[{"mask-linear-to":$()}],"mask-image-linear-from-color":[{"mask-linear-from":O()}],"mask-image-linear-to-color":[{"mask-linear-to":O()}],"mask-image-t-from-pos":[{"mask-t-from":$()}],"mask-image-t-to-pos":[{"mask-t-to":$()}],"mask-image-t-from-color":[{"mask-t-from":O()}],"mask-image-t-to-color":[{"mask-t-to":O()}],"mask-image-r-from-pos":[{"mask-r-from":$()}],"mask-image-r-to-pos":[{"mask-r-to":$()}],"mask-image-r-from-color":[{"mask-r-from":O()}],"mask-image-r-to-color":[{"mask-r-to":O()}],"mask-image-b-from-pos":[{"mask-b-from":$()}],"mask-image-b-to-pos":[{"mask-b-to":$()}],"mask-image-b-from-color":[{"mask-b-from":O()}],"mask-image-b-to-color":[{"mask-b-to":O()}],"mask-image-l-from-pos":[{"mask-l-from":$()}],"mask-image-l-to-pos":[{"mask-l-to":$()}],"mask-image-l-from-color":[{"mask-l-from":O()}],"mask-image-l-to-color":[{"mask-l-to":O()}],"mask-image-x-from-pos":[{"mask-x-from":$()}],"mask-image-x-to-pos":[{"mask-x-to":$()}],"mask-image-x-from-color":[{"mask-x-from":O()}],"mask-image-x-to-color":[{"mask-x-to":O()}],"mask-image-y-from-pos":[{"mask-y-from":$()}],"mask-image-y-to-pos":[{"mask-y-to":$()}],"mask-image-y-from-color":[{"mask-y-from":O()}],"mask-image-y-to-color":[{"mask-y-to":O()}],"mask-image-radial":[{"mask-radial":[H,L]}],"mask-image-radial-from-pos":[{"mask-radial-from":$()}],"mask-image-radial-to-pos":[{"mask-radial-to":$()}],"mask-image-radial-from-color":[{"mask-radial-from":O()}],"mask-image-radial-to-color":[{"mask-radial-to":O()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":E()}],"mask-image-conic-pos":[{"mask-conic":[ae]}],"mask-image-conic-from-pos":[{"mask-conic-from":$()}],"mask-image-conic-to-pos":[{"mask-conic-to":$()}],"mask-image-conic-from-color":[{"mask-conic-from":O()}],"mask-image-conic-to-color":[{"mask-conic-to":O()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:T()}],"mask-repeat":[{mask:z()}],"mask-size":[{mask:ie()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",H,L]}],filter:[{filter:["","none",H,L]}],blur:[{blur:le()}],brightness:[{brightness:[ae,H,L]}],contrast:[{contrast:[ae,H,L]}],"drop-shadow":[{"drop-shadow":["","none",g,Mn,In]}],"drop-shadow-color":[{"drop-shadow":O()}],grayscale:[{grayscale:["",ae,H,L]}],"hue-rotate":[{"hue-rotate":[ae,H,L]}],invert:[{invert:["",ae,H,L]}],saturate:[{saturate:[ae,H,L]}],sepia:[{sepia:["",ae,H,L]}],"backdrop-filter":[{"backdrop-filter":["","none",H,L]}],"backdrop-blur":[{"backdrop-blur":le()}],"backdrop-brightness":[{"backdrop-brightness":[ae,H,L]}],"backdrop-contrast":[{"backdrop-contrast":[ae,H,L]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ae,H,L]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ae,H,L]}],"backdrop-invert":[{"backdrop-invert":["",ae,H,L]}],"backdrop-opacity":[{"backdrop-opacity":[ae,H,L]}],"backdrop-saturate":[{"backdrop-saturate":[ae,H,L]}],"backdrop-sepia":[{"backdrop-sepia":["",ae,H,L]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":_()}],"border-spacing-x":[{"border-spacing-x":_()}],"border-spacing-y":[{"border-spacing-y":_()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",H,L]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ae,"initial",H,L]}],ease:[{ease:["linear","initial",x,H,L]}],delay:[{delay:[ae,H,L]}],animate:[{animate:["none",y,H,L]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[p,H,L]}],"perspective-origin":[{"perspective-origin":N()}],rotate:[{rotate:ue()}],"rotate-x":[{"rotate-x":ue()}],"rotate-y":[{"rotate-y":ue()}],"rotate-z":[{"rotate-z":ue()}],scale:[{scale:de()}],"scale-x":[{"scale-x":de()}],"scale-y":[{"scale-y":de()}],"scale-z":[{"scale-z":de()}],"scale-3d":["scale-3d"],skew:[{skew:ye()}],"skew-x":[{"skew-x":ye()}],"skew-y":[{"skew-y":ye()}],transform:[{transform:[H,L,"","none","gpu","cpu"]}],"transform-origin":[{origin:N()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Te()}],"translate-x":[{"translate-x":Te()}],"translate-y":[{"translate-y":Te()}],"translate-z":[{"translate-z":Te()}],"translate-none":["translate-none"],accent:[{accent:O()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:O()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],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",H,L]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":_()}],"scroll-mx":[{"scroll-mx":_()}],"scroll-my":[{"scroll-my":_()}],"scroll-ms":[{"scroll-ms":_()}],"scroll-me":[{"scroll-me":_()}],"scroll-mbs":[{"scroll-mbs":_()}],"scroll-mbe":[{"scroll-mbe":_()}],"scroll-mt":[{"scroll-mt":_()}],"scroll-mr":[{"scroll-mr":_()}],"scroll-mb":[{"scroll-mb":_()}],"scroll-ml":[{"scroll-ml":_()}],"scroll-p":[{"scroll-p":_()}],"scroll-px":[{"scroll-px":_()}],"scroll-py":[{"scroll-py":_()}],"scroll-ps":[{"scroll-ps":_()}],"scroll-pe":[{"scroll-pe":_()}],"scroll-pbs":[{"scroll-pbs":_()}],"scroll-pbe":[{"scroll-pbe":_()}],"scroll-pt":[{"scroll-pt":_()}],"scroll-pr":[{"scroll-pr":_()}],"scroll-pb":[{"scroll-pb":_()}],"scroll-pl":[{"scroll-pl":_()}],"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",H,L]}],fill:[{fill:["none",...O()]}],"stroke-w":[{stroke:[ae,an,Nt,Oa]}],stroke:[{stroke:["none",...O()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","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","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","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-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","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-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","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"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","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-pbs","scroll-pbe","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"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function V(...e){return im(va(e))}const so=wa("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),Y=h.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},a)=>{const i=r?mh:"button";return s.jsx(i,{className:V(so({variant:t,size:n,className:e})),ref:a,...o})});Y.displayName="Button";class cm extends Error{constructor(t,n,r){super(t),this.status=n,this.data=r,this.name="ApiError"}}function ao(){if(typeof window>"u")return!1;const e=window.location.origin;return e==="http://tauri.localhost"||e==="tauri://localhost"}function lm(){return ao()?"http://127.0.0.1:9988":""}let Ln=null;class um{constructor(t=lm()){this.baseUrl=t}setToken(t){Ln=t}getToken(){return Ln}buildUrl(t,n){const r=new URL(t,this.baseUrl||window.location.origin);return n&&Object.entries(n).forEach(([o,a])=>{r.searchParams.set(o,a)}),r.toString()}async request(t,n,r,o={}){const{params:a,headers:i,signal:c,...l}=o,u={"Content-Type":"application/json",...i};Ln&&ao()&&(u.Authorization=`Bearer ${Ln}`);const f=new AbortController,d=setTimeout(()=>f.abort(),3e4);let m=f.signal;c&&(c.addEventListener("abort",()=>f.abort()),m=f.signal);const g={method:t,headers:u,credentials:ao()?"omit":"include",...l,signal:m};r!==void 0&&(g.body=JSON.stringify(r));const b=this.buildUrl(n,a),p=await fetch(b,g).finally(()=>clearTimeout(d));if(!p.ok){let v=null,x=`Request failed with status ${p.status}`;try{if(v=await p.json(),v&&typeof v=="object"){const y=v;typeof y.error=="string"&&y.error?x=y.error:typeof y.message=="string"&&y.message&&(x=y.message)}}catch{}throw p.status===401&&typeof window<"u"&&!n.startsWith("/api/auth/")&&(window.location.href="/login"),new cm(x,p.status,v)}if(p.status!==204)return p.json()}async get(t,n){return this.request("GET",t,void 0,n)}async post(t,n,r){return this.request("POST",t,n,r)}async put(t,n,r){return this.request("PUT",t,n,r)}async delete(t,n){return this.request("DELETE",t,void 0,n)}}const ee=new um;function dm(e){return{name:e.name,displayName:e.displayName,available:e.isAvailable??e.available,toolType:e.toolType??"cli",version:e.version,path:e.executablePath??e.path,models:e.models,defaultModel:e.defaultModel}}const Le={async getTools(){return(await ee.get("/api/v1/ai-cli/tools")).data.map(dm)},async healthCheck(e){const n=(await ee.get(`/api/v1/ai-cli/tools/${e}/health`)).data;return{name:n.name,available:n.isAvailable??n.available,version:n.version,path:n.executablePath??n.path}},async getModels(e){return(await ee.get(`/api/v1/ai-cli/tools/${e}/models`)).data},async execute(e){return(await ee.post("/api/v1/ai-cli/execute",e)).data},async getWorkspaces(){return(await ee.get("/api/v1/ai-cli/workspaces")).data},async createWorkspace(e){return(await ee.post("/api/v1/ai-cli/workspaces",e)).data},async pullWorkspace(e){await ee.post(`/api/v1/ai-cli/workspaces/${e}/pull`)},async deleteWorkspace(e){await ee.post(`/api/v1/ai-cli/workspaces/${e}/delete`)},async browseDir(e){return(await ee.get("/api/v1/ai-cli/browse-dir",{params:{path:e}})).data},async detectGit(e){return(await ee.post("/api/v1/ai-cli/detect-git",{path:e})).data}},nt={async list(){return(await ee.get("/api/v1/skills")).data},async getById(e){return(await ee.get(`/api/v1/skills/${e}`)).data},async getTargets(){return(await ee.get("/api/v1/skills/targets")).data},async generate(e){return(await ee.post("/api/v1/skills/generate",{baseUrl:e})).data},async create(e){return(await ee.post("/api/v1/skills",e)).data},async update(e,t){return(await ee.put(`/api/v1/skills/${e}`,t)).data},async toggle(e){return(await ee.put(`/api/v1/skills/${e}/toggle`)).data},async deleteSkill(e){await ee.delete(`/api/v1/skills/${e}`)},async install(e,t,n){return(await ee.post(`/api/v1/skills/${e}/install`,{targets:t,baseUrl:n})).data},async uninstall(e,t){await ee.post(`/api/v1/skills/${e}/uninstall`,{targets:t})},async listInstalled(){return(await ee.get("/api/v1/skills/installed")).data},async listWorkspaceInstalled(e){return(await ee.get("/api/v1/skills/installed/workspace",{params:{path:e}})).data}},rt=h.forwardRef(({className:e,...t},n)=>s.jsx("textarea",{className:V("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...t}));rt.displayName="Textarea";const Ce=h.forwardRef(({className:e,...t},n)=>s.jsx("label",{ref:n,className:V("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...t}));Ce.displayName="Label";function B(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function fm(e,t){const n=h.createContext(t),r=a=>{const{children:i,...c}=a,l=h.useMemo(()=>c,Object.values(c));return s.jsx(n.Provider,{value:l,children:i})};r.displayName=e+"Provider";function o(a){const i=h.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[r,o]}function We(e,t=[]){let n=[];function r(a,i){const c=h.createContext(i),l=n.length;n=[...n,i];const u=d=>{var x;const{scope:m,children:g,...b}=d,p=((x=m==null?void 0:m[e])==null?void 0:x[l])||c,v=h.useMemo(()=>b,Object.values(b));return s.jsx(p.Provider,{value:v,children:g})};u.displayName=a+"Provider";function f(d,m){var p;const g=((p=m==null?void 0:m[e])==null?void 0:p[l])||c,b=h.useContext(g);if(b)return b;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${a}\``)}return[u,f]}const o=()=>{const a=n.map(i=>h.createContext(i));return function(c){const l=(c==null?void 0:c[e])||a;return h.useMemo(()=>({[`__scope${e}`]:{...c,[e]:l}}),[c,l])}};return o.scopeName=e,[r,hm(o,...t)]}function hm(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(a){const i=r.reduce((c,{useScope:l,scopeName:u})=>{const d=l(a)[`__scope${u}`];return{...c,...d}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}var je=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{},mm=h[" useId ".trim().toString()]||(()=>{}),pm=0;function Ve(e){const[t,n]=h.useState(mm());return je(()=>{n(r=>r??String(pm++))},[e]),t?`radix-${t}`:""}var gm=h[" useInsertionEffect ".trim().toString()]||je;function Ct({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,a,i]=bm({defaultProp:t,onChange:n}),c=e!==void 0,l=c?e:o;{const f=h.useRef(e!==void 0);h.useEffect(()=>{const d=f.current;d!==c&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=c},[c,r])}const u=h.useCallback(f=>{var d;if(c){const m=vm(f)?f(e):f;m!==e&&((d=i.current)==null||d.call(i,m))}else a(f)},[c,e,a,i]);return[l,u]}function bm({defaultProp:e,onChange:t}){const[n,r]=h.useState(e),o=h.useRef(n),a=h.useRef(t);return gm(()=>{a.current=t},[t]),h.useEffect(()=>{var i;o.current!==n&&((i=a.current)==null||i.call(a,n),o.current=n)},[n,o]),[n,r,a]}function vm(e){return typeof e=="function"}function Ht(e){const t=ym(e),n=h.forwardRef((r,o)=>{const{children:a,...i}=r,c=h.Children.toArray(a),l=c.find(wm);if(l){const u=l.props.children,f=c.map(d=>d===l?h.Children.count(u)>1?h.Children.only(null):h.isValidElement(u)?u.props.children:null:d);return s.jsx(t,{...i,ref:o,children:h.isValidElement(u)?h.cloneElement(u,void 0,f):null})}return s.jsx(t,{...i,ref:o,children:a})});return n.displayName=`${e}.Slot`,n}function ym(e){const t=h.forwardRef((n,r)=>{const{children:o,...a}=n;if(h.isValidElement(o)){const i=_m(o),c=Em(a,o.props);return o.type!==h.Fragment&&(c.ref=r?sn(r,i):i),h.cloneElement(o,c)}return h.Children.count(o)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ga=Symbol("radix.slottable");function xm(e){const t=({children:n})=>s.jsx(s.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Ga,t}function wm(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ga}function Em(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...c)=>{const l=a(...c);return o(...c),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...a}:r==="className"&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}function _m(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Sm=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ne=Sm.reduce((e,t)=>{const n=Ht(`Primitive.${t}`),r=h.forwardRef((o,a)=>{const{asChild:i,...c}=o,l=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(l,{...c,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function za(e,t){e&&xn.flushSync(()=>e.dispatchEvent(t))}function qe(e){const t=h.useRef(e);return h.useEffect(()=>{t.current=e}),h.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Nm(e,t=globalThis==null?void 0:globalThis.document){const n=qe(e);h.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Rm="DismissableLayer",io="dismissableLayer.update",Cm="dismissableLayer.pointerDownOutside",Tm="dismissableLayer.focusOutside",$a,Wa=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Hn=h.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:i,onDismiss:c,...l}=e,u=h.useContext(Wa),[f,d]=h.useState(null),m=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=h.useState({}),b=pe(t,R=>d(R)),p=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),x=p.indexOf(v),y=f?p.indexOf(f):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,E=y>=x,N=Pm(R=>{const _=R.target,I=[...u.branches].some(M=>M.contains(_));!E||I||(o==null||o(R),i==null||i(R),R.defaultPrevented||c==null||c())},m),j=Om(R=>{const _=R.target;[...u.branches].some(M=>M.contains(_))||(a==null||a(R),i==null||i(R),R.defaultPrevented||c==null||c())},m);return Nm(R=>{y===u.layers.size-1&&(r==null||r(R),!R.defaultPrevented&&c&&(R.preventDefault(),c()))},m),h.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&($a=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),Va(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=$a)}},[f,m,n,u]),h.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),Va())},[f,u]),h.useEffect(()=>{const R=()=>g({});return document.addEventListener(io,R),()=>document.removeEventListener(io,R)},[]),s.jsx(ne.div,{...l,ref:b,style:{pointerEvents:w?E?"auto":"none":void 0,...e.style},onFocusCapture:B(e.onFocusCapture,j.onFocusCapture),onBlurCapture:B(e.onBlurCapture,j.onBlurCapture),onPointerDownCapture:B(e.onPointerDownCapture,N.onPointerDownCapture)})});Hn.displayName=Rm;var jm="DismissableLayerBranch",Am=h.forwardRef((e,t)=>{const n=h.useContext(Wa),r=h.useRef(null),o=pe(t,r);return h.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),s.jsx(ne.div,{...e,ref:o})});Am.displayName=jm;function Pm(e,t=globalThis==null?void 0:globalThis.document){const n=qe(e),r=h.useRef(!1),o=h.useRef(()=>{});return h.useEffect(()=>{const a=c=>{if(c.target&&!r.current){let l=function(){qa(Cm,n,u,{discrete:!0})};const u={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",a),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Om(e,t=globalThis==null?void 0:globalThis.document){const n=qe(e),r=h.useRef(!1);return h.useEffect(()=>{const o=a=>{a.target&&!r.current&&qa(Tm,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Va(){const e=new CustomEvent(io);document.dispatchEvent(e)}function qa(e,t,n,{discrete:r}){const o=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?za(o,a):o.dispatchEvent(a)}var co="focusScope.autoFocusOnMount",lo="focusScope.autoFocusOnUnmount",Xa={bubbles:!1,cancelable:!0},km="FocusScope",Bn=h.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:a,...i}=e,[c,l]=h.useState(null),u=qe(o),f=qe(a),d=h.useRef(null),m=pe(t,p=>l(p)),g=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(r){let p=function(w){if(g.paused||!c)return;const E=w.target;c.contains(E)?d.current=E:ht(d.current,{select:!0})},v=function(w){if(g.paused||!c)return;const E=w.relatedTarget;E!==null&&(c.contains(E)||ht(d.current,{select:!0}))},x=function(w){if(document.activeElement===document.body)for(const N of w)N.removedNodes.length>0&&ht(c)};document.addEventListener("focusin",p),document.addEventListener("focusout",v);const y=new MutationObserver(x);return c&&y.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",v),y.disconnect()}}},[r,c,g.paused]),h.useEffect(()=>{if(c){Za.add(g);const p=document.activeElement;if(!c.contains(p)){const x=new CustomEvent(co,Xa);c.addEventListener(co,u),c.dispatchEvent(x),x.defaultPrevented||(Dm(Bm(Ya(c)),{select:!0}),document.activeElement===p&&ht(c))}return()=>{c.removeEventListener(co,u),setTimeout(()=>{const x=new CustomEvent(lo,Xa);c.addEventListener(lo,f),c.dispatchEvent(x),x.defaultPrevented||ht(p??document.body,{select:!0}),c.removeEventListener(lo,f),Za.remove(g)},0)}}},[c,u,f,g]);const b=h.useCallback(p=>{if(!n&&!r||g.paused)return;const v=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,x=document.activeElement;if(v&&x){const y=p.currentTarget,[w,E]=Im(y);w&&E?!p.shiftKey&&x===E?(p.preventDefault(),n&&ht(w,{select:!0})):p.shiftKey&&x===w&&(p.preventDefault(),n&&ht(E,{select:!0})):x===y&&p.preventDefault()}},[n,r,g.paused]);return s.jsx(ne.div,{tabIndex:-1,...i,ref:m,onKeyDown:b})});Bn.displayName=km;function Dm(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ht(r,{select:t}),document.activeElement!==n)return}function Im(e){const t=Ya(e),n=Ka(t,e),r=Ka(t.reverse(),e);return[n,r]}function Ya(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Ka(e,t){for(const n of e)if(!Mm(n,{upTo:t}))return n}function Mm(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 Lm(e){return e instanceof HTMLInputElement&&"select"in e}function ht(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Lm(e)&&t&&e.select()}}var Za=Hm();function Hm(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Qa(e,t),e.unshift(t)},remove(t){var n;e=Qa(e,t),(n=e[0])==null||n.resume()}}}function Qa(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Bm(e){return e.filter(t=>t.tagName!=="A")}var Fm="Portal",Fn=h.forwardRef((e,t)=>{var c;const{container:n,...r}=e,[o,a]=h.useState(!1);je(()=>a(!0),[]);const i=n||o&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return i?Ge.createPortal(s.jsx(ne.div,{...r,ref:t}),i):null});Fn.displayName=Fm;function Um(e,t){return h.useReducer((n,r)=>t[n][r]??n,e)}var Xe=e=>{const{present:t,children:n}=e,r=Gm(t),o=typeof n=="function"?n({present:r.isPresent}):h.Children.only(n),a=pe(r.ref,zm(o));return typeof n=="function"||r.isPresent?h.cloneElement(o,{ref:a}):null};Xe.displayName="Presence";function Gm(e){const[t,n]=h.useState(),r=h.useRef(null),o=h.useRef(e),a=h.useRef("none"),i=e?"mounted":"unmounted",[c,l]=Um(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const u=Un(r.current);a.current=c==="mounted"?u:"none"},[c]),je(()=>{const u=r.current,f=o.current;if(f!==e){const m=a.current,g=Un(u);e?l("MOUNT"):g==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(f&&m!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),je(()=>{if(t){let u;const f=t.ownerDocument.defaultView??window,d=g=>{const p=Un(r.current).includes(CSS.escape(g.animationName));if(g.target===t&&p&&(l("ANIMATION_END"),!o.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",u=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},m=g=>{g.target===t&&(a.current=Un(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{f.clearTimeout(u),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:h.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function Un(e){return(e==null?void 0:e.animationName)||"none"}function zm(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var uo=0;function fo(){h.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Ja()),document.body.insertAdjacentElement("beforeend",e[1]??Ja()),uo++,()=>{uo===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),uo--}},[])}function Ja(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Ye=function(){return Ye=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},Ye.apply(this,arguments)};function ei(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function $m(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,a;r<o;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var Gn="right-scroll-bar-position",zn="width-before-scroll-bar",Wm="with-scroll-bars-hidden",Vm="--removed-body-scroll-bar-size";function ho(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function qm(e,t){var n=S.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var Xm=typeof window<"u"?h.useLayoutEffect:h.useEffect,ti=new WeakMap;function Ym(e,t){var n=qm(null,function(r){return e.forEach(function(o){return ho(o,r)})});return Xm(function(){var r=ti.get(n);if(r){var o=new Set(r),a=new Set(e),i=n.current;o.forEach(function(c){a.has(c)||ho(c,null)}),a.forEach(function(c){o.has(c)||ho(c,i)})}ti.set(n,e)},[e]),n}function Km(e){return e}function Zm(e,t){t===void 0&&(t=Km);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var i=t(a,r);return n.push(i),function(){n=n.filter(function(c){return c!==i})}},assignSyncMedium:function(a){for(r=!0;n.length;){var i=n;n=[],i.forEach(a)}n={push:function(c){return a(c)},filter:function(){return n}}},assignMedium:function(a){r=!0;var i=[];if(n.length){var c=n;n=[],c.forEach(a),i=n}var l=function(){var f=i;i=[],f.forEach(a)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(f){i.push(f),u()},filter:function(f){return i=i.filter(f),n}}}};return o}function Qm(e){e===void 0&&(e={});var t=Zm(null);return t.options=Ye({async:!0,ssr:!1},e),t}var ni=function(e){var t=e.sideCar,n=ei(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return h.createElement(r,Ye({},n))};ni.isSideCarExport=!0;function Jm(e,t){return e.useMedium(t),ni}var ri=Qm(),mo=function(){},$n=h.forwardRef(function(e,t){var n=h.useRef(null),r=h.useState({onScrollCapture:mo,onWheelCapture:mo,onTouchMoveCapture:mo}),o=r[0],a=r[1],i=e.forwardProps,c=e.children,l=e.className,u=e.removeScrollBar,f=e.enabled,d=e.shards,m=e.sideCar,g=e.noRelative,b=e.noIsolation,p=e.inert,v=e.allowPinchZoom,x=e.as,y=x===void 0?"div":x,w=e.gapMode,E=ei(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=m,j=Ym([n,t]),R=Ye(Ye({},E),o);return h.createElement(h.Fragment,null,f&&h.createElement(N,{sideCar:ri,removeScrollBar:u,shards:d,noRelative:g,noIsolation:b,inert:p,setCallbacks:a,allowPinchZoom:!!v,lockRef:n,gapMode:w}),i?h.cloneElement(h.Children.only(c),Ye(Ye({},R),{ref:j})):h.createElement(y,Ye({},R,{className:l,ref:j}),c))});$n.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},$n.classNames={fullWidth:zn,zeroRight:Gn};var ep=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function tp(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=ep();return t&&e.setAttribute("nonce",t),e}function np(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function rp(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var op=function(){var e=0,t=null;return{add:function(n){e==0&&(t=tp())&&(np(t,n),rp(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},sp=function(){var e=op();return function(t,n){h.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},oi=function(){var e=sp(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},ap={left:0,top:0,right:0,gap:0},po=function(e){return parseInt(e||"",10)||0},ip=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[po(n),po(r),po(o)]},cp=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return ap;var t=ip(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},lp=oi(),Bt="data-scroll-locked",up=function(e,t,n,r){var o=e.left,a=e.top,i=e.right,c=e.gap;return n===void 0&&(n="margin"),`
|
|
200
|
+
.`.concat(Wm,` {
|
|
201
|
+
overflow: hidden `).concat(r,`;
|
|
202
|
+
padding-right: `).concat(c,"px ").concat(r,`;
|
|
203
|
+
}
|
|
204
|
+
body[`).concat(Bt,`] {
|
|
205
|
+
overflow: hidden `).concat(r,`;
|
|
206
|
+
overscroll-behavior: contain;
|
|
207
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
208
|
+
padding-left: `.concat(o,`px;
|
|
209
|
+
padding-top: `).concat(a,`px;
|
|
210
|
+
padding-right: `).concat(i,`px;
|
|
211
|
+
margin-left:0;
|
|
212
|
+
margin-top:0;
|
|
213
|
+
margin-right: `).concat(c,"px ").concat(r,`;
|
|
214
|
+
`),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.`).concat(Gn,` {
|
|
218
|
+
right: `).concat(c,"px ").concat(r,`;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.`).concat(zn,` {
|
|
222
|
+
margin-right: `).concat(c,"px ").concat(r,`;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.`).concat(Gn," .").concat(Gn,` {
|
|
226
|
+
right: 0 `).concat(r,`;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.`).concat(zn," .").concat(zn,` {
|
|
230
|
+
margin-right: 0 `).concat(r,`;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
body[`).concat(Bt,`] {
|
|
234
|
+
`).concat(Vm,": ").concat(c,`px;
|
|
235
|
+
}
|
|
236
|
+
`)},si=function(){var e=parseInt(document.body.getAttribute(Bt)||"0",10);return isFinite(e)?e:0},dp=function(){h.useEffect(function(){return document.body.setAttribute(Bt,(si()+1).toString()),function(){var e=si()-1;e<=0?document.body.removeAttribute(Bt):document.body.setAttribute(Bt,e.toString())}},[])},fp=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;dp();var a=h.useMemo(function(){return cp(o)},[o]);return h.createElement(lp,{styles:up(a,!t,o,n?"":"!important")})},go=!1;if(typeof window<"u")try{var Wn=Object.defineProperty({},"passive",{get:function(){return go=!0,!0}});window.addEventListener("test",Wn,Wn),window.removeEventListener("test",Wn,Wn)}catch{go=!1}var Ft=go?{passive:!1}:!1,hp=function(e){return e.tagName==="TEXTAREA"},ai=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!hp(e)&&n[t]==="visible")},mp=function(e){return ai(e,"overflowY")},pp=function(e){return ai(e,"overflowX")},ii=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=ci(e,r);if(o){var a=li(e,r),i=a[1],c=a[2];if(i>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},gp=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},bp=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},ci=function(e,t){return e==="v"?mp(t):pp(t)},li=function(e,t){return e==="v"?gp(t):bp(t)},vp=function(e,t){return e==="h"&&t==="rtl"?-1:1},yp=function(e,t,n,r,o){var a=vp(e,window.getComputedStyle(t).direction),i=a*r,c=n.target,l=t.contains(c),u=!1,f=i>0,d=0,m=0;do{if(!c)break;var g=li(e,c),b=g[0],p=g[1],v=g[2],x=p-v-a*b;(b||x)&&ci(e,c)&&(d+=x,m+=b);var y=c.parentNode;c=y&&y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?y.host:y}while(!l&&c!==document.body||l&&(t.contains(c)||t===c));return(f&&Math.abs(d)<1||!f&&Math.abs(m)<1)&&(u=!0),u},Vn=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ui=function(e){return[e.deltaX,e.deltaY]},di=function(e){return e&&"current"in e?e.current:e},xp=function(e,t){return e[0]===t[0]&&e[1]===t[1]},wp=function(e){return`
|
|
237
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
238
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
239
|
+
`)},Ep=0,Ut=[];function _p(e){var t=h.useRef([]),n=h.useRef([0,0]),r=h.useRef(),o=h.useState(Ep++)[0],a=h.useState(oi)[0],i=h.useRef(e);h.useEffect(function(){i.current=e},[e]),h.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var p=$m([e.lockRef.current],(e.shards||[]).map(di),!0).filter(Boolean);return p.forEach(function(v){return v.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),p.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var c=h.useCallback(function(p,v){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!i.current.allowPinchZoom;var x=Vn(p),y=n.current,w="deltaX"in p?p.deltaX:y[0]-x[0],E="deltaY"in p?p.deltaY:y[1]-x[1],N,j=p.target,R=Math.abs(w)>Math.abs(E)?"h":"v";if("touches"in p&&R==="h"&&j.type==="range")return!1;var _=window.getSelection(),I=_&&_.anchorNode,M=I?I===j||I.contains(j):!1;if(M)return!1;var q=ii(R,j);if(!q)return!0;if(q?N=R:(N=R==="v"?"h":"v",q=ii(R,j)),!q)return!1;if(!r.current&&"changedTouches"in p&&(w||E)&&(r.current=N),!N)return!0;var U=r.current||N;return yp(U,v,p,U==="h"?w:E)},[]),l=h.useCallback(function(p){var v=p;if(!(!Ut.length||Ut[Ut.length-1]!==a)){var x="deltaY"in v?ui(v):Vn(v),y=t.current.filter(function(N){return N.name===v.type&&(N.target===v.target||v.target===N.shadowParent)&&xp(N.delta,x)})[0];if(y&&y.should){v.cancelable&&v.preventDefault();return}if(!y){var w=(i.current.shards||[]).map(di).filter(Boolean).filter(function(N){return N.contains(v.target)}),E=w.length>0?c(v,w[0]):!i.current.noIsolation;E&&v.cancelable&&v.preventDefault()}}},[]),u=h.useCallback(function(p,v,x,y){var w={name:p,delta:v,target:x,should:y,shadowParent:Sp(x)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(E){return E!==w})},1)},[]),f=h.useCallback(function(p){n.current=Vn(p),r.current=void 0},[]),d=h.useCallback(function(p){u(p.type,ui(p),p.target,c(p,e.lockRef.current))},[]),m=h.useCallback(function(p){u(p.type,Vn(p),p.target,c(p,e.lockRef.current))},[]);h.useEffect(function(){return Ut.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:m}),document.addEventListener("wheel",l,Ft),document.addEventListener("touchmove",l,Ft),document.addEventListener("touchstart",f,Ft),function(){Ut=Ut.filter(function(p){return p!==a}),document.removeEventListener("wheel",l,Ft),document.removeEventListener("touchmove",l,Ft),document.removeEventListener("touchstart",f,Ft)}},[]);var g=e.removeScrollBar,b=e.inert;return h.createElement(h.Fragment,null,b?h.createElement(a,{styles:wp(o)}):null,g?h.createElement(fp,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Sp(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Np=Jm(ri,_p);var qn=h.forwardRef(function(e,t){return h.createElement($n,Ye({},e,{ref:t,sideCar:Np}))});qn.classNames=$n.classNames;var Rp=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Gt=new WeakMap,Xn=new WeakMap,Yn={},bo=0,fi=function(e){return e&&(e.host||fi(e.parentNode))},Cp=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=fi(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Tp=function(e,t,n,r){var o=Cp(t,Array.isArray(e)?e:[e]);Yn[n]||(Yn[n]=new WeakMap);var a=Yn[n],i=[],c=new Set,l=new Set(o),u=function(d){!d||c.has(d)||(c.add(d),u(d.parentNode))};o.forEach(u);var f=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(m){if(c.has(m))f(m);else try{var g=m.getAttribute(r),b=g!==null&&g!=="false",p=(Gt.get(m)||0)+1,v=(a.get(m)||0)+1;Gt.set(m,p),a.set(m,v),i.push(m),p===1&&b&&Xn.set(m,!0),v===1&&m.setAttribute(n,"true"),b||m.setAttribute(r,"true")}catch(x){console.error("aria-hidden: cannot operate on ",m,x)}})};return f(t),c.clear(),bo++,function(){i.forEach(function(d){var m=Gt.get(d)-1,g=a.get(d)-1;Gt.set(d,m),a.set(d,g),m||(Xn.has(d)||d.removeAttribute(r),Xn.delete(d)),g||d.removeAttribute(n)}),bo--,bo||(Gt=new WeakMap,Gt=new WeakMap,Xn=new WeakMap,Yn={})}},vo=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=Rp(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),Tp(r,o,n,"aria-hidden")):function(){return null}},Kn="Dialog",[hi,mi]=We(Kn),[jp,He]=hi(Kn),pi=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:a,modal:i=!0}=e,c=h.useRef(null),l=h.useRef(null),[u,f]=Ct({prop:r,defaultProp:o??!1,onChange:a,caller:Kn});return s.jsx(jp,{scope:t,triggerRef:c,contentRef:l,contentId:Ve(),titleId:Ve(),descriptionId:Ve(),open:u,onOpenChange:f,onOpenToggle:h.useCallback(()=>f(d=>!d),[f]),modal:i,children:n})};pi.displayName=Kn;var gi="DialogTrigger",bi=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=He(gi,n),a=pe(t,o.triggerRef);return s.jsx(ne.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":wo(o.open),...r,ref:a,onClick:B(e.onClick,o.onOpenToggle)})});bi.displayName=gi;var yo="DialogPortal",[Ap,vi]=hi(yo,{forceMount:void 0}),yi=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,a=He(yo,t);return s.jsx(Ap,{scope:t,forceMount:n,children:h.Children.map(r,i=>s.jsx(Xe,{present:n||a.open,children:s.jsx(Fn,{asChild:!0,container:o,children:i})}))})};yi.displayName=yo;var Zn="DialogOverlay",xi=h.forwardRef((e,t)=>{const n=vi(Zn,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,a=He(Zn,e.__scopeDialog);return a.modal?s.jsx(Xe,{present:r||a.open,children:s.jsx(Op,{...o,ref:t})}):null});xi.displayName=Zn;var Pp=Ht("DialogOverlay.RemoveScroll"),Op=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=He(Zn,n);return s.jsx(qn,{as:Pp,allowPinchZoom:!0,shards:[o.contentRef],children:s.jsx(ne.div,{"data-state":wo(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Tt="DialogContent",wi=h.forwardRef((e,t)=>{const n=vi(Tt,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,a=He(Tt,e.__scopeDialog);return s.jsx(Xe,{present:r||a.open,children:a.modal?s.jsx(kp,{...o,ref:t}):s.jsx(Dp,{...o,ref:t})})});wi.displayName=Tt;var kp=h.forwardRef((e,t)=>{const n=He(Tt,e.__scopeDialog),r=h.useRef(null),o=pe(t,n.contentRef,r);return h.useEffect(()=>{const a=r.current;if(a)return vo(a)},[]),s.jsx(Ei,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:B(e.onCloseAutoFocus,a=>{var i;a.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:B(e.onPointerDownOutside,a=>{const i=a.detail.originalEvent,c=i.button===0&&i.ctrlKey===!0;(i.button===2||c)&&a.preventDefault()}),onFocusOutside:B(e.onFocusOutside,a=>a.preventDefault())})}),Dp=h.forwardRef((e,t)=>{const n=He(Tt,e.__scopeDialog),r=h.useRef(!1),o=h.useRef(!1);return s.jsx(Ei,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var i,c;(i=e.onCloseAutoFocus)==null||i.call(e,a),a.defaultPrevented||(r.current||(c=n.triggerRef.current)==null||c.focus(),a.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:a=>{var l,u;(l=e.onInteractOutside)==null||l.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=a.target;((u=n.triggerRef.current)==null?void 0:u.contains(i))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&o.current&&a.preventDefault()}})}),Ei=h.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:a,...i}=e,c=He(Tt,n),l=h.useRef(null),u=pe(t,l);return fo(),s.jsxs(s.Fragment,{children:[s.jsx(Bn,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:a,children:s.jsx(Hn,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":wo(c.open),...i,ref:u,onDismiss:()=>c.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(Mp,{titleId:c.titleId}),s.jsx(Hp,{contentRef:l,descriptionId:c.descriptionId})]})]})}),xo="DialogTitle",_i=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=He(xo,n);return s.jsx(ne.h2,{id:o.titleId,...r,ref:t})});_i.displayName=xo;var Si="DialogDescription",Ni=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=He(Si,n);return s.jsx(ne.p,{id:o.descriptionId,...r,ref:t})});Ni.displayName=Si;var Ri="DialogClose",Ci=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=He(Ri,n);return s.jsx(ne.button,{type:"button",...r,ref:t,onClick:B(e.onClick,()=>o.onOpenChange(!1))})});Ci.displayName=Ri;function wo(e){return e?"open":"closed"}var Ti="DialogTitleWarning",[Ip,ji]=fm(Ti,{contentName:Tt,titleName:xo,docsSlug:"dialog"}),Mp=({titleId:e})=>{const t=ji(Ti),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
240
|
+
|
|
241
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
242
|
+
|
|
243
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return h.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Lp="DialogDescriptionWarning",Hp=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ji(Lp).contentName}}.`;return h.useEffect(()=>{var a;const o=(a=e.current)==null?void 0:a.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Ai=pi,Bp=bi,Pi=yi,Eo=xi,_o=wi,So=_i,No=Ni,Ro=Ci;const jt=Ai,Fp=Pi,Oi=h.forwardRef(({className:e,...t},n)=>s.jsx(Eo,{ref:n,className:V("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}));Oi.displayName=Eo.displayName;const mt=h.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(Fp,{children:[s.jsx(Oi,{}),s.jsxs(_o,{ref:r,className:V("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),...n,children:[t,s.jsxs(Ro,{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:[s.jsx(ma,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));mt.displayName=_o.displayName;const pt=({className:e,...t})=>s.jsx("div",{className:V("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});pt.displayName="DialogHeader";const gt=({className:e,...t})=>s.jsx("div",{className:V("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});gt.displayName="DialogFooter";const bt=h.forwardRef(({className:e,...t},n)=>s.jsx(So,{ref:n,className:V("text-lg font-semibold leading-none tracking-tight",e),...t}));bt.displayName=So.displayName;const vt=h.forwardRef(({className:e,...t},n)=>s.jsx(No,{ref:n,className:V("text-sm text-muted-foreground",e),...t}));vt.displayName=No.displayName;function ki(e,[t,n]){return Math.min(n,Math.max(t,e))}function Co(e){const t=e+"CollectionProvider",[n,r]=We(t),[o,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=p=>{const{scope:v,children:x}=p,y=S.useRef(null),w=S.useRef(new Map).current;return s.jsx(o,{scope:v,itemMap:w,collectionRef:y,children:x})};i.displayName=t;const c=e+"CollectionSlot",l=Ht(c),u=S.forwardRef((p,v)=>{const{scope:x,children:y}=p,w=a(c,x),E=pe(v,w.collectionRef);return s.jsx(l,{ref:E,children:y})});u.displayName=c;const f=e+"CollectionItemSlot",d="data-radix-collection-item",m=Ht(f),g=S.forwardRef((p,v)=>{const{scope:x,children:y,...w}=p,E=S.useRef(null),N=pe(v,E),j=a(f,x);return S.useEffect(()=>(j.itemMap.set(E,{ref:E,...w}),()=>void j.itemMap.delete(E))),s.jsx(m,{[d]:"",ref:N,children:y})});g.displayName=f;function b(p){const v=a(e+"CollectionConsumer",p);return S.useCallback(()=>{const y=v.collectionRef.current;if(!y)return[];const w=Array.from(y.querySelectorAll(`[${d}]`));return Array.from(v.itemMap.values()).sort((j,R)=>w.indexOf(j.ref.current)-w.indexOf(R.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:i,Slot:u,ItemSlot:g},b,r]}var Up=h.createContext(void 0);function Qn(e){const t=h.useContext(Up);return e||t||"ltr"}const Gp=["top","right","bottom","left"],yt=Math.min,ke=Math.max,Jn=Math.round,er=Math.floor,Ke=e=>({x:e,y:e}),zp={left:"right",right:"left",bottom:"top",top:"bottom"};function To(e,t,n){return ke(e,yt(t,n))}function ot(e,t){return typeof e=="function"?e(t):e}function st(e){return e.split("-")[0]}function zt(e){return e.split("-")[1]}function jo(e){return e==="x"?"y":"x"}function Ao(e){return e==="y"?"height":"width"}function Ze(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Po(e){return jo(Ze(e))}function $p(e,t,n){n===void 0&&(n=!1);const r=zt(e),o=Po(e),a=Ao(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=tr(i)),[i,tr(i)]}function Wp(e){const t=tr(e);return[Oo(e),t,Oo(t)]}function Oo(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Di=["left","right"],Ii=["right","left"],Vp=["top","bottom"],qp=["bottom","top"];function Xp(e,t,n){switch(e){case"top":case"bottom":return n?t?Ii:Di:t?Di:Ii;case"left":case"right":return t?Vp:qp;default:return[]}}function Yp(e,t,n,r){const o=zt(e);let a=Xp(st(e),n==="start",r);return o&&(a=a.map(i=>i+"-"+o),t&&(a=a.concat(a.map(Oo)))),a}function tr(e){const t=st(e);return zp[t]+e.slice(t.length)}function Kp(e){return{top:0,right:0,bottom:0,left:0,...e}}function Mi(e){return typeof e!="number"?Kp(e):{top:e,right:e,bottom:e,left:e}}function nr(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Li(e,t,n){let{reference:r,floating:o}=e;const a=Ze(t),i=Po(t),c=Ao(i),l=st(t),u=a==="y",f=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,m=r[c]/2-o[c]/2;let g;switch(l){case"top":g={x:f,y:r.y-o.height};break;case"bottom":g={x:f,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:d};break;case"left":g={x:r.x-o.width,y:d};break;default:g={x:r.x,y:r.y}}switch(zt(t)){case"start":g[i]-=m*(n&&u?-1:1);break;case"end":g[i]+=m*(n&&u?-1:1);break}return g}async function Zp(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:a,rects:i,elements:c,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:d="floating",altBoundary:m=!1,padding:g=0}=ot(t,e),b=Mi(g),v=c[m?d==="floating"?"reference":"floating":d],x=nr(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(v)))==null||n?v:v.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(c.floating)),boundary:u,rootBoundary:f,strategy:l})),y=d==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,w=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c.floating)),E=await(a.isElement==null?void 0:a.isElement(w))?await(a.getScale==null?void 0:a.getScale(w))||{x:1,y:1}:{x:1,y:1},N=nr(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:y,offsetParent:w,strategy:l}):y);return{top:(x.top-N.top+b.top)/E.y,bottom:(N.bottom-x.bottom+b.bottom)/E.y,left:(x.left-N.left+b.left)/E.x,right:(N.right-x.right+b.right)/E.x}}const Qp=50,Jp=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:a=[],platform:i}=n,c=i.detectOverflow?i:{...i,detectOverflow:Zp},l=await(i.isRTL==null?void 0:i.isRTL(t));let u=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:d}=Li(u,r,l),m=r,g=0;const b={};for(let p=0;p<a.length;p++){const v=a[p];if(!v)continue;const{name:x,fn:y}=v,{x:w,y:E,data:N,reset:j}=await y({x:f,y:d,initialPlacement:r,placement:m,strategy:o,middlewareData:b,rects:u,platform:c,elements:{reference:e,floating:t}});f=w??f,d=E??d,b[x]={...b[x],...N},j&&g<Qp&&(g++,typeof j=="object"&&(j.placement&&(m=j.placement),j.rects&&(u=j.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):j.rects),{x:f,y:d}=Li(u,m,l)),p=-1)}return{x:f,y:d,placement:m,strategy:o,middlewareData:b}},eg=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:a,platform:i,elements:c,middlewareData:l}=t,{element:u,padding:f=0}=ot(e,t)||{};if(u==null)return{};const d=Mi(f),m={x:n,y:r},g=Po(o),b=Ao(g),p=await i.getDimensions(u),v=g==="y",x=v?"top":"left",y=v?"bottom":"right",w=v?"clientHeight":"clientWidth",E=a.reference[b]+a.reference[g]-m[g]-a.floating[b],N=m[g]-a.reference[g],j=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let R=j?j[w]:0;(!R||!await(i.isElement==null?void 0:i.isElement(j)))&&(R=c.floating[w]||a.floating[b]);const _=E/2-N/2,I=R/2-p[b]/2-1,M=yt(d[x],I),q=yt(d[y],I),U=M,X=R-p[b]-q,Q=R/2-p[b]/2+_,oe=To(U,Q,X),F=!l.arrow&&zt(o)!=null&&Q!==oe&&a.reference[b]/2-(Q<U?M:q)-p[b]/2<0,K=F?Q<U?Q-U:Q-X:0;return{[g]:m[g]+K,data:{[g]:oe,centerOffset:Q-oe-K,...F&&{alignmentOffset:K}},reset:F}}}),tg=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:a,rects:i,initialPlacement:c,platform:l,elements:u}=t,{mainAxis:f=!0,crossAxis:d=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:p=!0,...v}=ot(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const x=st(o),y=Ze(c),w=st(c)===c,E=await(l.isRTL==null?void 0:l.isRTL(u.floating)),N=m||(w||!p?[tr(c)]:Wp(c)),j=b!=="none";!m&&j&&N.push(...Yp(c,p,b,E));const R=[c,...N],_=await l.detectOverflow(t,v),I=[];let M=((r=a.flip)==null?void 0:r.overflows)||[];if(f&&I.push(_[x]),d){const Q=$p(o,i,E);I.push(_[Q[0]],_[Q[1]])}if(M=[...M,{placement:o,overflows:I}],!I.every(Q=>Q<=0)){var q,U;const Q=(((q=a.flip)==null?void 0:q.index)||0)+1,oe=R[Q];if(oe&&(!(d==="alignment"?y!==Ze(oe):!1)||M.every(G=>Ze(G.placement)===y?G.overflows[0]>0:!0)))return{data:{index:Q,overflows:M},reset:{placement:oe}};let F=(U=M.filter(K=>K.overflows[0]<=0).sort((K,G)=>K.overflows[1]-G.overflows[1])[0])==null?void 0:U.placement;if(!F)switch(g){case"bestFit":{var X;const K=(X=M.filter(G=>{if(j){const D=Ze(G.placement);return D===y||D==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(D=>D>0).reduce((D,O)=>D+O,0)]).sort((G,D)=>G[1]-D[1])[0])==null?void 0:X[0];K&&(F=K);break}case"initialPlacement":F=c;break}if(o!==F)return{reset:{placement:F}}}return{}}}};function Hi(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Bi(e){return Gp.some(t=>e[t]>=0)}const ng=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...a}=ot(e,t);switch(o){case"referenceHidden":{const i=await r.detectOverflow(t,{...a,elementContext:"reference"}),c=Hi(i,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:Bi(c)}}}case"escaped":{const i=await r.detectOverflow(t,{...a,altBoundary:!0}),c=Hi(i,n.floating);return{data:{escapedOffsets:c,escaped:Bi(c)}}}default:return{}}}}},Fi=new Set(["left","top"]);async function rg(e,t){const{placement:n,platform:r,elements:o}=e,a=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=st(n),c=zt(n),l=Ze(n)==="y",u=Fi.has(i)?-1:1,f=a&&l?-1:1,d=ot(t,e);let{mainAxis:m,crossAxis:g,alignmentAxis:b}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return c&&typeof b=="number"&&(g=c==="end"?b*-1:b),l?{x:g*f,y:m*u}:{x:m*u,y:g*f}}const og=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:a,placement:i,middlewareData:c}=t,l=await rg(t,e);return i===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:a+l.y,data:{...l,placement:i}}}}},sg=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:a}=t,{mainAxis:i=!0,crossAxis:c=!1,limiter:l={fn:x=>{let{x:y,y:w}=x;return{x:y,y:w}}},...u}=ot(e,t),f={x:n,y:r},d=await a.detectOverflow(t,u),m=Ze(st(o)),g=jo(m);let b=f[g],p=f[m];if(i){const x=g==="y"?"top":"left",y=g==="y"?"bottom":"right",w=b+d[x],E=b-d[y];b=To(w,b,E)}if(c){const x=m==="y"?"top":"left",y=m==="y"?"bottom":"right",w=p+d[x],E=p-d[y];p=To(w,p,E)}const v=l.fn({...t,[g]:b,[m]:p});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[g]:i,[m]:c}}}}}},ag=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:a,middlewareData:i}=t,{offset:c=0,mainAxis:l=!0,crossAxis:u=!0}=ot(e,t),f={x:n,y:r},d=Ze(o),m=jo(d);let g=f[m],b=f[d];const p=ot(c,t),v=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(l){const w=m==="y"?"height":"width",E=a.reference[m]-a.floating[w]+v.mainAxis,N=a.reference[m]+a.reference[w]-v.mainAxis;g<E?g=E:g>N&&(g=N)}if(u){var x,y;const w=m==="y"?"width":"height",E=Fi.has(st(o)),N=a.reference[d]-a.floating[w]+(E&&((x=i.offset)==null?void 0:x[d])||0)+(E?0:v.crossAxis),j=a.reference[d]+a.reference[w]+(E?0:((y=i.offset)==null?void 0:y[d])||0)-(E?v.crossAxis:0);b<N?b=N:b>j&&(b=j)}return{[m]:g,[d]:b}}}},ig=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:a,platform:i,elements:c}=t,{apply:l=()=>{},...u}=ot(e,t),f=await i.detectOverflow(t,u),d=st(o),m=zt(o),g=Ze(o)==="y",{width:b,height:p}=a.floating;let v,x;d==="top"||d==="bottom"?(v=d,x=m===(await(i.isRTL==null?void 0:i.isRTL(c.floating))?"start":"end")?"left":"right"):(x=d,v=m==="end"?"top":"bottom");const y=p-f.top-f.bottom,w=b-f.left-f.right,E=yt(p-f[v],y),N=yt(b-f[x],w),j=!t.middlewareData.shift;let R=E,_=N;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(_=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(R=y),j&&!m){const M=ke(f.left,0),q=ke(f.right,0),U=ke(f.top,0),X=ke(f.bottom,0);g?_=b-2*(M!==0||q!==0?M+q:ke(f.left,f.right)):R=p-2*(U!==0||X!==0?U+X:ke(f.top,f.bottom))}await l({...t,availableWidth:_,availableHeight:R});const I=await i.getDimensions(c.floating);return b!==I.width||p!==I.height?{reset:{rects:!0}}:{}}}};function rr(){return typeof window<"u"}function $t(e){return Ui(e)?(e.nodeName||"").toLowerCase():"#document"}function De(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Qe(e){var t;return(t=(Ui(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ui(e){return rr()?e instanceof Node||e instanceof De(e).Node:!1}function Be(e){return rr()?e instanceof Element||e instanceof De(e).Element:!1}function at(e){return rr()?e instanceof HTMLElement||e instanceof De(e).HTMLElement:!1}function Gi(e){return!rr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof De(e).ShadowRoot}function cn(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Fe(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function cg(e){return/^(table|td|th)$/.test($t(e))}function or(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const lg=/transform|translate|scale|rotate|perspective|filter/,ug=/paint|layout|strict|content/,At=e=>!!e&&e!=="none";let ko;function Do(e){const t=Be(e)?Fe(e):e;return At(t.transform)||At(t.translate)||At(t.scale)||At(t.rotate)||At(t.perspective)||!Io()&&(At(t.backdropFilter)||At(t.filter))||lg.test(t.willChange||"")||ug.test(t.contain||"")}function dg(e){let t=xt(e);for(;at(t)&&!Wt(t);){if(Do(t))return t;if(or(t))return null;t=xt(t)}return null}function Io(){return ko==null&&(ko=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),ko}function Wt(e){return/^(html|body|#document)$/.test($t(e))}function Fe(e){return De(e).getComputedStyle(e)}function sr(e){return Be(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function xt(e){if($t(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Gi(e)&&e.host||Qe(e);return Gi(t)?t.host:t}function zi(e){const t=xt(e);return Wt(t)?e.ownerDocument?e.ownerDocument.body:e.body:at(t)&&cn(t)?t:zi(t)}function ln(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=zi(e),a=o===((r=e.ownerDocument)==null?void 0:r.body),i=De(o);if(a){const c=Mo(i);return t.concat(i,i.visualViewport||[],cn(o)?o:[],c&&n?ln(c):[])}else return t.concat(o,ln(o,[],n))}function Mo(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function $i(e){const t=Fe(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=at(e),a=o?e.offsetWidth:n,i=o?e.offsetHeight:r,c=Jn(n)!==a||Jn(r)!==i;return c&&(n=a,r=i),{width:n,height:r,$:c}}function Lo(e){return Be(e)?e:e.contextElement}function Vt(e){const t=Lo(e);if(!at(t))return Ke(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:a}=$i(t);let i=(a?Jn(n.width):n.width)/r,c=(a?Jn(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!c||!Number.isFinite(c))&&(c=1),{x:i,y:c}}const fg=Ke(0);function Wi(e){const t=De(e);return!Io()||!t.visualViewport?fg:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function hg(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==De(e)?!1:t}function Pt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),a=Lo(e);let i=Ke(1);t&&(r?Be(r)&&(i=Vt(r)):i=Vt(e));const c=hg(a,n,r)?Wi(a):Ke(0);let l=(o.left+c.x)/i.x,u=(o.top+c.y)/i.y,f=o.width/i.x,d=o.height/i.y;if(a){const m=De(a),g=r&&Be(r)?De(r):r;let b=m,p=Mo(b);for(;p&&r&&g!==b;){const v=Vt(p),x=p.getBoundingClientRect(),y=Fe(p),w=x.left+(p.clientLeft+parseFloat(y.paddingLeft))*v.x,E=x.top+(p.clientTop+parseFloat(y.paddingTop))*v.y;l*=v.x,u*=v.y,f*=v.x,d*=v.y,l+=w,u+=E,b=De(p),p=Mo(b)}}return nr({width:f,height:d,x:l,y:u})}function ar(e,t){const n=sr(e).scrollLeft;return t?t.left+n:Pt(Qe(e)).left+n}function Vi(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-ar(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function mg(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const a=o==="fixed",i=Qe(r),c=t?or(t.floating):!1;if(r===i||c&&a)return n;let l={scrollLeft:0,scrollTop:0},u=Ke(1);const f=Ke(0),d=at(r);if((d||!d&&!a)&&(($t(r)!=="body"||cn(i))&&(l=sr(r)),d)){const g=Pt(r);u=Vt(r),f.x=g.x+r.clientLeft,f.y=g.y+r.clientTop}const m=i&&!d&&!a?Vi(i,l):Ke(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+f.x+m.x,y:n.y*u.y-l.scrollTop*u.y+f.y+m.y}}function pg(e){return Array.from(e.getClientRects())}function gg(e){const t=Qe(e),n=sr(e),r=e.ownerDocument.body,o=ke(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=ke(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+ar(e);const c=-n.scrollTop;return Fe(r).direction==="rtl"&&(i+=ke(t.clientWidth,r.clientWidth)-o),{width:o,height:a,x:i,y:c}}const qi=25;function bg(e,t){const n=De(e),r=Qe(e),o=n.visualViewport;let a=r.clientWidth,i=r.clientHeight,c=0,l=0;if(o){a=o.width,i=o.height;const f=Io();(!f||f&&t==="fixed")&&(c=o.offsetLeft,l=o.offsetTop)}const u=ar(r);if(u<=0){const f=r.ownerDocument,d=f.body,m=getComputedStyle(d),g=f.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,b=Math.abs(r.clientWidth-d.clientWidth-g);b<=qi&&(a-=b)}else u<=qi&&(a+=u);return{width:a,height:i,x:c,y:l}}function vg(e,t){const n=Pt(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,a=at(e)?Vt(e):Ke(1),i=e.clientWidth*a.x,c=e.clientHeight*a.y,l=o*a.x,u=r*a.y;return{width:i,height:c,x:l,y:u}}function Xi(e,t,n){let r;if(t==="viewport")r=bg(e,n);else if(t==="document")r=gg(Qe(e));else if(Be(t))r=vg(t,n);else{const o=Wi(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return nr(r)}function Yi(e,t){const n=xt(e);return n===t||!Be(n)||Wt(n)?!1:Fe(n).position==="fixed"||Yi(n,t)}function yg(e,t){const n=t.get(e);if(n)return n;let r=ln(e,[],!1).filter(c=>Be(c)&&$t(c)!=="body"),o=null;const a=Fe(e).position==="fixed";let i=a?xt(e):e;for(;Be(i)&&!Wt(i);){const c=Fe(i),l=Do(i);!l&&c.position==="fixed"&&(o=null),(a?!l&&!o:!l&&c.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||cn(i)&&!l&&Yi(e,i))?r=r.filter(f=>f!==i):o=c,i=xt(i)}return t.set(e,r),r}function xg(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?or(t)?[]:yg(t,this._c):[].concat(n),r],c=Xi(t,i[0],o);let l=c.top,u=c.right,f=c.bottom,d=c.left;for(let m=1;m<i.length;m++){const g=Xi(t,i[m],o);l=ke(g.top,l),u=yt(g.right,u),f=yt(g.bottom,f),d=ke(g.left,d)}return{width:u-d,height:f-l,x:d,y:l}}function wg(e){const{width:t,height:n}=$i(e);return{width:t,height:n}}function Eg(e,t,n){const r=at(t),o=Qe(t),a=n==="fixed",i=Pt(e,!0,a,t);let c={scrollLeft:0,scrollTop:0};const l=Ke(0);function u(){l.x=ar(o)}if(r||!r&&!a)if(($t(t)!=="body"||cn(o))&&(c=sr(t)),r){const g=Pt(t,!0,a,t);l.x=g.x+t.clientLeft,l.y=g.y+t.clientTop}else o&&u();a&&!r&&o&&u();const f=o&&!r&&!a?Vi(o,c):Ke(0),d=i.left+c.scrollLeft-l.x-f.x,m=i.top+c.scrollTop-l.y-f.y;return{x:d,y:m,width:i.width,height:i.height}}function Ho(e){return Fe(e).position==="static"}function Ki(e,t){if(!at(e)||Fe(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Qe(e)===n&&(n=n.ownerDocument.body),n}function Zi(e,t){const n=De(e);if(or(e))return n;if(!at(e)){let o=xt(e);for(;o&&!Wt(o);){if(Be(o)&&!Ho(o))return o;o=xt(o)}return n}let r=Ki(e,t);for(;r&&cg(r)&&Ho(r);)r=Ki(r,t);return r&&Wt(r)&&Ho(r)&&!Do(r)?n:r||dg(e)||n}const _g=async function(e){const t=this.getOffsetParent||Zi,n=this.getDimensions,r=await n(e.floating);return{reference:Eg(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Sg(e){return Fe(e).direction==="rtl"}const Ng={convertOffsetParentRelativeRectToViewportRelativeRect:mg,getDocumentElement:Qe,getClippingRect:xg,getOffsetParent:Zi,getElementRects:_g,getClientRects:pg,getDimensions:wg,getScale:Vt,isElement:Be,isRTL:Sg};function Qi(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Rg(e,t){let n=null,r;const o=Qe(e);function a(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function i(c,l){c===void 0&&(c=!1),l===void 0&&(l=1),a();const u=e.getBoundingClientRect(),{left:f,top:d,width:m,height:g}=u;if(c||t(),!m||!g)return;const b=er(d),p=er(o.clientWidth-(f+m)),v=er(o.clientHeight-(d+g)),x=er(f),w={rootMargin:-b+"px "+-p+"px "+-v+"px "+-x+"px",threshold:ke(0,yt(1,l))||1};let E=!0;function N(j){const R=j[0].intersectionRatio;if(R!==l){if(!E)return i();R?i(!1,R):r=setTimeout(()=>{i(!1,1e-7)},1e3)}R===1&&!Qi(u,e.getBoundingClientRect())&&i(),E=!1}try{n=new IntersectionObserver(N,{...w,root:o.ownerDocument})}catch{n=new IntersectionObserver(N,w)}n.observe(e)}return i(!0),a}function Cg(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=Lo(e),f=o||a?[...u?ln(u):[],...t?ln(t):[]]:[];f.forEach(x=>{o&&x.addEventListener("scroll",n,{passive:!0}),a&&x.addEventListener("resize",n)});const d=u&&c?Rg(u,n):null;let m=-1,g=null;i&&(g=new ResizeObserver(x=>{let[y]=x;y&&y.target===u&&g&&t&&(g.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var w;(w=g)==null||w.observe(t)})),n()}),u&&!l&&g.observe(u),t&&g.observe(t));let b,p=l?Pt(e):null;l&&v();function v(){const x=Pt(e);p&&!Qi(p,x)&&n(),p=x,b=requestAnimationFrame(v)}return n(),()=>{var x;f.forEach(y=>{o&&y.removeEventListener("scroll",n),a&&y.removeEventListener("resize",n)}),d==null||d(),(x=g)==null||x.disconnect(),g=null,l&&cancelAnimationFrame(b)}}const Tg=og,jg=sg,Ag=tg,Pg=ig,Og=ng,Ji=eg,kg=ag,Dg=(e,t,n)=>{const r=new Map,o={platform:Ng,...n},a={...o.platform,_c:r};return Jp(e,t,{...o,platform:a})};var Ig=typeof document<"u",Mg=function(){},ir=Ig?S.useLayoutEffect:Mg;function cr(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 n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!cr(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const a=o[r];if(!(a==="_owner"&&e.$$typeof)&&!cr(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function ec(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function tc(e,t){const n=ec(e);return Math.round(t*n)/n}function Bo(e){const t=h.useRef(e);return ir(()=>{t.current=e}),t}function Lg(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:a,floating:i}={},transform:c=!0,whileElementsMounted:l,open:u}=e,[f,d]=h.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,g]=h.useState(r);cr(m,r)||g(r);const[b,p]=h.useState(null),[v,x]=h.useState(null),y=h.useCallback(G=>{G!==j.current&&(j.current=G,p(G))},[]),w=h.useCallback(G=>{G!==R.current&&(R.current=G,x(G))},[]),E=a||b,N=i||v,j=h.useRef(null),R=h.useRef(null),_=h.useRef(f),I=l!=null,M=Bo(l),q=Bo(o),U=Bo(u),X=h.useCallback(()=>{if(!j.current||!R.current)return;const G={placement:t,strategy:n,middleware:m};q.current&&(G.platform=q.current),Dg(j.current,R.current,G).then(D=>{const O={...D,isPositioned:U.current!==!1};Q.current&&!cr(_.current,O)&&(_.current=O,xn.flushSync(()=>{d(O)}))})},[m,t,n,q,U]);ir(()=>{u===!1&&_.current.isPositioned&&(_.current.isPositioned=!1,d(G=>({...G,isPositioned:!1})))},[u]);const Q=h.useRef(!1);ir(()=>(Q.current=!0,()=>{Q.current=!1}),[]),ir(()=>{if(E&&(j.current=E),N&&(R.current=N),E&&N){if(M.current)return M.current(E,N,X);X()}},[E,N,X,M,I]);const oe=h.useMemo(()=>({reference:j,floating:R,setReference:y,setFloating:w}),[y,w]),F=h.useMemo(()=>({reference:E,floating:N}),[E,N]),K=h.useMemo(()=>{const G={position:n,left:0,top:0};if(!F.floating)return G;const D=tc(F.floating,f.x),O=tc(F.floating,f.y);return c?{...G,transform:"translate("+D+"px, "+O+"px)",...ec(F.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:D,top:O}},[n,c,F.floating,f.x,f.y]);return h.useMemo(()=>({...f,update:X,refs:oe,elements:F,floatingStyles:K}),[f,X,oe,F,K])}const Hg=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Ji({element:r.current,padding:o}).fn(n):{}:r?Ji({element:r,padding:o}).fn(n):{}}}},Bg=(e,t)=>{const n=Tg(e);return{name:n.name,fn:n.fn,options:[e,t]}},Fg=(e,t)=>{const n=jg(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ug=(e,t)=>({fn:kg(e).fn,options:[e,t]}),Gg=(e,t)=>{const n=Ag(e);return{name:n.name,fn:n.fn,options:[e,t]}},zg=(e,t)=>{const n=Pg(e);return{name:n.name,fn:n.fn,options:[e,t]}},$g=(e,t)=>{const n=Og(e);return{name:n.name,fn:n.fn,options:[e,t]}},Wg=(e,t)=>{const n=Hg(e);return{name:n.name,fn:n.fn,options:[e,t]}};var Vg="Arrow",nc=h.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...a}=e;return s.jsx(ne.svg,{...a,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:s.jsx("polygon",{points:"0,0 30,0 15,10"})})});nc.displayName=Vg;var qg=nc;function rc(e){const[t,n]=h.useState(void 0);return je(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const a=o[0];let i,c;if("borderBoxSize"in a){const l=a.borderBoxSize,u=Array.isArray(l)?l[0]:l;i=u.inlineSize,c=u.blockSize}else i=e.offsetWidth,c=e.offsetHeight;n({width:i,height:c})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Fo="Popper",[oc,lr]=We(Fo),[Xg,sc]=oc(Fo),ac=e=>{const{__scopePopper:t,children:n}=e,[r,o]=h.useState(null);return s.jsx(Xg,{scope:t,anchor:r,onAnchorChange:o,children:n})};ac.displayName=Fo;var ic="PopperAnchor",cc=h.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,a=sc(ic,n),i=h.useRef(null),c=pe(t,i),l=h.useRef(null);return h.useEffect(()=>{const u=l.current;l.current=(r==null?void 0:r.current)||i.current,u!==l.current&&a.onAnchorChange(l.current)}),r?null:s.jsx(ne.div,{...o,ref:c})});cc.displayName=ic;var Uo="PopperContent",[Yg,Kg]=oc(Uo),lc=h.forwardRef((e,t)=>{var k,te,$,le,ue,de;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:a="center",alignOffset:i=0,arrowPadding:c=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:f=0,sticky:d="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:b,...p}=e,v=sc(Uo,n),[x,y]=h.useState(null),w=pe(t,ye=>y(ye)),[E,N]=h.useState(null),j=rc(E),R=(j==null?void 0:j.width)??0,_=(j==null?void 0:j.height)??0,I=r+(a!=="center"?"-"+a:""),M=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},q=Array.isArray(u)?u:[u],U=q.length>0,X={padding:M,boundary:q.filter(Qg),altBoundary:U},{refs:Q,floatingStyles:oe,placement:F,isPositioned:K,middlewareData:G}=Lg({strategy:"fixed",placement:I,whileElementsMounted:(...ye)=>Cg(...ye,{animationFrame:g==="always"}),elements:{reference:v.anchor},middleware:[Bg({mainAxis:o+_,alignmentAxis:i}),l&&Fg({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?Ug():void 0,...X}),l&&Gg({...X}),zg({...X,apply:({elements:ye,rects:Te,availableWidth:ct,availableHeight:Mt})=>{const{width:Lt,height:Ms}=Te.reference,C=ye.floating.style;C.setProperty("--radix-popper-available-width",`${ct}px`),C.setProperty("--radix-popper-available-height",`${Mt}px`),C.setProperty("--radix-popper-anchor-width",`${Lt}px`),C.setProperty("--radix-popper-anchor-height",`${Ms}px`)}}),E&&Wg({element:E,padding:c}),Jg({arrowWidth:R,arrowHeight:_}),m&&$g({strategy:"referenceHidden",...X})]}),[D,O]=fc(F),T=qe(b);je(()=>{K&&(T==null||T())},[K,T]);const z=(k=G.arrow)==null?void 0:k.x,ie=(te=G.arrow)==null?void 0:te.y,se=(($=G.arrow)==null?void 0:$.centerOffset)!==0,[me,ce]=h.useState();return je(()=>{x&&ce(window.getComputedStyle(x).zIndex)},[x]),s.jsx("div",{ref:Q.setFloating,"data-radix-popper-content-wrapper":"",style:{...oe,transform:K?oe.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:me,"--radix-popper-transform-origin":[(le=G.transformOrigin)==null?void 0:le.x,(ue=G.transformOrigin)==null?void 0:ue.y].join(" "),...((de=G.hide)==null?void 0:de.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:s.jsx(Yg,{scope:n,placedSide:D,onArrowChange:N,arrowX:z,arrowY:ie,shouldHideArrow:se,children:s.jsx(ne.div,{"data-side":D,"data-align":O,...p,ref:w,style:{...p.style,animation:K?void 0:"none"}})})})});lc.displayName=Uo;var uc="PopperArrow",Zg={top:"bottom",right:"left",bottom:"top",left:"right"},dc=h.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,a=Kg(uc,r),i=Zg[a.placedSide];return s.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:s.jsx(qg,{...o,ref:n,style:{...o.style,display:"block"}})})});dc.displayName=uc;function Qg(e){return e!==null}var Jg=e=>({name:"transformOrigin",options:e,fn(t){var v,x,y;const{placement:n,rects:r,middlewareData:o}=t,i=((v=o.arrow)==null?void 0:v.centerOffset)!==0,c=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[u,f]=fc(n),d={start:"0%",center:"50%",end:"100%"}[f],m=(((x=o.arrow)==null?void 0:x.x)??0)+c/2,g=(((y=o.arrow)==null?void 0:y.y)??0)+l/2;let b="",p="";return u==="bottom"?(b=i?d:`${m}px`,p=`${-l}px`):u==="top"?(b=i?d:`${m}px`,p=`${r.floating.height+l}px`):u==="right"?(b=`${-l}px`,p=i?d:`${g}px`):u==="left"&&(b=`${r.floating.width+l}px`,p=i?d:`${g}px`),{data:{x:b,y:p}}}});function fc(e){const[t,n="center"]=e.split("-");return[t,n]}var hc=ac,mc=cc,pc=lc,gc=dc;function bc(e){const t=h.useRef({value:e,previous:e});return h.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var vc=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),eb="VisuallyHidden",tb=h.forwardRef((e,t)=>s.jsx(ne.span,{...e,ref:t,style:{...vc,...e.style}}));tb.displayName=eb;var nb=[" ","Enter","ArrowUp","ArrowDown"],rb=[" ","Enter"],Ot="Select",[ur,dr,ob]=Co(Ot),[qt]=We(Ot,[ob,lr]),fr=lr(),[sb,wt]=qt(Ot),[ab,ib]=qt(Ot),yc=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:a,value:i,defaultValue:c,onValueChange:l,dir:u,name:f,autoComplete:d,disabled:m,required:g,form:b}=e,p=fr(t),[v,x]=h.useState(null),[y,w]=h.useState(null),[E,N]=h.useState(!1),j=Qn(u),[R,_]=Ct({prop:r,defaultProp:o??!1,onChange:a,caller:Ot}),[I,M]=Ct({prop:i,defaultProp:c,onChange:l,caller:Ot}),q=h.useRef(null),U=v?b||!!v.closest("form"):!0,[X,Q]=h.useState(new Set),oe=Array.from(X).map(F=>F.props.value).join(";");return s.jsx(hc,{...p,children:s.jsxs(sb,{required:g,scope:t,trigger:v,onTriggerChange:x,valueNode:y,onValueNodeChange:w,valueNodeHasChildren:E,onValueNodeHasChildrenChange:N,contentId:Ve(),value:I,onValueChange:M,open:R,onOpenChange:_,dir:j,triggerPointerDownPosRef:q,disabled:m,children:[s.jsx(ur.Provider,{scope:t,children:s.jsx(ab,{scope:e.__scopeSelect,onNativeOptionAdd:h.useCallback(F=>{Q(K=>new Set(K).add(F))},[]),onNativeOptionRemove:h.useCallback(F=>{Q(K=>{const G=new Set(K);return G.delete(F),G})},[]),children:n})}),U?s.jsxs(zc,{"aria-hidden":!0,required:g,tabIndex:-1,name:f,autoComplete:d,value:I,onChange:F=>M(F.target.value),disabled:m,form:b,children:[I===void 0?s.jsx("option",{value:""}):null,Array.from(X)]},oe):null]})})};yc.displayName=Ot;var xc="SelectTrigger",wc=h.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,a=fr(n),i=wt(xc,n),c=i.disabled||r,l=pe(t,i.onTriggerChange),u=dr(n),f=h.useRef("touch"),[d,m,g]=Wc(p=>{const v=u().filter(w=>!w.disabled),x=v.find(w=>w.value===i.value),y=Vc(v,p,x);y!==void 0&&i.onValueChange(y.value)}),b=p=>{c||(i.onOpenChange(!0),g()),p&&(i.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return s.jsx(mc,{asChild:!0,...a,children:s.jsx(ne.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:c,"data-disabled":c?"":void 0,"data-placeholder":$c(i.value)?"":void 0,...o,ref:l,onClick:B(o.onClick,p=>{p.currentTarget.focus(),f.current!=="mouse"&&b(p)}),onPointerDown:B(o.onPointerDown,p=>{f.current=p.pointerType;const v=p.target;v.hasPointerCapture(p.pointerId)&&v.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(b(p),p.preventDefault())}),onKeyDown:B(o.onKeyDown,p=>{const v=d.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&m(p.key),!(v&&p.key===" ")&&nb.includes(p.key)&&(b(),p.preventDefault())})})})});wc.displayName=xc;var Ec="SelectValue",_c=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:a,placeholder:i="",...c}=e,l=wt(Ec,n),{onValueNodeHasChildrenChange:u}=l,f=a!==void 0,d=pe(t,l.onValueNodeChange);return je(()=>{u(f)},[u,f]),s.jsx(ne.span,{...c,ref:d,style:{pointerEvents:"none"},children:$c(l.value)?s.jsx(s.Fragment,{children:i}):a})});_c.displayName=Ec;var cb="SelectIcon",Sc=h.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return s.jsx(ne.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});Sc.displayName=cb;var lb="SelectPortal",Nc=e=>s.jsx(Fn,{asChild:!0,...e});Nc.displayName=lb;var kt="SelectContent",Rc=h.forwardRef((e,t)=>{const n=wt(kt,e.__scopeSelect),[r,o]=h.useState();if(je(()=>{o(new DocumentFragment)},[]),!n.open){const a=r;return a?xn.createPortal(s.jsx(Cc,{scope:e.__scopeSelect,children:s.jsx(ur.Slot,{scope:e.__scopeSelect,children:s.jsx("div",{children:e.children})})}),a):null}return s.jsx(Tc,{...e,ref:t})});Rc.displayName=kt;var Ue=10,[Cc,Et]=qt(kt),ub="SelectContentImpl",db=Ht("SelectContent.RemoveScroll"),Tc=h.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:a,onPointerDownOutside:i,side:c,sideOffset:l,align:u,alignOffset:f,arrowPadding:d,collisionBoundary:m,collisionPadding:g,sticky:b,hideWhenDetached:p,avoidCollisions:v,...x}=e,y=wt(kt,n),[w,E]=h.useState(null),[N,j]=h.useState(null),R=pe(t,k=>E(k)),[_,I]=h.useState(null),[M,q]=h.useState(null),U=dr(n),[X,Q]=h.useState(!1),oe=h.useRef(!1);h.useEffect(()=>{if(w)return vo(w)},[w]),fo();const F=h.useCallback(k=>{const[te,...$]=U().map(de=>de.ref.current),[le]=$.slice(-1),ue=document.activeElement;for(const de of k)if(de===ue||(de==null||de.scrollIntoView({block:"nearest"}),de===te&&N&&(N.scrollTop=0),de===le&&N&&(N.scrollTop=N.scrollHeight),de==null||de.focus(),document.activeElement!==ue))return},[U,N]),K=h.useCallback(()=>F([_,w]),[F,_,w]);h.useEffect(()=>{X&&K()},[X,K]);const{onOpenChange:G,triggerPointerDownPosRef:D}=y;h.useEffect(()=>{if(w){let k={x:0,y:0};const te=le=>{var ue,de;k={x:Math.abs(Math.round(le.pageX)-(((ue=D.current)==null?void 0:ue.x)??0)),y:Math.abs(Math.round(le.pageY)-(((de=D.current)==null?void 0:de.y)??0))}},$=le=>{k.x<=10&&k.y<=10?le.preventDefault():w.contains(le.target)||G(!1),document.removeEventListener("pointermove",te),D.current=null};return D.current!==null&&(document.addEventListener("pointermove",te),document.addEventListener("pointerup",$,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",te),document.removeEventListener("pointerup",$,{capture:!0})}}},[w,G,D]),h.useEffect(()=>{const k=()=>G(!1);return window.addEventListener("blur",k),window.addEventListener("resize",k),()=>{window.removeEventListener("blur",k),window.removeEventListener("resize",k)}},[G]);const[O,T]=Wc(k=>{const te=U().filter(ue=>!ue.disabled),$=te.find(ue=>ue.ref.current===document.activeElement),le=Vc(te,k,$);le&&setTimeout(()=>le.ref.current.focus())}),z=h.useCallback((k,te,$)=>{const le=!oe.current&&!$;(y.value!==void 0&&y.value===te||le)&&(I(k),le&&(oe.current=!0))},[y.value]),ie=h.useCallback(()=>w==null?void 0:w.focus(),[w]),se=h.useCallback((k,te,$)=>{const le=!oe.current&&!$;(y.value!==void 0&&y.value===te||le)&&q(k)},[y.value]),me=r==="popper"?Go:jc,ce=me===Go?{side:c,sideOffset:l,align:u,alignOffset:f,arrowPadding:d,collisionBoundary:m,collisionPadding:g,sticky:b,hideWhenDetached:p,avoidCollisions:v}:{};return s.jsx(Cc,{scope:n,content:w,viewport:N,onViewportChange:j,itemRefCallback:z,selectedItem:_,onItemLeave:ie,itemTextRefCallback:se,focusSelectedItem:K,selectedItemText:M,position:r,isPositioned:X,searchRef:O,children:s.jsx(qn,{as:db,allowPinchZoom:!0,children:s.jsx(Bn,{asChild:!0,trapped:y.open,onMountAutoFocus:k=>{k.preventDefault()},onUnmountAutoFocus:B(o,k=>{var te;(te=y.trigger)==null||te.focus({preventScroll:!0}),k.preventDefault()}),children:s.jsx(Hn,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:k=>k.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:s.jsx(me,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:k=>k.preventDefault(),...x,...ce,onPlaced:()=>Q(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:B(x.onKeyDown,k=>{const te=k.ctrlKey||k.altKey||k.metaKey;if(k.key==="Tab"&&k.preventDefault(),!te&&k.key.length===1&&T(k.key),["ArrowUp","ArrowDown","Home","End"].includes(k.key)){let le=U().filter(ue=>!ue.disabled).map(ue=>ue.ref.current);if(["ArrowUp","End"].includes(k.key)&&(le=le.slice().reverse()),["ArrowUp","ArrowDown"].includes(k.key)){const ue=k.target,de=le.indexOf(ue);le=le.slice(de+1)}setTimeout(()=>F(le)),k.preventDefault()}})})})})})})});Tc.displayName=ub;var fb="SelectItemAlignedPosition",jc=h.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,a=wt(kt,n),i=Et(kt,n),[c,l]=h.useState(null),[u,f]=h.useState(null),d=pe(t,R=>f(R)),m=dr(n),g=h.useRef(!1),b=h.useRef(!0),{viewport:p,selectedItem:v,selectedItemText:x,focusSelectedItem:y}=i,w=h.useCallback(()=>{if(a.trigger&&a.valueNode&&c&&u&&p&&v&&x){const R=a.trigger.getBoundingClientRect(),_=u.getBoundingClientRect(),I=a.valueNode.getBoundingClientRect(),M=x.getBoundingClientRect();if(a.dir!=="rtl"){const ue=M.left-_.left,de=I.left-ue,ye=R.left-de,Te=R.width+ye,ct=Math.max(Te,_.width),Mt=window.innerWidth-Ue,Lt=ki(de,[Ue,Math.max(Ue,Mt-ct)]);c.style.minWidth=Te+"px",c.style.left=Lt+"px"}else{const ue=_.right-M.right,de=window.innerWidth-I.right-ue,ye=window.innerWidth-R.right-de,Te=R.width+ye,ct=Math.max(Te,_.width),Mt=window.innerWidth-Ue,Lt=ki(de,[Ue,Math.max(Ue,Mt-ct)]);c.style.minWidth=Te+"px",c.style.right=Lt+"px"}const q=m(),U=window.innerHeight-Ue*2,X=p.scrollHeight,Q=window.getComputedStyle(u),oe=parseInt(Q.borderTopWidth,10),F=parseInt(Q.paddingTop,10),K=parseInt(Q.borderBottomWidth,10),G=parseInt(Q.paddingBottom,10),D=oe+F+X+G+K,O=Math.min(v.offsetHeight*5,D),T=window.getComputedStyle(p),z=parseInt(T.paddingTop,10),ie=parseInt(T.paddingBottom,10),se=R.top+R.height/2-Ue,me=U-se,ce=v.offsetHeight/2,k=v.offsetTop+ce,te=oe+F+k,$=D-te;if(te<=se){const ue=q.length>0&&v===q[q.length-1].ref.current;c.style.bottom="0px";const de=u.clientHeight-p.offsetTop-p.offsetHeight,ye=Math.max(me,ce+(ue?ie:0)+de+K),Te=te+ye;c.style.height=Te+"px"}else{const ue=q.length>0&&v===q[0].ref.current;c.style.top="0px";const ye=Math.max(se,oe+p.offsetTop+(ue?z:0)+ce)+$;c.style.height=ye+"px",p.scrollTop=te-se+p.offsetTop}c.style.margin=`${Ue}px 0`,c.style.minHeight=O+"px",c.style.maxHeight=U+"px",r==null||r(),requestAnimationFrame(()=>g.current=!0)}},[m,a.trigger,a.valueNode,c,u,p,v,x,a.dir,r]);je(()=>w(),[w]);const[E,N]=h.useState();je(()=>{u&&N(window.getComputedStyle(u).zIndex)},[u]);const j=h.useCallback(R=>{R&&b.current===!0&&(w(),y==null||y(),b.current=!1)},[w,y]);return s.jsx(mb,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:g,onScrollButtonChange:j,children:s.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:E},children:s.jsx(ne.div,{...o,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});jc.displayName=fb;var hb="SelectPopperPosition",Go=h.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Ue,...a}=e,i=fr(n);return s.jsx(pc,{...i,...a,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...a.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)"}})});Go.displayName=hb;var[mb,zo]=qt(kt,{}),$o="SelectViewport",Ac=h.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,a=Et($o,n),i=zo($o,n),c=pe(t,a.onViewportChange),l=h.useRef(0);return s.jsxs(s.Fragment,{children:[s.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:r}),s.jsx(ur.Slot,{scope:n,children:s.jsx(ne.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:B(o.onScroll,u=>{const f=u.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:m}=i;if(m!=null&&m.current&&d){const g=Math.abs(l.current-f.scrollTop);if(g>0){const b=window.innerHeight-Ue*2,p=parseFloat(d.style.minHeight),v=parseFloat(d.style.height),x=Math.max(p,v);if(x<b){const y=x+g,w=Math.min(b,y),E=y-w;d.style.height=w+"px",d.style.bottom==="0px"&&(f.scrollTop=E>0?E:0,d.style.justifyContent="flex-end")}}}l.current=f.scrollTop})})})]})});Ac.displayName=$o;var Pc="SelectGroup",[pb,gb]=qt(Pc),bb=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Ve();return s.jsx(pb,{scope:n,id:o,children:s.jsx(ne.div,{role:"group","aria-labelledby":o,...r,ref:t})})});bb.displayName=Pc;var Oc="SelectLabel",kc=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=gb(Oc,n);return s.jsx(ne.div,{id:o.id,...r,ref:t})});kc.displayName=Oc;var hr="SelectItem",[vb,Dc]=qt(hr),Ic=h.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:a,...i}=e,c=wt(hr,n),l=Et(hr,n),u=c.value===r,[f,d]=h.useState(a??""),[m,g]=h.useState(!1),b=pe(t,y=>{var w;return(w=l.itemRefCallback)==null?void 0:w.call(l,y,r,o)}),p=Ve(),v=h.useRef("touch"),x=()=>{o||(c.onValueChange(r),c.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> 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 s.jsx(vb,{scope:n,value:r,disabled:o,textId:p,isSelected:u,onItemTextChange:h.useCallback(y=>{d(w=>w||((y==null?void 0:y.textContent)??"").trim())},[]),children:s.jsx(ur.ItemSlot,{scope:n,value:r,disabled:o,textValue:f,children:s.jsx(ne.div,{role:"option","aria-labelledby":p,"data-highlighted":m?"":void 0,"aria-selected":u&&m,"data-state":u?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...i,ref:b,onFocus:B(i.onFocus,()=>g(!0)),onBlur:B(i.onBlur,()=>g(!1)),onClick:B(i.onClick,()=>{v.current!=="mouse"&&x()}),onPointerUp:B(i.onPointerUp,()=>{v.current==="mouse"&&x()}),onPointerDown:B(i.onPointerDown,y=>{v.current=y.pointerType}),onPointerMove:B(i.onPointerMove,y=>{var w;v.current=y.pointerType,o?(w=l.onItemLeave)==null||w.call(l):v.current==="mouse"&&y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:B(i.onPointerLeave,y=>{var w;y.currentTarget===document.activeElement&&((w=l.onItemLeave)==null||w.call(l))}),onKeyDown:B(i.onKeyDown,y=>{var E;((E=l.searchRef)==null?void 0:E.current)!==""&&y.key===" "||(rb.includes(y.key)&&x(),y.key===" "&&y.preventDefault())})})})})});Ic.displayName=hr;var un="SelectItemText",Mc=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...a}=e,i=wt(un,n),c=Et(un,n),l=Dc(un,n),u=ib(un,n),[f,d]=h.useState(null),m=pe(t,x=>d(x),l.onItemTextChange,x=>{var y;return(y=c.itemTextRefCallback)==null?void 0:y.call(c,x,l.value,l.disabled)}),g=f==null?void 0:f.textContent,b=h.useMemo(()=>s.jsx("option",{value:l.value,disabled:l.disabled,children:g},l.value),[l.disabled,l.value,g]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=u;return je(()=>(p(b),()=>v(b)),[p,v,b]),s.jsxs(s.Fragment,{children:[s.jsx(ne.span,{id:l.textId,...a,ref:m}),l.isSelected&&i.valueNode&&!i.valueNodeHasChildren?xn.createPortal(a.children,i.valueNode):null]})});Mc.displayName=un;var Lc="SelectItemIndicator",Hc=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Dc(Lc,n).isSelected?s.jsx(ne.span,{"aria-hidden":!0,...r,ref:t}):null});Hc.displayName=Lc;var Wo="SelectScrollUpButton",Bc=h.forwardRef((e,t)=>{const n=Et(Wo,e.__scopeSelect),r=zo(Wo,e.__scopeSelect),[o,a]=h.useState(!1),i=pe(t,r.onScrollButtonChange);return je(()=>{if(n.viewport&&n.isPositioned){let c=function(){const u=l.scrollTop>0;a(u)};const l=n.viewport;return c(),l.addEventListener("scroll",c),()=>l.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),o?s.jsx(Uc,{...e,ref:i,onAutoScroll:()=>{const{viewport:c,selectedItem:l}=n;c&&l&&(c.scrollTop=c.scrollTop-l.offsetHeight)}}):null});Bc.displayName=Wo;var Vo="SelectScrollDownButton",Fc=h.forwardRef((e,t)=>{const n=Et(Vo,e.__scopeSelect),r=zo(Vo,e.__scopeSelect),[o,a]=h.useState(!1),i=pe(t,r.onScrollButtonChange);return je(()=>{if(n.viewport&&n.isPositioned){let c=function(){const u=l.scrollHeight-l.clientHeight,f=Math.ceil(l.scrollTop)<u;a(f)};const l=n.viewport;return c(),l.addEventListener("scroll",c),()=>l.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),o?s.jsx(Uc,{...e,ref:i,onAutoScroll:()=>{const{viewport:c,selectedItem:l}=n;c&&l&&(c.scrollTop=c.scrollTop+l.offsetHeight)}}):null});Fc.displayName=Vo;var Uc=h.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,a=Et("SelectScrollButton",n),i=h.useRef(null),c=dr(n),l=h.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return h.useEffect(()=>()=>l(),[l]),je(()=>{var f;const u=c().find(d=>d.ref.current===document.activeElement);(f=u==null?void 0:u.ref.current)==null||f.scrollIntoView({block:"nearest"})},[c]),s.jsx(ne.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:B(o.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(r,50))}),onPointerMove:B(o.onPointerMove,()=>{var u;(u=a.onItemLeave)==null||u.call(a),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:B(o.onPointerLeave,()=>{l()})})}),yb="SelectSeparator",Gc=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return s.jsx(ne.div,{"aria-hidden":!0,...r,ref:t})});Gc.displayName=yb;var qo="SelectArrow",xb=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=fr(n),a=wt(qo,n),i=Et(qo,n);return a.open&&i.position==="popper"?s.jsx(gc,{...o,...r,ref:t}):null});xb.displayName=qo;var wb="SelectBubbleInput",zc=h.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=h.useRef(null),a=pe(r,o),i=bc(t);return h.useEffect(()=>{const c=o.current;if(!c)return;const l=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(l,"value").set;if(i!==t&&f){const d=new Event("change",{bubbles:!0});f.call(c,t),c.dispatchEvent(d)}},[i,t]),s.jsx(ne.select,{...n,style:{...vc,...n.style},ref:a,defaultValue:t})});zc.displayName=wb;function $c(e){return e===""||e===void 0}function Wc(e){const t=qe(e),n=h.useRef(""),r=h.useRef(0),o=h.useCallback(i=>{const c=n.current+i;t(c),(function l(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>l(""),1e3))})(c)},[t]),a=h.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return h.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,a]}function Vc(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let i=Eb(e,Math.max(a,0));o.length===1&&(i=i.filter(u=>u!==n));const l=i.find(u=>u.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function Eb(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var _b=yc,qc=wc,Sb=_c,Nb=Sc,Rb=Nc,Xc=Rc,Cb=Ac,Yc=kc,Kc=Ic,Tb=Mc,jb=Hc,Zc=Bc,Qc=Fc,Jc=Gc;const Ab=_b,Pb=Sb,el=h.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(qc,{ref:r,className:V("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,s.jsx(Nb,{asChild:!0,children:s.jsx(An,{className:"h-4 w-4 opacity-50"})})]}));el.displayName=qc.displayName;const tl=h.forwardRef(({className:e,...t},n)=>s.jsx(Zc,{ref:n,className:V("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(Pn,{className:"h-4 w-4"})}));tl.displayName=Zc.displayName;const nl=h.forwardRef(({className:e,...t},n)=>s.jsx(Qc,{ref:n,className:V("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(An,{className:"h-4 w-4"})}));nl.displayName=Qc.displayName;const rl=h.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>s.jsx(Rb,{children:s.jsxs(Xc,{ref:o,className:V("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",n==="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:n,...r,children:[s.jsx(tl,{}),s.jsx(Cb,{className:V("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),s.jsx(nl,{})]})}));rl.displayName=Xc.displayName;const Ob=h.forwardRef(({className:e,...t},n)=>s.jsx(Yc,{ref:n,className:V("px-2 py-1.5 text-sm font-semibold",e),...t}));Ob.displayName=Yc.displayName;const ol=h.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(Kc,{ref:r,className:V("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[s.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(jb,{children:s.jsx(Kr,{className:"h-4 w-4"})})}),s.jsx(Tb,{children:t})]}));ol.displayName=Kc.displayName;const kb=h.forwardRef(({className:e,...t},n)=>s.jsx(Jc,{ref:n,className:V("-mx-1 my-1 h-px bg-muted",e),...t}));kb.displayName=Jc.displayName;function Db({open:e,onOpenChange:t,tool:n}){const r=J("aiCli"),o=J("common"),[a,i]=S.useState(""),[c,l]=S.useState(""),[u,f]=S.useState(""),[d,m]=S.useState(!1),[g,b]=S.useState([]);S.useEffect(()=>{!e||!n||(l(""),f(""),i(n.defaultModel??""),b(n.models??[]),n.available&&Le.getModels(n.name).then(b).catch(()=>{}))},[e,n]);const p=async()=>{if(!(!c.trim()||!n)){m(!0),f("");try{const v=await Le.execute({tool:n.name,prompt:c,model:a||void 0,timeoutMs:6e4});v.output?f(v.output):v.error?f(`Error: ${v.error}`):f(r("testDialog.noOutput"))}catch{W.error(r("toast.executeFailed"))}finally{m(!1)}}};return s.jsx(jt,{open:e,onOpenChange:t,children:s.jsxs(mt,{className:"sm:max-w-[600px]",children:[s.jsxs(pt,{children:[s.jsx(bt,{children:r("testDialog.title",{tool:(n==null?void 0:n.displayName)??""})}),s.jsx(vt,{children:r("testDialog.description")})]}),s.jsxs("div",{className:"space-y-4",children:[g.length>0&&s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ce,{children:r("testDialog.modelLabel")}),s.jsxs(Ab,{value:a,onValueChange:i,children:[s.jsx(el,{children:s.jsx(Pb,{placeholder:r("testDialog.modelPlaceholder")})}),s.jsx(rl,{children:g.map(v=>s.jsxs(ol,{value:v,children:[v,v===(n==null?void 0:n.defaultModel)&&s.jsxs("span",{className:"ml-2 text-muted-foreground text-xs",children:["(",r("testDialog.modelDefault"),")"]})]},v))})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ce,{children:r("testDialog.promptLabel")}),s.jsx(rt,{placeholder:r("testDialog.promptPlaceholder"),value:c,onChange:v=>l(v.target.value),rows:3})]}),u&&s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ce,{children:r("testDialog.resultLabel")}),s.jsx("pre",{className:"rounded-md bg-muted p-3 text-sm overflow-auto max-h-64 whitespace-pre-wrap",children:u})]})]}),s.jsxs(gt,{children:[s.jsx(Y,{variant:"outline",onClick:()=>t(!1),children:o("close")}),s.jsxs(Y,{onClick:p,disabled:d||!c.trim(),children:[d?s.jsx(ve,{className:"mr-2 h-4 w-4 animate-spin"}):s.jsx(on,{className:"mr-2 h-4 w-4"}),r(d?"testDialog.executing":"testDialog.execute")]})]})]})})}const Ib=wa("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Ne({className:e,variant:t,...n}){return s.jsx("div",{className:V(Ib({variant:t}),e),...n})}const Xt=h.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:V("rounded-xl border bg-card text-card-foreground shadow",e),...t}));Xt.displayName="Card";const dn=h.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:V("flex flex-col space-y-1.5 p-6",e),...t}));dn.displayName="CardHeader";const fn=h.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:V("font-semibold leading-none tracking-tight",e),...t}));fn.displayName="CardTitle";const mr=h.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:V("text-sm text-muted-foreground",e),...t}));mr.displayName="CardDescription";const Yt=h.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:V("p-6 pt-0",e),...t}));Yt.displayName="CardContent";const sl=h.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:V("flex items-center p-6 pt-0",e),...t}));sl.displayName="CardFooter";function Mb({isAvailable:e}){return e?s.jsx(Zr,{className:"h-5 w-5 text-green-500"}):s.jsx(da,{className:"h-5 w-5 text-muted-foreground"})}function Lb({tool:e,onTest:t,onHealthCheck:n,isChecking:r,installedSkills:o}){const a=J("aiCli"),i=e.toolType==="api"?rh:ch;return s.jsxs(Xt,{children:[s.jsxs(dn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(i,{className:"h-5 w-5 text-muted-foreground"}),s.jsxs("div",{children:[s.jsx(fn,{className:"text-base",children:e.displayName}),s.jsx(mr,{className:"text-xs",children:e.name})]})]}),s.jsx(Mb,{isAvailable:e.available})]}),s.jsx(Yt,{children:s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[s.jsx(Ne,{variant:e.available?"default":"secondary",children:e.available?a("status.available"):a("status.unavailable")}),s.jsx(Ne,{variant:"outline",className:"text-xs",children:a(`toolType.${e.toolType}`)}),e.version&&s.jsxs("span",{className:"text-muted-foreground",children:["v",e.version]}),e.models&&e.models.length>0&&s.jsx("span",{className:"text-muted-foreground text-xs",children:a("modelCount",{count:e.models.length})})]}),e.path&&s.jsx("p",{className:"text-xs text-muted-foreground truncate",title:e.path,children:e.path}),o.length>0&&s.jsxs("div",{className:"space-y-1.5 pt-1 border-t",children:[s.jsxs("p",{className:"text-xs font-medium text-muted-foreground pt-1",children:[a("installedSkills")," (",o.length,")"]}),s.jsx("div",{className:"flex flex-wrap gap-1",children:o.map(c=>s.jsx(Ne,{variant:"outline",className:"text-xs",children:c.name},c.name))})]}),s.jsxs("div",{className:"flex gap-2 pt-1",children:[s.jsxs(Y,{variant:"outline",size:"sm",onClick:()=>n(e.name),disabled:r,children:[r?s.jsx(ve,{className:"mr-1 h-3 w-3 animate-spin"}):s.jsx(et,{className:"mr-1 h-3 w-3"}),a("actions.healthCheck")]}),e.available&&s.jsxs(Y,{variant:"outline",size:"sm",onClick:()=>t(e),children:[s.jsx(on,{className:"mr-1 h-3 w-3"}),a("actions.testRun")]})]})]})})]})}function Hb(){const e=J("aiCli"),t=J("common"),[n,r]=S.useState([]),[o,a]=S.useState(!0),[i,c]=S.useState(null),[l,u]=S.useState(!1),[f,d]=S.useState(null),[m,g]=S.useState({}),b=S.useCallback(async()=>{a(!0);try{const[y,w]=await Promise.all([Le.getTools(),nt.listInstalled().catch(()=>({}))]);r(y),g(w)}catch{W.error(e("toast.loadFailed"))}finally{a(!1)}},[e]);S.useEffect(()=>{b()},[b]);const p=async y=>{c(y);try{const w=await Le.healthCheck(y);r(E=>E.map(N=>N.name===y?{...N,available:w.available,version:w.version,path:w.path}:N)),W.success(w.available?e("toast.healthOk",{name:y}):e("toast.healthUnavailable",{name:y}))}catch{W.error(e("toast.healthFailed",{name:y}))}finally{c(null)}},v=y=>{d(y),u(!0)},x=n.filter(y=>y.available).length;return s.jsxs("div",{className:"space-y-6",children:[s.jsx($e,{title:e("title"),description:e("description"),children:s.jsxs(Y,{variant:"outline",onClick:b,disabled:o,children:[o?s.jsx(ve,{className:"mr-2 h-4 w-4 animate-spin"}):s.jsx(et,{className:"mr-2 h-4 w-4"}),t("refresh")]})}),o?s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsx("p",{className:"text-muted-foreground",children:t("loading")})}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:s.jsx("span",{children:e("summary",{available:x,total:n.length})})}),s.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:n.map(y=>s.jsx(Lb,{tool:y,onTest:v,onHealthCheck:p,isChecking:i===y.name,installedSkills:m[y.name]||[]},y.name))}),n.length===0&&s.jsx("div",{className:"flex items-center justify-center h-32",children:s.jsx("p",{className:"text-muted-foreground",children:e("noTools")})})]}),s.jsx(Db,{open:l,onOpenChange:u,tool:f})]})}var al="AlertDialog",[Bb]=We(al,[mi]),it=mi(),il=e=>{const{__scopeAlertDialog:t,...n}=e,r=it(t);return s.jsx(Ai,{...r,...n,modal:!0})};il.displayName=al;var Fb="AlertDialogTrigger",Ub=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=it(n);return s.jsx(Bp,{...o,...r,ref:t})});Ub.displayName=Fb;var Gb="AlertDialogPortal",cl=e=>{const{__scopeAlertDialog:t,...n}=e,r=it(t);return s.jsx(Pi,{...r,...n})};cl.displayName=Gb;var zb="AlertDialogOverlay",ll=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=it(n);return s.jsx(Eo,{...o,...r,ref:t})});ll.displayName=zb;var Kt="AlertDialogContent",[$b,Wb]=Bb(Kt),Vb=xm("AlertDialogContent"),ul=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...o}=e,a=it(n),i=h.useRef(null),c=pe(t,i),l=h.useRef(null);return s.jsx(Ip,{contentName:Kt,titleName:dl,docsSlug:"alert-dialog",children:s.jsx($b,{scope:n,cancelRef:l,children:s.jsxs(_o,{role:"alertdialog",...a,...o,ref:c,onOpenAutoFocus:B(o.onOpenAutoFocus,u=>{var f;u.preventDefault(),(f=l.current)==null||f.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[s.jsx(Vb,{children:r}),s.jsx(Xb,{contentRef:i})]})})})});ul.displayName=Kt;var dl="AlertDialogTitle",fl=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=it(n);return s.jsx(So,{...o,...r,ref:t})});fl.displayName=dl;var hl="AlertDialogDescription",ml=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=it(n);return s.jsx(No,{...o,...r,ref:t})});ml.displayName=hl;var qb="AlertDialogAction",pl=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=it(n);return s.jsx(Ro,{...o,...r,ref:t})});pl.displayName=qb;var gl="AlertDialogCancel",bl=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:o}=Wb(gl,n),a=it(n),i=pe(t,o);return s.jsx(Ro,{...a,...r,ref:i})});bl.displayName=gl;var Xb=({contentRef:e})=>{const t=`\`${Kt}\` requires a description for the component to be accessible for screen reader users.
|
|
244
|
+
|
|
245
|
+
You can add a description to the \`${Kt}\` by passing a \`${hl}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
246
|
+
|
|
247
|
+
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 \`${Kt}\`. 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.
|
|
248
|
+
|
|
249
|
+
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return h.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},Yb=il,Kb=cl,vl=ll,yl=ul,xl=pl,wl=bl,El=fl,_l=ml;const Zb=Yb,Qb=Kb,Sl=h.forwardRef(({className:e,...t},n)=>s.jsx(vl,{className:V("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:n}));Sl.displayName=vl.displayName;const Nl=h.forwardRef(({className:e,...t},n)=>s.jsxs(Qb,{children:[s.jsx(Sl,{}),s.jsx(yl,{ref:n,className:V("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})]}));Nl.displayName=yl.displayName;const Rl=({className:e,...t})=>s.jsx("div",{className:V("flex flex-col space-y-2 text-center sm:text-left",e),...t});Rl.displayName="AlertDialogHeader";const Cl=({className:e,...t})=>s.jsx("div",{className:V("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Cl.displayName="AlertDialogFooter";const Tl=h.forwardRef(({className:e,...t},n)=>s.jsx(El,{ref:n,className:V("text-lg font-semibold",e),...t}));Tl.displayName=El.displayName;const jl=h.forwardRef(({className:e,...t},n)=>s.jsx(_l,{ref:n,className:V("text-sm text-muted-foreground",e),...t}));jl.displayName=_l.displayName;const Al=h.forwardRef(({className:e,...t},n)=>s.jsx(xl,{ref:n,className:V(so(),e),...t}));Al.displayName=xl.displayName;const Pl=h.forwardRef(({className:e,...t},n)=>s.jsx(wl,{ref:n,className:V(so({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));Pl.displayName=wl.displayName;function Jb({open:e,onOpenChange:t,title:n,description:r,onConfirm:o,confirmText:a,cancelText:i,variant:c="default"}){const l=J("common");return s.jsx(Zb,{open:e,onOpenChange:t,children:s.jsxs(Nl,{children:[s.jsxs(Rl,{children:[s.jsx(Tl,{children:n}),s.jsx(jl,{children:r})]}),s.jsxs(Cl,{children:[s.jsx(Pl,{children:i??l("cancel")}),s.jsx(Al,{onClick:o,className:c==="destructive"?"bg-destructive text-destructive-foreground hover:bg-destructive/90":void 0,children:a??l(c==="destructive"?"delete":"confirm")})]})]})})}function ev(e){try{return new Date(e).toLocaleString()}catch{return e}}const tv=S.memo(function({ws:t,onDelete:n,onPull:r,isPulling:o,wsSkills:a}){const i=J("aiCli.workspaces"),c=J("common"),l=Object.entries(a).flatMap(([u,f])=>f.map(d=>({...d,target:u})));return s.jsxs(Xt,{children:[s.jsx(dn,{className:"pb-2",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[t.type==="github"?s.jsx(ha,{className:"h-4 w-4 text-muted-foreground"}):s.jsx(Qr,{className:"h-4 w-4 text-muted-foreground"}),s.jsx(fn,{className:"text-sm",children:t.name||t.id.slice(0,8)})]}),s.jsx(Ne,{variant:t.type==="github"?"default":"secondary",children:i(`type.${t.type}`)})]})}),s.jsxs(Yt,{className:"space-y-2",children:[t.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:t.description}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",title:t.path,children:t.path}),t.type==="local"&&t.repoUrl&&s.jsxs("p",{className:"text-xs text-muted-foreground truncate",title:t.repoUrl,children:[s.jsx(fa,{className:"inline h-3 w-3 mr-1"}),t.repoUrl,t.branch&&` (${t.branch})`]}),t.type==="github"&&t.repoUrl&&s.jsx("p",{className:"text-xs text-muted-foreground truncate",title:t.repoUrl,children:t.repoUrl}),t.type==="github"&&t.branch&&s.jsx("p",{className:"text-xs text-muted-foreground",children:i("branch",{branch:t.branch})}),s.jsx("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:s.jsx("span",{children:ev(t.createdAt)})}),l.length>0&&s.jsxs("div",{className:"space-y-1.5 pt-1 border-t",children:[s.jsxs("p",{className:"text-xs font-medium text-muted-foreground pt-1",children:[i("installedSkills")," (",l.length,")"]}),s.jsx("div",{className:"flex flex-wrap gap-1",children:l.map(u=>s.jsxs(Ne,{variant:"outline",className:"text-xs",children:[u.name,s.jsxs("span",{className:"ml-1 text-muted-foreground",children:["(",u.target,")"]})]},`${u.target}-${u.name}`))})]}),s.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[t.type==="github"&&s.jsxs(Y,{variant:"outline",size:"sm",onClick:()=>r(t.id),disabled:o,children:[o?s.jsx(ve,{className:"mr-1 h-3 w-3 animate-spin"}):s.jsx(nh,{className:"mr-1 h-3 w-3"}),i(o?"pulling":"actions.pull")]}),s.jsxs(Y,{variant:"ghost",size:"sm",className:"text-destructive hover:text-destructive",onClick:()=>n(t),children:[s.jsx(eo,{className:"mr-1 h-3 w-3"}),c("delete")]})]})]})]})}),Je=h.forwardRef(({className:e,type:t,...n},r)=>s.jsx("input",{type:t,className:V("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n}));Je.displayName="Input";var Xo="rovingFocusGroup.onEntryFocus",nv={bubbles:!1,cancelable:!0},hn="RovingFocusGroup",[Yo,Ol,rv]=Co(hn),[ov,pr]=We(hn,[rv]),[sv,av]=ov(hn),kl=h.forwardRef((e,t)=>s.jsx(Yo.Provider,{scope:e.__scopeRovingFocusGroup,children:s.jsx(Yo.Slot,{scope:e.__scopeRovingFocusGroup,children:s.jsx(iv,{...e,ref:t})})}));kl.displayName=hn;var iv=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:a,currentTabStopId:i,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:f=!1,...d}=e,m=h.useRef(null),g=pe(t,m),b=Qn(a),[p,v]=Ct({prop:i,defaultProp:c??null,onChange:l,caller:hn}),[x,y]=h.useState(!1),w=qe(u),E=Ol(n),N=h.useRef(!1),[j,R]=h.useState(0);return h.useEffect(()=>{const _=m.current;if(_)return _.addEventListener(Xo,w),()=>_.removeEventListener(Xo,w)},[w]),s.jsx(sv,{scope:n,orientation:r,dir:b,loop:o,currentTabStopId:p,onItemFocus:h.useCallback(_=>v(_),[v]),onItemShiftTab:h.useCallback(()=>y(!0),[]),onFocusableItemAdd:h.useCallback(()=>R(_=>_+1),[]),onFocusableItemRemove:h.useCallback(()=>R(_=>_-1),[]),children:s.jsx(ne.div,{tabIndex:x||j===0?-1:0,"data-orientation":r,...d,ref:g,style:{outline:"none",...e.style},onMouseDown:B(e.onMouseDown,()=>{N.current=!0}),onFocus:B(e.onFocus,_=>{const I=!N.current;if(_.target===_.currentTarget&&I&&!x){const M=new CustomEvent(Xo,nv);if(_.currentTarget.dispatchEvent(M),!M.defaultPrevented){const q=E().filter(F=>F.focusable),U=q.find(F=>F.active),X=q.find(F=>F.id===p),oe=[U,X,...q].filter(Boolean).map(F=>F.ref.current);Ml(oe,f)}}N.current=!1}),onBlur:B(e.onBlur,()=>y(!1))})})}),Dl="RovingFocusGroupItem",Il=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:a,children:i,...c}=e,l=Ve(),u=a||l,f=av(Dl,n),d=f.currentTabStopId===u,m=Ol(n),{onFocusableItemAdd:g,onFocusableItemRemove:b,currentTabStopId:p}=f;return h.useEffect(()=>{if(r)return g(),()=>b()},[r,g,b]),s.jsx(Yo.ItemSlot,{scope:n,id:u,focusable:r,active:o,children:s.jsx(ne.span,{tabIndex:d?0:-1,"data-orientation":f.orientation,...c,ref:t,onMouseDown:B(e.onMouseDown,v=>{r?f.onItemFocus(u):v.preventDefault()}),onFocus:B(e.onFocus,()=>f.onItemFocus(u)),onKeyDown:B(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){f.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const x=uv(v,f.orientation,f.dir);if(x!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let w=m().filter(E=>E.focusable).map(E=>E.ref.current);if(x==="last")w.reverse();else if(x==="prev"||x==="next"){x==="prev"&&w.reverse();const E=w.indexOf(v.currentTarget);w=f.loop?dv(w,E+1):w.slice(E+1)}setTimeout(()=>Ml(w))}}),children:typeof i=="function"?i({isCurrentTabStop:d,hasTabStop:p!=null}):i})})});Il.displayName=Dl;var cv={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function lv(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function uv(e,t,n){const r=lv(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return cv[r]}function Ml(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function dv(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Ll=kl,Hl=Il,gr="Tabs",[fv]=We(gr,[pr]),Bl=pr(),[hv,Ko]=fv(gr),Fl=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:a,orientation:i="horizontal",dir:c,activationMode:l="automatic",...u}=e,f=Qn(c),[d,m]=Ct({prop:r,onChange:o,defaultProp:a??"",caller:gr});return s.jsx(hv,{scope:n,baseId:Ve(),value:d,onValueChange:m,orientation:i,dir:f,activationMode:l,children:s.jsx(ne.div,{dir:f,"data-orientation":i,...u,ref:t})})});Fl.displayName=gr;var Ul="TabsList",Gl=h.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,a=Ko(Ul,n),i=Bl(n);return s.jsx(Ll,{asChild:!0,...i,orientation:a.orientation,dir:a.dir,loop:r,children:s.jsx(ne.div,{role:"tablist","aria-orientation":a.orientation,...o,ref:t})})});Gl.displayName=Ul;var zl="TabsTrigger",$l=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...a}=e,i=Ko(zl,n),c=Bl(n),l=ql(i.baseId,r),u=Xl(i.baseId,r),f=r===i.value;return s.jsx(Hl,{asChild:!0,...c,focusable:!o,active:f,children:s.jsx(ne.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":u,"data-state":f?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l,...a,ref:t,onMouseDown:B(e.onMouseDown,d=>{!o&&d.button===0&&d.ctrlKey===!1?i.onValueChange(r):d.preventDefault()}),onKeyDown:B(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&i.onValueChange(r)}),onFocus:B(e.onFocus,()=>{const d=i.activationMode!=="manual";!f&&!o&&d&&i.onValueChange(r)})})})});$l.displayName=zl;var Wl="TabsContent",Vl=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:a,...i}=e,c=Ko(Wl,n),l=ql(c.baseId,r),u=Xl(c.baseId,r),f=r===c.value,d=h.useRef(f);return h.useEffect(()=>{const m=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(m)},[]),s.jsx(Xe,{present:o||f,children:({present:m})=>s.jsx(ne.div,{"data-state":f?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":l,hidden:!m,id:u,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:m&&a})})});Vl.displayName=Wl;function ql(e,t){return`${e}-trigger-${t}`}function Xl(e,t){return`${e}-content-${t}`}var mv=Fl,Yl=Gl,Kl=$l,Zl=Vl;const Ql=mv,Zo=h.forwardRef(({className:e,...t},n)=>s.jsx(Yl,{ref:n,className:V("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));Zo.displayName=Yl.displayName;const Zt=h.forwardRef(({className:e,...t},n)=>s.jsx(Kl,{ref:n,className:V("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 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",e),...t}));Zt.displayName=Kl.displayName;const pv=h.forwardRef(({className:e,...t},n)=>s.jsx(Zl,{ref:n,className:V("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));pv.displayName=Zl.displayName;function gv({onSelect:e,initialPath:t="/"}){const n=J("aiCli.workspaces.createDialog"),[r,o]=S.useState(t),[a,i]=S.useState([]),[c,l]=S.useState(!1),u=S.useCallback(async d=>{l(!0);try{const m=await Le.browseDir(d);i(m),o(d)}catch{i([])}finally{l(!1)}},[]);S.useEffect(()=>{u(t)},[t,u]);const f=()=>{const d=r.replace(/\/[^/]+\/?$/,"")||"/";u(d)};return s.jsxs("div",{className:"border rounded-md",children:[s.jsxs("div",{className:"flex items-center gap-1 p-2 border-b bg-muted/50",children:[s.jsxs(Y,{variant:"ghost",size:"sm",className:"h-7 px-2",onClick:f,children:[s.jsx(Pn,{className:"h-3 w-3 mr-1"}),n("parentDir")]}),s.jsx("span",{className:"text-xs text-muted-foreground truncate flex-1",title:r,children:r}),s.jsxs(Y,{size:"sm",className:"h-7",onClick:()=>e(r),children:[s.jsx(Kr,{className:"h-3 w-3 mr-1"}),n("selectThisDir")]})]}),s.jsx("div",{className:"max-h-48 overflow-y-auto",children:c?s.jsx("div",{className:"flex items-center justify-center py-6",children:s.jsx(ve,{className:"h-4 w-4 animate-spin text-muted-foreground"})}):a.length===0?s.jsx("div",{className:"flex items-center justify-center py-6",children:s.jsx("p",{className:"text-xs text-muted-foreground",children:n("emptyDir")})}):a.map(d=>s.jsxs("button",{type:"button",className:"flex items-center gap-2 w-full px-3 py-1.5 text-left text-sm hover:bg-accent transition-colors",onClick:()=>u(d.path),children:[s.jsx(Qr,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),s.jsx("span",{className:"truncate",children:d.name})]},d.path))})]})}function bv({localPath:e,onLocalPathChange:t,onDirSelected:n,t:r}){const[o,a]=S.useState(!1),[i,c]=S.useState(null),[l,u]=S.useState(!1),f=async d=>{t(d),a(!1);const m=d.split("/").filter(Boolean).pop()||"";u(!0),c(null);let g=null;try{g=await Le.detectGit(d),c(g)}catch{g=null}finally{u(!1)}n(d,m,g)};return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ce,{children:r("createDialog.localPathLabel")}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Je,{className:"flex-1",placeholder:r("createDialog.localPathPlaceholder"),value:e,onChange:d=>t(d.target.value)}),s.jsxs(Y,{type:"button",variant:"outline",size:"sm",onClick:()=>a(!o),children:[s.jsx(oh,{className:"h-3 w-3 mr-1"}),r("createDialog.browse")]})]}),o&&s.jsx(gv,{initialPath:e||"/",onSelect:f})]}),(l||i)&&s.jsx("div",{className:"flex items-center gap-2 text-xs",children:l?s.jsxs(s.Fragment,{children:[s.jsx(ve,{className:"h-3 w-3 animate-spin text-muted-foreground"}),s.jsx("span",{className:"text-muted-foreground",children:r("createDialog.detecting")})]}):i!=null&&i.isGitRepo?s.jsxs(s.Fragment,{children:[s.jsx(fa,{className:"h-3 w-3 text-green-500"}),s.jsx("span",{className:"text-green-600 dark:text-green-400",children:r("createDialog.gitDetected")}),i.remoteUrl&&s.jsx("span",{className:"text-muted-foreground truncate",title:i.remoteUrl,children:i.remoteUrl}),i.branch&&s.jsx(Ne,{variant:"outline",className:"text-xs",children:i.branch})]}):s.jsx("span",{className:"text-muted-foreground",children:r("createDialog.gitNotDetected")})})]})}function vv({open:e,onOpenChange:t,onCreated:n}){const r=J("aiCli.workspaces"),o=J("common"),[a,i]=S.useState("local"),[c,l]=S.useState(""),[u,f]=S.useState(""),[d,m]=S.useState(""),[g,b]=S.useState(""),[p,v]=S.useState(""),[x,y]=S.useState(null),[w,E]=S.useState(!1),N=()=>{i("local"),l(""),f(""),m(""),b(""),v(""),y(null)},j=(M,q,U)=>{c.trim()||l(q),y(U),U!=null&&U.isGitRepo&&U.remoteUrl&&b(U.remoteUrl),U!=null&&U.isGitRepo&&U.branch&&v(U.branch)},R=async()=>{if(c.trim()){E(!0);try{if(a==="local"){if(!d.trim())return;await Le.createWorkspace({type:"local",name:c.trim(),description:u.trim()||void 0,localPath:d.trim(),repoUrl:(x==null?void 0:x.remoteUrl)||void 0,branch:(x==null?void 0:x.branch)||void 0})}else{if(!g.trim()||!p.trim())return;await Le.createWorkspace({type:"github",name:c.trim(),description:u.trim()||void 0,repoUrl:g.trim(),branch:p.trim()})}t(!1),N(),n()}catch{W.error(r("toast.createFailed"))}finally{E(!1)}}},_=c.trim()!==""&&(a==="local"?d.trim()!=="":g.trim()!==""&&p.trim()!==""),I=M=>{M||N(),t(M)};return s.jsx(jt,{open:e,onOpenChange:I,children:s.jsxs(mt,{className:"sm:max-w-lg",children:[s.jsxs(pt,{children:[s.jsx(bt,{children:r("createDialog.title")}),s.jsx(vt,{children:r("createDialog.description")})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsx(Ql,{value:a,onValueChange:M=>i(M),children:s.jsxs(Zo,{className:"grid w-full grid-cols-2",children:[s.jsxs(Zt,{value:"local",children:[s.jsx(Qr,{className:"mr-1 h-3 w-3"}),r("createDialog.typeLocal")]}),s.jsxs(Zt,{value:"github",children:[s.jsx(ha,{className:"mr-1 h-3 w-3"}),r("createDialog.typeGithub")]})]})}),a==="local"?s.jsx(bv,{localPath:d,onLocalPathChange:m,onDirSelected:j,t:r}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ce,{children:r("createDialog.repoUrlLabel")}),s.jsx(Je,{placeholder:r("createDialog.repoUrlPlaceholder"),value:g,onChange:M=>b(M.target.value)})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ce,{children:r("createDialog.branchLabel")}),s.jsx(Je,{placeholder:r("createDialog.branchPlaceholder"),value:p,onChange:M=>v(M.target.value)})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ce,{children:r("createDialog.nameLabel")}),s.jsx(Je,{placeholder:r("createDialog.namePlaceholder"),value:c,onChange:M=>l(M.target.value)})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ce,{children:r("createDialog.descriptionLabel")}),s.jsx(rt,{placeholder:r("createDialog.descriptionPlaceholder"),value:u,onChange:M=>f(M.target.value),rows:2})]})]}),s.jsxs(gt,{children:[s.jsx(Y,{variant:"outline",onClick:()=>I(!1),children:o("cancel")}),s.jsxs(Y,{onClick:R,disabled:w||!_,children:[w&&s.jsx(ve,{className:"mr-1 h-3 w-3 animate-spin"}),o("create")]})]})]})})}const yv={};function xv(){const e=J("aiCli.workspaces"),t=J("common"),[n,r]=S.useState([]),[o,a]=S.useState(!0),[i,c]=S.useState({}),[l,u]=S.useState(!1),[f,d]=S.useState(null),[m,g]=S.useState(null),b=S.useCallback(async()=>{a(!0);try{const N=await Le.getWorkspaces();r(N);const j=await Promise.all(N.map(async R=>{try{const _=await nt.listWorkspaceInstalled(R.path);return[R.id,_]}catch{return[R.id,{}]}}));c(Object.fromEntries(j))}catch{W.error(e("toast.loadFailed"))}finally{a(!1)}},[e]);S.useEffect(()=>{b()},[b]);const p=async()=>{if(f)try{await Le.deleteWorkspace(f.id),d(null),await b(),W.success(e("toast.deleted"))}catch{W.error(e("toast.deleteFailed"))}},v=async N=>{g(N);try{await Le.pullWorkspace(N),W.success(e("toast.pulled"))}catch{W.error(e("toast.pullFailed"))}finally{g(null)}},x=async()=>{await b(),W.success(e("toast.created"))},y=n.filter(N=>N.type==="local").length,w=n.filter(N=>N.type==="github").length,E=f?`${e("deleteConfirm",{name:f.name||f.id})} ${f.type==="local"?e("deleteConfirmLocal"):e("deleteConfirmGithub")}`:"";return s.jsxs("div",{className:"space-y-6",children:[s.jsx($e,{title:e("title"),description:e("description"),children:s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(Y,{variant:"outline",size:"sm",onClick:()=>u(!0),children:[s.jsx(On,{className:"mr-1 h-4 w-4"}),e("actions.create")]}),s.jsxs(Y,{variant:"outline",onClick:b,disabled:o,children:[o?s.jsx(ve,{className:"mr-2 h-4 w-4 animate-spin"}):s.jsx(et,{className:"mr-2 h-4 w-4"}),t("refresh")]})]})}),o?s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsx("p",{className:"text-muted-foreground",children:t("loading")})}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:s.jsx("span",{children:e("summary",{local:y,github:w})})}),n.length===0?s.jsx("div",{className:"flex items-center justify-center h-32",children:s.jsx("p",{className:"text-muted-foreground",children:e("empty")})}):s.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:n.map(N=>s.jsx(tv,{ws:N,onDelete:d,onPull:v,isPulling:m===N.id,wsSkills:i[N.id]||yv},N.id))})]}),s.jsx(vv,{open:l,onOpenChange:u,onCreated:x}),s.jsx(Jb,{open:!!f,onOpenChange:N=>{N||d(null)},title:t("confirmDelete"),description:E,onConfirm:p,confirmText:t("delete"),variant:"destructive"})]})}var Qo=["Enter"," "],wv=["ArrowDown","PageUp","Home"],Jl=["ArrowUp","PageDown","End"],Ev=[...wv,...Jl],_v={ltr:[...Qo,"ArrowRight"],rtl:[...Qo,"ArrowLeft"]},Sv={ltr:["ArrowLeft"],rtl:["ArrowRight"]},mn="Menu",[pn,Nv,Rv]=Co(mn),[Dt,eu]=We(mn,[Rv,lr,pr]),br=lr(),tu=pr(),[Cv,It]=Dt(mn),[Tv,gn]=Dt(mn),nu=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:a,modal:i=!0}=e,c=br(t),[l,u]=h.useState(null),f=h.useRef(!1),d=qe(a),m=Qn(o);return h.useEffect(()=>{const g=()=>{f.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>f.current=!1;return document.addEventListener("keydown",g,{capture:!0}),()=>{document.removeEventListener("keydown",g,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),s.jsx(hc,{...c,children:s.jsx(Cv,{scope:t,open:n,onOpenChange:d,content:l,onContentChange:u,children:s.jsx(Tv,{scope:t,onClose:h.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:f,dir:m,modal:i,children:r})})})};nu.displayName=mn;var jv="MenuAnchor",Jo=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=br(n);return s.jsx(mc,{...o,...r,ref:t})});Jo.displayName=jv;var es="MenuPortal",[Av,ru]=Dt(es,{forceMount:void 0}),ou=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,a=It(es,t);return s.jsx(Av,{scope:t,forceMount:n,children:s.jsx(Xe,{present:n||a.open,children:s.jsx(Fn,{asChild:!0,container:o,children:r})})})};ou.displayName=es;var Me="MenuContent",[Pv,ts]=Dt(Me),su=h.forwardRef((e,t)=>{const n=ru(Me,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,a=It(Me,e.__scopeMenu),i=gn(Me,e.__scopeMenu);return s.jsx(pn.Provider,{scope:e.__scopeMenu,children:s.jsx(Xe,{present:r||a.open,children:s.jsx(pn.Slot,{scope:e.__scopeMenu,children:i.modal?s.jsx(Ov,{...o,ref:t}):s.jsx(kv,{...o,ref:t})})})})}),Ov=h.forwardRef((e,t)=>{const n=It(Me,e.__scopeMenu),r=h.useRef(null),o=pe(t,r);return h.useEffect(()=>{const a=r.current;if(a)return vo(a)},[]),s.jsx(ns,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:B(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),kv=h.forwardRef((e,t)=>{const n=It(Me,e.__scopeMenu);return s.jsx(ns,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Dv=Ht("MenuContent.ScrollLock"),ns=h.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:c,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:d,onInteractOutside:m,onDismiss:g,disableOutsideScroll:b,...p}=e,v=It(Me,n),x=gn(Me,n),y=br(n),w=tu(n),E=Nv(n),[N,j]=h.useState(null),R=h.useRef(null),_=pe(t,R,v.onContentChange),I=h.useRef(0),M=h.useRef(""),q=h.useRef(0),U=h.useRef(null),X=h.useRef("right"),Q=h.useRef(0),oe=b?qn:h.Fragment,F=b?{as:Dv,allowPinchZoom:!0}:void 0,K=D=>{var k,te;const O=M.current+D,T=E().filter($=>!$.disabled),z=document.activeElement,ie=(k=T.find($=>$.ref.current===z))==null?void 0:k.textValue,se=T.map($=>$.textValue),me=Vv(se,O,ie),ce=(te=T.find($=>$.textValue===me))==null?void 0:te.ref.current;(function $(le){M.current=le,window.clearTimeout(I.current),le!==""&&(I.current=window.setTimeout(()=>$(""),1e3))})(O),ce&&setTimeout(()=>ce.focus())};h.useEffect(()=>()=>window.clearTimeout(I.current),[]),fo();const G=h.useCallback(D=>{var T,z;return X.current===((T=U.current)==null?void 0:T.side)&&Xv(D,(z=U.current)==null?void 0:z.area)},[]);return s.jsx(Pv,{scope:n,searchRef:M,onItemEnter:h.useCallback(D=>{G(D)&&D.preventDefault()},[G]),onItemLeave:h.useCallback(D=>{var O;G(D)||((O=R.current)==null||O.focus(),j(null))},[G]),onTriggerLeave:h.useCallback(D=>{G(D)&&D.preventDefault()},[G]),pointerGraceTimerRef:q,onPointerGraceIntentChange:h.useCallback(D=>{U.current=D},[]),children:s.jsx(oe,{...F,children:s.jsx(Bn,{asChild:!0,trapped:o,onMountAutoFocus:B(a,D=>{var O;D.preventDefault(),(O=R.current)==null||O.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:s.jsx(Hn,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:d,onInteractOutside:m,onDismiss:g,children:s.jsx(Ll,{asChild:!0,...w,dir:x.dir,orientation:"vertical",loop:r,currentTabStopId:N,onCurrentTabStopIdChange:j,onEntryFocus:B(l,D=>{x.isUsingKeyboardRef.current||D.preventDefault()}),preventScrollOnEntryFocus:!0,children:s.jsx(pc,{role:"menu","aria-orientation":"vertical","data-state":Eu(v.open),"data-radix-menu-content":"",dir:x.dir,...y,...p,ref:_,style:{outline:"none",...p.style},onKeyDown:B(p.onKeyDown,D=>{const T=D.target.closest("[data-radix-menu-content]")===D.currentTarget,z=D.ctrlKey||D.altKey||D.metaKey,ie=D.key.length===1;T&&(D.key==="Tab"&&D.preventDefault(),!z&&ie&&K(D.key));const se=R.current;if(D.target!==se||!Ev.includes(D.key))return;D.preventDefault();const ce=E().filter(k=>!k.disabled).map(k=>k.ref.current);Jl.includes(D.key)&&ce.reverse(),$v(ce)}),onBlur:B(e.onBlur,D=>{D.currentTarget.contains(D.target)||(window.clearTimeout(I.current),M.current="")}),onPointerMove:B(e.onPointerMove,vn(D=>{const O=D.target,T=Q.current!==D.clientX;if(D.currentTarget.contains(O)&&T){const z=D.clientX>Q.current?"right":"left";X.current=z,Q.current=D.clientX}}))})})})})})})});su.displayName=Me;var Iv="MenuGroup",rs=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(ne.div,{role:"group",...r,ref:t})});rs.displayName=Iv;var Mv="MenuLabel",au=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(ne.div,{...r,ref:t})});au.displayName=Mv;var vr="MenuItem",iu="menu.itemSelect",yr=h.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,a=h.useRef(null),i=gn(vr,e.__scopeMenu),c=ts(vr,e.__scopeMenu),l=pe(t,a),u=h.useRef(!1),f=()=>{const d=a.current;if(!n&&d){const m=new CustomEvent(iu,{bubbles:!0,cancelable:!0});d.addEventListener(iu,g=>r==null?void 0:r(g),{once:!0}),za(d,m),m.defaultPrevented?u.current=!1:i.onClose()}};return s.jsx(cu,{...o,ref:l,disabled:n,onClick:B(e.onClick,f),onPointerDown:d=>{var m;(m=e.onPointerDown)==null||m.call(e,d),u.current=!0},onPointerUp:B(e.onPointerUp,d=>{var m;u.current||(m=d.currentTarget)==null||m.click()}),onKeyDown:B(e.onKeyDown,d=>{const m=c.searchRef.current!=="";n||m&&d.key===" "||Qo.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});yr.displayName=vr;var cu=h.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...a}=e,i=ts(vr,n),c=tu(n),l=h.useRef(null),u=pe(t,l),[f,d]=h.useState(!1),[m,g]=h.useState("");return h.useEffect(()=>{const b=l.current;b&&g((b.textContent??"").trim())},[a.children]),s.jsx(pn.ItemSlot,{scope:n,disabled:r,textValue:o??m,children:s.jsx(Hl,{asChild:!0,...c,focusable:!r,children:s.jsx(ne.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...a,ref:u,onPointerMove:B(e.onPointerMove,vn(b=>{r?i.onItemLeave(b):(i.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:B(e.onPointerLeave,vn(b=>i.onItemLeave(b))),onFocus:B(e.onFocus,()=>d(!0)),onBlur:B(e.onBlur,()=>d(!1))})})})}),Lv="MenuCheckboxItem",lu=h.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return s.jsx(mu,{scope:e.__scopeMenu,checked:n,children:s.jsx(yr,{role:"menuitemcheckbox","aria-checked":xr(n)?"mixed":n,...o,ref:t,"data-state":ss(n),onSelect:B(o.onSelect,()=>r==null?void 0:r(xr(n)?!0:!n),{checkForDefaultPrevented:!1})})})});lu.displayName=Lv;var uu="MenuRadioGroup",[Hv,Bv]=Dt(uu,{value:void 0,onValueChange:()=>{}}),du=h.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,a=qe(r);return s.jsx(Hv,{scope:e.__scopeMenu,value:n,onValueChange:a,children:s.jsx(rs,{...o,ref:t})})});du.displayName=uu;var fu="MenuRadioItem",hu=h.forwardRef((e,t)=>{const{value:n,...r}=e,o=Bv(fu,e.__scopeMenu),a=n===o.value;return s.jsx(mu,{scope:e.__scopeMenu,checked:a,children:s.jsx(yr,{role:"menuitemradio","aria-checked":a,...r,ref:t,"data-state":ss(a),onSelect:B(r.onSelect,()=>{var i;return(i=o.onValueChange)==null?void 0:i.call(o,n)},{checkForDefaultPrevented:!1})})})});hu.displayName=fu;var os="MenuItemIndicator",[mu,Fv]=Dt(os,{checked:!1}),pu=h.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,a=Fv(os,n);return s.jsx(Xe,{present:r||xr(a.checked)||a.checked===!0,children:s.jsx(ne.span,{...o,ref:t,"data-state":ss(a.checked)})})});pu.displayName=os;var Uv="MenuSeparator",gu=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(ne.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});gu.displayName=Uv;var Gv="MenuArrow",bu=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=br(n);return s.jsx(gc,{...o,...r,ref:t})});bu.displayName=Gv;var zv="MenuSub",[Rw,vu]=Dt(zv),bn="MenuSubTrigger",yu=h.forwardRef((e,t)=>{const n=It(bn,e.__scopeMenu),r=gn(bn,e.__scopeMenu),o=vu(bn,e.__scopeMenu),a=ts(bn,e.__scopeMenu),i=h.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:l}=a,u={__scopeMenu:e.__scopeMenu},f=h.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return h.useEffect(()=>f,[f]),h.useEffect(()=>{const d=c.current;return()=>{window.clearTimeout(d),l(null)}},[c,l]),s.jsx(Jo,{asChild:!0,...u,children:s.jsx(cu,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":Eu(n.open),...e,ref:sn(t,o.onTriggerChange),onClick:d=>{var m;(m=e.onClick)==null||m.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:B(e.onPointerMove,vn(d=>{a.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(a.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:B(e.onPointerLeave,vn(d=>{var g,b;f();const m=(g=n.content)==null?void 0:g.getBoundingClientRect();if(m){const p=(b=n.content)==null?void 0:b.dataset.side,v=p==="right",x=v?-5:5,y=m[v?"left":"right"],w=m[v?"right":"left"];a.onPointerGraceIntentChange({area:[{x:d.clientX+x,y:d.clientY},{x:y,y:m.top},{x:w,y:m.top},{x:w,y:m.bottom},{x:y,y:m.bottom}],side:p}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(d),d.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:B(e.onKeyDown,d=>{var g;const m=a.searchRef.current!=="";e.disabled||m&&d.key===" "||_v[r.dir].includes(d.key)&&(n.onOpenChange(!0),(g=n.content)==null||g.focus(),d.preventDefault())})})})});yu.displayName=bn;var xu="MenuSubContent",wu=h.forwardRef((e,t)=>{const n=ru(Me,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,a=It(Me,e.__scopeMenu),i=gn(Me,e.__scopeMenu),c=vu(xu,e.__scopeMenu),l=h.useRef(null),u=pe(t,l);return s.jsx(pn.Provider,{scope:e.__scopeMenu,children:s.jsx(Xe,{present:r||a.open,children:s.jsx(pn.Slot,{scope:e.__scopeMenu,children:s.jsx(ns,{id:c.contentId,"aria-labelledby":c.triggerId,...o,ref:u,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{var d;i.isUsingKeyboardRef.current&&((d=l.current)==null||d.focus()),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:B(e.onFocusOutside,f=>{f.target!==c.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:B(e.onEscapeKeyDown,f=>{i.onClose(),f.preventDefault()}),onKeyDown:B(e.onKeyDown,f=>{var g;const d=f.currentTarget.contains(f.target),m=Sv[i.dir].includes(f.key);d&&m&&(a.onOpenChange(!1),(g=c.trigger)==null||g.focus(),f.preventDefault())})})})})})});wu.displayName=xu;function Eu(e){return e?"open":"closed"}function xr(e){return e==="indeterminate"}function ss(e){return xr(e)?"indeterminate":e?"checked":"unchecked"}function $v(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Wv(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Vv(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let i=Wv(e,Math.max(a,0));o.length===1&&(i=i.filter(u=>u!==n));const l=i.find(u=>u.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function qv(e,t){const{x:n,y:r}=e;let o=!1;for(let a=0,i=t.length-1;a<t.length;i=a++){const c=t[a],l=t[i],u=c.x,f=c.y,d=l.x,m=l.y;f>r!=m>r&&n<(d-u)*(r-f)/(m-f)+u&&(o=!o)}return o}function Xv(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return qv(n,t)}function vn(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Yv=nu,Kv=Jo,Zv=ou,Qv=su,Jv=rs,ey=au,ty=yr,ny=lu,ry=du,oy=hu,sy=pu,ay=gu,iy=bu,cy=yu,ly=wu,wr="DropdownMenu",[uy]=We(wr,[eu]),Ae=eu(),[dy,_u]=uy(wr),Su=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:a,onOpenChange:i,modal:c=!0}=e,l=Ae(t),u=h.useRef(null),[f,d]=Ct({prop:o,defaultProp:a??!1,onChange:i,caller:wr});return s.jsx(dy,{scope:t,triggerId:Ve(),triggerRef:u,contentId:Ve(),open:f,onOpenChange:d,onOpenToggle:h.useCallback(()=>d(m=>!m),[d]),modal:c,children:s.jsx(Yv,{...l,open:f,onOpenChange:d,dir:r,modal:c,children:n})})};Su.displayName=wr;var Nu="DropdownMenuTrigger",Ru=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,a=_u(Nu,n),i=Ae(n);return s.jsx(Kv,{asChild:!0,...i,children:s.jsx(ne.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:sn(t,a.triggerRef),onPointerDown:B(e.onPointerDown,c=>{!r&&c.button===0&&c.ctrlKey===!1&&(a.onOpenToggle(),a.open||c.preventDefault())}),onKeyDown:B(e.onKeyDown,c=>{r||(["Enter"," "].includes(c.key)&&a.onOpenToggle(),c.key==="ArrowDown"&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(c.key)&&c.preventDefault())})})})});Ru.displayName=Nu;var fy="DropdownMenuPortal",Cu=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Ae(t);return s.jsx(Zv,{...r,...n})};Cu.displayName=fy;var Tu="DropdownMenuContent",ju=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=_u(Tu,n),a=Ae(n),i=h.useRef(!1);return s.jsx(Qv,{id:o.contentId,"aria-labelledby":o.triggerId,...a,...r,ref:t,onCloseAutoFocus:B(e.onCloseAutoFocus,c=>{var l;i.current||(l=o.triggerRef.current)==null||l.focus(),i.current=!1,c.preventDefault()}),onInteractOutside:B(e.onInteractOutside,c=>{const l=c.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,f=l.button===2||u;(!o.modal||f)&&(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)"}})});ju.displayName=Tu;var hy="DropdownMenuGroup",my=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ae(n);return s.jsx(Jv,{...o,...r,ref:t})});my.displayName=hy;var py="DropdownMenuLabel",Au=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ae(n);return s.jsx(ey,{...o,...r,ref:t})});Au.displayName=py;var gy="DropdownMenuItem",Pu=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ae(n);return s.jsx(ty,{...o,...r,ref:t})});Pu.displayName=gy;var by="DropdownMenuCheckboxItem",vy=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ae(n);return s.jsx(ny,{...o,...r,ref:t})});vy.displayName=by;var yy="DropdownMenuRadioGroup",xy=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ae(n);return s.jsx(ry,{...o,...r,ref:t})});xy.displayName=yy;var wy="DropdownMenuRadioItem",Ey=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ae(n);return s.jsx(oy,{...o,...r,ref:t})});Ey.displayName=wy;var _y="DropdownMenuItemIndicator",Sy=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ae(n);return s.jsx(sy,{...o,...r,ref:t})});Sy.displayName=_y;var Ny="DropdownMenuSeparator",Ou=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ae(n);return s.jsx(ay,{...o,...r,ref:t})});Ou.displayName=Ny;var Ry="DropdownMenuArrow",Cy=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ae(n);return s.jsx(iy,{...o,...r,ref:t})});Cy.displayName=Ry;var Ty="DropdownMenuSubTrigger",jy=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ae(n);return s.jsx(cy,{...o,...r,ref:t})});jy.displayName=Ty;var Ay="DropdownMenuSubContent",Py=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ae(n);return s.jsx(ly,{...o,...r,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)"}})});Py.displayName=Ay;var Oy=Su,ky=Ru,Dy=Cu,ku=ju,Du=Au,Iu=Pu,Mu=Ou;const Iy=Oy,My=ky,Lu=h.forwardRef(({className:e,sideOffset:t=4,...n},r)=>s.jsx(Dy,{children:s.jsx(ku,{ref:r,sideOffset:t,className:V("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),...n})}));Lu.displayName=ku.displayName;const Er=h.forwardRef(({className:e,inset:t,...n},r)=>s.jsx(Iu,{ref:r,className:V("relative flex cursor-default select-none items-center gap-2 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 [&>svg]:size-4 [&>svg]:shrink-0",t&&"pl-8",e),...n}));Er.displayName=Iu.displayName;const Ly=h.forwardRef(({className:e,inset:t,...n},r)=>s.jsx(Du,{ref:r,className:V("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));Ly.displayName=Du.displayName;const Hu=h.forwardRef(({className:e,...t},n)=>s.jsx(Mu,{ref:n,className:V("-mx-1 my-1 h-px bg-muted",e),...t}));Hu.displayName=Mu.displayName;function Hy({skill:e,targets:t,onInstall:n,onEdit:r,onToggle:o,onDelete:a}){const i=J("aiSkills"),c=e.installedTargets??[];return s.jsxs(Xt,{className:"flex flex-col",children:[s.jsxs(dn,{className:"flex-row items-start justify-between space-y-0 pb-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(fn,{className:"text-base font-semibold",children:e.name}),s.jsx(mr,{className:"line-clamp-2 text-sm",children:e.description})]}),s.jsxs(Iy,{children:[s.jsx(My,{asChild:!0,children:s.jsx(Y,{variant:"ghost",size:"icon",className:"h-8 w-8",children:s.jsx(th,{className:"h-4 w-4"})})}),s.jsxs(Lu,{align:"end",children:[s.jsxs(Er,{onClick:r,children:[s.jsx(sh,{className:"mr-2 h-4 w-4"}),i("actions.edit")]}),s.jsxs(Er,{onClick:o,children:[e.isEnabled?s.jsx(lh,{className:"mr-2 h-4 w-4"}):s.jsx(uh,{className:"mr-2 h-4 w-4"}),e.isEnabled?i("actions.disable"):i("actions.enable")]}),s.jsx(Hu,{}),s.jsxs(Er,{onClick:a,className:"text-destructive",children:[s.jsx(eo,{className:"mr-2 h-4 w-4"}),i("actions.delete")]})]})]})]}),s.jsxs(Yt,{className:"flex flex-1 flex-col justify-between gap-3",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[s.jsx(Ne,{variant:e.isEnabled?"default":"secondary",className:"text-xs",children:e.isEnabled?i("status.enabled"):i("status.disabled")}),s.jsxs("span",{children:[i("meta.source"),": ",e.sourceModule]}),s.jsxs("span",{children:["v",e.version]}),e.isEdited&&s.jsx(Ne,{variant:"outline",className:"text-xs",children:i("meta.edited")})]}),s.jsx("div",{className:"flex flex-wrap items-center gap-1.5",children:t.filter(l=>l.isInstalled).map(l=>{const u=c.includes(l.id);return s.jsxs(Ne,{variant:u?"default":"outline",className:"text-xs",children:[u&&s.jsx(Zr,{className:"mr-1 h-3 w-3"}),l.name]},l.id)})}),s.jsxs(Y,{variant:"outline",size:"sm",className:"w-full",onClick:n,disabled:!e.isEnabled,children:[s.jsx(eh,{className:"mr-2 h-4 w-4"}),i("actions.install")]})]})]})}const By=S.memo(Hy);var _r="Checkbox",[Fy]=We(_r),[Uy,as]=Fy(_r);function Gy(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:o,disabled:a,form:i,name:c,onCheckedChange:l,required:u,value:f="on",internal_do_not_use_render:d}=e,[m,g]=Ct({prop:n,defaultProp:o??!1,onChange:l,caller:_r}),[b,p]=h.useState(null),[v,x]=h.useState(null),y=h.useRef(!1),w=b?!!i||!!b.closest("form"):!0,E={checked:m,disabled:a,setChecked:g,control:b,setControl:p,name:c,form:i,value:f,hasConsumerStoppedPropagationRef:y,required:u,defaultChecked:_t(o)?!1:o,isFormControl:w,bubbleInput:v,setBubbleInput:x};return s.jsx(Uy,{scope:t,...E,children:zy(d)?d(E):r})}var Bu="CheckboxTrigger",Fu=h.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},o)=>{const{control:a,value:i,disabled:c,checked:l,required:u,setControl:f,setChecked:d,hasConsumerStoppedPropagationRef:m,isFormControl:g,bubbleInput:b}=as(Bu,e),p=pe(o,f),v=h.useRef(l);return h.useEffect(()=>{const x=a==null?void 0:a.form;if(x){const y=()=>d(v.current);return x.addEventListener("reset",y),()=>x.removeEventListener("reset",y)}},[a,d]),s.jsx(ne.button,{type:"button",role:"checkbox","aria-checked":_t(l)?"mixed":l,"aria-required":u,"data-state":Wu(l),"data-disabled":c?"":void 0,disabled:c,value:i,...r,ref:p,onKeyDown:B(t,x=>{x.key==="Enter"&&x.preventDefault()}),onClick:B(n,x=>{d(y=>_t(y)?!0:!y),b&&g&&(m.current=x.isPropagationStopped(),m.current||x.stopPropagation())})})});Fu.displayName=Bu;var is=h.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:a,required:i,disabled:c,value:l,onCheckedChange:u,form:f,...d}=e;return s.jsx(Gy,{__scopeCheckbox:n,checked:o,defaultChecked:a,disabled:c,required:i,onCheckedChange:u,name:r,form:f,value:l,internal_do_not_use_render:({isFormControl:m})=>s.jsxs(s.Fragment,{children:[s.jsx(Fu,{...d,ref:t,__scopeCheckbox:n}),m&&s.jsx($u,{__scopeCheckbox:n})]})})});is.displayName=_r;var Uu="CheckboxIndicator",Gu=h.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,a=as(Uu,n);return s.jsx(Xe,{present:r||_t(a.checked)||a.checked===!0,children:s.jsx(ne.span,{"data-state":Wu(a.checked),"data-disabled":a.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});Gu.displayName=Uu;var zu="CheckboxBubbleInput",$u=h.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:o,checked:a,defaultChecked:i,required:c,disabled:l,name:u,value:f,form:d,bubbleInput:m,setBubbleInput:g}=as(zu,e),b=pe(n,g),p=bc(a),v=rc(r);h.useEffect(()=>{const y=m;if(!y)return;const w=window.HTMLInputElement.prototype,N=Object.getOwnPropertyDescriptor(w,"checked").set,j=!o.current;if(p!==a&&N){const R=new Event("click",{bubbles:j});y.indeterminate=_t(a),N.call(y,_t(a)?!1:a),y.dispatchEvent(R)}},[m,p,a,o]);const x=h.useRef(_t(a)?!1:a);return s.jsx(ne.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??x.current,required:c,disabled:l,name:u,value:f,form:d,...t,tabIndex:-1,ref:b,style:{...t.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});$u.displayName=zu;function zy(e){return typeof e=="function"}function _t(e){return e==="indeterminate"}function Wu(e){return _t(e)?"indeterminate":e?"checked":"unchecked"}const Vu=h.forwardRef(({className:e,...t},n)=>s.jsx(is,{ref:n,className:V("peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:s.jsx(Gu,{className:V("flex items-center justify-center text-current"),children:s.jsx(Kr,{className:"h-4 w-4"})})}));Vu.displayName=is.displayName;function $y({skill:e,targets:t,open:n,onOpenChange:r,onDone:o}){const a=J("aiSkills"),i=J("common"),c=t.filter(b=>b.isInstalled),[l,u]=S.useState(e.installedTargets??[]),[f,d]=S.useState(!1),m=S.useCallback(b=>{u(p=>p.includes(b)?p.filter(v=>v!==b):[...p,b])},[]),g=S.useCallback(async()=>{if(l.length!==0){d(!0);try{const b=await nt.install(e.id,l);b.failed.length>0?W.error(a("toast.installPartial",{failed:b.failed.map(p=>p.target).join(", ")})):W.success(a("toast.installed",{targets:l.join(", ")})),b.apiKeyCreated&&W.success(a("toast.apiKeyCreated")),o()}catch{W.error(a("toast.installFailed"))}finally{d(!1)}}},[e.id,l,a,o]);return s.jsx(jt,{open:n,onOpenChange:r,children:s.jsxs(mt,{className:"sm:max-w-md",children:[s.jsxs(pt,{children:[s.jsx(bt,{children:a("installDialog.title")}),s.jsx(vt,{children:a("installDialog.description",{name:e.name})})]}),s.jsx("div",{className:"space-y-3 py-4",children:c.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:a("installDialog.noTargets")}):c.map(b=>{const p=(e.installedTargets??[]).includes(b.id);return s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(Vu,{id:`target-${b.id}`,checked:l.includes(b.id),onCheckedChange:()=>m(b.id)}),s.jsxs(Ce,{htmlFor:`target-${b.id}`,className:"flex items-center gap-2 text-sm",children:[b.name,p&&s.jsx(Zr,{className:"h-3.5 w-3.5 text-green-500"})]})]},b.id)})}),s.jsx("p",{className:"text-xs text-muted-foreground",children:a("installDialog.apiKeyNote")}),s.jsxs(gt,{children:[s.jsx(Y,{variant:"outline",onClick:()=>r(!1),children:i("cancel")}),s.jsxs(Y,{onClick:g,disabled:f||l.length===0,children:[f&&s.jsx(ve,{className:"mr-2 h-4 w-4 animate-spin"}),a("actions.install")]})]})]})})}function Wy({skill:e,open:t,onOpenChange:n,onSave:r}){const o=J("aiSkills"),a=J("common"),[i,c]=S.useState(e.content),[l,u]=S.useState(!1),f=async()=>{u(!0);try{await r(e.id,i)}finally{u(!1)}};return s.jsx(jt,{open:t,onOpenChange:n,children:s.jsxs(mt,{className:"sm:max-w-3xl max-h-[80vh]",children:[s.jsxs(pt,{children:[s.jsx(bt,{children:o("editor.title",{name:e.name})}),s.jsx(vt,{children:o("editor.description")})]}),s.jsx(rt,{value:i,onChange:d=>c(d.target.value),className:"min-h-[400px] font-mono text-sm",placeholder:"SKILL.md content..."}),s.jsxs(gt,{children:[s.jsx(Y,{variant:"outline",onClick:()=>n(!1),children:a("cancel")}),s.jsxs(Y,{onClick:f,disabled:l,children:[l&&s.jsx(ve,{className:"mr-2 h-4 w-4 animate-spin"}),a("save")]})]})]})})}function Vy(){const e=J("aiSkills"),t=J("common"),[n,r]=S.useState([]),[o,a]=S.useState([]),[i,c]=S.useState(!0),[l,u]=S.useState(!1),[f,d]=S.useState("all"),[m,g]=S.useState(null),[b,p]=S.useState(null),v=S.useCallback(async()=>{c(!0);try{const[R,_]=await Promise.all([nt.list(),nt.getTargets()]);r(R),a(_)}catch{W.error(e("toast.loadFailed"))}finally{c(!1)}},[e]);S.useEffect(()=>{v()},[v]);const x=S.useCallback(async()=>{u(!0);try{const R=await nt.generate();W.success(e("toast.generateDone",{created:R.created.length,updated:R.updated.length})),await v()}catch{W.error(e("toast.generateFailed"))}finally{u(!1)}},[e,v]),y=S.useCallback(async R=>{try{await nt.toggle(R),await v()}catch{W.error(e("toast.toggleFailed"))}},[e,v]),w=S.useCallback(async R=>{try{await nt.deleteSkill(R),W.success(e("toast.deleted")),await v()}catch{W.error(e("toast.deleteFailed"))}},[e,v]),E=S.useCallback(()=>{g(null),v()},[v]),N=S.useCallback(async(R,_)=>{try{await nt.update(R,{content:_}),W.success(e("toast.saved")),p(null),await v()}catch{W.error(e("toast.saveFailed"))}},[e,v]),j=n.filter(R=>f==="enabled"?R.isEnabled:f==="installed"?R.installedTargets.length>0:!0);return s.jsxs("div",{className:"space-y-6",children:[s.jsxs($e,{title:e("title"),description:e("description"),children:[s.jsxs(Y,{variant:"outline",size:"sm",onClick:x,disabled:l,children:[l?s.jsx(ve,{className:"mr-2 h-4 w-4 animate-spin"}):s.jsx(Jr,{className:"mr-2 h-4 w-4"}),e("actions.generate")]}),s.jsxs(Y,{variant:"outline",size:"sm",onClick:v,disabled:i,children:[s.jsx(et,{className:"mr-2 h-4 w-4"}),t("refresh")]})]}),s.jsx(Ql,{value:f,onValueChange:R=>d(R),children:s.jsxs(Zo,{children:[s.jsx(Zt,{value:"all",children:e("tabs.all")}),s.jsx(Zt,{value:"enabled",children:e("tabs.enabled")}),s.jsx(Zt,{value:"installed",children:e("tabs.installed")})]})}),i?s.jsx("div",{className:"flex items-center justify-center py-12",children:s.jsx(ve,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):j.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-muted-foreground",children:[s.jsx(Jr,{className:"mb-2 h-8 w-8"}),s.jsx("p",{children:e("empty")}),s.jsxs(Y,{variant:"outline",size:"sm",className:"mt-4",onClick:x,children:[s.jsx(On,{className:"mr-2 h-4 w-4"}),e("actions.generate")]})]}):s.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:j.map(R=>s.jsx(By,{skill:R,targets:o,onInstall:()=>g(R),onEdit:()=>p(R),onToggle:()=>y(R.id),onDelete:()=>w(R.id)},R.id))}),m&&s.jsx($y,{skill:m,targets:o,open:!!m,onOpenChange:R=>{R||g(null)},onDone:E}),b&&s.jsx(Wy,{skill:b,open:!!b,onOpenChange:R=>{R||p(null)},onSave:N})]})}function qy(){const e=J("aiSkills");return s.jsxs("div",{className:"space-y-6",children:[s.jsx($e,{title:e("market.title"),description:e("market.description")}),s.jsx(Xt,{children:s.jsxs(Yt,{className:"flex flex-col items-center justify-center py-16 gap-4 text-muted-foreground",children:[s.jsx(ih,{className:"h-12 w-12 opacity-40"}),s.jsx("p",{className:"text-sm",children:e("market.comingSoon")})]})})]})}var Sr={exports:{}},cs={},qu;function Xu(){if(qu)return cs;qu=1;function e(n){if(typeof WeakMap!="function")return null;var r=new WeakMap,o=new WeakMap;return(e=function(a){return a?o:r})(n)}function t(n,r){if(!r&&n&&n.__esModule)return n;if(n===null||typeof n!="object"&&typeof n!="function")return{default:n};var o=e(r);if(o&&o.has(n))return o.get(n);var a={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var c in n)if(c!=="default"&&Object.prototype.hasOwnProperty.call(n,c)){var l=i?Object.getOwnPropertyDescriptor(n,c):null;l&&(l.get||l.set)?Object.defineProperty(a,c,l):a[c]=n[c]}return a.default=n,o&&o.set(n,a),a}return cs._=t,cs}var ls={},us={},Yu;function Xy(){if(Yu)return us;Yu=1;function e(t){return t&&t.__esModule?t:{default:t}}return us._=e,us}var Ku;function Yy(){return Ku||(Ku=1,(function(e){"use client";Object.defineProperty(e,"__esModule",{value:!0});function t(u,f){for(var d in f)Object.defineProperty(u,d,{enumerable:!0,get:f[d]})}t(e,{AppRouterContext:function(){return o},GlobalLayoutRouterContext:function(){return i},LayoutRouterContext:function(){return a},MissingSlotContext:function(){return l},TemplateContext:function(){return c}});const r=Xy()._(S),o=r.default.createContext(null),a=r.default.createContext(null),i=r.default.createContext(null),c=r.default.createContext(null);process.env.NODE_ENV!=="production"&&(o.displayName="AppRouterContext",a.displayName="LayoutRouterContext",i.displayName="GlobalLayoutRouterContext",c.displayName="TemplateContext");const l=r.default.createContext(new Set)})(ls)),ls}var ds={},Nr={exports:{}},Zu;function Qu(){return Zu||(Zu=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ReadonlyURLSearchParams",{enumerable:!0,get:function(){return r}});class n extends Error{constructor(){super("Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams")}}class r extends URLSearchParams{append(){throw new n}delete(){throw new n}set(){throw new n}sort(){throw new n}}(typeof t.default=="function"||typeof t.default=="object"&&t.default!==null)&&typeof t.default.__esModule>"u"&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)})(Nr,Nr.exports)),Nr.exports}var Ju;function Ky(){return Ju||(Ju=1,(function(e){"use client";Object.defineProperty(e,"__esModule",{value:!0});function t(u,f){for(var d in f)Object.defineProperty(u,d,{enumerable:!0,get:f[d]})}t(e,{NavigationPromisesContext:function(){return c},PathParamsContext:function(){return i},PathnameContext:function(){return a},ReadonlyURLSearchParams:function(){return r.ReadonlyURLSearchParams},SearchParamsContext:function(){return o},createDevToolsInstrumentedPromise:function(){return l}});const n=S,r=Qu(),o=(0,n.createContext)(null),a=(0,n.createContext)(null),i=(0,n.createContext)(null),c=(0,n.createContext)(null);function l(u,f){const d=Promise.resolve(f);return d.status="fulfilled",d.value=f,d.displayName=`${u} (SSR)`,d}process.env.NODE_ENV!=="production"&&(o.displayName="SearchParamsContext",a.displayName="PathnameContext",i.displayName="PathParamsContext",c.displayName="NavigationPromisesContext")})(ds)),ds}var fs={},ed;function Zy(){return ed||(ed=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(d,m){for(var g in m)Object.defineProperty(d,g,{enumerable:!0,get:m[g]})}t(e,{DEFAULT_SEGMENT_KEY:function(){return u},NOT_FOUND_SEGMENT_KEY:function(){return f},PAGE_SEGMENT_KEY:function(){return l},addSearchParamsIfPageSegment:function(){return a},computeSelectedLayoutSegment:function(){return i},getSegmentValue:function(){return n},getSelectedLayoutSegmentPath:function(){return c},isGroupSegment:function(){return r},isParallelRouteSegment:function(){return o}});function n(d){return Array.isArray(d)?d[1]:d}function r(d){return d[0]==="("&&d.endsWith(")")}function o(d){return d.startsWith("@")&&d!=="@children"}function a(d,m){if(d.includes(l)){const b=JSON.stringify(m);return b!=="{}"?l+"?"+b:l}return d}function i(d,m){if(!d||d.length===0)return null;const g=m==="children"?d[0]:d[d.length-1];return g===u?null:g}function c(d,m,g=!0,b=[]){let p;if(g)p=d[1][m];else{const y=d[1];p=y.children??Object.values(y)[0]}if(!p)return b;const v=p[0];let x=n(v);return!x||x.startsWith(l)?b:(b.push(x),c(p,m,!1,b))}const l="__PAGE__",u="__DEFAULT__",f="/_not-found"})(fs)),fs}var hs={},td;function Qy(){return td||(td=1,(function(e){"use client";Object.defineProperty(e,"__esModule",{value:!0});function t(i,c){for(var l in c)Object.defineProperty(i,l,{enumerable:!0,get:c[l]})}t(e,{ServerInsertedHTMLContext:function(){return o},useServerInsertedHTML:function(){return a}});const r=Xu()._(S),o=r.default.createContext(null);function a(i){const c=(0,r.useContext)(o);c&&c(i)}})(hs)),hs}var Rr={exports:{}},nd;function Jy(){return nd||(nd=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});function n(a,i){for(var c in i)Object.defineProperty(a,c,{enumerable:!0,get:i[c]})}n(t,{UnrecognizedActionError:function(){return r},unstable_isUnrecognizedActionError:function(){return o}});class r extends Error{constructor(...i){super(...i),this.name="UnrecognizedActionError"}}function o(a){return!!(a&&typeof a=="object"&&a instanceof r)}(typeof t.default=="function"||typeof t.default=="object"&&t.default!==null)&&typeof t.default.__esModule>"u"&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)})(Rr,Rr.exports)),Rr.exports}var Cr={exports:{}},Tr={exports:{}},jr={exports:{}},rd;function od(){return rd||(rd=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"RedirectStatusCode",{enumerable:!0,get:function(){return n}});var n=(function(r){return r[r.SeeOther=303]="SeeOther",r[r.TemporaryRedirect=307]="TemporaryRedirect",r[r.PermanentRedirect=308]="PermanentRedirect",r})({});(typeof t.default=="function"||typeof t.default=="object"&&t.default!==null)&&typeof t.default.__esModule>"u"&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)})(jr,jr.exports)),jr.exports}var Ar={exports:{}},sd;function ms(){return sd||(sd=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});function n(c,l){for(var u in l)Object.defineProperty(c,u,{enumerable:!0,get:l[u]})}n(t,{REDIRECT_ERROR_CODE:function(){return o},RedirectType:function(){return a},isRedirectError:function(){return i}});const r=od(),o="NEXT_REDIRECT";var a=(function(c){return c.push="push",c.replace="replace",c})({});function i(c){if(typeof c!="object"||c===null||!("digest"in c)||typeof c.digest!="string")return!1;const l=c.digest.split(";"),[u,f]=l,d=l.slice(2,-2).join(";"),m=l.at(-2),g=Number(m);return u===o&&(f==="replace"||f==="push")&&typeof d=="string"&&!isNaN(g)&&g in r.RedirectStatusCode}(typeof t.default=="function"||typeof t.default=="object"&&t.default!==null)&&typeof t.default.__esModule>"u"&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)})(Ar,Ar.exports)),Ar.exports}var ps={},gs={},bs={},ad;function vs(){return ad||(ad=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(l,u){for(var f in u)Object.defineProperty(l,f,{enumerable:!0,get:u[f]})}t(e,{bindSnapshot:function(){return i},createAsyncLocalStorage:function(){return a},createSnapshot:function(){return c}});const n=Object.defineProperty(new Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"),"__NEXT_ERROR_CODE",{value:"E504",enumerable:!1,configurable:!0});class r{disable(){throw n}getStore(){}run(){throw n}exit(){throw n}enterWith(){throw n}static bind(u){return u}}const o=typeof globalThis<"u"&&globalThis.AsyncLocalStorage;function a(){return o?new o:new r}function i(l){return o?o.bind(l):r.bind(l)}function c(){return o?o.snapshot():function(l,...u){return l(...u)}}})(bs)),bs}var id;function ex(){return id||(id=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"actionAsyncStorageInstance",{enumerable:!0,get:function(){return n}});const n=(0,vs().createAsyncLocalStorage)()})(gs)),gs}var cd;function tx(){return cd||(cd=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"actionAsyncStorage",{enumerable:!0,get:function(){return t.actionAsyncStorageInstance}});const t=ex()})(ps)),ps}var ld;function nx(){return ld||(ld=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});function n(m,g){for(var b in g)Object.defineProperty(m,b,{enumerable:!0,get:g[b]})}n(t,{getRedirectError:function(){return i},getRedirectStatusCodeFromError:function(){return d},getRedirectTypeFromError:function(){return f},getURLFromRedirectError:function(){return u},permanentRedirect:function(){return l},redirect:function(){return c}});const r=od(),o=ms(),a=typeof window>"u"?tx().actionAsyncStorage:void 0;function i(m,g,b=r.RedirectStatusCode.TemporaryRedirect){const p=Object.defineProperty(new Error(o.REDIRECT_ERROR_CODE),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return p.digest=`${o.REDIRECT_ERROR_CODE};${g};${m};${b};`,p}function c(m,g){var b;throw g??(g=(b=a==null?void 0:a.getStore())!=null&&b.isAction?o.RedirectType.push:o.RedirectType.replace),i(m,g,r.RedirectStatusCode.TemporaryRedirect)}function l(m,g=o.RedirectType.replace){throw i(m,g,r.RedirectStatusCode.PermanentRedirect)}function u(m){return(0,o.isRedirectError)(m)?m.digest.split(";").slice(2,-2).join(";"):null}function f(m){if(!(0,o.isRedirectError)(m))throw Object.defineProperty(new Error("Not a redirect error"),"__NEXT_ERROR_CODE",{value:"E260",enumerable:!1,configurable:!0});return m.digest.split(";",2)[1]}function d(m){if(!(0,o.isRedirectError)(m))throw Object.defineProperty(new Error("Not a redirect error"),"__NEXT_ERROR_CODE",{value:"E260",enumerable:!1,configurable:!0});return Number(m.digest.split(";").at(-2))}(typeof t.default=="function"||typeof t.default=="object"&&t.default!==null)&&typeof t.default.__esModule>"u"&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)})(Tr,Tr.exports)),Tr.exports}var Pr={exports:{}},Or={exports:{}},ud;function kr(){return ud||(ud=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});function n(u,f){for(var d in f)Object.defineProperty(u,d,{enumerable:!0,get:f[d]})}n(t,{HTTPAccessErrorStatus:function(){return r},HTTP_ERROR_FALLBACK_ERROR_CODE:function(){return a},getAccessFallbackErrorTypeByStatus:function(){return l},getAccessFallbackHTTPStatus:function(){return c},isHTTPAccessFallbackError:function(){return i}});const r={NOT_FOUND:404,FORBIDDEN:403,UNAUTHORIZED:401},o=new Set(Object.values(r)),a="NEXT_HTTP_ERROR_FALLBACK";function i(u){if(typeof u!="object"||u===null||!("digest"in u)||typeof u.digest!="string")return!1;const[f,d]=u.digest.split(";");return f===a&&o.has(Number(d))}function c(u){const f=u.digest.split(";")[1];return Number(f)}function l(u){switch(u){case 401:return"unauthorized";case 403:return"forbidden";case 404:return"not-found";default:return}}(typeof t.default=="function"||typeof t.default=="object"&&t.default!==null)&&typeof t.default.__esModule>"u"&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)})(Or,Or.exports)),Or.exports}var dd;function rx(){return dd||(dd=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"notFound",{enumerable:!0,get:function(){return o}});const r=`${kr().HTTP_ERROR_FALLBACK_ERROR_CODE};404`;function o(){const a=Object.defineProperty(new Error(r),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});throw a.digest=r,a}(typeof t.default=="function"||typeof t.default=="object"&&t.default!==null)&&typeof t.default.__esModule>"u"&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)})(Pr,Pr.exports)),Pr.exports}var Dr={exports:{}},fd;function ox(){return fd||(fd=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"forbidden",{enumerable:!0,get:function(){return o}});const r=`${kr().HTTP_ERROR_FALLBACK_ERROR_CODE};403`;function o(){if(!process.env.__NEXT_EXPERIMENTAL_AUTH_INTERRUPTS)throw Object.defineProperty(new Error("`forbidden()` is experimental and only allowed to be enabled when `experimental.authInterrupts` is enabled."),"__NEXT_ERROR_CODE",{value:"E488",enumerable:!1,configurable:!0});const a=Object.defineProperty(new Error(r),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});throw a.digest=r,a}(typeof t.default=="function"||typeof t.default=="object"&&t.default!==null)&&typeof t.default.__esModule>"u"&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)})(Dr,Dr.exports)),Dr.exports}var Ir={exports:{}},hd;function sx(){return hd||(hd=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"unauthorized",{enumerable:!0,get:function(){return o}});const r=`${kr().HTTP_ERROR_FALLBACK_ERROR_CODE};401`;function o(){if(!process.env.__NEXT_EXPERIMENTAL_AUTH_INTERRUPTS)throw Object.defineProperty(new Error("`unauthorized()` is experimental and only allowed to be used when `experimental.authInterrupts` is enabled."),"__NEXT_ERROR_CODE",{value:"E411",enumerable:!1,configurable:!0});const a=Object.defineProperty(new Error(r),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});throw a.digest=r,a}(typeof t.default=="function"||typeof t.default=="object"&&t.default!==null)&&typeof t.default.__esModule>"u"&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)})(Ir,Ir.exports)),Ir.exports}var Mr={exports:{}},Lr={exports:{}},ys={},md;function pd(){return md||(md=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(u,f){for(var d in f)Object.defineProperty(u,d,{enumerable:!0,get:f[d]})}t(e,{isHangingPromiseRejectionError:function(){return n},makeDevtoolsIOAwarePromise:function(){return l},makeHangingPromise:function(){return i}});function n(u){return typeof u!="object"||u===null||!("digest"in u)?!1:u.digest===r}const r="HANGING_PROMISE_REJECTION";class o extends Error{constructor(f,d){super(`During prerendering, ${d} rejects when the prerender is complete. Typically these errors are handled by React but if you move ${d} to a different context by using \`setTimeout\`, \`after\`, or similar functions you may observe this error and you should handle it in that context. This occurred at route "${f}".`),this.route=f,this.expression=d,this.digest=r}}const a=new WeakMap;function i(u,f,d){if(u.aborted)return Promise.reject(new o(f,d));{const m=new Promise((g,b)=>{const p=b.bind(null,new o(f,d));let v=a.get(u);if(v)v.push(p);else{const x=[p];a.set(u,x),u.addEventListener("abort",()=>{for(let y=0;y<x.length;y++)x[y]()},{once:!0})}});return m.catch(c),m}}function c(){}function l(u,f,d){return f.stagedRendering?f.stagedRendering.delayUntilStage(d,void 0,u):new Promise(m=>{setTimeout(()=>{m(u)},0)})}})(ys)),ys}var xs={},gd;function ax(){return gd||(gd=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"isPostpone",{enumerable:!0,get:function(){return n}});const t=Symbol.for("react.postpone");function n(r){return typeof r=="object"&&r!==null&&r.$$typeof===t}})(xs)),xs}var ws={},bd;function Es(){return bd||(bd=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(a,i){for(var c in i)Object.defineProperty(a,c,{enumerable:!0,get:i[c]})}t(e,{BailoutToCSRError:function(){return r},isBailoutToCSRError:function(){return o}});const n="BAILOUT_TO_CLIENT_SIDE_RENDERING";class r extends Error{constructor(i){super(`Bail out to client-side rendering: ${i}`),this.reason=i,this.digest=n}}function o(a){return typeof a!="object"||a===null||!("digest"in a)?!1:a.digest===n}})(ws)),ws}var Hr={exports:{}},vd;function yd(){return vd||(vd=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isNextRouterError",{enumerable:!0,get:function(){return o}});const n=kr(),r=ms();function o(a){return(0,r.isRedirectError)(a)||(0,n.isHTTPAccessFallbackError)(a)}(typeof t.default=="function"||typeof t.default=="object"&&t.default!==null)&&typeof t.default.__esModule>"u"&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)})(Hr,Hr.exports)),Hr.exports}var _s={},Br={exports:{}},xd;function wd(){return xd||(xd=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});function n(i,c){for(var l in c)Object.defineProperty(i,l,{enumerable:!0,get:c[l]})}n(t,{DynamicServerError:function(){return o},isDynamicServerError:function(){return a}});const r="DYNAMIC_SERVER_USAGE";class o extends Error{constructor(c){super(`Dynamic server usage: ${c}`),this.description=c,this.digest=r}}function a(i){return typeof i!="object"||i===null||!("digest"in i)||typeof i.digest!="string"?!1:i.digest===r}(typeof t.default=="function"||typeof t.default=="object"&&t.default!==null)&&typeof t.default.__esModule>"u"&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)})(Br,Br.exports)),Br.exports}var Fr={exports:{}},Ed;function ix(){return Ed||(Ed=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});function n(i,c){for(var l in c)Object.defineProperty(i,l,{enumerable:!0,get:c[l]})}n(t,{StaticGenBailoutError:function(){return o},isStaticGenBailoutError:function(){return a}});const r="NEXT_STATIC_GEN_BAILOUT";class o extends Error{constructor(...c){super(...c),this.code=r}}function a(i){return typeof i!="object"||i===null||!("code"in i)?!1:i.code===r}(typeof t.default=="function"||typeof t.default=="object"&&t.default!==null)&&typeof t.default.__esModule>"u"&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)})(Fr,Fr.exports)),Fr.exports}var Ss={},Ns={},_d;function cx(){return _d||(_d=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"workUnitAsyncStorageInstance",{enumerable:!0,get:function(){return n}});const n=(0,vs().createAsyncLocalStorage)()})(Ns)),Ns}var Ur={exports:{}},Sd;function lx(){return Sd||(Sd=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});function n(R,_){for(var I in _)Object.defineProperty(R,I,{enumerable:!0,get:_[I]})}n(t,{ACTION_HEADER:function(){return o},FLIGHT_HEADERS:function(){return m},NEXT_ACTION_NOT_FOUND_HEADER:function(){return w},NEXT_ACTION_REVALIDATED_HEADER:function(){return j},NEXT_DID_POSTPONE_HEADER:function(){return p},NEXT_HMR_REFRESH_HASH_COOKIE:function(){return u},NEXT_HMR_REFRESH_HEADER:function(){return l},NEXT_HTML_REQUEST_ID_HEADER:function(){return N},NEXT_IS_PRERENDER_HEADER:function(){return y},NEXT_REQUEST_ID_HEADER:function(){return E},NEXT_REWRITTEN_PATH_HEADER:function(){return v},NEXT_REWRITTEN_QUERY_HEADER:function(){return x},NEXT_ROUTER_PREFETCH_HEADER:function(){return i},NEXT_ROUTER_SEGMENT_PREFETCH_HEADER:function(){return c},NEXT_ROUTER_STALE_TIME_HEADER:function(){return b},NEXT_ROUTER_STATE_TREE_HEADER:function(){return a},NEXT_RSC_UNION_QUERY:function(){return g},NEXT_URL:function(){return f},RSC_CONTENT_TYPE_HEADER:function(){return d},RSC_HEADER:function(){return r}});const r="rsc",o="next-action",a="next-router-state-tree",i="next-router-prefetch",c="next-router-segment-prefetch",l="next-hmr-refresh",u="__next_hmr_refresh_hash__",f="next-url",d="text/x-component",m=[r,a,i,l,c],g="_rsc",b="x-nextjs-stale-time",p="x-nextjs-postponed",v="x-nextjs-rewritten-path",x="x-nextjs-rewritten-query",y="x-nextjs-prerender",w="x-nextjs-action-not-found",E="x-nextjs-request-id",N="x-nextjs-html-request-id",j="x-action-revalidated";(typeof t.default=="function"||typeof t.default=="object"&&t.default!==null)&&typeof t.default.__esModule>"u"&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)})(Ur,Ur.exports)),Ur.exports}var Rs={},Nd;function Rd(){return Nd||(Nd=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"InvariantError",{enumerable:!0,get:function(){return t}});class t extends Error{constructor(r,o){super(`Invariant: ${r.endsWith(".")?r:r+"."} This is a bug in Next.js.`,o),this.name="InvariantError"}}})(Rs)),Rs}var Cd;function ux(){return Cd||(Cd=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(p,v){for(var x in v)Object.defineProperty(p,x,{enumerable:!0,get:v[x]})}t(e,{getCacheSignal:function(){return g},getDraftModeProviderForCacheScope:function(){return m},getHmrRefreshHash:function(){return u},getPrerenderResumeDataCache:function(){return c},getRenderResumeDataCache:function(){return l},getRuntimeStagePromise:function(){return b},getServerComponentsHmrCache:function(){return d},isHmrRefresh:function(){return f},throwForMissingRequestStore:function(){return a},throwInvariantForMissingStore:function(){return i},workUnitAsyncStorage:function(){return n.workUnitAsyncStorageInstance}});const n=cx(),r=lx(),o=Rd();function a(p){throw Object.defineProperty(new Error(`\`${p}\` was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`),"__NEXT_ERROR_CODE",{value:"E251",enumerable:!1,configurable:!0})}function i(){throw Object.defineProperty(new o.InvariantError("Expected workUnitAsyncStorage to have a store."),"__NEXT_ERROR_CODE",{value:"E696",enumerable:!1,configurable:!0})}function c(p){switch(p.type){case"prerender":case"prerender-runtime":case"prerender-ppr":return p.prerenderResumeDataCache;case"prerender-client":return p.prerenderResumeDataCache;case"request":if(p.prerenderResumeDataCache)return p.prerenderResumeDataCache;case"prerender-legacy":case"cache":case"private-cache":case"unstable-cache":return null;default:return p}}function l(p){switch(p.type){case"request":case"prerender":case"prerender-runtime":case"prerender-client":if(p.renderResumeDataCache)return p.renderResumeDataCache;case"prerender-ppr":return p.prerenderResumeDataCache??null;case"cache":case"private-cache":case"unstable-cache":case"prerender-legacy":return null;default:return p}}function u(p,v){if(p.dev)switch(v.type){case"cache":case"private-cache":case"prerender":case"prerender-runtime":return v.hmrRefreshHash;case"request":var x;return(x=v.cookies.get(r.NEXT_HMR_REFRESH_HASH_COOKIE))==null?void 0:x.value}}function f(p,v){if(p.dev)switch(v.type){case"cache":case"private-cache":case"request":return v.isHmrRefresh??!1}return!1}function d(p,v){if(p.dev)switch(v.type){case"cache":case"private-cache":case"request":return v.serverComponentsHmrCache}}function m(p,v){if(p.isDraftMode)switch(v.type){case"cache":case"private-cache":case"unstable-cache":case"prerender-runtime":case"request":return v.draftMode}}function g(p){switch(p.type){case"prerender":case"prerender-client":case"prerender-runtime":return p.cacheSignal;case"request":if(p.cacheSignal)return p.cacheSignal;case"prerender-ppr":case"prerender-legacy":case"cache":case"private-cache":case"unstable-cache":return null;default:return p}}function b(p){switch(p.type){case"prerender-runtime":case"private-cache":return p.runtimeStagePromise;case"prerender":case"prerender-client":case"prerender-ppr":case"prerender-legacy":case"request":case"cache":case"unstable-cache":return null;default:return p}}})(Ss)),Ss}var Cs={},Ts={},Td;function dx(){return Td||(Td=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"workAsyncStorageInstance",{enumerable:!0,get:function(){return n}});const n=(0,vs().createAsyncLocalStorage)()})(Ts)),Ts}var jd;function fx(){return jd||(jd=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"workAsyncStorage",{enumerable:!0,get:function(){return t.workAsyncStorageInstance}});const t=dx()})(Cs)),Cs}var js={},Ad;function hx(){return Ad||(Ad=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(i,c){for(var l in c)Object.defineProperty(i,l,{enumerable:!0,get:c[l]})}t(e,{METADATA_BOUNDARY_NAME:function(){return n},OUTLET_BOUNDARY_NAME:function(){return o},ROOT_LAYOUT_BOUNDARY_NAME:function(){return a},VIEWPORT_BOUNDARY_NAME:function(){return r}});const n="__next_metadata_boundary__",r="__next_viewport_boundary__",o="__next_outlet_boundary__",a="__next_root_layout_boundary__"})(js)),js}var As={},Pd;function mx(){return Pd||(Pd=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(i,c){for(var l in c)Object.defineProperty(i,l,{enumerable:!0,get:c[l]})}t(e,{atLeastOneTask:function(){return o},scheduleImmediate:function(){return r},scheduleOnNextTick:function(){return n},waitAtLeastOneReactRenderTask:function(){return a}});const n=i=>{Promise.resolve().then(()=>{process.env.NEXT_RUNTIME==="edge"?setTimeout(i,0):process.nextTick(i)})},r=i=>{process.env.NEXT_RUNTIME==="edge"?setTimeout(i,0):setImmediate(i)};function o(){return new Promise(i=>r(i))}function a(){return process.env.NEXT_RUNTIME==="edge"?new Promise(i=>setTimeout(i,0)):new Promise(i=>setImmediate(i))}})(As)),As}var Od;function Ps(){return Od||(Od=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(C,A){for(var P in A)Object.defineProperty(C,P,{enumerable:!0,get:A[P]})}t(e,{Postpone:function(){return R},PreludeState:function(){return Te},abortAndThrowOnSynchronousRequestDataAccess:function(){return j},abortOnSynchronousPlatformIOAccess:function(){return N},accessedDynamicData:function(){return oe},annotateDynamicAccess:function(){return T},consumeDynamicAccess:function(){return F},createDynamicTrackingState:function(){return b},createDynamicValidationState:function(){return p},createHangingInputAbortSignal:function(){return O},createRenderInBrowserAbortSignal:function(){return D},delayUntilRuntimeStage:function(){return Ms},formatDynamicAPIAccesses:function(){return K},getFirstDynamicReason:function(){return v},getStaticShellDisallowedDynamicReasons:function(){return Lt},isDynamicPostpone:function(){return M},isPrerenderInterruptedError:function(){return Q},logDisallowedDynamicError:function(){return ct},markCurrentScopeAsDynamic:function(){return x},postponeWithTracking:function(){return _},throwIfDisallowedDynamic:function(){return Mt},throwToInterruptStaticGeneration:function(){return y},trackAllowedDynamicAccess:function(){return le},trackDynamicDataInDynamicRender:function(){return w},trackDynamicHoleInRuntimeShell:function(){return ue},trackDynamicHoleInStaticShell:function(){return de},useDynamicRouteParams:function(){return z},useDynamicSearchParams:function(){return ie}});const n=m(S),r=wd(),o=ix(),a=ux(),i=fx(),c=pd(),l=hx(),u=mx(),f=Es(),d=Rd();function m(C){return C&&C.__esModule?C:{default:C}}const g=typeof n.default.unstable_postpone=="function";function b(C){return{isDebugDynamicAccesses:C,dynamicAccesses:[],syncDynamicErrorWithStack:null}}function p(){return{hasSuspenseAboveBody:!1,hasDynamicMetadata:!1,dynamicMetadata:null,hasDynamicViewport:!1,hasAllowedDynamic:!1,dynamicErrors:[]}}function v(C){var A;return(A=C.dynamicAccesses[0])==null?void 0:A.expression}function x(C,A,P){if(A)switch(A.type){case"cache":case"unstable-cache":return;case"private-cache":return}if(!(C.forceDynamic||C.forceStatic)){if(C.dynamicShouldError)throw Object.defineProperty(new o.StaticGenBailoutError(`Route ${C.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`${P}\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E553",enumerable:!1,configurable:!0});if(A)switch(A.type){case"prerender-ppr":return _(C.route,P,A.dynamicTracking);case"prerender-legacy":A.revalidate=0;const Z=Object.defineProperty(new r.DynamicServerError(`Route ${C.route} couldn't be rendered statically because it used ${P}. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`),"__NEXT_ERROR_CODE",{value:"E550",enumerable:!1,configurable:!0});throw C.dynamicUsageDescription=P,C.dynamicUsageStack=Z.stack,Z;case"request":process.env.NODE_ENV!=="production"&&(A.usedDynamic=!0);break}}}function y(C,A,P){const Z=Object.defineProperty(new r.DynamicServerError(`Route ${A.route} couldn't be rendered statically because it used \`${C}\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`),"__NEXT_ERROR_CODE",{value:"E558",enumerable:!1,configurable:!0});throw P.revalidate=0,A.dynamicUsageDescription=C,A.dynamicUsageStack=Z.stack,Z}function w(C){switch(C.type){case"cache":case"unstable-cache":return;case"private-cache":return;case"prerender":case"prerender-runtime":case"prerender-legacy":case"prerender-ppr":case"prerender-client":break;case"request":process.env.NODE_ENV!=="production"&&(C.usedDynamic=!0);break}}function E(C,A,P){const Z=`Route ${C} needs to bail out of prerendering at this point because it used ${A}.`,_e=X(Z);P.controller.abort(_e);const xe=P.dynamicTracking;xe&&xe.dynamicAccesses.push({stack:xe.isDebugDynamicAccesses?new Error().stack:void 0,expression:A})}function N(C,A,P,Z){const _e=Z.dynamicTracking;E(C,A,Z),_e&&_e.syncDynamicErrorWithStack===null&&(_e.syncDynamicErrorWithStack=P)}function j(C,A,P,Z){if(Z.controller.signal.aborted===!1){E(C,A,Z);const xe=Z.dynamicTracking;xe&&xe.syncDynamicErrorWithStack===null&&(xe.syncDynamicErrorWithStack=P)}throw X(`Route ${C} needs to bail out of prerendering at this point because it used ${A}.`)}function R({reason:C,route:A}){const P=a.workUnitAsyncStorage.getStore(),Z=P&&P.type==="prerender-ppr"?P.dynamicTracking:null;_(A,C,Z)}function _(C,A,P){G(),P&&P.dynamicAccesses.push({stack:P.isDebugDynamicAccesses?new Error().stack:void 0,expression:A}),n.default.unstable_postpone(I(C,A))}function I(C,A){return`Route ${C} needs to bail out of prerendering at this point because it used ${A}. React throws this special object to indicate where. It should not be caught by your own try/catch. Learn more: https://nextjs.org/docs/messages/ppr-caught-error`}function M(C){return typeof C=="object"&&C!==null&&typeof C.message=="string"?q(C.message):!1}function q(C){return C.includes("needs to bail out of prerendering at this point because it used")&&C.includes("Learn more: https://nextjs.org/docs/messages/ppr-caught-error")}if(q(I("%%%","^^^"))===!1)throw Object.defineProperty(new Error("Invariant: isDynamicPostpone misidentified a postpone reason. This is a bug in Next.js"),"__NEXT_ERROR_CODE",{value:"E296",enumerable:!1,configurable:!0});const U="NEXT_PRERENDER_INTERRUPTED";function X(C){const A=Object.defineProperty(new Error(C),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return A.digest=U,A}function Q(C){return typeof C=="object"&&C!==null&&C.digest===U&&"name"in C&&"message"in C&&C instanceof Error}function oe(C){return C.length>0}function F(C,A){return C.dynamicAccesses.push(...A.dynamicAccesses),C.dynamicAccesses}function K(C){return C.filter(A=>typeof A.stack=="string"&&A.stack.length>0).map(({expression:A,stack:P})=>(P=P.split(`
|
|
250
|
+
`).slice(4).filter(Z=>!(Z.includes("node_modules/next/")||Z.includes(" (<anonymous>)")||Z.includes(" (node:"))).join(`
|
|
251
|
+
`),`Dynamic API Usage Debug - ${A}:
|
|
252
|
+
${P}`))}function G(){if(!g)throw Object.defineProperty(new Error("Invariant: React.unstable_postpone is not defined. This suggests the wrong version of React was loaded. This is a bug in Next.js"),"__NEXT_ERROR_CODE",{value:"E224",enumerable:!1,configurable:!0})}function D(){const C=new AbortController;return C.abort(Object.defineProperty(new f.BailoutToCSRError("Render in Browser"),"__NEXT_ERROR_CODE",{value:"E721",enumerable:!1,configurable:!0})),C.signal}function O(C){switch(C.type){case"prerender":case"prerender-runtime":const A=new AbortController;if(C.cacheSignal)C.cacheSignal.inputReady().then(()=>{A.abort()});else{const P=(0,a.getRuntimeStagePromise)(C);P?P.then(()=>(0,u.scheduleOnNextTick)(()=>A.abort())):(0,u.scheduleOnNextTick)(()=>A.abort())}return A.signal;case"prerender-client":case"prerender-ppr":case"prerender-legacy":case"request":case"cache":case"private-cache":case"unstable-cache":return}}function T(C,A){const P=A.dynamicTracking;P&&P.dynamicAccesses.push({stack:P.isDebugDynamicAccesses?new Error().stack:void 0,expression:C})}function z(C){const A=i.workAsyncStorage.getStore(),P=a.workUnitAsyncStorage.getStore();if(A&&P)switch(P.type){case"prerender-client":case"prerender":{const Z=P.fallbackRouteParams;Z&&Z.size>0&&n.default.use((0,c.makeHangingPromise)(P.renderSignal,A.route,C));break}case"prerender-ppr":{const Z=P.fallbackRouteParams;if(Z&&Z.size>0)return _(A.route,C,P.dynamicTracking);break}case"prerender-runtime":throw Object.defineProperty(new d.InvariantError(`\`${C}\` was called during a runtime prerender. Next.js should be preventing ${C} from being included in server components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E771",enumerable:!1,configurable:!0});case"cache":case"private-cache":throw Object.defineProperty(new d.InvariantError(`\`${C}\` was called inside a cache scope. Next.js should be preventing ${C} from being included in server components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E745",enumerable:!1,configurable:!0})}}function ie(C){const A=i.workAsyncStorage.getStore(),P=a.workUnitAsyncStorage.getStore();if(A)switch(P||(0,a.throwForMissingRequestStore)(C),P.type){case"prerender-client":{n.default.use((0,c.makeHangingPromise)(P.renderSignal,A.route,C));break}case"prerender-legacy":case"prerender-ppr":{if(A.forceStatic)return;throw Object.defineProperty(new f.BailoutToCSRError(C),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0})}case"prerender":case"prerender-runtime":throw Object.defineProperty(new d.InvariantError(`\`${C}\` was called from a Server Component. Next.js should be preventing ${C} from being included in server components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E795",enumerable:!1,configurable:!0});case"cache":case"unstable-cache":case"private-cache":throw Object.defineProperty(new d.InvariantError(`\`${C}\` was called inside a cache scope. Next.js should be preventing ${C} from being included in server components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E745",enumerable:!1,configurable:!0});case"request":return}}const se=/\n\s+at Suspense \(<anonymous>\)/,me="body|div|main|section|article|aside|header|footer|nav|form|p|span|h1|h2|h3|h4|h5|h6",ce=new RegExp(`\\n\\s+at Suspense \\(<anonymous>\\)(?:(?!\\n\\s+at (?:${me}) \\(<anonymous>\\))[\\s\\S])*?\\n\\s+at ${l.ROOT_LAYOUT_BOUNDARY_NAME} \\([^\\n]*\\)`),k=new RegExp(`\\n\\s+at ${l.METADATA_BOUNDARY_NAME}[\\n\\s]`),te=new RegExp(`\\n\\s+at ${l.VIEWPORT_BOUNDARY_NAME}[\\n\\s]`),$=new RegExp(`\\n\\s+at ${l.OUTLET_BOUNDARY_NAME}[\\n\\s]`);function le(C,A,P,Z){if(!$.test(A))if(k.test(A)){P.hasDynamicMetadata=!0;return}else if(te.test(A)){P.hasDynamicViewport=!0;return}else if(ce.test(A)){P.hasAllowedDynamic=!0,P.hasSuspenseAboveBody=!0;return}else if(se.test(A)){P.hasAllowedDynamic=!0;return}else if(Z.syncDynamicErrorWithStack){P.dynamicErrors.push(Z.syncDynamicErrorWithStack);return}else{const _e=`Route "${C.route}": Uncached data was accessed outside of <Suspense>. This delays the entire page from rendering, resulting in a slow user experience. Learn more: https://nextjs.org/docs/messages/blocking-route`,xe=ye(_e,A);P.dynamicErrors.push(xe);return}}function ue(C,A,P,Z){if(!$.test(A))if(k.test(A)){const _e=`Route "${C.route}": Uncached data or \`connection()\` was accessed inside \`generateMetadata\`. Except for this instance, the page would have been entirely prerenderable which may have been the intended behavior. See more info here: https://nextjs.org/docs/messages/next-prerender-dynamic-metadata`,xe=ye(_e,A);P.dynamicMetadata=xe;return}else if(te.test(A)){const _e=`Route "${C.route}": Uncached data or \`connection()\` was accessed inside \`generateViewport\`. This delays the entire page from rendering, resulting in a slow user experience. Learn more: https://nextjs.org/docs/messages/next-prerender-dynamic-viewport`,xe=ye(_e,A);P.dynamicErrors.push(xe);return}else if(ce.test(A)){P.hasAllowedDynamic=!0,P.hasSuspenseAboveBody=!0;return}else if(se.test(A)){P.hasAllowedDynamic=!0;return}else if(Z.syncDynamicErrorWithStack){P.dynamicErrors.push(Z.syncDynamicErrorWithStack);return}else{const _e=`Route "${C.route}": Uncached data or \`connection()\` was accessed outside of \`<Suspense>\`. This delays the entire page from rendering, resulting in a slow user experience. Learn more: https://nextjs.org/docs/messages/blocking-route`,xe=ye(_e,A);P.dynamicErrors.push(xe);return}}function de(C,A,P,Z){if(!$.test(A))if(k.test(A)){const _e=`Route "${C.route}": Runtime data such as \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` was accessed inside \`generateMetadata\` or you have file-based metadata such as icons that depend on dynamic params segments. Except for this instance, the page would have been entirely prerenderable which may have been the intended behavior. See more info here: https://nextjs.org/docs/messages/next-prerender-dynamic-metadata`,xe=ye(_e,A);P.dynamicMetadata=xe;return}else if(te.test(A)){const _e=`Route "${C.route}": Runtime data such as \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` was accessed inside \`generateViewport\`. This delays the entire page from rendering, resulting in a slow user experience. Learn more: https://nextjs.org/docs/messages/next-prerender-dynamic-viewport`,xe=ye(_e,A);P.dynamicErrors.push(xe);return}else if(ce.test(A)){P.hasAllowedDynamic=!0,P.hasSuspenseAboveBody=!0;return}else if(se.test(A)){P.hasAllowedDynamic=!0;return}else if(Z.syncDynamicErrorWithStack){P.dynamicErrors.push(Z.syncDynamicErrorWithStack);return}else{const _e=`Route "${C.route}": Runtime data such as \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` was accessed outside of \`<Suspense>\`. This delays the entire page from rendering, resulting in a slow user experience. Learn more: https://nextjs.org/docs/messages/blocking-route`,xe=ye(_e,A);P.dynamicErrors.push(xe);return}}function ye(C,A){const P=process.env.NODE_ENV!=="production"&&n.default.captureOwnerStack?n.default.captureOwnerStack():null,Z=Object.defineProperty(new Error(C),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return Z.stack=Z.name+": "+C+(P||A),Z}var Te=(function(C){return C[C.Full=0]="Full",C[C.Empty=1]="Empty",C[C.Errored=2]="Errored",C})({});function ct(C,A){console.error(A),C.dev||(C.hasReadableErrorStacks?console.error(`To get a more detailed stack trace and pinpoint the issue, start the app in development mode by running \`next dev\`, then open "${C.route}" in your browser to investigate the error.`):console.error(`To get a more detailed stack trace and pinpoint the issue, try one of the following:
|
|
253
|
+
- Start the app in development mode by running \`next dev\`, then open "${C.route}" in your browser to investigate the error.
|
|
254
|
+
- Rerun the production build with \`next build --debug-prerender\` to generate better stack traces.`))}function Mt(C,A,P,Z){if(Z.syncDynamicErrorWithStack)throw ct(C,Z.syncDynamicErrorWithStack),new o.StaticGenBailoutError;if(A!==0){if(P.hasSuspenseAboveBody)return;const _e=P.dynamicErrors;if(_e.length>0){for(let xe=0;xe<_e.length;xe++)ct(C,_e[xe]);throw new o.StaticGenBailoutError}if(P.hasDynamicViewport)throw console.error(`Route "${C.route}" has a \`generateViewport\` that depends on Request data (\`cookies()\`, etc...) or uncached external data (\`fetch(...)\`, etc...) without explicitly allowing fully dynamic rendering. See more info here: https://nextjs.org/docs/messages/next-prerender-dynamic-viewport`),new o.StaticGenBailoutError;if(A===1)throw console.error(`Route "${C.route}" did not produce a static shell and Next.js was unable to determine a reason. This is a bug in Next.js.`),new o.StaticGenBailoutError}else if(P.hasAllowedDynamic===!1&&P.hasDynamicMetadata)throw console.error(`Route "${C.route}" has a \`generateMetadata\` that depends on Request data (\`cookies()\`, etc...) or uncached external data (\`fetch(...)\`, etc...) when the rest of the route does not. See more info here: https://nextjs.org/docs/messages/next-prerender-dynamic-metadata`),new o.StaticGenBailoutError}function Lt(C,A,P){if(P.hasSuspenseAboveBody)return[];if(A!==0){const Z=P.dynamicErrors;if(Z.length>0)return Z;if(A===1)return[Object.defineProperty(new d.InvariantError(`Route "${C.route}" did not produce a static shell and Next.js was unable to determine a reason.`),"__NEXT_ERROR_CODE",{value:"E936",enumerable:!1,configurable:!0})]}else if(P.hasAllowedDynamic===!1&&P.dynamicErrors.length===0&&P.dynamicMetadata)return[P.dynamicMetadata];return[]}function Ms(C,A){return C.runtimeStagePromise?C.runtimeStagePromise.then(()=>A):A}})(_s)),_s}var kd;function px(){return kd||(kd=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"unstable_rethrow",{enumerable:!0,get:function(){return l}});const n=pd(),r=ax(),o=Es(),a=yd(),i=Ps(),c=wd();function l(u){if((0,a.isNextRouterError)(u)||(0,o.isBailoutToCSRError)(u)||(0,c.isDynamicServerError)(u)||(0,i.isDynamicPostpone)(u)||(0,r.isPostpone)(u)||(0,n.isHangingPromiseRejectionError)(u)||(0,i.isPrerenderInterruptedError)(u))throw u;u instanceof Error&&"cause"in u&&l(u.cause)}(typeof t.default=="function"||typeof t.default=="object"&&t.default!==null)&&typeof t.default.__esModule>"u"&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)})(Lr,Lr.exports)),Lr.exports}var Gr={exports:{}},Dd;function gx(){return Dd||(Dd=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"unstable_rethrow",{enumerable:!0,get:function(){return o}});const n=Es(),r=yd();function o(a){if((0,r.isNextRouterError)(a)||(0,n.isBailoutToCSRError)(a))throw a;a instanceof Error&&"cause"in a&&o(a.cause)}(typeof t.default=="function"||typeof t.default=="object"&&t.default!==null)&&typeof t.default.__esModule>"u"&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)})(Gr,Gr.exports)),Gr.exports}var Id;function bx(){return Id||(Id=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"unstable_rethrow",{enumerable:!0,get:function(){return n}});const n=typeof window>"u"?px().unstable_rethrow:gx().unstable_rethrow;(typeof t.default=="function"||typeof t.default=="object"&&t.default!==null)&&typeof t.default.__esModule>"u"&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)})(Mr,Mr.exports)),Mr.exports}var Md;function vx(){return Md||(Md=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});function n(d,m){for(var g in m)Object.defineProperty(d,g,{enumerable:!0,get:m[g]})}n(t,{ReadonlyURLSearchParams:function(){return r.ReadonlyURLSearchParams},RedirectType:function(){return a.RedirectType},forbidden:function(){return c.forbidden},notFound:function(){return i.notFound},permanentRedirect:function(){return o.permanentRedirect},redirect:function(){return o.redirect},unauthorized:function(){return l.unauthorized},unstable_isUnrecognizedActionError:function(){return f},unstable_rethrow:function(){return u.unstable_rethrow}});const r=Qu(),o=nx(),a=ms(),i=rx(),c=ox(),l=sx(),u=bx();function f(){throw Object.defineProperty(new Error("`unstable_isUnrecognizedActionError` can only be used on the client."),"__NEXT_ERROR_CODE",{value:"E776",enumerable:!1,configurable:!0})}(typeof t.default=="function"||typeof t.default=="object"&&t.default!==null)&&typeof t.default.__esModule>"u"&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)})(Cr,Cr.exports)),Cr.exports}var Ld;function yx(){return Ld||(Ld=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});function n(w,E){for(var N in E)Object.defineProperty(w,N,{enumerable:!0,get:E[N]})}n(t,{ReadonlyURLSearchParams:function(){return i.ReadonlyURLSearchParams},RedirectType:function(){return f.RedirectType},ServerInsertedHTMLContext:function(){return l.ServerInsertedHTMLContext},forbidden:function(){return f.forbidden},notFound:function(){return f.notFound},permanentRedirect:function(){return f.permanentRedirect},redirect:function(){return f.redirect},unauthorized:function(){return f.unauthorized},unstable_isUnrecognizedActionError:function(){return u.unstable_isUnrecognizedActionError},unstable_rethrow:function(){return f.unstable_rethrow},useParams:function(){return v},usePathname:function(){return b},useRouter:function(){return p},useSearchParams:function(){return g},useSelectedLayoutSegment:function(){return y},useSelectedLayoutSegments:function(){return x},useServerInsertedHTML:function(){return l.useServerInsertedHTML}});const o=Xu()._(S),a=Yy(),i=Ky(),c=Zy(),l=Qy(),u=Jy(),f=vx(),d=typeof window>"u"?Ps().useDynamicRouteParams:void 0,m=typeof window>"u"?Ps().useDynamicSearchParams:void 0;function g(){m==null||m("useSearchParams()");const w=(0,o.useContext)(i.SearchParamsContext),E=(0,o.useMemo)(()=>w?new i.ReadonlyURLSearchParams(w):null,[w]);if(process.env.NODE_ENV!=="production"&&"use"in o.default){const N=(0,o.use)(i.NavigationPromisesContext);if(N)return(0,o.use)(N.searchParams)}return E}function b(){d==null||d("usePathname()");const w=(0,o.useContext)(i.PathnameContext);if(process.env.NODE_ENV!=="production"&&"use"in o.default){const E=(0,o.use)(i.NavigationPromisesContext);if(E)return(0,o.use)(E.pathname)}return w}function p(){const w=(0,o.useContext)(a.AppRouterContext);if(w===null)throw Object.defineProperty(new Error("invariant expected app router to be mounted"),"__NEXT_ERROR_CODE",{value:"E238",enumerable:!1,configurable:!0});return w}function v(){d==null||d("useParams()");const w=(0,o.useContext)(i.PathParamsContext);if(process.env.NODE_ENV!=="production"&&"use"in o.default){const E=(0,o.use)(i.NavigationPromisesContext);if(E)return(0,o.use)(E.params)}return w}function x(w="children"){var N;d==null||d("useSelectedLayoutSegments()");const E=(0,o.useContext)(a.LayoutRouterContext);if(!E)return null;if(process.env.NODE_ENV!=="production"&&"use"in o.default){const j=(0,o.use)(i.NavigationPromisesContext);if(j){const R=(N=j.selectedLayoutSegmentsPromises)==null?void 0:N.get(w);if(R)return(0,o.use)(R)}}return(0,c.getSelectedLayoutSegmentPath)(E.parentTree,w)}function y(w="children"){var j;d==null||d("useSelectedLayoutSegment()");const E=(0,o.useContext)(i.NavigationPromisesContext),N=x(w);if(process.env.NODE_ENV!=="production"&&E&&"use"in o.default){const R=(j=E.selectedLayoutSegmentPromises)==null?void 0:j.get(w);if(R)return(0,o.use)(R)}return(0,c.computeSelectedLayoutSegment)(N,w)}(typeof t.default=="function"||typeof t.default=="object"&&t.default!==null)&&typeof t.default.__esModule>"u"&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)})(Sr,Sr.exports)),Sr.exports}var Os,Hd;function xx(){return Hd||(Hd=1,Os=yx()),Os}var Bd=xx();const Qt=h.forwardRef(({className:e,...t},n)=>s.jsx("div",{className:"relative w-full overflow-auto",children:s.jsx("table",{ref:n,className:V("w-full caption-bottom text-sm",e),...t})}));Qt.displayName="Table";const Jt=h.forwardRef(({className:e,...t},n)=>s.jsx("thead",{ref:n,className:V("[&_tr]:border-b",e),...t}));Jt.displayName="TableHeader";const en=h.forwardRef(({className:e,...t},n)=>s.jsx("tbody",{ref:n,className:V("[&_tr:last-child]:border-0",e),...t}));en.displayName="TableBody";const wx=h.forwardRef(({className:e,...t},n)=>s.jsx("tfoot",{ref:n,className:V("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));wx.displayName="TableFooter";const Ee=h.forwardRef(({className:e,...t},n)=>s.jsx("tr",{ref:n,className:V("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));Ee.displayName="TableRow";const ge=h.forwardRef(({className:e,...t},n)=>s.jsx("th",{ref:n,className:V("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));ge.displayName="TableHead";const re=h.forwardRef(({className:e,...t},n)=>s.jsx("td",{ref:n,className:V("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));re.displayName="TableCell";const Ex=h.forwardRef(({className:e,...t},n)=>s.jsx("caption",{ref:n,className:V("mt-4 text-sm text-muted-foreground",e),...t}));Ex.displayName="TableCaption";const _x={async listRuns(){return(await ee.get("/api/v1/ai/agent/run")).data},async getRun(e){return(await ee.get(`/api/v1/ai/agent/run/${e}`)).data},async cancelRun(e){await ee.post(`/api/v1/ai/agent/run/${e}/cancel`)},getEventsUrl(e){return`${typeof window<"u"&&(window.location.origin==="http://tauri.localhost"||window.location.origin==="tauri://localhost")?"http://127.0.0.1:9988":""}/api/v1/ai/agent/run/${e}/events`}},Sx={pending:"secondary",running:"default",completed:"default",failed:"destructive",cancelled:"outline"},Nx={pending:"",running:"bg-blue-500 hover:bg-blue-500/80 text-white border-transparent",completed:"bg-green-500 hover:bg-green-500/80 text-white border-transparent",failed:"",cancelled:"text-muted-foreground"};function Rx({status:e,label:t}){return s.jsx(Ne,{variant:Sx[e],className:Nx[e],children:t})}function Cx(e){return e==null?"—":e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function Tx(e){return e?new Date(e).toLocaleString():"—"}function jx(e,t=80){return e.length<=t?e:`${e.slice(0,t)}...`}function Ax(){const e=J("agentRuns"),t=J("common"),n=Bd.useRouter(),[r,o]=S.useState([]),[a,i]=S.useState(!0),c=S.useCallback(async()=>{i(!0);try{const u=await _x.listRuns();o(u)}catch{W.error(e("toast.loadFailed"))}finally{i(!1)}},[e]);S.useEffect(()=>{c()},[c]);const l=u=>{n.push(`/ai-tools/agent-runs/${u}`)};return s.jsxs("div",{className:"space-y-6",children:[s.jsx($e,{title:e("title"),description:e("description"),children:s.jsxs(Y,{variant:"outline",onClick:c,disabled:a,children:[a?s.jsx(ve,{className:"mr-2 h-4 w-4 animate-spin"}):s.jsx(et,{className:"mr-2 h-4 w-4"}),t("refresh")]})}),s.jsx("div",{className:"rounded-lg border dark:border-zinc-800",children:s.jsxs(Qt,{children:[s.jsx(Jt,{children:s.jsxs(Ee,{children:[s.jsx(ge,{children:e("columns.status")}),s.jsx(ge,{children:e("columns.agentType")}),s.jsx(ge,{className:"w-[40%]",children:e("columns.prompt")}),s.jsx(ge,{children:e("columns.createdAt")}),s.jsx(ge,{children:e("columns.duration")})]})}),s.jsx(en,{children:a?s.jsx(Ee,{children:s.jsx(re,{colSpan:5,className:"h-32 text-center text-muted-foreground",children:t("loading")})}):r.length===0?s.jsx(Ee,{children:s.jsx(re,{colSpan:5,className:"h-32 text-center text-muted-foreground",children:t("noData")})}):r.map(u=>s.jsxs(Ee,{className:"cursor-pointer hover:bg-muted/50 dark:hover:bg-zinc-800/50",onClick:()=>l(u.id),children:[s.jsx(re,{children:s.jsx(Rx,{status:u.status,label:e(`status.${u.status}`)})}),s.jsx(re,{className:"font-mono text-sm",children:u.agentType}),s.jsx(re,{className:"text-sm text-muted-foreground",children:jx(u.prompt)}),s.jsx(re,{className:"text-sm",children:Tx(u.createdAt)}),s.jsx(re,{className:"text-sm",children:Cx(u.durationMs)})]},u.id))})]})})]})}const Fd={async listAgents(){return(await ee.get("/api/v1/agents")).data},async getAgent(e){return(await ee.get(`/api/v1/agents/${e}`)).data},async executeAgent(e){return(await ee.post("/api/v1/agents/execute",e)).data}};function Px({agent:e,onTest:t,tAvailable:n,tUnavailable:r,tTestAgent:o}){return s.jsxs(Xt,{className:"flex flex-col bg-card dark:bg-zinc-900 border dark:border-zinc-800",children:[s.jsxs(dn,{className:"pb-2",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsx(fn,{className:"text-base leading-tight",children:e.name}),s.jsx(Ne,{variant:"outline",className:"shrink-0 font-mono text-xs",children:e.type})]}),s.jsx("div",{className:"mt-1",children:s.jsx(Ne,{variant:e.isAvailable?"default":"secondary",className:e.isAvailable?"bg-green-500 hover:bg-green-500/80 text-white border-transparent text-xs":"text-muted-foreground text-xs",children:e.isAvailable?n:r})})]}),s.jsx(Yt,{className:"flex-1 pb-2",children:s.jsx(mr,{className:"text-sm leading-relaxed line-clamp-3",children:e.description})}),s.jsx(sl,{className:"pt-2",children:s.jsxs(Y,{size:"sm",variant:"outline",disabled:!e.isAvailable,onClick:()=>t(e),className:"w-full",children:[s.jsx(on,{className:"mr-2 h-3.5 w-3.5"}),o]})})]})}function Ox(){var g;const e=J("aiTools.agentGateway"),t=J("common"),n=Bd.useRouter(),[r,o]=S.useState([]),[a,i]=S.useState(!0),[c,l]=S.useState({open:!1,agent:null,prompt:"",running:!1}),u=S.useCallback(async()=>{i(!0);try{const b=await Fd.listAgents();o(b)}catch{W.error(e("loadError"))}finally{i(!1)}},[e]);S.useEffect(()=>{u()},[u]);const f=b=>{l({open:!0,agent:b,prompt:"",running:!1})},d=()=>{c.running||l(b=>({...b,open:!1,agent:null,prompt:""}))},m=async()=>{if(!(!c.agent||!c.prompt.trim())){l(b=>({...b,running:!0}));try{const b=await Fd.executeAgent({agentType:c.agent.type,prompt:c.prompt.trim(),async:!0});l(p=>({...p,running:!1,open:!1})),b.runId&&W.success(`${e("runId")}: ${b.runId}`,{action:{label:e("viewRun"),onClick:()=>n.push(`/ai-tools/agent-runs/${b.runId}`)},duration:8e3})}catch{l(b=>({...b,running:!1})),W.error(t("operationFailed"))}}};return s.jsxs("div",{className:"space-y-6",children:[s.jsx($e,{title:e("title"),description:e("description"),children:s.jsxs(Y,{variant:"outline",onClick:u,disabled:a,children:[a?s.jsx(ve,{className:"mr-2 h-4 w-4 animate-spin"}):s.jsx(et,{className:"mr-2 h-4 w-4"}),t("refresh")]})}),!a&&r.length===0?s.jsx("div",{className:"flex h-48 items-center justify-center rounded-lg border border-dashed dark:border-zinc-700 text-muted-foreground",children:e("noAgents")}):s.jsx("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3",children:r.map(b=>s.jsx(Px,{agent:b,onTest:f,tAvailable:e("available"),tUnavailable:e("unavailable"),tTestAgent:e("testAgent")},b.type))}),s.jsx(jt,{open:c.open,onOpenChange:b=>{b||d()},children:s.jsxs(mt,{className:"sm:max-w-lg dark:bg-zinc-900 dark:border-zinc-700",children:[s.jsxs(pt,{children:[s.jsx(bt,{children:(g=c.agent)==null?void 0:g.name}),s.jsx(vt,{children:e("testAgent")})]}),s.jsxs("div",{className:"space-y-2 py-2",children:[s.jsx(Ce,{htmlFor:"agent-prompt",children:e("prompt")}),s.jsx(rt,{id:"agent-prompt",placeholder:e("promptPlaceholder"),value:c.prompt,onChange:b=>l(p=>({...p,prompt:b.target.value})),rows:5,disabled:c.running,className:"resize-none dark:bg-zinc-800 dark:border-zinc-700"})]}),s.jsxs(gt,{children:[s.jsx(Y,{variant:"outline",onClick:d,disabled:c.running,children:t("cancel")}),s.jsx(Y,{onClick:m,disabled:c.running||!c.prompt.trim(),children:c.running?s.jsxs(s.Fragment,{children:[s.jsx(ve,{className:"mr-2 h-4 w-4 animate-spin"}),e("running")]}):s.jsxs(s.Fragment,{children:[s.jsx(on,{className:"mr-2 h-4 w-4"}),e("run")]})})]})]})})]})}const ks={async listPending(){return(await ee.get("/api/v1/ai/agent/approval/pending")).data},async getApproval(e){return(await ee.get(`/api/v1/ai/agent/approval/${e}`)).data},async approve(e,t){await ee.post(`/api/v1/ai/agent/approval/${e}/approve`,{response:t})},async reject(e,t){await ee.post(`/api/v1/ai/agent/approval/${e}/reject`,{response:t})}};function kx({status:e}){const t=J("aiTools.approvals"),n={pending:"bg-yellow-500 hover:bg-yellow-500/80 text-white border-transparent",approved:"bg-green-500 hover:bg-green-500/80 text-white border-transparent",rejected:"bg-red-500 hover:bg-red-500/80 text-white border-transparent"};return s.jsx(Ne,{variant:"outline",className:n[e],children:t(e)})}function Dx({approval:e,onApprove:t,onReject:n}){const r=J("aiTools.approvals");J("common");const[o,a]=S.useState(""),[i,c]=S.useState(!1),l=async()=>{c(!0),await t(e.id,o||void 0),c(!1)},u=async()=>{c(!0),await n(e.id,o||void 0),c(!1)};return s.jsxs("div",{className:"space-y-4 rounded-lg border dark:border-zinc-700 bg-muted/30 dark:bg-zinc-800/30 p-4",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-muted-foreground mb-1",children:r("question")}),s.jsx("p",{className:"text-sm whitespace-pre-wrap",children:e.question})]}),e.context&&s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-muted-foreground mb-1",children:"Context"}),s.jsx("pre",{className:"text-xs bg-muted dark:bg-zinc-900 rounded p-2 overflow-auto max-h-40",children:e.context})]}),e.status==="pending"&&s.jsxs("div",{className:"space-y-2",children:[s.jsx(rt,{placeholder:r("responsePlaceholder"),value:o,onChange:f=>a(f.target.value),rows:3,disabled:i,className:"resize-none dark:bg-zinc-800 dark:border-zinc-700"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(Y,{size:"sm",onClick:l,disabled:i,className:"bg-green-600 hover:bg-green-700 text-white",children:[i?s.jsx(ve,{className:"mr-1 h-3.5 w-3.5 animate-spin"}):s.jsx(Jf,{className:"mr-1 h-3.5 w-3.5"}),r("approve")]}),s.jsxs(Y,{size:"sm",variant:"destructive",onClick:u,disabled:i,children:[i?s.jsx(ve,{className:"mr-1 h-3.5 w-3.5 animate-spin"}):s.jsx(da,{className:"mr-1 h-3.5 w-3.5"}),r("reject")]})]})]}),e.response&&s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-muted-foreground mb-1",children:r("response")}),s.jsx("p",{className:"text-sm",children:e.response})]})]})}function Ix(){const e=J("aiTools.approvals"),t=J("common"),[n,r]=S.useState([]),[o,a]=S.useState(!0),[i,c]=S.useState(null),l=S.useRef(null),u=S.useCallback(async()=>{try{const g=await ks.listPending();r(g)}catch{W.error(t("loadDataFailed"))}finally{a(!1)}},[t]);S.useEffect(()=>(u(),l.current=setInterval(u,1e4),()=>{l.current&&clearInterval(l.current)}),[u]);const f=async(g,b)=>{try{await ks.approve(g,b),W.success(e("approveSuccess")),c(null),await u()}catch{W.error(t("operationFailed"))}},d=async(g,b)=>{try{await ks.reject(g,b),W.success(e("rejectSuccess")),c(null),await u()}catch{W.error(t("operationFailed"))}},m=g=>{c(b=>b===g?null:g)};return s.jsxs("div",{className:"space-y-6",children:[s.jsx($e,{title:e("title"),description:e("description"),children:s.jsxs(Y,{variant:"outline",onClick:u,disabled:o,children:[o?s.jsx(ve,{className:"mr-2 h-4 w-4 animate-spin"}):s.jsx(et,{className:"mr-2 h-4 w-4"}),t("refresh")]})}),s.jsx("div",{className:"rounded-lg border dark:border-zinc-800",children:s.jsxs(Qt,{children:[s.jsx(Jt,{children:s.jsxs(Ee,{children:[s.jsx(ge,{className:"w-[40%]",children:e("question")}),s.jsx(ge,{children:e("runId")}),s.jsx(ge,{children:e("createdAt")}),s.jsx(ge,{children:e("status")}),s.jsx(ge,{className:"w-10"})]})}),s.jsx(en,{children:o?s.jsx(Ee,{children:s.jsx(re,{colSpan:5,className:"h-32 text-center text-muted-foreground",children:t("loading")})}):n.length===0?s.jsx(Ee,{children:s.jsx(re,{colSpan:5,className:"h-32 text-center text-muted-foreground",children:e("noPending")})}):n.map(g=>s.jsxs(s.Fragment,{children:[s.jsxs(Ee,{className:"cursor-pointer hover:bg-muted/50 dark:hover:bg-zinc-800/50",onClick:()=>m(g.id),children:[s.jsx(re,{className:"text-sm",children:g.question.length>100?`${g.question.slice(0,100)}...`:g.question}),s.jsxs(re,{className:"font-mono text-xs text-muted-foreground",children:[g.runId.slice(0,8),"..."]}),s.jsx(re,{className:"text-sm",children:new Date(g.createdAt).toLocaleString()}),s.jsx(re,{children:s.jsx(kx,{status:g.status})}),s.jsx(re,{children:i===g.id?s.jsx(Pn,{className:"h-4 w-4 text-muted-foreground"}):s.jsx(An,{className:"h-4 w-4 text-muted-foreground"})})]},g.id),i===g.id&&s.jsx(Ee,{children:s.jsx(re,{colSpan:5,className:"bg-muted/20 dark:bg-zinc-900/40 p-4",children:s.jsx(Dx,{approval:g,onApprove:f,onReject:d})})},`${g.id}-detail`)]}))})]})})]})}const Ds={async listSessions(){return(await ee.get("/api/v1/ai/agent/session")).data},async createSession(e){return(await ee.post("/api/v1/ai/agent/session",{name:e})).data},async closeSession(e){await ee.post(`/api/v1/ai/agent/session/${e}/close`)}};function Mx({status:e}){const t=J("aiTools.sessions");return s.jsx(Ne,{variant:"outline",className:e==="active"?"bg-green-500 hover:bg-green-500/80 text-white border-transparent":"text-muted-foreground",children:t(e)})}function Lx({context:e}){const t=J("aiTools.sessions");return s.jsxs("div",{className:"rounded-lg border dark:border-zinc-700 bg-muted/30 dark:bg-zinc-800/30 p-4",children:[s.jsx("p",{className:"text-sm font-medium text-muted-foreground mb-2",children:t("context")}),s.jsx("pre",{className:"text-xs bg-muted dark:bg-zinc-900 rounded p-3 overflow-auto max-h-60 whitespace-pre-wrap",children:JSON.stringify(e,null,2)})]})}function Hx(){const e=J("aiTools.sessions"),t=J("common"),[n,r]=S.useState([]),[o,a]=S.useState(!0),[i,c]=S.useState(null),[l,u]=S.useState(!1),[f,d]=S.useState(""),[m,g]=S.useState(!1),[b,p]=S.useState(null),v=S.useCallback(async()=>{try{const E=await Ds.listSessions();r(E)}catch{W.error(t("loadDataFailed"))}finally{a(!1)}},[t]);S.useEffect(()=>{v()},[v]);const x=async()=>{g(!0);try{await Ds.createSession(f.trim()||void 0),W.success(e("createSuccess")),u(!1),d(""),await v()}catch{W.error(t("operationFailed"))}finally{g(!1)}},y=async(E,N)=>{N.stopPropagation(),p(E);try{await Ds.closeSession(E),W.success(e("closeSuccess")),await v()}catch{W.error(t("operationFailed"))}finally{p(null)}},w=E=>{c(N=>N===E?null:E)};return s.jsxs("div",{className:"space-y-6",children:[s.jsx($e,{title:e("title"),description:e("description"),children:s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(Y,{variant:"outline",onClick:v,disabled:o,children:[o?s.jsx(ve,{className:"mr-2 h-4 w-4 animate-spin"}):s.jsx(et,{className:"mr-2 h-4 w-4"}),t("refresh")]}),s.jsxs(Y,{onClick:()=>u(!0),children:[s.jsx(On,{className:"mr-2 h-4 w-4"}),e("newSession")]})]})}),s.jsx("div",{className:"rounded-lg border dark:border-zinc-800",children:s.jsxs(Qt,{children:[s.jsx(Jt,{children:s.jsxs(Ee,{children:[s.jsx(ge,{className:"w-[30%]",children:e("name")}),s.jsx(ge,{children:e("status")}),s.jsx(ge,{children:e("runs")}),s.jsx(ge,{children:e("createdAt")}),s.jsx(ge,{className:"text-right",children:t("actions")})]})}),s.jsx(en,{children:o?s.jsx(Ee,{children:s.jsx(re,{colSpan:5,className:"h-32 text-center text-muted-foreground",children:t("loading")})}):n.length===0?s.jsx(Ee,{children:s.jsx(re,{colSpan:5,className:"h-32 text-center text-muted-foreground",children:e("noSessions")})}):n.map(E=>s.jsxs(s.Fragment,{children:[s.jsxs(Ee,{className:"cursor-pointer hover:bg-muted/50 dark:hover:bg-zinc-800/50",onClick:()=>w(E.id),children:[s.jsx(re,{className:"font-medium text-sm",children:E.name??s.jsx("span",{className:"text-muted-foreground italic",children:e("unnamed")})}),s.jsx(re,{children:s.jsx(Mx,{status:E.status})}),s.jsx(re,{className:"text-sm text-muted-foreground",children:E.runIds.length}),s.jsx(re,{className:"text-sm",children:new Date(E.createdAt).toLocaleString()}),s.jsx(re,{className:"text-right",children:E.status==="active"&&s.jsxs(Y,{size:"sm",variant:"outline",onClick:N=>y(E.id,N),disabled:b===E.id,className:"h-7 px-2 text-xs",children:[b===E.id?s.jsx(ve,{className:"h-3 w-3 animate-spin"}):s.jsx(ma,{className:"h-3 w-3"}),s.jsx("span",{className:"ml-1",children:e("close")})]})})]},E.id),i===E.id&&s.jsx(Ee,{children:s.jsx(re,{colSpan:5,className:"bg-muted/20 dark:bg-zinc-900/40 p-4",children:s.jsx(Lx,{context:E.context})})},`${E.id}-context`)]}))})]})}),s.jsx(jt,{open:l,onOpenChange:E=>{m||u(E)},children:s.jsxs(mt,{className:"sm:max-w-md dark:bg-zinc-900 dark:border-zinc-700",children:[s.jsxs(pt,{children:[s.jsx(bt,{children:e("newSession")}),s.jsx(vt,{children:e("sessionName")})]}),s.jsxs("div",{className:"space-y-2 py-2",children:[s.jsx(Ce,{htmlFor:"session-name",children:e("name")}),s.jsx(Je,{id:"session-name",placeholder:e("namePlaceholder"),value:f,onChange:E=>d(E.target.value),disabled:m,onKeyDown:E=>{E.key==="Enter"&&x()},className:"dark:bg-zinc-800 dark:border-zinc-700"})]}),s.jsxs(gt,{children:[s.jsx(Y,{variant:"outline",onClick:()=>u(!1),disabled:m,children:t("cancel")}),s.jsxs(Y,{onClick:x,disabled:m,children:[m&&s.jsx(ve,{className:"mr-2 h-4 w-4 animate-spin"}),t("create")]})]})]})})]})}const Is={async listAgents(){return(await ee.get("/api/v1/agents/external")).data},async registerAgent(e){return(await ee.post("/api/v1/agents/external/register",e)).data},async unregisterAgent(e){await ee.post("/api/v1/agents/external/unregister",{agentId:e})}},Bx=15e3;function Fx({status:e}){const t=J("aiTools.agentMarket");return s.jsx(Ne,{variant:"outline",className:e==="online"?"bg-green-500 hover:bg-green-500/80 text-white border-transparent":"text-muted-foreground",children:t(e)})}function Ux({capabilities:e}){return!e||e.length===0?s.jsx("span",{className:"text-muted-foreground",children:"—"}):s.jsx("div",{className:"flex flex-wrap gap-1",children:e.map(t=>s.jsx(Ne,{variant:"secondary",className:"text-xs",children:t},t))})}const Ud={agentId:"",name:"",description:"",endpoint:"",capabilities:""};function Gx(){const e=J("aiTools.agentMarket"),t=J("common"),[n,r]=S.useState([]),[o,a]=S.useState(!0),[i,c]=S.useState(!1),[l,u]=S.useState(Ud),[f,d]=S.useState(!1),[m,g]=S.useState(null),b=S.useCallback(async()=>{try{const y=await Is.listAgents();r(y)}catch{W.error(e("loadError"))}finally{a(!1)}},[e]);S.useEffect(()=>{b();const y=setInterval(b,Bx);return()=>clearInterval(y)},[b]);const p=async()=>{d(!0);try{const y=l.capabilities.split(",").map(w=>w.trim()).filter(Boolean);await Is.registerAgent({agentId:l.agentId.trim(),name:l.name.trim(),description:l.description.trim()||void 0,endpoint:l.endpoint.trim(),capabilities:y.length>0?y:void 0}),W.success(e("registerSuccess")),c(!1),u(Ud),await b()}catch{W.error(t("operationFailed"))}finally{d(!1)}},v=async y=>{g(y);try{await Is.unregisterAgent(y),W.success(e("unregisterSuccess")),await b()}catch{W.error(t("operationFailed"))}finally{g(null)}},x=l.agentId.trim()&&l.name.trim()&&l.endpoint.trim();return s.jsxs("div",{className:"space-y-6",children:[s.jsx($e,{title:e("title"),description:e("description"),children:s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(Y,{variant:"outline",onClick:b,disabled:o,children:[o?s.jsx(ve,{className:"mr-2 h-4 w-4 animate-spin"}):s.jsx(et,{className:"mr-2 h-4 w-4"}),t("refresh")]}),s.jsxs(Y,{onClick:()=>c(!0),children:[s.jsx(On,{className:"mr-2 h-4 w-4"}),e("registerAgent")]})]})}),s.jsx("div",{className:"rounded-lg border dark:border-zinc-800",children:s.jsxs(Qt,{children:[s.jsx(Jt,{children:s.jsxs(Ee,{children:[s.jsx(ge,{className:"w-[18%]",children:e("name")}),s.jsx(ge,{className:"w-[14%]",children:e("agentId")}),s.jsx(ge,{className:"w-[20%]",children:e("endpoint")}),s.jsx(ge,{children:e("capabilities")}),s.jsx(ge,{className:"w-[10%]",children:e("status")}),s.jsx(ge,{className:"w-[14%]",children:e("lastHeartbeat")}),s.jsx(ge,{className:"text-right w-[10%]",children:t("actions")})]})}),s.jsx(en,{children:o?s.jsx(Ee,{children:s.jsx(re,{colSpan:7,className:"h-32 text-center text-muted-foreground",children:t("loading")})}):n.length===0?s.jsx(Ee,{children:s.jsx(re,{colSpan:7,className:"h-32 text-center text-muted-foreground",children:e("noAgents")})}):n.map(y=>s.jsxs(Ee,{children:[s.jsx(re,{className:"font-medium text-sm",children:y.name}),s.jsx(re,{children:s.jsx("code",{className:"text-xs font-mono bg-muted dark:bg-zinc-800 px-1.5 py-0.5 rounded",children:y.agentId})}),s.jsx(re,{className:"text-sm text-muted-foreground max-w-[160px] truncate",title:y.endpoint,children:y.endpoint}),s.jsx(re,{children:s.jsx(Ux,{capabilities:y.capabilities})}),s.jsx(re,{children:s.jsx(Fx,{status:y.status})}),s.jsx(re,{className:"text-sm text-muted-foreground",children:y.lastHeartbeatAt?new Date(y.lastHeartbeatAt).toLocaleString():e("never")}),s.jsx(re,{className:"text-right",children:s.jsxs(Y,{size:"sm",variant:"outline",onClick:()=>v(y.agentId),disabled:m===y.agentId,className:"h-7 px-2 text-xs text-destructive hover:text-destructive",children:[m===y.agentId?s.jsx(ve,{className:"h-3 w-3 animate-spin"}):s.jsx(eo,{className:"h-3 w-3"}),s.jsx("span",{className:"ml-1",children:e("unregister")})]})})]},y.id))})]})}),s.jsx(jt,{open:i,onOpenChange:y=>{f||c(y)},children:s.jsxs(mt,{className:"sm:max-w-lg dark:bg-zinc-900 dark:border-zinc-700",children:[s.jsxs(pt,{children:[s.jsx(bt,{children:e("registerAgent")}),s.jsx(vt,{children:e("description")})]}),s.jsxs("div",{className:"space-y-4 py-2",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsxs(Ce,{htmlFor:"agent-id",children:[e("agentId")," *"]}),s.jsx(Je,{id:"agent-id",placeholder:e("agentIdPlaceholder"),value:l.agentId,onChange:y=>u(w=>({...w,agentId:y.target.value})),disabled:f,className:"dark:bg-zinc-800 dark:border-zinc-700 font-mono"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs(Ce,{htmlFor:"agent-name",children:[e("name")," *"]}),s.jsx(Je,{id:"agent-name",placeholder:e("namePlaceholder"),value:l.name,onChange:y=>u(w=>({...w,name:y.target.value})),disabled:f,className:"dark:bg-zinc-800 dark:border-zinc-700"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ce,{htmlFor:"agent-desc",children:t("description")}),s.jsx(rt,{id:"agent-desc",placeholder:t("noDescription"),value:l.description,onChange:y=>u(w=>({...w,description:y.target.value})),disabled:f,rows:2,className:"dark:bg-zinc-800 dark:border-zinc-700 resize-none"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs(Ce,{htmlFor:"agent-endpoint",children:[e("endpoint")," *"]}),s.jsx(Je,{id:"agent-endpoint",placeholder:e("endpointPlaceholder"),value:l.endpoint,onChange:y=>u(w=>({...w,endpoint:y.target.value})),disabled:f,className:"dark:bg-zinc-800 dark:border-zinc-700"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ce,{htmlFor:"agent-capabilities",children:e("capabilities")}),s.jsx(Je,{id:"agent-capabilities",placeholder:e("capabilitiesPlaceholder"),value:l.capabilities,onChange:y=>u(w=>({...w,capabilities:y.target.value})),disabled:f,className:"dark:bg-zinc-800 dark:border-zinc-700"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:e("capabilitiesHint")})]})]}),s.jsxs(gt,{children:[s.jsx(Y,{variant:"outline",onClick:()=>c(!1),disabled:f,children:t("cancel")}),s.jsxs(Y,{onClick:p,disabled:f||!x,children:[f&&s.jsx(ve,{className:"mr-2 h-4 w-4 animate-spin"}),e("register")]})]})]})})]})}const yn={async createPlan(e){return(await ee.post("/api/v1/ai/orchestrator/plan",{goal:e})).data},async executePlan(e){return(await ee.post(`/api/v1/ai/orchestrator/plan/${e}/run`,{})).data},async listPlans(){return(await ee.get("/api/v1/ai/orchestrator/plan")).data},async getPlan(e){return(await ee.get(`/api/v1/ai/orchestrator/plan/${e}`)).data},async submitFeedback(e,t,n){await ee.post(`/api/v1/ai/orchestrator/plan/${e}/feedback`,{rating:t,comment:n})}};function zx({status:e}){const t=J("aiTools.orchestrator"),n={pending:"bg-zinc-500 hover:bg-zinc-500/80 text-white border-transparent",running:"bg-blue-500 hover:bg-blue-500/80 text-white border-transparent",completed:"bg-green-500 hover:bg-green-500/80 text-white border-transparent",failed:"bg-red-500 hover:bg-red-500/80 text-white border-transparent"};return s.jsx(Ne,{variant:"outline",className:n[e],children:t(e)})}function Gd({steps:e}){const t=J("aiTools.orchestrator");return s.jsxs("div",{className:"space-y-2",children:[s.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:t("steps")}),s.jsx("div",{className:"space-y-2",children:e.map(n=>s.jsxs("div",{className:"rounded-lg border dark:border-zinc-700 bg-muted/20 dark:bg-zinc-800/30 p-3 space-y-1",children:[s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.jsx(Ne,{variant:"outline",className:"font-mono text-xs dark:border-zinc-600",children:n.stepId}),s.jsx(Ne,{variant:"secondary",className:"text-xs dark:bg-zinc-700",children:n.agentType}),s.jsx(zx,{status:n.status})]}),s.jsx("p",{className:"text-sm text-foreground/80",children:n.prompt}),n.output&&s.jsx("pre",{className:"text-xs bg-muted dark:bg-zinc-900 rounded p-2 overflow-auto max-h-32 mt-1",children:n.output})]},n.stepId))})]})}function $x({planId:e,onSubmitted:t}){const n=J("aiTools.orchestrator"),[r,o]=S.useState(0),[a,i]=S.useState(0),[c,l]=S.useState(""),[u,f]=S.useState(!1),d=async()=>{if(r!==0){f(!0);try{await yn.submitFeedback(e,r,c||void 0),W.success(n("feedbackThanks")),t()}catch{W.error(n("submitFeedback"))}finally{f(!1)}}};return s.jsxs("div",{className:"space-y-3 rounded-lg border dark:border-zinc-700 bg-muted/20 dark:bg-zinc-800/30 p-4",children:[s.jsx("p",{className:"text-sm font-medium",children:n("feedback")}),s.jsx("div",{className:"flex gap-1",children:[1,2,3,4,5].map(m=>s.jsx("button",{type:"button",onClick:()=>o(m),onMouseEnter:()=>i(m),onMouseLeave:()=>i(0),className:"focus:outline-none",children:s.jsx(ah,{className:`h-6 w-6 transition-colors ${m<=(a||r)?"fill-yellow-400 text-yellow-400":"text-muted-foreground"}`})},m))}),s.jsx(rt,{placeholder:n("commentPlaceholder"),value:c,onChange:m=>l(m.target.value),rows:2,disabled:u,className:"resize-none dark:bg-zinc-800 dark:border-zinc-700"}),s.jsxs(Y,{size:"sm",onClick:d,disabled:u||r===0,children:[u&&s.jsx(ve,{className:"mr-1 h-3.5 w-3.5 animate-spin"}),n("submitFeedback")]})]})}function Wx({status:e}){const t=J("aiTools.orchestrator"),n={draft:"bg-zinc-500 hover:bg-zinc-500/80 text-white border-transparent",running:"bg-blue-500 hover:bg-blue-500/80 text-white border-transparent",completed:"bg-green-500 hover:bg-green-500/80 text-white border-transparent",failed:"bg-red-500 hover:bg-red-500/80 text-white border-transparent"};return s.jsx(Ne,{variant:"outline",className:n[e],children:t(e)})}function Vx(){const e=J("aiTools.orchestrator"),t=J("common"),[n,r]=S.useState(""),[o,a]=S.useState(!1),[i,c]=S.useState(!1),[l,u]=S.useState(null),[f,d]=S.useState(!1),[m,g]=S.useState([]),[b,p]=S.useState(!0),[v,x]=S.useState(null),y=S.useRef(null),w=()=>{y.current&&(clearInterval(y.current),y.current=null)},E=S.useCallback(async()=>{try{const _=await yn.listPlans();g(_)}catch{W.error(t("loadDataFailed"))}finally{p(!1)}},[t]);S.useEffect(()=>{E()},[E]),S.useEffect(()=>()=>w(),[]);const N=async()=>{if(n.trim()){a(!0),u(null),d(!1);try{const _=await yn.createPlan(n.trim());u(_),W.success(e("planCreated")),await E()}catch{W.error(t("operationFailed"))}finally{a(!1)}}},j=async()=>{if(l){c(!0),d(!1);try{const _=await yn.executePlan(l.id);u(_),y.current=setInterval(async()=>{try{const I=await yn.getPlan(l.id);u(I),(I.status==="completed"||I.status==="failed")&&(w(),c(!1),I.status==="completed"?W.success(e("planCompleted")):W.error(e("planFailed")),await E())}catch{w(),c(!1)}},3e3)}catch{W.error(t("operationFailed")),c(!1)}}},R=_=>{x(I=>I===_?null:_)};return s.jsxs("div",{className:"space-y-6",children:[s.jsx($e,{title:e("title"),description:e("description")}),s.jsxs("div",{className:"rounded-lg border dark:border-zinc-800 p-4 space-y-4 bg-card dark:bg-zinc-900/40",children:[s.jsx(rt,{placeholder:e("goalPlaceholder"),value:n,onChange:_=>r(_.target.value),rows:4,disabled:o||i,className:"resize-none dark:bg-zinc-800 dark:border-zinc-700"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(Y,{onClick:N,disabled:o||i||!n.trim(),children:[o?s.jsx(ve,{className:"mr-2 h-4 w-4 animate-spin"}):s.jsx(Jr,{className:"mr-2 h-4 w-4"}),e(o?"generating":"generatePlan")]}),l&&l.status==="draft"&&s.jsxs(Y,{variant:"secondary",onClick:j,disabled:i,children:[i?s.jsx(ve,{className:"mr-2 h-4 w-4 animate-spin"}):s.jsx(on,{className:"mr-2 h-4 w-4"}),e(i?"executing":"executePlan")]})]}),l&&s.jsxs("div",{className:"space-y-4 pt-2",children:[s.jsx(Gd,{steps:l.plan}),l.result&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:e("result")}),s.jsx("pre",{className:"text-xs bg-muted dark:bg-zinc-900 rounded p-3 overflow-auto max-h-48 whitespace-pre-wrap",children:l.result})]}),l.status==="completed"&&!f&&s.jsx($x,{planId:l.id,onSubmitted:()=>d(!0)})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("p",{className:"text-sm font-semibold",children:e("recentPlans")}),s.jsx("div",{className:"rounded-lg border dark:border-zinc-800",children:s.jsxs(Qt,{children:[s.jsx(Jt,{children:s.jsxs(Ee,{children:[s.jsx(ge,{className:"w-[40%]",children:e("goal")}),s.jsx(ge,{children:e("status")}),s.jsx(ge,{children:e("stepsProgress")}),s.jsx(ge,{children:t("createdAt")}),s.jsx(ge,{className:"w-10"})]})}),s.jsx(en,{children:b?s.jsx(Ee,{children:s.jsx(re,{colSpan:5,className:"h-32 text-center text-muted-foreground",children:t("loading")})}):m.length===0?s.jsx(Ee,{children:s.jsx(re,{colSpan:5,className:"h-32 text-center text-muted-foreground",children:e("noPlans")})}):m.map(_=>s.jsxs(s.Fragment,{children:[s.jsxs(Ee,{className:"cursor-pointer hover:bg-muted/50 dark:hover:bg-zinc-800/50",onClick:()=>R(_.id),children:[s.jsx(re,{className:"text-sm",children:_.goal.length>80?`${_.goal.slice(0,80)}...`:_.goal}),s.jsx(re,{children:s.jsx(Wx,{status:_.status})}),s.jsxs(re,{className:"text-sm text-muted-foreground",children:[_.stepsDone,"/",_.stepsTotal]}),s.jsx(re,{className:"text-sm",children:new Date(_.createdAt).toLocaleString()}),s.jsx(re,{children:v===_.id?s.jsx(Pn,{className:"h-4 w-4 text-muted-foreground"}):s.jsx(An,{className:"h-4 w-4 text-muted-foreground"})})]},_.id),v===_.id&&s.jsx(Ee,{children:s.jsx(re,{colSpan:5,className:"bg-muted/20 dark:bg-zinc-900/40 p-4",children:s.jsxs("div",{className:"space-y-4",children:[s.jsx(Gd,{steps:_.plan}),_.result&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:e("result")}),s.jsx("pre",{className:"text-xs bg-muted dark:bg-zinc-900 rounded p-3 overflow-auto max-h-48 whitespace-pre-wrap",children:_.result})]})]})})},`${_.id}-detail`)]}))})]})})]})]})}const zd={"/":Hb,"/workspaces":xv,"/skills":Vy,"/skill-market":qy,"/agent-runs":Ax,"/agents":Ox,"/approvals":Ix,"/sessions":Hx,"/agent-market":Gx,"/orchestrator":Vx};function qx({path:e}){const t=zd[e]??zd["/"];return h.createElement(t)}const zr=new WeakMap;function Xx(e,{path:t}){const n=window.__OCTO_REACT;if(!n){console.error("[octo-ai] window.__OCTO_REACT not found — host app must expose it");return}let r=zr.get(e);r||(r=n.ReactDOMClient.createRoot(e),zr.set(e,r)),r.render(h.createElement(qx,{path:t}))}function Yx(e){const t=zr.get(e);t&&(t.unmount(),zr.delete(e))}window.__OCTO_MODULES??(window.__OCTO_MODULES={}),window.__OCTO_MODULES.ai={mount:Xx,unmount:Yx}})(window.__OCTO_REACT.React,window.__OCTO_REACT.ReactDOM);
|