tarsk 0.5.68 → 0.5.69

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 (59) hide show
  1. package/dist/public/assets/{account-view-BlK6g38q.js → account-view-Chzj6v7a.js} +1 -1
  2. package/dist/public/assets/{alert-dialog-B6An1LDY.js → alert-dialog-CLYxQdrK.js} +1 -1
  3. package/dist/public/assets/{async-error-boundary-Rf-s2_Ez.js → async-error-boundary-CM6LU7nT.js} +1 -1
  4. package/dist/public/assets/{browser-tab-BJxPUVJi.js → browser-tab--1iEoJGu.js} +1 -1
  5. package/dist/public/assets/{chat-dock-context-DyKjqpND.js → chat-dock-context-Gg1jpamu.js} +1 -1
  6. package/dist/public/assets/{commit-dialog-CYb1kJCq.js → commit-dialog-BfdxNX_T.js} +1 -1
  7. package/dist/public/assets/{commit-error-dialog-DvxaNRcH.js → commit-error-dialog-DrsDKL-B.js} +1 -1
  8. package/dist/public/assets/{commit-method-fields-Dijc502F.js → commit-method-fields-o-xw2faT.js} +1 -1
  9. package/dist/public/assets/{context-menu-C51M1WGZ.js → context-menu-BLvLpqq7.js} +1 -1
  10. package/dist/public/assets/{conversation-history-view-w_6Jd3d-.js → conversation-history-view-ukfe_7qw.js} +1 -1
  11. package/dist/public/assets/{create-project-dialog-CSVkngnF.js → create-project-dialog-DrXo61FQ.js} +1 -1
  12. package/dist/public/assets/{create-repo-dialog-CcFA8pXz.js → create-repo-dialog-CkFACtMf.js} +1 -1
  13. package/dist/public/assets/{delete-confirm-dialog-uTSX_x-i.js → delete-confirm-dialog-D1zjctrX.js} +1 -1
  14. package/dist/public/assets/{diff-view-XN5G5F6E.js → diff-view-Cxf7v9t1.js} +1 -1
  15. package/dist/public/assets/{explorer-tab-view-A2ICDFPB.js → explorer-tab-view-LkT0bDcR.js} +2 -2
  16. package/dist/public/assets/{explorer-tree-B04Ba59E.js → explorer-tree-B6EZUVTn.js} +1 -1
  17. package/dist/public/assets/{explorer-view-CofaKFiu.js → explorer-view-D5y8Uxoi.js} +1 -1
  18. package/dist/public/assets/{git-history-dialog-V3kaff2G.js → git-history-dialog-X6sVwgPT.js} +1 -1
  19. package/dist/public/assets/{index-B0xy4BkI.js → index-CJCQ4bTo.js} +32 -33
  20. package/dist/public/assets/{mcp-server-card-DOsP-SQ8.js → mcp-server-card-DPakHrG9.js} +1 -1
  21. package/dist/public/assets/{merged-pr-dialog-BerRzLlh.js → merged-pr-dialog-C3euJvCu.js} +1 -1
  22. package/dist/public/assets/{model-list-controls-Dw98tMn7.js → model-list-controls-2JtkzWsp.js} +1 -1
  23. package/dist/public/assets/{monaco-setup-C87kBr4u.js → monaco-setup-b-rhUj5t.js} +1 -1
  24. package/dist/public/assets/{onboarding-DVc9-yKJ.js → onboarding-KBcwP-kU.js} +1 -1
  25. package/dist/public/assets/{project-env-vars-view-BQwUd7y6.js → project-env-vars-view-D60J_-qQ.js} +1 -1
  26. package/dist/public/assets/{project-model-aliases-view-CobSp09z.js → project-model-aliases-view-EClnOgBH.js} +1 -1
  27. package/dist/public/assets/{project-settings-view-CPTd5lEi.js → project-settings-view-Cb0iiyad.js} +1 -1
  28. package/dist/public/assets/{project-tools-view-DShQghoz.js → project-tools-view-B_WnVICB.js} +1 -1
  29. package/dist/public/assets/{providers-list-view-Da9VMcuP.js → providers-list-view-CYy82_hl.js} +1 -1
  30. package/dist/public/assets/{pull-request-dialog-BAarT9EM.js → pull-request-dialog-CitbRcub.js} +1 -1
  31. package/dist/public/assets/{pull-with-changes-dialog-BcF25mjQ.js → pull-with-changes-dialog-CpgHqvKf.js} +1 -1
  32. package/dist/public/assets/{push-before-pr-dialog-BF0NzV2u.js → push-before-pr-dialog-CrcNZDLb.js} +1 -1
  33. package/dist/public/assets/{react-vendor-B7jFrulV.js → react-vendor-7n7LyU5o.js} +1 -1
  34. package/dist/public/assets/{settings-general-view-DT4nElcL.js → settings-general-view-72s5xgPj.js} +1 -1
  35. package/dist/public/assets/{settings-instructions-view-Bsr8wRMf.js → settings-instructions-view-DN4-73KP.js} +1 -1
  36. package/dist/public/assets/{settings-list-B9wyVzKw.js → settings-list-CWdsaJKC.js} +1 -1
  37. package/dist/public/assets/{settings-logs-view-CyaGqUKH.js → settings-logs-view-CkkVgGvv.js} +1 -1
  38. package/dist/public/assets/{settings-mcp-servers-view-BTUWHB5K.js → settings-mcp-servers-view-B8_vnfl6.js} +1 -1
  39. package/dist/public/assets/{settings-models-view-DFwkVdt3.js → settings-models-view-xIRY7PvW.js} +1 -1
  40. package/dist/public/assets/{settings-rules-view-BhA9tjVh.js → settings-rules-view-DIk0ghSW.js} +1 -1
  41. package/dist/public/assets/{settings-skills-view-BFoO9oZk.js → settings-skills-view-qWbr0Vl2.js} +1 -1
  42. package/dist/public/assets/{settings-slack-view-D4mrQ9C9.js → settings-slack-view-RFLP0USW.js} +1 -1
  43. package/dist/public/assets/{settings-slash-commands-view-BLKPDUVG.js → settings-slash-commands-view-zFWoR_R7.js} +1 -1
  44. package/dist/public/assets/{settings-statistics-view-fa6iBiP8.js → settings-statistics-view-BgrzVn4R.js} +1 -1
  45. package/dist/public/assets/{settings-storage-view-LaiAi5gv.js → settings-storage-view-BS2k7E74.js} +1 -1
  46. package/dist/public/assets/{settings-subagents-view-BjMz2Ri_.js → settings-subagents-view-BZr1NkVp.js} +1 -1
  47. package/dist/public/assets/{settings-system-prompt-view-DNh1yqZh.js → settings-system-prompt-view-mQErde93.js} +1 -1
  48. package/dist/public/assets/{settings-view-BoC66Wji.js → settings-view-D4-XZz2V.js} +2 -2
  49. package/dist/public/assets/{tasks-view-B049aXpC.js → tasks-view-DgkXglqW.js} +2 -2
  50. package/dist/public/assets/{terminal-panel-Pv5xqCpm.js → terminal-panel-DCaBWV04.js} +1 -1
  51. package/dist/public/assets/{ui-components-DJLsrr5e.js → ui-components-1WsgZqWa.js} +1 -1
  52. package/dist/public/assets/{use-active-dock-panel-instance-BlRDPUlZ.js → use-active-dock-panel-instance-B9ao_JH2.js} +1 -1
  53. package/dist/public/assets/{use-installed-ai-files-DmLnugpj.js → use-installed-ai-files-GpG9ZL8U.js} +1 -1
  54. package/dist/public/assets/{web-BidDZaMC.js → web-BuYdGVW8.js} +1 -1
  55. package/dist/public/assets/{web-DHUv7oQP.js → web-CEfF0992.js} +1 -1
  56. package/dist/public/assets/{web-JMCxQg4N.js → web-D7CwlITA.js} +1 -1
  57. package/dist/public/assets/{web-C_HuLxHj.js → web-yeAPC2wm.js} +1 -1
  58. package/dist/public/index.html +5 -5
  59. package/package.json +1 -1
