@jiangxiaosheng/digital-agent-platform 1.0.3 → 1.0.5

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.
Files changed (119) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +71 -67
  3. package/.next/app-path-routes-manifest.json +1 -1
  4. package/.next/build-manifest.json +2 -2
  5. package/.next/cache/.tsbuildinfo +1 -1
  6. package/.next/cache/eslint/.cache_1bmmeh3 +1 -1
  7. package/.next/cache/webpack/client-production/0.pack +0 -0
  8. package/.next/cache/webpack/client-production/1.pack +0 -0
  9. package/.next/cache/webpack/client-production/3.pack +0 -0
  10. package/.next/cache/webpack/client-production/4.pack +0 -0
  11. package/.next/cache/webpack/client-production/5.pack +0 -0
  12. package/.next/cache/webpack/client-production/6.pack +0 -0
  13. package/.next/cache/webpack/client-production/7.pack +0 -0
  14. package/.next/cache/webpack/client-production/8.pack +0 -0
  15. package/.next/cache/webpack/client-production/9.pack +0 -0
  16. package/.next/cache/webpack/client-production/index.pack +0 -0
  17. package/.next/cache/webpack/client-production/index.pack.old +0 -0
  18. package/.next/cache/webpack/edge-server-production/1.pack +0 -0
  19. package/.next/cache/webpack/edge-server-production/index.pack +0 -0
  20. package/.next/cache/webpack/edge-server-production/index.pack.old +0 -0
  21. package/.next/cache/webpack/server-production/0.pack +0 -0
  22. package/.next/cache/webpack/server-production/1.pack +0 -0
  23. package/.next/cache/webpack/server-production/3.pack +0 -0
  24. package/.next/cache/webpack/server-production/4.pack +0 -0
  25. package/.next/cache/webpack/server-production/5.pack +0 -0
  26. package/.next/cache/webpack/server-production/6.pack +0 -0
  27. package/.next/cache/webpack/server-production/7.pack +0 -0
  28. package/.next/cache/webpack/server-production/8.pack +0 -0
  29. package/.next/cache/webpack/server-production/index.pack +0 -0
  30. package/.next/cache/webpack/server-production/index.pack.old +0 -0
  31. package/.next/next-minimal-server.js.nft.json +1 -1
  32. package/.next/next-server.js.nft.json +1 -1
  33. package/.next/prerender-manifest.json +1 -1
  34. package/.next/server/app/[locale]/agents/[id]/chat/page_client-reference-manifest.js +1 -1
  35. package/.next/server/app/[locale]/agents/[id]/edit/page.js +1 -1
  36. package/.next/server/app/[locale]/agents/[id]/edit/page.js.nft.json +1 -1
  37. package/.next/server/app/[locale]/agents/[id]/edit/page_client-reference-manifest.js +1 -1
  38. package/.next/server/app/[locale]/agents/new/page.js +1 -1
  39. package/.next/server/app/[locale]/agents/new/page.js.nft.json +1 -1
  40. package/.next/server/app/[locale]/agents/new/page_client-reference-manifest.js +1 -1
  41. package/.next/server/app/[locale]/agents/page_client-reference-manifest.js +1 -1
  42. package/.next/server/app/[locale]/knowledge/page_client-reference-manifest.js +1 -1
  43. package/.next/server/app/[locale]/page_client-reference-manifest.js +1 -1
  44. package/.next/server/app/[locale]/settings/page.js +1 -1
  45. package/.next/server/app/[locale]/settings/page.js.nft.json +1 -1
  46. package/.next/server/app/[locale]/settings/page_client-reference-manifest.js +1 -1
  47. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  48. package/.next/server/app/_not-found.html +1 -1
  49. package/.next/server/app/_not-found.rsc +1 -1
  50. package/.next/server/app/api/agents/[id]/route_client-reference-manifest.js +1 -1
  51. package/.next/server/app/api/agents/route_client-reference-manifest.js +1 -1
  52. package/.next/server/app/api/auth-config/test/route_client-reference-manifest.js +1 -1
  53. package/.next/server/app/api/bash-output/route_client-reference-manifest.js +1 -1
  54. package/.next/server/app/api/chat/[agentId]/route_client-reference-manifest.js +1 -1
  55. package/.next/server/app/api/env-vars/[key]/route_client-reference-manifest.js +1 -1
  56. package/.next/server/app/api/env-vars/route_client-reference-manifest.js +1 -1
  57. package/.next/server/app/api/env-vars/scan/route.js +1 -1
  58. package/.next/server/app/api/env-vars/scan/route_client-reference-manifest.js +1 -1
  59. package/.next/server/app/api/file-serve/route_client-reference-manifest.js +1 -1
  60. package/.next/server/app/api/fs/browse/route_client-reference-manifest.js +1 -1
  61. package/.next/server/app/api/knowledge/[id]/documents/[docId]/route_client-reference-manifest.js +1 -1
  62. package/.next/server/app/api/knowledge/[id]/route_client-reference-manifest.js +1 -1
  63. package/.next/server/app/api/knowledge/[id]/upload/route.js +1 -1
  64. package/.next/server/app/api/knowledge/[id]/upload/route_client-reference-manifest.js +1 -1
  65. package/.next/server/app/api/knowledge/route_client-reference-manifest.js +1 -1
  66. package/.next/server/app/api/knowledge/search/route_client-reference-manifest.js +1 -1
  67. package/.next/server/app/api/models/route.js +1 -1
  68. package/.next/server/app/api/models/route_client-reference-manifest.js +1 -1
  69. package/.next/server/app/api/models-config/route_client-reference-manifest.js +1 -1
  70. package/.next/server/app/api/models-config/test/route_client-reference-manifest.js +1 -1
  71. package/.next/server/app/api/sessions/[agentId]/[sessionId]/route_client-reference-manifest.js +1 -1
  72. package/.next/server/app/api/sessions/[agentId]/route_client-reference-manifest.js +1 -1
  73. package/.next/server/app/api/sessions/history/route_client-reference-manifest.js +1 -1
  74. package/.next/server/app/api/settings/route_client-reference-manifest.js +1 -1
  75. package/.next/server/app/api/skills/[name]/route.js +1 -1
  76. package/.next/server/app/api/skills/[name]/route_client-reference-manifest.js +1 -1
  77. package/.next/server/app/api/skills/install/route.js +1 -1
  78. package/.next/server/app/api/skills/install/route_client-reference-manifest.js +1 -1
  79. package/.next/server/app/api/skills/route.js +1 -1
  80. package/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
  81. package/.next/server/app/api/skills/search/route_client-reference-manifest.js +1 -1
  82. package/.next/server/app/api/tts/route_client-reference-manifest.js +1 -1
  83. package/.next/server/app/api/voice-provider/route_client-reference-manifest.js +1 -1
  84. package/.next/server/app/api/workspace-files/route_client-reference-manifest.js +1 -1
  85. package/.next/server/app/index.html +1 -1
  86. package/.next/server/app/index.rsc +1 -1
  87. package/.next/server/app/page_client-reference-manifest.js +1 -1
  88. package/.next/server/app-paths-manifest.json +17 -17
  89. package/.next/server/chunks/1354.js +1 -0
  90. package/.next/server/chunks/7420.js +1 -0
  91. package/.next/server/chunks/7555.js +1 -0
  92. package/.next/server/chunks/9576.js +1 -0
  93. package/.next/server/middleware-manifest.json +4 -4
  94. package/.next/server/pages/404.html +1 -1
  95. package/.next/server/pages/500.html +1 -1
  96. package/.next/server/pages/_error.js +1 -1
  97. package/.next/static/chunks/3763-85d191447a96df85.js +1 -0
  98. package/.next/static/chunks/5822-2ca912318cc34b52.js +1 -0
  99. package/.next/static/chunks/5964-cdb47df650c9e359.js +1 -0
  100. package/.next/static/chunks/6009-1f2b513c3fe454c1.js +1 -0
  101. package/.next/static/chunks/app/[locale]/agents/[id]/edit/{page-8d0cc73c7aff7774.js → page-74a70d27b56ead9b.js} +1 -1
  102. package/.next/static/chunks/app/[locale]/agents/new/{page-aeaa197c0ccfd2f9.js → page-11833508212d4d80.js} +1 -1
  103. package/.next/static/chunks/app/[locale]/knowledge/{page-7b4b6aa0a07d7da3.js → page-4928374e08e30a81.js} +1 -1
  104. package/.next/static/chunks/app/[locale]/settings/page-472b2cd8df49bf94.js +1 -0
  105. package/.next/trace +4 -4
  106. package/package.json +1 -1
  107. package/src/app/[locale]/settings/page.tsx +3 -3
  108. package/src/app/api/models/route.ts +8 -2
  109. package/src/components/agents/model-selector.tsx +6 -0
  110. package/src/lib/skills.ts +2 -1
  111. package/.next/server/chunks/1285.js +0 -1
  112. package/.next/server/chunks/2112.js +0 -1
  113. package/.next/server/chunks/4125.js +0 -1
  114. package/.next/static/chunks/2733-714d0e6cd51477c7.js +0 -1
  115. package/.next/static/chunks/3923-e04a628626d77a16.js +0 -1
  116. package/.next/static/chunks/6742-ad22486f7c4c8592.js +0 -1
  117. package/.next/static/chunks/app/[locale]/settings/page-71d67c3b9f712584.js +0 -1
  118. /package/.next/static/{jzQoM_kWiDDx3mIoxV6tk → rUwWYP4-J64RRKJv93Ihp}/_buildManifest.js +0 -0
  119. /package/.next/static/{jzQoM_kWiDDx3mIoxV6tk → rUwWYP4-J64RRKJv93Ihp}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6742],{8867:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(7401).A)("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},1719:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(7401).A)("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},6967:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(7401).A)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},853:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(7401).A)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},6609:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(7401).A)("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]])},8050:(e,t,n)=>{function r(e,t,n){if(!t.has(e))throw TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function o(e,t){var n=r(e,t,"get");return n.get?n.get.call(e):n.value}function i(e,t,n){var o=r(e,t,"set");return!function(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw TypeError("attempted to set read only private field");t.value=n}}(e,o,n),n}n.d(t,{N:()=>m});var l,a,u=n(2115),s=n(8166),c=n(8068),f=n(2317),d=n(5155),p=Object.defineProperty,h=(e,t)=>p(e,"name",{value:t,configurable:!0});function m(e){let t=e+"CollectionProvider",[n,r]=(0,s.A)(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=h(e=>{let{scope:t,children:n}=e,r=u.useRef(null),i=u.useRef(new Map).current;return(0,d.jsx)(o,{scope:t,itemMap:i,collectionRef:r,children:n})},"CollectionProvider");l.displayName=t;let a=e+"CollectionSlot",p=(0,f.TL)(a),m=u.forwardRef((e,t)=>{let{scope:n,children:r}=e,o=i(a,n),l=(0,c.s)(t,o.collectionRef);return(0,d.jsx)(p,{ref:l,children:r})});m.displayName=a;let v=e+"CollectionItemSlot",g="data-radix-collection-item",y=(0,f.TL)(v),w=u.forwardRef((e,t)=>{let{scope:n,children:r,...o}=e,l=u.useRef(null),a=(0,c.s)(t,l),s=i(v,n);return u.useEffect(()=>(s.itemMap.set(l,{ref:l,...o}),()=>void s.itemMap.delete(l))),(0,d.jsx)(y,{[g]:"",ref:a,children:r})});function x(t){let n=i(e+"CollectionConsumer",t);return u.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll("[".concat(g,"]")));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return w.displayName=v,h(x,"useCollection"),[{Provider:l,Slot:m,ItemSlot:w},x,r]}h(m,"createCollection");var v=new WeakMap,g=(l=new WeakMap,h(a=class e extends Map{set(e,t){return v.get(this)&&(this.has(e)?o(this,l)[o(this,l).indexOf(e)]=e:o(this,l).push(e)),super.set(e,t),this}insert(e,t,n){let r;let i=this.has(t),a=o(this,l).length,u=x(e),s=u>=0?u:a+u,c=s<0||s>=a?-1:s;if(c===this.size||i&&c===this.size-1||-1===c)return this.set(t,n),this;let f=this.size+(i?0:1);u<0&&s++;let d=[...o(this,l)],p=!1;for(let e=s;e<f;e++)if(s===e){let o=d[e];d[e]===t&&(o=d[e+1]),i&&this.delete(t),r=this.get(o),this.set(t,n)}else{p||d[e-1]!==t||(p=!0);let n=d[p?e:e-1],o=r;r=this.get(n),this.delete(n),this.set(n,o)}return this}with(t,n,r){let o=new e(this);return o.insert(t,n,r),o}before(e){let t=o(this,l).indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=o(this,l).indexOf(e);return -1===r?this:this.insert(r,t,n)}after(e){let t=o(this,l).indexOf(e);if(-1!==(t=-1===t||t===this.size-1?-1:t+1))return this.entryAt(t)}setAfter(e,t,n){let r=o(this,l).indexOf(e);return -1===r?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return i(this,l,[]),super.clear()}delete(e){let t=super.delete(e);return t&&o(this,l).splice(o(this,l).indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return void 0!==t&&this.delete(t)}at(e){let t=y(o(this,l),e);if(void 0!==t)return this.get(t)}entryAt(e){let t=y(o(this,l),e);if(void 0!==t)return[t,this.get(t)]}indexOf(e){return o(this,l).indexOf(e)}keyAt(e){return y(o(this,l),e)}from(e,t){let n=this.indexOf(e);if(-1===n)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(-1===n)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return -1}filter(t,n){let r=[],o=0;for(let e of this)Reflect.apply(t,n,[e,o,this])&&r.push(e),o++;return new e(r)}map(t,n){let r=[],o=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,o,this])]),o++;return new e(r)}reduce(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let[r,o]=t,i=0,l=null!=o?o:this.at(0);for(let e of this)l=0===i&&1===t.length?e:Reflect.apply(r,this,[l,e,i,this]),i++;return l}reduceRight(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let[r,o]=t,i=null!=o?o:this.at(-1);for(let e=this.size-1;e>=0;e--){let n=this.at(e);i=e===this.size-1&&1===t.length?n:Reflect.apply(r,this,[i,n,e,this])}return i}toSorted(t){return new e([...this.entries()].sort(t))}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];let o=[...this.entries()];return o.splice(...n),new e(o)}slice(t,n){let r=new e,o=this.size-1;if(void 0===t)return r;t<0&&(t+=this.size),void 0!==n&&n>0&&(o=n-1);for(let e=t;e<=o;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}constructor(e){super(e),function(e,t,n){(function(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,n)}(this,l,{writable:!0,value:void 0}),i(this,l,[...super.keys()]),v.set(this,!0)}},"OrderedDict"),a);function y(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);let n=w(e,t);return -1===n?void 0:e[n]}function w(e,t){let n=e.length,r=x(t),o=r>=0?r:n+r;return o<0||o>=n?-1:o}function x(e){return e!=e||0===e?0:Math.trunc(e)}function b(e,t){if(e===t)return!0;if("object"!=typeof e||"object"!=typeof t||null==e||null==t)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}function S(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function R(e,t){return e[1].element&&t[1].element?S(e[1].element,t[1].element)?-1:1:0}function C(e){return new MutationObserver(t=>{for(let n of t)if("childList"===n.type){e();return}})}h(y,"at"),h(w,"toSafeIndex"),h(x,"toSafeInteger"),h(function(e){let t=e+"CollectionProvider",[n,r]=(0,s.A)(t),[o,i]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new g,setItemMap:h(()=>void 0,"setItemMap")}),l=h(e=>{let{state:t,...n}=e;return t?(0,d.jsx)(p,{...n,state:t}):(0,d.jsx)(a,{...n})},"CollectionProvider");l.displayName=t;let a=h(e=>{let t=A();return(0,d.jsx)(p,{...e,state:t})},"CollectionInit");a.displayName=t+"Init";let p=h(e=>{let{scope:t,children:n,state:r}=e,i=u.useRef(null),[l,a]=u.useState(null),s=(0,c.s)(i,a),[f,p]=r;return u.useEffect(()=>{if(!l)return;let e=C(()=>{});return e.observe(l,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[l]),(0,d.jsx)(o,{scope:t,itemMap:f,setItemMap:p,collectionRef:s,collectionRefObject:i,collectionElement:l,children:n})},"CollectionProviderImpl");p.displayName=t+"Impl";let m=e+"CollectionSlot",v=(0,f.TL)(m),y=u.forwardRef((e,t)=>{let{scope:n,children:r}=e,o=i(m,n),l=(0,c.s)(t,o.collectionRef);return(0,d.jsx)(v,{ref:l,children:r})});y.displayName=m;let w=e+"CollectionItemSlot",x=(0,f.TL)(w),S=u.forwardRef((e,t)=>{let{scope:n,children:r,...o}=e,l=u.useRef(null),[a,s]=u.useState(null),f=(0,c.s)(t,l,s),{setItemMap:p}=i(w,n),h=u.useRef(o);b(h.current,o)||(h.current=o);let m=h.current;return u.useEffect(()=>(p(e=>a?e.has(a)?e.set(a,{...m,element:a}).toSorted(R):(e.set(a,{...m,element:a}),e.toSorted(R)):e),()=>{p(e=>a&&e.has(a)?(e.delete(a),new g(e)):e)}),[a,m,p]),(0,d.jsx)(x,{"data-radix-collection-item":"",ref:f,children:r})});function A(){return u.useState(new g)}function j(t){let{itemMap:n}=i(e+"CollectionConsumer",t);return n}return S.displayName=w,h(A,"useInitCollection"),h(j,"useCollection"),[{Provider:l,Slot:y,ItemSlot:S},{createCollectionScope:r,useCollection:j,useInitCollection:A}]},"createCollection"),h(b,"shallowEqual"),h(S,"isElementPreceding"),h(R,"sortByDocumentPosition"),h(C,"getChildListObserver")},6195:(e,t,n)=>{n.d(t,{b:()=>a});var r=n(2115),o=n(3360),i=n(5155),l=Object.defineProperty,a=r.forwardRef(l(function(e,t){return(0,i.jsx)(o.sG.label,{...e,ref:t,onMouseDown:t=>{var n;t.target.closest("button, input, select, textarea")||(null===(n=e.onMouseDown)||void 0===n||n.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0}))},965:(e,t,n)=>{let r;n.d(t,{UC:()=>tk,YJ:()=>tW,In:()=>tA,q7:()=>tZ,VF:()=>tJ,p4:()=>tY,JU:()=>t_,ZL:()=>tE,bL:()=>tS,wv:()=>tQ,l9:()=>tR,WT:()=>tC,LM:()=>tB});var o=n(2115),i=n(7650),l=n(1786),a=n(3610),u=n(8050),s=n(8068),c=n(8166),f=n(4256),d=n(3741),p=n(2292),h=n(196),m=n(7668);let v=["top","right","bottom","left"],g=Math.min,y=Math.max,w=Math.round,x=Math.floor,b=e=>({x:e,y:e}),S={left:"right",right:"left",bottom:"top",top:"bottom"};function R(e,t){return"function"==typeof e?e(t):e}function C(e){return e.split("-")[0]}function A(e){return e.split("-")[1]}function j(e){return"x"===e?"y":"x"}function T(e){return"y"===e?"height":"width"}function E(e){let t=e[0];return"t"===t||"b"===t?"y":"x"}function P(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}let k=["left","right"],I=["right","left"],O=["top","bottom"],L=["bottom","top"];function D(e){let t=C(e);return S[t]+e.slice(t.length)}function M(e){var t,n,r,o;return"number"!=typeof e?{top:null!=(t=e.top)?t:0,right:null!=(n=e.right)?n:0,bottom:null!=(r=e.bottom)?r:0,left:null!=(o=e.left)?o:0}:{top:e,right:e,bottom:e,left:e}}function F(e){let{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 K(e,t,n){let r,{reference:o,floating:i}=e,l=E(t),a=j(E(t)),u=T(a),s=C(t),c=o.x+o.width/2-i.width/2,f=o.y+o.height/2-i.height/2,d=o[u]/2-i[u]/2;switch(s){case"top":r={x:c,y:o.y-i.height};break;case"bottom":r={x:c,y:o.y+o.height};break;case"right":r={x:o.x+o.width,y:f};break;case"left":r={x:o.x-i.width,y:f};break;default:r={x:o.x,y:o.y}}let p=A(t);return p&&(r[a]+=d*("end"===p?1:-1)*(n&&"y"===l?-1:1)),r}async function H(e,t){var n;void 0===t&&(t={});let{x:r,y:o,platform:i,rects:l,elements:a,strategy:u}=e,{boundary:s="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=R(t,e),h=M(p),m=a[d?"floating"===f?"reference":"floating":f],v=F(await i.getClippingRect({element:null==(n=await (null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await (null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:s,rootBoundary:c,strategy:u})),g="floating"===f?{x:r,y:o,width:l.floating.width,height:l.floating.height}:l.reference,y=await (null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),w=await (null==i.isElement?void 0:i.isElement(y))&&await (null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},x=F(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:g,offsetParent:y,strategy:u}):g);return{top:(v.top-x.top+h.top)/w.y,bottom:(x.bottom-v.bottom+h.bottom)/w.y,left:(v.left-x.left+h.left)/w.x,right:(x.right-v.right+h.right)/w.x}}let N=async(e,t,n)=>{let{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,a=l.detectOverflow?l:{...l,detectOverflow:H},u=await (null==l.isRTL?void 0:l.isRTL(t)),s=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:f}=K(s,r,u),d=r,p=0,h={};for(let n=0;n<i.length;n++){let m=i[n];if(!m)continue;let{name:v,fn:g}=m,{x:y,y:w,data:x,reset:b}=await g({x:c,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:h,rects:s,platform:a,elements:{reference:e,floating:t}});c=null!=y?y:c,f=null!=w?w:f,h[v]={...h[v],...x},b&&p<50&&(p++,"object"==typeof b&&(b.placement&&(d=b.placement),b.rects&&(s=!0===b.rects?await l.getElementRects({reference:e,floating:t,strategy:o}):b.rects),{x:c,y:f}=K(s,d,u)),n=-1)}return{x:c,y:f,placement:d,strategy:o,middlewareData:h}};function z(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function B(e){return v.some(t=>e[t]>=0)}let G=new Set(["left","top"]);async function V(e,t){let{placement:n,platform:r,elements:o}=e,i=await (null==r.isRTL?void 0:r.isRTL(o.floating)),l=C(n),a=A(n),u="y"===E(n),s=G.has(l)?-1:1,c=i&&u?-1:1,f=R(t,e),{mainAxis:d,crossAxis:p,alignmentAxis:h}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&"number"==typeof h&&(p="end"===a?-1*h:h),u?{x:p*c,y:d*s}:{x:d*s,y:p*c}}function W(){return"undefined"!=typeof window}function _(e){return X(e)?(e.nodeName||"").toLowerCase():"#document"}function q(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function U(e){var t;return null==(t=(X(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function X(e){return!!W()&&(e instanceof Node||e instanceof q(e).Node)}function Z(e){return!!W()&&(e instanceof Element||e instanceof q(e).Element)}function $(e){return!!W()&&(e instanceof HTMLElement||e instanceof q(e).HTMLElement)}function Y(e){return!!W()&&"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof q(e).ShadowRoot)}function J(e){let{overflow:t,overflowX:n,overflowY:r,display:o}=el(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&"inline"!==o&&"contents"!==o}function Q(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}let ee=/transform|translate|scale|rotate|perspective|filter/,et=/paint|layout|strict|content/,en=e=>!!e&&"none"!==e;function er(e){let t=Z(e)?el(e):e;return en(t.transform)||en(t.translate)||en(t.scale)||en(t.rotate)||en(t.perspective)||!eo()&&(en(t.backdropFilter)||en(t.filter))||ee.test(t.willChange||"")||et.test(t.contain||"")}function eo(){return null==r&&(r="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),r}function ei(e){return/^(html|body|#document)$/.test(_(e))}function el(e){return q(e).getComputedStyle(e)}function ea(e){return Z(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function eu(e){if("html"===_(e))return e;let t=e.assignedSlot||e.parentNode||Y(e)&&e.host||U(e);return Y(t)?t.host:t}function es(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);let o=function e(t){let n=eu(t);return ei(n)?(t.ownerDocument||t).body:$(n)&&J(n)?n:e(n)}(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),l=q(o);if(!i)return t.concat(o,es(o,[],n));{let e=ec(l);return t.concat(l,l.visualViewport||[],J(o)?o:[],e&&n?es(e):[])}}function ec(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ef(e){let t=el(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,o=$(e),i=o?e.offsetWidth:n,l=o?e.offsetHeight:r,a=w(n)!==i||w(r)!==l;return a&&(n=i,r=l),{width:n,height:r,$:a}}function ed(e){return Z(e)?e:e.contextElement}function ep(e){let t=ed(e);if(!$(t))return b(1);let n=t.getBoundingClientRect(),{width:r,height:o,$:i}=ef(t),l=(i?w(n.width):n.width)/r,a=(i?w(n.height):n.height)/o;return l&&Number.isFinite(l)||(l=1),a&&Number.isFinite(a)||(a=1),{x:l,y:a}}let eh=b(0);function em(e){let t=q(e);return eo()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:eh}function ev(e,t,n,r){var o;void 0===t&&(t=!1),void 0===n&&(n=!1);let i=e.getBoundingClientRect(),l=ed(e),a=b(1);t&&(r?Z(r)&&(a=ep(r)):a=ep(e));let u=(void 0===(o=n)&&(o=!1),r&&o&&r===q(l))?em(l):b(0),s=(i.left+u.x)/a.x,c=(i.top+u.y)/a.y,f=i.width/a.x,d=i.height/a.y;if(l&&r){let e=q(l),t=Z(r)?q(r):r,n=e,o=ec(n);for(;o&&t!==n;){let e=ep(o),t=o.getBoundingClientRect(),r=el(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,l=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;s*=e.x,c*=e.y,f*=e.x,d*=e.y,s+=i,c+=l,o=ec(n=q(o))}}return F({width:f,height:d,x:s,y:c})}function eg(e,t){let n=ea(e).scrollLeft;return t?t.left+n:ev(U(e)).left+n}function ey(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-eg(e,n),y:n.top+t.scrollTop}}function ew(e,t,n){let r;if("viewport"===t||"layoutViewport"===t)r=function(e,t,n){void 0===n&&(n="viewport");let r="layoutViewport"===n,o=q(e),i=U(e),l=o.visualViewport,a=i.clientWidth,u=i.clientHeight,s=0,c=0;if(l){let e=!eo()||"fixed"===t;r?e||(s=-l.offsetLeft,c=-l.offsetTop):(a=l.width,u=l.height,e&&(s=l.offsetLeft,c=l.offsetTop))}if(0>=eg(i)){let e=i.ownerDocument,t=e.body,n=getComputedStyle(t),r="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(i.clientWidth-t.clientWidth-r),l="stable both-edges"===getComputedStyle(i).scrollbarGutter?o/2:o;l<=25&&(a-=l)}return{width:a,height:u,x:s,y:c}}(e,n,t);else if("document"===t)r=function(e){let t=ea(e),n=e.ownerDocument.body,r=y(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),o=y(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),i=-t.scrollLeft+eg(e),l=-t.scrollTop;return"rtl"===el(n).direction&&(i+=y(e.clientWidth,n.clientWidth)-r),{width:r,height:o,x:i,y:l}}(U(e));else if(Z(t))r=function(e,t){let n=ev(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=ep(e),l=e.clientWidth*i.x;return{width:l,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{let n=em(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return F(r)}function ex(e){return"static"===el(e).position}function eb(e,t){if(!$(e)||"fixed"===el(e).position)return null;if(t)return t(e);let n=e.offsetParent;return U(e)===n&&(n=n.ownerDocument.body),n}function eS(e,t){var n;let r=q(e);if(Q(e))return r;if(!$(e)){let t=eu(e);for(;t&&!ei(t);){if(Z(t)&&!ex(t))return t;t=eu(t)}return r}let o=eb(e,t);for(;o&&(n=o,/^(table|td|th)$/.test(_(n)))&&ex(o);)o=eb(o,t);return o&&ei(o)&&ex(o)&&!er(o)?r:o||function(e){let t=eu(e);for(;$(t)&&!ei(t);){if(er(t))return t;if(Q(t))break;t=eu(t)}return null}(e)||r}let eR=async function(e){let t=this.getOffsetParent||eS,n=this.getDimensions,r=await n(e.floating);return{reference:function(e,t,n){let r=$(t),o=U(t),i="fixed"===n,l=ev(e,!0,i,t),a={scrollLeft:0,scrollTop:0},u=b(0);if((r||!i)&&(("body"!==_(t)||J(o))&&(a=ea(t)),r)){let e=ev(t,!0,i,t);u.x=e.x+t.clientLeft,u.y=e.y+t.clientTop}!r&&o&&(u.x=eg(o));let s=!o||r||i?b(0):ey(o,a);return{x:l.left+a.scrollLeft-u.x-s.x,y:l.top+a.scrollTop-u.y-s.y,width:l.width,height:l.height}}(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},eC={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e,i="fixed"===o,l=U(r),a=!!t&&Q(t.floating);if(r===l||a&&i)return n;let u={scrollLeft:0,scrollTop:0},s=b(1),c=b(0),f=$(r);if((f||!i)&&(("body"!==_(r)||J(l))&&(u=ea(r)),f)){let e=ev(r);s=ep(r),c.x=e.x+r.clientLeft,c.y=e.y+r.clientTop}let d=!l||f||i?b(0):ey(l,u);return{width:n.width*s.x,height:n.height*s.y,x:n.x*s.x-u.scrollLeft*s.x+c.x+d.x,y:n.y*s.y-u.scrollTop*s.y+c.y+d.y}},getDocumentElement:U,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e,i=[..."clippingAncestors"===n?Q(t)?[]:function(e,t){let n=t.get(e);if(n)return n;let r=es(e,[],!1).filter(e=>Z(e)&&"body"!==_(e)),o=null,i="fixed"===el(e).position,l=i?eu(e):e;for(;Z(l)&&!ei(l);){let e=el(l),t=er(l),n=o?o.position:i?"fixed":"";t||"fixed"!==n&&("absolute"!==n||"static"!==e.position)?o=e:r=r.filter(e=>e!==l),l=eu(l)}return t.set(e,r),r}(t,this._c):[].concat(n),r],l=ew(t,i[0],o),a=l.top,u=l.right,s=l.bottom,c=l.left;for(let e=1;e<i.length;e++){let n=ew(t,i[e],o);a=y(n.top,a),u=g(n.right,u),s=g(n.bottom,s),c=y(n.left,c)}return{width:u-c,height:s-a,x:c,y:a}},getOffsetParent:eS,getElementRects:eR,getClientRects:function(e){return e.getClientRects?Array.from(e.getClientRects()):[]},getDimensions:function(e){let{width:t,height:n}=ef(e);return{width:t,height:n}},getScale:ep,isElement:Z,isRTL:function(e){return"rtl"===el(e).direction}};function eA(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}let ej=e=>({name:"arrow",options:e,async fn(t){let{x:n,y:r,placement:o,rects:i,platform:l,elements:a,middlewareData:u}=t,{element:s,padding:c=0}=R(e,t)||{};if(null==s)return{};let f=M(c),d={x:n,y:r},p=j(E(o)),h=T(p),m=await l.getDimensions(s),v="y"===p,w=v?"clientHeight":"clientWidth",x=i.reference[h]+i.reference[p]-d[p]-i.floating[h],b=d[p]-i.reference[p],S=await (null==l.getOffsetParent?void 0:l.getOffsetParent(s)),C=S?S[w]:0;C&&await (null==l.isElement?void 0:l.isElement(S))||(C=a.floating[w]||i.floating[h]);let P=C/2-m[h]/2-1,k=g(f[v?"top":"left"],P),I=g(f[v?"bottom":"right"],P),O=C-m[h]-I,L=C/2-m[h]/2+(x/2-b/2),D=y(k,g(L,O)),F=!u.arrow&&null!=A(o)&&L!==D&&i.reference[h]/2-(L<k?k:I)-m[h]/2<0,K=F?L<k?L-k:L-O:0;return{[p]:d[p]+K,data:{[p]:D,centerOffset:L-D-K,...F&&{alignmentOffset:K}},reset:F}}}),eT=(e,t,n)=>{let r=new Map,o=null!=n?n:{},i={...eC,...o.platform,_c:r};return N(e,t,{...o,platform:i})};var eE="undefined"!=typeof document?o.useLayoutEffect:function(){};function eP(e,t){let n,r,o;if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if((n=e.length)!==t.length)return!1;for(r=n;0!=r--;)if(!eP(e[r],t[r]))return!1;return!0}if((n=(o=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!({}).hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){let n=o[r];if(("_owner"!==n||!e.$$typeof)&&!eP(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function ek(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function eI(e,t){let n=ek(e);return Math.round(t*n)/n}function eO(e){let t=o.useRef(e);return eE(()=>{t.current=e}),t}let eL=e=>({name:"arrow",options:e,fn(t){let{element:n,padding:r}="function"==typeof e?e(t):e;return n&&({}).hasOwnProperty.call(n,"current")?null!=n.current?ej({element:n.current,padding:r}).fn(t):{}:n?ej({element:n,padding:r}).fn(t):{}}}),eD=(e,t)=>{let n=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;let{x:o,y:i,placement:l,middlewareData:a}=t,u=await V(t,e);return l===(null==(n=a.offset)?void 0:n.placement)&&null!=(r=a.arrow)&&r.alignmentOffset?{}:{x:o+u.x,y:i+u.y,data:{...u,placement:l}}}}}(e);return{name:n.name,fn:n.fn,options:[e,t]}},eM=(e,t)=>{let n=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){let{x:n,y:r,placement:o,platform:i}=t,{mainAxis:l=!0,crossAxis:a=!1,limiter:u={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...s}=R(e,t),c={x:n,y:r},f=await i.detectOverflow(t,s),d=E(o),p=j(d),h=c[p],m=c[d],v=(e,t)=>y(t+f["y"===e?"top":"left"],g(t,t-f["y"===e?"bottom":"right"]));l&&(h=v(p,h)),a&&(m=v(d,m));let w=u.fn({...t,[p]:h,[d]:m});return{...w,data:{x:w.x-n,y:w.y-r,enabled:{[p]:l,[d]:a}}}}}}(e);return{name:n.name,fn:n.fn,options:[e,t]}},eF=(e,t)=>({fn:function(e){return void 0===e&&(e={}),{options:e,fn(t){var n,r,o,i;let{x:l,y:a,placement:u,rects:s,middlewareData:c}=t,{offset:f=0,mainAxis:d=!0,crossAxis:p=!0}=R(e,t),h={x:l,y:a},m=E(u),v=j(m),g=h[v],y=h[m],w=R(f,t),x="number"==typeof w?{mainAxis:w,crossAxis:0}:{mainAxis:null!=(n=w.mainAxis)?n:0,crossAxis:null!=(r=w.crossAxis)?r:0};if(d){let e="y"===v?"height":"width",t=s.reference[v]-s.floating[e]+x.mainAxis,n=s.reference[v]+s.reference[e]-x.mainAxis;g<t?g=t:g>n&&(g=n)}if(p){let e="y"===v?"width":"height",t=G.has(C(u)),n=s.reference[m]-s.floating[e]+(t&&(null==(o=c.offset)?void 0:o[m])||0)+(t?0:x.crossAxis),r=s.reference[m]+s.reference[e]+(t?0:(null==(i=c.offset)?void 0:i[m])||0)-(t?x.crossAxis:0);y<n?y=n:y>r&&(y=r)}return{[v]:g,[m]:y}}}}(e).fn,options:[e,t]}),eK=(e,t)=>{let n=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r,o,i,l;let{placement:a,middlewareData:u,rects:s,initialPlacement:c,platform:f,elements:d}=t,{mainAxis:p=!0,crossAxis:h=!0,fallbackPlacements:m,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:y=!0,...w}=R(e,t);if(null!=(n=u.arrow)&&n.alignmentOffset)return{};let x=C(a),b=E(c),S=C(c)===c,M=await (null==f.isRTL?void 0:f.isRTL(d.floating)),F=m||(S||!y?[D(c)]:function(e){let t=D(e);return[P(e),t,P(t)]}(c)),K="none"!==g;!m&&K&&F.push(...function(e,t,n,r){let o=A(e),i=function(e,t,n){switch(e){case"top":case"bottom":if(n)return t?I:k;return t?k:I;case"left":case"right":return t?O:L;default:return[]}}(C(e),"start"===n,r);return o&&(i=i.map(e=>e+"-"+o),t&&(i=i.concat(i.map(P)))),i}(c,y,g,M));let H=[c,...F],N=await f.detectOverflow(t,w),z=[],B=(null==(r=u.flip)?void 0:r.overflows)||[];if(p&&z.push(N[x]),h){let e=function(e,t,n){void 0===n&&(n=!1);let r=A(e),o=j(E(e)),i=T(o),l="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=D(l)),[l,D(l)]}(a,s,M);z.push(N[e[0]],N[e[1]])}if(B=[...B,{placement:a,overflows:z}],!z.every(e=>e<=0)){let e=((null==(o=u.flip)?void 0:o.index)||0)+1,t=H[e];if(t&&(!("alignment"===h&&b!==E(t))||B.every(e=>E(e.placement)!==b||e.overflows[0]>0)))return{data:{index:e,overflows:B},reset:{placement:t}};let n=null==(i=B.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:i.placement;if(!n)switch(v){case"bestFit":{let e=null==(l=B.filter(e=>{if(K){let t=E(e.placement);return t===b||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:l[0];e&&(n=e);break}case"initialPlacement":n=c}if(a!==n)return{reset:{placement:n}}}return{}}}}(e);return{name:n.name,fn:n.fn,options:[e,t]}},eH=(e,t)=>{let n=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){let n,r;let{placement:o,rects:i,platform:l,elements:a}=t,{apply:u=()=>{},...s}=R(e,t),c=await l.detectOverflow(t,s),f=C(o),d=A(o),p="y"===E(o),{width:h,height:m}=i.floating;"top"===f||"bottom"===f?(n=f,r=d===(await (null==l.isRTL?void 0:l.isRTL(a.floating))?"start":"end")?"left":"right"):(r=f,n="end"===d?"top":"bottom");let v=m-c.top-c.bottom,w=h-c.left-c.right,x=g(m-c[n],v),b=g(h-c[r],w),S=t.middlewareData.shift,j=!S,T=x,P=b;null!=S&&S.enabled.x&&(P=w),null!=S&&S.enabled.y&&(T=v),j&&!d&&(p?P=h-2*y(c.left,c.right):T=m-2*y(c.top,c.bottom)),await u({...t,availableWidth:P,availableHeight:T});let k=await l.getDimensions(a.floating);return h!==k.width||m!==k.height?{reset:{rects:!0}}:{}}}}(e);return{name:n.name,fn:n.fn,options:[e,t]}},eN=(e,t)=>{let n=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:o="referenceHidden",...i}=R(e,t);switch(o){case"referenceHidden":{let e=z(await r.detectOverflow(t,{...i,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:B(e)}}}case"escaped":{let e=z(await r.detectOverflow(t,{...i,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:B(e)}}}default:return{}}}}}(e);return{name:n.name,fn:n.fn,options:[e,t]}},ez=(e,t)=>{let n=eL(e);return{name:n.name,fn:n.fn,options:[e,t]}};var eB=n(3360),eG=n(1524),eV=n(6611),eW=n(7510),e_=n(5155),eq=Object.defineProperty,eU=(e,t)=>eq(e,"name",{value:t,configurable:!0}),eX="Popper",[eZ,e$]=(0,c.A)(eX),[eY,eJ]=eZ(eX),eQ=eU(e=>{let{__scopePopper:t,children:n}=e,[r,i]=o.useState(null),[l,a]=o.useState(void 0);return(0,e_.jsx)(eY,{scope:t,anchor:r,onAnchorChange:i,placementState:l,setPlacementState:a,children:n})},"Popper"),e0=o.forwardRef(eU(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,l=eJ("PopperAnchor",n),a=o.useRef(null),u=l.onAnchorChange,c=o.useCallback(e=>{a.current=e,e&&u(e)},[u]),f=(0,s.s)(t,c),d=o.useRef(null);o.useEffect(()=>{if(!r)return;let e=d.current;d.current=r.current,e!==d.current&&u(d.current)});let p=l.placementState&&e3(l.placementState),h=null==p?void 0:p[0],m=null==p?void 0:p[1];return r?null:(0,e_.jsx)(eB.sG.div,{"data-radix-popper-side":h,"data-radix-popper-align":m,...i,ref:f})},"PopperAnchor")),e1="PopperContent",[e2,e6]=eZ(e1),e5=o.forwardRef(eU(function(e,t){var n,r,l,a,u,c,f,d,p;let{__scopePopper:h,side:m="bottom",sideOffset:v=0,align:w="center",alignOffset:b=0,arrowPadding:S=0,avoidCollisions:R=!0,collisionBoundary:C=[],collisionPadding:A=0,sticky:j="partial",hideWhenDetached:T=!1,updatePositionStrategy:E="optimized",onPlaced:P,...k}=e,I=eJ(e1,h),[O,L]=o.useState(null),D=(0,s.s)(t,L),[M,F]=o.useState(null),K=(0,eW.X)(M),H=null!==(d=null==K?void 0:K.width)&&void 0!==d?d:0,N=null!==(p=null==K?void 0:K.height)&&void 0!==p?p:0,z="number"==typeof A?A:{top:0,right:0,bottom:0,left:0,...A},B=Array.isArray(C)?C:[C],G=B.length>0,V={padding:z,boundary:B.filter(e7),altBoundary:G},{refs:W,floatingStyles:_,placement:X,isPositioned:Z,middlewareData:$}=function(e){void 0===e&&(e={});let{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:l,elements:{reference:a,floating:u}={},transform:s=!0,whileElementsMounted:c,open:f}=e,[d,p]=o.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=o.useState(r);eP(h,r)||m(r);let[v,g]=o.useState(null),[y,w]=o.useState(null),x=o.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=o.useCallback(e=>{e!==A.current&&(A.current=e,w(e))},[]),S=a||v,R=u||y,C=o.useRef(null),A=o.useRef(null),j=o.useRef(d),T=null!=c,E=eO(c),P=eO(l),k=eO(f),I=o.useCallback(()=>{if(!C.current||!A.current)return;let e={placement:t,strategy:n,middleware:h};P.current&&(e.platform=P.current),eT(C.current,A.current,e).then(e=>{let t={...e,isPositioned:!1!==k.current};O.current&&!eP(j.current,t)&&(j.current=t,i.flushSync(()=>{p(t)}))})},[h,t,n,P,k]);eE(()=>{!1===f&&j.current.isPositioned&&(j.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[f]);let O=o.useRef(!1);eE(()=>(O.current=!0,()=>{O.current=!1}),[]),eE(()=>{if(S&&(C.current=S),R&&(A.current=R),S&&R){if(E.current)return E.current(S,R,I);I()}},[S,R,I,E,T]);let L=o.useMemo(()=>({reference:C,floating:A,setReference:x,setFloating:b}),[x,b]),D=o.useMemo(()=>({reference:S,floating:R}),[S,R]),M=o.useMemo(()=>{let e={position:n,left:0,top:0};if(!D.floating)return e;let t=eI(D.floating,d.x),r=eI(D.floating,d.y);return s?{...e,transform:"translate("+t+"px, "+r+"px)",...ek(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,s,D.floating,d.x,d.y]);return o.useMemo(()=>({...d,update:I,refs:L,elements:D,floatingStyles:M}),[d,I,L,D,M])}({strategy:"fixed",placement:m+("center"!==w?"-"+w:""),whileElementsMounted:eU(function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e,t,n,r){let o;void 0===r&&(r={});let{ancestorScroll:i=!0,ancestorResize:l=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:u="function"==typeof IntersectionObserver,animationFrame:s=!1}=r,c=ed(e),f=i||l?[...c?es(c):[],...t?es(t):[]]:[];f.forEach(e=>{i&&e.addEventListener("scroll",n),l&&e.addEventListener("resize",n)});let d=c&&u?function(e,t,n){let r,o=null,i=U(e);function l(){var e;clearTimeout(r),null==(e=o)||e.disconnect(),o=null}function a(n,u){void 0===n&&(n=!1),void 0===u&&(u=1),l();let s=e.getBoundingClientRect(),{left:c,top:f,width:d,height:p}=s;if(n||t(),!d||!p)return;let h=x(f),m=x(i.clientWidth-(c+d)),v={rootMargin:-h+"px "+-m+"px "+-x(i.clientHeight-(f+p))+"px "+-x(c)+"px",threshold:y(0,g(1,u))||1},w=!0;function b(t){let n=t[0].intersectionRatio;if(!eA(s,e.getBoundingClientRect()))return a();if(n!==u){if(!w)return a();n?a(!1,n):r=setTimeout(()=>{a(!1,1e-7)},1e3)}w=!1}try{o=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch(e){o=new IntersectionObserver(b,v)}o.observe(e)}let u=q(e),s=()=>a(n);return u.addEventListener("resize",s),a(!0),()=>{u.removeEventListener("resize",s),l()}}(c,n,l):null,p=-1,h=null;a&&(h=new ResizeObserver(e=>{let[r]=e;r&&r.target===c&&h&&t&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=h)||e.observe(t)})),n()}),c&&!s&&h.observe(c),t&&h.observe(t));let m=s?ev(e):null;return s&&function t(){let r=ev(e);m&&!eA(m,r)&&n(),m=r,o=requestAnimationFrame(t)}(),n(),()=>{var e;f.forEach(e=>{i&&e.removeEventListener("scroll",n),l&&e.removeEventListener("resize",n)}),null==d||d(),null==(e=h)||e.disconnect(),h=null,s&&cancelAnimationFrame(o)}}(...t,{animationFrame:"always"===E})},"whileElementsMounted"),elements:{reference:I.anchor},middleware:[eD({mainAxis:v+N,alignmentAxis:b}),R&&eM({mainAxis:!0,crossAxis:!1,limiter:"partial"===j?eF():void 0,...V}),R&&eK({...V}),eH({...V,apply:eU(e=>{let{elements:t,rects:n,availableWidth:r,availableHeight:o}=e,{width:i,height:l}=n.reference,a=t.floating.style;a.setProperty("--radix-popper-available-width","".concat(r,"px")),a.setProperty("--radix-popper-available-height","".concat(o,"px")),a.setProperty("--radix-popper-anchor-width","".concat(i,"px")),a.setProperty("--radix-popper-anchor-height","".concat(l,"px"))},"apply")}),M&&ez({element:M,padding:S}),e8({arrowWidth:H,arrowHeight:N}),T&&eN({strategy:"referenceHidden",...V,boundary:G?V.boundary:void 0})]}),Y=I.setPlacementState;(0,eV.N)(()=>(Y(X),()=>{Y(void 0)}),[X,Y]);let[J,Q]=e3(X),ee=(0,eG.c)(P);(0,eV.N)(()=>{Z&&(null==ee||ee())},[Z,ee]);let et=null===(n=$.arrow)||void 0===n?void 0:n.x,en=null===(r=$.arrow)||void 0===r?void 0:r.y,er=(null===(l=$.arrow)||void 0===l?void 0:l.centerOffset)!==0,[eo,ei]=o.useState();return(0,eV.N)(()=>{O&&ei(window.getComputedStyle(O).zIndex)},[O]),(0,e_.jsx)("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{..._,transform:Z?_.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:eo,"--radix-popper-transform-origin":[null===(a=$.transformOrigin)||void 0===a?void 0:a.x,null===(u=$.transformOrigin)||void 0===u?void 0:u.y].join(" "),...(null===(c=$.hide)||void 0===c?void 0:c.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,e_.jsx)(e2,{scope:h,placedSide:J,placedAlign:Q,onArrowChange:F,arrowX:et,arrowY:en,shouldHideArrow:er,children:(0,e_.jsx)(eB.sG.div,{"data-side":J,"data-align":Q,...k,ref:D,style:{...k.style,animation:Z?null===(f=k.style)||void 0===f?void 0:f.animation:"none"}})})})},"PopperContent"));function e7(e){return null!==e}eU(e7,"isNotNull");var e8=eU(e=>({name:"transformOrigin",options:e,fn(t){var n,r,o,i,l;let{placement:a,rects:u,middlewareData:s}=t,c=(null===(n=s.arrow)||void 0===n?void 0:n.centerOffset)!==0,f=c?0:e.arrowWidth,d=c?0:e.arrowHeight,[p,h]=e3(a),m={start:"0%",center:"50%",end:"100%"}[h],v=(null!==(i=null===(r=s.arrow)||void 0===r?void 0:r.x)&&void 0!==i?i:0)+f/2,g=(null!==(l=null===(o=s.arrow)||void 0===o?void 0:o.y)&&void 0!==l?l:0)+d/2,y="",w="";return"bottom"===p?(y=c?m:"".concat(v,"px"),w="".concat(-d,"px")):"top"===p?(y=c?m:"".concat(v,"px"),w="".concat(u.floating.height+d,"px")):"right"===p?(y="".concat(-d,"px"),w=c?m:"".concat(g,"px")):"left"===p&&(y="".concat(u.floating.width+d,"px"),w=c?m:"".concat(g,"px")),{data:{x:y,y:w}}}}),"transformOrigin");function e3(e){let[t,n="center"]=e.split("-");return[t,n]}eU(e3,"getSideAndAlignFromPlacement");var e4=n(7323),e9=n(7028),te=n(2317),tt=n(7924),tn=n(858),tr=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"}),to=n(5587),ti=n(2431),tl=Object.defineProperty,ta=(e,t)=>tl(e,"name",{value:t,configurable:!0}),tu=[" ","Enter","ArrowUp","ArrowDown"],ts=[" ","Enter"],tc="Select",[tf,td,tp]=(0,u.N)(tc),[th,tm]=(0,c.A)(tc,[tp,e$]),tv=e$(),[tg,ty]=th(tc),[tw,tx]=th(tc);function tb(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:l,value:a,defaultValue:u,onValueChange:s,dir:c,name:d,autoComplete:p,disabled:h,required:v,form:g,internal_do_not_use_render:y}=e,w=tv(t),[x,b]=o.useState(null),[S,R]=o.useState(null),[C,A]=o.useState(!1),j=(0,f.jH)(c),[T,E]=(0,tt.i)({prop:r,defaultProp:null!=i&&i,onChange:l,caller:tc}),[P,k]=(0,tt.i)({prop:a,defaultProp:u,onChange:s,caller:tc}),I=o.useRef(null),O=o.useRef(P);o.useEffect(()=>{let e=g?null==x?void 0:x.ownerDocument.getElementById(g):null==x?void 0:x.form;if(e instanceof HTMLFormElement){let t=ta(()=>k(O.current),"reset");return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[g,x,k]);let L=!x||!!g||!!x.closest("form"),[D,M]=o.useState(new Set),F=(0,m.B)(),K=Array.from(D).map(e=>e.props.value).join(";"),H=o.useCallback(e=>{M(t=>new Set(t).add(e))},[]),N=o.useCallback(e=>{M(t=>{let n=new Set(t);return n.delete(e),n})},[]),z={required:v,trigger:x,onTriggerChange:b,valueNode:S,onValueNodeChange:R,valueNodeHasChildren:C,onValueNodeHasChildrenChange:A,contentId:F,value:P,onValueChange:k,open:T,onOpenChange:E,dir:j,triggerPointerDownPosRef:I,disabled:h,name:d,autoComplete:p,form:g,nativeOptions:D,nativeSelectKey:K,isFormControl:L};return(0,e_.jsx)(eQ,{...w,children:(0,e_.jsx)(tg,{scope:t,...z,children:(0,e_.jsx)(tf.Provider,{scope:t,children:(0,e_.jsx)(tw,{scope:t,onNativeOptionAdd:H,onNativeOptionRemove:N,children:t1(y)?y(z):n})})})})}ta(tb,"SelectProvider");var tS=ta(e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,e_.jsx)(tb,{__scopeSelect:t,...r,internal_do_not_use_render:e=>{let{isFormControl:r}=e;return(0,e_.jsxs)(e_.Fragment,{children:[n,r?(0,e_.jsx)(t0,{__scopeSelect:t}):null]})}})},"Select"),tR=o.forwardRef(ta(function(e,t){let{__scopeSelect:n,disabled:r=!1,...i}=e,l=tv(n),u=ty("SelectTrigger",n),c=u.disabled||r,f=(0,s.s)(t,u.onTriggerChange),d=td(n),p=o.useRef("touch"),[h,m,v]=t6(e=>{let t=d().filter(e=>!e.disabled),n=t.find(e=>e.value===u.value),r=t5(t,e,n);void 0!==r&&u.onValueChange(r.value)}),g=ta(e=>{c||(u.onOpenChange(!0),v()),e&&(u.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})},"handleOpen");return(0,e_.jsx)(e0,{asChild:!0,...l,children:(0,e_.jsx)(eB.sG.button,{type:"button",role:"combobox","aria-controls":u.open?u.contentId:void 0,"aria-expanded":u.open,"aria-required":u.required,"aria-autocomplete":"none",dir:u.dir,"data-state":u.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":t2(u.value)?"":void 0,...i,ref:f,onClick:(0,a.mK)(i.onClick,e=>{e.currentTarget.focus(),"mouse"!==p.current&&g(e)}),onPointerDown:(0,a.mK)(i.onPointerDown,e=>{p.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(g(e),e.preventDefault())}),onKeyDown:(0,a.mK)(i.onKeyDown,e=>{let t=""!==h.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||m(e.key),(!t||" "!==e.key)&&tu.includes(e.key)&&(g(),e.preventDefault())})})})},"SelectTrigger")),tC=o.forwardRef(ta(function(e,t){let{__scopeSelect:n,className:r,style:i,children:l,placeholder:a="",...u}=e,c=ty("SelectValue",n),{onValueNodeHasChildrenChange:f}=c,d=void 0!==l,p=(0,s.s)(t,c.onValueNodeChange);(0,eV.N)(()=>{f(d)},[f,d]);let h=t2(c.value);return(0,e_.jsx)(eB.sG.span,{...u,asChild:!h&&u.asChild,ref:p,style:{pointerEvents:"none"},children:(0,e_.jsx)(o.Fragment,{children:h?a:l},h?"placeholder":"value")})},"SelectValue")),tA=o.forwardRef(ta(function(e,t){let{__scopeSelect:n,children:r,...o}=e;return(0,e_.jsx)(eB.sG.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})},"SelectIcon")),[tj,tT]=th("SelectPortal",{forceMount:void 0}),tE=ta(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,e_.jsx)(tj,{scope:e.__scopeSelect,forceMount:n,children:(0,e_.jsx)(e4.Z,{asChild:!0,...r})})},"SelectPortal"),tP="SelectContent",tk=o.forwardRef(ta(function(e,t){let n=tT(tP,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,l=ty(tP,e.__scopeSelect),[a,u]=o.useState();return(0,eV.N)(()=>{u(new DocumentFragment)},[]),(0,e_.jsx)(e9.C,{present:r||l.open,children:e=>{let{present:n}=e;return n?(0,e_.jsx)(tM,{...i,ref:t}):(0,e_.jsx)(tI,{...i,fragment:a})}})},"SelectContent")),tI=o.forwardRef(ta(function(e,t){let{__scopeSelect:n,children:r,fragment:o}=e;return o?i.createPortal((0,e_.jsx)(tO,{scope:n,children:(0,e_.jsx)(tf.Slot,{scope:n,children:(0,e_.jsx)("div",{ref:t,children:r})})}),o):null},"SelectContentFragment")),[tO,tL]=th(tP),tD=(0,te.TL)("SelectContent.RemoveScroll"),tM=o.forwardRef(ta(function(e,t){let{__scopeSelect:n}=e,{position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:l,onPointerDownOutside:u,side:c,sideOffset:f,align:m,alignOffset:v,arrowPadding:g,collisionBoundary:y,collisionPadding:w,sticky:x,hideWhenDetached:b,avoidCollisions:S,...R}=e,C=ty(tP,n),[A,j]=o.useState(null),[T,E]=o.useState(null),P=(0,s.s)(t,j),[k,I]=o.useState(null),[O,L]=o.useState(null),D=td(n),[M,F]=o.useState(!1),K=o.useRef(!1);o.useEffect(()=>{if(A)return(0,to.Eq)(A)},[A]),(0,p.Oh)();let H=o.useCallback(e=>{let[t,...n]=D().map(e=>e.ref.current),[r]=n.slice(-1),o=document.activeElement;for(let n of e)if(n===o||(null==n||n.scrollIntoView({block:"nearest"}),n===t&&T&&(T.scrollTop=0),n===r&&T&&(T.scrollTop=T.scrollHeight),null==n||n.focus(),document.activeElement!==o))return},[D,T]),N=o.useCallback(()=>H([k,A]),[H,k,A]);o.useEffect(()=>{M&&N()},[M,N]);let{onOpenChange:z,triggerPointerDownPosRef:B}=C;o.useEffect(()=>{if(A){let e={x:0,y:0},t=ta(t=>{var n,r,o,i;e={x:Math.abs(Math.round(t.pageX)-(null!==(o=null===(n=B.current)||void 0===n?void 0:n.x)&&void 0!==o?o:0)),y:Math.abs(Math.round(t.pageY)-(null!==(i=null===(r=B.current)||void 0===r?void 0:r.y)&&void 0!==i?i:0))}},"handlePointerMove"),n=ta(n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(A)||z(!1),document.removeEventListener("pointermove",t),B.current=null},"handlePointerUp");return null!==B.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}},[A,z,B]),o.useEffect(()=>{let e=ta(()=>z(!1),"close");return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[z]);let[G,V]=t6(e=>{let t=D().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),r=t5(t,e,n);r&&setTimeout(()=>{var e;return null===(e=r.ref.current)||void 0===e?void 0:e.focus()})}),W=o.useCallback((e,t,n)=>{let r=!K.current&&!n;(void 0!==C.value&&C.value===t||r)&&(I(e),r&&(K.current=!0))},[C.value]),_=o.useCallback(()=>null==A?void 0:A.focus(),[A]),q=o.useCallback((e,t,n)=>{let r=!K.current&&!n;(void 0!==C.value&&C.value===t||r)&&L(e)},[C.value]),U="popper"===r?tK:tF;return(0,e_.jsx)(tO,{scope:n,content:A,viewport:T,onViewportChange:E,itemRefCallback:W,selectedItem:k,onItemLeave:_,itemTextRefCallback:q,focusSelectedItem:N,selectedItemText:O,position:r,isPositioned:M,searchRef:G,children:(0,e_.jsx)(ti.A,{as:tD,allowPinchZoom:!0,children:(0,e_.jsx)(h.n,{asChild:!0,trapped:C.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:(0,a.mK)(i,e=>{var t;null===(t=C.trigger)||void 0===t||t.focus({preventScroll:!0}),e.preventDefault()}),children:(0,e_.jsx)(d.qW,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>C.onOpenChange(!1),children:(0,e_.jsx)(U,{role:"listbox",id:C.contentId,"data-state":C.open?"open":"closed",dir:C.dir,onContextMenu:e=>e.preventDefault(),...R,...U===tK?{side:c,sideOffset:f,align:m,alignOffset:v,arrowPadding:g,collisionBoundary:y,collisionPadding:w,sticky:x,hideWhenDetached:b,avoidCollisions:S}:{},onPlaced:()=>F(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...R.style},onKeyDown:(0,a.mK)(R.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||V(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=D().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>H(t)),e.preventDefault()}})})})})})})},"SelectContentImpl")),tF=o.forwardRef(ta(function(e,t){let{__scopeSelect:n,onPlaced:r,...i}=e,a=ty(tP,n),u=tL(tP,n),[c,f]=o.useState(null),[d,p]=o.useState(null),h=(0,s.s)(t,p),m=td(n),v=o.useRef(!1),g=o.useRef(!0),{viewport:y,selectedItem:w,selectedItemText:x,focusSelectedItem:b}=u,S=o.useCallback(()=>{if(a.trigger&&a.valueNode&&c&&d&&y&&w&&x){let e=a.trigger.getBoundingClientRect(),t=d.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),o=x.getBoundingClientRect();if("rtl"!==a.dir){let r=o.left-t.left,i=n.left-r,a=e.left-i,u=e.width+a,s=Math.max(u,t.width),f=window.innerWidth-10,d=(0,l.q)(i,[10,Math.max(10,f-s)]);c.style.minWidth=u+"px",c.style.left=d+"px"}else{let r=t.right-o.right,i=window.innerWidth-n.right-r,a=window.innerWidth-e.right-i,u=e.width+a,s=Math.max(u,t.width),f=window.innerWidth-10,d=(0,l.q)(i,[10,Math.max(10,f-s)]);c.style.minWidth=u+"px",c.style.right=d+"px"}let i=m(),u=window.innerHeight-20,s=y.scrollHeight,f=window.getComputedStyle(d),p=parseInt(f.borderTopWidth,10),h=parseInt(f.paddingTop,10),g=parseInt(f.borderBottomWidth,10),b=p+h+s+parseInt(f.paddingBottom,10)+g,S=Math.min(5*w.offsetHeight,b),R=window.getComputedStyle(y),C=parseInt(R.paddingTop,10),A=parseInt(R.paddingBottom,10),j=e.top+e.height/2-10,T=w.offsetHeight/2,E=p+h+(w.offsetTop+T);if(E<=j){let e=i.length>0&&w===i[i.length-1].ref.current;c.style.bottom="0px";let t=Math.max(u-j,T+(e?A:0)+(d.clientHeight-y.offsetTop-y.offsetHeight)+g);c.style.height=E+t+"px"}else{let e=i.length>0&&w===i[0].ref.current;c.style.top="0px";let t=Math.max(j,p+y.offsetTop+(e?C:0)+T);c.style.height=t+(b-E)+"px",y.scrollTop=E-j+y.offsetTop}c.style.margin="".concat(10,"px 0"),c.style.minHeight=S+"px",c.style.maxHeight=u+"px",null==r||r(),requestAnimationFrame(()=>v.current=!0)}},[m,a.trigger,a.valueNode,c,d,y,w,x,a.dir,r]);(0,eV.N)(()=>S(),[S]);let[R,C]=o.useState();(0,eV.N)(()=>{d&&C(window.getComputedStyle(d).zIndex)},[d]);let A=o.useCallback(e=>{e&&!0===g.current&&(S(),null==b||b(),g.current=!1)},[S,b]);return(0,e_.jsx)(tH,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:v,onScrollButtonChange:A,children:(0,e_.jsx)("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:R},children:(0,e_.jsx)(eB.sG.div,{...i,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})},"SelectItemAlignedPosition")),tK=o.forwardRef(ta(function(e,t){let{__scopeSelect:n,align:r="start",collisionPadding:o=10,...i}=e,l=tv(n);return(0,e_.jsx)(e5,{...l,...i,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...i.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)"}})},"SelectPopperPosition")),[tH,tN]=th(tP,{}),tz="SelectViewport",tB=o.forwardRef(ta(function(e,t){let{__scopeSelect:n,nonce:r,...i}=e,l=tL(tz,n),u=tN(tz,n),c=(0,s.s)(t,l.onViewportChange),f=o.useRef(0);return(0,e_.jsxs)(e_.Fragment,{children:[(0,e_.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}),(0,e_.jsx)(tf.Slot,{scope:n,children:(0,e_.jsx)(eB.sG.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:(0,a.mK)(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=u;if((null==r?void 0:r.current)&&n){let e=Math.abs(f.current-t.scrollTop);if(e>0){let r=window.innerHeight-20,o=Math.max(parseFloat(n.style.minHeight),parseFloat(n.style.height));if(o<r){let i=o+e,l=Math.min(r,i),a=i-l;n.style.height=l+"px","0px"===n.style.bottom&&(t.scrollTop=a>0?a:0,n.style.justifyContent="flex-end")}}}f.current=t.scrollTop})})})]})},"SelectViewport")),[tG,tV]=th("SelectGroup"),tW=o.forwardRef(ta(function(e,t){let{__scopeSelect:n,...r}=e,o=(0,m.B)();return(0,e_.jsx)(tG,{scope:n,id:o,children:(0,e_.jsx)(eB.sG.div,{role:"group","aria-labelledby":o,...r,ref:t})})},"SelectGroup")),t_=o.forwardRef(ta(function(e,t){let{__scopeSelect:n,...r}=e,o=tV("SelectLabel",n);return(0,e_.jsx)(eB.sG.div,{id:o.id,...r,ref:t})},"SelectLabel")),tq="SelectItem",[tU,tX]=th(tq),tZ=o.forwardRef(ta(function(e,t){let{__scopeSelect:n,value:r,disabled:i=!1,textValue:l,...u}=e,c=ty(tq,n),f=tL(tq,n),d=c.value===r,[p,h]=o.useState(null!=l?l:""),[v,g]=o.useState(!1),y=(0,eG.c)(e=>{var t;return null===(t=f.itemRefCallback)||void 0===t?void 0:t.call(f,e,r,i)}),w=(0,s.s)(t,y),x=(0,m.B)(),b=o.useRef("touch"),S=ta(()=>{i||(c.onValueChange(r),c.onOpenChange(!1))},"handleSelect");return(0,e_.jsx)(tU,{scope:n,value:r,disabled:i,textId:x,isSelected:d,onItemTextChange:o.useCallback(e=>{h(t=>{var n;return t||(null!==(n=null==e?void 0:e.textContent)&&void 0!==n?n:"").trim()})},[]),children:(0,e_.jsx)(tf.ItemSlot,{scope:n,value:r,disabled:i,textValue:p,children:(0,e_.jsx)(eB.sG.div,{role:"option","aria-labelledby":x,"data-highlighted":v?"":void 0,"aria-selected":d&&v,"data-state":d?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...u,ref:w,onFocus:(0,a.mK)(u.onFocus,()=>g(!0)),onBlur:(0,a.mK)(u.onBlur,()=>g(!1)),onClick:(0,a.mK)(u.onClick,()=>{"mouse"!==b.current&&S()}),onPointerUp:(0,a.mK)(u.onPointerUp,()=>{"mouse"===b.current&&S()}),onPointerDown:(0,a.mK)(u.onPointerDown,e=>{b.current=e.pointerType}),onPointerMove:(0,a.mK)(u.onPointerMove,e=>{if(b.current=e.pointerType,i){var t;null===(t=f.onItemLeave)||void 0===t||t.call(f)}else"mouse"===b.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:(0,a.mK)(u.onPointerLeave,e=>{if(e.currentTarget===document.activeElement){var t;null===(t=f.onItemLeave)||void 0===t||t.call(f)}}),onKeyDown:(0,a.mK)(u.onKeyDown,e=>{var t;i||e.target!==e.currentTarget||(null===(t=f.searchRef)||void 0===t?void 0:t.current)!==""&&" "===e.key||(ts.includes(e.key)&&S()," "===e.key&&e.preventDefault())})})})})},"SelectItem")),t$="SelectItemText",tY=o.forwardRef(ta(function(e,t){let{__scopeSelect:n,className:r,style:l,...a}=e,u=ty(t$,n),c=tL(t$,n),f=tX(t$,n),d=tx(t$,n),[p,h]=o.useState(null),m=(0,eG.c)(e=>{var t;return null===(t=c.itemTextRefCallback)||void 0===t?void 0:t.call(c,e,f.value,f.disabled)}),v=(0,s.s)(t,h,f.onItemTextChange,m),g=null==p?void 0:p.textContent,y=o.useMemo(()=>(0,e_.jsx)("option",{value:f.value,disabled:f.disabled,children:g},f.value),[f.disabled,f.value,g]),{onNativeOptionAdd:w,onNativeOptionRemove:x}=d;return(0,eV.N)(()=>(w(y),()=>x(y)),[w,x,y]),(0,e_.jsxs)(e_.Fragment,{children:[(0,e_.jsx)(eB.sG.span,{id:f.textId,...a,ref:v}),f.isSelected&&u.valueNode&&!u.valueNodeHasChildren&&!t2(u.value)?i.createPortal(a.children,u.valueNode):null]})},"SelectItemText")),tJ=o.forwardRef(ta(function(e,t){let{__scopeSelect:n,...r}=e;return tX("SelectItemIndicator",n).isSelected?(0,e_.jsx)(eB.sG.span,{"aria-hidden":!0,...r,ref:t}):null},"SelectItemIndicator")),tQ=o.forwardRef(ta(function(e,t){let{__scopeSelect:n,...r}=e;return(0,e_.jsx)(eB.sG.div,{"aria-hidden":!0,...r,ref:t})},"SelectSeparator")),t0=o.forwardRef(ta(function(e,t){let{__scopeSelect:n,...r}=e,i=ty("SelectBubbleInput",n),{value:l,onValueChange:a,required:u,disabled:c,name:f,autoComplete:d,form:p}=i,{nativeOptions:h,nativeSelectKey:m}=i,v=o.useRef(null),g=(0,s.s)(t,v),y=null!=l?l:"",w=(0,tn.Z)(y),x=Array.from(h).some(e=>{var t;return(null!==(t=e.props.value)&&void 0!==t?t:"")===""});return o.useEffect(()=>{let e=v.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLSelectElement.prototype,"value").set;if(w!==y&&t){let n=new Event("change",{bubbles:!0});t.call(e,y),e.dispatchEvent(n)}},[w,y]),(0,e_.jsxs)(eB.sG.select,{"aria-hidden":!0,required:u,tabIndex:-1,name:f,autoComplete:d,disabled:c,form:p,onChange:e=>a(e.target.value),...r,style:{...tr,...r.style},ref:g,defaultValue:y,children:[t2(l)&&!x?(0,e_.jsx)("option",{value:""}):null,Array.from(h)]},m)},"SelectBubbleInput"));function t1(e){return"function"==typeof e}function t2(e){return""===e||void 0===e}function t6(e){let t=(0,eG.c)(e),n=o.useRef(""),r=o.useRef(0),i=o.useCallback(e=>{t(n.current+e)},[t]),l=o.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return o.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,l]}function t5(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,o=n?e.indexOf(n):-1,i=t7(e,Math.max(o,0));1===r.length&&(i=i.filter(e=>e!==n));let l=i.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return l!==n?l:void 0}function t7(e,t){return e.map((n,r)=>e[(t+r)%e.length])}ta(t1,"isFunction"),ta(t2,"shouldShowPlaceholder"),ta(t6,"useTypeaheadSearch"),ta(t5,"findNextItem"),ta(t7,"wrapArray")},2413:(e,t,n)=>{n.d(t,{bL:()=>x,zi:()=>b});var r=n(2115),o=n(3610),i=n(8068),l=n(8166),a=n(7924),u=n(7510),s=n(3360),c=n(5155),f=Object.defineProperty,d=(e,t)=>f(e,"name",{value:t,configurable:!0}),p="Switch",[h,m]=(0,l.A)(p),[v,g]=h(p);function y(e){let{__scopeSwitch:t,checked:n,children:o,defaultChecked:i,disabled:l,form:u,name:s,onCheckedChange:f,required:d,value:h="on",internal_do_not_use_render:m}=e,[g,y]=(0,a.i)({prop:n,defaultProp:null!=i&&i,onChange:f,caller:p}),[w,x]=r.useState(null),[b,S]=r.useState(null),C=r.useRef(!1),[A,j]=r.useReducer(e=>e+1,0),T=!w||!!u||!!w.closest("form"),E={checked:g,setChecked:y,disabled:l,control:w,setControl:x,name:s,form:u,value:h,hasConsumerStoppedPropagationRef:C,userInteractionCount:A,onUserInteraction:j,required:d,defaultChecked:i,isFormControl:T,bubbleInput:b,setBubbleInput:S};return(0,c.jsx)(v,{scope:t,...E,children:R(m)?m(E):o})}d(y,"SwitchProvider");var w=r.forwardRef(d(function(e,t){let{__scopeSwitch:n,onClick:l,...a}=e,{control:u,form:f,value:p,disabled:h,checked:m,required:v,setControl:y,setChecked:w,hasConsumerStoppedPropagationRef:x,onUserInteraction:b,isFormControl:S,bubbleInput:R}=g("SwitchTrigger",n),A=(0,i.s)(t,y),j=r.useRef(m);return r.useEffect(()=>{let e=f?null==u?void 0:u.ownerDocument.getElementById(f):null==u?void 0:u.form;if(e instanceof HTMLFormElement){let t=d(()=>w(j.current),"reset");return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[u,f,w]),(0,c.jsx)(s.sG.button,{type:"button",role:"switch","aria-checked":m,"aria-required":v,"data-state":C(m),"data-disabled":h?"":void 0,disabled:h,value:p,...a,ref:A,onClick:(0,o.mK)(l,e=>{b(),w(e=>!e),R&&S&&(x.current=e.isPropagationStopped(),x.current||e.stopPropagation())})})},"SwitchTrigger")),x=r.forwardRef(d(function(e,t){let{__scopeSwitch:n,name:r,checked:o,defaultChecked:i,required:l,disabled:a,value:u,onCheckedChange:s,form:f,...d}=e;return(0,c.jsx)(y,{__scopeSwitch:n,checked:o,defaultChecked:i,disabled:a,required:l,onCheckedChange:s,name:r,form:f,value:u,internal_do_not_use_render:e=>{let{isFormControl:r}=e;return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(w,{...d,ref:t,__scopeSwitch:n}),r&&(0,c.jsx)(S,{__scopeSwitch:n})]})}})},"Switch")),b=r.forwardRef(d(function(e,t){let{__scopeSwitch:n,...r}=e,o=g("SwitchThumb",n);return(0,c.jsx)(s.sG.span,{"data-state":C(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:t})},"SwitchThumb")),S=r.forwardRef(d(function(e,t){let{__scopeSwitch:n,onClick:l,...a}=e,{control:f,hasConsumerStoppedPropagationRef:d,userInteractionCount:p,checked:h,defaultChecked:m,required:v,disabled:y,name:w,value:x,form:b,bubbleInput:S,setBubbleInput:R}=g("SwitchBubbleInput",n),C=(0,i.s)(t,R),A=(0,u.X)(f),j=r.useRef(!1),T=r.useRef(h),E=r.useRef(p);r.useEffect(()=>{if(!S)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set,t=p!==E.current;E.current=p;let n=T.current!==h;T.current=h;let r=!(t&&d.current);if(n&&e){j.current=!t;let n=new Event("click",{bubbles:r});e.call(S,h),S.dispatchEvent(n),j.current=!1}},[S,h,d,p]);let P=r.useRef(h);return(0,c.jsx)(s.sG.input,{type:"checkbox","aria-hidden":!0,defaultChecked:null!=m?m:P.current,required:v,disabled:y,name:w,value:x,form:b,...a,tabIndex:-1,ref:C,onClick:(0,o.mK)(l,e=>{j.current&&e.stopPropagation()}),style:{...a.style,...A,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function R(e){return"function"==typeof e}function C(e){return e?"checked":"unchecked"}d(R,"isFunction"),d(C,"getState")},3078:(e,t,n)=>{n.d(t,{UC:()=>eu,B8:()=>el,bL:()=>ei,l9:()=>ea});var r=n(2115),o=n.t(r,2),i=n(3610),l=n(8166),a=n(8050),u=n(8068),s=n(7668),c=n(3360),f=n(1524),d=n(7924),p=n(4256),h=n(6611),m=Object.defineProperty,v=(e,t)=>m(e,"name",{value:t,configurable:!0}),g=!1;function y(){let[e,t]=r.useState(g);return r.useEffect(()=>{g||(g=!0,t(!0))},[]),e}v(y,"useIsHydrated");var w=o[" useSyncExternalStore ".trim().toString()];function x(){return()=>{}}function b(){return w(x,()=>!0,()=>!1)}v(x,"subscribe"),v(b,"useIsHydratedModern");var S="function"==typeof w?b:y,R=n(5155),C=Object.defineProperty,A=(e,t)=>C(e,"name",{value:t,configurable:!0}),j="rovingFocusGroup.onEntryFocus",T={bubbles:!1,cancelable:!0},E="RovingFocusGroup",[P,k,I]=(0,a.N)(E),[O,L]=(0,l.A)(E,[I]),[D,M]=O(E),F=r.forwardRef(A(function(e,t){return(0,R.jsx)(P.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,R.jsx)(P.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,R.jsx)(K,{...e,ref:t})})})},"RovingFocusGroup")),K=r.forwardRef(A(function(e,t){let{__scopeRovingFocusGroup:n,orientation:o,loop:l=!1,dir:a,currentTabStopId:s,defaultCurrentTabStopId:h,onCurrentTabStopIdChange:m,onEntryFocus:v,preventScrollOnEntryFocus:g=!1,...y}=e,w=r.useRef(null),x=(0,u.s)(t,w),b=(0,p.jH)(a),[S,C]=(0,d.i)({prop:s,defaultProp:null!=h?h:null,onChange:m,caller:E}),[A,P]=r.useState(!1),I=(0,f.c)(v),O=k(n),L=r.useRef(!1),[M,F]=r.useState(0);return r.useEffect(()=>{let e=w.current;if(e)return e.addEventListener(j,I),()=>e.removeEventListener(j,I)},[I]),(0,R.jsx)(D,{scope:n,orientation:o,dir:b,loop:l,currentTabStopId:S,onItemFocus:r.useCallback(e=>C(e),[C]),onItemShiftTab:r.useCallback(()=>P(!0),[]),onFocusableItemAdd:r.useCallback(()=>F(e=>e+1),[]),onFocusableItemRemove:r.useCallback(()=>F(e=>e-1),[]),children:(0,R.jsx)(c.sG.div,{tabIndex:A||0===M?-1:0,"data-orientation":o,...y,ref:x,style:{outline:"none",...e.style},onMouseDown:(0,i.mK)(e.onMouseDown,()=>{L.current=!0}),onFocus:(0,i.mK)(e.onFocus,e=>{let t=!L.current;if(e.target===e.currentTarget&&t&&!A){let t=new CustomEvent(j,T);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=O().filter(e=>e.focusable);G([e.find(e=>e.active),e.find(e=>e.id===S),...e].filter(Boolean).map(e=>e.ref.current),g)}}L.current=!1}),onBlur:(0,i.mK)(e.onBlur,()=>P(!1))})})},"RovingFocusGroupImpl")),H=r.forwardRef(A(function(e,t){let{__scopeRovingFocusGroup:n,focusable:o=!0,active:l=!1,tabStopId:a,children:u,...f}=e,d=(0,s.B)(),p=a||d,m=M("RovingFocusGroupItem",n),v=m.currentTabStopId===p,g=k(n),{onFocusableItemAdd:y,onFocusableItemRemove:w,currentTabStopId:x}=m,b=S();return(0,h.N)(()=>{if(b&&o)return y(),()=>w()},[b,o,y,w]),r.useEffect(()=>{if(!b&&o)return y(),()=>w()},[b,o,y,w]),(0,R.jsx)(P.ItemSlot,{scope:n,id:p,focusable:o,active:l,children:(0,R.jsx)(c.sG.span,{tabIndex:v?0:-1,"data-orientation":m.orientation,...f,ref:t,onMouseDown:(0,i.mK)(e.onMouseDown,e=>{o?m.onItemFocus(p):e.preventDefault()}),onFocus:(0,i.mK)(e.onFocus,()=>m.onItemFocus(p)),onKeyDown:(0,i.mK)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey){m.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=B(e,m.orientation,m.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=g().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)n.reverse();else if("prev"===t||"next"===t){"prev"===t&&n.reverse();let r=n.indexOf(e.currentTarget);n=m.loop?V(n,r+1):n.slice(r+1)}setTimeout(()=>G(n))}}),children:"function"==typeof u?u({isCurrentTabStop:v,hasTabStop:null!=x}):u})})},"RovingFocusGroupItem")),N={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function z(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}function B(e,t,n){let r=z(e.key,n);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(r))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)))return N[r]}function G(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function V(e,t){return e.map((n,r)=>e[(t+r)%e.length])}A(z,"getDirectionAwareKey"),A(B,"getFocusIntent"),A(G,"focusFirst"),A(V,"wrapArray");var W=n(7028),_=Object.defineProperty,q=(e,t)=>_(e,"name",{value:t,configurable:!0}),U="Tabs",[X,Z]=(0,l.A)(U,[L]),$=L(),[Y,J]=X(U),Q=r.forwardRef(q(function(e,t){let{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:l="horizontal",dir:a,activationMode:u="automatic",...f}=e,h=(0,p.jH)(a),[m,v]=(0,d.i)({prop:r,onChange:o,defaultProp:null!=i?i:"",caller:U});return(0,R.jsx)(Y,{scope:n,baseId:(0,s.B)(),value:m,onValueChange:v,orientation:l,dir:h,activationMode:u,children:(0,R.jsx)(c.sG.div,{dir:h,"data-orientation":l,...f,ref:t})})},"Tabs")),ee=r.forwardRef(q(function(e,t){let{__scopeTabs:n,loop:r=!0,...o}=e,i=J("TabsList",n),l=$(n);return(0,R.jsx)(F,{asChild:!0,...l,orientation:i.orientation,dir:i.dir,loop:r,children:(0,R.jsx)(c.sG.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})},"TabsList")),et=r.forwardRef(q(function(e,t){let{__scopeTabs:n,value:r,disabled:o=!1,...l}=e,a=J("TabsTrigger",n),u=$(n),s=er(a.baseId,r),f=eo(a.baseId,r),d=r===a.value;return(0,R.jsx)(H,{asChild:!0,...u,focusable:!o,active:d,children:(0,R.jsx)(c.sG.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":f,"data-state":d?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:s,...l,ref:t,onMouseDown:(0,i.mK)(e.onMouseDown,e=>{o||0!==e.button||!1!==e.ctrlKey?e.preventDefault():a.onValueChange(r)}),onKeyDown:(0,i.mK)(e.onKeyDown,e=>{!o&&e.target===e.currentTarget&&[" ","Enter"].includes(e.key)&&a.onValueChange(r)}),onFocus:(0,i.mK)(e.onFocus,()=>{let e="manual"!==a.activationMode;d||o||!e||a.onValueChange(r)})})})},"TabsTrigger")),en=r.forwardRef(q(function(e,t){let{__scopeTabs:n,value:o,forceMount:i,children:l,...a}=e,u=J("TabsContent",n),s=er(u.baseId,o),f=eo(u.baseId,o),d=o===u.value,p=r.useRef(d);return r.useEffect(()=>{let e=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,R.jsx)(W.C,{present:i||d,children:n=>{let{present:r}=n;return(0,R.jsx)(c.sG.div,{"data-state":d?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":s,hidden:!r,id:f,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:r&&l})}})},"TabsContent"));function er(e,t){return"".concat(e,"-trigger-").concat(t)}function eo(e,t){return"".concat(e,"-content-").concat(t)}q(er,"makeTriggerId"),q(eo,"makeContentId");var ei=Q,el=ee,ea=et,eu=en},858:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(2115);function o(e){let t=r.useRef({value:e,previous:e});return r.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}(0,Object.defineProperty)(o,"name",{value:"usePrevious",configurable:!0})},7510:(e,t,n)=>{n.d(t,{X:()=>i});var r=n(2115),o=n(6611);function i(e){let[t,n]=r.useState(void 0);return(0,o.N)(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let r,o;if(!Array.isArray(t)||!t.length)return;let i=t[0];if("borderBoxSize"in i){let e=i.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,o=t.blockSize}else r=e.offsetWidth,o=e.offsetHeight;n({width:r,height:o})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)},[e]),t}(0,Object.defineProperty)(i,"name",{value:"useSize",configurable:!0})}}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2455],{3821:(e,s,a)=>{Promise.resolve().then(a.bind(a,9789))},5765:(e,s,a)=>{"use strict";a.d(s,{A:()=>t});let t=(0,a(7401).A)("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]])},4505:(e,s,a)=>{"use strict";a.d(s,{A:()=>t});let t=(0,a(7401).A)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},3473:(e,s,a)=>{"use strict";a.d(s,{A:()=>t});let t=(0,a(7401).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},1773:(e,s,a)=>{"use strict";a.d(s,{A:()=>t});let t=(0,a(7401).A)("RefreshCw",[["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"}]])},5686:(e,s,a)=>{"use strict";a.d(s,{A:()=>t});let t=(0,a(7401).A)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},9789:(e,s,a)=>{"use strict";a.r(s),a.d(s,{default:()=>P});var t=a(5155),r=a(2115),n=a(7266),l=a(7113),i=a(6046),d=a(4505),o=a(8867),c=a(7401);let m=(0,c.A)("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);var u=a(3473),x=a(1719),h=a(6967),p=a(5686);let v=(0,c.A)("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),g=(0,c.A)("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),f=(0,c.A)("CircleX",[["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"}]]);var y=a(1773),j=a(6609),b=a(3312),N=a(3900),k=a(8986),w=a(488),C=a(2884),S=a(7528),A=a(5121),E=a(1567),T=a(853),K=a(5765);let z=(0,c.A)("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);var M=a(6754),B=a(1344);function I(e){let{enabledSkills:s,onChange:a}=e,[n,l]=(0,r.useState)([]),[i,o]=(0,r.useState)(!1),[c,m]=(0,r.useState)(!1),x=(0,r.useCallback)(()=>{o(!0),fetch("/api/skills").then(e=>e.json()).then(l).finally(()=>o(!1))},[]);(0,r.useEffect)(()=>{x()},[x]);let h=async e=>{await fetch("/api/skills/".concat(encodeURIComponent(e)),{method:"DELETE"}),l(s=>s.filter(s=>s.name!==e)),a&&s&&a(s.filter(s=>s!==e))};return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"text-sm text-muted-foreground",children:["已安装 ",(0,t.jsx)("span",{className:"font-medium text-foreground",children:n.length})," 个 Skill"]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)(b.$,{variant:"ghost",size:"sm",onClick:x,disabled:i,className:"gap-1.5 h-8",children:[(0,t.jsx)(y.A,{className:(0,E.cn)("h-3.5 w-3.5",i&&"animate-spin")}),"刷新"]}),(0,t.jsxs)(b.$,{variant:"outline",size:"sm",onClick:()=>m(!0),className:"gap-1.5 h-8",children:[(0,t.jsx)(u.A,{className:"h-3.5 w-3.5"}),"安装 Skill"]})]})]}),i?(0,t.jsxs)("div",{className:"flex items-center justify-center py-10 text-muted-foreground text-sm",children:[(0,t.jsx)(d.A,{className:"h-4 w-4 animate-spin mr-2"}),"加载中…"]}):0===n.length?(0,t.jsxs)("div",{className:"rounded-xl border border-dashed p-10 text-center text-sm text-muted-foreground",children:[(0,t.jsx)("p",{className:"mb-2",children:"还没有安装任何 Skill"}),(0,t.jsxs)(b.$,{variant:"outline",size:"sm",onClick:()=>m(!0),className:"gap-1.5",children:[(0,t.jsx)(u.A,{className:"h-3.5 w-3.5"}),"安装第一个 Skill"]})]}):(0,t.jsx)("div",{className:"space-y-2",children:n.map(e=>(0,t.jsxs)("div",{className:"group flex items-start gap-3 rounded-xl border p-3.5 hover:bg-secondary/20 transition-colors",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,t.jsx)("span",{className:"font-mono text-sm font-medium",children:e.name}),e.hasSetup&&(0,t.jsx)(A.E,{variant:"outline",className:"text-[10px] h-4 px-1.5 font-normal",children:"含 Setup"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:e.description||"暂无描述"}),(0,t.jsx)("p",{className:"text-[10px] text-muted-foreground/60 mt-0.5 font-mono truncate",children:e.filePath})]}),(0,t.jsx)("button",{type:"button",onClick:()=>h(e.name),title:"卸载",className:"opacity-0 group-hover:opacity-100 p-1.5 rounded-lg text-muted-foreground hover:text-destructive hover:bg-destructive/10 transition-all shrink-0",children:(0,t.jsx)(p.A,{className:"h-4 w-4"})})]},e.name))}),(0,t.jsx)(L,{open:c,onClose:()=>m(!1),onInstalled:x,installed:n})]})}function L(e){let{open:s,onClose:a,onInstalled:n,installed:l}=e,i=new Set(l.map(e=>e.name)),[c,m]=(0,r.useState)("search"),[u,x]=(0,r.useState)(""),[h,p]=(0,r.useState)([]),[v,g]=(0,r.useState)(!1),[y,j]=(0,r.useState)(""),[w,S]=(0,r.useState)(null),[I,L]=(0,r.useState)({}),[J,P]=(0,r.useState)(""),[D,O]=(0,r.useState)(""),[R,$]=(0,r.useState)(""),[U,V]=(0,r.useState)("idle"),[q,F]=(0,r.useState)(""),_=(0,r.useRef)(null),H=(0,r.useCallback)(async e=>{if(!e.trim()){p([]);return}g(!0),j("");try{var s,a;let t=await fetch("/api/skills/search",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:e.trim(),limit:30})}),r=await t.json();if(!t.ok)throw Error(null!==(s=r.error)&&void 0!==s?s:"HTTP ".concat(t.status));p(null!==(a=r.results)&&void 0!==a?a:[])}catch(e){j(String(e)),p([])}finally{g(!1)}},[]);(0,r.useEffect)(()=>{if("search"===c)return _.current&&clearTimeout(_.current),_.current=setTimeout(()=>H(u),400),()=>{_.current&&clearTimeout(_.current)}},[u,c,H]);let X=async e=>{S(e);try{var s;let a=await fetch("/api/skills/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({package:e})}),t=await a.json();if(!a.ok||!t.success)throw Error(null!==(s=t.error)&&void 0!==s?s:"安装失败");L(s=>({...s,[e]:"ok"})),n()}catch(s){L(s=>({...s,[e]:"err"})),console.error(s)}finally{S(null)}},W=async()=>{V("loading"),F("");try{var e;let s="url"===c?{url:J.trim()}:{content:D.trim(),name:R.trim()},t=await fetch("/api/skills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}),r=await t.json();if(!t.ok)throw Error(null!==(e=r.error)&&void 0!==e?e:"安装失败");V("ok"),n(),setTimeout(()=>{a(),G()},1200)}catch(e){V("err"),F(String(e))}},G=()=>{x(""),p([]),j(""),P(""),O(""),$(""),V("idle"),F(""),L({})};return(0,t.jsx)(B.lG,{open:s,onOpenChange:e=>{e||(a(),G())},children:(0,t.jsxs)(B.Cf,{className:"max-w-xl max-h-[85vh] flex flex-col",children:[(0,t.jsx)(B.c7,{children:(0,t.jsx)(B.L3,{children:"安装 Skill"})}),(0,t.jsxs)(C.tU,{value:c,onValueChange:e=>m(e),className:"flex-1 flex flex-col min-h-0",children:[(0,t.jsxs)(C.j7,{className:"shrink-0",children:[(0,t.jsx)(C.Xi,{value:"search",children:"\uD83D\uDD0D 社区搜索"}),(0,t.jsx)(C.Xi,{value:"url",children:"\uD83D\uDD17 URL 安装"}),(0,t.jsx)(C.Xi,{value:"paste",children:"\uD83D\uDCCB 粘贴内容"})]}),(0,t.jsxs)(C.av,{value:"search",className:"flex-1 flex flex-col min-h-0 space-y-3 mt-3",children:[(0,t.jsxs)("div",{className:"relative shrink-0",children:[(0,t.jsx)(T.A,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),(0,t.jsx)(N.p,{value:u,onChange:e=>x(e.target.value),placeholder:"搜索社区 Skills,例如:web search、pdf、code review…",className:"pl-9",autoFocus:!0})]}),(0,t.jsxs)("div",{className:"flex-1 overflow-y-auto min-h-0 space-y-1.5 pr-1",children:[v&&(0,t.jsxs)("div",{className:"flex items-center justify-center py-12 text-muted-foreground text-sm",children:[(0,t.jsx)(d.A,{className:"h-4 w-4 animate-spin mr-2"}),"搜索中…"]}),!v&&y&&(0,t.jsx)("div",{className:"py-8 text-center text-sm text-destructive",children:y}),!v&&!y&&u&&0===h.length&&(0,t.jsxs)("div",{className:"py-8 text-center text-sm text-muted-foreground",children:["未找到「",u,"」相关 Skill"]}),!v&&!y&&!u&&(0,t.jsxs)("div",{className:"py-8 text-center text-sm text-muted-foreground",children:["输入关键词搜索 ",(0,t.jsx)("a",{href:"https://skills.sh",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"skills.sh"})," 社区 Skills"]}),h.map(e=>{let s=I[e.package],a=w===e.package,r=i.has(e.name);return(0,t.jsxs)("div",{className:(0,E.cn)("flex items-start gap-3 rounded-xl border p-3 transition-colors",r?"bg-[#57BE6B]/5 border-[#57BE6B]/30":"hover:bg-secondary/30"),children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,t.jsx)("span",{className:"font-mono text-sm font-medium",children:e.name}),r&&(0,t.jsx)(A.E,{className:"text-[10px] h-4 px-1.5 bg-[#57BE6B]/15 text-[#57BE6B] border-0 font-normal",children:"已安装"}),e.installs>0&&(0,t.jsxs)("span",{className:"text-[10px] text-muted-foreground bg-secondary px-1.5 py-0.5 rounded",children:["↓ ",e.installsDisplay]})]}),(0,t.jsx)("p",{className:"text-[11px] font-mono text-muted-foreground/70 mt-0.5",children:e.package}),(0,t.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-blue-500 hover:underline flex items-center gap-0.5 mt-0.5 w-fit",children:[(0,t.jsx)(K.A,{className:"h-2.5 w-2.5"}),"查看详情"]})]}),r?(0,t.jsxs)("div",{className:"flex items-center gap-1 h-7 px-2 text-xs text-[#57BE6B] shrink-0",children:[(0,t.jsx)(o.A,{className:"h-3.5 w-3.5"}),"已安装"]}):(0,t.jsx)(b.$,{size:"sm",variant:"ok"===s?"ghost":"outline",className:(0,E.cn)("h-7 text-xs shrink-0 gap-1 min-w-[56px]","ok"===s&&"text-green-600 dark:text-green-400"),disabled:a||"ok"===s,onClick:()=>X(e.package),children:a?(0,t.jsx)(d.A,{className:"h-3 w-3 animate-spin"}):"ok"===s?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.A,{className:"h-3 w-3"}),"已装"]}):"err"===s?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(f,{className:"h-3 w-3 text-destructive"}),"失败"]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(z,{className:"h-3 w-3"}),"安装"]})})]},e.package)})]})]}),(0,t.jsxs)(C.av,{value:"url",className:"space-y-3 mt-3",children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(k.J,{className:"text-xs text-muted-foreground",children:"SKILL.md 的原始 URL"}),(0,t.jsx)(N.p,{value:J,onChange:e=>P(e.target.value),placeholder:"https://raw.githubusercontent.com/user/repo/main/skill/SKILL.md",className:"font-mono text-sm"}),(0,t.jsx)("p",{className:"text-[11px] text-muted-foreground",children:"支持 GitHub raw 链接或任意可访问的 markdown 地址"})]}),"ok"===U&&(0,t.jsxs)("p",{className:"text-sm text-green-600 flex items-center gap-1",children:[(0,t.jsx)(o.A,{className:"h-4 w-4"}),"安装成功!"]}),"err"===U&&(0,t.jsxs)("p",{className:"text-sm text-destructive flex items-center gap-1",children:[(0,t.jsx)(f,{className:"h-4 w-4"}),q]}),(0,t.jsxs)(B.Es,{children:[(0,t.jsx)(b.$,{variant:"outline",onClick:()=>{a(),G()},children:"取消"}),(0,t.jsxs)(b.$,{onClick:W,disabled:"loading"===U||!J.trim(),children:["loading"===U&&(0,t.jsx)(d.A,{className:"mr-2 h-4 w-4 animate-spin"}),"安装"]})]})]}),(0,t.jsxs)(C.av,{value:"paste",className:"space-y-3 mt-3",children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(k.J,{className:"text-xs text-muted-foreground",children:"Skill 名称(slug)"}),(0,t.jsx)(N.p,{value:R,onChange:e=>$(e.target.value),placeholder:"my-skill",className:"font-mono text-sm"})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(k.J,{className:"text-xs text-muted-foreground",children:"SKILL.md 内容"}),(0,t.jsx)(M.T,{value:D,onChange:e=>O(e.target.value),placeholder:"---\nname: my-skill\ndescription: 描述这个 skill 的用途\n---\n\n# My Skill\n\n...",rows:8,className:"font-mono text-xs"})]}),"ok"===U&&(0,t.jsxs)("p",{className:"text-sm text-green-600 flex items-center gap-1",children:[(0,t.jsx)(o.A,{className:"h-4 w-4"}),"安装成功!"]}),"err"===U&&(0,t.jsxs)("p",{className:"text-sm text-destructive flex items-center gap-1",children:[(0,t.jsx)(f,{className:"h-4 w-4"}),q]}),(0,t.jsxs)(B.Es,{children:[(0,t.jsx)(b.$,{variant:"outline",onClick:()=>{a(),G()},children:"取消"}),(0,t.jsxs)(b.$,{onClick:W,disabled:"loading"===U||!D.trim(),children:["loading"===U&&(0,t.jsx)(d.A,{className:"mr-2 h-4 w-4 animate-spin"}),"安装"]})]})]})]})]})})}let J=[{value:"anthropic-messages",label:"Anthropic Messages"},{value:"openai-responses",label:"OpenAI Responses"},{value:"openai-completions",label:"OpenAI Completions (Legacy)"},{value:"google-generative-ai",label:"Google Generative AI"},{value:"bedrock-converse-stream",label:"AWS Bedrock Converse"}];function P(){var e,s,a,c,x,h,p,v;let g=(0,n.useTranslations)("settings"),f=(0,n.useTranslations)("common"),{theme:y,setTheme:j}=(0,l.D)(),w=(0,n.useLocale)(),A=(0,i.useRouter)(),E=(0,i.usePathname)(),[T,K]=(0,r.useState)({}),[z,M]=(0,r.useState)({providers:{}}),[B,L]=(0,r.useState)({currentProvider:"openai",providers:{}}),[J,P]=(0,r.useState)("idle");(0,r.useEffect)(()=>{fetch("/api/models-config").then(e=>e.json()).then(e=>{var s,a;K(null!==(s=e.auth)&&void 0!==s?s:{}),M(null!==(a=e.modelsConfig)&&void 0!==a?a:{providers:{}})}),fetch("/api/voice-provider").then(e=>e.json()).then(e=>{L(e)})},[]);let O=(0,r.useCallback)(async()=>{P("saving"),await fetch("/api/models-config",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({auth:T,modelsConfig:z})}),await fetch("/api/voice-provider",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(B)}),P("saved"),setTimeout(()=>P("idle"),2500),await fetch("/api/models")},[T,z,B]);return(0,t.jsxs)("div",{className:"p-6 max-w-3xl mx-auto",children:[(0,t.jsxs)("div",{className:"mb-6 flex items-center justify-between p-4 rounded-xl bg-white dark:bg-slate-800/50 backdrop-blur-sm border border-gray-200 dark:border-slate-700/50 neo-card",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-2xl font-bold text-gray-900 dark:bg-gradient-to-r dark:from-cyan-400 dark:to-blue-400 dark:bg-clip-text dark:text-transparent",children:g("title")}),(0,t.jsx)("p",{className:"text-sm text-gray-700 dark:text-gray-400 mt-1",children:g("subtitle")})]}),(0,t.jsxs)(b.$,{onClick:O,disabled:"saving"===J,className:"neo-button gap-2 bg-gradient-to-r from-blue-500 to-indigo-500 dark:from-cyan-600 dark:to-blue-600 hover:from-blue-600 hover:to-indigo-600 dark:hover:from-cyan-500 dark:hover:to-blue-500 text-white border-0 shadow-lg hover:shadow-blue-500/30 dark:hover:shadow-cyan-500/50 transition-all duration-200 hover:scale-105",children:["saving"===J?(0,t.jsx)(d.A,{className:"h-4 w-4 animate-spin"}):"saved"===J?(0,t.jsx)(o.A,{className:"h-4 w-4"}):(0,t.jsx)(m,{className:"h-4 w-4"}),"saving"===J?"保存中…":"saved"===J?"已保存":f("save")]})]}),(0,t.jsxs)(C.tU,{defaultValue:"providers",children:[(0,t.jsxs)(C.j7,{className:"mb-6 neo-card bg-gray-50 dark:bg-slate-800/50 backdrop-blur-sm border border-gray-200 dark:border-slate-700/50 p-1",children:[(0,t.jsx)(C.Xi,{value:"providers",className:"data-[state=active]:neo-card-inset data-[state=active]:bg-blue-100 data-[state=active]:text-blue-700 dark:data-[state=active]:bg-gradient-to-r dark:data-[state=active]:from-cyan-600 dark:data-[state=active]:to-blue-600 dark:data-[state=active]:text-white hover:bg-gray-100 dark:hover:bg-slate-700/50 transition-all duration-200",children:"内置提供商"}),(0,t.jsx)(C.Xi,{value:"custom",className:"data-[state=active]:neo-card-inset data-[state=active]:bg-blue-100 data-[state=active]:text-blue-700 dark:data-[state=active]:bg-gradient-to-r dark:data-[state=active]:from-cyan-600 dark:data-[state=active]:to-blue-600 dark:data-[state=active]:text-white hover:bg-gray-100 dark:hover:bg-slate-700/50 transition-all duration-200",children:"自定义提供商"}),(0,t.jsx)(C.Xi,{value:"voice",className:"data-[state=active]:neo-card-inset data-[state=active]:bg-blue-100 data-[state=active]:text-blue-700 dark:data-[state=active]:bg-gradient-to-r dark:data-[state=active]:from-cyan-600 dark:data-[state=active]:to-blue-600 dark:data-[state=active]:text-white hover:bg-gray-100 dark:hover:bg-slate-700/50 transition-all duration-200",children:"语音供应商"}),(0,t.jsx)(C.Xi,{value:"envvars",className:"data-[state=active]:neo-card-inset data-[state=active]:bg-blue-100 data-[state=active]:text-blue-700 dark:data-[state=active]:bg-gradient-to-r dark:data-[state=active]:from-cyan-600 dark:data-[state=active]:to-blue-600 dark:data-[state=active]:text-white hover:bg-gray-100 dark:hover:bg-slate-700/50 transition-all duration-200",children:"环境变量"}),(0,t.jsx)(C.Xi,{value:"skills",className:"data-[state=active]:neo-card-inset data-[state=active]:bg-blue-100 data-[state=active]:text-blue-700 dark:data-[state=active]:bg-gradient-to-r dark:data-[state=active]:from-cyan-600 dark:data-[state=active]:to-blue-600 dark:data-[state=active]:text-white hover:bg-gray-100 dark:hover:bg-slate-700/50 transition-all duration-200",children:"Skills 管理"}),(0,t.jsx)(C.Xi,{value:"appearance",className:"data-[state=active]:neo-card-inset data-[state=active]:bg-blue-100 data-[state=active]:text-blue-700 dark:data-[state=active]:bg-gradient-to-r dark:data-[state=active]:from-cyan-600 dark:data-[state=active]:to-blue-600 dark:data-[state=active]:text-white hover:bg-gray-100 dark:hover:bg-slate-700/50 transition-all duration-200",children:"外观 & 语言"})]}),(0,t.jsx)(C.av,{value:"providers",className:"space-y-4",children:(0,t.jsx)(U,{apiKeys:T,onKeysChange:K,onSave:O})}),(0,t.jsxs)(C.av,{value:"custom",className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("div",{children:(0,t.jsxs)("p",{className:"text-sm text-muted-foreground",children:["添加兼容 OpenAI / Anthropic API 的自定义提供商。配置存储在"," ",(0,t.jsx)("code",{className:"font-mono text-xs bg-secondary px-1 rounded",children:"~/.pi/agent/models.json"}),"。"]})}),(0,t.jsxs)(b.$,{variant:"outline",size:"sm",className:"neo-button hover:scale-105 transition-transform",onClick:()=>{let e="custom-provider-".concat(Date.now());M(s=>({providers:{...s.providers,[e]:{baseUrl:"",api:"openai-completions",apiKey:"",models:[]}}}))},children:[(0,t.jsx)(u.A,{className:"mr-2 h-4 w-4"}),"添加提供商"]})]}),0===Object.keys(z.providers).length?(0,t.jsx)("div",{className:"rounded-lg border border-dashed p-8 text-center text-muted-foreground text-sm",children:"暂无自定义提供商。点击「添加提供商」创建一个。"}):(0,t.jsx)("div",{className:"space-y-4",children:Object.entries(z.providers).map(e=>{let[s,a]=e;return(0,t.jsx)(D,{name:s,provider:a,onChange:e=>M(a=>({providers:{...a.providers,[s]:e}})),onRename:e=>{e!==s&&e&&M(a=>{let{[s]:t,...r}=a.providers;return{providers:{...r,[e]:t}}})},onDelete:()=>M(e=>{let{[s]:a,...t}=e.providers;return{providers:t}})},s)})})]}),(0,t.jsxs)(C.av,{value:"voice",className:"space-y-4",children:[(0,t.jsx)("div",{className:"mb-4",children:(0,t.jsxs)("p",{className:"text-sm text-muted-foreground",children:["选择一个语音供应商并配置API密钥,全局生效。配置存储在"," ",(0,t.jsx)("code",{className:"font-mono text-xs bg-secondary px-1 rounded",children:"~/.pi/agent/voice-provider.json"}),"。"]})}),(0,t.jsxs)("div",{className:"neo-card p-4 bg-white dark:bg-slate-800/50 rounded-xl",children:[(0,t.jsx)(k.J,{className:"text-sm font-medium text-gray-700 dark:text-gray-300 mb-2 block",children:"当前语音供应商"}),(0,t.jsxs)(S.l6,{value:B.currentProvider,onValueChange:e=>L(s=>({...s,currentProvider:e})),children:[(0,t.jsx)(S.bq,{className:"neo-card-inset",children:(0,t.jsx)(S.yv,{})}),(0,t.jsxs)(S.gC,{children:[(0,t.jsx)(S.eb,{value:"openai",children:"OpenAI TTS"}),(0,t.jsx)(S.eb,{value:"aliyun",children:"阿里云语音合成"}),(0,t.jsx)(S.eb,{value:"tencent",children:"腾讯云TTS"}),(0,t.jsx)(S.eb,{value:"baidu",children:"百度语音合成"})]})]})]}),"openai"===B.currentProvider&&(0,t.jsxs)("div",{className:"neo-card p-4 bg-white dark:bg-slate-800/50 rounded-xl space-y-3",children:[(0,t.jsx)("h3",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"OpenAI TTS 配置"}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(k.J,{className:"text-xs",children:"API Key"}),(0,t.jsx)(N.p,{type:"password",placeholder:"sk-...",value:(null===(e=B.providers.openai)||void 0===e?void 0:e.apiKey)||"",onChange:e=>L(s=>({...s,providers:{...s.providers,openai:{...s.providers.openai,apiKey:e.target.value}}}))})]})]}),"aliyun"===B.currentProvider&&(0,t.jsxs)("div",{className:"neo-card p-4 bg-white dark:bg-slate-800/50 rounded-xl space-y-3",children:[(0,t.jsx)("h3",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"阿里云配置"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(k.J,{className:"text-xs",children:"AppKey"}),(0,t.jsx)(N.p,{placeholder:"...",value:(null===(s=B.providers.aliyun)||void 0===s?void 0:s.appKey)||"",onChange:e=>L(s=>{var a,t;return{...s,providers:{...s.providers,aliyun:{...s.providers.aliyun,appKey:e.target.value,accessKeyId:(null===(a=s.providers.aliyun)||void 0===a?void 0:a.accessKeyId)||"",accessKeySecret:(null===(t=s.providers.aliyun)||void 0===t?void 0:t.accessKeySecret)||""}}}})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(k.J,{className:"text-xs",children:"Access Key ID"}),(0,t.jsx)(N.p,{type:"password",placeholder:"...",value:(null===(a=B.providers.aliyun)||void 0===a?void 0:a.accessKeyId)||"",onChange:e=>L(s=>{var a,t;return{...s,providers:{...s.providers,aliyun:{...s.providers.aliyun,appKey:(null===(a=s.providers.aliyun)||void 0===a?void 0:a.appKey)||"",accessKeyId:e.target.value,accessKeySecret:(null===(t=s.providers.aliyun)||void 0===t?void 0:t.accessKeySecret)||""}}}})})]}),(0,t.jsxs)("div",{className:"space-y-2 col-span-2",children:[(0,t.jsx)(k.J,{className:"text-xs",children:"Access Key Secret"}),(0,t.jsx)(N.p,{type:"password",placeholder:"...",value:(null===(c=B.providers.aliyun)||void 0===c?void 0:c.accessKeySecret)||"",onChange:e=>L(s=>{var a,t;return{...s,providers:{...s.providers,aliyun:{...s.providers.aliyun,appKey:(null===(a=s.providers.aliyun)||void 0===a?void 0:a.appKey)||"",accessKeyId:(null===(t=s.providers.aliyun)||void 0===t?void 0:t.accessKeyId)||"",accessKeySecret:e.target.value}}}})})]})]})]}),"tencent"===B.currentProvider&&(0,t.jsxs)("div",{className:"neo-card p-4 bg-white dark:bg-slate-800/50 rounded-xl space-y-3",children:[(0,t.jsx)("h3",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"腾讯云配置"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(k.J,{className:"text-xs",children:"Secret ID"}),(0,t.jsx)(N.p,{type:"password",placeholder:"AKID...",value:(null===(x=B.providers.tencent)||void 0===x?void 0:x.secretId)||"",onChange:e=>L(s=>{var a;return{...s,providers:{...s.providers,tencent:{...s.providers.tencent,secretId:e.target.value,secretKey:(null===(a=s.providers.tencent)||void 0===a?void 0:a.secretKey)||""}}}})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(k.J,{className:"text-xs",children:"Secret Key"}),(0,t.jsx)(N.p,{type:"password",placeholder:"...",value:(null===(h=B.providers.tencent)||void 0===h?void 0:h.secretKey)||"",onChange:e=>L(s=>{var a;return{...s,providers:{...s.providers,tencent:{...s.providers.tencent,secretId:(null===(a=s.providers.tencent)||void 0===a?void 0:a.secretId)||"",secretKey:e.target.value}}}})})]})]})]}),"baidu"===B.currentProvider&&(0,t.jsxs)("div",{className:"neo-card p-4 bg-white dark:bg-slate-800/50 rounded-xl space-y-3",children:[(0,t.jsx)("h3",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"百度配置"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(k.J,{className:"text-xs",children:"API Key"}),(0,t.jsx)(N.p,{type:"password",placeholder:"...",value:(null===(p=B.providers.baidu)||void 0===p?void 0:p.apiKey)||"",onChange:e=>L(s=>{var a;return{...s,providers:{...s.providers,baidu:{...s.providers.baidu,apiKey:e.target.value,secretKey:(null===(a=s.providers.baidu)||void 0===a?void 0:a.secretKey)||""}}}})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(k.J,{className:"text-xs",children:"Secret Key"}),(0,t.jsx)(N.p,{type:"password",placeholder:"...",value:(null===(v=B.providers.baidu)||void 0===v?void 0:v.secretKey)||"",onChange:e=>L(s=>{var a;return{...s,providers:{...s.providers,baidu:{...s.providers.baidu,apiKey:(null===(a=s.providers.baidu)||void 0===a?void 0:a.apiKey)||"",secretKey:e.target.value}}}})})]})]})]})]}),(0,t.jsx)(C.av,{value:"envvars",children:(0,t.jsx)(R,{})}),(0,t.jsxs)(C.av,{value:"skills",className:"space-y-2",children:[(0,t.jsx)("div",{className:"mb-4",children:(0,t.jsxs)("p",{className:"text-sm text-muted-foreground",children:["安装、卸载 Skills。Skills 存储在"," ",(0,t.jsx)("code",{className:"font-mono text-xs bg-secondary px-1 rounded",children:"~/.pi/agent/skills/"}),", 对所有数字人共享。在数字人配置中可按需启用/禁用。"]})}),(0,t.jsx)(I,{})]}),(0,t.jsxs)(C.av,{value:"appearance",className:"space-y-6",children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(k.J,{children:g("theme")}),(0,t.jsxs)(S.l6,{value:y,onValueChange:j,children:[(0,t.jsx)(S.bq,{className:"w-48",children:(0,t.jsx)(S.yv,{})}),(0,t.jsxs)(S.gC,{children:[(0,t.jsx)(S.eb,{value:"light",children:g("themeLight")}),(0,t.jsx)(S.eb,{value:"dark",children:g("themeDark")}),(0,t.jsx)(S.eb,{value:"system",children:g("themeSystem")})]})]})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(k.J,{children:g("language")}),(0,t.jsxs)(S.l6,{value:w,onValueChange:e=>{A.push(E.replace(/^\/(zh|en)/,"/".concat(e)))},children:[(0,t.jsx)(S.bq,{className:"w-48",children:(0,t.jsx)(S.yv,{})}),(0,t.jsxs)(S.gC,{children:[(0,t.jsx)(S.eb,{value:"zh",children:"中文"}),(0,t.jsx)(S.eb,{value:"en",children:"English"})]})]})]})]})]})]})}function D(e){var s,a,n,l,i,d,c,m;let{name:y,provider:j,onChange:w,onRename:C,onDelete:T}=e,[K,z]=(0,r.useState)(!0),[M,B]=(0,r.useState)(y),[I,L]=(0,r.useState)(!1),[P,D]=(0,r.useState)({phase:"idle"}),R=(e,s)=>w({...j,[e]:s}),$=async e=>{D({phase:"testing"});try{let s=await fetch("/api/models-config/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerName:y,provider:j,model:e})}),a=await s.json();a.ok?D({phase:"success",latencyMs:a.latencyMs,responseText:a.responseText}):D({phase:"error",message:a.error,latencyMs:a.latencyMs})}catch(e){D({phase:"error",message:String(e)})}},U=(e,s,a)=>{var t;let r=[...null!==(t=j.models)&&void 0!==t?t:[]];r[e]={...r[e],[s]:a},R("models",r)},V=e=>{var s;let a=[...null!==(s=j.models)&&void 0!==s?s:[]];a.splice(e,1),R("models",a)};return(0,t.jsxs)("div",{className:"rounded-xl border bg-card overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 px-4 py-3 cursor-pointer hover:bg-secondary/30 transition-colors",onClick:()=>z(!K),children:[K?(0,t.jsx)(x.A,{className:"h-4 w-4 text-muted-foreground"}):(0,t.jsx)(h.A,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)("span",{className:"font-mono text-sm font-medium flex-1 truncate",children:y}),(0,t.jsx)(A.E,{variant:"outline",className:"text-xs",children:null!==(a=j.api)&&void 0!==a?a:"—"}),(0,t.jsxs)(A.E,{variant:"secondary",className:"text-xs",children:[null!==(n=null===(s=j.models)||void 0===s?void 0:s.length)&&void 0!==n?n:0," models"]}),(0,t.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),T()},className:"ml-1 text-muted-foreground hover:text-destructive transition-colors",children:(0,t.jsx)(p.A,{className:"h-4 w-4"})})]}),K&&(0,t.jsxs)("div",{className:"px-4 pb-4 space-y-4 border-t",children:[(0,t.jsxs)("div",{className:"pt-4 space-y-1.5",children:[(0,t.jsx)(k.J,{className:"text-xs text-muted-foreground uppercase tracking-wider",children:"提供商名称(唯一标识)"}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(N.p,{value:M,onChange:e=>B(e.target.value),className:"font-mono text-sm",placeholder:"my-custom-provider"}),M!==y&&M.trim()&&(0,t.jsx)(b.$,{size:"sm",onClick:()=>C(M.trim()),children:"重命名"})]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(k.J,{className:"text-xs text-muted-foreground uppercase tracking-wider",children:"Base URL"}),(0,t.jsx)(N.p,{value:null!==(l=j.baseUrl)&&void 0!==l?l:"",onChange:e=>R("baseUrl",e.target.value||void 0),placeholder:"https://api.example.com/v1",className:"font-mono text-sm"})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(k.J,{className:"text-xs text-muted-foreground uppercase tracking-wider",children:"API 协议"}),(0,t.jsxs)(S.l6,{value:null!==(i=j.api)&&void 0!==i?i:"openai-completions",onValueChange:e=>R("api",e),children:[(0,t.jsx)(S.bq,{children:(0,t.jsx)(S.yv,{})}),(0,t.jsx)(S.gC,{children:J.map(e=>(0,t.jsx)(S.eb,{value:e.value,children:e.label},e.value))})]})]})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(k.J,{className:"text-xs text-muted-foreground uppercase tracking-wider",children:"API Key"}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(N.p,{type:I?"text":"password",value:null!==(d=j.apiKey)&&void 0!==d?d:"",onChange:e=>R("apiKey",e.target.value||void 0),placeholder:"ENV_VAR_NAME, !shell-command, 或直接填写密钥",className:"pr-10 font-mono text-sm"}),(0,t.jsx)("button",{type:"button",onClick:()=>L(!I),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:I?(0,t.jsx)(v,{className:"h-4 w-4"}):(0,t.jsx)(g,{className:"h-4 w-4"})})]}),(0,t.jsxs)("p",{className:"text-[11px] text-muted-foreground",children:["前缀 ",(0,t.jsx)("code",{className:"font-mono",children:"!"})," 运行 Shell 命令,或填写环境变量名(自动读取)"]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(k.J,{className:"text-xs text-muted-foreground uppercase tracking-wider",children:"模型列表"}),(0,t.jsxs)(b.$,{variant:"ghost",size:"sm",onClick:()=>{var e;R("models",[...null!==(e=j.models)&&void 0!==e?e:[],{id:"",name:"",contextWindow:128e3,maxTokens:4096,input:["text","image"],reasoning:!1,cost:{input:0,output:0}}])},className:"h-7 text-xs",children:[(0,t.jsx)(u.A,{className:"mr-1 h-3 w-3"}),"添加模型"]})]}),0===(null!==(c=j.models)&&void 0!==c?c:[]).length?(0,t.jsx)("p",{className:"text-sm text-muted-foreground text-center py-4 border border-dashed rounded-lg",children:"暂无模型,点击「添加模型」"}):(0,t.jsx)("div",{className:"space-y-3",children:(null!==(m=j.models)&&void 0!==m?m:[]).map((e,s)=>(0,t.jsx)(O,{model:e,onUpdate:(e,a)=>U(s,e,a),onDelete:()=>V(s),onTest:()=>$(e),testState:P},s))})]}),"idle"!==P.phase&&"testing"!==P.phase&&(0,t.jsxs)("div",{className:(0,E.cn)("flex items-start gap-2 rounded-lg px-3 py-2 text-sm","success"===P.phase?"bg-green-50 dark:bg-green-900/20 text-green-700 dark:text-green-400":"bg-red-50 dark:bg-red-900/20 text-red-700 dark:text-red-400"),children:["success"===P.phase?(0,t.jsx)(o.A,{className:"h-4 w-4 mt-0.5 shrink-0"}):(0,t.jsx)(f,{className:"h-4 w-4 mt-0.5 shrink-0"}),(0,t.jsx)("div",{children:"success"===P.phase?"连接成功 (".concat(P.latencyMs,"ms)").concat(P.responseText?' — "'.concat(P.responseText,'"'):""):"连接失败: ".concat(P.message).concat(P.latencyMs?" (".concat(P.latencyMs,"ms)"):"")}),(0,t.jsx)("button",{onClick:()=>D({phase:"idle"}),className:"ml-auto text-current opacity-50 hover:opacity-100",children:(0,t.jsx)(f,{className:"h-3 w-3"})})]})]})]})}function O(e){var s,a,r,n,l,i,o,c;let{model:m,onUpdate:u,onDelete:x,onTest:h,testState:v}=e,g="testing"===v.phase;return(0,t.jsxs)("div",{className:"rounded-lg border bg-secondary/20 p-3 space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0 grid grid-cols-2 gap-2",children:[(0,t.jsx)(N.p,{value:m.id,onChange:e=>u("id",e.target.value),placeholder:"model-id(如 gpt-4o)",className:"font-mono text-xs h-8"}),(0,t.jsx)(N.p,{value:null!==(r=m.name)&&void 0!==r?r:"",onChange:e=>u("name",e.target.value||void 0),placeholder:"显示名称(可选)",className:"text-xs h-8"})]}),(0,t.jsxs)(b.$,{variant:"ghost",size:"sm",onClick:h,disabled:!m.id||g,className:"h-8 text-xs shrink-0 gap-1",title:"测试连接",children:[g?(0,t.jsx)(d.A,{className:"h-3 w-3 animate-spin"}):(0,t.jsx)(y.A,{className:"h-3 w-3"}),"测试"]}),(0,t.jsx)("button",{type:"button",onClick:x,className:"text-muted-foreground hover:text-destructive transition-colors",children:(0,t.jsx)(p.A,{className:"h-4 w-4"})})]}),(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(k.J,{className:"text-[10px] text-muted-foreground",children:"Context Window"}),(0,t.jsx)(N.p,{type:"number",value:null!==(n=m.contextWindow)&&void 0!==n?n:128e3,onChange:e=>u("contextWindow",Number(e.target.value)),className:"text-xs h-7 mt-0.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(k.J,{className:"text-[10px] text-muted-foreground",children:"Max Output Tokens"}),(0,t.jsx)(N.p,{type:"number",value:null!==(l=m.maxTokens)&&void 0!==l?l:4096,onChange:e=>u("maxTokens",Number(e.target.value)),className:"text-xs h-7 mt-0.5"})]}),(0,t.jsx)("div",{className:"flex flex-col justify-end",children:(0,t.jsxs)("div",{className:"flex items-center gap-2 h-7",children:[(0,t.jsx)(w.d,{id:"reasoning-".concat(m.id),checked:null!==(i=m.reasoning)&&void 0!==i&&i,onCheckedChange:e=>u("reasoning",e),className:"scale-75"}),(0,t.jsx)(k.J,{htmlFor:"reasoning-".concat(m.id),className:"text-[11px] cursor-pointer",children:"支持 Thinking"})]})})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(k.J,{className:"text-[10px] text-muted-foreground",children:"输入价格 ($/1M tokens)"}),(0,t.jsx)(N.p,{type:"number",step:"0.01",value:null!==(o=null===(s=m.cost)||void 0===s?void 0:s.input)&&void 0!==o?o:0,onChange:e=>u("cost",{...m.cost,input:Number(e.target.value)}),className:"text-xs h-7 mt-0.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(k.J,{className:"text-[10px] text-muted-foreground",children:"输出价格 ($/1M tokens)"}),(0,t.jsx)(N.p,{type:"number",step:"0.01",value:null!==(c=null===(a=m.cost)||void 0===a?void 0:a.output)&&void 0!==c?c:0,onChange:e=>u("cost",{...m.cost,output:Number(e.target.value)}),className:"text-xs h-7 mt-0.5"})]})]})]})}function R(){var e;let[s,a]=(0,r.useState)({}),[n,l]=(0,r.useState)(!0),[i,c]=(0,r.useState)(""),[m,x]=(0,r.useState)(""),[h,v]=(0,r.useState)(null),[g,k]=(0,r.useState)(""),[w,C]=(0,r.useState)(""),[S,A]=(0,r.useState)(null),[T,K]=(0,r.useState)(null),[z,M]=(0,r.useState)(!1),[B,I]=(0,r.useState)({}),L=(0,r.useCallback)(()=>{l(!0),fetch("/api/env-vars",{cache:"no-store"}).then(e=>e.json()).then(e=>{a(e),l(!1)}).catch(()=>l(!1))},[]);(0,r.useEffect)(()=>{L()},[L]);let J=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:m;if(C(""),!e.trim()){C("变量名不能为空");return}let a=await fetch("/api/env-vars",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:e.trim(),value:s})}),t=await a.json();if(!a.ok){var r;C(null!==(r=t.error)&&void 0!==r?r:"保存失败");return}e===i&&(c(""),x("")),A(e.trim()),setTimeout(()=>A(null),2500),L(),K(null)},P=async e=>{await fetch("/api/env-vars/".concat(encodeURIComponent(e)),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:g})}),v(null),A(e),setTimeout(()=>A(null),2500),L()},D=async e=>{await fetch("/api/env-vars/".concat(encodeURIComponent(e)),{method:"DELETE"}),L(),K(null)},O=async()=>{M(!0),K(await fetch("/api/env-vars/scan").then(e=>e.json())),I({}),M(!1)},R=async e=>{var s;await J(e,null!==(s=B[e])&&void 0!==s?s:""),I(s=>{let a={...s};return delete a[e],a}),setTimeout(O,300)},$=Object.entries(s).sort((e,s)=>{let[a]=e,[t]=s;return a.localeCompare(t)}),U=null!==(e=null==T?void 0:T.summary.filter(e=>!e.stored))&&void 0!==e?e:[];return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3 rounded-xl border border-zinc-200 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-800/50 p-4",children:[(0,t.jsx)(j.A,{className:"h-5 w-5 text-zinc-500 shrink-0 mt-0.5"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:"全局环境变量"}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground mt-0.5",children:["存于 ",(0,t.jsx)("code",{className:"font-mono bg-zinc-100 dark:bg-zinc-800 px-1 rounded",children:"~/.digital-agents/env.json"}),", Bash 工具执行时自动注入。"]})]}),(0,t.jsxs)(b.$,{size:"sm",variant:"outline",onClick:O,disabled:z,className:"gap-1.5 shrink-0",children:[z?(0,t.jsx)(d.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(y.A,{className:"h-3.5 w-3.5"}),"扫描 Skill 变量"]})]}),T&&(0,t.jsxs)("div",{className:"rounded-xl border overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b bg-secondary/30",children:[(0,t.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Skill 引用的环境变量"}),(0,t.jsx)("button",{type:"button",onClick:()=>K(null),className:"text-muted-foreground hover:text-foreground text-xs",children:"关闭"})]}),(0,t.jsx)("div",{className:"p-3 space-y-2",children:0===T.summary.length?(0,t.jsx)("p",{className:"text-sm text-muted-foreground text-center py-4",children:"未发现 Skill 引用的环境变量"}):T.summary.map(e=>{var s;return(0,t.jsxs)("div",{className:(0,E.cn)("flex items-center gap-2 rounded-lg border px-3 py-2.5 transition-all",e.stored?"border-[#57BE6B]/40 bg-[#57BE6B]/8 dark:bg-[#57BE6B]/10":"border-amber-300 dark:border-amber-700 bg-amber-50/50 dark:bg-amber-900/10"),children:[e.stored?(0,t.jsx)(o.A,{className:"h-4 w-4 text-[#57BE6B] shrink-0"}):(0,t.jsx)("span",{className:"h-4 w-4 rounded-full border-2 border-amber-400 shrink-0 flex items-center justify-center",children:(0,t.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-amber-400"})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("code",{className:"text-xs font-mono font-semibold",children:e.name}),(0,t.jsxs)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:["引用于:",e.skills.join("、")]})]}),e.stored?(0,t.jsx)("span",{className:"text-[10px] text-[#57BE6B] shrink-0",children:"已配置"}):(0,t.jsxs)("div",{className:"flex items-center gap-1.5 shrink-0",children:[(0,t.jsx)(N.p,{value:null!==(s=B[e.name])&&void 0!==s?s:"",onChange:s=>I(a=>({...a,[e.name]:s.target.value})),onKeyDown:s=>"Enter"===s.key&&R(e.name),placeholder:"输入值...",className:"h-7 w-36 text-xs font-mono"}),(0,t.jsxs)(b.$,{size:"sm",className:"h-7 px-2 text-xs gap-1",onClick:()=>R(e.name),children:[(0,t.jsx)(u.A,{className:"h-3 w-3"}),"添加"]})]})]},e.name)})}),U.length>0&&(0,t.jsx)("div",{className:"px-4 py-2.5 border-t bg-amber-50/30 dark:bg-amber-900/10",children:(0,t.jsxs)("p",{className:"text-xs text-amber-600 dark:text-amber-400",children:["⚠️ ",U.length," 个变量尚未配置 — 相关 Skill 执行时可能报错"]})})]}),(0,t.jsxs)("div",{className:"rounded-xl border p-4 space-y-3",children:[(0,t.jsx)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"手动添加变量"}),(0,t.jsxs)("div",{className:"flex gap-2 items-start",children:[(0,t.jsx)(N.p,{value:i,onChange:e=>{c(e.target.value),C("")},onKeyDown:e=>"Enter"===e.key&&J(),placeholder:"VARIABLE_NAME",className:"font-mono text-sm flex-1"}),(0,t.jsx)("span",{className:"text-muted-foreground pt-2 text-sm shrink-0",children:"="}),(0,t.jsx)(N.p,{value:m,onChange:e=>x(e.target.value),onKeyDown:e=>"Enter"===e.key&&J(),placeholder:"value",className:"font-mono text-sm flex-1"}),(0,t.jsxs)(b.$,{size:"sm",onClick:()=>J(),className:"gap-1.5 shrink-0",children:[(0,t.jsx)(u.A,{className:"h-3.5 w-3.5"}),"添加"]})]}),w&&(0,t.jsx)("p",{className:"text-xs text-destructive",children:w})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:["已配置 (",$.length,")"]}),$.length>0&&(0,t.jsx)("button",{type:"button",onClick:async()=>{confirm("确认清空所有环境变量?")&&(await fetch("/api/env-vars",{method:"DELETE"}),L(),K(null))},className:"text-xs text-destructive hover:underline",children:"清空全部"})]}),n?(0,t.jsxs)("div",{className:"flex items-center justify-center py-8 text-muted-foreground text-sm",children:[(0,t.jsx)(d.A,{className:"h-4 w-4 animate-spin mr-2"}),"加载中…"]}):0===$.length?(0,t.jsx)("div",{className:"rounded-lg border border-dashed p-8 text-center text-sm text-muted-foreground",children:"暂无环境变量。点击「扫描 Skill 变量」自动发现 Skill 所需的变量名,或手动添加。"}):$.map(e=>{let[s,a]=e;return(0,t.jsxs)("div",{className:(0,E.cn)("group flex items-center gap-2 rounded-lg border px-3 py-2.5 transition-all",S===s?"border-[#57BE6B]/60 bg-[#57BE6B]/10":"border-border hover:border-zinc-300 dark:hover:border-zinc-600"),children:[(0,t.jsx)("code",{className:"text-xs font-mono font-semibold shrink-0 min-w-[140px] truncate",children:s}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs shrink-0",children:"="}),h===s?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(N.p,{value:g,onChange:e=>k(e.target.value),onKeyDown:e=>{"Enter"===e.key&&P(s),"Escape"===e.key&&v(null)},className:"h-7 text-xs font-mono flex-1",autoFocus:!0}),(0,t.jsx)(b.$,{size:"sm",variant:"ghost",className:"h-7 px-2 text-[#57BE6B]",onClick:()=>P(s),children:(0,t.jsx)(o.A,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(b.$,{size:"sm",variant:"ghost",className:"h-7 px-2",onClick:()=>v(null),children:(0,t.jsx)(f,{className:"h-3.5 w-3.5"})})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-xs font-mono text-muted-foreground flex-1 truncate cursor-pointer hover:text-foreground",onClick:()=>{v(s),k(a)},title:a||"(空)",children:a||(0,t.jsx)("em",{className:"opacity-40 not-italic",children:"(空)"})}),S===s&&(0,t.jsx)("span",{className:"text-[10px] text-[#57BE6B] shrink-0",children:"已保存"}),(0,t.jsx)("button",{type:"button",className:"opacity-0 group-hover:opacity-100 text-muted-foreground hover:text-foreground transition-all",onClick:()=>{v(s),k(a)},title:"编辑",children:(0,t.jsx)(y.A,{className:"h-3.5 w-3.5"})}),(0,t.jsx)("button",{type:"button",className:"opacity-0 group-hover:opacity-100 text-muted-foreground hover:text-destructive transition-all",onClick:()=>D(s),title:"删除",children:(0,t.jsx)(p.A,{className:"h-3.5 w-3.5"})})]})]},s)})]})]})}let $={anthropic:{name:"Anthropic",placeholder:"sk-ant-api03-...",color:"bg-orange-50 dark:bg-orange-900/20 border-orange-200 dark:border-orange-800"},openai:{name:"OpenAI",placeholder:"sk-proj-...",color:"bg-green-50 dark:bg-green-900/20 border-green-200 dark:border-green-800"},google:{name:"Google AI",placeholder:"AIzaSy...",color:"bg-blue-50 dark:bg-blue-900/20 border-blue-200 dark:border-blue-800"},groq:{name:"Groq",placeholder:"gsk_...",color:"bg-purple-50 dark:bg-purple-900/20 border-purple-200 dark:border-purple-800"},deepseek:{name:"DeepSeek",placeholder:"sk-...",color:"bg-cyan-50 dark:bg-cyan-900/20 border-cyan-200 dark:border-cyan-800"},xai:{name:"xAI (Grok)",placeholder:"xai-...",color:"bg-zinc-50 dark:bg-zinc-800/50 border-zinc-200 dark:border-zinc-700"},mistral:{name:"Mistral",placeholder:"...",color:"bg-yellow-50 dark:bg-yellow-900/20 border-yellow-200 dark:border-yellow-800"}};function U(e){var s,a;let{apiKeys:n,onKeysChange:l,onSave:i}=e,[c,m]=(0,r.useState)(""),[x,h]=(0,r.useState)(""),[v,g]=(0,r.useState)({phase:"idle"}),[j,w]=(0,r.useState)(!1),[C,S]=(0,r.useState)(null),[A,T]=(0,r.useState)(""),K=Object.entries(n).filter(e=>{let[,s]=e;return s&&""!==s.trim()}),z=Object.entries($).filter(e=>{let[s]=e;return!n[s]}),M=async(e,s)=>{g({phase:"testing"});try{var a;let t=await fetch("/api/auth-config/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:e,key:s})}),r=await t.json();r.ok?g({phase:"ok",ms:r.latencyMs}):g({phase:"err",msg:null!==(a=r.error)&&void 0!==a?a:"HTTP ".concat(r.status)})}catch(e){g({phase:"err",msg:String(e)})}},B=async()=>{c&&x.trim()&&await M(c,x.trim())},I=async()=>{l({...n,[c]:x.trim()}),await i(),m(""),h(""),g({phase:"idle"}),w(!1)},L=async e=>{let s={...n};delete s[e],l(s),await i()},J=async e=>{l({...n,[e]:A.trim()}),await i(),S(null),T("")};return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:"LLM 提供商"}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground mt-0.5",children:["密钥存储于 ",(0,t.jsx)("code",{className:"font-mono bg-secondary px-1 rounded",children:"~/.pi/agent/auth.json"})]})]}),!j&&(0,t.jsxs)(b.$,{variant:"outline",size:"sm",onClick:()=>w(!0),className:"gap-1.5",disabled:0===z.length,children:[(0,t.jsx)(u.A,{className:"h-3.5 w-3.5"}),"添加提供商"]})]}),0===K.length&&!j&&(0,t.jsx)("div",{className:"rounded-xl border border-dashed p-8 text-center text-sm text-muted-foreground",children:"还没有配置任何 LLM 提供商。点击「添加提供商」开始配置。"}),(0,t.jsx)("div",{className:"space-y-2",children:K.map(e=>{var s,a,r;let[n,l]=e,i=$[n],d=C===n;return(0,t.jsxs)("div",{className:(0,E.cn)("group flex items-center gap-3 rounded-xl border p-3.5 transition-all",null!==(s=null==i?void 0:i.color)&&void 0!==s?s:""),children:[(0,t.jsxs)("div",{className:"w-28 shrink-0",children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:null!==(a=null==i?void 0:i.name)&&void 0!==a?a:n}),(0,t.jsx)("p",{className:"text-[11px] text-muted-foreground font-mono",children:n})]}),d?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(N.p,{type:"password",value:A,onChange:e=>T(e.target.value),onKeyDown:e=>{"Enter"===e.key&&J(n),"Escape"===e.key&&S(null)},placeholder:null!==(r=null==i?void 0:i.placeholder)&&void 0!==r?r:"API Key",className:"flex-1 font-mono text-xs h-8",autoFocus:!0}),(0,t.jsxs)(b.$,{size:"sm",className:"h-7 px-2 gap-1 text-xs",onClick:()=>J(n),children:[(0,t.jsx)(o.A,{className:"h-3 w-3"}),"保存"]}),(0,t.jsx)(b.$,{size:"sm",variant:"ghost",className:"h-7 px-2",onClick:()=>S(null),children:(0,t.jsx)(f,{className:"h-3.5 w-3.5"})})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"flex-1 font-mono text-xs text-muted-foreground",children:l.startsWith("***")?l:"••••••••"+l.slice(-4)}),(0,t.jsxs)("div",{className:"flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[(0,t.jsx)(b.$,{size:"sm",variant:"ghost",className:"h-7 px-2 text-xs",onClick:()=>{S(n),T(l.startsWith("***")?"":l)},children:"编辑"}),(0,t.jsx)(b.$,{size:"sm",variant:"ghost",className:"h-7 px-2 text-destructive hover:text-destructive",onClick:()=>L(n),children:(0,t.jsx)(p.A,{className:"h-3.5 w-3.5"})})]})]})]},n)})}),j&&(0,t.jsxs)("div",{className:"rounded-xl border-2 border-dashed border-[#57BE6B]/50 p-4 space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("p",{className:"text-sm font-semibold",children:"添加提供商"}),(0,t.jsx)("button",{type:"button",onClick:()=>{w(!1),g({phase:"idle"}),h(""),m("")},className:"text-muted-foreground hover:text-foreground",children:(0,t.jsx)(f,{className:"h-4 w-4"})})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(k.J,{className:"text-xs text-muted-foreground",children:"提供商"}),(0,t.jsxs)("select",{value:c,onChange:e=>{m(e.target.value),g({phase:"idle"})},className:"w-full h-9 rounded-md border border-input bg-white dark:bg-zinc-800 px-3 text-sm focus:outline-none focus:ring-1 focus:ring-ring",children:[(0,t.jsx)("option",{value:"",children:"选择提供商…"}),z.map(e=>{let[s,a]=e;return(0,t.jsx)("option",{value:s,children:a.name},s)})]})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(k.J,{className:"text-xs text-muted-foreground",children:"API Key"}),(0,t.jsx)(N.p,{type:"password",value:x,onChange:e=>{h(e.target.value),g({phase:"idle"})},onKeyDown:e=>"Enter"===e.key&&B(),placeholder:c?null!==(a=null===(s=$[c])||void 0===s?void 0:s.placeholder)&&void 0!==a?a:"API Key":"先选择提供商",className:"font-mono text-sm",disabled:!c})]})]}),"idle"!==v.phase&&(0,t.jsxs)("div",{className:(0,E.cn)("flex items-center gap-2 rounded-lg px-3 py-2 text-sm","testing"===v.phase?"bg-secondary":"ok"===v.phase?"bg-[#57BE6B]/10 text-[#57BE6B]":"bg-red-50 dark:bg-red-900/20 text-red-600 dark:text-red-400"),children:["testing"===v.phase&&(0,t.jsx)(d.A,{className:"h-4 w-4 animate-spin"}),"ok"===v.phase&&(0,t.jsx)(o.A,{className:"h-4 w-4"}),"err"===v.phase&&(0,t.jsx)(f,{className:"h-4 w-4"}),(0,t.jsxs)("span",{children:["testing"===v.phase&&"测试连通性中…","ok"===v.phase&&"连接成功 (".concat(v.ms,"ms) — 点击「确认添加」保存"),"err"===v.phase&&"连接失败: ".concat(v.msg)]})]}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsxs)(b.$,{variant:"outline",className:"flex-1 gap-1.5",disabled:!c||!x.trim()||"testing"===v.phase,onClick:B,children:["testing"===v.phase?(0,t.jsx)(d.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(y.A,{className:"h-3.5 w-3.5"}),"测试连通性"]}),"ok"===v.phase&&(0,t.jsxs)(b.$,{className:"flex-1 gap-1.5 bg-[#57BE6B] hover:bg-[#4aaa5d]",onClick:I,children:[(0,t.jsx)(o.A,{className:"h-3.5 w-3.5"}),"确认添加"]})]})]})]})}},5121:(e,s,a)=>{"use strict";a.d(s,{E:()=>i});var t=a(5155);a(2115);var r=a(1027),n=a(1567);let l=(0,r.F)("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",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-destructive-foreground",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function i(e){let{className:s,variant:a,...r}=e;return(0,t.jsx)("div",{className:(0,n.cn)(l({variant:a}),s),...r})}},3312:(e,s,a)=>{"use strict";a.d(s,{$:()=>o});var t=a(5155),r=a(2115),n=a(2317),l=a(1027),i=a(1567);let d=(0,l.F)("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-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-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"}}),o=r.forwardRef((e,s)=>{let{className:a,variant:r,size:l,asChild:o=!1,...c}=e,m=o?n.DX:"button";return(0,t.jsx)(m,{className:(0,i.cn)(d({variant:r,size:l,className:a})),ref:s,...c})});o.displayName="Button"},1344:(e,s,a)=>{"use strict";a.d(s,{Cf:()=>u,Es:()=>h,L3:()=>p,c7:()=>x,lG:()=>d,rr:()=>v});var t=a(5155),r=a(2115),n=a(6217),l=a(767),i=a(1567);let d=n.bL;n.l9;let o=n.ZL,c=n.bm,m=r.forwardRef((e,s)=>{let{className:a,...r}=e;return(0,t.jsx)(n.hJ,{ref:s,className:(0,i.cn)("fixed inset-0 z-50 bg-black/60 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...r})});m.displayName=n.hJ.displayName;let u=r.forwardRef((e,s)=>{let{className:a,children:r,...d}=e;return(0,t.jsxs)(o,{children:[(0,t.jsx)(m,{}),(0,t.jsxs)(n.UC,{ref:s,className:(0,i.cn)("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 rounded-lg",a),...d,children:[r,(0,t.jsx)(c,{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 disabled:pointer-events-none",children:(0,t.jsx)(l.A,{className:"h-4 w-4"})})]})]})});u.displayName=n.UC.displayName;let x=e=>{let{className:s,...a}=e;return(0,t.jsx)("div",{className:(0,i.cn)("flex flex-col space-y-1.5 text-center sm:text-left",s),...a})};x.displayName="DialogHeader";let h=e=>{let{className:s,...a}=e;return(0,t.jsx)("div",{className:(0,i.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",s),...a})};h.displayName="DialogFooter";let p=r.forwardRef((e,s)=>{let{className:a,...r}=e;return(0,t.jsx)(n.hE,{ref:s,className:(0,i.cn)("text-lg font-semibold leading-none tracking-tight",a),...r})});p.displayName=n.hE.displayName;let v=r.forwardRef((e,s)=>{let{className:a,...r}=e;return(0,t.jsx)(n.VY,{ref:s,className:(0,i.cn)("text-sm text-muted-foreground",a),...r})});v.displayName=n.VY.displayName},3900:(e,s,a)=>{"use strict";a.d(s,{p:()=>l});var t=a(5155),r=a(2115),n=a(1567);let l=r.forwardRef((e,s)=>{let{className:a,type:r,...l}=e;return(0,t.jsx)("input",{type:r,className:(0,n.cn)("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",a),ref:s,...l})});l.displayName="Input"},8986:(e,s,a)=>{"use strict";a.d(s,{J:()=>i});var t=a(5155),r=a(2115),n=a(6195),l=a(1567);let i=r.forwardRef((e,s)=>{let{className:a,...r}=e;return(0,t.jsx)(n.b,{ref:s,className:(0,l.cn)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",a),...r})});i.displayName=n.b.displayName},7528:(e,s,a)=>{"use strict";a.d(s,{bq:()=>m,eb:()=>x,gC:()=>u,l6:()=>o,yv:()=>c});var t=a(5155),r=a(2115),n=a(965),l=a(1719),i=a(8867),d=a(1567);let o=n.bL;n.YJ;let c=n.WT,m=r.forwardRef((e,s)=>{let{className:a,children:r,...i}=e;return(0,t.jsxs)(n.l9,{ref:s,className:(0,d.cn)("flex h-9 w-full items-center justify-between 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",a),...i,children:[r,(0,t.jsx)(n.In,{asChild:!0,children:(0,t.jsx)(l.A,{className:"h-4 w-4 opacity-50"})})]})});m.displayName=n.l9.displayName;let u=r.forwardRef((e,s)=>{let{className:a,children:r,position:l="popper",...i}=e;return(0,t.jsx)(n.ZL,{children:(0,t.jsx)(n.UC,{ref:s,className:(0,d.cn)("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-white dark:bg-zinc-800 text-foreground shadow-xl animate-in fade-in-0 zoom-in-95","popper"===l&&"translate-y-1",a),position:l,...i,children:(0,t.jsx)(n.LM,{className:(0,d.cn)("p-1","popper"===l&&"w-full min-w-[var(--radix-select-trigger-width)]"),children:r})})})});u.displayName=n.UC.displayName;let x=r.forwardRef((e,s)=>{let{className:a,children:r,...l}=e;return(0,t.jsxs)(n.q7,{ref:s,className:(0,d.cn)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),...l,children:[(0,t.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,t.jsx)(n.VF,{children:(0,t.jsx)(i.A,{className:"h-4 w-4"})})}),(0,t.jsx)(n.p4,{children:r})]})});x.displayName=n.q7.displayName,r.forwardRef((e,s)=>{let{className:a,...r}=e;return(0,t.jsx)(n.JU,{ref:s,className:(0,d.cn)("py-1.5 pl-8 pr-2 text-xs font-semibold",a),...r})}).displayName=n.JU.displayName,r.forwardRef((e,s)=>{let{className:a,...r}=e;return(0,t.jsx)(n.wv,{ref:s,className:(0,d.cn)("-mx-1 my-1 h-px bg-muted",a),...r})}).displayName=n.wv.displayName},488:(e,s,a)=>{"use strict";a.d(s,{d:()=>i});var t=a(5155),r=a(2115),n=a(2413),l=a(1567);let i=r.forwardRef((e,s)=>{let{className:a,...r}=e;return(0,t.jsx)(n.bL,{className:(0,l.cn)("peer inline-flex h-[22px] w-10 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent","transition-colors duration-200","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50","data-[state=unchecked]:bg-zinc-300 dark:data-[state=unchecked]:bg-zinc-600","data-[state=checked]:bg-[#57BE6B]",a),...r,ref:s,children:(0,t.jsx)(n.zi,{className:(0,l.cn)("pointer-events-none block h-[16px] w-[16px] rounded-full bg-white shadow-md ring-0","transition-transform duration-200","data-[state=checked]:translate-x-[18px] data-[state=unchecked]:translate-x-0")})})});i.displayName=n.bL.displayName},2884:(e,s,a)=>{"use strict";a.d(s,{Xi:()=>o,av:()=>c,j7:()=>d,tU:()=>i});var t=a(5155),r=a(2115),n=a(3078),l=a(1567);let i=n.bL,d=r.forwardRef((e,s)=>{let{className:a,...r}=e;return(0,t.jsx)(n.B8,{ref:s,className:(0,l.cn)("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",a),...r})});d.displayName=n.B8.displayName;let o=r.forwardRef((e,s)=>{let{className:a,...r}=e;return(0,t.jsx)(n.l9,{ref:s,className:(0,l.cn)("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 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",a),...r})});o.displayName=n.l9.displayName;let c=r.forwardRef((e,s)=>{let{className:a,...r}=e;return(0,t.jsx)(n.UC,{ref:s,className:(0,l.cn)("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",a),...r})});c.displayName=n.UC.displayName},6754:(e,s,a)=>{"use strict";a.d(s,{T:()=>l});var t=a(5155),r=a(2115),n=a(1567);let l=r.forwardRef((e,s)=>{let{className:a,...r}=e;return(0,t.jsx)("textarea",{className:(0,n.cn)("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm 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",a),ref:s,...r})});l.displayName="Textarea"},1567:(e,s,a)=>{"use strict";a.d(s,{cn:()=>n});var t=a(3463),r=a(9795);function n(){for(var e=arguments.length,s=Array(e),a=0;a<e;a++)s[a]=arguments[a];return(0,r.QP)((0,t.$)(s))}},1786:(e,s,a)=>{"use strict";function t(e,[s,a]){return Math.min(a,Math.max(s,e))}a.d(s,{q:()=>t}),(0,Object.defineProperty)(t,"name",{value:"clamp",configurable:!0})},4256:(e,s,a)=>{"use strict";a.d(s,{jH:()=>l});var t=a(2115);a(5155);var r=Object.defineProperty,n=t.createContext(void 0);function l(e){let s=t.useContext(n);return e||s||"ltr"}r(l,"name",{value:"useDirection",configurable:!0})},7113:(e,s,a)=>{"use strict";a.d(s,{D:()=>c,N:()=>m});var t=a(2115),r=(e,s,a,t,r,n,l,i)=>{let d=document.documentElement,o=["light","dark"];function c(s){(Array.isArray(e)?e:[e]).forEach(e=>{let a="class"===e,t=a&&n?r.map(e=>n[e]||e):r;a?(d.classList.remove(...t),d.classList.add(n&&n[s]?n[s]:s)):d.setAttribute(e,s)}),i&&o.includes(s)&&(d.style.colorScheme=s)}if(t)c(t);else try{let e=localStorage.getItem(s)||a,t=l&&"system"===e?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e;c(t)}catch(e){}},n=["light","dark"],l="(prefers-color-scheme: dark)",i="undefined"==typeof window,d=t.createContext(void 0),o={setTheme:e=>{},themes:[]},c=()=>{var e;return null!=(e=t.useContext(d))?e:o},m=e=>t.useContext(d)?t.createElement(t.Fragment,null,e.children):t.createElement(x,{...e}),u=["light","dark"],x=e=>{let{forcedTheme:s,disableTransitionOnChange:a=!1,enableSystem:r=!0,enableColorScheme:i=!0,storageKey:o="theme",themes:c=u,defaultTheme:m=r?"system":"light",attribute:x="data-theme",value:f,children:y,nonce:j,scriptProps:b}=e,[N,k]=t.useState(()=>p(o,m)),[w,C]=t.useState(()=>"system"===N?g():N),S=f?Object.values(f):c,A=t.useCallback(e=>{let s=e;if(!s)return;"system"===e&&r&&(s=g());let t=f?f[s]:s,l=a?v(j):null,d=document.documentElement,o=e=>{"class"===e?(d.classList.remove(...S),t&&d.classList.add(t)):e.startsWith("data-")&&(t?d.setAttribute(e,t):d.removeAttribute(e))};if(Array.isArray(x)?x.forEach(o):o(x),i){let e=n.includes(m)?m:null,a=n.includes(s)?s:e;d.style.colorScheme=a}null==l||l()},[j]),E=t.useCallback(e=>{let s="function"==typeof e?e(N):e;k(s);try{localStorage.setItem(o,s)}catch(e){}},[N]),T=t.useCallback(e=>{C(g(e)),"system"===N&&r&&!s&&A("system")},[N,s]);t.useEffect(()=>{let e=window.matchMedia(l);return e.addListener(T),T(e),()=>e.removeListener(T)},[T]),t.useEffect(()=>{let e=e=>{e.key===o&&(e.newValue?k(e.newValue):E(m))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[E]),t.useEffect(()=>{A(null!=s?s:N)},[s,N]);let K=t.useMemo(()=>({theme:N,setTheme:E,forcedTheme:s,resolvedTheme:"system"===N?w:N,themes:r?[...c,"system"]:c,systemTheme:r?w:void 0}),[N,E,s,w,r,c]);return t.createElement(d.Provider,{value:K},t.createElement(h,{forcedTheme:s,storageKey:o,attribute:x,enableSystem:r,enableColorScheme:i,defaultTheme:m,value:f,themes:c,nonce:j,scriptProps:b}),y)},h=t.memo(e=>{let{forcedTheme:s,storageKey:a,attribute:n,enableSystem:l,enableColorScheme:i,defaultTheme:d,value:o,themes:c,nonce:m,scriptProps:u}=e,x=JSON.stringify([n,a,d,s,c,o,l,i]).slice(1,-1);return t.createElement("script",{...u,suppressHydrationWarning:!0,nonce:"undefined"==typeof window?m:"",dangerouslySetInnerHTML:{__html:"(".concat(r.toString(),")(").concat(x,")")}})}),p=(e,s)=>{let a;if(!i){try{a=localStorage.getItem(e)||void 0}catch(e){}return a||s}},v=e=>{let s=document.createElement("style");return e&&s.setAttribute("nonce",e),s.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(s),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(s)},1)}},g=e=>(e||(e=window.matchMedia(l)),e.matches?"dark":"light")}},e=>{var s=s=>e(e.s=s);e.O(0,[8313,3259,6742,8441,1517,7358],()=>s(3821)),_N_E=e.O()}]);