@decocms/mesh 2.64.0 → 2.64.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. package/dist/client/assets/{AlertCircle-B7sqll3Z.js → AlertCircle-exKB88m_.js} +1 -1
  2. package/dist/client/assets/{ArrowUp-D8YYlj5b.js → ArrowUp-NeI_Sm5E.js} +1 -1
  3. package/dist/client/assets/{Calendar-Cn4v8JwE.js → Calendar-ChE-VbnE.js} +1 -1
  4. package/dist/client/assets/{Check-lN7sUZo8.js → Check-DqzdHNMw.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-En_P43wp.js → ChevronDown-DNLmRmxT.js} +1 -1
  6. package/dist/client/assets/{ChevronRight-BB2YL4K4.js → ChevronRight-BOG2FNn-.js} +1 -1
  7. package/dist/client/assets/{Code01-Dgx2dgXr.js → Code01-D9NkYkuA.js} +1 -1
  8. package/dist/client/assets/{Copy01-daHVbD8K.js → Copy01-BLooCkZe.js} +1 -1
  9. package/dist/client/assets/{DotsHorizontal-DT2O2EOj.js → DotsHorizontal-r_tIL4Ov.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-D1ZY49Um.js → DotsVertical-BeH4d2j5.js} +1 -1
  11. package/dist/client/assets/{Download01-oP6u6TmF.js → Download01-7dhNcBFv.js} +1 -1
  12. package/dist/client/assets/{Edit01-C_JM_ANM.js → Edit01-Zee8_Yir.js} +1 -1
  13. package/dist/client/assets/{File02-DlRIy2xF.js → File02-B0e9oXtX.js} +1 -1
  14. package/dist/client/assets/{File06-2dtWfDa_.js → File06-CNHRuvsg.js} +1 -1
  15. package/dist/client/assets/{FilterLines-BCtAjuvO.js → FilterLines-DxGB60xi.js} +1 -1
  16. package/dist/client/assets/{Grid01-DHptyetH.js → Grid01-BGQX-rj4.js} +1 -1
  17. package/dist/client/assets/{Home02-CwpXJj-n.js → Home02-Cj_b_3Nv.js} +1 -1
  18. package/dist/client/assets/{Image01-CILGPgam.js → Image01-DPdsVLq5.js} +1 -1
  19. package/dist/client/assets/{Inbox01-BTvTBHN2.js → Inbox01-DVXsLh-J.js} +1 -1
  20. package/dist/client/assets/{InfoCircle-COTflZ7n.js → InfoCircle-D-NOn_9O.js} +1 -1
  21. package/dist/client/assets/{Key01-DFKkR5uc.js → Key01-B8mXK7o_.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-WHnCc-Ds.js → LinkExternal01-pdytjGUU.js} +1 -1
  23. package/dist/client/assets/{List-Dl-Bi1Os.js → List-DwdxUhFm.js} +1 -1
  24. package/dist/client/assets/{Loading01-D8raUT2q.js → Loading01--EdyQou6.js} +1 -1
  25. package/dist/client/assets/{Lock01-0pDC11sR.js → Lock01-MF1zrVD-.js} +1 -1
  26. package/dist/client/assets/{Pin01-C3nTzsY2.js → Pin01-CDSgnzFS.js} +1 -1
  27. package/dist/client/assets/{Play-B3d026b0.js → Play-CGl18U0a.js} +1 -1
  28. package/dist/client/assets/{Plus-BcqTpnxy.js → Plus-CKeAhIyX.js} +1 -1
  29. package/dist/client/assets/{SearchMd-DVuLBPJW.js → SearchMd-BH2aZiBv.js} +1 -1
  30. package/dist/client/assets/{Share07-DW8M4mUv.js → Share07-BIhcsqZd.js} +1 -1
  31. package/dist/client/assets/{Terminal-BOgtpg9n.js → Terminal-CRout4QP.js} +1 -1
  32. package/dist/client/assets/{Tool01-D95FDZLP.js → Tool01-PF9kQMj1.js} +1 -1
  33. package/dist/client/assets/{Trash01-CR6s5yrj.js → Trash01-DWmC_leT.js} +1 -1
  34. package/dist/client/assets/{Upload01-CkSc1CyA.js → Upload01-Bykolsxu.js} +1 -1
  35. package/dist/client/assets/{Users03-CCWN1VQn.js → Users03-Bll7QSmr.js} +1 -1
  36. package/dist/client/assets/{X-BsLffR19.js → X-DPo-5hWo.js} +1 -1
  37. package/dist/client/assets/{XClose-D9VL7Fhs.js → XClose-BgTbSIyK.js} +1 -1
  38. package/dist/client/assets/{agent-detail-DEjCff0P.js → agent-detail-CpwZc1b1.js} +1 -1
  39. package/dist/client/assets/{agents-C0Oa7sFF.js → agents-oKjI60eC.js} +1 -1
  40. package/dist/client/assets/{alert-dialog-BYFUia7V.js → alert-dialog-CAM8sgWL.js} +1 -1
  41. package/dist/client/assets/{auth-catchall-B3lc_CZ9.js → auth-catchall-DM4kJVyq.js} +1 -1
  42. package/dist/client/assets/{avatar-B6WhQiHI.js → avatar-BKY-flI3.js} +1 -1
  43. package/dist/client/assets/{badge-D19NcG12.js → badge-CTM0uIWD.js} +1 -1
  44. package/dist/client/assets/{binder-CwgOa4SG.js → binder-Rtvfp3ct.js} +1 -1
  45. package/dist/client/assets/{breadcrumb-BuFIEIOz.js → breadcrumb-CPuY6F-0.js} +1 -1
  46. package/dist/client/assets/{button-BNRw8VbO.js → button-DZky_O5b.js} +1 -1
  47. package/dist/client/assets/{card-B2_21gZH.js → card-B7MutzeW.js} +1 -1
  48. package/dist/client/assets/{checkbox-D0Zw7dGS.js → checkbox-FfI3AO16.js} +1 -1
  49. package/dist/client/assets/{circle-alert-DepalnIB.js → circle-alert-D_EfZXyv.js} +1 -1
  50. package/dist/client/assets/{collapsible-Dg-5RnYq.js → collapsible-BoMwbmju.js} +1 -1
  51. package/dist/client/assets/{collection-detail-DFH_vpkO.js → collection-detail-BtpKZhJa.js} +1 -1
  52. package/dist/client/assets/{collection-search-D5gi0-bL.js → collection-search-76irKOdK.js} +1 -1
  53. package/dist/client/assets/{collection-tab-DxItkIfa.js → collection-tab-keDulUWT.js} +1 -1
  54. package/dist/client/assets/{collection-table-wrapper-igJ5OqPc.js → collection-table-wrapper-BJq8wZxV.js} +1 -1
  55. package/dist/client/assets/{connect-CtxQyDSW.js → connect-C2-6ppjk.js} +1 -1
  56. package/dist/client/assets/{connection-card-GHfjxhQ1.js → connection-card-B3jQjBgZ.js} +1 -1
  57. package/dist/client/assets/{connection-detail-sqbtlWZ0.js → connection-detail-Hc-xgFqj.js} +1 -1
  58. package/dist/client/assets/{connections-DeNXDjso.js → connections-CUoG-mV_.js} +1 -1
  59. package/dist/client/assets/constants-D6nN-s6F.js +1 -0
  60. package/dist/client/assets/{constants-Cpe-c81c.js → constants-G7VjePam.js} +1 -1
  61. package/dist/client/assets/{create-organization-dialog-7bdcAksX.js → create-organization-dialog-CAVp9V3U.js} +1 -1
  62. package/dist/client/assets/{dialog-Csoqe4hG.js → dialog-BfMrinrm.js} +1 -1
  63. package/dist/client/assets/{dropdown-menu-CsYNL9oo.js → dropdown-menu-ez_4ZmAk.js} +1 -1
  64. package/dist/client/assets/{dynamic-plugin-layout-bKoth3Ne.js → dynamic-plugin-layout-Ct7KFYp2.js} +1 -1
  65. package/dist/client/assets/{empty-state-Cn1CRUZO.js → empty-state-Cg4cXdfL.js} +1 -1
  66. package/dist/client/assets/{empty-state-CpRLw49r.js → empty-state-D1xTHC6z.js} +1 -1
  67. package/dist/client/assets/{env-vars-editor-0JsZHlg0.js → env-vars-editor-BKxl8k2Z.js} +1 -1
  68. package/dist/client/assets/{error-boundary-DQ5uRgdY.js → error-boundary-gLETJlNI.js} +1 -1
  69. package/dist/client/assets/{extract-connection-data-B6LHMHtn.js → extract-connection-data-ErflmyS5.js} +1 -1
  70. package/dist/client/assets/{file-browser-xiIO0qLw.js → file-browser-CBHo45M0.js} +2 -2
  71. package/dist/client/assets/{form-DAoJifFq.js → form-BmYBK--9.js} +1 -1
  72. package/dist/client/assets/{grid-view-Bj9WDB_-.js → grid-view-C-dwKiE-.js} +1 -1
  73. package/dist/client/assets/{home-BgLX6VJQ.js → home-BDN98qz3.js} +1 -1
  74. package/dist/client/assets/{index-CU94_QoM.css → index-BPkoxqog.css} +1 -1
  75. package/dist/client/assets/{index-CsOz92iP.js → index-BZabJ6cV.js} +1 -1
  76. package/dist/client/assets/{index-yjsBu7QA.js → index-BgOoHyXW.js} +2 -2
  77. package/dist/client/assets/{index-GUdoiFzV.js → index-C37GOiqD.js} +1 -1
  78. package/dist/client/assets/{index-Bos_CuhY.js → index-C_wS7kU0.js} +1 -1
  79. package/dist/client/assets/{index-DJLvIq1X.js → index-Ce8gkgBF.js} +1 -1
  80. package/dist/client/assets/{index-P_cUV9l9.js → index-DJ2Jm9li.js} +1 -1
  81. package/dist/client/assets/{index-BhNLW4h1.js → index-DWCFQK0J.js} +1 -1
  82. package/dist/client/assets/{infiniteQueryObserver-D_8FFQdU.js → infiniteQueryObserver-DeNzkqh2.js} +1 -1
  83. package/dist/client/assets/{input-C-GM7dsu.js → input-BzaoEOCn.js} +1 -1
  84. package/dist/client/assets/{layout-D8G7uVC8.js → layout-CodKePSg.js} +1 -1
  85. package/dist/client/assets/{localstorage-keys-C_mtBNzA.js → localstorage-keys-D6GRYm3g.js} +1 -1
  86. package/dist/client/assets/{login-FPJg9vSY.js → login-1vYqawvH.js} +1 -1
  87. package/dist/client/assets/{mcp-oauth-l77m3IWF.js → mcp-oauth-CwgwnIPj.js} +1 -1
  88. package/dist/client/assets/{mcp-server-card-D5sj_LDb.js → mcp-server-card-DIRrlGUw.js} +1 -1
  89. package/dist/client/assets/{mcp-server-detail-BFJxlaGZ.js → mcp-server-detail-CSLx-xgM.js} +2 -2
  90. package/dist/client/assets/{members-D6XXyYMu.js → members-DGtdEsXJ.js} +1 -1
  91. package/dist/client/assets/{monaco-editor-p_EFt-aT.js → monaco-editor-ClMv24Rj.js} +1 -1
  92. package/dist/client/assets/{monitoring-CFkcXam_.js → monitoring-Dt3Jqymb.js} +1 -1
  93. package/dist/client/assets/{oauth-callback-DN_uk9hh.js → oauth-callback-CiHGnzYq.js} +1 -1
  94. package/dist/client/assets/{page-BityQMBs.js → page-BmajQcYq.js} +1 -1
  95. package/dist/client/assets/{page-D2S0EYIA.js → page-Dh7IL0BH.js} +1 -1
  96. package/dist/client/assets/{pin-to-sidebar-button-qPJJKT8U.js → pin-to-sidebar-button-C4cbmw2S.js} +1 -1
  97. package/dist/client/assets/{plugin-empty-state-CuuSx5zh.js → plugin-empty-state-CBcxf1BJ.js} +1 -1
  98. package/dist/client/assets/{plugin-header-BpBy7iT0.js → plugin-header-CcZgfMpE.js} +1 -1
  99. package/dist/client/assets/{plugins-CEFWqcJY.js → plugins-DTsvxiGH.js} +1 -1
  100. package/dist/client/assets/{popover-u_i609j_.js → popover-DUJwUSSM.js} +1 -1
  101. package/dist/client/assets/{registry-utils-BNFgymSf.js → registry-utils-DJNRhqR6.js} +1 -1
  102. package/dist/client/assets/{resizable-Bac7VXSC.js → resizable-84bjYGaV.js} +1 -1
  103. package/dist/client/assets/{resource-tabs-CE-63rPp.js → resource-tabs-CVxcKDVM.js} +1 -1
  104. package/dist/client/assets/{select-B4SPtD5h.js → select-iwsI8D5M.js} +1 -1
  105. package/dist/client/assets/{settings-CoEwEtT9.js → settings-BgsuV025.js} +1 -1
  106. package/dist/client/assets/{shell-layout-BH2X3Yeb.js → shell-layout-BNFkBUbX.js} +2 -2
  107. package/dist/client/assets/{spinner-Duo6KesX.js → spinner-C10QwZNL.js} +1 -1
  108. package/dist/client/assets/{store-invite-CyZGTGUz.js → store-invite-C76m8rKU.js} +1 -1
  109. package/dist/client/assets/{switch-DBMrpKuB.js → switch-CtUEm8Xv.js} +1 -1
  110. package/dist/client/assets/{table-NP0FOAI5.js → table-BM-vLnK2.js} +1 -1
  111. package/dist/client/assets/{textarea-ByvgxbRE.js → textarea-DKyvCB8I.js} +1 -1
  112. package/dist/client/assets/{tools-list-gkMtCYZf.js → tools-list-DRICPoNu.js} +1 -1
  113. package/dist/client/assets/{typewriter-title-CZvcEhZW.js → typewriter-title-BUQDml2i.js} +1 -1
  114. package/dist/client/assets/{use-binding-CNR8kDE7.js → use-binding-COwUQLKP.js} +1 -1
  115. package/dist/client/assets/{use-collections-Hp9XPnUY.js → use-collections-CE5nYbrV.js} +1 -1
  116. package/dist/client/assets/{use-connection-Dj100t8H.js → use-connection-sLATlyBj.js} +1 -1
  117. package/dist/client/assets/{use-create-virtual-mcp-B01dvSQa.js → use-create-virtual-mcp-CAqC56mj.js} +1 -1
  118. package/dist/client/assets/{use-deco-chat-open-C4y7eW_U.js → use-deco-chat-open-94yXlVsB.js} +1 -1
  119. package/dist/client/assets/{use-list-state-DsM4HMGd.js → use-list-state-vuNkB3yR.js} +1 -1
  120. package/dist/client/assets/{use-mcp-prompts-SKr2e7l0.js → use-mcp-prompts-DkUA9eji.js} +1 -1
  121. package/dist/client/assets/{use-members-C8R91dOK.js → use-members-Bohb_YFO.js} +1 -1
  122. package/dist/client/assets/{use-mobile-CS2zVR4m.js → use-mobile-BpwfxiEP.js} +1 -1
  123. package/dist/client/assets/{use-organization-settings-ClYOYczD.js → use-organization-settings-OSGN2_Jg.js} +1 -1
  124. package/dist/client/assets/{use-virtual-mcp-XGRCLjSr.js → use-virtual-mcp-XIWHgsHo.js} +1 -1
  125. package/dist/client/assets/useInfiniteQuery-C5DCUMiS.js +1 -0
  126. package/dist/client/assets/{useMutation-VOj1VEf8.js → useMutation-Ngf5wAT3.js} +1 -1
  127. package/dist/client/assets/useQuery-BlNmU8Jq.js +1 -0
  128. package/dist/client/assets/{view-mode-toggle-zGyN0eoT.js → view-mode-toggle-DC9CalE4.js} +1 -1
  129. package/dist/client/assets/{workflow-BRSWFGSV.js → workflow-DutOEPT0.js} +1 -1
  130. package/dist/client/index.html +2 -2
  131. package/package.json +1 -1
  132. package/dist/client/assets/constants-gYpJq1UH.js +0 -1
  133. package/dist/client/assets/useInfiniteQuery-C34Ot4VI.js +0 -1
  134. package/dist/client/assets/useQuery-C5RIveiE.js +0 -1