@@ -1 +1 @@
1
- import{Di as e,Oi as t,Rr as n,Sn as r,b as i,i as a,in as o,yn as s,yt as c}from"./interactive-BrHVRHmQ.js";import{Ct as l,Eo as u,St as d,Tt as f,wt as p}from"./onboarding-DVc9-yKJ.js";var m=t(),h=e();function g(e){let t=(0,m.c)(6),{onContinue:n,disabled:r,creating:i}=e,a=r||i,o;t[0]===i?o=t[1]:(o=i?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(c,{className:`mr-2 h-4 w-4 animate-spin`}),`Creating...`]}):(0,h.jsxs)(h.Fragment,{children:[`Continue`,(0,h.jsx)(s,{className:`ml-2 h-4 w-4`})]}),t[0]=i,t[1]=o);let l;return t[2]!==n||t[3]!==a||t[4]!==o?(l=(0,h.jsx)(`div`,{className:`mt-6 border-t pt-4 flex justify-end`,children:(0,h.jsx)(u,{onClick:n,disabled:a,children:o})}),t[2]=n,t[3]=a,t[4]=o,t[5]=l):l=t[5],l}function _(e){return e.toLowerCase().replace(/\s+/g,`-`).replace(/[^a-z0-9-]/g,``).replace(/-+/g,`-`).replace(/^-|-$/g,``)}function v(e){return e.replace(/-/g,` `).split(/\s+/).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}function y(e){return e.length>0&&e.length<=64}function b(e){let t=(0,m.c)(29),{name:s,description:c,installed:g,onClick:_,onOpen:v,onUninstall:y,showInstalledControls:b,className:x}=e,S=b===void 0?!0:b,C=!g&&`cursor-pointer hover:bg-accent/50`,w;t[0]!==x||t[1]!==C?(w=a(`flex w-full flex-col gap-2 rounded-lg border border-border bg-card p-2.5 text-left transition-colors`,C,x),t[0]=x,t[1]=C,t[2]=w):w=t[2];let T=g?void 0:_,E=g?void 0:`button`,D;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(D=a(n.label,`truncate leading-normal`),t[3]=D):D=t[3];let O;t[4]===s?O=t[5]:(O=(0,h.jsx)(`span`,{className:D,children:s}),t[4]=s,t[5]=O);let k;t[6]!==g||t[7]!==S?(k=g&&S&&(0,h.jsx)(p,{delayDuration:300,children:(0,h.jsxs)(d,{children:[(0,h.jsx)(f,{asChild:!0,children:(0,h.jsx)(`span`,{className:`flex-shrink-0 h-4 w-4 rounded-full bg-green-500/15 flex items-center justify-center`,children:(0,h.jsx)(r,{className:`h-2.5 w-2.5 text-green-600 dark:text-green-400`})})}),(0,h.jsx)(l,{children:`Installed`})]})}),t[6]=g,t[7]=S,t[8]=k):k=t[8];let A;t[9]!==O||t[10]!==k?(A=(0,h.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[O,k]}),t[9]=O,t[10]=k,t[11]=A):A=t[11];let j;t[12]!==g||t[13]!==v||t[14]!==y||t[15]!==S?(j=g&&S&&(0,h.jsxs)(`div`,{className:`flex items-center gap-1 flex-shrink-0`,children:[v&&(0,h.jsx)(p,{delayDuration:300,children:(0,h.jsxs)(d,{children:[(0,h.jsx)(f,{asChild:!0,children:(0,h.jsx)(u,{variant:`ghost`,size:`icon-sm`,onClick:e=>{e.stopPropagation(),v()},children:(0,h.jsx)(o,{className:`h-3.5 w-3.5`})})}),(0,h.jsx)(l,{children:`Open in Explorer`})]})}),y&&(0,h.jsx)(p,{delayDuration:300,children:(0,h.jsxs)(d,{children:[(0,h.jsx)(f,{asChild:!0,children:(0,h.jsx)(u,{variant:`ghost`,size:`icon-sm`,onClick:e=>{e.stopPropagation(),y()},className:`text-destructive hover:text-destructive`,children:(0,h.jsx)(i,{className:`h-3.5 w-3.5`})})}),(0,h.jsx)(l,{children:`Remove`})]})})]}),t[12]=g,t[13]=v,t[14]=y,t[15]=S,t[16]=j):j=t[16];let M;t[17]!==j||t[18]!==A?(M=(0,h.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[A,j]}),t[17]=j,t[18]=A,t[19]=M):M=t[19];let N;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(N=a(n.caption,`line-clamp-3 select-text`),t[20]=N):N=t[20];let P;t[21]===c?P=t[22]:(P=(0,h.jsx)(`p`,{className:N,children:c}),t[21]=c,t[22]=P);let F;return t[23]!==M||t[24]!==P||t[25]!==w||t[26]!==T||t[27]!==E?(F=(0,h.jsxs)(`div`,{className:w,onClick:T,role:E,children:[M,P]}),t[23]=M,t[24]=P,t[25]=w,t[26]=T,t[27]=E,t[28]=F):F=t[28],F}export{g as a,_ as i,v as n,y as r,b as t};
1
+ import{Di as e,Oi as t,Rr as n,Sn as r,b as i,i as a,in as o,yn as s,yt as c}from"./interactive-BrHVRHmQ.js";import{Ct as l,Eo as u,St as d,Tt as f,wt as p}from"./onboarding-KBcwP-kU.js";var m=t(),h=e();function g(e){let t=(0,m.c)(6),{onContinue:n,disabled:r,creating:i}=e,a=r||i,o;t[0]===i?o=t[1]:(o=i?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(c,{className:`mr-2 h-4 w-4 animate-spin`}),`Creating...`]}):(0,h.jsxs)(h.Fragment,{children:[`Continue`,(0,h.jsx)(s,{className:`ml-2 h-4 w-4`})]}),t[0]=i,t[1]=o);let l;return t[2]!==n||t[3]!==a||t[4]!==o?(l=(0,h.jsx)(`div`,{className:`mt-6 border-t pt-4 flex justify-end`,children:(0,h.jsx)(u,{onClick:n,disabled:a,children:o})}),t[2]=n,t[3]=a,t[4]=o,t[5]=l):l=t[5],l}function _(e){return e.toLowerCase().replace(/\s+/g,`-`).replace(/[^a-z0-9-]/g,``).replace(/-+/g,`-`).replace(/^-|-$/g,``)}function v(e){return e.replace(/-/g,` `).split(/\s+/).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}function y(e){return e.length>0&&e.length<=64}function b(e){let t=(0,m.c)(29),{name:s,description:c,installed:g,onClick:_,onOpen:v,onUninstall:y,showInstalledControls:b,className:x}=e,S=b===void 0?!0:b,C=!g&&`cursor-pointer hover:bg-accent/50`,w;t[0]!==x||t[1]!==C?(w=a(`flex w-full flex-col gap-2 rounded-lg border border-border bg-card p-2.5 text-left transition-colors`,C,x),t[0]=x,t[1]=C,t[2]=w):w=t[2];let T=g?void 0:_,E=g?void 0:`button`,D;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(D=a(n.label,`truncate leading-normal`),t[3]=D):D=t[3];let O;t[4]===s?O=t[5]:(O=(0,h.jsx)(`span`,{className:D,children:s}),t[4]=s,t[5]=O);let k;t[6]!==g||t[7]!==S?(k=g&&S&&(0,h.jsx)(p,{delayDuration:300,children:(0,h.jsxs)(d,{children:[(0,h.jsx)(f,{asChild:!0,children:(0,h.jsx)(`span`,{className:`flex-shrink-0 h-4 w-4 rounded-full bg-green-500/15 flex items-center justify-center`,children:(0,h.jsx)(r,{className:`h-2.5 w-2.5 text-green-600 dark:text-green-400`})})}),(0,h.jsx)(l,{children:`Installed`})]})}),t[6]=g,t[7]=S,t[8]=k):k=t[8];let A;t[9]!==O||t[10]!==k?(A=(0,h.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[O,k]}),t[9]=O,t[10]=k,t[11]=A):A=t[11];let j;t[12]!==g||t[13]!==v||t[14]!==y||t[15]!==S?(j=g&&S&&(0,h.jsxs)(`div`,{className:`flex items-center gap-1 flex-shrink-0`,children:[v&&(0,h.jsx)(p,{delayDuration:300,children:(0,h.jsxs)(d,{children:[(0,h.jsx)(f,{asChild:!0,children:(0,h.jsx)(u,{variant:`ghost`,size:`icon-sm`,onClick:e=>{e.stopPropagation(),v()},children:(0,h.jsx)(o,{className:`h-3.5 w-3.5`})})}),(0,h.jsx)(l,{children:`Open in Explorer`})]})}),y&&(0,h.jsx)(p,{delayDuration:300,children:(0,h.jsxs)(d,{children:[(0,h.jsx)(f,{asChild:!0,children:(0,h.jsx)(u,{variant:`ghost`,size:`icon-sm`,onClick:e=>{e.stopPropagation(),y()},className:`text-destructive hover:text-destructive`,children:(0,h.jsx)(i,{className:`h-3.5 w-3.5`})})}),(0,h.jsx)(l,{children:`Remove`})]})})]}),t[12]=g,t[13]=v,t[14]=y,t[15]=S,t[16]=j):j=t[16];let M;t[17]!==j||t[18]!==A?(M=(0,h.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[A,j]}),t[17]=j,t[18]=A,t[19]=M):M=t[19];let N;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(N=a(n.caption,`line-clamp-3 select-text`),t[20]=N):N=t[20];let P;t[21]===c?P=t[22]:(P=(0,h.jsx)(`p`,{className:N,children:c}),t[21]=c,t[22]=P);let F;return t[23]!==M||t[24]!==P||t[25]!==w||t[26]!==T||t[27]!==E?(F=(0,h.jsxs)(`div`,{className:w,onClick:T,role:E,children:[M,P]}),t[23]=M,t[24]=P,t[25]=w,t[26]=T,t[27]=E,t[28]=F):F=t[28],F}export{g as a,_ as i,v as n,y as r,b as t};
@@ -1 +1 @@
1
- import{Di as e,Oi as t,Rr as n}from"./interactive-BrHVRHmQ.js";import{A as r,D as i,Eo as a,O as o,T as s,b as c,j as l,k as u,s as d}from"./onboarding-DVc9-yKJ.js";var f=t(),p=e();function m(e){let t=(0,f.c)(30),{open:m,onOpenChange:h,onNewBranch:g,onJustOpen:_,newChatOnNewBranch:v,onNewChatOnNewBranchChange:y,isLoading:b,projectName:x}=e,S=b===void 0?!1:b,C;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,p.jsx)(l,{children:`Pull Request Merged`}),t[0]=C):C=t[0];let w=x?` for ${x}`:``,T;t[1]===w?T=t[2]:(T=(0,p.jsxs)(r,{children:[C,(0,p.jsxs)(o,{children:[`The PR has already been merged`,w,`. Create a new branch and PR?`]})]}),t[1]=w,t[2]=T);let E;t[3]===y?E=t[4]:(E=e=>y(e===!0),t[3]=y,t[4]=E);let D;t[5]!==v||t[6]!==E?(D=(0,p.jsx)(d,{id:`new-chat-on-new-branch`,checked:v,onCheckedChange:E}),t[5]=v,t[6]=E,t[7]=D):D=t[7];let O;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,p.jsx)(c,{htmlFor:`new-chat-on-new-branch`,className:n.labelNormal,children:`New Chat`}),t[8]=O):O=t[8];let k;t[9]===D?k=t[10]:(k=(0,p.jsxs)(`div`,{className:`flex items-center gap-2`,children:[D,O]}),t[9]=D,t[10]=k);let A;t[11]!==S||t[12]!==_?(A=(0,p.jsx)(a,{variant:`ghost`,onClick:_,disabled:S,children:`Just Open`}),t[11]=S,t[12]=_,t[13]=A):A=t[13];let j;t[14]!==S||t[15]!==g?(j=(0,p.jsx)(a,{onClick:g,disabled:S,children:`New Branch`}),t[14]=S,t[15]=g,t[16]=j):j=t[16];let M;t[17]!==j||t[18]!==A?(M=(0,p.jsxs)(`div`,{className:`flex w-full flex-col-reverse gap-2 sm:w-auto sm:flex-row`,children:[A,j]}),t[17]=j,t[18]=A,t[19]=M):M=t[19];let N;t[20]!==M||t[21]!==k?(N=(0,p.jsxs)(u,{className:`flex-col gap-4 sm:flex-row sm:items-center sm:justify-between`,children:[k,M]}),t[20]=M,t[21]=k,t[22]=N):N=t[22];let P;t[23]!==N||t[24]!==T?(P=(0,p.jsxs)(i,{children:[T,N]}),t[23]=N,t[24]=T,t[25]=P):P=t[25];let F;return t[26]!==h||t[27]!==m||t[28]!==P?(F=(0,p.jsx)(s,{open:m,onOpenChange:h,children:P}),t[26]=h,t[27]=m,t[28]=P,t[29]=F):F=t[29],F}export{m as MergedPRDialog};
1
+ import{Di as e,Oi as t,Rr as n}from"./interactive-BrHVRHmQ.js";import{A as r,D as i,Eo as a,O as o,T as s,b as c,j as l,k as u,s as d}from"./onboarding-KBcwP-kU.js";var f=t(),p=e();function m(e){let t=(0,f.c)(30),{open:m,onOpenChange:h,onNewBranch:g,onJustOpen:_,newChatOnNewBranch:v,onNewChatOnNewBranchChange:y,isLoading:b,projectName:x}=e,S=b===void 0?!1:b,C;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,p.jsx)(l,{children:`Pull Request Merged`}),t[0]=C):C=t[0];let w=x?` for ${x}`:``,T;t[1]===w?T=t[2]:(T=(0,p.jsxs)(r,{children:[C,(0,p.jsxs)(o,{children:[`The PR has already been merged`,w,`. Create a new branch and PR?`]})]}),t[1]=w,t[2]=T);let E;t[3]===y?E=t[4]:(E=e=>y(e===!0),t[3]=y,t[4]=E);let D;t[5]!==v||t[6]!==E?(D=(0,p.jsx)(d,{id:`new-chat-on-new-branch`,checked:v,onCheckedChange:E}),t[5]=v,t[6]=E,t[7]=D):D=t[7];let O;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,p.jsx)(c,{htmlFor:`new-chat-on-new-branch`,className:n.labelNormal,children:`New Chat`}),t[8]=O):O=t[8];let k;t[9]===D?k=t[10]:(k=(0,p.jsxs)(`div`,{className:`flex items-center gap-2`,children:[D,O]}),t[9]=D,t[10]=k);let A;t[11]!==S||t[12]!==_?(A=(0,p.jsx)(a,{variant:`ghost`,onClick:_,disabled:S,children:`Just Open`}),t[11]=S,t[12]=_,t[13]=A):A=t[13];let j;t[14]!==S||t[15]!==g?(j=(0,p.jsx)(a,{onClick:g,disabled:S,children:`New Branch`}),t[14]=S,t[15]=g,t[16]=j):j=t[16];let M;t[17]!==j||t[18]!==A?(M=(0,p.jsxs)(`div`,{className:`flex w-full flex-col-reverse gap-2 sm:w-auto sm:flex-row`,children:[A,j]}),t[17]=j,t[18]=A,t[19]=M):M=t[19];let N;t[20]!==M||t[21]!==k?(N=(0,p.jsxs)(u,{className:`flex-col gap-4 sm:flex-row sm:items-center sm:justify-between`,children:[k,M]}),t[20]=M,t[21]=k,t[22]=N):N=t[22];let P;t[23]!==N||t[24]!==T?(P=(0,p.jsxs)(i,{children:[T,N]}),t[23]=N,t[24]=T,t[25]=P):P=t[25];let F;return t[26]!==h||t[27]!==m||t[28]!==P?(F=(0,p.jsx)(s,{open:m,onOpenChange:h,children:P}),t[26]=h,t[27]=m,t[28]=P,t[29]=F):F=t[29],F}export{m as MergedPRDialog};
@@ -1 +1 @@
1
- import"./rolldown-runtime-aKtaBQYM.js";import{D as e,Di as t,H as n,Mn as r,Oi as i,Rr as a,cn as o,ki as s}from"./interactive-BrHVRHmQ.js";import{Ct as c,Eo as l,St as u,Tt as d,i as f,s as p,wt as m}from"./onboarding-DVc9-yKJ.js";var h=i(),g=t();function _(t){let n=(0,h.c)(9),{codingIndex:r,modelName:i}=t,o=f(r);if(o===0)return null;let s;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=[1,2,3,4,5],n[0]=s):s=n[0];let l;n[1]===o?l=n[2]:(l=(0,g.jsx)(d,{asChild:!0,children:(0,g.jsx)(`div`,{className:`flex items-center gap-0.5`,children:s.map(t=>(0,g.jsx)(e,{className:`h-3 w-3 ${t<=o?`fill-yellow-400 text-yellow-400`:`text-gray-300`}`},t))})}),n[1]=o,n[2]=l);let p;n[3]!==r||n[4]!==i?(p=(0,g.jsx)(c,{children:(0,g.jsxs)(`p`,{className:a.body,children:[i,` was indexed `,r,` for coding intelligence`]})}),n[3]=r,n[4]=i,n[5]=p):p=n[5];let _;return n[6]!==l||n[7]!==p?(_=(0,g.jsx)(m,{children:(0,g.jsxs)(u,{children:[l,p]})}),n[6]=l,n[7]=p,n[8]=_):_=n[8],_}s();function v(e){let t=(0,h.c)(10),{id:n,checked:r,disabled:i,onChange:a}=e,o=i===void 0?!1:i,s;t[0]===a?s=t[1]:(s=e=>a(e===!0),t[0]=a,t[1]=s);let l;t[2]!==r||t[3]!==o||t[4]!==n||t[5]!==s?(l=(0,g.jsx)(d,{asChild:!0,children:(0,g.jsx)(`span`,{className:`inline-flex`,children:(0,g.jsx)(p,{id:n,disabled:o,checked:r,onCheckedChange:s,"aria-label":`Select All Models`})})}),t[2]=r,t[3]=o,t[4]=n,t[5]=s,t[6]=l):l=t[6];let f;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,g.jsx)(c,{children:`Select All Models`}),t[7]=f):f=t[7];let _;return t[8]===l?_=t[9]:(_=(0,g.jsx)(m,{children:(0,g.jsxs)(u,{children:[l,f]})}),t[8]=l,t[9]=_),_}function y(t){let i=(0,h.c)(31),{sortBy:a,onSortByChange:s,showCodingIndex:f,showIntelligenceByPrice:p}=t,_=f===void 0?!1:f,v=p===void 0?!1:p,y=a===`alphabetical`?`secondary`:`ghost`,b;i[0]===s?b=i[1]:(b=()=>s(`alphabetical`),i[0]=s,i[1]=b);let x;i[2]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,g.jsx)(r,{className:`h-4 w-4`}),i[2]=x):x=i[2];let S;i[3]!==y||i[4]!==b?(S=(0,g.jsx)(d,{asChild:!0,children:(0,g.jsx)(l,{type:`button`,variant:y,size:`icon`,className:`h-8 w-8`,onClick:b,children:x})}),i[3]=y,i[4]=b,i[5]=S):S=i[5];let C;i[6]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,g.jsx)(c,{children:`Sort A–Z`}),i[6]=C):C=i[6];let w;i[7]===S?w=i[8]:(w=(0,g.jsxs)(u,{children:[S,C]}),i[7]=S,i[8]=w);let T=a===`price-low`||a===`price-high`?`secondary`:`ghost`,E;i[9]===s?E=i[10]:(E=()=>s(`price-low`),i[9]=s,i[10]=E);let D;i[11]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,g.jsx)(o,{className:`h-4 w-4`}),i[11]=D):D=i[11];let O;i[12]!==E||i[13]!==T?(O=(0,g.jsx)(d,{asChild:!0,children:(0,g.jsx)(l,{type:`button`,variant:T,size:`icon`,className:`h-8 w-8`,onClick:E,children:D})}),i[12]=E,i[13]=T,i[14]=O):O=i[14];let k;i[15]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,g.jsx)(c,{children:`Sort by price`}),i[15]=k):k=i[15];let A;i[16]===O?A=i[17]:(A=(0,g.jsxs)(u,{children:[O,k]}),i[16]=O,i[17]=A);let j;i[18]!==s||i[19]!==_||i[20]!==a?(j=_?(0,g.jsxs)(u,{children:[(0,g.jsx)(d,{asChild:!0,children:(0,g.jsx)(l,{type:`button`,variant:a===`coding-index`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>s(`coding-index`),children:(0,g.jsx)(e,{className:`h-4 w-4`})})}),(0,g.jsx)(c,{children:`Sort by coding intelligence`})]}):null,i[18]=s,i[19]=_,i[20]=a,i[21]=j):j=i[21];let M;i[22]!==s||i[23]!==v||i[24]!==a?(M=v?(0,g.jsxs)(u,{children:[(0,g.jsx)(d,{asChild:!0,children:(0,g.jsx)(l,{type:`button`,variant:a===`intelligence-by-price`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>s(`intelligence-by-price`),children:(0,g.jsx)(n,{className:`h-4 w-4`})})}),(0,g.jsx)(c,{children:`Sort by price/intelligence`})]}):null,i[22]=s,i[23]=v,i[24]=a,i[25]=M):M=i[25];let N;return i[26]!==A||i[27]!==j||i[28]!==M||i[29]!==w?(N=(0,g.jsx)(m,{children:(0,g.jsxs)(`div`,{className:`flex items-center rounded-md p-0.5`,children:[w,A,j,M]})}),i[26]=A,i[27]=j,i[28]=M,i[29]=w,i[30]=N):N=i[30],N}export{y as n,_ as r,v as t};
1
+ import"./rolldown-runtime-aKtaBQYM.js";import{D as e,Di as t,H as n,Mn as r,Oi as i,Rr as a,cn as o,ki as s}from"./interactive-BrHVRHmQ.js";import{Ct as c,Eo as l,St as u,Tt as d,i as f,s as p,wt as m}from"./onboarding-KBcwP-kU.js";var h=i(),g=t();function _(t){let n=(0,h.c)(9),{codingIndex:r,modelName:i}=t,o=f(r);if(o===0)return null;let s;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=[1,2,3,4,5],n[0]=s):s=n[0];let l;n[1]===o?l=n[2]:(l=(0,g.jsx)(d,{asChild:!0,children:(0,g.jsx)(`div`,{className:`flex items-center gap-0.5`,children:s.map(t=>(0,g.jsx)(e,{className:`h-3 w-3 ${t<=o?`fill-yellow-400 text-yellow-400`:`text-gray-300`}`},t))})}),n[1]=o,n[2]=l);let p;n[3]!==r||n[4]!==i?(p=(0,g.jsx)(c,{children:(0,g.jsxs)(`p`,{className:a.body,children:[i,` was indexed `,r,` for coding intelligence`]})}),n[3]=r,n[4]=i,n[5]=p):p=n[5];let _;return n[6]!==l||n[7]!==p?(_=(0,g.jsx)(m,{children:(0,g.jsxs)(u,{children:[l,p]})}),n[6]=l,n[7]=p,n[8]=_):_=n[8],_}s();function v(e){let t=(0,h.c)(10),{id:n,checked:r,disabled:i,onChange:a}=e,o=i===void 0?!1:i,s;t[0]===a?s=t[1]:(s=e=>a(e===!0),t[0]=a,t[1]=s);let l;t[2]!==r||t[3]!==o||t[4]!==n||t[5]!==s?(l=(0,g.jsx)(d,{asChild:!0,children:(0,g.jsx)(`span`,{className:`inline-flex`,children:(0,g.jsx)(p,{id:n,disabled:o,checked:r,onCheckedChange:s,"aria-label":`Select All Models`})})}),t[2]=r,t[3]=o,t[4]=n,t[5]=s,t[6]=l):l=t[6];let f;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,g.jsx)(c,{children:`Select All Models`}),t[7]=f):f=t[7];let _;return t[8]===l?_=t[9]:(_=(0,g.jsx)(m,{children:(0,g.jsxs)(u,{children:[l,f]})}),t[8]=l,t[9]=_),_}function y(t){let i=(0,h.c)(31),{sortBy:a,onSortByChange:s,showCodingIndex:f,showIntelligenceByPrice:p}=t,_=f===void 0?!1:f,v=p===void 0?!1:p,y=a===`alphabetical`?`secondary`:`ghost`,b;i[0]===s?b=i[1]:(b=()=>s(`alphabetical`),i[0]=s,i[1]=b);let x;i[2]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,g.jsx)(r,{className:`h-4 w-4`}),i[2]=x):x=i[2];let S;i[3]!==y||i[4]!==b?(S=(0,g.jsx)(d,{asChild:!0,children:(0,g.jsx)(l,{type:`button`,variant:y,size:`icon`,className:`h-8 w-8`,onClick:b,children:x})}),i[3]=y,i[4]=b,i[5]=S):S=i[5];let C;i[6]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,g.jsx)(c,{children:`Sort A–Z`}),i[6]=C):C=i[6];let w;i[7]===S?w=i[8]:(w=(0,g.jsxs)(u,{children:[S,C]}),i[7]=S,i[8]=w);let T=a===`price-low`||a===`price-high`?`secondary`:`ghost`,E;i[9]===s?E=i[10]:(E=()=>s(`price-low`),i[9]=s,i[10]=E);let D;i[11]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,g.jsx)(o,{className:`h-4 w-4`}),i[11]=D):D=i[11];let O;i[12]!==E||i[13]!==T?(O=(0,g.jsx)(d,{asChild:!0,children:(0,g.jsx)(l,{type:`button`,variant:T,size:`icon`,className:`h-8 w-8`,onClick:E,children:D})}),i[12]=E,i[13]=T,i[14]=O):O=i[14];let k;i[15]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,g.jsx)(c,{children:`Sort by price`}),i[15]=k):k=i[15];let A;i[16]===O?A=i[17]:(A=(0,g.jsxs)(u,{children:[O,k]}),i[16]=O,i[17]=A);let j;i[18]!==s||i[19]!==_||i[20]!==a?(j=_?(0,g.jsxs)(u,{children:[(0,g.jsx)(d,{asChild:!0,children:(0,g.jsx)(l,{type:`button`,variant:a===`coding-index`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>s(`coding-index`),children:(0,g.jsx)(e,{className:`h-4 w-4`})})}),(0,g.jsx)(c,{children:`Sort by coding intelligence`})]}):null,i[18]=s,i[19]=_,i[20]=a,i[21]=j):j=i[21];let M;i[22]!==s||i[23]!==v||i[24]!==a?(M=v?(0,g.jsxs)(u,{children:[(0,g.jsx)(d,{asChild:!0,children:(0,g.jsx)(l,{type:`button`,variant:a===`intelligence-by-price`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>s(`intelligence-by-price`),children:(0,g.jsx)(n,{className:`h-4 w-4`})})}),(0,g.jsx)(c,{children:`Sort by price/intelligence`})]}):null,i[22]=s,i[23]=v,i[24]=a,i[25]=M):M=i[25];let N;return i[26]!==A||i[27]!==j||i[28]!==M||i[29]!==w?(N=(0,g.jsx)(m,{children:(0,g.jsxs)(`div`,{className:`flex items-center rounded-md p-0.5`,children:[w,A,j,M]})}),i[26]=A,i[27]=j,i[28]=M,i[29]=w,i[30]=N):N=i[30],N}export{y as n,_ as r,v as t};
@@ -1 +1 @@
1
- import"./react-vendor-B7jFrulV.js";import{a as e,i as t,n,o as r,r as i,s as a,t as o}from"./monaco-D1hpqXQ0.js";function s(r){return r===`json`?new n:r===`css`||r===`scss`||r===`less`?new t:r===`html`||r===`handlebars`||r===`razor`?new i:r===`typescript`||r===`javascript`?new o:new e}globalThis.MonacoEnvironment={getWorker(e,t){return s(t)}},r.config({monaco:a});
1
+ import"./react-vendor-7n7LyU5o.js";import{a as e,i as t,n,o as r,r as i,s as a,t as o}from"./monaco-D1hpqXQ0.js";function s(r){return r===`json`?new n:r===`css`||r===`scss`||r===`less`?new t:r===`html`||r===`handlebars`||r===`razor`?new i:r===`typescript`||r===`javascript`?new o:new e}globalThis.MonacoEnvironment={getWorker(e,t){return s(t)}},r.config({monaco:a});
@@ -1,4 +1,4 @@
1
- import{i as e,n as t,t as n}from"./rolldown-runtime-aKtaBQYM.js";import{B as r,Br as i,Cr as a,Di as o,Hr as s,Lr as c,Mn as l,Oi as u,Rr as d,Sn as f,Tt as p,_n as m,a as h,cn as g,f as _,i as v,in as y,ki as b,kn as x,l as S,li as C,nn as w,or as T,qn as E,rn as D,tr as O,vn as k,wr as A,xn as j,yt as M}from"./interactive-BrHVRHmQ.js";var N=n((e=>{var t=b();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.4`})),P=n(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=N()})),F=u(),I=e(b(),1);function ee(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function te(...e){return t=>{let n=!1,r=e.map(e=>{let r=ee(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():ee(e[t],null)}}}}function L(...e){return I.useCallback(te(...e),e)}var R=o(),ne=Symbol.for(`react.lazy`),re=I.use;function ie(e){return typeof e==`object`&&!!e&&`then`in e}function ae(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===ne&&`_payload`in e&&ie(e._payload)}function oe(e){let t=ce(e),n=I.forwardRef((e,n)=>{let{children:r,...i}=e;ae(r)&&typeof re==`function`&&(r=re(r._payload));let a=I.Children.toArray(r),o=a.find(ue);if(o){let e=o.props.children,r=a.map(t=>t===o?I.Children.count(e)>1?I.Children.only(null):I.isValidElement(e)?e.props.children:null:t);return(0,R.jsx)(t,{...i,ref:n,children:I.isValidElement(e)?I.cloneElement(e,void 0,r):null})}return(0,R.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}var se=oe(`Slot`);function ce(e){let t=I.forwardRef((e,t)=>{let{children:n,...r}=e;if(ae(n)&&typeof re==`function`&&(n=re(n._payload)),I.isValidElement(n)){let e=fe(n),i=de(r,n.props);return n.type!==I.Fragment&&(i.ref=t?te(t,e):e),I.cloneElement(n,i)}return I.Children.count(n)>1?I.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var le=Symbol(`radix.slottable`);function ue(e){return I.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===le}function de(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function fe(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var pe=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,me=S,he=(e,t)=>n=>{if(t?.variants==null)return me(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=pe(t)||pe(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return me(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},ge=he(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-full ${d.body} font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/90`,destructive:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,outline:`border border-input bg-background hover:bg-accent hover:text-accent-foreground`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80`,ghost:`hover:bg-foreground hover:text-background transition-colors`,action:`text-muted-foreground hover:bg-foreground hover:text-background transition-colors`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-10 px-6 py-3`,sm:`h-9 rounded-full px-4`,lg:`h-11 rounded-full px-10`,icon:`h-10 w-10 [&_svg]:size-5`,"icon-md":`h-8 w-8 [&_svg]:size-4`,"icon-sm":`h-7 w-7 [&_svg]:size-4`,"icon-xs":`h-5 w-5 [&_svg]:size-3`}},defaultVariants:{variant:`default`,size:`default`}}),_e=I.forwardRef((e,t)=>{let n=(0,F.c)(15),r,i,a,o,s;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4],s=n[5]):({className:r,variant:s,size:a,asChild:o,...i}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o,n[5]=s);let c=o!==void 0&&o?se:`button`,l;n[6]!==r||n[7]!==a||n[8]!==s?(l=v(ge({variant:s,size:a,className:r})),n[6]=r,n[7]=a,n[8]=s,n[9]=l):l=n[9];let u;return n[10]!==c||n[11]!==i||n[12]!==t||n[13]!==l?(u=(0,R.jsx)(c,{className:l,ref:t,...i}),n[10]=c,n[11]=i,n[12]=t,n[13]=l,n[14]=u):u=n[14],u});_e.displayName=`Button`;var ve=e(P(),1),ye=function(e){return e.PACKAGE_MANAGER=`tarsk.create-project.packageManager`,e.COMMIT_METHOD=`tarsk.create-project.commitMethod`,e.TEMPLATE_ID=`tarsk.create-project.templateId`,e.AUTO_GENERATE_COMMIT_MESSAGE=`autoGenerateCommitMessage`,e.AUTO_GENERATE_PR_INFO=`autoGeneratePRInfo`,e.CREATE_BRANCH_AFTER_PR=`createBranchAfterPR`,e.PRIVATE_REPOSITORY_DEFAULT=`privateRepositoryDefault`,e.NEW_CHAT_ON_NEW_BRANCH=`newChatOnNewBranch`,e.SELECTED_MODEL_PREFIX=`selected-model-`,e.SCROLL_POSITION_PREFIX=`scroll-position-`,e.FONT_SCALE=`tarsk.general.fontScale`,e.FROSTED_PANEL_OPACITY=`tarsk.general.frostedPanelOpacity`,e.IMAGE_BACKGROUND=`tarsk.general.imageBackground`,e.WALLPAPER_MODE=`tarsk.general.wallpaperMode`,e.WALLPAPER_COLOR=`tarsk.general.wallpaperColor`,e.BRAND_COLOR=`tarsk.general.brandColor`,e.OPEN_WITH_PROGRAM=`tarsk.general.openWithProgram`,e.SERVER_URL=`tarsk.server.url`,e.SERVER_BIND_MODE=`tarsk.general.serverBindMode`,e.HISTORY_COLUMNS=`tarsk.settings.historyColumns`,e}({}),be=function(e){return e.MESSAGE_HISTORY=`chat_message_history`,e.BASH_COMMAND_DURATIONS=`tarsk.bash-command-durations`,e.SKILL_CATALOG_PREFIX=`tarsk.skills.catalog.`,e.SKILL_SOURCE_SELECTION=`tarsk.skills.selectedSource`,e}({});function z(e){return typeof localStorage>`u`?null:localStorage.getItem(e)}function B(e,t){typeof localStorage>`u`||localStorage.setItem(e,t)}function xe(e){return typeof sessionStorage>`u`?null:sessionStorage.getItem(e)}function Se(e,t){typeof sessionStorage>`u`||sessionStorage.setItem(e,t)}function Ce(e=`npm`){return z(`tarsk.create-project.packageManager`)??e}function we(e){B(`tarsk.create-project.packageManager`,e)}function Te(e=`pull-request`){return z(`tarsk.create-project.commitMethod`)??e}function Ee(e){B(`tarsk.create-project.commitMethod`,e)}function De(e=``){return z(`tarsk.create-project.templateId`)??e}function Oe(e){B(`tarsk.create-project.templateId`,e)}function ke(e=!1){let t=z(`autoGenerateCommitMessage`);return t===null?e:t===`true`}function Ae(e){B(`autoGenerateCommitMessage`,e.toString())}function je(e=!1){let t=z(`autoGeneratePRInfo`);return t===null?e:t===`true`}function Me(e){B(`autoGeneratePRInfo`,e.toString())}function Ne(e=!1){let t=z(`createBranchAfterPR`);return t===null?e:t===`true`}function Pe(e){B(`createBranchAfterPR`,e.toString())}function Fe(e=!1){let t=z(`privateRepositoryDefault`);return t===null?e:t===`true`}function Ie(e){B(`privateRepositoryDefault`,e.toString())}function Le(e=!1){let t=z(`newChatOnNewBranch`);return t===null?e:t===`true`}function Re(e){B(`newChatOnNewBranch`,e.toString())}function ze(e){let t=z(`scroll-position-`+e),n=t===null?null:Number(t);return n!==null&&Number.isFinite(n)?n:null}function Be(e,t){B(`scroll-position-`+e,String(t))}function Ve(){let e=xe(`chat_message_history`);return e?JSON.parse(e):[]}function He(e){let t=Ve();e.trim()&&t[t.length-1]!==e&&(t.push(e),Se(`chat_message_history`,JSON.stringify(t)))}function Ue(e){return typeof sessionStorage>`u`?null:sessionStorage.getItem(e)}function We(e,t){typeof sessionStorage>`u`||sessionStorage.setItem(e,t)}function Ge(e=`default`){return Ue(`tarsk.skills.selectedSource`)??e}function Ke(e){We(`tarsk.skills.selectedSource`,e)}function qe(e){return`tarsk.skills.catalog.${e}`}function Je(e){let t=Ue(qe(e));if(!t)return null;try{return JSON.parse(t)}catch{return null}}function Ye(e,t){We(qe(e),JSON.stringify(t))}function Xe(e){typeof sessionStorage>`u`||sessionStorage.removeItem(qe(e))}var Ze=`tarsk.skills.customSources`;function Qe(){if(typeof localStorage>`u`)return[];let e=localStorage.getItem(Ze);if(!e)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>typeof e==`object`&&!!e&&typeof e.id==`string`&&typeof e.title==`string`&&typeof e.url==`string`):[]}catch{return[]}}function $e(){typeof localStorage>`u`||localStorage.removeItem(Ze)}function et(e=100){let t=z(`tarsk.general.fontScale`);if(t!==null){let e=Number(t);if(Number.isFinite(e)&&e>=50&&e<=300)return e}return e}function tt(e){B(`tarsk.general.fontScale`,String(e))}function nt(e=80){let t=z(`tarsk.general.frostedPanelOpacity`);if(t!==null){let e=Number(t);if(Number.isFinite(e)&&e>=60&&e<=100)return e}return e}function rt(e){B(`tarsk.general.frostedPanelOpacity`,String(e))}var it=new Set([`image`,`background`,`color`]),at=/^#[0-9a-fA-F]{6}$/,ot=`#1f2937`,st=`#82c309`;function ct(e){return e!==null&&it.has(e)}function lt(e=`background`){let t=z(`tarsk.general.wallpaperMode`);if(ct(t))return t;if(t===`brand`)return`background`;let n=z(`tarsk.general.imageBackground`);return n===`false`?`background`:n===`true`?`image`:e}function ut(e){B(`tarsk.general.wallpaperMode`,e)}function dt(e=ot){let t=z(`tarsk.general.wallpaperColor`);return t!==null&&at.test(t)?t:e}function ft(e){at.test(e)&&B(`tarsk.general.wallpaperColor`,e.toLowerCase())}function pt(e=st){let t=z(`tarsk.general.brandColor`);return t!==null&&at.test(t)?t:e}function mt(e){at.test(e)&&B(`tarsk.general.brandColor`,e.toLowerCase())}function ht(e=`VS Code`){return z(`tarsk.general.openWithProgram`)??e}function gt(e){B(`tarsk.general.openWithProgram`,e)}function _t(e){if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.fetchedAt==`number`&&(t.serverBindMode===`local`||t.serverBindMode===`network`)&&Array.isArray(t.networkAddresses)&&t.networkAddresses.every(e=>typeof e==`string`)}function vt(){let e=z(`tarsk.general.serverBindMode`);if(!e)return null;try{let t=JSON.parse(e);return _t(t)?t:null}catch{return null}}function yt(e){B(`tarsk.general.serverBindMode`,JSON.stringify({...e,fetchedAt:e.fetchedAt??Date.now()}))}function bt(){return typeof window>`u`?null:window.Capacitor?.getPlatform?.()??null}function xt(){return Et()&&bt()===`ios`}function St(){return z(ye.SERVER_URL)}function Ct(e){B(ye.SERVER_URL,e)}function wt(e){try{return new URL(e).hostname}catch{return``}}function Tt(e){let t=e.trim();if(!t)return``;let n=t.replace(/^https?:\/\//,``).split(`/`)[0]?.split(`:`)[0]??``;return n?`http://${n}:641`:``}function Et(){if(typeof window>`u`)return!1;if(window.Capacitor?.isNativePlatform?.())return!0;let e=window.location.protocol;return e===`capacitor:`||e===`ionic:`||e===`file:`}function Dt(){let e=St();if(e){let t=wt(e);if(t)return t}return Et()?``:document.location.hostname}async function Ot(e){try{return(await fetch(`${e.replace(/\/$/,``)}/health`,{method:`GET`})).ok}catch{return!1}}function kt(e){let t=Tt(e);if(t){if(Et()){Ct(t),window.location.reload();return}window.location.assign(t)}}function At(){return typeof window<`u`&&`__electrobunWebviewId`in window}function jt(){return typeof document<`u`&&document.location.port===`8100`}function Mt(){if(typeof document>`u`)return null;let{hostname:e,port:t,protocol:n}=document.location;return!t||n!==`http:`&&n!==`https:`?null:`${n}//${e}:${t}`}function Nt(){if(typeof document>`u`)return`http://localhost:641`;let{hostname:e,port:t}=document.location;return t===`8100`?`http://${e}:462`:Mt()||`http://${e}:641`}function Pt(){if(At()){let e=Mt();if(e)return e}if(!Et())return Nt();let e=St();return e?e.replace(/\/$/,``):Nt()}function V(e){let t=e.startsWith(`/`)?e:`/${e}`;return`${Pt()}${t}`}function Ft(e){if(!e)return`Unknown error`;if(typeof e.error==`string`)return e.error.trim()||`Unknown error`;if(e.error&&typeof e.error==`object`){let t=e.error.message;if(typeof t==`string`&&t.trim())return t.trim();let n=e.error.details;return typeof n==`string`&&n.trim()?n.trim():`Unknown error`}return`Unknown error`}async function It(e){try{return Ft(await e.json())}catch{}return e.statusText||`Unknown error`}function Lt(e,t,n){let r=Error(e);return n?.error&&typeof n.error==`object`&&(r.details=n.error.details,r.code=n.error.code),r}async function Rt(e){let t;try{t=await e.json()}catch{}throw Lt(Ft(t)||e.statusText||`Unknown error`,e,t)}async function zt(e,t){let n=await fetch(V(e),{...t,method:`GET`});if(!n.ok){let e=await It(n);throw Error(e)}return n.blob()}async function H(e,t){let n=await fetch(V(e),{...t,method:`GET`});if(!n.ok){let e=await It(n);throw Error(e)}return n.json()}async function U(e,t,n){let r=await fetch(V(e),{...n,method:`POST`,headers:{"Content-Type":`application/json`,...n?.headers},body:t?JSON.stringify(t):void 0});if(!r.ok){let e=await It(r);throw Error(e)}return r.json()}async function Bt(e,t,n){let r=await fetch(V(e),{...n,method:`POST`,headers:{"Content-Type":`application/json`,...n?.headers},body:t?JSON.stringify(t):void 0});if(!r.ok){let e=await It(r);throw Error(e)}return r.blob()}async function Vt(e,t,n){let r=await fetch(V(e),{...n,method:`POST`,headers:{"Content-Type":`application/octet-stream`,...n?.headers},body:t});if(!r.ok){let e=await It(r);throw Error(e)}return r.json()}async function Ht(e,t,n){let r=await fetch(V(e),{...n,method:`PUT`,headers:{"Content-Type":`application/json`,...n?.headers},body:t?JSON.stringify(t):void 0});if(!r.ok){let e=await It(r);throw Error(e)}return r.json()}async function Ut(e,t,n){let r=await fetch(V(e),{...n,method:`PATCH`,headers:{"Content-Type":`application/json`,...n?.headers},body:t?JSON.stringify(t):void 0});if(!r.ok){let e=await It(r);throw Error(e)}return r.json()}async function Wt(e,t,n){let r=await fetch(V(e),{...n,method:`PUT`,headers:{"Content-Type":`application/json`,...n?.headers},body:t?JSON.stringify(t):void 0});if(!r.ok){let e=await It(r);throw Error(e)}return r.body}async function W(e,t){let n=await fetch(V(e),{...t,method:`DELETE`});if(!n.ok){let e=await It(n);throw Error(e)}if(n.status!==204)return n.json()}async function Gt(e,t){let n=await fetch(V(e),{...t,method:`DELETE`});if(!n.ok){let e=await It(n);throw Error(e)}return n.body}async function Kt(e,t,n){let r=await fetch(V(e),{...n,method:`POST`,headers:{"Content-Type":`application/json`,...n?.headers},body:t?JSON.stringify(t):void 0,signal:n?.signal});return r.ok||await Rt(r),r.body}async function qt(e,t){let n=await fetch(V(e),{...t,method:`GET`});return n.ok||await Rt(n),n.body}async function Jt(e,t,n){let r=await fetch(V(e),{...n,method:`POST`,headers:{"Content-Type":`application/json`,...n?.headers},body:t?JSON.stringify(t):void 0});if(!r.ok){let e;try{e=await r.json()}catch{}throw Lt(Ft(e)||r.statusText||`Unknown error`,r,e)}return r.json()}async function Yt(e,t,n){let r=await fetch(V(e),{...n,method:`PUT`,headers:{"Content-Type":`application/json`,...n?.headers},body:t?JSON.stringify(t):void 0});if(!r.ok){let e;try{e=await r.json()}catch{}throw Lt(Ft(e)||r.statusText||`Unknown error`,r,e)}return r.json()}function G(...e){return e.map(e=>encodeURIComponent(String(e))).join(`/`)}var Xt=O(`gitops.ttl-cache`),K=new class{cache=new Map;inFlightRequests=new Map;generations=new Map;async get(e,t,n){let r=e.startsWith(`unified-git-status-`),i=r?performance.now():0,a=this.inFlightRequests.get(e);if(a)return r&&Xt.debug(`in-flight-reuse`,{key:e}),a;let o=this.cache.get(e);if(o&&Date.now()<o.expires){if(r){let t=Math.round(performance.now()-i);Xt.debug(`cache hit`,{key:e,duration:t})}return o.data}r&&Xt.debug(`cache miss, fetching`,{key:e});let s=this.generations.get(e)??0,c=t().then(t=>{if((this.generations.get(e)??0)===s){if(this.cache.set(e,{data:t,expires:Date.now()+n}),r){let t=Math.round(performance.now()-i);Xt.debug(`stored in cache`,{key:e,duration:t})}}else r&&Xt.debug(`skipped stale cache write`,{key:e});return t}).finally(()=>{this.inFlightRequests.get(e)===c&&this.inFlightRequests.delete(e)});return this.inFlightRequests.set(e,c),c}getSync(e){let t=this.cache.get(e);if(t&&Date.now()<t.expires)return t.data}bumpGeneration(e){this.generations.set(e,(this.generations.get(e)??0)+1)}invalidate(e){this.cache.delete(e),this.inFlightRequests.delete(e),this.bumpGeneration(e)}invalidatePattern(e){let t=[];for(let n of this.cache.keys())e.test(n)&&t.push(n);for(let n of this.inFlightRequests.keys())e.test(n)&&!t.includes(n)&&t.push(n);for(let e of t)this.cache.delete(e),this.inFlightRequests.delete(e),this.bumpGeneration(e)}clear(){for(let e of new Set([...this.cache.keys(),...this.inFlightRequests.keys(),...this.generations.keys()]))this.bumpGeneration(e);this.cache.clear(),this.inFlightRequests.clear()}};function Zt(e,t){let n=URL.createObjectURL(e),r=document.createElement(`a`);r.href=n,r.download=t,r.rel=`noopener`,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(n)}function Qt(e,t=`image/png`){let n=atob(e),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return new Blob([r],{type:t})}function $t(e){let t=e.indexOf(`,`),n=e.slice(0,t);return Qt(e.slice(t+1),n.match(/^data:([^;]+)/)?.[1]??`image/png`)}async function en(e){if(e.imageData)return Qt(e.imageData);if(e.imageUrl){if(e.imageUrl.startsWith(`data:`))return $t(e.imageUrl);let t=s(e.imageUrl,Pt()),n=await fetch(t);if(!n.ok)throw Error(`Failed to fetch image: ${n.status}`);return n.blob()}throw Error(`imageUrl or imageData is required`)}function tn(e){return!e.imageUrl||i(e.imageUrl)?e:{...e,imageUrl:s(e.imageUrl,Pt())}}async function nn(e){let t=e.filename??`generated-image-${Date.now()}.png`;try{return Zt(await en(e),t),{path:t}}catch{if(!e.imageUrl||e.imageUrl.startsWith(`data:`))throw Error(`imageUrl or imageData is required`);let n=document.createElement(`a`);return n.href=e.imageUrl,n.download=t,n.target=`_blank`,n.rel=`noopener noreferrer`,document.body.appendChild(n),n.click(),document.body.removeChild(n),{path:t}}}async function rn(e){let t=await en(e);if(!navigator.clipboard?.write)throw Error(`Clipboard API not available`);let n=t.type||`image/png`,r=t.type?t:new Blob([t],{type:n});await navigator.clipboard.write([new ClipboardItem({[n]:r})])}async function an(e){return At()?U(`api/image/save`,tn(e)):nn(e)}async function on(e){if(At()){await U(`api/image/clipboard`,tn(e));return}await rn(e)}function sn(e){let t=e.trim().toLowerCase();return t===`load failed`||t.includes(`failed to fetch`)||t.includes(`network error`)||t.includes(`network connection was lost`)||t.includes(`networkrequestfailed`)||t.includes(`networkrequest failed`)||t.includes(`socket is not connected`)}function cn(e){if(e instanceof Error&&`code`in e&&typeof e.code==`string`)return e.code}function ln(e){if(cn(e)===`THREAD_BUSY`)return!0;if(!(e instanceof Error))return!1;let t=e.message.toLowerCase();return t.includes(`already processing a message`)||t.includes(`already being processed`)||t.includes(`multiple chat windows are processing`)}function un(e,t){return ln(e)?t?.trim()?!0:e instanceof Error?!e.message.toLowerCase().includes(`multiple chat windows`):!1:!1}var dn=50;function fn(e,t,n,r,i){let a=e.getReader(),o=!1;function s(){o=!0,a.cancel().catch(()=>{})}let c=new TextDecoder,l=``,u=0;function d(e){let t=e.content?.trim();if(t)return E(t);let n=e.error?.message?.trim();if(n)return E(n);let r=e.message?.trim();return r?E(r):`Unknown error`}function f(e){if(!e)return!1;let t=e.trim();return t.length>200?!1:[/^Cannot read properties/i,/^Error:/i,/^TypeError:/i,/^ReferenceError:/i,/^SyntaxError:/i,/^failed to/i,/^error:/i,/^forbidden/i,/^unauthorized/i].some(e=>e.test(t))}async function p(){u+=1,!(u<dn)&&(u=0,await new Promise(e=>{setTimeout(e,0)}))}async function m(e){return e.type===`ping`?`continue`:e.type===`error`?(r(d(e)),n(),`stop`):e.type===`message`?(i?.({role:e.role??`assistant`,content:e.content??``,isThinking:e.isThinking}),`continue`):e.type===`complete`?(n(),`stop`):e.type===`result`&&f(e.content)?(r(E(e.content??`Unknown error`)),n(),`stop`):(t(e),await p(),`continue`)}async function h(){if(!l.trim())return`continue`;try{return await m(JSON.parse(l))}catch{return l.trim()&&t({type:`result`,content:l}),`continue`}}async function g(e){let t=e.trim();if(!t)return`continue`;try{return await m(JSON.parse(t))}catch{return`continue`}}async function _(){try{for(;!o;){let{done:e,value:t}=await a.read();if(e||o){if(!o&&e){if(await h()===`stop`)return;n()}break}l+=c.decode(t,{stream:!0});let r=l.split(`
1
+ import{i as e,n as t,t as n}from"./rolldown-runtime-aKtaBQYM.js";import{B as r,Br as i,Cr as a,Di as o,Hr as s,Lr as c,Mn as l,Oi as u,Rr as d,Sn as f,Tt as p,_n as m,a as h,cn as g,f as _,i as v,in as y,ki as b,kn as x,l as S,li as C,nn as w,or as T,qn as E,rn as D,tr as O,vn as k,wr as A,xn as j,yt as M}from"./interactive-BrHVRHmQ.js";var N=n((e=>{var t=b();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.4`})),P=n(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=N()})),F=u(),I=e(b(),1);function ee(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function te(...e){return t=>{let n=!1,r=e.map(e=>{let r=ee(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():ee(e[t],null)}}}}function L(...e){return I.useCallback(te(...e),e)}var R=o(),ne=Symbol.for(`react.lazy`),re=I.use;function ie(e){return typeof e==`object`&&!!e&&`then`in e}function ae(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===ne&&`_payload`in e&&ie(e._payload)}function oe(e){let t=ce(e),n=I.forwardRef((e,n)=>{let{children:r,...i}=e;ae(r)&&typeof re==`function`&&(r=re(r._payload));let a=I.Children.toArray(r),o=a.find(ue);if(o){let e=o.props.children,r=a.map(t=>t===o?I.Children.count(e)>1?I.Children.only(null):I.isValidElement(e)?e.props.children:null:t);return(0,R.jsx)(t,{...i,ref:n,children:I.isValidElement(e)?I.cloneElement(e,void 0,r):null})}return(0,R.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}var se=oe(`Slot`);function ce(e){let t=I.forwardRef((e,t)=>{let{children:n,...r}=e;if(ae(n)&&typeof re==`function`&&(n=re(n._payload)),I.isValidElement(n)){let e=fe(n),i=de(r,n.props);return n.type!==I.Fragment&&(i.ref=t?te(t,e):e),I.cloneElement(n,i)}return I.Children.count(n)>1?I.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var le=Symbol(`radix.slottable`);function ue(e){return I.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===le}function de(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function fe(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var pe=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,me=S,he=(e,t)=>n=>{if(t?.variants==null)return me(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=pe(t)||pe(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return me(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},ge=he(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-full ${d.body} font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/90`,destructive:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,outline:`border border-input bg-background hover:bg-accent hover:text-accent-foreground`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80`,ghost:`hover:bg-foreground hover:text-background transition-colors`,action:`text-muted-foreground hover:bg-foreground hover:text-background transition-colors`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-10 px-6 py-3`,sm:`h-9 rounded-full px-4`,lg:`h-11 rounded-full px-10`,icon:`h-10 w-10 [&_svg]:size-5`,"icon-md":`h-8 w-8 [&_svg]:size-4`,"icon-sm":`h-7 w-7 [&_svg]:size-4`,"icon-xs":`h-5 w-5 [&_svg]:size-3`}},defaultVariants:{variant:`default`,size:`default`}}),_e=I.forwardRef((e,t)=>{let n=(0,F.c)(15),r,i,a,o,s;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4],s=n[5]):({className:r,variant:s,size:a,asChild:o,...i}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o,n[5]=s);let c=o!==void 0&&o?se:`button`,l;n[6]!==r||n[7]!==a||n[8]!==s?(l=v(ge({variant:s,size:a,className:r})),n[6]=r,n[7]=a,n[8]=s,n[9]=l):l=n[9];let u;return n[10]!==c||n[11]!==i||n[12]!==t||n[13]!==l?(u=(0,R.jsx)(c,{className:l,ref:t,...i}),n[10]=c,n[11]=i,n[12]=t,n[13]=l,n[14]=u):u=n[14],u});_e.displayName=`Button`;var ve=e(P(),1),ye=function(e){return e.PACKAGE_MANAGER=`tarsk.create-project.packageManager`,e.COMMIT_METHOD=`tarsk.create-project.commitMethod`,e.TEMPLATE_ID=`tarsk.create-project.templateId`,e.AUTO_GENERATE_COMMIT_MESSAGE=`autoGenerateCommitMessage`,e.AUTO_GENERATE_PR_INFO=`autoGeneratePRInfo`,e.CREATE_BRANCH_AFTER_PR=`createBranchAfterPR`,e.PRIVATE_REPOSITORY_DEFAULT=`privateRepositoryDefault`,e.NEW_CHAT_ON_NEW_BRANCH=`newChatOnNewBranch`,e.SELECTED_MODEL_PREFIX=`selected-model-`,e.SCROLL_POSITION_PREFIX=`scroll-position-`,e.FONT_SCALE=`tarsk.general.fontScale`,e.FROSTED_PANEL_OPACITY=`tarsk.general.frostedPanelOpacity`,e.IMAGE_BACKGROUND=`tarsk.general.imageBackground`,e.WALLPAPER_MODE=`tarsk.general.wallpaperMode`,e.WALLPAPER_COLOR=`tarsk.general.wallpaperColor`,e.BRAND_COLOR=`tarsk.general.brandColor`,e.OPEN_WITH_PROGRAM=`tarsk.general.openWithProgram`,e.SERVER_URL=`tarsk.server.url`,e.SERVER_BIND_MODE=`tarsk.general.serverBindMode`,e.HISTORY_COLUMNS=`tarsk.settings.historyColumns`,e}({}),be=function(e){return e.MESSAGE_HISTORY=`chat_message_history`,e.BASH_COMMAND_DURATIONS=`tarsk.bash-command-durations`,e.SKILL_CATALOG_PREFIX=`tarsk.skills.catalog.`,e.SKILL_SOURCE_SELECTION=`tarsk.skills.selectedSource`,e}({});function z(e){return typeof localStorage>`u`?null:localStorage.getItem(e)}function B(e,t){typeof localStorage>`u`||localStorage.setItem(e,t)}function xe(e){return typeof sessionStorage>`u`?null:sessionStorage.getItem(e)}function Se(e,t){typeof sessionStorage>`u`||sessionStorage.setItem(e,t)}function Ce(e=`npm`){return z(`tarsk.create-project.packageManager`)??e}function we(e){B(`tarsk.create-project.packageManager`,e)}function Te(e=`pull-request`){return z(`tarsk.create-project.commitMethod`)??e}function Ee(e){B(`tarsk.create-project.commitMethod`,e)}function De(e=``){return z(`tarsk.create-project.templateId`)??e}function Oe(e){B(`tarsk.create-project.templateId`,e)}function ke(e=!1){let t=z(`autoGenerateCommitMessage`);return t===null?e:t===`true`}function Ae(e){B(`autoGenerateCommitMessage`,e.toString())}function je(e=!1){let t=z(`autoGeneratePRInfo`);return t===null?e:t===`true`}function Me(e){B(`autoGeneratePRInfo`,e.toString())}function Ne(e=!1){let t=z(`createBranchAfterPR`);return t===null?e:t===`true`}function Pe(e){B(`createBranchAfterPR`,e.toString())}function Fe(e=!1){let t=z(`privateRepositoryDefault`);return t===null?e:t===`true`}function Ie(e){B(`privateRepositoryDefault`,e.toString())}function Le(e=!1){let t=z(`newChatOnNewBranch`);return t===null?e:t===`true`}function Re(e){B(`newChatOnNewBranch`,e.toString())}function ze(e){let t=z(`scroll-position-`+e),n=t===null?null:Number(t);return n!==null&&Number.isFinite(n)?n:null}function Be(e,t){B(`scroll-position-`+e,String(t))}function Ve(){let e=xe(`chat_message_history`);return e?JSON.parse(e):[]}function He(e){let t=Ve();e.trim()&&t[t.length-1]!==e&&(t.push(e),Se(`chat_message_history`,JSON.stringify(t)))}function Ue(e){return typeof sessionStorage>`u`?null:sessionStorage.getItem(e)}function We(e,t){typeof sessionStorage>`u`||sessionStorage.setItem(e,t)}function Ge(e=`default`){return Ue(`tarsk.skills.selectedSource`)??e}function Ke(e){We(`tarsk.skills.selectedSource`,e)}function qe(e){return`tarsk.skills.catalog.${e}`}function Je(e){let t=Ue(qe(e));if(!t)return null;try{return JSON.parse(t)}catch{return null}}function Ye(e,t){We(qe(e),JSON.stringify(t))}function Xe(e){typeof sessionStorage>`u`||sessionStorage.removeItem(qe(e))}var Ze=`tarsk.skills.customSources`;function Qe(){if(typeof localStorage>`u`)return[];let e=localStorage.getItem(Ze);if(!e)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>typeof e==`object`&&!!e&&typeof e.id==`string`&&typeof e.title==`string`&&typeof e.url==`string`):[]}catch{return[]}}function $e(){typeof localStorage>`u`||localStorage.removeItem(Ze)}function et(e=100){let t=z(`tarsk.general.fontScale`);if(t!==null){let e=Number(t);if(Number.isFinite(e)&&e>=50&&e<=300)return e}return e}function tt(e){B(`tarsk.general.fontScale`,String(e))}function nt(e=80){let t=z(`tarsk.general.frostedPanelOpacity`);if(t!==null){let e=Number(t);if(Number.isFinite(e)&&e>=60&&e<=100)return e}return e}function rt(e){B(`tarsk.general.frostedPanelOpacity`,String(e))}var it=new Set([`image`,`background`,`color`]),at=/^#[0-9a-fA-F]{6}$/,ot=`#1f2937`,st=`#82c309`;function ct(e){return e!==null&&it.has(e)}function lt(e=`background`){let t=z(`tarsk.general.wallpaperMode`);if(ct(t))return t;if(t===`brand`)return`background`;let n=z(`tarsk.general.imageBackground`);return n===`false`?`background`:n===`true`?`image`:e}function ut(e){B(`tarsk.general.wallpaperMode`,e)}function dt(e=ot){let t=z(`tarsk.general.wallpaperColor`);return t!==null&&at.test(t)?t:e}function ft(e){at.test(e)&&B(`tarsk.general.wallpaperColor`,e.toLowerCase())}function pt(e=st){let t=z(`tarsk.general.brandColor`);return t!==null&&at.test(t)?t:e}function mt(e){at.test(e)&&B(`tarsk.general.brandColor`,e.toLowerCase())}function ht(e=`VS Code`){return z(`tarsk.general.openWithProgram`)??e}function gt(e){B(`tarsk.general.openWithProgram`,e)}function _t(e){if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.fetchedAt==`number`&&(t.serverBindMode===`local`||t.serverBindMode===`network`)&&Array.isArray(t.networkAddresses)&&t.networkAddresses.every(e=>typeof e==`string`)}function vt(){let e=z(`tarsk.general.serverBindMode`);if(!e)return null;try{let t=JSON.parse(e);return _t(t)?t:null}catch{return null}}function yt(e){B(`tarsk.general.serverBindMode`,JSON.stringify({...e,fetchedAt:e.fetchedAt??Date.now()}))}function bt(){return typeof window>`u`?null:window.Capacitor?.getPlatform?.()??null}function xt(){return Et()&&bt()===`ios`}function St(){return z(ye.SERVER_URL)}function Ct(e){B(ye.SERVER_URL,e)}function wt(e){try{return new URL(e).hostname}catch{return``}}function Tt(e){let t=e.trim();if(!t)return``;let n=t.replace(/^https?:\/\//,``).split(`/`)[0]?.split(`:`)[0]??``;return n?`http://${n}:641`:``}function Et(){if(typeof window>`u`)return!1;if(window.Capacitor?.isNativePlatform?.())return!0;let e=window.location.protocol;return e===`capacitor:`||e===`ionic:`||e===`file:`}function Dt(){let e=St();if(e){let t=wt(e);if(t)return t}return Et()?``:document.location.hostname}async function Ot(e){try{return(await fetch(`${e.replace(/\/$/,``)}/health`,{method:`GET`})).ok}catch{return!1}}function kt(e){let t=Tt(e);if(t){if(Et()){Ct(t),window.location.reload();return}window.location.assign(t)}}function At(){return typeof window<`u`&&`__electrobunWebviewId`in window}function jt(){return typeof document<`u`&&document.location.port===`8100`}function Mt(){if(typeof document>`u`)return null;let{protocol:e,hostname:t,port:n,host:r,origin:i}=document.location;return e!==`http:`&&e!==`https:`?null:i||`${e}//${r??(n?`${t}:${n}`:t)}`}function Nt(){if(typeof document>`u`)return`http://localhost:641`;let{hostname:e,port:t}=document.location;return t===`8100`?`http://${e}:462`:Mt()||`http://${e}:641`}function Pt(){if(At()){let e=Mt();if(e)return e}if(!Et())return Nt();let e=St();return e?e.replace(/\/$/,``):Nt()}function V(e){let t=e.startsWith(`/`)?e:`/${e}`;return`${Pt()}${t}`}function Ft(e){if(!e)return`Unknown error`;if(typeof e.error==`string`)return e.error.trim()||`Unknown error`;if(e.error&&typeof e.error==`object`){let t=e.error.message;if(typeof t==`string`&&t.trim())return t.trim();let n=e.error.details;return typeof n==`string`&&n.trim()?n.trim():`Unknown error`}return`Unknown error`}async function It(e){try{return Ft(await e.json())}catch{}return e.statusText||`Unknown error`}function Lt(e,t,n){let r=Error(e);return n?.error&&typeof n.error==`object`&&(r.details=n.error.details,r.code=n.error.code),r}async function Rt(e){let t;try{t=await e.json()}catch{}throw Lt(Ft(t)||e.statusText||`Unknown error`,e,t)}async function zt(e,t){let n=await fetch(V(e),{...t,method:`GET`});if(!n.ok){let e=await It(n);throw Error(e)}return n.blob()}async function H(e,t){let n=await fetch(V(e),{...t,method:`GET`});if(!n.ok){let e=await It(n);throw Error(e)}return n.json()}async function U(e,t,n){let r=await fetch(V(e),{...n,method:`POST`,headers:{"Content-Type":`application/json`,...n?.headers},body:t?JSON.stringify(t):void 0});if(!r.ok){let e=await It(r);throw Error(e)}return r.json()}async function Bt(e,t,n){let r=await fetch(V(e),{...n,method:`POST`,headers:{"Content-Type":`application/json`,...n?.headers},body:t?JSON.stringify(t):void 0});if(!r.ok){let e=await It(r);throw Error(e)}return r.blob()}async function Vt(e,t,n){let r=await fetch(V(e),{...n,method:`POST`,headers:{"Content-Type":`application/octet-stream`,...n?.headers},body:t});if(!r.ok){let e=await It(r);throw Error(e)}return r.json()}async function Ht(e,t,n){let r=await fetch(V(e),{...n,method:`PUT`,headers:{"Content-Type":`application/json`,...n?.headers},body:t?JSON.stringify(t):void 0});if(!r.ok){let e=await It(r);throw Error(e)}return r.json()}async function Ut(e,t,n){let r=await fetch(V(e),{...n,method:`PATCH`,headers:{"Content-Type":`application/json`,...n?.headers},body:t?JSON.stringify(t):void 0});if(!r.ok){let e=await It(r);throw Error(e)}return r.json()}async function Wt(e,t,n){let r=await fetch(V(e),{...n,method:`PUT`,headers:{"Content-Type":`application/json`,...n?.headers},body:t?JSON.stringify(t):void 0});if(!r.ok){let e=await It(r);throw Error(e)}return r.body}async function W(e,t){let n=await fetch(V(e),{...t,method:`DELETE`});if(!n.ok){let e=await It(n);throw Error(e)}if(n.status!==204)return n.json()}async function Gt(e,t){let n=await fetch(V(e),{...t,method:`DELETE`});if(!n.ok){let e=await It(n);throw Error(e)}return n.body}async function Kt(e,t,n){let r=await fetch(V(e),{...n,method:`POST`,headers:{"Content-Type":`application/json`,...n?.headers},body:t?JSON.stringify(t):void 0,signal:n?.signal});return r.ok||await Rt(r),r.body}async function qt(e,t){let n=await fetch(V(e),{...t,method:`GET`});return n.ok||await Rt(n),n.body}async function Jt(e,t,n){let r=await fetch(V(e),{...n,method:`POST`,headers:{"Content-Type":`application/json`,...n?.headers},body:t?JSON.stringify(t):void 0});if(!r.ok){let e;try{e=await r.json()}catch{}throw Lt(Ft(e)||r.statusText||`Unknown error`,r,e)}return r.json()}async function Yt(e,t,n){let r=await fetch(V(e),{...n,method:`PUT`,headers:{"Content-Type":`application/json`,...n?.headers},body:t?JSON.stringify(t):void 0});if(!r.ok){let e;try{e=await r.json()}catch{}throw Lt(Ft(e)||r.statusText||`Unknown error`,r,e)}return r.json()}function G(...e){return e.map(e=>encodeURIComponent(String(e))).join(`/`)}var Xt=O(`gitops.ttl-cache`),K=new class{cache=new Map;inFlightRequests=new Map;generations=new Map;async get(e,t,n){let r=e.startsWith(`unified-git-status-`),i=r?performance.now():0,a=this.inFlightRequests.get(e);if(a)return r&&Xt.debug(`in-flight-reuse`,{key:e}),a;let o=this.cache.get(e);if(o&&Date.now()<o.expires){if(r){let t=Math.round(performance.now()-i);Xt.debug(`cache hit`,{key:e,duration:t})}return o.data}r&&Xt.debug(`cache miss, fetching`,{key:e});let s=this.generations.get(e)??0,c=t().then(t=>{if((this.generations.get(e)??0)===s){if(this.cache.set(e,{data:t,expires:Date.now()+n}),r){let t=Math.round(performance.now()-i);Xt.debug(`stored in cache`,{key:e,duration:t})}}else r&&Xt.debug(`skipped stale cache write`,{key:e});return t}).finally(()=>{this.inFlightRequests.get(e)===c&&this.inFlightRequests.delete(e)});return this.inFlightRequests.set(e,c),c}getSync(e){let t=this.cache.get(e);if(t&&Date.now()<t.expires)return t.data}bumpGeneration(e){this.generations.set(e,(this.generations.get(e)??0)+1)}invalidate(e){this.cache.delete(e),this.inFlightRequests.delete(e),this.bumpGeneration(e)}invalidatePattern(e){let t=[];for(let n of this.cache.keys())e.test(n)&&t.push(n);for(let n of this.inFlightRequests.keys())e.test(n)&&!t.includes(n)&&t.push(n);for(let e of t)this.cache.delete(e),this.inFlightRequests.delete(e),this.bumpGeneration(e)}clear(){for(let e of new Set([...this.cache.keys(),...this.inFlightRequests.keys(),...this.generations.keys()]))this.bumpGeneration(e);this.cache.clear(),this.inFlightRequests.clear()}};function Zt(e,t){let n=URL.createObjectURL(e),r=document.createElement(`a`);r.href=n,r.download=t,r.rel=`noopener`,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(n)}function Qt(e,t=`image/png`){let n=atob(e),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return new Blob([r],{type:t})}function $t(e){let t=e.indexOf(`,`),n=e.slice(0,t);return Qt(e.slice(t+1),n.match(/^data:([^;]+)/)?.[1]??`image/png`)}async function en(e){if(e.imageData)return Qt(e.imageData);if(e.imageUrl){if(e.imageUrl.startsWith(`data:`))return $t(e.imageUrl);let t=s(e.imageUrl,Pt()),n=await fetch(t);if(!n.ok)throw Error(`Failed to fetch image: ${n.status}`);return n.blob()}throw Error(`imageUrl or imageData is required`)}function tn(e){return!e.imageUrl||i(e.imageUrl)?e:{...e,imageUrl:s(e.imageUrl,Pt())}}async function nn(e){let t=e.filename??`generated-image-${Date.now()}.png`;try{return Zt(await en(e),t),{path:t}}catch{if(!e.imageUrl||e.imageUrl.startsWith(`data:`))throw Error(`imageUrl or imageData is required`);let n=document.createElement(`a`);return n.href=e.imageUrl,n.download=t,n.target=`_blank`,n.rel=`noopener noreferrer`,document.body.appendChild(n),n.click(),document.body.removeChild(n),{path:t}}}async function rn(e){let t=await en(e);if(!navigator.clipboard?.write)throw Error(`Clipboard API not available`);let n=t.type||`image/png`,r=t.type?t:new Blob([t],{type:n});await navigator.clipboard.write([new ClipboardItem({[n]:r})])}async function an(e){return At()?U(`api/image/save`,tn(e)):nn(e)}async function on(e){if(At()){await U(`api/image/clipboard`,tn(e));return}await rn(e)}function sn(e){let t=e.trim().toLowerCase();return t===`load failed`||t.includes(`failed to fetch`)||t.includes(`network error`)||t.includes(`network connection was lost`)||t.includes(`networkrequestfailed`)||t.includes(`networkrequest failed`)||t.includes(`socket is not connected`)}function cn(e){if(e instanceof Error&&`code`in e&&typeof e.code==`string`)return e.code}function ln(e){if(cn(e)===`THREAD_BUSY`)return!0;if(!(e instanceof Error))return!1;let t=e.message.toLowerCase();return t.includes(`already processing a message`)||t.includes(`already being processed`)||t.includes(`multiple chat windows are processing`)}function un(e,t){return ln(e)?t?.trim()?!0:e instanceof Error?!e.message.toLowerCase().includes(`multiple chat windows`):!1:!1}var dn=50;function fn(e,t,n,r,i){let a=e.getReader(),o=!1;function s(){o=!0,a.cancel().catch(()=>{})}let c=new TextDecoder,l=``,u=0;function d(e){let t=e.content?.trim();if(t)return E(t);let n=e.error?.message?.trim();if(n)return E(n);let r=e.message?.trim();return r?E(r):`Unknown error`}function f(e){if(!e)return!1;let t=e.trim();return t.length>200?!1:[/^Cannot read properties/i,/^Error:/i,/^TypeError:/i,/^ReferenceError:/i,/^SyntaxError:/i,/^failed to/i,/^error:/i,/^forbidden/i,/^unauthorized/i].some(e=>e.test(t))}async function p(){u+=1,!(u<dn)&&(u=0,await new Promise(e=>{setTimeout(e,0)}))}async function m(e){return e.type===`ping`?`continue`:e.type===`error`?(r(d(e)),n(),`stop`):e.type===`message`?(i?.({role:e.role??`assistant`,content:e.content??``,isThinking:e.isThinking}),`continue`):e.type===`complete`?(n(),`stop`):e.type===`result`&&f(e.content)?(r(E(e.content??`Unknown error`)),n(),`stop`):(t(e),await p(),`continue`)}async function h(){if(!l.trim())return`continue`;try{return await m(JSON.parse(l))}catch{return l.trim()&&t({type:`result`,content:l}),`continue`}}async function g(e){let t=e.trim();if(!t)return`continue`;try{return await m(JSON.parse(t))}catch{return`continue`}}async function _(){try{for(;!o;){let{done:e,value:t}=await a.read();if(e||o){if(!o&&e){if(await h()===`stop`)return;n()}break}l+=c.decode(t,{stream:!0});let r=l.split(`
2
2
  `);l=r.pop()??``;for(let e of r)if(o||await g(e)===`stop`)return}}catch(e){o||(r(e instanceof Error?e.message:`Stream error`),n())}}return _(),s}var pn=O(`gitops.api`);async function mn(e,t=!1,n=!1){let r=new URLSearchParams;t&&r.set(`fresh`,`true`),n&&r.set(`asyncRefresh`,`true`);let i=r.toString(),a=i?`api/git/unified-status/${G(e)}?${i}`:`api/git/unified-status/${G(e)}`,o=performance.now();pn.debug(`getUnifiedGitStatus start`,{threadId:e,fresh:t});try{return await H(a)}finally{let n=Math.round(performance.now()-o);pn.debug(`getUnifiedGitStatus end`,{threadId:e,fresh:t,duration:n})}}async function hn(e,t,n){return(await U(`api/git/generate-commit-message/${G(e)}`,{model:t,provider:n})).message}async function gn(e,t){await U(`api/git/commit/${G(e)}`,{message:t})}async function _n(e){await U(`api/git/push/${G(e)}`)}async function vn(e){await U(`api/git/pull/${G(e)}`)}async function yn(e){return U(`api/git/sync-branch/${G(e)}`,{})}async function bn(e,t,n){return U(`api/git/generate-pr-info/${G(e)}`,{model:t,provider:n})}async function xn(e,t,n,r){return U(`api/git/create-pr/${G(e)}`,{title:t,description:n,baseBranch:r})}async function Sn(e){await U(`api/git/fetch/${G(e)}`)}async function Cn(e,t,n){return U(`api/git/create-branch/${G(e)}`,{baseBranch:t,branchName:n})}async function wn(e,t){return U(`api/git/revert-file/${G(e)}`,{filePath:t})}async function Tn(e,t=50){return(await H(`api/git/log/${G(e)}?limit=${t}`)).commits}async function En(e){return H(`api/git/pr-status/${G(e)}`)}async function Dn(e,t,n,r){return U(`api/git/create-repo/${G(e)}`,{repoName:t,description:n,isPrivate:r})}async function On(e,t){return U(`api/git/checkpoint/${G(e)}`,{messageId:t})}async function kn(e,t){return U(`api/git/checkpoint-restore/${G(e)}`,{checkpointRef:t})}async function An(e){return H(`api/git/diff/${G(e)}`)}async function jn(e,t,n){return zt(`api/git/media/${G(e)}?path=${encodeURIComponent(t)}&version=${n}`)}async function Mn(){return(await H(`api/skills/popular`)).skills??[]}async function Nn(){return(await H(`api/skills/sources`)).sources??[]}async function Pn(e){return(await H(`api/skills/catalog?${new URLSearchParams({sourceId:e}).toString()}`)).skills??[]}async function Fn(e,t){return U(`api/skills/sources/verify`,{title:e,url:t})}async function In(e,t,n){return Ht(`api/skills/sources/${G(e)}`,{title:t,url:n})}async function Ln(e){await W(`api/skills/sources/${G(e)}`)}async function Rn(e){return(await U(`api/skills/sources/import`,{sources:e})).sources??[]}async function zn(e,t){return H(`api/skills/catalog/files?${new URLSearchParams({sourceId:e,skillId:t}).toString()}`)}async function Bn(e,t,n){return H(`api/skills/catalog/file?${new URLSearchParams({sourceId:e,skillId:t,relativePath:n}).toString()}`)}async function Vn(){return(await H(`api/agents/popular`)).agents??[]}async function Hn(){return(await H(`api/rules/popular`)).rules??[]}async function Un(){return(await H(`api/slash-commands/popular`)).commands??[]}async function Wn(e,t,n,r,i){return U(`api/threads/${G(e)}/ai-files/github-folder`,{gitHubRepo:t,gitHubFolder:n,destPath:r,gitHubRef:i})}async function Gn(e,t,n,r){return U(`api/threads/${G(e)}/ai-files/catalog-skill`,{sourceId:t,skillId:n,destPath:r})}var Kn=t({EmptyBalanceError:()=>Jn,LOW_BALANCE_THRESHOLD:()=>50,acknowledgeBrowserJsStarted:()=>ya,applyAppUpdate:()=>fa,authorizeMCPOAuth:()=>Ea,checkBalance:()=>Yn,checkForAppUpdate:()=>da,checkGitInstalled:()=>Qi,checkVpInstalled:()=>Zn,clearChatHistory:()=>si,clearConversationHistory:()=>oa,clearLogFeed:()=>hr,clearProjectTaskModifications:()=>Nr,clearSlackTokens:()=>br,compactChat:()=>ci,completeOnboarding:()=>$i,copyImageToClipboard:()=>Di,createFolderProject:()=>Lr,createProject:()=>Pr,createProjectFromZip:()=>zr,createScaffoldedProject:()=>$n,createSlackBinding:()=>xr,createSlashCommand:()=>ia,createThread:()=>Jr,createThreadAgent:()=>Fa,createThreadSkill:()=>Pa,createUserTask:()=>Ui,deleteAccount:()=>lr,deleteCommand:()=>Fi,deleteMCPServer:()=>wa,deleteProject:()=>Kr,deleteProjectAIFile:()=>Aa,deleteSlackBinding:()=>Sr,deleteSlashCommand:()=>aa,deleteThread:()=>Yr,deleteThreadAIFile:()=>Ia,deleteUserTask:()=>Wi,disableImageModel:()=>Ti,disableModel:()=>yi,enableImageModel:()=>wi,enableModel:()=>vi,exportProjectPlugin:()=>ki,fetchAllAvailableModels:()=>_i,fetchAvailableImageModels:()=>Si,fetchAvailableModels:()=>gi,fetchPendingAskUserQuestions:()=>pa,fixComments:()=>$r,freeDevServerPort:()=>Ji,generateImage:()=>Ei,generateThreadTitle:()=>Zr,getAccountInfo:()=>cr,getAccountSettings:()=>pr,getAllEnabledImageModels:()=>Ci,getAllEnabledModels:()=>xi,getAvailablePrograms:()=>Tr,getChatHistory:()=>ti,getCliProcesses:()=>Er,getContextBreakdown:()=>la,getConversationFolderPath:()=>ri,getConversationUsage:()=>ca,getGitUser:()=>Ar,getGitUserName:()=>jr,getLatencyStatistics:()=>fr,getMCPConfig:()=>Sa,getMCPOAuthStatus:()=>Da,getObservationPage:()=>ni,getOnboardingStatus:()=>Zi,getPackageScripts:()=>Ii,getPopularMCPServers:()=>Ta,getProcessingState:()=>Or,getProcessingThreads:()=>kr,getProject:()=>Br,getProjectAIFiles:()=>ka,getProjectEnvVars:()=>Vr,getProjectScripts:()=>Ri,getProjectSystemPrompt:()=>Xi,getProjectWindowState:()=>Hr,getProjects:()=>Mr,getProviderCredits:()=>rr,getProviderLogoCdnUrl:()=>nr,getProviderLogoUrl:()=>tr,getProviders:()=>er,getRecentConversations:()=>sa,getRecommendedModels:()=>ta,getScaffoldTemplates:()=>Xn,getSessionToolLearnings:()=>ii,getSlackManifest:()=>vr,getSlackSettings:()=>mr,getSlashCommands:()=>na,getSlashCommandsAndSkills:()=>ra,getSpendSummary:()=>dr,getThread:()=>Vi,getThreadAIFile:()=>Ma,getThreadAIFiles:()=>ja,getThreadFiles:()=>Li,getToolDefinitionsBreakdown:()=>ua,getUserTasks:()=>Hi,installProjectPluginImport:()=>ji,installVp:()=>Qn,invalidateProjectsCache:()=>qr,isDevServerRunning:()=>Yi,killCliProcess:()=>Dr,openExternalUrl:()=>sr,openFolderProject:()=>Fr,openPathProject:()=>Ir,openProjectWith:()=>di,openThreadWith:()=>fi,postClientLog:()=>_r,previewProjectPluginImport:()=>Ai,processVoiceTranscript:()=>wr,quitAccount:()=>ur,refreshModels:()=>Ni,replaceUniqueProjectText:()=>Wr,reportBrowserActionResult:()=>xa,reportBrowserWebviewReady:()=>ba,resetOnboarding:()=>ea,revokeMCPOAuth:()=>Oa,routeChatPrompt:()=>Qr,runProjectScript:()=>zi,saveCommand:()=>Pi,saveImageToDownloads:()=>Oi,saveMCPServer:()=>Ca,saveModelSettings:()=>bi,saveProjectWindowState:()=>Ur,saveProviderEnvironment:()=>ar,saveProviderKey:()=>ir,saveThreadAIFile:()=>Na,selectThread:()=>ei,sendChatMessage:()=>ai,setSlackTokens:()=>yr,startDevServer:()=>Ki,stopChatGeneration:()=>li,stopDevServer:()=>qi,stopProjectScript:()=>Bi,streamLogFeed:()=>gr,submitAskUserAnswer:()=>ma,submitBrowserJsResult:()=>va,submitSeatbeltEscalationResponse:()=>ga,submitShellPermissionResponse:()=>ha,submitWebFetchPermissionResponse:()=>_a,subscribeToChatStream:()=>oi,suggestRunCommand:()=>Gi,syncProjectEnvVars:()=>Gr,ttlCache:()=>K,updateAccountSettings:()=>Cr,updateProject:()=>ui,updateProjectName:()=>hi,updateProjectOpenWith:()=>pi,updateProjectSetupScript:()=>mi,updateThread:()=>Xr,uploadProjectPlugin:()=>Mi}),qn=O(`gitops.api`),Jn=class extends Error{constructor(){super(`No prompts remaining`),this.name=`EmptyBalanceError`}};async function Yn(){let{plan:e,promptsRemaining:t}=await cr();return e===`unlimited-pro`?{isEmpty:!1,isLow:!1}:{isEmpty:t<=0,isLow:t>0&&t<=50}}async function Xn(){return H(`api/scaffold/templates`)}async function Zn(){return(await H(`api/scaffold/check-vp`)).installed}async function Qn(){return U(`api/scaffold/install-vp`,{})}async function $n(e,t,n){return Kt(`api/scaffold`,{projectName:e,templateId:t,packageManager:n})}async function er(){return K.get(`providers`,async()=>H(`api/providers`),6e4)}function tr(e){return`${Pt()}/api/providers/${G(e)}/logo`}function nr(e){return`https://models.tarsk.io/svg/${G(e)}.svg`}async function rr(e){return K.get(`provider-credits-${e}`,async()=>H(`api/providers/${G(e)}/credits`),3e4)}async function ir(e,t){await U(`api/providers/keys`,{providerName:e,apiKey:t}),K.invalidate(`providers`)}async function ar(e){await U(`api/providers/env`,{values:e}),K.invalidate(`providers`)}function or(e){return typeof window>`u`?!1:window.open(e,`_blank`,`noopener,noreferrer`)!==null}async function sr(e){if(typeof window<`u`&&!At()){or(e);return}try{await U(`api/providers/open-external`,{url:e})}catch(t){if(or(e))return;throw t instanceof Error?t:Error(`Failed to open URL`)}}async function cr(){return H(`api/account/info`)}async function lr(){return U(`api/account/delete`,{})}async function ur(){return U(`api/account/quit`,{})}async function dr(){return H(`api/account/spend`)}async function fr(){return H(`api/account/statistics`)}async function pr(){return H(`api/account/settings`)}async function mr(){return H(`api/slack/settings`)}async function hr(){await W(`api/logs`)}async function gr(e){return qt(`api/logs/stream`,e)}async function _r(e){try{await U(`api/logs`,e)}catch(e){qn.debug(`Failed to post client log entry`,e)}}async function vr(){return H(`api/slack/manifest`)}async function yr(e){return Ht(`api/slack/tokens`,e)}async function br(){await W(`api/slack/tokens`)}async function xr(e){return U(`api/slack/bindings`,e)}async function Sr(e,t){await W(`api/slack/bindings/${G(e)}/${G(t)}`)}async function Cr(e){return Ht(`api/account/settings`,e)}async function wr(e,t){return(await U(`api/voice-model/process-transcript`,{text:e,threadId:t?.threadId,provider:t?.provider,model:t?.model})).text}async function Tr(){return K.get(`available-programs`,async()=>(await H(`api/programs`)).programs??[],3e5)}async function Er(){return(await H(`api/processes`)).processes}async function Dr(e){await U(`api/processes/${G(e)}/kill`)}async function Or(){return K.get(`processing-threads`,async()=>{let e=await H(`api/threads/processing`);return{processingThreadIds:e.processingThreadIds??[],processingRuns:e.processingRuns??[]}},0)}async function kr(){return(await Or()).processingThreadIds}async function Ar(){return K.get(`git-user`,async()=>{try{let e=await H(`api/git/user`);return{name:e.name??``,email:e.email??``}}catch{return{name:``,email:``}}},6e5)}async function jr(){return(await Ar()).name}async function Mr(){return K.get(`projects`,async()=>{let e=await H(`api/projects`),t=Array.isArray(e)?e:e.projects??[],n=Array.isArray(e)?null:e.cloneRootPath??null;return{projects:(t||[]).map(e=>{let t=e;return{projectId:t.projectId??t.id,name:t.name,gitUrl:t.gitUrl,projectPath:t.projectPath??t.path,threads:t.threads??[],commands:t.commands??[],setupScript:t.setupScript,validationScript:t.validationScript,runCommand:t.runCommand,planPrompt:t.planPrompt,testPrompt:t.testPrompt,reviewPrompt:t.reviewPrompt,customSystemPrompt:t.customSystemPrompt,useCustomSystemPrompt:!!t.useCustomSystemPrompt,allowAllCommands:t.allowAllCommands!==!1,allowedCommandPatterns:t.allowedCommandPatterns??[],modelAliases:t.modelAliases??void 0,defaultChatMode:C(t.defaultChatMode)?t.defaultChatMode:void 0,disabledTools:t.disabledTools??void 0,smartJsEnabled:t.smartJsEnabled===!0,useBuiltInBrowser:t.useBuiltInBrowser!==!1,projectIcon:t.projectIcon,tasksModifiedCount:Number(t.tasksModifiedCount)||0}}).map(e=>{let t=(e.threads||[]).map(e=>{let t=e,n=t.threadId??t.id;return{threadId:n,title:t.title??n,path:t.path??``,currentBranch:t.currentBranch??``,isSelected:!!t.isSelected,model:t.model??void 0,modelProvider:t.modelProvider??void 0,gitStatusDot:T(t.gitStatusDot)}});return{...e,threads:t}}),cloneRootPath:n}},3e4)}async function Nr(e){await U(`api/projects/${G(e)}/tasks/clear-modifications`)}async function Pr(e,t){return Kt(`api/projects`,{gitUrl:e,commitMethod:t})}async function Fr(){return Kt(`api/projects/open-folder`,{})}async function Ir(e){return Kt(`api/projects/open-path`,{path:e})}async function Lr(e){return Kt(`api/projects/new-folder`,{projectName:e})}function Rr(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>{let e=typeof r.result==`string`?r.result:``,n=e.indexOf(`,`);t(n>=0?e.slice(n+1):e)},r.onerror=()=>n(r.error),r.readAsDataURL(e)})}async function zr(e,t,n){return Kt(`api/projects/from-zip`,{data:await Rr(e),name:t,overrideProjectId:n})}async function Br(e){return K.get(`project-${e}`,async()=>{let t=await H(`api/projects/${G(e)}`);return{...t,projectPath:t.projectPath??t.path}},3e4)}async function Vr(e){return H(`api/projects/${G(e)}/env-vars`)}async function Hr(e){return(await H(`api/projects/${G(e)}/window-state`)).state}async function Ur(e,t){await Yt(`api/projects/${G(e)}/window-state`,{state:t})}async function Wr(e,t,n){return U(`api/projects/${G(e)}/replace-unique-text`,{oldText:t,newText:n})}async function Gr(e,t){await Ht(`api/projects/${G(e)}/env-vars`,{vars:t})}async function Kr(e){await W(`api/projects/${G(e)}`),K.invalidate(`projects`)}function qr(e){K.invalidate(`projects`),e&&K.invalidate(`project-${e}`)}async function Jr(e,t){return Kt(`api/threads`,{projectId:e,title:t})}async function Yr(e,t){let n=await Gt(`api/threads/${G(t)}?stream=true`);return K.invalidate(`projects`),n}async function Xr(e,t){await Ut(`api/threads/${G(e)}`,t),K.invalidate(`thread-${e}`),(`model`in t||`modelProvider`in t||`chatTitles`in t||`diffComments`in t)&&K.invalidate(`projects`)}async function Zr(e,t,n){return(await U(`api/threads/${G(e)}/generate-title`,{prompt:t,provider:n?.provider,model:n?.model})).title}async function Qr(e,t){return(await U(`api/chat/${G(e)}/auto-route`,{prompt:t})).decision}async function $r(e,t){return U(`api/threads/${G(e)}/fix-comments`,{comments:t})}async function ei(e,t){await U(`api/threads/${G(t)}/select`)}async function ti(e,t){let n=t?`?conversationId=${encodeURIComponent(t)}`:``;return{threadId:e,messages:await H(`api/threads/${G(e)}/messages${n}`)}}async function ni(e,t,n=1,r=2e3){let i=new URLSearchParams({offset:String(n),limit:String(r)});return H(`api/threads/${G(e)}/observations/${G(t)}?${i}`)}async function ri(e){return(await H(`api/threads/${G(e)}/conversation-folder-path`)).path}async function ii(e){return(await H(`api/threads/${G(e)}/session-learnings`)).learnings}async function ai(e,t,n,r=[],i,a,o,s,c,l,u){let{isEmpty:d}=await Yn();if(d)throw new Jn;return Kt(`api/chat`,{threadId:e,content:t,model:n,provider:a,planMode:o,ralphMode:s,orchestrateMode:u,checkpointRef:c,conversationId:l,attachments:r.map(e=>({name:e.fileName,content:e.content.split(`,`)[1]||e.content,size:0,mimeType:e.mimeType||`application/octet-stream`}))},{signal:i})}async function oi(e,t,n){let r=new URLSearchParams({replay:`compact`}),i=n?.trim();return i&&r.set(`conversationId`,i),qt(`api/chat/subscribe/${G(e)}?${r.toString()}`,{signal:t})}async function si(e){let t=await W(`api/chat/${G(e)}`);return K.invalidate(`thread-${e}`),t?.conversationId||``}async function ci(e,t){return Jt(`api/chat/${G(e)}/compact`,t)}async function li(e,t){try{let n=new URLSearchParams,r=t?.conversationId?.trim();r&&n.set(`conversationId`,r),t?.all&&n.set(`all`,`1`);let i=n.size>0?`?${n.toString()}`:``;await U(`api/chat/stop/${G(e)}${i}`)}catch{}}async function ui(e,t){return t.runNow&&t.setupScript?Wt(`api/projects/${G(e)}`,t):(await Yt(`api/projects/${G(e)}`,t),qr(e),null)}async function di(e,t){await Jt(`api/projects/${G(e)}/open`,{program:t})}async function fi(e,t){await Jt(`api/threads/${G(e)}/open`,{program:t})}async function pi(e,t){await ui(e,{program:t})}async function mi(e,t,n){return ui(e,{setupScript:t,runNow:n})}async function hi(e,t){await ui(e,{name:t})}async function gi(e,t){let n=new URLSearchParams({provider:e});t!==void 0&&n.set(`supportedTools`,t?`true`:`false`),n.set(`useCase`,`coding`);let r=`available-models-${n.toString()}`;return K.get(r,async()=>{let e=await H(`api/models?${n.toString()}`);return{models:e.models??[],enabledModelIds:e.enabledModelIds??[]}},12e4)}async function _i(e){let t=new URLSearchParams({useCase:e}),n=`available-models-all-${e}`;return K.get(n,async()=>(await H(`api/models/all?${t.toString()}`)).providers??{},12e4)}async function vi(e,t){await U(`api/models/${G(e,t)}/enable`),K.invalidate(`enabled-models`),K.invalidatePattern(/^available-models-/),K.invalidatePattern(/^available-image-models-/)}async function yi(e,t){await U(`api/models/${G(e,t)}/disable`),K.invalidate(`enabled-models`),K.invalidatePattern(/^available-models-/),K.invalidatePattern(/^available-image-models-/)}async function bi(e,t,n){await U(`api/models/${G(e,t)}/settings`,n),K.invalidatePattern(/^available-models-/),K.invalidate(`enabled-models`)}async function xi(){return K.get(`enabled-models`,async()=>(await H(`api/models/enabled?useCase=coding`)).enabledModels??{},12e4)}async function Si(e){let t=new URLSearchParams({provider:e,useCase:`image`}),n=`available-image-models-${e}`;return K.get(n,async()=>{let e=await H(`api/models?${t.toString()}`);return{models:e.models??[],enabledModelIds:e.enabledModelIds??[]}},12e4)}async function Ci(){return K.get(`enabled-image-models`,async()=>(await H(`api/models/enabled?useCase=image`)).enabledModels??{},12e4)}async function wi(e,t){await U(`api/models/${G(e,t)}/enable?useCase=image`),K.invalidate(`enabled-image-models`),K.invalidatePattern(/^available-models-/),K.invalidatePattern(/^available-image-models-/)}async function Ti(e,t){await U(`api/models/${G(e,t)}/disable?useCase=image`),K.invalidate(`enabled-image-models`),K.invalidatePattern(/^available-models-/),K.invalidatePattern(/^available-image-models-/)}async function Ei(e,t,n,r){return U(`api/image/generate`,{prompt:e,model:t,provider:n,threadId:r})}async function Di(e){await on(e)}async function Oi(e){return an(e)}async function ki(e,t){return Bt(`api/projects/${G(e)}/plugin-export`,t)}async function Ai(e,t){return U(`api/projects/${G(e)}/plugin-import/preview`,{url:t})}async function ji(e,t){return U(`api/projects/${G(e)}/plugin-import`,t)}async function Mi(e,t){return U(`api/projects/${G(e)}/plugin-upload`,t)}async function Ni(e){let t=await U(`api/models/${G(e)}/refresh`);return K.invalidatePattern(/^available-models-/),K.invalidatePattern(/^available-image-models-/),K.invalidate(`enabled-models`),K.invalidate(`enabled-image-models`),t.modelCount??0}async function Pi(e,t){await U(`api/projects/${G(e)}/commands`,t)}async function Fi(e,t){await W(`api/projects/${G(e)}/commands/${G(t)}`)}async function Ii(e){return H(`api/projects/${G(e)}/package-scripts`)}async function Li(e){return H(`api/threads/${G(e)}/files`)}async function Ri(e){return(await H(`api/threads/${G(e)}/project-scripts`)).scripts}async function zi(e,t,n,r){let{relativeFolder:i,...a}=r??{},o={scriptName:t,command:n};return i&&(o.relativeFolder=i),Kt(`api/threads/${G(e)}/project-scripts/run`,o,a)}async function Bi(e,t){return U(`api/threads/${G(e)}/project-scripts/stop`,{scriptName:t})}async function Vi(e){return K.get(`thread-${e}`,async()=>H(`api/threads/${e}`),45e3)}async function Hi(e){return(await H(`api/projects/${G(e)}/user-tasks`)).tasks??[]}async function Ui(e,t){return U(`api/projects/${G(e)}/user-tasks`,{content:t})}async function Wi(e,t){await W(`api/projects/${G(e)}/user-tasks/${G(t)}`)}async function Gi(e){return U(`api/projects/${G(e)}/run-suggest`,{})}async function Ki(e,t,n){return qn.info(`Start dev server requested`,{projectId:e,threadId:t}),K.invalidate(`dev-server-running-${e}`),Kt(`api/projects/${G(e)}/run`,{threadId:t},{signal:n})}async function qi(e){return K.invalidate(`dev-server-running-${e}`),U(`api/projects/${G(e)}/stop`,{})}async function Ji(e,t){return U(`api/projects/${G(e)}/free-port`,{port:t})}async function Yi(e){return K.get(`dev-server-running-${e}`,async()=>H(`api/projects/${G(e)}/running`),3e3)}async function Xi(e){return H(`api/projects/${G(e)}/system-prompt`)}async function Zi(){return H(`api/onboarding/status`)}async function Qi(){return H(`api/onboarding/git-check`)}async function $i(){return U(`api/onboarding/complete`,{})}async function ea(){return U(`api/onboarding/reset`,{})}async function ta(){return H(`api/onboarding/recommended-models`)}async function na(e){return(await H(`api/slash-commands?threadId=${G(e)}`)).commands??[]}async function ra(e){let t=await H(`api/slash-commands?threadId=${G(e)}`);return{commands:t.commands??[],skills:t.skills??[],bundledSkills:t.bundledSkills??[]}}async function ia(e,t,n,r,i){return U(`api/slash-commands`,{name:e,content:t,metadata:n,scope:r,threadId:i})}async function aa(e){let t=await fetch(`http://localhost:641/api/slash-commands`,{method:`DELETE`,headers:{"Content-Type":`application/json`},body:JSON.stringify({filePath:e})});if(!t.ok)throw Error(`Failed to delete slash command: ${t.statusText}`);return t.json()}async function oa(e){let t=new URLSearchParams;e?.threadId?t.set(`threadId`,e.threadId):e?.projectId&&t.set(`projectId`,e.projectId);let n=t.toString();await W(`api/conversations${n?`?${n}`:``}`)}async function sa(e=20,t=0){return H(`api/conversations/recent?limit=${Math.min(Math.max(e,1),100)}&offset=${Math.max(t,0)}`)}async function ca(e,t){return H(`api/conversations/${G(e)}/${G(t)}/usage`)}async function la(e,t,n){let r=`context-breakdown-${e}-${t}`;return n?.forceRefresh&&K.invalidate(r),K.get(r,async()=>H(`api/conversations/${G(e)}/${G(t)}/context`),45e3)}async function ua(e,t){return H(`api/conversations/${G(e)}/${G(t)}/context/tool-definitions`)}async function da(){try{return await H(`api/update/check`)}catch{return{updateAvailable:!1,supported:!1}}}async function fa(){return U(`api/update/apply`)}async function pa(){return(await H(`api/ask-user/pending`)).questions??[]}async function ma(e,t){await U(`api/ask-user/respond`,typeof t==`string`?{toolCallId:e,answer:t}:{toolCallId:e,answers:t})}async function ha(e,t,n){await U(`api/shell-permission/respond`,{toolCallId:e,decision:t,pattern:n?.pattern,projectId:n?.projectId})}async function ga(e,t){await U(`api/shell-permission/respond`,{toolCallId:e,escalationScope:t===`skip`?void 0:t,escalationDecision:t===`skip`?`skip`:void 0})}async function _a(e,t){await U(`api/web-fetch-permission/respond`,{toolCallId:e,decision:t})}async function va(e,t,n){await U(`api/browser-js/respond`,{toolCallId:e,result:t,threadId:n})}async function ya(e,t){await U(`api/browser-js/respond`,{toolCallId:e,started:!0,threadId:t})}async function ba(e,t){await U(`api/browser/ready`,{toolCallId:e,webviewId:t})}async function xa(e,t){await U(`api/browser/action-result`,{toolCallId:e,result:t})}async function Sa(e){return H(`api/mcp/config?projectPath=${encodeURIComponent(e)}`)}async function Ca(e,t,n){return Ht(`api/mcp/config`,{projectPath:e,serverName:t,serverConfig:n})}async function wa(e,t){return W(`api/mcp/config/${G(t)}?projectPath=${encodeURIComponent(e)}`)}async function Ta(){return(await H(`api/mcp/popular`)).servers??[]}async function Ea(e,t){return U(`api/mcp/oauth/authorize`,{projectPath:e,serverName:t})}async function Da(e,t){return H(`api/mcp/oauth/status?projectPath=${encodeURIComponent(e)}&serverName=${encodeURIComponent(t)}`)}async function Oa(e,t){return W(`api/mcp/oauth?projectPath=${encodeURIComponent(e)}&serverName=${encodeURIComponent(t)}`)}async function ka(e){return(await H(`api/projects/${G(e)}/ai-files`)).nodes??[]}async function Aa(e,t){return W(`api/projects/${G(e)}/ai-file?path=${encodeURIComponent(t)}`)}async function ja(e){return(await H(`api/threads/${G(e)}/ai-files`)).nodes??[]}async function Ma(e,t){return H(`api/threads/${G(e)}/ai-file?path=${encodeURIComponent(t)}`)}async function Na(e,t,n){return Ht(`api/threads/${G(e)}/ai-file`,{path:t,content:n})}async function Pa(e,t,n){return U(`api/threads/${G(e)}/ai-files/skill`,{name:t,description:n})}async function Fa(e,t,n,r){return U(`api/threads/${G(e)}/ai-files/agent`,{name:t,description:n,tools:r})}async function Ia(e,t){return W(`api/threads/${G(e)}/ai-file?path=${encodeURIComponent(t)}`)}typeof window<`u`&&window.document&&window.document.createElement;function q(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function La(e,t){let n=I.createContext(t),r=e=>{let{children:t,...r}=e,i=I.useMemo(()=>r,Object.values(r));return(0,R.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=I.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function Ra(e,t=[]){let n=[];function r(t,r){let i=I.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=I.useMemo(()=>o,Object.values(o));return(0,R.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=I.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>I.createContext(e));return function(n){let r=n?.[e]||t;return I.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,za(i,...t)]}function za(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return I.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}function Ba(e){let t=Va(e),n=I.forwardRef((e,n)=>{let{children:r,...i}=e,a=I.Children.toArray(r),o=a.find(Wa);if(o){let e=o.props.children,r=a.map(t=>t===o?I.Children.count(e)>1?I.Children.only(null):I.isValidElement(e)?e.props.children:null:t);return(0,R.jsx)(t,{...i,ref:n,children:I.isValidElement(e)?I.cloneElement(e,void 0,r):null})}return(0,R.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function Va(e){let t=I.forwardRef((e,t)=>{let{children:n,...r}=e;if(I.isValidElement(n)){let e=Ka(n),i=Ga(r,n.props);return n.type!==I.Fragment&&(i.ref=t?te(t,e):e),I.cloneElement(n,i)}return I.Children.count(n)>1?I.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ha=Symbol(`radix.slottable`);function Ua(e){let t=({children:e})=>(0,R.jsx)(R.Fragment,{children:e});return t.displayName=`${e}.Slottable`,t.__radixId=Ha,t}function Wa(e){return I.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Ha}function Ga(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function Ka(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var J=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Ba(`Primitive.${t}`),r=I.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,R.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function qa(e,t){e&&ve.flushSync(()=>e.dispatchEvent(t))}function Y(e){let t=I.useRef(e);return I.useEffect(()=>{t.current=e}),I.useMemo(()=>(...e)=>t.current?.(...e),[])}function Ja(e,t=globalThis?.document){let n=Y(e);I.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var Ya=`DismissableLayer`,Xa=`dismissableLayer.update`,Za=`dismissableLayer.pointerDownOutside`,Qa=`dismissableLayer.focusOutside`,$a,eo=I.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),to=I.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=I.useContext(eo),[u,d]=I.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=I.useState({}),m=L(t,e=>d(e)),h=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=h.indexOf(g),v=u?h.indexOf(u):-1,y=l.layersWithOutsidePointerEventsDisabled.size>0,b=v>=_,x=io(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!b||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),S=ao(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return Ja(e=>{v===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),I.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&($a=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),oo(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=$a)}},[u,f,n,l]),I.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),oo())},[u,l]),I.useEffect(()=>{let e=()=>p({});return document.addEventListener(Xa,e),()=>document.removeEventListener(Xa,e)},[]),(0,R.jsx)(J.div,{...c,ref:m,style:{pointerEvents:y?b?`auto`:`none`:void 0,...e.style},onFocusCapture:q(e.onFocusCapture,S.onFocusCapture),onBlurCapture:q(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:q(e.onPointerDownCapture,x.onPointerDownCapture)})});to.displayName=Ya;var no=`DismissableLayerBranch`,ro=I.forwardRef((e,t)=>{let n=I.useContext(eo),r=I.useRef(null),i=L(t,r);return I.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,R.jsx)(J.div,{...e,ref:i})});ro.displayName=no;function io(e,t=globalThis?.document){let n=Y(e),r=I.useRef(!1),i=I.useRef(()=>{});return I.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){so(Za,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function ao(e,t=globalThis?.document){let n=Y(e),r=I.useRef(!1);return I.useEffect(()=>{let e=e=>{e.target&&!r.current&&so(Qa,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function oo(){let e=new CustomEvent(Xa);document.dispatchEvent(e)}function so(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?qa(i,a):i.dispatchEvent(a)}var co=to,lo=ro,X=globalThis?.document?I.useLayoutEffect:()=>{},uo=I.useId||(()=>void 0),fo=0;function po(e){let[t,n]=I.useState(uo());return X(()=>{e||n(e=>e??String(fo++))},[e]),e||(t?`radix-${t}`:``)}var mo=[`top`,`right`,`bottom`,`left`],ho=Math.min,Z=Math.max,go=Math.round,_o=Math.floor,vo=e=>({x:e,y:e}),yo={left:`right`,right:`left`,bottom:`top`,top:`bottom`},bo={start:`end`,end:`start`};function xo(e,t,n){return Z(e,ho(t,n))}function So(e,t){return typeof e==`function`?e(t):e}function Co(e){return e.split(`-`)[0]}function wo(e){return e.split(`-`)[1]}function To(e){return e===`x`?`y`:`x`}function Eo(e){return e===`y`?`height`:`width`}var Do=new Set([`top`,`bottom`]);function Oo(e){return Do.has(Co(e))?`y`:`x`}function ko(e){return To(Oo(e))}function Ao(e,t,n){n===void 0&&(n=!1);let r=wo(e),i=ko(e),a=Eo(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=zo(o)),[o,zo(o)]}function jo(e){let t=zo(e);return[Mo(e),t,Mo(t)]}function Mo(e){return e.replace(/start|end/g,e=>bo[e])}var No=[`left`,`right`],Po=[`right`,`left`],Fo=[`top`,`bottom`],Io=[`bottom`,`top`];function Lo(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Po:No:t?No:Po;case`left`:case`right`:return t?Fo:Io;default:return[]}}function Ro(e,t,n,r){let i=wo(e),a=Lo(Co(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Mo)))),a}function zo(e){return e.replace(/left|right|bottom|top/g,e=>yo[e])}function Bo(e){return{top:0,right:0,bottom:0,left:0,...e}}function Vo(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Bo(e)}function Ho(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Uo(e,t,n){let{reference:r,floating:i}=e,a=Oo(t),o=ko(t),s=Eo(o),c=Co(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(wo(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function Wo(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=So(t,e),p=Vo(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Ho(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Ho(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Go=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=a.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Uo(l,r,c),f=r,p={},m=0;for(let n=0;n<s.length;n++){let{name:a,fn:h}=s[n],{x:g,y:_,data:v,reset:y}=await h({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:p,rects:l,platform:{...o,detectOverflow:o.detectOverflow??Wo},elements:{reference:e,floating:t}});u=g??u,d=_??d,p={...p,[a]:{...p[a],...v}},y&&m<=50&&(m++,typeof y==`object`&&(y.placement&&(f=y.placement),y.rects&&(l=y.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):y.rects),{x:u,y:d}=Uo(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:p}},Ko=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=So(e,t)||{};if(l==null)return{};let d=Vo(u),f={x:n,y:r},p=ko(i),m=Eo(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=ho(d[_],T),D=ho(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=xo(O,A,k),M=!c.arrow&&wo(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),qo=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=So(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Co(r),_=Oo(o),v=Co(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[zo(o)]:jo(o)),x=p!==`none`;!d&&x&&b.push(...Ro(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Ao(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==Oo(t))||T.every(e=>Oo(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Oo(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function Jo(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Yo(e){return mo.some(t=>e[t]>=0)}var Xo=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=So(e,t);switch(i){case`referenceHidden`:{let e=Jo(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Yo(e)}}}case`escaped`:{let e=Jo(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Yo(e)}}}default:return{}}}}},Zo=new Set([`left`,`top`]);async function Qo(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Co(n),s=wo(n),c=Oo(n)===`y`,l=Zo.has(o)?-1:1,u=a&&c?-1:1,d=So(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var $o=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Qo(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},es=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=So(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Oo(Co(i)),p=To(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=xo(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=xo(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},ts=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=So(e,t),u={x:n,y:r},d=Oo(i),f=To(d),p=u[f],m=u[d],h=So(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Zo.has(Co(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},ns=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=So(e,t),u=await o.detectOverflow(t,l),d=Co(i),f=wo(i),p=Oo(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=ho(h-u[g],v),x=ho(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=Z(u.left,0),t=Z(u.right,0),n=Z(u.top,0),r=Z(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:Z(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:Z(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function rs(){return typeof window<`u`}function is(e){return os(e)?(e.nodeName||``).toLowerCase():`#document`}function Q(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function as(e){return((os(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function os(e){return rs()?e instanceof Node||e instanceof Q(e).Node:!1}function ss(e){return rs()?e instanceof Element||e instanceof Q(e).Element:!1}function cs(e){return rs()?e instanceof HTMLElement||e instanceof Q(e).HTMLElement:!1}function ls(e){return!rs()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Q(e).ShadowRoot}var us=new Set([`inline`,`contents`]);function ds(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=ws(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!us.has(i)}var fs=new Set([`table`,`td`,`th`]);function ps(e){return fs.has(is(e))}var ms=[`:popover-open`,`:modal`];function hs(e){return ms.some(t=>{try{return e.matches(t)}catch{return!1}})}var gs=[`transform`,`translate`,`scale`,`rotate`,`perspective`],_s=[`transform`,`translate`,`scale`,`rotate`,`perspective`,`filter`],vs=[`paint`,`layout`,`strict`,`content`];function ys(e){let t=xs(),n=ss(e)?ws(e):e;return gs.some(e=>n[e]?n[e]!==`none`:!1)||(n.containerType?n.containerType!==`normal`:!1)||!t&&(n.backdropFilter?n.backdropFilter!==`none`:!1)||!t&&(n.filter?n.filter!==`none`:!1)||_s.some(e=>(n.willChange||``).includes(e))||vs.some(e=>(n.contain||``).includes(e))}function bs(e){let t=Es(e);for(;cs(t)&&!Cs(t);){if(ys(t))return t;if(hs(t))return null;t=Es(t)}return null}function xs(){return typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter`,`none`)}var Ss=new Set([`html`,`body`,`#document`]);function Cs(e){return Ss.has(is(e))}function ws(e){return Q(e).getComputedStyle(e)}function Ts(e){return ss(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Es(e){if(is(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||ls(e)&&e.host||as(e);return ls(t)?t.host:t}function Ds(e){let t=Es(e);return Cs(t)?e.ownerDocument?e.ownerDocument.body:e.body:cs(t)&&ds(t)?t:Ds(t)}function Os(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Ds(e),i=r===e.ownerDocument?.body,a=Q(r);if(i){let e=ks(a);return t.concat(a,a.visualViewport||[],ds(r)?r:[],e&&n?Os(e):[])}return t.concat(r,Os(r,[],n))}function ks(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function As(e){let t=ws(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=cs(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=go(n)!==a||go(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function js(e){return ss(e)?e:e.contextElement}function Ms(e){let t=js(e);if(!cs(t))return vo(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=As(t),o=(a?go(n.width):n.width)/r,s=(a?go(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Ns=vo(0);function Ps(e){let t=Q(e);return!xs()||!t.visualViewport?Ns:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Fs(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Q(e)?!1:t}function Is(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=js(e),o=vo(1);t&&(r?ss(r)&&(o=Ms(r)):o=Ms(e));let s=Fs(a,n,r)?Ps(a):vo(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=Q(a),t=r&&ss(r)?Q(r):r,n=e,i=ks(n);for(;i&&r&&t!==n;){let e=Ms(i),t=i.getBoundingClientRect(),r=ws(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Q(i),i=ks(n)}}return Ho({width:u,height:d,x:c,y:l})}function Ls(e,t){let n=Ts(e).scrollLeft;return t?t.left+n:Is(as(e)).left+n}function Rs(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Ls(e,n),y:n.top+t.scrollTop}}function zs(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=as(r),s=t?hs(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=vo(1),u=vo(0),d=cs(r);if((d||!d&&!a)&&((is(r)!==`body`||ds(o))&&(c=Ts(r)),cs(r))){let e=Is(r);l=Ms(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Rs(o,c):vo(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Bs(e){return Array.from(e.getClientRects())}function Vs(e){let t=as(e),n=Ts(e),r=e.ownerDocument.body,i=Z(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Z(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Ls(e),s=-n.scrollTop;return ws(r).direction===`rtl`&&(o+=Z(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Hs=25;function Us(e,t){let n=Q(e),r=as(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=xs();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Ls(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Hs&&(a-=o)}else l<=Hs&&(a+=l);return{width:a,height:o,x:s,y:c}}var Ws=new Set([`absolute`,`fixed`]);function Gs(e,t){let n=Is(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=cs(e)?Ms(e):vo(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Ks(e,t,n){let r;if(t===`viewport`)r=Us(e,n);else if(t===`document`)r=Vs(as(e));else if(ss(t))r=Gs(t,n);else{let n=Ps(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Ho(r)}function qs(e,t){let n=Es(e);return n===t||!ss(n)||Cs(n)?!1:ws(n).position===`fixed`||qs(n,t)}function Js(e,t){let n=t.get(e);if(n)return n;let r=Os(e,[],!1).filter(e=>ss(e)&&is(e)!==`body`),i=null,a=ws(e).position===`fixed`,o=a?Es(e):e;for(;ss(o)&&!Cs(o);){let t=ws(o),n=ys(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&Ws.has(i.position)||ds(o)&&!n&&qs(e,o))?r=r.filter(e=>e!==o):i=t,o=Es(o)}return t.set(e,r),r}function Ys(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?hs(t)?[]:Js(t,this._c):[].concat(n),r],o=a[0],s=a.reduce((e,n)=>{let r=Ks(t,n,i);return e.top=Z(r.top,e.top),e.right=ho(r.right,e.right),e.bottom=ho(r.bottom,e.bottom),e.left=Z(r.left,e.left),e},Ks(t,o,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function Xs(e){let{width:t,height:n}=As(e);return{width:t,height:n}}function Zs(e,t,n){let r=cs(t),i=as(t),a=n===`fixed`,o=Is(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=vo(0);function l(){c.x=Ls(i)}if(r||!r&&!a)if((is(t)!==`body`||ds(i))&&(s=Ts(t)),r){let e=Is(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?Rs(i,s):vo(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Qs(e){return ws(e).position===`static`}function $s(e,t){if(!cs(e)||ws(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return as(e)===n&&(n=n.ownerDocument.body),n}function ec(e,t){let n=Q(e);if(hs(e))return n;if(!cs(e)){let t=Es(e);for(;t&&!Cs(t);){if(ss(t)&&!Qs(t))return t;t=Es(t)}return n}let r=$s(e,t);for(;r&&ps(r)&&Qs(r);)r=$s(r,t);return r&&Cs(r)&&Qs(r)&&!ys(r)?n:r||bs(e)||n}var tc=async function(e){let t=this.getOffsetParent||ec,n=this.getDimensions,r=await n(e.floating);return{reference:Zs(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function nc(e){return ws(e).direction===`rtl`}var rc={convertOffsetParentRelativeRectToViewportRelativeRect:zs,getDocumentElement:as,getClippingRect:Ys,getOffsetParent:ec,getElementRects:tc,getClientRects:Bs,getDimensions:Xs,getScale:Ms,isElement:ss,isRTL:nc};function ic(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ac(e,t){let n=null,r,i=as(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=_o(d),h=_o(i.clientWidth-(u+f)),g=_o(i.clientHeight-(d+p)),_=_o(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Z(0,ho(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!ic(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function oc(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=js(e),u=i||a?[...l?Os(l):[],...Os(t)]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?ac(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),p.observe(t));let m,h=c?Is(e):null;c&&g();function g(){let t=Is(e);h&&!ic(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var sc=$o,cc=es,lc=qo,uc=ns,dc=Xo,fc=Ko,pc=ts,mc=(e,t,n)=>{let r=new Map,i={platform:rc,...n},a={...i.platform,_c:r};return Go(e,t,{...i,platform:a})},hc=typeof document<`u`?I.useLayoutEffect:function(){};function gc(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!gc(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!gc(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function _c(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function vc(e,t){let n=_c(e);return Math.round(t*n)/n}function yc(e){let t=I.useRef(e);return hc(()=>{t.current=e}),t}function bc(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=I.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=I.useState(r);gc(f,r)||p(r);let[m,h]=I.useState(null),[g,_]=I.useState(null),v=I.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=I.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=I.useRef(null),C=I.useRef(null),w=I.useRef(u),T=c!=null,E=yc(c),D=yc(i),O=yc(l),k=I.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),mc(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!gc(w.current,t)&&(w.current=t,ve.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);hc(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=I.useRef(!1);hc(()=>(A.current=!0,()=>{A.current=!1}),[]),hc(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=I.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=I.useMemo(()=>({reference:b,floating:x}),[b,x]),N=I.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=vc(M.floating,u.x),r=vc(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,..._c(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return I.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var xc=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:fc({element:r.current,padding:i}).fn(n):r?fc({element:r,padding:i}).fn(n):{}}}},Sc=(e,t)=>({...sc(e),options:[e,t]}),Cc=(e,t)=>({...cc(e),options:[e,t]}),wc=(e,t)=>({...pc(e),options:[e,t]}),Tc=(e,t)=>({...lc(e),options:[e,t]}),Ec=(e,t)=>({...uc(e),options:[e,t]}),Dc=(e,t)=>({...dc(e),options:[e,t]}),Oc=(e,t)=>({...xc(e),options:[e,t]}),kc=`Arrow`,Ac=I.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,R.jsx)(J.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,R.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});Ac.displayName=kc;var jc=Ac;function Mc(e){let[t,n]=I.useState(void 0);return X(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var Nc=`Popper`,[Pc,Fc]=Ra(Nc),[Ic,Lc]=Pc(Nc),Rc=e=>{let{__scopePopper:t,children:n}=e,[r,i]=I.useState(null);return(0,R.jsx)(Ic,{scope:t,anchor:r,onAnchorChange:i,children:n})};Rc.displayName=Nc;var zc=`PopperAnchor`,Bc=I.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=Lc(zc,n),o=I.useRef(null),s=L(t,o),c=I.useRef(null);return I.useEffect(()=>{let e=c.current;c.current=r?.current||o.current,e!==c.current&&a.onAnchorChange(c.current)}),r?null:(0,R.jsx)(J.div,{...i,ref:s})});Bc.displayName=zc;var Vc=`PopperContent`,[Hc,Uc]=Pc(Vc),Wc=I.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=Lc(Vc,n),[_,v]=I.useState(null),y=L(t,e=>v(e)),[b,x]=I.useState(null),S=Mc(b),C=S?.width??0,w=S?.height??0,T=r+(a===`center`?``:`-`+a),E=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},D=Array.isArray(l)?l:[l],O=D.length>0,k={padding:E,boundary:D.filter(Jc),altBoundary:O},{refs:A,floatingStyles:j,placement:M,isPositioned:N,middlewareData:P}=bc({strategy:`fixed`,placement:T,whileElementsMounted:(...e)=>oc(...e,{animationFrame:p===`always`}),elements:{reference:g.anchor},middleware:[Sc({mainAxis:i+w,alignmentAxis:o}),c&&Cc({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?wc():void 0,...k}),c&&Tc({...k}),Ec({...k,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),b&&Oc({element:b,padding:s}),Yc({arrowWidth:C,arrowHeight:w}),f&&Dc({strategy:`referenceHidden`,...k})]}),[F,ee]=Xc(M),te=Y(m);X(()=>{N&&te?.()},[N,te]);let ne=P.arrow?.x,re=P.arrow?.y,ie=P.arrow?.centerOffset!==0,[ae,oe]=I.useState();return X(()=>{_&&oe(window.getComputedStyle(_).zIndex)},[_]),(0,R.jsx)(`div`,{ref:A.setFloating,"data-radix-popper-content-wrapper":``,style:{...j,transform:N?j.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ae,"--radix-popper-transform-origin":[P.transformOrigin?.x,P.transformOrigin?.y].join(` `),...P.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,R.jsx)(Hc,{scope:n,placedSide:F,onArrowChange:x,arrowX:ne,arrowY:re,shouldHideArrow:ie,children:(0,R.jsx)(J.div,{"data-side":F,"data-align":ee,...h,ref:y,style:{...h.style,animation:N?void 0:`none`}})})})});Wc.displayName=Vc;var Gc=`PopperArrow`,Kc={top:`bottom`,right:`left`,bottom:`top`,left:`right`},qc=I.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=Uc(Gc,n),a=Kc[i.placedSide];return(0,R.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,R.jsx)(jc,{...r,ref:t,style:{...r.style,display:`block`}})})});qc.displayName=Gc;function Jc(e){return e!==null}var Yc=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Xc(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function Xc(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var Zc=Rc,Qc=Bc,$c=Wc,el=qc,tl=`Portal`,nl=I.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=I.useState(!1);X(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?ve.createPortal((0,R.jsx)(J.div,{...r,ref:t}),o):null});nl.displayName=tl;function rl(e,t){return I.useReducer((e,n)=>t[e][n]??e,e)}var $=e=>{let{present:t,children:n}=e,r=il(t),i=typeof n==`function`?n({present:r.isPresent}):I.Children.only(n),a=L(r.ref,ol(i));return typeof n==`function`||r.isPresent?I.cloneElement(i,{ref:a}):null};$.displayName=`Presence`;function il(e){let[t,n]=I.useState(),r=I.useRef(null),i=I.useRef(e),a=I.useRef(`none`),[o,s]=rl(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return I.useEffect(()=>{let e=al(r.current);a.current=o===`mounted`?e:`none`},[o]),X(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=al(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),X(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=al(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=al(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:I.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function al(e){return e?.animationName||`none`}function ol(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var sl=I.useInsertionEffect||X;function cl({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=ll({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=I.useRef(e!==void 0);I.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,I.useCallback(t=>{if(s){let n=ul(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function ll({defaultProp:e,onChange:t}){let[n,r]=I.useState(e),i=I.useRef(n),a=I.useRef(t);return sl(()=>{a.current=t},[t]),I.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function ul(e){return typeof e==`function`}var dl=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),fl=`VisuallyHidden`,pl=I.forwardRef((e,t)=>(0,R.jsx)(J.span,{...e,ref:t,style:{...dl,...e.style}}));pl.displayName=fl;var ml=pl,[hl,gl]=Ra(`Tooltip`,[Fc]),_l=Fc(),vl=`TooltipProvider`,yl=700,bl=`tooltip.open`,[xl,Sl]=hl(vl),Cl=e=>{let{__scopeTooltip:t,delayDuration:n=yl,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=I.useRef(!0),s=I.useRef(!1),c=I.useRef(0);return I.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,R.jsx)(xl,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:I.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:I.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:I.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};Cl.displayName=vl;var wl=`Tooltip`,[Tl,El]=hl(wl),Dl=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=Sl(wl,e.__scopeTooltip),l=_l(t),[u,d]=I.useState(null),f=po(),p=I.useRef(0),m=o??c.disableHoverableContent,h=s??c.delayDuration,g=I.useRef(!1),[_,v]=cl({prop:r,defaultProp:i??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(bl))):c.onClose(),a?.(e)},caller:wl}),y=I.useMemo(()=>_?g.current?`delayed-open`:`instant-open`:`closed`,[_]),b=I.useCallback(()=>{window.clearTimeout(p.current),p.current=0,g.current=!1,v(!0)},[v]),x=I.useCallback(()=>{window.clearTimeout(p.current),p.current=0,v(!1)},[v]),S=I.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{g.current=!0,v(!0),p.current=0},h)},[h,v]);return I.useEffect(()=>()=>{p.current&&=(window.clearTimeout(p.current),0)},[]),(0,R.jsx)(Zc,{...l,children:(0,R.jsx)(Tl,{scope:t,contentId:f,open:_,stateAttribute:y,trigger:u,onTriggerChange:d,onTriggerEnter:I.useCallback(()=>{c.isOpenDelayedRef.current?S():b()},[c.isOpenDelayedRef,S,b]),onTriggerLeave:I.useCallback(()=>{m?x():(window.clearTimeout(p.current),p.current=0)},[x,m]),onOpen:b,onClose:x,disableHoverableContent:m,children:n})})};Dl.displayName=wl;var Ol=`TooltipTrigger`,kl=I.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=El(Ol,n),a=Sl(Ol,n),o=_l(n),s=L(t,I.useRef(null),i.onTriggerChange),c=I.useRef(!1),l=I.useRef(!1),u=I.useCallback(()=>c.current=!1,[]);return I.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,R.jsx)(Qc,{asChild:!0,...o,children:(0,R.jsx)(J.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:q(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:q(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:q(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:q(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:q(e.onBlur,i.onClose),onClick:q(e.onClick,i.onClose)})})});kl.displayName=Ol;var Al=`TooltipPortal`,[jl,Ml]=hl(Al,{forceMount:void 0}),Nl=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=El(Al,t);return(0,R.jsx)(jl,{scope:t,forceMount:n,children:(0,R.jsx)($,{present:n||a.open,children:(0,R.jsx)(nl,{asChild:!0,container:i,children:r})})})};Nl.displayName=Al;var Pl=`TooltipContent`,Fl=I.forwardRef((e,t)=>{let n=Ml(Pl,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=El(Pl,e.__scopeTooltip);return(0,R.jsx)($,{present:r||o.open,children:o.disableHoverableContent?(0,R.jsx)(Bl,{side:i,...a,ref:t}):(0,R.jsx)(Il,{side:i,...a,ref:t})})}),Il=I.forwardRef((e,t)=>{let n=El(Pl,e.__scopeTooltip),r=Sl(Pl,e.__scopeTooltip),i=I.useRef(null),a=L(t,i),[o,s]=I.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=I.useCallback(()=>{s(null),d(!1)},[d]),p=I.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=Wl(r,Ul(r,n.getBoundingClientRect())),a=Gl(t.getBoundingClientRect());s(ql([...i,...a])),d(!0)},[d]);return I.useEffect(()=>()=>f(),[f]),I.useEffect(()=>{if(c&&u){let e=e=>p(e,u),t=e=>p(e,c);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),I.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!Kl(n,o);r?f():i&&(f(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,R.jsx)(Bl,{...e,ref:a})}),[Ll,Rl]=hl(wl,{isInside:!1}),zl=Ua(`TooltipContent`),Bl=I.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=El(Pl,n),l=_l(n),{onClose:u}=c;return I.useEffect(()=>(document.addEventListener(bl,u),()=>document.removeEventListener(bl,u)),[u]),I.useEffect(()=>{if(c.trigger){let e=e=>{e.target?.contains(c.trigger)&&u()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,u]),(0,R.jsx)(to,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:(0,R.jsxs)($c,{"data-state":c.stateAttribute,...l,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,R.jsx)(zl,{children:r}),(0,R.jsx)(Ll,{scope:n,isInside:!0,children:(0,R.jsx)(ml,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});Fl.displayName=Pl;var Vl=`TooltipArrow`,Hl=I.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=_l(n);return Rl(Vl,n).isInside?null:(0,R.jsx)(el,{...i,...r,ref:t})});Hl.displayName=Vl;function Ul(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function Wl(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Gl(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function Kl(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function ql(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),Jl(t)}function Jl(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Yl=Cl,Xl=Dl,Zl=kl,Ql=Nl,$l=Fl,eu=Yl,tu=Xl,nu=Zl,ru=I.forwardRef((e,t)=>{let n=(0,F.c)(11),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:r,sideOffset:a,...i}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o=a===void 0?4:a,s;n[4]===r?s=n[5]:(s=v(`z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-base text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,r),n[4]=r,n[5]=s);let c;return n[6]!==i||n[7]!==t||n[8]!==o||n[9]!==s?(c=(0,R.jsx)(Ql,{children:(0,R.jsx)($l,{ref:t,sideOffset:o,className:s,...i})}),n[6]=i,n[7]=t,n[8]=o,n[9]=s,n[10]=c):c=n[10],c});ru.displayName=$l.displayName;function iu(e){let t=(0,F.c)(16),{className:n,label:r,size:i,overScenic:a}=e,o=i===void 0?`md`:i,s=a===void 0?!1:a,c=o===`sm`?`h-4 w-4`:o===`lg`?`h-8 w-8`:`h-6 w-6`,l;t[0]===n?l=t[1]:(l=v(`flex h-full items-center justify-center`,n),t[0]=n,t[1]=l);let u=s?`scenic-foreground`:`text-muted-foreground`,f;t[2]!==c||t[3]!==u?(f=v(c,`animate-spin mx-auto`,u),t[2]=c,t[3]=u,t[4]=f):f=t[4];let p;t[5]===f?p=t[6]:(p=(0,R.jsx)(M,{className:f}),t[5]=f,t[6]=p);let m;t[7]!==r||t[8]!==s?(m=r?(0,R.jsx)(`p`,{className:v(s?v(d.body,`scenic-foreground-muted`):d.bodyMuted,`mt-2`),children:r}):null,t[7]=r,t[8]=s,t[9]=m):m=t[9];let h;t[10]!==p||t[11]!==m?(h=(0,R.jsxs)(`div`,{className:`text-center`,children:[p,m]}),t[10]=p,t[11]=m,t[12]=h):h=t[12];let g;return t[13]!==l||t[14]!==h?(g=(0,R.jsx)(`div`,{className:l,children:h}),t[13]=l,t[14]=h,t[15]=g):g=t[15],g}function au(){let e=(0,F.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,R.jsx)(`div`,{className:`space-y-1 px-2 py-2`,children:[1,2,3].map(ou)}),e[0]=t):t=e[0],t}function ou(e){return(0,R.jsx)(`div`,{className:`animate-pulse h-7 bg-muted rounded-full`},e)}function su(){let e=(0,F.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,R.jsx)(`div`,{className:`animate-pulse h-4 bg-muted rounded mx-4 my-1`}),e[0]=t):t=e[0],t}var cu=I.createContext(void 0);function lu(e){let t=I.useContext(cu);return e||t||`ltr`}function uu(e,[t,n]){return Math.min(n,Math.max(t,e))}function du(e,t){return I.useReducer((e,n)=>t[e][n]??e,e)}var fu=`ScrollArea`,[pu,mu]=Ra(fu),[hu,gu]=pu(fu),_u=I.forwardRef((e,t)=>{let{__scopeScrollArea:n,type:r=`hover`,dir:i,scrollHideDelay:a=600,...o}=e,[s,c]=I.useState(null),[l,u]=I.useState(null),[d,f]=I.useState(null),[p,m]=I.useState(null),[h,g]=I.useState(null),[_,v]=I.useState(0),[y,b]=I.useState(0),[x,S]=I.useState(!1),[C,w]=I.useState(!1),T=L(t,e=>c(e)),E=lu(i);return(0,R.jsx)(hu,{scope:n,type:r,dir:E,scrollHideDelay:a,scrollArea:s,viewport:l,onViewportChange:u,content:d,onContentChange:f,scrollbarX:p,onScrollbarXChange:m,scrollbarXEnabled:x,onScrollbarXEnabledChange:S,scrollbarY:h,onScrollbarYChange:g,scrollbarYEnabled:C,onScrollbarYEnabledChange:w,onCornerWidthChange:v,onCornerHeightChange:b,children:(0,R.jsx)(J.div,{dir:E,...o,ref:T,style:{position:`relative`,"--radix-scroll-area-corner-width":_+`px`,"--radix-scroll-area-corner-height":y+`px`,...e.style}})})});_u.displayName=fu;var vu=`ScrollAreaViewport`,yu=I.forwardRef((e,t)=>{let{__scopeScrollArea:n,children:r,nonce:i,...a}=e,o=gu(vu,n),s=L(t,I.useRef(null),o.onViewportChange);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}`},nonce:i}),(0,R.jsx)(J.div,{"data-radix-scroll-area-viewport":``,...a,ref:s,style:{overflowX:o.scrollbarXEnabled?`scroll`:`hidden`,overflowY:o.scrollbarYEnabled?`scroll`:`hidden`,...e.style},children:(0,R.jsx)(`div`,{ref:o.onContentChange,style:{minWidth:`100%`,display:`table`},children:r})})]})});yu.displayName=vu;var bu=`ScrollAreaScrollbar`,xu=I.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=gu(bu,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:o}=i,s=e.orientation===`horizontal`;return I.useEffect(()=>(s?a(!0):o(!0),()=>{s?a(!1):o(!1)}),[s,a,o]),i.type===`hover`?(0,R.jsx)(Su,{...r,ref:t,forceMount:n}):i.type===`scroll`?(0,R.jsx)(Cu,{...r,ref:t,forceMount:n}):i.type===`auto`?(0,R.jsx)(wu,{...r,ref:t,forceMount:n}):i.type===`always`?(0,R.jsx)(Tu,{...r,ref:t}):null});xu.displayName=bu;var Su=I.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=gu(bu,e.__scopeScrollArea),[a,o]=I.useState(!1);return I.useEffect(()=>{let e=i.scrollArea,t=0;if(e){let n=()=>{window.clearTimeout(t),o(!0)},r=()=>{t=window.setTimeout(()=>o(!1),i.scrollHideDelay)};return e.addEventListener(`pointerenter`,n),e.addEventListener(`pointerleave`,r),()=>{window.clearTimeout(t),e.removeEventListener(`pointerenter`,n),e.removeEventListener(`pointerleave`,r)}}},[i.scrollArea,i.scrollHideDelay]),(0,R.jsx)($,{present:n||a,children:(0,R.jsx)(wu,{"data-state":a?`visible`:`hidden`,...r,ref:t})})}),Cu=I.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=gu(bu,e.__scopeScrollArea),a=e.orientation===`horizontal`,o=Gu(()=>c(`SCROLL_END`),100),[s,c]=du(`hidden`,{hidden:{SCROLL:`scrolling`},scrolling:{SCROLL_END:`idle`,POINTER_ENTER:`interacting`},interacting:{SCROLL:`interacting`,POINTER_LEAVE:`idle`},idle:{HIDE:`hidden`,SCROLL:`scrolling`,POINTER_ENTER:`interacting`}});return I.useEffect(()=>{if(s===`idle`){let e=window.setTimeout(()=>c(`HIDE`),i.scrollHideDelay);return()=>window.clearTimeout(e)}},[s,i.scrollHideDelay,c]),I.useEffect(()=>{let e=i.viewport,t=a?`scrollLeft`:`scrollTop`;if(e){let n=e[t],r=()=>{let r=e[t];n!==r&&(c(`SCROLL`),o()),n=r};return e.addEventListener(`scroll`,r),()=>e.removeEventListener(`scroll`,r)}},[i.viewport,a,c,o]),(0,R.jsx)($,{present:n||s!==`hidden`,children:(0,R.jsx)(Tu,{"data-state":s===`hidden`?`hidden`:`visible`,...r,ref:t,onPointerEnter:q(e.onPointerEnter,()=>c(`POINTER_ENTER`)),onPointerLeave:q(e.onPointerLeave,()=>c(`POINTER_LEAVE`))})})}),wu=I.forwardRef((e,t)=>{let n=gu(bu,e.__scopeScrollArea),{forceMount:r,...i}=e,[a,o]=I.useState(!1),s=e.orientation===`horizontal`,c=Gu(()=>{if(n.viewport){let e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;o(s?e:t)}},10);return Ku(n.viewport,c),Ku(n.content,c),(0,R.jsx)($,{present:r||a,children:(0,R.jsx)(Tu,{"data-state":a?`visible`:`hidden`,...i,ref:t})})}),Tu=I.forwardRef((e,t)=>{let{orientation:n=`vertical`,...r}=e,i=gu(bu,e.__scopeScrollArea),a=I.useRef(null),o=I.useRef(0),[s,c]=I.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=Ru(s.viewport,s.content),u={...r,sizes:s,onSizesChange:c,hasThumb:l>0&&l<1,onThumbChange:e=>a.current=e,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:e=>o.current=e};function d(e,t){return Bu(e,o.current,s,t)}return n===`horizontal`?(0,R.jsx)(Eu,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollLeft,t=Vu(e,s,i.dir);a.current.style.transform=`translate3d(${t}px, 0, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollLeft=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollLeft=d(e,i.dir))}}):n===`vertical`?(0,R.jsx)(Du,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollTop,t=Vu(e,s);a.current.style.transform=`translate3d(0, ${t}px, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollTop=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollTop=d(e))}}):null}),Eu=I.forwardRef((e,t)=>{let{sizes:n,onSizesChange:r,...i}=e,a=gu(bu,e.__scopeScrollArea),[o,s]=I.useState(),c=I.useRef(null),l=L(t,c,a.onScrollbarXChange);return I.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,R.jsx)(Au,{"data-orientation":`horizontal`,...i,ref:l,sizes:n,style:{bottom:0,left:a.dir===`rtl`?`var(--radix-scroll-area-corner-width)`:0,right:a.dir===`ltr`?`var(--radix-scroll-area-corner-width)`:0,"--radix-scroll-area-thumb-width":zu(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollLeft+t.deltaX;e.onWheelScroll(r),Uu(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:Lu(o.paddingLeft),paddingEnd:Lu(o.paddingRight)}})}})}),Du=I.forwardRef((e,t)=>{let{sizes:n,onSizesChange:r,...i}=e,a=gu(bu,e.__scopeScrollArea),[o,s]=I.useState(),c=I.useRef(null),l=L(t,c,a.onScrollbarYChange);return I.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,R.jsx)(Au,{"data-orientation":`vertical`,...i,ref:l,sizes:n,style:{top:0,right:a.dir===`ltr`?0:void 0,left:a.dir===`rtl`?0:void 0,bottom:`var(--radix-scroll-area-corner-height)`,"--radix-scroll-area-thumb-height":zu(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollTop+t.deltaY;e.onWheelScroll(r),Uu(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:Lu(o.paddingTop),paddingEnd:Lu(o.paddingBottom)}})}})}),[Ou,ku]=pu(bu),Au=I.forwardRef((e,t)=>{let{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:a,onThumbPointerUp:o,onThumbPointerDown:s,onThumbPositionChange:c,onDragScroll:l,onWheelScroll:u,onResize:d,...f}=e,p=gu(bu,n),[m,h]=I.useState(null),g=L(t,e=>h(e)),_=I.useRef(null),v=I.useRef(``),y=p.viewport,b=r.content-r.viewport,x=Y(u),S=Y(c),C=Gu(d,10);function w(e){_.current&&l({x:e.clientX-_.current.left,y:e.clientY-_.current.top})}return I.useEffect(()=>{let e=e=>{let t=e.target;m?.contains(t)&&x(e,b)};return document.addEventListener(`wheel`,e,{passive:!1}),()=>document.removeEventListener(`wheel`,e,{passive:!1})},[y,m,b,x]),I.useEffect(S,[r,S]),Ku(m,C),Ku(p.content,C),(0,R.jsx)(Ou,{scope:n,scrollbar:m,hasThumb:i,onThumbChange:Y(a),onThumbPointerUp:Y(o),onThumbPositionChange:S,onThumbPointerDown:Y(s),children:(0,R.jsx)(J.div,{...f,ref:g,style:{position:`absolute`,...f.style},onPointerDown:q(e.onPointerDown,e=>{e.button===0&&(e.target.setPointerCapture(e.pointerId),_.current=m.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect=`none`,p.viewport&&(p.viewport.style.scrollBehavior=`auto`),w(e))}),onPointerMove:q(e.onPointerMove,w),onPointerUp:q(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=v.current,p.viewport&&(p.viewport.style.scrollBehavior=``),_.current=null})})})}),ju=`ScrollAreaThumb`,Mu=I.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=ku(ju,e.__scopeScrollArea);return(0,R.jsx)($,{present:n||i.hasThumb,children:(0,R.jsx)(Nu,{ref:t,...r})})}),Nu=I.forwardRef((e,t)=>{let{__scopeScrollArea:n,style:r,...i}=e,a=gu(ju,n),o=ku(ju,n),{onThumbPositionChange:s}=o,c=L(t,e=>o.onThumbChange(e)),l=I.useRef(void 0),u=Gu(()=>{l.current&&=(l.current(),void 0)},100);return I.useEffect(()=>{let e=a.viewport;if(e){let t=()=>{u(),l.current||(l.current=Wu(e,s),s())};return s(),e.addEventListener(`scroll`,t),()=>e.removeEventListener(`scroll`,t)}},[a.viewport,u,s]),(0,R.jsx)(J.div,{"data-state":o.hasThumb?`visible`:`hidden`,...i,ref:c,style:{width:`var(--radix-scroll-area-thumb-width)`,height:`var(--radix-scroll-area-thumb-height)`,...r},onPointerDownCapture:q(e.onPointerDownCapture,e=>{let t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;o.onThumbPointerDown({x:n,y:r})}),onPointerUp:q(e.onPointerUp,o.onThumbPointerUp)})});Mu.displayName=ju;var Pu=`ScrollAreaCorner`,Fu=I.forwardRef((e,t)=>{let n=gu(Pu,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!==`scroll`&&r?(0,R.jsx)(Iu,{...e,ref:t}):null});Fu.displayName=Pu;var Iu=I.forwardRef((e,t)=>{let{__scopeScrollArea:n,...r}=e,i=gu(Pu,n),[a,o]=I.useState(0),[s,c]=I.useState(0),l=!!(a&&s);return Ku(i.scrollbarX,()=>{let e=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(e),c(e)}),Ku(i.scrollbarY,()=>{let e=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(e),o(e)}),l?(0,R.jsx)(J.div,{...r,ref:t,style:{width:a,height:s,position:`absolute`,right:i.dir===`ltr`?0:void 0,left:i.dir===`rtl`?0:void 0,bottom:0,...e.style}}):null});function Lu(e){return e?parseInt(e,10):0}function Ru(e,t){let n=e/t;return isNaN(n)?0:n}function zu(e){let t=Ru(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function Bu(e,t,n,r=`ltr`){let i=zu(n),a=i/2,o=t||a,s=i-o,c=n.scrollbar.paddingStart+o,l=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d=r===`ltr`?[0,u]:[u*-1,0];return Hu([c,l],d)(e)}function Vu(e,t,n=`ltr`){let r=zu(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,c=uu(e,n===`ltr`?[0,o]:[o*-1,0]);return Hu([0,o],[0,s])(c)}function Hu(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function Uu(e,t){return e>0&&e<t}var Wu=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function i(){let a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,s=n.top!==a.top;(o||s)&&t(),n=a,r=window.requestAnimationFrame(i)})(),()=>window.cancelAnimationFrame(r)};function Gu(e,t){let n=Y(e),r=I.useRef(0);return I.useEffect(()=>()=>window.clearTimeout(r.current),[]),I.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Ku(e,t){let n=Y(t);X(()=>{let t=0;if(e){let r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,n])}var qu=_u,Ju=yu,Yu=Fu,Xu=I.forwardRef((e,t)=>{let n=(0,F.c)(15),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:i,children:r,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o;n[4]===i?o=n[5]:(o=v(`relative overflow-hidden`,i),n[4]=i,n[5]=o);let s;n[6]===r?s=n[7]:(s=(0,R.jsx)(Ju,{className:`h-full w-full rounded-[inherit]`,children:r}),n[6]=r,n[7]=s);let c,l;n[8]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,R.jsx)(Zu,{}),l=(0,R.jsx)(Yu,{}),n[8]=c,n[9]=l):(c=n[8],l=n[9]);let u;return n[10]!==a||n[11]!==t||n[12]!==o||n[13]!==s?(u=(0,R.jsxs)(qu,{ref:t,className:o,...a,children:[s,c,l]}),n[10]=a,n[11]=t,n[12]=o,n[13]=s,n[14]=u):u=n[14],u});Xu.displayName=qu.displayName;var Zu=I.forwardRef((e,t)=>{let n=(0,F.c)(14),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:r,orientation:a,...i}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o=a===void 0?`vertical`:a,s=o===`vertical`&&`h-full w-2.5 border-l border-l-transparent p-[1px]`,c=o===`horizontal`&&`h-2.5 flex-col border-t border-t-transparent p-[1px]`,l;n[4]!==r||n[5]!==s||n[6]!==c?(l=v(`flex touch-none select-none transition-colors`,s,c,r),n[4]=r,n[5]=s,n[6]=c,n[7]=l):l=n[7];let u;n[8]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,R.jsx)(Mu,{className:`relative flex-1 rounded-full bg-border`}),n[8]=u):u=n[8];let d;return n[9]!==o||n[10]!==i||n[11]!==t||n[12]!==l?(d=(0,R.jsx)(xu,{ref:t,orientation:o,className:l,...i,children:u}),n[9]=o,n[10]=i,n[11]=t,n[12]=l,n[13]=d):d=n[13],d});Zu.displayName=xu.displayName;var Qu=`[&>div]:!box-border [&>div]:!pr-4`,$u=I.forwardRef((e,t)=>{let n=(0,F.c)(14),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:r,orientation:a,...i}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o=a===void 0?`vertical`:a,s=o===`vertical`&&`right-0 h-full w-2.5 p-0.5`,c=o===`horizontal`&&`h-2.5 flex-col border-t border-t-transparent p-[1px]`,l;n[4]!==r||n[5]!==s||n[6]!==c?(l=v(`flex touch-none select-none transition-colors`,s,c,r),n[4]=r,n[5]=s,n[6]=c,n[7]=l):l=n[7];let u;n[8]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,R.jsx)(Mu,{className:`relative flex-1 rounded-full bg-foreground/20 can-hover:hover:bg-foreground/35`}),n[8]=u):u=n[8];let d;return n[9]!==o||n[10]!==i||n[11]!==t||n[12]!==l?(d=(0,R.jsx)(xu,{ref:t,orientation:o,className:l,...i,children:u}),n[9]=o,n[10]=i,n[11]=t,n[12]=l,n[13]=d):d=n[13],d});$u.displayName=`SettingsScrollBar`;var ed=I.forwardRef((e,t)=>{let n=(0,F.c)(20),r,i,a,o,s;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4],s=n[5]):({className:i,children:r,viewportRef:s,onViewportScroll:a,...o}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o,n[5]=s);let c;n[6]===i?c=n[7]:(c=v(`relative overflow-hidden`,i),n[6]=i,n[7]=c);let l;n[8]===Symbol.for(`react.memo_cache_sentinel`)?(l=v(`h-full w-full rounded-[inherit]`,Qu),n[8]=l):l=n[8];let u;n[9]!==r||n[10]!==a||n[11]!==s?(u=(0,R.jsx)(Ju,{ref:s,onScroll:a,className:l,children:r}),n[9]=r,n[10]=a,n[11]=s,n[12]=u):u=n[12];let d,f;n[13]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,R.jsx)($u,{}),f=(0,R.jsx)(Yu,{}),n[13]=d,n[14]=f):(d=n[13],f=n[14]);let p;return n[15]!==o||n[16]!==t||n[17]!==c||n[18]!==u?(p=(0,R.jsxs)(qu,{ref:t,className:c,...o,children:[u,d,f]}),n[15]=o,n[16]=t,n[17]=c,n[18]=u,n[19]=p):p=n[19],p});ed.displayName=`SettingsScrollArea`;var td=I.forwardRef((e,t)=>{let n=(0,F.c)(14),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:r,orientation:a,...i}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o=a===void 0?`vertical`:a,s=o===`vertical`&&`h-full w-2 p-0.5`,c=o===`horizontal`&&`h-2 w-full flex-col p-0.5`,l;n[4]!==r||n[5]!==s||n[6]!==c?(l=v(`flex touch-none select-none bg-transparent`,s,c,r),n[4]=r,n[5]=s,n[6]=c,n[7]=l):l=n[7];let u;n[8]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,R.jsx)(Mu,{className:`relative flex-1 rounded-full bg-foreground/35 can-hover:hover:bg-foreground/50`}),n[8]=u):u=n[8];let d;return n[9]!==o||n[10]!==i||n[11]!==t||n[12]!==l?(d=(0,R.jsx)(xu,{ref:t,orientation:o,className:l,...i,children:u}),n[9]=o,n[10]=i,n[11]=t,n[12]=l,n[13]=d):d=n[13],d});td.displayName=`FrostedScrollBar`;var nd=I.forwardRef((e,t)=>{let n=(0,F.c)(15),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:i,children:r,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o;n[4]===i?o=n[5]:(o=v(`relative overflow-hidden`,i),n[4]=i,n[5]=o);let s;n[6]===r?s=n[7]:(s=(0,R.jsx)(Ju,{className:`h-full w-full rounded-[inherit]`,children:r}),n[6]=r,n[7]=s);let c,l;n[8]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,R.jsx)(td,{}),l=(0,R.jsx)(Yu,{}),n[8]=c,n[9]=l):(c=n[8],l=n[9]);let u;return n[10]!==a||n[11]!==t||n[12]!==o||n[13]!==s?(u=(0,R.jsxs)(qu,{ref:t,className:o,...a,children:[s,c,l]}),n[10]=a,n[11]=t,n[12]=o,n[13]=s,n[14]=u):u=n[14],u});nd.displayName=`FrostedScrollArea`;function rd(e){let t=(0,F.c)(5),{children:n,className:r}=e,i;t[0]===r?i=t[1]:(i=v(c.settingsPage,r),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=(0,R.jsx)(`div`,{className:i,children:n}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a}function id(e){let t=(0,F.c)(5),{children:n,className:r}=e,i;t[0]===r?i=t[1]:(i=v(c.formPage,r),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=(0,R.jsx)(`div`,{className:i,children:n}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a}function ad(e){let t=(0,F.c)(30),{title:n,description:r,action:i,className:a,titleClassName:o,tableHeader:s,sticky:c,border:l}=e,u=c===void 0?!0:c,f=l===void 0?!1:l,p=u?`sticky top-0 z-10 -mx-6`:null,m;t[0]!==a||t[1]!==p?(m=v(`shrink-0`,p,a),t[0]=a,t[1]=p,t[2]=m):m=t[2];let h=f&&!s?`border-b border-divider`:null,g;t[3]===h?g=t[4]:(g=v(`flex items-center justify-between bg-transparent px-6 py-4 electrobun-webkit-app-region-drag`,h),t[3]=h,t[4]=g);let _=i?`pr-4`:null,y;t[5]===_?y=t[6]:(y=v(_),t[5]=_,t[6]=y);let b;t[7]===o?b=t[8]:(b=v(d.sectionTitle,o),t[7]=o,t[8]=b);let x;t[9]!==b||t[10]!==n?(x=(0,R.jsx)(`h2`,{className:b,children:n}),t[9]=b,t[10]=n,t[11]=x):x=t[11];let S;t[12]===r?S=t[13]:(S=r?(0,R.jsx)(`p`,{className:v(d.pageSubtitle,`pt-1.5`),children:r}):null,t[12]=r,t[13]=S);let C;t[14]!==x||t[15]!==S||t[16]!==y?(C=(0,R.jsxs)(`div`,{className:y,children:[x,S]}),t[14]=x,t[15]=S,t[16]=y,t[17]=C):C=t[17];let w;t[18]===i?w=t[19]:(w=i?(0,R.jsx)(`div`,{className:`electrobun-webkit-app-region-no-drag`,children:i}):null,t[18]=i,t[19]=w);let T;t[20]!==C||t[21]!==w||t[22]!==g?(T=(0,R.jsxs)(`div`,{className:g,children:[C,w]}),t[20]=C,t[21]=w,t[22]=g,t[23]=T):T=t[23];let E;t[24]===s?E=t[25]:(E=s?(0,R.jsx)(`div`,{className:`electrobun-webkit-app-region-no-drag px-6 pb-2`,children:s}):null,t[24]=s,t[25]=E);let D;return t[26]!==T||t[27]!==E||t[28]!==m?(D=(0,R.jsxs)(`div`,{className:m,children:[T,E]}),t[26]=T,t[27]=E,t[28]=m,t[29]=D):D=t[29],D}function od(e){let t=(0,F.c)(16),{title:n,description:r,action:i,titleClassName:a,tableHeader:o,border:s,children:c,pageClassName:l,className:u}=e,d=s===void 0?!1:s,f;t[0]===u?f=t[1]:(f=v(`flex h-full min-h-0 flex-col`,u),t[0]=u,t[1]=f);let p;t[2]!==i||t[3]!==d||t[4]!==r||t[5]!==o||t[6]!==n||t[7]!==a?(p=(0,R.jsx)(ad,{title:n,description:r,action:i,titleClassName:a,tableHeader:o,border:d,sticky:!1}),t[2]=i,t[3]=d,t[4]=r,t[5]=o,t[6]=n,t[7]=a,t[8]=p):p=t[8];let m;t[9]!==c||t[10]!==l?(m=(0,R.jsx)(ed,{className:`min-h-0 flex-1`,children:(0,R.jsx)(rd,{className:l,children:c})}),t[9]=c,t[10]=l,t[11]=m):m=t[11];let h;return t[12]!==f||t[13]!==p||t[14]!==m?(h=(0,R.jsxs)(`div`,{className:f,children:[p,m]}),t[12]=f,t[13]=p,t[14]=m,t[15]=h):h=t[15],h}function sd(e){let t=(0,F.c)(5),{title:n,className:r}=e,i;t[0]===r?i=t[1]:(i=v(d.sectionTitle,`mb-3`,r),t[0]=r,t[1]=i);let a;return t[2]!==i||t[3]!==n?(a=(0,R.jsx)(`h2`,{className:i,children:n}),t[2]=i,t[3]=n,t[4]=a):a=t[4],a}function cd(e){let t=(0,F.c)(6),{children:n,variant:r,className:i}=e,a=r===void 0?`info`:r,o;t[0]!==i||t[1]!==a?(o=v(a===`hint`?d.hintBanner:a===`success`?v(d.body,`text-green-700 bg-green-50 dark:text-green-400 dark:bg-green-950/30 rounded-md px-3 py-2 mb-4`):a===`error`?v(d.error,`bg-destructive/10 rounded-md px-3 py-2 mb-4`):d.infoBanner,i),t[0]=i,t[1]=a,t[2]=o):o=t[2];let s;return t[3]!==n||t[4]!==o?(s=(0,R.jsx)(`div`,{className:o,children:n}),t[3]=n,t[4]=o,t[5]=s):s=t[5],s}function ld(e){let t=(0,F.c)(5),{children:n,className:r}=e,i;t[0]===r?i=t[1]:(i=v(`min-h-0 flex-1`,r),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=(0,R.jsx)(nd,{className:i,children:n}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a}function ud(e){let t=(0,F.c)(10),{children:n,title:r,action:i}=e,a;t[0]===r?a=t[1]:(a=r?(0,R.jsx)(`h2`,{className:v(d.emptyStateTitle,`mb-2`),children:r}):null,t[0]=r,t[1]=a);let o;t[2]===n?o=t[3]:(o=(0,R.jsx)(`p`,{className:d.bodyMuted,children:n}),t[2]=n,t[3]=o);let s;t[4]===i?s=t[5]:(s=i?(0,R.jsx)(`div`,{className:`mt-4`,children:i}):null,t[4]=i,t[5]=s);let c;return t[6]!==a||t[7]!==o||t[8]!==s?(c=(0,R.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,R.jsxs)(`div`,{className:`text-center`,children:[a,o,s]})}),t[6]=a,t[7]=o,t[8]=s,t[9]=c):c=t[9],c}function dd(e){let t=(0,F.c)(5),{children:n,className:r}=e,i;t[0]===r?i=t[1]:(i=v(`h-full flex flex-col overflow-hidden`,r),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=(0,R.jsx)(`div`,{className:i,children:n}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a}function fd(e){let t=(0,F.c)(5),{children:n,className:r}=e,i;t[0]===r?i=t[1]:(i=v(`flex flex-col overflow-hidden rounded-xl`,r),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=(0,R.jsx)(`div`,{className:i,children:n}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a}var pd=`animate-in fade-in duration-[50ms]`;function md(e){let t=(0,F.c)(10),{loading:n,children:r,className:i,containerRef:a}=e;if(n){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,R.jsx)(iu,{className:`min-h-0 flex-1`}),t[0]=e):e=t[0],e}let o;t[1]===i?o=t[2]:(o=v(`h-full min-h-0 flex-1`,i),t[1]=i,t[2]=o);let s;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(s=v(`flex flex-col gap-2.5`,pd),t[3]=s):s=t[3];let c;t[4]===r?c=t[5]:(c=(0,R.jsx)(`div`,{className:s,children:r}),t[4]=r,t[5]=c);let l;return t[6]!==a||t[7]!==o||t[8]!==c?(l=(0,R.jsx)(ed,{ref:a,className:o,children:c}),t[6]=a,t[7]=o,t[8]=c,t[9]=l):l=t[9],l}function hd(e){let t=(0,F.c)(6),{loading:n,children:r,className:i}=e;if(n){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,R.jsx)(iu,{className:`min-h-0 flex-1`}),t[0]=e):e=t[0],e}let a;t[1]===i?a=t[2]:(a=v(`flex h-full min-h-0 flex-col overflow-hidden`,pd,i),t[1]=i,t[2]=a);let o;return t[3]!==r||t[4]!==a?(o=(0,R.jsx)(`div`,{className:a,children:r}),t[3]=r,t[4]=a,t[5]=o):o=t[5],o}function gd(e){let t=(0,F.c)(9),{label:n,control:r,className:i,align:a}=e,o=(a===void 0?`start`:a)===`end`?`justify-between`:`flex-wrap`,s;t[0]!==i||t[1]!==o?(s=v(`flex w-full items-center gap-x-4 gap-y-2`,o,i),t[0]=i,t[1]=o,t[2]=s):s=t[2];let c;t[3]===r?c=t[4]:(c=(0,R.jsx)(`div`,{className:`w-fit shrink-0`,children:r}),t[3]=r,t[4]=c);let l;return t[5]!==n||t[6]!==s||t[7]!==c?(l=(0,R.jsxs)(`div`,{className:s,children:[n,c]}),t[5]=n,t[6]=s,t[7]=c,t[8]=l):l=t[8],l}function _d(e,t,n){let r=v(d.label,`w-fit`,n?`cursor-pointer hover:underline`:t?`cursor-help`:null),i=n?(0,R.jsx)(`button`,{type:`button`,tabIndex:0,className:v(r,`border-0 bg-transparent p-0 text-left`),onClick:n,"aria-label":`${e} (click to reset)`,children:e}):(0,R.jsx)(`span`,{tabIndex:t?0:void 0,className:r,children:e});return t?(0,R.jsxs)(tu,{children:[(0,R.jsx)(nu,{asChild:!0,children:i}),(0,R.jsx)(ru,{side:`top`,className:`max-w-xs`,children:t})]}):i}function vd(e){let t=(0,F.c)(11),{label:n,control:r,className:i,align:a}=e,o=(a===void 0?`center`:a)===`start`?`@md/settings-page:items-start`:null,s;t[0]!==i||t[1]!==o?(s=v(c.settingsFieldRow,o,i),t[0]=i,t[1]=o,t[2]=s):s=t[2];let l;t[3]===n?l=t[4]:(l=(0,R.jsx)(`div`,{className:c.settingsFieldLabel,children:n}),t[3]=n,t[4]=l);let u;t[5]===r?u=t[6]:(u=(0,R.jsx)(`div`,{className:c.settingsFieldControl,children:r}),t[5]=r,t[6]=u);let d;return t[7]!==s||t[8]!==l||t[9]!==u?(d=(0,R.jsxs)(`div`,{className:s,children:[l,u]}),t[7]=s,t[8]=l,t[9]=u,t[10]=d):d=t[10],d}function yd(e){let t=(0,F.c)(6),{children:n,className:r,id:i}=e,a;t[0]===r?a=t[1]:(a=v(c.settingsFieldStack,r),t[0]=r,t[1]=a);let o;return t[2]!==n||t[3]!==i||t[4]!==a?(o=(0,R.jsx)(`div`,{id:i,className:a,children:n}),t[2]=n,t[3]=i,t[4]=a,t[5]=o):o=t[5],o}function bd(e){let t=(0,F.c)(59),{title:n,description:r,action:i,children:a,className:o,controlLayout:s,onTitleClick:c}=e,l=s===void 0?`responsive-row`:s,u;t[0]!==r||t[1]!==c||t[2]!==n?(u=_d(n,r,c),t[0]=r,t[1]=c,t[2]=n,t[3]=u):u=t[3];let d=u,f=l===`responsive-row`,p=l===`row-end`?`end`:l===`row-start`?`start`:null;if(i&&a){if(f){let e;t[4]===o?e=t[5]:(e=v(`space-y-2`,o),t[4]=o,t[5]=e);let n;t[6]!==i||t[7]!==d?(n=(0,R.jsx)(vd,{label:d,control:i}),t[6]=i,t[7]=d,t[8]=n):n=t[8];let r;return t[9]!==a||t[10]!==e||t[11]!==n?(r=(0,R.jsxs)(`div`,{className:e,children:[n,a]}),t[9]=a,t[10]=e,t[11]=n,t[12]=r):r=t[12],r}if(p){let e;t[13]===o?e=t[14]:(e=v(`space-y-2`,o),t[13]=o,t[14]=e);let n;t[15]!==i||t[16]!==d||t[17]!==p?(n=(0,R.jsx)(gd,{label:d,control:i,align:p}),t[15]=i,t[16]=d,t[17]=p,t[18]=n):n=t[18];let r;return t[19]!==a||t[20]!==e||t[21]!==n?(r=(0,R.jsxs)(`div`,{className:e,children:[n,a]}),t[19]=a,t[20]=e,t[21]=n,t[22]=r):r=t[22],r}let e;t[23]===o?e=t[24]:(e=v(`space-y-2`,o),t[23]=o,t[24]=e);let n;t[25]===i?n=t[26]:(n=(0,R.jsx)(`div`,{children:i}),t[25]=i,t[26]=n);let r;return t[27]!==a||t[28]!==d||t[29]!==e||t[30]!==n?(r=(0,R.jsxs)(`div`,{className:e,children:[d,n,a]}),t[27]=a,t[28]=d,t[29]=e,t[30]=n,t[31]=r):r=t[31],r}if(i){if(f){let e;return t[32]!==i||t[33]!==o||t[34]!==d?(e=(0,R.jsx)(vd,{label:d,control:i,className:o}),t[32]=i,t[33]=o,t[34]=d,t[35]=e):e=t[35],e}if(p){let e;return t[36]!==i||t[37]!==o||t[38]!==d||t[39]!==p?(e=(0,R.jsx)(gd,{label:d,control:i,align:p,className:o}),t[36]=i,t[37]=o,t[38]=d,t[39]=p,t[40]=e):e=t[40],e}let e;t[41]===o?e=t[42]:(e=v(`space-y-2`,o),t[41]=o,t[42]=e);let n;t[43]===i?n=t[44]:(n=(0,R.jsx)(`div`,{children:i}),t[43]=i,t[44]=n);let r;return t[45]!==d||t[46]!==e||t[47]!==n?(r=(0,R.jsxs)(`div`,{className:e,children:[d,n]}),t[45]=d,t[46]=e,t[47]=n,t[48]=r):r=t[48],r}if(f&&a){let e;return t[49]!==a||t[50]!==o||t[51]!==d?(e=(0,R.jsx)(vd,{label:d,control:a,className:o,align:`start`}),t[49]=a,t[50]=o,t[51]=d,t[52]=e):e=t[52],e}let m;t[53]===o?m=t[54]:(m=v(`space-y-2`,o),t[53]=o,t[54]=m);let h;return t[55]!==a||t[56]!==d||t[57]!==m?(h=(0,R.jsxs)(`div`,{className:m,children:[d,a]}),t[55]=a,t[56]=d,t[57]=m,t[58]=h):h=t[58],h}function xd(e){let t=e+`CollectionProvider`,[n,r]=Ra(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=I.useRef(null),a=I.useRef(new Map).current;return(0,R.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=Ba(s),l=I.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,R.jsx)(c,{ref:L(t,a(s,n).collectionRef),children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=Ba(u),p=I.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=I.useRef(null),s=L(t,o),c=a(u,n);return I.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,R.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return I.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:l,ItemSlot:p},m,r]}var Sd=0;function Cd(){I.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??wd()),document.body.insertAdjacentElement(`beforeend`,e[1]??wd()),Sd++,()=>{Sd===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),Sd--}},[])}function wd(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var Td=`focusScope.autoFocusOnMount`,Ed=`focusScope.autoFocusOnUnmount`,Dd={bubbles:!1,cancelable:!0},Od=`FocusScope`,kd=I.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=I.useState(null),l=Y(i),u=Y(a),d=I.useRef(null),f=L(t,e=>c(e)),p=I.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;I.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:Id(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||Id(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Id(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),I.useEffect(()=>{if(s){Ld.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(Td,Dd);s.addEventListener(Td,l),s.dispatchEvent(t),t.defaultPrevented||(Ad(Bd(Md(s)),{select:!0}),document.activeElement===e&&Id(s))}return()=>{s.removeEventListener(Td,l),setTimeout(()=>{let t=new CustomEvent(Ed,Dd);s.addEventListener(Ed,u),s.dispatchEvent(t),t.defaultPrevented||Id(e??document.body,{select:!0}),s.removeEventListener(Ed,u),Ld.remove(p)},0)}}},[s,l,u,p]);let m=I.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=jd(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&Id(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&Id(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,R.jsx)(J.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});kd.displayName=Od;function Ad(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Id(r,{select:t}),document.activeElement!==n)return}function jd(e){let t=Md(e);return[Nd(t,e),Nd(t.reverse(),e)]}function Md(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Nd(e,t){for(let n of e)if(!Pd(n,{upTo:t}))return n}function Pd(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function Fd(e){return e instanceof HTMLInputElement&&`select`in e}function Id(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Fd(e)&&t&&e.select()}}var Ld=Rd();function Rd(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=zd(e,t),e.unshift(t)},remove(t){e=zd(e,t),e[0]?.resume()}}}function zd(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Bd(e){return e.filter(e=>e.tagName!==`A`)}var Vd=`rovingFocusGroup.onEntryFocus`,Hd={bubbles:!1,cancelable:!0},Ud=`RovingFocusGroup`,[Wd,Gd,Kd]=xd(Ud),[qd,Jd]=Ra(Ud,[Kd]),[Yd,Xd]=qd(Ud),Zd=I.forwardRef((e,t)=>(0,R.jsx)(Wd.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,R.jsx)(Wd.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,R.jsx)(Qd,{...e,ref:t})})}));Zd.displayName=Ud;var Qd=I.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=I.useRef(null),p=L(t,f),m=lu(a),[h,g]=cl({prop:o,defaultProp:s??null,onChange:c,caller:Ud}),[_,v]=I.useState(!1),y=Y(l),b=Gd(n),x=I.useRef(!1),[S,C]=I.useState(0);return I.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(Vd,y),()=>e.removeEventListener(Vd,y)},[y]),(0,R.jsx)(Yd,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:I.useCallback(e=>g(e),[g]),onItemShiftTab:I.useCallback(()=>v(!0),[]),onFocusableItemAdd:I.useCallback(()=>C(e=>e+1),[]),onFocusableItemRemove:I.useCallback(()=>C(e=>e-1),[]),children:(0,R.jsx)(J.div,{tabIndex:_||S===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:q(e.onMouseDown,()=>{x.current=!0}),onFocus:q(e.onFocus,e=>{let t=!x.current;if(e.target===e.currentTarget&&t&&!_){let t=new CustomEvent(Vd,Hd);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=b().filter(e=>e.focusable);af([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}x.current=!1}),onBlur:q(e.onBlur,()=>v(!1))})})}),$d=`RovingFocusGroupItem`,ef=I.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=po(),l=a||c,u=Xd($d,n),d=u.currentTabStopId===l,f=Gd(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u;return I.useEffect(()=>{if(r)return p(),()=>m()},[r,p,m]),(0,R.jsx)(Wd.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,R.jsx)(J.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:q(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:q(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:q(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=rf(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?of(n,r+1):n.slice(r+1)}setTimeout(()=>af(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})});ef.displayName=$d;var tf={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function nf(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function rf(e,t,n){let r=nf(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return tf[r]}function af(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function of(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var sf=Zd,cf=ef,lf=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},uf=new WeakMap,df=new WeakMap,ff={},pf=0,mf=function(e){return e&&(e.host||mf(e.parentNode))},hf=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=mf(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},gf=function(e,t,n,r){var i=hf(t,Array.isArray(e)?e:[e]);ff[n]||(ff[n]=new WeakMap);var a=ff[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(uf.get(e)||0)+1,l=(a.get(e)||0)+1;uf.set(e,c),a.set(e,l),o.push(e),c===1&&i&&df.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),pf++,function(){o.forEach(function(e){var t=uf.get(e)-1,i=a.get(e)-1;uf.set(e,t),a.set(e,i),t||(df.has(e)||e.removeAttribute(r),df.delete(e)),i||e.removeAttribute(n)}),pf--,pf||(uf=new WeakMap,uf=new WeakMap,df=new WeakMap,ff={})}},_f=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||lf(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),gf(r,i,n,`aria-hidden`)):function(){return null}},vf=function(){return vf=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},vf.apply(this,arguments)};function yf(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function bf(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var xf=`right-scroll-bar-position`,Sf=`width-before-scroll-bar`,Cf=`with-scroll-bars-hidden`,wf=`--removed-body-scroll-bar-size`;function Tf(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Ef(e,t){var n=(0,I.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Df=typeof window<`u`?I.useLayoutEffect:I.useEffect,Of=new WeakMap;function kf(e,t){var n=Ef(t||null,function(t){return e.forEach(function(e){return Tf(e,t)})});return Df(function(){var t=Of.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Tf(e,null)}),i.forEach(function(e){r.has(e)||Tf(e,a)})}Of.set(n,e)},[e]),n}function Af(e){return e}function jf(e,t){t===void 0&&(t=Af);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Mf(e){e===void 0&&(e={});var t=jf(null);return t.options=vf({async:!0,ssr:!1},e),t}var Nf=function(e){var t=e.sideCar,n=yf(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return I.createElement(r,vf({},n))};Nf.isSideCarExport=!0;function Pf(e,t){return e.useMedium(t),Nf}var Ff=Mf(),If=function(){},Lf=I.forwardRef(function(e,t){var n=I.useRef(null),r=I.useState({onScrollCapture:If,onWheelCapture:If,onTouchMoveCapture:If}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=yf(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=kf([n,t]),C=vf(vf({},b),i);return I.createElement(I.Fragment,null,u&&I.createElement(x,{sideCar:Ff,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?I.cloneElement(I.Children.only(s),vf(vf({},C),{ref:S})):I.createElement(v,vf({},C,{className:c,ref:S}),s))});Lf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Lf.classNames={fullWidth:Sf,zeroRight:xf};var Rf,zf=function(){if(Rf)return Rf;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Bf(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=zf();return t&&e.setAttribute(`nonce`,t),e}function Vf(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Hf(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Uf=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Bf())&&(Vf(t,n),Hf(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Wf=function(){var e=Uf();return function(t,n){I.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Gf=function(){var e=Wf();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Kf={left:0,top:0,right:0,gap:0},qf=function(e){return parseInt(e||``,10)||0},Jf=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[qf(n),qf(r),qf(i)]},Yf=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Kf;var t=Jf(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Xf=Gf(),Zf=`data-scroll-locked`,Qf=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
