@agent-spaces/server 0.3.0 → 0.3.1

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 (184) hide show
  1. package/dist/adapters/claude-code-runtime/index.js +48 -6
  2. package/dist/adapters/claude-code-runtime/message-format.js +3 -3
  3. package/dist/adapters/git.js +140 -2
  4. package/dist/agents/agent-designer.js +334 -0
  5. package/dist/agents/agent-message-parts.js +8 -0
  6. package/dist/agents/commit-agent.js +9 -2
  7. package/dist/agents/issue-task-controller.js +14 -4
  8. package/dist/app.js +53 -1
  9. package/dist/package.json +1 -1
  10. package/dist/routes/agent-sse.js +4 -1
  11. package/dist/routes/agent.js +15 -0
  12. package/dist/routes/channel.js +1 -1
  13. package/dist/routes/file.js +97 -1
  14. package/dist/routes/git.js +122 -1
  15. package/dist/routes/iframe-bookmarks.js +33 -0
  16. package/dist/routes/speech-recognition.js +80 -0
  17. package/dist/services/agent.js +48 -5
  18. package/dist/services/builtin-tools.js +67 -1
  19. package/dist/services/channel.js +2 -0
  20. package/dist/services/command-process-manager.js +14 -1
  21. package/dist/services/file.js +86 -6
  22. package/dist/services/gitignore.js +65 -0
  23. package/dist/services/issue-retry.js +2 -1
  24. package/dist/services/issue.js +2 -2
  25. package/dist/services/notification-hub/bot-agent.js +9 -1
  26. package/dist/services/persistent-agent-context.js +155 -0
  27. package/dist/services/pty.js +47 -2
  28. package/dist/services/search.js +11 -3
  29. package/dist/services/speech-recognition/base.js +3 -0
  30. package/dist/services/speech-recognition/index.js +16 -0
  31. package/dist/services/speech-recognition/tencent.js +112 -0
  32. package/dist/storage/iframe-bookmarks-store.js +46 -0
  33. package/dist/storage/speech-recognition-store.js +58 -0
  34. package/dist/web/404.html +1 -1
  35. package/dist/web/__next.__PAGE__.txt +4 -4
  36. package/dist/web/__next._full.txt +31 -26
  37. package/dist/web/__next._head.txt +4 -4
  38. package/dist/web/__next._index.txt +17 -13
  39. package/dist/web/__next._tree.txt +2 -2
  40. package/dist/web/_next/static/chunks/0-mtp2au0a0nh.js +189 -0
  41. package/dist/web/_next/static/chunks/00amm3dvu3po9.js +31 -0
  42. package/dist/web/_next/static/chunks/02unyp1obddyn.js +3 -0
  43. package/dist/web/_next/static/chunks/0d.v1csiyl.1~.js +2 -0
  44. package/dist/web/_next/static/chunks/0egot8y~i-ge3.js +1 -0
  45. package/dist/web/_next/static/chunks/0e~0o6v_awcod.js +1 -0
  46. package/dist/web/_next/static/chunks/0fpf.rso9mhc0.js +1 -0
  47. package/dist/web/_next/static/chunks/0glol5jdarfma.js +2 -0
  48. package/dist/web/_next/static/chunks/0m1ud--um8kjh.js +1 -0
  49. package/dist/web/_next/static/chunks/0o6w-uw2p.phy.js +5 -0
  50. package/dist/web/_next/static/chunks/0os7q6w~-tmg7.css +1 -0
  51. package/dist/web/_next/static/chunks/0plreh4_gkxf9.js +1 -0
  52. package/dist/web/_next/static/chunks/0u7_qd9hzqwac.js +1 -0
  53. package/dist/web/_next/static/chunks/0vesz93a98px4.js +1 -0
  54. package/dist/web/_next/static/chunks/0w3o.7vi.dlm6.js +1 -0
  55. package/dist/web/_next/static/chunks/0xtmr0y4vo-~p.js +1 -0
  56. package/dist/web/_next/static/chunks/0~3uikgc074il.js +1 -0
  57. package/dist/web/_next/static/chunks/{0y5ipuqgqfrob.js → 0~xn0gfqxa20r.js} +3 -3
  58. package/dist/web/_next/static/chunks/11ozf700niy2z.js +1 -0
  59. package/dist/web/_next/static/chunks/{0jmsjlawtg6oa.js → 145gbwitjxamg.js} +1 -1
  60. package/dist/web/_next/static/chunks/{turbopack-0lxiiw.jhevml.js → turbopack-0kcwat8.leugk.js} +1 -1
  61. package/dist/web/_not-found/__next._full.txt +34 -30
  62. package/dist/web/_not-found/__next._head.txt +4 -4
  63. package/dist/web/_not-found/__next._index.txt +17 -13
  64. package/dist/web/_not-found/__next._not-found.__PAGE__.txt +2 -2
  65. package/dist/web/_not-found/__next._not-found.txt +3 -3
  66. package/dist/web/_not-found/__next._tree.txt +2 -2
  67. package/dist/web/_not-found.html +1 -1
  68. package/dist/web/_not-found.txt +34 -30
  69. package/dist/web/index.html +1 -1
  70. package/dist/web/index.txt +31 -26
  71. package/dist/web/login/__next._full.txt +35 -29
  72. package/dist/web/login/__next._head.txt +4 -4
  73. package/dist/web/login/__next._index.txt +17 -13
  74. package/dist/web/login/__next._tree.txt +2 -2
  75. package/dist/web/login/__next.login.__PAGE__.txt +4 -4
  76. package/dist/web/login/__next.login.txt +3 -3
  77. package/dist/web/login.html +1 -1
  78. package/dist/web/login.txt +35 -29
  79. package/dist/web/settings/__next._full.txt +36 -34
  80. package/dist/web/settings/__next._head.txt +4 -4
  81. package/dist/web/settings/__next._index.txt +17 -13
  82. package/dist/web/settings/__next._tree.txt +2 -2
  83. package/dist/web/settings/__next.settings.__PAGE__.txt +4 -4
  84. package/dist/web/settings/__next.settings.txt +5 -5
  85. package/dist/web/settings/agents/__next._full.txt +38 -35
  86. package/dist/web/settings/agents/__next._head.txt +4 -4
  87. package/dist/web/settings/agents/__next._index.txt +17 -13
  88. package/dist/web/settings/agents/__next._tree.txt +2 -2
  89. package/dist/web/settings/agents/__next.settings.agents.__PAGE__.txt +4 -4
  90. package/dist/web/settings/agents/__next.settings.agents.txt +3 -3
  91. package/dist/web/settings/agents/__next.settings.txt +5 -5
  92. package/dist/web/settings/agents.html +1 -1
  93. package/dist/web/settings/agents.txt +38 -35
  94. package/dist/web/settings/mcps/__next._full.txt +38 -35
  95. package/dist/web/settings/mcps/__next._head.txt +4 -4
  96. package/dist/web/settings/mcps/__next._index.txt +17 -13
  97. package/dist/web/settings/mcps/__next._tree.txt +2 -2
  98. package/dist/web/settings/mcps/__next.settings.mcps.__PAGE__.txt +4 -4
  99. package/dist/web/settings/mcps/__next.settings.mcps.txt +3 -3
  100. package/dist/web/settings/mcps/__next.settings.txt +5 -5
  101. package/dist/web/settings/mcps.html +1 -1
  102. package/dist/web/settings/mcps.txt +38 -35
  103. package/dist/web/settings/models/__next._full.txt +38 -35
  104. package/dist/web/settings/models/__next._head.txt +4 -4
  105. package/dist/web/settings/models/__next._index.txt +17 -13
  106. package/dist/web/settings/models/__next._tree.txt +2 -2
  107. package/dist/web/settings/models/__next.settings.models.__PAGE__.txt +4 -4
  108. package/dist/web/settings/models/__next.settings.models.txt +3 -3
  109. package/dist/web/settings/models/__next.settings.txt +5 -5
  110. package/dist/web/settings/models.html +1 -1
  111. package/dist/web/settings/models.txt +38 -35
  112. package/dist/web/settings/providers/__next._full.txt +38 -35
  113. package/dist/web/settings/providers/__next._head.txt +4 -4
  114. package/dist/web/settings/providers/__next._index.txt +17 -13
  115. package/dist/web/settings/providers/__next._tree.txt +2 -2
  116. package/dist/web/settings/providers/__next.settings.providers.__PAGE__.txt +4 -4
  117. package/dist/web/settings/providers/__next.settings.providers.txt +3 -3
  118. package/dist/web/settings/providers/__next.settings.txt +5 -5
  119. package/dist/web/settings/providers.html +1 -1
  120. package/dist/web/settings/providers.txt +38 -35
  121. package/dist/web/settings/skills/__next._full.txt +38 -35
  122. package/dist/web/settings/skills/__next._head.txt +4 -4
  123. package/dist/web/settings/skills/__next._index.txt +17 -13
  124. package/dist/web/settings/skills/__next._tree.txt +2 -2
  125. package/dist/web/settings/skills/__next.settings.skills.__PAGE__.txt +4 -4
  126. package/dist/web/settings/skills/__next.settings.skills.txt +3 -3
  127. package/dist/web/settings/skills/__next.settings.txt +5 -5
  128. package/dist/web/settings/skills.html +1 -1
  129. package/dist/web/settings/skills.txt +38 -35
  130. package/dist/web/settings.html +1 -1
  131. package/dist/web/settings.txt +36 -34
  132. package/dist/web/workflows/__next._full.txt +36 -31
  133. package/dist/web/workflows/__next._head.txt +4 -4
  134. package/dist/web/workflows/__next._index.txt +17 -13
  135. package/dist/web/workflows/__next._tree.txt +2 -2
  136. package/dist/web/workflows/__next.workflows.__PAGE__.txt +4 -4
  137. package/dist/web/workflows/__next.workflows.txt +3 -3
  138. package/dist/web/workflows.html +1 -1
  139. package/dist/web/workflows.txt +36 -31
  140. package/dist/web/workspace/_/__next._full.txt +39 -34
  141. package/dist/web/workspace/_/__next._head.txt +4 -4
  142. package/dist/web/workspace/_/__next._index.txt +17 -13
  143. package/dist/web/workspace/_/__next._tree.txt +2 -2
  144. package/dist/web/workspace/_/__next.workspace.$d$id.__PAGE__.txt +3 -3
  145. package/dist/web/workspace/_/__next.workspace.$d$id.txt +3 -3
  146. package/dist/web/workspace/_/__next.workspace.txt +3 -3
  147. package/dist/web/workspace/_.html +1 -1
  148. package/dist/web/workspace/_.txt +39 -34
  149. package/dist/web/workspaces/__next._full.txt +35 -30
  150. package/dist/web/workspaces/__next._head.txt +4 -4
  151. package/dist/web/workspaces/__next._index.txt +17 -13
  152. package/dist/web/workspaces/__next._tree.txt +2 -2
  153. package/dist/web/workspaces/__next.workspaces.__PAGE__.txt +4 -4
  154. package/dist/web/workspaces/__next.workspaces.txt +3 -3
  155. package/dist/web/workspaces.html +1 -1
  156. package/dist/web/workspaces.txt +35 -30
  157. package/dist/ws/agent-prompt.js +48 -18
  158. package/dist/ws/agent-runner.js +4 -1
  159. package/dist/ws/message-parts.js +8 -0
  160. package/dist/ws/terminal-handler.js +1 -1
  161. package/package.json +1 -1
  162. package/public/avatars/1778953228323-5je54x-user.jpg +0 -0
  163. package/public/avatars/1778954057880-g01q6y-user.jpg +0 -0
  164. package/dist/web/_next/static/chunks/002-dxhags4dj.js +0 -2
  165. package/dist/web/_next/static/chunks/00fu7sjtftd3f.js +0 -1
  166. package/dist/web/_next/static/chunks/00s_1ft2-qz0r.js +0 -1
  167. package/dist/web/_next/static/chunks/02wkg1tjv~_t2.js +0 -1
  168. package/dist/web/_next/static/chunks/03jy~o.gx._e-.js +0 -3
  169. package/dist/web/_next/static/chunks/07bs5ds68tg38.js +0 -2
  170. package/dist/web/_next/static/chunks/0b1w9_ne4c2ez.js +0 -1
  171. package/dist/web/_next/static/chunks/0bzechrx76-ix.js +0 -1
  172. package/dist/web/_next/static/chunks/0csqa76ud3h4d.js +0 -1
  173. package/dist/web/_next/static/chunks/0fxdvo63ywaa~.js +0 -1
  174. package/dist/web/_next/static/chunks/0k5bmi-es-2nj.js +0 -1
  175. package/dist/web/_next/static/chunks/0pep4mkvt3.rh.js +0 -31
  176. package/dist/web/_next/static/chunks/0tqwdxb-8t_n1.js +0 -1
  177. package/dist/web/_next/static/chunks/0yc41k980zabo.js +0 -1
  178. package/dist/web/_next/static/chunks/0zhhkzv4.0koq.js +0 -183
  179. package/dist/web/_next/static/chunks/0zl19l5tuoppw.js +0 -1
  180. package/dist/web/_next/static/chunks/102lz3yanx8i~.css +0 -1
  181. package/dist/web/_next/static/chunks/13wm9.vry~.lh.js +0 -5
  182. /package/dist/web/_next/static/{XzP71HbFE1fuE_bLT-x7i → 4dBAEZ275uRqcyeaRmXSx}/_buildManifest.js +0 -0
  183. /package/dist/web/_next/static/{XzP71HbFE1fuE_bLT-x7i → 4dBAEZ275uRqcyeaRmXSx}/_clientMiddlewareManifest.js +0 -0
  184. /package/dist/web/_next/static/{XzP71HbFE1fuE_bLT-x7i → 4dBAEZ275uRqcyeaRmXSx}/_ssgManifest.js +0 -0
