@decocms/mesh 2.20.0 → 2.20.2

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 (146) hide show
  1. package/dist/client/assets/{AlertCircle-CkNvGXW2.js → AlertCircle-CI2U-jkN.js} +1 -1
  2. package/dist/client/assets/{ArrowLeft-BsUDOBX0.js → ArrowLeft-B3km7toT.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-Xq_0RBx_.js → ArrowUp-BF7mM4C2.js} +1 -1
  4. package/dist/client/assets/{Check-DijrPXQx.js → Check-BQkm1TiP.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-DASi-DMo.js → ChevronDown-DP6jvip7.js} +1 -1
  6. package/dist/client/assets/{Code01-C0ZFF6Hl.js → Code01-qXTn9GK9.js} +1 -1
  7. package/dist/client/assets/{Copy01-BQZg7H8u.js → Copy01-CEYn2daS.js} +1 -1
  8. package/dist/client/assets/{DotsHorizontal-CjU9uXdh.js → DotsHorizontal-C2Nr-D-f.js} +1 -1
  9. package/dist/client/assets/{DotsVertical-D6TZm5RT.js → DotsVertical-BPP4U4GQ.js} +1 -1
  10. package/dist/client/assets/{Download01-BTR8eSV6.js → Download01-BkDXja2z.js} +1 -1
  11. package/dist/client/assets/{Edit01-BsdLQ-QO.js → Edit01-Cq0mQDLh.js} +1 -1
  12. package/dist/client/assets/{File06-Bm9rDm48.js → File06-KMD38I-q.js} +1 -1
  13. package/dist/client/assets/{FilterLines-Dg_ubOas.js → FilterLines-Bojt6HPl.js} +1 -1
  14. package/dist/client/assets/{FlipBackward-BZkXBjUF.js → FlipBackward-C-K9FamE.js} +1 -1
  15. package/dist/client/assets/{GitBranch01-DYs19mSG.js → GitBranch01-DGTCzEh5.js} +1 -1
  16. package/dist/client/assets/{Grid01-CTb93Z2I.js → Grid01-D4lXvveX.js} +1 -1
  17. package/dist/client/assets/{Home02-CAgSUdC-.js → Home02-DPdZvu8L.js} +1 -1
  18. package/dist/client/assets/{Image01-CUinB3ac.js → Image01-C0R6SF_P.js} +1 -1
  19. package/dist/client/assets/{Inbox01-tMW4EgP4.js → Inbox01-BsOUYwQZ.js} +1 -1
  20. package/dist/client/assets/{InfoCircle-DqeM4n2r.js → InfoCircle-BgIkbjJr.js} +1 -1
  21. package/dist/client/assets/{Key01-BDVEoltU.js → Key01-DTwk4FpG.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-C2ZOZHgx.js → LinkExternal01-DmruqAb9.js} +1 -1
  23. package/dist/client/assets/{List-jMJevXfS.js → List-BsSZz32j.js} +1 -1
  24. package/dist/client/assets/{Loading01-6JGza9Vp.js → Loading01-Ae5ezbtD.js} +1 -1
  25. package/dist/client/assets/{Lock01-DAc7yIAH.js → Lock01-BuQSktMF.js} +1 -1
  26. package/dist/client/assets/{Play-BWxFDrEk.js → Play-DKlNHVjf.js} +1 -1
  27. package/dist/client/assets/{Plus-Dcgso5EP.js → Plus-CdG75X26.js} +1 -1
  28. package/dist/client/assets/{SearchMd-CbnCIalV.js → SearchMd-GFaonOaJ.js} +1 -1
  29. package/dist/client/assets/{Terminal-DNtUg1U7.js → Terminal-C6mZx-5A.js} +1 -1
  30. package/dist/client/assets/{Trash01-CzA8mxf_.js → Trash01-BWIN9RL_.js} +1 -1
  31. package/dist/client/assets/{Upload01-BPJ4Vq2H.js → Upload01-CaBE4VYK.js} +1 -1
  32. package/dist/client/assets/{X-C7-BOCtk.js → X-C18ho617.js} +1 -1
  33. package/dist/client/assets/{XClose-COetRF8H.js → XClose-CfwoKknl.js} +1 -1
  34. package/dist/client/assets/{alert-dialog-Mcf5ObRp.js → alert-dialog-CCJCsKzK.js} +1 -1
  35. package/dist/client/assets/{auth-catchall-JCvomRO1.js → auth-catchall-C33VWmDE.js} +1 -1
  36. package/dist/client/assets/{avatar-D0pQKePK.js → avatar-B7xnPXuk.js} +1 -1
  37. package/dist/client/assets/{badge-9bzwrgbk.js → badge-BVO6I0sW.js} +1 -1
  38. package/dist/client/assets/{binder-B4r3FJOG.js → binder-By0LBK9Y.js} +1 -1
  39. package/dist/client/assets/{button-C_Xg9B1B.js → button-CGmrzkpY.js} +1 -1
  40. package/dist/client/assets/{card-BXLd4InC.js → card-DIjMh1NO.js} +1 -1
  41. package/dist/client/assets/{checkbox-z9w2qryt.js → checkbox-DYViXeUc.js} +1 -1
  42. package/dist/client/assets/{collection-detail-zSSQWfP2.js → collection-detail-DtlOJm8P.js} +1 -1
  43. package/dist/client/assets/{collection-display-button-DNzo_eaI.js → collection-display-button-CtkxsCB_.js} +1 -1
  44. package/dist/client/assets/{collection-header-DMI-enxo.js → collection-header-B4qcjEt5.js} +1 -1
  45. package/dist/client/assets/{collection-page-CPVm36im.js → collection-page-s-RR5fU6.js} +1 -1
  46. package/dist/client/assets/{collection-search-NPXhv3P8.js → collection-search-BVb42O45.js} +1 -1
  47. package/dist/client/assets/{collection-tab-DoDfK_be.js → collection-tab-CvrhLJCU.js} +1 -1
  48. package/dist/client/assets/{collection-table-wrapper-CH0cDKjW.js → collection-table-wrapper-BohFZqii.js} +1 -1
  49. package/dist/client/assets/{connection-DoXpv3Ov.js → connection-ChwHK0-S.js} +1 -1
  50. package/dist/client/assets/{connection-card-zeRxy9uc.js → connection-card-DMMfNQUo.js} +1 -1
  51. package/dist/client/assets/{connection-detail-vV4L4jYp.js → connection-detail-D9bORT-_.js} +1 -1
  52. package/dist/client/assets/{connections-DNpwgzUU.js → connections-CRhyn7eO.js} +1 -1
  53. package/dist/client/assets/constants-J0aH6mLs.js +1 -0
  54. package/dist/client/assets/{create-organization-dialog-Ro3igzlR.js → create-organization-dialog-CtbMd6S_.js} +1 -1
  55. package/dist/client/assets/{dialog-C9Agm5JE.js → dialog-DJJ2cvEE.js} +1 -1
  56. package/dist/client/assets/{dropdown-menu-fQ8f1M5d.js → dropdown-menu-CAeD2aIb.js} +1 -1
  57. package/dist/client/assets/{dynamic-plugin-layout-B3cv12GM.js → dynamic-plugin-layout-BeSg8wRq.js} +1 -1
  58. package/dist/client/assets/{empty-state-DdUozeuW.js → empty-state-BkAB-hls.js} +1 -1
  59. package/dist/client/assets/{empty-state-DBRX3hef.js → empty-state-wP9uukGJ.js} +1 -1
  60. package/dist/client/assets/{env-vars-editor-BXw6d8cC.js → env-vars-editor-DuH6BBdA.js} +1 -1
  61. package/dist/client/assets/{error-boundary-yHT4ni_0.js → error-boundary-BUvK8Sry.js} +1 -1
  62. package/dist/client/assets/{extract-connection-data-PVjaut0P.js → extract-connection-data-BLs0SRok.js} +1 -1
  63. package/dist/client/assets/{file-browser-Bh7hl3h8.js → file-browser-DuR45yyf.js} +2 -2
  64. package/dist/client/assets/{form-D_wQlmgT.js → form-DiGzBnRK.js} +1 -1
  65. package/dist/client/assets/gateway-detail-BCBmyW-G.js +1 -0
  66. package/dist/client/assets/{gateways-B0QSXg4v.js → gateways-BgSVXbfx.js} +1 -1
  67. package/dist/client/assets/{grid-view-BsHjiotE.js → grid-view-Db741zGU.js} +1 -1
  68. package/dist/client/assets/{home-m3uBo7L5.js → home-BtJc_wcZ.js} +1 -1
  69. package/dist/client/assets/{index-QjJpaT60.js → index-CL_rL7XJ.js} +4 -4
  70. package/dist/client/assets/{index-Cg8UjPnN.js → index-D4QCsSzb.js} +1 -1
  71. package/dist/client/assets/index-DUA-vRuy.js +1 -0
  72. package/dist/client/assets/{index-DZBCLPmz.js → index-Diww4UW3.js} +2 -2
  73. package/dist/client/assets/{index-3IJwc3nu.js → index-DjRWdLI4.js} +1 -1
  74. package/dist/client/assets/index-H07QDM93.css +1 -0
  75. package/dist/client/assets/{infiniteQueryObserver-CB9iuYaY.js → infiniteQueryObserver-BmbQcWdI.js} +1 -1
  76. package/dist/client/assets/{input-DrOaW48H.js → input-CrURMEZe.js} +1 -1
  77. package/dist/client/assets/{layout-B4oQiZN6.js → layout-kp8TTJc9.js} +1 -1
  78. package/dist/client/assets/{lazy-highlighter-CSmD3B45.js → lazy-highlighter-dN3WcL6s.js} +1 -1
  79. package/dist/client/assets/{localstorage-keys-ColTY5EO.js → localstorage-keys-BVANkONM.js} +1 -1
  80. package/dist/client/assets/{login-BdRlUNll.js → login-CnuJ6k4x.js} +1 -1
  81. package/dist/client/assets/{mcp-oauth-CcVuDlog.js → mcp-oauth-CdcIczUJ.js} +1 -1
  82. package/dist/client/assets/{mcp-server-card-BnclXini.js → mcp-server-card-VZUBDTRj.js} +1 -1
  83. package/dist/client/assets/{mcp-server-detail-DTSTQPDK.js → mcp-server-detail-CIR0FKMd.js} +1 -1
  84. package/dist/client/assets/{members-BAse2YpR.js → members-bQTH1spX.js} +1 -1
  85. package/dist/client/assets/{monaco-editor-BtLswDg1.js → monaco-editor-CDRbE4GY.js} +1 -1
  86. package/dist/client/assets/{monitoring-FELvrXqN.js → monitoring-Cb41cf-X.js} +1 -1
  87. package/dist/client/assets/{oauth-callback-sXSk4y6N.js → oauth-callback-z6t0OToi.js} +1 -1
  88. package/dist/client/assets/{page-IVcVoGr6.js → page-CcKdSzCp.js} +1 -1
  89. package/dist/client/assets/{page-c25MW39x.js → page-SWPgLEpC.js} +1 -1
  90. package/dist/client/assets/{pin-to-sidebar-button-D7zfHxC-.js → pin-to-sidebar-button-DIwkO0Tx.js} +1 -1
  91. package/dist/client/assets/{plugin-empty-state-DINK0udh.js → plugin-empty-state-B-glkOMH.js} +1 -1
  92. package/dist/client/assets/{plugin-header-BaOkI6uW.js → plugin-header-BA0z5mBU.js} +1 -1
  93. package/dist/client/assets/{plugins-DU28fvG7.js → plugins-Cq62fkYj.js} +1 -1
  94. package/dist/client/assets/{popover-DDq46px5.js → popover-Bx7diZ86.js} +1 -1
  95. package/dist/client/assets/{project-context-provider-CwtkfEWe.js → project-context-provider-DulCVL2k.js} +1 -1
  96. package/dist/client/assets/{registry-utils-nz3H3-qh.js → registry-utils-8Lvx2XTy.js} +1 -1
  97. package/dist/client/assets/{resizable-ZYLqRZrr.js → resizable-Gk1RjNnW.js} +1 -1
  98. package/dist/client/assets/{resource-tabs-Dv00g9SH.js → resource-tabs-ACbF96qo.js} +1 -1
  99. package/dist/client/assets/{select-Cgab7LNB.js → select-C8LOz7vA.js} +1 -1
  100. package/dist/client/assets/{settings-CUngx_cw.js → settings-BXJ6BGel.js} +1 -1
  101. package/dist/client/assets/shell-layout-CFRw9Ru3.js +3 -0
  102. package/dist/client/assets/{spinner-ISlo4YZH.js → spinner-BF56RAKQ.js} +1 -1
  103. package/dist/client/assets/{switch-BDCe2nGJ.js → switch-DJBd8Fzb.js} +1 -1
  104. package/dist/client/assets/{textarea-BL4bZEBo.js → textarea-C_zgj3Sp.js} +1 -1
  105. package/dist/client/assets/{tool-set-selector-CWxawPKU.js → tool-set-selector-B9rTBahU.js} +1 -1
  106. package/dist/client/assets/{tools-list-BAdvjUaK.js → tools-list-mr-l2d8l.js} +1 -1
  107. package/dist/client/assets/{tooltip-CpJ7mUzE.js → tooltip-Suu_Gpqh.js} +1 -1
  108. package/dist/client/assets/{typewriter-title-vVGiDyZ3.js → typewriter-title-DM-oRxie.js} +1 -1
  109. package/dist/client/assets/{use-binding-DGnotkAI.js → use-binding-D6wv_5fO.js} +1 -1
  110. package/dist/client/assets/{use-collections-BmF5uRR6.js → use-collections-CXETocKO.js} +1 -1
  111. package/dist/client/assets/{use-connection-CD3KQhdl.js → use-connection-CCXutWLD.js} +1 -1
  112. package/dist/client/assets/{use-connection-resources-Bk8Paqb0.js → use-connection-resources-D0st76bP.js} +1 -1
  113. package/dist/client/assets/{use-create-gateway-Buvj1BPg.js → use-create-gateway-BlLsktgc.js} +1 -1
  114. package/dist/client/assets/{use-gateway-HT97xIYl.js → use-gateway-DD-xEZju.js} +1 -1
  115. package/dist/client/assets/{use-gateway-system-prompt-DPiQIOlu.js → use-gateway-system-prompt-zGJSEzce.js} +1 -1
  116. package/dist/client/assets/{use-list-state-DceT21J-.js → use-list-state-AndcW8aD.js} +1 -1
  117. package/dist/client/assets/{use-mcp-C2xjgZVM.js → use-mcp-D9llr83X.js} +1 -1
  118. package/dist/client/assets/{use-members-D-h9QOxK.js → use-members-CB2ebBfn.js} +1 -1
  119. package/dist/client/assets/{use-mobile-BH2x5CB1.js → use-mobile-DssCtDl6.js} +1 -1
  120. package/dist/client/assets/{use-organization-settings-BMsrsPvw.js → use-organization-settings-CQXtXtZs.js} +1 -1
  121. package/dist/client/assets/{use-tool-call-BmQnCqef.js → use-tool-call-BmvKn7jp.js} +1 -1
  122. package/dist/client/assets/useInfiniteQuery-BttwTOfK.js +1 -0
  123. package/dist/client/assets/{useMutation-DV6K6Nze.js → useMutation-Dl1MMkEC.js} +1 -1
  124. package/dist/client/assets/useQuery-Bvk0U2ed.js +1 -0
  125. package/dist/client/assets/{value-BiYWDF0x.js → value-DaPOjTmC.js} +1 -1
  126. package/dist/client/assets/{view-mode-toggle-DPk8_aIn.js → view-mode-toggle-BLClM-0g.js} +1 -1
  127. package/dist/client/assets/{workflow-B_8Qc7GH.js → workflow-CQ7PQ7Dg.js} +1 -1
  128. package/dist/client/index.html +2 -2
  129. package/dist/server/cli.js +1 -1
  130. package/dist/server/node_modules/kysely/README.md +3 -1
  131. package/dist/server/node_modules/kysely/dist/cjs/index.d.ts +3 -1
  132. package/dist/server/node_modules/kysely/dist/cjs/migration/migrator.d.ts +1 -1
  133. package/dist/server/node_modules/kysely/dist/cjs/migration/migrator.js +75 -68
  134. package/dist/server/node_modules/kysely/dist/esm/index.d.ts +3 -1
  135. package/dist/server/node_modules/kysely/dist/esm/migration/migrator.d.ts +1 -1
  136. package/dist/server/node_modules/kysely/dist/esm/migration/migrator.js +75 -68
  137. package/dist/server/node_modules/kysely/package.json +13 -13
  138. package/dist/server/server.js +1 -1
  139. package/package.json +1 -1
  140. package/dist/client/assets/constants-CBp9PjFO.js +0 -1
  141. package/dist/client/assets/gateway-detail-B6I6y-jz.js +0 -1
  142. package/dist/client/assets/index-Dh9ePU0t.css +0 -1
  143. package/dist/client/assets/index-DiisCGqz.js +0 -1
  144. package/dist/client/assets/shell-layout-IdYGAQZJ.js +0 -3
  145. package/dist/client/assets/useInfiniteQuery-hrzJXDha.js +0 -1
  146. package/dist/client/assets/useQuery-mZS4-X0F.js +0 -1