@@ -1 +1 @@
1
- import{r as c,aZ as rt,am as Ne,j as d,as as st,at as be,al as k,au as lt,ak as j,an as P,b1 as $,aw as at,a2 as _e,ax as Ee,b2 as it,ao as ct,b3 as dt,ay as ut,aB as pt,az as ft,aC as mt,aD as ht,aq as vt,aA as gt,aE as xt,aF as St,c as ee}from"./index-yjsBu7QA.js";import{V as wt}from"./empty-state-CpRLw49r.js";import{i as Ct}from"./Check-lN7sUZo8.js";import{t as Re}from"./ChevronDown-En_P43wp.js";import{c as oe}from"./button-BNRw8VbO.js";function Pe(n,[e,t]){return Math.min(t,Math.max(e,n))}var yt=[" ","Enter","ArrowUp","ArrowDown"],It=[" ","Enter"],J="Select",[de,ue,bt]=it(J),[ne]=vt(J,[bt,Ee]),pe=Ee(),[Tt,G]=ne(J),[Nt,Pt]=ne(J),je=n=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:r,onOpenChange:i,value:s,defaultValue:l,onValueChange:a,dir:u,name:h,autoComplete:g,disabled:b,required:w,form:S}=n,p=pe(e),[v,C]=c.useState(null),[m,x]=c.useState(null),[F,M]=c.useState(!1),re=rt(u),[_,O]=Ne({prop:o,defaultProp:r??!1,onChange:i,caller:J}),[U,q]=Ne({prop:s,defaultProp:l,onChange:a,caller:J}),L=c.useRef(null),B=v?S||!!v.closest("form"):!0,[W,V]=c.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return d.jsx(st,{...p,children:d.jsxs(Tt,{required:w,scope:e,trigger:v,onTriggerChange:C,valueNode:m,onValueNodeChange:x,valueNodeHasChildren:F,onValueNodeHasChildrenChange:M,contentId:be(),value:U,onValueChange:q,open:_,onOpenChange:O,dir:re,triggerPointerDownPosRef:L,disabled:b,children:[d.jsx(de.Provider,{scope:e,children:d.jsx(Nt,{scope:n.__scopeSelect,onNativeOptionAdd:c.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:c.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?d.jsxs(Qe,{"aria-hidden":!0,required:w,tabIndex:-1,name:h,autoComplete:g,value:U,onChange:E=>q(E.target.value),disabled:b,form:S,children:[U===void 0?d.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};je.displayName=J;var Me="SelectTrigger",Ae=c.forwardRef((n,e)=>{const{__scopeSelect:t,disabled:o=!1,...r}=n,i=pe(t),s=G(Me,t),l=s.disabled||o,a=k(e,s.onTriggerChange),u=ue(t),h=c.useRef("touch"),[g,b,w]=tt(p=>{const v=u().filter(x=>!x.disabled),C=v.find(x=>x.value===s.value),m=ot(v,p,C);m!==void 0&&s.onValueChange(m.value)}),S=p=>{l||(s.onOpenChange(!0),w()),p&&(s.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return d.jsx(lt,{asChild:!0,...i,children:d.jsx(j.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":et(s.value)?"":void 0,...r,ref:a,onClick:P(r.onClick,p=>{p.currentTarget.focus(),h.current!=="mouse"&&S(p)}),onPointerDown:P(r.onPointerDown,p=>{h.current=p.pointerType;const v=p.target;v.hasPointerCapture(p.pointerId)&&v.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:P(r.onKeyDown,p=>{const v=g.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&b(p.key),!(v&&p.key===" ")&&yt.includes(p.key)&&(S(),p.preventDefault())})})})});Ae.displayName=Me;var Oe="SelectValue",De=c.forwardRef((n,e)=>{const{__scopeSelect:t,className:o,style:r,children:i,placeholder:s="",...l}=n,a=G(Oe,t),{onValueNodeHasChildrenChange:u}=a,h=i!==void 0,g=k(e,a.onValueNodeChange);return $(()=>{u(h)},[u,h]),d.jsx(j.span,{...l,ref:g,style:{pointerEvents:"none"},children:et(a.value)?d.jsx(d.Fragment,{children:s}):i})});De.displayName=Oe;var _t="SelectIcon",ke=c.forwardRef((n,e)=>{const{__scopeSelect:t,children:o,...r}=n;return d.jsx(j.span,{"aria-hidden":!0,...r,ref:e,children:o||"▼"})});ke.displayName=_t;var Et="SelectPortal",Le=n=>d.jsx(at,{asChild:!0,...n});Le.displayName=Et;var Q="SelectContent",Be=c.forwardRef((n,e)=>{const t=G(Q,n.__scopeSelect),[o,r]=c.useState();if($(()=>{r(new DocumentFragment)},[]),!t.open){const i=o;return i?_e.createPortal(d.jsx(Ve,{scope:n.__scopeSelect,children:d.jsx(de.Slot,{scope:n.__scopeSelect,children:d.jsx("div",{children:n.children})})}),i):null}return d.jsx(He,{...n,ref:e})});Be.displayName=Q;var A=10,[Ve,Y]=ne(Q),Rt="SelectContentImpl",jt=gt("SelectContent.RemoveScroll"),He=c.forwardRef((n,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:i,onPointerDownOutside:s,side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v,...C}=n,m=G(Q,t),[x,F]=c.useState(null),[M,re]=c.useState(null),_=k(e,f=>F(f)),[O,U]=c.useState(null),[q,L]=c.useState(null),B=ue(t),[W,V]=c.useState(!1),H=c.useRef(!1);c.useEffect(()=>{if(x)return ut(x)},[x]),pt();const E=c.useCallback(f=>{const[T,...R]=B().map(N=>N.ref.current),[y]=R.slice(-1),I=document.activeElement;for(const N of f)if(N===I||(N?.scrollIntoView({block:"nearest"}),N===T&&M&&(M.scrollTop=0),N===y&&M&&(M.scrollTop=M.scrollHeight),N?.focus(),document.activeElement!==I))return},[B,M]),D=c.useCallback(()=>E([O,x]),[E,O,x]);c.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=m;c.useEffect(()=>{if(x){let f={x:0,y:0};const T=y=>{f={x:Math.abs(Math.round(y.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(y.pageY)-(K.current?.y??0))}},R=y=>{f.x<=10&&f.y<=10?y.preventDefault():x.contains(y.target)||z(!1),document.removeEventListener("pointermove",T),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",R,{capture:!0})}}},[x,z,K]),c.useEffect(()=>{const f=()=>z(!1);return window.addEventListener("blur",f),window.addEventListener("resize",f),()=>{window.removeEventListener("blur",f),window.removeEventListener("resize",f)}},[z]);const[fe,ae]=tt(f=>{const T=B().filter(I=>!I.disabled),R=T.find(I=>I.ref.current===document.activeElement),y=ot(T,f,R);y&&setTimeout(()=>y.ref.current.focus())}),me=c.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&(U(f),y&&(H.current=!0))},[m.value]),he=c.useCallback(()=>x?.focus(),[x]),te=c.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&L(f)},[m.value]),ie=o==="popper"?Se:ze,se=ie===Se?{side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v}:{};return d.jsx(Ve,{scope:t,content:x,viewport:M,onViewportChange:re,itemRefCallback:me,selectedItem:O,onItemLeave:he,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:q,position:o,isPositioned:W,searchRef:fe,children:d.jsx(ft,{as:jt,allowPinchZoom:!0,children:d.jsx(mt,{asChild:!0,trapped:m.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:P(r,f=>{m.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:d.jsx(ht,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:d.jsx(ie,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:f=>f.preventDefault(),...C,...se,onPlaced:()=>V(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:P(C.onKeyDown,f=>{const T=f.ctrlKey||f.altKey||f.metaKey;if(f.key==="Tab"&&f.preventDefault(),!T&&f.key.length===1&&ae(f.key),["ArrowUp","ArrowDown","Home","End"].includes(f.key)){let y=B().filter(I=>!I.disabled).map(I=>I.ref.current);if(["ArrowUp","End"].includes(f.key)&&(y=y.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const I=f.target,N=y.indexOf(I);y=y.slice(N+1)}setTimeout(()=>E(y)),f.preventDefault()}})})})})})})});He.displayName=Rt;var Mt="SelectItemAlignedPosition",ze=c.forwardRef((n,e)=>{const{__scopeSelect:t,onPlaced:o,...r}=n,i=G(Q,t),s=Y(Q,t),[l,a]=c.useState(null),[u,h]=c.useState(null),g=k(e,_=>h(_)),b=ue(t),w=c.useRef(!1),S=c.useRef(!0),{viewport:p,selectedItem:v,selectedItemText:C,focusSelectedItem:m}=s,x=c.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&u&&p&&v&&C){const _=i.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),U=i.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(i.dir!=="rtl"){const I=q.left-O.left,N=U.left-I,Z=_.left-N,X=_.width+Z,ve=Math.max(X,O.width),ge=window.innerWidth-A,xe=Pe(N,[A,Math.max(A,ge-ve)]);l.style.minWidth=X+"px",l.style.left=xe+"px"}else{const I=O.right-q.right,N=window.innerWidth-U.right-I,Z=window.innerWidth-_.right-N,X=_.width+Z,ve=Math.max(X,O.width),ge=window.innerWidth-A,xe=Pe(N,[A,Math.max(A,ge-ve)]);l.style.minWidth=X+"px",l.style.right=xe+"px"}const L=b(),B=window.innerHeight-A*2,W=p.scrollHeight,V=window.getComputedStyle(u),H=parseInt(V.borderTopWidth,10),E=parseInt(V.paddingTop,10),D=parseInt(V.borderBottomWidth,10),z=parseInt(V.paddingBottom,10),K=H+E+W+z+D,fe=Math.min(v.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=_.top+_.height/2-A,ie=B-te,se=v.offsetHeight/2,f=v.offsetTop+se,T=H+E+f,R=K-T;if(T<=te){const I=L.length>0&&v===L[L.length-1].ref.current;l.style.bottom="0px";const N=u.clientHeight-p.offsetTop-p.offsetHeight,Z=Math.max(ie,se+(I?he:0)+N+D),X=T+Z;l.style.height=X+"px"}else{const I=L.length>0&&v===L[0].ref.current;l.style.top="0px";const Z=Math.max(te,H+p.offsetTop+(I?me:0)+se)+R;l.style.height=Z+"px",p.scrollTop=T-te+p.offsetTop}l.style.margin=`${A}px 0`,l.style.minHeight=fe+"px",l.style.maxHeight=B+"px",o?.(),requestAnimationFrame(()=>w.current=!0)}},[b,i.trigger,i.valueNode,l,u,p,v,C,i.dir,o]);$(()=>x(),[x]);const[F,M]=c.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const re=c.useCallback(_=>{_&&S.current===!0&&(x(),m?.(),S.current=!1)},[x,m]);return d.jsx(Ot,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:w,onScrollButtonChange:re,children:d.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:F},children:d.jsx(j.div,{...r,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});ze.displayName=Mt;var At="SelectPopperPosition",Se=c.forwardRef((n,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:r=A,...i}=n,s=pe(t);return d.jsx(xt,{...s,...i,ref:e,align:o,collisionPadding:r,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Se.displayName=At;var[Ot,Te]=ne(Q,{}),we="SelectViewport",Fe=c.forwardRef((n,e)=>{const{__scopeSelect:t,nonce:o,...r}=n,i=Y(we,t),s=Te(we,t),l=k(e,i.onViewportChange),a=c.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),d.jsx(de.Slot,{scope:t,children:d.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:P(r.onScroll,u=>{const h=u.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:b}=s;if(b?.current&&g){const w=Math.abs(a.current-h.scrollTop);if(w>0){const S=window.innerHeight-A*2,p=parseFloat(g.style.minHeight),v=parseFloat(g.style.height),C=Math.max(p,v);if(C<S){const m=C+w,x=Math.min(S,m),F=m-x;g.style.height=x+"px",g.style.bottom==="0px"&&(h.scrollTop=F>0?F:0,g.style.justifyContent="flex-end")}}}a.current=h.scrollTop})})})]})});Fe.displayName=we;var Ue="SelectGroup",[Dt,kt]=ne(Ue),Lt=c.forwardRef((n,e)=>{const{__scopeSelect:t,...o}=n,r=be();return d.jsx(Dt,{scope:t,id:r,children:d.jsx(j.div,{role:"group","aria-labelledby":r,...o,ref:e})})});Lt.displayName=Ue;var We="SelectLabel",Bt=c.forwardRef((n,e)=>{const{__scopeSelect:t,...o}=n,r=kt(We,t);return d.jsx(j.div,{id:r.id,...o,ref:e})});Bt.displayName=We;var ce="SelectItem",[Vt,Ke]=ne(ce),$e=c.forwardRef((n,e)=>{const{__scopeSelect:t,value:o,disabled:r=!1,textValue:i,...s}=n,l=G(ce,t),a=Y(ce,t),u=l.value===o,[h,g]=c.useState(i??""),[b,w]=c.useState(!1),S=k(e,m=>a.itemRefCallback?.(m,o,r)),p=be(),v=c.useRef("touch"),C=()=>{r||(l.onValueChange(o),l.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(Vt,{scope:t,value:o,disabled:r,textId:p,isSelected:u,onItemTextChange:c.useCallback(m=>{g(x=>x||(m?.textContent??"").trim())},[]),children:d.jsx(de.ItemSlot,{scope:t,value:o,disabled:r,textValue:h,children:d.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":b?"":void 0,"aria-selected":u&&b,"data-state":u?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...s,ref:S,onFocus:P(s.onFocus,()=>w(!0)),onBlur:P(s.onBlur,()=>w(!1)),onClick:P(s.onClick,()=>{v.current!=="mouse"&&C()}),onPointerUp:P(s.onPointerUp,()=>{v.current==="mouse"&&C()}),onPointerDown:P(s.onPointerDown,m=>{v.current=m.pointerType}),onPointerMove:P(s.onPointerMove,m=>{v.current=m.pointerType,r?a.onItemLeave?.():v.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:P(s.onPointerLeave,m=>{m.currentTarget===document.activeElement&&a.onItemLeave?.()}),onKeyDown:P(s.onKeyDown,m=>{a.searchRef?.current!==""&&m.key===" "||(It.includes(m.key)&&C(),m.key===" "&&m.preventDefault())})})})})});$e.displayName=ce;var le="SelectItemText",Ge=c.forwardRef((n,e)=>{const{__scopeSelect:t,className:o,style:r,...i}=n,s=G(le,t),l=Y(le,t),a=Ke(le,t),u=Pt(le,t),[h,g]=c.useState(null),b=k(e,C=>g(C),a.onItemTextChange,C=>l.itemTextRefCallback?.(C,a.value,a.disabled)),w=h?.textContent,S=c.useMemo(()=>d.jsx("option",{value:a.value,disabled:a.disabled,children:w},a.value),[a.disabled,a.value,w]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=u;return $(()=>(p(S),()=>v(S)),[p,v,S]),d.jsxs(d.Fragment,{children:[d.jsx(j.span,{id:a.textId,...i,ref:b}),a.isSelected&&s.valueNode&&!s.valueNodeHasChildren?_e.createPortal(i.children,s.valueNode):null]})});Ge.displayName=le;var Ye="SelectItemIndicator",qe=c.forwardRef((n,e)=>{const{__scopeSelect:t,...o}=n;return Ke(Ye,t).isSelected?d.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});qe.displayName=Ye;var Ce="SelectScrollUpButton",Ze=c.forwardRef((n,e)=>{const t=Y(Ce,n.__scopeSelect),o=Te(Ce,n.__scopeSelect),[r,i]=c.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollTop>0;i(u)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),r?d.jsx(Je,{...n,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop-a.offsetHeight)}}):null});Ze.displayName=Ce;var ye="SelectScrollDownButton",Xe=c.forwardRef((n,e)=>{const t=Y(ye,n.__scopeSelect),o=Te(ye,n.__scopeSelect),[r,i]=c.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollHeight-a.clientHeight,h=Math.ceil(a.scrollTop)<u;i(h)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),r?d.jsx(Je,{...n,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop+a.offsetHeight)}}):null});Xe.displayName=ye;var Je=c.forwardRef((n,e)=>{const{__scopeSelect:t,onAutoScroll:o,...r}=n,i=Y("SelectScrollButton",t),s=c.useRef(null),l=ue(t),a=c.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return c.useEffect(()=>()=>a(),[a]),$(()=>{l().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),d.jsx(j.div,{"aria-hidden":!0,...r,ref:e,style:{flexShrink:0,...r.style},onPointerDown:P(r.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:P(r.onPointerMove,()=>{i.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:P(r.onPointerLeave,()=>{a()})})}),Ht="SelectSeparator",zt=c.forwardRef((n,e)=>{const{__scopeSelect:t,...o}=n;return d.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});zt.displayName=Ht;var Ie="SelectArrow",Ft=c.forwardRef((n,e)=>{const{__scopeSelect:t,...o}=n,r=pe(t),i=G(Ie,t),s=Y(Ie,t);return i.open&&s.position==="popper"?d.jsx(St,{...r,...o,ref:e}):null});Ft.displayName=Ie;var Ut="SelectBubbleInput",Qe=c.forwardRef(({__scopeSelect:n,value:e,...t},o)=>{const r=c.useRef(null),i=k(o,r),s=ct(e);return c.useEffect(()=>{const l=r.current;if(!l)return;const a=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(a,"value").set;if(s!==e&&h){const g=new Event("change",{bubbles:!0});h.call(l,e),l.dispatchEvent(g)}},[s,e]),d.jsx(j.select,{...t,style:{...wt,...t.style},ref:i,defaultValue:e})});Qe.displayName=Ut;function et(n){return n===""||n===void 0}function tt(n){const e=dt(n),t=c.useRef(""),o=c.useRef(0),r=c.useCallback(s=>{const l=t.current+s;e(l),(function a(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>a(""),1e3))})(l)},[e]),i=c.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return c.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,r,i]}function ot(n,e,t){const r=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,i=t?n.indexOf(t):-1;let s=Wt(n,Math.max(i,0));r.length===1&&(s=s.filter(u=>u!==t));const a=s.find(u=>u.textValue.toLowerCase().startsWith(r.toLowerCase()));return a!==t?a:void 0}function Wt(n,e){return n.map((t,o)=>n[(e+o)%n.length])}var Kt=je,$t=Ae,Gt=De,Yt=ke,qt=Le,Zt=Be,Xt=Fe,Jt=$e,Qt=Ge,eo=qe,to=Ze,oo=Xe;const nt=({size:n=24,color:e="currentColor",...t})=>c.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},c.createElement("path",{d:"m18 15-6-6-6 6"}));nt.displayName="ChevronUp";function uo(n){const e=ee.c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Kt,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(n){const e=ee.c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Gt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function fo(n){const e=ee.c(13);let t,o,r,i;e[0]!==n?({className:o,size:i,children:t,...r}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=r,e[4]=i):(t=e[1],o=e[2],r=e[3],i=e[4]);const s=i===void 0?"default":i;let l;e[5]!==o?(l=oe("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-lg border bg-transparent px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-10 data-[size=sm]:h-7 data-[size=xs]:h-7 data-[size=xs]:px-2.5 data-[size=xs]:py-1.5 data-[size=xs]:rounded-lg *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=d.jsx(Yt,{asChild:!0,children:d.jsx(Re,{className:"size-4 opacity-50"})}),e[7]=a):a=e[7];let u;return e[8]!==t||e[9]!==r||e[10]!==s||e[11]!==l?(u=d.jsxs($t,{"data-slot":"select-trigger","data-size":s,className:l,...r,children:[t,a]}),e[8]=t,e[9]=r,e[10]=s,e[11]=l,e[12]=u):u=e[12],u}function mo(n){const e=ee.c(25);let t,o,r,i,s;e[0]!==n?({className:o,children:t,position:i,hideScrollButtons:s,...r}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=r,e[4]=i,e[5]=s):(t=e[1],o=e[2],r=e[3],i=e[4],s=e[5]);const l=i===void 0?"popper":i,a=s===void 0?!1:s,u=l==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let h;e[6]!==o||e[7]!==u?(h=oe("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border shadow-md",u,o),e[6]=o,e[7]=u,e[8]=h):h=e[8];let g;e[9]!==a?(g=!a&&d.jsx(no,{}),e[9]=a,e[10]=g):g=e[10];const b=l==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let w;e[11]!==b?(w=oe("p-1",b),e[11]=b,e[12]=w):w=e[12];let S;e[13]!==t||e[14]!==w?(S=d.jsx(Xt,{className:w,children:t}),e[13]=t,e[14]=w,e[15]=S):S=e[15];let p;e[16]!==a?(p=!a&&d.jsx(ro,{}),e[16]=a,e[17]=p):p=e[17];let v;return e[18]!==l||e[19]!==r||e[20]!==h||e[21]!==g||e[22]!==S||e[23]!==p?(v=d.jsx(qt,{children:d.jsxs(Zt,{"data-slot":"select-content",className:h,position:l,...r,children:[g,S,p]})}),e[18]=l,e[19]=r,e[20]=h,e[21]=g,e[22]=S,e[23]=p,e[24]=v):v=e[24],v}function ho(n){const e=ee.c(16);let t,o,r,i;e[0]!==n?({className:o,children:t,hideCheck:i,...r}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=r,e[4]=i):(t=e[1],o=e[2],r=e[3],i=e[4]);const s=i===void 0?!1:i;let l;e[5]!==o?(l=oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]!==s?(a=!s&&d.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:d.jsx(eo,{children:d.jsx(Ct,{className:"size-4"})})}),e[7]=s,e[8]=a):a=e[8];let u;e[9]!==t?(u=d.jsx(Qt,{children:t}),e[9]=t,e[10]=u):u=e[10];let h;return e[11]!==r||e[12]!==l||e[13]!==a||e[14]!==u?(h=d.jsxs(Jt,{"data-slot":"select-item",className:l,...r,children:[a,u]}),e[11]=r,e[12]=l,e[13]=a,e[14]=u,e[15]=h):h=e[15],h}function no(n){const e=ee.c(9);let t,o;e[0]!==n?({className:t,...o}=n,e[0]=n,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let r;e[3]!==t?(r=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=r):r=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(nt,{className:"size-4"}),e[5]=i):i=e[5];let s;return e[6]!==o||e[7]!==r?(s=d.jsx(to,{"data-slot":"select-scroll-up-button",className:r,...o,children:i}),e[6]=o,e[7]=r,e[8]=s):s=e[8],s}function ro(n){const e=ee.c(9);let t,o;e[0]!==n?({className:t,...o}=n,e[0]=n,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let r;e[3]!==t?(r=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=r):r=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(Re,{className:"size-4"}),e[5]=i):i=e[5];let s;return e[6]!==o||e[7]!==r?(s=d.jsx(oo,{"data-slot":"select-scroll-down-button",className:r,...o,children:i}),e[6]=o,e[7]=r,e[8]=s):s=e[8],s}export{uo as S,fo as a,po as b,mo as c,ho as d,Pe as e,nt as n};
1
+ import{r as c,aZ as rt,am as Ne,j as d,as as st,at as be,al as k,au as lt,ak as j,an as P,b1 as $,aw as at,a2 as _e,ax as Ee,b2 as it,ao as ct,b3 as dt,ay as ut,aB as pt,az as ft,aC as mt,aD as ht,aq as vt,aA as gt,aE as xt,aF as St,c as ee}from"./index-BgOoHyXW.js";import{V as wt}from"./empty-state-D1xTHC6z.js";import{i as Ct}from"./Check-DqzdHNMw.js";import{t as Re}from"./ChevronDown-DNLmRmxT.js";import{c as oe}from"./button-DZky_O5b.js";function Pe(n,[e,t]){return Math.min(t,Math.max(e,n))}var yt=[" ","Enter","ArrowUp","ArrowDown"],It=[" ","Enter"],J="Select",[de,ue,bt]=it(J),[ne]=vt(J,[bt,Ee]),pe=Ee(),[Tt,G]=ne(J),[Nt,Pt]=ne(J),je=n=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:r,onOpenChange:i,value:s,defaultValue:l,onValueChange:a,dir:u,name:h,autoComplete:g,disabled:b,required:w,form:S}=n,p=pe(e),[v,C]=c.useState(null),[m,x]=c.useState(null),[F,M]=c.useState(!1),re=rt(u),[_,O]=Ne({prop:o,defaultProp:r??!1,onChange:i,caller:J}),[U,q]=Ne({prop:s,defaultProp:l,onChange:a,caller:J}),L=c.useRef(null),B=v?S||!!v.closest("form"):!0,[W,V]=c.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return d.jsx(st,{...p,children:d.jsxs(Tt,{required:w,scope:e,trigger:v,onTriggerChange:C,valueNode:m,onValueNodeChange:x,valueNodeHasChildren:F,onValueNodeHasChildrenChange:M,contentId:be(),value:U,onValueChange:q,open:_,onOpenChange:O,dir:re,triggerPointerDownPosRef:L,disabled:b,children:[d.jsx(de.Provider,{scope:e,children:d.jsx(Nt,{scope:n.__scopeSelect,onNativeOptionAdd:c.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:c.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?d.jsxs(Qe,{"aria-hidden":!0,required:w,tabIndex:-1,name:h,autoComplete:g,value:U,onChange:E=>q(E.target.value),disabled:b,form:S,children:[U===void 0?d.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};je.displayName=J;var Me="SelectTrigger",Ae=c.forwardRef((n,e)=>{const{__scopeSelect:t,disabled:o=!1,...r}=n,i=pe(t),s=G(Me,t),l=s.disabled||o,a=k(e,s.onTriggerChange),u=ue(t),h=c.useRef("touch"),[g,b,w]=tt(p=>{const v=u().filter(x=>!x.disabled),C=v.find(x=>x.value===s.value),m=ot(v,p,C);m!==void 0&&s.onValueChange(m.value)}),S=p=>{l||(s.onOpenChange(!0),w()),p&&(s.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return d.jsx(lt,{asChild:!0,...i,children:d.jsx(j.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":et(s.value)?"":void 0,...r,ref:a,onClick:P(r.onClick,p=>{p.currentTarget.focus(),h.current!=="mouse"&&S(p)}),onPointerDown:P(r.onPointerDown,p=>{h.current=p.pointerType;const v=p.target;v.hasPointerCapture(p.pointerId)&&v.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:P(r.onKeyDown,p=>{const v=g.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&b(p.key),!(v&&p.key===" ")&&yt.includes(p.key)&&(S(),p.preventDefault())})})})});Ae.displayName=Me;var Oe="SelectValue",De=c.forwardRef((n,e)=>{const{__scopeSelect:t,className:o,style:r,children:i,placeholder:s="",...l}=n,a=G(Oe,t),{onValueNodeHasChildrenChange:u}=a,h=i!==void 0,g=k(e,a.onValueNodeChange);return $(()=>{u(h)},[u,h]),d.jsx(j.span,{...l,ref:g,style:{pointerEvents:"none"},children:et(a.value)?d.jsx(d.Fragment,{children:s}):i})});De.displayName=Oe;var _t="SelectIcon",ke=c.forwardRef((n,e)=>{const{__scopeSelect:t,children:o,...r}=n;return d.jsx(j.span,{"aria-hidden":!0,...r,ref:e,children:o||"▼"})});ke.displayName=_t;var Et="SelectPortal",Le=n=>d.jsx(at,{asChild:!0,...n});Le.displayName=Et;var Q="SelectContent",Be=c.forwardRef((n,e)=>{const t=G(Q,n.__scopeSelect),[o,r]=c.useState();if($(()=>{r(new DocumentFragment)},[]),!t.open){const i=o;return i?_e.createPortal(d.jsx(Ve,{scope:n.__scopeSelect,children:d.jsx(de.Slot,{scope:n.__scopeSelect,children:d.jsx("div",{children:n.children})})}),i):null}return d.jsx(He,{...n,ref:e})});Be.displayName=Q;var A=10,[Ve,Y]=ne(Q),Rt="SelectContentImpl",jt=gt("SelectContent.RemoveScroll"),He=c.forwardRef((n,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:i,onPointerDownOutside:s,side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v,...C}=n,m=G(Q,t),[x,F]=c.useState(null),[M,re]=c.useState(null),_=k(e,f=>F(f)),[O,U]=c.useState(null),[q,L]=c.useState(null),B=ue(t),[W,V]=c.useState(!1),H=c.useRef(!1);c.useEffect(()=>{if(x)return ut(x)},[x]),pt();const E=c.useCallback(f=>{const[T,...R]=B().map(N=>N.ref.current),[y]=R.slice(-1),I=document.activeElement;for(const N of f)if(N===I||(N?.scrollIntoView({block:"nearest"}),N===T&&M&&(M.scrollTop=0),N===y&&M&&(M.scrollTop=M.scrollHeight),N?.focus(),document.activeElement!==I))return},[B,M]),D=c.useCallback(()=>E([O,x]),[E,O,x]);c.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=m;c.useEffect(()=>{if(x){let f={x:0,y:0};const T=y=>{f={x:Math.abs(Math.round(y.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(y.pageY)-(K.current?.y??0))}},R=y=>{f.x<=10&&f.y<=10?y.preventDefault():x.contains(y.target)||z(!1),document.removeEventListener("pointermove",T),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",R,{capture:!0})}}},[x,z,K]),c.useEffect(()=>{const f=()=>z(!1);return window.addEventListener("blur",f),window.addEventListener("resize",f),()=>{window.removeEventListener("blur",f),window.removeEventListener("resize",f)}},[z]);const[fe,ae]=tt(f=>{const T=B().filter(I=>!I.disabled),R=T.find(I=>I.ref.current===document.activeElement),y=ot(T,f,R);y&&setTimeout(()=>y.ref.current.focus())}),me=c.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&(U(f),y&&(H.current=!0))},[m.value]),he=c.useCallback(()=>x?.focus(),[x]),te=c.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&L(f)},[m.value]),ie=o==="popper"?Se:ze,se=ie===Se?{side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v}:{};return d.jsx(Ve,{scope:t,content:x,viewport:M,onViewportChange:re,itemRefCallback:me,selectedItem:O,onItemLeave:he,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:q,position:o,isPositioned:W,searchRef:fe,children:d.jsx(ft,{as:jt,allowPinchZoom:!0,children:d.jsx(mt,{asChild:!0,trapped:m.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:P(r,f=>{m.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:d.jsx(ht,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:d.jsx(ie,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:f=>f.preventDefault(),...C,...se,onPlaced:()=>V(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:P(C.onKeyDown,f=>{const T=f.ctrlKey||f.altKey||f.metaKey;if(f.key==="Tab"&&f.preventDefault(),!T&&f.key.length===1&&ae(f.key),["ArrowUp","ArrowDown","Home","End"].includes(f.key)){let y=B().filter(I=>!I.disabled).map(I=>I.ref.current);if(["ArrowUp","End"].includes(f.key)&&(y=y.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const I=f.target,N=y.indexOf(I);y=y.slice(N+1)}setTimeout(()=>E(y)),f.preventDefault()}})})})})})})});He.displayName=Rt;var Mt="SelectItemAlignedPosition",ze=c.forwardRef((n,e)=>{const{__scopeSelect:t,onPlaced:o,...r}=n,i=G(Q,t),s=Y(Q,t),[l,a]=c.useState(null),[u,h]=c.useState(null),g=k(e,_=>h(_)),b=ue(t),w=c.useRef(!1),S=c.useRef(!0),{viewport:p,selectedItem:v,selectedItemText:C,focusSelectedItem:m}=s,x=c.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&u&&p&&v&&C){const _=i.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),U=i.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(i.dir!=="rtl"){const I=q.left-O.left,N=U.left-I,Z=_.left-N,X=_.width+Z,ve=Math.max(X,O.width),ge=window.innerWidth-A,xe=Pe(N,[A,Math.max(A,ge-ve)]);l.style.minWidth=X+"px",l.style.left=xe+"px"}else{const I=O.right-q.right,N=window.innerWidth-U.right-I,Z=window.innerWidth-_.right-N,X=_.width+Z,ve=Math.max(X,O.width),ge=window.innerWidth-A,xe=Pe(N,[A,Math.max(A,ge-ve)]);l.style.minWidth=X+"px",l.style.right=xe+"px"}const L=b(),B=window.innerHeight-A*2,W=p.scrollHeight,V=window.getComputedStyle(u),H=parseInt(V.borderTopWidth,10),E=parseInt(V.paddingTop,10),D=parseInt(V.borderBottomWidth,10),z=parseInt(V.paddingBottom,10),K=H+E+W+z+D,fe=Math.min(v.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=_.top+_.height/2-A,ie=B-te,se=v.offsetHeight/2,f=v.offsetTop+se,T=H+E+f,R=K-T;if(T<=te){const I=L.length>0&&v===L[L.length-1].ref.current;l.style.bottom="0px";const N=u.clientHeight-p.offsetTop-p.offsetHeight,Z=Math.max(ie,se+(I?he:0)+N+D),X=T+Z;l.style.height=X+"px"}else{const I=L.length>0&&v===L[0].ref.current;l.style.top="0px";const Z=Math.max(te,H+p.offsetTop+(I?me:0)+se)+R;l.style.height=Z+"px",p.scrollTop=T-te+p.offsetTop}l.style.margin=`${A}px 0`,l.style.minHeight=fe+"px",l.style.maxHeight=B+"px",o?.(),requestAnimationFrame(()=>w.current=!0)}},[b,i.trigger,i.valueNode,l,u,p,v,C,i.dir,o]);$(()=>x(),[x]);const[F,M]=c.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const re=c.useCallback(_=>{_&&S.current===!0&&(x(),m?.(),S.current=!1)},[x,m]);return d.jsx(Ot,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:w,onScrollButtonChange:re,children:d.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:F},children:d.jsx(j.div,{...r,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});ze.displayName=Mt;var At="SelectPopperPosition",Se=c.forwardRef((n,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:r=A,...i}=n,s=pe(t);return d.jsx(xt,{...s,...i,ref:e,align:o,collisionPadding:r,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Se.displayName=At;var[Ot,Te]=ne(Q,{}),we="SelectViewport",Fe=c.forwardRef((n,e)=>{const{__scopeSelect:t,nonce:o,...r}=n,i=Y(we,t),s=Te(we,t),l=k(e,i.onViewportChange),a=c.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),d.jsx(de.Slot,{scope:t,children:d.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:P(r.onScroll,u=>{const h=u.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:b}=s;if(b?.current&&g){const w=Math.abs(a.current-h.scrollTop);if(w>0){const S=window.innerHeight-A*2,p=parseFloat(g.style.minHeight),v=parseFloat(g.style.height),C=Math.max(p,v);if(C<S){const m=C+w,x=Math.min(S,m),F=m-x;g.style.height=x+"px",g.style.bottom==="0px"&&(h.scrollTop=F>0?F:0,g.style.justifyContent="flex-end")}}}a.current=h.scrollTop})})})]})});Fe.displayName=we;var Ue="SelectGroup",[Dt,kt]=ne(Ue),Lt=c.forwardRef((n,e)=>{const{__scopeSelect:t,...o}=n,r=be();return d.jsx(Dt,{scope:t,id:r,children:d.jsx(j.div,{role:"group","aria-labelledby":r,...o,ref:e})})});Lt.displayName=Ue;var We="SelectLabel",Bt=c.forwardRef((n,e)=>{const{__scopeSelect:t,...o}=n,r=kt(We,t);return d.jsx(j.div,{id:r.id,...o,ref:e})});Bt.displayName=We;var ce="SelectItem",[Vt,Ke]=ne(ce),$e=c.forwardRef((n,e)=>{const{__scopeSelect:t,value:o,disabled:r=!1,textValue:i,...s}=n,l=G(ce,t),a=Y(ce,t),u=l.value===o,[h,g]=c.useState(i??""),[b,w]=c.useState(!1),S=k(e,m=>a.itemRefCallback?.(m,o,r)),p=be(),v=c.useRef("touch"),C=()=>{r||(l.onValueChange(o),l.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(Vt,{scope:t,value:o,disabled:r,textId:p,isSelected:u,onItemTextChange:c.useCallback(m=>{g(x=>x||(m?.textContent??"").trim())},[]),children:d.jsx(de.ItemSlot,{scope:t,value:o,disabled:r,textValue:h,children:d.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":b?"":void 0,"aria-selected":u&&b,"data-state":u?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...s,ref:S,onFocus:P(s.onFocus,()=>w(!0)),onBlur:P(s.onBlur,()=>w(!1)),onClick:P(s.onClick,()=>{v.current!=="mouse"&&C()}),onPointerUp:P(s.onPointerUp,()=>{v.current==="mouse"&&C()}),onPointerDown:P(s.onPointerDown,m=>{v.current=m.pointerType}),onPointerMove:P(s.onPointerMove,m=>{v.current=m.pointerType,r?a.onItemLeave?.():v.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:P(s.onPointerLeave,m=>{m.currentTarget===document.activeElement&&a.onItemLeave?.()}),onKeyDown:P(s.onKeyDown,m=>{a.searchRef?.current!==""&&m.key===" "||(It.includes(m.key)&&C(),m.key===" "&&m.preventDefault())})})})})});$e.displayName=ce;var le="SelectItemText",Ge=c.forwardRef((n,e)=>{const{__scopeSelect:t,className:o,style:r,...i}=n,s=G(le,t),l=Y(le,t),a=Ke(le,t),u=Pt(le,t),[h,g]=c.useState(null),b=k(e,C=>g(C),a.onItemTextChange,C=>l.itemTextRefCallback?.(C,a.value,a.disabled)),w=h?.textContent,S=c.useMemo(()=>d.jsx("option",{value:a.value,disabled:a.disabled,children:w},a.value),[a.disabled,a.value,w]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=u;return $(()=>(p(S),()=>v(S)),[p,v,S]),d.jsxs(d.Fragment,{children:[d.jsx(j.span,{id:a.textId,...i,ref:b}),a.isSelected&&s.valueNode&&!s.valueNodeHasChildren?_e.createPortal(i.children,s.valueNode):null]})});Ge.displayName=le;var Ye="SelectItemIndicator",qe=c.forwardRef((n,e)=>{const{__scopeSelect:t,...o}=n;return Ke(Ye,t).isSelected?d.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});qe.displayName=Ye;var Ce="SelectScrollUpButton",Ze=c.forwardRef((n,e)=>{const t=Y(Ce,n.__scopeSelect),o=Te(Ce,n.__scopeSelect),[r,i]=c.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollTop>0;i(u)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),r?d.jsx(Je,{...n,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop-a.offsetHeight)}}):null});Ze.displayName=Ce;var ye="SelectScrollDownButton",Xe=c.forwardRef((n,e)=>{const t=Y(ye,n.__scopeSelect),o=Te(ye,n.__scopeSelect),[r,i]=c.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollHeight-a.clientHeight,h=Math.ceil(a.scrollTop)<u;i(h)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),r?d.jsx(Je,{...n,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop+a.offsetHeight)}}):null});Xe.displayName=ye;var Je=c.forwardRef((n,e)=>{const{__scopeSelect:t,onAutoScroll:o,...r}=n,i=Y("SelectScrollButton",t),s=c.useRef(null),l=ue(t),a=c.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return c.useEffect(()=>()=>a(),[a]),$(()=>{l().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),d.jsx(j.div,{"aria-hidden":!0,...r,ref:e,style:{flexShrink:0,...r.style},onPointerDown:P(r.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:P(r.onPointerMove,()=>{i.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:P(r.onPointerLeave,()=>{a()})})}),Ht="SelectSeparator",zt=c.forwardRef((n,e)=>{const{__scopeSelect:t,...o}=n;return d.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});zt.displayName=Ht;var Ie="SelectArrow",Ft=c.forwardRef((n,e)=>{const{__scopeSelect:t,...o}=n,r=pe(t),i=G(Ie,t),s=Y(Ie,t);return i.open&&s.position==="popper"?d.jsx(St,{...r,...o,ref:e}):null});Ft.displayName=Ie;var Ut="SelectBubbleInput",Qe=c.forwardRef(({__scopeSelect:n,value:e,...t},o)=>{const r=c.useRef(null),i=k(o,r),s=ct(e);return c.useEffect(()=>{const l=r.current;if(!l)return;const a=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(a,"value").set;if(s!==e&&h){const g=new Event("change",{bubbles:!0});h.call(l,e),l.dispatchEvent(g)}},[s,e]),d.jsx(j.select,{...t,style:{...wt,...t.style},ref:i,defaultValue:e})});Qe.displayName=Ut;function et(n){return n===""||n===void 0}function tt(n){const e=dt(n),t=c.useRef(""),o=c.useRef(0),r=c.useCallback(s=>{const l=t.current+s;e(l),(function a(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>a(""),1e3))})(l)},[e]),i=c.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return c.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,r,i]}function ot(n,e,t){const r=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,i=t?n.indexOf(t):-1;let s=Wt(n,Math.max(i,0));r.length===1&&(s=s.filter(u=>u!==t));const a=s.find(u=>u.textValue.toLowerCase().startsWith(r.toLowerCase()));return a!==t?a:void 0}function Wt(n,e){return n.map((t,o)=>n[(e+o)%n.length])}var Kt=je,$t=Ae,Gt=De,Yt=ke,qt=Le,Zt=Be,Xt=Fe,Jt=$e,Qt=Ge,eo=qe,to=Ze,oo=Xe;const nt=({size:n=24,color:e="currentColor",...t})=>c.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},c.createElement("path",{d:"m18 15-6-6-6 6"}));nt.displayName="ChevronUp";function uo(n){const e=ee.c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Kt,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(n){const e=ee.c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Gt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function fo(n){const e=ee.c(13);let t,o,r,i;e[0]!==n?({className:o,size:i,children:t,...r}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=r,e[4]=i):(t=e[1],o=e[2],r=e[3],i=e[4]);const s=i===void 0?"default":i;let l;e[5]!==o?(l=oe("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-lg border bg-transparent px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-10 data-[size=sm]:h-7 data-[size=xs]:h-7 data-[size=xs]:px-2.5 data-[size=xs]:py-1.5 data-[size=xs]:rounded-lg *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=d.jsx(Yt,{asChild:!0,children:d.jsx(Re,{className:"size-4 opacity-50"})}),e[7]=a):a=e[7];let u;return e[8]!==t||e[9]!==r||e[10]!==s||e[11]!==l?(u=d.jsxs($t,{"data-slot":"select-trigger","data-size":s,className:l,...r,children:[t,a]}),e[8]=t,e[9]=r,e[10]=s,e[11]=l,e[12]=u):u=e[12],u}function mo(n){const e=ee.c(25);let t,o,r,i,s;e[0]!==n?({className:o,children:t,position:i,hideScrollButtons:s,...r}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=r,e[4]=i,e[5]=s):(t=e[1],o=e[2],r=e[3],i=e[4],s=e[5]);const l=i===void 0?"popper":i,a=s===void 0?!1:s,u=l==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let h;e[6]!==o||e[7]!==u?(h=oe("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border shadow-md",u,o),e[6]=o,e[7]=u,e[8]=h):h=e[8];let g;e[9]!==a?(g=!a&&d.jsx(no,{}),e[9]=a,e[10]=g):g=e[10];const b=l==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let w;e[11]!==b?(w=oe("p-1",b),e[11]=b,e[12]=w):w=e[12];let S;e[13]!==t||e[14]!==w?(S=d.jsx(Xt,{className:w,children:t}),e[13]=t,e[14]=w,e[15]=S):S=e[15];let p;e[16]!==a?(p=!a&&d.jsx(ro,{}),e[16]=a,e[17]=p):p=e[17];let v;return e[18]!==l||e[19]!==r||e[20]!==h||e[21]!==g||e[22]!==S||e[23]!==p?(v=d.jsx(qt,{children:d.jsxs(Zt,{"data-slot":"select-content",className:h,position:l,...r,children:[g,S,p]})}),e[18]=l,e[19]=r,e[20]=h,e[21]=g,e[22]=S,e[23]=p,e[24]=v):v=e[24],v}function ho(n){const e=ee.c(16);let t,o,r,i;e[0]!==n?({className:o,children:t,hideCheck:i,...r}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=r,e[4]=i):(t=e[1],o=e[2],r=e[3],i=e[4]);const s=i===void 0?!1:i;let l;e[5]!==o?(l=oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]!==s?(a=!s&&d.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:d.jsx(eo,{children:d.jsx(Ct,{className:"size-4"})})}),e[7]=s,e[8]=a):a=e[8];let u;e[9]!==t?(u=d.jsx(Qt,{children:t}),e[9]=t,e[10]=u):u=e[10];let h;return e[11]!==r||e[12]!==l||e[13]!==a||e[14]!==u?(h=d.jsxs(Jt,{"data-slot":"select-item",className:l,...r,children:[a,u]}),e[11]=r,e[12]=l,e[13]=a,e[14]=u,e[15]=h):h=e[15],h}function no(n){const e=ee.c(9);let t,o;e[0]!==n?({className:t,...o}=n,e[0]=n,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let r;e[3]!==t?(r=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=r):r=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(nt,{className:"size-4"}),e[5]=i):i=e[5];let s;return e[6]!==o||e[7]!==r?(s=d.jsx(to,{"data-slot":"select-scroll-up-button",className:r,...o,children:i}),e[6]=o,e[7]=r,e[8]=s):s=e[8],s}function ro(n){const e=ee.c(9);let t,o;e[0]!==n?({className:t,...o}=n,e[0]=n,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let r;e[3]!==t?(r=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=r):r=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(Re,{className:"size-4"}),e[5]=i):i=e[5];let s;return e[6]!==o||e[7]!==r?(s=d.jsx(oo,{"data-slot":"select-scroll-down-button",className:r,...o,children:i}),e[6]=o,e[7]=r,e[8]=s):s=e[8],s}export{uo as S,fo as a,po as b,mo as c,ho as d,Pe as e,nt as n};
@@ -1 +1 @@
1
- import{r as w,l as U,u as $,a1 as D,k as K,h as Q,v as C,K as M,g as A,j as e,q as H,c as T,o as W,s as k}from"./index-yjsBu7QA.js";import{P as N}from"./index-P_cUV9l9.js";import{B as Y,a as Z,b as G,c as J}from"./breadcrumb-BuFIEIOz.js";import{u as V}from"./useMutation-VOj1VEf8.js";import{B as S}from"./button-BNRw8VbO.js";import{a as X,F as R,b as E,c as O,d as B,f as I,e as _}from"./form-DAoJifFq.js";import{I as q}from"./input-C-GM7dsu.js";import{i as ee}from"./ChevronRight-BB2YL4K4.js";import{i as se}from"./Upload01-CkSc1CyA.js";import{i as re}from"./X-BsLffR19.js";const P=({size:d=24,color:s="currentColor",...t})=>w.createElement("svg",{viewBox:"0 0 24 24",width:d,height:d,stroke:s,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},w.createElement("path",{d:"m2 14.5 9.642 4.821c.131.066.197.099.266.111.06.012.123.012.184 0 .069-.012.135-.045.266-.11L22 14.5m-20-5 9.642-4.821c.131-.066.197-.098.266-.111a.5.5 0 0 1 .184 0c.069.013.135.045.266.111L22 9.5l-9.642 4.821a1.028 1.028 0 0 1-.266.111.501.501 0 0 1-.184 0c-.069-.012-.135-.045-.266-.11L2 9.5Z"}));P.displayName="LayersTwo01";const te=W({name:k().min(1,"Name is required").max(255,"Name is too long"),slug:k().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens"),logo:k().optional()});function oe(d){const s=T.c(24),{value:t,onChange:a,name:m}=d,o=w.useRef(null);let u;s[0]!==a?(u=F=>{const L=F.target.files?.[0];if(L){if(L.size>2097152){C.error("Image must be smaller than 2MB");return}const c=new FileReader;c.onerror=()=>{const y=c.error;console.error("FileReader error:",y),C.error(y?.message||"Failed to read image file. Please try again."),o.current&&(o.current.value="")},c.onloadend=()=>{if(c.readyState===FileReader.DONE&&c.result){const y=c.result;a(y)}},c.readAsDataURL(L)}},s[0]=a,s[1]=u):u=s[1];const j=u;let l;s[2]===Symbol.for("react.memo_cache_sentinel")?(l=()=>{o.current?.click()},s[2]=l):l=s[2];const r=l;let i;s[3]!==a?(i=F=>{F.stopPropagation(),a("")},s[3]=a,s[4]=i):i=s[4];const n=i;let g;s[5]!==j?(g=e.jsx("input",{type:"file",ref:o,className:"hidden",accept:"image/*",onChange:j}),s[5]=j,s[6]=g):g=s[6];let x;s[7]!==n||s[8]!==m||s[9]!==t?(x=t?e.jsxs("div",{className:"relative group",children:[e.jsx("div",{className:"h-20 w-20 rounded-lg border border-border bg-muted/20 overflow-hidden",children:e.jsx("img",{src:t,alt:m||"Organization logo",className:"w-full h-full object-cover"})}),e.jsx("button",{type:"button",onClick:n,className:"absolute -top-2 -right-2 h-6 w-6 rounded-full bg-destructive text-destructive-foreground opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:e.jsx(re,{className:"h-3 w-3"})})]}):e.jsxs("button",{type:"button",onClick:r,className:"h-20 w-20 rounded-lg border-2 border-dashed border-border hover:border-foreground/50 hover:bg-accent/50 transition-colors flex flex-col items-center justify-center gap-1 text-muted-foreground hover:text-foreground",children:[e.jsx(se,{className:"h-5 w-5"}),e.jsx("span",{className:"text-xs",children:"Upload"})]}),s[7]=n,s[8]=m,s[9]=t,s[10]=x):x=s[10];const z=t?"Change Logo":"Upload Logo";let h;s[11]!==z?(h=e.jsx(S,{type:"button",variant:"outline",size:"sm",onClick:r,className:"mb-2",children:z}),s[11]=z,s[12]=h):h=s[12];let f;s[13]!==n||s[14]!==t?(f=t&&e.jsx(S,{type:"button",variant:"ghost",size:"sm",onClick:n,className:"ml-2",children:"Remove"}),s[13]=n,s[14]=t,s[15]=f):f=s[15];let b;s[16]===Symbol.for("react.memo_cache_sentinel")?(b=e.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Recommended: Square image, at least 200x200px. Max 2MB."}),s[16]=b):b=s[16];let p;s[17]!==h||s[18]!==f?(p=e.jsxs("div",{className:"flex-1",children:[h,f,b]}),s[17]=h,s[18]=f,s[19]=p):p=s[19];let v;return s[20]!==p||s[21]!==g||s[22]!==x?(v=e.jsxs("div",{className:"flex items-start gap-4",children:[g,x,p]}),s[20]=p,s[21]=g,s[22]=x,s[23]=v):v=s[23],v}function he(){const d=U(),{org:s}=$(),t=D(),[a,m]=w.useState(!1),o=K({resolver:Q(te),values:{name:s.name??"",slug:s.slug??"",logo:s.logo??""}}),u=V({mutationFn:async r=>{const i={name:r.name,slug:r.slug};r.logo&&(i.logo=r.logo);const n=await A.organization.update({organizationId:s.id,data:i});if(n?.error)throw new Error(n.error.message||"Failed to update organization");return n},onSuccess:r=>{t.invalidateQueries({queryKey:M.organizations()}),t.invalidateQueries({queryKey:M.activeOrganization(s.slug)}),C.success("Organization settings updated successfully"),r?.data?.slug&&r.data.slug!==s.slug&&d({to:"/$org/settings",params:{org:r.data.slug}})},onError:r=>{C.error(r instanceof Error?r.message:"Failed to update organization")},onSettled:()=>{m(!1)}}),j=r=>{m(!0),u.mutate(r)},l=o.formState.isDirty;return e.jsxs(N,{children:[e.jsx(N.Header,{children:e.jsx(N.Header.Left,{children:e.jsx(Y,{children:e.jsx(Z,{children:e.jsx(G,{children:e.jsx(J,{children:"Settings"})})})})})}),e.jsx(N.Content,{children:e.jsx("div",{className:"flex h-full",children:e.jsx("div",{className:"flex-1 overflow-auto",children:e.jsx("div",{className:"p-5 max-w-2xl",children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Organization"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Update your organization's name, slug, and logo."})]}),e.jsx(X,{...o,children:e.jsxs("form",{onSubmit:o.handleSubmit(j),className:"space-y-6",children:[e.jsx(R,{control:o.control,name:"name",render:({field:r})=>e.jsxs(E,{children:[e.jsx(O,{children:"Organization Name"}),e.jsx(B,{children:e.jsx(q,{placeholder:"My Organization",...r,disabled:a})}),e.jsx(I,{})]})}),e.jsx(R,{control:o.control,name:"slug",render:({field:r})=>e.jsxs(E,{children:[e.jsx(O,{children:"Organization Slug"}),e.jsx(B,{children:e.jsx(q,{placeholder:"my-organization",...r,disabled:a,onChange:i=>{const n=i.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");r.onChange(n)}})}),e.jsx(_,{children:"Used in URLs. Only lowercase letters, numbers, and hyphens are allowed."}),e.jsx(I,{})]})}),e.jsx(R,{control:o.control,name:"logo",render:({field:r})=>e.jsxs(E,{children:[e.jsx(O,{children:"Logo"}),e.jsx(B,{children:e.jsx(oe,{value:r.value,onChange:r.onChange,name:o.watch("name")})}),e.jsx(I,{})]})}),e.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[e.jsx(S,{type:"submit",disabled:!l||a,className:"min-w-24",children:a?"Saving...":"Save Changes"}),l&&e.jsx(S,{type:"button",variant:"outline",onClick:()=>o.reset(),disabled:a,children:"Cancel"})]})]})}),e.jsxs("div",{className:"border-t border-border pt-6 mt-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"More Settings"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Additional configuration options for your organization."})]}),e.jsx("div",{className:"mt-4",children:e.jsxs(H,{to:"/$org/settings/plugins",params:{org:s.slug},className:"flex items-center justify-between p-4 rounded-lg border border-border hover:bg-accent/50 transition-colors group",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(P,{className:"h-5 w-5 text-muted-foreground"}),e.jsxs("div",{children:[e.jsx("div",{className:"font-medium text-foreground",children:"Plugins"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Enable or disable plugins for your organization"})]})]}),e.jsx(ee,{className:"h-5 w-5 text-muted-foreground group-hover:text-foreground transition-colors"})]})})]})]})})})})})]})}export{he as default};
1
+ import{r as w,l as U,u as $,a1 as D,k as K,h as Q,v as C,K as M,g as A,j as e,q as H,c as T,o as W,s as k}from"./index-BgOoHyXW.js";import{P as N}from"./index-DJ2Jm9li.js";import{B as Y,a as Z,b as G,c as J}from"./breadcrumb-CPuY6F-0.js";import{u as V}from"./useMutation-Ngf5wAT3.js";import{B as S}from"./button-DZky_O5b.js";import{a as X,F as R,b as E,c as O,d as B,f as I,e as _}from"./form-BmYBK--9.js";import{I as q}from"./input-BzaoEOCn.js";import{i as ee}from"./ChevronRight-BOG2FNn-.js";import{i as se}from"./Upload01-Bykolsxu.js";import{i as re}from"./X-DPo-5hWo.js";const P=({size:d=24,color:s="currentColor",...t})=>w.createElement("svg",{viewBox:"0 0 24 24",width:d,height:d,stroke:s,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},w.createElement("path",{d:"m2 14.5 9.642 4.821c.131.066.197.099.266.111.06.012.123.012.184 0 .069-.012.135-.045.266-.11L22 14.5m-20-5 9.642-4.821c.131-.066.197-.098.266-.111a.5.5 0 0 1 .184 0c.069.013.135.045.266.111L22 9.5l-9.642 4.821a1.028 1.028 0 0 1-.266.111.501.501 0 0 1-.184 0c-.069-.012-.135-.045-.266-.11L2 9.5Z"}));P.displayName="LayersTwo01";const te=W({name:k().min(1,"Name is required").max(255,"Name is too long"),slug:k().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens"),logo:k().optional()});function oe(d){const s=T.c(24),{value:t,onChange:a,name:m}=d,o=w.useRef(null);let u;s[0]!==a?(u=F=>{const L=F.target.files?.[0];if(L){if(L.size>2097152){C.error("Image must be smaller than 2MB");return}const c=new FileReader;c.onerror=()=>{const y=c.error;console.error("FileReader error:",y),C.error(y?.message||"Failed to read image file. Please try again."),o.current&&(o.current.value="")},c.onloadend=()=>{if(c.readyState===FileReader.DONE&&c.result){const y=c.result;a(y)}},c.readAsDataURL(L)}},s[0]=a,s[1]=u):u=s[1];const j=u;let l;s[2]===Symbol.for("react.memo_cache_sentinel")?(l=()=>{o.current?.click()},s[2]=l):l=s[2];const r=l;let i;s[3]!==a?(i=F=>{F.stopPropagation(),a("")},s[3]=a,s[4]=i):i=s[4];const n=i;let g;s[5]!==j?(g=e.jsx("input",{type:"file",ref:o,className:"hidden",accept:"image/*",onChange:j}),s[5]=j,s[6]=g):g=s[6];let x;s[7]!==n||s[8]!==m||s[9]!==t?(x=t?e.jsxs("div",{className:"relative group",children:[e.jsx("div",{className:"h-20 w-20 rounded-lg border border-border bg-muted/20 overflow-hidden",children:e.jsx("img",{src:t,alt:m||"Organization logo",className:"w-full h-full object-cover"})}),e.jsx("button",{type:"button",onClick:n,className:"absolute -top-2 -right-2 h-6 w-6 rounded-full bg-destructive text-destructive-foreground opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:e.jsx(re,{className:"h-3 w-3"})})]}):e.jsxs("button",{type:"button",onClick:r,className:"h-20 w-20 rounded-lg border-2 border-dashed border-border hover:border-foreground/50 hover:bg-accent/50 transition-colors flex flex-col items-center justify-center gap-1 text-muted-foreground hover:text-foreground",children:[e.jsx(se,{className:"h-5 w-5"}),e.jsx("span",{className:"text-xs",children:"Upload"})]}),s[7]=n,s[8]=m,s[9]=t,s[10]=x):x=s[10];const z=t?"Change Logo":"Upload Logo";let h;s[11]!==z?(h=e.jsx(S,{type:"button",variant:"outline",size:"sm",onClick:r,className:"mb-2",children:z}),s[11]=z,s[12]=h):h=s[12];let f;s[13]!==n||s[14]!==t?(f=t&&e.jsx(S,{type:"button",variant:"ghost",size:"sm",onClick:n,className:"ml-2",children:"Remove"}),s[13]=n,s[14]=t,s[15]=f):f=s[15];let b;s[16]===Symbol.for("react.memo_cache_sentinel")?(b=e.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Recommended: Square image, at least 200x200px. Max 2MB."}),s[16]=b):b=s[16];let p;s[17]!==h||s[18]!==f?(p=e.jsxs("div",{className:"flex-1",children:[h,f,b]}),s[17]=h,s[18]=f,s[19]=p):p=s[19];let v;return s[20]!==p||s[21]!==g||s[22]!==x?(v=e.jsxs("div",{className:"flex items-start gap-4",children:[g,x,p]}),s[20]=p,s[21]=g,s[22]=x,s[23]=v):v=s[23],v}function he(){const d=U(),{org:s}=$(),t=D(),[a,m]=w.useState(!1),o=K({resolver:Q(te),values:{name:s.name??"",slug:s.slug??"",logo:s.logo??""}}),u=V({mutationFn:async r=>{const i={name:r.name,slug:r.slug};r.logo&&(i.logo=r.logo);const n=await A.organization.update({organizationId:s.id,data:i});if(n?.error)throw new Error(n.error.message||"Failed to update organization");return n},onSuccess:r=>{t.invalidateQueries({queryKey:M.organizations()}),t.invalidateQueries({queryKey:M.activeOrganization(s.slug)}),C.success("Organization settings updated successfully"),r?.data?.slug&&r.data.slug!==s.slug&&d({to:"/$org/settings",params:{org:r.data.slug}})},onError:r=>{C.error(r instanceof Error?r.message:"Failed to update organization")},onSettled:()=>{m(!1)}}),j=r=>{m(!0),u.mutate(r)},l=o.formState.isDirty;return e.jsxs(N,{children:[e.jsx(N.Header,{children:e.jsx(N.Header.Left,{children:e.jsx(Y,{children:e.jsx(Z,{children:e.jsx(G,{children:e.jsx(J,{children:"Settings"})})})})})}),e.jsx(N.Content,{children:e.jsx("div",{className:"flex h-full",children:e.jsx("div",{className:"flex-1 overflow-auto",children:e.jsx("div",{className:"p-5 max-w-2xl",children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Organization"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Update your organization's name, slug, and logo."})]}),e.jsx(X,{...o,children:e.jsxs("form",{onSubmit:o.handleSubmit(j),className:"space-y-6",children:[e.jsx(R,{control:o.control,name:"name",render:({field:r})=>e.jsxs(E,{children:[e.jsx(O,{children:"Organization Name"}),e.jsx(B,{children:e.jsx(q,{placeholder:"My Organization",...r,disabled:a})}),e.jsx(I,{})]})}),e.jsx(R,{control:o.control,name:"slug",render:({field:r})=>e.jsxs(E,{children:[e.jsx(O,{children:"Organization Slug"}),e.jsx(B,{children:e.jsx(q,{placeholder:"my-organization",...r,disabled:a,onChange:i=>{const n=i.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");r.onChange(n)}})}),e.jsx(_,{children:"Used in URLs. Only lowercase letters, numbers, and hyphens are allowed."}),e.jsx(I,{})]})}),e.jsx(R,{control:o.control,name:"logo",render:({field:r})=>e.jsxs(E,{children:[e.jsx(O,{children:"Logo"}),e.jsx(B,{children:e.jsx(oe,{value:r.value,onChange:r.onChange,name:o.watch("name")})}),e.jsx(I,{})]})}),e.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[e.jsx(S,{type:"submit",disabled:!l||a,className:"min-w-24",children:a?"Saving...":"Save Changes"}),l&&e.jsx(S,{type:"button",variant:"outline",onClick:()=>o.reset(),disabled:a,children:"Cancel"})]})]})}),e.jsxs("div",{className:"border-t border-border pt-6 mt-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"More Settings"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Additional configuration options for your organization."})]}),e.jsx("div",{className:"mt-4",children:e.jsxs(H,{to:"/$org/settings/plugins",params:{org:s.slug},className:"flex items-center justify-between p-4 rounded-lg border border-border hover:bg-accent/50 transition-colors group",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(P,{className:"h-5 w-5 text-muted-foreground"}),e.jsxs("div",{children:[e.jsx("div",{className:"font-medium text-foreground",children:"Plugins"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Enable or disable plugins for your organization"})]})]}),e.jsx(ee,{className:"h-5 w-5 text-muted-foreground group-hover:text-foreground transition-colors"})]})})]})]})})})})})]})}export{he as default};
@@ -1,6 +1,6 @@
1
- import{r as v,c as w,j as n,u as be,l as le,b6 as Ce,L as Me,w as Ct,H as kt,y as _t,v as Y,bz as He,g as K,a as ke,aY as zt,bA as $t,b3 as Ue,bB as re,b as It,S as Be,d as Ot,e as Tt,N as Mt,x as Et,P as Lt,aN as We,K as At,O as Pt}from"./index-yjsBu7QA.js";import{C as F,u as Dt}from"./index-Bos_CuhY.js";import{I as Rt,n as Ht,b as Fe,a as ue,T as he,c as pe}from"./empty-state-CpRLw49r.js";import{P as ae}from"./index-P_cUV9l9.js";import{u as je}from"./use-deco-chat-open-C4y7eW_U.js";import{c as M,B as U}from"./button-BNRw8VbO.js";import{d as Ut}from"./constants-Cpe-c81c.js";import{T as Bt,i as Wt,b as Ft,S as Vt,c as Kt,d as Zt,e as Gt,f as Yt,t as Ve}from"./typewriter-title-CZvcEhZW.js";import{s as Ke}from"./Plus-BcqTpnxy.js";import{t as Ze}from"./Users03-CCWN1VQn.js";import{i as xe}from"./X-BsLffR19.js";import{E as Ge}from"./error-boundary-DQ5uRgdY.js";import{u as qt,S as Q,c as Jt}from"./collapsible-Dg-5RnYq.js";import{a as Xt}from"./Home02-CwpXJj-n.js";import{u as _e,a as Qt}from"./use-organization-settings-ClYOYczD.js";import{u as ie}from"./use-mobile-CS2zVR4m.js";import{A as J}from"./avatar-B6WhQiHI.js";import{P as ze,a as $e,b as Ie}from"./popover-u_i609j_.js";import{t as es}from"./ChevronDown-En_P43wp.js";import{C as Ye}from"./create-organization-dialog-7bdcAksX.js";import{c as ts,b as ss,g as ns,a as as,D as rs}from"./dialog-Csoqe4hG.js";import{L as ls}from"./form-DAoJifFq.js";import{S as is}from"./switch-DBMrpKuB.js";import{i as ge}from"./Check-lN7sUZo8.js";import{i as os}from"./Code01-Dgx2dgXr.js";import{a as qe}from"./Copy01-daHVbD8K.js";import{n as Ee}from"./Inbox01-BTvTBHN2.js";import{B as Le}from"./badge-D19NcG12.js";import{s as Ae}from"./XClose-D9VL7Fhs.js";import{i as cs}from"./File06-2dtWfDa_.js";import{I as ds}from"./input-C-GM7dsu.js";import{c as ms}from"./Grid01-DHptyetH.js";import{a as fs,b as us,D as hs,c as ps,g as Pe}from"./dropdown-menu-CsYNL9oo.js";import{n as De}from"./LinkExternal01-WHnCc-Ds.js";import{u as Je,L as Xe}from"./localstorage-keys-C_mtBNzA.js";import{R as xs,a as Qe,b as gs}from"./resizable-Bac7VXSC.js";import"./spinner-Duo6KesX.js";import"./use-mcp-prompts-SKr2e7l0.js";import"./useQuery-C5RIveiE.js";import"./AlertCircle-B7sqll3Z.js";import"./ArrowUp-D8YYlj5b.js";import"./Edit01-C_JM_ANM.js";import"./ChevronRight-BB2YL4K4.js";import"./Terminal-BOgtpg9n.js";import"./monaco-editor-p_EFt-aT.js";import"./use-connection-Dj100t8H.js";import"./use-collections-Hp9XPnUY.js";import"./useMutation-VOj1VEf8.js";import"./generate-id-Dyweu44Y.js";import"./SearchMd-DVuLBPJW.js";import"./Trash01-CR6s5yrj.js";import"./use-virtual-mcp-XGRCLjSr.js";import"./use-create-virtual-mcp-B01dvSQa.js";import"./use-binding-CNR8kDE7.js";import"./binder-CwgOa4SG.js";import"./select-B4SPtD5h.js";import"./Image01-CILGPgam.js";import"./alert-dialog-BYFUia7V.js";import"./infiniteQueryObserver-D_8FFQdU.js";const we=({size:t=24,color:e="currentColor",...s})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},v.createElement("path",{d:"M7 17 17 7m0 0H7m10 0v10"}));we.displayName="ArrowUpRight";const et=({size:t=24,color:e="currentColor",...s})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},v.createElement("path",{d:"M9 7H4.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C3 7.76 3 8.04 3 8.6v10.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C3.76 21 4.04 21 4.6 21H9m0 0h6m-6 0V4.6c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C9.76 3 10.04 3 10.6 3h2.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C15 3.76 15 4.04 15 4.6V21m0-10h4.4c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C21 11.76 21 12.04 21 12.6v6.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C20.24 21 19.96 21 19.4 21H15"}));et.displayName="BarChart10";const tt=({size:t=24,color:e="currentColor",...s})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},v.createElement("path",{d:"m12 21-.1-.15c-.695-1.042-1.042-1.563-1.5-1.94a4 4 0 0 0-1.378-.737C8.453 18 7.827 18 6.575 18H5.2c-1.12 0-1.68 0-2.108-.218a2 2 0 0 1-.874-.874C2 16.48 2 15.92 2 14.8V6.2c0-1.12 0-1.68.218-2.108a2 2 0 0 1 .874-.874C3.52 3 4.08 3 5.2 3h.4c2.24 0 3.36 0 4.216.436a4 4 0 0 1 1.748 1.748C12 6.04 12 7.16 12 9.4M12 21V9.4M12 21l.1-.15c.695-1.042 1.042-1.563 1.5-1.94a3.999 3.999 0 0 1 1.378-.737C15.547 18 16.173 18 17.425 18H18.8c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C22 16.48 22 15.92 22 14.8V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C20.48 3 19.92 3 18.8 3h-.4c-2.24 0-3.36 0-4.216.436a4 4 0 0 0-1.748 1.748C12 6.04 12 7.16 12 9.4"}));tt.displayName="BookOpen01";const st=({size:t=24,color:e="currentColor",...s})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},v.createElement("path",{d:"M15 21v-5.4c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C14.24 14 13.96 14 13.4 14h-2.8c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C9 14.76 9 15.04 9 15.6V21M3 7a3 3 0 0 0 6 0 3 3 0 1 0 6 0 3 3 0 1 0 6 0M6.2 21h11.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C21 19.48 21 18.92 21 17.8V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C19.48 3 18.92 3 17.8 3H6.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C3 4.52 3 5.08 3 6.2v11.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C4.52 21 5.08 21 6.2 21Z"}));st.displayName="Building02";const nt=({size:t=24,color:e="currentColor",...s})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},v.createElement("path",{d:"m18 17-5-5 5-5m-7 10-5-5 5-5"}));nt.displayName="ChevronLeftDouble";const at=({size:t=24,color:e="currentColor",...s})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},v.createElement("path",{d:"m6 17 5-5-5-5m7 10 5-5-5-5"}));at.displayName="ChevronRightDouble";const rt=({size:t=24,color:e="currentColor",...s})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},v.createElement("path",{d:"M2 12h20M2 12c0 5.523 4.477 10 10 10M2 12C2 6.477 6.477 2 12 2m10 10c0 5.523-4.477 10-10 10m10-10c0-5.523-4.477-10-10-10m0 0a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10m0-20a15.3 15.3 0 0 0-4 10 15.3 15.3 0 0 0 4 10"}));rt.displayName="Globe01";const lt=({size:t=24,color:e="currentColor",...s})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},v.createElement("path",{d:"M15 3v18M7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3Z"}));lt.displayName="LayoutRight";const it=({size:t=24,color:e="currentColor",...s})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},v.createElement("path",{d:"m16 17 5-5m0 0-5-5m5 5H9m0-9H7.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C3 5.28 3 6.12 3 7.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C5.28 21 6.12 21 7.8 21H9"}));it.displayName="LogOut01";const ot=({size:t=24,color:e="currentColor",...s})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},v.createElement("path",{d:"m16 17 5-5m0 0-5-5m5 5H9m3 5c0 .93 0 1.395-.102 1.776a3 3 0 0 1-2.122 2.122C9.395 21 8.93 21 8 21h-.5c-1.398 0-2.097 0-2.648-.228a3 3 0 0 1-1.624-1.624C3 18.597 3 17.898 3 16.5v-9c0-1.398 0-2.097.228-2.648a3 3 0 0 1 1.624-1.624C5.403 3 6.102 3 7.5 3H8c.93 0 1.395 0 1.776.102a3 3 0 0 1 2.122 2.122C12 5.605 12 6.07 12 7"}));ot.displayName="LogOut02";const ct=({size:t=24,color:e="currentColor",...s})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},v.createElement("path",{d:"m2 7 8.165 5.715c.661.463.992.695 1.351.784a2 2 0 0 0 .968 0c.36-.09.69-.32 1.351-.784L22 7M6.8 20h10.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C22 17.72 22 16.88 22 15.2V8.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C19.72 4 18.88 4 17.2 4H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 6.28 2 7.12 2 8.8v6.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 20 5.12 20 6.8 20Z"}));ct.displayName="Mail01";const Oe=({size:t=24,color:e="currentColor",...s})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},v.createElement("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"}),v.createElement("path",{d:"M18.727 14.727a1.5 1.5 0 0 0 .3 1.655l.055.054a1.816 1.816 0 0 1 0 2.573 1.818 1.818 0 0 1-2.573 0l-.055-.055a1.5 1.5 0 0 0-1.654-.3 1.5 1.5 0 0 0-.91 1.373v.155a1.818 1.818 0 1 1-3.636 0V20.1a1.5 1.5 0 0 0-.981-1.373 1.5 1.5 0 0 0-1.655.3l-.054.055a1.818 1.818 0 0 1-3.106-1.287 1.818 1.818 0 0 1 .533-1.286l.054-.055a1.5 1.5 0 0 0 .3-1.654 1.5 1.5 0 0 0-1.372-.91h-.155a1.818 1.818 0 1 1 0-3.636H3.9a1.5 1.5 0 0 0 1.373-.981 1.5 1.5 0 0 0-.3-1.655l-.055-.054A1.818 1.818 0 1 1 7.491 4.99l.054.054a1.5 1.5 0 0 0 1.655.3h.073a1.5 1.5 0 0 0 .909-1.372v-.155a1.818 1.818 0 0 1 3.636 0V3.9a1.499 1.499 0 0 0 .91 1.373 1.5 1.5 0 0 0 1.654-.3l.054-.055a1.817 1.817 0 0 1 2.573 0 1.819 1.819 0 0 1 0 2.573l-.055.054a1.5 1.5 0 0 0-.3 1.655v.073a1.5 1.5 0 0 0 1.373.909h.155a1.818 1.818 0 0 1 0 3.636H20.1a1.499 1.499 0 0 0-1.373.91Z"}));Oe.displayName="Settings01";const dt=({size:t=24,color:e="currentColor",...s})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},v.createElement("path",{d:"m9.395 19.371.585 1.315a2.212 2.212 0 0 0 4.044 0l.584-1.315a2.426 2.426 0 0 1 2.47-1.423l1.43.152a2.212 2.212 0 0 0 2.023-3.502l-.847-1.164a2.428 2.428 0 0 1-.46-1.434c0-.513.163-1.014.464-1.429l.847-1.163a2.211 2.211 0 0 0-2.022-3.502l-1.43.152a2.433 2.433 0 0 1-1.47-.312 2.426 2.426 0 0 1-1-1.117l-.589-1.315a2.212 2.212 0 0 0-4.044 0L9.395 4.63c-.207.468-.557.86-1 1.117-.445.256-.96.365-1.47.312l-1.434-.152a2.212 2.212 0 0 0-2.023 3.502l.847 1.163a2.43 2.43 0 0 1 0 2.858l-.847 1.163a2.21 2.21 0 0 0 .786 3.273c.382.195.811.274 1.237.23l1.43-.153a2.434 2.434 0 0 1 2.474 1.43Z"}),v.createElement("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"}));dt.displayName="Settings02";const mt=({size:t=24,color:e="currentColor",...s})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},v.createElement("path",{d:"M3 8h12m0 0a3 3 0 1 0 6 0 3 3 0 0 0-6 0Zm-6 8h12M9 16a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}));mt.displayName="Settings04";const ft=({size:t=24,color:e="currentColor",...s})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},v.createElement("path",{d:"M4 21.817C4.603 22 5.416 22 6.8 22h10.4c1.384 0 2.197 0 2.8-.183m-16 0a2.18 2.18 0 0 1-.362-.144 3 3 0 0 1-1.311-1.311C2 19.72 2 18.88 2 17.2V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C4.28 2 5.12 2 6.8 2h10.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C22 4.28 22 5.12 22 6.8v10.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311 2.18 2.18 0 0 1-.362.144m-16 0c0-.809.005-1.237.077-1.597a4 4 0 0 1 3.143-3.143C7.606 17 8.07 17 9 17h6c.93 0 1.394 0 1.78.077a4 4 0 0 1 3.143 3.143c.072.36.077.788.077 1.597M16 9.5a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z"}));ft.displayName="UserSquare";const ut=({size:t=24,color:e="currentColor",...s})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},v.createElement("path",{d:"M13 2 4.093 12.688c-.348.418-.523.628-.525.804a.5.5 0 0 0 .185.397c.138.111.41.111.955.111H12l-1 8 8.907-10.688c.348-.418.523-.628.525-.804a.5.5 0 0 0-.185-.397c-.138-.111-.41-.111-.955-.111H12l1-8Z"}));ut.displayName="Zap";function bs(){const t=w.c(68),{org:e}=be(),[,s]=je(),{selectedVirtualMcp:a,modelsConnections:r,isChatEmpty:l,activeThreadId:i,setActiveThreadId:o,threads:c}=qt();let d;if(t[0]!==i||t[1]!==c){let G;t[3]!==i?(G=X=>X.id===i,t[3]=i,t[4]=G):G=t[4],d=c.find(G),t[0]=i,t[1]=c,t[2]=d}else d=t[2];const m=d,[u,h]=v.useState(!1),[x,b]=v.useTransition();let f;t[5]!==e.id?(f=Ut(e.id),t[5]=e.id,t[6]=f):f=t[6];const p=a??f;let N;t[7]!==o?(N=()=>{b(()=>{o(crypto.randomUUID())})},t[7]=o,t[8]=N):N=t[8];const j=N;if(r.length===0){let G;t[9]!==p.title?(G=n.jsx(ae.Header.Left,{className:"gap-2",children:n.jsx("span",{className:"text-sm font-medium",children:p.title})}),t[9]=p.title,t[10]=G):G=t[10];let X;t[11]!==s?(X=()=>s(!1),t[11]=s,t[12]=X):X=t[12];let ce;t[13]===Symbol.for("react.memo_cache_sentinel")?(ce=n.jsx(xe,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[13]=ce):ce=t[13];let te;t[14]!==X?(te=n.jsx(ae.Header.Right,{className:"gap-1",children:n.jsx("button",{type:"button",onClick:X,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent transition-colors group cursor-pointer",title:"Close chat",children:ce})}),t[14]=X,t[15]=te):te=t[15];let se;t[16]!==G||t[17]!==te?(se=n.jsxs(ae.Header,{className:"flex-none",children:[G,te]}),t[16]=G,t[17]=te,t[18]=se):se=t[18];let ne;t[19]!==e?(ne=n.jsx(F.Main,{className:"flex flex-col items-center",children:n.jsx(F.EmptyState,{children:n.jsx(F.NoLlmBindingEmptyState,{title:"No model provider connected",description:"Connect to a model provider to unlock AI-powered features.",org:e})})}),t[19]=e,t[20]=ne):ne=t[20];let de;return t[21]!==se||t[22]!==ne?(de=n.jsxs(F,{children:[se,ne]}),t[21]=se,t[22]=ne,t[23]=de):de=t[23],de}const C=u?"duration-300 opacity-0 -translate-x-4 pointer-events-none":x?"duration-200 opacity-0 pointer-events-none":"duration-300 opacity-100 translate-x-0";let y;t[24]!==C?(y=M("absolute inset-0 flex flex-col transition-all ease-in-out",C),t[24]=C,t[25]=y):y=t[25];let k;t[26]!==m||t[27]!==p||t[28]!==l?(k=n.jsx(ae.Header.Left,{className:"gap-2",children:!l&&m?.title?n.jsx(Bt,{text:m.title,className:"text-sm font-medium text-foreground"}):n.jsx("span",{className:"text-sm font-medium text-foreground",children:p.title})}),t[26]=m,t[27]=p,t[28]=l,t[29]=k):k=t[29];let S;t[30]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx(Ke,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[30]=S):S=t[30];let $;t[31]!==j||t[32]!==x?($=n.jsx("button",{type:"button",onClick:j,disabled:x,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent group cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",title:"New chat",children:S}),t[31]=j,t[32]=x,t[33]=$):$=t[33];let _;t[34]===Symbol.for("react.memo_cache_sentinel")?(_=()=>h(!0),t[34]=_):_=t[34];let z;t[35]===Symbol.for("react.memo_cache_sentinel")?(z=n.jsx("button",{type:"button",onClick:_,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent group cursor-pointer",title:"Chat history",children:n.jsx(Wt,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"})}),t[35]=z):z=t[35];let I;t[36]!==s?(I=()=>s(!1),t[36]=s,t[37]=I):I=t[37];let O;t[38]===Symbol.for("react.memo_cache_sentinel")?(O=n.jsx(xe,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[38]=O):O=t[38];let T;t[39]!==I?(T=n.jsx("button",{type:"button",onClick:I,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent transition-colors group cursor-pointer",title:"Close chat",children:O}),t[39]=I,t[40]=T):T=t[40];let E;t[41]!==T||t[42]!==$?(E=n.jsxs(ae.Header.Right,{className:"gap-1",children:[$,z,T]}),t[41]=T,t[42]=$,t[43]=E):E=t[43];let L;t[44]!==E||t[45]!==k?(L=n.jsxs(ae.Header,{className:"flex-none",children:[k,E]}),t[44]=E,t[45]=k,t[46]=L):L=t[46];let A;t[47]!==p||t[48]!==l?(A=n.jsx(F.Main,{children:l?n.jsx(F.EmptyState,{children:n.jsxs("div",{className:"flex flex-col items-center gap-6 w-full px-4",children:[n.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 p-0 text-center",children:[n.jsx(Rt,{icon:p.icon,name:p.title,size:"lg",fallbackIcon:n.jsx(Ze,{size:32}),className:"size-[60px]! rounded-[18px]!"}),n.jsx("h3",{className:"text-xl font-medium text-foreground",children:p.title}),n.jsx("div",{className:"text-muted-foreground text-center text-sm max-w-md",children:p.description??"Ask anything about configuring model providers or using MCP Mesh."})]}),n.jsx(F.IceBreakers,{})]})}):n.jsx(F.Messages,{})}),t[47]=p,t[48]=l,t[49]=A):A=t[49];let R;t[50]===Symbol.for("react.memo_cache_sentinel")?(R=n.jsx(F.Footer,{children:n.jsx(F.Input,{})}),t[50]=R):R=t[50];let P;t[51]!==L||t[52]!==A||t[53]!==y?(P=n.jsxs("div",{className:y,children:[L,A,R]}),t[51]=L,t[52]=A,t[53]=y,t[54]=P):P=t[54];const H=u?"opacity-100 translate-x-0":"opacity-0 translate-x-4 pointer-events-none";let D;t[55]!==H?(D=M("absolute inset-0 flex flex-col transition-all duration-300 ease-in-out",H),t[55]=H,t[56]=D):D=t[56];let V;t[57]===Symbol.for("react.memo_cache_sentinel")?(V=()=>h(!1),t[57]=V):V=t[57];let B;t[58]!==i||t[59]!==o||t[60]!==c?(B=n.jsx(Ft,{threads:c,activeThreadId:i,onThreadSelect:o,onClose:V}),t[58]=i,t[59]=o,t[60]=c,t[61]=B):B=t[61];let Z;t[62]!==D||t[63]!==B?(Z=n.jsx("div",{className:D,children:B}),t[62]=D,t[63]=B,t[64]=Z):Z=t[64];let oe;return t[65]!==P||t[66]!==Z?(oe=n.jsxs(F,{className:"relative overflow-hidden",children:[P,Z]}),t[65]=P,t[66]=Z,t[67]=oe):oe=t[67],oe}function js(){const t=w.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(F.Skeleton,{}),t[0]=e):e=t[0];let s;return t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(Ge,{fallback:e,children:n.jsx(v.Suspense,{fallback:n.jsx(F.Skeleton,{}),children:n.jsx(bs,{})})}),t[1]=s):s=t[1],s}function vs(){const t=w.c(14),{locator:e,org:s}=be(),a=le(),r=Ce(),{org:l}=Me.parse(e);let i;t[0]!==e?(i=Me.isOrgAdminProject(e),t[0]=e,t[1]=i):i=t[1];const o=i,c=_e(s.id);let d;t[2]!==c?.enabled_plugins?(d=c?.enabled_plugins??[],t[2]=c?.enabled_plugins,t[3]=d):d=t[3];const m=d;let u;t[4]!==m?(u=S=>m.includes(S.pluginId),t[4]=m,t[5]=u):u=t[5];const h=Ct.filter(u),x=r.location.pathname===`/${l}`||r.location.pathname===`/${l}/`;let b;t[6]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx(Xt,{}),t[6]=b):b=t[6];let f;t[7]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(st,{}),t[7]=f):f=t[7];let g;t[8]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(Ht,{}),t[8]=g):g=t[8];let p;t[9]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx(Ze,{}),t[9]=p):p=t[9];let N;t[10]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(ut,{}),t[10]=N):N=t[10];let j;t[11]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(et,{}),t[11]=j):j=t[11];let C;t[12]===Symbol.for("react.memo_cache_sentinel")?(C=n.jsx(ft,{}),t[12]=C):C=t[12];let y;t[13]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(Oe,{}),t[13]=y):y=t[13];const k=[{key:"home",label:"Home",icon:b,onClick:()=>{x?window.dispatchEvent(new CustomEvent("reset-home-view")):a({to:"/$org",params:{org:l}})}},{key:"store",label:"Store",icon:f,onClick:()=>a({to:"/$org/store",params:{org:l}})},...h.map(S=>({key:S.pluginId,label:S.label,icon:S.icon,onClick:()=>a({to:"/$org/$pluginId",params:{org:l,pluginId:S.pluginId}})})),{key:"mcps",label:"Connections",icon:g,onClick:()=>a({to:"/$org/mcps",params:{org:l}})},{key:"agents",label:"Agents",icon:p,onClick:()=>a({to:"/$org/agents",params:{org:l}})},{key:"workflow",label:"Workflows",icon:N,onClick:()=>a({to:"/$org/workflows",params:{org:l}})},{key:"monitoring",label:"Monitoring",icon:j,onClick:()=>a({to:"/$org/monitoring",params:{org:l}})},{key:"members",label:"Members",icon:C,onClick:()=>a({to:"/$org/members",params:{org:l}})},{key:"settings",label:"Settings",icon:y,onClick:()=>a({to:"/$org/settings",params:{org:l}})}];return o?k:[]}const Ns="sidebar_state",ws=3600*24*7,Ss="16rem",ys="18rem",Cs="3rem",ks="b",ht=v.createContext(null);function ve(){const t=v.useContext(ht);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function _s(t){const e=w.c(21),{defaultOpen:s,open:a,onOpenChange:r,children:l}=t,i=s===void 0?!0:s,o=ie(),[c,d]=v.useState(!1),[m,u]=v.useState(i),h=a??m;let x;e[0]!==h||e[1]!==r?(x=$=>{const _=typeof $=="function"?$(h):$;r?r(_):u(_),document.cookie=`${Ns}=${_}; path=/; max-age=${ws}`},e[0]=h,e[1]=r,e[2]=x):x=e[2];const b=x;let f;e[3]!==o||e[4]!==b?(f=()=>o?d($s):b(zs),e[3]=o,e[4]=b,e[5]=f):f=e[5];const g=f;let p,N;e[6]!==g?(p=()=>{const $=_=>{if(_.key===ks&&(_.metaKey||_.ctrlKey)){const z=_.target;if(z.tagName==="INPUT"||z.tagName==="TEXTAREA"||z.isContentEditable)return;_.preventDefault(),g()}};return globalThis.addEventListener("keydown",$),()=>globalThis.removeEventListener("keydown",$)},N=[g],e[6]=g,e[7]=p,e[8]=N):(p=e[7],N=e[8]),v.useEffect(p,N);const j=h?"expanded":"collapsed";let C;e[9]!==o||e[10]!==h||e[11]!==c||e[12]!==b||e[13]!==j||e[14]!==g?(C={state:j,open:h,setOpen:b,isMobile:o,openMobile:c,setOpenMobile:d,toggleSidebar:g},e[9]=o,e[10]=h,e[11]=c,e[12]=b,e[13]=j,e[14]=g,e[15]=C):C=e[15];const y=C;let k;e[16]!==l?(k=n.jsx(Fe,{delayDuration:0,children:l}),e[16]=l,e[17]=k):k=e[17];let S;return e[18]!==y||e[19]!==k?(S=n.jsx(ht.Provider,{value:y,children:k}),e[18]=y,e[19]=k,e[20]=S):S=e[20],S}function zs(t){return!t}function $s(t){return!t}function Is(t){const e=w.c(14);let s,a,r,l;e[0]!==t?({className:a,style:l,children:s,...r}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=r,e[4]=l):(s=e[1],a=e[2],r=e[3],l=e[4]);let i;e[5]!==l?(i={"--sidebar-width":Ss,"--sidebar-width-icon":Cs,...l},e[5]=l,e[6]=i):i=e[6];const o=i;let c;e[7]!==a?(c=M("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex h-full w-full",a),e[7]=a,e[8]=c):c=e[8];let d;return e[9]!==s||e[10]!==r||e[11]!==o||e[12]!==c?(d=n.jsx("div",{"data-slot":"sidebar-wrapper",style:o,className:c,...r,children:s}),e[9]=s,e[10]=r,e[11]=o,e[12]=c,e[13]=d):d=e[13],d}function Os(t){const e=w.c(46);let s,a,r,l,i,o;e[0]!==t?({side:l,variant:i,collapsible:o,className:a,children:s,...r}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=r,e[4]=l,e[5]=i,e[6]=o):(s=e[1],a=e[2],r=e[3],l=e[4],i=e[5],o=e[6]);const c=l===void 0?"left":l,d=i===void 0?"sidebar":i,m=o===void 0?"offcanvas":o,{isMobile:u,state:h,openMobile:x,setOpenMobile:b}=ve();if(m==="none"){let _;e[7]!==a?(_=M("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",a),e[7]=a,e[8]=_):_=e[8];let z;return e[9]!==s||e[10]!==r||e[11]!==_?(z=n.jsx("div",{"data-slot":"sidebar",className:_,...r,children:s}),e[9]=s,e[10]=r,e[11]=_,e[12]=z):z=e[12],z}if(u){let _;e[13]===Symbol.for("react.memo_cache_sentinel")?(_={"--sidebar-width":ys},e[13]=_):_=e[13];let z;e[14]===Symbol.for("react.memo_cache_sentinel")?(z=n.jsxs(Kt,{className:"sr-only",children:[n.jsx(Zt,{children:"Sidebar"}),n.jsx(Gt,{children:"Displays the mobile sidebar."})]}),e[14]=z):z=e[14];let I;e[15]!==s?(I=n.jsx("div",{className:"flex h-full w-full flex-col",children:s}),e[15]=s,e[16]=I):I=e[16];let O;e[17]!==c||e[18]!==I?(O=n.jsxs(Yt,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:_,side:c,children:[z,I]}),e[17]=c,e[18]=I,e[19]=O):O=e[19];let T;return e[20]!==x||e[21]!==r||e[22]!==b||e[23]!==O?(T=n.jsx(Vt,{open:x,onOpenChange:b,...r,children:O}),e[20]=x,e[21]=r,e[22]=b,e[23]=O,e[24]=T):T=e[24],T}const f=h==="collapsed"?m:"",g=d==="floating"||d==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)";let p;e[25]!==g?(p=M("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",g),e[25]=g,e[26]=p):p=e[26];let N;e[27]!==p?(N=n.jsx("div",{"data-slot":"sidebar-gap",className:p}),e[27]=p,e[28]=N):N=e[28];const j=c==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",C=d==="floating"||d==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)";let y;e[29]!==a||e[30]!==j||e[31]!==C?(y=M("fixed top-12 bottom-0 z-10 hidden w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",j,C,a),e[29]=a,e[30]=j,e[31]=C,e[32]=y):y=e[32];let k;e[33]!==s?(k=n.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border py-2 flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:s}),e[33]=s,e[34]=k):k=e[34];let S;e[35]!==r||e[36]!==y||e[37]!==k?(S=n.jsx("div",{"data-slot":"sidebar-container",className:y,...r,children:k}),e[35]=r,e[36]=y,e[37]=k,e[38]=S):S=e[38];let $;return e[39]!==c||e[40]!==h||e[41]!==S||e[42]!==f||e[43]!==N||e[44]!==d?($=n.jsxs("div",{className:"group peer text-foreground hidden md:block border-r","data-state":h,"data-collapsible":f,"data-variant":d,"data-side":c,"data-slot":"sidebar",children:[N,S]}),e[39]=c,e[40]=h,e[41]=S,e[42]=f,e[43]=N,e[44]=d,e[45]=$):$=e[45],$}function Ts(t){const e=w.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let r;e[3]!==s?(r=M("bg-background relative flex w-full flex-1 flex-col min-w-0","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",s),e[3]=s,e[4]=r):r=e[4];let l;return e[5]!==a||e[6]!==r?(l=n.jsx("main",{"data-slot":"sidebar-inset",className:r,...a}),e[5]=a,e[6]=r,e[7]=l):l=e[7],l}function pt(t){const e=w.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let r;e[3]!==s?(r=M("flex flex-col gap-2 p-2",s),e[3]=s,e[4]=r):r=e[4];let l;return e[5]!==a||e[6]!==r?(l=n.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:r,...a}),e[5]=a,e[6]=r,e[7]=l):l=e[7],l}function Ms(t){const e=w.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let r;e[3]!==s?(r=M("flex flex-col gap-2 px-2 items-start justify-start",s),e[3]=s,e[4]=r):r=e[4];let l;return e[5]!==a||e[6]!==r?(l=n.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:r,...a}),e[5]=a,e[6]=r,e[7]=l):l=e[7],l}function Es(t){const e=w.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let r;e[3]!==s?(r=M("h-4 m-0! w-full",s),e[3]=s,e[4]=r):r=e[4];let l;return e[5]!==a||e[6]!==r?(l=n.jsx("div",{"data-sidebar":"separator",className:r,...a}),e[5]=a,e[6]=r,e[7]=l):l=e[7],l}function Ls(t){const e=w.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let r;e[3]!==s?(r=M("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",s),e[3]=s,e[4]=r):r=e[4];let l;return e[5]!==a||e[6]!==r?(l=n.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:r,...a}),e[5]=a,e[6]=r,e[7]=l):l=e[7],l}function As(t){const e=w.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let r;e[3]!==s?(r=M("relative flex w-full min-w-0 flex-col px-2 py-2 md:py-0",s),e[3]=s,e[4]=r):r=e[4];let l;return e[5]!==a||e[6]!==r?(l=n.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:r,...a}),e[5]=a,e[6]=r,e[7]=l):l=e[7],l}function Ps(t){const e=w.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let r;e[3]!==s?(r=M("w-full text-sm",s),e[3]=s,e[4]=r):r=e[4];let l;return e[5]!==a||e[6]!==r?(l=n.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:r,...a}),e[5]=a,e[6]=r,e[7]=l):l=e[7],l}function Ne(t){const e=w.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let r;e[3]!==s?(r=M("flex w-full min-w-0 flex-col gap-1",s),e[3]=s,e[4]=r):r=e[4];let l;return e[5]!==a||e[6]!==r?(l=n.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:r,...a}),e[5]=a,e[6]=r,e[7]=l):l=e[7],l}function ee(t){const e=w.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let r;e[3]!==s?(r=M("group/menu-item relative",s),e[3]=s,e[4]=r):r=e[4];let l;return e[5]!==a||e[6]!==r?(l=n.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:r,...a}),e[5]=a,e[6]=r,e[7]=l):l=e[7],l}const Ds=_t("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-lg px-2 py-1.5 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding,colors] transition-colors duration-150 ease-out hover:transition-none focus-visible:ring-2 active:bg-sidebar-accent/75 disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent/75 [&>span:last-child]:truncate [&>svg]:size-[18px] [&>svg]:shrink-0 [&>svg]:text-muted-foreground",{variants:{variant:{default:"hover:bg-sidebar-accent text-sidebar-foreground/80 active:text-sidebar-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-7 text-sm font-[450]",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Te(t){const e=w.c(28);let s,a,r,l,i,o,c;e[0]!==t?({asChild:r,isActive:l,variant:i,size:o,tooltip:c,className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=r,e[4]=l,e[5]=i,e[6]=o,e[7]=c):(s=e[1],a=e[2],r=e[3],l=e[4],i=e[5],o=e[6],c=e[7]);const d=r===void 0?!1:r,m=l===void 0?!1:l,u=i===void 0?"default":i,h=o===void 0?"default":o,x=d?kt:"button",{isMobile:b,state:f}=ve();let g;e[8]!==s||e[9]!==h||e[10]!==u?(g=M(Ds({variant:u,size:h}),s),e[8]=s,e[9]=h,e[10]=u,e[11]=g):g=e[11];let p;e[12]!==x||e[13]!==m||e[14]!==a||e[15]!==h||e[16]!==g?(p=n.jsx(x,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":h,"data-active":m,className:g,...a}),e[12]=x,e[13]=m,e[14]=a,e[15]=h,e[16]=g,e[17]=p):p=e[17];const N=p;if(!c)return N;if(typeof c=="string"){let S;e[18]!==c?(S={children:c},e[18]=c,e[19]=S):S=e[19],c=S}let j;e[20]!==N?(j=n.jsx(he,{asChild:!0,children:N}),e[20]=N,e[21]=j):j=e[21];const C=f!=="collapsed"||b;let y;e[22]!==C||e[23]!==c?(y=n.jsx(ue,{side:"right",align:"center",hidden:C,...c}),e[22]=C,e[23]=c,e[24]=y):y=e[24];let k;return e[25]!==j||e[26]!==y?(k=n.jsxs(pe,{children:[j,y]}),e[25]=j,e[26]=y,e[27]=k):k=e[27],k}function xt(t){const e=w.c(11),{navigationItems:s,header:a,footer:r,additionalContent:l,variant:i,collapsible:o}=t,c=i===void 0?"sidebar":i,d=o===void 0?"icon":o;let m;e[0]!==s?(m=s.map(Rs),e[0]=s,e[1]=m):m=e[1];let u;e[2]!==l||e[3]!==m?(u=n.jsx(Ls,{className:"flex-1 overflow-x-hidden",children:n.jsx(As,{className:"font-medium",children:n.jsx(Ps,{children:n.jsxs(Ne,{className:"gap-0.5",children:[m,l]})})})}),e[2]=l,e[3]=m,e[4]=u):u=e[4];let h;return e[5]!==d||e[6]!==r||e[7]!==a||e[8]!==u||e[9]!==c?(h=n.jsxs(Os,{variant:c,collapsible:d,children:[a,u,r]}),e[5]=d,e[6]=r,e[7]=a,e[8]=u,e[9]=c,e[10]=h):h=e[10],h}function Rs(t){return n.jsx(ee,{children:n.jsxs(Te,{className:"group/nav-item cursor-pointer text-foreground/90 hover:text-foreground",onClick:t.onClick,isActive:t.isActive,tooltip:t.label,children:[n.jsx("span",{className:"text-muted-foreground group-hover/nav-item:text-foreground transition-colors [&>svg]:size-4",children:t.icon}),n.jsx("span",{className:"truncate",children:t.label})]})},t.key)}xt.Skeleton=function(){return n.jsx("div",{className:"flex flex-col gap-0.5",children:Array.from({length:8}).map((e,s)=>n.jsx("div",{className:"w-full h-8",children:n.jsx(Q,{className:"h-full bg-sidebar-accent rounded-md"})},s))})};const Hs="w-full h-8 justify-start gap-2 px-2 text-sm font-[450] text-sidebar-foreground hover:text-sidebar-foreground hover:bg-sidebar-accent active:bg-sidebar-accent/75 [&>svg]:size-[18px] [&>svg]:text-muted-foreground hover:[&>svg]:text-sidebar-foreground";function me(t){const e=w.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let r;e[3]!==s?(r=M(Hs,s),e[3]=s,e[4]=r):r=e[4];let l;return e[5]!==a||e[6]!==r?(l=n.jsx(U,{variant:"ghost",size:"sm",className:r,...a}),e[5]=a,e[6]=r,e[7]=l):l=e[7],l}function Us(t){const e=w.c(27),{user:s,userImage:a,onOpenSettings:r}=t;let l;e[0]!==s?(l=async()=>{if(!s)return;const y=`ID: ${s.id}
1
+ import{r as v,c as w,j as n,u as be,l as le,b6 as Ce,L as Me,w as Ct,H as kt,y as _t,v as Y,bA as He,g as K,a as ke,aY as zt,bB as $t,b3 as Ue,bC as re,b as It,S as Be,d as Ot,e as Tt,N as Mt,x as Et,P as Lt,aN as We,K as At,O as Pt}from"./index-BgOoHyXW.js";import{C as F,u as Dt}from"./index-C_wS7kU0.js";import{I as Rt,n as Ht,b as Fe,a as ue,T as he,c as pe}from"./empty-state-D1xTHC6z.js";import{P as ae}from"./index-DJ2Jm9li.js";import{u as je}from"./use-deco-chat-open-94yXlVsB.js";import{c as M,B as U}from"./button-DZky_O5b.js";import{d as Ut}from"./constants-G7VjePam.js";import{T as Bt,i as Wt,b as Ft,S as Vt,c as Kt,d as Zt,e as Gt,f as Yt,t as Ve}from"./typewriter-title-BUQDml2i.js";import{s as Ke}from"./Plus-CKeAhIyX.js";import{t as Ze}from"./Users03-Bll7QSmr.js";import{i as xe}from"./X-DPo-5hWo.js";import{E as Ge}from"./error-boundary-gLETJlNI.js";import{u as qt,S as Q,c as Jt}from"./collapsible-BoMwbmju.js";import{a as Xt}from"./Home02-Cj_b_3Nv.js";import{u as _e,a as Qt}from"./use-organization-settings-OSGN2_Jg.js";import{u as ie}from"./use-mobile-BpwfxiEP.js";import{A as J}from"./avatar-BKY-flI3.js";import{P as ze,a as $e,b as Ie}from"./popover-DUJwUSSM.js";import{t as es}from"./ChevronDown-DNLmRmxT.js";import{C as Ye}from"./create-organization-dialog-CAVp9V3U.js";import{c as ts,b as ss,g as ns,a as as,D as rs}from"./dialog-BfMrinrm.js";import{L as ls}from"./form-BmYBK--9.js";import{S as is}from"./switch-CtUEm8Xv.js";import{i as ge}from"./Check-DqzdHNMw.js";import{i as os}from"./Code01-D9NkYkuA.js";import{a as qe}from"./Copy01-BLooCkZe.js";import{n as Ee}from"./Inbox01-DVXsLh-J.js";import{B as Le}from"./badge-CTM0uIWD.js";import{s as Ae}from"./XClose-BgTbSIyK.js";import{i as cs}from"./File06-CNHRuvsg.js";import{I as ds}from"./input-BzaoEOCn.js";import{c as ms}from"./Grid01-BGQX-rj4.js";import{a as fs,b as us,D as hs,c as ps,g as Pe}from"./dropdown-menu-ez_4ZmAk.js";import{n as De}from"./LinkExternal01-pdytjGUU.js";import{u as Je,L as Xe}from"./localstorage-keys-D6GRYm3g.js";import{R as xs,a as Qe,b as gs}from"./resizable-84bjYGaV.js";import"./spinner-C10QwZNL.js";import"./use-mcp-prompts-DkUA9eji.js";import"./useQuery-BlNmU8Jq.js";import"./AlertCircle-exKB88m_.js";import"./ArrowUp-NeI_Sm5E.js";import"./Edit01-Zee8_Yir.js";import"./ChevronRight-BOG2FNn-.js";import"./Terminal-CRout4QP.js";import"./monaco-editor-ClMv24Rj.js";import"./use-connection-sLATlyBj.js";import"./use-collections-CE5nYbrV.js";import"./useMutation-Ngf5wAT3.js";import"./generate-id-Dyweu44Y.js";import"./SearchMd-BH2aZiBv.js";import"./Trash01-DWmC_leT.js";import"./use-virtual-mcp-XIWHgsHo.js";import"./use-create-virtual-mcp-CAqC56mj.js";import"./use-binding-COwUQLKP.js";import"./binder-Rtvfp3ct.js";import"./select-iwsI8D5M.js";import"./Image01-DPdsVLq5.js";import"./alert-dialog-CAM8sgWL.js";import"./infiniteQueryObserver-DeNzkqh2.js";const we=({size:t=24,color:e="currentColor",...s})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},v.createElement("path",{d:"M7 17 17 7m0 0H7m10 0v10"}));we.displayName="ArrowUpRight";const et=({size:t=24,color:e="currentColor",...s})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},v.createElement("path",{d:"M9 7H4.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C3 7.76 3 8.04 3 8.6v10.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C3.76 21 4.04 21 4.6 21H9m0 0h6m-6 0V4.6c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C9.76 3 10.04 3 10.6 3h2.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C15 3.76 15 4.04 15 4.6V21m0-10h4.4c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C21 11.76 21 12.04 21 12.6v6.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C20.24 21 19.96 21 19.4 21H15"}));et.displayName="BarChart10";const tt=({size:t=24,color:e="currentColor",...s})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},v.createElement("path",{d:"m12 21-.1-.15c-.695-1.042-1.042-1.563-1.5-1.94a4 4 0 0 0-1.378-.737C8.453 18 7.827 18 6.575 18H5.2c-1.12 0-1.68 0-2.108-.218a2 2 0 0 1-.874-.874C2 16.48 2 15.92 2 14.8V6.2c0-1.12 0-1.68.218-2.108a2 2 0 0 1 .874-.874C3.52 3 4.08 3 5.2 3h.4c2.24 0 3.36 0 4.216.436a4 4 0 0 1 1.748 1.748C12 6.04 12 7.16 12 9.4M12 21V9.4M12 21l.1-.15c.695-1.042 1.042-1.563 1.5-1.94a3.999 3.999 0 0 1 1.378-.737C15.547 18 16.173 18 17.425 18H18.8c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C22 16.48 22 15.92 22 14.8V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C20.48 3 19.92 3 18.8 3h-.4c-2.24 0-3.36 0-4.216.436a4 4 0 0 0-1.748 1.748C12 6.04 12 7.16 12 9.4"}));tt.displayName="BookOpen01";const st=({size:t=24,color:e="currentColor",...s})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},v.createElement("path",{d:"M15 21v-5.4c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C14.24 14 13.96 14 13.4 14h-2.8c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C9 14.76 9 15.04 9 15.6V21M3 7a3 3 0 0 0 6 0 3 3 0 1 0 6 0 3 3 0 1 0 6 0M6.2 21h11.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C21 19.48 21 18.92 21 17.8V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C19.48 3 18.92 3 17.8 3H6.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C3 4.52 3 5.08 3 6.2v11.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C4.52 21 5.08 21 6.2 21Z"}));st.displayName="Building02";const nt=({size:t=24,color:e="currentColor",...s})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},v.createElement("path",{d:"m18 17-5-5 5-5m-7 10-5-5 5-5"}));nt.displayName="ChevronLeftDouble";const at=({size:t=24,color:e="currentColor",...s})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},v.createElement("path",{d:"m6 17 5-5-5-5m7 10 5-5-5-5"}));at.displayName="ChevronRightDouble";const rt=({size:t=24,color:e="currentColor",...s})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},v.createElement("path",{d:"M2 12h20M2 12c0 5.523 4.477 10 10 10M2 12C2 6.477 6.477 2 12 2m10 10c0 5.523-4.477 10-10 10m10-10c0-5.523-4.477-10-10-10m0 0a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10m0-20a15.3 15.3 0 0 0-4 10 15.3 15.3 0 0 0 4 10"}));rt.displayName="Globe01";const lt=({size:t=24,color:e="currentColor",...s})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},v.createElement("path",{d:"M15 3v18M7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3Z"}));lt.displayName="LayoutRight";const it=({size:t=24,color:e="currentColor",...s})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},v.createElement("path",{d:"m16 17 5-5m0 0-5-5m5 5H9m0-9H7.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C3 5.28 3 6.12 3 7.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C5.28 21 6.12 21 7.8 21H9"}));it.displayName="LogOut01";const ot=({size:t=24,color:e="currentColor",...s})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},v.createElement("path",{d:"m16 17 5-5m0 0-5-5m5 5H9m3 5c0 .93 0 1.395-.102 1.776a3 3 0 0 1-2.122 2.122C9.395 21 8.93 21 8 21h-.5c-1.398 0-2.097 0-2.648-.228a3 3 0 0 1-1.624-1.624C3 18.597 3 17.898 3 16.5v-9c0-1.398 0-2.097.228-2.648a3 3 0 0 1 1.624-1.624C5.403 3 6.102 3 7.5 3H8c.93 0 1.395 0 1.776.102a3 3 0 0 1 2.122 2.122C12 5.605 12 6.07 12 7"}));ot.displayName="LogOut02";const ct=({size:t=24,color:e="currentColor",...s})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},v.createElement("path",{d:"m2 7 8.165 5.715c.661.463.992.695 1.351.784a2 2 0 0 0 .968 0c.36-.09.69-.32 1.351-.784L22 7M6.8 20h10.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C22 17.72 22 16.88 22 15.2V8.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C19.72 4 18.88 4 17.2 4H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 6.28 2 7.12 2 8.8v6.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 20 5.12 20 6.8 20Z"}));ct.displayName="Mail01";const Oe=({size:t=24,color:e="currentColor",...s})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},v.createElement("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"}),v.createElement("path",{d:"M18.727 14.727a1.5 1.5 0 0 0 .3 1.655l.055.054a1.816 1.816 0 0 1 0 2.573 1.818 1.818 0 0 1-2.573 0l-.055-.055a1.5 1.5 0 0 0-1.654-.3 1.5 1.5 0 0 0-.91 1.373v.155a1.818 1.818 0 1 1-3.636 0V20.1a1.5 1.5 0 0 0-.981-1.373 1.5 1.5 0 0 0-1.655.3l-.054.055a1.818 1.818 0 0 1-3.106-1.287 1.818 1.818 0 0 1 .533-1.286l.054-.055a1.5 1.5 0 0 0 .3-1.654 1.5 1.5 0 0 0-1.372-.91h-.155a1.818 1.818 0 1 1 0-3.636H3.9a1.5 1.5 0 0 0 1.373-.981 1.5 1.5 0 0 0-.3-1.655l-.055-.054A1.818 1.818 0 1 1 7.491 4.99l.054.054a1.5 1.5 0 0 0 1.655.3h.073a1.5 1.5 0 0 0 .909-1.372v-.155a1.818 1.818 0 0 1 3.636 0V3.9a1.499 1.499 0 0 0 .91 1.373 1.5 1.5 0 0 0 1.654-.3l.054-.055a1.817 1.817 0 0 1 2.573 0 1.819 1.819 0 0 1 0 2.573l-.055.054a1.5 1.5 0 0 0-.3 1.655v.073a1.5 1.5 0 0 0 1.373.909h.155a1.818 1.818 0 0 1 0 3.636H20.1a1.499 1.499 0 0 0-1.373.91Z"}));Oe.displayName="Settings01";const dt=({size:t=24,color:e="currentColor",...s})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},v.createElement("path",{d:"m9.395 19.371.585 1.315a2.212 2.212 0 0 0 4.044 0l.584-1.315a2.426 2.426 0 0 1 2.47-1.423l1.43.152a2.212 2.212 0 0 0 2.023-3.502l-.847-1.164a2.428 2.428 0 0 1-.46-1.434c0-.513.163-1.014.464-1.429l.847-1.163a2.211 2.211 0 0 0-2.022-3.502l-1.43.152a2.433 2.433 0 0 1-1.47-.312 2.426 2.426 0 0 1-1-1.117l-.589-1.315a2.212 2.212 0 0 0-4.044 0L9.395 4.63c-.207.468-.557.86-1 1.117-.445.256-.96.365-1.47.312l-1.434-.152a2.212 2.212 0 0 0-2.023 3.502l.847 1.163a2.43 2.43 0 0 1 0 2.858l-.847 1.163a2.21 2.21 0 0 0 .786 3.273c.382.195.811.274 1.237.23l1.43-.153a2.434 2.434 0 0 1 2.474 1.43Z"}),v.createElement("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"}));dt.displayName="Settings02";const mt=({size:t=24,color:e="currentColor",...s})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},v.createElement("path",{d:"M3 8h12m0 0a3 3 0 1 0 6 0 3 3 0 0 0-6 0Zm-6 8h12M9 16a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}));mt.displayName="Settings04";const ft=({size:t=24,color:e="currentColor",...s})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},v.createElement("path",{d:"M4 21.817C4.603 22 5.416 22 6.8 22h10.4c1.384 0 2.197 0 2.8-.183m-16 0a2.18 2.18 0 0 1-.362-.144 3 3 0 0 1-1.311-1.311C2 19.72 2 18.88 2 17.2V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C4.28 2 5.12 2 6.8 2h10.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C22 4.28 22 5.12 22 6.8v10.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311 2.18 2.18 0 0 1-.362.144m-16 0c0-.809.005-1.237.077-1.597a4 4 0 0 1 3.143-3.143C7.606 17 8.07 17 9 17h6c.93 0 1.394 0 1.78.077a4 4 0 0 1 3.143 3.143c.072.36.077.788.077 1.597M16 9.5a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z"}));ft.displayName="UserSquare";const ut=({size:t=24,color:e="currentColor",...s})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},v.createElement("path",{d:"M13 2 4.093 12.688c-.348.418-.523.628-.525.804a.5.5 0 0 0 .185.397c.138.111.41.111.955.111H12l-1 8 8.907-10.688c.348-.418.523-.628.525-.804a.5.5 0 0 0-.185-.397c-.138-.111-.41-.111-.955-.111H12l1-8Z"}));ut.displayName="Zap";function bs(){const t=w.c(68),{org:e}=be(),[,s]=je(),{selectedVirtualMcp:a,modelsConnections:r,isChatEmpty:l,activeThreadId:i,setActiveThreadId:o,threads:c}=qt();let d;if(t[0]!==i||t[1]!==c){let G;t[3]!==i?(G=X=>X.id===i,t[3]=i,t[4]=G):G=t[4],d=c.find(G),t[0]=i,t[1]=c,t[2]=d}else d=t[2];const m=d,[u,h]=v.useState(!1),[x,b]=v.useTransition();let f;t[5]!==e.id?(f=Ut(e.id),t[5]=e.id,t[6]=f):f=t[6];const p=a??f;let N;t[7]!==o?(N=()=>{b(()=>{o(crypto.randomUUID())})},t[7]=o,t[8]=N):N=t[8];const j=N;if(r.length===0){let G;t[9]!==p.title?(G=n.jsx(ae.Header.Left,{className:"gap-2",children:n.jsx("span",{className:"text-sm font-medium",children:p.title})}),t[9]=p.title,t[10]=G):G=t[10];let X;t[11]!==s?(X=()=>s(!1),t[11]=s,t[12]=X):X=t[12];let ce;t[13]===Symbol.for("react.memo_cache_sentinel")?(ce=n.jsx(xe,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[13]=ce):ce=t[13];let te;t[14]!==X?(te=n.jsx(ae.Header.Right,{className:"gap-1",children:n.jsx("button",{type:"button",onClick:X,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent transition-colors group cursor-pointer",title:"Close chat",children:ce})}),t[14]=X,t[15]=te):te=t[15];let se;t[16]!==G||t[17]!==te?(se=n.jsxs(ae.Header,{className:"flex-none",children:[G,te]}),t[16]=G,t[17]=te,t[18]=se):se=t[18];let ne;t[19]!==e?(ne=n.jsx(F.Main,{className:"flex flex-col items-center",children:n.jsx(F.EmptyState,{children:n.jsx(F.NoLlmBindingEmptyState,{title:"No model provider connected",description:"Connect to a model provider to unlock AI-powered features.",org:e})})}),t[19]=e,t[20]=ne):ne=t[20];let de;return t[21]!==se||t[22]!==ne?(de=n.jsxs(F,{children:[se,ne]}),t[21]=se,t[22]=ne,t[23]=de):de=t[23],de}const C=u?"duration-300 opacity-0 -translate-x-4 pointer-events-none":x?"duration-200 opacity-0 pointer-events-none":"duration-300 opacity-100 translate-x-0";let y;t[24]!==C?(y=M("absolute inset-0 flex flex-col transition-all ease-in-out",C),t[24]=C,t[25]=y):y=t[25];let k;t[26]!==m||t[27]!==p||t[28]!==l?(k=n.jsx(ae.Header.Left,{className:"gap-2",children:!l&&m?.title?n.jsx(Bt,{text:m.title,className:"text-sm font-medium text-foreground"}):n.jsx("span",{className:"text-sm font-medium text-foreground",children:p.title})}),t[26]=m,t[27]=p,t[28]=l,t[29]=k):k=t[29];let S;t[30]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx(Ke,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[30]=S):S=t[30];let $;t[31]!==j||t[32]!==x?($=n.jsx("button",{type:"button",onClick:j,disabled:x,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent group cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",title:"New chat",children:S}),t[31]=j,t[32]=x,t[33]=$):$=t[33];let _;t[34]===Symbol.for("react.memo_cache_sentinel")?(_=()=>h(!0),t[34]=_):_=t[34];let z;t[35]===Symbol.for("react.memo_cache_sentinel")?(z=n.jsx("button",{type:"button",onClick:_,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent group cursor-pointer",title:"Chat history",children:n.jsx(Wt,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"})}),t[35]=z):z=t[35];let I;t[36]!==s?(I=()=>s(!1),t[36]=s,t[37]=I):I=t[37];let O;t[38]===Symbol.for("react.memo_cache_sentinel")?(O=n.jsx(xe,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[38]=O):O=t[38];let T;t[39]!==I?(T=n.jsx("button",{type:"button",onClick:I,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent transition-colors group cursor-pointer",title:"Close chat",children:O}),t[39]=I,t[40]=T):T=t[40];let E;t[41]!==T||t[42]!==$?(E=n.jsxs(ae.Header.Right,{className:"gap-1",children:[$,z,T]}),t[41]=T,t[42]=$,t[43]=E):E=t[43];let L;t[44]!==E||t[45]!==k?(L=n.jsxs(ae.Header,{className:"flex-none",children:[k,E]}),t[44]=E,t[45]=k,t[46]=L):L=t[46];let A;t[47]!==p||t[48]!==l?(A=n.jsx(F.Main,{children:l?n.jsx(F.EmptyState,{children:n.jsxs("div",{className:"flex flex-col items-center gap-6 w-full px-4",children:[n.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 p-0 text-center",children:[n.jsx(Rt,{icon:p.icon,name:p.title,size:"lg",fallbackIcon:n.jsx(Ze,{size:32}),className:"size-[60px]! rounded-[18px]!"}),n.jsx("h3",{className:"text-xl font-medium text-foreground",children:p.title}),n.jsx("div",{className:"text-muted-foreground text-center text-sm max-w-md",children:p.description??"Ask anything about configuring model providers or using MCP Mesh."})]}),n.jsx(F.IceBreakers,{})]})}):n.jsx(F.Messages,{})}),t[47]=p,t[48]=l,t[49]=A):A=t[49];let R;t[50]===Symbol.for("react.memo_cache_sentinel")?(R=n.jsx(F.Footer,{children:n.jsx(F.Input,{})}),t[50]=R):R=t[50];let P;t[51]!==L||t[52]!==A||t[53]!==y?(P=n.jsxs("div",{className:y,children:[L,A,R]}),t[51]=L,t[52]=A,t[53]=y,t[54]=P):P=t[54];const H=u?"opacity-100 translate-x-0":"opacity-0 translate-x-4 pointer-events-none";let D;t[55]!==H?(D=M("absolute inset-0 flex flex-col transition-all duration-300 ease-in-out",H),t[55]=H,t[56]=D):D=t[56];let V;t[57]===Symbol.for("react.memo_cache_sentinel")?(V=()=>h(!1),t[57]=V):V=t[57];let B;t[58]!==i||t[59]!==o||t[60]!==c?(B=n.jsx(Ft,{threads:c,activeThreadId:i,onThreadSelect:o,onClose:V}),t[58]=i,t[59]=o,t[60]=c,t[61]=B):B=t[61];let Z;t[62]!==D||t[63]!==B?(Z=n.jsx("div",{className:D,children:B}),t[62]=D,t[63]=B,t[64]=Z):Z=t[64];let oe;return t[65]!==P||t[66]!==Z?(oe=n.jsxs(F,{className:"relative overflow-hidden",children:[P,Z]}),t[65]=P,t[66]=Z,t[67]=oe):oe=t[67],oe}function js(){const t=w.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(F.Skeleton,{}),t[0]=e):e=t[0];let s;return t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(Ge,{fallback:e,children:n.jsx(v.Suspense,{fallback:n.jsx(F.Skeleton,{}),children:n.jsx(bs,{})})}),t[1]=s):s=t[1],s}function vs(){const t=w.c(14),{locator:e,org:s}=be(),a=le(),r=Ce(),{org:l}=Me.parse(e);let i;t[0]!==e?(i=Me.isOrgAdminProject(e),t[0]=e,t[1]=i):i=t[1];const o=i,c=_e(s.id);let d;t[2]!==c?.enabled_plugins?(d=c?.enabled_plugins??[],t[2]=c?.enabled_plugins,t[3]=d):d=t[3];const m=d;let u;t[4]!==m?(u=S=>m.includes(S.pluginId),t[4]=m,t[5]=u):u=t[5];const h=Ct.filter(u),x=r.location.pathname===`/${l}`||r.location.pathname===`/${l}/`;let b;t[6]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx(Xt,{}),t[6]=b):b=t[6];let f;t[7]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(st,{}),t[7]=f):f=t[7];let g;t[8]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(Ht,{}),t[8]=g):g=t[8];let p;t[9]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx(Ze,{}),t[9]=p):p=t[9];let N;t[10]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(ut,{}),t[10]=N):N=t[10];let j;t[11]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(et,{}),t[11]=j):j=t[11];let C;t[12]===Symbol.for("react.memo_cache_sentinel")?(C=n.jsx(ft,{}),t[12]=C):C=t[12];let y;t[13]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(Oe,{}),t[13]=y):y=t[13];const k=[{key:"home",label:"Home",icon:b,onClick:()=>{x?window.dispatchEvent(new CustomEvent("reset-home-view")):a({to:"/$org",params:{org:l}})}},{key:"store",label:"Store",icon:f,onClick:()=>a({to:"/$org/store",params:{org:l}})},...h.map(S=>({key:S.pluginId,label:S.label,icon:S.icon,onClick:()=>a({to:"/$org/$pluginId",params:{org:l,pluginId:S.pluginId}})})),{key:"mcps",label:"Connections",icon:g,onClick:()=>a({to:"/$org/mcps",params:{org:l}})},{key:"agents",label:"Agents",icon:p,onClick:()=>a({to:"/$org/agents",params:{org:l}})},{key:"workflow",label:"Workflows",icon:N,onClick:()=>a({to:"/$org/workflows",params:{org:l}})},{key:"monitoring",label:"Monitoring",icon:j,onClick:()=>a({to:"/$org/monitoring",params:{org:l}})},{key:"members",label:"Members",icon:C,onClick:()=>a({to:"/$org/members",params:{org:l}})},{key:"settings",label:"Settings",icon:y,onClick:()=>a({to:"/$org/settings",params:{org:l}})}];return o?k:[]}const Ns="sidebar_state",ws=3600*24*7,Ss="16rem",ys="18rem",Cs="3rem",ks="b",ht=v.createContext(null);function ve(){const t=v.useContext(ht);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function _s(t){const e=w.c(21),{defaultOpen:s,open:a,onOpenChange:r,children:l}=t,i=s===void 0?!0:s,o=ie(),[c,d]=v.useState(!1),[m,u]=v.useState(i),h=a??m;let x;e[0]!==h||e[1]!==r?(x=$=>{const _=typeof $=="function"?$(h):$;r?r(_):u(_),document.cookie=`${Ns}=${_}; path=/; max-age=${ws}`},e[0]=h,e[1]=r,e[2]=x):x=e[2];const b=x;let f;e[3]!==o||e[4]!==b?(f=()=>o?d($s):b(zs),e[3]=o,e[4]=b,e[5]=f):f=e[5];const g=f;let p,N;e[6]!==g?(p=()=>{const $=_=>{if(_.key===ks&&(_.metaKey||_.ctrlKey)){const z=_.target;if(z.tagName==="INPUT"||z.tagName==="TEXTAREA"||z.isContentEditable)return;_.preventDefault(),g()}};return globalThis.addEventListener("keydown",$),()=>globalThis.removeEventListener("keydown",$)},N=[g],e[6]=g,e[7]=p,e[8]=N):(p=e[7],N=e[8]),v.useEffect(p,N);const j=h?"expanded":"collapsed";let C;e[9]!==o||e[10]!==h||e[11]!==c||e[12]!==b||e[13]!==j||e[14]!==g?(C={state:j,open:h,setOpen:b,isMobile:o,openMobile:c,setOpenMobile:d,toggleSidebar:g},e[9]=o,e[10]=h,e[11]=c,e[12]=b,e[13]=j,e[14]=g,e[15]=C):C=e[15];const y=C;let k;e[16]!==l?(k=n.jsx(Fe,{delayDuration:0,children:l}),e[16]=l,e[17]=k):k=e[17];let S;return e[18]!==y||e[19]!==k?(S=n.jsx(ht.Provider,{value:y,children:k}),e[18]=y,e[19]=k,e[20]=S):S=e[20],S}function zs(t){return!t}function $s(t){return!t}function Is(t){const e=w.c(14);let s,a,r,l;e[0]!==t?({className:a,style:l,children:s,...r}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=r,e[4]=l):(s=e[1],a=e[2],r=e[3],l=e[4]);let i;e[5]!==l?(i={"--sidebar-width":Ss,"--sidebar-width-icon":Cs,...l},e[5]=l,e[6]=i):i=e[6];const o=i;let c;e[7]!==a?(c=M("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex h-full w-full",a),e[7]=a,e[8]=c):c=e[8];let d;return e[9]!==s||e[10]!==r||e[11]!==o||e[12]!==c?(d=n.jsx("div",{"data-slot":"sidebar-wrapper",style:o,className:c,...r,children:s}),e[9]=s,e[10]=r,e[11]=o,e[12]=c,e[13]=d):d=e[13],d}function Os(t){const e=w.c(46);let s,a,r,l,i,o;e[0]!==t?({side:l,variant:i,collapsible:o,className:a,children:s,...r}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=r,e[4]=l,e[5]=i,e[6]=o):(s=e[1],a=e[2],r=e[3],l=e[4],i=e[5],o=e[6]);const c=l===void 0?"left":l,d=i===void 0?"sidebar":i,m=o===void 0?"offcanvas":o,{isMobile:u,state:h,openMobile:x,setOpenMobile:b}=ve();if(m==="none"){let _;e[7]!==a?(_=M("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",a),e[7]=a,e[8]=_):_=e[8];let z;return e[9]!==s||e[10]!==r||e[11]!==_?(z=n.jsx("div",{"data-slot":"sidebar",className:_,...r,children:s}),e[9]=s,e[10]=r,e[11]=_,e[12]=z):z=e[12],z}if(u){let _;e[13]===Symbol.for("react.memo_cache_sentinel")?(_={"--sidebar-width":ys},e[13]=_):_=e[13];let z;e[14]===Symbol.for("react.memo_cache_sentinel")?(z=n.jsxs(Kt,{className:"sr-only",children:[n.jsx(Zt,{children:"Sidebar"}),n.jsx(Gt,{children:"Displays the mobile sidebar."})]}),e[14]=z):z=e[14];let I;e[15]!==s?(I=n.jsx("div",{className:"flex h-full w-full flex-col",children:s}),e[15]=s,e[16]=I):I=e[16];let O;e[17]!==c||e[18]!==I?(O=n.jsxs(Yt,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:_,side:c,children:[z,I]}),e[17]=c,e[18]=I,e[19]=O):O=e[19];let T;return e[20]!==x||e[21]!==r||e[22]!==b||e[23]!==O?(T=n.jsx(Vt,{open:x,onOpenChange:b,...r,children:O}),e[20]=x,e[21]=r,e[22]=b,e[23]=O,e[24]=T):T=e[24],T}const f=h==="collapsed"?m:"",g=d==="floating"||d==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)";let p;e[25]!==g?(p=M("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",g),e[25]=g,e[26]=p):p=e[26];let N;e[27]!==p?(N=n.jsx("div",{"data-slot":"sidebar-gap",className:p}),e[27]=p,e[28]=N):N=e[28];const j=c==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",C=d==="floating"||d==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)";let y;e[29]!==a||e[30]!==j||e[31]!==C?(y=M("fixed top-12 bottom-0 z-10 hidden w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",j,C,a),e[29]=a,e[30]=j,e[31]=C,e[32]=y):y=e[32];let k;e[33]!==s?(k=n.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border py-2 flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:s}),e[33]=s,e[34]=k):k=e[34];let S;e[35]!==r||e[36]!==y||e[37]!==k?(S=n.jsx("div",{"data-slot":"sidebar-container",className:y,...r,children:k}),e[35]=r,e[36]=y,e[37]=k,e[38]=S):S=e[38];let $;return e[39]!==c||e[40]!==h||e[41]!==S||e[42]!==f||e[43]!==N||e[44]!==d?($=n.jsxs("div",{className:"group peer text-foreground hidden md:block border-r","data-state":h,"data-collapsible":f,"data-variant":d,"data-side":c,"data-slot":"sidebar",children:[N,S]}),e[39]=c,e[40]=h,e[41]=S,e[42]=f,e[43]=N,e[44]=d,e[45]=$):$=e[45],$}function Ts(t){const e=w.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let r;e[3]!==s?(r=M("bg-background relative flex w-full flex-1 flex-col min-w-0","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",s),e[3]=s,e[4]=r):r=e[4];let l;return e[5]!==a||e[6]!==r?(l=n.jsx("main",{"data-slot":"sidebar-inset",className:r,...a}),e[5]=a,e[6]=r,e[7]=l):l=e[7],l}function pt(t){const e=w.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let r;e[3]!==s?(r=M("flex flex-col gap-2 p-2",s),e[3]=s,e[4]=r):r=e[4];let l;return e[5]!==a||e[6]!==r?(l=n.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:r,...a}),e[5]=a,e[6]=r,e[7]=l):l=e[7],l}function Ms(t){const e=w.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let r;e[3]!==s?(r=M("flex flex-col gap-2 px-2 items-start justify-start",s),e[3]=s,e[4]=r):r=e[4];let l;return e[5]!==a||e[6]!==r?(l=n.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:r,...a}),e[5]=a,e[6]=r,e[7]=l):l=e[7],l}function Es(t){const e=w.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let r;e[3]!==s?(r=M("h-4 m-0! w-full",s),e[3]=s,e[4]=r):r=e[4];let l;return e[5]!==a||e[6]!==r?(l=n.jsx("div",{"data-sidebar":"separator",className:r,...a}),e[5]=a,e[6]=r,e[7]=l):l=e[7],l}function Ls(t){const e=w.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let r;e[3]!==s?(r=M("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",s),e[3]=s,e[4]=r):r=e[4];let l;return e[5]!==a||e[6]!==r?(l=n.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:r,...a}),e[5]=a,e[6]=r,e[7]=l):l=e[7],l}function As(t){const e=w.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let r;e[3]!==s?(r=M("relative flex w-full min-w-0 flex-col px-2 py-2 md:py-0",s),e[3]=s,e[4]=r):r=e[4];let l;return e[5]!==a||e[6]!==r?(l=n.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:r,...a}),e[5]=a,e[6]=r,e[7]=l):l=e[7],l}function Ps(t){const e=w.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let r;e[3]!==s?(r=M("w-full text-sm",s),e[3]=s,e[4]=r):r=e[4];let l;return e[5]!==a||e[6]!==r?(l=n.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:r,...a}),e[5]=a,e[6]=r,e[7]=l):l=e[7],l}function Ne(t){const e=w.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let r;e[3]!==s?(r=M("flex w-full min-w-0 flex-col gap-1",s),e[3]=s,e[4]=r):r=e[4];let l;return e[5]!==a||e[6]!==r?(l=n.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:r,...a}),e[5]=a,e[6]=r,e[7]=l):l=e[7],l}function ee(t){const e=w.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let r;e[3]!==s?(r=M("group/menu-item relative",s),e[3]=s,e[4]=r):r=e[4];let l;return e[5]!==a||e[6]!==r?(l=n.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:r,...a}),e[5]=a,e[6]=r,e[7]=l):l=e[7],l}const Ds=_t("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-lg px-2 py-1.5 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding,colors] transition-colors duration-150 ease-out hover:transition-none focus-visible:ring-2 active:bg-sidebar-accent/75 disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent/75 [&>span:last-child]:truncate [&>svg]:size-[18px] [&>svg]:shrink-0 [&>svg]:text-muted-foreground",{variants:{variant:{default:"hover:bg-sidebar-accent text-sidebar-foreground/80 active:text-sidebar-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-7 text-sm font-[450]",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Te(t){const e=w.c(28);let s,a,r,l,i,o,c;e[0]!==t?({asChild:r,isActive:l,variant:i,size:o,tooltip:c,className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=r,e[4]=l,e[5]=i,e[6]=o,e[7]=c):(s=e[1],a=e[2],r=e[3],l=e[4],i=e[5],o=e[6],c=e[7]);const d=r===void 0?!1:r,m=l===void 0?!1:l,u=i===void 0?"default":i,h=o===void 0?"default":o,x=d?kt:"button",{isMobile:b,state:f}=ve();let g;e[8]!==s||e[9]!==h||e[10]!==u?(g=M(Ds({variant:u,size:h}),s),e[8]=s,e[9]=h,e[10]=u,e[11]=g):g=e[11];let p;e[12]!==x||e[13]!==m||e[14]!==a||e[15]!==h||e[16]!==g?(p=n.jsx(x,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":h,"data-active":m,className:g,...a}),e[12]=x,e[13]=m,e[14]=a,e[15]=h,e[16]=g,e[17]=p):p=e[17];const N=p;if(!c)return N;if(typeof c=="string"){let S;e[18]!==c?(S={children:c},e[18]=c,e[19]=S):S=e[19],c=S}let j;e[20]!==N?(j=n.jsx(he,{asChild:!0,children:N}),e[20]=N,e[21]=j):j=e[21];const C=f!=="collapsed"||b;let y;e[22]!==C||e[23]!==c?(y=n.jsx(ue,{side:"right",align:"center",hidden:C,...c}),e[22]=C,e[23]=c,e[24]=y):y=e[24];let k;return e[25]!==j||e[26]!==y?(k=n.jsxs(pe,{children:[j,y]}),e[25]=j,e[26]=y,e[27]=k):k=e[27],k}function xt(t){const e=w.c(11),{navigationItems:s,header:a,footer:r,additionalContent:l,variant:i,collapsible:o}=t,c=i===void 0?"sidebar":i,d=o===void 0?"icon":o;let m;e[0]!==s?(m=s.map(Rs),e[0]=s,e[1]=m):m=e[1];let u;e[2]!==l||e[3]!==m?(u=n.jsx(Ls,{className:"flex-1 overflow-x-hidden",children:n.jsx(As,{className:"font-medium",children:n.jsx(Ps,{children:n.jsxs(Ne,{className:"gap-0.5",children:[m,l]})})})}),e[2]=l,e[3]=m,e[4]=u):u=e[4];let h;return e[5]!==d||e[6]!==r||e[7]!==a||e[8]!==u||e[9]!==c?(h=n.jsxs(Os,{variant:c,collapsible:d,children:[a,u,r]}),e[5]=d,e[6]=r,e[7]=a,e[8]=u,e[9]=c,e[10]=h):h=e[10],h}function Rs(t){return n.jsx(ee,{children:n.jsxs(Te,{className:"group/nav-item cursor-pointer text-foreground/90 hover:text-foreground",onClick:t.onClick,isActive:t.isActive,tooltip:t.label,children:[n.jsx("span",{className:"text-muted-foreground group-hover/nav-item:text-foreground transition-colors [&>svg]:size-4",children:t.icon}),n.jsx("span",{className:"truncate",children:t.label})]})},t.key)}xt.Skeleton=function(){return n.jsx("div",{className:"flex flex-col gap-0.5",children:Array.from({length:8}).map((e,s)=>n.jsx("div",{className:"w-full h-8",children:n.jsx(Q,{className:"h-full bg-sidebar-accent rounded-md"})},s))})};const Hs="w-full h-8 justify-start gap-2 px-2 text-sm font-[450] text-sidebar-foreground hover:text-sidebar-foreground hover:bg-sidebar-accent active:bg-sidebar-accent/75 [&>svg]:size-[18px] [&>svg]:text-muted-foreground hover:[&>svg]:text-sidebar-foreground";function me(t){const e=w.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let r;e[3]!==s?(r=M(Hs,s),e[3]=s,e[4]=r):r=e[4];let l;return e[5]!==a||e[6]!==r?(l=n.jsx(U,{variant:"ghost",size:"sm",className:r,...a}),e[5]=a,e[6]=r,e[7]=l):l=e[7],l}function Us(t){const e=w.c(27),{user:s,userImage:a,onOpenSettings:r}=t;let l;e[0]!==s?(l=async()=>{if(!s)return;const y=`ID: ${s.id}
2
2
  Name: ${s.name||"N/A"}
3
- Email: ${s.email}`;try{await navigator.clipboard.writeText(y),Y.success("User info copied to clipboard")}catch{Y.error("Failed to copy user info to clipboard")}},e[0]=s,e[1]=l):l=e[1];const i=l,o=s.name||s.email||"U";let c;e[2]!==o||e[3]!==a?(c=n.jsx(J,{url:a,fallback:o,shape:"circle",size:"sm",className:"size-8 shrink-0"}),e[2]=o,e[3]=a,e[4]=c):c=e[4];const d=s.name||"User";let m;e[5]!==d?(m=n.jsx("span",{className:"text-sm text-sidebar-foreground truncate font-[450]",children:d}),e[5]=d,e[6]=m):m=e[6];let u;e[7]!==s.email?(u=n.jsx("span",{className:"text-xs text-muted-foreground truncate font-normal",children:s.email}),e[7]=s.email,e[8]=u):u=e[8];let h;e[9]!==m||e[10]!==u?(h=n.jsxs("div",{className:"flex flex-col min-w-0 text-left",children:[m,u]}),e[9]=m,e[10]=u,e[11]=h):h=e[11];let x;e[12]!==i||e[13]!==c||e[14]!==h?(x=n.jsxs(U,{variant:"ghost",onClick:i,className:"h-auto p-2 m-1 mb-0 justify-start gap-2 hover:bg-sidebar-accent hover:text-inherit active:bg-sidebar-accent/75",children:[c,h]}),e[12]=i,e[13]=c,e[14]=h,e[15]=x):x=e[15];let b;e[16]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx(mt,{size:18}),e[16]=b):b=e[16];let f;e[17]!==r?(f=n.jsxs(me,{onClick:r,children:[b,"Preferences"]}),e[17]=r,e[18]=f):f=e[18];let g;e[19]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(me,{asChild:!0,children:n.jsxs("a",{href:"https://www.decocms.com/terms-of-use",target:"_blank",rel:"noopener noreferrer",children:[n.jsx(tt,{size:18}),n.jsx("span",{className:"flex-1",children:"Terms & Conditions"}),n.jsx(we,{size:14})]})}),e[19]=g):g=e[19];let p;e[20]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx(me,{asChild:!0,children:n.jsxs("a",{href:"https://github.com/decocms/mesh",target:"_blank",rel:"noopener noreferrer",children:[n.jsx(He,{className:"size-[18px]"}),n.jsx("span",{className:"flex-1",children:"decocms/mesh"}),n.jsx(we,{size:14})]})}),e[20]=p):p=e[20];let N;e[21]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsxs(me,{onClick:Bs,children:[n.jsx(ot,{size:18}),"Log out"]}),e[21]=N):N=e[21];let j;e[22]!==f?(j=n.jsxs("div",{className:"p-1 flex flex-col",children:[f,g,p,N]}),e[22]=f,e[23]=j):j=e[23];let C;return e[24]!==j||e[25]!==x?(C=n.jsx(n.Fragment,{children:n.jsxs("div",{className:"flex flex-col gap-0.5 bg-sidebar min-w-[250px]",children:[x,j]})}),e[24]=j,e[25]=x,e[26]=C):C=e[26],C}function Bs(){return K.signOut()}function Ws(t){const e=w.c(22),{org:s,isActive:a,onClick:r,onSettings:l}=t,[i,o]=v.useState(!1),c=a||i,d=a&&"bg-accent hover:bg-accent";let m;e[0]!==d?(m=M("flex items-center gap-2 w-full justify-start font-normal h-10 px-2 rounded-lg cursor-pointer transition-colors hover:bg-accent/50",d),e[0]=d,e[1]=m):m=e[1];let u;e[2]!==r?(u=j=>{(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),r?.())},e[2]=r,e[3]=u):u=e[3];let h,x;e[4]===Symbol.for("react.memo_cache_sentinel")?(h=()=>o(!0),x=()=>o(!1),e[4]=h,e[5]=x):(h=e[4],x=e[5]);const b=s.logo??void 0;let f;e[6]!==s.name||e[7]!==b?(f=n.jsx(J,{url:b,fallback:s.name,size:"sm",className:"size-6 shrink-0 rounded-md",objectFit:"cover"}),e[6]=s.name,e[7]=b,e[8]=f):f=e[8];let g;e[9]!==s.name?(g=n.jsx("span",{className:"flex-1 text-sm text-foreground truncate text-left min-w-0",children:s.name}),e[9]=s.name,e[10]=g):g=e[10];let p;e[11]!==l||e[12]!==s.name||e[13]!==c?(p=l&&c?n.jsx("button",{type:"button","aria-label":`${s.name} settings`,className:"size-5 shrink-0 flex items-center justify-center rounded-md transition-colors hover:bg-foreground/10",onClick:j=>{j.stopPropagation(),l()},children:n.jsx(dt,{size:16,className:"text-muted-foreground"})}):n.jsx("span",{className:"size-5 shrink-0","aria-hidden":"true"}),e[11]=l,e[12]=s.name,e[13]=c,e[14]=p):p=e[14];let N;return e[15]!==r||e[16]!==m||e[17]!==u||e[18]!==f||e[19]!==g||e[20]!==p?(N=n.jsxs("div",{role:"button",tabIndex:0,className:m,onClick:r,onKeyDown:u,onMouseEnter:h,onMouseLeave:x,children:[f,g,p]}),e[15]=r,e[16]=m,e[17]=u,e[18]=f,e[19]=g,e[20]=p,e[21]=N):N=e[21],N}function Fs(t){const e=w.c(33),{currentOrgSlug:s,onOrgSelect:a,onOrgSettings:r,onPopoverClose:l}=t,{data:i}=K.useListOrganizations(),[o,c]=v.useState(!1);let d,m,u,h;if(e[0]!==s||e[1]!==a||e[2]!==r||e[3]!==l||e[4]!==i){let p;e[9]!==s?(p=(S,$)=>S.slug===s?-1:$.slug===s?1:S.name.localeCompare($.name),e[9]=s,e[10]=p):p=e[10];const N=[...i??[]].sort(p);u="flex flex-col min-w-[275px] border-l border-border";let j;e[11]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx("span",{className:"text-xs text-muted-foreground truncate",children:"Your Organizations"}),e[11]=j):j=e[11];let C;e[12]!==l?(C=()=>{l(),c(!0)},e[12]=l,e[13]=C):C=e[13];let y;e[14]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(Ke,{size:16,className:"text-muted-foreground"}),e[14]=y):y=e[14],e[15]!==C?(h=n.jsxs("div",{className:"flex items-center justify-between h-10 px-3 border-b border-border",children:[j,n.jsx(U,{variant:"ghost",size:"icon",className:"size-5",onClick:C,children:y})]}),e[15]=C,e[16]=h):h=e[16],d="flex flex-col gap-0.5 p-1 flex-1 overflow-y-auto";let k;e[17]!==s||e[18]!==a||e[19]!==r?(k=S=>n.jsx(Ws,{org:S,isActive:S.slug===s,onClick:()=>a(S.slug),onSettings:()=>r(S.slug)},S.slug),e[17]=s,e[18]=a,e[19]=r,e[20]=k):k=e[20],m=N.map(k),e[0]=s,e[1]=a,e[2]=r,e[3]=l,e[4]=i,e[5]=d,e[6]=m,e[7]=u,e[8]=h}else d=e[5],m=e[6],u=e[7],h=e[8];let x;e[21]!==d||e[22]!==m?(x=n.jsx("div",{className:d,children:m}),e[21]=d,e[22]=m,e[23]=x):x=e[23];let b;e[24]!==u||e[25]!==h||e[26]!==x?(b=n.jsxs("div",{className:u,children:[h,x]}),e[24]=u,e[25]=h,e[26]=x,e[27]=b):b=e[27];let f;e[28]!==o?(f=n.jsx(Ye,{open:o,onOpenChange:c}),e[28]=o,e[29]=f):f=e[29];let g;return e[30]!==b||e[31]!==f?(g=n.jsxs(n.Fragment,{children:[b,f]}),e[30]=b,e[31]=f,e[32]=g):g=e[32],g}function gt(t){const e=w.c(48),{open:s,onOpenChange:a,user:r,userImage:l}=t,[i,o]=Dt(),[c,d]=v.useState(!1);let m;e[0]!==r.id?(m=()=>{navigator.clipboard.writeText(r.id),d(!0),setTimeout(()=>d(!1),2e3)},e[0]=r.id,e[1]=m):m=e[1];const u=m;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx(ts,{className:"text-base",children:"Profile Settings"}),e[2]=h):h=e[2];let x;e[3]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsxs(ss,{className:"px-6 pt-6 pb-4 border-b border-border shrink-0 relative",children:[h,n.jsxs(ns,{className:"absolute top-1/2 right-4 -translate-y-1/2 cursor-pointer rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2",children:[n.jsx(xe,{size:16}),n.jsx("span",{className:"sr-only",children:"Close"})]})]}),e[3]=x):x=e[3];const b=r.name||"U";let f;e[4]!==b||e[5]!==l?(f=n.jsx(J,{url:l,fallback:b,shape:"circle",size:"xl",className:"h-16 w-16"}),e[4]=b,e[5]=l,e[6]=f):f=e[6];const g=r.name||"User";let p;e[7]!==g?(p=n.jsx("span",{className:"text-base font-medium text-foreground",children:g}),e[7]=g,e[8]=p):p=e[8];let N;e[9]!==r.email?(N=n.jsx("span",{className:"text-sm text-muted-foreground",children:r.email}),e[9]=r.email,e[10]=N):N=e[10];let j;e[11]!==p||e[12]!==N?(j=n.jsxs("div",{className:"flex flex-col gap-1",children:[p,N]}),e[11]=p,e[12]=N,e[13]=j):j=e[13];let C;e[14]!==f||e[15]!==j?(C=n.jsxs("div",{className:"flex items-center gap-4",children:[f,j]}),e[14]=f,e[15]=j,e[16]=C):C=e[16];let y;e[17]!==i||e[18]!==o?(y=()=>o(!i),e[17]=i,e[18]=o,e[19]=y):y=e[19];let k;e[20]===Symbol.for("react.memo_cache_sentinel")?(k=n.jsxs("div",{className:"flex flex-col gap-1 flex-1 min-w-0",children:[n.jsxs(ls,{className:"text-sm font-medium text-foreground flex items-center gap-2 pointer-events-none",children:[n.jsx(os,{size:16,className:"text-muted-foreground"}),"Developer Mode"]}),n.jsx("p",{className:"text-xs text-muted-foreground pointer-events-none",children:"Show technical details like JSON input/output for tool calls"})]}),e[20]=k):k=e[20];let S;e[21]!==i||e[22]!==o?(S=n.jsx("div",{onClick:Vs,children:n.jsx(is,{checked:i,onCheckedChange:o})}),e[21]=i,e[22]=o,e[23]=S):S=e[23];let $;e[24]!==y||e[25]!==S?($=n.jsxs("button",{type:"button",onClick:y,className:"flex items-center justify-between gap-4 p-4 rounded-lg border border-border hover:bg-accent/50 transition-colors text-left w-full cursor-pointer",children:[k,S]}),e[24]=y,e[25]=S,e[26]=$):$=e[26];let _;e[27]!==C||e[28]!==$?(_=n.jsxs("div",{className:"p-5 space-y-6 min-h-[225px]",children:[C,$]}),e[27]=C,e[28]=$,e[29]=_):_=e[29];let z;e[30]!==r.id?(z=n.jsx("span",{className:"font-mono text-xs",children:r.id}),e[30]=r.id,e[31]=z):z=e[31];let I;e[32]!==c?(I=c?n.jsx(ge,{size:14,className:"text-green-600"}):n.jsx(qe,{size:14,className:"opacity-0 group-hover:opacity-100 transition-opacity"}),e[32]=c,e[33]=I):I=e[33];let O;e[34]!==u||e[35]!==z||e[36]!==I?(O=n.jsx(he,{asChild:!0,children:n.jsxs("button",{type:"button",onClick:u,className:"group flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[z,I]})}),e[34]=u,e[35]=z,e[36]=I,e[37]=O):O=e[37];let T;e[38]===Symbol.for("react.memo_cache_sentinel")?(T=n.jsx(ue,{side:"top",children:n.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[38]=T):T=e[38];let E;e[39]!==O?(E=n.jsx("div",{className:"border-t border-border px-5 py-4 flex items-center shrink-0",children:n.jsx(Fe,{children:n.jsxs(pe,{children:[O,T]})})}),e[39]=O,e[40]=E):E=e[40];let L;e[41]!==_||e[42]!==E?(L=n.jsxs(as,{className:"sm:max-w-lg sm:max-h-[85vh] p-0 flex flex-col",closeButtonClassName:"hidden",children:[x,n.jsxs("div",{className:"flex flex-col",children:[_,E]})]}),e[41]=_,e[42]=E,e[43]=L):L=e[43];let A;return e[44]!==a||e[45]!==s||e[46]!==L?(A=n.jsx(rs,{open:s,onOpenChange:a,children:L}),e[44]=a,e[45]=s,e[46]=L,e[47]=A):A=e[47],A}function Vs(t){return t.stopPropagation()}function bt(t){const e=w.c(43),{isCollapsed:s}=t,a=s===void 0?!1:s;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},e[0]=r):r=e[0];const{org:l}=ke(r),{data:i}=K.useListOrganizations(),{data:o}=K.useSession(),c=le();let d;e[1]!==l||e[2]!==i?(d=i?.find(D=>D.slug===l),e[1]=l,e[2]=i,e[3]=d):d=e[3];const m=d,[u,h]=v.useState(!1),[x,b]=v.useState(!1),f=o?.user,g=f?.image;let p;e[4]!==c?(p=D=>{h(!1),c({to:"/$org/settings",params:{org:D}})},e[4]=c,e[5]=p):p=e[5];const N=p;let j;e[6]!==c?(j=D=>{h(!1),c({to:"/$org",params:{org:D}})},e[6]=c,e[7]=j):j=e[7];const C=j,y=a?"justify-center":"justify-start",k=a?"":"pl-0.5! px-1.5 gap-1.5";let S;e[8]!==y||e[9]!==k?(S=M("h-7 min-w-0 max-w-full hover:bg-sidebar-accent",y,k),e[8]=y,e[9]=k,e[10]=S):S=e[10];const $=m?.logo??"",_=m?.name??"";let z;e[11]!==_||e[12]!==$?(z=n.jsx(J,{url:$,fallback:_,size:"xs",className:"shrink-0 rounded-[5px]",objectFit:"cover"}),e[11]=_,e[12]=$,e[13]=z):z=e[13];let I;e[14]!==m?.name||e[15]!==a?(I=!a&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"truncate text-[14px] tracking-[-0.00625rem] font-medium text-foreground text-left",children:m?.name??"Select org"}),n.jsx(es,{className:"size-3.5 text-muted-foreground shrink-0"})]}),e[14]=m?.name,e[15]=a,e[16]=I):I=e[16];let O;e[17]!==z||e[18]!==I||e[19]!==S?(O=n.jsx(ze,{asChild:!0,children:n.jsxs(U,{variant:"ghost",size:"sm",className:S,children:[z,I]})}),e[17]=z,e[18]=I,e[19]=S,e[20]=O):O=e[20];let T;e[21]!==f||e[22]!==g?(T=f&&n.jsx(Us,{user:f,userImage:g,onOpenSettings:()=>{b(!0),h(!1)}}),e[21]=f,e[22]=g,e[23]=T):T=e[23];let E;e[24]===Symbol.for("react.memo_cache_sentinel")?(E=()=>h(!1),e[24]=E):E=e[24];let L;e[25]!==N||e[26]!==C||e[27]!==l?(L=n.jsx(Fs,{currentOrgSlug:l,onOrgSelect:C,onOrgSettings:N,onPopoverClose:E}),e[25]=N,e[26]=C,e[27]=l,e[28]=L):L=e[28];let A;e[29]!==T||e[30]!==L?(A=n.jsxs($e,{align:"start",side:"bottom",className:"p-0 flex w-auto h-88 overflow-hidden",children:[T,L]}),e[29]=T,e[30]=L,e[31]=A):A=e[31];let R;e[32]!==u||e[33]!==O||e[34]!==A?(R=n.jsxs(Ie,{open:u,onOpenChange:h,children:[O,A]}),e[32]=u,e[33]=O,e[34]=A,e[35]=R):R=e[35];let P;e[36]!==x||e[37]!==f||e[38]!==g?(P=f&&x&&f.email&&n.jsx(gt,{open:x,onOpenChange:b,user:{...f,name:f.name??void 0,email:f.email},userImage:g}),e[36]=x,e[37]=f,e[38]=g,e[39]=P):P=e[39];let H;return e[40]!==R||e[41]!==P?(H=n.jsxs(n.Fragment,{children:[R,P]}),e[40]=R,e[41]=P,e[42]=H):H=e[42],H}bt.Skeleton=function(){return n.jsxs("div",{className:"flex items-center gap-1.5 h-7 px-1.5 w-full",children:[n.jsx(Q,{className:"size-5 rounded-[5px] shrink-0"}),n.jsx(Q,{className:"h-3.5 flex-1"})]})};function Se(){const t=w.c(45),{state:e,toggleSidebar:s}=ve(),a=e==="collapsed",[r,l]=je();let i;t[0]!==l?(i=()=>{l(Ks)},t[0]=l,t[1]=i):i=t[1];const o=i,c=a&&"group-hover/account-switcher:opacity-0 group-hover/account-switcher:pointer-events-none transition-opacity";let d;t[2]!==c?(d=M("w-full min-w-0",c),t[2]=c,t[3]=d):d=t[3];let m;t[4]!==a?(m=n.jsx(bt,{isCollapsed:a}),t[4]=a,t[5]=m):m=t[5];let u;t[6]!==d||t[7]!==m?(u=n.jsx("div",{className:d,children:m}),t[6]=d,t[7]=m,t[8]=u):u=t[8];const h=a?"opacity-0 group-hover/account-switcher:opacity-100 pointer-events-none group-hover/account-switcher:pointer-events-auto":"opacity-0 pointer-events-none";let x;t[9]!==h?(x=M("absolute inset-0 m-auto size-7 hover:bg-sidebar-accent transition-opacity",h),t[9]=h,t[10]=x):x=t[10];const b=!a;let f;t[11]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(at,{className:"size-4 text-muted-foreground shrink-0"}),t[11]=f):f=t[11];let g;t[12]!==x||t[13]!==b||t[14]!==s?(g=n.jsx(U,{variant:"ghost",size:"icon",className:x,onClick:s,"aria-label":"Expand sidebar",disabled:b,children:f}),t[12]=x,t[13]=b,t[14]=s,t[15]=g):g=t[15];let p;t[16]!==u||t[17]!==g?(p=n.jsxs("div",{className:"group/account-switcher relative flex items-center justify-center gap-1.5 min-w-0 flex-1 overflow-hidden",children:[u,g]}),t[16]=u,t[17]=g,t[18]=p):p=t[18];const N=a&&"hidden";let j;t[19]!==N?(j=M("flex items-center gap-0.5 shrink-0",N),t[19]=N,t[20]=j):j=t[20];let C;t[21]===Symbol.for("react.memo_cache_sentinel")?(C=n.jsx(nt,{className:"size-4 text-muted-foreground"}),t[21]=C):C=t[21];let y;t[22]!==a||t[23]!==s?(y=n.jsx(he,{asChild:!0,children:n.jsx(U,{variant:"ghost",size:"icon",className:"size-7 hover:bg-sidebar-accent",onClick:s,"aria-label":"Collapse sidebar",disabled:a,children:C})}),t[22]=a,t[23]=s,t[24]=y):y=t[24];let k;t[25]===Symbol.for("react.memo_cache_sentinel")?(k=n.jsx(ue,{side:"bottom",children:"Collapse sidebar"}),t[25]=k):k=t[25];let S;t[26]!==y?(S=n.jsxs(pe,{children:[y,k]}),t[26]=y,t[27]=S):S=t[27];const $=r&&"bg-sidebar-accent";let _;t[28]!==$?(_=M("size-7 hover:bg-sidebar-accent",$),t[28]=$,t[29]=_):_=t[29];let z;t[30]===Symbol.for("react.memo_cache_sentinel")?(z=n.jsx(Ve,{size:11,className:"text-muted-foreground"}),t[30]=z):z=t[30];let I;t[31]!==a||t[32]!==_||t[33]!==o?(I=n.jsx(he,{asChild:!0,children:n.jsx(U,{variant:"ghost",size:"icon",className:_,onClick:o,"aria-label":"Toggle Decopilot",disabled:a,children:z})}),t[31]=a,t[32]=_,t[33]=o,t[34]=I):I=t[34];let O;t[35]===Symbol.for("react.memo_cache_sentinel")?(O=n.jsx(ue,{side:"bottom",children:"Toggle Decopilot"}),t[35]=O):O=t[35];let T;t[36]!==I?(T=n.jsxs(pe,{children:[I,O]}),t[36]=I,t[37]=T):T=t[37];let E;t[38]!==j||t[39]!==S||t[40]!==T?(E=n.jsxs("div",{className:j,children:[S,T]}),t[38]=j,t[39]=S,t[40]=T,t[41]=E):E=t[41];let L;return t[42]!==p||t[43]!==E?(L=n.jsx(pt,{className:"h-12 gap-0 pt-0",children:n.jsx(Ne,{children:n.jsx(ee,{children:n.jsxs("div",{className:"flex items-center justify-between w-full h-12",children:[p,E]})})})}),t[42]=p,t[43]=E,t[44]=L):L=t[44],L}function Ks(t){return!t}Se.Skeleton=function(){return n.jsx(pt,{className:"h-12 gap-0 pt-0",children:n.jsx(Ne,{children:n.jsx(ee,{children:n.jsxs("div",{className:"flex items-center justify-between w-full h-12",children:[n.jsxs("div",{className:"flex items-center gap-1.5 min-w-0 flex-1 px-1.5",children:[n.jsx(Q,{className:"size-5 rounded-[5px] shrink-0"}),n.jsx(Q,{className:"h-3.5 w-16"})]}),n.jsxs("div",{className:"flex items-center gap-0.5",children:[n.jsx(Q,{className:"size-7 rounded-lg"}),n.jsx(Q,{className:"size-7 rounded-lg"})]})]})})})})};function Zs({invitation:t,onStatusChange:e}){const[s,a]=v.useState(!1),[r,l]=v.useState(!1),i=le(),o=async()=>{a(!0);try{const x=await K.organization.acceptInvitation({invitationId:t.id});if(x.error)Y.error(x.error.message),a(!1);else{e(t.id,"accepted");const b=await K.organization.setActive({organizationId:t.organizationId});b?.data?.slug?(Y.success("Invitation accepted!"),i({to:"/$org",params:{org:b.data.slug}})):(Y.success("Invitation accepted! Redirecting..."),i({to:"/"}))}}catch{Y.error("Failed to accept invitation"),a(!1)}},c=async()=>{l(!0);try{const x=await K.organization.rejectInvitation({invitationId:t.id});x.error?(Y.error(x.error.message),l(!1)):(Y.success("Invitation rejected"),e(t.id,"rejected"),l(!1))}catch{Y.error("Failed to reject invitation"),l(!1)}},d=t.organizationName||t.organizationId,m=t.status==="pending",u=t.status==="accepted",h=t.status==="rejected";return n.jsxs("div",{className:M("flex items-center gap-3 px-3 py-2 h-12 border-b border-border/50 last:border-b-0",!m&&"opacity-50"),children:[n.jsx("div",{className:"shrink-0 size-5 flex items-center justify-center",children:n.jsx(ct,{size:16,className:"text-muted-foreground"})}),n.jsxs("p",{className:"flex-1 text-sm text-foreground min-w-0 whitespace-nowrap overflow-hidden",children:["You have been invited to ",n.jsx("span",{className:"font-semibold inline-block max-w-[200px] truncate align-bottom",children:d})]}),n.jsx("div",{className:"flex items-center gap-1 shrink-0",children:m?n.jsxs(n.Fragment,{children:[n.jsx(U,{variant:"ghost",size:"icon",onClick:c,disabled:s||r,className:"h-8 w-8",children:n.jsx(Ae,{size:14})}),n.jsx(U,{variant:"outline",size:"icon",onClick:o,disabled:s||r,className:"h-8 w-8",children:n.jsx(ge,{size:14})})]}):u?n.jsxs(Le,{variant:"outline",className:"h-6 px-2 text-xs",children:[n.jsx(ge,{size:12}),"Accepted"]}):h?n.jsxs(Le,{variant:"outline",className:"h-6 px-2 text-xs",children:[n.jsx(Ae,{size:12}),"Declined"]}):null})]})}function Gs(){const[t,e]=v.useState(!1),s=v.useContext(zt),{data:a}=s.hooks.useListUserInvitations(),{data:r}=K.useListOrganizations(),[l,i]=v.useState({}),m=(a??[]).filter(f=>new Date(f.expiresAt)>new Date).map(f=>{const g=(r??[]).find(p=>p.id===f.organizationId);return{...f,organizationSlug:g?.slug||f.organizationSlug,organizationName:g?.name||f.organizationName}}).map(f=>({...f,status:l[f.id]||f.status})),u=[...m].sort((f,g)=>{const p={pending:0,accepted:1,rejected:2};return(p[f.status]??999)-(p[g.status]??999)}),x=m.filter(f=>f.status==="pending").length>0,b=(f,g)=>{i(p=>({...p,[f]:g}))};return n.jsx(Ms,{className:"border-t border-border pt-2",children:n.jsx(Ne,{children:n.jsx(ee,{children:n.jsxs(Ie,{open:t,onOpenChange:e,children:[n.jsx(ze,{asChild:!0,children:n.jsxs(Te,{className:"group/nav-item cursor-pointer text-foreground/90 hover:text-foreground relative",tooltip:"Inbox",children:[n.jsx("span",{className:"text-muted-foreground group-hover/nav-item:text-foreground transition-colors [&>svg]:size-4",children:n.jsx(Ee,{})}),n.jsx("span",{className:"truncate",children:"Inbox"}),x&&n.jsx("span",{className:"absolute top-1 right-1 h-2 w-2 rounded-full bg-destructive"})]})}),n.jsxs($e,{align:"end",className:"w-[480px] p-0 overflow-hidden",children:[n.jsx("div",{className:"px-4 py-3 border-b border-border",children:n.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Inbox"})}),n.jsx("div",{className:"max-h-96 overflow-auto",children:u.length>0?u.map(f=>n.jsx(Zs,{invitation:f,onStatusChange:b},f.id)):n.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[n.jsx(Ee,{size:32,className:"text-muted-foreground/40 mb-2"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"No invitations at the moment"})]})})]})]})})})})}function jt(t){const e=w.c(4),{children:s}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Es,{className:"my-2 -ml-1"}),e[0]=a):a=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(ee,{children:n.jsx("div",{className:"group-data-[collapsible=icon]:hidden px-2 py-0 text-xs font-medium h-6 text-muted-foreground flex items-center justify-between",children:n.jsx("span",{className:"whitespace-nowrap",children:"Pinned Views"})})}),e[1]=r):r=e[1];let l;return e[2]!==s?(l=n.jsxs(n.Fragment,{children:[a,r,s]}),e[2]=s,e[3]=l):l=e[3],l}function Ys(t){const e=w.c(26),{item:s}=t,a=le(),{org:r}=be(),l=_e(r.id),i=Qt(r.id);let o;e[0]!==i.update||e[1]!==s.url||e[2]!==l?.sidebar_items?(o=async()=>{const C=(l?.sidebar_items||[]).filter(y=>y.url!==s.url);await i.update.mutateAsync({sidebar_items:C})},e[0]=i.update,e[1]=s.url,e[2]=l?.sidebar_items,e[3]=o):o=e[3];const c=o;let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=/^https?:\/\/.+/,e[4]=d):d=e[4];let m;e[5]!==s.icon?(m=d.test(s.icon),e[5]=s.icon,e[6]=m):m=e[6];const u=m;let h;e[7]!==s.url||e[8]!==a?(h=()=>{a({to:s.url})},e[7]=s.url,e[8]=a,e[9]=h):h=e[9];const x=s.title;let b;e[10]!==u||e[11]!==s.icon||e[12]!==s.title?(b=n.jsx("div",{className:"flex items-center justify-center shrink-0",children:u?n.jsx("img",{src:s.icon,alt:s.title,className:"h-4 w-4 rounded object-cover"}):n.jsx(cs,{size:16,className:"text-muted-foreground group-hover/item:text-foreground transition-colors"})}),e[10]=u,e[11]=s.icon,e[12]=s.title,e[13]=b):b=e[13];let f;e[14]!==s.title?(f=s.title.toLocaleLowerCase(),e[14]=s.title,e[15]=f):f=e[15];let g;e[16]!==f?(g=n.jsx("div",{className:"flex-1 min-w-0 flex flex-col items-start",children:n.jsx("span",{className:"truncate text-sm w-full capitalize",children:f})}),e[16]=f,e[17]=g):g=e[17];let p;e[18]!==c?(p=n.jsx(xe,{size:16,className:"text-muted-foreground opacity-0 group-hover/item:opacity-50 hover:opacity-100 cursor-pointer",onClick:j=>{j.preventDefault(),j.stopPropagation(),c()}}),e[18]=c,e[19]=p):p=e[19];let N;return e[20]!==s.title||e[21]!==h||e[22]!==b||e[23]!==g||e[24]!==p?(N=n.jsx(ee,{children:n.jsxs(Te,{className:"w-full pr-2 group/item relative cursor-pointer text-foreground/90 hover:text-foreground",onClick:h,tooltip:x,children:[b,g,p]})}),e[20]=s.title,e[21]=h,e[22]=b,e[23]=g,e[24]=p,e[25]=N):N=e[25],N}function Re(){const t=w.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(ee,{children:n.jsx("div",{className:"flex items-center gap-2 px-4 py-2",children:n.jsx(Q,{className:"h-4 flex-1"})})}),t[0]=e):e=t[0],e}function qs(){const t=w.c(4),{org:e}=be(),a=_e(e.id)?.sidebar_items;if(!a?.length)return null;let r;t[0]!==a?(r=a.map(Js),t[0]=a,t[1]=r):r=t[1];let l;return t[2]!==r?(l=n.jsx(jt,{children:r}),t[2]=r,t[3]=l):l=t[3],l}function Js(t){return n.jsx(Ys,{item:t},t.url)}function Xs(){const t=w.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(v.Suspense,{fallback:n.jsxs(jt,{children:[n.jsx(Re,{}),n.jsx(Re,{})]}),children:n.jsx(qs,{})}),t[0]=e):e=t[0],e}function Qs(){const t=w.c(5),e=vs();let s,a;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(v.Suspense,{fallback:n.jsx(Se.Skeleton,{}),children:n.jsx(Se,{})}),a=n.jsx(Gs,{}),t[0]=s,t[1]=a):(s=t[0],a=t[1]);let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(Ge,{children:n.jsx(v.Suspense,{fallback:null,children:n.jsx(Xs,{})})}),t[2]=r):r=t[2];let l;return t[3]!==e?(l=n.jsx(xt,{navigationItems:e,header:s,footer:a,additionalContent:r}),t[3]=e,t[4]=l):l=t[4],l}function en(t){const e=w.c(12);let s,a,r,l;e[0]!==t?({className:s,orientation:r,decorative:l,...a}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=r,e[4]=l):(s=e[1],a=e[2],r=e[3],l=e[4]);const i=r===void 0?"horizontal":r,o=l===void 0?!0:l;let c;e[5]!==s?(c=M("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",s),e[5]=s,e[6]=c):c=e[6];let d;return e[7]!==o||e[8]!==i||e[9]!==a||e[10]!==c?(d=n.jsx($t,{"data-slot":"separator-root",decorative:o,orientation:i,className:c,...a}),e[7]=o,e[8]=i,e[9]=a,e[10]=c,e[11]=d):d=e[11],d}const vt=v.createContext(null);function tn(){const t=v.useContext(vt);if(!t)throw new Error("TopbarSwitcher compound components must be used within TopbarSwitcher.Root");return t}function sn(t){const e=w.c(10),{children:s,onItemHover:a}=t,[r,l]=v.useState(null);let i;e[0]!==a?(i=u=>{l(u),a?.(u)},e[0]=a,e[1]=i):i=e[1];const o=i;let c;e[2]!==r||e[3]!==o?(c={hoveredItem:r,setHoveredItem:o},e[2]=r,e[3]=o,e[4]=c):c=e[4];let d;e[5]!==s?(d=n.jsx(Ie,{children:s}),e[5]=s,e[6]=d):d=e[6];let m;return e[7]!==c||e[8]!==d?(m=n.jsx(vt.Provider,{value:c,children:d}),e[7]=c,e[8]=d,e[9]=m):m=e[9],m}function nn(t){const e=w.c(6),{children:s,onClick:a}=t;let r;e[0]!==s||e[1]!==a?(r=n.jsx(U,{variant:"link",className:"p-0.5 h-auto",onClick:a,type:"button",children:s}),e[0]=s,e[1]=a,e[2]=r):r=e[2];let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(ze,{asChild:!0,children:n.jsx(U,{size:"icon",variant:"ghost",className:"w-6 h-6 p-0",children:n.jsx(Jt,{size:16,className:"opacity-50"})})}),e[3]=l):l=e[3];let i;return e[4]!==r?(i=n.jsxs("div",{className:"flex items-center gap-1",children:[r,l]}),e[4]=r,e[5]=i):i=e[5],i}function an(t){const e=w.c(8),{item:s,fallback:a}=t,r=a===void 0?"":a,l=s?.avatarUrl??"",i=s?.name??r;let o;e[0]!==l||e[1]!==i?(o=n.jsx(J,{url:l,fallback:i,size:"xs",objectFit:"contain"}),e[0]=l,e[1]=i,e[2]=o):o=e[2];const c=s?.name??r;let d;e[3]!==c?(d=n.jsx("span",{children:c}),e[3]=c,e[4]=d):d=e[4];let m;return e[5]!==o||e[6]!==d?(m=n.jsxs("div",{className:"flex items-center gap-2",children:[o,d]}),e[5]=o,e[6]=d,e[7]=m):m=e[7],m}function rn(t){const e=w.c(6),{children:s,align:a}=t,r=a===void 0?"start":a,i=v.Children.toArray(s).filter(ln).length===1?"280px":"480px";let o;e[0]!==i?(o={width:i},e[0]=i,e[1]=o):o=e[1];let c;return e[2]!==r||e[3]!==s||e[4]!==o?(c=n.jsx($e,{align:r,className:"p-0 flex items-start",style:o,children:s}),e[2]=r,e[3]=s,e[4]=o,e[5]=c):c=e[5],c}function ln(t){return v.isValidElement(t)&&(t.type===wt||t.type===Nt)}function Nt(t){const e=w.c(5),{children:s,className:a}=t;let r;e[0]!==a?(r=M("flex flex-col border-border w-[240px] border-r last:border-r-0 last:w-full",a),e[0]=a,e[1]=r):r=e[1];let l;return e[2]!==s||e[3]!==r?(l=n.jsx("div",{className:r,children:s}),e[2]=s,e[3]=r,e[4]=l):l=e[4],l}const wt=Nt;function on(t){const e=w.c(6),{placeholder:s,value:a,onChange:r}=t,l=s===void 0?"Search...":s;let i;e[0]!==r?(i=c=>r(c.target.value),e[0]=r,e[1]=i):i=e[1];let o;return e[2]!==l||e[3]!==i||e[4]!==a?(o=n.jsx(ds,{placeholder:l,value:a,onChange:i,className:"rounded-none border-t-0 border-x-0 focus-visible:border-border focus-visible:ring-0"}),e[2]=l,e[3]=i,e[4]=a,e[5]=o):o=e[5],o}function cn(t){const e=w.c(6),{children:s,emptyMessage:a}=t,r=a===void 0?"No items found.":a,l=v.Children.count(s)>0;let i;e[0]!==r||e[1]!==l?(i=!l&&n.jsx("div",{className:"text-muted-foreground text-sm px-1 py-8 text-center",children:r}),e[0]=r,e[1]=l,e[2]=i):i=e[2];let o;return e[3]!==s||e[4]!==i?(o=n.jsxs("div",{className:"flex flex-col gap-0.5 p-1 max-h-44 overflow-y-auto",children:[i,s]}),e[3]=s,e[4]=i,e[5]=o):o=e[5],o}function dn(t){const e=w.c(15),{item:s,onClick:a,onHover:r,children:l}=t,i=tn();let o;e[0]!==i||e[1]!==s||e[2]!==r?(o=()=>{i.setHoveredItem(s.slug),r?.(s)},e[0]=i,e[1]=s,e[2]=r,e[3]=o):o=e[3];const c=o;let d;e[4]!==s||e[5]!==a?(d=()=>a(s),e[4]=s,e[5]=a,e[6]=d):d=e[6];let m;e[7]!==l||e[8]!==s.avatarUrl||e[9]!==s.name?(m=l||n.jsxs(n.Fragment,{children:[n.jsx(J,{url:s.avatarUrl??"",fallback:s.name,size:"xs",className:"w-[22px]! h-[22px]!",objectFit:"contain"}),n.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:s.name})]}),e[7]=l,e[8]=s.avatarUrl,e[9]=s.name,e[10]=m):m=e[10];let u;return e[11]!==c||e[12]!==d||e[13]!==m?(u=n.jsx(U,{onClick:d,onMouseEnter:c,variant:"ghost",size:"sm",className:"w-full justify-start font-normal",children:m}),e[11]=c,e[12]=d,e[13]=m,e[14]=u):u=e[14],u}function mn(t){const e=w.c(2),{children:s}=t;let a;return e[0]!==s?(a=n.jsx("div",{className:"px-1 pb-1 pt-0.5",children:s}),e[0]=s,e[1]=a):a=e[1],a}function fn(t){const e=w.c(11),{onClick:s,icon:a,children:r,variant:l}=t,o=(l===void 0?"default":l)==="muted"&&"text-muted-foreground";let c;e[0]!==o?(c=M("w-full justify-start font-normal",o),e[0]=o,e[1]=c):c=e[1];let d;e[2]!==a?(d=a&&n.jsx("span",{className:"[&>svg]:size-4",children:a}),e[2]=a,e[3]=d):d=e[3];let m;e[4]!==r?(m=n.jsx("span",{children:r}),e[4]=r,e[5]=m):m=e[5];let u;return e[6]!==s||e[7]!==c||e[8]!==d||e[9]!==m?(u=n.jsxs(U,{variant:"ghost",size:"sm",className:c,onClick:s,children:[d,m]}),e[6]=s,e[7]=c,e[8]=d,e[9]=m,e[10]=u):u=e[10],u}function un(){const t=w.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(en,{}),t[0]=e):e=t[0],e}function hn(){const t=w.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"h-4 w-16 bg-accent rounded-full animate-pulse"}),t[0]=e):e=t[0],e}const W=Object.assign(sn,{Trigger:nn,CurrentItem:an,Content:rn,Panel:wt,Search:on,Items:cn,Item:dn,Actions:mn,Action:fn,Separator:un,Skeleton:hn});function ye(){const t=w.c(59);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const{org:s}=ke(e),{data:a}=K.useListOrganizations(),r=le();let l;t[1]!==s||t[2]!==a?(l=a?.find(E=>E.slug===s),t[1]=s,t[2]=a,t[3]=l):l=t[3];const i=l,[o,c]=v.useState(""),[d,m]=v.useState(!1);let u,h,x,b,f,g,p,N;if(t[4]!==i||t[5]!==r||t[6]!==s||t[7]!==o||t[8]!==a){const L=(a?(()=>{const V=a.filter(B=>B.name.toLowerCase().includes(o.toLowerCase()));if(s){const B=V.findIndex(Z=>Z.slug===s);if(B>0){const Z=V[B];Z&&(V.splice(B,1),V.unshift(Z))}}return V})():[]).map(pn);let A;t[17]!==i?(A=i?{slug:i.slug,name:i.name,avatarUrl:i.logo}:void 0,t[17]=i,t[18]=A):A=t[18];const R=A;b=W;let P;t[19]!==r||t[20]!==s?(P=()=>r({to:"/$org",params:{org:s??""}}),t[19]=r,t[20]=s,t[21]=P):P=t[21];let H;t[22]!==R?(H=n.jsx(W.CurrentItem,{item:R}),t[22]=R,t[23]=H):H=t[23],t[24]!==P||t[25]!==H?(N=n.jsx(W.Trigger,{onClick:P,children:H}),t[24]=P,t[25]=H,t[26]=N):N=t[26],x=W.Content,h=W.Panel,t[27]!==o?(p=n.jsx(W.Search,{placeholder:"Search organizations...",value:o,onChange:c}),t[27]=o,t[28]=p):p=t[28],u=W.Items,f="No organizations found.";let D;t[29]!==r?(D=V=>n.jsx(W.Item,{item:V,onClick:B=>r({to:"/$org",params:{org:B.slug}})},V.slug),t[29]=r,t[30]=D):D=t[30],g=L.map(D),t[4]=i,t[5]=r,t[6]=s,t[7]=o,t[8]=a,t[9]=u,t[10]=h,t[11]=x,t[12]=b,t[13]=f,t[14]=g,t[15]=p,t[16]=N}else u=t[9],h=t[10],x=t[11],b=t[12],f=t[13],g=t[14],p=t[15],N=t[16];let j;t[31]!==u||t[32]!==f||t[33]!==g?(j=n.jsx(u,{emptyMessage:f,children:g}),t[31]=u,t[32]=f,t[33]=g,t[34]=j):j=t[34];let C,y;t[35]===Symbol.for("react.memo_cache_sentinel")?(C=n.jsx(W.Actions,{children:n.jsx(W.Action,{onClick:()=>m(!0),variant:"muted",children:"+ Create organization"})}),y=n.jsx(W.Separator,{}),t[35]=C,t[36]=y):(C=t[35],y=t[36]);let k;t[37]!==r?(k=()=>r({to:"/"}),t[37]=r,t[38]=k):k=t[38];let S;t[39]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx(ms,{}),t[39]=S):S=t[39];let $;t[40]!==k?($=n.jsx(W.Actions,{children:n.jsx(W.Action,{onClick:k,icon:S,children:"See all organizations"})}),t[40]=k,t[41]=$):$=t[41];let _;t[42]!==h||t[43]!==$||t[44]!==p||t[45]!==j?(_=n.jsxs(h,{children:[p,j,C,y,$]}),t[42]=h,t[43]=$,t[44]=p,t[45]=j,t[46]=_):_=t[46];let z;t[47]!==x||t[48]!==_?(z=n.jsx(x,{children:_}),t[47]=x,t[48]=_,t[49]=z):z=t[49];let I;t[50]!==b||t[51]!==z||t[52]!==N?(I=n.jsxs(b,{children:[N,z]}),t[50]=b,t[51]=z,t[52]=N,t[53]=I):I=t[53];let O;t[54]!==d?(O=n.jsx(Ye,{open:d,onOpenChange:m}),t[54]=d,t[55]=O):O=t[55];let T;return t[56]!==I||t[57]!==O?(T=n.jsxs(n.Fragment,{children:[I,O]}),t[56]=I,t[57]=O,t[58]=T):T=t[58],T}function pn(t){return{slug:t.slug,name:t.name,avatarUrl:t.logo}}ye.Skeleton=W.Skeleton;function xn({prop:t,defaultProp:e,onChange:s=()=>{}}){const[a,r]=gn({defaultProp:e,onChange:s}),l=t!==void 0,i=l?t:a,o=Ue(s),c=v.useCallback(d=>{if(l){const u=typeof d=="function"?d(t):d;u!==t&&o(u)}else r(d)},[l,t,r,o]);return[i,c]}function gn({defaultProp:t,onChange:e}){const s=v.useState(t),[a]=s,r=v.useRef(a),l=Ue(e);return v.useEffect(()=>{r.current!==a&&(l(a),r.current=a)},[a,r,l]),s}function bn(t){const e=w.c(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=n.jsx(re.Root,{"data-slot":"drawer",...s}),e[2]=s,e[3]=a):a=e[3],a}function jn(t){const e=w.c(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=n.jsx(re.Trigger,{"data-slot":"drawer-trigger",...s}),e[2]=s,e[3]=a):a=e[3],a}function vn(t){const e=w.c(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=n.jsx(re.Portal,{"data-slot":"drawer-portal",...s}),e[2]=s,e[3]=a):a=e[3],a}function Nn(t){const e=w.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let r;e[3]!==s?(r=M("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",s),e[3]=s,e[4]=r):r=e[4];let l;return e[5]!==a||e[6]!==r?(l=n.jsx(re.Overlay,{"data-slot":"drawer-overlay",className:r,...a}),e[5]=a,e[6]=r,e[7]=l):l=e[7],l}function wn(t){const e=w.c(12);let s,a,r;e[0]!==t?({className:a,children:s,...r}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=r):(s=e[1],a=e[2],r=e[3]);let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(Nn,{}),e[4]=l):l=e[4];let i;e[5]!==a?(i=M("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",a),e[5]=a,e[6]=i):i=e[6];let o;e[7]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),e[7]=o):o=e[7];let c;return e[8]!==s||e[9]!==r||e[10]!==i?(c=n.jsxs(vn,{"data-slot":"drawer-portal",children:[l,n.jsxs(re.Content,{"data-slot":"drawer-content",className:i,...r,children:[o,s]})]}),e[8]=s,e[9]=r,e[10]=i,e[11]=c):c=e[11],c}function Sn(t){const e=w.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let r;e[3]!==s?(r=M("flex flex-col gap-1.5 px-4 py-2",s),e[3]=s,e[4]=r):r=e[4];let l;return e[5]!==a||e[6]!==r?(l=n.jsx("div",{"data-slot":"drawer-header",className:r,...a}),e[5]=a,e[6]=r,e[7]=l):l=e[7],l}function yn(t){const e=w.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let r;e[3]!==s?(r=M("text-foreground font-semibold",s),e[3]=s,e[4]=r):r=e[4];let l;return e[5]!==a||e[6]!==r?(l=n.jsx(re.Title,{"data-slot":"drawer-title",className:r,...a}),e[5]=a,e[6]=r,e[7]=l):l=e[7],l}const St=v.createContext({setOpen:()=>{}}),Cn=()=>v.useContext(St),kn=t=>{const e=w.c(25);let s,a,r,l,i;e[0]!==t?({children:s,defaultOpen:a,open:l,onOpenChange:r,...i}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=r,e[4]=l,e[5]=i):(s=e[1],a=e[2],r=e[3],l=e[4],i=e[5]);const o=a??!1;let c;e[6]!==r||e[7]!==l||e[8]!==o?(c={prop:l,defaultProp:o,onChange:r},e[6]=r,e[7]=l,e[8]=o,e[9]=c):c=e[9];const[d,m]=xn(c);let u;e[10]!==m?(u={setOpen:m},e[10]=m,e[11]=u):u=e[11];let h;e[12]!==s||e[13]!==d||e[14]!==i||e[15]!==m?(h=n.jsx(bn,{open:d,onOpenChange:m,...i,children:s}),e[12]=s,e[13]=d,e[14]=i,e[15]=m,e[16]=h):h=e[16];let x;e[17]!==d||e[18]!==i||e[19]!==m||e[20]!==h?(x=n.jsx(hs,{open:d,onOpenChange:m,...i,children:h}),e[17]=d,e[18]=i,e[19]=m,e[20]=h,e[21]=x):x=e[21];let b;return e[22]!==u||e[23]!==x?(b=n.jsx(St.Provider,{value:u,children:x}),e[22]=u,e[23]=x,e[24]=b):b=e[24],b},_n=t=>{const{children:e,title:s,...a}=t,r=ie(),{className:l,...i}=a;return r?n.jsxs(wn,{...i,children:[n.jsx(Sn,{className:"hidden",children:n.jsx(yn,{children:s})}),n.jsx("div",{className:M("flex flex-col gap-2 p-2 py-4",l),children:e})]}):n.jsx(us,{...a,children:e})},zn=t=>{const{children:e,...s}=t,{setOpen:a}=Cn(),r=ie(),{className:l,...i}=s;return r?n.jsx("div",{...i,onClick:o=>{a(!1);const{onClick:c}=i;c?.(o)},className:M("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",l),children:e}):n.jsx(ps,{...s,children:e})},$n=t=>{const e=w.c(7);let s,a;e[0]!==t?({children:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);const r=ie();let l;return e[3]!==s||e[4]!==r||e[5]!==a?(l=r?n.jsx(jn,{asChild:!0,children:s}):n.jsx(fs,{...a,children:s}),e[3]=s,e[4]=r,e[5]=a,e[6]=l):l=e[6],l},In=t=>{const e=w.c(7);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);const r=ie();let l;return e[3]!==s||e[4]!==r||e[5]!==a?(l=r?n.jsx(Pe,{className:M(s),...a}):n.jsx(Pe,{className:M(s),...a}),e[3]=s,e[4]=r,e[5]=a,e[6]=l):l=e[6],l};function On(t){const e=w.c(11),{user:s,trigger:a,align:r,children:l}=t,i=r===void 0?"start":r;let o;e[0]!==a||e[1]!==s?(o=a(s),e[0]=a,e[1]=s,e[2]=o):o=e[2];let c;e[3]!==o?(c=n.jsx($n,{asChild:!0,children:n.jsx("div",{children:o})}),e[3]=o,e[4]=c):c=e[4];let d;e[5]!==i||e[6]!==l?(d=n.jsx(_n,{side:"top",align:i,className:"md:w-[240px]",children:l}),e[5]=i,e[6]=l,e[7]=d):d=e[7];let m;return e[8]!==c||e[9]!==d?(m=n.jsxs(kn,{children:[c,d]}),e[8]=c,e[9]=d,e[10]=m):m=e[10],m}function Tn(t){const e=w.c(8),{children:s,onClick:a,className:r,asChild:l}=t;let i;e[0]!==l||e[1]!==s||e[2]!==a?(i=l?s:n.jsx("button",{type:"button",className:"flex items-center gap-2 text-sm w-full cursor-pointer",onClick:a,children:s}),e[0]=l,e[1]=s,e[2]=a,e[3]=i):i=e[3];let o;return e[4]!==l||e[5]!==r||e[6]!==i?(o=n.jsx(zn,{asChild:l,className:r,children:i}),e[4]=l,e[5]=r,e[6]=i,e[7]=o):o=e[7],o}function Mn(t){const e=w.c(2),{className:s}=t;let a;return e[0]!==s?(a=n.jsx(In,{className:s}),e[0]=s,e[1]=a):a=e[1],a}function En(){const t=w.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"w-8 h-8 bg-muted rounded-full animate-pulse"}),t[0]=e):e=t[0],e}const q=Object.assign(On,{Item:Tn,Separator:Mn,Skeleton:En});function Ln(t){const e=w.c(47),{user:s,userImage:a}=t,[r,l]=v.useState(!1),[i,o]=v.useState(!1);let c;e[0]!==s.email||e[1]!==s.id||e[2]!==s.name?(c=()=>{const A=`ID: ${s.id}
3
+ Email: ${s.email}`;try{await navigator.clipboard.writeText(y),Y.success("User info copied to clipboard")}catch{Y.error("Failed to copy user info to clipboard")}},e[0]=s,e[1]=l):l=e[1];const i=l,o=s.name||s.email||"U";let c;e[2]!==o||e[3]!==a?(c=n.jsx(J,{url:a,fallback:o,shape:"circle",size:"sm",className:"size-8 shrink-0"}),e[2]=o,e[3]=a,e[4]=c):c=e[4];const d=s.name||"User";let m;e[5]!==d?(m=n.jsx("span",{className:"text-sm text-sidebar-foreground truncate font-[450]",children:d}),e[5]=d,e[6]=m):m=e[6];let u;e[7]!==s.email?(u=n.jsx("span",{className:"text-xs text-muted-foreground truncate font-normal",children:s.email}),e[7]=s.email,e[8]=u):u=e[8];let h;e[9]!==m||e[10]!==u?(h=n.jsxs("div",{className:"flex flex-col min-w-0 text-left",children:[m,u]}),e[9]=m,e[10]=u,e[11]=h):h=e[11];let x;e[12]!==i||e[13]!==c||e[14]!==h?(x=n.jsxs(U,{variant:"ghost",onClick:i,className:"h-auto p-2 m-1 mb-0 justify-start gap-2 hover:bg-sidebar-accent hover:text-inherit active:bg-sidebar-accent/75",children:[c,h]}),e[12]=i,e[13]=c,e[14]=h,e[15]=x):x=e[15];let b;e[16]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx(mt,{size:18}),e[16]=b):b=e[16];let f;e[17]!==r?(f=n.jsxs(me,{onClick:r,children:[b,"Preferences"]}),e[17]=r,e[18]=f):f=e[18];let g;e[19]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(me,{asChild:!0,children:n.jsxs("a",{href:"https://www.decocms.com/terms-of-use",target:"_blank",rel:"noopener noreferrer",children:[n.jsx(tt,{size:18}),n.jsx("span",{className:"flex-1",children:"Terms & Conditions"}),n.jsx(we,{size:14})]})}),e[19]=g):g=e[19];let p;e[20]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx(me,{asChild:!0,children:n.jsxs("a",{href:"https://github.com/decocms/mesh",target:"_blank",rel:"noopener noreferrer",children:[n.jsx(He,{className:"size-[18px]"}),n.jsx("span",{className:"flex-1",children:"decocms/mesh"}),n.jsx(we,{size:14})]})}),e[20]=p):p=e[20];let N;e[21]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsxs(me,{onClick:Bs,children:[n.jsx(ot,{size:18}),"Log out"]}),e[21]=N):N=e[21];let j;e[22]!==f?(j=n.jsxs("div",{className:"p-1 flex flex-col",children:[f,g,p,N]}),e[22]=f,e[23]=j):j=e[23];let C;return e[24]!==j||e[25]!==x?(C=n.jsx(n.Fragment,{children:n.jsxs("div",{className:"flex flex-col gap-0.5 bg-sidebar min-w-[250px]",children:[x,j]})}),e[24]=j,e[25]=x,e[26]=C):C=e[26],C}function Bs(){return K.signOut()}function Ws(t){const e=w.c(22),{org:s,isActive:a,onClick:r,onSettings:l}=t,[i,o]=v.useState(!1),c=a||i,d=a&&"bg-accent hover:bg-accent";let m;e[0]!==d?(m=M("flex items-center gap-2 w-full justify-start font-normal h-10 px-2 rounded-lg cursor-pointer transition-colors hover:bg-accent/50",d),e[0]=d,e[1]=m):m=e[1];let u;e[2]!==r?(u=j=>{(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),r?.())},e[2]=r,e[3]=u):u=e[3];let h,x;e[4]===Symbol.for("react.memo_cache_sentinel")?(h=()=>o(!0),x=()=>o(!1),e[4]=h,e[5]=x):(h=e[4],x=e[5]);const b=s.logo??void 0;let f;e[6]!==s.name||e[7]!==b?(f=n.jsx(J,{url:b,fallback:s.name,size:"sm",className:"size-6 shrink-0 rounded-md",objectFit:"cover"}),e[6]=s.name,e[7]=b,e[8]=f):f=e[8];let g;e[9]!==s.name?(g=n.jsx("span",{className:"flex-1 text-sm text-foreground truncate text-left min-w-0",children:s.name}),e[9]=s.name,e[10]=g):g=e[10];let p;e[11]!==l||e[12]!==s.name||e[13]!==c?(p=l&&c?n.jsx("button",{type:"button","aria-label":`${s.name} settings`,className:"size-5 shrink-0 flex items-center justify-center rounded-md transition-colors hover:bg-foreground/10",onClick:j=>{j.stopPropagation(),l()},children:n.jsx(dt,{size:16,className:"text-muted-foreground"})}):n.jsx("span",{className:"size-5 shrink-0","aria-hidden":"true"}),e[11]=l,e[12]=s.name,e[13]=c,e[14]=p):p=e[14];let N;return e[15]!==r||e[16]!==m||e[17]!==u||e[18]!==f||e[19]!==g||e[20]!==p?(N=n.jsxs("div",{role:"button",tabIndex:0,className:m,onClick:r,onKeyDown:u,onMouseEnter:h,onMouseLeave:x,children:[f,g,p]}),e[15]=r,e[16]=m,e[17]=u,e[18]=f,e[19]=g,e[20]=p,e[21]=N):N=e[21],N}function Fs(t){const e=w.c(33),{currentOrgSlug:s,onOrgSelect:a,onOrgSettings:r,onPopoverClose:l}=t,{data:i}=K.useListOrganizations(),[o,c]=v.useState(!1);let d,m,u,h;if(e[0]!==s||e[1]!==a||e[2]!==r||e[3]!==l||e[4]!==i){let p;e[9]!==s?(p=(S,$)=>S.slug===s?-1:$.slug===s?1:S.name.localeCompare($.name),e[9]=s,e[10]=p):p=e[10];const N=[...i??[]].sort(p);u="flex flex-col min-w-[275px] border-l border-border";let j;e[11]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx("span",{className:"text-xs text-muted-foreground truncate",children:"Your Organizations"}),e[11]=j):j=e[11];let C;e[12]!==l?(C=()=>{l(),c(!0)},e[12]=l,e[13]=C):C=e[13];let y;e[14]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(Ke,{size:16,className:"text-muted-foreground"}),e[14]=y):y=e[14],e[15]!==C?(h=n.jsxs("div",{className:"flex items-center justify-between h-10 px-3 border-b border-border",children:[j,n.jsx(U,{variant:"ghost",size:"icon",className:"size-5",onClick:C,children:y})]}),e[15]=C,e[16]=h):h=e[16],d="flex flex-col gap-0.5 p-1 flex-1 overflow-y-auto";let k;e[17]!==s||e[18]!==a||e[19]!==r?(k=S=>n.jsx(Ws,{org:S,isActive:S.slug===s,onClick:()=>a(S.slug),onSettings:()=>r(S.slug)},S.slug),e[17]=s,e[18]=a,e[19]=r,e[20]=k):k=e[20],m=N.map(k),e[0]=s,e[1]=a,e[2]=r,e[3]=l,e[4]=i,e[5]=d,e[6]=m,e[7]=u,e[8]=h}else d=e[5],m=e[6],u=e[7],h=e[8];let x;e[21]!==d||e[22]!==m?(x=n.jsx("div",{className:d,children:m}),e[21]=d,e[22]=m,e[23]=x):x=e[23];let b;e[24]!==u||e[25]!==h||e[26]!==x?(b=n.jsxs("div",{className:u,children:[h,x]}),e[24]=u,e[25]=h,e[26]=x,e[27]=b):b=e[27];let f;e[28]!==o?(f=n.jsx(Ye,{open:o,onOpenChange:c}),e[28]=o,e[29]=f):f=e[29];let g;return e[30]!==b||e[31]!==f?(g=n.jsxs(n.Fragment,{children:[b,f]}),e[30]=b,e[31]=f,e[32]=g):g=e[32],g}function gt(t){const e=w.c(48),{open:s,onOpenChange:a,user:r,userImage:l}=t,[i,o]=Dt(),[c,d]=v.useState(!1);let m;e[0]!==r.id?(m=()=>{navigator.clipboard.writeText(r.id),d(!0),setTimeout(()=>d(!1),2e3)},e[0]=r.id,e[1]=m):m=e[1];const u=m;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx(ts,{className:"text-base",children:"Profile Settings"}),e[2]=h):h=e[2];let x;e[3]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsxs(ss,{className:"px-6 pt-6 pb-4 border-b border-border shrink-0 relative",children:[h,n.jsxs(ns,{className:"absolute top-1/2 right-4 -translate-y-1/2 cursor-pointer rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2",children:[n.jsx(xe,{size:16}),n.jsx("span",{className:"sr-only",children:"Close"})]})]}),e[3]=x):x=e[3];const b=r.name||"U";let f;e[4]!==b||e[5]!==l?(f=n.jsx(J,{url:l,fallback:b,shape:"circle",size:"xl",className:"h-16 w-16"}),e[4]=b,e[5]=l,e[6]=f):f=e[6];const g=r.name||"User";let p;e[7]!==g?(p=n.jsx("span",{className:"text-base font-medium text-foreground",children:g}),e[7]=g,e[8]=p):p=e[8];let N;e[9]!==r.email?(N=n.jsx("span",{className:"text-sm text-muted-foreground",children:r.email}),e[9]=r.email,e[10]=N):N=e[10];let j;e[11]!==p||e[12]!==N?(j=n.jsxs("div",{className:"flex flex-col gap-1",children:[p,N]}),e[11]=p,e[12]=N,e[13]=j):j=e[13];let C;e[14]!==f||e[15]!==j?(C=n.jsxs("div",{className:"flex items-center gap-4",children:[f,j]}),e[14]=f,e[15]=j,e[16]=C):C=e[16];let y;e[17]!==i||e[18]!==o?(y=()=>o(!i),e[17]=i,e[18]=o,e[19]=y):y=e[19];let k;e[20]===Symbol.for("react.memo_cache_sentinel")?(k=n.jsxs("div",{className:"flex flex-col gap-1 flex-1 min-w-0",children:[n.jsxs(ls,{className:"text-sm font-medium text-foreground flex items-center gap-2 pointer-events-none",children:[n.jsx(os,{size:16,className:"text-muted-foreground"}),"Developer Mode"]}),n.jsx("p",{className:"text-xs text-muted-foreground pointer-events-none",children:"Show technical details like JSON input/output for tool calls"})]}),e[20]=k):k=e[20];let S;e[21]!==i||e[22]!==o?(S=n.jsx("div",{onClick:Vs,children:n.jsx(is,{checked:i,onCheckedChange:o})}),e[21]=i,e[22]=o,e[23]=S):S=e[23];let $;e[24]!==y||e[25]!==S?($=n.jsxs("button",{type:"button",onClick:y,className:"flex items-center justify-between gap-4 p-4 rounded-lg border border-border hover:bg-accent/50 transition-colors text-left w-full cursor-pointer",children:[k,S]}),e[24]=y,e[25]=S,e[26]=$):$=e[26];let _;e[27]!==C||e[28]!==$?(_=n.jsxs("div",{className:"p-5 space-y-6 min-h-[225px]",children:[C,$]}),e[27]=C,e[28]=$,e[29]=_):_=e[29];let z;e[30]!==r.id?(z=n.jsx("span",{className:"font-mono text-xs",children:r.id}),e[30]=r.id,e[31]=z):z=e[31];let I;e[32]!==c?(I=c?n.jsx(ge,{size:14,className:"text-green-600"}):n.jsx(qe,{size:14,className:"opacity-0 group-hover:opacity-100 transition-opacity"}),e[32]=c,e[33]=I):I=e[33];let O;e[34]!==u||e[35]!==z||e[36]!==I?(O=n.jsx(he,{asChild:!0,children:n.jsxs("button",{type:"button",onClick:u,className:"group flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[z,I]})}),e[34]=u,e[35]=z,e[36]=I,e[37]=O):O=e[37];let T;e[38]===Symbol.for("react.memo_cache_sentinel")?(T=n.jsx(ue,{side:"top",children:n.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[38]=T):T=e[38];let E;e[39]!==O?(E=n.jsx("div",{className:"border-t border-border px-5 py-4 flex items-center shrink-0",children:n.jsx(Fe,{children:n.jsxs(pe,{children:[O,T]})})}),e[39]=O,e[40]=E):E=e[40];let L;e[41]!==_||e[42]!==E?(L=n.jsxs(as,{className:"sm:max-w-lg sm:max-h-[85vh] p-0 flex flex-col",closeButtonClassName:"hidden",children:[x,n.jsxs("div",{className:"flex flex-col",children:[_,E]})]}),e[41]=_,e[42]=E,e[43]=L):L=e[43];let A;return e[44]!==a||e[45]!==s||e[46]!==L?(A=n.jsx(rs,{open:s,onOpenChange:a,children:L}),e[44]=a,e[45]=s,e[46]=L,e[47]=A):A=e[47],A}function Vs(t){return t.stopPropagation()}function bt(t){const e=w.c(43),{isCollapsed:s}=t,a=s===void 0?!1:s;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},e[0]=r):r=e[0];const{org:l}=ke(r),{data:i}=K.useListOrganizations(),{data:o}=K.useSession(),c=le();let d;e[1]!==l||e[2]!==i?(d=i?.find(D=>D.slug===l),e[1]=l,e[2]=i,e[3]=d):d=e[3];const m=d,[u,h]=v.useState(!1),[x,b]=v.useState(!1),f=o?.user,g=f?.image;let p;e[4]!==c?(p=D=>{h(!1),c({to:"/$org/settings",params:{org:D}})},e[4]=c,e[5]=p):p=e[5];const N=p;let j;e[6]!==c?(j=D=>{h(!1),c({to:"/$org",params:{org:D}})},e[6]=c,e[7]=j):j=e[7];const C=j,y=a?"justify-center":"justify-start",k=a?"":"pl-0.5! px-1.5 gap-1.5";let S;e[8]!==y||e[9]!==k?(S=M("h-7 min-w-0 max-w-full hover:bg-sidebar-accent",y,k),e[8]=y,e[9]=k,e[10]=S):S=e[10];const $=m?.logo??"",_=m?.name??"";let z;e[11]!==_||e[12]!==$?(z=n.jsx(J,{url:$,fallback:_,size:"xs",className:"shrink-0 rounded-[5px]",objectFit:"cover"}),e[11]=_,e[12]=$,e[13]=z):z=e[13];let I;e[14]!==m?.name||e[15]!==a?(I=!a&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"truncate text-[14px] tracking-[-0.00625rem] font-medium text-foreground text-left",children:m?.name??"Select org"}),n.jsx(es,{className:"size-3.5 text-muted-foreground shrink-0"})]}),e[14]=m?.name,e[15]=a,e[16]=I):I=e[16];let O;e[17]!==z||e[18]!==I||e[19]!==S?(O=n.jsx(ze,{asChild:!0,children:n.jsxs(U,{variant:"ghost",size:"sm",className:S,children:[z,I]})}),e[17]=z,e[18]=I,e[19]=S,e[20]=O):O=e[20];let T;e[21]!==f||e[22]!==g?(T=f&&n.jsx(Us,{user:f,userImage:g,onOpenSettings:()=>{b(!0),h(!1)}}),e[21]=f,e[22]=g,e[23]=T):T=e[23];let E;e[24]===Symbol.for("react.memo_cache_sentinel")?(E=()=>h(!1),e[24]=E):E=e[24];let L;e[25]!==N||e[26]!==C||e[27]!==l?(L=n.jsx(Fs,{currentOrgSlug:l,onOrgSelect:C,onOrgSettings:N,onPopoverClose:E}),e[25]=N,e[26]=C,e[27]=l,e[28]=L):L=e[28];let A;e[29]!==T||e[30]!==L?(A=n.jsxs($e,{align:"start",side:"bottom",className:"p-0 flex w-auto h-88 overflow-hidden",children:[T,L]}),e[29]=T,e[30]=L,e[31]=A):A=e[31];let R;e[32]!==u||e[33]!==O||e[34]!==A?(R=n.jsxs(Ie,{open:u,onOpenChange:h,children:[O,A]}),e[32]=u,e[33]=O,e[34]=A,e[35]=R):R=e[35];let P;e[36]!==x||e[37]!==f||e[38]!==g?(P=f&&x&&f.email&&n.jsx(gt,{open:x,onOpenChange:b,user:{...f,name:f.name??void 0,email:f.email},userImage:g}),e[36]=x,e[37]=f,e[38]=g,e[39]=P):P=e[39];let H;return e[40]!==R||e[41]!==P?(H=n.jsxs(n.Fragment,{children:[R,P]}),e[40]=R,e[41]=P,e[42]=H):H=e[42],H}bt.Skeleton=function(){return n.jsxs("div",{className:"flex items-center gap-1.5 h-7 px-1.5 w-full",children:[n.jsx(Q,{className:"size-5 rounded-[5px] shrink-0"}),n.jsx(Q,{className:"h-3.5 flex-1"})]})};function Se(){const t=w.c(45),{state:e,toggleSidebar:s}=ve(),a=e==="collapsed",[r,l]=je();let i;t[0]!==l?(i=()=>{l(Ks)},t[0]=l,t[1]=i):i=t[1];const o=i,c=a&&"group-hover/account-switcher:opacity-0 group-hover/account-switcher:pointer-events-none group-hover/account-switcher:invisible";let d;t[2]!==c?(d=M("w-full min-w-0 transition-opacity",c),t[2]=c,t[3]=d):d=t[3];let m;t[4]!==a?(m=n.jsx(bt,{isCollapsed:a}),t[4]=a,t[5]=m):m=t[5];let u;t[6]!==d||t[7]!==m?(u=n.jsx("div",{className:d,children:m}),t[6]=d,t[7]=m,t[8]=u):u=t[8];const h=a?"opacity-0 invisible pointer-events-none group-hover/account-switcher:opacity-100 group-hover/account-switcher:visible group-hover/account-switcher:pointer-events-auto":"opacity-0 invisible pointer-events-none";let x;t[9]!==h?(x=M("absolute inset-0 m-auto size-7 hover:bg-sidebar-accent transition-opacity",h),t[9]=h,t[10]=x):x=t[10];const b=!a;let f;t[11]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(at,{className:"size-4 text-muted-foreground shrink-0"}),t[11]=f):f=t[11];let g;t[12]!==x||t[13]!==b||t[14]!==s?(g=n.jsx(U,{variant:"ghost",size:"icon",className:x,onClick:s,"aria-label":"Expand sidebar",disabled:b,children:f}),t[12]=x,t[13]=b,t[14]=s,t[15]=g):g=t[15];let p;t[16]!==u||t[17]!==g?(p=n.jsxs("div",{className:"group/account-switcher relative flex items-center justify-center gap-1.5 min-w-0 flex-1 overflow-hidden",children:[u,g]}),t[16]=u,t[17]=g,t[18]=p):p=t[18];const N=a&&"hidden";let j;t[19]!==N?(j=M("flex items-center gap-0.5 shrink-0",N),t[19]=N,t[20]=j):j=t[20];let C;t[21]===Symbol.for("react.memo_cache_sentinel")?(C=n.jsx(nt,{className:"size-4 text-muted-foreground"}),t[21]=C):C=t[21];let y;t[22]!==a||t[23]!==s?(y=n.jsx(he,{asChild:!0,children:n.jsx(U,{variant:"ghost",size:"icon",className:"size-7 hover:bg-sidebar-accent",onClick:s,"aria-label":"Collapse sidebar",disabled:a,children:C})}),t[22]=a,t[23]=s,t[24]=y):y=t[24];let k;t[25]===Symbol.for("react.memo_cache_sentinel")?(k=n.jsx(ue,{side:"bottom",children:"Collapse sidebar"}),t[25]=k):k=t[25];let S;t[26]!==y?(S=n.jsxs(pe,{children:[y,k]}),t[26]=y,t[27]=S):S=t[27];const $=r&&"bg-sidebar-accent";let _;t[28]!==$?(_=M("size-7 hover:bg-sidebar-accent",$),t[28]=$,t[29]=_):_=t[29];let z;t[30]===Symbol.for("react.memo_cache_sentinel")?(z=n.jsx(Ve,{size:11,className:"text-muted-foreground"}),t[30]=z):z=t[30];let I;t[31]!==a||t[32]!==_||t[33]!==o?(I=n.jsx(he,{asChild:!0,children:n.jsx(U,{variant:"ghost",size:"icon",className:_,onClick:o,"aria-label":"Toggle Decopilot",disabled:a,children:z})}),t[31]=a,t[32]=_,t[33]=o,t[34]=I):I=t[34];let O;t[35]===Symbol.for("react.memo_cache_sentinel")?(O=n.jsx(ue,{side:"bottom",children:"Toggle Decopilot"}),t[35]=O):O=t[35];let T;t[36]!==I?(T=n.jsxs(pe,{children:[I,O]}),t[36]=I,t[37]=T):T=t[37];let E;t[38]!==j||t[39]!==S||t[40]!==T?(E=n.jsxs("div",{className:j,children:[S,T]}),t[38]=j,t[39]=S,t[40]=T,t[41]=E):E=t[41];let L;return t[42]!==p||t[43]!==E?(L=n.jsx(pt,{className:"h-12 gap-0 pt-0",children:n.jsx(Ne,{children:n.jsx(ee,{children:n.jsxs("div",{className:"flex items-center justify-between w-full h-12",children:[p,E]})})})}),t[42]=p,t[43]=E,t[44]=L):L=t[44],L}function Ks(t){return!t}Se.Skeleton=function(){return n.jsx(pt,{className:"h-12 gap-0 pt-0",children:n.jsx(Ne,{children:n.jsx(ee,{children:n.jsxs("div",{className:"flex items-center justify-between w-full h-12",children:[n.jsxs("div",{className:"flex items-center gap-1.5 min-w-0 flex-1 px-1.5",children:[n.jsx(Q,{className:"size-5 rounded-[5px] shrink-0"}),n.jsx(Q,{className:"h-3.5 w-16"})]}),n.jsxs("div",{className:"flex items-center gap-0.5",children:[n.jsx(Q,{className:"size-7 rounded-lg"}),n.jsx(Q,{className:"size-7 rounded-lg"})]})]})})})})};function Zs({invitation:t,onStatusChange:e}){const[s,a]=v.useState(!1),[r,l]=v.useState(!1),i=le(),o=async()=>{a(!0);try{const x=await K.organization.acceptInvitation({invitationId:t.id});if(x.error)Y.error(x.error.message),a(!1);else{e(t.id,"accepted");const b=await K.organization.setActive({organizationId:t.organizationId});b?.data?.slug?(Y.success("Invitation accepted!"),i({to:"/$org",params:{org:b.data.slug}})):(Y.success("Invitation accepted! Redirecting..."),i({to:"/"}))}}catch{Y.error("Failed to accept invitation"),a(!1)}},c=async()=>{l(!0);try{const x=await K.organization.rejectInvitation({invitationId:t.id});x.error?(Y.error(x.error.message),l(!1)):(Y.success("Invitation rejected"),e(t.id,"rejected"),l(!1))}catch{Y.error("Failed to reject invitation"),l(!1)}},d=t.organizationName||t.organizationId,m=t.status==="pending",u=t.status==="accepted",h=t.status==="rejected";return n.jsxs("div",{className:M("flex items-center gap-3 px-3 py-2 h-12 border-b border-border/50 last:border-b-0",!m&&"opacity-50"),children:[n.jsx("div",{className:"shrink-0 size-5 flex items-center justify-center",children:n.jsx(ct,{size:16,className:"text-muted-foreground"})}),n.jsxs("p",{className:"flex-1 text-sm text-foreground min-w-0 whitespace-nowrap overflow-hidden",children:["You have been invited to ",n.jsx("span",{className:"font-semibold inline-block max-w-[200px] truncate align-bottom",children:d})]}),n.jsx("div",{className:"flex items-center gap-1 shrink-0",children:m?n.jsxs(n.Fragment,{children:[n.jsx(U,{variant:"ghost",size:"icon",onClick:c,disabled:s||r,className:"h-8 w-8",children:n.jsx(Ae,{size:14})}),n.jsx(U,{variant:"outline",size:"icon",onClick:o,disabled:s||r,className:"h-8 w-8",children:n.jsx(ge,{size:14})})]}):u?n.jsxs(Le,{variant:"outline",className:"h-6 px-2 text-xs",children:[n.jsx(ge,{size:12}),"Accepted"]}):h?n.jsxs(Le,{variant:"outline",className:"h-6 px-2 text-xs",children:[n.jsx(Ae,{size:12}),"Declined"]}):null})]})}function Gs(){const[t,e]=v.useState(!1),s=v.useContext(zt),{data:a}=s.hooks.useListUserInvitations(),{data:r}=K.useListOrganizations(),[l,i]=v.useState({}),m=(a??[]).filter(f=>new Date(f.expiresAt)>new Date).map(f=>{const g=(r??[]).find(p=>p.id===f.organizationId);return{...f,organizationSlug:g?.slug||f.organizationSlug,organizationName:g?.name||f.organizationName}}).map(f=>({...f,status:l[f.id]||f.status})),u=[...m].sort((f,g)=>{const p={pending:0,accepted:1,rejected:2};return(p[f.status]??999)-(p[g.status]??999)}),x=m.filter(f=>f.status==="pending").length>0,b=(f,g)=>{i(p=>({...p,[f]:g}))};return n.jsx(Ms,{className:"border-t border-border pt-2",children:n.jsx(Ne,{children:n.jsx(ee,{children:n.jsxs(Ie,{open:t,onOpenChange:e,children:[n.jsx(ze,{asChild:!0,children:n.jsxs(Te,{className:"group/nav-item cursor-pointer text-foreground/90 hover:text-foreground relative",tooltip:"Inbox",children:[n.jsx("span",{className:"text-muted-foreground group-hover/nav-item:text-foreground transition-colors [&>svg]:size-4",children:n.jsx(Ee,{})}),n.jsx("span",{className:"truncate",children:"Inbox"}),x&&n.jsx("span",{className:"absolute top-1 right-1 h-2 w-2 rounded-full bg-destructive"})]})}),n.jsxs($e,{align:"end",className:"w-[480px] p-0 overflow-hidden",children:[n.jsx("div",{className:"px-4 py-3 border-b border-border",children:n.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Inbox"})}),n.jsx("div",{className:"max-h-96 overflow-auto",children:u.length>0?u.map(f=>n.jsx(Zs,{invitation:f,onStatusChange:b},f.id)):n.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[n.jsx(Ee,{size:32,className:"text-muted-foreground/40 mb-2"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"No invitations at the moment"})]})})]})]})})})})}function jt(t){const e=w.c(4),{children:s}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Es,{className:"my-2 -ml-1"}),e[0]=a):a=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(ee,{children:n.jsx("div",{className:"group-data-[collapsible=icon]:hidden px-2 py-0 text-xs font-medium h-6 text-muted-foreground flex items-center justify-between",children:n.jsx("span",{className:"whitespace-nowrap",children:"Pinned Views"})})}),e[1]=r):r=e[1];let l;return e[2]!==s?(l=n.jsxs(n.Fragment,{children:[a,r,s]}),e[2]=s,e[3]=l):l=e[3],l}function Ys(t){const e=w.c(26),{item:s}=t,a=le(),{org:r}=be(),l=_e(r.id),i=Qt(r.id);let o;e[0]!==i.update||e[1]!==s.url||e[2]!==l?.sidebar_items?(o=async()=>{const C=(l?.sidebar_items||[]).filter(y=>y.url!==s.url);await i.update.mutateAsync({sidebar_items:C})},e[0]=i.update,e[1]=s.url,e[2]=l?.sidebar_items,e[3]=o):o=e[3];const c=o;let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=/^https?:\/\/.+/,e[4]=d):d=e[4];let m;e[5]!==s.icon?(m=d.test(s.icon),e[5]=s.icon,e[6]=m):m=e[6];const u=m;let h;e[7]!==s.url||e[8]!==a?(h=()=>{a({to:s.url})},e[7]=s.url,e[8]=a,e[9]=h):h=e[9];const x=s.title;let b;e[10]!==u||e[11]!==s.icon||e[12]!==s.title?(b=n.jsx("div",{className:"flex items-center justify-center shrink-0",children:u?n.jsx("img",{src:s.icon,alt:s.title,className:"h-4 w-4 rounded object-cover"}):n.jsx(cs,{size:16,className:"text-muted-foreground group-hover/item:text-foreground transition-colors"})}),e[10]=u,e[11]=s.icon,e[12]=s.title,e[13]=b):b=e[13];let f;e[14]!==s.title?(f=s.title.toLocaleLowerCase(),e[14]=s.title,e[15]=f):f=e[15];let g;e[16]!==f?(g=n.jsx("div",{className:"flex-1 min-w-0 flex flex-col items-start",children:n.jsx("span",{className:"truncate text-sm w-full capitalize",children:f})}),e[16]=f,e[17]=g):g=e[17];let p;e[18]!==c?(p=n.jsx(xe,{size:16,className:"text-muted-foreground opacity-0 group-hover/item:opacity-50 hover:opacity-100 cursor-pointer",onClick:j=>{j.preventDefault(),j.stopPropagation(),c()}}),e[18]=c,e[19]=p):p=e[19];let N;return e[20]!==s.title||e[21]!==h||e[22]!==b||e[23]!==g||e[24]!==p?(N=n.jsx(ee,{children:n.jsxs(Te,{className:"w-full pr-2 group/item relative cursor-pointer text-foreground/90 hover:text-foreground",onClick:h,tooltip:x,children:[b,g,p]})}),e[20]=s.title,e[21]=h,e[22]=b,e[23]=g,e[24]=p,e[25]=N):N=e[25],N}function Re(){const t=w.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(ee,{children:n.jsx("div",{className:"flex items-center gap-2 px-4 py-2",children:n.jsx(Q,{className:"h-4 flex-1"})})}),t[0]=e):e=t[0],e}function qs(){const t=w.c(4),{org:e}=be(),a=_e(e.id)?.sidebar_items;if(!a?.length)return null;let r;t[0]!==a?(r=a.map(Js),t[0]=a,t[1]=r):r=t[1];let l;return t[2]!==r?(l=n.jsx(jt,{children:r}),t[2]=r,t[3]=l):l=t[3],l}function Js(t){return n.jsx(Ys,{item:t},t.url)}function Xs(){const t=w.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(v.Suspense,{fallback:n.jsxs(jt,{children:[n.jsx(Re,{}),n.jsx(Re,{})]}),children:n.jsx(qs,{})}),t[0]=e):e=t[0],e}function Qs(){const t=w.c(5),e=vs();let s,a;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(v.Suspense,{fallback:n.jsx(Se.Skeleton,{}),children:n.jsx(Se,{})}),a=n.jsx(Gs,{}),t[0]=s,t[1]=a):(s=t[0],a=t[1]);let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(Ge,{children:n.jsx(v.Suspense,{fallback:null,children:n.jsx(Xs,{})})}),t[2]=r):r=t[2];let l;return t[3]!==e?(l=n.jsx(xt,{navigationItems:e,header:s,footer:a,additionalContent:r}),t[3]=e,t[4]=l):l=t[4],l}function en(t){const e=w.c(12);let s,a,r,l;e[0]!==t?({className:s,orientation:r,decorative:l,...a}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=r,e[4]=l):(s=e[1],a=e[2],r=e[3],l=e[4]);const i=r===void 0?"horizontal":r,o=l===void 0?!0:l;let c;e[5]!==s?(c=M("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",s),e[5]=s,e[6]=c):c=e[6];let d;return e[7]!==o||e[8]!==i||e[9]!==a||e[10]!==c?(d=n.jsx($t,{"data-slot":"separator-root",decorative:o,orientation:i,className:c,...a}),e[7]=o,e[8]=i,e[9]=a,e[10]=c,e[11]=d):d=e[11],d}const vt=v.createContext(null);function tn(){const t=v.useContext(vt);if(!t)throw new Error("TopbarSwitcher compound components must be used within TopbarSwitcher.Root");return t}function sn(t){const e=w.c(10),{children:s,onItemHover:a}=t,[r,l]=v.useState(null);let i;e[0]!==a?(i=u=>{l(u),a?.(u)},e[0]=a,e[1]=i):i=e[1];const o=i;let c;e[2]!==r||e[3]!==o?(c={hoveredItem:r,setHoveredItem:o},e[2]=r,e[3]=o,e[4]=c):c=e[4];let d;e[5]!==s?(d=n.jsx(Ie,{children:s}),e[5]=s,e[6]=d):d=e[6];let m;return e[7]!==c||e[8]!==d?(m=n.jsx(vt.Provider,{value:c,children:d}),e[7]=c,e[8]=d,e[9]=m):m=e[9],m}function nn(t){const e=w.c(6),{children:s,onClick:a}=t;let r;e[0]!==s||e[1]!==a?(r=n.jsx(U,{variant:"link",className:"p-0.5 h-auto",onClick:a,type:"button",children:s}),e[0]=s,e[1]=a,e[2]=r):r=e[2];let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(ze,{asChild:!0,children:n.jsx(U,{size:"icon",variant:"ghost",className:"w-6 h-6 p-0",children:n.jsx(Jt,{size:16,className:"opacity-50"})})}),e[3]=l):l=e[3];let i;return e[4]!==r?(i=n.jsxs("div",{className:"flex items-center gap-1",children:[r,l]}),e[4]=r,e[5]=i):i=e[5],i}function an(t){const e=w.c(8),{item:s,fallback:a}=t,r=a===void 0?"":a,l=s?.avatarUrl??"",i=s?.name??r;let o;e[0]!==l||e[1]!==i?(o=n.jsx(J,{url:l,fallback:i,size:"xs",objectFit:"contain"}),e[0]=l,e[1]=i,e[2]=o):o=e[2];const c=s?.name??r;let d;e[3]!==c?(d=n.jsx("span",{children:c}),e[3]=c,e[4]=d):d=e[4];let m;return e[5]!==o||e[6]!==d?(m=n.jsxs("div",{className:"flex items-center gap-2",children:[o,d]}),e[5]=o,e[6]=d,e[7]=m):m=e[7],m}function rn(t){const e=w.c(6),{children:s,align:a}=t,r=a===void 0?"start":a,i=v.Children.toArray(s).filter(ln).length===1?"280px":"480px";let o;e[0]!==i?(o={width:i},e[0]=i,e[1]=o):o=e[1];let c;return e[2]!==r||e[3]!==s||e[4]!==o?(c=n.jsx($e,{align:r,className:"p-0 flex items-start",style:o,children:s}),e[2]=r,e[3]=s,e[4]=o,e[5]=c):c=e[5],c}function ln(t){return v.isValidElement(t)&&(t.type===wt||t.type===Nt)}function Nt(t){const e=w.c(5),{children:s,className:a}=t;let r;e[0]!==a?(r=M("flex flex-col border-border w-[240px] border-r last:border-r-0 last:w-full",a),e[0]=a,e[1]=r):r=e[1];let l;return e[2]!==s||e[3]!==r?(l=n.jsx("div",{className:r,children:s}),e[2]=s,e[3]=r,e[4]=l):l=e[4],l}const wt=Nt;function on(t){const e=w.c(6),{placeholder:s,value:a,onChange:r}=t,l=s===void 0?"Search...":s;let i;e[0]!==r?(i=c=>r(c.target.value),e[0]=r,e[1]=i):i=e[1];let o;return e[2]!==l||e[3]!==i||e[4]!==a?(o=n.jsx(ds,{placeholder:l,value:a,onChange:i,className:"rounded-none border-t-0 border-x-0 focus-visible:border-border focus-visible:ring-0"}),e[2]=l,e[3]=i,e[4]=a,e[5]=o):o=e[5],o}function cn(t){const e=w.c(6),{children:s,emptyMessage:a}=t,r=a===void 0?"No items found.":a,l=v.Children.count(s)>0;let i;e[0]!==r||e[1]!==l?(i=!l&&n.jsx("div",{className:"text-muted-foreground text-sm px-1 py-8 text-center",children:r}),e[0]=r,e[1]=l,e[2]=i):i=e[2];let o;return e[3]!==s||e[4]!==i?(o=n.jsxs("div",{className:"flex flex-col gap-0.5 p-1 max-h-44 overflow-y-auto",children:[i,s]}),e[3]=s,e[4]=i,e[5]=o):o=e[5],o}function dn(t){const e=w.c(15),{item:s,onClick:a,onHover:r,children:l}=t,i=tn();let o;e[0]!==i||e[1]!==s||e[2]!==r?(o=()=>{i.setHoveredItem(s.slug),r?.(s)},e[0]=i,e[1]=s,e[2]=r,e[3]=o):o=e[3];const c=o;let d;e[4]!==s||e[5]!==a?(d=()=>a(s),e[4]=s,e[5]=a,e[6]=d):d=e[6];let m;e[7]!==l||e[8]!==s.avatarUrl||e[9]!==s.name?(m=l||n.jsxs(n.Fragment,{children:[n.jsx(J,{url:s.avatarUrl??"",fallback:s.name,size:"xs",className:"w-[22px]! h-[22px]!",objectFit:"contain"}),n.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:s.name})]}),e[7]=l,e[8]=s.avatarUrl,e[9]=s.name,e[10]=m):m=e[10];let u;return e[11]!==c||e[12]!==d||e[13]!==m?(u=n.jsx(U,{onClick:d,onMouseEnter:c,variant:"ghost",size:"sm",className:"w-full justify-start font-normal",children:m}),e[11]=c,e[12]=d,e[13]=m,e[14]=u):u=e[14],u}function mn(t){const e=w.c(2),{children:s}=t;let a;return e[0]!==s?(a=n.jsx("div",{className:"px-1 pb-1 pt-0.5",children:s}),e[0]=s,e[1]=a):a=e[1],a}function fn(t){const e=w.c(11),{onClick:s,icon:a,children:r,variant:l}=t,o=(l===void 0?"default":l)==="muted"&&"text-muted-foreground";let c;e[0]!==o?(c=M("w-full justify-start font-normal",o),e[0]=o,e[1]=c):c=e[1];let d;e[2]!==a?(d=a&&n.jsx("span",{className:"[&>svg]:size-4",children:a}),e[2]=a,e[3]=d):d=e[3];let m;e[4]!==r?(m=n.jsx("span",{children:r}),e[4]=r,e[5]=m):m=e[5];let u;return e[6]!==s||e[7]!==c||e[8]!==d||e[9]!==m?(u=n.jsxs(U,{variant:"ghost",size:"sm",className:c,onClick:s,children:[d,m]}),e[6]=s,e[7]=c,e[8]=d,e[9]=m,e[10]=u):u=e[10],u}function un(){const t=w.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(en,{}),t[0]=e):e=t[0],e}function hn(){const t=w.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"h-4 w-16 bg-accent rounded-full animate-pulse"}),t[0]=e):e=t[0],e}const W=Object.assign(sn,{Trigger:nn,CurrentItem:an,Content:rn,Panel:wt,Search:on,Items:cn,Item:dn,Actions:mn,Action:fn,Separator:un,Skeleton:hn});function ye(){const t=w.c(59);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const{org:s}=ke(e),{data:a}=K.useListOrganizations(),r=le();let l;t[1]!==s||t[2]!==a?(l=a?.find(E=>E.slug===s),t[1]=s,t[2]=a,t[3]=l):l=t[3];const i=l,[o,c]=v.useState(""),[d,m]=v.useState(!1);let u,h,x,b,f,g,p,N;if(t[4]!==i||t[5]!==r||t[6]!==s||t[7]!==o||t[8]!==a){const L=(a?(()=>{const V=a.filter(B=>B.name.toLowerCase().includes(o.toLowerCase()));if(s){const B=V.findIndex(Z=>Z.slug===s);if(B>0){const Z=V[B];Z&&(V.splice(B,1),V.unshift(Z))}}return V})():[]).map(pn);let A;t[17]!==i?(A=i?{slug:i.slug,name:i.name,avatarUrl:i.logo}:void 0,t[17]=i,t[18]=A):A=t[18];const R=A;b=W;let P;t[19]!==r||t[20]!==s?(P=()=>r({to:"/$org",params:{org:s??""}}),t[19]=r,t[20]=s,t[21]=P):P=t[21];let H;t[22]!==R?(H=n.jsx(W.CurrentItem,{item:R}),t[22]=R,t[23]=H):H=t[23],t[24]!==P||t[25]!==H?(N=n.jsx(W.Trigger,{onClick:P,children:H}),t[24]=P,t[25]=H,t[26]=N):N=t[26],x=W.Content,h=W.Panel,t[27]!==o?(p=n.jsx(W.Search,{placeholder:"Search organizations...",value:o,onChange:c}),t[27]=o,t[28]=p):p=t[28],u=W.Items,f="No organizations found.";let D;t[29]!==r?(D=V=>n.jsx(W.Item,{item:V,onClick:B=>r({to:"/$org",params:{org:B.slug}})},V.slug),t[29]=r,t[30]=D):D=t[30],g=L.map(D),t[4]=i,t[5]=r,t[6]=s,t[7]=o,t[8]=a,t[9]=u,t[10]=h,t[11]=x,t[12]=b,t[13]=f,t[14]=g,t[15]=p,t[16]=N}else u=t[9],h=t[10],x=t[11],b=t[12],f=t[13],g=t[14],p=t[15],N=t[16];let j;t[31]!==u||t[32]!==f||t[33]!==g?(j=n.jsx(u,{emptyMessage:f,children:g}),t[31]=u,t[32]=f,t[33]=g,t[34]=j):j=t[34];let C,y;t[35]===Symbol.for("react.memo_cache_sentinel")?(C=n.jsx(W.Actions,{children:n.jsx(W.Action,{onClick:()=>m(!0),variant:"muted",children:"+ Create organization"})}),y=n.jsx(W.Separator,{}),t[35]=C,t[36]=y):(C=t[35],y=t[36]);let k;t[37]!==r?(k=()=>r({to:"/"}),t[37]=r,t[38]=k):k=t[38];let S;t[39]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx(ms,{}),t[39]=S):S=t[39];let $;t[40]!==k?($=n.jsx(W.Actions,{children:n.jsx(W.Action,{onClick:k,icon:S,children:"See all organizations"})}),t[40]=k,t[41]=$):$=t[41];let _;t[42]!==h||t[43]!==$||t[44]!==p||t[45]!==j?(_=n.jsxs(h,{children:[p,j,C,y,$]}),t[42]=h,t[43]=$,t[44]=p,t[45]=j,t[46]=_):_=t[46];let z;t[47]!==x||t[48]!==_?(z=n.jsx(x,{children:_}),t[47]=x,t[48]=_,t[49]=z):z=t[49];let I;t[50]!==b||t[51]!==z||t[52]!==N?(I=n.jsxs(b,{children:[N,z]}),t[50]=b,t[51]=z,t[52]=N,t[53]=I):I=t[53];let O;t[54]!==d?(O=n.jsx(Ye,{open:d,onOpenChange:m}),t[54]=d,t[55]=O):O=t[55];let T;return t[56]!==I||t[57]!==O?(T=n.jsxs(n.Fragment,{children:[I,O]}),t[56]=I,t[57]=O,t[58]=T):T=t[58],T}function pn(t){return{slug:t.slug,name:t.name,avatarUrl:t.logo}}ye.Skeleton=W.Skeleton;function xn({prop:t,defaultProp:e,onChange:s=()=>{}}){const[a,r]=gn({defaultProp:e,onChange:s}),l=t!==void 0,i=l?t:a,o=Ue(s),c=v.useCallback(d=>{if(l){const u=typeof d=="function"?d(t):d;u!==t&&o(u)}else r(d)},[l,t,r,o]);return[i,c]}function gn({defaultProp:t,onChange:e}){const s=v.useState(t),[a]=s,r=v.useRef(a),l=Ue(e);return v.useEffect(()=>{r.current!==a&&(l(a),r.current=a)},[a,r,l]),s}function bn(t){const e=w.c(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=n.jsx(re.Root,{"data-slot":"drawer",...s}),e[2]=s,e[3]=a):a=e[3],a}function jn(t){const e=w.c(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=n.jsx(re.Trigger,{"data-slot":"drawer-trigger",...s}),e[2]=s,e[3]=a):a=e[3],a}function vn(t){const e=w.c(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=n.jsx(re.Portal,{"data-slot":"drawer-portal",...s}),e[2]=s,e[3]=a):a=e[3],a}function Nn(t){const e=w.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let r;e[3]!==s?(r=M("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",s),e[3]=s,e[4]=r):r=e[4];let l;return e[5]!==a||e[6]!==r?(l=n.jsx(re.Overlay,{"data-slot":"drawer-overlay",className:r,...a}),e[5]=a,e[6]=r,e[7]=l):l=e[7],l}function wn(t){const e=w.c(12);let s,a,r;e[0]!==t?({className:a,children:s,...r}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=r):(s=e[1],a=e[2],r=e[3]);let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(Nn,{}),e[4]=l):l=e[4];let i;e[5]!==a?(i=M("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",a),e[5]=a,e[6]=i):i=e[6];let o;e[7]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),e[7]=o):o=e[7];let c;return e[8]!==s||e[9]!==r||e[10]!==i?(c=n.jsxs(vn,{"data-slot":"drawer-portal",children:[l,n.jsxs(re.Content,{"data-slot":"drawer-content",className:i,...r,children:[o,s]})]}),e[8]=s,e[9]=r,e[10]=i,e[11]=c):c=e[11],c}function Sn(t){const e=w.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let r;e[3]!==s?(r=M("flex flex-col gap-1.5 px-4 py-2",s),e[3]=s,e[4]=r):r=e[4];let l;return e[5]!==a||e[6]!==r?(l=n.jsx("div",{"data-slot":"drawer-header",className:r,...a}),e[5]=a,e[6]=r,e[7]=l):l=e[7],l}function yn(t){const e=w.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let r;e[3]!==s?(r=M("text-foreground font-semibold",s),e[3]=s,e[4]=r):r=e[4];let l;return e[5]!==a||e[6]!==r?(l=n.jsx(re.Title,{"data-slot":"drawer-title",className:r,...a}),e[5]=a,e[6]=r,e[7]=l):l=e[7],l}const St=v.createContext({setOpen:()=>{}}),Cn=()=>v.useContext(St),kn=t=>{const e=w.c(25);let s,a,r,l,i;e[0]!==t?({children:s,defaultOpen:a,open:l,onOpenChange:r,...i}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=r,e[4]=l,e[5]=i):(s=e[1],a=e[2],r=e[3],l=e[4],i=e[5]);const o=a??!1;let c;e[6]!==r||e[7]!==l||e[8]!==o?(c={prop:l,defaultProp:o,onChange:r},e[6]=r,e[7]=l,e[8]=o,e[9]=c):c=e[9];const[d,m]=xn(c);let u;e[10]!==m?(u={setOpen:m},e[10]=m,e[11]=u):u=e[11];let h;e[12]!==s||e[13]!==d||e[14]!==i||e[15]!==m?(h=n.jsx(bn,{open:d,onOpenChange:m,...i,children:s}),e[12]=s,e[13]=d,e[14]=i,e[15]=m,e[16]=h):h=e[16];let x;e[17]!==d||e[18]!==i||e[19]!==m||e[20]!==h?(x=n.jsx(hs,{open:d,onOpenChange:m,...i,children:h}),e[17]=d,e[18]=i,e[19]=m,e[20]=h,e[21]=x):x=e[21];let b;return e[22]!==u||e[23]!==x?(b=n.jsx(St.Provider,{value:u,children:x}),e[22]=u,e[23]=x,e[24]=b):b=e[24],b},_n=t=>{const{children:e,title:s,...a}=t,r=ie(),{className:l,...i}=a;return r?n.jsxs(wn,{...i,children:[n.jsx(Sn,{className:"hidden",children:n.jsx(yn,{children:s})}),n.jsx("div",{className:M("flex flex-col gap-2 p-2 py-4",l),children:e})]}):n.jsx(us,{...a,children:e})},zn=t=>{const{children:e,...s}=t,{setOpen:a}=Cn(),r=ie(),{className:l,...i}=s;return r?n.jsx("div",{...i,onClick:o=>{a(!1);const{onClick:c}=i;c?.(o)},className:M("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",l),children:e}):n.jsx(ps,{...s,children:e})},$n=t=>{const e=w.c(7);let s,a;e[0]!==t?({children:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);const r=ie();let l;return e[3]!==s||e[4]!==r||e[5]!==a?(l=r?n.jsx(jn,{asChild:!0,children:s}):n.jsx(fs,{...a,children:s}),e[3]=s,e[4]=r,e[5]=a,e[6]=l):l=e[6],l},In=t=>{const e=w.c(7);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);const r=ie();let l;return e[3]!==s||e[4]!==r||e[5]!==a?(l=r?n.jsx(Pe,{className:M(s),...a}):n.jsx(Pe,{className:M(s),...a}),e[3]=s,e[4]=r,e[5]=a,e[6]=l):l=e[6],l};function On(t){const e=w.c(11),{user:s,trigger:a,align:r,children:l}=t,i=r===void 0?"start":r;let o;e[0]!==a||e[1]!==s?(o=a(s),e[0]=a,e[1]=s,e[2]=o):o=e[2];let c;e[3]!==o?(c=n.jsx($n,{asChild:!0,children:n.jsx("div",{children:o})}),e[3]=o,e[4]=c):c=e[4];let d;e[5]!==i||e[6]!==l?(d=n.jsx(_n,{side:"top",align:i,className:"md:w-[240px]",children:l}),e[5]=i,e[6]=l,e[7]=d):d=e[7];let m;return e[8]!==c||e[9]!==d?(m=n.jsxs(kn,{children:[c,d]}),e[8]=c,e[9]=d,e[10]=m):m=e[10],m}function Tn(t){const e=w.c(8),{children:s,onClick:a,className:r,asChild:l}=t;let i;e[0]!==l||e[1]!==s||e[2]!==a?(i=l?s:n.jsx("button",{type:"button",className:"flex items-center gap-2 text-sm w-full cursor-pointer",onClick:a,children:s}),e[0]=l,e[1]=s,e[2]=a,e[3]=i):i=e[3];let o;return e[4]!==l||e[5]!==r||e[6]!==i?(o=n.jsx(zn,{asChild:l,className:r,children:i}),e[4]=l,e[5]=r,e[6]=i,e[7]=o):o=e[7],o}function Mn(t){const e=w.c(2),{className:s}=t;let a;return e[0]!==s?(a=n.jsx(In,{className:s}),e[0]=s,e[1]=a):a=e[1],a}function En(){const t=w.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"w-8 h-8 bg-muted rounded-full animate-pulse"}),t[0]=e):e=t[0],e}const q=Object.assign(On,{Item:Tn,Separator:Mn,Skeleton:En});function Ln(t){const e=w.c(47),{user:s,userImage:a}=t,[r,l]=v.useState(!1),[i,o]=v.useState(!1);let c;e[0]!==s.email||e[1]!==s.id||e[2]!==s.name?(c=()=>{const A=`ID: ${s.id}
4
4
  Name: ${s.name||"N/A"}
5
5
  Email: ${s.email}`;navigator.clipboard.writeText(A),o(!0),Y.success("User info copied to clipboard"),setTimeout(()=>o(!1),2e3)},e[0]=s.email,e[1]=s.id,e[2]=s.name,e[3]=c):c=e[3];const d=c;let m;e[4]!==s.email||e[5]!==s.name||e[6]!==a?(m=()=>n.jsx(J,{url:a,fallback:s.name||s.email||"U",shape:"circle",size:"sm",className:"cursor-pointer hover:ring-2 ring-muted-foreground transition-all h-7 w-7"}),e[4]=s.email,e[5]=s.name,e[6]=a,e[7]=m):m=e[7];const u=s.name||s.email||"U";let h;e[8]!==u||e[9]!==a?(h=n.jsx(J,{url:a,fallback:u,shape:"circle",size:"sm"}),e[8]=u,e[9]=a,e[10]=h):h=e[10];const x=s.name||"User";let b;e[11]!==x?(b=n.jsx("div",{className:"text-sm font-medium truncate",children:x}),e[11]=x,e[12]=b):b=e[12];let f;e[13]!==s.email?(f=n.jsx("div",{className:"text-xs text-muted-foreground truncate",children:s.email}),e[13]=s.email,e[14]=f):f=e[14];let g;e[15]!==b||e[16]!==f?(g=n.jsxs("div",{className:"flex-1 min-w-0 text-left",children:[b,f]}),e[15]=b,e[16]=f,e[17]=g):g=e[17];let p;e[18]!==i?(p=n.jsx("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:i?n.jsx(ge,{size:16,className:"text-green-600"}):n.jsx(qe,{size:16,className:"text-muted-foreground"})}),e[18]=i,e[19]=p):p=e[19];let N;e[20]!==h||e[21]!==g||e[22]!==p?(N=n.jsxs("div",{className:"group flex items-center gap-3 w-full py-1",children:[h,g,p]}),e[20]=h,e[21]=g,e[22]=p,e[23]=N):N=e[23];let j;e[24]!==d||e[25]!==N?(j=n.jsx(q.Item,{onClick:d,children:N}),e[24]=d,e[25]=N,e[26]=j):j=e[26];let C;e[27]===Symbol.for("react.memo_cache_sentinel")?(C=n.jsx(q.Separator,{}),e[27]=C):C=e[27];let y,k;e[28]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsxs(q.Item,{onClick:()=>l(!0),children:[n.jsx(Oe,{className:"text-muted-foreground",size:18}),"Profile Settings"]}),k=n.jsx(q.Separator,{}),e[28]=y,e[29]=k):(y=e[28],k=e[29]);let S;e[30]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx(He,{className:"w-4 h-4 text-muted-foreground"}),e[30]=S):S=e[30];let $;e[31]===Symbol.for("react.memo_cache_sentinel")?($=n.jsx(q.Item,{asChild:!0,children:n.jsxs("a",{href:"https://github.com/decocms/admin",target:"_blank",rel:"noopener noreferrer",className:"flex w-full items-center gap-2 text-sm cursor-pointer",children:[S,"decocms/admin",n.jsx(De,{size:18,className:"text-muted-foreground ml-auto"})]})}),e[31]=$):$=e[31];let _;e[32]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx(rt,{className:"text-muted-foreground",size:18}),e[32]=_):_=e[32];let z,I;e[33]===Symbol.for("react.memo_cache_sentinel")?(z=n.jsx(q.Item,{asChild:!0,children:n.jsxs("a",{href:"https://decocms.com",target:"_blank",rel:"noopener noreferrer",className:"flex w-full items-center gap-2 text-sm cursor-pointer",children:[_,"Homepage",n.jsx(De,{size:18,className:"ml-auto text-muted-foreground"})]})}),I=n.jsx(q.Separator,{}),e[33]=z,e[34]=I):(z=e[33],I=e[34]);let O;e[35]===Symbol.for("react.memo_cache_sentinel")?(O=n.jsxs(q.Item,{onClick:An,children:[n.jsx(it,{size:18,className:"text-muted-foreground"}),"Log out"]}),e[35]=O):O=e[35];let T;e[36]!==j||e[37]!==m||e[38]!==s?(T=n.jsxs(q,{user:s,trigger:m,align:"end",children:[j,C,y,k,$,z,I,O]}),e[36]=j,e[37]=m,e[38]=s,e[39]=T):T=e[39];let E;e[40]!==r||e[41]!==s||e[42]!==a?(E=r&&n.jsx(gt,{open:r,onOpenChange:l,user:s,userImage:a}),e[40]=r,e[41]=s,e[42]=a,e[43]=E):E=e[43];let L;return e[44]!==T||e[45]!==E?(L=n.jsxs(n.Fragment,{children:[T,E]}),e[44]=T,e[45]=E,e[46]=L):L=e[46],L}function An(){return K.signOut()}function Pn(){const t=w.c(7),{data:e}=K.useSession();if(!e?.user){let c;return t[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(J,{url:void 0,fallback:"U",shape:"circle",size:"sm",className:"cursor-pointer h-7 w-7",muted:!0}),t[0]=c):c=t[0],c}const s=e.user,a=s.name??void 0;let r;t[1]!==a||t[2]!==s?(r={...s,name:a},t[1]=a,t[2]=s,t[3]=r):r=t[3];const l=r,i=s.image;let o;return t[4]!==i||t[5]!==l?(o=n.jsx(Ln,{user:l,userImage:i}),t[4]=i,t[5]=l,t[6]=o):o=t[6],o}function Dn(){const t=w.c(2),s=Ce().location.href;let a;return t[0]!==s?(a=n.jsx(Mt,{to:"/login",search:{next:s},replace:!0}),t[0]=s,t[1]=a):a=t[1],a}function Rn(t){const e=w.c(6),{children:s}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(It,{children:n.jsx(Be,{})}),e[0]=a):a=e[0];let r;e[1]!==s?(r=n.jsx(Ot,{children:s}),e[1]=s,e[2]=r):r=e[2];let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(Tt,{children:n.jsx(Dn,{})}),e[3]=l):l=e[3];let i;return e[4]!==r?(i=n.jsxs(n.Fragment,{children:[a,r,l]}),e[4]=r,e[5]=i):i=e[5],i}function Hn(t){const e=w.c(5),{children:s,className:a}=t;let r;e[0]!==a?(r=M("fixed top-0 left-0 right-0 z-20 bg-background flex items-center w-full h-12 border-b border-border",a),e[0]=a,e[1]=r):r=e[1];let l;return e[2]!==s||e[3]!==r?(l=n.jsx("div",{className:r,children:s}),e[2]=s,e[3]=r,e[4]=l):l=e[4],l}function Un(t){const e=w.c(5),{children:s,className:a}=t;let r;e[0]!==a?(r=M("flex items-center justify-center px-2.5 h-full border-r border-border",a),e[0]=a,e[1]=r):r=e[1];let l;return e[2]!==s||e[3]!==r?(l=n.jsx("div",{className:r,children:s}),e[2]=s,e[3]=r,e[4]=l):l=e[4],l}function Bn(t){const e=w.c(5),{children:s,className:a}=t;let r;e[0]!==a?(r=M("flex items-center gap-2 px-2 h-full",a),e[0]=a,e[1]=r):r=e[1];let l;return e[2]!==s||e[3]!==r?(l=n.jsx("div",{className:r,children:s}),e[2]=s,e[3]=r,e[4]=l):l=e[4],l}function Wn(t){const e=w.c(5),{children:s,className:a}=t;let r;e[0]!==a?(r=M("flex items-center gap-2 px-2 h-full flex-1",a),e[0]=a,e[1]=r):r=e[1];let l;return e[2]!==s||e[3]!==r?(l=n.jsx("div",{className:r,children:s}),e[2]=s,e[3]=r,e[4]=l):l=e[4],l}function Fn(t){const e=w.c(5),{children:s,className:a}=t;let r;e[0]!==a?(r=M("flex items-center gap-2 px-2 h-full ml-auto",a),e[0]=a,e[1]=r):r=e[1];let l;return e[2]!==s||e[3]!==r?(l=n.jsx("div",{className:r,children:s}),e[2]=s,e[3]=r,e[4]=l):l=e[4],l}function Vn(){const t=w.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"flex items-center justify-center px-2 h-full border-r border-border",children:n.jsx("div",{className:"w-8 h-8 bg-muted rounded-md animate-pulse"})}),t[0]=e):e=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx("div",{className:"flex items-center gap-2 px-2 h-full",children:n.jsx("div",{className:"w-32 h-6 bg-muted rounded-md animate-pulse"})}),t[1]=s):s=t[1];let a;return t[2]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsxs("div",{className:"fixed top-0 left-0 right-0 z-20 bg-background flex items-center w-full h-12 border-b border-border",children:[e,s,n.jsx("div",{className:"flex items-center gap-2 px-2 h-full ml-auto",children:n.jsx("div",{className:"w-8 h-8 bg-muted rounded-full animate-pulse"})})]}),t[2]=a):a=t[2],a}const fe=Object.assign(Hn,{Sidebar:Un,Left:Bn,Center:Wn,Right:Fn,Skeleton:Vn});function yt(){const t=w.c(3),{toggleSidebar:e}=ve();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(lt,{className:"text-muted-foreground/85 group-hover:text-foreground transition-colors",size:18}),t[0]=s):s=t[0];let a;return t[1]!==e?(a=n.jsx(n.Fragment,{children:n.jsx(U,{onClick:e,size:"icon",variant:"ghost",className:"w-7 h-7 rounded-md",children:s})}),t[1]=e,t[2]=a):a=t[2],a}yt.Skeleton=function(){return n.jsx("div",{className:"w-7 h-7 bg-muted rounded-md animate-pulse"})};function Kn({showSidebarToggle:t=!1,showOrgSwitcher:e=!1,showDecoChat:s=!1,disableDecoChat:a=!1}){const[r,l]=je(),i=v.useRef(a);a&&r&&i.current!==a&&l(!1),i.current=a;const o=()=>{a||l(c=>!c)};return n.jsxs(fe,{children:[t&&n.jsx(fe.Sidebar,{children:n.jsx(yt,{})}),n.jsx(fe.Left,{children:e&&n.jsx(v.Suspense,{fallback:n.jsx(ye.Skeleton,{}),children:n.jsx(ye,{})})}),n.jsxs(fe.Right,{className:"gap-2",children:[s&&!a&&n.jsxs(U,{size:"sm",variant:"default",onClick:o,className:"h-7 gap-2",children:[n.jsx(Ve,{size:16}),"Chat"]}),n.jsx(Pn,{})]})]})}function Zn(t){const e=w.c(10),{children:s,className:a}=t,[,r]=v.useTransition();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=Xe.decoChatPanelWidth(),e[0]=l):l=e[0];const[i,o]=Je(l,30);let c;e[1]!==o?(c=h=>r(()=>o(h)),e[1]=o,e[2]=c):c=e[2];const d=c;let m;e[3]!==a?(m=M("min-w-0",a),e[3]=a,e[4]=m):m=e[4];let u;return e[5]!==i||e[6]!==s||e[7]!==d||e[8]!==m?(u=n.jsx(Qe,{defaultSize:i,minSize:20,className:m,onResize:d,children:s}),e[5]=i,e[6]=s,e[7]=d,e[8]=m,e[9]=u):u=e[9],u}function Gn(t){const e=w.c(5),{children:s}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=Xe.sidebarOpen(),e[0]=a):a=e[0];const[r,l]=Je(a,!0);let i;return e[1]!==s||e[2]!==l||e[3]!==r?(i=n.jsx(_s,{open:r,onOpenChange:l,children:s}),e[1]=s,e[2]=l,e[3]=r,e[4]=i):i=e[4],i}function Yn(t){const e=w.c(6),{disableChat:s}=t,a=s===void 0?!1:s,[r]=je();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(Qe,{className:"bg-background",children:n.jsx(We,{})}),e[0]=l):l=e[0];let i;e[1]!==r||e[2]!==a?(i=!a&&n.jsxs(n.Fragment,{children:[n.jsx(xs,{withHandle:r}),n.jsx(Zn,{className:M(r?"max-w-none":"max-w-0"),children:n.jsx(js,{})})]}),e[1]=r,e[2]=a,e[3]=i):i=e[3];let o;return e[4]!==i?(o=n.jsxs(gs,{direction:"horizontal",children:[l,i]}),e[4]=i,e[5]=o):o=e[5],o}function qn(){const t=w.c(18);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const{org:s}=ke(e),a=Ce(),r=a.location.pathname===`/${s}`||a.location.pathname===`/${s}/`;let l;t[1]!==s?(l=At.activeOrganization(s),t[1]=s,t[2]=l):l=t[2];let i;t[3]!==s?(i=async()=>{if(!s)return null;const{data:b}=await K.organization.setActive({organizationSlug:s});return{org:b,project:{slug:Pt}}},t[3]=s,t[4]=i):i=t[4];let o;t[5]!==l||t[6]!==i?(o={queryKey:l,queryFn:i,gcTime:1/0,staleTime:1/0,refetchOnWindowFocus:!1,refetchOnMount:!1},t[5]=l,t[6]=i,t[7]=o):o=t[7];const{data:c}=Et(o);if(!c){let b;t[8]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx(Kn,{}),t[8]=b):b=t[8];let f;return t[9]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsxs("div",{className:"min-h-screen bg-background",children:[b,n.jsx("div",{className:"pt-12",children:n.jsx(We,{})})]}),t[9]=f):f=t[9],f}let d;t[10]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx("style",{children:`
6
6
  [data-slot="sidebar-container"] {