@@ -1,2 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,788010,e=>{"use strict";var a=e.i(344180),t=e.i(465458);e.s(["Textarea",0,function({className:e,...s}){return(0,a.jsx)("textarea",{"data-slot":"textarea",className:(0,t.cn)("flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...s})}])},368942,e=>{"use strict";let a=(0,e.i(816709).create)((e,a)=>({models:[],providers:[],loaded:!1,ensure:async()=>{if(!a().loaded)try{let[a,t]=await Promise.all([fetch("/api/models").then(e=>e.json()),fetch("/api/providers").then(e=>e.json())]);e({models:a,providers:t,loaded:!0})}catch{}},addModel:a=>e(e=>({models:[...e.models,a]})),updateModel:a=>e(e=>({models:e.models.map(e=>e.id===a.id?a:e)})),removeModel:a=>e(e=>({models:e.models.filter(e=>e.id!==a)})),addProvider:a=>e(e=>({providers:[...e.providers,a]})),updateProvider:a=>e(e=>({providers:e.providers.map(e=>e.id===a.id?a:e)})),removeProvider:a=>e(e=>({providers:e.providers.filter(e=>e.id!==a)}))}));e.s(["useLLMStore",0,a])},226624,e=>{"use strict";var a,t=e.i(344180);e.s([],916562),e.i(916562),e.i(8890);var s=e.i(764556),i=e.i(535270),r=e.i(29905),l=e.i(204133),n=e.i(277642),d=e.i(236706),o=e.i(863728),c=e.i(969490),u=e.i(370383),p=e.i(139236),m=e.i(931709),h=e.i(267805);let x=s.createContext(void 0);var g=e.i(438904);let v=((a={}).checked="data-checked",a.unchecked="data-unchecked",a.disabled="data-disabled",a.readonly="data-readonly",a.required="data-required",a.valid="data-valid",a.invalid="data-invalid",a.touched="data-touched",a.dirty="data-dirty",a.filled="data-filled",a.focused="data-focused",a),f={...g.fieldValidityMapping,checked:e=>e?{[v.checked]:""}:{[v.unchecked]:""}};var b=e.i(125231),y=e.i(975698),j=e.i(380414),k=e.i(443124),N=e.i(575665),w=e.i(602453),C=e.i(742665),S=e.i(638144);let P=s.forwardRef(function(e,a){let{checked:h,className:g,defaultChecked:v,"aria-labelledby":P,form:T,id:M,inputRef:z,name:I,nativeButton:A=!1,onCheckedChange:O,readOnly:D=!1,required:B=!1,disabled:E=!1,render:K,uncheckedValue:R,value:L,style:_,...F}=e,{clearErrors:U}=(0,j.useFormContext)(),{state:G,setTouched:q,setDirty:V,validityData:$,setFilled:J,setFocused:W,shouldValidateOnChange:H,validationMode:Q,disabled:Z,name:X,validation:Y}=(0,b.useFieldRootContext)(),{labelId:ee}=(0,k.useLabelableContext)(),ea=Z||E,et=X??I,es=(0,r.useStableCallback)(O),ei=s.useRef(null),er=(0,l.useMergedRefs)(ei,z,Y.inputRef),el=s.useRef(null),en=(0,p.useBaseUiId)(),ed=(0,N.useLabelableId)({id:M,implicit:!1,controlRef:el}),eo=A?void 0:ed,[ec,eu]=(0,i.useControlled)({controlled:h,default:!!v,name:"Switch",state:"checked"});(0,y.useRegisterFieldControl)(el,{id:en,value:ec}),(0,n.useIsoLayoutEffect)(()=>{ei.current&&J(ei.current.checked)},[ei,J]),(0,S.useValueChanged)(ec,()=>{U(et),V(ec!==$.initialValue),J(ec),H()?Y.commit(ec):Y.commit(ec,!0)});let{getButtonProps:ep,buttonRef:em}=(0,m.useButton)({disabled:ea,native:A}),eh=function(e,a,t,i=!0,r){let[l,d]=s.useState(),o=(0,p.useBaseUiId)(r?`${r}-label`:void 0),c=e??a??l;return(0,n.useIsoLayoutEffect)(()=>{let s=e||a||!i?void 0:function(e,a){let t=function(e){if(!e)return;let a=e.parentElement;if(a&&"LABEL"===a.tagName)return a;let t=e.id;if(t){let a=e.nextElementSibling;if(a&&a.htmlFor===t)return a}let s=e.labels;return s&&s[0]}(e);if(t)return!t.id&&a&&(t.id=a),t.id||void 0}(t.current,o);l!==s&&d(s)}),c}(P,ee,ei,!A,eo),ex=s.useMemo(()=>(0,u.mergeProps)({checked:ec,disabled:ea,form:T,id:eo,name:et,required:B,style:et?d.visuallyHiddenInput:d.visuallyHidden,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:er,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(D)return void e.preventDefault();let a=e.currentTarget.checked,t=(0,w.createChangeEventDetails)(C.REASONS.none,e.nativeEvent);es?.(a,t),t.isCanceled||eu(a)},onFocus(){el.current?.focus()}},Y.getInputValidationProps,void 0!==L?{value:L}:o.EMPTY_OBJECT),[ec,ea,T,er,eo,et,es,D,B,eu,Y,L]),eg=s.useMemo(()=>({...G,checked:ec,disabled:ea,readOnly:D,required:B}),[G,ec,ea,D,B]),ev=(0,c.useRenderElement)("span",e,{state:eg,ref:[a,el,em],props:[{id:A?ed:en,role:"switch","aria-checked":ec,"aria-readonly":D||void 0,"aria-required":B||void 0,"aria-labelledby":eh,onFocus(){ea||W(!0)},onBlur(){let e=ei.current;e&&!ea&&(q(!0),W(!1),"onBlur"===Q&&Y.commit(e.checked))},onClick(e){D||ea||(e.preventDefault(),ei.current?.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey})))}},Y.getValidationProps,F,ep],stateAttributesMapping:f});return(0,t.jsxs)(x.Provider,{value:eg,children:[ev,!ec&&et&&void 0!==R&&(0,t.jsx)("input",{type:"hidden",form:T,name:et,value:R}),(0,t.jsx)("input",{...ex,suppressHydrationWarning:!0})]})}),T=s.forwardRef(function(e,a){let{render:t,className:i,style:r,...l}=e,{state:n}=(0,b.useFieldRootContext)(),d=function(){let e=s.useContext(x);if(void 0===e)throw Error((0,h.default)(63));return e}(),o={...n,...d};return(0,c.useRenderElement)("span",e,{state:o,ref:a,stateAttributesMapping:f,props:l})});e.s(["Root",0,P,"Thumb",0,T],695728);var M=e.i(695728),M=M,z=e.i(465458);e.s(["Switch",0,function({className:e,size:a="default",...s}){return(0,t.jsx)(M.Root,{"data-slot":"switch","data-size":a,className:(0,z.cn)("peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50",e),...s,children:(0,t.jsx)(M.Thumb,{"data-slot":"switch-thumb",className:"pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground"})})}],226624)},673478,e=>{"use strict";let a=(0,e.i(433721).default)("cpu",[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]]);e.s(["Cpu",0,a],673478)},325443,946899,e=>{"use strict";let a=(0,e.i(433721).default)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);e.s(["default",0,a],946899),e.s(["Bot",0,a],325443)},415360,e=>{"use strict";let a=(0,e.i(433721).default)("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]);e.s(["Sparkles",0,a],415360)},444433,e=>{"use strict";e.s(["BUILT_IN_AGENT_TOOLS",0,[{name:"CreateCurrentChannelIssue",label:"Create Current Issue",description:"Create and bind an issue for the current channel."},{name:"ViewCurrentChannelIssue",label:"View Current Issue",description:"View the issue and comments bound to the current channel."},{name:"AddCurrentChannelComment",label:"Add Current Comment",description:"Add a comment to the issue bound to the current channel."},{name:"ListQuickCommands",label:"List Quick Commands",description:"List all quick commands for a workspace with their running status."},{name:"RunQuickCommand",label:"Run Quick Command",description:"Start a quick command by its ID. Returns the terminal session ID."},{name:"StopQuickCommand",label:"Stop Quick Command",description:"Stop a running quick command by its ID."}]])},282180,e=>{"use strict";var a=e.i(344180),t=e.i(444433);let s=(t.BUILT_IN_AGENT_TOOLS??[]).map(e=>e.name),i=new Set(["openai-responses-to-anthropic-messages","openai-chat-completions-to-anthropic-messages"]);function r(e){return{mcpServers:Object.fromEntries(e.map(e=>[e,{}]))}}function l(e){return e.map(e=>({name:`${e}.md`,content:`# ${e}
2
- `}))}let n={agent:{name:"Agent",role:"agent",description:"通用 Agent,可在 workflow 中承担任意执行节点",avatarUrl:"",runtimeKind:"claude-code",modelProvider:"anthropic-messages",modelId:"claude-sonnet-4-6",apiBase:"",apiKey:"",workingDir:"",mcps:r([]),skills:l(["coding","debugging","testing"]),tools:s,systemPrompt:"你是通用 Agent。根据 issue 和当前任务上下文完成被分配的工作,遵循项目规范,必要时修改代码、运行验证,并清晰汇报结果。",temperature:.3,maxTokens:8192,enabled:!0},scheduler:{name:"Scheduler",role:"scheduler",description:"任务调度者,负责任务分发和协调",avatarUrl:"",runtimeKind:"claude-code",modelProvider:"anthropic-messages",modelId:"claude-sonnet-4-6",apiBase:"",apiKey:"",workingDir:"",mcps:r([]),skills:l(["planning","task-split"]),tools:s,systemPrompt:"你是调度者 Agent。负责接收用户任务,分析任务类型,分发给合适的执行者。你需要跟踪任务状态,确保所有子任务按时完成。",temperature:.3,maxTokens:4096,enabled:!0},task_creator:{name:"Task Creator",role:"task_creator",description:"任务创建者,负责把 issue 拆成可执行任务",avatarUrl:"",runtimeKind:"claude-code",modelProvider:"anthropic-messages",modelId:"claude-sonnet-4-6",apiBase:"",apiKey:"",workingDir:"",mcps:r([]),skills:l(["planning","task-split"]),tools:s,systemPrompt:"你是任务创建者 Agent。负责读取 issue 上下文,把需求拆分为少量可执行任务,并用系统工具写入任务列表。只创建真正需要独立执行的任务,避免把细碎步骤拆成任务。",temperature:.3,maxTokens:4096,enabled:!0},bot:{name:"Bot Agent",role:"bot",description:"消息机器人,负责处理外部聊天平台中的用户消息",avatarUrl:"",runtimeKind:"claude-code",modelProvider:"anthropic-messages",modelId:"claude-sonnet-4-6",apiBase:"",apiKey:"",workingDir:"",mcps:{},skills:[],tools:s,systemPrompt:"你是 Agent Spaces 的消息机器人。你会简洁回答来自外部聊天平台的用户消息。不要执行危险操作;需要用户提供更多信息时直接询问。",temperature:.3,maxTokens:4096,enabled:!0}};e.s(["FieldGroup",0,function({label:e,children:t}){return(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("label",{className:"text-xs text-muted-foreground",children:e}),t]})},"PROVIDER_OPTIONS",0,[{value:"anthropic-messages",labelKey:"anthropicMessages"},{value:"openai-chat-completions",labelKey:"openaiChatCompletions"},{value:"openai-responses",labelKey:"openaiResponses"},{value:"openai-responses-to-anthropic-messages",labelKey:"openaiResponsesToAnthropic"},{value:"openai-chat-completions-to-anthropic-messages",labelKey:"openaiChatToAnthropic"},{value:"gemini-generate-content",labelKey:"geminiGenerateContent"}],"ROLE_COLORS",0,{agent:"bg-gray-500/10 text-gray-600 border-gray-200",scheduler:"bg-blue-500/10 text-blue-600 border-blue-200",task_creator:"bg-green-500/10 text-green-600 border-green-200",bot:"bg-cyan-500/10 text-cyan-600 border-cyan-200"},"ROLE_OPTIONS",0,["agent","scheduler","task_creator","bot"],"RUNTIME_OPTIONS",0,[{value:"claude-code",labelKey:"claudeCode"},{value:"open-agent-sdk",labelKey:"openAgentSdk"},{value:"codex",labelKey:"codex"},{value:"langchain",labelKey:"langchain"}],"Section",0,function({icon:e,title:t,children:s}){return(0,a.jsxs)("div",{className:"flex flex-col gap-2.5",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5 text-xs font-medium text-muted-foreground uppercase tracking-wider",children:[e,t]}),s]})},"isAnthropicBridgeProvider",0,function(e){return!!(e&&i.has(e))},"isDraftAgent",0,function(e){return e.id.startsWith("draft-")},"newAgentDraft",0,function(e){return{id:`draft-${e}-${Date.now()}`,...n[e],mcps:structuredClone(n[e].mcps),skills:n[e].skills.map(e=>({...e})),tools:[...n[e].tools]}},"newEmptyAgent",0,function(){return{id:`draft-empty-${Date.now()}`,name:"",role:"agent",description:"",avatarUrl:"",runtimeKind:"claude-code",modelProvider:"",modelId:"",apiBase:"",apiKey:"",workingDir:"",mcps:{},skills:[],tools:s,systemPrompt:"",temperature:.3,maxTokens:4096,enabled:!0}},"normalizeAgent",0,function(e){var a,i;return{...e,name:e.name||"New Agent",description:e.description||"",avatarUrl:e.avatarUrl||"",runtimeKind:e.runtimeKind||"open-agent-sdk",modelProvider:e.modelProvider||"",modelId:e.modelId||"claude-sonnet-4-6",apiBase:e.apiBase||"",apiKey:e.apiKey||"",workingDir:e.workingDir||"",mcps:(a=e.mcps)||{},skills:Array.isArray(i=e.skills)?i.map(e=>"string"==typeof e?{name:e.endsWith(".md")?e:`${e}.md`}:e):[],tools:function(e){if(!Array.isArray(e))return s;let a=new Set((t.BUILT_IN_AGENT_TOOLS??[]).map(e=>e.name));return e.filter(e=>a.has(e))}(e.tools),systemPrompt:e.systemPrompt||"",temperature:e.temperature??.3,maxTokens:e.maxTokens??4096,enabled:e.enabled??!0}},"serializeAgent",0,function(e){let{id:a,...t}=e;return{...t,modelProvider:t.modelProvider||void 0}}])},159619,839374,e=>{"use strict";let a=(0,e.i(433721).default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["default",0,a],839374),e.s(["Copy",0,a],159619)},330044,92929,119211,e=>{"use strict";var a=e.i(344180),t=e.i(244073),s=e.i(611176),i=e.i(260218),r=e.i(562918),l=e.i(226624),n=e.i(325443),d=e.i(159619),o=e.i(137340),c=e.i(465458);e.s(["AgentList",0,function({agents:e,onSelect:u,onDelete:p,onToggleEnabled:m}){let h=(0,t.useTranslations)("agent");return(0,a.jsxs)("div",{className:"flex flex-col p-2",children:[e.map(e=>(0,a.jsxs)("div",{className:(0,c.cn)("group flex items-center gap-3 rounded-lg px-3 py-2.5 hover:bg-muted/50 cursor-pointer transition-colors",!e.enabled&&"opacity-50"),onClick:()=>u(e),children:[(0,a.jsx)(s.AgentIcon,{name:e.name,avatarUrl:e.avatarUrl,apiBase:e.apiBase,className:"size-8"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:e.name}),(0,a.jsx)(r.Badge,{variant:"outline",className:"text-[10px] h-4 px-1.5",children:e.role})]}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:e.description||h("list.noDescription")})]}),(0,a.jsx)("span",{className:"text-[10px] text-muted-foreground font-mono",children:e.modelId.split("-").slice(0,2).join("-")}),(0,a.jsx)("div",{onClick:e=>e.stopPropagation(),children:(0,a.jsx)(l.Switch,{size:"sm",checked:e.enabled,onCheckedChange:()=>m?.(e.id)})}),(0,a.jsx)(i.Button,{variant:"ghost",size:"icon-xs",className:"opacity-0 group-hover:opacity-100 transition-opacity",onClick:a=>{a.stopPropagation(),navigator.clipboard.writeText(e.id)},children:(0,a.jsx)(d.Copy,{className:"size-3"})}),(0,a.jsx)(i.Button,{variant:"ghost",size:"icon-xs",className:"opacity-0 group-hover:opacity-100 transition-opacity",onClick:a=>{a.stopPropagation(),p(e.id)},children:(0,a.jsx)(o.Trash2,{className:"size-3 text-destructive"})})]},e.id)),0===e.length&&(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-muted-foreground",children:[(0,a.jsx)(n.Bot,{className:"size-10 mb-2 opacity-30"}),(0,a.jsx)("p",{className:"text-sm",children:h("list.empty")})]})]})}],330044);var u=e.i(433721);let p=(0,u.default)("plug-zap",[["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m18 3-4 4h6l-4 4",key:"16psg9"}]]);e.s(["PlugZap",0,p],92929);let m=(0,u.default)("wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]);e.s(["Wrench",0,m],119211)},426022,e=>{"use strict";let a=(0,e.i(433721).default)("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]);e.s(["MessageSquare",0,a],426022)},588591,e=>{"use strict";var a=e.i(344180),t=e.i(764556),s=e.i(244073),i=e.i(355819),r=e.i(209988),l=e.i(260218),n=e.i(917955),d=e.i(465458),o=e.i(767467),c=e.i(325443),u=e.i(650654),p=e.i(953700),m=e.i(282180),h=e.i(330044),x=e.i(368942),g=e.i(444433),v=e.i(611176),f=e.i(681622),b=e.i(788010),y=e.i(188815),j=e.i(972846),k=e.i(673478),N=e.i(92929),w=e.i(451534),C=e.i(119211),S=e.i(415360),P=e.i(426022);let T=(0,e.i(433721).default)("sliders-vertical",[["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M12 21v-9",key:"17s77i"}],["path",{d:"M12 8V3",key:"13r4qs"}],["path",{d:"M17 16h4",key:"h1uq16"}],["path",{d:"M19 12V3",key:"o1uvq1"}],["path",{d:"M19 21v-5",key:"qua636"}],["path",{d:"M3 14h4",key:"bcjad9"}],["path",{d:"M5 10V3",key:"cb8scm"}],["path",{d:"M5 21v-7",key:"1w1uti"}]]);var M=e.i(129981);function z({agent:e,roleOptions:i,testing:r,testResult:n,onChange:o,onMcpChange:c,onAddSkillFiles:u,onRemoveSkill:p,onTestConnection:h}){let I=(0,s.useTranslations)("agent"),[A,O]=(0,t.useState)(()=>JSON.stringify(e.mcps,null,2)),[D,B]=(0,t.useState)(null),[E,K]=(0,t.useState)([]),{models:R,providers:L,ensure:_}=(0,x.useLLMStore)(),F=R.filter(e=>!e.embedding);(0,t.useEffect)(()=>{_()},[_]);let U=(0,t.useCallback)(e=>{o("apiBase",e.apiBase),o("apiKey",e.apiKey);let a=F.filter(a=>a.provider===e.name).map(e=>({value:e.modelId,label:e.name}));K(a),a.length>0&&o("modelId",a[0].value)},[F,o]),G=async e=>{if(!e?.length)return;let a=Array.from(e).filter(e=>e.name.toLowerCase().endsWith(".md"));u(await Promise.all(a.map(async e=>({name:e.name,content:await e.text()}))))};return(0,a.jsxs)("div",{className:"flex flex-col gap-5 p-5",children:[(0,a.jsxs)(m.Section,{icon:(0,a.jsx)(P.MessageSquare,{className:"size-3.5"}),title:I("detail.basic"),children:[(0,a.jsxs)("div",{className:"flex items-start gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col items-center gap-1.5",children:[(0,a.jsx)(v.AgentIcon,{name:e.name,avatarUrl:e.avatarUrl,apiBase:e.apiBase,className:"size-16 rounded-xl border border-input"}),(0,a.jsxs)("label",{className:"text-[10px] text-primary cursor-pointer hover:underline",children:[I("detail.uploadAvatar"),(0,a.jsx)("input",{type:"file",accept:"image/*",className:"hidden",onChange:async e=>{let a=e.target.files?.[0];if(!a)return;let t=new FileReader;t.onload=async()=>{try{let e=await fetch("/api/upload/avatar",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({dataUrl:t.result,filename:a.name})}),s=await e.json();s.url&&o("avatarUrl",s.url)}catch{}},t.readAsDataURL(a),e.target.value=""}})]}),e.avatarUrl&&(0,a.jsx)("button",{type:"button",className:"text-[10px] text-destructive hover:underline",onClick:()=>o("avatarUrl",""),children:I("detail.removeAvatar")})]}),(0,a.jsxs)("div",{className:"flex-1 flex flex-col gap-2.5",children:[(0,a.jsx)(m.FieldGroup,{label:I("detail.name"),children:(0,a.jsx)(f.Input,{value:e.name,onChange:e=>o("name",e.target.value)})}),(0,a.jsx)(m.FieldGroup,{label:I("detail.role"),children:(0,a.jsx)("select",{value:e.role,onChange:e=>o("role",e.target.value),className:"h-8 w-full rounded-lg border border-input bg-transparent px-2.5 text-sm outline-none focus-visible:border-ring dark:bg-input/30",children:i.map(e=>(0,a.jsx)("option",{value:e,children:e},e))})})]})]}),(0,a.jsx)(m.FieldGroup,{label:I("detail.description"),children:(0,a.jsx)(f.Input,{value:e.description,onChange:e=>o("description",e.target.value)})}),(0,a.jsx)(m.FieldGroup,{label:I("detail.agentRuntime"),children:(0,a.jsx)(y.SearchSelect,{value:e.runtimeKind??"",onChange:e=>o("runtimeKind",e),options:m.RUNTIME_OPTIONS.map(e=>({value:e.value,label:I(`runtime.${e.labelKey}`)})),placeholder:I("detail.runtimePlaceholder"),searchPlaceholder:I("detail.runtimeSearchPlaceholder"),allowCustom:!1})})]}),(0,a.jsx)(m.Section,{icon:(0,a.jsx)(w.FolderOpen,{className:"size-3.5"}),title:I("detail.workingDirectory"),children:(0,a.jsx)(f.Input,{value:e.workingDir,onChange:e=>o("workingDir",e.target.value),placeholder:I("detail.workingDirPlaceholder")})}),(0,a.jsx)(m.Section,{icon:(0,a.jsx)(S.Sparkles,{className:"size-3.5"}),title:I("detail.systemPrompt"),children:(0,a.jsx)(b.Textarea,{value:e.systemPrompt,onChange:e=>o("systemPrompt",e.target.value),placeholder:I("detail.systemPromptPlaceholder"),className:"min-h-24 text-xs"})}),(0,a.jsxs)(m.Section,{icon:(0,a.jsx)(C.Wrench,{className:"size-3.5"}),title:I("detail.mcpServers"),children:[(0,a.jsx)(b.Textarea,{value:A,onChange:e=>(e=>{O(e);try{let a=JSON.parse(e);if(!a||"object"!=typeof a||Array.isArray(a))throw Error("MCP config must be a JSON object");B(null),c(a)}catch(e){B(e instanceof Error?e.message:"Invalid JSON")}})(e.target.value),placeholder:'{\n "mcpServers": {}\n}',className:"min-h-28 font-mono text-xs"}),D&&(0,a.jsx)("div",{className:"text-xs text-destructive",children:D})]}),(0,a.jsx)(m.Section,{icon:(0,a.jsx)(C.Wrench,{className:"size-3.5"}),title:I("detail.tools"),children:(0,a.jsx)("div",{className:"grid gap-2",children:(g.BUILT_IN_AGENT_TOOLS??[]).map(t=>(0,a.jsxs)("label",{className:"flex cursor-pointer items-start gap-2 rounded-lg border border-input px-3 py-2 hover:bg-muted/50",children:[(0,a.jsx)("input",{type:"checkbox",checked:e.tools.includes(t.name),onChange:()=>{var a;let s;return a=t.name,void((s=new Set(e.tools)).has(a)?s.delete(a):s.add(a),o("tools",(g.BUILT_IN_AGENT_TOOLS??[]).map(e=>e.name).filter(e=>s.has(e))))},className:"mt-0.5 size-3.5"}),(0,a.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,a.jsx)("span",{className:"block text-xs font-medium",children:t.label}),(0,a.jsx)("span",{className:"block text-[11px] text-muted-foreground",children:t.description})]})]},t.name))})}),(0,a.jsxs)(m.Section,{icon:(0,a.jsx)(k.Cpu,{className:"size-3.5"}),title:I("detail.skills"),children:[(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5 mb-2",children:e.skills.map((e,t)=>(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-md border px-2 py-0.5 text-xs font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 text-foreground",children:[e.name,(0,a.jsx)("button",{type:"button",onClick:()=>p(t),className:"hover:text-destructive",children:(0,a.jsx)(j.X,{className:"size-2.5"})})]},t))}),(0,a.jsxs)("label",{className:"flex h-8 cursor-pointer items-center justify-center gap-2 rounded-lg border border-dashed border-input text-xs text-muted-foreground hover:bg-muted/50",children:[(0,a.jsx)(M.Upload,{className:"size-3.5"}),I("detail.uploadSkills"),(0,a.jsx)("input",{type:"file",accept:".md,text/markdown",multiple:!0,className:"hidden",onChange:e=>{G(e.target.files),e.target.value=""}})]})]}),(0,a.jsxs)(m.Section,{icon:(0,a.jsx)(T,{className:"size-3.5"}),title:I("detail.model"),children:[(0,a.jsxs)("div",{className:"space-y-2.5",children:[(0,a.jsx)(m.FieldGroup,{label:I("detail.provider"),children:(0,a.jsx)(y.SearchSelect,{value:L.find(a=>a.apiBase===e.apiBase&&a.apiKey===e.apiKey)?.name||"",onChange:e=>{let a=L.find(a=>a.name===e);a&&U(a)},options:L.map(e=>({value:e.name,label:e.name})),placeholder:I("detail.providerPlaceholder"),searchPlaceholder:I("detail.providerSearchPlaceholder"),allowCustom:!1})}),(0,a.jsx)(m.FieldGroup,{label:I("detail.modelField"),children:(0,a.jsx)(y.SearchSelect,{value:e.modelId,onChange:e=>o("modelId",e),options:E.length>0?E:[{value:e.modelId||"",label:e.modelId||I("detail.selectProviderFirst")}],placeholder:I("detail.modelPlaceholder"),searchPlaceholder:I("detail.modelSearchPlaceholder")})}),(0,a.jsx)(m.FieldGroup,{label:I("detail.apiMessageType"),children:(0,a.jsx)(y.SearchSelect,{value:e.modelProvider||"",onChange:e=>o("modelProvider",e),options:m.PROVIDER_OPTIONS.map(e=>({value:e.value,label:I(`provider.${e.labelKey}`)})),placeholder:I("detail.apiMessageTypePlaceholder"),searchPlaceholder:I("detail.apiMessageTypeSearchPlaceholder"),allowCustom:!1})}),(0,a.jsx)(m.FieldGroup,{label:I("detail.apiBase"),children:(0,a.jsx)(f.Input,{value:e.apiBase,onChange:e=>o("apiBase",e.target.value),placeholder:I("detail.apiBasePlaceholder"),className:"h-7 text-xs"})}),(0,a.jsx)(m.FieldGroup,{label:I("detail.apiKey"),children:(0,a.jsx)(f.Input,{type:"password",value:e.apiKey,onChange:e=>o("apiKey",e.target.value),placeholder:I("detail.apiKeyPlaceholder"),className:"h-7 text-xs"})})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,a.jsx)("div",{className:"text-xs text-muted-foreground",children:I("detail.validateHelper")}),(0,a.jsxs)(l.Button,{type:"button",variant:"outline",size:"sm",onClick:h,disabled:r||!e.apiBase||!e.apiKey||!e.modelId,children:[(0,a.jsx)(N.PlugZap,{className:"size-3.5"}),r?I("detail.testing"):I("detail.test")]})]}),n&&(0,a.jsxs)("div",{className:(0,d.cn)("rounded-md border px-3 py-2 text-xs",n.success?"border-green-500/30 bg-green-500/10 text-green-700":"border-destructive/30 bg-destructive/10 text-destructive"),children:[n.message,n.debug&&(0,a.jsxs)("div",{className:"mt-2 space-y-1 font-mono text-[10px] opacity-80",children:[n.debug.status&&(0,a.jsxs)("div",{children:[I("debug.status")," ",n.debug.status]}),n.debug.provider&&(0,a.jsxs)("div",{children:[I("debug.provider")," ",n.debug.provider]}),n.debug.requestUrl&&(0,a.jsxs)("div",{children:[I("debug.url")," ",n.debug.requestUrl]}),n.debug.model&&(0,a.jsxs)("div",{children:[I("debug.model")," ",n.debug.model]}),n.debug.responseBody&&(0,a.jsxs)("div",{className:"max-h-20 overflow-auto whitespace-pre-wrap",children:[I("debug.body")," ",n.debug.responseBody]})]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,a.jsx)(m.FieldGroup,{label:I("detail.temperature"),children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{type:"range",min:0,max:2,step:.1,value:e.temperature,onChange:e=>o("temperature",parseFloat(e.target.value)),className:"flex-1"}),(0,a.jsx)("span",{className:"text-xs font-mono w-8 text-right",children:e.temperature})]})}),(0,a.jsx)(m.FieldGroup,{label:I("detail.maxTokens"),children:(0,a.jsx)(f.Input,{type:"number",value:e.maxTokens,onChange:e=>o("maxTokens",parseInt(e.target.value)||0),className:"h-7 text-xs"})})]})]})]})}e.s(["AgentDialog",0,function({open:e,onOpenChange:x,roleFilter:g,initialAgentId:v,standalone:f}){let b=(0,s.useTranslations)("agent"),y=(0,s.useTranslations)("common"),[j,k]=(0,t.useState)([]),[N,w]=(0,t.useState)(null),[C,S]=(0,t.useState)(null),[P,T]=(0,t.useState)(!1),[M,I]=(0,t.useState)(!1),[A,O]=(0,t.useState)(!1),[D,B]=(0,t.useState)(null),[E,K]=(0,t.useState)(null),R=g?new Set(Array.isArray(g)?g:[g]):null,L=R?j.filter(e=>R.has(e.role)):j,_=R?m.ROLE_OPTIONS.filter(e=>R.has(e)):m.ROLE_OPTIONS;(0,t.useEffect)(()=>{if(!e)return;let a=new AbortController;return queueMicrotask(()=>{T(!0),K(null)}),fetch("/api/agents/presets",{signal:a.signal}).then(async e=>{if(!e.ok)throw Error(await e.text());return e.json()}).then(e=>{let a=e.map(m.normalizeAgent);if(k(a),v){let e=a.find(e=>e.id===v);e&&(w(e),S({...e}))}}).catch(e=>{"AbortError"!==e.name&&K(b("error.loadFailed"))}).finally(()=>T(!1)),()=>a.abort()},[e,v,b]);let F=()=>{w(null),S(null),B(null)},U=async()=>{if(C){I(!0),K(null);try{let e=(0,m.isDraftAgent)(C),a=(0,m.serializeAgent)(C),t=await fetch(e?"/api/agents/presets":`/api/agents/presets/${C.id}`,{method:e?"POST":"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e?a:C)});if(!t.ok)throw Error(await t.text());let s=await t.json(),r=(0,m.normalizeAgent)(s);k(a=>e?[...a,r]:a.map(e=>e.id===r.id?r:e)),i.useAgentStore.setState(a=>({agents:e?[...a.agents,s]:a.agents.map(e=>e.id===s.id?s:e)})),w(null),S(null)}catch{K(b("error.saveFailed"))}finally{I(!1)}}},G=async()=>{if(C){O(!0),B(null),K(null);try{let e=await fetch("/api/agents/presets/test-connection",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(C)}),a=await e.json();B({success:!!a.success,message:a.message||a.error||b("error.connectionTestFailed"),debug:a.debug?{...a.debug,status:e.status}:{status:e.status}})}catch(e){B({success:!1,message:e instanceof Error?e.message:b("error.connectionTestFailed")})}finally{O(!1)}}},q=e=>{let a="empty"===e?(0,m.newEmptyAgent)():(0,m.newAgentDraft)(e);K(null),w(a),S({...a})},V=async e=>{k(a=>a.map(a=>a.id===e?{...a,enabled:!a.enabled}:a)),await i.useAgentStore.getState().toggleEnabled(e)},$=async e=>{if(e.startsWith("draft-")){w(null),S(null);return}I(!0),K(null);try{let a=await fetch(`/api/agents/presets/${e}`,{method:"DELETE"});if(!a.ok)throw Error(await a.text());k(a=>a.filter(a=>a.id!==e)),i.useAgentStore.setState(a=>({agents:a.agents.filter(a=>a.id!==e)})),N?.id===e&&(w(null),S(null))}catch{K(b("error.deleteFailed"))}finally{I(!1)}},J=(0,a.jsxs)(a.Fragment,{children:[!f&&(0,a.jsxs)("div",{className:"flex items-center gap-3 border-b px-5 pr-12 py-4",children:[N?(0,a.jsx)(l.Button,{variant:"ghost",size:"icon-sm",onClick:F,children:(0,a.jsx)(o.ArrowLeft,{className:"size-4"})}):(0,a.jsx)("div",{className:"flex size-7 items-center justify-center rounded-lg bg-primary/10",children:(0,a.jsx)(c.Bot,{className:"size-4 text-primary"})}),(0,a.jsxs)(r.DialogHeader,{className:"flex-1 space-y-0",children:[(0,a.jsx)(r.DialogTitle,{className:"text-base",children:N?C?.name??"":b("dialog.title")}),(0,a.jsx)(r.DialogDescription,{className:"text-xs",children:N?b("dialog.editDescription"):b("dialog.listDescription")})]}),!N&&(0,a.jsxs)(n.DropdownMenu,{children:[(0,a.jsx)(n.DropdownMenuTrigger,{render:(0,a.jsxs)(l.Button,{variant:"outline",size:"sm",disabled:M,children:[(0,a.jsx)(p.Plus,{className:"size-3.5"}),b("dialog.add"),(0,a.jsx)(u.ChevronDown,{className:"size-3.5"})]})}),(0,a.jsx)(n.DropdownMenuContent,{side:"bottom",align:"end",className:"w-44",children:(0,a.jsxs)(n.DropdownMenuGroup,{children:[!R&&(0,a.jsxs)(n.DropdownMenuItem,{className:"gap-2",onClick:()=>q("empty"),children:[(0,a.jsx)("span",{className:"size-2 rounded-full bg-muted"}),(0,a.jsx)("span",{children:b("dialog.addEmpty")})]}),m.ROLE_OPTIONS.map(e=>(0,a.jsxs)(n.DropdownMenuItem,{className:"gap-2",onClick:()=>q(e),children:[(0,a.jsx)("span",{className:(0,d.cn)("size-2 rounded-full",m.ROLE_COLORS[e].split(" ")[0])}),(0,a.jsx)("span",{className:"capitalize",children:b(`role.${e}.name`)})]},e))]})})]})]}),f&&!N&&(0,a.jsx)("div",{className:"flex items-center justify-end px-5 py-3 border-b",children:(0,a.jsxs)(n.DropdownMenu,{children:[(0,a.jsx)(n.DropdownMenuTrigger,{render:(0,a.jsxs)(l.Button,{variant:"outline",size:"sm",disabled:M,children:[(0,a.jsx)(p.Plus,{className:"size-3.5"}),b("dialog.add"),(0,a.jsx)(u.ChevronDown,{className:"size-3.5"})]})}),(0,a.jsx)(n.DropdownMenuContent,{side:"bottom",align:"end",className:"w-44",children:(0,a.jsxs)(n.DropdownMenuGroup,{children:[!R&&(0,a.jsxs)(n.DropdownMenuItem,{className:"gap-2",onClick:()=>q("empty"),children:[(0,a.jsx)("span",{className:"size-2 rounded-full bg-muted"}),(0,a.jsx)("span",{children:b("dialog.addEmpty")})]}),m.ROLE_OPTIONS.map(e=>(0,a.jsxs)(n.DropdownMenuItem,{className:"gap-2",onClick:()=>q(e),children:[(0,a.jsx)("span",{className:(0,d.cn)("size-2 rounded-full",m.ROLE_COLORS[e].split(" ")[0])}),(0,a.jsx)("span",{className:"capitalize",children:b(`role.${e}.name`)})]},e))]})})]})}),f&&N&&(0,a.jsxs)("div",{className:"flex items-center gap-3 px-5 py-3 border-b",children:[(0,a.jsx)(l.Button,{variant:"ghost",size:"icon-sm",onClick:F,children:(0,a.jsx)(o.ArrowLeft,{className:"size-4"})}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("h2",{className:"text-base font-medium truncate",children:C?.name??""}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:b("dialog.editDescription")})]})]}),(0,a.jsxs)("div",{className:"flex-1 overflow-y-auto",children:[E&&(0,a.jsx)("div",{className:"mx-5 mt-4 rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-xs text-destructive",children:E}),P?(0,a.jsx)("div",{className:"py-12 text-center text-sm text-muted-foreground",children:b("dialog.loading")}):N?C?(0,a.jsx)(z,{agent:C,roleOptions:_,testing:A,testResult:D,onChange:(e,a)=>{S(t=>t?"modelProvider"===e?{...t,modelProvider:a,runtimeKind:(0,m.isAnthropicBridgeProvider)(a)?"claude-code":t.runtimeKind}:"runtimeKind"===e?{...t,runtimeKind:a}:{...t,[e]:a}:t)},onMcpChange:e=>{S(a=>a?{...a,mcps:e}:a)},onAddSkillFiles:e=>{if(!C)return;let a=new Set(C.skills.map(e=>e.name));S(t=>t?{...t,skills:[...t.skills.filter(a=>!e.some(e=>e.name===a.name)),...e.filter(e=>e.name&&!a.has(e.name)),...e.filter(e=>a.has(e.name))]}:t)},onRemoveSkill:e=>{C&&S(a=>a?{...a,skills:a.skills.filter((a,t)=>t!==e)}:a)},onTestConnection:G},C.id):null:(0,a.jsx)(h.AgentList,{agents:L,onSelect:e=>{w(e),S({...e})},onDelete:$,onToggleEnabled:V})]}),N&&(0,a.jsxs)("div",{className:"flex justify-end gap-2 border-t px-5 py-3",children:[(0,a.jsx)(l.Button,{variant:"outline",size:"sm",onClick:F,disabled:M,children:y("cancel")}),(0,a.jsx)(l.Button,{size:"sm",onClick:U,disabled:M,children:y(M?"saving":"save")})]})]});return f?(0,a.jsx)("div",{className:"h-full flex flex-col",children:J}):(0,a.jsx)(r.Dialog,{open:e,onOpenChange:e=>{e||F(),x(e)},children:(0,a.jsx)(r.DialogContent,{className:"sm:max-w-2xl max-h-[85vh] flex flex-col p-0 gap-0",children:J})})}],588591)}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,837121,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"warnOnce",{enumerable:!0,get:function(){return a}});let a=e=>{}},989484,905724,e=>{"use strict";let t=(0,e.i(433721).default)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);e.s(["default",0,t],905724),e.s(["FileText",0,t],989484)},799543,(e,t,s)=>{t.exports=e.r(233331)},767467,e=>{"use strict";let t=(0,e.i(433721).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["ArrowLeft",0,t],767467)},189131,e=>{"use strict";var t=e.i(764556);let s=t.createContext(void 0);e.s(["useDirection",0,function(){let e=t.useContext(s);return e?.direction??"ltr"}])},459250,e=>{"use strict";var t=e.i(764556);let s=t.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});e.s(["CompositeListContext",0,s,"useCompositeListContext",0,function(){return t.useContext(s)}])},296615,e=>{"use strict";var t,s=e.i(764556),a=e.i(277642),n=e.i(459250);let i=((t={})[t.None=0]="None",t[t.GuessFromOrder=1]="GuessFromOrder",t);e.s(["useCompositeListItem",0,function(e={}){let{label:t,metadata:r,textRef:l,indexGuessBehavior:o,index:c}=e,{register:d,unregister:m,subscribeMapChange:u,elementsRef:x,labelsRef:h,nextIndexRef:p}=(0,n.useCompositeListContext)(),f=s.useRef(-1),[g,v]=s.useState(c??(o===i.GuessFromOrder?()=>{if(-1===f.current){let e=p.current;p.current+=1,f.current=e}return f.current}:-1)),j=s.useRef(null),y=s.useCallback(e=>{if(j.current=e,-1!==g&&null!==e&&(x.current[g]=e,h)){let s=void 0!==t;h.current[g]=s?t:l?.current?.textContent??e.textContent}},[g,x,h,t,l]);return(0,a.useIsoLayoutEffect)(()=>{if(null!=c)return;let e=j.current;if(e)return d(e,r),()=>{m(e)}},[c,d,m,r]),(0,a.useIsoLayoutEffect)(()=>{if(null==c)return u(e=>{let t=j.current?e.get(j.current)?.index:null;null!=t&&v(t)})},[c,u,v]),s.useMemo(()=>({ref:y,index:g}),[g,y])}])},756432,e=>{"use strict";var t=e.i(764556),s=e.i(549154),a=e.i(29905),n=e.i(277642),i=e.i(459250),r=e.i(344180);function l(){return new Map}function o(){return new Set}function c(e,t){let s=e.compareDocumentPosition(t);return s&Node.DOCUMENT_POSITION_FOLLOWING||s&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:s&Node.DOCUMENT_POSITION_PRECEDING||s&Node.DOCUMENT_POSITION_CONTAINS?1:0}e.s(["CompositeList",0,function(e){let{children:d,elementsRef:m,labelsRef:u,onMapChange:x}=e,h=(0,a.useStableCallback)(x),p=t.useRef(0),f=(0,s.useRefWithInit)(o).current,g=(0,s.useRefWithInit)(l).current,[v,j]=t.useState(0),y=t.useRef(v),N=(0,a.useStableCallback)((e,t)=>{g.set(e,t??null),y.current+=1,j(y.current)}),w=(0,a.useStableCallback)(e=>{g.delete(e),y.current+=1,j(y.current)}),k=t.useMemo(()=>{let e=new Map;return Array.from(g.keys()).filter(e=>e.isConnected).sort(c).forEach((t,s)=>{let a=g.get(t)??{};e.set(t,{...a,index:s})}),e},[g,v]);(0,n.useIsoLayoutEffect)(()=>{if("function"!=typeof MutationObserver||0===k.size)return;let e=new MutationObserver(e=>{let t=new Set,s=e=>t.has(e)?t.delete(e):t.add(e);e.forEach(e=>{e.removedNodes.forEach(s),e.addedNodes.forEach(s)}),0===t.size&&(y.current+=1,j(y.current))});return k.forEach((t,s)=>{s.parentElement&&e.observe(s.parentElement,{childList:!0})}),()=>{e.disconnect()}},[k]),(0,n.useIsoLayoutEffect)(()=>{y.current===v&&(m.current.length!==k.size&&(m.current.length=k.size),u&&u.current.length!==k.size&&(u.current.length=k.size),p.current=k.size),h(k)},[h,k,m,u,v]),(0,n.useIsoLayoutEffect)(()=>()=>{m.current=[]},[m]),(0,n.useIsoLayoutEffect)(()=>()=>{u&&(u.current=[])},[u]);let b=(0,a.useStableCallback)(e=>(f.add(e),()=>{f.delete(e)}));(0,n.useIsoLayoutEffect)(()=>{f.forEach(e=>e(k))},[f,k]);let C=t.useMemo(()=>({register:N,unregister:w,subscribeMapChange:b,elementsRef:m,labelsRef:u,nextIndexRef:p}),[N,w,b,m,u,p]);return(0,r.jsx)(i.CompositeListContext.Provider,{value:C,children:d})}])},464111,e=>{"use strict";e.s(["clamp",0,function(e,t=Number.MIN_SAFE_INTEGER,s=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,s))}])},394394,e=>{"use strict";var t=e.i(764556);let s=t.createContext(void 0),a={disableStyleElements:!1};e.s(["useCSPContext",0,function(){return t.useContext(s)??a}])},842809,203922,e=>{"use strict";let t=new Map;function s(e,s,a){return null==e?"":(function(e,s){let a=JSON.stringify({locale:e,options:s}),n=t.get(a);if(n)return n;let i=new Intl.NumberFormat(e,s);return t.set(a,i),i})(s,a).format(e)}e.s(["formatNumber",0,s,"formatNumberValue",0,function(e,t,a){return null==e?"":a?s(e,t,a):s(e/100,t,{style:"percent"})}],842809),e.s(["valueToPercent",0,function(e,t,s){return(e-t)*100/(s-t)}],203922)},517432,e=>{"use strict";var t=e.i(56032),s=e.i(863728);function a(){return s.NOOP}function n(){return!1}function i(){return!0}e.s(["useIsHydrating",0,function(){return(0,t.useSyncExternalStore)(a,n,i)}])},950396,e=>{"use strict";var t=e.i(344180),s=e.i(764556),a=e.i(799543);let n=(0,s.createContext)({theme:"system",setTheme:()=>{},resolvedTheme:"light"}),i="agent-spaces-theme",r={light:"#ffffff",dark:"#0f1117"};function l(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function o(e){var t;let s,a="system"===e?l():e,n=document.documentElement;n.classList.remove("light","dark"),n.classList.add(a),n.style.colorScheme=a,t=a,(s=document.querySelector('meta[name="theme-color"]'))||((s=document.createElement("meta")).name="theme-color",document.head.appendChild(s)),s.content=r[t],window.AgentSpacesStatusBar?.setTheme(t)}e.s(["ThemeProvider",0,function({children:e,defaultTheme:c="system"}){(0,a.useServerInsertedHTML)(()=>(0,t.jsx)("script",{dangerouslySetInnerHTML:{__html:`(function(){try{var t=localStorage.getItem('${i}');var d=t==='dark'||((!t||t==='system')&&matchMedia('(prefers-color-scheme:dark)').matches);var r=d?'dark':'light';document.documentElement.classList.add(r);document.documentElement.style.colorScheme=r;var m=document.querySelector('meta[name="theme-color"]');if(!m){m=document.createElement('meta');m.name='theme-color';document.head.appendChild(m)}m.content=d?'${r.dark}':'${r.light}';if(window.AgentSpacesStatusBar){window.AgentSpacesStatusBar.setTheme(r)}}catch(e){}})()`}},"theme-init"));let d=(0,s.useSyncExternalStore)(e=>{let t=window.matchMedia("(prefers-color-scheme: dark)");return t.addEventListener("change",e),()=>t.removeEventListener("change",e)},()=>l(),()=>"light"),m=(0,s.useSyncExternalStore)(e=>(window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)),()=>localStorage.getItem(i)||c,()=>c),u="system"===m?d:m,x=(0,s.useCallback)(e=>{localStorage.setItem(i,e),o(e),window.dispatchEvent(new StorageEvent("storage",{key:i}))},[]);return(0,s.useEffect)(()=>{o(m)},[m,d]),(0,t.jsx)(n.Provider,{value:{theme:m,setTheme:x,resolvedTheme:u},children:e})},"useTheme",0,function(){return(0,s.useContext)(n)}])},799773,e=>{"use strict";let t=(0,e.i(433721).default)("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);e.s(["User",0,t],799773)},951841,e=>{"use strict";let t;var s=e.i(764556);e.s(["useUserAvatar",0,function(){let[e,a]=(0,s.useState)(()=>void 0!==t?t:localStorage.getItem("userAvatarUrl"));return(0,s.useEffect)(()=>{void 0===t&&fetch("/api/user/settings").then(e=>e.json()).then(e=>{e.avatarUrl&&(t=e.avatarUrl,a(e.avatarUrl),localStorage.setItem("userAvatarUrl",e.avatarUrl))}).catch(()=>{})},[]),e}])},92457,e=>{"use strict";let t=(0,e.i(433721).default)("monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);e.s(["Monitor",0,t],92457)},357301,e=>{"use strict";let t=(0,e.i(433721).default)("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);e.s(["RotateCcw",0,t],357301)},551157,e=>{"use strict";let t=(0,e.i(433721).default)("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);e.s(["default",0,t])},267624,e=>{"use strict";let t=(0,e.i(433721).default)("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);e.s(["LayoutGrid",0,t],267624)},757106,e=>{"use strict";let t=(0,e.i(433721).default)("brain",[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]]);e.s(["default",0,t])},990336,e=>{"use strict";var t=e.i(757106);e.s(["Brain",()=>t.default])},307858,e=>{"use strict";let t=(0,e.i(433721).default)("external-link",[["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"}]]);e.s(["ExternalLink",0,t],307858)},549705,e=>{"use strict";var t=e.i(344180),s=e.i(764556),a=e.i(244073),n=e.i(209988),i=e.i(260218),r=e.i(681622),l=e.i(562918),o=e.i(767467),c=e.i(100559),d=e.i(953700),m=e.i(137340),u=e.i(990336),x=e.i(307858),h=e.i(368942);let p={vision:"bg-blue-500/10 text-blue-600 border-blue-200",reasoning:"bg-purple-500/10 text-purple-600 border-purple-200",embedding:"bg-green-500/10 text-green-600 border-green-200"};function f({providers:e,providerModels:s,onEdit:n,onDelete:r,onAddModel:o}){let d=(0,a.useTranslations)("providers");return(0,t.jsxs)("div",{className:"flex flex-col p-2",children:[e.map(e=>{let a=s.find(t=>t.id===e.id),h=a?.models??[];return(0,t.jsxs)("div",{className:"group rounded-lg px-3 py-2.5 hover:bg-muted/50 cursor-pointer transition-colors",onClick:()=>n(e),children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"flex size-8 items-center justify-center rounded-lg bg-primary/10",children:(0,t.jsx)(c.Server,{className:"size-4 text-primary"})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("span",{className:"text-sm font-medium",children:e.name}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:e.apiBase||d("list.noApiBase")})]}),(0,t.jsxs)(l.Badge,{variant:"outline",className:"text-[10px] h-4 px-1.5",children:[h.length," ",d("list.modelsCount")]}),(0,t.jsx)(i.Button,{variant:"ghost",size:"icon-xs",className:"opacity-0 group-hover:opacity-100 transition-opacity",onClick:t=>{t.stopPropagation(),r(e.id)},children:(0,t.jsx)(m.Trash2,{className:"size-3 text-destructive"})})]}),h.length>0&&(0,t.jsx)("div",{className:"mt-2 ml-11 flex flex-wrap gap-1",children:h.map(e=>(0,t.jsxs)("span",{className:"inline-flex items-center gap-0.5 text-[11px] text-muted-foreground",children:[(0,t.jsx)(u.Brain,{className:"size-3"}),e.name,["vision","reasoning","embedding"].map(s=>e[s]?(0,t.jsx)("span",{className:`inline-block rounded px-1 text-[9px] font-medium border ${p[s]}`,children:s[0].toUpperCase()},s):null)]},e.id))}),(0,t.jsxs)(i.Button,{variant:"ghost",size:"xs",className:"mt-1 ml-11 h-6 text-[11px] text-muted-foreground",onClick:t=>{t.stopPropagation(),o(e.name)},children:[(0,t.jsx)(x.ExternalLink,{className:"size-3"}),d("list.addModel")]})]},e.id)}),0===e.length&&(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-muted-foreground",children:[(0,t.jsx)(c.Server,{className:"size-10 mb-2 opacity-30"}),(0,t.jsx)("p",{className:"text-sm",children:d("list.empty")})]})]})}function g({draft:e,onChange:s}){let n=(0,a.useTranslations)("providers");return(0,t.jsx)("div",{className:"flex flex-col gap-5 p-5",children:(0,t.jsxs)("div",{className:"flex flex-col gap-2.5",children:[(0,t.jsx)("div",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:n("form.connection")}),(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground",children:n("form.name")}),(0,t.jsx)(r.Input,{value:e.name||"",onChange:e=>s("name",e.target.value),placeholder:n("form.namePlaceholder")})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground",children:n("form.apiBase")}),(0,t.jsx)(r.Input,{value:e.apiBase||"",onChange:e=>s("apiBase",e.target.value),placeholder:n("form.apiBasePlaceholder")})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground",children:n("form.apiKey")}),(0,t.jsx)(r.Input,{type:"password",value:e.apiKey||"",onChange:e=>s("apiKey",e.target.value),placeholder:n("form.apiKeyPlaceholder")})]})]})})}e.s(["ProvidersDialog",0,function({open:e,onOpenChange:r,onAddModel:l,standalone:c}){let m=(0,a.useTranslations)("providers"),u=(0,a.useTranslations)("common"),{models:x,providers:p,ensure:v,addProvider:j,updateProvider:y,removeProvider:N}=(0,h.useLLMStore)(),[w,k]=(0,s.useState)(null),[b,C]=(0,s.useState)(null),[S,z]=(0,s.useState)(!1),[T,I]=(0,s.useState)(!1),[D,M]=(0,s.useState)(null);(0,s.useEffect)(()=>{e&&(z(!0),M(null),v().finally(()=>z(!1)))},[e,v]);let $=()=>{k(null),C(null)},E=()=>{k(null),C({name:"",apiBase:"",apiKey:""})},O=async()=>{if(b&&b.name){I(!0),M(null);try{let e=!w,t=await fetch(e?"/api/providers":`/api/providers/${w.id}`,{method:e?"POST":"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(b)});if(!t.ok)throw Error();let s=await t.json();e?j(s):y(s),$()}catch{M(m("error.saveFailed"))}finally{I(!1)}}},A=async e=>{if(confirm(m("confirm.delete"))){I(!0);try{if(!(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok)throw Error();N(e),w?.id===e&&$()}catch{M(m("error.deleteFailed"))}finally{I(!1)}}},L=(0,t.jsxs)(t.Fragment,{children:[!c&&(0,t.jsxs)("div",{className:"flex items-center gap-3 border-b px-5 py-4",children:[b&&(0,t.jsx)(i.Button,{variant:"ghost",size:"icon-sm",onClick:$,children:(0,t.jsx)(o.ArrowLeft,{className:"size-4"})}),(0,t.jsxs)(n.DialogHeader,{className:"flex-1 space-y-0",children:[(0,t.jsx)(n.DialogTitle,{className:"text-base",children:b?w?m("dialog.editTitle"):m("dialog.addTitle"):m("dialog.title")}),(0,t.jsx)(n.DialogDescription,{className:"text-xs",children:b?m("dialog.editDescription"):m("dialog.listDescription")})]}),!b&&(0,t.jsxs)(i.Button,{variant:"outline",size:"sm",onClick:E,className:"mr-6",children:[(0,t.jsx)(d.Plus,{className:"size-3.5"}),m("dialog.add")]})]}),c&&!b&&(0,t.jsx)("div",{className:"flex items-center justify-end px-5 py-3 border-b",children:(0,t.jsxs)(i.Button,{variant:"outline",size:"sm",onClick:E,children:[(0,t.jsx)(d.Plus,{className:"size-3.5"}),m("dialog.add")]})}),c&&b&&(0,t.jsxs)("div",{className:"flex items-center gap-3 px-5 py-3 border-b",children:[(0,t.jsx)(i.Button,{variant:"ghost",size:"icon-sm",onClick:$,children:(0,t.jsx)(o.ArrowLeft,{className:"size-4"})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("h2",{className:"text-base font-medium truncate",children:w?m("dialog.editTitle"):m("dialog.addTitle")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:m("dialog.editDescription")})]})]}),(0,t.jsxs)("div",{className:"flex-1 overflow-y-auto",children:[D&&(0,t.jsx)("div",{className:"mx-5 mt-4 rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-xs text-destructive",children:D}),S?(0,t.jsx)("div",{className:"py-12 text-center text-sm text-muted-foreground",children:m("dialog.loading")}):b?(0,t.jsx)(g,{draft:b,onChange:(e,t)=>{C(s=>s?{...s,[e]:t}:s)}}):(0,t.jsx)(f,{providers:p,providerModels:p.map(e=>{let t;return{id:e.id,models:(t=e.name,x.filter(e=>e.provider===t))}}),onEdit:e=>{k(e),C({...e})},onDelete:A,onAddModel:e=>{c||r(!1),l(e)}})]}),b&&(0,t.jsxs)("div",{className:"flex justify-end gap-2 border-t px-5 py-3",children:[(0,t.jsx)(i.Button,{variant:"outline",size:"sm",onClick:$,disabled:T,children:u("cancel")}),(0,t.jsx)(i.Button,{size:"sm",onClick:O,disabled:T||!b.name,children:u(T?"saving":"save")})]})]});return c?(0,t.jsx)("div",{className:"h-full flex flex-col",children:L}):(0,t.jsx)(n.Dialog,{open:e,onOpenChange:e=>{e||$(),r(e)},children:(0,t.jsx)(n.DialogContent,{className:"sm:max-w-2xl max-h-[85vh] flex flex-col p-0 gap-0",children:L})})}])},515104,e=>{"use strict";function t(){return"tauri.localhost"===window.location.hostname||"__TAURI_INTERNALS__"in window}async function s(){return t()?l():"Notification"in window?r(Notification.permission):"unsupported"}async function a(){return t()?o():i()}async function n(e,s){var a,n;return t()?c(e,s):(a=e,n=s,void("Notification"in window&&"granted"===Notification.permission&&new Notification(a,{body:n,icon:"/favicon.ico"})))}async function i(){return"Notification"in window?r(await Notification.requestPermission()):"unsupported"}function r(e){switch(e){case"granted":return"granted";case"denied":return"denied";default:return"default"}}async function l(){try{let{isPermissionGranted:t}=await e.A(678001);return await t()?"granted":"default"}catch{return"unsupported"}}async function o(){try{let{requestPermission:t,isPermissionGranted:s}=await e.A(678001),a=await t();if("granted"===a||await s())return"granted";return"denied"}catch{return"unsupported"}}async function c(t,s){try{let{sendNotification:a,isPermissionGranted:n}=await e.A(678001);if(!await n())return;a({title:t,body:s})}catch{}}e.s(["getNotificationPermission",0,s,"isTauriEnvironment",0,t,"requestNotificationPermission",0,a,"sendNativeNotification",0,n])},437122,233297,286117,e=>{"use strict";var t=e.i(523592);function s(e){let[t,s=""]=e.split("#",2),[a,n=""]=t.split("?",2);if(!a.startsWith("/")||a.startsWith("/api/"))return e;if("/"===a)return`/${n?`?${n}`:""}${s?`#${s}`:""}`;if(a.startsWith("/workspace/")){let e=a.slice(11).split("/")[0],t=new URLSearchParams(n);return t.set("workspaceId",e),`/workspace/_.html${t.toString()?`?${t.toString()}`:""}${s?`#${s}`:""}`}let i=a.endsWith(".html")?a:`${a}.html`;return`${i}${n?`?${n}`:""}${s?`#${s}`:""}`}function a(e){return"/index.html"===e?"/":e.endsWith(".html")?e.slice(0,-5):e}function n(e){return"/login"===a(e)}e.i(8890),e.i(515104),e.s(["tauriNavigate",0,function(e,t,a=!1){t=s(t),a?window.location.replace(t):window.location.href=t},"toStaticHref",0,s],233297),e.s(["isLoginPath",0,n,"isWorkspacePath",0,function(e){return a(e).startsWith("/workspace/")},"workspaceIdFromLocation",0,function(e,t){let s=new URLSearchParams(t).get("workspaceId");if(s)return s;let n=a(e).match(/^\/workspace\/([^/]+)/);return n?.[1]??null}],286117);let i="agent-spaces-token",r="agent-spaces-auth-verified";function l(){let e=localStorage.getItem(i);if(null!==e)return e;let s=(0,t.getActiveServer)()?.secret;return void 0!==s?s:null}function o(){localStorage.removeItem(i),localStorage.removeItem(r)}function c(){let e=l();return null===e?{}:{Authorization:`Bearer ${e}`}}async function d(e,a){let i=function(e){if("string"!=typeof e||e.startsWith("http"))return e;let s=(0,t.getActiveServerUrl)();return s?`${s}${e.startsWith("/")?"":"/"}${e}`:e}(e),r={...c(),...a?.headers},l=await fetch(i,{...a,headers:r});return(401===l.status||403===l.status)&&(o(),n(window.location.pathname)||window.location.replace(s("/login"))),l}e.s(["authHeaders",0,c,"fetchWithAuth",0,d,"getToken",0,l,"isAuthenticated",0,function(){return"1"===localStorage.getItem(r)},"removeToken",0,o,"setToken",0,function(e){localStorage.setItem(i,e),localStorage.setItem(r,"1")}],437122)},962562,e=>{"use strict";let t=(0,e.i(433721).default)("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);e.s(["Pencil",0,t],962562)},210,e=>{"use strict";let t=(0,e.i(433721).default)("settings-2",[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);e.s(["Settings2",0,t],210)},100559,e=>{"use strict";let t=(0,e.i(433721).default)("server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);e.s(["Server",0,t],100559)},894920,e=>{"use strict";var t=e.i(344180),s=e.i(764556),a=e.i(209988),n=e.i(260218),i=e.i(681622),r=e.i(788010),l=e.i(344118),o=e.i(962562),c=e.i(953700),d=e.i(100559),m=e.i(137340);let u=(0,e.i(433721).default)("wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);var x=e.i(244073);e.s(["ServerManagerDialog",0,function({open:e,onOpenChange:h,servers:p,activeId:f,onUpdate:g,onRemove:v,onSwitch:j}){let y=(0,x.useTranslations)("sidebar"),N=(0,x.useTranslations)("common"),[w,k]=s.useState(null),[b,C]=s.useState(""),[S,z]=s.useState(""),[T,I]=s.useState(""),[D,M]=s.useState(""),[$,E]=s.useState(""),[O,A]=s.useState(""),[L,P]=s.useState(""),[B,U]=s.useState(null),F=()=>{k(null),C(""),z(""),I("")},R=()=>{if(!b.trim()||!S.trim())return;let e=S.trim().replace(/\/$/,"");/^https?:\/\//.test(e)||(e="http://"+e),g(p.map(t=>t.id===w?{...t,name:b.trim(),url:e,secret:T.trim()||void 0}:t)),F()},_=s.useCallback(e=>{console.log(`[server-diagnostic] ${e}`),P(t=>`${t}${t?"\n":""}${e}`)},[]),H=async e=>{U(e.id),P("");let t=e.url.replace(/\/$/,""),s=`${t}/api/health`,a=new URL("/ws",t);a.protocol="https:"===a.protocol?"wss:":"ws:",a.searchParams.set("workspaceId","__diagnostic__"),a.searchParams.set("token",e.secret||"__diagnostic__"),_(`time: ${new Date().toISOString()}`),_(`window.origin: ${window.location.origin}`),_(`window.href: ${window.location.href}`),_(`navigator.onLine: ${navigator.onLine}`),_(`target: ${t}`),_(`health: ${s}`);let n=performance.now();try{let e=new AbortController,t=window.setTimeout(()=>e.abort(),1e4),a=await fetch(s,{method:"GET",cache:"no-store",mode:"cors",signal:e.signal});window.clearTimeout(t);let i=await a.text();_(`fetch /api/health: OK ${a.status} ${a.statusText} (${Math.round(performance.now()-n)}ms)`),_(`fetch response: ${i.slice(0,500)||"<empty>"}`)}catch(t){let e=t instanceof Error?t:Error(String(t));_(`fetch /api/health: FAILED ${e.name}: ${e.message} (${Math.round(performance.now()-n)}ms)`)}_(`websocket: ${a.toString()}`),await new Promise(e=>{let t=performance.now(),s=!1,n=(a,n)=>{if(!s){s=!0,_(`${a} (${Math.round(performance.now()-t)}ms)`);try{n?.close()}catch{}e()}};try{let e=new WebSocket(a.toString()),t=window.setTimeout(()=>n("websocket: TIMEOUT",e),1e4);e.onopen=()=>{window.clearTimeout(t),n("websocket: OPEN",e)},e.onerror=()=>{window.clearTimeout(t),n("websocket: ERROR",e)},e.onclose=s=>{window.clearTimeout(t),n(`websocket: CLOSE code=${s.code} reason=${s.reason||"<empty>"}`,e)}}catch(t){let e=t instanceof Error?t:Error(String(t));n(`websocket: FAILED ${e.name}: ${e.message}`)}}),U(null)};return(0,t.jsx)(a.Dialog,{open:e,onOpenChange:e=>{h(e),e||F()},children:(0,t.jsxs)(a.DialogContent,{className:"max-w-md",children:[(0,t.jsxs)(a.DialogHeader,{children:[(0,t.jsx)(a.DialogTitle,{children:y("server.manageServers")}),(0,t.jsx)(a.DialogDescription,{children:y("server.manageDescription")})]}),(0,t.jsx)("div",{className:"space-y-1",children:p.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-3 rounded-md border px-3 py-2",children:[(0,t.jsx)(d.Server,{className:"size-4 shrink-0 text-muted-foreground"}),w===e.id?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.Input,{className:"h-7 text-sm flex-1",value:b,onChange:e=>C(e.target.value),placeholder:"Name",autoFocus:!0}),(0,t.jsx)(i.Input,{className:"h-7 text-sm flex-[1.5]",value:S,onChange:e=>z(e.target.value),placeholder:"http://...",onKeyDown:e=>"Enter"===e.key&&e.preventDefault()}),(0,t.jsx)(n.Button,{size:"sm",variant:"ghost",onClick:R,className:"h-7 px-2",children:N("save")}),(0,t.jsx)(n.Button,{size:"sm",variant:"ghost",onClick:F,className:"h-7 px-2",children:N("cancel")})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0 cursor-pointer",onClick:()=>{e.id!==f&&j(e)},children:[(0,t.jsx)("div",{className:"text-sm font-medium truncate",children:e.name}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground truncate",children:e.url})]}),e.id===f?(0,t.jsx)(l.Check,{className:"size-4 shrink-0 text-primary"}):(0,t.jsx)(n.Button,{size:"sm",variant:"ghost",onClick:()=>j(e),className:"h-7 px-2 text-xs shrink-0",children:y("server.switch")}),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(u,{className:"size-3.5 shrink-0 text-muted-foreground cursor-pointer hover:text-foreground",onClick:()=>H(e)}),(0,t.jsx)(o.Pencil,{className:"size-3.5 shrink-0 text-muted-foreground cursor-pointer hover:text-foreground",onClick:()=>{k(e.id),C(e.name),z(e.url),I(e.secret||"")}}),"default"!==e.id&&(0,t.jsx)(m.Trash2,{className:"size-3.5 shrink-0 text-muted-foreground cursor-pointer hover:text-destructive",onClick:()=>v(e.id)})]})]})]},e.id))}),null===w&&(0,t.jsxs)("div",{className:"border-t pt-3 mt-2 space-y-2",children:[(0,t.jsx)("div",{className:"text-xs font-medium text-muted-foreground mb-2",children:y("server.newServer")}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(i.Input,{className:"h-8 text-sm",value:D,onChange:e=>M(e.target.value),placeholder:"Name"}),(0,t.jsx)(n.Button,{size:"sm",onClick:()=>{if(!D.trim()||!$.trim())return;let e=$.trim().replace(/\/$/,"");/^https?:\/\//.test(e)||(e="http://"+e),g([...p,{id:Date.now().toString(),name:D.trim(),url:e,secret:O.trim()||void 0}]),M(""),E(""),A("")},disabled:!D.trim()||!$.trim(),children:(0,t.jsx)(c.Plus,{className:"size-4"})})]}),(0,t.jsx)("div",{className:"flex items-center gap-2",children:(0,t.jsx)(i.Input,{className:"h-8 text-sm flex-1",value:$,onChange:e=>E(e.target.value),placeholder:"http://..."})}),(0,t.jsx)("div",{className:"flex items-center gap-2",children:(0,t.jsx)(i.Input,{className:"h-8 text-sm flex-1",type:"password",value:O,onChange:e=>A(e.target.value),placeholder:y("server.secretOptionalPlaceholder"),onKeyDown:e=>"Enter"===e.key&&e.preventDefault()})})]}),(0,t.jsxs)("div",{className:"border-t pt-3 mt-2 space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("div",{className:"text-xs font-medium text-muted-foreground",children:"Network diagnostics"}),(0,t.jsx)(n.Button,{size:"sm",variant:"ghost",className:"h-7 px-2 text-xs",disabled:!p.find(e=>e.id===f)||null!==B,onClick:()=>{let e=p.find(e=>e.id===f);e&&H(e)},children:B?"Testing...":"Test active"})]}),(0,t.jsx)(r.Textarea,{readOnly:!0,value:L||"Tap the Wi-Fi icon next to a server, or use Test active.",className:"h-36 resize-none font-mono text-[11px]"})]})]})})}],894920)},111343,e=>{"use strict";let t=(0,e.i(433721).default)("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"}]]);e.s(["Save",0,t],111343)},255742,973767,401058,977694,e=>{"use strict";var t=e.i(433721);let s=(0,t.default)("star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);e.s(["Star",0,s],255742);let a=(0,t.default)("star-off",[["path",{d:"m10.344 4.688 1.181-2.393a.53.53 0 0 1 .95 0l2.31 4.679a2.12 2.12 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.237 3.152",key:"19ctli"}],["path",{d:"m17.945 17.945.43 2.505a.53.53 0 0 1-.771.56l-4.618-2.428a2.12 2.12 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.12 2.12 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a8 8 0 0 0 .4-.099",key:"ptqqvy"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);e.s(["StarOff",0,a],973767);let n=(0,t.default)("ellipsis-vertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);e.s(["MoreVertical",0,n],401058);let i=(0,t.default)("rocket",[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]]);e.s(["Rocket",0,i],977694)},22906,191202,e=>{"use strict";var t=e.i(344180),s=e.i(764556),a=e.i(244073),n=e.i(887836),i=e.i(209988),r=e.i(260218),l=e.i(681622),o=e.i(788010),c=e.i(191118),d=e.i(917955),m=e.i(996652),u=e.i(188815),x=e.i(611176),h=e.i(255742),p=e.i(973767),f=e.i(129981),g=e.i(887354);let v=(0,e.i(433721).default)("plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]]);e.s(["Plug",0,v],191202);var j=e.i(972846),y=e.i(401058),N=e.i(137340),w=e.i(977694),k=e.i(111343),b=e.i(465458);e.i(462506);let C=(0,n.default)(()=>e.A(863812).then(e=>e.default),{loadableGenerated:{modules:[158480]},ssr:!1,loading:()=>(0,t.jsx)("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"Loading editor..."})});e.s(["McpsDialog",0,function({open:e,onOpenChange:n,standalone:S}){let z=(0,a.useTranslations)("mcps"),T=(0,a.useTranslations)("common"),[I,D]=(0,s.useState)([]),[M,$]=(0,s.useState)([]),[E,O]=(0,s.useState)(!1),[A,L]=(0,s.useState)(""),[P,B]=(0,s.useState)("all"),[U,F]=(0,s.useState)(""),[R,_]=(0,s.useState)(!1),[H,W]=(0,s.useState)(""),[q,J]=(0,s.useState)(""),[V,G]=(0,s.useState)(null),[K,X]=(0,s.useState)([]),[Y,Q]=(0,s.useState)(null),[Z,ee]=(0,s.useState)(""),et=(0,s.useCallback)(async()=>{O(!0);try{let e=await fetch("/api/mcps");e.ok&&D(await e.json())}catch{}O(!1)},[]),es=(0,s.useCallback)(async()=>{try{let e=await fetch("/api/agents/presets");if(e.ok){let t=await e.json();$(t.map(e=>({id:e.id,name:e.name,avatarUrl:e.avatarUrl,description:e.description})))}}catch{}},[]);(0,s.useEffect)(()=>{(e||S)&&(et(),es())},[e,S,et,es]);let ea=async e=>{try{let t=await fetch(`/api/mcps/${encodeURIComponent(e.name)}/favorite`,{method:"POST"});if(t.ok){let{favorited:s}=await t.json();D(t=>t.map(t=>t.name===e.name?{...t,favorited:s}:t))}}catch{}},en=async()=>{J("");try{JSON.parse(H)}catch{J(z("importInvalidJson"));return}try{let e=await fetch("/api/mcps/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonText:H})});if(e.ok)W(""),_(!1),et();else{let t=await e.json();J(t.error||z("importFailed"))}}catch{J(z("importFailed"))}},ei=async()=>{let e;if(Y){try{e=JSON.parse(Z)}catch{return}try{(await fetch(`/api/mcps/${encodeURIComponent(Y.name)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({config:e})})).ok&&(D(t=>t.map(t=>t.name===Y.name?{...t,config:e}:t)),Q(null))}catch{}}},er=async e=>{try{(await fetch(`/api/mcps/${encodeURIComponent(e.name)}`,{method:"DELETE"})).ok&&D(t=>t.filter(t=>t.name!==e.name))}catch{}},el=async()=>{if(V){for(let e of M){let t=V.boundAgents.some(t=>t.id===e.id),s=K.includes(e.id);if(t&&!s){let t=await fetch(`/api/agents/presets/${e.id}`);if(!t.ok)continue;let s=await t.json(),a=s.mcps||{},n={...a.mcpServers||{}};delete n[V.name],await fetch(`/api/agents/presets/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({...s,mcps:{...a,mcpServers:n}})})}else if(!t&&s){let t=await fetch(`/api/agents/presets/${e.id}`);if(!t.ok)continue;let s=await t.json(),a=s.mcps||{},n={...a.mcpServers||{}};V.name in n||(n[V.name]=V.config,await fetch(`/api/agents/presets/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({...s,mcps:{...a,mcpServers:n}})}))}}G(null),et()}},eo=e=>{X(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},ec=I.filter(e=>{if(A){let t=A.toLowerCase();if(!e.name.toLowerCase().includes(t)&&!e.description.toLowerCase().includes(t))return!1}return("favorites"!==P||!!e.favorited)&&("agent"!==P||!U||!!e.boundAgents.some(e=>e.id===U))}),ed=(S||e)&&!V&&!Y,em=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.DialogHeader,{children:(0,t.jsxs)("div",{className:"flex items-center justify-end pr-8 pt-2",children:[(0,t.jsxs)("div",{className:"hidden md:block",children:[S?(0,t.jsx)("h2",{className:"text-base font-semibold",children:z("title")}):(0,t.jsx)(i.DialogTitle,{children:z("title")}),S?(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:z("description")}):(0,t.jsx)(i.DialogDescription,{children:z("description")})]}),(0,t.jsx)("div",{className:"flex items-center gap-2",children:(0,t.jsxs)(m.Popover,{open:R,onOpenChange:_,children:[(0,t.jsx)(m.PopoverTrigger,{render:(0,t.jsxs)(r.Button,{variant:"outline",size:"sm",children:[(0,t.jsx)(f.Upload,{className:"size-3.5 mr-1"}),z("import")]})}),(0,t.jsx)(m.PopoverContent,{className:"w-96",align:"end",children:(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:z("importTitle")}),(0,t.jsx)(o.Textarea,{value:H,onChange:e=>{W(e.target.value),J("")},placeholder:'{\n "mcpServers": {\n "server-name": {\n "command": "npx",\n "args": ["-y", "package"],\n "env": {}\n }\n }\n}',className:"font-mono text-xs min-h-[180px] resize-none"}),q&&(0,t.jsx)("p",{className:"text-xs text-destructive",children:q}),(0,t.jsx)(r.Button,{size:"sm",onClick:en,disabled:!H.trim(),className:"w-full",children:z("importConfirm")})]})})]})})]})}),(0,t.jsxs)("div",{className:"flex flex-1 min-h-0 gap-4 pt-2",children:[(0,t.jsxs)("div",{className:"hidden md:flex w-44 shrink-0 flex-col gap-3",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)(r.Button,{variant:"all"===P?"secondary":"ghost",size:"sm",className:"w-full justify-start",onClick:()=>{B("all"),F("")},children:[(0,t.jsx)(v,{className:"size-3.5 mr-1.5"}),z("filterAll")]}),(0,t.jsxs)(r.Button,{variant:"favorites"===P?"secondary":"ghost",size:"sm",className:"w-full justify-start",onClick:()=>{B("favorites"),F("")},children:[(0,t.jsx)(h.Star,{className:"size-3.5 mr-1.5"}),z("filterFavorites")]})]}),M.length>0&&(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("p",{className:"text-xs font-medium text-muted-foreground px-2",children:z("filterByAgent")}),(0,t.jsx)(c.ScrollArea,{className:"max-h-48",children:M.map(e=>(0,t.jsxs)(r.Button,{variant:"agent"===P&&U===e.id?"secondary":"ghost",size:"sm",className:"w-full justify-start",onClick:()=>{B("agent"),F(e.id)},children:[(0,t.jsx)(x.AgentIcon,{agentId:e.id,name:e.name,avatarUrl:e.avatarUrl,className:"size-4 mr-1.5 rounded-full"}),(0,t.jsx)("span",{className:"truncate",children:e.name})]},e.id))})]})]}),(0,t.jsxs)("div",{className:"flex-1 min-w-0 flex flex-col gap-3",children:[(0,t.jsxs)("div",{className:"flex md:hidden flex-col gap-2",children:[(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(g.Search,{className:"size-3.5 absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),(0,t.jsx)(l.Input,{value:A,onChange:e=>L(e.target.value),placeholder:z("search"),className:"pl-8"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)("div",{className:"flex rounded-lg border border-input p-0.5",children:[(0,t.jsx)("button",{type:"button",className:(0,b.cn)("px-2.5 py-1 rounded-md text-xs font-medium transition-colors","all"===P?"bg-muted":"text-muted-foreground hover:text-foreground"),onClick:()=>{B("all"),F("")},children:z("filterAll")}),(0,t.jsxs)("button",{type:"button",className:(0,b.cn)("px-2.5 py-1 rounded-md text-xs font-medium transition-colors","favorites"===P?"bg-muted":"text-muted-foreground hover:text-foreground"),onClick:()=>{B("favorites"),F("")},children:[(0,t.jsx)(h.Star,{className:"size-3 inline-block mr-0.5 -mt-px"}),z("filterFavorites")]})]}),M.length>0&&(0,t.jsx)(u.SearchSelect,{value:"agent"===P?U:"",onChange:e=>{e?(B("agent"),F(e)):(B("all"),F(""))},options:M.map(e=>({value:e.id,label:e.name})),placeholder:z("filterByAgent"),allowCustom:!1,className:"flex-1 min-w-0"})]})]}),(0,t.jsxs)("div",{className:"hidden md:block relative",children:[(0,t.jsx)(g.Search,{className:"size-3.5 absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),(0,t.jsx)(l.Input,{value:A,onChange:e=>L(e.target.value),placeholder:z("search"),className:"pl-8"})]}),(0,t.jsx)(c.ScrollArea,{className:"flex-1",children:E?(0,t.jsx)("div",{className:"flex items-center justify-center py-12 text-muted-foreground text-sm",children:T("loading")}):0===ec.length?(0,t.jsx)("div",{className:"flex items-center justify-center py-12 text-muted-foreground text-sm",children:z("empty")}):(0,t.jsx)("div",{className:"grid grid-cols-1 gap-3 pr-2",children:ec.map(e=>(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-background p-4 hover:bg-accent/30 transition-colors cursor-pointer",onClick:()=>{Q(e),ee(JSON.stringify(e.config,null,2))},children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(v,{className:"size-3.5 text-muted-foreground"}),(0,t.jsx)("span",{className:"font-medium text-sm",children:e.name}),(0,t.jsx)("button",{type:"button",className:"flex items-center justify-center size-5 rounded hover:bg-accent",onClick:t=>{t.stopPropagation(),ea(e)},children:e.favorited?(0,t.jsx)(h.Star,{className:"size-3.5 text-yellow-500 fill-yellow-500"}):(0,t.jsx)(p.StarOff,{className:"size-3.5 text-muted-foreground"})})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:e.description||e.config.command||e.config.url||JSON.stringify(e.config).slice(0,100)})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 shrink-0",onClick:e=>e.stopPropagation(),children:[(0,t.jsxs)(r.Button,{variant:"outline",size:"sm",onClick:()=>{G(e),X(e.boundAgents.map(e=>e.id))},children:[(0,t.jsx)(w.Rocket,{className:"size-3.5 mr-1"}),z("apply")]}),(0,t.jsxs)(d.DropdownMenu,{children:[(0,t.jsx)(d.DropdownMenuTrigger,{render:(0,t.jsx)(r.Button,{variant:"ghost",size:"icon",className:"size-7"}),children:(0,t.jsx)(y.MoreVertical,{className:"size-3.5"})}),(0,t.jsx)(d.DropdownMenuContent,{align:"end",children:(0,t.jsxs)(d.DropdownMenuItem,{className:"text-destructive focus:text-destructive",onClick:()=>er(e),children:[(0,t.jsx)(N.Trash2,{className:"size-3.5 mr-1.5"}),z("delete")]})})]})]})]}),e.boundAgents.length>0&&(0,t.jsxs)("div",{className:"flex items-center gap-1.5 mt-2.5 pt-2.5 border-t border-border/50",children:[e.boundAgents.map(e=>(0,t.jsx)(x.AgentIcon,{agentId:e.id,name:e.name,avatarUrl:e.avatarUrl,className:"size-5 rounded-full"},e.id)),(0,t.jsx)("span",{className:"text-xs text-muted-foreground ml-1",children:e.boundAgents.length})]})]},e.name))})})]})]})]});return(0,t.jsxs)(t.Fragment,{children:[S&&ed&&(0,t.jsx)("div",{className:"h-full flex flex-col",children:em}),!S&&(0,t.jsx)(i.Dialog,{open:ed,onOpenChange:n,children:(0,t.jsx)(i.DialogContent,{className:"!w-[80vw] !max-w-[80vw] !h-[80vh] flex flex-col",children:em})}),(0,t.jsx)(i.Dialog,{open:!!Y,onOpenChange:e=>{e||Q(null)},children:(0,t.jsxs)(i.DialogContent,{className:"!w-[80vw] !max-w-[80vw] !h-[80vh] flex flex-col",children:[(0,t.jsx)(i.DialogHeader,{children:(0,t.jsxs)("div",{className:"flex items-center justify-between pr-8",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(i.DialogTitle,{children:z("editTitle",{name:Y?.name||""})}),(0,t.jsx)(i.DialogDescription,{children:z("editDescription")})]}),(0,t.jsxs)(r.Button,{size:"sm",onClick:ei,children:[(0,t.jsx)(k.Save,{className:"size-3.5 mr-1"}),T("save")]})]})}),(0,t.jsx)("div",{className:"flex-1 min-h-0 pt-2",children:(0,t.jsx)(C,{height:"100%",language:"json",value:Z,onChange:e=>ee(e||""),theme:"vs-dark",options:{fontSize:13,minimap:{enabled:!1},scrollBeyondLastLine:!1,padding:{top:8},renderLineHighlight:"gutter",wordWrap:"on",formatOnPaste:!0}})})]})}),(0,t.jsx)(i.Dialog,{open:!!V,onOpenChange:e=>{e||G(null)},children:(0,t.jsxs)(i.DialogContent,{className:"sm:max-w-sm",children:[(0,t.jsxs)(i.DialogHeader,{children:[(0,t.jsx)(i.DialogTitle,{children:z("bindTitle",{name:V?.name||""})}),(0,t.jsx)(i.DialogDescription,{children:z("bindDescription")})]}),(0,t.jsxs)("div",{className:"space-y-3 pt-2",children:[(0,t.jsx)("div",{className:"max-h-52 overflow-y-auto space-y-0.5",children:M.map(e=>(0,t.jsxs)("button",{type:"button",onClick:()=>eo(e.id),className:(0,b.cn)("flex items-center gap-2 w-full px-2 py-1.5 rounded-md hover:bg-muted text-left text-sm transition-colors"),children:[(0,t.jsx)(x.AgentIcon,{agentId:e.id,name:e.name,avatarUrl:e.avatarUrl,className:"size-5 rounded-full"}),(0,t.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,t.jsx)("span",{className:"block truncate",children:e.name}),e.description&&(0,t.jsx)("span",{className:"block truncate text-xs text-muted-foreground",children:e.description})]}),(0,t.jsx)("div",{className:(0,b.cn)("flex items-center justify-center size-4 rounded border shrink-0",K.includes(e.id)?"bg-primary border-primary text-primary-foreground":"border-input")})]},e.id))}),K.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:K.map(e=>{let s=M.find(t=>t.id===e);return(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-md bg-muted px-2 py-0.5 text-xs",children:[(0,t.jsx)(x.AgentIcon,{agentId:e,name:s?.name,className:"size-3.5 rounded-full"}),s?.name||e,(0,t.jsx)("button",{type:"button",onClick:()=>eo(e),className:"hover:text-destructive",children:(0,t.jsx)(j.X,{className:"size-3"})})]},e)})}),(0,t.jsxs)("div",{className:"flex justify-end gap-2 pt-1",children:[(0,t.jsx)(r.Button,{variant:"outline",onClick:()=>G(null),children:T("cancel")}),(0,t.jsx)(r.Button,{onClick:el,children:T("confirm")})]})]})]})})]})}],22906)},625873,e=>{"use strict";var t=e.i(344180),s=e.i(764556),a=e.i(244073),n=e.i(887836),i=e.i(209988),r=e.i(260218),l=e.i(681622),o=e.i(191118),c=e.i(917955),d=e.i(996652),m=e.i(898822),u=e.i(129981),x=e.i(972846),h=e.i(984178),p=e.i(465458);let f=0;function g({value:e=[],onChange:a,accept:n,maxFiles:i=0,maxSize:r,disabled:l=!1,className:o,placeholder:c}){let[d,v]=(0,s.useState)(null),j=(0,s.useCallback)((t,s)=>{if(v(null),s.length>0){let e=s[0].errors[0]?.message;e&&v(e)}if(0===t.length)return;let n=t.map(e=>{let t={id:`upload-${++f}`,file:e};return e.type.startsWith("image/")&&(t.preview=URL.createObjectURL(e)),t}),r=i>0?[...e,...n].slice(0,i):[...e,...n];a?.(r)},[e,a,i]),y=(0,s.useCallback)(t=>{let s=e.find(e=>e.id===t);s?.preview&&URL.revokeObjectURL(s.preview),a?.(e.filter(e=>e.id!==t))},[e,a]),{getRootProps:N,getInputProps:w,isDragActive:k,open:b}=(0,m.useDropzone)({onDrop:j,accept:n,maxFiles:i||void 0,maxSize:r,disabled:l,noClick:!1});return(0,t.jsxs)("div",{className:(0,p.cn)("space-y-3",o),children:[(0,t.jsxs)("div",{...N(),className:(0,p.cn)("relative flex flex-col items-center justify-center gap-2 rounded-xl border-2 border-dashed px-6 py-8 transition-colors cursor-pointer",k?"border-primary bg-primary/5":"border-border hover:border-primary/50 hover:bg-accent/50",l&&"pointer-events-none opacity-50"),children:[(0,t.jsx)("input",{...w()}),(0,t.jsx)(u.Upload,{className:"size-8 text-muted-foreground"}),(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:c??(k?"松开即可上传":"拖拽文件到此处,或点击选择")}),!k&&(0,t.jsxs)("p",{className:"mt-1 text-xs text-muted-foreground",children:["支持多文件",r?`,单文件最大 ${(r/1024/1024).toFixed(0)}MB`:""]})]})]}),d&&(0,t.jsx)("p",{className:"text-xs text-destructive",children:d}),e.length>0&&(0,t.jsx)("div",{className:"flex flex-col gap-2",children:e.map(e=>{var s;return(0,t.jsxs)("div",{className:"flex items-center gap-3 rounded-lg border border-border bg-background px-3 py-2",children:[e.preview?(0,t.jsx)("img",{src:e.preview,alt:"",className:"size-10 rounded-md object-cover"}):(0,t.jsx)("div",{className:"flex size-10 items-center justify-center rounded-md bg-muted",children:(0,t.jsx)(h.FileIcon,{className:"size-5 text-muted-foreground"})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("p",{className:"truncate text-sm",children:e.file.name}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:(s=e.file.size)<1024?`${s} B`:s<1048576?`${(s/1024).toFixed(1)} KB`:`${(s/1024/1024).toFixed(1)} MB`})]}),(0,t.jsx)("button",{type:"button",onClick:t=>{t.stopPropagation(),y(e.id)},className:"flex size-7 items-center justify-center rounded-md hover:bg-accent transition-colors",children:(0,t.jsx)(x.X,{className:"size-4 text-muted-foreground"})})]},e.id)})})]})}var v=e.i(188815),j=e.i(611176),y=e.i(255742),N=e.i(973767),w=e.i(887354),k=e.i(989484),b=e.i(401058),C=e.i(137340),S=e.i(977694),z=e.i(111343),T=e.i(601039);e.i(462506);let I=(0,n.default)(()=>e.A(863812).then(e=>e.default),{loadableGenerated:{modules:[158480]},ssr:!1,loading:()=>(0,t.jsx)("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"Loading editor..."})});e.s(["SkillsDialog",0,function({open:e,onOpenChange:n,standalone:m}){let h=(0,a.useTranslations)("skills"),f=(0,a.useTranslations)("common"),[D,M]=(0,s.useState)([]),[$,E]=(0,s.useState)([]),[O,A]=(0,s.useState)(!1),[L,P]=(0,s.useState)(""),[B,U]=(0,s.useState)("all"),[F,R]=(0,s.useState)(""),[_,H]=(0,s.useState)(!1),[W,q]=(0,s.useState)([]),[J,V]=(0,s.useState)(null),[G,K]=(0,s.useState)([]),[X,Y]=(0,s.useState)(null),[Q,Z]=(0,s.useState)(""),[ee,et]=(0,s.useState)([]),[es,ea]=(0,s.useState)(new Set),[en,ei]=(0,s.useState)(!1),[er,el]=(0,s.useState)(!1),eo=(0,s.useCallback)(async()=>{A(!0);try{let e=await fetch("/api/skills");e.ok&&M(await e.json())}catch{}A(!1)},[]),ec=(0,s.useCallback)(async()=>{try{let e=await fetch("/api/agents/presets");if(e.ok){let t=await e.json();E(t.map(e=>({id:e.id,name:e.name,avatarUrl:e.avatarUrl,description:e.description})))}}catch{}},[]);(0,s.useEffect)(()=>{(e||m)&&(eo(),ec())},[e,m,eo,ec]);let ed=async e=>{try{let t=await fetch(`/api/skills/${encodeURIComponent(e.name)}/favorite`,{method:"POST"});if(t.ok){let{favorited:s}=await t.json();M(t=>t.map(t=>t.name===e.name?{...t,favorited:s}:t))}}catch{}},em=async()=>{for(let e of W){let t=await e.file.text();await fetch("/api/skills/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({filename:e.file.name,content:t})})}q([]),H(!1),eo()},eu=async()=>{if(X)try{(await fetch(`/api/skills/${encodeURIComponent(X.name)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:Q})})).ok&&(M(e=>e.map(e=>e.name===X.name?{...e,content:Q}:e)),Y(null))}catch{}},ex=async e=>{try{(await fetch(`/api/skills/${encodeURIComponent(e.name)}`,{method:"DELETE"})).ok&&M(t=>t.filter(t=>t.name!==e.name))}catch{}},eh=async()=>{if(J){for(let e of $){let t=J.boundAgents.some(t=>t.id===e.id),s=G.includes(e.id);if(t&&!s){let t=await fetch(`/api/agents/presets/${e.id}`);if(!t.ok)continue;let s=await t.json(),a=(s.skills||[]).filter(e=>e.replace(/\.md$/i,"")!==J.name);console.log("[skills] remove skill",J.name,"from agent",e.name,"updatedSkills:",a),await fetch(`/api/agents/presets/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({...s,skills:a})})}else if(!t&&s){let t=await fetch(`/api/agents/presets/${e.id}`);if(!t.ok)continue;let s=await t.json();if(!(s.skills||[]).map(e=>e.replace(/\.md$/i,"")).includes(J.name)){let t=[...s.skills||[],`${J.name}.md`];console.log("[skills] add skill",J.name,"to agent",e.name,"updatedSkills:",t),await fetch(`/api/agents/presets/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({...s,skills:t})})}}}V(null),eo()}},ep=e=>{K(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},ef=async()=>{el(!0);try{let e=await fetch("/api/skills/sync-check");if(e.ok){let t=await e.json();et(t),ea(new Set(t.map(e=>`${e.agentId}::${e.skillName}`))),ei(!0)}}catch{}el(!1)},eg=async()=>{let e=ee.filter(e=>es.has(`${e.agentId}::${e.skillName}`));if(0!==e.length)try{(await fetch("/api/skills/sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({items:e.map(e=>({agentId:e.agentId,skillName:e.skillName}))})})).ok&&(ei(!1),eo())}catch{}},ev=D.filter(e=>{if(L){let t=L.toLowerCase();if(!e.name.toLowerCase().includes(t)&&!e.content.toLowerCase().includes(t))return!1}return("favorites"!==B||!!e.favorited)&&("agent"!==B||!F||!!e.boundAgents.some(e=>e.id===F))}),ej=(m||e)&&!J&&!X,ey=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.DialogHeader,{children:(0,t.jsxs)("div",{className:"flex items-center justify-between pr-8",children:[(0,t.jsxs)("div",{className:"hidden md:block",children:[m?(0,t.jsx)("h2",{className:"text-base font-semibold",children:h("title")}):(0,t.jsx)(i.DialogTitle,{children:h("title")}),m?(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:h("description")}):(0,t.jsx)(i.DialogDescription,{children:h("description")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 ml-auto shrink-0 pt-2",children:[(0,t.jsxs)(r.Button,{variant:"outline",size:"sm",onClick:ef,disabled:er,children:[(0,t.jsx)(T.RefreshCw,{className:(0,p.cn)("size-3.5 mr-1",er&&"animate-spin")}),h("syncToAgents")]}),(0,t.jsxs)(d.Popover,{open:_,onOpenChange:H,children:[(0,t.jsx)(d.PopoverTrigger,{render:(0,t.jsxs)(r.Button,{variant:"outline",size:"sm",children:[(0,t.jsx)(u.Upload,{className:"size-3.5 mr-1"}),h("import")]})}),(0,t.jsx)(d.PopoverContent,{className:"w-80",align:"end",children:(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:h("importTitle")}),(0,t.jsx)(g,{value:W,onChange:q,accept:{"text/markdown":[".md"],"":[".md"]},placeholder:h("importPlaceholder"),maxFiles:10}),(0,t.jsx)(r.Button,{size:"sm",onClick:em,disabled:0===W.length,className:"w-full",children:h("importConfirm")})]})})]})]})]})}),(0,t.jsxs)("div",{className:"flex flex-1 min-h-0 gap-4 pt-2",children:[(0,t.jsxs)("div",{className:"hidden md:flex w-44 shrink-0 flex-col gap-3",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)(r.Button,{variant:"all"===B?"secondary":"ghost",size:"sm",className:"w-full justify-start",onClick:()=>{U("all"),R("")},children:[(0,t.jsx)(k.FileText,{className:"size-3.5 mr-1.5"}),h("filterAll")]}),(0,t.jsxs)(r.Button,{variant:"favorites"===B?"secondary":"ghost",size:"sm",className:"w-full justify-start",onClick:()=>{U("favorites"),R("")},children:[(0,t.jsx)(y.Star,{className:"size-3.5 mr-1.5"}),h("filterFavorites")]})]}),$.length>0&&(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("p",{className:"text-xs font-medium text-muted-foreground px-2",children:h("filterByAgent")}),(0,t.jsx)(o.ScrollArea,{className:"max-h-48",children:$.map(e=>(0,t.jsxs)(r.Button,{variant:"agent"===B&&F===e.id?"secondary":"ghost",size:"sm",className:"w-full justify-start",onClick:()=>{U("agent"),R(e.id)},children:[(0,t.jsx)(j.AgentIcon,{agentId:e.id,name:e.name,avatarUrl:e.avatarUrl,className:"size-4 mr-1.5 rounded-full"}),(0,t.jsx)("span",{className:"truncate",children:e.name})]},e.id))})]})]}),(0,t.jsxs)("div",{className:"flex-1 min-w-0 flex flex-col gap-3",children:[(0,t.jsxs)("div",{className:"flex md:hidden flex-col gap-2",children:[(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(w.Search,{className:"size-3.5 absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),(0,t.jsx)(l.Input,{value:L,onChange:e=>P(e.target.value),placeholder:h("search"),className:"pl-8"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)("div",{className:"flex rounded-lg border border-input p-0.5",children:[(0,t.jsx)("button",{type:"button",className:(0,p.cn)("px-2.5 py-1 rounded-md text-xs font-medium transition-colors","all"===B?"bg-muted":"text-muted-foreground hover:text-foreground"),onClick:()=>{U("all"),R("")},children:h("filterAll")}),(0,t.jsxs)("button",{type:"button",className:(0,p.cn)("px-2.5 py-1 rounded-md text-xs font-medium transition-colors","favorites"===B?"bg-muted":"text-muted-foreground hover:text-foreground"),onClick:()=>{U("favorites"),R("")},children:[(0,t.jsx)(y.Star,{className:"size-3 inline-block mr-0.5 -mt-px"}),h("filterFavorites")]})]}),$.length>0&&(0,t.jsx)(v.SearchSelect,{value:"agent"===B?F:"",onChange:e=>{e?(U("agent"),R(e)):(U("all"),R(""))},options:$.map(e=>({value:e.id,label:e.name})),placeholder:h("filterByAgent"),allowCustom:!1,className:"flex-1 min-w-0"})]})]}),(0,t.jsxs)("div",{className:"hidden md:block relative",children:[(0,t.jsx)(w.Search,{className:"size-3.5 absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),(0,t.jsx)(l.Input,{value:L,onChange:e=>P(e.target.value),placeholder:h("search"),className:"pl-8"})]}),(0,t.jsx)(o.ScrollArea,{className:"flex-1",children:O?(0,t.jsx)("div",{className:"flex items-center justify-center py-12 text-muted-foreground text-sm",children:f("loading")}):0===ev.length?(0,t.jsx)("div",{className:"flex items-center justify-center py-12 text-muted-foreground text-sm",children:h("empty")}):(0,t.jsx)("div",{className:"grid grid-cols-1 gap-3 pr-2",children:ev.map(e=>(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-background p-4 hover:bg-accent/30 transition-colors cursor-pointer",onClick:()=>{Y(e),Z(e.content)},children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("span",{className:"font-medium text-sm",children:e.name}),(0,t.jsx)("button",{type:"button",className:"flex items-center justify-center size-5 rounded hover:bg-accent",onClick:t=>{t.stopPropagation(),ed(e)},children:e.favorited?(0,t.jsx)(y.Star,{className:"size-3.5 text-yellow-500 fill-yellow-500"}):(0,t.jsx)(N.StarOff,{className:"size-3.5 text-muted-foreground"})})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:e.description||e.content.slice(0,120).replace(/^#\s+/,"")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 shrink-0",onClick:e=>e.stopPropagation(),children:[(0,t.jsxs)(r.Button,{variant:"outline",size:"sm",onClick:()=>{V(e),K(e.boundAgents.map(e=>e.id))},children:[(0,t.jsx)(S.Rocket,{className:"size-3.5 mr-1"}),h("apply")]}),(0,t.jsxs)(c.DropdownMenu,{children:[(0,t.jsx)(c.DropdownMenuTrigger,{render:(0,t.jsx)(r.Button,{variant:"ghost",size:"icon",className:"size-7"}),children:(0,t.jsx)(b.MoreVertical,{className:"size-3.5"})}),(0,t.jsx)(c.DropdownMenuContent,{align:"end",children:(0,t.jsxs)(c.DropdownMenuItem,{className:"text-destructive focus:text-destructive",onClick:()=>ex(e),children:[(0,t.jsx)(C.Trash2,{className:"size-3.5 mr-1.5"}),h("delete")]})})]})]})]}),e.boundAgents.length>0&&(0,t.jsxs)("div",{className:"flex items-center gap-1.5 mt-2.5 pt-2.5 border-t border-border/50",children:[e.boundAgents.map(e=>(0,t.jsx)(j.AgentIcon,{agentId:e.id,name:e.name,avatarUrl:e.avatarUrl,className:"size-5 rounded-full"},e.id)),(0,t.jsx)("span",{className:"text-xs text-muted-foreground ml-1",children:e.boundAgents.length})]})]},e.name))})})]})]})]});return(0,t.jsxs)(t.Fragment,{children:[m&&ej&&(0,t.jsx)("div",{className:"h-full flex flex-col",children:ey}),!m&&(0,t.jsx)(i.Dialog,{open:ej,onOpenChange:n,children:(0,t.jsx)(i.DialogContent,{className:"!w-[80vw] !max-w-[80vw] !h-[80vh] flex flex-col",children:ey})}),(0,t.jsx)(i.Dialog,{open:!!X,onOpenChange:e=>{e||Y(null)},children:(0,t.jsxs)(i.DialogContent,{className:"!w-[80vw] !max-w-[80vw] !h-[80vh] flex flex-col",children:[(0,t.jsx)(i.DialogHeader,{children:(0,t.jsxs)("div",{className:"flex items-center justify-between pr-8",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(i.DialogTitle,{children:h("editTitle",{name:X?.name||""})}),(0,t.jsx)(i.DialogDescription,{children:h("editDescription")})]}),(0,t.jsxs)(r.Button,{size:"sm",onClick:eu,children:[(0,t.jsx)(z.Save,{className:"size-3.5 mr-1"}),f("save")]})]})}),(0,t.jsx)("div",{className:"flex-1 min-h-0 pt-2",children:(0,t.jsx)(I,{height:"100%",language:"markdown",value:Q,onChange:e=>Z(e||""),theme:"vs-dark",options:{fontSize:13,minimap:{enabled:!1},scrollBeyondLastLine:!1,padding:{top:8},renderLineHighlight:"gutter",wordWrap:"on"}})})]})}),(0,t.jsx)(i.Dialog,{open:!!J,onOpenChange:e=>{e||V(null)},children:(0,t.jsxs)(i.DialogContent,{className:"sm:max-w-sm",children:[(0,t.jsxs)(i.DialogHeader,{children:[(0,t.jsx)(i.DialogTitle,{children:h("bindTitle",{name:J?.name||""})}),(0,t.jsx)(i.DialogDescription,{children:h("bindDescription")})]}),(0,t.jsxs)("div",{className:"space-y-3 pt-2",children:[(0,t.jsx)("div",{className:"max-h-52 overflow-y-auto space-y-0.5",children:$.map(e=>(0,t.jsxs)("button",{type:"button",onClick:()=>ep(e.id),className:(0,p.cn)("flex items-center gap-2 w-full px-2 py-1.5 rounded-md hover:bg-muted text-left text-sm transition-colors"),children:[(0,t.jsx)(j.AgentIcon,{agentId:e.id,name:e.name,avatarUrl:e.avatarUrl,className:"size-5 rounded-full"}),(0,t.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,t.jsx)("span",{className:"block truncate",children:e.name}),e.description&&(0,t.jsx)("span",{className:"block truncate text-xs text-muted-foreground",children:e.description})]}),(0,t.jsx)("div",{className:(0,p.cn)("flex items-center justify-center size-4 rounded border shrink-0",G.includes(e.id)?"bg-primary border-primary text-primary-foreground":"border-input")})]},e.id))}),G.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:G.map(e=>{let s=$.find(t=>t.id===e);return(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-md bg-muted px-2 py-0.5 text-xs",children:[(0,t.jsx)(j.AgentIcon,{agentId:e,name:s?.name,className:"size-3.5 rounded-full"}),s?.name||e,(0,t.jsx)("button",{type:"button",onClick:()=>ep(e),className:"hover:text-destructive",children:(0,t.jsx)(x.X,{className:"size-3"})})]},e)})}),(0,t.jsxs)("div",{className:"flex justify-end gap-2 pt-1",children:[(0,t.jsx)(r.Button,{variant:"outline",onClick:()=>V(null),children:f("cancel")}),(0,t.jsx)(r.Button,{onClick:eh,children:f("confirm")})]})]})]})}),(0,t.jsx)(i.Dialog,{open:en,onOpenChange:ei,children:(0,t.jsxs)(i.DialogContent,{className:"sm:max-w-lg",children:[(0,t.jsxs)(i.DialogHeader,{children:[(0,t.jsx)(i.DialogTitle,{children:h("syncTitle")}),(0,t.jsx)(i.DialogDescription,{children:h("syncDescription")})]}),(0,t.jsxs)("div",{className:"space-y-3 pt-2",children:[0===ee.length?(0,t.jsx)("div",{className:"flex items-center justify-center py-8 text-muted-foreground text-sm",children:h("syncEmpty")}):(0,t.jsx)(o.ScrollArea,{className:"max-h-72",children:(0,t.jsx)("div",{className:"space-y-1",children:ee.map(e=>{let s=`${e.agentId}::${e.skillName}`;return(0,t.jsxs)("button",{type:"button",onClick:()=>{var t,s;let a;return t=e.agentId,s=e.skillName,a=`${t}::${s}`,void ea(e=>{let t=new Set(e);return t.has(a)?t.delete(a):t.add(a),t})},className:"flex items-center gap-3 w-full px-2 py-1.5 rounded-md hover:bg-muted text-left text-sm transition-colors",children:[(0,t.jsx)("div",{className:(0,p.cn)("flex items-center justify-center size-4 rounded border shrink-0",es.has(s)?"bg-primary border-primary text-primary-foreground":"border-input")}),(0,t.jsx)(j.AgentIcon,{agentId:e.agentId,name:e.agentName,className:"size-5 rounded-full"}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate",children:e.agentName}),(0,t.jsxs)("span",{className:"text-muted-foreground text-xs shrink-0",children:[e.skillName,".md"]})]},s)})})}),ee.length>0&&(0,t.jsxs)("div",{className:"flex justify-end gap-2 pt-1",children:[(0,t.jsx)(r.Button,{variant:"outline",onClick:()=>ei(!1),children:f("cancel")}),(0,t.jsx)(r.Button,{onClick:eg,disabled:0===es.size,children:h("syncConfirm")})]})]})]})})]})}],625873)},678001,e=>{e.v(t=>Promise.all(["static/chunks/0zl19l5tuoppw.js"].map(t=>e.l(t))).then(()=>t(228394)))},863812,e=>{e.v(t=>Promise.all(["static/chunks/168ojsxhm7ypc.js"].map(t=>e.l(t))).then(()=>t(158480)))}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,120276,t=>{"use strict";let e;t.i(836406),t.i(859073),t.i(664195),t.i(347410),t.i(768224),t.i(93151),t.i(158555),t.i(517965),t.i(742150),t.i(500127),t.i(874243),t.i(686882),t.i(127819),t.i(640883),t.i(604257),t.i(869416),t.i(116427),t.i(836354),t.i(473864),t.i(318209),t.i(172781),t.i(250182),t.i(131624),t.i(238015),t.i(534662),t.i(433140),t.i(663159),t.i(119260),t.i(877059),t.i(808e3),t.i(645831),t.i(764894),t.i(551501),t.i(337525),t.i(335283),t.i(615239),t.i(324240),t.i(33999),t.i(745026),t.i(637114),t.i(705067),t.i(948539),t.i(768797),t.i(633666),t.i(405261),t.i(231009),t.i(72895),t.i(862215),t.i(273544),t.i(844168),t.i(843210),t.i(767312),t.i(116013),t.i(735564),t.i(44118),t.i(486172),t.i(321915),t.i(171733),t.i(6838),t.i(45048),t.i(526568),t.i(646675),t.i(426208),t.i(772315),t.i(137475),t.i(504183),t.i(656092),t.i(126391),t.i(925665),t.i(756500);var i=t.i(680590);e="object"==typeof self&&self.constructor&&"DedicatedWorkerGlobalScope"===self.constructor.name&&void 0!==globalThis.workerttPolicy?globalThis.workerttPolicy:function(t,e){let i=globalThis.MonacoEnvironment;if(i?.createTrustedTypesPolicy)try{return i.createTrustedTypesPolicy(t,e)}catch(t){console.error(t);return}try{return globalThis.trustedTypes?.createPolicy(t,e)}catch(t){console.error(t);return}}("defaultWorkerFactory",{createScriptURL:t=>t}),t.s(["createWebWorker",0,function(t){let s=Promise.resolve(function(t){let i=t.label,s=globalThis.MonacoEnvironment;if(s){if("function"==typeof s.getWorker)return s.getWorker("workerMain.js",i);if("function"==typeof s.getWorkerUrl){let t=s.getWorkerUrl("workerMain.js",i);return new Worker(e?e.createScriptURL(t):t,{name:i,type:"module"})}}if(t.createWorker)return t.createWorker();throw Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}({label:t.label??"monaco-editor-worker",moduleId:t.moduleId,createWorker:t.createWorker})).then(e=>(e.postMessage("ignore"),e.postMessage(t.createData),e));return i.editor.createWebWorker({worker:s,host:t.host,keepIdleModels:t.keepIdleModels})}])},817854,t=>{"use strict";var e=t.i(344180),i=t.i(465458);t.s(["Label",0,function({className:t,...s}){return(0,e.jsx)("label",{"data-slot":"label",className:(0,i.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),...s})}])},212965,250438,t=>{"use strict";let e=(0,t.i(433721).default)("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);t.s(["ArrowDown",0,e],212965);var i=t.i(558680);t.s(["ChevronDownIcon",()=>i.default],250438)},302773,t=>{"use strict";let e=(0,t.i(816709).create)((t,e)=>({workflows:[],currentWorkflow:null,isLoading:!1,loadWorkflows:async()=>{t({isLoading:!0});try{let e=await fetch("/api/workflows"),i=await e.json();t({workflows:i,isLoading:!1})}catch{t({isLoading:!1})}},createWorkflow:async e=>{let i=await fetch("/api/workflows",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await i.json();return t(t=>({workflows:[...t.workflows,s]})),s},updateWorkflow:async(t,i)=>{let s=await fetch(`/api/workflows/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)}),a=await s.json();e().upsertWorkflow(a)},deleteWorkflow:async t=>{await fetch(`/api/workflows/${t}`,{method:"DELETE"}),e().removeWorkflow(t)},duplicateWorkflow:async e=>{let i=await fetch(`/api/workflows/${e}/duplicate`,{method:"POST"}),s=await i.json();t(t=>({workflows:[...t.workflows,s]}))},setCurrentWorkflow:e=>t({currentWorkflow:e}),upsertWorkflow:e=>{t(t=>{let i=t.workflows.findIndex(t=>t.id===e.id);if(-1!==i){let s=[...t.workflows];return s[i]=e,{workflows:s}}return{workflows:[...t.workflows,e]}})},removeWorkflow:e=>{t(t=>({workflows:t.workflows.filter(t=>t.id!==e),currentWorkflow:t.currentWorkflow?.id===e?null:t.currentWorkflow}))}}));t.s(["useWorkflowStore",0,e])},551959,t=>{"use strict";t.i(836406),t.i(859073),t.i(664195),t.i(347410),t.i(768224),t.i(93151),t.i(158555),t.i(517965),t.i(742150),t.i(500127),t.i(874243),t.i(686882),t.i(127819),t.i(640883),t.i(604257),t.i(869416),t.i(116427),t.i(836354),t.i(473864),t.i(318209),t.i(172781),t.i(250182),t.i(131624),t.i(238015),t.i(534662),t.i(433140),t.i(663159),t.i(119260),t.i(877059),t.i(808e3),t.i(645831),t.i(764894),t.i(551501),t.i(337525),t.i(335283),t.i(615239),t.i(324240),t.i(33999),t.i(745026),t.i(637114),t.i(705067),t.i(948539),t.i(768797),t.i(633666),t.i(405261),t.i(231009),t.i(72895),t.i(862215),t.i(273544),t.i(844168),t.i(843210),t.i(767312),t.i(116013),t.i(735564),t.i(44118),t.i(486172),t.i(321915),t.i(171733),t.i(6838),t.i(45048),t.i(526568),t.i(646675),t.i(426208),t.i(772315),t.i(137475),t.i(504183),t.i(656092),t.i(126391),t.i(925665),t.i(756500);var e,i,s,a,n,o=t.i(680590),r=((e=r||{})[e.None=0]="None",e[e.CommonJS=1]="CommonJS",e[e.AMD=2]="AMD",e[e.UMD=3]="UMD",e[e.System=4]="System",e[e.ES2015=5]="ES2015",e[e.ESNext=99]="ESNext",e),l=((i=l||{})[i.None=0]="None",i[i.Preserve=1]="Preserve",i[i.React=2]="React",i[i.ReactNative=3]="ReactNative",i[i.ReactJSX=4]="ReactJSX",i[i.ReactJSXDev=5]="ReactJSXDev",i),c=((s=c||{})[s.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",s[s.LineFeed=1]="LineFeed",s),h=((a=h||{})[a.ES3=0]="ES3",a[a.ES5=1]="ES5",a[a.ES2015=2]="ES2015",a[a.ES2016=3]="ES2016",a[a.ES2017=4]="ES2017",a[a.ES2018=5]="ES2018",a[a.ES2019=6]="ES2019",a[a.ES2020=7]="ES2020",a[a.ESNext=99]="ESNext",a[a.JSON=100]="JSON",a[a.Latest=99]="Latest",a),m=((n=m||{})[n.Classic=1]="Classic",n[n.NodeJs=2]="NodeJs",n);class u{constructor(t,e,i,s,a){this._onDidChange=new o.Emitter,this._onDidExtraLibsChange=new o.Emitter,this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(t),this.setDiagnosticsOptions(e),this.setWorkerOptions(i),this.setInlayHintsOptions(s),this.setModeConfiguration(a),this._onDidExtraLibsChangeTimeout=-1}get onDidChange(){return this._onDidChange.event}get onDidExtraLibsChange(){return this._onDidExtraLibsChange.event}get modeConfiguration(){return this._modeConfiguration}get workerOptions(){return this._workerOptions}get inlayHintsOptions(){return this._inlayHintsOptions}getExtraLibs(){return this._extraLibs}addExtraLib(t,e){let i;if(i=void 0===e?`ts:extralib-${Math.random().toString(36).substring(2,15)}`:e,this._extraLibs[i]&&this._extraLibs[i].content===t)return{dispose:()=>{}};let s=1;return this._removedExtraLibs[i]&&(s=this._removedExtraLibs[i]+1),this._extraLibs[i]&&(s=this._extraLibs[i].version+1),this._extraLibs[i]={content:t,version:s},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let t=this._extraLibs[i];t&&t.version===s&&(delete this._extraLibs[i],this._removedExtraLibs[i]=s,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(t){for(let t in this._extraLibs)this._removedExtraLibs[t]=this._extraLibs[t].version;if(this._extraLibs=Object.create(null),t&&t.length>0)for(let e of t){let t=e.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,i=e.content,s=1;this._removedExtraLibs[t]&&(s=this._removedExtraLibs[t]+1),this._extraLibs[t]={content:i,version:s}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){-1===this._onDidExtraLibsChangeTimeout&&(this._onDidExtraLibsChangeTimeout=window.setTimeout(()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)},0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(t){this._compilerOptions=t||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(t){this._diagnosticsOptions=t||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(t){this._workerOptions=t||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(t){this._inlayHintsOptions=t||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(t){}setEagerModelSync(t){this._eagerModelSync=t}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(t){this._modeConfiguration=t||Object.create(null),this._onDidChange.fire(void 0)}}let p={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,diagnostics:!0,documentRangeFormattingEdits:!0,signatureHelp:!0,onTypeFormattingEdits:!0,codeActions:!0,inlayHints:!0},k=new u({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},p),d=new u({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},p);function v(){return t.A(69588)}o.languages.onLanguage("typescript",()=>v().then(t=>t.setupTypeScript(k))),o.languages.onLanguage("javascript",()=>v().then(t=>t.setupJavaScript(d))),t.s(["JsxEmit",0,l,"ModuleKind",0,r,"ModuleResolutionKind",0,m,"NewLineKind",0,c,"ScriptTarget",0,h,"getJavaScriptWorker",0,()=>v().then(t=>t.getJavaScriptWorker()),"getTypeScriptWorker",0,()=>v().then(t=>t.getTypeScriptWorker()),"javascriptDefaults",0,d,"typescriptDefaults",0,k,"typescriptVersion",0,"5.9.3"],551959)},771485,t=>{t.v(e=>Promise.all(["static/chunks/0.335m_d-cd_g.js","static/chunks/035l5i6hvxwm4.js"].map(e=>t.l(e))).then(()=>e(462988)))},918487,t=>{t.v(e=>Promise.all(["static/chunks/0qe5wvs8fe9ip.js","static/chunks/035l5i6hvxwm4.js"].map(e=>t.l(e))).then(()=>e(343355)))},134924,t=>{t.v(e=>Promise.all(["static/chunks/0ag4p6m9rze~n.js","static/chunks/035l5i6hvxwm4.js"].map(e=>t.l(e))).then(()=>e(813595)))},69588,t=>{t.v(e=>Promise.all(["static/chunks/03sd~wmqw.9gc.js"].map(e=>t.l(e))).then(()=>e(319120)))},635811,t=>{t.v(e=>Promise.all(["static/chunks/09j3~tko9ep2k.js"].map(e=>t.l(e))).then(()=>e(10039)))},264749,t=>{t.v(e=>Promise.all(["static/chunks/0sjpil-vio33w.js"].map(e=>t.l(e))).then(()=>e(785424)))},317605,t=>{t.v(e=>Promise.all(["static/chunks/0rfeqjw8k-viv.js"].map(e=>t.l(e))).then(()=>e(947234)))},704590,t=>{t.v(e=>Promise.all(["static/chunks/100t886jj0x0x.js"].map(e=>t.l(e))).then(()=>e(459451)))},153742,t=>{t.v(e=>Promise.all(["static/chunks/05tqezrd9jb7y.js"].map(e=>t.l(e))).then(()=>e(419759)))},629448,t=>{t.v(e=>Promise.all(["static/chunks/0d8lm7uud1uuc.js"].map(e=>t.l(e))).then(()=>e(675039)))},124011,t=>{t.v(e=>Promise.all(["static/chunks/0xgw6nacc67av.js"].map(e=>t.l(e))).then(()=>e(786142)))},331538,t=>{t.v(e=>Promise.all(["static/chunks/0b9oy9dat2g6l.js"].map(e=>t.l(e))).then(()=>e(612156)))},940085,t=>{t.v(e=>Promise.all(["static/chunks/0rx7dmtxo4d6p.js"].map(e=>t.l(e))).then(()=>e(434780)))},158993,t=>{t.v(e=>Promise.all(["static/chunks/0jm496tvvtjqx.js"].map(e=>t.l(e))).then(()=>e(644426)))},189140,t=>{t.v(e=>Promise.all(["static/chunks/0ztjb8i4tqvql.js"].map(e=>t.l(e))).then(()=>e(829708)))},12065,t=>{t.v(e=>Promise.all(["static/chunks/0yuyx75r122y-.js"].map(e=>t.l(e))).then(()=>e(969420)))},546118,t=>{t.v(e=>Promise.all(["static/chunks/0h5q90v_js2e0.js"].map(e=>t.l(e))).then(()=>e(389449)))},468355,t=>{t.v(e=>Promise.all(["static/chunks/13vl889h_tb-~.js"].map(e=>t.l(e))).then(()=>e(377384)))},292453,t=>{t.v(e=>Promise.all(["static/chunks/0358_-ep6szf..js"].map(e=>t.l(e))).then(()=>e(43559)))},699591,t=>{t.v(e=>Promise.all(["static/chunks/0zb1vymmeoc9o.js"].map(e=>t.l(e))).then(()=>e(318640)))},357037,t=>{t.v(e=>Promise.all(["static/chunks/0q01i3ypmm4rg.js"].map(e=>t.l(e))).then(()=>e(433920)))},766246,t=>{t.v(e=>Promise.all(["static/chunks/11n6upyldh80p.js"].map(e=>t.l(e))).then(()=>e(219782)))},301403,t=>{t.v(e=>Promise.all(["static/chunks/0brr7g0p8esun.js"].map(e=>t.l(e))).then(()=>e(652984)))},806910,t=>{t.v(e=>Promise.all(["static/chunks/0kp1m06cg897x.js"].map(e=>t.l(e))).then(()=>e(32456)))},961253,t=>{t.v(e=>Promise.all(["static/chunks/0gkx0n_plricw.js"].map(e=>t.l(e))).then(()=>e(141471)))},264559,t=>{t.v(e=>Promise.all(["static/chunks/0d4o_4v0-e97a.js"].map(e=>t.l(e))).then(()=>e(623124)))},30518,t=>{t.v(e=>Promise.all(["static/chunks/0-y43ovhjaeo_.js"].map(e=>t.l(e))).then(()=>e(64384)))},768474,t=>{t.v(e=>Promise.all(["static/chunks/0f0-0to._hvah.js"].map(e=>t.l(e))).then(()=>e(717049)))},504826,t=>{t.v(e=>Promise.all(["static/chunks/0ghe5b2-kyi7-.js"].map(e=>t.l(e))).then(()=>e(976570)))},524721,t=>{t.v(e=>Promise.all(["static/chunks/0m9t_esdrum7w.js"].map(e=>t.l(e))).then(()=>e(790307)))},365570,t=>{t.v(e=>Promise.all(["static/chunks/0_yb4aw3n-lks.js"].map(e=>t.l(e))).then(()=>e(195962)))},787804,t=>{t.v(e=>Promise.all(["static/chunks/02ucy02hzl4vo.js"].map(e=>t.l(e))).then(()=>e(68378)))},979480,t=>{t.v(e=>Promise.all(["static/chunks/00n.pmqcipjyd.js"].map(e=>t.l(e))).then(()=>e(3717)))},850064,t=>{t.v(e=>Promise.all(["static/chunks/0.-4-1p34akka.js"].map(e=>t.l(e))).then(()=>e(118112)))},236120,t=>{t.v(e=>Promise.all(["static/chunks/0_gm.-h0brxaf.js"].map(e=>t.l(e))).then(()=>e(854779)))},769302,t=>{t.v(e=>Promise.all(["static/chunks/0g3ypwmflp2mx.js"].map(e=>t.l(e))).then(()=>e(183995)))},511259,t=>{t.v(e=>Promise.all(["static/chunks/0i0psxcvhdp9w.js"].map(e=>t.l(e))).then(()=>e(479742)))},778189,t=>{t.v(e=>Promise.all(["static/chunks/0ss8hcog1_n1i.js"].map(e=>t.l(e))).then(()=>e(671135)))},391583,t=>{t.v(e=>Promise.all(["static/chunks/0rs7_x_.71x1k.js"].map(e=>t.l(e))).then(()=>e(624545)))},4206,t=>{t.v(e=>Promise.all(["static/chunks/0nq24vo2_9kp4.js"].map(e=>t.l(e))).then(()=>e(495584)))},816552,t=>{t.v(e=>Promise.all(["static/chunks/0d5sgidwe_pcg.js"].map(e=>t.l(e))).then(()=>e(788024)))},718384,t=>{t.v(e=>Promise.all(["static/chunks/0hu5nx-z4fj7v.js"].map(e=>t.l(e))).then(()=>e(495619)))},284913,t=>{t.v(e=>Promise.all(["static/chunks/0y.6d96hu3k6k.js"].map(e=>t.l(e))).then(()=>e(547756)))},581714,t=>{t.v(e=>Promise.all(["static/chunks/0q7h6v.~-hcln.js"].map(e=>t.l(e))).then(()=>e(166861)))},261034,t=>{t.v(e=>Promise.all(["static/chunks/0vemm6g3yufzf.js"].map(e=>t.l(e))).then(()=>e(779542)))},93611,t=>{t.v(e=>Promise.all(["static/chunks/186mu8y9np1sy.js"].map(e=>t.l(e))).then(()=>e(417164)))},862727,t=>{t.v(e=>Promise.all(["static/chunks/17a_qp~nx3_r1.js"].map(e=>t.l(e))).then(()=>e(879006)))},697377,t=>{t.v(e=>Promise.all(["static/chunks/060_mn7wcaphv.js"].map(e=>t.l(e))).then(()=>e(217792)))},347750,t=>{t.v(e=>Promise.all(["static/chunks/0w-ftk2~z_w0f.js"].map(e=>t.l(e))).then(()=>e(895880)))},461792,t=>{t.v(e=>Promise.all(["static/chunks/15gjlpek9nxo4.js"].map(e=>t.l(e))).then(()=>e(539576)))},84791,t=>{t.v(e=>Promise.all(["static/chunks/12ae7z-332nqe.js"].map(e=>t.l(e))).then(()=>e(759422)))},590375,t=>{t.v(e=>Promise.all(["static/chunks/0n.gs01bd1s_w.js"].map(e=>t.l(e))).then(()=>e(591135)))},146984,t=>{t.v(e=>Promise.all(["static/chunks/06vb1.5j-tuzp.js"].map(e=>t.l(e))).then(()=>e(45058)))},64443,t=>{t.v(e=>Promise.all(["static/chunks/0q38twk.8uk88.js"].map(e=>t.l(e))).then(()=>e(139429)))},402493,t=>{t.v(e=>Promise.all(["static/chunks/15s4k5wdbcagm.js"].map(e=>t.l(e))).then(()=>e(707280)))},294884,t=>{t.v(e=>Promise.all(["static/chunks/09qqxs3eg7e46.js"].map(e=>t.l(e))).then(()=>e(570275)))},445468,t=>{t.v(e=>Promise.all(["static/chunks/14j.uts4xnh.u.js"].map(e=>t.l(e))).then(()=>e(81057)))},250392,t=>{t.v(e=>Promise.all(["static/chunks/11x5nw_8yy5d0.js"].map(e=>t.l(e))).then(()=>e(894793)))},35431,t=>{t.v(e=>Promise.all(["static/chunks/0ck3is68a9586.js"].map(e=>t.l(e))).then(()=>e(413019)))},185498,t=>{t.v(e=>Promise.all(["static/chunks/15abz60ucjy3t.js"].map(e=>t.l(e))).then(()=>e(509728)))},288688,t=>{t.v(e=>Promise.all(["static/chunks/11~8.35p7_vky.js"].map(e=>t.l(e))).then(()=>e(327571)))},257081,t=>{t.v(e=>Promise.all(["static/chunks/05irsi.vzfofq.js"].map(e=>t.l(e))).then(()=>e(827750)))},434615,t=>{t.v(e=>Promise.all(["static/chunks/0jxj3xh399qcn.js"].map(e=>t.l(e))).then(()=>e(570842)))},611325,t=>{t.v(e=>Promise.all(["static/chunks/0qtd.b3zhzf38.js"].map(e=>t.l(e))).then(()=>e(891824)))},199304,t=>{t.v(e=>Promise.all(["static/chunks/02~6z3ja20ogz.js"].map(e=>t.l(e))).then(()=>e(211678)))},424725,t=>{t.v(e=>Promise.all(["static/chunks/14qoup0y_1j0t.js"].map(e=>t.l(e))).then(()=>e(270100)))},575894,t=>{t.v(e=>Promise.all(["static/chunks/13w2r5w~ikt_6.js"].map(e=>t.l(e))).then(()=>e(895660)))},440673,t=>{t.v(e=>Promise.all(["static/chunks/0wm70l0hod.sw.js"].map(e=>t.l(e))).then(()=>e(592785)))},647192,t=>{t.v(e=>Promise.all(["static/chunks/0gqhau02~fg83.js"].map(e=>t.l(e))).then(()=>e(399133)))},30427,t=>{t.v(e=>Promise.all(["static/chunks/0zj_8cn9~m2~g.js"].map(e=>t.l(e))).then(()=>e(210032)))},509854,t=>{t.v(e=>Promise.all(["static/chunks/0extjypm.j7dp.js"].map(e=>t.l(e))).then(()=>e(637149)))},641974,t=>{t.v(e=>Promise.all(["static/chunks/0t1pc5h0n0y3..js"].map(e=>t.l(e))).then(()=>e(637056)))},66225,t=>{t.v(e=>Promise.all(["static/chunks/0uiiaq~dh4jdx.js"].map(e=>t.l(e))).then(()=>e(57079)))},252541,t=>{t.v(e=>Promise.all(["static/chunks/06xd5s9wkyu0_.js"].map(e=>t.l(e))).then(()=>e(441745)))},769837,t=>{t.v(e=>Promise.all(["static/chunks/0bm-i9rs31uos.js"].map(e=>t.l(e))).then(()=>e(534975)))},215611,t=>{t.v(e=>Promise.all(["static/chunks/0ggkvx5v53lvc.js"].map(e=>t.l(e))).then(()=>e(473166)))},316227,t=>{t.v(e=>Promise.all(["static/chunks/05tbg-zp1~2c_.js"].map(e=>t.l(e))).then(()=>e(282279)))},240972,t=>{t.v(e=>Promise.all(["static/chunks/05gu5s~8nh2wc.js"].map(e=>t.l(e))).then(()=>e(60065)))},216930,t=>{t.v(e=>Promise.all(["static/chunks/0sz5yhrzrrx-_.js"].map(e=>t.l(e))).then(()=>e(240783)))},755019,t=>{t.v(e=>Promise.all(["static/chunks/0p~x_p9pgpnmh.js"].map(e=>t.l(e))).then(()=>e(970178)))},717277,t=>{t.v(e=>Promise.all(["static/chunks/184ukbf139de1.js"].map(e=>t.l(e))).then(()=>e(418864)))},308554,t=>{t.v(e=>Promise.all(["static/chunks/0_-20qzivafad.js"].map(e=>t.l(e))).then(()=>e(797989)))},943272,t=>{t.v(e=>Promise.all(["static/chunks/0w52~a1.76e6y.js"].map(e=>t.l(e))).then(()=>e(493215)))},867512,t=>{t.v(e=>Promise.all(["static/chunks/0.hcqmse3gu~-.js"].map(e=>t.l(e))).then(()=>e(392020)))},611958,t=>{t.v(e=>Promise.all(["static/chunks/0lkfsj~tpr.u8.js"].map(e=>t.l(e))).then(()=>e(148296)))}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,816709,e=>{"use strict";var t=e.i(764556);let i=e=>{let t,i=new Set,r=(e,r)=>{let l="function"==typeof e?e(t):e;if(!Object.is(l,t)){let e=t;t=(null!=r?r:"object"!=typeof l||null===l)?l:Object.assign({},t,l),i.forEach(i=>i(t,e))}},l=()=>t,a={setState:r,getState:l,getInitialState:()=>n,subscribe:e=>(i.add(e),()=>i.delete(e))},n=t=e(r,l,a);return a},r=e=>{let r=e?i(e):i,l=e=>(function(e,i=e=>e){let r=t.default.useSyncExternalStore(e.subscribe,t.default.useCallback(()=>i(e.getState()),[e,i]),t.default.useCallback(()=>i(e.getInitialState()),[e,i]));return t.default.useDebugValue(r),r})(r,e);return Object.assign(l,r),l};e.s(["create",0,e=>e?r(e):r],816709)},636707,e=>{"use strict";e.s([])},125231,438904,e=>{"use strict";e.i(8890);var t,i=e.i(267805),r=e.i(764556),l=e.i(863728);let a=((t={}).disabled="data-disabled",t.valid="data-valid",t.invalid="data-invalid",t.touched="data-touched",t.dirty="data-dirty",t.filled="data-filled",t.focused="data-focused",t),n={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},u={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},s={disabled:!1,...u};e.s(["DEFAULT_FIELD_ROOT_STATE",0,s,"DEFAULT_FIELD_STATE_ATTRIBUTES",0,u,"DEFAULT_VALIDITY_STATE",0,n,"fieldValidityMapping",0,{valid:e=>null===e?null:e?{[a.valid]:""}:{[a.invalid]:""}}],438904);let o=r.createContext({invalid:void 0,name:void 0,validityData:{state:n,errors:[],error:"",value:"",initialValue:null},setValidityData:l.NOOP,disabled:void 0,touched:u.touched,setTouched:l.NOOP,dirty:u.dirty,setDirty:l.NOOP,filled:u.filled,setFilled:l.NOOP,focused:u.focused,setFocused:l.NOOP,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:s,markedDirtyRef:{current:!1},registerFieldControl:l.NOOP,validation:{getValidationProps:(e=l.EMPTY_OBJECT)=>e,getInputValidationProps:(e=l.EMPTY_OBJECT)=>e,inputRef:{current:null},commit:async()=>{}}});e.s(["FieldRootContext",0,o,"useFieldRootContext",0,function(e=!0){let t=r.useContext(o);if(t.setValidityData===l.NOOP&&!e)throw Error((0,i.default)(28));return t}],125231)},50891,e=>{"use strict";var t=e.i(267805),i=e.i(764556);let r=i.createContext({legendId:void 0,setLegendId:()=>{},disabled:void 0});e.s(["useFieldsetRootContext",0,function(e=!1){let l=i.useContext(r);if(!l&&!e)throw Error((0,t.default)(86));return l}])},380414,443124,e=>{"use strict";e.i(8890);var t=e.i(764556),i=e.i(863728);let r=t.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:i.NOOP,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});e.s(["useFormContext",0,function(){return t.useContext(r)}],380414);let l=t.createContext({controlId:void 0,registerControlId:i.NOOP,labelId:void 0,setLabelId:i.NOOP,messageIds:[],setMessageIds:i.NOOP,getDescriptionProps:e=>e});e.s(["LabelableContext",0,l,"useLabelableContext",0,function(){return t.useContext(l)}],443124)},84987,593947,2602,213700,262407,987854,781406,e=>{"use strict";e.i(8890);var t=e.i(764556),i=e.i(29905),r=e.i(125231),l=e.i(438904),a=e.i(50891),n=e.i(380414),u=e.i(549154),s=e.i(370383),o=e.i(139236),d=e.i(443124),c=e.i(344180);let f=function(e){let r=(0,o.useBaseUiId)(),l=void 0===e.controlId?r:e.controlId,[a,n]=t.useState(l),[f,v]=t.useState(e.labelId),[b,g]=t.useState([]),p=(0,u.useRefWithInit)(()=>new Map),{messageIds:m}=(0,d.useLabelableContext)(),y=(0,i.useStableCallback)((e,t)=>{let i=p.current;void 0===t?i.delete(e):(i.set(e,t),n(e=>{let t;if(0!==i.size){for(let r of i.values()){if(void 0!==e&&r===e)return e;void 0===t&&(t=r)}return t}}))}),C=t.useCallback(e=>(0,s.mergeProps)({"aria-describedby":m.concat(b).join(" ")||void 0},e),[m,b]),h=t.useMemo(()=>({controlId:a,registerControlId:y,labelId:f,setLabelId:v,messageIds:b,setMessageIds:g,getDescriptionProps:C}),[a,y,f,v,b,g,C]);return(0,c.jsx)(d.LabelableContext.Provider,{value:h,children:e.children})};e.s(["LabelableProvider",0,f],593947);var v=e.i(969490),b=e.i(863728),g=e.i(232449);function p(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}e.s(["getCombinedFieldValidityData",0,p],2602);let m=Object.keys(l.DEFAULT_VALIDITY_STATE);var y=e.i(106206),C=e.i(277642);let h=t.forwardRef(function(e,u){let{errors:o,validationMode:f,submitAttemptedRef:h}=(0,n.useFormContext)(),{render:x,className:R,validate:E,validationDebounceTime:I=0,validationMode:T=f,name:M,disabled:S=!1,invalid:L,dirty:O,touched:F,actionsRef:V,style:k,...P}=e,{disabled:D}=(0,a.useFieldsetRootContext)(),A=(0,i.useStableCallback)(E||(()=>null)),w=D||S,[j,N]=t.useState(!1),[_,U]=t.useState(!1),[B,Y]=t.useState(!1),[J,H]=t.useState(!1),K=O??_,W=F??j,z=t.useRef(!1),q=(0,i.useStableCallback)(e=>{void 0===O&&(e&&(z.current=!0),U(e))}),G=(0,i.useStableCallback)(e=>{void 0===F&&N(e)}),Q=(0,i.useStableCallback)(()=>"onChange"===T||"onSubmit"===T&&h.current),X=!!M&&Object.hasOwn(o,M)&&void 0!==o[M],Z=!0===L||X,[$,ee]=t.useState({state:l.DEFAULT_VALIDITY_STATE,error:"",errors:[],value:null,initialValue:null}),et=!Z&&$.state.valid,ei=t.useMemo(()=>({disabled:w,touched:W,dirty:K,valid:et,filled:B,focused:J}),[w,W,K,et,B,J]),er=function(e){let{formRef:r,clearErrors:a}=(0,n.useFormContext)(),{setValidityData:u,validate:o,validityData:c,validationDebounceTime:f,invalid:v,markedDirtyRef:y,state:C,name:h,shouldValidateOnChange:x}=e,{controlId:R,getDescriptionProps:E}=(0,d.useLabelableContext)(),I=(0,g.useTimeout)(),T=t.useRef(null),M=(0,i.useStableCallback)(async(e,t=!1)=>{let i,a=T.current;if(!a)return;if(t){if(!1!==C.valid)return;let t=a.validity;if(!t.valueMissing){let t={value:e,state:{...l.DEFAULT_VALIDITY_STATE,valid:!0},error:"",errors:[],initialValue:c.initialValue};if(a.setCustomValidity(""),R){let e=r.current.fields.get(R);e&&r.current.fields.set(R,{...e,...p(t,!1)})}u(t);return}let i=m.reduce((e,i)=>(e[i]=t[i],e),{});if(!i.valid&&!function(e){if(!e||e.valid||!e.valueMissing)return!1;let t=!1;for(let i of m)"valid"!==i&&("valueMissing"===i&&(t=e[i]),e[i]&&(t=!1));return t}(i))return}I.clear();let n=null,s=[],d=function(e){let t=m.reduce((t,i)=>(t[i]=e.validity[i],t),{}),i=!1;for(let e of m)if("valid"!==e){if("valueMissing"===e&&t[e])i=!0;else if(t[e])return t}return i&&!y.current&&(t.valid=!0,t.valueMissing=!1),t}(a),f=x();if(a.validationMessage&&!f)i=a.validationMessage,s=[a.validationMessage];else{let t=o(e,Array.from(r.current.fields.values()).reduce((e,t)=>(t.name&&(e[t.name]=t.getValue()),e),{}));null!==(n="object"==typeof t&&null!==t&&"then"in t?await t:t)?(d.valid=!1,d.customError=!0,Array.isArray(n)?(s=n,a.setCustomValidity(n.join("\n"))):n&&(s=[n],a.setCustomValidity(n))):f&&(a.setCustomValidity(""),d.customError=!1,a.validationMessage?(i=a.validationMessage,s=[a.validationMessage]):a.validity.valid&&!d.valid&&(d.valid=!0))}let b={value:e,state:d,error:i??(Array.isArray(n)?n[0]:n??""),errors:s,initialValue:c.initialValue};if(R){let e=r.current.fields.get(R);e&&r.current.fields.set(R,{...e,...p(b,v)})}u(b)}),S=t.useCallback((e={})=>(0,s.mergeProps)(E,!1===C.valid?{"aria-invalid":!0}:b.EMPTY_OBJECT,e),[E,C.valid]),L=t.useCallback((e={})=>(0,s.mergeProps)({onChange(e){if(e.nativeEvent.defaultPrevented)return;if(a(h),!x())return void M(e.currentTarget.value,!0);let t=e.currentTarget;""===t.value?M(t.value):(I.clear(),f?I.start(f,()=>{M(t.value)}):M(t.value))}},S(e)),[S,a,h,I,M,f,x]);return t.useMemo(()=>({getValidationProps:S,getInputValidationProps:L,inputRef:T,commit:M}),[S,L,M])}({setValidityData:ee,validate:A,validityData:$,validationDebounceTime:I,invalid:Z,markedDirtyRef:z,state:ei,name:M,shouldValidateOnChange:Q}),el=t.useCallback(()=>{z.current=!0,er.commit($.value)},[er,$]),ea=function(e){let{commit:r,invalid:l,markedDirtyRef:a,name:u,setValidityData:s,validityData:o}=e,{formRef:d}=(0,n.useFormContext)(),c=t.useRef(null),f=t.useRef(null),v=t.useRef(null),b=(0,i.useStableCallback)(()=>{let e=f.current;if(e)return e.getValue?e.getValue():e.value}),g=(0,i.useStableCallback)((e=!0)=>{let t=f.current;if(!t)return;let i=t.value;void 0===i&&(i=b()),a.current=!0,e?y.flushSync(()=>r(i)):r(i)});function m(e=f.current?.id){e&&d.current.fields.delete(e)}return(0,C.useIsoLayoutEffect)(()=>{let e=f.current;e&&e.id&&d.current.fields.set(e.id,{getValue:b,name:u,controlRef:e.controlRef??v,validityData:p(o,l),validate:g})},[d,b,l,u,g,o]),(0,C.useIsoLayoutEffect)(()=>{let e=d.current.fields;return()=>{let t=f.current?.id;t&&e.delete(t)}},[d]),(0,i.useStableCallback)((e,t)=>{let i;if(!t){c.current===e&&(c.current=null,m(),f.current=null);return}let r=f.current?.id;c.current=e,f.current=t,r&&r!==t.id&&m(r),function(){let e=f.current;if(!e)return;let t=e.value;void 0===t&&(t=b()),null===o.initialValue&&null!==t&&s(e=>({...e,initialValue:t}))}(),(i=f.current)&&i.id&&d.current.fields.set(i.id,{getValue:b,name:u,controlRef:i.controlRef??v,validityData:p(o,l),validate:g})})}({commit:er.commit,invalid:Z,markedDirtyRef:z,name:M,setValidityData:ee,validityData:$});t.useImperativeHandle(V,()=>({validate:el}),[el]);let en=t.useMemo(()=>({invalid:Z,name:M,validityData:$,setValidityData:ee,disabled:w,touched:W,setTouched:G,dirty:K,setDirty:q,filled:B,setFilled:Y,focused:J,setFocused:H,validate:A,validationMode:T,validationDebounceTime:I,shouldValidateOnChange:Q,state:ei,markedDirtyRef:z,registerFieldControl:ea,validation:er}),[Z,M,$,w,W,G,K,q,B,Y,J,H,A,T,I,Q,ei,ea,er]),eu=(0,v.useRenderElement)("div",e,{ref:u,state:ei,props:P,stateAttributesMapping:l.fieldValidityMapping});return(0,c.jsx)(r.FieldRootContext.Provider,{value:en,children:eu})}),x=t.forwardRef(function(e,t){return(0,c.jsx)(f,{children:(0,c.jsx)(h,{...e,ref:t})})});e.s(["FieldRoot",0,x],84987);var R=e.i(92615),E=e.i(526850),I=e.i(410421),T=e.i(559713);function M(e={}){let{id:t,fallbackControlId:r,native:l=!1,setLabelId:a,focusControl:n}=e,{controlId:u,setLabelId:s}=(0,d.useLabelableContext)(),o=(0,i.useStableCallback)(e=>{s(e),a?.(e)}),c=(0,T.useRegisteredLabelId)(t,o),f=u??r;function v(e){let t=(0,I.getTarget)(e.nativeEvent);t?.closest("button,input,select,textarea")||(!e.defaultPrevented&&e.detail>1&&e.preventDefault(),l||function(e){if(n)return n(e,f);if(!f)return;let t=(0,E.ownerDocument)(e.currentTarget).getElementById(f);(0,R.isHTMLElement)(t)&&S(t)}(e))}return l?{id:c,htmlFor:f??void 0,onMouseDown:v}:{id:c,onClick:v,onPointerDown(e){e.preventDefault()}}}function S(e){e.focus({focusVisible:!0})}e.s(["focusElementWithVisible",0,S,"useLabel",0,M],213700);let L=t.forwardRef(function(e,i){let{render:a,className:n,style:u,id:s,nativeLabel:o=!0,...c}=e,f=(0,r.useFieldRootContext)(!1),{labelId:b}=(0,d.useLabelableContext)(),g=t.useRef(null),p=M({id:b??s,native:o});return(0,v.useRenderElement)("label",e,{ref:[i,g],state:f.state,props:[p,c],stateAttributesMapping:l.fieldValidityMapping})});e.s(["FieldLabel",0,L],262407);var O=e.i(273598),F=e.i(282458),V=e.i(254891);let k={...l.fieldValidityMapping,...F.transitionStatusMapping},P=t.forwardRef(function(e,i){let{render:l,id:a,className:u,match:s,style:f,...b}=e,g=(0,o.useBaseUiId)(a),{validityData:p,state:m,name:y}=(0,r.useFieldRootContext)(!1),{setMessageIds:h}=(0,d.useLabelableContext)(),{errors:x}=(0,n.useFormContext)(),R=y?x[y]:null,E="string"==typeof s,I=!1;I=!0===s||(E?!!p.state[s]:!!R||!1===p.state.valid);let{mounted:T,transitionStatus:M,setMounted:S}=(0,V.useTransitionStatus)(I);(0,C.useIsoLayoutEffect)(()=>{if(I&&g)return h(e=>e.concat(g)),()=>{h(e=>e.filter(e=>e!==g))}},[I,g,h]);let L=t.useRef(null),[F,P]=t.useState(null),[D,A]=t.useState(null),w=p.errors.length>1?(0,c.jsx)("ul",{children:p.errors.map(e=>(0,c.jsx)("li",{children:e},e))}):p.error,j=E?w:R||w,N=p.error;null!=R?N=Array.isArray(R)?JSON.stringify(R):R:p.errors.length>1&&(N=JSON.stringify(p.errors)),I&&N!==D&&(A(N),P(j)),(0,O.useOpenChangeComplete)({open:I,ref:L,onComplete(){I||S(!1)}});let _={...m,transitionStatus:M},U=(0,v.useRenderElement)("div",e,{ref:[i,L],state:_,props:[{id:g,children:I?j:F},b],stateAttributesMapping:k,enabled:T});return T?U:null});e.s(["FieldError",0,P],987854);let D=t.forwardRef(function(e,t){let{render:i,id:a,className:n,style:u,...s}=e,c=(0,o.useBaseUiId)(a),f=(0,r.useFieldRootContext)(!1),{setMessageIds:b}=(0,d.useLabelableContext)();return(0,C.useIsoLayoutEffect)(()=>{if(c)return b(e=>e.concat(c)),()=>{b(e=>e.filter(e=>e!==c))}},[c,b]),(0,v.useRenderElement)("p",e,{ref:t,state:f.state,props:[{id:c},s],stateAttributesMapping:l.fieldValidityMapping})});e.s(["FieldDescription",0,D],781406)},535270,e=>{"use strict";var t=e.i(764556);e.s(["useControlled",0,function({controlled:e,default:i,name:r,state:l="value"}){let{current:a}=t.useRef(void 0!==e),[n,u]=t.useState(i),s=t.useCallback(e=>{a||u(e)},[]);return[a?e:n,s]}])},975698,e=>{"use strict";var t=e.i(764556),i=e.i(277642),r=e.i(125231);e.s(["useRegisterFieldControl",0,function(e,l){let{enabled:a=!0,getValue:n,id:u,value:s}=l,{registerFieldControl:o}=(0,r.useFieldRootContext)(),d=t.useRef(null);d.current||(d.current=Symbol()),(0,i.useIsoLayoutEffect)(()=>{let t=d.current;if(t&&a)return o(t,{controlRef:e,getValue:n,id:u,value:s}),()=>{o(t,void 0)}},[e,a,n,u,o,s])}])},575665,e=>{"use strict";var t=e.i(764556),i=e.i(277642),r=e.i(29905),l=e.i(549154),a=e.i(92615),n=e.i(863728),u=e.i(139236),s=e.i(443124);e.s(["useLabelableId",0,function(e={}){let{id:o,implicit:d=!1,controlRef:c}=e,{controlId:f,registerControlId:v}=(0,s.useLabelableContext)(),b=(0,u.useBaseUiId)(o),g=d?f:void 0,p=(0,l.useRefWithInit)(()=>Symbol("labelable-control")),m=t.useRef(!1),y=t.useRef(null!=o),C=(0,r.useStableCallback)(()=>{m.current&&v!==n.NOOP&&(m.current=!1,v(p.current,void 0))});return(0,i.useIsoLayoutEffect)(()=>{let e;if(v!==n.NOOP){if(d){let t=c?.current;e=(0,a.isElement)(t)&&null!=t.closest("label")?o??null:g??b}else if(null!=o)y.current=!0,e=o;else{if(!y.current)return void C();e=b}if(void 0===e)return void C();m.current=!0,v(p.current,e)}},[o,c,g,v,d,b,p,C]),t.useEffect(()=>C,[C]),f??b}])},681622,e=>{"use strict";var t=e.i(344180);e.i(8890);var i=e.i(764556);e.i(636707);var r=e.i(84987),l=e.i(262407),a=e.i(987854),n=e.i(781406),u=e.i(535270),s=e.i(277642),o=e.i(526850),d=e.i(29905),c=e.i(125231),f=e.i(975698),v=e.i(443124),b=e.i(575665),g=e.i(438904),p=e.i(969490),m=e.i(602453),y=e.i(742665),C=e.i(410421);let h=i.forwardRef(function(e,t){let{render:r,className:l,id:a,name:n,value:h,disabled:x=!1,onValueChange:R,defaultValue:E,autoFocus:I=!1,style:T,...M}=e,{state:S,name:L,disabled:O,setTouched:F,setDirty:V,validityData:k,setFocused:P,setFilled:D,validationMode:A,validation:w}=(0,c.useFieldRootContext)(),j=O||x,N={...S,disabled:j},{labelId:_}=(0,v.useLabelableContext)(),U=(0,b.useLabelableId)({id:a});(0,s.useIsoLayoutEffect)(()=>{let e=null!=h;w.inputRef.current?.value||e&&""!==h?D(!0):e&&""===h&&D(!1)},[w.inputRef,D,h]);let B=i.useRef(null);(0,s.useIsoLayoutEffect)(()=>{I&&B.current===(0,C.activeElement)((0,o.ownerDocument)(B.current))&&P(!0)},[I,P]);let[Y]=(0,u.useControlled)({controlled:h,default:E,name:"FieldControl",state:"value"}),J=void 0!==h,H=J?Y:void 0,K=(0,d.useStableCallback)(()=>w.inputRef.current?.value);return(0,f.useRegisterFieldControl)(w.inputRef,{id:U,value:H,getValue:K}),(0,p.useRenderElement)("input",e,{ref:[t,B],state:N,props:[{id:U,disabled:j,name:L??n,ref:w.inputRef,"aria-labelledby":_,autoFocus:I,...J?{value:H}:{defaultValue:E},onChange(e){let t=e.currentTarget.value;R?.(t,(0,m.createChangeEventDetails)(y.REASONS.none,e.nativeEvent)),V(t!==k.initialValue),D(""!==t)},onFocus(){P(!0)},onBlur(e){F(!0),P(!1),"onBlur"===A&&w.commit(e.currentTarget.value)},onKeyDown(e){"INPUT"===e.currentTarget.tagName&&"Enter"===e.key&&(F(!0),w.commit(e.currentTarget.value))}},w.getInputValidationProps(),M],stateAttributesMapping:g.fieldValidityMapping})});var x=e.i(2602),R=e.i(254891);let E=i.createContext({disabled:!1});var I=e.i(593947),T=e.i(267805);let M=i.createContext(void 0),S=i.forwardRef(function(e,r){let{render:l,className:a,style:n,disabled:u=!1,...s}=e,{state:o,disabled:d}=(0,c.useFieldRootContext)(!1),f=d||u,v=function(e=!0){let t=i.useContext(M);if(void 0===t&&!e)throw Error((0,T.default)(3));return t}(),b=v?.parent.id,m=v?.allValues!==void 0,y=i.useMemo(()=>({disabled:f}),[f]),C=(0,p.useRenderElement)("div",e,{ref:r,state:o,props:s,stateAttributesMapping:g.fieldValidityMapping});return(0,t.jsx)(I.LabelableProvider,{controlId:m?b:void 0,children:(0,t.jsx)(E.Provider,{value:y,children:C})})});e.s(["Control",0,h,"Description",()=>n.FieldDescription,"Error",()=>a.FieldError,"Item",0,S,"Label",()=>l.FieldLabel,"Root",()=>r.FieldRoot,"Validity",0,function(e){let{children:r}=e,{validityData:l,invalid:a}=(0,c.useFieldRootContext)(!1),n=i.useMemo(()=>(0,x.getCombinedFieldValidityData)(l,a),[l,a]),u=!1===n.state.valid,{transitionStatus:s}=(0,R.useTransitionStatus)(u),o=i.useMemo(()=>({...n,validity:n.state,transitionStatus:s}),[n,s]);return(0,t.jsx)(i.Fragment,{children:r(o)})}],906646);var L=e.i(906646),L=L;let O=i.forwardRef(function(e,i){return(0,t.jsx)(L.Control,{ref:i,...e})});var F=e.i(465458);e.s(["Input",0,function({className:e,type:i,...r}){return(0,t.jsx)(O,{type:i,"data-slot":"input",className:(0,F.cn)("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...r})}],681622)},953700,e=>{"use strict";let t=(0,e.i(433721).default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["Plus",0,t],953700)},137340,288556,e=>{"use strict";let t=(0,e.i(433721).default)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);e.s(["default",0,t],288556),e.s(["Trash2",0,t],137340)},562918,928542,e=>{"use strict";var t=e.i(370383),i=e.i(969490);function r(e){return(0,i.useRenderElement)(e.defaultTagName??"div",e,e)}e.s(["useRender",0,r],928542);var l=e.i(294237),a=e.i(465458);let n=(0,l.cva)("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});e.s(["Badge",0,function({className:e,variant:i="default",render:l,...u}){return r({defaultTagName:"span",props:(0,t.mergeProps)({className:(0,a.cn)(n({variant:i}),e)},u),render:l,state:{slot:"badge",variant:i}})}],562918)}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,212965,250438,e=>{"use strict";let t=(0,e.i(433721).default)("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);e.s(["ArrowDown",0,t],212965);var r=e.i(558680);e.s(["ChevronDownIcon",()=>r.default],250438)},817854,e=>{"use strict";var t=e.i(344180),r=e.i(465458);e.s(["Label",0,function({className:e,...a}){return(0,t.jsx)("label",{"data-slot":"label",className:(0,r.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...a})}])},161610,321137,e=>{"use strict";function t(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function r(e,t){var r=Object.create(e.prototype);for(var a in t)r[a]=t[a];return r}function a(){}var n="\\s*([+-]?\\d+)\\s*",i="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",o="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",s=/^#([0-9a-f]{3,8})$/,f=RegExp(`^rgb\\(${n},${n},${n}\\)$`),u=RegExp(`^rgb\\(${o},${o},${o}\\)$`),l=RegExp(`^rgba\\(${n},${n},${n},${i}\\)$`),d=RegExp(`^rgba\\(${o},${o},${o},${i}\\)$`),c=RegExp(`^hsl\\(${i},${o},${o}\\)$`),h=RegExp(`^hsla\\(${i},${o},${o},${i}\\)$`),g={aliceblue:0xf0f8ff,antiquewhite:0xfaebd7,aqua:65535,aquamarine:8388564,azure:0xf0ffff,beige:0xf5f5dc,bisque:0xffe4c4,black:0,blanchedalmond:0xffebcd,blue:255,blueviolet:9055202,brown:0xa52a2a,burlywood:0xdeb887,cadetblue:6266528,chartreuse:8388352,chocolate:0xd2691e,coral:0xff7f50,cornflowerblue:6591981,cornsilk:0xfff8dc,crimson:0xdc143c,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:0xb8860b,darkgray:0xa9a9a9,darkgreen:25600,darkgrey:0xa9a9a9,darkkhaki:0xbdb76b,darkmagenta:9109643,darkolivegreen:5597999,darkorange:0xff8c00,darkorchid:0x9932cc,darkred:9109504,darksalmon:0xe9967a,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:0xff1493,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:0xb22222,floralwhite:0xfffaf0,forestgreen:2263842,fuchsia:0xff00ff,gainsboro:0xdcdcdc,ghostwhite:0xf8f8ff,gold:0xffd700,goldenrod:0xdaa520,gray:8421504,green:32768,greenyellow:0xadff2f,grey:8421504,honeydew:0xf0fff0,hotpink:0xff69b4,indianred:0xcd5c5c,indigo:4915330,ivory:0xfffff0,khaki:0xf0e68c,lavender:0xe6e6fa,lavenderblush:0xfff0f5,lawngreen:8190976,lemonchiffon:0xfffacd,lightblue:0xadd8e6,lightcoral:0xf08080,lightcyan:0xe0ffff,lightgoldenrodyellow:0xfafad2,lightgray:0xd3d3d3,lightgreen:9498256,lightgrey:0xd3d3d3,lightpink:0xffb6c1,lightsalmon:0xffa07a,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:0xb0c4de,lightyellow:0xffffe0,lime:65280,limegreen:3329330,linen:0xfaf0e6,magenta:0xff00ff,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:0xba55d3,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:0xc71585,midnightblue:1644912,mintcream:0xf5fffa,mistyrose:0xffe4e1,moccasin:0xffe4b5,navajowhite:0xffdead,navy:128,oldlace:0xfdf5e6,olive:8421376,olivedrab:7048739,orange:0xffa500,orangered:0xff4500,orchid:0xda70d6,palegoldenrod:0xeee8aa,palegreen:0x98fb98,paleturquoise:0xafeeee,palevioletred:0xdb7093,papayawhip:0xffefd5,peachpuff:0xffdab9,peru:0xcd853f,pink:0xffc0cb,plum:0xdda0dd,powderblue:0xb0e0e6,purple:8388736,rebeccapurple:6697881,red:0xff0000,rosybrown:0xbc8f8f,royalblue:4286945,saddlebrown:9127187,salmon:0xfa8072,sandybrown:0xf4a460,seagreen:3050327,seashell:0xfff5ee,sienna:0xa0522d,silver:0xc0c0c0,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:0xfffafa,springgreen:65407,steelblue:4620980,tan:0xd2b48c,teal:32896,thistle:0xd8bfd8,tomato:0xff6347,turquoise:4251856,violet:0xee82ee,wheat:0xf5deb3,white:0xffffff,whitesmoke:0xf5f5f5,yellow:0xffff00,yellowgreen:0x9acd32};function x(){return this.rgb().formatHex()}function b(){return this.rgb().formatRgb()}function p(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=s.exec(e))?(r=t[1].length,t=parseInt(t[1],16),6===r?m(t):3===r?new v(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===r?y(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===r?y(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=f.exec(e))?new v(t[1],t[2],t[3],1):(t=u.exec(e))?new v(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=l.exec(e))?y(t[1],t[2],t[3],t[4]):(t=d.exec(e))?y(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=c.exec(e))?j(t[1],t[2]/100,t[3]/100,1):(t=h.exec(e))?j(t[1],t[2]/100,t[3]/100,t[4]):g.hasOwnProperty(e)?m(g[e]):"transparent"===e?new v(NaN,NaN,NaN,0):null}function m(e){return new v(e>>16&255,e>>8&255,255&e,1)}function y(e,t,r,a){return a<=0&&(e=t=r=NaN),new v(e,t,r,a)}function w(e,t,r,n){var i;return 1==arguments.length?((i=e)instanceof a||(i=p(i)),i)?new v((i=i.rgb()).r,i.g,i.b,i.opacity):new v:new v(e,t,r,null==n?1:n)}function v(e,t,r,a){this.r=+e,this.g=+t,this.b=+r,this.opacity=+a}function $(){return`#${A(this.r)}${A(this.g)}${A(this.b)}`}function N(){let e=k(this.opacity);return`${1===e?"rgb(":"rgba("}${M(this.r)}, ${M(this.g)}, ${M(this.b)}${1===e?")":`, ${e})`}`}function k(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function M(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function A(e){return((e=M(e))<16?"0":"")+e.toString(16)}function j(e,t,r,a){return a<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new q(e,t,r,a)}function R(e){if(e instanceof q)return new q(e.h,e.s,e.l,e.opacity);if(e instanceof a||(e=p(e)),!e)return new q;if(e instanceof q)return e;var t=(e=e.rgb()).r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),o=Math.max(t,r,n),s=NaN,f=o-i,u=(o+i)/2;return f?(s=t===o?(r-n)/f+(r<n)*6:r===o?(n-t)/f+2:(t-r)/f+4,f/=u<.5?o+i:2-o-i,s*=60):f=u>0&&u<1?0:s,new q(s,f,u,e.opacity)}function q(e,t,r,a){this.h=+e,this.s=+t,this.l=+r,this.opacity=+a}function C(e){return(e=(e||0)%360)<0?e+360:e}function E(e){return Math.max(0,Math.min(1,e||0))}function H(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}t(a,p,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:x,formatHex:x,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return R(this).formatHsl()},formatRgb:b,toString:b}),t(v,w,r(a,{brighter(e){return e=null==e?1.4285714285714286:Math.pow(1.4285714285714286,e),new v(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new v(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new v(M(this.r),M(this.g),M(this.b),k(this.opacity))},displayable(){return -.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:$,formatHex:$,formatHex8:function(){return`#${A(this.r)}${A(this.g)}${A(this.b)}${A((isNaN(this.opacity)?1:this.opacity)*255)}`},formatRgb:N,toString:N})),t(q,function(e,t,r,a){return 1==arguments.length?R(e):new q(e,t,r,null==a?1:a)},r(a,{brighter(e){return e=null==e?1.4285714285714286:Math.pow(1.4285714285714286,e),new q(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new q(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,a=r+(r<.5?r:1-r)*t,n=2*r-a;return new v(H(e>=240?e-240:e+120,n,a),H(e,n,a),H(e<120?e+240:e-120,n,a),this.opacity)},clamp(){return new q(C(this.h),E(this.s),E(this.l),k(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=k(this.opacity);return`${1===e?"hsl(":"hsla("}${C(this.h)}, ${100*E(this.s)}%, ${100*E(this.l)}%${1===e?")":`, ${e})`}`}})),e.s(["default",0,p,"rgb",0,w],321137),e.s(["color",0,p],161610)},145665,181503,e=>{"use strict";var t=e.i(321137);function r(e,t,r,a,n){var i=e*e,o=i*e;return((1-3*e+3*i-o)*t+(4-6*i+3*o)*r+(1+3*e+3*i-3*o)*a+o*n)/6}let a=e=>()=>e;function n(e,t){var r=t-e;return r?function(t){return e+t*r}:a(isNaN(e)?t:e)}e.s(["default",0,a],181503);let i=function e(r){var i,o=1==(i=+r)?n:function(e,t){var r,n,o;return t-e?(r=e,n=t,r=Math.pow(r,o=i),n=Math.pow(n,o)-r,o=1/o,function(e){return Math.pow(r+e*n,o)}):a(isNaN(e)?t:e)};function s(e,r){var a=o((e=(0,t.rgb)(e)).r,(r=(0,t.rgb)(r)).r),i=o(e.g,r.g),s=o(e.b,r.b),f=n(e.opacity,r.opacity);return function(t){return e.r=a(t),e.g=i(t),e.b=s(t),e.opacity=f(t),e+""}}return s.gamma=e,s}(1);function o(e){return function(r){var a,n,i=r.length,o=Array(i),s=Array(i),f=Array(i);for(a=0;a<i;++a)n=(0,t.rgb)(r[a]),o[a]=n.r||0,s[a]=n.g||0,f[a]=n.b||0;return o=e(o),s=e(s),f=e(f),n.opacity=1,function(e){return n.r=o(e),n.g=s(e),n.b=f(e),n+""}}}o(function(e){var t=e.length-1;return function(a){var n=a<=0?a=0:a>=1?(a=1,t-1):Math.floor(a*t),i=e[n],o=e[n+1],s=n>0?e[n-1]:2*i-o,f=n<t-1?e[n+2]:2*o-i;return r((a-n/t)*t,s,i,o,f)}}),o(function(e){var t=e.length;return function(a){var n=Math.floor(((a%=1)<0?++a:a)*t),i=e[(n+t-1)%t],o=e[n%t],s=e[(n+1)%t],f=e[(n+2)%t];return r((a-n/t)*t,i,o,s,f)}}),e.s(["default",0,i],145665)},819505,238816,97376,e=>{"use strict";e.s(["genericArray",()=>r],819505);var t=e.i(213570);function r(e,r){var a,n=r?r.length:0,i=e?Math.min(n,e.length):0,o=Array(i),s=Array(n);for(a=0;a<i;++a)o[a]=(0,t.default)(e[a],r[a]);for(;a<n;++a)s[a]=r[a];return function(e){for(a=0;a<i;++a)s[a]=o[a](e);return s}}e.s(["default",0,function(e,t){t||(t=[]);var r,a=e?Math.min(t.length,e.length):0,n=t.slice();return function(i){for(r=0;r<a;++r)n[r]=e[r]*(1-i)+t[r]*i;return n}},"isNumberArray",0,function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}],238816),e.s(["default",0,function(e,t){var r=new Date;return e*=1,t*=1,function(a){return r.setTime(e*(1-a)+t*a),r}}],97376)},842541,e=>{"use strict";e.s(["default",0,function(e,t){return e*=1,t*=1,function(r){return e*(1-r)+t*r}}])},905660,e=>{"use strict";e.s(["default",()=>r]);var t=e.i(213570);function r(e,r){var a,n={},i={};for(a in(null===e||"object"!=typeof e)&&(e={}),(null===r||"object"!=typeof r)&&(r={}),r)a in e?n[a]=(0,t.default)(e[a],r[a]):i[a]=r[a];return function(e){for(a in n)i[a]=n[a](e);return i}}},647483,e=>{"use strict";var t=e.i(842541),r=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,a=RegExp(r.source,"g");e.s(["default",0,function(e,n){var i,o,s,f,u,l=r.lastIndex=a.lastIndex=0,d=-1,c=[],h=[];for(e+="",n+="";(s=r.exec(e))&&(f=a.exec(n));)(u=f.index)>l&&(u=n.slice(l,u),c[d]?c[d]+=u:c[++d]=u),(s=s[0])===(f=f[0])?c[d]?c[d]+=f:c[++d]=f:(c[++d]=null,h.push({i:d,x:(0,t.default)(s,f)})),l=a.lastIndex;return l<n.length&&(u=n.slice(l),c[d]?c[d]+=u:c[++d]=u),c.length<2?h[0]?(i=h[0].x,function(e){return i(e)+""}):(o=n,function(){return o}):(n=h.length,function(e){for(var t,r=0;r<n;++r)c[(t=h[r]).i]=t.x(e);return c.join("")})}])},678152,213570,e=>{"use strict";e.s(["default",()=>l],213570);var t=e.i(161610),r=e.i(145665),a=e.i(819505),n=e.i(97376),i=e.i(842541),o=e.i(905660),s=e.i(647483),f=e.i(181503),u=e.i(238816);function l(e,l){var d,c=typeof l;return null==l||"boolean"===c?(0,f.default)(l):("number"===c?i.default:"string"===c?(d=(0,t.color)(l))?(l=d,r.default):s.default:l instanceof t.color?r.default:l instanceof Date?n.default:(0,u.isNumberArray)(l)?u.default:Array.isArray(l)?a.genericArray:"function"!=typeof l.valueOf&&"function"!=typeof l.toString||isNaN(l)?o.default:i.default)(e,l)}e.s(["interpolate",0,l],678152)},77075,e=>{"use strict";var t=e.i(842541);e.s(["interpolateNumber",()=>t.default])},212603,e=>{"use strict";var t=e.i(344180),r=e.i(465458);e.s(["Card",0,function({className:e,size:a="default",...n}){return(0,t.jsx)("div",{"data-slot":"card","data-size":a,className:(0,r.cn)("group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",e),...n})},"CardContent",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-content",className:(0,r.cn)("px-4 group-data-[size=sm]/card:px-3",e),...a})},"CardDescription",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-description",className:(0,r.cn)("text-sm text-muted-foreground",e),...a})},"CardHeader",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-header",className:(0,r.cn)("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3",e),...a})},"CardTitle",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-title",className:(0,r.cn)("font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",e),...a})}])}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,523592,e=>{"use strict";var t=e.i(8890);let r="agent-spaces-servers",a="agent-spaces-active-server",n="active-server";function s(){let e=t.default.env.NEXT_PUBLIC_SERVER_URL?.trim();if(e)return e.replace(/\/$/,"");let{hostname:r,port:a}=window.location;return"tauri.localhost"===r||r.endsWith(".tauri.localhost")?"http://localhost:3100":("localhost"===r||"127.0.0.1"===r)&&"3000"===a?`http://${r}:3100`:window.location.origin}let i=[{id:"default",name:"Default",url:s()}];function o(){try{let e=localStorage.getItem(r);return e?JSON.parse(e).map(e=>"default"!==e.id||e.url?e:{...e,url:s()}):i}catch{return i}}function l(){return localStorage.getItem(a)||"default"}function d(){let e=o(),t=l();return e.find(e=>e.id===t)||e[0]||null}e.s(["getActiveServer",0,d,"getActiveServerUrl",0,function(){return d()?.url??null},"loadActiveId",0,l,"loadServers",0,o,"saveActiveId",0,function(e){localStorage.setItem(a,e)},"saveServers",0,function(e){localStorage.setItem(r,JSON.stringify(e))},"setActiveServerCookie",0,function(e){e?document.cookie=`${n}=${encodeURIComponent(e)}; path=/; max-age=31536000; SameSite=Lax`:document.cookie=`${n}=; path=/; max-age=0`}])},344118,50153,e=>{"use strict";let t=(0,e.i(433721).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["default",0,t],50153),e.s(["Check",0,t],344118)},355819,e=>{"use strict";let t=(0,e.i(816709).create)((e,t)=>({agents:[],loaded:!1,loading:!1,ensure:async()=>{let{loaded:r,loading:a}=t();if(!r&&!a){e({loading:!0});try{let t=await fetch("/api/agents/presets");if(!t.ok)return;let r=await t.json();e({agents:r,loaded:!0})}catch{}finally{e({loading:!1})}}},toggleEnabled:async r=>{let a=t().agents.find(e=>e.id===r);if(!a)return;let n=!a.enabled;e(e=>({agents:e.agents.map(e=>e.id===r?{...e,enabled:n}:e)}));try{(await fetch(`/api/agents/presets/${r}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({...a,enabled:n})})).ok||e(e=>({agents:e.agents.map(e=>e.id===r?{...e,enabled:a.enabled}:e)}))}catch{e(e=>({agents:e.agents.map(e=>e.id===r?{...e,enabled:a.enabled}:e)}))}}}));e.s(["findAgentById",0,function(e){return t.getState().agents.find(t=>t.id===e)},"useAgentStore",0,t])},942917,e=>{"use strict";let t=(0,e.i(433721).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["default",0,t])},972846,e=>{"use strict";var t=e.i(912248);e.s(["X",()=>t.default])},451534,680422,e=>{"use strict";let t=(0,e.i(433721).default)("folder-open",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);e.s(["default",0,t],680422),e.s(["FolderOpen",0,t],451534)},193251,e=>{"use strict";let t=(0,e.i(433721).default)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);e.s(["Download",0,t],193251)},411649,e=>{"use strict";let t=(0,e.i(433721).default)("house",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]]);e.s(["Home",0,t],411649)},62669,e=>{"use strict";let t=(0,e.i(433721).default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);e.s(["Loader2",0,t],62669)},511800,612505,e=>{"use strict";let t=(0,e.i(433721).default)("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);e.s(["default",0,t],612505),e.s(["AlertCircle",0,t],511800)},550080,e=>{"use strict";var t=e.i(144988);e.s(["File",()=>t.default])},220336,e=>{"use strict";let t=(0,e.i(433721).default)("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);e.s(["default",0,t])},973370,e=>{"use strict";var t=e.i(220336);e.s(["Folder",()=>t.default])},992764,e=>{"use strict";var t=e.i(942917);e.s(["ChevronRight",()=>t.default])},378371,e=>{"use strict";let t=(0,e.i(433721).default)("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);e.s(["ArrowUp",0,t],378371)},434805,660748,e=>{"use strict";var t,r=e.i(344180),a=e.i(764556),n=e.i(244073),s=e.i(550080),i=e.i(973370),o=e.i(451534),l=e.i(992764),d=e.i(378371),c=e.i(411649),u=e.i(62669),m=e.i(433721);let h=(0,m.default)("folder-plus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);var p=e.i(344118),f=e.i(972846);let g=(0,m.default)("shield-check",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),x=(0,m.default)("shield-alert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]),b=(0,m.default)("shield-off",[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71",key:"1jlk70"}],["path",{d:"M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264",key:"18rp1v"}]]);var y=e.i(465458);e.s(["FolderPicker",0,function({value:e,onChange:t,className:m,placeholder:v="/path/to/project",allowFiles:j=!1,fileFilter:k}){let[w,N]=(0,a.useState)(!1),[C,M]=(0,a.useState)(e||""),[S,D]=(0,a.useState)([]),[F,P]=(0,a.useState)([]),W=(0,n.useTranslations)("folderPicker"),[z,T]=(0,a.useState)(null),[A,R]=(0,a.useState)(!1),[I,O]=(0,a.useState)(""),[E,H]=(0,a.useState)(!1),[L,U]=(0,a.useState)(""),[J,V]=(0,a.useState)(null),[$,B]=(0,a.useState)(!1),q=(0,a.useRef)(null),X=(0,a.useRef)(null),Y=(0,a.useRef)(null),K=(0,a.useCallback)(async e=>{if(!e)return void V(null);B(!0);try{let t=await fetch(`/api/folder/check-permissions?path=${encodeURIComponent(e)}`);if(!t.ok)return void V(null);let r=await t.json();V(r)}catch{V(null)}finally{B(!1)}},[]),Q=(0,a.useCallback)(async e=>{R(!0),O("");try{let t=`/api/folder/browse?path=${encodeURIComponent(e)}`;j&&(t+="&files=1",k&&(t+=`&fileFilter=${encodeURIComponent(k)}`));let r=await fetch(t);if(!r.ok)throw Error((await r.json()).error||"Failed to browse");let a=await r.json();M(a.path),D(a.directories),P(a.files??[]),T(a.parent),K(a.path)}catch(e){O(e.message)}finally{R(!1)}},[K,j,k]);(0,a.useEffect)(()=>{w&&Q(e||"")},[w]),(0,a.useEffect)(()=>{E&&Y.current&&Y.current.focus()},[E]);let G=e=>{Q(e)},_=async()=>{let e=L.trim();if(!e)return;let r=C.includes("/")?"/":"\\",a=C?`${C}${r}${e}`:e;try{let e=await fetch("/api/folder/create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:a})});if(!e.ok)throw Error((await e.json()).error||"Failed to create folder");H(!1),U(""),t(a),M(a),N(!1)}catch(e){O(e.message)}},Z=S.length>0||F.length>0;return(0,r.jsxs)("div",{className:(0,y.cn)("relative",m),children:[(0,r.jsxs)("div",{className:"flex gap-1.5",children:[(0,r.jsx)("input",{className:"flex-1 rounded-xl border border-border bg-background px-4 py-2.5 text-sm outline-none focus:border-primary focus:ring-2 focus:ring-primary/20 transition-all",placeholder:v,value:e,onChange:e=>{t(e.target.value)},onKeyDown:t=>{"Enter"===t.key&&(t.preventDefault(),Q(e))},ref:q}),(0,r.jsxs)("button",{type:"button",onClick:()=>{w?(N(!1),H(!1),U("")):N(!0)},className:(0,y.cn)("flex items-center gap-1.5 rounded-xl border px-3 py-2.5 text-sm transition-colors",w?"border-primary bg-primary/5 text-primary":"border-border bg-background text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:[(0,r.jsx)(o.FolderOpen,{className:"size-4"}),"Browse"]})]}),w&&(0,r.jsxs)("div",{className:"absolute left-0 right-0 top-full z-50 mt-1 flex flex-col rounded-xl border border-border bg-popover shadow-lg",style:{height:360},children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 border-b border-border px-3 py-2",children:[(0,r.jsx)("button",{type:"button",onClick:()=>G(""),className:"flex size-7 items-center justify-center rounded-md hover:bg-accent transition-colors",title:"Home",children:(0,r.jsx)(c.Home,{className:"size-3.5"})}),(0,r.jsx)("button",{type:"button",onClick:()=>{z&&Q(z)},className:"flex size-7 items-center justify-center rounded-md hover:bg-accent transition-colors",title:"Go up",children:(0,r.jsx)(d.ArrowUp,{className:"size-3.5"})}),(0,r.jsx)("div",{className:"flex-1 truncate rounded-md bg-muted px-2.5 py-1 text-xs text-muted-foreground font-mono",children:C}),(0,r.jsx)("button",{type:"button",onClick:()=>{H(!0),U("")},className:"flex size-7 items-center justify-center rounded-md hover:bg-accent transition-colors",title:W("newFolder"),children:(0,r.jsx)(h,{className:"size-3.5"})}),!j&&(0,r.jsx)("button",{type:"button",onClick:()=>{t(C),N(!1)},className:"rounded-lg bg-primary px-3 py-1 text-xs font-medium text-primary-foreground hover:bg-primary/90 transition-colors",children:W("select")})]}),E&&(0,r.jsxs)("div",{className:"flex items-center gap-1.5 border-b border-border px-3 py-1.5",children:[(0,r.jsx)(h,{className:"size-4 text-muted-foreground shrink-0"}),(0,r.jsx)("input",{ref:Y,className:"flex-1 rounded-md border border-border bg-background px-2 py-1 text-sm outline-none focus:border-primary",placeholder:W("folderNamePlaceholder"),value:L,onChange:e=>U(e.target.value),onKeyDown:e=>{"Enter"===e.key?(e.preventDefault(),_()):"Escape"===e.key&&(H(!1),U(""))}}),(0,r.jsx)("button",{type:"button",onClick:_,className:"flex size-6 items-center justify-center rounded-md hover:bg-accent transition-colors",disabled:!L.trim(),children:(0,r.jsx)(p.Check,{className:"size-3.5 text-primary"})}),(0,r.jsx)("button",{type:"button",onClick:()=>{H(!1),U("")},className:"flex size-6 items-center justify-center rounded-md hover:bg-accent transition-colors",children:(0,r.jsx)(f.X,{className:"size-3.5 text-muted-foreground"})})]}),(0,r.jsx)("div",{ref:X,className:"flex-1 overflow-y-auto p-1.5",children:A?(0,r.jsxs)("div",{className:"flex items-center justify-center py-8 text-muted-foreground",children:[(0,r.jsx)(u.Loader2,{className:"size-4 animate-spin mr-2"}),"Loading..."]}):I?(0,r.jsx)("div",{className:"px-3 py-8 text-center text-xs text-destructive",children:I}):Z?(0,r.jsxs)(r.Fragment,{children:[S.map(e=>(0,r.jsxs)("button",{type:"button",onClick:()=>G(e.path),onDoubleClick:()=>{t(e.path),N(!1)},className:"flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-sm hover:bg-accent transition-colors text-left",children:[(0,r.jsx)(i.Folder,{className:"size-4 text-muted-foreground shrink-0"}),(0,r.jsx)("span",{className:"flex-1 truncate",children:e.name}),(0,r.jsx)(l.ChevronRight,{className:"size-3 text-muted-foreground shrink-0"})]},e.path)),F.map(e=>(0,r.jsxs)("button",{type:"button",onClick:()=>{t(e.path),N(!1)},className:"flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-sm hover:bg-accent transition-colors text-left",children:[(0,r.jsx)(s.File,{className:"size-4 text-muted-foreground shrink-0"}),(0,r.jsx)("span",{className:"flex-1 truncate font-mono text-xs",children:e.name})]},e.path))]}):(0,r.jsx)("div",{className:"px-3 py-8 text-center text-xs text-muted-foreground",children:"No subdirectories"})}),(0,r.jsx)("div",{className:"border-t border-border px-3 py-1.5 flex items-center gap-2 text-xs",children:$?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(u.Loader2,{className:"size-3 animate-spin text-muted-foreground"}),(0,r.jsx)("span",{className:"text-muted-foreground",children:"Checking permissions..."})]}):J?(0,r.jsx)(r.Fragment,{children:J.readable&&J.writable?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(g,{className:"size-3.5 text-green-500"}),(0,r.jsx)("span",{className:"text-green-600 dark:text-green-400",children:"Read/Write"})]}):J.readable&&!J.writable?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(x,{className:"size-3.5 text-amber-500"}),(0,r.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:"Read-only — files cannot be written here"})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(b,{className:"size-3.5 text-destructive"}),(0,r.jsx)("span",{className:"text-destructive",children:J.error||"No access"})]})}):(0,r.jsx)("span",{className:"text-muted-foreground",children:W("selectDirectory")})})]})]})}],434805),e.s([],606106),e.i(606106),e.i(8890);var v=e.i(106045),j=e.i(236706),k=e.i(842809),w=e.i(969490),N=e.i(267805);let C=a.createContext(void 0);function M(){let e=a.useContext(C);if(void 0===e)throw Error((0,N.default)(51));return e}let S=((t={}).complete="data-complete",t.indeterminate="data-indeterminate",t.progressing="data-progressing",t),D={status:e=>"progressing"===e?{[S.progressing]:""}:"complete"===e?{[S.complete]:""}:"indeterminate"===e?{[S.indeterminate]:""}:null};function F(e,t){return null==t?"indeterminate progress":e||`${t}%`}let P=a.forwardRef(function(e,t){let{format:n,getAriaValueText:s=F,locale:i,max:o=100,min:l=0,value:d,render:c,className:u,children:m,style:h,...p}=e,[f,g]=a.useState(),x=(0,v.useValueAsRef)(n),b="indeterminate";Number.isFinite(d)&&(b=d===o?"complete":"progressing");let y=(0,k.formatNumberValue)(d,i,x.current),N=a.useMemo(()=>({status:b}),[b]),M={"aria-labelledby":f,"aria-valuemax":o,"aria-valuemin":l,"aria-valuenow":d??void 0,"aria-valuetext":s(y,d),role:"progressbar",children:(0,r.jsxs)(a.Fragment,{children:[m,(0,r.jsx)("span",{role:"presentation",style:j.visuallyHidden,children:"x"})]})},S=a.useMemo(()=>({formattedValue:y,max:o,min:l,setLabelId:g,state:N,status:b,value:d}),[y,o,l,g,N,b,d]),P=(0,w.useRenderElement)("div",e,{state:N,ref:t,props:[M,p],stateAttributesMapping:D});return(0,r.jsx)(C.Provider,{value:S,children:P})}),W=a.forwardRef(function(e,t){let{render:r,className:a,style:n,...s}=e,{state:i}=M();return(0,w.useRenderElement)("div",e,{state:i,ref:t,props:s,stateAttributesMapping:D})});var z=e.i(203922);let T=a.forwardRef(function(e,t){let{render:r,className:n,style:s,...i}=e,{max:o,min:l,value:d,state:c}=M(),u=Number.isFinite(d)&&null!==d?(0,z.valueToPercent)(d,l,o):null,m=a.useCallback(()=>null==u?{}:{insetInlineStart:0,height:"inherit",width:`${u}%`},[u]);return(0,w.useRenderElement)("div",e,{state:c,ref:t,props:[{style:m()},i],stateAttributesMapping:D})}),A=a.forwardRef(function(e,t){let{className:r,render:a,children:n,style:s,...i}=e,{value:o,formattedValue:l,state:d}=M(),c=null==o?"indeterminate":l,u=null==o?null:l;return(0,w.useRenderElement)("span",e,{state:d,ref:t,props:[{"aria-hidden":!0,children:"function"==typeof n?n(c,o):u},i],stateAttributesMapping:D})});var R=e.i(559713);let I=a.forwardRef(function(e,t){let{render:r,className:a,style:n,id:s,...i}=e,{setLabelId:o,state:l}=M(),d=(0,R.useRegisteredLabelId)(s,o);return(0,w.useRenderElement)("span",e,{state:l,ref:t,props:[{id:d,role:"presentation"},i],stateAttributesMapping:D})});e.s(["Indicator",0,T,"Label",0,I,"Root",0,P,"Track",0,W,"Value",0,A],729535);var O=e.i(729535),O=O;function E({className:e,...t}){return(0,r.jsx)(O.Track,{className:(0,y.cn)("relative flex h-1 w-full items-center overflow-x-hidden rounded-full bg-muted",e),"data-slot":"progress-track",...t})}function H({className:e,...t}){return(0,r.jsx)(O.Indicator,{"data-slot":"progress-indicator",className:(0,y.cn)("h-full bg-primary transition-all",e),...t})}e.s(["Progress",0,function({className:e,children:t,value:a,...n}){return(0,r.jsxs)(O.Root,{value:a,"data-slot":"progress",className:(0,y.cn)("flex flex-wrap gap-3",e),...n,children:[t,(0,r.jsx)(E,{children:(0,r.jsx)(H,{})})]})},"ProgressIndicator",0,H,"ProgressLabel",0,function({className:e,...t}){return(0,r.jsx)(O.Label,{className:(0,y.cn)("text-sm font-medium",e),"data-slot":"progress-label",...t})},"ProgressTrack",0,E],660748)},361031,e=>{"use strict";let t=(0,e.i(816709).create)(e=>({workspaces:[],setWorkspaces:t=>e({workspaces:t}),upsertWorkspace:t=>{e(e=>{let r=e.workspaces.findIndex(e=>e.id===t.id);if(-1===r)return{workspaces:[...e.workspaces,t]};let a=[...e.workspaces];return a[r]=t,{workspaces:a}})},removeWorkspace:t=>{e(e=>({workspaces:e.workspaces.filter(e=>e.id!==t)}))}}));e.s(["useWorkspaceStore",0,t])},524,e=>{"use strict";var t=e.i(344180),r=e.i(764556),a=e.i(209988),n=e.i(260218),s=e.i(355819),i=e.i(193251),o=e.i(62669),l=e.i(511800),d=e.i(434805),c=e.i(660748),u=e.i(244073);function m({open:e,onOpenChange:h,workspace:p,onSubmit:f}){let g=(0,u.useTranslations)("workspace"),x=(0,u.useTranslations)("common"),b=(0,s.useAgentStore)(e=>e.agents),[y,v]=(0,r.useState)(p?.name??""),[j,k]=(0,r.useState)(p?.boundDirs[0]??""),[w,N]=(0,r.useState)(!1),[C,M]=(0,r.useState)(!1),[S,D]=(0,r.useState)(""),[F,P]=(0,r.useState)(!1),[W,z]=(0,r.useState)(null),T=!!p,A=async()=>{if(y&&j){N(!0);try{await f({name:y,boundDirs:[j]}),h(!1)}finally{N(!1)}}},R=(0,r.useCallback)(async()=>{if(S&&j){P(!0),z(null);try{let e=await fetch("/api/workspaces/clone",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:S,targetDir:j})});if(!e.ok){let t=await e.json();z({phase:"error",progress:0,error:t.error||g("clone.cloneFailed")}),P(!1);return}let t=e.body?.getReader();if(!t){z({phase:"error",progress:0,error:g("clone.noResponseBody")}),P(!1);return}let r=new TextDecoder,a="";for(;;){let{done:e,value:n}=await t.read();if(e)break;let s=(a+=r.decode(n,{stream:!0})).split("\n");for(let e of(a=s.pop()||"",s))if(e.startsWith("data: "))try{let t=JSON.parse(e.slice(6));z(t),("done"===t.phase||"error"===t.phase)&&(P(!1),"done"===t.phase&&t.cloneDir&&(k(t.cloneDir),y||v(S.split("/").pop()?.replace(".git","")||""),M(!1),D(""),z(null)))}catch{}}}catch(e){z({phase:"error",progress:0,error:e.message}),P(!1)}}},[S,j,y,g]);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.Dialog,{open:e,onOpenChange:h,children:(0,t.jsxs)(a.DialogContent,{children:[(0,t.jsxs)(a.DialogHeader,{children:[(0,t.jsx)(a.DialogTitle,{children:T?g("dialog.editTitle"):g("dialog.newTitle")}),(0,t.jsx)(a.DialogDescription,{children:T?g("dialog.editDescription"):g("dialog.newDescription")})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-3 py-2",children:[(0,t.jsx)("input",{className:"rounded-xl border border-border bg-background px-4 py-2.5 text-sm outline-none focus:border-primary focus:ring-2 focus:ring-primary/20 transition-all",placeholder:g("dialog.namePlaceholder"),value:y,onChange:e=>v(e.target.value),onKeyDown:e=>"Enter"===e.key&&e.preventDefault()}),(0,t.jsx)("div",{children:(0,t.jsx)(d.FolderPicker,{value:j,onChange:k,placeholder:"/path/to/project"})}),!T&&(0,t.jsxs)(n.Button,{type:"button",variant:"outline",size:"sm",className:"w-full gap-1.5",onClick:()=>M(!0),disabled:!j,title:j?g("clone.fromGitTooltip"):g("clone.selectFolderFirst"),children:[(0,t.jsx)(i.Download,{className:"size-4"}),g("clone.createFromGit")]}),T&&b.length>0&&(0,t.jsxs)("div",{className:"rounded-xl border border-border p-3",children:[(0,t.jsxs)("div",{className:"mb-2 flex items-center gap-2 text-sm font-medium",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:b.length}),(0,t.jsx)("span",{children:g("agents")})]}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:b.map(e=>(0,t.jsx)("span",{className:"inline-flex items-center gap-1 rounded-md bg-muted px-2 py-0.5 text-xs",children:e.name||e.role},e.id))})]})]}),(0,t.jsxs)(a.DialogFooter,{children:[(0,t.jsx)(n.Button,{variant:"outline",onClick:()=>h(!1),disabled:w,children:x("cancel")}),(0,t.jsx)(n.Button,{onClick:A,disabled:!y||!j||w,children:x(T?"save":"create")})]})]})}),(0,t.jsx)(a.Dialog,{open:C,onOpenChange:e=>{F||M(e)},children:(0,t.jsxs)(a.DialogContent,{children:[(0,t.jsxs)(a.DialogHeader,{children:[(0,t.jsx)(a.DialogTitle,{children:g("clone.title")}),(0,t.jsx)(a.DialogDescription,{children:g("clone.description")})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-3 py-2",children:[(0,t.jsx)("input",{className:"rounded-xl border border-border bg-background px-4 py-2.5 text-sm outline-none focus:border-primary focus:ring-2 focus:ring-primary/20 transition-all",placeholder:"https://github.com/user/repo.git",value:S,onChange:e=>D(e.target.value),onKeyDown:e=>"Enter"===e.key&&e.preventDefault(),disabled:F}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:[g("clone.cloneTo"),j,"/",S?S.split("/").pop()?.replace(".git","")||"repo":"..."]}),W&&"done"!==W.phase&&"error"!==W.phase&&(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsxs)(c.Progress,{value:W.progress,children:[(0,t.jsx)(c.ProgressLabel,{children:g(`clone.phase.${W.phase}`)}),(0,t.jsxs)("span",{className:"ml-auto text-sm text-muted-foreground tabular-nums",children:[W.progress,"%"]}),(0,t.jsx)(c.ProgressTrack,{children:(0,t.jsx)(c.ProgressIndicator,{})})]}),null!=W.received&&null!=W.total&&(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:[W.received," / ",W.total," ",g("clone.objects")]})]}),W?.phase==="error"&&(0,t.jsxs)("div",{className:"flex items-start gap-2 rounded-lg border border-destructive/50 bg-destructive/5 p-3",children:[(0,t.jsx)(l.AlertCircle,{className:"size-4 mt-0.5 shrink-0 text-destructive"}),(0,t.jsx)("p",{className:"text-sm text-destructive",children:W.error})]})]}),(0,t.jsxs)(a.DialogFooter,{children:[(0,t.jsx)(n.Button,{variant:"outline",onClick:()=>{F||M(!1)},disabled:F,children:x("cancel")}),(0,t.jsx)(n.Button,{onClick:R,disabled:!S||F,children:F?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.Loader2,{className:"size-4 animate-spin"}),g("clone.cloning")]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.Download,{className:"size-4"}),g("clone.clone")]})})]})]})})]})}e.s(["WorkspaceDialog",0,function({open:e,onOpenChange:r,workspace:a,onSubmit:n}){return(0,t.jsx)(m,{open:e,onOpenChange:r,workspace:a,onSubmit:n},e?a?.id??"new":"closed")}])},226651,e=>{"use strict";let t=(0,e.i(433721).default)("ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);e.s(["default",0,t])},487122,511518,e=>{"use strict";let t=Symbol.for("constructDateFrom");e.s(["constructFromSymbol",0,t,"millisecondsInDay",0,864e5,"millisecondsInWeek",0,6048e5,"minutesInDay",0,1440,"minutesInMonth",0,43200],511518),e.s(["constructFrom",0,function(e,r){return"function"==typeof e?e(r):e&&"object"==typeof e&&t in e?e[t](r):e instanceof Date?new e.constructor(r):new Date(r)}],487122)},238153,244874,e=>{"use strict";var t;let r={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function a(e){return (t={})=>{let r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}let n={date:a({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:a({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:a({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},s={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function i(e){return(t,r)=>{let a;if("formatting"===(r?.context?String(r.context):"standalone")&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,n=r?.width?String(r.width):t;a=e.formattingValues[n]||e.formattingValues[t]}else{let t=e.defaultWidth,n=r?.width?String(r.width):e.defaultWidth;a=e.values[n]||e.values[t]}return a[e.argumentCallback?e.argumentCallback(t):t]}}function o(e){return(t,r={})=>{let a,n=r.width,s=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],i=t.match(s);if(!i)return null;let o=i[0],l=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],d=Array.isArray(l)?function(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}(l,e=>e.test(o)):function(e,t){for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}(l,e=>e.test(o));return a=e.valueCallback?e.valueCallback(d):d,{value:a=r.valueCallback?r.valueCallback(a):a,rest:t.slice(o.length)}}}let l={code:"en-US",formatDistance:(e,t,a)=>{let n,s=r[e];if(n="string"==typeof s?s:1===t?s.one:s.other.replace("{{count}}",t.toString()),a?.addSuffix)if(a.comparison&&a.comparison>0)return"in "+n;else return n+" ago";return n},formatLong:n,formatRelative:(e,t,r,a)=>s[e],localize:{ordinalNumber:(e,t)=>{let r=Number(e),a=r%100;if(a>20||a<10)switch(a%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},era:i({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:i({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:i({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:i({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:i({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(t={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)},(e,r={})=>{let a=e.match(t.matchPattern);if(!a)return null;let n=a[0],s=e.match(t.parsePattern);if(!s)return null;let i=t.valueCallback?t.valueCallback(s[0]):s[0];return{value:i=r.valueCallback?r.valueCallback(i):i,rest:e.slice(n.length)}}),era:o({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:o({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:o({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:o({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:o({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};e.s(["enUS",0,l],244874),e.s(["defaultLocale",0,l],238153)},492421,e=>{"use strict";let t={};e.s(["getDefaultOptions",0,function(){return t}])},632713,516467,e=>{"use strict";var t=e.i(487122);function r(e,r){return(0,t.constructFrom)(r||e,e)}e.s(["toDate",0,r],516467),e.s(["getTimezoneOffsetInMilliseconds",0,function(e){let t=r(e),a=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return a.setUTCFullYear(t.getFullYear()),e-a}],632713)},539392,e=>{"use strict";var t=e.i(487122);e.s(["normalizeDates",0,function(e,...r){let a=t.constructFrom.bind(null,e||r.find(e=>"object"==typeof e));return r.map(a)}])},731285,e=>{"use strict";var t=e.i(539392);e.s(["differenceInCalendarMonths",0,function(e,r,a){let[n,s]=(0,t.normalizeDates)(a?.in,e,r);return 12*(n.getFullYear()-s.getFullYear())+(n.getMonth()-s.getMonth())}])},936765,e=>{"use strict";var t=e.i(516467);e.s(["endOfMonth",0,function(e,r){let a=(0,t.toDate)(e,r?.in),n=a.getMonth();return a.setFullYear(a.getFullYear(),n+1,0),a.setHours(23,59,59,999),a}])}]);