@@ -1 +1 @@
1
- import{r as i,aj as A,aa as $,j as c,am as L,a5 as z,as as G,a3 as _,a6 as j,a8 as g,ak as w,a7 as E,al as H,aY as K,aZ as Z,a_ as U,a$ as V,b0 as W,an as Y,ao as q,ap as B,c as R}from"./index-DZBCLPmz.js";import{c as J}from"./button-C_Xg9B1B.js";var x="Popover",[b]=z(x,[A]),P=A(),[Q,d]=b(x),N=t=>{const{__scopePopover:e,children:o,open:r,defaultOpen:n,onOpenChange:a,modal:s=!1}=t,p=P(e),l=i.useRef(null),[u,h]=i.useState(!1),[m,f]=$({prop:r,defaultProp:n??!1,onChange:a,caller:x});return c.jsx(L,{...p,children:c.jsx(Q,{scope:e,contentId:G(),triggerRef:l,open:m,onOpenChange:f,onOpenToggle:i.useCallback(()=>f(C=>!C),[f]),hasCustomAnchor:u,onCustomAnchorAdd:i.useCallback(()=>h(!0),[]),onCustomAnchorRemove:i.useCallback(()=>h(!1),[]),modal:s,children:o})})};N.displayName=x;var F="PopoverAnchor",X=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=d(F,o),a=P(o),{onCustomAnchorAdd:s,onCustomAnchorRemove:p}=n;return i.useEffect(()=>(s(),()=>p()),[s,p]),c.jsx(w,{...a,...r,ref:e})});X.displayName=F;var S="PopoverTrigger",y=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=d(S,o),a=P(o),s=_(e,n.triggerRef),p=c.jsx(j.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":I(n.open),...r,ref:s,onClick:g(t.onClick,n.onOpenToggle)});return n.hasCustomAnchor?p:c.jsx(w,{asChild:!0,...a,children:p})});y.displayName=S;var O="PopoverPortal",[ee,oe]=b(O,{forceMount:void 0}),D=t=>{const{__scopePopover:e,forceMount:o,children:r,container:n}=t,a=d(O,e);return c.jsx(ee,{scope:e,forceMount:o,children:c.jsx(E,{present:o||a.open,children:c.jsx(H,{asChild:!0,container:n,children:r})})})};D.displayName=O;var v="PopoverContent",M=i.forwardRef((t,e)=>{const o=oe(v,t.__scopePopover),{forceMount:r=o.forceMount,...n}=t,a=d(v,t.__scopePopover);return c.jsx(E,{present:r||a.open,children:a.modal?c.jsx(re,{...n,ref:e}):c.jsx(ne,{...n,ref:e})})});M.displayName=v;var te=U("PopoverContent.RemoveScroll"),re=i.forwardRef((t,e)=>{const o=d(v,t.__scopePopover),r=i.useRef(null),n=_(e,r),a=i.useRef(!1);return i.useEffect(()=>{const s=r.current;if(s)return K(s)},[]),c.jsx(Z,{as:te,allowPinchZoom:!0,children:c.jsx(k,{...t,ref:n,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:g(t.onCloseAutoFocus,s=>{s.preventDefault(),a.current||o.triggerRef.current?.focus()}),onPointerDownOutside:g(t.onPointerDownOutside,s=>{const p=s.detail.originalEvent,l=p.button===0&&p.ctrlKey===!0,u=p.button===2||l;a.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:g(t.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),ne=i.forwardRef((t,e)=>{const o=d(v,t.__scopePopover),r=i.useRef(!1),n=i.useRef(!1);return c.jsx(k,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{t.onCloseAutoFocus?.(a),a.defaultPrevented||(r.current||o.triggerRef.current?.focus(),a.preventDefault()),r.current=!1,n.current=!1},onInteractOutside:a=>{t.onInteractOutside?.(a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const s=a.target;o.triggerRef.current?.contains(s)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&n.current&&a.preventDefault()}})}),k=i.forwardRef((t,e)=>{const{__scopePopover:o,trapFocus:r,onOpenAutoFocus:n,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEscapeKeyDown:p,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:h,...m}=t,f=d(v,o),C=P(o);return V(),c.jsx(W,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:n,onUnmountAutoFocus:a,children:c.jsx(Y,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:h,onEscapeKeyDown:p,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>f.onOpenChange(!1),children:c.jsx(q,{"data-state":I(f.open),role:"dialog",id:f.contentId,...C,...m,ref:e,style:{...m.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),T="PopoverClose",ae=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=d(T,o);return c.jsx(j.button,{type:"button",...r,ref:e,onClick:g(t.onClick,()=>n.onOpenChange(!1))})});ae.displayName=T;var se="PopoverArrow",ce=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=P(o);return c.jsx(B,{...n,...r,ref:e})});ce.displayName=se;function I(t){return t?"open":"closed"}var ie=N,pe=y,le=D,ue=M;function ve(t){const e=R.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=c.jsx(ie,{"data-slot":"popover",...o}),e[2]=o,e[3]=r):r=e[3],r}function ge(t){const e=R.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=c.jsx(pe,{"data-slot":"popover-trigger",...o}),e[2]=o,e[3]=r):r=e[3],r}function Pe(t){const e=R.c(12);let o,r,n,a;e[0]!==t?({className:o,align:n,sideOffset:a,...r}=t,e[0]=t,e[1]=o,e[2]=r,e[3]=n,e[4]=a):(o=e[1],r=e[2],n=e[3],a=e[4]);const s=n===void 0?"center":n,p=a===void 0?4:a;let l;e[5]!==o?(l=J("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 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-lg overflow-hidden border p-4 shadow-md outline-hidden",o),e[5]=o,e[6]=l):l=e[6];let u;return e[7]!==s||e[8]!==r||e[9]!==p||e[10]!==l?(u=c.jsx(le,{children:c.jsx(ue,{"data-slot":"popover-content",align:s,sideOffset:p,className:l,...r})}),e[7]=s,e[8]=r,e[9]=p,e[10]=l,e[11]=u):u=e[11],u}export{ve as P,ge as a,Pe as b};
1
+ import{r as i,aj as A,aa as $,j as c,am as L,a5 as z,as as G,a3 as _,a6 as j,a8 as g,ak as w,a7 as E,al as H,aY as K,aZ as Z,a_ as U,a$ as V,b0 as W,an as Y,ao as q,ap as B,c as R}from"./index-Diww4UW3.js";import{c as J}from"./button-CGmrzkpY.js";var x="Popover",[b]=z(x,[A]),P=A(),[Q,d]=b(x),N=t=>{const{__scopePopover:e,children:o,open:r,defaultOpen:n,onOpenChange:a,modal:s=!1}=t,p=P(e),l=i.useRef(null),[u,h]=i.useState(!1),[m,f]=$({prop:r,defaultProp:n??!1,onChange:a,caller:x});return c.jsx(L,{...p,children:c.jsx(Q,{scope:e,contentId:G(),triggerRef:l,open:m,onOpenChange:f,onOpenToggle:i.useCallback(()=>f(C=>!C),[f]),hasCustomAnchor:u,onCustomAnchorAdd:i.useCallback(()=>h(!0),[]),onCustomAnchorRemove:i.useCallback(()=>h(!1),[]),modal:s,children:o})})};N.displayName=x;var F="PopoverAnchor",X=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=d(F,o),a=P(o),{onCustomAnchorAdd:s,onCustomAnchorRemove:p}=n;return i.useEffect(()=>(s(),()=>p()),[s,p]),c.jsx(w,{...a,...r,ref:e})});X.displayName=F;var S="PopoverTrigger",y=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=d(S,o),a=P(o),s=_(e,n.triggerRef),p=c.jsx(j.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":I(n.open),...r,ref:s,onClick:g(t.onClick,n.onOpenToggle)});return n.hasCustomAnchor?p:c.jsx(w,{asChild:!0,...a,children:p})});y.displayName=S;var O="PopoverPortal",[ee,oe]=b(O,{forceMount:void 0}),D=t=>{const{__scopePopover:e,forceMount:o,children:r,container:n}=t,a=d(O,e);return c.jsx(ee,{scope:e,forceMount:o,children:c.jsx(E,{present:o||a.open,children:c.jsx(H,{asChild:!0,container:n,children:r})})})};D.displayName=O;var v="PopoverContent",M=i.forwardRef((t,e)=>{const o=oe(v,t.__scopePopover),{forceMount:r=o.forceMount,...n}=t,a=d(v,t.__scopePopover);return c.jsx(E,{present:r||a.open,children:a.modal?c.jsx(re,{...n,ref:e}):c.jsx(ne,{...n,ref:e})})});M.displayName=v;var te=U("PopoverContent.RemoveScroll"),re=i.forwardRef((t,e)=>{const o=d(v,t.__scopePopover),r=i.useRef(null),n=_(e,r),a=i.useRef(!1);return i.useEffect(()=>{const s=r.current;if(s)return K(s)},[]),c.jsx(Z,{as:te,allowPinchZoom:!0,children:c.jsx(k,{...t,ref:n,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:g(t.onCloseAutoFocus,s=>{s.preventDefault(),a.current||o.triggerRef.current?.focus()}),onPointerDownOutside:g(t.onPointerDownOutside,s=>{const p=s.detail.originalEvent,l=p.button===0&&p.ctrlKey===!0,u=p.button===2||l;a.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:g(t.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),ne=i.forwardRef((t,e)=>{const o=d(v,t.__scopePopover),r=i.useRef(!1),n=i.useRef(!1);return c.jsx(k,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{t.onCloseAutoFocus?.(a),a.defaultPrevented||(r.current||o.triggerRef.current?.focus(),a.preventDefault()),r.current=!1,n.current=!1},onInteractOutside:a=>{t.onInteractOutside?.(a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const s=a.target;o.triggerRef.current?.contains(s)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&n.current&&a.preventDefault()}})}),k=i.forwardRef((t,e)=>{const{__scopePopover:o,trapFocus:r,onOpenAutoFocus:n,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEscapeKeyDown:p,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:h,...m}=t,f=d(v,o),C=P(o);return V(),c.jsx(W,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:n,onUnmountAutoFocus:a,children:c.jsx(Y,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:h,onEscapeKeyDown:p,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>f.onOpenChange(!1),children:c.jsx(q,{"data-state":I(f.open),role:"dialog",id:f.contentId,...C,...m,ref:e,style:{...m.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),T="PopoverClose",ae=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=d(T,o);return c.jsx(j.button,{type:"button",...r,ref:e,onClick:g(t.onClick,()=>n.onOpenChange(!1))})});ae.displayName=T;var se="PopoverArrow",ce=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=P(o);return c.jsx(B,{...n,...r,ref:e})});ce.displayName=se;function I(t){return t?"open":"closed"}var ie=N,pe=y,le=D,ue=M;function ve(t){const e=R.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=c.jsx(ie,{"data-slot":"popover",...o}),e[2]=o,e[3]=r):r=e[3],r}function ge(t){const e=R.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=c.jsx(pe,{"data-slot":"popover-trigger",...o}),e[2]=o,e[3]=r):r=e[3],r}function Pe(t){const e=R.c(12);let o,r,n,a;e[0]!==t?({className:o,align:n,sideOffset:a,...r}=t,e[0]=t,e[1]=o,e[2]=r,e[3]=n,e[4]=a):(o=e[1],r=e[2],n=e[3],a=e[4]);const s=n===void 0?"center":n,p=a===void 0?4:a;let l;e[5]!==o?(l=J("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 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-lg overflow-hidden border p-4 shadow-md outline-hidden",o),e[5]=o,e[6]=l):l=e[6];let u;return e[7]!==s||e[8]!==r||e[9]!==p||e[10]!==l?(u=c.jsx(le,{children:c.jsx(ue,{"data-slot":"popover-content",align:s,sideOffset:p,className:l,...r})}),e[7]=s,e[8]=r,e[9]=p,e[10]=l,e[11]=u):u=e[11],u}export{ve as P,ge as a,Pe as b};
@@ -1 +1 @@
1
- import{r as x,c as d,j as p}from"./index-DZBCLPmz.js";const a="org-admin",P={from({org:r,project:t}){if(r?.includes("/")||t.includes("/"))throw new Error("Org or project cannot contain slashes");return`${r}/${t}`},parse(r){r.startsWith("/")&&(r=r.slice(1));const[t,e]=r.split("/");if(!t||!e)throw new Error("Invalid locator");return{org:t,project:e}},isOrgAdminProject(r){return r.split("/")[1]===a},adminProject(r){return`${r}/${a}`}},j=x.createContext(void 0),m=()=>{const r=x.useContext(j);if(!r)throw new Error("useProjectContext must be used within a ProjectContextProvider");return r},f=r=>{const t=d.c(10),{children:e,org:o,project:s}=r;let n;t[0]!==o.slug||t[1]!==s.slug?(n=P.from({org:o.slug,project:s.slug}),t[0]=o.slug,t[1]=s.slug,t[2]=n):n=t[2];const u=n;let c;t[3]!==u||t[4]!==o||t[5]!==s?(c={org:o,project:s,locator:u},t[3]=u,t[4]=o,t[5]=s,t[6]=c):c=t[6];const l=c;let i;return t[7]!==e||t[8]!==l?(i=p.jsx(j.Provider,{value:l,children:e}),t[7]=e,t[8]=l,t[9]=i):i=t[9],i};export{P as L,a as O,f as P,m as u};
1
+ import{r as x,c as d,j as p}from"./index-Diww4UW3.js";const a="org-admin",P={from({org:r,project:t}){if(r?.includes("/")||t.includes("/"))throw new Error("Org or project cannot contain slashes");return`${r}/${t}`},parse(r){r.startsWith("/")&&(r=r.slice(1));const[t,e]=r.split("/");if(!t||!e)throw new Error("Invalid locator");return{org:t,project:e}},isOrgAdminProject(r){return r.split("/")[1]===a},adminProject(r){return`${r}/${a}`}},j=x.createContext(void 0),m=()=>{const r=x.useContext(j);if(!r)throw new Error("useProjectContext must be used within a ProjectContextProvider");return r},f=r=>{const t=d.c(10),{children:e,org:o,project:s}=r;let n;t[0]!==o.slug||t[1]!==s.slug?(n=P.from({org:o.slug,project:s.slug}),t[0]=o.slug,t[1]=s.slug,t[2]=n):n=t[2];const u=n;let c;t[3]!==u||t[4]!==o||t[5]!==s?(c={org:o,project:s,locator:u},t[3]=u,t[4]=o,t[5]=s,t[6]=c):c=t[6];const l=c;let i;return t[7]!==e||t[8]!==l?(i=p.jsx(j.Provider,{value:l,children:e}),t[7]=e,t[8]=l,t[9]=i):i=t[9],i};export{P as L,a as O,f as P,m as u};
@@ -1 +1 @@
1
- import{r as a}from"./index-DZBCLPmz.js";const s=({size:t=24,color:r="currentColor",...e})=>a.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:r,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e},a.createElement("path",{d:"M12 2a15.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 10m0-20C6.477 2 2 6.477 2 12s4.477 10 10 10m0-20c5.523 0 10 4.477 10 10s-4.477 10-10 10M2.5 9h19m-19 6h19"}));s.displayName="Globe02";function l(t){return t?t.find(e=>e.name.endsWith("_LIST"))?.name??"":""}function u(t){return t?t.find(e=>e.name.endsWith("_FILTERS"))?.name??"":""}function m(t){if(!t)return[];const r=[];for(const e of t){let n=[];if(Array.isArray(e))n=e;else if(typeof e=="object"&&e!==null){const i=Object.keys(e).find(o=>Array.isArray(e[o]));i&&(n=e[i])}r.push(...n)}return r}const c={"streamable-http":"HTTP",http:"HTTP",sse:"SSE",stdio:"STDIO",websocket:"Websocket"};function d(t){return t?c[t]??t.toUpperCase():null}function h(t){return t?t.match(/schemas\/([\d-]+)/)?.[1]??null:null}function y(t){if(!t)return[];if(Array.isArray(t))return t;if(typeof t=="object"&&t!==null){const r=Object.keys(t).find(e=>Array.isArray(t[e]));if(r)return t[r]}return[]}export{m as a,u as b,h as c,y as e,l as f,d as g,s};
1
+ import{r as a}from"./index-Diww4UW3.js";const s=({size:t=24,color:r="currentColor",...e})=>a.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:r,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e},a.createElement("path",{d:"M12 2a15.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 10m0-20C6.477 2 2 6.477 2 12s4.477 10 10 10m0-20c5.523 0 10 4.477 10 10s-4.477 10-10 10M2.5 9h19m-19 6h19"}));s.displayName="Globe02";function l(t){return t?t.find(e=>e.name.endsWith("_LIST"))?.name??"":""}function u(t){return t?t.find(e=>e.name.endsWith("_FILTERS"))?.name??"":""}function m(t){if(!t)return[];const r=[];for(const e of t){let n=[];if(Array.isArray(e))n=e;else if(typeof e=="object"&&e!==null){const i=Object.keys(e).find(o=>Array.isArray(e[o]));i&&(n=e[i])}r.push(...n)}return r}const c={"streamable-http":"HTTP",http:"HTTP",sse:"SSE",stdio:"STDIO",websocket:"Websocket"};function d(t){return t?c[t]??t.toUpperCase():null}function h(t){return t?t.match(/schemas\/([\d-]+)/)?.[1]??null:null}function y(t){if(!t)return[];if(Array.isArray(t))return t;if(typeof t=="object"&&t!==null){const r=Object.keys(t).find(e=>Array.isArray(t[e]));if(r)return t[r]}return[]}export{m as a,u as b,h as c,y as e,l as f,d as g,s};
@@ -1 +1 @@
1
- import{r as f,a0 as Pn,c as He,j as he}from"./index-DZBCLPmz.js";import{c as Je}from"./button-C_Xg9B1B.js";const Ye=({size:n=24,color:e="currentColor",...t})=>f.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},f.createElement("path",{d:"M12 6a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm7-14a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM5 6a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"}));Ye.displayName="DotsGrid";const Ee=f.createContext(null);Ee.displayName="PanelGroupContext";const A={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},_e=10,ne=f.useLayoutEffect,Fe=Pn.useId,wn=typeof Fe=="function"?Fe:()=>null;let En=0;function Ge(n=null){const e=wn(),t=f.useRef(n||e||null);return t.current===null&&(t.current=""+En++),n??t.current}function Qe({children:n,className:e="",collapsedSize:t,collapsible:r,defaultSize:i,forwardedRef:o,id:l,maxSize:a,minSize:s,onCollapse:h,onExpand:w,onResize:p,order:u,style:v,tagName:z="div",...C}){const E=f.useContext(Ee);if(E===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:S,expandPanel:L,getPanelSize:N,getPanelStyle:D,groupId:V,isPanelCollapsed:R,reevaluatePanelConstraints:P,registerPanel:F,resizePanel:q,unregisterPanel:W}=E,G=Ge(l),M=f.useRef({callbacks:{onCollapse:h,onExpand:w,onResize:p},constraints:{collapsedSize:t,collapsible:r,defaultSize:i,maxSize:a,minSize:s},id:G,idIsFromProps:l!==void 0,order:u});f.useRef({didLogMissingDefaultSizeWarning:!1}),ne(()=>{const{callbacks:_,constraints:H}=M.current,B={...H};M.current.id=G,M.current.idIsFromProps=l!==void 0,M.current.order=u,_.onCollapse=h,_.onExpand=w,_.onResize=p,H.collapsedSize=t,H.collapsible=r,H.defaultSize=i,H.maxSize=a,H.minSize=s,(B.collapsedSize!==H.collapsedSize||B.collapsible!==H.collapsible||B.maxSize!==H.maxSize||B.minSize!==H.minSize)&&P(M.current,B)}),ne(()=>{const _=M.current;return F(_),()=>{W(_)}},[u,G,F,W]),f.useImperativeHandle(o,()=>({collapse:()=>{S(M.current)},expand:_=>{L(M.current,_)},getId(){return G},getSize(){return N(M.current)},isCollapsed(){return R(M.current)},isExpanded(){return!R(M.current)},resize:_=>{q(M.current,_)}}),[S,L,N,R,G,q]);const Y=D(M.current,i);return f.createElement(z,{...C,children:n,className:e,id:G,style:{...Y,...v},[A.groupId]:V,[A.panel]:"",[A.panelCollapsible]:r||void 0,[A.panelId]:G,[A.panelSize]:parseFloat(""+Y.flexGrow).toFixed(1)})}const en=f.forwardRef((n,e)=>f.createElement(Qe,{...n,forwardedRef:e}));Qe.displayName="Panel";en.displayName="forwardRef(Panel)";let De=null,Se=-1,J=null;function Cn(n,e){if(e){const t=(e&ln)!==0,r=(e&an)!==0,i=(e&sn)!==0,o=(e&un)!==0;if(t)return i?"se-resize":o?"ne-resize":"e-resize";if(r)return i?"sw-resize":o?"nw-resize":"w-resize";if(i)return"s-resize";if(o)return"n-resize"}switch(n){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function In(){J!==null&&(document.head.removeChild(J),De=null,J=null,Se=-1)}function ke(n,e){var t,r;const i=Cn(n,e);if(De!==i){if(De=i,J===null&&(J=document.createElement("style"),document.head.appendChild(J)),Se>=0){var o;(o=J.sheet)===null||o===void 0||o.removeRule(Se)}Se=(t=(r=J.sheet)===null||r===void 0?void 0:r.insertRule(`*{cursor: ${i} !important;}`))!==null&&t!==void 0?t:-1}}function nn(n){return n.type==="keydown"}function tn(n){return n.type.startsWith("pointer")}function rn(n){return n.type.startsWith("mouse")}function Ce(n){if(tn(n)){if(n.isPrimary)return{x:n.clientX,y:n.clientY}}else if(rn(n))return{x:n.clientX,y:n.clientY};return{x:1/0,y:1/0}}function Rn(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function Ln(n,e,t){return n.x<e.x+e.width&&n.x+n.width>e.x&&n.y<e.y+e.height&&n.y+n.height>e.y}function kn(n,e){if(n===e)throw new Error("Cannot compare node with itself");const t={a:Ve(n),b:Ve(e)};let r;for(;t.a.at(-1)===t.b.at(-1);)n=t.a.pop(),e=t.b.pop(),r=n;x(r,"Stacking order can only be calculated for elements with a common ancestor");const i={a:Ue(Ke(t.a)),b:Ue(Ke(t.b))};if(i.a===i.b){const o=r.childNodes,l={a:t.a.at(-1),b:t.b.at(-1)};let a=o.length;for(;a--;){const s=o[a];if(s===l.a)return 1;if(s===l.b)return-1}}return Math.sign(i.a-i.b)}const An=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Mn(n){var e;const t=getComputedStyle((e=on(n))!==null&&e!==void 0?e:n).display;return t==="flex"||t==="inline-flex"}function Nn(n){const e=getComputedStyle(n);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||Mn(n))||+e.opacity<1||"transform"in e&&e.transform!=="none"||"webkitTransform"in e&&e.webkitTransform!=="none"||"mixBlendMode"in e&&e.mixBlendMode!=="normal"||"filter"in e&&e.filter!=="none"||"webkitFilter"in e&&e.webkitFilter!=="none"||"isolation"in e&&e.isolation==="isolate"||An.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function Ke(n){let e=n.length;for(;e--;){const t=n[e];if(x(t,"Missing node"),Nn(t))return t}return null}function Ue(n){return n&&Number(getComputedStyle(n).zIndex)||0}function Ve(n){const e=[];for(;n;)e.push(n),n=on(n);return e}function on(n){const{parentNode:e}=n;return e&&e instanceof ShadowRoot?e.host:e}const ln=1,an=2,sn=4,un=8,$n=Rn()==="coarse";let U=[],ae=!1,ee=new Map,Ie=new Map;const ze=new Set;function Dn(n,e,t,r,i){var o;const{ownerDocument:l}=e,a={direction:t,element:e,hitAreaMargins:r,setResizeHandlerState:i},s=(o=ee.get(l))!==null&&o!==void 0?o:0;return ee.set(l,s+1),ze.add(a),Pe(),function(){var w;Ie.delete(n),ze.delete(a);const p=(w=ee.get(l))!==null&&w!==void 0?w:1;if(ee.set(l,p-1),Pe(),p===1&&ee.delete(l),U.includes(a)){const u=U.indexOf(a);u>=0&&U.splice(u,1),Te(),i("up",!0,null)}}}function Hn(n){const{target:e}=n,{x:t,y:r}=Ce(n);ae=!0,Be({target:e,x:t,y:r}),Pe(),U.length>0&&(we("down",n),n.preventDefault(),cn(e)||n.stopImmediatePropagation())}function Ae(n){const{x:e,y:t}=Ce(n);if(ae&&n.buttons===0&&(ae=!1,we("up",n)),!ae){const{target:r}=n;Be({target:r,x:e,y:t})}we("move",n),Te(),U.length>0&&n.preventDefault()}function Me(n){const{target:e}=n,{x:t,y:r}=Ce(n);Ie.clear(),ae=!1,U.length>0&&(n.preventDefault(),cn(e)||n.stopImmediatePropagation()),we("up",n),Be({target:e,x:t,y:r}),Te(),Pe()}function cn(n){let e=n;for(;e;){if(e.hasAttribute(A.resizeHandle))return!0;e=e.parentElement}return!1}function Be({target:n,x:e,y:t}){U.splice(0);let r=null;(n instanceof HTMLElement||n instanceof SVGElement)&&(r=n),ze.forEach(i=>{const{element:o,hitAreaMargins:l}=i,a=o.getBoundingClientRect(),{bottom:s,left:h,right:w,top:p}=a,u=$n?l.coarse:l.fine;if(e>=h-u&&e<=w+u&&t>=p-u&&t<=s+u){if(r!==null&&document.contains(r)&&o!==r&&!o.contains(r)&&!r.contains(o)&&kn(r,o)>0){let z=r,C=!1;for(;z&&!z.contains(o);){if(Ln(z.getBoundingClientRect(),a)){C=!0;break}z=z.parentElement}if(C)return}U.push(i)}})}function Ne(n,e){Ie.set(n,e)}function Te(){let n=!1,e=!1;U.forEach(r=>{const{direction:i}=r;i==="horizontal"?n=!0:e=!0});let t=0;Ie.forEach(r=>{t|=r}),n&&e?ke("intersection",t):n?ke("horizontal",t):e?ke("vertical",t):In()}let $e=new AbortController;function Pe(){$e.abort(),$e=new AbortController;const n={capture:!0,signal:$e.signal};ze.size&&(ae?(U.length>0&&ee.forEach((e,t)=>{const{body:r}=t;e>0&&(r.addEventListener("contextmenu",Me,n),r.addEventListener("pointerleave",Ae,n),r.addEventListener("pointermove",Ae,n))}),window.addEventListener("pointerup",Me,n),window.addEventListener("pointercancel",Me,n)):ee.forEach((e,t)=>{const{body:r}=t;e>0&&(r.addEventListener("pointerdown",Hn,n),r.addEventListener("pointermove",Ae,n))}))}function we(n,e){ze.forEach(t=>{const{setResizeHandlerState:r}=t,i=U.includes(t);r(n,i,e)})}function _n(){const[n,e]=f.useState(0);return f.useCallback(()=>e(t=>t+1),[])}function x(n,e){if(!n)throw console.error(e),Error(e)}function te(n,e,t=_e){return n.toFixed(t)===e.toFixed(t)?0:n>e?1:-1}function X(n,e,t=_e){return te(n,e,t)===0}function j(n,e,t){return te(n,e,t)===0}function Gn(n,e,t){if(n.length!==e.length)return!1;for(let r=0;r<n.length;r++){const i=n[r],o=e[r];if(!j(i,o,t))return!1}return!0}function le({panelConstraints:n,panelIndex:e,size:t}){const r=n[e];x(r!=null,`Panel constraints not found for index ${e}`);let{collapsedSize:i=0,collapsible:o,maxSize:l=100,minSize:a=0}=r;if(te(t,a)<0)if(o){const s=(i+a)/2;te(t,s)<0?t=i:t=a}else t=a;return t=Math.min(l,t),t=parseFloat(t.toFixed(_e)),t}function ge({delta:n,initialLayout:e,panelConstraints:t,pivotIndices:r,prevLayout:i,trigger:o}){if(j(n,0))return e;const l=[...e],[a,s]=r;x(a!=null,"Invalid first pivot index"),x(s!=null,"Invalid second pivot index");let h=0;if(o==="keyboard"){{const p=n<0?s:a,u=t[p];x(u,`Panel constraints not found for index ${p}`);const{collapsedSize:v=0,collapsible:z,minSize:C=0}=u;if(z){const E=e[p];if(x(E!=null,`Previous layout not found for panel index ${p}`),j(E,v)){const S=C-E;te(S,Math.abs(n))>0&&(n=n<0?0-S:S)}}}{const p=n<0?a:s,u=t[p];x(u,`No panel constraints found for index ${p}`);const{collapsedSize:v=0,collapsible:z,minSize:C=0}=u;if(z){const E=e[p];if(x(E!=null,`Previous layout not found for panel index ${p}`),j(E,C)){const S=E-v;te(S,Math.abs(n))>0&&(n=n<0?0-S:S)}}}}{const p=n<0?1:-1;let u=n<0?s:a,v=0;for(;;){const C=e[u];x(C!=null,`Previous layout not found for panel index ${u}`);const S=le({panelConstraints:t,panelIndex:u,size:100})-C;if(v+=S,u+=p,u<0||u>=t.length)break}const z=Math.min(Math.abs(n),Math.abs(v));n=n<0?0-z:z}{let u=n<0?a:s;for(;u>=0&&u<t.length;){const v=Math.abs(n)-Math.abs(h),z=e[u];x(z!=null,`Previous layout not found for panel index ${u}`);const C=z-v,E=le({panelConstraints:t,panelIndex:u,size:C});if(!j(z,E)&&(h+=z-E,l[u]=E,h.toPrecision(3).localeCompare(Math.abs(n).toPrecision(3),void 0,{numeric:!0})>=0))break;n<0?u--:u++}}if(Gn(i,l))return i;{const p=n<0?s:a,u=e[p];x(u!=null,`Previous layout not found for panel index ${p}`);const v=u+h,z=le({panelConstraints:t,panelIndex:p,size:v});if(l[p]=z,!j(z,v)){let C=v-z,S=n<0?s:a;for(;S>=0&&S<t.length;){const L=l[S];x(L!=null,`Previous layout not found for panel index ${S}`);const N=L+C,D=le({panelConstraints:t,panelIndex:S,size:N});if(j(L,D)||(C-=D-L,l[S]=D),j(C,0))break;n>0?S--:S++}}}const w=l.reduce((p,u)=>u+p,0);return j(w,100)?l:i}function Bn({layout:n,panelsArray:e,pivotIndices:t}){let r=0,i=100,o=0,l=0;const a=t[0];x(a!=null,"No pivot index found"),e.forEach((p,u)=>{const{constraints:v}=p,{maxSize:z=100,minSize:C=0}=v;u===a?(r=C,i=z):(o+=C,l+=z)});const s=Math.min(i,100-o),h=Math.max(r,100-l),w=n[a];return{valueMax:s,valueMin:h,valueNow:w}}function ye(n,e=document){return Array.from(e.querySelectorAll(`[${A.resizeHandleId}][data-panel-group-id="${n}"]`))}function fn(n,e,t=document){const i=ye(n,t).findIndex(o=>o.getAttribute(A.resizeHandleId)===e);return i??null}function dn(n,e,t){const r=fn(n,e,t);return r!=null?[r,r+1]:[-1,-1]}function pn(n,e=document){var t;if(e instanceof HTMLElement&&(e==null||(t=e.dataset)===null||t===void 0?void 0:t.panelGroupId)==n)return e;const r=e.querySelector(`[data-panel-group][data-panel-group-id="${n}"]`);return r||null}function Re(n,e=document){const t=e.querySelector(`[${A.resizeHandleId}="${n}"]`);return t||null}function Tn(n,e,t,r=document){var i,o,l,a;const s=Re(e,r),h=ye(n,r),w=s?h.indexOf(s):-1,p=(i=(o=t[w])===null||o===void 0?void 0:o.id)!==null&&i!==void 0?i:null,u=(l=(a=t[w+1])===null||a===void 0?void 0:a.id)!==null&&l!==void 0?l:null;return[p,u]}function Wn({committedValuesRef:n,eagerValuesRef:e,groupId:t,layout:r,panelDataArray:i,panelGroupElement:o,setLayout:l}){f.useRef({didWarnAboutMissingResizeHandle:!1}),ne(()=>{if(!o)return;const a=ye(t,o);for(let s=0;s<i.length-1;s++){const{valueMax:h,valueMin:w,valueNow:p}=Bn({layout:r,panelsArray:i,pivotIndices:[s,s+1]}),u=a[s];if(u!=null){const v=i[s];x(v,`No panel data found for index "${s}"`),u.setAttribute("aria-controls",v.id),u.setAttribute("aria-valuemax",""+Math.round(h)),u.setAttribute("aria-valuemin",""+Math.round(w)),u.setAttribute("aria-valuenow",p!=null?""+Math.round(p):"")}}return()=>{a.forEach((s,h)=>{s.removeAttribute("aria-controls"),s.removeAttribute("aria-valuemax"),s.removeAttribute("aria-valuemin"),s.removeAttribute("aria-valuenow")})}},[t,r,i,o]),f.useEffect(()=>{if(!o)return;const a=e.current;x(a,"Eager values not found");const{panelDataArray:s}=a,h=pn(t,o);x(h!=null,`No group found for id "${t}"`);const w=ye(t,o);x(w,`No resize handles found for group id "${t}"`);const p=w.map(u=>{const v=u.getAttribute(A.resizeHandleId);x(v,"Resize handle element has no handle id attribute");const[z,C]=Tn(t,v,s,o);if(z==null||C==null)return()=>{};const E=S=>{if(!S.defaultPrevented)switch(S.key){case"Enter":{S.preventDefault();const L=s.findIndex(N=>N.id===z);if(L>=0){const N=s[L];x(N,`No panel data found for index ${L}`);const D=r[L],{collapsedSize:V=0,collapsible:R,minSize:P=0}=N.constraints;if(D!=null&&R){const F=ge({delta:j(D,V)?P-V:V-D,initialLayout:r,panelConstraints:s.map(q=>q.constraints),pivotIndices:dn(t,v,o),prevLayout:r,trigger:"keyboard"});r!==F&&l(F)}}break}}};return u.addEventListener("keydown",E),()=>{u.removeEventListener("keydown",E)}});return()=>{p.forEach(u=>u())}},[o,n,e,t,r,i,l])}function Ze(n,e){if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!==e[t])return!1;return!0}function gn(n,e){const t=n==="horizontal",{x:r,y:i}=Ce(e);return t?r:i}function jn(n,e,t,r,i){const o=t==="horizontal",l=Re(e,i);x(l,`No resize handle element found for id "${e}"`);const a=l.getAttribute(A.groupId);x(a,"Resize handle element has no group id attribute");let{initialCursorPosition:s}=r;const h=gn(t,n),w=pn(a,i);x(w,`No group element found for id "${a}"`);const p=w.getBoundingClientRect(),u=o?p.width:p.height;return(h-s)/u*100}function Fn(n,e,t,r,i,o){if(nn(n)){const l=t==="horizontal";let a=0;n.shiftKey?a=100:i!=null?a=i:a=10;let s=0;switch(n.key){case"ArrowDown":s=l?0:a;break;case"ArrowLeft":s=l?-a:0;break;case"ArrowRight":s=l?a:0;break;case"ArrowUp":s=l?0:-a;break;case"End":s=100;break;case"Home":s=-100;break}return s}else return r==null?0:jn(n,e,t,r,o)}function Kn({panelDataArray:n}){const e=Array(n.length),t=n.map(o=>o.constraints);let r=0,i=100;for(let o=0;o<n.length;o++){const l=t[o];x(l,`Panel constraints not found for index ${o}`);const{defaultSize:a}=l;a!=null&&(r++,e[o]=a,i-=a)}for(let o=0;o<n.length;o++){const l=t[o];x(l,`Panel constraints not found for index ${o}`);const{defaultSize:a}=l;if(a!=null)continue;const s=n.length-r,h=i/s;r++,e[o]=h,i-=h}return e}function oe(n,e,t){e.forEach((r,i)=>{const o=n[i];x(o,`Panel data not found for index ${i}`);const{callbacks:l,constraints:a,id:s}=o,{collapsedSize:h=0,collapsible:w}=a,p=t[s];if(p==null||r!==p){t[s]=r;const{onCollapse:u,onExpand:v,onResize:z}=l;z&&z(r,p),w&&(u||v)&&(v&&(p==null||X(p,h))&&!X(r,h)&&v(),u&&(p==null||!X(p,h))&&X(r,h)&&u())}})}function be(n,e){if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!=e[t])return!1;return!0}function Un({defaultSize:n,dragState:e,layout:t,panelData:r,panelIndex:i,precision:o=3}){const l=t[i];let a;return l==null?a=n!=null?n.toPrecision(o):"1":r.length===1?a="1":a=l.toPrecision(o),{flexBasis:0,flexGrow:a,flexShrink:1,overflow:"hidden",pointerEvents:e!==null?"none":void 0}}function Vn(n,e=10){let t=null;return(...i)=>{t!==null&&clearTimeout(t),t=setTimeout(()=>{n(...i)},e)}}function Oe(n){try{if(typeof localStorage<"u")n.getItem=e=>localStorage.getItem(e),n.setItem=(e,t)=>{localStorage.setItem(e,t)};else throw new Error("localStorage not supported in this environment")}catch(e){console.error(e),n.getItem=()=>null,n.setItem=()=>{}}}function mn(n){return`react-resizable-panels:${n}`}function hn(n){return n.map(e=>{const{constraints:t,id:r,idIsFromProps:i,order:o}=e;return i?r:o?`${o}:${JSON.stringify(t)}`:JSON.stringify(t)}).sort((e,t)=>e.localeCompare(t)).join(",")}function zn(n,e){try{const t=mn(n),r=e.getItem(t);if(r){const i=JSON.parse(r);if(typeof i=="object"&&i!=null)return i}}catch{}return null}function Zn(n,e,t){var r,i;const o=(r=zn(n,t))!==null&&r!==void 0?r:{},l=hn(e);return(i=o[l])!==null&&i!==void 0?i:null}function On(n,e,t,r,i){var o;const l=mn(n),a=hn(e),s=(o=zn(n,i))!==null&&o!==void 0?o:{};s[a]={expandToSizes:Object.fromEntries(t.entries()),layout:r};try{i.setItem(l,JSON.stringify(s))}catch(h){console.error(h)}}function qe({layout:n,panelConstraints:e}){const t=[...n],r=t.reduce((o,l)=>o+l,0);if(t.length!==e.length)throw Error(`Invalid ${e.length} panel layout: ${t.map(o=>`${o}%`).join(", ")}`);if(!j(r,100)&&t.length>0)for(let o=0;o<e.length;o++){const l=t[o];x(l!=null,`No layout data found for index ${o}`);const a=100/r*l;t[o]=a}let i=0;for(let o=0;o<e.length;o++){const l=t[o];x(l!=null,`No layout data found for index ${o}`);const a=le({panelConstraints:e,panelIndex:o,size:l});l!=a&&(i+=l-a,t[o]=a)}if(!j(i,0))for(let o=0;o<e.length;o++){const l=t[o];x(l!=null,`No layout data found for index ${o}`);const a=l+i,s=le({panelConstraints:e,panelIndex:o,size:a});if(l!==s&&(i-=s-l,t[o]=s,j(i,0)))break}return t}const qn=100,me={getItem:n=>(Oe(me),me.getItem(n)),setItem:(n,e)=>{Oe(me),me.setItem(n,e)}},Xe={};function yn({autoSaveId:n=null,children:e,className:t="",direction:r,forwardedRef:i,id:o=null,onLayout:l=null,keyboardResizeBy:a=null,storage:s=me,style:h,tagName:w="div",...p}){const u=Ge(o),v=f.useRef(null),[z,C]=f.useState(null),[E,S]=f.useState([]),L=_n(),N=f.useRef({}),D=f.useRef(new Map),V=f.useRef(0),R=f.useRef({autoSaveId:n,direction:r,dragState:z,id:u,keyboardResizeBy:a,onLayout:l,storage:s}),P=f.useRef({layout:E,panelDataArray:[],panelDataArrayChanged:!1});f.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),f.useImperativeHandle(i,()=>({getId:()=>R.current.id,getLayout:()=>{const{layout:c}=P.current;return c},setLayout:c=>{const{onLayout:m}=R.current,{layout:b,panelDataArray:g}=P.current,d=qe({layout:c,panelConstraints:g.map(y=>y.constraints)});Ze(b,d)||(S(d),P.current.layout=d,m&&m(d),oe(g,d,N.current))}}),[]),ne(()=>{R.current.autoSaveId=n,R.current.direction=r,R.current.dragState=z,R.current.id=u,R.current.onLayout=l,R.current.storage=s}),Wn({committedValuesRef:R,eagerValuesRef:P,groupId:u,layout:E,panelDataArray:P.current.panelDataArray,setLayout:S,panelGroupElement:v.current}),f.useEffect(()=>{const{panelDataArray:c}=P.current;if(n){if(E.length===0||E.length!==c.length)return;let m=Xe[n];m==null&&(m=Vn(On,qn),Xe[n]=m);const b=[...c],g=new Map(D.current);m(n,b,g,E,s)}},[n,E,s]),f.useEffect(()=>{});const F=f.useCallback(c=>{const{onLayout:m}=R.current,{layout:b,panelDataArray:g}=P.current;if(c.constraints.collapsible){const d=g.map(Z=>Z.constraints),{collapsedSize:y=0,panelSize:I,pivotIndices:$}=Q(g,c,b);if(x(I!=null,`Panel size not found for panel "${c.id}"`),!X(I,y)){D.current.set(c.id,I);const O=ie(g,c)===g.length-1?I-y:y-I,k=ge({delta:O,initialLayout:b,panelConstraints:d,pivotIndices:$,prevLayout:b,trigger:"imperative-api"});be(b,k)||(S(k),P.current.layout=k,m&&m(k),oe(g,k,N.current))}}},[]),q=f.useCallback((c,m)=>{const{onLayout:b}=R.current,{layout:g,panelDataArray:d}=P.current;if(c.constraints.collapsible){const y=d.map(K=>K.constraints),{collapsedSize:I=0,panelSize:$=0,minSize:Z=0,pivotIndices:O}=Q(d,c,g),k=m??Z;if(X($,I)){const K=D.current.get(c.id),de=K!=null&&K>=k?K:k,Le=ie(d,c)===d.length-1?$-de:de-$,T=ge({delta:Le,initialLayout:g,panelConstraints:y,pivotIndices:O,prevLayout:g,trigger:"imperative-api"});be(g,T)||(S(T),P.current.layout=T,b&&b(T),oe(d,T,N.current))}}},[]),W=f.useCallback(c=>{const{layout:m,panelDataArray:b}=P.current,{panelSize:g}=Q(b,c,m);return x(g!=null,`Panel size not found for panel "${c.id}"`),g},[]),G=f.useCallback((c,m)=>{const{panelDataArray:b}=P.current,g=ie(b,c);return Un({defaultSize:m,dragState:z,layout:E,panelData:b,panelIndex:g})},[z,E]),M=f.useCallback(c=>{const{layout:m,panelDataArray:b}=P.current,{collapsedSize:g=0,collapsible:d,panelSize:y}=Q(b,c,m);return x(y!=null,`Panel size not found for panel "${c.id}"`),d===!0&&X(y,g)},[]),Y=f.useCallback(c=>{const{layout:m,panelDataArray:b}=P.current,{collapsedSize:g=0,collapsible:d,panelSize:y}=Q(b,c,m);return x(y!=null,`Panel size not found for panel "${c.id}"`),!d||te(y,g)>0},[]),_=f.useCallback(c=>{const{panelDataArray:m}=P.current;m.push(c),m.sort((b,g)=>{const d=b.order,y=g.order;return d==null&&y==null?0:d==null?-1:y==null?1:d-y}),P.current.panelDataArrayChanged=!0,L()},[L]);ne(()=>{if(P.current.panelDataArrayChanged){P.current.panelDataArrayChanged=!1;const{autoSaveId:c,onLayout:m,storage:b}=R.current,{layout:g,panelDataArray:d}=P.current;let y=null;if(c){const $=Zn(c,d,b);$&&(D.current=new Map(Object.entries($.expandToSizes)),y=$.layout)}y==null&&(y=Kn({panelDataArray:d}));const I=qe({layout:y,panelConstraints:d.map($=>$.constraints)});Ze(g,I)||(S(I),P.current.layout=I,m&&m(I),oe(d,I,N.current))}}),ne(()=>{const c=P.current;return()=>{c.layout=[]}},[]);const H=f.useCallback(c=>{let m=!1;const b=v.current;return b&&window.getComputedStyle(b,null).getPropertyValue("direction")==="rtl"&&(m=!0),function(d){d.preventDefault();const y=v.current;if(!y)return()=>null;const{direction:I,dragState:$,id:Z,keyboardResizeBy:O,onLayout:k}=R.current,{layout:K,panelDataArray:de}=P.current,{initialLayout:ve}=$??{},Le=dn(Z,c,y);let T=Fn(d,c,I,$,O,y);const We=I==="horizontal";We&&m&&(T=-T);const bn=de.map(Sn=>Sn.constraints),pe=ge({delta:T,initialLayout:ve??K,panelConstraints:bn,pivotIndices:Le,prevLayout:K,trigger:nn(d)?"keyboard":"mouse-or-touch"}),je=!be(K,pe);(tn(d)||rn(d))&&V.current!=T&&(V.current=T,!je&&T!==0?We?Ne(c,T<0?ln:an):Ne(c,T<0?sn:un):Ne(c,0)),je&&(S(pe),P.current.layout=pe,k&&k(pe),oe(de,pe,N.current))}},[]),B=f.useCallback((c,m)=>{const{onLayout:b}=R.current,{layout:g,panelDataArray:d}=P.current,y=d.map(K=>K.constraints),{panelSize:I,pivotIndices:$}=Q(d,c,g);x(I!=null,`Panel size not found for panel "${c.id}"`);const O=ie(d,c)===d.length-1?I-m:m-I,k=ge({delta:O,initialLayout:g,panelConstraints:y,pivotIndices:$,prevLayout:g,trigger:"imperative-api"});be(g,k)||(S(k),P.current.layout=k,b&&b(k),oe(d,k,N.current))},[]),se=f.useCallback((c,m)=>{const{layout:b,panelDataArray:g}=P.current,{collapsedSize:d=0,collapsible:y}=m,{collapsedSize:I=0,collapsible:$,maxSize:Z=100,minSize:O=0}=c.constraints,{panelSize:k}=Q(g,c,b);k!=null&&(y&&$&&X(k,d)?X(d,I)||B(c,I):k<O?B(c,O):k>Z&&B(c,Z))},[B]),ue=f.useCallback((c,m)=>{const{direction:b}=R.current,{layout:g}=P.current;if(!v.current)return;const d=Re(c,v.current);x(d,`Drag handle element not found for id "${c}"`);const y=gn(b,m);C({dragHandleId:c,dragHandleRect:d.getBoundingClientRect(),initialCursorPosition:y,initialLayout:g})},[]),ce=f.useCallback(()=>{C(null)},[]),xe=f.useCallback(c=>{const{panelDataArray:m}=P.current,b=ie(m,c);b>=0&&(m.splice(b,1),delete N.current[c.id],P.current.panelDataArrayChanged=!0,L())},[L]),re=f.useMemo(()=>({collapsePanel:F,direction:r,dragState:z,expandPanel:q,getPanelSize:W,getPanelStyle:G,groupId:u,isPanelCollapsed:M,isPanelExpanded:Y,reevaluatePanelConstraints:se,registerPanel:_,registerResizeHandle:H,resizePanel:B,startDragging:ue,stopDragging:ce,unregisterPanel:xe,panelGroupElement:v.current}),[F,z,r,q,W,G,u,M,Y,se,_,H,B,ue,ce,xe]),fe={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return f.createElement(Ee.Provider,{value:re},f.createElement(w,{...p,children:e,className:t,id:o,ref:v,style:{...fe,...h},[A.group]:"",[A.groupDirection]:r,[A.groupId]:u}))}const xn=f.forwardRef((n,e)=>f.createElement(yn,{...n,forwardedRef:e}));yn.displayName="PanelGroup";xn.displayName="forwardRef(PanelGroup)";function ie(n,e){return n.findIndex(t=>t===e||t.id===e.id)}function Q(n,e,t){const r=ie(n,e),o=r===n.length-1?[r-1,r]:[r,r+1],l=t[r];return{...e.constraints,panelSize:l,pivotIndices:o}}function Xn({disabled:n,handleId:e,resizeHandler:t,panelGroupElement:r}){f.useEffect(()=>{if(n||t==null||r==null)return;const i=Re(e,r);if(i==null)return;const o=l=>{if(!l.defaultPrevented)switch(l.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{l.preventDefault(),t(l);break}case"F6":{l.preventDefault();const a=i.getAttribute(A.groupId);x(a,`No group element found for id "${a}"`);const s=ye(a,r),h=fn(a,e,r);x(h!==null,`No resize element found for id "${e}"`);const w=l.shiftKey?h>0?h-1:s.length-1:h+1<s.length?h+1:0;s[w].focus();break}}};return i.addEventListener("keydown",o),()=>{i.removeEventListener("keydown",o)}},[r,n,e,t])}function vn({children:n=null,className:e="",disabled:t=!1,hitAreaMargins:r,id:i,onBlur:o,onClick:l,onDragging:a,onFocus:s,onPointerDown:h,onPointerUp:w,style:p={},tabIndex:u=0,tagName:v="div",...z}){var C,E;const S=f.useRef(null),L=f.useRef({onClick:l,onDragging:a,onPointerDown:h,onPointerUp:w});f.useEffect(()=>{L.current.onClick=l,L.current.onDragging=a,L.current.onPointerDown=h,L.current.onPointerUp=w});const N=f.useContext(Ee);if(N===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:D,groupId:V,registerResizeHandle:R,startDragging:P,stopDragging:F,panelGroupElement:q}=N,W=Ge(i),[G,M]=f.useState("inactive"),[Y,_]=f.useState(!1),[H,B]=f.useState(null),se=f.useRef({state:G});ne(()=>{se.current.state=G}),f.useEffect(()=>{if(t)B(null);else{const re=R(W);B(()=>re)}},[t,W,R]);const ue=(C=r?.coarse)!==null&&C!==void 0?C:15,ce=(E=r?.fine)!==null&&E!==void 0?E:5;f.useEffect(()=>{if(t||H==null)return;const re=S.current;x(re,"Element ref not attached");let fe=!1;return Dn(W,re,D,{coarse:ue,fine:ce},(m,b,g)=>{if(!b){M("inactive");return}switch(m){case"down":{M("drag"),fe=!1,x(g,'Expected event to be defined for "down" action'),P(W,g);const{onDragging:d,onPointerDown:y}=L.current;d?.(!0),y?.();break}case"move":{const{state:d}=se.current;fe=!0,d!=="drag"&&M("hover"),x(g,'Expected event to be defined for "move" action'),H(g);break}case"up":{M("hover"),F();const{onClick:d,onDragging:y,onPointerUp:I}=L.current;y?.(!1),I?.(),fe||d?.();break}}})},[ue,D,t,ce,R,W,H,P,F]),Xn({disabled:t,handleId:W,resizeHandler:H,panelGroupElement:q});const xe={touchAction:"none",userSelect:"none"};return f.createElement(v,{...z,children:n,className:e,id:i,onBlur:()=>{_(!1),o?.()},onFocus:()=>{_(!0),s?.()},ref:S,role:"separator",style:{...xe,...p},tabIndex:u,[A.groupDirection]:D,[A.groupId]:V,[A.resizeHandle]:"",[A.resizeHandleActive]:G==="drag"?"pointer":Y?"keyboard":void 0,[A.resizeHandleEnabled]:!t,[A.resizeHandleId]:W,[A.resizeHandleState]:G})}vn.displayName="PanelResizeHandle";function Qn(n){const e=He.c(8);let t,r;e[0]!==n?({className:t,...r}=n,e[0]=n,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let i;e[3]!==t?(i=Je("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",t),e[3]=t,e[4]=i):i=e[4];let o;return e[5]!==r||e[6]!==i?(o=he.jsx(xn,{"data-slot":"resizable-panel-group",className:i,...r}),e[5]=r,e[6]=i,e[7]=o):o=e[7],o}function et(n){const e=He.c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let r;return e[2]!==t?(r=he.jsx(en,{"data-slot":"resizable-panel",...t}),e[2]=t,e[3]=r):r=e[3],r}function nt(n){const e=He.c(12);let t,r,i;e[0]!==n?({withHandle:i,className:t,...r}=n,e[0]=n,e[1]=t,e[2]=r,e[3]=i):(t=e[1],r=e[2],i=e[3]);let o;e[4]!==t?(o=Je("bg-border focus-visible:ring-ring relative flex w-[0.5px] items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",t),e[4]=t,e[5]=o):o=e[5];let l;e[6]!==i?(l=i&&he.jsx("div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:he.jsx(Ye,{className:"size-2.5"})}),e[6]=i,e[7]=l):l=e[7];let a;return e[8]!==r||e[9]!==o||e[10]!==l?(a=he.jsx(vn,{"data-slot":"resizable-handle",className:o,...r,children:l}),e[8]=r,e[9]=o,e[10]=l,e[11]=a):a=e[11],a}export{et as R,nt as a,Qn as b};
1
+ import{r as f,a0 as Pn,c as He,j as he}from"./index-Diww4UW3.js";import{c as Je}from"./button-CGmrzkpY.js";const Ye=({size:n=24,color:e="currentColor",...t})=>f.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},f.createElement("path",{d:"M12 6a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm7-14a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM5 6a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"}));Ye.displayName="DotsGrid";const Ee=f.createContext(null);Ee.displayName="PanelGroupContext";const A={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},_e=10,ne=f.useLayoutEffect,Fe=Pn.useId,wn=typeof Fe=="function"?Fe:()=>null;let En=0;function Ge(n=null){const e=wn(),t=f.useRef(n||e||null);return t.current===null&&(t.current=""+En++),n??t.current}function Qe({children:n,className:e="",collapsedSize:t,collapsible:r,defaultSize:i,forwardedRef:o,id:l,maxSize:a,minSize:s,onCollapse:h,onExpand:w,onResize:p,order:u,style:v,tagName:z="div",...C}){const E=f.useContext(Ee);if(E===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:S,expandPanel:L,getPanelSize:N,getPanelStyle:D,groupId:V,isPanelCollapsed:R,reevaluatePanelConstraints:P,registerPanel:F,resizePanel:q,unregisterPanel:W}=E,G=Ge(l),M=f.useRef({callbacks:{onCollapse:h,onExpand:w,onResize:p},constraints:{collapsedSize:t,collapsible:r,defaultSize:i,maxSize:a,minSize:s},id:G,idIsFromProps:l!==void 0,order:u});f.useRef({didLogMissingDefaultSizeWarning:!1}),ne(()=>{const{callbacks:_,constraints:H}=M.current,B={...H};M.current.id=G,M.current.idIsFromProps=l!==void 0,M.current.order=u,_.onCollapse=h,_.onExpand=w,_.onResize=p,H.collapsedSize=t,H.collapsible=r,H.defaultSize=i,H.maxSize=a,H.minSize=s,(B.collapsedSize!==H.collapsedSize||B.collapsible!==H.collapsible||B.maxSize!==H.maxSize||B.minSize!==H.minSize)&&P(M.current,B)}),ne(()=>{const _=M.current;return F(_),()=>{W(_)}},[u,G,F,W]),f.useImperativeHandle(o,()=>({collapse:()=>{S(M.current)},expand:_=>{L(M.current,_)},getId(){return G},getSize(){return N(M.current)},isCollapsed(){return R(M.current)},isExpanded(){return!R(M.current)},resize:_=>{q(M.current,_)}}),[S,L,N,R,G,q]);const Y=D(M.current,i);return f.createElement(z,{...C,children:n,className:e,id:G,style:{...Y,...v},[A.groupId]:V,[A.panel]:"",[A.panelCollapsible]:r||void 0,[A.panelId]:G,[A.panelSize]:parseFloat(""+Y.flexGrow).toFixed(1)})}const en=f.forwardRef((n,e)=>f.createElement(Qe,{...n,forwardedRef:e}));Qe.displayName="Panel";en.displayName="forwardRef(Panel)";let De=null,Se=-1,J=null;function Cn(n,e){if(e){const t=(e&ln)!==0,r=(e&an)!==0,i=(e&sn)!==0,o=(e&un)!==0;if(t)return i?"se-resize":o?"ne-resize":"e-resize";if(r)return i?"sw-resize":o?"nw-resize":"w-resize";if(i)return"s-resize";if(o)return"n-resize"}switch(n){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function In(){J!==null&&(document.head.removeChild(J),De=null,J=null,Se=-1)}function ke(n,e){var t,r;const i=Cn(n,e);if(De!==i){if(De=i,J===null&&(J=document.createElement("style"),document.head.appendChild(J)),Se>=0){var o;(o=J.sheet)===null||o===void 0||o.removeRule(Se)}Se=(t=(r=J.sheet)===null||r===void 0?void 0:r.insertRule(`*{cursor: ${i} !important;}`))!==null&&t!==void 0?t:-1}}function nn(n){return n.type==="keydown"}function tn(n){return n.type.startsWith("pointer")}function rn(n){return n.type.startsWith("mouse")}function Ce(n){if(tn(n)){if(n.isPrimary)return{x:n.clientX,y:n.clientY}}else if(rn(n))return{x:n.clientX,y:n.clientY};return{x:1/0,y:1/0}}function Rn(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function Ln(n,e,t){return n.x<e.x+e.width&&n.x+n.width>e.x&&n.y<e.y+e.height&&n.y+n.height>e.y}function kn(n,e){if(n===e)throw new Error("Cannot compare node with itself");const t={a:Ve(n),b:Ve(e)};let r;for(;t.a.at(-1)===t.b.at(-1);)n=t.a.pop(),e=t.b.pop(),r=n;x(r,"Stacking order can only be calculated for elements with a common ancestor");const i={a:Ue(Ke(t.a)),b:Ue(Ke(t.b))};if(i.a===i.b){const o=r.childNodes,l={a:t.a.at(-1),b:t.b.at(-1)};let a=o.length;for(;a--;){const s=o[a];if(s===l.a)return 1;if(s===l.b)return-1}}return Math.sign(i.a-i.b)}const An=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Mn(n){var e;const t=getComputedStyle((e=on(n))!==null&&e!==void 0?e:n).display;return t==="flex"||t==="inline-flex"}function Nn(n){const e=getComputedStyle(n);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||Mn(n))||+e.opacity<1||"transform"in e&&e.transform!=="none"||"webkitTransform"in e&&e.webkitTransform!=="none"||"mixBlendMode"in e&&e.mixBlendMode!=="normal"||"filter"in e&&e.filter!=="none"||"webkitFilter"in e&&e.webkitFilter!=="none"||"isolation"in e&&e.isolation==="isolate"||An.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function Ke(n){let e=n.length;for(;e--;){const t=n[e];if(x(t,"Missing node"),Nn(t))return t}return null}function Ue(n){return n&&Number(getComputedStyle(n).zIndex)||0}function Ve(n){const e=[];for(;n;)e.push(n),n=on(n);return e}function on(n){const{parentNode:e}=n;return e&&e instanceof ShadowRoot?e.host:e}const ln=1,an=2,sn=4,un=8,$n=Rn()==="coarse";let U=[],ae=!1,ee=new Map,Ie=new Map;const ze=new Set;function Dn(n,e,t,r,i){var o;const{ownerDocument:l}=e,a={direction:t,element:e,hitAreaMargins:r,setResizeHandlerState:i},s=(o=ee.get(l))!==null&&o!==void 0?o:0;return ee.set(l,s+1),ze.add(a),Pe(),function(){var w;Ie.delete(n),ze.delete(a);const p=(w=ee.get(l))!==null&&w!==void 0?w:1;if(ee.set(l,p-1),Pe(),p===1&&ee.delete(l),U.includes(a)){const u=U.indexOf(a);u>=0&&U.splice(u,1),Te(),i("up",!0,null)}}}function Hn(n){const{target:e}=n,{x:t,y:r}=Ce(n);ae=!0,Be({target:e,x:t,y:r}),Pe(),U.length>0&&(we("down",n),n.preventDefault(),cn(e)||n.stopImmediatePropagation())}function Ae(n){const{x:e,y:t}=Ce(n);if(ae&&n.buttons===0&&(ae=!1,we("up",n)),!ae){const{target:r}=n;Be({target:r,x:e,y:t})}we("move",n),Te(),U.length>0&&n.preventDefault()}function Me(n){const{target:e}=n,{x:t,y:r}=Ce(n);Ie.clear(),ae=!1,U.length>0&&(n.preventDefault(),cn(e)||n.stopImmediatePropagation()),we("up",n),Be({target:e,x:t,y:r}),Te(),Pe()}function cn(n){let e=n;for(;e;){if(e.hasAttribute(A.resizeHandle))return!0;e=e.parentElement}return!1}function Be({target:n,x:e,y:t}){U.splice(0);let r=null;(n instanceof HTMLElement||n instanceof SVGElement)&&(r=n),ze.forEach(i=>{const{element:o,hitAreaMargins:l}=i,a=o.getBoundingClientRect(),{bottom:s,left:h,right:w,top:p}=a,u=$n?l.coarse:l.fine;if(e>=h-u&&e<=w+u&&t>=p-u&&t<=s+u){if(r!==null&&document.contains(r)&&o!==r&&!o.contains(r)&&!r.contains(o)&&kn(r,o)>0){let z=r,C=!1;for(;z&&!z.contains(o);){if(Ln(z.getBoundingClientRect(),a)){C=!0;break}z=z.parentElement}if(C)return}U.push(i)}})}function Ne(n,e){Ie.set(n,e)}function Te(){let n=!1,e=!1;U.forEach(r=>{const{direction:i}=r;i==="horizontal"?n=!0:e=!0});let t=0;Ie.forEach(r=>{t|=r}),n&&e?ke("intersection",t):n?ke("horizontal",t):e?ke("vertical",t):In()}let $e=new AbortController;function Pe(){$e.abort(),$e=new AbortController;const n={capture:!0,signal:$e.signal};ze.size&&(ae?(U.length>0&&ee.forEach((e,t)=>{const{body:r}=t;e>0&&(r.addEventListener("contextmenu",Me,n),r.addEventListener("pointerleave",Ae,n),r.addEventListener("pointermove",Ae,n))}),window.addEventListener("pointerup",Me,n),window.addEventListener("pointercancel",Me,n)):ee.forEach((e,t)=>{const{body:r}=t;e>0&&(r.addEventListener("pointerdown",Hn,n),r.addEventListener("pointermove",Ae,n))}))}function we(n,e){ze.forEach(t=>{const{setResizeHandlerState:r}=t,i=U.includes(t);r(n,i,e)})}function _n(){const[n,e]=f.useState(0);return f.useCallback(()=>e(t=>t+1),[])}function x(n,e){if(!n)throw console.error(e),Error(e)}function te(n,e,t=_e){return n.toFixed(t)===e.toFixed(t)?0:n>e?1:-1}function X(n,e,t=_e){return te(n,e,t)===0}function j(n,e,t){return te(n,e,t)===0}function Gn(n,e,t){if(n.length!==e.length)return!1;for(let r=0;r<n.length;r++){const i=n[r],o=e[r];if(!j(i,o,t))return!1}return!0}function le({panelConstraints:n,panelIndex:e,size:t}){const r=n[e];x(r!=null,`Panel constraints not found for index ${e}`);let{collapsedSize:i=0,collapsible:o,maxSize:l=100,minSize:a=0}=r;if(te(t,a)<0)if(o){const s=(i+a)/2;te(t,s)<0?t=i:t=a}else t=a;return t=Math.min(l,t),t=parseFloat(t.toFixed(_e)),t}function ge({delta:n,initialLayout:e,panelConstraints:t,pivotIndices:r,prevLayout:i,trigger:o}){if(j(n,0))return e;const l=[...e],[a,s]=r;x(a!=null,"Invalid first pivot index"),x(s!=null,"Invalid second pivot index");let h=0;if(o==="keyboard"){{const p=n<0?s:a,u=t[p];x(u,`Panel constraints not found for index ${p}`);const{collapsedSize:v=0,collapsible:z,minSize:C=0}=u;if(z){const E=e[p];if(x(E!=null,`Previous layout not found for panel index ${p}`),j(E,v)){const S=C-E;te(S,Math.abs(n))>0&&(n=n<0?0-S:S)}}}{const p=n<0?a:s,u=t[p];x(u,`No panel constraints found for index ${p}`);const{collapsedSize:v=0,collapsible:z,minSize:C=0}=u;if(z){const E=e[p];if(x(E!=null,`Previous layout not found for panel index ${p}`),j(E,C)){const S=E-v;te(S,Math.abs(n))>0&&(n=n<0?0-S:S)}}}}{const p=n<0?1:-1;let u=n<0?s:a,v=0;for(;;){const C=e[u];x(C!=null,`Previous layout not found for panel index ${u}`);const S=le({panelConstraints:t,panelIndex:u,size:100})-C;if(v+=S,u+=p,u<0||u>=t.length)break}const z=Math.min(Math.abs(n),Math.abs(v));n=n<0?0-z:z}{let u=n<0?a:s;for(;u>=0&&u<t.length;){const v=Math.abs(n)-Math.abs(h),z=e[u];x(z!=null,`Previous layout not found for panel index ${u}`);const C=z-v,E=le({panelConstraints:t,panelIndex:u,size:C});if(!j(z,E)&&(h+=z-E,l[u]=E,h.toPrecision(3).localeCompare(Math.abs(n).toPrecision(3),void 0,{numeric:!0})>=0))break;n<0?u--:u++}}if(Gn(i,l))return i;{const p=n<0?s:a,u=e[p];x(u!=null,`Previous layout not found for panel index ${p}`);const v=u+h,z=le({panelConstraints:t,panelIndex:p,size:v});if(l[p]=z,!j(z,v)){let C=v-z,S=n<0?s:a;for(;S>=0&&S<t.length;){const L=l[S];x(L!=null,`Previous layout not found for panel index ${S}`);const N=L+C,D=le({panelConstraints:t,panelIndex:S,size:N});if(j(L,D)||(C-=D-L,l[S]=D),j(C,0))break;n>0?S--:S++}}}const w=l.reduce((p,u)=>u+p,0);return j(w,100)?l:i}function Bn({layout:n,panelsArray:e,pivotIndices:t}){let r=0,i=100,o=0,l=0;const a=t[0];x(a!=null,"No pivot index found"),e.forEach((p,u)=>{const{constraints:v}=p,{maxSize:z=100,minSize:C=0}=v;u===a?(r=C,i=z):(o+=C,l+=z)});const s=Math.min(i,100-o),h=Math.max(r,100-l),w=n[a];return{valueMax:s,valueMin:h,valueNow:w}}function ye(n,e=document){return Array.from(e.querySelectorAll(`[${A.resizeHandleId}][data-panel-group-id="${n}"]`))}function fn(n,e,t=document){const i=ye(n,t).findIndex(o=>o.getAttribute(A.resizeHandleId)===e);return i??null}function dn(n,e,t){const r=fn(n,e,t);return r!=null?[r,r+1]:[-1,-1]}function pn(n,e=document){var t;if(e instanceof HTMLElement&&(e==null||(t=e.dataset)===null||t===void 0?void 0:t.panelGroupId)==n)return e;const r=e.querySelector(`[data-panel-group][data-panel-group-id="${n}"]`);return r||null}function Re(n,e=document){const t=e.querySelector(`[${A.resizeHandleId}="${n}"]`);return t||null}function Tn(n,e,t,r=document){var i,o,l,a;const s=Re(e,r),h=ye(n,r),w=s?h.indexOf(s):-1,p=(i=(o=t[w])===null||o===void 0?void 0:o.id)!==null&&i!==void 0?i:null,u=(l=(a=t[w+1])===null||a===void 0?void 0:a.id)!==null&&l!==void 0?l:null;return[p,u]}function Wn({committedValuesRef:n,eagerValuesRef:e,groupId:t,layout:r,panelDataArray:i,panelGroupElement:o,setLayout:l}){f.useRef({didWarnAboutMissingResizeHandle:!1}),ne(()=>{if(!o)return;const a=ye(t,o);for(let s=0;s<i.length-1;s++){const{valueMax:h,valueMin:w,valueNow:p}=Bn({layout:r,panelsArray:i,pivotIndices:[s,s+1]}),u=a[s];if(u!=null){const v=i[s];x(v,`No panel data found for index "${s}"`),u.setAttribute("aria-controls",v.id),u.setAttribute("aria-valuemax",""+Math.round(h)),u.setAttribute("aria-valuemin",""+Math.round(w)),u.setAttribute("aria-valuenow",p!=null?""+Math.round(p):"")}}return()=>{a.forEach((s,h)=>{s.removeAttribute("aria-controls"),s.removeAttribute("aria-valuemax"),s.removeAttribute("aria-valuemin"),s.removeAttribute("aria-valuenow")})}},[t,r,i,o]),f.useEffect(()=>{if(!o)return;const a=e.current;x(a,"Eager values not found");const{panelDataArray:s}=a,h=pn(t,o);x(h!=null,`No group found for id "${t}"`);const w=ye(t,o);x(w,`No resize handles found for group id "${t}"`);const p=w.map(u=>{const v=u.getAttribute(A.resizeHandleId);x(v,"Resize handle element has no handle id attribute");const[z,C]=Tn(t,v,s,o);if(z==null||C==null)return()=>{};const E=S=>{if(!S.defaultPrevented)switch(S.key){case"Enter":{S.preventDefault();const L=s.findIndex(N=>N.id===z);if(L>=0){const N=s[L];x(N,`No panel data found for index ${L}`);const D=r[L],{collapsedSize:V=0,collapsible:R,minSize:P=0}=N.constraints;if(D!=null&&R){const F=ge({delta:j(D,V)?P-V:V-D,initialLayout:r,panelConstraints:s.map(q=>q.constraints),pivotIndices:dn(t,v,o),prevLayout:r,trigger:"keyboard"});r!==F&&l(F)}}break}}};return u.addEventListener("keydown",E),()=>{u.removeEventListener("keydown",E)}});return()=>{p.forEach(u=>u())}},[o,n,e,t,r,i,l])}function Ze(n,e){if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!==e[t])return!1;return!0}function gn(n,e){const t=n==="horizontal",{x:r,y:i}=Ce(e);return t?r:i}function jn(n,e,t,r,i){const o=t==="horizontal",l=Re(e,i);x(l,`No resize handle element found for id "${e}"`);const a=l.getAttribute(A.groupId);x(a,"Resize handle element has no group id attribute");let{initialCursorPosition:s}=r;const h=gn(t,n),w=pn(a,i);x(w,`No group element found for id "${a}"`);const p=w.getBoundingClientRect(),u=o?p.width:p.height;return(h-s)/u*100}function Fn(n,e,t,r,i,o){if(nn(n)){const l=t==="horizontal";let a=0;n.shiftKey?a=100:i!=null?a=i:a=10;let s=0;switch(n.key){case"ArrowDown":s=l?0:a;break;case"ArrowLeft":s=l?-a:0;break;case"ArrowRight":s=l?a:0;break;case"ArrowUp":s=l?0:-a;break;case"End":s=100;break;case"Home":s=-100;break}return s}else return r==null?0:jn(n,e,t,r,o)}function Kn({panelDataArray:n}){const e=Array(n.length),t=n.map(o=>o.constraints);let r=0,i=100;for(let o=0;o<n.length;o++){const l=t[o];x(l,`Panel constraints not found for index ${o}`);const{defaultSize:a}=l;a!=null&&(r++,e[o]=a,i-=a)}for(let o=0;o<n.length;o++){const l=t[o];x(l,`Panel constraints not found for index ${o}`);const{defaultSize:a}=l;if(a!=null)continue;const s=n.length-r,h=i/s;r++,e[o]=h,i-=h}return e}function oe(n,e,t){e.forEach((r,i)=>{const o=n[i];x(o,`Panel data not found for index ${i}`);const{callbacks:l,constraints:a,id:s}=o,{collapsedSize:h=0,collapsible:w}=a,p=t[s];if(p==null||r!==p){t[s]=r;const{onCollapse:u,onExpand:v,onResize:z}=l;z&&z(r,p),w&&(u||v)&&(v&&(p==null||X(p,h))&&!X(r,h)&&v(),u&&(p==null||!X(p,h))&&X(r,h)&&u())}})}function be(n,e){if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!=e[t])return!1;return!0}function Un({defaultSize:n,dragState:e,layout:t,panelData:r,panelIndex:i,precision:o=3}){const l=t[i];let a;return l==null?a=n!=null?n.toPrecision(o):"1":r.length===1?a="1":a=l.toPrecision(o),{flexBasis:0,flexGrow:a,flexShrink:1,overflow:"hidden",pointerEvents:e!==null?"none":void 0}}function Vn(n,e=10){let t=null;return(...i)=>{t!==null&&clearTimeout(t),t=setTimeout(()=>{n(...i)},e)}}function Oe(n){try{if(typeof localStorage<"u")n.getItem=e=>localStorage.getItem(e),n.setItem=(e,t)=>{localStorage.setItem(e,t)};else throw new Error("localStorage not supported in this environment")}catch(e){console.error(e),n.getItem=()=>null,n.setItem=()=>{}}}function mn(n){return`react-resizable-panels:${n}`}function hn(n){return n.map(e=>{const{constraints:t,id:r,idIsFromProps:i,order:o}=e;return i?r:o?`${o}:${JSON.stringify(t)}`:JSON.stringify(t)}).sort((e,t)=>e.localeCompare(t)).join(",")}function zn(n,e){try{const t=mn(n),r=e.getItem(t);if(r){const i=JSON.parse(r);if(typeof i=="object"&&i!=null)return i}}catch{}return null}function Zn(n,e,t){var r,i;const o=(r=zn(n,t))!==null&&r!==void 0?r:{},l=hn(e);return(i=o[l])!==null&&i!==void 0?i:null}function On(n,e,t,r,i){var o;const l=mn(n),a=hn(e),s=(o=zn(n,i))!==null&&o!==void 0?o:{};s[a]={expandToSizes:Object.fromEntries(t.entries()),layout:r};try{i.setItem(l,JSON.stringify(s))}catch(h){console.error(h)}}function qe({layout:n,panelConstraints:e}){const t=[...n],r=t.reduce((o,l)=>o+l,0);if(t.length!==e.length)throw Error(`Invalid ${e.length} panel layout: ${t.map(o=>`${o}%`).join(", ")}`);if(!j(r,100)&&t.length>0)for(let o=0;o<e.length;o++){const l=t[o];x(l!=null,`No layout data found for index ${o}`);const a=100/r*l;t[o]=a}let i=0;for(let o=0;o<e.length;o++){const l=t[o];x(l!=null,`No layout data found for index ${o}`);const a=le({panelConstraints:e,panelIndex:o,size:l});l!=a&&(i+=l-a,t[o]=a)}if(!j(i,0))for(let o=0;o<e.length;o++){const l=t[o];x(l!=null,`No layout data found for index ${o}`);const a=l+i,s=le({panelConstraints:e,panelIndex:o,size:a});if(l!==s&&(i-=s-l,t[o]=s,j(i,0)))break}return t}const qn=100,me={getItem:n=>(Oe(me),me.getItem(n)),setItem:(n,e)=>{Oe(me),me.setItem(n,e)}},Xe={};function yn({autoSaveId:n=null,children:e,className:t="",direction:r,forwardedRef:i,id:o=null,onLayout:l=null,keyboardResizeBy:a=null,storage:s=me,style:h,tagName:w="div",...p}){const u=Ge(o),v=f.useRef(null),[z,C]=f.useState(null),[E,S]=f.useState([]),L=_n(),N=f.useRef({}),D=f.useRef(new Map),V=f.useRef(0),R=f.useRef({autoSaveId:n,direction:r,dragState:z,id:u,keyboardResizeBy:a,onLayout:l,storage:s}),P=f.useRef({layout:E,panelDataArray:[],panelDataArrayChanged:!1});f.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),f.useImperativeHandle(i,()=>({getId:()=>R.current.id,getLayout:()=>{const{layout:c}=P.current;return c},setLayout:c=>{const{onLayout:m}=R.current,{layout:b,panelDataArray:g}=P.current,d=qe({layout:c,panelConstraints:g.map(y=>y.constraints)});Ze(b,d)||(S(d),P.current.layout=d,m&&m(d),oe(g,d,N.current))}}),[]),ne(()=>{R.current.autoSaveId=n,R.current.direction=r,R.current.dragState=z,R.current.id=u,R.current.onLayout=l,R.current.storage=s}),Wn({committedValuesRef:R,eagerValuesRef:P,groupId:u,layout:E,panelDataArray:P.current.panelDataArray,setLayout:S,panelGroupElement:v.current}),f.useEffect(()=>{const{panelDataArray:c}=P.current;if(n){if(E.length===0||E.length!==c.length)return;let m=Xe[n];m==null&&(m=Vn(On,qn),Xe[n]=m);const b=[...c],g=new Map(D.current);m(n,b,g,E,s)}},[n,E,s]),f.useEffect(()=>{});const F=f.useCallback(c=>{const{onLayout:m}=R.current,{layout:b,panelDataArray:g}=P.current;if(c.constraints.collapsible){const d=g.map(Z=>Z.constraints),{collapsedSize:y=0,panelSize:I,pivotIndices:$}=Q(g,c,b);if(x(I!=null,`Panel size not found for panel "${c.id}"`),!X(I,y)){D.current.set(c.id,I);const O=ie(g,c)===g.length-1?I-y:y-I,k=ge({delta:O,initialLayout:b,panelConstraints:d,pivotIndices:$,prevLayout:b,trigger:"imperative-api"});be(b,k)||(S(k),P.current.layout=k,m&&m(k),oe(g,k,N.current))}}},[]),q=f.useCallback((c,m)=>{const{onLayout:b}=R.current,{layout:g,panelDataArray:d}=P.current;if(c.constraints.collapsible){const y=d.map(K=>K.constraints),{collapsedSize:I=0,panelSize:$=0,minSize:Z=0,pivotIndices:O}=Q(d,c,g),k=m??Z;if(X($,I)){const K=D.current.get(c.id),de=K!=null&&K>=k?K:k,Le=ie(d,c)===d.length-1?$-de:de-$,T=ge({delta:Le,initialLayout:g,panelConstraints:y,pivotIndices:O,prevLayout:g,trigger:"imperative-api"});be(g,T)||(S(T),P.current.layout=T,b&&b(T),oe(d,T,N.current))}}},[]),W=f.useCallback(c=>{const{layout:m,panelDataArray:b}=P.current,{panelSize:g}=Q(b,c,m);return x(g!=null,`Panel size not found for panel "${c.id}"`),g},[]),G=f.useCallback((c,m)=>{const{panelDataArray:b}=P.current,g=ie(b,c);return Un({defaultSize:m,dragState:z,layout:E,panelData:b,panelIndex:g})},[z,E]),M=f.useCallback(c=>{const{layout:m,panelDataArray:b}=P.current,{collapsedSize:g=0,collapsible:d,panelSize:y}=Q(b,c,m);return x(y!=null,`Panel size not found for panel "${c.id}"`),d===!0&&X(y,g)},[]),Y=f.useCallback(c=>{const{layout:m,panelDataArray:b}=P.current,{collapsedSize:g=0,collapsible:d,panelSize:y}=Q(b,c,m);return x(y!=null,`Panel size not found for panel "${c.id}"`),!d||te(y,g)>0},[]),_=f.useCallback(c=>{const{panelDataArray:m}=P.current;m.push(c),m.sort((b,g)=>{const d=b.order,y=g.order;return d==null&&y==null?0:d==null?-1:y==null?1:d-y}),P.current.panelDataArrayChanged=!0,L()},[L]);ne(()=>{if(P.current.panelDataArrayChanged){P.current.panelDataArrayChanged=!1;const{autoSaveId:c,onLayout:m,storage:b}=R.current,{layout:g,panelDataArray:d}=P.current;let y=null;if(c){const $=Zn(c,d,b);$&&(D.current=new Map(Object.entries($.expandToSizes)),y=$.layout)}y==null&&(y=Kn({panelDataArray:d}));const I=qe({layout:y,panelConstraints:d.map($=>$.constraints)});Ze(g,I)||(S(I),P.current.layout=I,m&&m(I),oe(d,I,N.current))}}),ne(()=>{const c=P.current;return()=>{c.layout=[]}},[]);const H=f.useCallback(c=>{let m=!1;const b=v.current;return b&&window.getComputedStyle(b,null).getPropertyValue("direction")==="rtl"&&(m=!0),function(d){d.preventDefault();const y=v.current;if(!y)return()=>null;const{direction:I,dragState:$,id:Z,keyboardResizeBy:O,onLayout:k}=R.current,{layout:K,panelDataArray:de}=P.current,{initialLayout:ve}=$??{},Le=dn(Z,c,y);let T=Fn(d,c,I,$,O,y);const We=I==="horizontal";We&&m&&(T=-T);const bn=de.map(Sn=>Sn.constraints),pe=ge({delta:T,initialLayout:ve??K,panelConstraints:bn,pivotIndices:Le,prevLayout:K,trigger:nn(d)?"keyboard":"mouse-or-touch"}),je=!be(K,pe);(tn(d)||rn(d))&&V.current!=T&&(V.current=T,!je&&T!==0?We?Ne(c,T<0?ln:an):Ne(c,T<0?sn:un):Ne(c,0)),je&&(S(pe),P.current.layout=pe,k&&k(pe),oe(de,pe,N.current))}},[]),B=f.useCallback((c,m)=>{const{onLayout:b}=R.current,{layout:g,panelDataArray:d}=P.current,y=d.map(K=>K.constraints),{panelSize:I,pivotIndices:$}=Q(d,c,g);x(I!=null,`Panel size not found for panel "${c.id}"`);const O=ie(d,c)===d.length-1?I-m:m-I,k=ge({delta:O,initialLayout:g,panelConstraints:y,pivotIndices:$,prevLayout:g,trigger:"imperative-api"});be(g,k)||(S(k),P.current.layout=k,b&&b(k),oe(d,k,N.current))},[]),se=f.useCallback((c,m)=>{const{layout:b,panelDataArray:g}=P.current,{collapsedSize:d=0,collapsible:y}=m,{collapsedSize:I=0,collapsible:$,maxSize:Z=100,minSize:O=0}=c.constraints,{panelSize:k}=Q(g,c,b);k!=null&&(y&&$&&X(k,d)?X(d,I)||B(c,I):k<O?B(c,O):k>Z&&B(c,Z))},[B]),ue=f.useCallback((c,m)=>{const{direction:b}=R.current,{layout:g}=P.current;if(!v.current)return;const d=Re(c,v.current);x(d,`Drag handle element not found for id "${c}"`);const y=gn(b,m);C({dragHandleId:c,dragHandleRect:d.getBoundingClientRect(),initialCursorPosition:y,initialLayout:g})},[]),ce=f.useCallback(()=>{C(null)},[]),xe=f.useCallback(c=>{const{panelDataArray:m}=P.current,b=ie(m,c);b>=0&&(m.splice(b,1),delete N.current[c.id],P.current.panelDataArrayChanged=!0,L())},[L]),re=f.useMemo(()=>({collapsePanel:F,direction:r,dragState:z,expandPanel:q,getPanelSize:W,getPanelStyle:G,groupId:u,isPanelCollapsed:M,isPanelExpanded:Y,reevaluatePanelConstraints:se,registerPanel:_,registerResizeHandle:H,resizePanel:B,startDragging:ue,stopDragging:ce,unregisterPanel:xe,panelGroupElement:v.current}),[F,z,r,q,W,G,u,M,Y,se,_,H,B,ue,ce,xe]),fe={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return f.createElement(Ee.Provider,{value:re},f.createElement(w,{...p,children:e,className:t,id:o,ref:v,style:{...fe,...h},[A.group]:"",[A.groupDirection]:r,[A.groupId]:u}))}const xn=f.forwardRef((n,e)=>f.createElement(yn,{...n,forwardedRef:e}));yn.displayName="PanelGroup";xn.displayName="forwardRef(PanelGroup)";function ie(n,e){return n.findIndex(t=>t===e||t.id===e.id)}function Q(n,e,t){const r=ie(n,e),o=r===n.length-1?[r-1,r]:[r,r+1],l=t[r];return{...e.constraints,panelSize:l,pivotIndices:o}}function Xn({disabled:n,handleId:e,resizeHandler:t,panelGroupElement:r}){f.useEffect(()=>{if(n||t==null||r==null)return;const i=Re(e,r);if(i==null)return;const o=l=>{if(!l.defaultPrevented)switch(l.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{l.preventDefault(),t(l);break}case"F6":{l.preventDefault();const a=i.getAttribute(A.groupId);x(a,`No group element found for id "${a}"`);const s=ye(a,r),h=fn(a,e,r);x(h!==null,`No resize element found for id "${e}"`);const w=l.shiftKey?h>0?h-1:s.length-1:h+1<s.length?h+1:0;s[w].focus();break}}};return i.addEventListener("keydown",o),()=>{i.removeEventListener("keydown",o)}},[r,n,e,t])}function vn({children:n=null,className:e="",disabled:t=!1,hitAreaMargins:r,id:i,onBlur:o,onClick:l,onDragging:a,onFocus:s,onPointerDown:h,onPointerUp:w,style:p={},tabIndex:u=0,tagName:v="div",...z}){var C,E;const S=f.useRef(null),L=f.useRef({onClick:l,onDragging:a,onPointerDown:h,onPointerUp:w});f.useEffect(()=>{L.current.onClick=l,L.current.onDragging=a,L.current.onPointerDown=h,L.current.onPointerUp=w});const N=f.useContext(Ee);if(N===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:D,groupId:V,registerResizeHandle:R,startDragging:P,stopDragging:F,panelGroupElement:q}=N,W=Ge(i),[G,M]=f.useState("inactive"),[Y,_]=f.useState(!1),[H,B]=f.useState(null),se=f.useRef({state:G});ne(()=>{se.current.state=G}),f.useEffect(()=>{if(t)B(null);else{const re=R(W);B(()=>re)}},[t,W,R]);const ue=(C=r?.coarse)!==null&&C!==void 0?C:15,ce=(E=r?.fine)!==null&&E!==void 0?E:5;f.useEffect(()=>{if(t||H==null)return;const re=S.current;x(re,"Element ref not attached");let fe=!1;return Dn(W,re,D,{coarse:ue,fine:ce},(m,b,g)=>{if(!b){M("inactive");return}switch(m){case"down":{M("drag"),fe=!1,x(g,'Expected event to be defined for "down" action'),P(W,g);const{onDragging:d,onPointerDown:y}=L.current;d?.(!0),y?.();break}case"move":{const{state:d}=se.current;fe=!0,d!=="drag"&&M("hover"),x(g,'Expected event to be defined for "move" action'),H(g);break}case"up":{M("hover"),F();const{onClick:d,onDragging:y,onPointerUp:I}=L.current;y?.(!1),I?.(),fe||d?.();break}}})},[ue,D,t,ce,R,W,H,P,F]),Xn({disabled:t,handleId:W,resizeHandler:H,panelGroupElement:q});const xe={touchAction:"none",userSelect:"none"};return f.createElement(v,{...z,children:n,className:e,id:i,onBlur:()=>{_(!1),o?.()},onFocus:()=>{_(!0),s?.()},ref:S,role:"separator",style:{...xe,...p},tabIndex:u,[A.groupDirection]:D,[A.groupId]:V,[A.resizeHandle]:"",[A.resizeHandleActive]:G==="drag"?"pointer":Y?"keyboard":void 0,[A.resizeHandleEnabled]:!t,[A.resizeHandleId]:W,[A.resizeHandleState]:G})}vn.displayName="PanelResizeHandle";function Qn(n){const e=He.c(8);let t,r;e[0]!==n?({className:t,...r}=n,e[0]=n,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let i;e[3]!==t?(i=Je("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",t),e[3]=t,e[4]=i):i=e[4];let o;return e[5]!==r||e[6]!==i?(o=he.jsx(xn,{"data-slot":"resizable-panel-group",className:i,...r}),e[5]=r,e[6]=i,e[7]=o):o=e[7],o}function et(n){const e=He.c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let r;return e[2]!==t?(r=he.jsx(en,{"data-slot":"resizable-panel",...t}),e[2]=t,e[3]=r):r=e[3],r}function nt(n){const e=He.c(12);let t,r,i;e[0]!==n?({withHandle:i,className:t,...r}=n,e[0]=n,e[1]=t,e[2]=r,e[3]=i):(t=e[1],r=e[2],i=e[3]);let o;e[4]!==t?(o=Je("bg-border focus-visible:ring-ring relative flex w-[0.5px] items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",t),e[4]=t,e[5]=o):o=e[5];let l;e[6]!==i?(l=i&&he.jsx("div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:he.jsx(Ye,{className:"size-2.5"})}),e[6]=i,e[7]=l):l=e[7];let a;return e[8]!==r||e[9]!==o||e[10]!==l?(a=he.jsx(vn,{"data-slot":"resizable-handle",className:o,...r,children:l}),e[8]=r,e[9]=o,e[10]=l,e[11]=a):a=e[11],a}export{et as R,nt as a,Qn as b};
@@ -1 +1 @@
1
- import{c as x,j as u}from"./index-DZBCLPmz.js";import{c,B as p}from"./button-C_Xg9B1B.js";import{B as g}from"./badge-9bzwrgbk.js";function j(f){const e=x.c(12),{tabs:d,activeTab:n,onTabChange:s,className:l}=f;let t;e[0]!==l?(t=c("flex items-center gap-2 overflow-x-auto no-scrollbar",l),e[0]=l,e[1]=t):t=e[1];let o;if(e[2]!==n||e[3]!==s||e[4]!==d){let i;e[6]!==n||e[7]!==s?(i=r=>{const m=n===r.id;return u.jsxs(p,{variant:"outline",size:"sm",onClick:()=>s(r.id),className:c("h-8 rounded-lg border border-transparent bg-transparent px-3 py-1 hover:bg-muted",m&&"bg-muted border-input text-foreground font-medium",!m&&"text-muted-foreground font-normal"),children:[r.label,r.count!==void 0&&u.jsx(g,{variant:"secondary",className:c("ml-2 h-5 min-w-5 px-1 rounded-full text-[10px] font-mono",m?"bg-background text-foreground":"bg-muted-foreground/10 text-muted-foreground"),children:r.count})]},r.id)},e[6]=n,e[7]=s,e[8]=i):i=e[8],o=d.map(i),e[2]=n,e[3]=s,e[4]=d,e[5]=o}else o=e[5];let a;return e[9]!==t||e[10]!==o?(a=u.jsx("div",{className:t,children:o}),e[9]=t,e[10]=o,e[11]=a):a=e[11],a}export{j as R};
1
+ import{c as x,j as u}from"./index-Diww4UW3.js";import{c,B as p}from"./button-CGmrzkpY.js";import{B as g}from"./badge-BVO6I0sW.js";function j(f){const e=x.c(12),{tabs:d,activeTab:n,onTabChange:s,className:l}=f;let t;e[0]!==l?(t=c("flex items-center gap-2 overflow-x-auto no-scrollbar",l),e[0]=l,e[1]=t):t=e[1];let o;if(e[2]!==n||e[3]!==s||e[4]!==d){let i;e[6]!==n||e[7]!==s?(i=r=>{const m=n===r.id;return u.jsxs(p,{variant:"outline",size:"sm",onClick:()=>s(r.id),className:c("h-8 rounded-lg border border-transparent bg-transparent px-3 py-1 hover:bg-muted",m&&"bg-muted border-input text-foreground font-medium",!m&&"text-muted-foreground font-normal"),children:[r.label,r.count!==void 0&&u.jsx(g,{variant:"secondary",className:c("ml-2 h-5 min-w-5 px-1 rounded-full text-[10px] font-mono",m?"bg-background text-foreground":"bg-muted-foreground/10 text-muted-foreground"),children:r.count})]},r.id)},e[6]=n,e[7]=s,e[8]=i):i=e[8],o=d.map(i),e[2]=n,e[3]=s,e[4]=d,e[5]=o}else o=e[5];let a;return e[9]!==t||e[10]!==o?(a=u.jsx("div",{className:t,children:o}),e[9]=t,e[10]=o,e[11]=a):a=e[11],a}export{j as R};
@@ -1 +1 @@
1
- import{r as c,aj as _e,a4 as rt,aa as Ne,j as d,am as st,a5 as lt,as as be,at,a3 as k,ak as it,a6 as j,a8 as P,a9 as $,al as ct,$ as Ee,aF as dt,m as ut,aY as pt,a$ as ft,aZ as mt,a_ as ht,b0 as vt,an as gt,ao as xt,ap as St,c as ee}from"./index-DZBCLPmz.js";import{V as wt}from"./tooltip-CpJ7mUzE.js";import{i as Ct}from"./Check-DijrPXQx.js";import{t as Re}from"./ChevronDown-DASi-DMo.js";import{c as oe}from"./button-C_Xg9B1B.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]=at(J),[ne]=lt(J,[bt,_e]),pe=_e(),[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(it,{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(ct,{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?Ee.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=ht("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 pt(x)},[x]),ft();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(mt,{as:jt,allowPinchZoom:!0,children:d.jsx(vt,{asChild:!0,trapped:m.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:P(r,f=>{m.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:d.jsx(gt,{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?Ee.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=dt(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=ut(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};
1
+ import{r as c,aj as _e,a4 as rt,aa as Ne,j as d,am as st,a5 as lt,as as be,at,a3 as k,ak as it,a6 as j,a8 as P,a9 as $,al as ct,$ as Ee,aF as dt,m as ut,aY as pt,a$ as ft,aZ as mt,a_ as ht,b0 as vt,an as gt,ao as xt,ap as St,c as ee}from"./index-Diww4UW3.js";import{V as wt}from"./tooltip-Suu_Gpqh.js";import{i as Ct}from"./Check-BQkm1TiP.js";import{t as Re}from"./ChevronDown-DP6jvip7.js";import{c as oe}from"./button-CGmrzkpY.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]=at(J),[ne]=lt(J,[bt,_e]),pe=_e(),[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(it,{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(ct,{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?Ee.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=ht("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 pt(x)},[x]),ft();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(mt,{as:jt,allowPinchZoom:!0,children:d.jsx(vt,{asChild:!0,trapped:m.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:P(r,f=>{m.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:d.jsx(gt,{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?Ee.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=dt(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=ut(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};
@@ -1 +1 @@
1
- import{r as N,f as B,x as $,E as D,B as P,t as C,K as I,a as K,j as s,M as Q,y as A,c as H,z as L}from"./index-DZBCLPmz.js";import{C as T}from"./collection-header-DMI-enxo.js";import{C as W}from"./collection-page-CPVm36im.js";import{u as Y}from"./project-context-provider-CwtkfEWe.js";import{B as w}from"./button-C_Xg9B1B.js";import{a as Z,F as k,b as E,c as R,d as O,f as M,e as G}from"./form-D_wQlmgT.js";import{I as U}from"./input-DrOaW48H.js";import{u as J}from"./useMutation-DV6K6Nze.js";import{i as V}from"./Grid01-CTb93Z2I.js";import{i as X}from"./Upload01-BPJ4Vq2H.js";import{i as _}from"./X-C7-BOCtk.js";import"./collection-display-button-DNzo_eaI.js";import"./dropdown-menu-fQ8f1M5d.js";import"./ArrowUp-Xq_0RBx_.js";import"./Check-DijrPXQx.js";import"./List-jMJevXfS.js";import"./tooltip-CpJ7mUzE.js";import"./view-mode-toggle-DPk8_aIn.js";const q=({size:d=24,color:e="currentColor",...r})=>N.createElement("svg",{viewBox:"0 0 24 24",width:d,height:d,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},N.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"}));q.displayName="LayersTwo01";const ee=A({name:L().min(1,"Name is required").max(255,"Name is too long"),slug:L().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:L().optional()});function se(d){const e=H.c(24),{value:r,onChange:a,name:m}=d,o=N.useRef(null);let u;e[0]!==a?(u=S=>{const F=S.target.files?.[0];if(F){if(F.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(F)}},e[0]=a,e[1]=u):u=e[1];const j=u;let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=()=>{o.current?.click()},e[2]=l):l=e[2];const t=l;let i;e[3]!==a?(i=S=>{S.stopPropagation(),a("")},e[3]=a,e[4]=i):i=e[4];const n=i;let g;e[5]!==j?(g=s.jsx("input",{type:"file",ref:o,className:"hidden",accept:"image/*",onChange:j}),e[5]=j,e[6]=g):g=e[6];let x;e[7]!==n||e[8]!==m||e[9]!==r?(x=r?s.jsxs("div",{className:"relative group",children:[s.jsx("div",{className:"h-20 w-20 rounded-lg border border-border bg-muted/20 overflow-hidden",children:s.jsx("img",{src:r,alt:m||"Organization logo",className:"w-full h-full object-cover"})}),s.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:s.jsx(_,{className:"h-3 w-3"})})]}):s.jsxs("button",{type:"button",onClick:t,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:[s.jsx(X,{className:"h-5 w-5"}),s.jsx("span",{className:"text-xs",children:"Upload"})]}),e[7]=n,e[8]=m,e[9]=r,e[10]=x):x=e[10];const z=r?"Change Logo":"Upload Logo";let h;e[11]!==z?(h=s.jsx(w,{type:"button",variant:"outline",size:"sm",onClick:t,className:"mb-2",children:z}),e[11]=z,e[12]=h):h=e[12];let f;e[13]!==n||e[14]!==r?(f=r&&s.jsx(w,{type:"button",variant:"ghost",size:"sm",onClick:n,className:"ml-2",children:"Remove"}),e[13]=n,e[14]=r,e[15]=f):f=e[15];let v;e[16]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Recommended: Square image, at least 200x200px. Max 2MB."}),e[16]=v):v=e[16];let p;e[17]!==h||e[18]!==f?(p=s.jsxs("div",{className:"flex-1",children:[h,f,v]}),e[17]=h,e[18]=f,e[19]=p):p=e[19];let b;return e[20]!==p||e[21]!==g||e[22]!==x?(b=s.jsxs("div",{className:"flex items-start gap-4",children:[g,x,p]}),e[20]=p,e[21]=g,e[22]=x,e[23]=b):b=e[23],b}function be(){const d=B(),{org:e}=Y(),r=$(),[a,m]=N.useState(!1),o=D({resolver:P(ee),values:{name:e.name??"",slug:e.slug??"",logo:e.logo??""}}),u=J({mutationFn:async t=>{const i={name:t.name,slug:t.slug};t.logo&&(i.logo=t.logo);const n=await K.organization.update({organizationId:e.id,data:i});if(n?.error)throw new Error(n.error.message||"Failed to update organization");return n},onSuccess:t=>{r.invalidateQueries({queryKey:I.organizations()}),r.invalidateQueries({queryKey:I.activeOrganization(e.slug)}),C.success("Organization settings updated successfully"),t?.data?.slug&&t.data.slug!==e.slug&&d({to:"/$org/settings",params:{org:t.data.slug}})},onError:t=>{C.error(t instanceof Error?t.message:"Failed to update organization")},onSettled:()=>{m(!1)}}),j=t=>{m(!0),u.mutate(t)},l=o.formState.isDirty;return s.jsxs(W,{children:[s.jsx(T,{title:"Settings"}),s.jsx("div",{className:"flex-1 overflow-auto",children:s.jsx("div",{className:"flex h-full",children:s.jsx("div",{className:"flex-1 overflow-auto",children:s.jsx("div",{className:"p-5 max-w-2xl",children:s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Organization"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Update your organization's name, slug, and logo."})]}),s.jsx(Z,{...o,children:s.jsxs("form",{onSubmit:o.handleSubmit(j),className:"space-y-6",children:[s.jsx(k,{control:o.control,name:"name",render:({field:t})=>s.jsxs(E,{children:[s.jsx(R,{children:"Organization Name"}),s.jsx(O,{children:s.jsx(U,{placeholder:"My Organization",...t,disabled:a})}),s.jsx(M,{})]})}),s.jsx(k,{control:o.control,name:"slug",render:({field:t})=>s.jsxs(E,{children:[s.jsx(R,{children:"Organization Slug"}),s.jsx(O,{children:s.jsx(U,{placeholder:"my-organization",...t,disabled:a,onChange:i=>{const n=i.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");t.onChange(n)}})}),s.jsx(G,{children:"Used in URLs. Only lowercase letters, numbers, and hyphens are allowed."}),s.jsx(M,{})]})}),s.jsx(k,{control:o.control,name:"logo",render:({field:t})=>s.jsxs(E,{children:[s.jsx(R,{children:"Logo"}),s.jsx(O,{children:s.jsx(se,{value:t.value,onChange:t.onChange,name:o.watch("name")})}),s.jsx(M,{})]})}),s.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[s.jsx(w,{type:"submit",disabled:!l||a,className:"min-w-24",children:a?"Saving...":"Save Changes"}),l&&s.jsx(w,{type:"button",variant:"outline",onClick:()=>o.reset(),disabled:a,children:"Cancel"})]})]})}),s.jsxs("div",{className:"border-t border-border pt-6 mt-6",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"More Settings"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Additional configuration options for your organization."})]}),s.jsx("div",{className:"mt-4",children:s.jsxs(Q,{to:"/$org/settings/plugins",params:{org:e.slug},className:"flex items-center justify-between p-4 rounded-lg border border-border hover:bg-accent/50 transition-colors group",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(q,{className:"h-5 w-5 text-muted-foreground"}),s.jsxs("div",{children:[s.jsx("div",{className:"font-medium text-foreground",children:"Plugins"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Enable or disable plugins for your organization"})]})]}),s.jsx(V,{className:"h-5 w-5 text-muted-foreground group-hover:text-foreground transition-colors"})]})})]})]})})})})})]})}export{be as default};
1
+ import{r as N,f as B,x as $,E as D,B as P,t as C,K as I,a as K,j as s,M as Q,y as A,c as H,z as L}from"./index-Diww4UW3.js";import{C as T}from"./collection-header-B4qcjEt5.js";import{C as W}from"./collection-page-s-RR5fU6.js";import{u as Y}from"./project-context-provider-DulCVL2k.js";import{B as w}from"./button-CGmrzkpY.js";import{a as Z,F as k,b as E,c as R,d as O,f as M,e as G}from"./form-DiGzBnRK.js";import{I as U}from"./input-CrURMEZe.js";import{u as J}from"./useMutation-Dl1MMkEC.js";import{i as V}from"./Grid01-D4lXvveX.js";import{i as X}from"./Upload01-CaBE4VYK.js";import{i as _}from"./X-C18ho617.js";import"./collection-display-button-CtkxsCB_.js";import"./dropdown-menu-CAeD2aIb.js";import"./ArrowUp-BF7mM4C2.js";import"./Check-BQkm1TiP.js";import"./List-BsSZz32j.js";import"./tooltip-Suu_Gpqh.js";import"./view-mode-toggle-BLClM-0g.js";const q=({size:d=24,color:e="currentColor",...r})=>N.createElement("svg",{viewBox:"0 0 24 24",width:d,height:d,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},N.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"}));q.displayName="LayersTwo01";const ee=A({name:L().min(1,"Name is required").max(255,"Name is too long"),slug:L().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:L().optional()});function se(d){const e=H.c(24),{value:r,onChange:a,name:m}=d,o=N.useRef(null);let u;e[0]!==a?(u=S=>{const F=S.target.files?.[0];if(F){if(F.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(F)}},e[0]=a,e[1]=u):u=e[1];const j=u;let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=()=>{o.current?.click()},e[2]=l):l=e[2];const t=l;let i;e[3]!==a?(i=S=>{S.stopPropagation(),a("")},e[3]=a,e[4]=i):i=e[4];const n=i;let g;e[5]!==j?(g=s.jsx("input",{type:"file",ref:o,className:"hidden",accept:"image/*",onChange:j}),e[5]=j,e[6]=g):g=e[6];let x;e[7]!==n||e[8]!==m||e[9]!==r?(x=r?s.jsxs("div",{className:"relative group",children:[s.jsx("div",{className:"h-20 w-20 rounded-lg border border-border bg-muted/20 overflow-hidden",children:s.jsx("img",{src:r,alt:m||"Organization logo",className:"w-full h-full object-cover"})}),s.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:s.jsx(_,{className:"h-3 w-3"})})]}):s.jsxs("button",{type:"button",onClick:t,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:[s.jsx(X,{className:"h-5 w-5"}),s.jsx("span",{className:"text-xs",children:"Upload"})]}),e[7]=n,e[8]=m,e[9]=r,e[10]=x):x=e[10];const z=r?"Change Logo":"Upload Logo";let h;e[11]!==z?(h=s.jsx(w,{type:"button",variant:"outline",size:"sm",onClick:t,className:"mb-2",children:z}),e[11]=z,e[12]=h):h=e[12];let f;e[13]!==n||e[14]!==r?(f=r&&s.jsx(w,{type:"button",variant:"ghost",size:"sm",onClick:n,className:"ml-2",children:"Remove"}),e[13]=n,e[14]=r,e[15]=f):f=e[15];let v;e[16]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Recommended: Square image, at least 200x200px. Max 2MB."}),e[16]=v):v=e[16];let p;e[17]!==h||e[18]!==f?(p=s.jsxs("div",{className:"flex-1",children:[h,f,v]}),e[17]=h,e[18]=f,e[19]=p):p=e[19];let b;return e[20]!==p||e[21]!==g||e[22]!==x?(b=s.jsxs("div",{className:"flex items-start gap-4",children:[g,x,p]}),e[20]=p,e[21]=g,e[22]=x,e[23]=b):b=e[23],b}function be(){const d=B(),{org:e}=Y(),r=$(),[a,m]=N.useState(!1),o=D({resolver:P(ee),values:{name:e.name??"",slug:e.slug??"",logo:e.logo??""}}),u=J({mutationFn:async t=>{const i={name:t.name,slug:t.slug};t.logo&&(i.logo=t.logo);const n=await K.organization.update({organizationId:e.id,data:i});if(n?.error)throw new Error(n.error.message||"Failed to update organization");return n},onSuccess:t=>{r.invalidateQueries({queryKey:I.organizations()}),r.invalidateQueries({queryKey:I.activeOrganization(e.slug)}),C.success("Organization settings updated successfully"),t?.data?.slug&&t.data.slug!==e.slug&&d({to:"/$org/settings",params:{org:t.data.slug}})},onError:t=>{C.error(t instanceof Error?t.message:"Failed to update organization")},onSettled:()=>{m(!1)}}),j=t=>{m(!0),u.mutate(t)},l=o.formState.isDirty;return s.jsxs(W,{children:[s.jsx(T,{title:"Settings"}),s.jsx("div",{className:"flex-1 overflow-auto",children:s.jsx("div",{className:"flex h-full",children:s.jsx("div",{className:"flex-1 overflow-auto",children:s.jsx("div",{className:"p-5 max-w-2xl",children:s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Organization"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Update your organization's name, slug, and logo."})]}),s.jsx(Z,{...o,children:s.jsxs("form",{onSubmit:o.handleSubmit(j),className:"space-y-6",children:[s.jsx(k,{control:o.control,name:"name",render:({field:t})=>s.jsxs(E,{children:[s.jsx(R,{children:"Organization Name"}),s.jsx(O,{children:s.jsx(U,{placeholder:"My Organization",...t,disabled:a})}),s.jsx(M,{})]})}),s.jsx(k,{control:o.control,name:"slug",render:({field:t})=>s.jsxs(E,{children:[s.jsx(R,{children:"Organization Slug"}),s.jsx(O,{children:s.jsx(U,{placeholder:"my-organization",...t,disabled:a,onChange:i=>{const n=i.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");t.onChange(n)}})}),s.jsx(G,{children:"Used in URLs. Only lowercase letters, numbers, and hyphens are allowed."}),s.jsx(M,{})]})}),s.jsx(k,{control:o.control,name:"logo",render:({field:t})=>s.jsxs(E,{children:[s.jsx(R,{children:"Logo"}),s.jsx(O,{children:s.jsx(se,{value:t.value,onChange:t.onChange,name:o.watch("name")})}),s.jsx(M,{})]})}),s.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[s.jsx(w,{type:"submit",disabled:!l||a,className:"min-w-24",children:a?"Saving...":"Save Changes"}),l&&s.jsx(w,{type:"button",variant:"outline",onClick:()=>o.reset(),disabled:a,children:"Cancel"})]})]})}),s.jsxs("div",{className:"border-t border-border pt-6 mt-6",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"More Settings"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Additional configuration options for your organization."})]}),s.jsx("div",{className:"mt-4",children:s.jsxs(Q,{to:"/$org/settings/plugins",params:{org:e.slug},className:"flex items-center justify-between p-4 rounded-lg border border-border hover:bg-accent/50 transition-colors group",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(q,{className:"h-5 w-5 text-muted-foreground"}),s.jsxs("div",{children:[s.jsx("div",{className:"font-medium text-foreground",children:"Plugins"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Enable or disable plugins for your organization"})]})]}),s.jsx(V,{className:"h-5 w-5 text-muted-foreground group-hover:text-foreground transition-colors"})]})})]})]})})})})})]})}export{be as default};
@@ -0,0 +1,3 @@
1
+ import{r as w,e as et,a as W,j as n,f as te,t as U,c as h,R as tt,T as st,D as at,C as nt,P as ot,g as lt,O as rt,h as it,i as ct,k as ve,p as dt,l as mt,d as we,m as Ne,n as Z,G as ft,o as ut,S as Se,q as pt,s as ht,N as xt,v as gt,K as bt,w as ye}from"./index-Diww4UW3.js";import{B as H,c as I}from"./button-CGmrzkpY.js";import{P as Ce,a as _e,b as ke}from"./popover-Bx7diZ86.js";import{B as fe}from"./badge-BVO6I0sW.js";import{i as ee}from"./Check-BQkm1TiP.js";import{n as ue}from"./Inbox01-BsOUYwQZ.js";import{s as pe}from"./XClose-CfwoKknl.js";import{E as $e}from"./error-boundary-BUvK8Sry.js";import{i as jt}from"./File06-KMD38I-q.js";import{i as Y}from"./X-C18ho617.js";import{u as q}from"./use-mobile-DssCtDl6.js";import{T as ze,a as Ie,b as Oe,c as Te}from"./tooltip-Suu_Gpqh.js";import{S as Me,i as vt,C as A,u as wt}from"./index-CL_rL7XJ.js";import{u as le,a as Nt}from"./use-organization-settings-CQXtXtZs.js";import{u as se,L as he,P as St,O as yt}from"./project-context-provider-DulCVL2k.js";import{n as Ct,I as _t}from"./empty-state-wP9uukGJ.js";import{i as Ae}from"./use-gateway-DD-xEZju.js";import{a as kt}from"./Home02-DPdZvu8L.js";import{C as $t}from"./create-organization-dialog-CtbMd6S_.js";import{I as zt}from"./input-CrURMEZe.js";import{A as K}from"./avatar-B7xnPXuk.js";import{c as It}from"./Grid01-D4lXvveX.js";import{D as Ot,a as Tt,b as Mt,c as At,d as xe}from"./dropdown-menu-CAeD2aIb.js";import{a as Re}from"./Copy01-CEYn2daS.js";import{n as ge}from"./LinkExternal01-DmruqAb9.js";import{D as Rt,a as Pt,b as Et,c as Dt,d as Lt}from"./dialog-DJJ2cvEE.js";import{L as Ht}from"./form-DiGzBnRK.js";import{S as Bt}from"./switch-DJBd8Fzb.js";import{i as Ut}from"./Code01-qXTn9GK9.js";import{u as Wt}from"./use-gateway-system-prompt-zGJSEzce.js";import{u as re,L as ie}from"./localstorage-keys-BVANkONM.js";import{T as Ft,t as Vt}from"./typewriter-title-DM-oRxie.js";import{R as Pe,a as Gt,b as Kt}from"./resizable-Gk1RjNnW.js";import{s as Zt}from"./Plus-CdG75X26.js";import"./textarea-C_zgj3Sp.js";import"./AlertCircle-CI2U-jkN.js";import"./ArrowUp-BF7mM4C2.js";import"./ChevronDown-DP6jvip7.js";import"./Edit01-Cq0mQDLh.js";import"./connection-ChwHK0-S.js";import"./use-collections-CXETocKO.js";import"./useMutation-Dl1MMkEC.js";import"./use-connection-CCXutWLD.js";import"./use-binding-D6wv_5fO.js";import"./binder-By0LBK9Y.js";import"./SearchMd-GFaonOaJ.js";import"./use-create-gateway-BlLsktgc.js";import"./select-C8LOz7vA.js";import"./Image01-C0R6SF_P.js";import"./spinner-BF56RAKQ.js";import"./Terminal-C6mZx-5A.js";import"./monaco-editor-CDRbE4GY.js";import"./alert-dialog-CCJCsKzK.js";import"./well-known-mcp-DOEdYmKO.js";import"./generate-id-Dyweu44Y.js";import"./Trash01-BWIN9RL_.js";import"./useQuery-Bvk0U2ed.js";const Ee=({size:t=24,color:e="currentColor",...s})=>w.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},w.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"}));Ee.displayName="BarChart10";const De=({size:t=24,color:e="currentColor",...s})=>w.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},w.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"}));De.displayName="Building02";const Le=({size:t=24,color:e="currentColor",...s})=>w.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},w.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"}));Le.displayName="Globe01";const He=({size:t=24,color:e="currentColor",...s})=>w.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},w.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"}));He.displayName="LayoutRight";const Be=({size:t=24,color:e="currentColor",...s})=>w.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},w.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"}));Be.displayName="LogOut01";const Ue=({size:t=24,color:e="currentColor",...s})=>w.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},w.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"}));Ue.displayName="Mail01";const ce=({size:t=24,color:e="currentColor",...s})=>w.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},w.createElement("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"}),w.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"}));ce.displayName="Settings01";const We=({size:t=24,color:e="currentColor",...s})=>w.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},w.createElement("path",{d:"M22 21v-2a4.002 4.002 0 0 0-3-3.874M15.5 3.291a4.001 4.001 0 0 1 0 7.418M17 21c0-1.864 0-2.796-.305-3.53a4 4 0 0 0-2.164-2.165C13.796 15 12.864 15 11 15H8c-1.864 0-2.796 0-3.53.305a4 4 0 0 0-2.166 2.164C2 18.204 2 19.136 2 21M13.5 7a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z"}));We.displayName="Users01";const Fe=({size:t=24,color:e="currentColor",...s})=>w.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},w.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"}));Fe.displayName="Zap";function Yt({invitation:t,onStatusChange:e}){const[s,a]=w.useState(!1),[o,l]=w.useState(!1),r=te(),i=async()=>{a(!0);try{const g=await W.organization.acceptInvitation({invitationId:t.id});if(g.error)U.error(g.error.message),a(!1);else{e(t.id,"accepted");const p=await W.organization.setActive({organizationId:t.organizationId});p?.data?.slug?(U.success("Invitation accepted!"),r({to:"/$org",params:{org:p.data.slug}})):(U.success("Invitation accepted! Redirecting..."),r({to:"/"}))}}catch{U.error("Failed to accept invitation"),a(!1)}},c=async()=>{l(!0);try{const g=await W.organization.rejectInvitation({invitationId:t.id});g.error?(U.error(g.error.message),l(!1)):(U.success("Invitation rejected"),e(t.id,"rejected"),l(!1))}catch{U.error("Failed to reject invitation"),l(!1)}},d=t.organizationName||t.organizationId,m=t.status==="pending",f=t.status==="accepted",u=t.status==="rejected";return n.jsxs("div",{className:I("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(Ue,{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(H,{variant:"ghost",size:"icon",onClick:c,disabled:s||o,className:"h-8 w-8",children:n.jsx(pe,{size:14})}),n.jsx(H,{variant:"outline",size:"icon",onClick:i,disabled:s||o,className:"h-8 w-8",children:n.jsx(ee,{size:14})})]}):f?n.jsxs(fe,{variant:"outline",className:"h-6 px-2 text-xs",children:[n.jsx(ee,{size:12}),"Accepted"]}):u?n.jsxs(fe,{variant:"outline",className:"h-6 px-2 text-xs",children:[n.jsx(pe,{size:12}),"Declined"]}):null})]})}function qt(){const[t,e]=w.useState(!1),s=w.useContext(et),{data:a}=s.hooks.useListUserInvitations(),{data:o}=W.useListOrganizations(),[l,r]=w.useState({}),d=(a??[]).map(p=>{const b=(o??[]).find(x=>x.id===p.organizationId);return{...p,organizationSlug:b?.slug||p.organizationSlug,organizationName:b?.name||p.organizationName}}).map(p=>({...p,status:l[p.id]||p.status})),m=[...d].sort((p,b)=>{const x={pending:0,accepted:1,rejected:2};return(x[p.status]??999)-(x[b.status]??999)}),u=d.filter(p=>p.status==="pending").length>0,g=(p,b)=>{r(x=>({...x,[p]:b}))};return n.jsxs(Ce,{open:t,onOpenChange:e,children:[n.jsx(_e,{asChild:!0,children:n.jsxs(H,{variant:"ghost",size:"sm",className:"relative h-7 w-7 p-0","aria-label":"Inbox",children:[n.jsx(ue,{size:18,className:"text-muted-foreground"}),u&&n.jsx("span",{className:"absolute bottom-1 right-0.5 h-2 w-2 rounded-full bg-destructive ring-2 ring-background"})]})}),n.jsxs(ke,{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:m.length>0?m.map(p=>n.jsx(Yt,{invitation:p,onStatusChange:g},p.id)):n.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[n.jsx(ue,{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=h.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(tt,{"data-slot":"sheet",...s}),e[2]=s,e[3]=a):a=e[3],a}function Xt(t){const e=h.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(ot,{"data-slot":"sheet-portal",...s}),e[2]=s,e[3]=a):a=e[3],a}function Qt(t){const e=h.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 o;e[3]!==s?(o=I("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]=o):o=e[4];let l;return e[5]!==a||e[6]!==o?(l=n.jsx(rt,{"data-slot":"sheet-overlay",className:o,...a}),e[5]=a,e[6]=o,e[7]=l):l=e[7],l}function es(t){const e=h.c(17);let s,a,o,l;e[0]!==t?({className:a,children:s,side:l,...o}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=o,e[4]=l):(s=e[1],a=e[2],o=e[3],l=e[4]);const r=l===void 0?"right":l;let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(Qt,{}),e[5]=i):i=e[5];const c=r==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",d=r==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",m=r==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",f=r==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t";let u;e[6]!==a||e[7]!==c||e[8]!==d||e[9]!==m||e[10]!==f?(u=I("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",c,d,m,f,a),e[6]=a,e[7]=c,e[8]=d,e[9]=m,e[10]=f,e[11]=u):u=e[11];let g;e[12]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsxs(lt,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[n.jsx(Y,{className:"size-4"}),n.jsx("span",{className:"sr-only",children:"Close"})]}),e[12]=g):g=e[12];let p;return e[13]!==s||e[14]!==o||e[15]!==u?(p=n.jsxs(Xt,{children:[i,n.jsxs(nt,{"data-slot":"sheet-content",className:u,...o,children:[s,g]})]}),e[13]=s,e[14]=o,e[15]=u,e[16]=p):p=e[16],p}function ts(t){const e=h.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 o;e[3]!==s?(o=I("flex flex-col gap-1.5 p-4",s),e[3]=s,e[4]=o):o=e[4];let l;return e[5]!==a||e[6]!==o?(l=n.jsx("div",{"data-slot":"sheet-header",className:o,...a}),e[5]=a,e[6]=o,e[7]=l):l=e[7],l}function ss(t){const e=h.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 o;e[3]!==s?(o=I("text-foreground font-semibold",s),e[3]=s,e[4]=o):o=e[4];let l;return e[5]!==a||e[6]!==o?(l=n.jsx(st,{"data-slot":"sheet-title",className:o,...a}),e[5]=a,e[6]=o,e[7]=l):l=e[7],l}function as(t){const e=h.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 o;e[3]!==s?(o=I("text-muted-foreground text-sm",s),e[3]=s,e[4]=o):o=e[4];let l;return e[5]!==a||e[6]!==o?(l=n.jsx(at,{"data-slot":"sheet-description",className:o,...a}),e[5]=a,e[6]=o,e[7]=l):l=e[7],l}const ns="sidebar_state",os=3600*24*7,ls="16rem",rs="18rem",is="3rem",cs="b",Ve=w.createContext(null);function de(){const t=w.useContext(Ve);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function ds(t){const e=h.c(21),{defaultOpen:s,open:a,onOpenChange:o,children:l}=t,r=s===void 0?!0:s,i=q(),[c,d]=w.useState(!1),[m,f]=w.useState(r),u=a??m;let g;e[0]!==u||e[1]!==o?(g=$=>{const S=typeof $=="function"?$(u):$;o?o(S):f(S),document.cookie=`${ns}=${S}; path=/; max-age=${os}`},e[0]=u,e[1]=o,e[2]=g):g=e[2];const p=g;let b;e[3]!==i||e[4]!==p?(b=()=>i?d(fs):p(ms),e[3]=i,e[4]=p,e[5]=b):b=e[5];const x=b;let j,v;e[6]!==x?(j=()=>{const $=S=>{if(S.key===cs&&(S.metaKey||S.ctrlKey)){const z=S.target;if(z.tagName==="INPUT"||z.tagName==="TEXTAREA"||z.isContentEditable)return;S.preventDefault(),x()}};return globalThis.addEventListener("keydown",$),()=>globalThis.removeEventListener("keydown",$)},v=[x],e[6]=x,e[7]=j,e[8]=v):(j=e[7],v=e[8]),w.useEffect(j,v);const N=u?"expanded":"collapsed";let k;e[9]!==i||e[10]!==u||e[11]!==c||e[12]!==p||e[13]!==N||e[14]!==x?(k={state:N,open:u,setOpen:p,isMobile:i,openMobile:c,setOpenMobile:d,toggleSidebar:x},e[9]=i,e[10]=u,e[11]=c,e[12]=p,e[13]=N,e[14]=x,e[15]=k):k=e[15];const y=k;let _;e[16]!==l?(_=n.jsx(Ie,{delayDuration:0,children:l}),e[16]=l,e[17]=_):_=e[17];let C;return e[18]!==y||e[19]!==_?(C=n.jsx(Ve.Provider,{value:y,children:_}),e[18]=y,e[19]=_,e[20]=C):C=e[20],C}function ms(t){return!t}function fs(t){return!t}function us(t){const e=h.c(14);let s,a,o,l;e[0]!==t?({className:a,style:l,children:s,...o}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=o,e[4]=l):(s=e[1],a=e[2],o=e[3],l=e[4]);let r;e[5]!==l?(r={"--sidebar-width":ls,"--sidebar-width-icon":is,...l},e[5]=l,e[6]=r):r=e[6];const i=r;let c;e[7]!==a?(c=I("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]!==o||e[11]!==i||e[12]!==c?(d=n.jsx("div",{"data-slot":"sidebar-wrapper",style:i,className:c,...o,children:s}),e[9]=s,e[10]=o,e[11]=i,e[12]=c,e[13]=d):d=e[13],d}function ps(t){const e=h.c(46);let s,a,o,l,r,i;e[0]!==t?({side:l,variant:r,collapsible:i,className:a,children:s,...o}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=o,e[4]=l,e[5]=r,e[6]=i):(s=e[1],a=e[2],o=e[3],l=e[4],r=e[5],i=e[6]);const c=l===void 0?"left":l,d=r===void 0?"sidebar":r,m=i===void 0?"offcanvas":i,{isMobile:f,state:u,openMobile:g,setOpenMobile:p}=de();if(m==="none"){let S;e[7]!==a?(S=I("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",a),e[7]=a,e[8]=S):S=e[8];let z;return e[9]!==s||e[10]!==o||e[11]!==S?(z=n.jsx("div",{"data-slot":"sidebar",className:S,...o,children:s}),e[9]=s,e[10]=o,e[11]=S,e[12]=z):z=e[12],z}if(f){let S;e[13]===Symbol.for("react.memo_cache_sentinel")?(S={"--sidebar-width":rs},e[13]=S):S=e[13];let z;e[14]===Symbol.for("react.memo_cache_sentinel")?(z=n.jsxs(ts,{className:"sr-only",children:[n.jsx(ss,{children:"Sidebar"}),n.jsx(as,{children:"Displays the mobile sidebar."})]}),e[14]=z):z=e[14];let O;e[15]!==s?(O=n.jsx("div",{className:"flex h-full w-full flex-col",children:s}),e[15]=s,e[16]=O):O=e[16];let T;e[17]!==c||e[18]!==O?(T=n.jsxs(es,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:S,side:c,children:[z,O]}),e[17]=c,e[18]=O,e[19]=T):T=e[19];let M;return e[20]!==g||e[21]!==o||e[22]!==p||e[23]!==T?(M=n.jsx(Jt,{open:g,onOpenChange:p,...o,children:T}),e[20]=g,e[21]=o,e[22]=p,e[23]=T,e[24]=M):M=e[24],M}const b=u==="collapsed"?m:"",x=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 j;e[25]!==x?(j=I("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",x),e[25]=x,e[26]=j):j=e[26];let v;e[27]!==j?(v=n.jsx("div",{"data-slot":"sidebar-gap",className:j}),e[27]=j,e[28]=v):v=e[28];const N=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)]",k=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]!==N||e[31]!==k?(y=I("fixed top-12 bottom-0 z-10 hidden w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",N,k,a),e[29]=a,e[30]=N,e[31]=k,e[32]=y):y=e[32];let _;e[33]!==s?(_=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]=_):_=e[34];let C;e[35]!==o||e[36]!==y||e[37]!==_?(C=n.jsx("div",{"data-slot":"sidebar-container",className:y,...o,children:_}),e[35]=o,e[36]=y,e[37]=_,e[38]=C):C=e[38];let $;return e[39]!==c||e[40]!==u||e[41]!==C||e[42]!==b||e[43]!==v||e[44]!==d?($=n.jsxs("div",{className:"group peer text-foreground hidden md:block border-r","data-state":u,"data-collapsible":b,"data-variant":d,"data-side":c,"data-slot":"sidebar",children:[v,C]}),e[39]=c,e[40]=u,e[41]=C,e[42]=b,e[43]=v,e[44]=d,e[45]=$):$=e[45],$}function hs(t){const e=h.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 o;e[3]!==s?(o=I("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]=o):o=e[4];let l;return e[5]!==a||e[6]!==o?(l=n.jsx("main",{"data-slot":"sidebar-inset",className:o,...a}),e[5]=a,e[6]=o,e[7]=l):l=e[7],l}function xs(t){const e=h.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 o;e[3]!==s?(o=I("h-4 m-0! w-full",s),e[3]=s,e[4]=o):o=e[4];let l;return e[5]!==a||e[6]!==o?(l=n.jsx("div",{"data-sidebar":"separator",className:o,...a}),e[5]=a,e[6]=o,e[7]=l):l=e[7],l}function gs(t){const e=h.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 o;e[3]!==s?(o=I("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",s),e[3]=s,e[4]=o):o=e[4];let l;return e[5]!==a||e[6]!==o?(l=n.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:o,...a}),e[5]=a,e[6]=o,e[7]=l):l=e[7],l}function bs(t){const e=h.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 o;e[3]!==s?(o=I("relative flex w-full min-w-0 flex-col px-2 py-2 md:py-0",s),e[3]=s,e[4]=o):o=e[4];let l;return e[5]!==a||e[6]!==o?(l=n.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:o,...a}),e[5]=a,e[6]=o,e[7]=l):l=e[7],l}function js(t){const e=h.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 o;e[3]!==s?(o=I("w-full text-sm",s),e[3]=s,e[4]=o):o=e[4];let l;return e[5]!==a||e[6]!==o?(l=n.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:o,...a}),e[5]=a,e[6]=o,e[7]=l):l=e[7],l}function vs(t){const e=h.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 o;e[3]!==s?(o=I("flex w-full min-w-0 flex-col gap-1",s),e[3]=s,e[4]=o):o=e[4];let l;return e[5]!==a||e[6]!==o?(l=n.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:o,...a}),e[5]=a,e[6]=o,e[7]=l):l=e[7],l}function ae(t){const e=h.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 o;e[3]!==s?(o=I("group/menu-item relative",s),e[3]=s,e[4]=o):o=e[4];let l;return e[5]!==a||e[6]!==o?(l=n.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:o,...a}),e[5]=a,e[6]=o,e[7]=l):l=e[7],l}const ws=it("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 Ge(t){const e=h.c(28);let s,a,o,l,r,i,c;e[0]!==t?({asChild:o,isActive:l,variant:r,size:i,tooltip:c,className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=o,e[4]=l,e[5]=r,e[6]=i,e[7]=c):(s=e[1],a=e[2],o=e[3],l=e[4],r=e[5],i=e[6],c=e[7]);const d=o===void 0?!1:o,m=l===void 0?!1:l,f=r===void 0?"default":r,u=i===void 0?"default":i,g=d?ct:"button",{isMobile:p,state:b}=de();let x;e[8]!==s||e[9]!==u||e[10]!==f?(x=I(ws({variant:f,size:u}),s),e[8]=s,e[9]=u,e[10]=f,e[11]=x):x=e[11];let j;e[12]!==g||e[13]!==m||e[14]!==a||e[15]!==u||e[16]!==x?(j=n.jsx(g,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":u,"data-active":m,className:x,...a}),e[12]=g,e[13]=m,e[14]=a,e[15]=u,e[16]=x,e[17]=j):j=e[17];const v=j;if(!c)return v;if(typeof c=="string"){let C;e[18]!==c?(C={children:c},e[18]=c,e[19]=C):C=e[19],c=C}let N;e[20]!==v?(N=n.jsx(Oe,{asChild:!0,children:v}),e[20]=v,e[21]=N):N=e[21];const k=b!=="collapsed"||p;let y;e[22]!==k||e[23]!==c?(y=n.jsx(ze,{side:"right",align:"center",hidden:k,...c}),e[22]=k,e[23]=c,e[24]=y):y=e[24];let _;return e[25]!==N||e[26]!==y?(_=n.jsxs(Te,{children:[N,y]}),e[25]=N,e[26]=y,e[27]=_):_=e[27],_}function Ns(t){const e=h.c(26),{item:s}=t,a=te(),{org:o}=se(),l=le(o.id),r=Nt(o.id);let i;e[0]!==r.update||e[1]!==s.url||e[2]!==l?.sidebar_items?(i=async()=>{const k=(l?.sidebar_items||[]).filter(y=>y.url!==s.url);await r.update.mutateAsync({sidebar_items:k})},e[0]=r.update,e[1]=s.url,e[2]=l?.sidebar_items,e[3]=i):i=e[3];const c=i;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 f=m;let u;e[7]!==s.url||e[8]!==a?(u=()=>{a({to:s.url})},e[7]=s.url,e[8]=a,e[9]=u):u=e[9];const g=s.title;let p;e[10]!==f||e[11]!==s.icon||e[12]!==s.title?(p=n.jsx("div",{className:"flex items-center justify-center shrink-0",children:f?n.jsx("img",{src:s.icon,alt:s.title,className:"h-4 w-4 rounded object-cover"}):n.jsx(jt,{size:16,className:"text-muted-foreground group-hover/item:text-foreground transition-colors"})}),e[10]=f,e[11]=s.icon,e[12]=s.title,e[13]=p):p=e[13];let b;e[14]!==s.title?(b=s.title.toLocaleLowerCase(),e[14]=s.title,e[15]=b):b=e[15];let x;e[16]!==b?(x=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:b})}),e[16]=b,e[17]=x):x=e[17];let j;e[18]!==c?(j=n.jsx(Y,{size:16,className:"text-muted-foreground opacity-0 group-hover/item:opacity-50 hover:opacity-100 cursor-pointer",onClick:N=>{N.preventDefault(),N.stopPropagation(),c()}}),e[18]=c,e[19]=j):j=e[19];let v;return e[20]!==s.title||e[21]!==u||e[22]!==p||e[23]!==x||e[24]!==j?(v=n.jsx(ae,{children:n.jsxs(Ge,{className:"w-full pr-2 group/item relative cursor-pointer text-foreground/90 hover:text-foreground",onClick:u,tooltip:g,children:[p,x,j]})}),e[20]=s.title,e[21]=u,e[22]=p,e[23]=x,e[24]=j,e[25]=v):v=e[25],v}function Ss(){const t=h.c(4),{org:e}=se(),a=le(e.id)?.sidebar_items;if(!a?.length)return null;let o;t[0]!==a?(o=a.map(ys),t[0]=a,t[1]=o):o=t[1];let l;return t[2]!==o?(l=n.jsx(Ke,{children:o}),t[2]=o,t[3]=l):l=t[3],l}function ys(t){return n.jsx(Ns,{item:t},t.url)}function be(){const t=h.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(ae,{children:n.jsx("div",{className:"flex items-center gap-2 px-4 py-2",children:n.jsx(Me,{className:"h-4 flex-1"})})}),t[0]=e):e=t[0],e}function Ke(t){const e=h.c(4),{children:s}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(xs,{className:"my-2 -ml-1"}),e[0]=a):a=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(ae,{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]=o):o=e[1];let l;return e[2]!==s?(l=n.jsxs(n.Fragment,{children:[a,o,s]}),e[2]=s,e[3]=l):l=e[3],l}function Cs(){const t=h.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(w.Suspense,{fallback:n.jsxs(Ke,{children:[n.jsx(be,{}),n.jsx(be,{})]}),children:n.jsx(Ss,{})}),t[0]=e):e=t[0],e}function _s(){const t=h.c(14),{locator:e,org:s}=se(),a=te(),o=ve(),{org:l}=he.parse(e);let r;t[0]!==e?(r=he.isOrgAdminProject(e),t[0]=e,t[1]=r):r=t[1];const i=r,c=le(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 f;t[4]!==m?(f=C=>m.includes(C.pluginId),t[4]=m,t[5]=f):f=t[5];const u=dt.filter(f),g=o.location.pathname===`/${l}`||o.location.pathname===`/${l}/`;let p;t[6]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx(kt,{}),t[6]=p):p=t[6];let b;t[7]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx(De,{}),t[7]=b):b=t[7];let x;t[8]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(Ct,{}),t[8]=x):x=t[8];let j;t[9]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(Ae,{}),t[9]=j):j=t[9];let v;t[10]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(Fe,{}),t[10]=v):v=t[10];let N;t[11]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(Ee,{}),t[11]=N):N=t[11];let k;t[12]===Symbol.for("react.memo_cache_sentinel")?(k=n.jsx(We,{}),t[12]=k):k=t[12];let y;t[13]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(ce,{}),t[13]=y):y=t[13];const _=[{key:"home",label:"Home",icon:p,onClick:()=>{g?window.dispatchEvent(new CustomEvent("reset-home-view")):a({to:"/$org",params:{org:l}})}},{key:"store",label:"Store",icon:b,onClick:()=>a({to:"/$org/store",params:{org:l}})},...u.map(C=>({key:C.pluginId,label:C.label,icon:C.icon,onClick:()=>a({to:"/$org/$pluginId",params:{org:l,pluginId:C.pluginId}})})),{key:"mcps",label:"Connections",icon:x,onClick:()=>a({to:"/$org/mcps",params:{org:l}})},{key:"gateways",label:"Agents",icon:j,onClick:()=>a({to:"/$org/gateways",params:{org:l}})},{key:"workflow",label:"Workflows",icon:v,onClick:()=>a({to:"/$org/workflows",params:{org:l}})},{key:"monitoring",label:"Monitoring",icon:N,onClick:()=>a({to:"/$org/monitoring",params:{org:l}})},{key:"members",label:"Members",icon:k,onClick:()=>a({to:"/$org/members",params:{org:l}})},{key:"settings",label:"Settings",icon:y,onClick:()=>a({to:"/$org/settings",params:{org:l}})}];return i?_:[]}function Ze(t){const e=h.c(10),{navigationItems:s,footer:a,additionalContent:o,variant:l,collapsible:r}=t,i=l===void 0?"sidebar":l,c=r===void 0?"icon":r;let d;e[0]!==s?(d=s.map(ks),e[0]=s,e[1]=d):d=e[1];let m;e[2]!==o||e[3]!==d?(m=n.jsx(gs,{className:"flex-1 overflow-x-hidden",children:n.jsx(bs,{className:"font-medium",children:n.jsx(js,{children:n.jsxs(vs,{className:"gap-0.5",children:[d,o]})})})}),e[2]=o,e[3]=d,e[4]=m):m=e[4];let f;return e[5]!==c||e[6]!==a||e[7]!==m||e[8]!==i?(f=n.jsxs(ps,{variant:i,collapsible:c,children:[m,a]}),e[5]=c,e[6]=a,e[7]=m,e[8]=i,e[9]=f):f=e[9],f}function ks(t){return n.jsx(ae,{children:n.jsxs(Ge,{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)}Ze.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(Me,{className:"h-full bg-sidebar-accent rounded-md"})},s))})};function $s(){const t=h.c(3),e=_s();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(n.Fragment,{children:n.jsx($e,{children:n.jsx(w.Suspense,{fallback:null,children:n.jsx(Cs,{})})})}),t[0]=s):s=t[0];let a;return t[1]!==e?(a=n.jsx(Ze,{navigationItems:e,additionalContent:s}),t[1]=e,t[2]=a):a=t[2],a}function zs(t){const e=h.c(12);let s,a,o,l;e[0]!==t?({className:s,orientation:o,decorative:l,...a}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=o,e[4]=l):(s=e[1],a=e[2],o=e[3],l=e[4]);const r=o===void 0?"horizontal":o,i=l===void 0?!0:l;let c;e[5]!==s?(c=I("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]!==i||e[8]!==r||e[9]!==a||e[10]!==c?(d=n.jsx(mt,{"data-slot":"separator-root",decorative:i,orientation:r,className:c,...a}),e[7]=i,e[8]=r,e[9]=a,e[10]=c,e[11]=d):d=e[11],d}const Ye=w.createContext(null);function Is(){const t=w.useContext(Ye);if(!t)throw new Error("TopbarSwitcher compound components must be used within TopbarSwitcher.Root");return t}function Os(t){const e=h.c(10),{children:s,onItemHover:a}=t,[o,l]=w.useState(null);let r;e[0]!==a?(r=f=>{l(f),a?.(f)},e[0]=a,e[1]=r):r=e[1];const i=r;let c;e[2]!==o||e[3]!==i?(c={hoveredItem:o,setHoveredItem:i},e[2]=o,e[3]=i,e[4]=c):c=e[4];let d;e[5]!==s?(d=n.jsx(Ce,{children:s}),e[5]=s,e[6]=d):d=e[6];let m;return e[7]!==c||e[8]!==d?(m=n.jsx(Ye.Provider,{value:c,children:d}),e[7]=c,e[8]=d,e[9]=m):m=e[9],m}function Ts(t){const e=h.c(6),{children:s,onClick:a}=t;let o;e[0]!==s||e[1]!==a?(o=n.jsx(H,{variant:"link",className:"p-0.5 h-auto",onClick:a,type:"button",children:s}),e[0]=s,e[1]=a,e[2]=o):o=e[2];let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(_e,{asChild:!0,children:n.jsx(H,{size:"icon",variant:"ghost",className:"w-6 h-6 p-0",children:n.jsx(vt,{size:16,className:"opacity-50"})})}),e[3]=l):l=e[3];let r;return e[4]!==o?(r=n.jsxs("div",{className:"flex items-center gap-1",children:[o,l]}),e[4]=o,e[5]=r):r=e[5],r}function Ms(t){const e=h.c(8),{item:s,fallback:a}=t,o=a===void 0?"":a,l=s?.avatarUrl??"",r=s?.name??o;let i;e[0]!==l||e[1]!==r?(i=n.jsx(K,{url:l,fallback:r,size:"xs",objectFit:"contain"}),e[0]=l,e[1]=r,e[2]=i):i=e[2];const c=s?.name??o;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]!==i||e[6]!==d?(m=n.jsxs("div",{className:"flex items-center gap-2",children:[i,d]}),e[5]=i,e[6]=d,e[7]=m):m=e[7],m}function As(t){const e=h.c(6),{children:s,align:a}=t,o=a===void 0?"start":a,r=w.Children.toArray(s).filter(Rs).length===1?"280px":"480px";let i;e[0]!==r?(i={width:r},e[0]=r,e[1]=i):i=e[1];let c;return e[2]!==o||e[3]!==s||e[4]!==i?(c=n.jsx(ke,{align:o,className:"p-0 flex items-start",style:i,children:s}),e[2]=o,e[3]=s,e[4]=i,e[5]=c):c=e[5],c}function Rs(t){return w.isValidElement(t)&&(t.type===Je||t.type===qe)}function qe(t){const e=h.c(5),{children:s,className:a}=t;let o;e[0]!==a?(o=I("flex flex-col border-border w-[240px] border-r last:border-r-0 last:w-full",a),e[0]=a,e[1]=o):o=e[1];let l;return e[2]!==s||e[3]!==o?(l=n.jsx("div",{className:o,children:s}),e[2]=s,e[3]=o,e[4]=l):l=e[4],l}const Je=qe;function Ps(t){const e=h.c(6),{placeholder:s,value:a,onChange:o}=t,l=s===void 0?"Search...":s;let r;e[0]!==o?(r=c=>o(c.target.value),e[0]=o,e[1]=r):r=e[1];let i;return e[2]!==l||e[3]!==r||e[4]!==a?(i=n.jsx(zt,{placeholder:l,value:a,onChange:r,className:"rounded-none border-t-0 border-x-0 focus-visible:border-border focus-visible:ring-0"}),e[2]=l,e[3]=r,e[4]=a,e[5]=i):i=e[5],i}function Es(t){const e=h.c(6),{children:s,emptyMessage:a}=t,o=a===void 0?"No items found.":a,l=w.Children.count(s)>0;let r;e[0]!==o||e[1]!==l?(r=!l&&n.jsx("div",{className:"text-muted-foreground text-sm px-1 py-8 text-center",children:o}),e[0]=o,e[1]=l,e[2]=r):r=e[2];let i;return e[3]!==s||e[4]!==r?(i=n.jsxs("div",{className:"flex flex-col gap-0.5 p-1 max-h-44 overflow-y-auto",children:[r,s]}),e[3]=s,e[4]=r,e[5]=i):i=e[5],i}function Ds(t){const e=h.c(15),{item:s,onClick:a,onHover:o,children:l}=t,r=Is();let i;e[0]!==r||e[1]!==s||e[2]!==o?(i=()=>{r.setHoveredItem(s.slug),o?.(s)},e[0]=r,e[1]=s,e[2]=o,e[3]=i):i=e[3];const c=i;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(K,{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 f;return e[11]!==c||e[12]!==d||e[13]!==m?(f=n.jsx(H,{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]=f):f=e[14],f}function Ls(t){const e=h.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 Hs(t){const e=h.c(11),{onClick:s,icon:a,children:o,variant:l}=t,i=(l===void 0?"default":l)==="muted"&&"text-muted-foreground";let c;e[0]!==i?(c=I("w-full justify-start font-normal",i),e[0]=i,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]!==o?(m=n.jsx("span",{children:o}),e[4]=o,e[5]=m):m=e[5];let f;return e[6]!==s||e[7]!==c||e[8]!==d||e[9]!==m?(f=n.jsxs(H,{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]=f):f=e[10],f}function Bs(){const t=h.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(zs,{}),t[0]=e):e=t[0],e}function Us(){const t=h.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 P=Object.assign(Os,{Trigger:Ts,CurrentItem:Ms,Content:As,Panel:Je,Search:Ps,Items:Es,Item:Ds,Actions:Ls,Action:Hs,Separator:Bs,Skeleton:Us});function oe(){const t=h.c(59);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const{org:s}=we(e),{data:a}=W.useListOrganizations(),o=te();let l;t[1]!==s||t[2]!==a?(l=a?.find(R=>R.slug===s),t[1]=s,t[2]=a,t[3]=l):l=t[3];const r=l,[i,c]=w.useState(""),[d,m]=w.useState(!1);let f,u,g,p,b,x,j,v;if(t[4]!==r||t[5]!==o||t[6]!==s||t[7]!==i||t[8]!==a){const E=(a?(()=>{const B=a.filter(F=>F.name.toLowerCase().includes(i.toLowerCase()));if(s){const F=B.findIndex(X=>X.slug===s);if(F>0){const X=B[F];X&&(B.splice(F,1),B.unshift(X))}}return B})():[]).map(Ws);let D;t[17]!==r?(D=r?{slug:r.slug,name:r.name,avatarUrl:r.logo}:void 0,t[17]=r,t[18]=D):D=t[18];const ne=D;p=P;let V;t[19]!==o||t[20]!==s?(V=()=>o({to:"/$org",params:{org:s??""}}),t[19]=o,t[20]=s,t[21]=V):V=t[21];let G;t[22]!==ne?(G=n.jsx(P.CurrentItem,{item:ne}),t[22]=ne,t[23]=G):G=t[23],t[24]!==V||t[25]!==G?(v=n.jsx(P.Trigger,{onClick:V,children:G}),t[24]=V,t[25]=G,t[26]=v):v=t[26],g=P.Content,u=P.Panel,t[27]!==i?(j=n.jsx(P.Search,{placeholder:"Search organizations...",value:i,onChange:c}),t[27]=i,t[28]=j):j=t[28],f=P.Items,b="No organizations found.";let J;t[29]!==o?(J=B=>n.jsx(P.Item,{item:B,onClick:F=>o({to:"/$org",params:{org:F.slug}})},B.slug),t[29]=o,t[30]=J):J=t[30],x=E.map(J),t[4]=r,t[5]=o,t[6]=s,t[7]=i,t[8]=a,t[9]=f,t[10]=u,t[11]=g,t[12]=p,t[13]=b,t[14]=x,t[15]=j,t[16]=v}else f=t[9],u=t[10],g=t[11],p=t[12],b=t[13],x=t[14],j=t[15],v=t[16];let N;t[31]!==f||t[32]!==b||t[33]!==x?(N=n.jsx(f,{emptyMessage:b,children:x}),t[31]=f,t[32]=b,t[33]=x,t[34]=N):N=t[34];let k,y;t[35]===Symbol.for("react.memo_cache_sentinel")?(k=n.jsx(P.Actions,{children:n.jsx(P.Action,{onClick:()=>m(!0),variant:"muted",children:"+ Create organization"})}),y=n.jsx(P.Separator,{}),t[35]=k,t[36]=y):(k=t[35],y=t[36]);let _;t[37]!==o?(_=()=>o({to:"/"}),t[37]=o,t[38]=_):_=t[38];let C;t[39]===Symbol.for("react.memo_cache_sentinel")?(C=n.jsx(It,{}),t[39]=C):C=t[39];let $;t[40]!==_?($=n.jsx(P.Actions,{children:n.jsx(P.Action,{onClick:_,icon:C,children:"See all organizations"})}),t[40]=_,t[41]=$):$=t[41];let S;t[42]!==u||t[43]!==$||t[44]!==j||t[45]!==N?(S=n.jsxs(u,{children:[j,N,k,y,$]}),t[42]=u,t[43]=$,t[44]=j,t[45]=N,t[46]=S):S=t[46];let z;t[47]!==g||t[48]!==S?(z=n.jsx(g,{children:S}),t[47]=g,t[48]=S,t[49]=z):z=t[49];let O;t[50]!==p||t[51]!==z||t[52]!==v?(O=n.jsxs(p,{children:[v,z]}),t[50]=p,t[51]=z,t[52]=v,t[53]=O):O=t[53];let T;t[54]!==d?(T=n.jsx($t,{open:d,onOpenChange:m}),t[54]=d,t[55]=T):T=t[55];let M;return t[56]!==O||t[57]!==T?(M=n.jsxs(n.Fragment,{children:[O,T]}),t[56]=O,t[57]=T,t[58]=M):M=t[58],M}function Ws(t){return{slug:t.slug,name:t.name,avatarUrl:t.logo}}oe.Skeleton=P.Skeleton;function Fs({prop:t,defaultProp:e,onChange:s=()=>{}}){const[a,o]=Vs({defaultProp:e,onChange:s}),l=t!==void 0,r=l?t:a,i=Ne(s),c=w.useCallback(d=>{if(l){const f=typeof d=="function"?d(t):d;f!==t&&i(f)}else o(d)},[l,t,o,i]);return[r,c]}function Vs({defaultProp:t,onChange:e}){const s=w.useState(t),[a]=s,o=w.useRef(a),l=Ne(e);return w.useEffect(()=>{o.current!==a&&(l(a),o.current=a)},[a,o,l]),s}function Gs(t){const e=h.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(Z.Root,{"data-slot":"drawer",...s}),e[2]=s,e[3]=a):a=e[3],a}function Ks(t){const e=h.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(Z.Trigger,{"data-slot":"drawer-trigger",...s}),e[2]=s,e[3]=a):a=e[3],a}function Zs(t){const e=h.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(Z.Portal,{"data-slot":"drawer-portal",...s}),e[2]=s,e[3]=a):a=e[3],a}function Ys(t){const e=h.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 o;e[3]!==s?(o=I("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]=o):o=e[4];let l;return e[5]!==a||e[6]!==o?(l=n.jsx(Z.Overlay,{"data-slot":"drawer-overlay",className:o,...a}),e[5]=a,e[6]=o,e[7]=l):l=e[7],l}function qs(t){const e=h.c(12);let s,a,o;e[0]!==t?({className:a,children:s,...o}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=o):(s=e[1],a=e[2],o=e[3]);let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(Ys,{}),e[4]=l):l=e[4];let r;e[5]!==a?(r=I("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]=r):r=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=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]=i):i=e[7];let c;return e[8]!==s||e[9]!==o||e[10]!==r?(c=n.jsxs(Zs,{"data-slot":"drawer-portal",children:[l,n.jsxs(Z.Content,{"data-slot":"drawer-content",className:r,...o,children:[i,s]})]}),e[8]=s,e[9]=o,e[10]=r,e[11]=c):c=e[11],c}function Js(t){const e=h.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 o;e[3]!==s?(o=I("flex flex-col gap-1.5 px-4 py-2",s),e[3]=s,e[4]=o):o=e[4];let l;return e[5]!==a||e[6]!==o?(l=n.jsx("div",{"data-slot":"drawer-header",className:o,...a}),e[5]=a,e[6]=o,e[7]=l):l=e[7],l}function Xs(t){const e=h.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 o;e[3]!==s?(o=I("text-foreground font-semibold",s),e[3]=s,e[4]=o):o=e[4];let l;return e[5]!==a||e[6]!==o?(l=n.jsx(Z.Title,{"data-slot":"drawer-title",className:o,...a}),e[5]=a,e[6]=o,e[7]=l):l=e[7],l}const Xe=w.createContext({setOpen:()=>{}}),Qs=()=>w.useContext(Xe),ea=t=>{const e=h.c(25);let s,a,o,l,r;e[0]!==t?({children:s,defaultOpen:a,open:l,onOpenChange:o,...r}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=o,e[4]=l,e[5]=r):(s=e[1],a=e[2],o=e[3],l=e[4],r=e[5]);const i=a??!1;let c;e[6]!==o||e[7]!==l||e[8]!==i?(c={prop:l,defaultProp:i,onChange:o},e[6]=o,e[7]=l,e[8]=i,e[9]=c):c=e[9];const[d,m]=Fs(c);let f;e[10]!==m?(f={setOpen:m},e[10]=m,e[11]=f):f=e[11];let u;e[12]!==s||e[13]!==d||e[14]!==r||e[15]!==m?(u=n.jsx(Gs,{open:d,onOpenChange:m,...r,children:s}),e[12]=s,e[13]=d,e[14]=r,e[15]=m,e[16]=u):u=e[16];let g;e[17]!==d||e[18]!==r||e[19]!==m||e[20]!==u?(g=n.jsx(Mt,{open:d,onOpenChange:m,...r,children:u}),e[17]=d,e[18]=r,e[19]=m,e[20]=u,e[21]=g):g=e[21];let p;return e[22]!==f||e[23]!==g?(p=n.jsx(Xe.Provider,{value:f,children:g}),e[22]=f,e[23]=g,e[24]=p):p=e[24],p},ta=t=>{const{children:e,title:s,...a}=t,o=q(),{className:l,...r}=a;return o?n.jsxs(qs,{...r,children:[n.jsx(Js,{className:"hidden",children:n.jsx(Xs,{children:s})}),n.jsx("div",{className:I("flex flex-col gap-2 p-2 py-4",l),children:e})]}):n.jsx(Tt,{...a,children:e})},sa=t=>{const{children:e,...s}=t,{setOpen:a}=Qs(),o=q(),{className:l,...r}=s;return o?n.jsx("div",{...r,onClick:i=>{a(!1);const{onClick:c}=r;c?.(i)},className:I("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(At,{...s,children:e})},aa=t=>{const e=h.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 o=q();let l;return e[3]!==s||e[4]!==o||e[5]!==a?(l=o?n.jsx(Ks,{asChild:!0,children:s}):n.jsx(Ot,{...a,children:s}),e[3]=s,e[4]=o,e[5]=a,e[6]=l):l=e[6],l},na=t=>{const e=h.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 o=q();let l;return e[3]!==s||e[4]!==o||e[5]!==a?(l=o?n.jsx(xe,{className:I(s),...a}):n.jsx(xe,{className:I(s),...a}),e[3]=s,e[4]=o,e[5]=a,e[6]=l):l=e[6],l};function oa(t){const e=h.c(11),{user:s,trigger:a,align:o,children:l}=t,r=o===void 0?"start":o;let i;e[0]!==a||e[1]!==s?(i=a(s),e[0]=a,e[1]=s,e[2]=i):i=e[2];let c;e[3]!==i?(c=n.jsx(aa,{asChild:!0,children:n.jsx("div",{children:i})}),e[3]=i,e[4]=c):c=e[4];let d;e[5]!==r||e[6]!==l?(d=n.jsx(ta,{side:"top",align:r,className:"md:w-[240px]",children:l}),e[5]=r,e[6]=l,e[7]=d):d=e[7];let m;return e[8]!==c||e[9]!==d?(m=n.jsxs(ea,{children:[c,d]}),e[8]=c,e[9]=d,e[10]=m):m=e[10],m}function la(t){const e=h.c(8),{children:s,onClick:a,className:o,asChild:l}=t;let r;e[0]!==l||e[1]!==s||e[2]!==a?(r=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]=r):r=e[3];let i;return e[4]!==l||e[5]!==o||e[6]!==r?(i=n.jsx(sa,{asChild:l,className:o,children:r}),e[4]=l,e[5]=o,e[6]=r,e[7]=i):i=e[7],i}function ra(t){const e=h.c(2),{className:s}=t;let a;return e[0]!==s?(a=n.jsx(na,{className:s}),e[0]=s,e[1]=a):a=e[1],a}function ia(){const t=h.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 L=Object.assign(oa,{Item:la,Separator:ra,Skeleton:ia});function ca(t){const e=h.c(48),{open:s,onOpenChange:a,user:o,userImage:l}=t,[r,i]=Wt(),[c,d]=w.useState(!1);let m;e[0]!==o.id?(m=()=>{navigator.clipboard.writeText(o.id),d(!0),setTimeout(()=>d(!1),2e3)},e[0]=o.id,e[1]=m):m=e[1];const f=m;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(Rt,{className:"text-base",children:"Profile Settings"}),e[2]=u):u=e[2];let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsxs(Pt,{className:"px-6 pt-6 pb-4 border-b border-border shrink-0 relative",children:[u,n.jsxs(Et,{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(Y,{size:16}),n.jsx("span",{className:"sr-only",children:"Close"})]})]}),e[3]=g):g=e[3];const p=o.name||"U";let b;e[4]!==p||e[5]!==l?(b=n.jsx(K,{url:l,fallback:p,shape:"circle",size:"xl",className:"h-16 w-16"}),e[4]=p,e[5]=l,e[6]=b):b=e[6];const x=o.name||"User";let j;e[7]!==x?(j=n.jsx("span",{className:"text-base font-medium text-foreground",children:x}),e[7]=x,e[8]=j):j=e[8];let v;e[9]!==o.email?(v=n.jsx("span",{className:"text-sm text-muted-foreground",children:o.email}),e[9]=o.email,e[10]=v):v=e[10];let N;e[11]!==j||e[12]!==v?(N=n.jsxs("div",{className:"flex flex-col gap-1",children:[j,v]}),e[11]=j,e[12]=v,e[13]=N):N=e[13];let k;e[14]!==b||e[15]!==N?(k=n.jsxs("div",{className:"flex items-center gap-4",children:[b,N]}),e[14]=b,e[15]=N,e[16]=k):k=e[16];let y;e[17]!==r||e[18]!==i?(y=()=>i(!r),e[17]=r,e[18]=i,e[19]=y):y=e[19];let _;e[20]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsxs("div",{className:"flex flex-col gap-1 flex-1 min-w-0",children:[n.jsxs(Ht,{className:"text-sm font-medium text-foreground flex items-center gap-2 pointer-events-none",children:[n.jsx(Ut,{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]=_):_=e[20];let C;e[21]!==r||e[22]!==i?(C=n.jsx("div",{onClick:da,children:n.jsx(Bt,{checked:r,onCheckedChange:i})}),e[21]=r,e[22]=i,e[23]=C):C=e[23];let $;e[24]!==y||e[25]!==C?($=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:[_,C]}),e[24]=y,e[25]=C,e[26]=$):$=e[26];let S;e[27]!==k||e[28]!==$?(S=n.jsxs("div",{className:"p-5 space-y-6 min-h-[225px]",children:[k,$]}),e[27]=k,e[28]=$,e[29]=S):S=e[29];let z;e[30]!==o.id?(z=n.jsx("span",{className:"font-mono text-xs",children:o.id}),e[30]=o.id,e[31]=z):z=e[31];let O;e[32]!==c?(O=c?n.jsx(ee,{size:14,className:"text-green-600"}):n.jsx(Re,{size:14,className:"opacity-0 group-hover:opacity-100 transition-opacity"}),e[32]=c,e[33]=O):O=e[33];let T;e[34]!==f||e[35]!==z||e[36]!==O?(T=n.jsx(Oe,{asChild:!0,children:n.jsxs("button",{type:"button",onClick:f,className:"group flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[z,O]})}),e[34]=f,e[35]=z,e[36]=O,e[37]=T):T=e[37];let M;e[38]===Symbol.for("react.memo_cache_sentinel")?(M=n.jsx(ze,{side:"top",children:n.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[38]=M):M=e[38];let R;e[39]!==T?(R=n.jsx("div",{className:"border-t border-border px-5 py-4 flex items-center shrink-0",children:n.jsx(Ie,{children:n.jsxs(Te,{children:[T,M]})})}),e[39]=T,e[40]=R):R=e[40];let E;e[41]!==S||e[42]!==R?(E=n.jsxs(Dt,{className:"sm:max-w-lg sm:max-h-[85vh] p-0 flex flex-col",closeButtonClassName:"hidden",children:[g,n.jsxs("div",{className:"flex flex-col",children:[S,R]})]}),e[41]=S,e[42]=R,e[43]=E):E=e[43];let D;return e[44]!==a||e[45]!==s||e[46]!==E?(D=n.jsx(Lt,{open:s,onOpenChange:a,children:E}),e[44]=a,e[45]=s,e[46]=E,e[47]=D):D=e[47],D}function da(t){return t.stopPropagation()}function ma(t){const e=h.c(47),{user:s,userImage:a}=t,[o,l]=w.useState(!1),[r,i]=w.useState(!1);let c;e[0]!==s.email||e[1]!==s.id||e[2]!==s.name?(c=()=>{const D=`ID: ${s.id}
2
+ Name: ${s.name||"N/A"}
3
+ Email: ${s.email}`;navigator.clipboard.writeText(D),i(!0),U.success("User info copied to clipboard"),setTimeout(()=>i(!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(K,{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 f=s.name||s.email||"U";let u;e[8]!==f||e[9]!==a?(u=n.jsx(K,{url:a,fallback:f,shape:"circle",size:"sm"}),e[8]=f,e[9]=a,e[10]=u):u=e[10];const g=s.name||"User";let p;e[11]!==g?(p=n.jsx("div",{className:"text-sm font-medium truncate",children:g}),e[11]=g,e[12]=p):p=e[12];let b;e[13]!==s.email?(b=n.jsx("div",{className:"text-xs text-muted-foreground truncate",children:s.email}),e[13]=s.email,e[14]=b):b=e[14];let x;e[15]!==p||e[16]!==b?(x=n.jsxs("div",{className:"flex-1 min-w-0 text-left",children:[p,b]}),e[15]=p,e[16]=b,e[17]=x):x=e[17];let j;e[18]!==r?(j=n.jsx("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:r?n.jsx(ee,{size:16,className:"text-green-600"}):n.jsx(Re,{size:16,className:"text-muted-foreground"})}),e[18]=r,e[19]=j):j=e[19];let v;e[20]!==u||e[21]!==x||e[22]!==j?(v=n.jsxs("div",{className:"group flex items-center gap-3 w-full py-1",children:[u,x,j]}),e[20]=u,e[21]=x,e[22]=j,e[23]=v):v=e[23];let N;e[24]!==d||e[25]!==v?(N=n.jsx(L.Item,{onClick:d,children:v}),e[24]=d,e[25]=v,e[26]=N):N=e[26];let k;e[27]===Symbol.for("react.memo_cache_sentinel")?(k=n.jsx(L.Separator,{}),e[27]=k):k=e[27];let y,_;e[28]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsxs(L.Item,{onClick:()=>l(!0),children:[n.jsx(ce,{className:"text-muted-foreground",size:18}),"Profile Settings"]}),_=n.jsx(L.Separator,{}),e[28]=y,e[29]=_):(y=e[28],_=e[29]);let C;e[30]===Symbol.for("react.memo_cache_sentinel")?(C=n.jsx(ft,{className:"w-4 h-4 text-muted-foreground"}),e[30]=C):C=e[30];let $;e[31]===Symbol.for("react.memo_cache_sentinel")?($=n.jsx(L.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:[C,"decocms/admin",n.jsx(ge,{size:18,className:"text-muted-foreground ml-auto"})]})}),e[31]=$):$=e[31];let S;e[32]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx(Le,{className:"text-muted-foreground",size:18}),e[32]=S):S=e[32];let z,O;e[33]===Symbol.for("react.memo_cache_sentinel")?(z=n.jsx(L.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:[S,"Homepage",n.jsx(ge,{size:18,className:"ml-auto text-muted-foreground"})]})}),O=n.jsx(L.Separator,{}),e[33]=z,e[34]=O):(z=e[33],O=e[34]);let T;e[35]===Symbol.for("react.memo_cache_sentinel")?(T=n.jsxs(L.Item,{onClick:fa,children:[n.jsx(Be,{size:18,className:"text-muted-foreground"}),"Log out"]}),e[35]=T):T=e[35];let M;e[36]!==N||e[37]!==m||e[38]!==s?(M=n.jsxs(L,{user:s,trigger:m,align:"end",children:[N,k,y,_,$,z,O,T]}),e[36]=N,e[37]=m,e[38]=s,e[39]=M):M=e[39];let R;e[40]!==o||e[41]!==s||e[42]!==a?(R=o&&n.jsx(ca,{open:o,onOpenChange:l,user:s,userImage:a}),e[40]=o,e[41]=s,e[42]=a,e[43]=R):R=e[43];let E;return e[44]!==M||e[45]!==R?(E=n.jsxs(n.Fragment,{children:[M,R]}),e[44]=M,e[45]=R,e[46]=E):E=e[46],E}function fa(){return W.signOut()}function ua(){const t=h.c(7),{data:e}=W.useSession();if(!e?.user){let c;return t[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(K,{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 o;t[1]!==a||t[2]!==s?(o={...s,name:a},t[1]=a,t[2]=s,t[3]=o):o=t[3];const l=o,r=s.image;let i;return t[4]!==r||t[5]!==l?(i=n.jsx(ma,{user:l,userImage:r}),t[4]=r,t[5]=l,t[6]=i):i=t[6],i}function me(){const t=h.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=ie.decoChatOpen(),t[0]=e):e=t[0];const[s,a]=re(e,pa);let o;return t[1]!==s||t[2]!==a?(o=[s,a],t[1]=s,t[2]=a,t[3]=o):o=t[3],o}function pa(t){return!!(t??!1)}function ha(t){const e=h.c(6),{children:s}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(ut,{children:n.jsx(Se,{})}),e[0]=a):a=e[0];let o;e[1]!==s?(o=n.jsx(pt,{children:s}),e[1]=s,e[2]=o):o=e[2];let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(ht,{children:n.jsx(xt,{to:"/login",replace:!0})}),e[3]=l):l=e[3];let r;return e[4]!==o?(r=n.jsxs(n.Fragment,{children:[a,o,l]}),e[4]=o,e[5]=r):r=e[5],r}function xa(t){const e=h.c(5),{children:s,className:a}=t;let o;e[0]!==a?(o=I("fixed top-0 left-0 right-0 z-20 bg-sidebar flex items-center w-full h-12 border-b border-border",a),e[0]=a,e[1]=o):o=e[1];let l;return e[2]!==s||e[3]!==o?(l=n.jsx("div",{className:o,children:s}),e[2]=s,e[3]=o,e[4]=l):l=e[4],l}function ga(t){const e=h.c(5),{children:s,className:a}=t;let o;e[0]!==a?(o=I("flex items-center justify-center px-2.5 h-full border-r border-border",a),e[0]=a,e[1]=o):o=e[1];let l;return e[2]!==s||e[3]!==o?(l=n.jsx("div",{className:o,children:s}),e[2]=s,e[3]=o,e[4]=l):l=e[4],l}function ba(t){const e=h.c(5),{children:s,className:a}=t;let o;e[0]!==a?(o=I("flex items-center gap-2 px-2 h-full",a),e[0]=a,e[1]=o):o=e[1];let l;return e[2]!==s||e[3]!==o?(l=n.jsx("div",{className:o,children:s}),e[2]=s,e[3]=o,e[4]=l):l=e[4],l}function ja(t){const e=h.c(5),{children:s,className:a}=t;let o;e[0]!==a?(o=I("flex items-center gap-2 px-2 h-full flex-1",a),e[0]=a,e[1]=o):o=e[1];let l;return e[2]!==s||e[3]!==o?(l=n.jsx("div",{className:o,children:s}),e[2]=s,e[3]=o,e[4]=l):l=e[4],l}function va(t){const e=h.c(5),{children:s,className:a}=t;let o;e[0]!==a?(o=I("flex items-center gap-2 px-2 h-full ml-auto",a),e[0]=a,e[1]=o):o=e[1];let l;return e[2]!==s||e[3]!==o?(l=n.jsx("div",{className:o,children:s}),e[2]=s,e[3]=o,e[4]=l):l=e[4],l}function wa(){const t=h.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-sidebar 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 Q=Object.assign(xa,{Sidebar:ga,Left:ba,Center:ja,Right:va,Skeleton:wa});function Qe(){const t=h.c(3),{toggleSidebar:e}=de();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(He,{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(H,{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}Qe.Skeleton=function(){return n.jsx("div",{className:"w-7 h-7 bg-muted rounded-md animate-pulse"})};const Na="https://assets.decocache.com/decocms/fd07a578-6b1c-40f1-bc05-88a3b981695d/f7fc4ffa81aec04e37ae670c3cd4936643a7b269.png";function Sa(){const t=h.c(40),{org:e}=se(),[,s]=me(),{createThread:a,activeThread:o,selectedGateway:l,modelsConnections:r,isChatEmpty:i}=wt();if(r.length===0){let y;t[0]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsxs(A.Header.Left,{children:[n.jsx("img",{src:Na,alt:"Chat",className:"size-5 rounded"}),n.jsx("span",{className:"text-sm font-medium",children:"Chat"})]}),t[0]=y):y=t[0];let _;t[1]!==s?(_=()=>s(!1),t[1]=s,t[2]=_):_=t[2];let C;t[3]===Symbol.for("react.memo_cache_sentinel")?(C=n.jsx(Y,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[3]=C):C=t[3];let $;t[4]!==_?($=n.jsxs(A.Header,{children:[y,n.jsx(A.Header.Right,{children:n.jsx("button",{type:"button",onClick:_,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent transition-colors group cursor-pointer",title:"Close chat",children:C})})]}),t[4]=_,t[5]=$):$=t[5];let S;t[6]!==e?(S=n.jsx(A.Main,{className:"flex flex-col items-center",children:n.jsx(A.EmptyState,{children:n.jsx(A.NoLlmBindingEmptyState,{title:"No model provider connected",description:"Connect to a model provider to unlock AI-powered features.",org:e})})}),t[6]=e,t[7]=S):S=t[7];let z;return t[8]!==$||t[9]!==S?(z=n.jsxs(A,{children:[$,S]}),t[8]=$,t[9]=S,t[10]=z):z=t[10],z}let c;t[11]!==o||t[12]!==i?(c=n.jsx(A.Header.Left,{children:!i&&o?.title?n.jsx(Ft,{text:o.title,className:"text-sm font-medium text-foreground"}):n.jsx("span",{className:"text-sm font-medium text-foreground",children:"Chat"})}),t[11]=o,t[12]=i,t[13]=c):c=t[13];let d;t[14]!==a?(d=()=>a(),t[14]=a,t[15]=d):d=t[15];let m;t[16]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(Zt,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[16]=m):m=t[16];let f;t[17]!==d?(f=n.jsx("button",{type:"button",onClick:d,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent group cursor-pointer",title:"New chat",children:m}),t[17]=d,t[18]=f):f=t[18];let u;t[19]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(A.ThreadHistoryPopover,{}),t[19]=u):u=t[19];let g;t[20]!==s?(g=()=>s(!1),t[20]=s,t[21]=g):g=t[21];let p;t[22]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx(Y,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[22]=p):p=t[22];let b;t[23]!==g?(b=n.jsx("button",{type:"button",onClick:g,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent transition-colors group cursor-pointer",title:"Close chat",children:p}),t[23]=g,t[24]=b):b=t[24];let x;t[25]!==f||t[26]!==b?(x=n.jsxs(A.Header.Right,{children:[f,u,b]}),t[25]=f,t[26]=b,t[27]=x):x=t[27];let j;t[28]!==c||t[29]!==x?(j=n.jsxs(A.Header,{children:[c,x]}),t[28]=c,t[29]=x,t[30]=j):j=t[30];let v;t[31]!==i||t[32]!==l?.description||t[33]!==l?.icon||t[34]!==l?.title?(v=n.jsx(A.Main,{children:i?n.jsx(A.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(_t,{icon:l?.icon??"/favicon.svg",name:l?.title||"Chat",size:"lg",fallbackIcon:n.jsx(Ae,{size:32}),className:"size-[60px]! rounded-[18px]!"}),n.jsx("h3",{className:"text-xl font-medium text-foreground",children:l?.title||"Chat"}),n.jsx("div",{className:"text-muted-foreground text-center text-sm max-w-md",children:l?.description??"Ask anything about configuring model providers or using MCP Mesh."})]}),n.jsx(A.IceBreakers,{})]})}):n.jsx(A.Messages,{minHeightOffset:280})}),t[31]=i,t[32]=l?.description,t[33]=l?.icon,t[34]=l?.title,t[35]=v):v=t[35];let N;t[36]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(A.Footer,{children:n.jsx(A.Input,{})}),t[36]=N):N=t[36];let k;return t[37]!==v||t[38]!==j?(k=n.jsxs(A,{children:[j,v,N]}),t[37]=v,t[38]=j,t[39]=k):k=t[39],k}function ya(){const t=h.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(A.Skeleton,{}),t[0]=e):e=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(A.Skeleton,{}),t[1]=s):s=t[1];let a;return t[2]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx($e,{fallback:e,children:n.jsx(w.Suspense,{fallback:s,children:n.jsx(A.Provider,{children:n.jsx(Sa,{})})})}),t[2]=a):a=t[2],a}function je({showSidebarToggle:t=!1,showOrgSwitcher:e=!1,showDecoChat:s=!1,disableDecoChat:a=!1}){const[o,l]=me(),r=w.useRef(a);a&&o&&r.current!==a&&l(!1),r.current=a;const i=()=>{a||l(c=>!c)};return n.jsxs(Q,{children:[t&&n.jsx(Q.Sidebar,{children:n.jsx(Qe,{})}),n.jsx(Q.Left,{children:e&&n.jsx(w.Suspense,{fallback:n.jsx(oe.Skeleton,{}),children:n.jsx(oe,{})})}),n.jsxs(Q.Right,{className:"gap-2",children:[n.jsx(qt,{}),s&&!a&&n.jsxs(H,{size:"sm",variant:"default",onClick:i,className:"h-7 gap-2",children:[n.jsx(Vt,{size:16}),"Chat"]}),n.jsx(ua,{})]})]})}function Ca(t){const e=h.c(10),{children:s,className:a}=t,[,o]=w.useTransition();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=ie.decoChatPanelWidth(),e[0]=l):l=e[0];const[r,i]=re(l,30);let c;e[1]!==i?(c=u=>o(()=>i(u)),e[1]=i,e[2]=c):c=e[2];const d=c;let m;e[3]!==a?(m=I("min-w-0",a),e[3]=a,e[4]=m):m=e[4];let f;return e[5]!==r||e[6]!==s||e[7]!==d||e[8]!==m?(f=n.jsx(Pe,{defaultSize:r,minSize:20,className:m,onResize:d,children:s}),e[5]=r,e[6]=s,e[7]=d,e[8]=m,e[9]=f):f=e[9],f}function _a(t){const e=h.c(5),{children:s}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=ie.sidebarOpen(),e[0]=a):a=e[0];const[o,l]=re(a,!0);let r;return e[1]!==s||e[2]!==l||e[3]!==o?(r=n.jsx(ds,{open:o,onOpenChange:l,children:s}),e[1]=s,e[2]=l,e[3]=o,e[4]=r):r=e[4],r}function ka(t){const e=h.c(12),{disableChat:s}=t,a=s===void 0?!1:s,[o]=me(),l=o&&!a;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(Pe,{className:"bg-background",children:n.jsx(ye,{})}),e[0]=r):r=e[0];let i;e[1]!==a||e[2]!==l?(i=!a&&n.jsx(Gt,{withHandle:l}),e[1]=a,e[2]=l,e[3]=i):i=e[3];const c=l?"max-w-none":"max-w-0";let d;e[4]!==c?(d=I(c),e[4]=c,e[5]=d):d=e[5];let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(ya,{}),e[6]=m):m=e[6];let f;e[7]!==d?(f=n.jsx(Ca,{className:d,children:m}),e[7]=d,e[8]=f):f=e[8];let u;return e[9]!==i||e[10]!==f?(u=n.jsxs(Kt,{direction:"horizontal",children:[r,i,f]}),e[9]=i,e[10]=f,e[11]=u):u=e[11],u}function $a(){const t=h.c(22);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const{org:s}=we(e),a=ve(),o=a.location.pathname===`/${s}`||a.location.pathname===`/${s}/`;let l;t[1]!==s?(l=bt.activeOrganization(s),t[1]=s,t[2]=l):l=t[2];let r;t[3]!==s?(r=async()=>{if(!s)return null;const{data:b}=await W.organization.setActive({organizationSlug:s});return{org:b,project:{slug:yt}}},t[3]=s,t[4]=r):r=t[4];let i;t[5]!==l||t[6]!==r?(i={queryKey:l,queryFn:r,gcTime:1/0,staleTime:1/0,refetchOnWindowFocus:!1,refetchOnMount:!1},t[5]=l,t[6]=r,t[7]=i):i=t[7];const{data:c}=gt(i);if(!c){let b;t[8]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx(je,{}),t[8]=b):b=t[8];let x;return t[9]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsxs("div",{className:"min-h-screen bg-background",children:[b,n.jsx("div",{className:"pt-12",children:n.jsx(ye,{})})]}),t[9]=x):x=t[9],x}let d;t[10]!==o?(d=n.jsx(je,{showSidebarToggle:!0,showOrgSwitcher:!0,showDecoChat:!0,disableDecoChat:o}),t[10]=o,t[11]=d):d=t[11];let m;t[12]===Symbol.for("react.memo_cache_sentinel")?(m={"--sidebar-width":"13rem","--sidebar-width-mobile":"11rem"},t[12]=m):m=t[12];let f;t[13]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx($s,{}),t[13]=f):f=t[13];let u;t[14]!==o?(u=n.jsxs(us,{className:"flex-1 bg-sidebar",style:m,children:[f,n.jsx(hs,{className:"pt-12",children:n.jsx(ka,{disableChat:o})})]}),t[14]=o,t[15]=u):u=t[15];let g;t[16]!==d||t[17]!==u?(g=n.jsx(_a,{children:n.jsxs("div",{className:"flex flex-col h-screen",children:[d,u]})}),t[16]=d,t[17]=u,t[18]=g):g=t[18];let p;return t[19]!==c||t[20]!==g?(p=n.jsx(St,{...c,children:g}),t[19]=c,t[20]=g,t[21]=p):p=t[21],p}function Mn(){const t=h.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(ha,{children:n.jsx(w.Suspense,{fallback:n.jsx(Se,{}),children:n.jsx($a,{})})}),t[0]=e):e=t[0],e}export{Mn as default};
@@ -1 +1 @@
1
- import{c as C,h as d,j as a}from"./index-DZBCLPmz.js";import{c as m}from"./button-C_Xg9B1B.js";const u=d("animate-spin",{variants:{variant:{default:"fill-primary text-gray-200",destructive:"fill-destructive text-gray-200",secondary:"fill-secondary text-gray-200",special:"fill-special text-backround"},size:{default:"h-7 w-7",sm:"h-6 w-6",lg:"h-8 w-8",icon:"h-6 w-6",xs:"h-4 w-4"}},defaultVariants:{variant:"default",size:"default"}});function p(f){const e=C.c(10),{variant:c,size:o}=f;let t;e[0]!==o||e[1]!==c?(t=m(u({variant:c,size:o})),e[0]=o,e[1]=c,e[2]=t):t=e[2];let l,i;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=a.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i=a.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"}),e[3]=l,e[4]=i):(l=e[3],i=e[4]);let s;e[5]!==t?(s=a.jsxs("svg",{"aria-hidden":"true",className:t,viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[l,i]}),e[5]=t,e[6]=s):s=e[6];let r;e[7]===Symbol.for("react.memo_cache_sentinel")?(r=a.jsx("span",{className:"sr-only",children:"Loading..."}),e[7]=r):r=e[7];let n;return e[8]!==s?(n=a.jsxs("div",{role:"status",children:[s,r]}),e[8]=s,e[9]=n):n=e[9],n}export{p as S};
1
+ import{c as C,h as d,j as a}from"./index-Diww4UW3.js";import{c as m}from"./button-CGmrzkpY.js";const u=d("animate-spin",{variants:{variant:{default:"fill-primary text-gray-200",destructive:"fill-destructive text-gray-200",secondary:"fill-secondary text-gray-200",special:"fill-special text-backround"},size:{default:"h-7 w-7",sm:"h-6 w-6",lg:"h-8 w-8",icon:"h-6 w-6",xs:"h-4 w-4"}},defaultVariants:{variant:"default",size:"default"}});function p(f){const e=C.c(10),{variant:c,size:o}=f;let t;e[0]!==o||e[1]!==c?(t=m(u({variant:c,size:o})),e[0]=o,e[1]=c,e[2]=t):t=e[2];let l,i;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=a.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i=a.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"}),e[3]=l,e[4]=i):(l=e[3],i=e[4]);let s;e[5]!==t?(s=a.jsxs("svg",{"aria-hidden":"true",className:t,viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[l,i]}),e[5]=t,e[6]=s):s=e[6];let r;e[7]===Symbol.for("react.memo_cache_sentinel")?(r=a.jsx("span",{className:"sr-only",children:"Loading..."}),e[7]=r):r=e[7];let n;return e[8]!==s?(n=a.jsxs("div",{role:"status",children:[s,r]}),e[8]=s,e[9]=n):n=e[9],n}export{p as S};