3
3
  .${Cf} {
4
4
  overflow: hidden ${r};
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Di as t,Oi as n,Rr as r,f as i,hr as a,i as o,ki as s,nn as c,rn as l,yt as u}from"./interactive-BrHVRHmQ.js";import{Wt as d}from"./react-vendor-B7jFrulV.js";import{Ci as f,Eo as p,dt as m,mt as h,rt as g,st as _,ur as v,ut as y,x as b}from"./onboarding-DVc9-yKJ.js";import{t as x}from"./use-toast-hxHsVv6a.js";import{t as S}from"./use-settings-page-loading-BU2CDnfE.js";var C=n(),w=e(s(),1),T=t();function E(e){let t=(0,C.c)(20),{entry:n,index:r,loading:i,onValueChange:s}=e,u=a(n.name),[d,f]=(0,w.useState)(!1),m=n.value.length>0||n.hasExistingValue,h=n.hasExistingValue&&!n.value?`••••••••`:`value`;(0,w.useEffect)(()=>{u||f(!1)},[u]);let g=b,_=u&&!d?`password`:`text`,v=n.value,y;t[0]!==r||t[1]!==s?(y=e=>s(r,e.target.value),t[0]=r,t[1]=s,t[2]=y):y=t[2];let x=o(`font-mono`,u&&`pr-10`),S;t[3]!==g||t[4]!==n.value||t[5]!==i||t[6]!==h||t[7]!==_||t[8]!==y||t[9]!==x?(S=(0,T.jsx)(g,{type:_,placeholder:h,value:v,onChange:y,className:x,disabled:i}),t[3]=g,t[4]=n.value,t[5]=i,t[6]=h,t[7]=_,t[8]=y,t[9]=x,t[10]=S):S=t[10];let E;t[11]!==m||t[12]!==u||t[13]!==i||t[14]!==f||t[15]!==d?(E=u?(0,T.jsx)(p,{type:`button`,variant:`ghost`,size:`sm`,className:`absolute right-1 top-1/2 h-8 w-8 -translate-y-1/2 p-0`,onClick:()=>f(D),disabled:i||!m,children:d?(0,T.jsx)(l,{className:`h-4 w-4 text-muted-foreground`}):(0,T.jsx)(c,{className:`h-4 w-4 text-muted-foreground`})}):null,t[11]=m,t[12]=u,t[13]=i,t[14]=f,t[15]=d,t[16]=E):E=t[16];let O;return t[17]!==S||t[18]!==E?(O=(0,T.jsxs)(`div`,{className:`relative flex-1`,children:[S,E]}),t[17]=S,t[18]=E,t[19]=O):O=t[19],O}function D(e){return!e}function O({projectId:e}){let t=d(),[n,a]=(0,w.useState)([]),[o,s]=(0,w.useState)([]),[c,l]=(0,w.useState)(!0),[C,D]=(0,w.useState)(!1),O=(0,w.useCallback)(async()=>{if(!e){l(!1);return}l(!0);try{let t=(await v(e)).vars.map(e=>({name:e.name,value:e.value??``,hasExistingValue:e.hasValue&&e.value===void 0}));a(t),s(t)}catch(e){x({title:`Error`,description:e instanceof Error?e.message:`Failed to load environment variables`,variant:`destructive`})}finally{l(!1)}},[e]);(0,w.useLayoutEffect)(()=>{e&&l(!0)},[e]),(0,w.useEffect)(()=>{O()},[O]);let k=S(e,[c]);function A(){a(e=>[...e,{name:``,value:``,hasExistingValue:!1}])}function j(e,t){a(n=>n.map((n,r)=>r===e?{...n,name:t.toUpperCase()}:n))}function M(e,t){a(n=>n.map((n,r)=>r===e?{...n,value:t}:n))}function N(e){a(t=>t.filter((t,n)=>n!==e))}function P(){if(n.length!==o.length)return!0;for(let e=0;e<n.length;e+=1){let t=n[e],r=o[e];if(!r||t.name!==r.name||t.value!==r.value||t.hasExistingValue!==r.hasExistingValue)return!0}return!1}async function F(){if(!(!e||!P())){D(!0);try{let r=n.map(e=>({name:e.name.trim(),value:e.value,hasExistingValue:e.hasExistingValue})).filter(e=>e.name.length>0),i=r.find((e,t)=>r.findIndex(t=>t.name===e.name)!==t);if(i)throw Error(`Duplicate environment variable name: ${i.name}`);let a=r.find(e=>!e.hasExistingValue&&!e.value.trim());if(a)throw Error(`Value is required for environment variable: ${a.name}`);await f(e,r.map(e=>({name:e.name,value:e.value.trim()||void 0}))),s(n.map(e=>({...e,value:``}))),await O(),t(`/`)}catch(e){x({title:`Error`,description:e instanceof Error?e.message:`Failed to save environment variables`,variant:`destructive`})}finally{D(!1)}}}return e?(0,T.jsx)(_,{loading:k,children:(0,T.jsxs)(h,{className:`shrink-0`,children:[(0,T.jsx)(g,{title:`Environment Variables`,description:`Encrypted in Tarsk and injected for bash commands and MCP tools.`,action:(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(p,{variant:`ghost`,size:`sm`,onClick:A,disabled:c,children:`Add variable`}),(0,T.jsx)(p,{onClick:()=>void F(),disabled:C||c,children:C?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(u,{className:`mr-2 h-4 w-4 animate-spin`}),`Saving...`]}):`Save`})]}),sticky:!1}),(0,T.jsx)(m,{className:`max-w-none pt-6`,children:n.length===0?(0,T.jsx)(`p`,{className:r.caption,children:`No environment variables configured`}):(0,T.jsx)(`div`,{className:`flex flex-col gap-2`,children:n.map((e,t)=>(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(b,{placeholder:`API_KEY`,value:e.name,onChange:e=>j(t,e.target.value),className:`w-[35%] font-mono`,disabled:c}),(0,T.jsx)(E,{entry:e,index:t,loading:c,onValueChange:M}),(0,T.jsx)(p,{variant:`ghost`,size:`icon`,onClick:()=>N(t),className:`h-9 w-9 shrink-0`,disabled:c||C,children:(0,T.jsx)(i,{className:`h-3.5 w-3.5`})})]},t))})})]})}):(0,T.jsx)(y,{title:`No project selected`,children:`Please select a project from the sidebar to manage environment variables.`})}export{O as default};
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Di as t,Oi as n,Rr as r,f as i,hr as a,i as o,ki as s,nn as c,rn as l,yt as u}from"./interactive-BrHVRHmQ.js";import{Wt as d}from"./react-vendor-7n7LyU5o.js";import{Ci as f,Eo as p,dt as m,mt as h,rt as g,st as _,ur as v,ut as y,x as b}from"./onboarding-KBcwP-kU.js";import{t as x}from"./use-toast-hxHsVv6a.js";import{t as S}from"./use-settings-page-loading-BU2CDnfE.js";var C=n(),w=e(s(),1),T=t();function E(e){let t=(0,C.c)(20),{entry:n,index:r,loading:i,onValueChange:s}=e,u=a(n.name),[d,f]=(0,w.useState)(!1),m=n.value.length>0||n.hasExistingValue,h=n.hasExistingValue&&!n.value?`••••••••`:`value`;(0,w.useEffect)(()=>{u||f(!1)},[u]);let g=b,_=u&&!d?`password`:`text`,v=n.value,y;t[0]!==r||t[1]!==s?(y=e=>s(r,e.target.value),t[0]=r,t[1]=s,t[2]=y):y=t[2];let x=o(`font-mono`,u&&`pr-10`),S;t[3]!==g||t[4]!==n.value||t[5]!==i||t[6]!==h||t[7]!==_||t[8]!==y||t[9]!==x?(S=(0,T.jsx)(g,{type:_,placeholder:h,value:v,onChange:y,className:x,disabled:i}),t[3]=g,t[4]=n.value,t[5]=i,t[6]=h,t[7]=_,t[8]=y,t[9]=x,t[10]=S):S=t[10];let E;t[11]!==m||t[12]!==u||t[13]!==i||t[14]!==f||t[15]!==d?(E=u?(0,T.jsx)(p,{type:`button`,variant:`ghost`,size:`sm`,className:`absolute right-1 top-1/2 h-8 w-8 -translate-y-1/2 p-0`,onClick:()=>f(D),disabled:i||!m,children:d?(0,T.jsx)(l,{className:`h-4 w-4 text-muted-foreground`}):(0,T.jsx)(c,{className:`h-4 w-4 text-muted-foreground`})}):null,t[11]=m,t[12]=u,t[13]=i,t[14]=f,t[15]=d,t[16]=E):E=t[16];let O;return t[17]!==S||t[18]!==E?(O=(0,T.jsxs)(`div`,{className:`relative flex-1`,children:[S,E]}),t[17]=S,t[18]=E,t[19]=O):O=t[19],O}function D(e){return!e}function O({projectId:e}){let t=d(),[n,a]=(0,w.useState)([]),[o,s]=(0,w.useState)([]),[c,l]=(0,w.useState)(!0),[C,D]=(0,w.useState)(!1),O=(0,w.useCallback)(async()=>{if(!e){l(!1);return}l(!0);try{let t=(await v(e)).vars.map(e=>({name:e.name,value:e.value??``,hasExistingValue:e.hasValue&&e.value===void 0}));a(t),s(t)}catch(e){x({title:`Error`,description:e instanceof Error?e.message:`Failed to load environment variables`,variant:`destructive`})}finally{l(!1)}},[e]);(0,w.useLayoutEffect)(()=>{e&&l(!0)},[e]),(0,w.useEffect)(()=>{O()},[O]);let k=S(e,[c]);function A(){a(e=>[...e,{name:``,value:``,hasExistingValue:!1}])}function j(e,t){a(n=>n.map((n,r)=>r===e?{...n,name:t.toUpperCase()}:n))}function M(e,t){a(n=>n.map((n,r)=>r===e?{...n,value:t}:n))}function N(e){a(t=>t.filter((t,n)=>n!==e))}function P(){if(n.length!==o.length)return!0;for(let e=0;e<n.length;e+=1){let t=n[e],r=o[e];if(!r||t.name!==r.name||t.value!==r.value||t.hasExistingValue!==r.hasExistingValue)return!0}return!1}async function F(){if(!(!e||!P())){D(!0);try{let r=n.map(e=>({name:e.name.trim(),value:e.value,hasExistingValue:e.hasExistingValue})).filter(e=>e.name.length>0),i=r.find((e,t)=>r.findIndex(t=>t.name===e.name)!==t);if(i)throw Error(`Duplicate environment variable name: ${i.name}`);let a=r.find(e=>!e.hasExistingValue&&!e.value.trim());if(a)throw Error(`Value is required for environment variable: ${a.name}`);await f(e,r.map(e=>({name:e.name,value:e.value.trim()||void 0}))),s(n.map(e=>({...e,value:``}))),await O(),t(`/`)}catch(e){x({title:`Error`,description:e instanceof Error?e.message:`Failed to save environment variables`,variant:`destructive`})}finally{D(!1)}}}return e?(0,T.jsx)(_,{loading:k,children:(0,T.jsxs)(h,{className:`shrink-0`,children:[(0,T.jsx)(g,{title:`Environment Variables`,description:`Encrypted in Tarsk and injected for bash commands and MCP tools.`,action:(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(p,{variant:`ghost`,size:`sm`,onClick:A,disabled:c,children:`Add variable`}),(0,T.jsx)(p,{onClick:()=>void F(),disabled:C||c,children:C?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(u,{className:`mr-2 h-4 w-4 animate-spin`}),`Saving...`]}):`Save`})]}),sticky:!1}),(0,T.jsx)(m,{className:`max-w-none pt-6`,children:n.length===0?(0,T.jsx)(`p`,{className:r.caption,children:`No environment variables configured`}):(0,T.jsx)(`div`,{className:`flex flex-col gap-2`,children:n.map((e,t)=>(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(b,{placeholder:`API_KEY`,value:e.name,onChange:e=>j(t,e.target.value),className:`w-[35%] font-mono`,disabled:c}),(0,T.jsx)(E,{entry:e,index:t,loading:c,onValueChange:M}),(0,T.jsx)(p,{variant:`ghost`,size:`icon`,onClick:()=>N(t),className:`h-9 w-9 shrink-0`,disabled:c||C,children:(0,T.jsx)(i,{className:`h-3.5 w-3.5`})})]},t))})})]})}):(0,T.jsx)(y,{title:`No project selected`,children:`Please select a project from the sidebar to manage environment variables.`})}export{O as default};
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Ci as t,Di as n,Oi as r,Rr as i,Ti as a,_i as o,gi as s,hi as c,i as l,ki as u,mi as d,pi as f,wi as p,yt as m}from"./interactive-BrHVRHmQ.js";import{Wt as h}from"./react-vendor-B7jFrulV.js";import{Eo as g,Ti as _,Wn as v,_ as y,cr as b,dt as x,g as S,h as C,lt as w,m as T,mt as E,p as D,rt as O,st as k,tt as A,ut as j,v as M,w as N}from"./onboarding-DVc9-yKJ.js";import{t as P}from"./use-toast-hxHsVv6a.js";import{t as F}from"./use-settings-page-loading-BU2CDnfE.js";var I=e(u(),1),L=r(),R=n(),z=`__unspecified__`,B=`__default__`;function V(e){let t=(0,L.c)(20),{value:n,onChange:r,enabledModels:i,disabled:l}=e,u=l===void 0?!1:l,m;if(t[0]!==i){m=new Map;for(let e of i){let t=e.provider??`other`,n=m.get(t);n?n.push(e):m.set(t,[e])}t[0]=i,t[1]=m}else m=t[1];let h=m,g;t[2]!==r||t[3]!==n?(g=function(e,t){let i={...n};if(t===z){delete i[e],r(i);return}let a=s(t);a&&(i[e]=a,r(i))},t[2]=r,t[3]=n,t[4]=g):g=t[4];let _=g,v;t[5]===i?v=t[6]:(v=function(e){if(!e)return;let t=e.provider.toLowerCase();return i.find(n=>n.id===e.model&&(n.provider??`other`).toLowerCase()===t)},t[5]=i,t[6]=v);let b=v,x;t[7]!==r||t[8]!==n?(x=function(e,t){let i=n[e];if(!i)return;let o={...i};if(t===B)delete o.reasoningEffort;else if(a(t))o.reasoningEffort=t;else return;r({...n,[e]:o})},t[7]=r,t[8]=n,t[9]=x):x=t[9];let E=x,O;t[10]!==u||t[11]!==i||t[12]!==b||t[13]!==_||t[14]!==E||t[15]!==h||t[16]!==n?(O=c.map(e=>{let t=n[e],r=t?o(t):z,a=b(t)?.supportedReasoningEfforts??[];return(0,R.jsx)(A,{title:d[e],description:f[e],children:(0,R.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,R.jsxs)(D,{value:r,onValueChange:t=>_(e,t),disabled:u,children:[(0,R.jsx)(y,{id:`model-alias-${e}`,className:`w-full min-w-0`,children:(0,R.jsx)(M,{placeholder:`Unspecified`})}),(0,R.jsxs)(T,{children:[(0,R.jsx)(C,{value:z,children:`Unspecified`}),i.length>0&&(0,R.jsx)(S,{}),[...h.entries()].map(U)]})]}),t&&a.length>0&&(0,R.jsxs)(D,{value:t.reasoningEffort??B,onValueChange:t=>E(e,t),disabled:u,children:[(0,R.jsx)(y,{id:`model-alias-${e}-reasoning`,className:`w-full min-w-0`,children:(0,R.jsx)(M,{placeholder:`Model default`})}),(0,R.jsxs)(T,{children:[(0,R.jsx)(C,{value:B,children:`Model default`}),(0,R.jsx)(C,{value:`off`,children:p(`off`)}),a.map(H)]})]})]})},e)}),t[10]=u,t[11]=i,t[12]=b,t[13]=_,t[14]=E,t[15]=h,t[16]=n,t[17]=O):O=t[17];let k;return t[18]===O?k=t[19]:(k=(0,R.jsx)(w,{id:`model-aliases`,children:O}),t[18]=O,t[19]=k),k}function H(e){return(0,R.jsx)(C,{value:e,children:p(e)},e)}function U(e){let[t,n]=e;return(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`div`,{className:l(i.dropdownGroupHeading,`px-2 py-1.5 uppercase`),children:t}),n.map(e=>{let n=o({provider:e.provider??t,model:e.id});return(0,R.jsx)(C,{value:n,children:N(e.id)},n)})]},t)}function W(e){return[...e].sort((e,t)=>{let n=(e.provider??``).localeCompare(t.provider??``);return n===0?N(e.id).localeCompare(N(t.id)):n})}function G({projectId:e,onProjectUpdated:n}){let r=h(),[i,a]=(0,I.useState)({}),[o,s]=(0,I.useState)({}),[c,l]=(0,I.useState)([]),[u,d]=(0,I.useState)(!0),[f,p]=(0,I.useState)(!1),y=(0,I.useCallback)(async()=>{if(!e){d(!1);return}d(!0);try{let[t,n]=await Promise.all([b(e),v().catch(()=>({}))]),r=t.modelAliases??{};l(W(Object.values(n).flat())),a(r),s(r)}catch(e){P({title:`Error`,description:e instanceof Error?e.message:`Failed to load model aliases`,variant:`destructive`})}finally{d(!1)}},[e]);(0,I.useLayoutEffect)(()=>{e&&d(!0)},[e]),(0,I.useEffect)(()=>{y()},[y]);let S=F(e,[u]);function C(){return JSON.stringify(i)!==JSON.stringify(o)}async function w(){if(!(!e||!C())){p(!0);try{let a=Object.keys(i).length>0?i:void 0;if(a){let e=await v();t(a,Object.fromEntries(Object.entries(e).map(([e,t])=>[e,t.map(e=>e.id)])))}await _(e,{modelAliases:a??null}),s(i),n&&await n(),await y(),r(`/`)}catch(e){P({title:`Error`,description:e instanceof Error?e.message:`Failed to save model aliases`,variant:`destructive`})}finally{p(!1)}}}return e?(0,R.jsx)(k,{loading:S,children:(0,R.jsxs)(E,{className:`shrink-0`,children:[(0,R.jsx)(O,{title:`Model Aliases`,description:`Map short names (fast, local, cheap, smart) to enabled models. Subagents can reference these aliases in AGENT.md. Set Cheap to enable Orchestrate mode.`,action:(0,R.jsx)(g,{onClick:()=>void w(),disabled:f||u,children:f?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(m,{className:`mr-2 h-4 w-4 animate-spin`}),`Saving...`]}):`Save`}),sticky:!1}),(0,R.jsx)(x,{className:`max-w-none pt-6`,children:(0,R.jsx)(V,{value:i,onChange:a,enabledModels:c,disabled:u||f})})]})}):(0,R.jsx)(j,{title:`No project selected`,children:`Please select a project from the sidebar to configure model aliases.`})}export{G as default};
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Ci as t,Di as n,Oi as r,Rr as i,Ti as a,_i as o,gi as s,hi as c,i as l,ki as u,mi as d,pi as f,wi as p,yt as m}from"./interactive-BrHVRHmQ.js";import{Wt as h}from"./react-vendor-7n7LyU5o.js";import{Eo as g,Ti as _,Wn as v,_ as y,cr as b,dt as x,g as S,h as C,lt as w,m as T,mt as E,p as D,rt as O,st as k,tt as A,ut as j,v as M,w as N}from"./onboarding-KBcwP-kU.js";import{t as P}from"./use-toast-hxHsVv6a.js";import{t as F}from"./use-settings-page-loading-BU2CDnfE.js";var I=e(u(),1),L=r(),R=n(),z=`__unspecified__`,B=`__default__`;function V(e){let t=(0,L.c)(20),{value:n,onChange:r,enabledModels:i,disabled:l}=e,u=l===void 0?!1:l,m;if(t[0]!==i){m=new Map;for(let e of i){let t=e.provider??`other`,n=m.get(t);n?n.push(e):m.set(t,[e])}t[0]=i,t[1]=m}else m=t[1];let h=m,g;t[2]!==r||t[3]!==n?(g=function(e,t){let i={...n};if(t===z){delete i[e],r(i);return}let a=s(t);a&&(i[e]=a,r(i))},t[2]=r,t[3]=n,t[4]=g):g=t[4];let _=g,v;t[5]===i?v=t[6]:(v=function(e){if(!e)return;let t=e.provider.toLowerCase();return i.find(n=>n.id===e.model&&(n.provider??`other`).toLowerCase()===t)},t[5]=i,t[6]=v);let b=v,x;t[7]!==r||t[8]!==n?(x=function(e,t){let i=n[e];if(!i)return;let o={...i};if(t===B)delete o.reasoningEffort;else if(a(t))o.reasoningEffort=t;else return;r({...n,[e]:o})},t[7]=r,t[8]=n,t[9]=x):x=t[9];let E=x,O;t[10]!==u||t[11]!==i||t[12]!==b||t[13]!==_||t[14]!==E||t[15]!==h||t[16]!==n?(O=c.map(e=>{let t=n[e],r=t?o(t):z,a=b(t)?.supportedReasoningEfforts??[];return(0,R.jsx)(A,{title:d[e],description:f[e],children:(0,R.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,R.jsxs)(D,{value:r,onValueChange:t=>_(e,t),disabled:u,children:[(0,R.jsx)(y,{id:`model-alias-${e}`,className:`w-full min-w-0`,children:(0,R.jsx)(M,{placeholder:`Unspecified`})}),(0,R.jsxs)(T,{children:[(0,R.jsx)(C,{value:z,children:`Unspecified`}),i.length>0&&(0,R.jsx)(S,{}),[...h.entries()].map(U)]})]}),t&&a.length>0&&(0,R.jsxs)(D,{value:t.reasoningEffort??B,onValueChange:t=>E(e,t),disabled:u,children:[(0,R.jsx)(y,{id:`model-alias-${e}-reasoning`,className:`w-full min-w-0`,children:(0,R.jsx)(M,{placeholder:`Model default`})}),(0,R.jsxs)(T,{children:[(0,R.jsx)(C,{value:B,children:`Model default`}),(0,R.jsx)(C,{value:`off`,children:p(`off`)}),a.map(H)]})]})]})},e)}),t[10]=u,t[11]=i,t[12]=b,t[13]=_,t[14]=E,t[15]=h,t[16]=n,t[17]=O):O=t[17];let k;return t[18]===O?k=t[19]:(k=(0,R.jsx)(w,{id:`model-aliases`,children:O}),t[18]=O,t[19]=k),k}function H(e){return(0,R.jsx)(C,{value:e,children:p(e)},e)}function U(e){let[t,n]=e;return(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`div`,{className:l(i.dropdownGroupHeading,`px-2 py-1.5 uppercase`),children:t}),n.map(e=>{let n=o({provider:e.provider??t,model:e.id});return(0,R.jsx)(C,{value:n,children:N(e.id)},n)})]},t)}function W(e){return[...e].sort((e,t)=>{let n=(e.provider??``).localeCompare(t.provider??``);return n===0?N(e.id).localeCompare(N(t.id)):n})}function G({projectId:e,onProjectUpdated:n}){let r=h(),[i,a]=(0,I.useState)({}),[o,s]=(0,I.useState)({}),[c,l]=(0,I.useState)([]),[u,d]=(0,I.useState)(!0),[f,p]=(0,I.useState)(!1),y=(0,I.useCallback)(async()=>{if(!e){d(!1);return}d(!0);try{let[t,n]=await Promise.all([b(e),v().catch(()=>({}))]),r=t.modelAliases??{};l(W(Object.values(n).flat())),a(r),s(r)}catch(e){P({title:`Error`,description:e instanceof Error?e.message:`Failed to load model aliases`,variant:`destructive`})}finally{d(!1)}},[e]);(0,I.useLayoutEffect)(()=>{e&&d(!0)},[e]),(0,I.useEffect)(()=>{y()},[y]);let S=F(e,[u]);function C(){return JSON.stringify(i)!==JSON.stringify(o)}async function w(){if(!(!e||!C())){p(!0);try{let a=Object.keys(i).length>0?i:void 0;if(a){let e=await v();t(a,Object.fromEntries(Object.entries(e).map(([e,t])=>[e,t.map(e=>e.id)])))}await _(e,{modelAliases:a??null}),s(i),n&&await n(),await y(),r(`/`)}catch(e){P({title:`Error`,description:e instanceof Error?e.message:`Failed to save model aliases`,variant:`destructive`})}finally{p(!1)}}}return e?(0,R.jsx)(k,{loading:S,children:(0,R.jsxs)(E,{className:`shrink-0`,children:[(0,R.jsx)(O,{title:`Model Aliases`,description:`Map short names (fast, local, cheap, smart) to enabled models. Subagents can reference these aliases in AGENT.md. Set Cheap to enable Orchestrate mode.`,action:(0,R.jsx)(g,{onClick:()=>void w(),disabled:f||u,children:f?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(m,{className:`mr-2 h-4 w-4 animate-spin`}),`Saving...`]}):`Save`}),sticky:!1}),(0,R.jsx)(x,{className:`max-w-none pt-6`,children:(0,R.jsx)(V,{value:i,onChange:a,enabledModels:c,disabled:u||f})})]})}):(0,R.jsx)(j,{title:`No project selected`,children:`Please select a project from the sidebar to configure model aliases.`})}export{G as default};
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Di as t,Oi as n,Rr as r,Rt as i,i as a,ii as o,ki as s,yt as c}from"./interactive-BrHVRHmQ.js";import{Wt as l}from"./react-vendor-B7jFrulV.js";import{Ca as u,Ei as d,Eo as f,Si as p,Ti as m,b as h,cr as g,dt as ee,it as te,lt as ne,mt as re,rt as ie,st as ae,tt as _,ut as oe,x as se}from"./onboarding-DVc9-yKJ.js";import{t as v}from"./use-toast-hxHsVv6a.js";import{U as ce,ft as le,i as ue,o as y}from"./index-B0xy4BkI.js";import{i as de}from"./commit-method-fields-Dijc502F.js";import{a as fe,n as b,r as pe,t as x}from"./context-menu-C51M1WGZ.js";import{t as me}from"./use-settings-page-loading-BU2CDnfE.js";var S=n(),C=e(s(),1),w=t();function he(e){return new Promise((t,n)=>{let r=new Image;r.onload=()=>t(r),r.onerror=()=>n(Error(`The selected file is not a readable image.`)),r.src=e})}async function ge(e,t){if(!e){t.setLoading(!1);return}t.setLoading(!0);try{let n=await g(e);t.setProjectPath(n.projectPath??null),t.setName(n.name??``),t.setValue(n.setupScript??``),t.setValidationScript(n.validationScript??``),t.setRunCmd(n.runCommand??``),t.setCommitMethod(n.commitMethod??o.PullRequest),t.setAllowAllCommands(n.allowAllCommands!==!1),t.setAllowedCommandPatterns(n.allowedCommandPatterns??[]),t.setUseBuiltInBrowser(n.useBuiltInBrowser!==!1),t.setProjectIcon(n.projectIcon??null),t.setOriginalName(n.name??``),t.setOriginalAllowAllCommands(n.allowAllCommands!==!1),t.setOriginalAllowedCommandPatterns(n.allowedCommandPatterns??[]),t.setOriginalUseBuiltInBrowser(n.useBuiltInBrowser!==!1),t.setOriginalProjectIcon(n.projectIcon??null)}catch(e){v({title:`Error`,description:e instanceof Error?e.message:`Failed to load project settings`,variant:`destructive`})}finally{t.setLoading(!1)}}async function T(e,t){try{let n=await he(e),r=document.createElement(`canvas`);r.width=256,r.height=256;let i=r.getContext(`2d`);if(!i)throw Error(`Could not prepare image conversion`);i.imageSmoothingEnabled=!0,i.imageSmoothingQuality=`high`;let a=Math.max(256/n.naturalWidth,256/n.naturalHeight),o=n.naturalWidth*a,s=n.naturalHeight*a;i.drawImage(n,(256-o)/2,(256-s)/2,o,s),t(r.toDataURL(`image/png`))}catch(e){v({title:`Could not use image`,description:e instanceof Error?e.message:`The selected file could not be read.`,variant:`destructive`})}}async function _e(e,t){let n=e.target.files?.[0];if(e.target.value=``,!n)return;let r=URL.createObjectURL(n);try{await T(r,t)}finally{URL.revokeObjectURL(r)}}async function ve(e,t,n){n(!0);try{let n=await p(e);n.runCommand?(t(n.runCommand),v({title:`Success`,description:`Suggested: ${n.runCommand}`})):v({title:`No command found`,description:`Could not detect a dev script in package.json`})}catch(e){v({title:`Error`,description:e instanceof Error?e.message:`Failed to suggest command`,variant:`destructive`})}finally{n(!1)}}async function E(e,t,n){t!==n&&await d(e,t)}async function ye(e,t,n,r,i){await m(e,{setupScript:t.trim()||null,validationScript:n.trim()||null,runCommand:r.trim()||null,commitMethod:i})}async function be(e,t,n,r,i){(t!==r||JSON.stringify(n)!==JSON.stringify(i))&&await m(e,{allowAllCommands:t,allowedCommandPatterns:n})}async function xe(e,t,n){t!==n&&await m(e,{useBuiltInBrowser:t})}async function D(e,t,n){t!==n&&await m(e,{projectIcon:t})}async function Se(e,t,n,r,i,a){n.setSaving(!0);try{await E(e,t.name,t.originalName),await ye(e,t.value,t.validationScript,t.runCmd,t.commitMethod),await be(e,t.allowAllCommands,t.allowedCommandPatterns,t.originalAllowAllCommands,t.originalAllowedCommandPatterns),await xe(e,t.useBuiltInBrowser,t.originalUseBuiltInBrowser),await D(e,t.projectIcon,t.originalProjectIcon),n.setOriginalName(t.name),n.setOriginalAllowAllCommands(t.allowAllCommands),n.setOriginalAllowedCommandPatterns(t.allowedCommandPatterns),n.setOriginalUseBuiltInBrowser(t.useBuiltInBrowser),n.setOriginalProjectIcon(t.projectIcon),r&&await r(),await a(),i(`/`)}catch(e){v({title:`Error`,description:e instanceof Error?e.message:`Failed to save settings`,variant:`destructive`})}finally{n.setSaving(!1)}}function Ce(e){let t=(0,S.c)(10),{allowAllCommands:n,patterns:i,disabled:o,onRemove:s}=e;if(n||i.length===0)return null;let c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,w.jsx)(h,{children:`Allowed command patterns`}),t[0]=c):c=t[0];let l;if(t[1]!==o||t[2]!==s||t[3]!==i){let e;t[5]!==o||t[6]!==s?(e=e=>(0,w.jsxs)(`li`,{className:`flex items-center justify-between rounded-md border border-border px-3 py-2`,children:[(0,w.jsx)(`code`,{className:a(r.mono,r.bodyMuted),children:e}),(0,w.jsx)(f,{type:`button`,variant:`ghost`,size:`sm`,disabled:o,onClick:()=>s(e),children:`Remove`})]},e),t[5]=o,t[6]=s,t[7]=e):e=t[7],l=i.map(e),t[1]=o,t[2]=s,t[3]=i,t[4]=l}else l=t[4];let u;return t[8]===l?u=t[9]:(u=(0,w.jsxs)(`div`,{className:`space-y-2 mt-3`,children:[c,(0,w.jsx)(`ul`,{className:`space-y-1`,children:l})]}),t[8]=l,t[9]=u),u}function we(e){let t=(0,S.c)(21),{projectIcon:n,disabled:r,inputRef:a,onFileChange:o,onButtonClick:s,onRemove:c}=e,l;t[0]!==r||t[1]!==a||t[2]!==o?(l=(0,w.jsx)(`input`,{ref:a,type:`file`,accept:`image/*`,className:`sr-only`,onChange:o,disabled:r}),t[0]=r,t[1]=a,t[2]=o,t[3]=l):l=t[3];let u=n?`Change project icon`:`Choose project icon`,d;t[4]===n?d=t[5]:(d=n?(0,w.jsx)(`img`,{src:n,alt:``,className:`h-full w-full object-cover`}):(0,w.jsx)(i,{className:`h-4 w-4 text-muted-foreground`,strokeWidth:1.5}),t[4]=n,t[5]=d);let f;t[6]!==r||t[7]!==s||t[8]!==u||t[9]!==d?(f=(0,w.jsx)(fe,{asChild:!0,children:(0,w.jsx)(`button`,{type:`button`,className:`flex h-8 w-8 items-center justify-center overflow-hidden rounded-md border border-border bg-muted/40 outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:s,disabled:r,"aria-label":u,children:d})}),t[6]=r,t[7]=s,t[8]=u,t[9]=d,t[10]=f):f=t[10];let p;t[11]!==r||t[12]!==c||t[13]!==n?(p=n&&(0,w.jsx)(b,{children:(0,w.jsx)(pe,{disabled:r,onSelect:c,children:`Remove`})}),t[11]=r,t[12]=c,t[13]=n,t[14]=p):p=t[14];let m;t[15]!==f||t[16]!==p?(m=(0,w.jsxs)(x,{children:[f,p]}),t[15]=f,t[16]=p,t[17]=m):m=t[17];let h;return t[18]!==l||t[19]!==m?(h=(0,w.jsxs)(`div`,{className:`flex items-center gap-2`,children:[l,m]}),t[18]=l,t[19]=m,t[20]=h):h=t[20],h}function Te(e){let t=(0,S.c)(6),{saving:n,disabled:r,onClick:i}=e,a;t[0]===n?a=t[1]:(a=n?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(c,{className:`mr-2 h-4 w-4 animate-spin`}),`Saving...`]}):`Save`,t[0]=n,t[1]=a);let o;return t[2]!==r||t[3]!==i||t[4]!==a?(o=(0,w.jsx)(f,{onClick:i,disabled:r,children:a}),t[2]=r,t[3]=i,t[4]=a,t[5]=o):o=t[5],o}function Ee(e,t,n){let r=(0,S.c)(13),i;r[0]===e?i=r[1]:(i=function(t){return T(t,e)},r[0]=e,r[1]=i);let a=i,o,s;r[2]===a?(o=r[3],s=r[4]):(o=()=>{if(!u())return;let e=function(e){let t=e.detail.dataUrl;a(t)};return window.addEventListener(`tarsk:project-icon-selected`,e),()=>{window.removeEventListener(`tarsk:project-icon-selected`,e)}},s=[a],r[2]=a,r[3]=o,r[4]=s),(0,C.useEffect)(o,s);let c;r[5]===e?c=r[6]:(c=function(t){return _e(t,e)},r[5]=e,r[6]=c);let l=c,d;r[7]!==n||r[8]!==t?(d=function(){u()&&t?y(t):n.current?.click()},r[7]=n,r[8]=t,r[9]=d):d=r[9];let f=d,p;return r[10]!==f||r[11]!==l?(p={handleProjectIconChange:l,handleProjectIconButtonClick:f},r[10]=f,r[11]=l,r[12]=p):p=r[12],p}function De(e){let t=(0,S.c)(117),{projectId:n,onProjectUpdated:i}=e,s=l(),u=ue(),[d,p]=(0,C.useState)(``),[m,h]=(0,C.useState)(``),[g,v]=(0,C.useState)(``),[y,fe]=(0,C.useState)(o.PullRequest),[b,pe]=(0,C.useState)(``),[x,he]=(0,C.useState)(!1),[T,_e]=(0,C.useState)(!1),[E,ye]=(0,C.useState)(!0),[be,xe]=(0,C.useState)(``),[D,De]=(0,C.useState)(!0),Oe;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=[],t[0]=Oe):Oe=t[0];let[O,ke]=(0,C.useState)(Oe),[Ae,je]=(0,C.useState)(!0),Me;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(Me=[],t[1]=Me):Me=t[1];let[Ne,Pe]=(0,C.useState)(Me),[k,Fe]=(0,C.useState)(!0),[Ie,Le]=(0,C.useState)(!0),[A,Re]=(0,C.useState)(null),[ze,Be]=(0,C.useState)(null),[Ve,He]=(0,C.useState)(null),Ue=(0,C.useRef)(null),We;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(We={setProjectPath:He,setName:p,setValue:h,setRunCmd:v,setCommitMethod:fe,setValidationScript:pe,setAllowAllCommands:De,setAllowedCommandPatterns:ke,setUseBuiltInBrowser:Fe,setProjectIcon:Re,setOriginalName:xe,setOriginalAllowAllCommands:je,setOriginalAllowedCommandPatterns:Pe,setOriginalUseBuiltInBrowser:Le,setOriginalProjectIcon:Be,setLoading:ye,setSaving:he},t[2]=We):We=t[2];let Ge=We,j;t[3]===n?j=t[4]:(j=()=>ge(n,Ge),t[3]=n,t[4]=j);let M=j,Ke,qe;t[5]===n?(Ke=t[6],qe=t[7]):(Ke=()=>{n&&ye(!0)},qe=[n],t[5]=n,t[6]=Ke,t[7]=qe),(0,C.useLayoutEffect)(Ke,qe);let Je,Ye;t[8]===M?(Je=t[9],Ye=t[10]):(Je=()=>{M()},Ye=[M],t[8]=M,t[9]=Je,t[10]=Ye),(0,C.useEffect)(Je,Ye);let Xe;t[11]===E?Xe=t[12]:(Xe=[E],t[11]=E,t[12]=Xe);let Ze=me(n,Xe),Qe;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(Qe=function(e){fe(e)},t[13]=Qe):Qe=t[13];let $e=Qe,{handleProjectIconChange:et,handleProjectIconButtonClick:tt}=Ee(Re,Ve,Ue),nt;t[14]===n?nt=t[15]:(nt=async()=>{n&&await ve(n,v,_e)},t[14]=n,t[15]=nt);let rt=nt,it;t[16]!==D||t[17]!==O||t[18]!==y||t[19]!==M||t[20]!==d||t[21]!==s||t[22]!==i||t[23]!==Ae||t[24]!==Ne||t[25]!==be||t[26]!==ze||t[27]!==Ie||t[28]!==A||t[29]!==n||t[30]!==g||t[31]!==k||t[32]!==b||t[33]!==m?(it=async()=>{n&&await Se(n,{name:d,value:m,runCmd:g,commitMethod:y,validationScript:b,allowAllCommands:D,allowedCommandPatterns:O,useBuiltInBrowser:k,projectIcon:A,originalName:be,originalAllowAllCommands:Ae,originalAllowedCommandPatterns:Ne,originalUseBuiltInBrowser:Ie,originalProjectIcon:ze},Ge,i,s,M)},t[16]=D,t[17]=O,t[18]=y,t[19]=M,t[20]=d,t[21]=s,t[22]=i,t[23]=Ae,t[24]=Ne,t[25]=be,t[26]=ze,t[27]=Ie,t[28]=A,t[29]=n,t[30]=g,t[31]=k,t[32]=b,t[33]=m,t[34]=it):it=t[34];let at=it,N=E||x,ot=E||T;if(!n){let e;return t[35]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,w.jsx)(oe,{title:`No project selected`,children:`Please select a project from the sidebar to view its settings.`}),t[35]=e):e=t[35],e}let P;t[36]!==N||t[37]!==at||t[38]!==x?(P=(0,w.jsx)(ie,{title:`Project Settings`,description:`Configure settings for your project.`,action:(0,w.jsx)(Te,{saving:x,disabled:N,onClick:at}),sticky:!1}),t[36]=N,t[37]=at,t[38]=x,t[39]=P):P=t[39];let st;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(st=e=>p(e.target.value),t[40]=st):st=t[40];let F;t[41]!==E||t[42]!==d?(F=(0,w.jsx)(_,{title:`Project Name`,children:(0,w.jsx)(se,{id:`projectName`,value:d,onChange:st,placeholder:`Enter project name`,disabled:E})}),t[41]=E,t[42]=d,t[43]=F):F=t[43];let ct;t[44]===Symbol.for(`react.memo_cache_sentinel`)?(ct=e=>h(e.target.value),t[44]=ct):ct=t[44];let I;t[45]!==E||t[46]!==m?(I=(0,w.jsx)(_,{title:`Setup Script`,description:`This script runs automatically after cloning the repo for new threads.`,children:(0,w.jsx)(ce,{id:`setupScript`,value:m,onChange:ct,placeholder:`e.g. npm install`,className:`font-mono min-h-[80px] resize-none`,disabled:E})}),t[45]=E,t[46]=m,t[47]=I):I=t[47];let lt;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(lt=e=>pe(e.target.value),t[48]=lt):lt=t[48];let L;t[49]!==E||t[50]!==b?(L=(0,w.jsx)(_,{title:`Validation Script`,description:`This script runs after each chat response. If it fails, Tarsk will try to fix issues automatically up to the retry limit.`,children:(0,w.jsx)(ce,{id:`validationScript`,value:b,onChange:lt,placeholder:`e.g. npm run lint && npm test`,className:`font-mono min-h-[80px] resize-none`,disabled:E})}),t[49]=E,t[50]=b,t[51]=L):L=t[51];let ut;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(ut=e=>v(e.target.value),t[52]=ut):ut=t[52];let R;t[53]!==E||t[54]!==g?(R=(0,w.jsx)(se,{id:`runCommand`,value:g,onChange:ut,placeholder:`e.g. npm run dev`,className:`font-mono pr-28`,disabled:E}),t[53]=E,t[54]=g,t[55]=R):R=t[55];let z;t[56]===T?z=t[57]:(z=T?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(c,{className:`h-3 w-3 animate-spin`}),`Suggesting...`]}):`Suggest`,t[56]=T,t[57]=z);let B;t[58]!==rt||t[59]!==ot||t[60]!==z?(B=(0,w.jsx)(f,{variant:`ghost`,size:`sm`,className:`absolute right-1 top-1 h-8`,onClick:rt,disabled:ot,children:z}),t[58]=rt,t[59]=ot,t[60]=z,t[61]=B):B=t[61];let V;t[62]!==R||t[63]!==B?(V=(0,w.jsx)(_,{title:`Run Command`,description:`The command to start the dev server. Leave empty to disable run functionality.`,children:(0,w.jsxs)(`div`,{className:`relative`,children:[R,B]})}),t[62]=R,t[63]=B,t[64]=V):V=t[64];let dt=y===o.PullRequest?`Feature branches are created and pull requests can be created.`:`Commits are made directly to the main branch without feature branches.`,H;t[65]!==y||t[66]!==E?(H=(0,w.jsx)(de,{commitMethod:y,onCommitMethodChange:$e,disabled:E}),t[65]=y,t[66]=E,t[67]=H):H=t[67];let U;t[68]!==dt||t[69]!==H?(U=(0,w.jsx)(_,{title:`Commit Method`,description:dt,controlLayout:`row-end`,action:H}),t[68]=dt,t[69]=H,t[70]=U):U=t[70];let ft=!D,pt;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(pt=e=>De(!e),t[71]=pt):pt=t[71];let W;t[72]!==E||t[73]!==ft?(W=(0,w.jsx)(le,{value:ft,onChange:pt,disabled:E,ariaLabel:`Confirm Commands`}),t[72]=E,t[73]=ft,t[74]=W):W=t[74];let G;t[75]!==D||t[76]!==O||t[77]!==N?(G=!D&&O.length>0&&(0,w.jsx)(Ce,{allowAllCommands:D,patterns:O,disabled:N,onRemove:e=>ke(t=>t.filter(t=>t!==e))}),t[75]=D,t[76]=O,t[77]=N,t[78]=G):G=t[78];let K;t[79]!==W||t[80]!==G?(K=(0,w.jsx)(_,{title:`Confirm Commands`,description:`When enabled, the agent asks for approval before running bash commands, skill scripts, and browser shell calls.`,controlLayout:`row-end`,action:W,children:G}),t[79]=W,t[80]=G,t[81]=K):K=t[81];let q;t[82]!==N||t[83]!==k?(q=(0,w.jsx)(_,{title:`Built-in Browser`,description:`When enabled, Tarsk shows the Browser tab and opens detected dev URLs in the app. When disabled, the tab is hidden and URLs open in your system browser.`,controlLayout:`row-end`,action:(0,w.jsx)(le,{value:k,onChange:Fe,disabled:N,ariaLabel:`Built-in Browser`})}),t[82]=N,t[83]=k,t[84]=q):q=t[84];let mt;t[85]===Symbol.for(`react.memo_cache_sentinel`)?(mt=()=>Re(null),t[85]=mt):mt=t[85];let J;t[86]!==N||t[87]!==tt||t[88]!==et||t[89]!==A?(J=(0,w.jsx)(_,{title:`Project Icon`,description:`Choose an image to use for this project on the Projects page. It will be center-cropped to a 256×256 PNG.`,controlLayout:`row-end`,action:(0,w.jsx)(we,{projectIcon:A,disabled:N,inputRef:Ue,onFileChange:et,onButtonClick:tt,onRemove:mt})}),t[86]=N,t[87]=tt,t[88]=et,t[89]=A,t[90]=J):J=t[90];let Y;t[91]!==F||t[92]!==I||t[93]!==L||t[94]!==V||t[95]!==U||t[96]!==K||t[97]!==q||t[98]!==J?(Y=(0,w.jsx)(ee,{className:`max-w-none pt-6`,children:(0,w.jsxs)(ne,{children:[F,I,L,V,U,K,q,J]})}),t[91]=F,t[92]=I,t[93]=L,t[94]=V,t[95]=U,t[96]=K,t[97]=q,t[98]=J,t[99]=Y):Y=t[99];let X;t[100]!==P||t[101]!==Y?(X=(0,w.jsxs)(re,{className:`shrink-0`,children:[P,Y]}),t[100]=P,t[101]=Y,t[102]=X):X=t[102];let ht;t[103]===Symbol.for(`react.memo_cache_sentinel`)?(ht=(0,w.jsx)(te,{title:`Delete Project`}),t[103]=ht):ht=t[103];let gt;t[104]===Symbol.for(`react.memo_cache_sentinel`)?(gt=(0,w.jsx)(`div`,{className:`min-w-0`,children:(0,w.jsx)(`p`,{className:a(r.bodyMuted),children:`Permanently removes the project, its threads, and all associated storage. This action cannot be undone.`})}),t[104]=gt):gt=t[104];let Z;t[105]!==d||t[106]!==n||t[107]!==u?(Z=()=>{n&&u({id:n,name:d})},t[105]=d,t[106]=n,t[107]=u,t[108]=Z):Z=t[108];let Q;t[109]!==N||t[110]!==Z?(Q=(0,w.jsxs)(re,{className:`shrink-0 rounded-none border-t border-table-border pt-6 mt-8`,children:[ht,(0,w.jsxs)(`div`,{className:`flex flex-col items-start gap-4`,children:[gt,(0,w.jsx)(f,{type:`button`,variant:`destructive`,disabled:N,onClick:Z,children:`Delete Project`})]})]}),t[109]=N,t[110]=Z,t[111]=Q):Q=t[111];let $;return t[112]!==Ze||t[113]!==n||t[114]!==X||t[115]!==Q?($=(0,w.jsxs)(ae,{loading:Ze,children:[X,Q]},n),t[112]=Ze,t[113]=n,t[114]=X,t[115]=Q,t[116]=$):$=t[116],$}export{De as default};
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Di as t,Oi as n,Rr as r,Rt as i,i as a,ii as o,ki as s,yt as c}from"./interactive-BrHVRHmQ.js";import{Wt as l}from"./react-vendor-7n7LyU5o.js";import{Ca as u,Ei as d,Eo as f,Si as p,Ti as m,b as h,cr as g,dt as ee,it as te,lt as ne,mt as re,rt as ie,st as ae,tt as _,ut as oe,x as se}from"./onboarding-KBcwP-kU.js";import{t as v}from"./use-toast-hxHsVv6a.js";import{U as ce,ft as le,i as ue,o as y}from"./index-CJCQ4bTo.js";import{i as de}from"./commit-method-fields-o-xw2faT.js";import{a as fe,n as b,r as pe,t as x}from"./context-menu-BLvLpqq7.js";import{t as me}from"./use-settings-page-loading-BU2CDnfE.js";var S=n(),C=e(s(),1),w=t();function he(e){return new Promise((t,n)=>{let r=new Image;r.onload=()=>t(r),r.onerror=()=>n(Error(`The selected file is not a readable image.`)),r.src=e})}async function ge(e,t){if(!e){t.setLoading(!1);return}t.setLoading(!0);try{let n=await g(e);t.setProjectPath(n.projectPath??null),t.setName(n.name??``),t.setValue(n.setupScript??``),t.setValidationScript(n.validationScript??``),t.setRunCmd(n.runCommand??``),t.setCommitMethod(n.commitMethod??o.PullRequest),t.setAllowAllCommands(n.allowAllCommands!==!1),t.setAllowedCommandPatterns(n.allowedCommandPatterns??[]),t.setUseBuiltInBrowser(n.useBuiltInBrowser!==!1),t.setProjectIcon(n.projectIcon??null),t.setOriginalName(n.name??``),t.setOriginalAllowAllCommands(n.allowAllCommands!==!1),t.setOriginalAllowedCommandPatterns(n.allowedCommandPatterns??[]),t.setOriginalUseBuiltInBrowser(n.useBuiltInBrowser!==!1),t.setOriginalProjectIcon(n.projectIcon??null)}catch(e){v({title:`Error`,description:e instanceof Error?e.message:`Failed to load project settings`,variant:`destructive`})}finally{t.setLoading(!1)}}async function T(e,t){try{let n=await he(e),r=document.createElement(`canvas`);r.width=256,r.height=256;let i=r.getContext(`2d`);if(!i)throw Error(`Could not prepare image conversion`);i.imageSmoothingEnabled=!0,i.imageSmoothingQuality=`high`;let a=Math.max(256/n.naturalWidth,256/n.naturalHeight),o=n.naturalWidth*a,s=n.naturalHeight*a;i.drawImage(n,(256-o)/2,(256-s)/2,o,s),t(r.toDataURL(`image/png`))}catch(e){v({title:`Could not use image`,description:e instanceof Error?e.message:`The selected file could not be read.`,variant:`destructive`})}}async function _e(e,t){let n=e.target.files?.[0];if(e.target.value=``,!n)return;let r=URL.createObjectURL(n);try{await T(r,t)}finally{URL.revokeObjectURL(r)}}async function ve(e,t,n){n(!0);try{let n=await p(e);n.runCommand?(t(n.runCommand),v({title:`Success`,description:`Suggested: ${n.runCommand}`})):v({title:`No command found`,description:`Could not detect a dev script in package.json`})}catch(e){v({title:`Error`,description:e instanceof Error?e.message:`Failed to suggest command`,variant:`destructive`})}finally{n(!1)}}async function E(e,t,n){t!==n&&await d(e,t)}async function ye(e,t,n,r,i){await m(e,{setupScript:t.trim()||null,validationScript:n.trim()||null,runCommand:r.trim()||null,commitMethod:i})}async function be(e,t,n,r,i){(t!==r||JSON.stringify(n)!==JSON.stringify(i))&&await m(e,{allowAllCommands:t,allowedCommandPatterns:n})}async function xe(e,t,n){t!==n&&await m(e,{useBuiltInBrowser:t})}async function D(e,t,n){t!==n&&await m(e,{projectIcon:t})}async function Se(e,t,n,r,i,a){n.setSaving(!0);try{await E(e,t.name,t.originalName),await ye(e,t.value,t.validationScript,t.runCmd,t.commitMethod),await be(e,t.allowAllCommands,t.allowedCommandPatterns,t.originalAllowAllCommands,t.originalAllowedCommandPatterns),await xe(e,t.useBuiltInBrowser,t.originalUseBuiltInBrowser),await D(e,t.projectIcon,t.originalProjectIcon),n.setOriginalName(t.name),n.setOriginalAllowAllCommands(t.allowAllCommands),n.setOriginalAllowedCommandPatterns(t.allowedCommandPatterns),n.setOriginalUseBuiltInBrowser(t.useBuiltInBrowser),n.setOriginalProjectIcon(t.projectIcon),r&&await r(),await a(),i(`/`)}catch(e){v({title:`Error`,description:e instanceof Error?e.message:`Failed to save settings`,variant:`destructive`})}finally{n.setSaving(!1)}}function Ce(e){let t=(0,S.c)(10),{allowAllCommands:n,patterns:i,disabled:o,onRemove:s}=e;if(n||i.length===0)return null;let c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,w.jsx)(h,{children:`Allowed command patterns`}),t[0]=c):c=t[0];let l;if(t[1]!==o||t[2]!==s||t[3]!==i){let e;t[5]!==o||t[6]!==s?(e=e=>(0,w.jsxs)(`li`,{className:`flex items-center justify-between rounded-md border border-border px-3 py-2`,children:[(0,w.jsx)(`code`,{className:a(r.mono,r.bodyMuted),children:e}),(0,w.jsx)(f,{type:`button`,variant:`ghost`,size:`sm`,disabled:o,onClick:()=>s(e),children:`Remove`})]},e),t[5]=o,t[6]=s,t[7]=e):e=t[7],l=i.map(e),t[1]=o,t[2]=s,t[3]=i,t[4]=l}else l=t[4];let u;return t[8]===l?u=t[9]:(u=(0,w.jsxs)(`div`,{className:`space-y-2 mt-3`,children:[c,(0,w.jsx)(`ul`,{className:`space-y-1`,children:l})]}),t[8]=l,t[9]=u),u}function we(e){let t=(0,S.c)(21),{projectIcon:n,disabled:r,inputRef:a,onFileChange:o,onButtonClick:s,onRemove:c}=e,l;t[0]!==r||t[1]!==a||t[2]!==o?(l=(0,w.jsx)(`input`,{ref:a,type:`file`,accept:`image/*`,className:`sr-only`,onChange:o,disabled:r}),t[0]=r,t[1]=a,t[2]=o,t[3]=l):l=t[3];let u=n?`Change project icon`:`Choose project icon`,d;t[4]===n?d=t[5]:(d=n?(0,w.jsx)(`img`,{src:n,alt:``,className:`h-full w-full object-cover`}):(0,w.jsx)(i,{className:`h-4 w-4 text-muted-foreground`,strokeWidth:1.5}),t[4]=n,t[5]=d);let f;t[6]!==r||t[7]!==s||t[8]!==u||t[9]!==d?(f=(0,w.jsx)(fe,{asChild:!0,children:(0,w.jsx)(`button`,{type:`button`,className:`flex h-8 w-8 items-center justify-center overflow-hidden rounded-md border border-border bg-muted/40 outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:s,disabled:r,"aria-label":u,children:d})}),t[6]=r,t[7]=s,t[8]=u,t[9]=d,t[10]=f):f=t[10];let p;t[11]!==r||t[12]!==c||t[13]!==n?(p=n&&(0,w.jsx)(b,{children:(0,w.jsx)(pe,{disabled:r,onSelect:c,children:`Remove`})}),t[11]=r,t[12]=c,t[13]=n,t[14]=p):p=t[14];let m;t[15]!==f||t[16]!==p?(m=(0,w.jsxs)(x,{children:[f,p]}),t[15]=f,t[16]=p,t[17]=m):m=t[17];let h;return t[18]!==l||t[19]!==m?(h=(0,w.jsxs)(`div`,{className:`flex items-center gap-2`,children:[l,m]}),t[18]=l,t[19]=m,t[20]=h):h=t[20],h}function Te(e){let t=(0,S.c)(6),{saving:n,disabled:r,onClick:i}=e,a;t[0]===n?a=t[1]:(a=n?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(c,{className:`mr-2 h-4 w-4 animate-spin`}),`Saving...`]}):`Save`,t[0]=n,t[1]=a);let o;return t[2]!==r||t[3]!==i||t[4]!==a?(o=(0,w.jsx)(f,{onClick:i,disabled:r,children:a}),t[2]=r,t[3]=i,t[4]=a,t[5]=o):o=t[5],o}function Ee(e,t,n){let r=(0,S.c)(13),i;r[0]===e?i=r[1]:(i=function(t){return T(t,e)},r[0]=e,r[1]=i);let a=i,o,s;r[2]===a?(o=r[3],s=r[4]):(o=()=>{if(!u())return;let e=function(e){let t=e.detail.dataUrl;a(t)};return window.addEventListener(`tarsk:project-icon-selected`,e),()=>{window.removeEventListener(`tarsk:project-icon-selected`,e)}},s=[a],r[2]=a,r[3]=o,r[4]=s),(0,C.useEffect)(o,s);let c;r[5]===e?c=r[6]:(c=function(t){return _e(t,e)},r[5]=e,r[6]=c);let l=c,d;r[7]!==n||r[8]!==t?(d=function(){u()&&t?y(t):n.current?.click()},r[7]=n,r[8]=t,r[9]=d):d=r[9];let f=d,p;return r[10]!==f||r[11]!==l?(p={handleProjectIconChange:l,handleProjectIconButtonClick:f},r[10]=f,r[11]=l,r[12]=p):p=r[12],p}function De(e){let t=(0,S.c)(117),{projectId:n,onProjectUpdated:i}=e,s=l(),u=ue(),[d,p]=(0,C.useState)(``),[m,h]=(0,C.useState)(``),[g,v]=(0,C.useState)(``),[y,fe]=(0,C.useState)(o.PullRequest),[b,pe]=(0,C.useState)(``),[x,he]=(0,C.useState)(!1),[T,_e]=(0,C.useState)(!1),[E,ye]=(0,C.useState)(!0),[be,xe]=(0,C.useState)(``),[D,De]=(0,C.useState)(!0),Oe;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=[],t[0]=Oe):Oe=t[0];let[O,ke]=(0,C.useState)(Oe),[Ae,je]=(0,C.useState)(!0),Me;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(Me=[],t[1]=Me):Me=t[1];let[Ne,Pe]=(0,C.useState)(Me),[k,Fe]=(0,C.useState)(!0),[Ie,Le]=(0,C.useState)(!0),[A,Re]=(0,C.useState)(null),[ze,Be]=(0,C.useState)(null),[Ve,He]=(0,C.useState)(null),Ue=(0,C.useRef)(null),We;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(We={setProjectPath:He,setName:p,setValue:h,setRunCmd:v,setCommitMethod:fe,setValidationScript:pe,setAllowAllCommands:De,setAllowedCommandPatterns:ke,setUseBuiltInBrowser:Fe,setProjectIcon:Re,setOriginalName:xe,setOriginalAllowAllCommands:je,setOriginalAllowedCommandPatterns:Pe,setOriginalUseBuiltInBrowser:Le,setOriginalProjectIcon:Be,setLoading:ye,setSaving:he},t[2]=We):We=t[2];let Ge=We,j;t[3]===n?j=t[4]:(j=()=>ge(n,Ge),t[3]=n,t[4]=j);let M=j,Ke,qe;t[5]===n?(Ke=t[6],qe=t[7]):(Ke=()=>{n&&ye(!0)},qe=[n],t[5]=n,t[6]=Ke,t[7]=qe),(0,C.useLayoutEffect)(Ke,qe);let Je,Ye;t[8]===M?(Je=t[9],Ye=t[10]):(Je=()=>{M()},Ye=[M],t[8]=M,t[9]=Je,t[10]=Ye),(0,C.useEffect)(Je,Ye);let Xe;t[11]===E?Xe=t[12]:(Xe=[E],t[11]=E,t[12]=Xe);let Ze=me(n,Xe),Qe;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(Qe=function(e){fe(e)},t[13]=Qe):Qe=t[13];let $e=Qe,{handleProjectIconChange:et,handleProjectIconButtonClick:tt}=Ee(Re,Ve,Ue),nt;t[14]===n?nt=t[15]:(nt=async()=>{n&&await ve(n,v,_e)},t[14]=n,t[15]=nt);let rt=nt,it;t[16]!==D||t[17]!==O||t[18]!==y||t[19]!==M||t[20]!==d||t[21]!==s||t[22]!==i||t[23]!==Ae||t[24]!==Ne||t[25]!==be||t[26]!==ze||t[27]!==Ie||t[28]!==A||t[29]!==n||t[30]!==g||t[31]!==k||t[32]!==b||t[33]!==m?(it=async()=>{n&&await Se(n,{name:d,value:m,runCmd:g,commitMethod:y,validationScript:b,allowAllCommands:D,allowedCommandPatterns:O,useBuiltInBrowser:k,projectIcon:A,originalName:be,originalAllowAllCommands:Ae,originalAllowedCommandPatterns:Ne,originalUseBuiltInBrowser:Ie,originalProjectIcon:ze},Ge,i,s,M)},t[16]=D,t[17]=O,t[18]=y,t[19]=M,t[20]=d,t[21]=s,t[22]=i,t[23]=Ae,t[24]=Ne,t[25]=be,t[26]=ze,t[27]=Ie,t[28]=A,t[29]=n,t[30]=g,t[31]=k,t[32]=b,t[33]=m,t[34]=it):it=t[34];let at=it,N=E||x,ot=E||T;if(!n){let e;return t[35]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,w.jsx)(oe,{title:`No project selected`,children:`Please select a project from the sidebar to view its settings.`}),t[35]=e):e=t[35],e}let P;t[36]!==N||t[37]!==at||t[38]!==x?(P=(0,w.jsx)(ie,{title:`Project Settings`,description:`Configure settings for your project.`,action:(0,w.jsx)(Te,{saving:x,disabled:N,onClick:at}),sticky:!1}),t[36]=N,t[37]=at,t[38]=x,t[39]=P):P=t[39];let st;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(st=e=>p(e.target.value),t[40]=st):st=t[40];let F;t[41]!==E||t[42]!==d?(F=(0,w.jsx)(_,{title:`Project Name`,children:(0,w.jsx)(se,{id:`projectName`,value:d,onChange:st,placeholder:`Enter project name`,disabled:E})}),t[41]=E,t[42]=d,t[43]=F):F=t[43];let ct;t[44]===Symbol.for(`react.memo_cache_sentinel`)?(ct=e=>h(e.target.value),t[44]=ct):ct=t[44];let I;t[45]!==E||t[46]!==m?(I=(0,w.jsx)(_,{title:`Setup Script`,description:`This script runs automatically after cloning the repo for new threads.`,children:(0,w.jsx)(ce,{id:`setupScript`,value:m,onChange:ct,placeholder:`e.g. npm install`,className:`font-mono min-h-[80px] resize-none`,disabled:E})}),t[45]=E,t[46]=m,t[47]=I):I=t[47];let lt;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(lt=e=>pe(e.target.value),t[48]=lt):lt=t[48];let L;t[49]!==E||t[50]!==b?(L=(0,w.jsx)(_,{title:`Validation Script`,description:`This script runs after each chat response. If it fails, Tarsk will try to fix issues automatically up to the retry limit.`,children:(0,w.jsx)(ce,{id:`validationScript`,value:b,onChange:lt,placeholder:`e.g. npm run lint && npm test`,className:`font-mono min-h-[80px] resize-none`,disabled:E})}),t[49]=E,t[50]=b,t[51]=L):L=t[51];let ut;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(ut=e=>v(e.target.value),t[52]=ut):ut=t[52];let R;t[53]!==E||t[54]!==g?(R=(0,w.jsx)(se,{id:`runCommand`,value:g,onChange:ut,placeholder:`e.g. npm run dev`,className:`font-mono pr-28`,disabled:E}),t[53]=E,t[54]=g,t[55]=R):R=t[55];let z;t[56]===T?z=t[57]:(z=T?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(c,{className:`h-3 w-3 animate-spin`}),`Suggesting...`]}):`Suggest`,t[56]=T,t[57]=z);let B;t[58]!==rt||t[59]!==ot||t[60]!==z?(B=(0,w.jsx)(f,{variant:`ghost`,size:`sm`,className:`absolute right-1 top-1 h-8`,onClick:rt,disabled:ot,children:z}),t[58]=rt,t[59]=ot,t[60]=z,t[61]=B):B=t[61];let V;t[62]!==R||t[63]!==B?(V=(0,w.jsx)(_,{title:`Run Command`,description:`The command to start the dev server. Leave empty to disable run functionality.`,children:(0,w.jsxs)(`div`,{className:`relative`,children:[R,B]})}),t[62]=R,t[63]=B,t[64]=V):V=t[64];let dt=y===o.PullRequest?`Feature branches are created and pull requests can be created.`:`Commits are made directly to the main branch without feature branches.`,H;t[65]!==y||t[66]!==E?(H=(0,w.jsx)(de,{commitMethod:y,onCommitMethodChange:$e,disabled:E}),t[65]=y,t[66]=E,t[67]=H):H=t[67];let U;t[68]!==dt||t[69]!==H?(U=(0,w.jsx)(_,{title:`Commit Method`,description:dt,controlLayout:`row-end`,action:H}),t[68]=dt,t[69]=H,t[70]=U):U=t[70];let ft=!D,pt;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(pt=e=>De(!e),t[71]=pt):pt=t[71];let W;t[72]!==E||t[73]!==ft?(W=(0,w.jsx)(le,{value:ft,onChange:pt,disabled:E,ariaLabel:`Confirm Commands`}),t[72]=E,t[73]=ft,t[74]=W):W=t[74];let G;t[75]!==D||t[76]!==O||t[77]!==N?(G=!D&&O.length>0&&(0,w.jsx)(Ce,{allowAllCommands:D,patterns:O,disabled:N,onRemove:e=>ke(t=>t.filter(t=>t!==e))}),t[75]=D,t[76]=O,t[77]=N,t[78]=G):G=t[78];let K;t[79]!==W||t[80]!==G?(K=(0,w.jsx)(_,{title:`Confirm Commands`,description:`When enabled, the agent asks for approval before running bash commands, skill scripts, and browser shell calls.`,controlLayout:`row-end`,action:W,children:G}),t[79]=W,t[80]=G,t[81]=K):K=t[81];let q;t[82]!==N||t[83]!==k?(q=(0,w.jsx)(_,{title:`Built-in Browser`,description:`When enabled, Tarsk shows the Browser tab and opens detected dev URLs in the app. When disabled, the tab is hidden and URLs open in your system browser.`,controlLayout:`row-end`,action:(0,w.jsx)(le,{value:k,onChange:Fe,disabled:N,ariaLabel:`Built-in Browser`})}),t[82]=N,t[83]=k,t[84]=q):q=t[84];let mt;t[85]===Symbol.for(`react.memo_cache_sentinel`)?(mt=()=>Re(null),t[85]=mt):mt=t[85];let J;t[86]!==N||t[87]!==tt||t[88]!==et||t[89]!==A?(J=(0,w.jsx)(_,{title:`Project Icon`,description:`Choose an image to use for this project on the Projects page. It will be center-cropped to a 256×256 PNG.`,controlLayout:`row-end`,action:(0,w.jsx)(we,{projectIcon:A,disabled:N,inputRef:Ue,onFileChange:et,onButtonClick:tt,onRemove:mt})}),t[86]=N,t[87]=tt,t[88]=et,t[89]=A,t[90]=J):J=t[90];let Y;t[91]!==F||t[92]!==I||t[93]!==L||t[94]!==V||t[95]!==U||t[96]!==K||t[97]!==q||t[98]!==J?(Y=(0,w.jsx)(ee,{className:`max-w-none pt-6`,children:(0,w.jsxs)(ne,{children:[F,I,L,V,U,K,q,J]})}),t[91]=F,t[92]=I,t[93]=L,t[94]=V,t[95]=U,t[96]=K,t[97]=q,t[98]=J,t[99]=Y):Y=t[99];let X;t[100]!==P||t[101]!==Y?(X=(0,w.jsxs)(re,{className:`shrink-0`,children:[P,Y]}),t[100]=P,t[101]=Y,t[102]=X):X=t[102];let ht;t[103]===Symbol.for(`react.memo_cache_sentinel`)?(ht=(0,w.jsx)(te,{title:`Delete Project`}),t[103]=ht):ht=t[103];let gt;t[104]===Symbol.for(`react.memo_cache_sentinel`)?(gt=(0,w.jsx)(`div`,{className:`min-w-0`,children:(0,w.jsx)(`p`,{className:a(r.bodyMuted),children:`Permanently removes the project, its threads, and all associated storage. This action cannot be undone.`})}),t[104]=gt):gt=t[104];let Z;t[105]!==d||t[106]!==n||t[107]!==u?(Z=()=>{n&&u({id:n,name:d})},t[105]=d,t[106]=n,t[107]=u,t[108]=Z):Z=t[108];let Q;t[109]!==N||t[110]!==Z?(Q=(0,w.jsxs)(re,{className:`shrink-0 rounded-none border-t border-table-border pt-6 mt-8`,children:[ht,(0,w.jsxs)(`div`,{className:`flex flex-col items-start gap-4`,children:[gt,(0,w.jsx)(f,{type:`button`,variant:`destructive`,disabled:N,onClick:Z,children:`Delete Project`})]})]}),t[109]=N,t[110]=Z,t[111]=Q):Q=t[111];let $;return t[112]!==Ze||t[113]!==n||t[114]!==X||t[115]!==Q?($=(0,w.jsxs)(ae,{loading:Ze,children:[X,Q]},n),t[112]=Ze,t[113]=n,t[114]=X,t[115]=Q,t[116]=$):$=t[116],$}export{De as default};