@decocms/mesh 2.72.0 → 2.72.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. package/dist/client/assets/{AlertCircle-CHm1uTvc.js → AlertCircle-BOIQEKjW.js} +1 -1
  2. package/dist/client/assets/{ArrowUp-CsvTcSKO.js → ArrowUp-BRclUYsx.js} +1 -1
  3. package/dist/client/assets/{Calendar-RaRlGUMn.js → Calendar-DydX5uRn.js} +1 -1
  4. package/dist/client/assets/{Check-CTaDpFbx.js → Check-Bkb61eVw.js} +1 -1
  5. package/dist/client/assets/{CheckCircle-BUL08lD-.js → CheckCircle-ZkjIkaWv.js} +1 -1
  6. package/dist/client/assets/{CheckDone01-C9iBTpWu.js → CheckDone01-BusS8ANA.js} +1 -1
  7. package/dist/client/assets/{ChevronDown-BmbIYWgz.js → ChevronDown-DqJTvBdv.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-C7PRdwhN.js → ChevronRight-BBcOJkyP.js} +1 -1
  9. package/dist/client/assets/{Code01-BHb1dfFm.js → Code01-DEMYMNLO.js} +1 -1
  10. package/dist/client/assets/{Copy01-BHrubS15.js → Copy01-BvgMlJ5t.js} +1 -1
  11. package/dist/client/assets/{DotsHorizontal-BKEGXeRq.js → DotsHorizontal-C3Pu-YCA.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-6bV4Jb02.js → DotsVertical-DMOP2SMU.js} +1 -1
  13. package/dist/client/assets/{Download01-DCCcXkST.js → Download01-VwSgop8U.js} +1 -1
  14. package/dist/client/assets/{Edit01-Ck6L4sn5.js → Edit01-ByF-cYbh.js} +1 -1
  15. package/dist/client/assets/{File02-Bdk2SiT1.js → File02-D6OcKUS4.js} +1 -1
  16. package/dist/client/assets/{File06-g3-IRgq5.js → File06-CkTcogsG.js} +1 -1
  17. package/dist/client/assets/{FilterLines-CZJIfYWV.js → FilterLines-BL17m8OO.js} +1 -1
  18. package/dist/client/assets/{Globe02-nY9R9qg_.js → Globe02-CwdZK2H5.js} +1 -1
  19. package/dist/client/assets/{Grid01-CzUkHZSJ.js → Grid01-zbmmdox0.js} +1 -1
  20. package/dist/client/assets/{Home02-D9mVq7KP.js → Home02-DPzckV1r.js} +1 -1
  21. package/dist/client/assets/{Image01-C213KIPf.js → Image01-BuXlAy8i.js} +1 -1
  22. package/dist/client/assets/{Inbox01-CXr_wpYC.js → Inbox01-Czow08Bp.js} +1 -1
  23. package/dist/client/assets/{InfoCircle-DEUMb_Ke.js → InfoCircle-C8GtqndP.js} +1 -1
  24. package/dist/client/assets/{LinkExternal01-CmQ2HPM6.js → LinkExternal01-DJasjN8P.js} +1 -1
  25. package/dist/client/assets/{List-hntTIiNx.js → List-BvAv-Mbv.js} +1 -1
  26. package/dist/client/assets/{Loading01-B78uc8_j.js → Loading01-DOPFYU4m.js} +1 -1
  27. package/dist/client/assets/{Lock01-rY0GklCm.js → Lock01-BALKEl0l.js} +1 -1
  28. package/dist/client/assets/{Pin01-B6bFgA7L.js → Pin01-Dk_x7uai.js} +1 -1
  29. package/dist/client/assets/{Play-CMxteKat.js → Play-CjfPPVn_.js} +1 -1
  30. package/dist/client/assets/{Plus-B1DSIk_Y.js → Plus-WaQ7hmj5.js} +1 -1
  31. package/dist/client/assets/{SearchMd-rxhL9uWW.js → SearchMd-Ds-ERWzq.js} +1 -1
  32. package/dist/client/assets/{Settings01-BBpmfPia.js → Settings01-CMNXJNnf.js} +1 -1
  33. package/dist/client/assets/{Share07-DNr4Gv0F.js → Share07-w2-wABEW.js} +1 -1
  34. package/dist/client/assets/{Terminal-CvqFIFfF.js → Terminal-CrrxpXUI.js} +1 -1
  35. package/dist/client/assets/{Tool01-BWEJZQCA.js → Tool01-Cn8FHCpZ.js} +1 -1
  36. package/dist/client/assets/{Trash01-CNJdNb2Z.js → Trash01-C-euKa34.js} +1 -1
  37. package/dist/client/assets/{Upload01-CtypJgSZ.js → Upload01-Dc0hOrKX.js} +1 -1
  38. package/dist/client/assets/{Users03-B_SbeQBk.js → Users03-zsvZ9QWQ.js} +1 -1
  39. package/dist/client/assets/{X-mZzFkOTX.js → X-DUGfq2_H.js} +1 -1
  40. package/dist/client/assets/{XClose-BwAC8sFB.js → XClose-Cv_qbaYN.js} +1 -1
  41. package/dist/client/assets/{agent-connections-preview-DieWCUjN.js → agent-connections-preview-C15fpCN8.js} +1 -1
  42. package/dist/client/assets/{agent-detail-CViIjBwu.js → agent-detail-BQXrWX9M.js} +1 -1
  43. package/dist/client/assets/{agents-CyHP3pcb.js → agents-NgYS-NWl.js} +1 -1
  44. package/dist/client/assets/{alert-dialog-BN06wH-l.js → alert-dialog-B4H6MrIT.js} +1 -1
  45. package/dist/client/assets/{auth-catchall-DXrXBOXl.js → auth-catchall-GUc2KujY.js} +1 -1
  46. package/dist/client/assets/{avatar-2G5ouaDu.js → avatar-B-AS-16N.js} +1 -1
  47. package/dist/client/assets/{badge-tOUVTd9z.js → badge-BFm6jM0d.js} +1 -1
  48. package/dist/client/assets/{binder-CbgCr5Rm.js → binder-C4CQlgMb.js} +1 -1
  49. package/dist/client/assets/{breadcrumb-JfdGMaRd.js → breadcrumb-Cvo4WJJ5.js} +1 -1
  50. package/dist/client/assets/{button-BKtq_PYU.js → button-Cl3WMTWk.js} +1 -1
  51. package/dist/client/assets/{card-C0u1Pmkw.js → card-B-73zAje.js} +1 -1
  52. package/dist/client/assets/{checkbox-DmCTNQLX.js → checkbox-kN_xGJfO.js} +1 -1
  53. package/dist/client/assets/{circle-alert-BNmG-8Wh.js → circle-alert-BEtzK3t3.js} +1 -1
  54. package/dist/client/assets/{collection-detail-CGH1Knd0.js → collection-detail-C9AV2Fn9.js} +1 -1
  55. package/dist/client/assets/{collection-search-MQc1JOFA.js → collection-search-Aeh0FXZR.js} +1 -1
  56. package/dist/client/assets/{collection-tab-qHWWI3bH.js → collection-tab-CgMRLj1Y.js} +1 -1
  57. package/dist/client/assets/{collection-table-wrapper-L4Z0dyO1.js → collection-table-wrapper-CmBNNf0K.js} +1 -1
  58. package/dist/client/assets/{collection-tabs-CyRXUdkR.js → collection-tabs-2AUf3kZ2.js} +1 -1
  59. package/dist/client/assets/{command-Bqwb_7NQ.js → command-DICG2vo0.js} +1 -1
  60. package/dist/client/assets/{connect-D30M34Bx.js → connect-DoxLTvbh.js} +1 -1
  61. package/dist/client/assets/{connection-card-CMQL70VR.js → connection-card-ChzuU2dT.js} +1 -1
  62. package/dist/client/assets/connection-detail-CVNpoyUm.js +1 -0
  63. package/dist/client/assets/{connections-B7K4OdQw.js → connections-BHOwcUB0.js} +1 -1
  64. package/dist/client/assets/{constants-PBHJ4h9F.js → constants-1q3hobyw.js} +1 -1
  65. package/dist/client/assets/constants-DzWq-50V.js +1 -0
  66. package/dist/client/assets/{create-organization-dialog-BOgbyqMq.js → create-organization-dialog-DWV2eGAF.js} +1 -1
  67. package/dist/client/assets/{create-project-dialog-BxxiVX3V.js → create-project-dialog-49RtElmv.js} +1 -1
  68. package/dist/client/assets/{dialog-B8Jtq_Yp.js → dialog-BmGDp4UV.js} +1 -1
  69. package/dist/client/assets/{dropdown-menu-C6Z4raJE.js → dropdown-menu-6IaHSzwJ.js} +1 -1
  70. package/dist/client/assets/{dynamic-plugin-layout-CDgkhjuC.js → dynamic-plugin-layout-C_HHJRk0.js} +1 -1
  71. package/dist/client/assets/{empty-state-BXisfxVt.js → empty-state-DFIrBrC-.js} +1 -1
  72. package/dist/client/assets/{empty-state-B8XrD0Ub.js → empty-state-oU8PNga_.js} +1 -1
  73. package/dist/client/assets/{env-vars-editor-8a4L674b.js → env-vars-editor-Bmnp2cvo.js} +1 -1
  74. package/dist/client/assets/{error-boundary-D9qG4zZt.js → error-boundary-D7C5xzme.js} +1 -1
  75. package/dist/client/assets/{extract-connection-data-CCyj_Y1X.js → extract-connection-data-CQQ4ZZEG.js} +1 -1
  76. package/dist/client/assets/{file-browser-DInIgvl2.js → file-browser-CHtfSNHu.js} +2 -2
  77. package/dist/client/assets/{form-DQap4sDh.js → form-qYB4UriD.js} +1 -1
  78. package/dist/client/assets/{grid-view-BKnSWUuB.js → grid-view-B4Eut3Xi.js} +1 -1
  79. package/dist/client/assets/{home-DvvANWHB.js → home-BYm3DFU4.js} +1 -1
  80. package/dist/client/assets/index--g69ISoA.css +1 -0
  81. package/dist/client/assets/{index-sFvIWgLs.js → index-5T3tdhiA.js} +1 -1
  82. package/dist/client/assets/{index-D5w8F0R7.js → index-9vOB29ZB.js} +1 -1
  83. package/dist/client/assets/{index-UwBLOz8J.js → index-BA6gcyzW.js} +1 -1
  84. package/dist/client/assets/{index-CCcWAtA_.js → index-BV-rIyOx.js} +2 -2
  85. package/dist/client/assets/{index-BMXxQz0A.js → index-BYzsWn1B.js} +1 -1
  86. package/dist/client/assets/{index-D12lWWsR.js → index-CxyQJKsK.js} +1 -1
  87. package/dist/client/assets/{index--tmJoUux.js → index-Dolyg0HI.js} +1 -1
  88. package/dist/client/assets/{index-C76QOf8q.js → index-Vp0uDDij.js} +1 -1
  89. package/dist/client/assets/{index-DFZdUy6e.js → index-fCCl5Un_.js} +1 -1
  90. package/dist/client/assets/{infiniteQueryObserver-BdhSYRBe.js → infiniteQueryObserver-CrYps4St.js} +1 -1
  91. package/dist/client/assets/{input-Dh6Cjukb.js → input-Dv5qvD5N.js} +1 -1
  92. package/dist/client/assets/{integration-icon-Biu6JpM0.js → integration-icon-DKM9NBX1.js} +1 -1
  93. package/dist/client/assets/{layout-DWXfRazY.js → layout-B7afTuaN.js} +1 -1
  94. package/dist/client/assets/{localstorage-keys-BWsOCDUX.js → localstorage-keys-Ds2uOTRP.js} +1 -1
  95. package/dist/client/assets/{login-DoPkmmdP.js → login-BpnfmGBt.js} +1 -1
  96. package/dist/client/assets/{mcp-oauth-BQMyy4a5.js → mcp-oauth-C_XpjqFg.js} +1 -1
  97. package/dist/client/assets/{mcp-server-card-DxnHyWDy.js → mcp-server-card-CiGvO9aP.js} +1 -1
  98. package/dist/client/assets/{mcp-server-detail-BzBDrjZ5.js → mcp-server-detail-SQfpDpYc.js} +2 -2
  99. package/dist/client/assets/{members-pjR_l8r-.js → members-CQSBREQS.js} +1 -1
  100. package/dist/client/assets/{monaco-editor-XyXN2SEV.js → monaco-editor-q53ZLBJ5.js} +1 -1
  101. package/dist/client/assets/{monitoring-BiXkhP0l.js → monitoring-CK4xcQzM.js} +1 -1
  102. package/dist/client/assets/{oauth-callback-COK_3Woz.js → oauth-callback-CeLfnx5m.js} +1 -1
  103. package/dist/client/assets/{page-zhioOXqc.js → page-CrfNBuC7.js} +1 -1
  104. package/dist/client/assets/{page-Ca4TsO7U.js → page-jzi-88Nr.js} +1 -1
  105. package/dist/client/assets/{plugin-empty-state-BWDzgwMT.js → plugin-empty-state-Bnssy2Oj.js} +1 -1
  106. package/dist/client/assets/{plugin-header-Dm-T5OvY.js → plugin-header-DoQQAOys.js} +1 -1
  107. package/dist/client/assets/{popover-Bn1QrYWJ.js → popover-DuZ2ZN5J.js} +1 -1
  108. package/dist/client/assets/{project-layout-DQQxPJ7M.js → project-layout-CH4wXxX2.js} +1 -1
  109. package/dist/client/assets/{project-settings-Bq572DKS.js → project-settings-CKgnjrBp.js} +1 -1
  110. package/dist/client/assets/{projects-list-D2y67tOl.js → projects-list-D0sSao6e.js} +1 -1
  111. package/dist/client/assets/{registry-utils-eTnhYK1Z.js → registry-utils-CqOx6XXE.js} +1 -1
  112. package/dist/client/assets/{resizable-Cth4qfOJ.js → resizable-CZuYHBhW.js} +1 -1
  113. package/dist/client/assets/{select-CJ01X7RE.js → select-ODRW9YrY.js} +1 -1
  114. package/dist/client/assets/{shell-layout-Dmklwlc_.js → shell-layout-BxNK1bDI.js} +1 -1
  115. package/dist/client/assets/{spinner-CoIaSc2j.js → spinner-BPZfVVyD.js} +1 -1
  116. package/dist/client/assets/{store-invite-CM-bUgIj.js → store-invite-ICTVmn8_.js} +1 -1
  117. package/dist/client/assets/{switch-TZYuSAHJ.js → switch-B-1QAIh-.js} +1 -1
  118. package/dist/client/assets/{table-B7Ue2bk2.js → table-BBnlXDKe.js} +1 -1
  119. package/dist/client/assets/{tasks-DvdoE4Ok.js → tasks-CpdqRpYU.js} +1 -1
  120. package/dist/client/assets/{textarea-D6y1LKj_.js → textarea-DK_SwVx9.js} +1 -1
  121. package/dist/client/assets/{tools-list-fxJEZlSp.js → tools-list-B5iaOgKy.js} +1 -1
  122. package/dist/client/assets/{typewriter-title-DR6tdNBL.js → typewriter-title-C_OsyMAQ.js} +1 -1
  123. package/dist/client/assets/{use-binding-ucSDtQ56.js → use-binding-BVOuBiur.js} +1 -1
  124. package/dist/client/assets/{use-connection-BCPygOxC.js → use-connection-B8DnjeO8.js} +1 -1
  125. package/dist/client/assets/{use-create-virtual-mcp-u-AAtHmy.js → use-create-virtual-mcp-7fubOknm.js} +1 -1
  126. package/dist/client/assets/use-deco-chat-open-cMRvRYVG.js +23 -0
  127. package/dist/client/assets/{use-install-from-registry-f8JxKFFW.js → use-install-from-registry-ClVbT6BY.js} +1 -1
  128. package/dist/client/assets/{use-list-state-oNgAMbdK.js → use-list-state-DjV5kR97.js} +1 -1
  129. package/dist/client/assets/{use-llm-Lxpo1ior.js → use-llm-H-K3anTg.js} +1 -1
  130. package/dist/client/assets/{use-mcp-prompts-WwyO9-Nk.js → use-mcp-prompts-Chz_2-6S.js} +1 -1
  131. package/dist/client/assets/{use-mcp-tools-eSLltC3i.js → use-mcp-tools-CXMetymP.js} +1 -1
  132. package/dist/client/assets/{use-mobile-BUK8Wer1.js → use-mobile-B2CDnK8i.js} +1 -1
  133. package/dist/client/assets/{use-organization-settings-BR3GSp3x.js → use-organization-settings-Bu92wRjl.js} +1 -1
  134. package/dist/client/assets/{use-project-DLsFLh3O.js → use-project-CzroiUzj.js} +1 -1
  135. package/dist/client/assets/{use-virtual-mcp-ByfXJ3SB.js → use-virtual-mcp-ayu_K6US.js} +1 -1
  136. package/dist/client/assets/useInfiniteQuery-TqDHdib1.js +1 -0
  137. package/dist/client/assets/{useMutation-Cn2d2ilG.js → useMutation-BOrtlNTb.js} +1 -1
  138. package/dist/client/assets/useQuery-DDYln2BW.js +1 -0
  139. package/dist/client/assets/utils-CfR4kXxZ.js +1 -0
  140. package/dist/client/assets/{view-mode-toggle-BJkt6e92.js → view-mode-toggle-CHHKGadJ.js} +1 -1
  141. package/dist/client/assets/{workflow-BP45xRRH.js → workflow-BBKpGvON.js} +1 -1
  142. package/dist/client/index.html +2 -2
  143. package/package.json +1 -1
  144. package/dist/client/assets/connection-detail-CQNN_rRv.js +0 -1
  145. package/dist/client/assets/constants-DIAAKB_c.js +0 -1
  146. package/dist/client/assets/index-CP_rYaE5.css +0 -1
  147. package/dist/client/assets/use-deco-chat-open-DsNk3kZu.js +0 -23
  148. package/dist/client/assets/useInfiniteQuery-BcqgMbS1.js +0 -1
  149. package/dist/client/assets/useQuery-Dp4Sp9Q1.js +0 -1
  150. package/dist/client/assets/utils-CnoQZeDK.js +0 -1
@@ -1 +1 @@
1
- import{c as G,r as D,u as X,q as ue,K as le,bs as xe,j as s,m as oe,O as ie,g as ge,bt as pe,l as he}from"./index-CCcWAtA_.js";import{P as U}from"./index-D5w8F0R7.js";import{B as je,a as ve,b as ye,c as be}from"./breadcrumb-JfdGMaRd.js";import{i as ae}from"./FilterLines-CZJIfYWV.js";import{n as Ne}from"./Inbox01-CXr_wpYC.js";import{i as Z}from"./Loading01-B78uc8_j.js";import{i as ce}from"./SearchMd-rxhL9uWW.js";import{u as Ce}from"./useInfiniteQuery-BcqgMbS1.js";import{a as Se,f as we,b as Te}from"./registry-utils-eTnhYK1Z.js";import{u as Ie,h as Re,b as Pe}from"./constants-PBHJ4h9F.js";import{f as $e,g as me,h as ke}from"./use-connection-BCPygOxC.js";import{s as Le}from"./slugify-CEUa2lfQ.js";import{C as ze}from"./collection-search-MQc1JOFA.js";import{M as re}from"./mcp-server-card-DxnHyWDy.js";import{B as J}from"./button-BKtq_PYU.js";import{I as Fe}from"./input-Dh6Cjukb.js";import{c as de}from"./utils-CnoQZeDK.js";import{b as Ke,P as Ae,a as Ee}from"./popover-Bn1QrYWJ.js";import{i as Be}from"./Check-CTaDpFbx.js";import{t as De}from"./ChevronDown-BmbIYWgz.js";import{s as Y}from"./XClose-BwAC8sFB.js";import{d as Me,a as Oe,b as Ve,c as _e,S as We}from"./select-CJ01X7RE.js";import{s as qe}from"./Plus-B1DSIk_Y.js";import{E as Ge}from"./empty-state-B8XrD0Ub.js";import{u as He}from"./use-binding-ucSDtQ56.js";import{L as Ue,u as Je}from"./localstorage-keys-BWsOCDUX.js";import"./ChevronRight-C7PRdwhN.js";import"./infiniteQueryObserver-BdhSYRBe.js";import"./useMutation-Cn2d2ilG.js";import"./integration-icon-Biu6JpM0.js";import"./index-BMXxQz0A.js";import"./Globe02-nY9R9qg_.js";import"./Lock01-rY0GklCm.js";import"./Terminal-CvqFIFfF.js";import"./card-C0u1Pmkw.js";import"./github-icon-Dp3wHhYE.js";import"./binder-CbgCr5Rm.js";import"./useQuery-Dp4Sp9Q1.js";function Qe(t,e){const l=G.c(4),[n,c]=D.useState(t),r=D.useRef(null),a=D.useRef(!0);let i,m;return l[0]!==e||l[1]!==t?(i=()=>{if(a.current){a.current=!1;return}return r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{c(t)},e),()=>{r.current&&clearTimeout(r.current)}},m=[t,e],l[0]=e,l[1]=t,l[2]=i,l[3]=m):(i=l[2],m=l[3]),D.useEffect(i,m),n}function Ye(t){const e=G.c(14),l=D.useRef(null),n=`scroll-position:${t}`,c=D.useRef(null);let r;e[0]!==n?(r=()=>{l.current&&sessionStorage.setItem(n,String(l.current.scrollTop))},e[0]=n,e[1]=r):r=e[1];const a=r;let i;e[2]!==n?(i=()=>{if(c.current===n)return;const d=sessionStorage.getItem(n);if(d&&l.current){const j=Number.parseInt(d,10);l.current.scrollTop=j}c.current=n},e[2]=n,e[3]=i):i=e[3];const m=i;let y;e[4]!==m||e[5]!==n?(y=()=>{c.current!==n&&m()},e[4]=m,e[5]=n,e[6]=y):y=e[6];const p=y;let o;e[7]!==m||e[8]!==n?(o=d=>{l.current=d,d&&c.current!==n&&requestAnimationFrame(()=>{m()})},e[7]=m,e[8]=n,e[9]=o):o=e[9];const b=o;let u;return e[10]!==p||e[11]!==a||e[12]!==b?(u={scrollRef:b,saveScrollPosition:a,handleScroll:p},e[10]=p,e[11]=a,e[12]=b,e[13]=u):u=e[13],u}const Ze=24;function Xe(t){const e=G.c(53),{registryId:l,listToolName:n,filtersToolName:c,search:r}=t,{org:a}=X();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=[],e[0]=i):i=e[0];const[m,y]=D.useState(i);let p;e[1]===Symbol.for("react.memo_cache_sentinel")?(p=[],e[1]=p):p=e[1];const[o,b]=D.useState(p),u=l||null;let d;e[2]!==a.id||e[3]!==u?(d={connectionId:u,orgId:a.id},e[2]=a.id,e[3]=u,e[4]=d):d=e[4];const j=Ie(d),I=!!c;let N;e[5]!==c||e[6]!==l?(N=le.toolCall(l,c||"no-filters","{}"),e[5]=c,e[6]=l,e[7]=N):N=e[7];let C;e[8]!==j||e[9]!==c?(C=async()=>{if(!c)return{tags:[],categories:[]};const B=await j.callTool({name:c,arguments:{}});return B.structuredContent??B},e[8]=j,e[9]=c,e[10]=C):C=e[10];let L;e[11]!==N||e[12]!==C?(L={queryKey:N,queryFn:C,staleTime:36e5},e[11]=N,e[12]=C,e[13]=L):L=e[13];const{data:$}=ue(L);let v,S,w;if(e[14]!==n||e[15]!==l||e[16]!==r||e[17]!==o||e[18]!==m){const B=r?.trim()?{operator:"or",conditions:[{field:["name"],operator:"contains",value:r},{field:["title"],operator:"contains",value:r},{field:["description"],operator:"contains",value:r}]}:void 0;v={limit:Ze,...m.length>0&&{tags:m},...o.length>0&&{categories:o},...B&&{where:B}},w=Ce,S=le.toolCall(l,n,JSON.stringify(v)),e[14]=n,e[15]=l,e[16]=r,e[17]=o,e[18]=m,e[19]=v,e[20]=S,e[21]=w}else v=e[19],S=e[20],w=e[21];let T;e[22]!==j||e[23]!==v||e[24]!==n?(T=async B=>{const{pageParam:te}=B,fe=te?{...v,cursor:te}:v,se=await j.callTool({name:n,arguments:fe});return se.structuredContent??se},e[22]=j,e[23]=v,e[24]=n,e[25]=T):T=e[25];let z;e[26]!==T||e[27]!==S?(z={queryKey:S,queryFn:T,initialPageParam:void 0,getNextPageParam:et,staleTime:36e5,placeholderData:xe},e[26]=T,e[27]=S,e[28]=z):z=e[28];const{data:A,fetchNextPage:k,hasNextPage:f,isFetchingNextPage:x,isFetching:g,isLoading:R}=w(z);let P;e:{if(!A?.pages||A.pages.length===0){P=null;break e}const B=A.pages[0];if(typeof B=="object"&&B!==null&&"totalCount"in B&&typeof B.totalCount=="number"){P=B.totalCount;break e}P=null}const K=P,h=A?.pages;let F;e[29]!==h?(F=Se(h),e[29]=h,e[30]=F):F=e[30];const E=F;let O;e[31]!==r||e[32]!==o.length||e[33]!==m.length?(O=m.length>0||o.length>0||!!r?.trim(),e[31]=r,e[32]=o.length,e[33]=m.length,e[34]=O):O=e[34];const V=O,W=g&&!x&&!R&&V;let q;e[35]!==k||e[36]!==f||e[37]!==x?(q=()=>{f&&!x&&k()},e[35]=k,e[36]=f,e[37]=x,e[38]=q):q=e[38];const M=q,_=f??!1,H=I?$?.tags:void 0,ee=I?$?.categories:void 0;let Q;return e[39]!==V||e[40]!==g||e[41]!==x||e[42]!==W||e[43]!==R||e[44]!==E||e[45]!==M||e[46]!==o||e[47]!==m||e[48]!==_||e[49]!==H||e[50]!==ee||e[51]!==K?(Q={items:E,totalCount:K,hasMore:_,isLoadingMore:x,isFiltering:W,isInitialLoading:R,isFetching:g,loadMore:M,availableTags:H,availableCategories:ee,selectedTags:m,selectedCategories:o,setSelectedTags:y,setSelectedCategories:b,hasActiveFilters:V},e[39]=V,e[40]=g,e[41]=x,e[42]=W,e[43]=R,e[44]=E,e[45]=M,e[46]=o,e[47]=m,e[48]=_,e[49]=H,e[50]=ee,e[51]=K,e[52]=Q):Q=e[52],Q}function et(t){if(typeof t=="object"&&t!==null){const e=t.nextCursor||t.cursor;if(e)return e}}function tt(t,e){return[...t].sort((l,n)=>n.count-l.count).slice(0,e)}function ne(t){const e=G.c(52),{label:l,items:n,selectedItems:c,onToggle:r,onClear:a}=t,[i,m]=D.useState(""),[y,p]=D.useState(!1);let o,b,u,d,j,I,N,C,L,$,v;if(e[0]!==n||e[1]!==l||e[2]!==r||e[3]!==y||e[4]!==i||e[5]!==c){const k=[...i?n.filter(F=>F.value.toLowerCase().includes(i.toLowerCase())):n].sort(st);u=c.length,b=Ke,L=y,$=p;let f;e[17]!==l?(f=s.jsx("span",{children:l}),e[17]=l,e[18]=f):f=e[18];let x;e[19]!==u?(x=u>0&&s.jsx("span",{className:"ml-1 rounded-full bg-primary text-primary-foreground px-1.5 py-0.5 text-[10px] font-medium",children:u}),e[19]=u,e[20]=x):x=e[20];let g;e[21]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(De,{size:14,className:"opacity-50"}),e[21]=g):g=e[21],e[22]!==x||e[23]!==f?(v=s.jsx(Ae,{asChild:!0,children:s.jsxs(J,{variant:"outline",size:"sm",className:"h-7 px-3 gap-1.5 text-xs font-normal flex-1",children:[f,x,g]})}),e[22]=x,e[23]=f,e[24]=v):v=e[24],o=Ee,I="w-64 p-0",N="start";let R;e[25]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(ce,{size:16,className:"text-muted-foreground shrink-0"}),e[25]=R):R=e[25];let P;e[26]!==l?(P=l.toLowerCase(),e[26]=l,e[27]=P):P=e[27];const K=`Search ${P}...`;let h;e[28]===Symbol.for("react.memo_cache_sentinel")?(h=F=>m(F.target.value),e[28]=h):h=e[28],e[29]!==i||e[30]!==K?(C=s.jsx("div",{className:"shrink-0 w-full border-b border-border h-10",children:s.jsxs("label",{className:"flex items-center gap-2.5 h-10 px-4 cursor-text",children:[R,s.jsx(Fe,{type:"text",placeholder:K,value:i,onChange:h,className:"flex-1 border-0 shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"})]})}),e[29]=i,e[30]=K,e[31]=C):C=e[31],d="max-h-64 overflow-y-auto p-1 flex flex-col gap-1",j=k.length===0?s.jsx("div",{className:"px-2 py-4 text-sm text-muted-foreground text-center",children:"No results found"}):k.map(F=>{const E=c.includes(F.value);return s.jsxs("button",{onClick:()=>r(F.value),className:de("w-full flex items-center justify-between px-2 py-1.5 text-sm rounded cursor-pointer transition-colors",E?"bg-accent/50 text-foreground":"hover:bg-muted text-foreground"),children:[s.jsxs("span",{className:"truncate flex items-center gap-2",children:[E&&s.jsx(Be,{size:16,className:"text-muted-foreground shrink-0"}),F.value]}),s.jsx("span",{className:"text-xs text-muted-foreground ml-2 shrink-0",children:F.count})]},F.value)}),e[0]=n,e[1]=l,e[2]=r,e[3]=y,e[4]=i,e[5]=c,e[6]=o,e[7]=b,e[8]=u,e[9]=d,e[10]=j,e[11]=I,e[12]=N,e[13]=C,e[14]=L,e[15]=$,e[16]=v}else o=e[6],b=e[7],u=e[8],d=e[9],j=e[10],I=e[11],N=e[12],C=e[13],L=e[14],$=e[15],v=e[16];let S;e[32]!==d||e[33]!==j?(S=s.jsx("div",{className:d,children:j}),e[32]=d,e[33]=j,e[34]=S):S=e[34];let w;e[35]!==l||e[36]!==a||e[37]!==u?(w=u>0&&s.jsx("div",{className:"p-2 border-t border-border",children:s.jsxs(J,{variant:"ghost",size:"sm",onClick:a,className:"w-full text-xs text-muted-foreground hover:text-foreground",children:["Clear ",l.toLowerCase()]})}),e[35]=l,e[36]=a,e[37]=u,e[38]=w):w=e[38];let T;e[39]!==o||e[40]!==w||e[41]!==I||e[42]!==N||e[43]!==C||e[44]!==S?(T=s.jsxs(o,{className:I,align:N,children:[C,S,w]}),e[39]=o,e[40]=w,e[41]=I,e[42]=N,e[43]=C,e[44]=S,e[45]=T):T=e[45];let z;return e[46]!==b||e[47]!==T||e[48]!==L||e[49]!==$||e[50]!==v?(z=s.jsxs(b,{open:L,onOpenChange:$,children:[v,T]}),e[46]=b,e[47]=T,e[48]=L,e[49]=$,e[50]=v,e[51]=z):z=e[51],z}function st(t,e){return e.count-t.count}function lt(t){const e=G.c(67),{availableTags:l,availableCategories:n,selectedTags:c,selectedCategories:r,onTagChange:a,onCategoryChange:i}=t,m=l&&l.length>0||n&&n.length>0,y=c.length>0||r.length>0;if(!m)return null;let p;e[0]!==a||e[1]!==c?(p=f=>{c.includes(f)?a(c.filter(x=>x!==f)):a([...c,f])},e[0]=a,e[1]=c,e[2]=p):p=e[2];const o=p;let b;e[3]!==i||e[4]!==r?(b=f=>{r.includes(f)?i(r.filter(x=>x!==f)):i([...r,f])},e[3]=i,e[4]=r,e[5]=b):b=e[5];const u=b;let d;e[6]!==i||e[7]!==a?(d=()=>{a([]),i([])},e[6]=i,e[7]=a,e[8]=d):d=e[8];const j=d;let I,N,C,L,$,v,S;if(e[9]!==n||e[10]!==l||e[11]!==i||e[12]!==a||e[13]!==r||e[14]!==c||e[15]!==u||e[16]!==o){const f=n?tt(n,6):[];I=r,N=c,S=new Set(f.map(rt)),$="flex items-center border-b border-border";let x;e[24]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("div",{className:"flex items-center gap-2 text-muted-foreground",children:s.jsx(ae,{size:16})}),e[24]=x):x=e[24];let g;e[25]!==n||e[26]!==i||e[27]!==r||e[28]!==u?(g=n&&n.length>0&&s.jsx(ne,{label:"Categories",items:n,selectedItems:r,onToggle:u,onClear:()=>i([])}),e[25]=n,e[26]=i,e[27]=r,e[28]=u,e[29]=g):g=e[29];let R;e[30]!==l||e[31]!==a||e[32]!==c||e[33]!==o?(R=l&&l.length>0&&s.jsx(ne,{label:"Tags",items:l,selectedItems:c,onToggle:o,onClear:()=>a([])}),e[30]=l,e[31]=a,e[32]=c,e[33]=o,e[34]=R):R=e[34],e[35]!==R||e[36]!==g?(v=s.jsxs("div",{className:"flex items-center gap-3 flex-wrap px-5 py-3 border-r border-border",children:[x,g,R]}),e[35]=R,e[36]=g,e[37]=v):v=e[37],C="flex items-center gap-3 flex-wrap px-5 py-3";let P;e[38]!==r||e[39]!==u?(P=K=>{const h=r.includes(K.value);return s.jsxs("div",{onClick:()=>u(K.value),className:de("inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer",h?"bg-primary text-primary-foreground hover:bg-primary/80":"bg-muted hover:bg-accent text-muted-foreground"),children:[s.jsx("span",{children:K.value}),h&&s.jsx("span",{onClick:F=>{F.stopPropagation(),u(K.value)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:s.jsx(Y,{size:12})})]},K.value)},e[38]=r,e[39]=u,e[40]=P):P=e[40],L=f.map(P),e[9]=n,e[10]=l,e[11]=i,e[12]=a,e[13]=r,e[14]=c,e[15]=u,e[16]=o,e[17]=I,e[18]=N,e[19]=C,e[20]=L,e[21]=$,e[22]=v,e[23]=S}else I=e[17],N=e[18],C=e[19],L=e[20],$=e[21],v=e[22],S=e[23];let w;if(e[41]!==I||e[42]!==u||e[43]!==S){let f;e[45]!==S?(f=g=>!S.has(g),e[45]=S,e[46]=f):f=e[46];let x;e[47]!==u?(x=g=>s.jsxs("div",{onClick:()=>u(g),className:"inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer bg-primary text-primary-foreground hover:bg-accent/50",children:[s.jsx("span",{children:g}),s.jsx("span",{onClick:R=>{R.stopPropagation(),u(g)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:s.jsx(Y,{size:12})})]},`cat-${g}`),e[47]=u,e[48]=x):x=e[48],w=I.filter(f).map(x),e[41]=I,e[42]=u,e[43]=S,e[44]=w}else w=e[44];let T;if(e[49]!==N||e[50]!==o){let f;e[52]!==o?(f=x=>s.jsxs("div",{onClick:()=>o(x),className:"inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer bg-primary text-primary-foreground hover:bg-accent/50",children:[s.jsx("span",{children:x}),s.jsx("span",{onClick:g=>{g.stopPropagation(),o(x)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:s.jsx(Y,{size:12})})]},`tag-${x}`),e[52]=o,e[53]=f):f=e[53],T=N.map(f),e[49]=N,e[50]=o,e[51]=T}else T=e[51];let z;e[54]!==j||e[55]!==y?(z=y&&s.jsxs(J,{variant:"ghost",size:"sm",onClick:j,className:"h-7 text-xs text-muted-foreground hover:text-foreground gap-1 px-2",children:[s.jsx(Y,{size:14}),"Clear all"]}),e[54]=j,e[55]=y,e[56]=z):z=e[56];let A;e[57]!==z||e[58]!==C||e[59]!==L||e[60]!==w||e[61]!==T?(A=s.jsxs("div",{className:C,children:[L,w,T,z]}),e[57]=z,e[58]=C,e[59]=L,e[60]=w,e[61]=T,e[62]=A):A=e[62];let k;return e[63]!==A||e[64]!==$||e[65]!==v?(k=s.jsxs("div",{className:$,children:[v,A]}),e[63]=A,e[64]=$,e[65]=v,e[66]=k):k=e[66],k}function rt(t){return t.value}function nt(t,e){if(!e)return t;const l=e.toLowerCase();return t.filter(n=>(n.name||n.title||"").toLowerCase().includes(l)||(n.description||n.server.description||"").toLowerCase().includes(l))}function ot(t){return t.verified===!0||t._meta?.["mcp.mesh"]?.verified===!0}function it(t){const e=G.c(54),{registryId:l,listToolName:n,filtersToolName:c}=t,[r,a]=D.useState(""),i=Qe(r,300),m=oe(),{org:y}=X(),{scrollRef:p,saveScrollPosition:o,handleScroll:b}=Ye(`store-discovery:${l}`);let u;e[0]!==i||e[1]!==c||e[2]!==n||e[3]!==l?(u={registryId:l,listToolName:n,filtersToolName:c,search:i},e[0]=i,e[1]=c,e[2]=n,e[3]=l,e[4]=u):u=e[4];const{items:d,hasMore:j,isLoadingMore:I,isInitialLoading:N,isFetching:C,loadMore:L,availableTags:$,availableCategories:v,selectedTags:S,selectedCategories:w,setSelectedTags:T,setSelectedCategories:z,hasActiveFilters:A}=Xe(u);let k,f,x,g;e[5]!==i||e[6]!==C||e[7]!==N||e[8]!==d||e[9]!==r?(k=r?nt(d,r):d,f=(r!==i||C)&&!N&&!!r,g=k.filter(ot),x=k.filter(M=>!g.find(_=>_.id===M.id)),e[5]=i,e[6]=C,e[7]=N,e[8]=d,e[9]=r,e[10]=k,e[11]=f,e[12]=x,e[13]=g):(k=e[10],f=e[11],x=e[12],g=e[13]);const R=x;let P;e[14]!==m||e[15]!==y.slug||e[16]!==l||e[17]!==o?(P=M=>{o();const _=Le(M.name||M.title||M.server.title||""),H=M.server.name;m({to:"/$org/$project/store/$appName",params:{org:y.slug,project:ie,appName:_},search:{registryId:l,serverName:H}})},e[14]=m,e[15]=y.slug,e[16]=l,e[17]=o,e[18]=P):P=e[18];const K=P;let h;e[19]!==b||e[20]!==j||e[21]!==I||e[22]!==L?(h=M=>{if(b(),!j||I)return;const _=M.currentTarget;_.scrollHeight-_.scrollTop-_.clientHeight<200&&L()},e[19]=b,e[20]=j,e[21]=I,e[22]=L,e[23]=h):h=e[23];const F=h;let E;e[24]!==f||e[25]!==r?(E=s.jsx(ze,{value:r,onChange:a,placeholder:"Search for an MCP Server...",isSearching:f}),e[24]=f,e[25]=r,e[26]=E):E=e[26];let O;e[27]!==v||e[28]!==$||e[29]!==w||e[30]!==S||e[31]!==z||e[32]!==T?(O=s.jsx(lt,{availableTags:$,availableCategories:v,selectedTags:S,selectedCategories:w,onTagChange:T,onCategoryChange:z}),e[27]=v,e[28]=$,e[29]=w,e[30]=S,e[31]=z,e[32]=T,e[33]=O):O=e[33];let V;e[34]!==R||e[35]!==k||e[36]!==K||e[37]!==A||e[38]!==j||e[39]!==N||e[40]!==I||e[41]!==f||e[42]!==d||e[43]!==r||e[44]!==g?(V=s.jsx("div",{className:"p-5",children:s.jsx("div",{children:N?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(Z,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading items..."})]}):d.length===0&&!A?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(Ne,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No items available"}),s.jsx("p",{className:"text-muted-foreground",children:"This store doesn't have any available items yet."})]}):d.length===0&&A&&!r?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(ae,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No matching items"}),s.jsx("p",{className:"text-muted-foreground",children:"Try adjusting your filters to find more results."})]}):r&&k.length===0&&!f?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(ce,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No results found"}),s.jsx("p",{className:"text-muted-foreground",children:"Try adjusting your search terms."})]}):s.jsxs("div",{className:"flex flex-col gap-8",children:[f&&k.length===0&&s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(Z,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Searching..."})]}),g.length>0&&s.jsx(re,{items:g,title:"Verified",onItemClick:K}),R.length>0&&s.jsx(re,{items:R,title:g.length>0?"All":"",onItemClick:K}),j&&I&&s.jsx("div",{className:"flex justify-center py-8",children:s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[s.jsx(Z,{size:20,className:"animate-spin"}),s.jsx("span",{className:"text-sm",children:"Loading more items..."})]})})]})})}),e[34]=R,e[35]=k,e[36]=K,e[37]=A,e[38]=j,e[39]=N,e[40]=I,e[41]=f,e[42]=d,e[43]=r,e[44]=g,e[45]=V):V=e[45];let W;e[46]!==F||e[47]!==p||e[48]!==V?(W=s.jsx("div",{ref:p,className:"flex-1 overflow-y-auto",onScroll:F,children:V}),e[46]=F,e[47]=p,e[48]=V,e[49]=W):W=e[49];let q;return e[50]!==E||e[51]!==O||e[52]!==W?(q=s.jsxs("div",{className:"flex flex-col h-full",children:[E,O,W]}),e[50]=E,e[51]=O,e[52]=W,e[53]=q):q=e[53],q}function at(t){const e=G.c(8),{registryId:l}=t,n=$e(l),c=n?.tools;let r;e[0]!==c?(r=we(c),e[0]=c,e[1]=r):r=e[1];const a=r;if(!a)throw new Error("This registry does not support listing store items.");const i=n?.tools;let m;e[2]!==i?(m=Te(i),e[2]=i,e[3]=m):m=e[3];const p=m||void 0;let o;return e[4]!==a||e[5]!==l||e[6]!==p?(o=s.jsx(it,{registryId:l,listToolName:a,filtersToolName:p}),e[4]=a,e[5]=l,e[6]=p,e[7]=o):o=e[7],o}function ct(t){const e=G.c(15),{registries:l,value:n,onValueChange:c,onAddWellKnown:r,wellKnownRegistries:a,placeholder:i}=t,m=i===void 0?"Select a registry...":i;let y;e[0]!==m?(y=s.jsx(Oe,{size:"sm",className:"w-auto min-w-[160px]",children:s.jsx(Ve,{placeholder:m})}),e[0]=m,e[1]=y):y=e[1];let p;e[2]!==l?(p=l.map(mt),e[2]=l,e[3]=p):p=e[3];let o;e[4]!==r||e[5]!==a?(o=a.length>0&&s.jsxs("div",{className:"border-t border-border pt-1",children:[s.jsx("p",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:"Other known registries"}),a.map(d=>s.jsxs("button",{onClick:j=>{j.preventDefault(),j.stopPropagation(),r(d)},className:"relative flex w-full cursor-pointer items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none hover:bg-accent hover:text-accent-foreground",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[d.icon?s.jsx("img",{src:d.icon,alt:d.title,className:"w-4 h-4 rounded"}):s.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:d.title.slice(0,1).toUpperCase()}),s.jsx("span",{className:"flex-1",children:d.title})]}),s.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center text-muted-foreground",children:s.jsx(qe,{size:16})})]},d.id??d.title))]}),e[4]=r,e[5]=a,e[6]=o):o=e[6];let b;e[7]!==p||e[8]!==o?(b=s.jsxs(_e,{children:[p,o]}),e[7]=p,e[8]=o,e[9]=b):b=e[9];let u;return e[10]!==c||e[11]!==y||e[12]!==b||e[13]!==n?(u=s.jsxs(We,{value:n,onValueChange:c,children:[y,b]}),e[10]=c,e[11]=y,e[12]=b,e[13]=n,e[14]=u):u=e[14],u}function mt(t){return s.jsx(Me,{className:"cursor-pointer",value:t.id??t.name,children:s.jsxs("div",{className:"flex items-center gap-2",children:[t.icon?s.jsx("img",{src:t.icon,alt:t.name,className:"w-4 h-4 rounded"}):s.jsx("div",{className:"w-4 h-4 rounded from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:t.name.slice(0,1).toUpperCase()}),s.jsx("span",{children:t.name})]})},t.id??t.name)}function dt({registries:t,onConnected:e}){const l=me(),{org:{slug:n}}=X(),{data:c}=ge.useSession(),r=oe(),[a,i]=D.useState(!1),m=t[0],y=async()=>{if(!(!m||!c?.user?.id)){i(!0);try{const o=await l.create.mutateAsync(m);e?.(o.id)}finally{i(!1)}}},p=()=>{r({to:"/$org/$project/mcps",params:{org:n,project:ie},search:{action:"create"}})};return s.jsx(Ge,{image:s.jsx("img",{src:"/store-empty-state.svg",alt:"No store connected",width:336,height:320,className:"max-w-full h-auto"}),title:"Connect to registry",description:"Connect to discover and use Connections from the community.",actions:s.jsxs(s.Fragment,{children:[s.jsxs(J,{variant:"outline",onClick:y,disabled:a||!m,children:[m?.icon&&s.jsx("img",{src:m.icon,alt:"",className:"size-4"}),a?"Installing...":"Install Registry"]}),s.jsx(J,{variant:"outline",onClick:p,children:"Custom Connection"})]})})}function Xt(){const t=G.c(42),{org:e}=X(),l=ke(),n=me(),c=pe(),r=c.location.pathname.includes("/store/")&&c.location.pathname.split("/").length>3,a=He(l);let i;t[0]!==a?(i=a.map(xt),t[0]=a,t[1]=i):i=t[1];const m=i;let y;t[2]!==e.slug?(y=Ue.selectedRegistry(e.slug),t[2]=e.slug,t[3]=y):y=t[3];const[p,o]=Je(y,ut);let b;if(t[4]!==a||t[5]!==p){let h;t[7]!==p?(h=F=>F.id===p,t[7]=p,t[8]=h):h=t[8],b=a.find(h),t[4]=a,t[5]=p,t[6]=b}else b=t[6];const d=b?.id||a[0]?.id||"";let j;t[9]!==e.id?(j=Re(e.id),t[9]=e.id,t[10]=j):j=t[10];let I;t[11]!==j?(I=[j],t[11]=j,t[12]=I):I=t[12];const N=I;let C;t[13]===Symbol.for("react.memo_cache_sentinel")?(C=[Pe()],t[13]=C):C=t[13];const L=C;let $;t[14]!==n.create||t[15]!==o?($=async h=>{const F=await n.create.mutateAsync(h);o(F.id)},t[14]=n.create,t[15]=o,t[16]=$):$=t[16];const v=$;let S;t[17]!==a?(S=new Set(a.map(ft)),t[17]=a,t[18]=S):S=t[18];const w=S;let T;t[19]!==w||t[20]!==N?(T=N.filter(h=>h.id&&!w.has(h.id)),t[19]=w,t[20]=N,t[21]=T):T=t[21];const z=T;let A;t[22]!==w?(A=L.filter(h=>h.id&&!w.has(h.id)),t[22]=w,t[23]=A):A=t[23];const k=A;if(r){let h;return t[24]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(he,{}),t[24]=h):h=t[24],h}let f;t[25]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(U.Header.Left,{children:s.jsx(je,{children:s.jsx(ve,{children:s.jsx(ye,{children:s.jsx(be,{children:"Store"})})})})}),t[25]=f):f=t[25];let x;t[26]!==v?(x=async h=>v(h),t[26]=v,t[27]=x):x=t[27];let g;t[28]!==z||t[29]!==d||t[30]!==m||t[31]!==o||t[32]!==x?(g=s.jsxs(U.Header,{children:[f,s.jsx(U.Header.Right,{children:s.jsx(ct,{wellKnownRegistries:z,registries:m,value:d,onValueChange:o,onAddWellKnown:x,placeholder:"Select store..."})})]}),t[28]=z,t[29]=d,t[30]=m,t[31]=o,t[32]=x,t[33]=g):g=t[33];let R;t[34]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[s.jsx(Z,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading store items..."})]}),t[34]=R):R=t[34];let P;t[35]!==k||t[36]!==d||t[37]!==o?(P=s.jsx(U.Content,{children:s.jsx(D.Suspense,{fallback:R,children:d?s.jsx(at,{registryId:d}):s.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:s.jsx(dt,{registries:k,onConnected:h=>{o(h)}})})})}),t[35]=k,t[36]=d,t[37]=o,t[38]=P):P=t[38];let K;return t[39]!==g||t[40]!==P?(K=s.jsxs(U,{children:[g,P]}),t[39]=g,t[40]=P,t[41]=K):K=t[41],K}function ft(t){return t.id}function ut(t){return t??""}function xt(t){return{id:t.id,name:t.title,icon:t.icon||void 0}}export{Xt as default};
1
+ import{c as G,r as D,u as X,q as ue,K as le,bs as xe,j as s,m as oe,O as ie,g as ge,bt as pe,l as he}from"./index-BV-rIyOx.js";import{P as U}from"./index-9vOB29ZB.js";import{B as je,a as ve,b as ye,c as be}from"./breadcrumb-Cvo4WJJ5.js";import{i as ae}from"./FilterLines-BL17m8OO.js";import{n as Ne}from"./Inbox01-Czow08Bp.js";import{i as Z}from"./Loading01-DOPFYU4m.js";import{i as ce}from"./SearchMd-Ds-ERWzq.js";import{u as Ce}from"./useInfiniteQuery-TqDHdib1.js";import{a as Se,f as we,b as Te}from"./registry-utils-CqOx6XXE.js";import{u as Ie,h as Re,b as Pe}from"./constants-1q3hobyw.js";import{f as $e,g as me,h as ke}from"./use-connection-B8DnjeO8.js";import{s as Le}from"./slugify-CEUa2lfQ.js";import{C as ze}from"./collection-search-Aeh0FXZR.js";import{M as re}from"./mcp-server-card-CiGvO9aP.js";import{B as J}from"./button-Cl3WMTWk.js";import{I as Fe}from"./input-Dv5qvD5N.js";import{c as de}from"./utils-CfR4kXxZ.js";import{b as Ke,P as Ae,a as Ee}from"./popover-DuZ2ZN5J.js";import{i as Be}from"./Check-Bkb61eVw.js";import{t as De}from"./ChevronDown-DqJTvBdv.js";import{s as Y}from"./XClose-Cv_qbaYN.js";import{d as Me,a as Oe,b as Ve,c as _e,S as We}from"./select-ODRW9YrY.js";import{s as qe}from"./Plus-WaQ7hmj5.js";import{E as Ge}from"./empty-state-oU8PNga_.js";import{u as He}from"./use-binding-BVOuBiur.js";import{L as Ue,u as Je}from"./localstorage-keys-Ds2uOTRP.js";import"./ChevronRight-BBcOJkyP.js";import"./infiniteQueryObserver-CrYps4St.js";import"./useMutation-BOrtlNTb.js";import"./integration-icon-DKM9NBX1.js";import"./index-BYzsWn1B.js";import"./Globe02-CwdZK2H5.js";import"./Lock01-BALKEl0l.js";import"./Terminal-CrrxpXUI.js";import"./card-B-73zAje.js";import"./github-icon-Dp3wHhYE.js";import"./binder-C4CQlgMb.js";import"./useQuery-DDYln2BW.js";function Qe(t,e){const l=G.c(4),[n,c]=D.useState(t),r=D.useRef(null),a=D.useRef(!0);let i,m;return l[0]!==e||l[1]!==t?(i=()=>{if(a.current){a.current=!1;return}return r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{c(t)},e),()=>{r.current&&clearTimeout(r.current)}},m=[t,e],l[0]=e,l[1]=t,l[2]=i,l[3]=m):(i=l[2],m=l[3]),D.useEffect(i,m),n}function Ye(t){const e=G.c(14),l=D.useRef(null),n=`scroll-position:${t}`,c=D.useRef(null);let r;e[0]!==n?(r=()=>{l.current&&sessionStorage.setItem(n,String(l.current.scrollTop))},e[0]=n,e[1]=r):r=e[1];const a=r;let i;e[2]!==n?(i=()=>{if(c.current===n)return;const d=sessionStorage.getItem(n);if(d&&l.current){const j=Number.parseInt(d,10);l.current.scrollTop=j}c.current=n},e[2]=n,e[3]=i):i=e[3];const m=i;let y;e[4]!==m||e[5]!==n?(y=()=>{c.current!==n&&m()},e[4]=m,e[5]=n,e[6]=y):y=e[6];const p=y;let o;e[7]!==m||e[8]!==n?(o=d=>{l.current=d,d&&c.current!==n&&requestAnimationFrame(()=>{m()})},e[7]=m,e[8]=n,e[9]=o):o=e[9];const b=o;let u;return e[10]!==p||e[11]!==a||e[12]!==b?(u={scrollRef:b,saveScrollPosition:a,handleScroll:p},e[10]=p,e[11]=a,e[12]=b,e[13]=u):u=e[13],u}const Ze=24;function Xe(t){const e=G.c(53),{registryId:l,listToolName:n,filtersToolName:c,search:r}=t,{org:a}=X();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=[],e[0]=i):i=e[0];const[m,y]=D.useState(i);let p;e[1]===Symbol.for("react.memo_cache_sentinel")?(p=[],e[1]=p):p=e[1];const[o,b]=D.useState(p),u=l||null;let d;e[2]!==a.id||e[3]!==u?(d={connectionId:u,orgId:a.id},e[2]=a.id,e[3]=u,e[4]=d):d=e[4];const j=Ie(d),I=!!c;let N;e[5]!==c||e[6]!==l?(N=le.toolCall(l,c||"no-filters","{}"),e[5]=c,e[6]=l,e[7]=N):N=e[7];let C;e[8]!==j||e[9]!==c?(C=async()=>{if(!c)return{tags:[],categories:[]};const B=await j.callTool({name:c,arguments:{}});return B.structuredContent??B},e[8]=j,e[9]=c,e[10]=C):C=e[10];let L;e[11]!==N||e[12]!==C?(L={queryKey:N,queryFn:C,staleTime:36e5},e[11]=N,e[12]=C,e[13]=L):L=e[13];const{data:$}=ue(L);let v,S,w;if(e[14]!==n||e[15]!==l||e[16]!==r||e[17]!==o||e[18]!==m){const B=r?.trim()?{operator:"or",conditions:[{field:["name"],operator:"contains",value:r},{field:["title"],operator:"contains",value:r},{field:["description"],operator:"contains",value:r}]}:void 0;v={limit:Ze,...m.length>0&&{tags:m},...o.length>0&&{categories:o},...B&&{where:B}},w=Ce,S=le.toolCall(l,n,JSON.stringify(v)),e[14]=n,e[15]=l,e[16]=r,e[17]=o,e[18]=m,e[19]=v,e[20]=S,e[21]=w}else v=e[19],S=e[20],w=e[21];let T;e[22]!==j||e[23]!==v||e[24]!==n?(T=async B=>{const{pageParam:te}=B,fe=te?{...v,cursor:te}:v,se=await j.callTool({name:n,arguments:fe});return se.structuredContent??se},e[22]=j,e[23]=v,e[24]=n,e[25]=T):T=e[25];let z;e[26]!==T||e[27]!==S?(z={queryKey:S,queryFn:T,initialPageParam:void 0,getNextPageParam:et,staleTime:36e5,placeholderData:xe},e[26]=T,e[27]=S,e[28]=z):z=e[28];const{data:A,fetchNextPage:k,hasNextPage:f,isFetchingNextPage:x,isFetching:g,isLoading:R}=w(z);let P;e:{if(!A?.pages||A.pages.length===0){P=null;break e}const B=A.pages[0];if(typeof B=="object"&&B!==null&&"totalCount"in B&&typeof B.totalCount=="number"){P=B.totalCount;break e}P=null}const K=P,h=A?.pages;let F;e[29]!==h?(F=Se(h),e[29]=h,e[30]=F):F=e[30];const E=F;let O;e[31]!==r||e[32]!==o.length||e[33]!==m.length?(O=m.length>0||o.length>0||!!r?.trim(),e[31]=r,e[32]=o.length,e[33]=m.length,e[34]=O):O=e[34];const V=O,W=g&&!x&&!R&&V;let q;e[35]!==k||e[36]!==f||e[37]!==x?(q=()=>{f&&!x&&k()},e[35]=k,e[36]=f,e[37]=x,e[38]=q):q=e[38];const M=q,_=f??!1,H=I?$?.tags:void 0,ee=I?$?.categories:void 0;let Q;return e[39]!==V||e[40]!==g||e[41]!==x||e[42]!==W||e[43]!==R||e[44]!==E||e[45]!==M||e[46]!==o||e[47]!==m||e[48]!==_||e[49]!==H||e[50]!==ee||e[51]!==K?(Q={items:E,totalCount:K,hasMore:_,isLoadingMore:x,isFiltering:W,isInitialLoading:R,isFetching:g,loadMore:M,availableTags:H,availableCategories:ee,selectedTags:m,selectedCategories:o,setSelectedTags:y,setSelectedCategories:b,hasActiveFilters:V},e[39]=V,e[40]=g,e[41]=x,e[42]=W,e[43]=R,e[44]=E,e[45]=M,e[46]=o,e[47]=m,e[48]=_,e[49]=H,e[50]=ee,e[51]=K,e[52]=Q):Q=e[52],Q}function et(t){if(typeof t=="object"&&t!==null){const e=t.nextCursor||t.cursor;if(e)return e}}function tt(t,e){return[...t].sort((l,n)=>n.count-l.count).slice(0,e)}function ne(t){const e=G.c(52),{label:l,items:n,selectedItems:c,onToggle:r,onClear:a}=t,[i,m]=D.useState(""),[y,p]=D.useState(!1);let o,b,u,d,j,I,N,C,L,$,v;if(e[0]!==n||e[1]!==l||e[2]!==r||e[3]!==y||e[4]!==i||e[5]!==c){const k=[...i?n.filter(F=>F.value.toLowerCase().includes(i.toLowerCase())):n].sort(st);u=c.length,b=Ke,L=y,$=p;let f;e[17]!==l?(f=s.jsx("span",{children:l}),e[17]=l,e[18]=f):f=e[18];let x;e[19]!==u?(x=u>0&&s.jsx("span",{className:"ml-1 rounded-full bg-primary text-primary-foreground px-1.5 py-0.5 text-[10px] font-medium",children:u}),e[19]=u,e[20]=x):x=e[20];let g;e[21]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(De,{size:14,className:"opacity-50"}),e[21]=g):g=e[21],e[22]!==x||e[23]!==f?(v=s.jsx(Ae,{asChild:!0,children:s.jsxs(J,{variant:"outline",size:"sm",className:"h-7 px-3 gap-1.5 text-xs font-normal flex-1",children:[f,x,g]})}),e[22]=x,e[23]=f,e[24]=v):v=e[24],o=Ee,I="w-64 p-0",N="start";let R;e[25]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(ce,{size:16,className:"text-muted-foreground shrink-0"}),e[25]=R):R=e[25];let P;e[26]!==l?(P=l.toLowerCase(),e[26]=l,e[27]=P):P=e[27];const K=`Search ${P}...`;let h;e[28]===Symbol.for("react.memo_cache_sentinel")?(h=F=>m(F.target.value),e[28]=h):h=e[28],e[29]!==i||e[30]!==K?(C=s.jsx("div",{className:"shrink-0 w-full border-b border-border h-10",children:s.jsxs("label",{className:"flex items-center gap-2.5 h-10 px-4 cursor-text",children:[R,s.jsx(Fe,{type:"text",placeholder:K,value:i,onChange:h,className:"flex-1 border-0 shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"})]})}),e[29]=i,e[30]=K,e[31]=C):C=e[31],d="max-h-64 overflow-y-auto p-1 flex flex-col gap-1",j=k.length===0?s.jsx("div",{className:"px-2 py-4 text-sm text-muted-foreground text-center",children:"No results found"}):k.map(F=>{const E=c.includes(F.value);return s.jsxs("button",{onClick:()=>r(F.value),className:de("w-full flex items-center justify-between px-2 py-1.5 text-sm rounded cursor-pointer transition-colors",E?"bg-accent/50 text-foreground":"hover:bg-muted text-foreground"),children:[s.jsxs("span",{className:"truncate flex items-center gap-2",children:[E&&s.jsx(Be,{size:16,className:"text-muted-foreground shrink-0"}),F.value]}),s.jsx("span",{className:"text-xs text-muted-foreground ml-2 shrink-0",children:F.count})]},F.value)}),e[0]=n,e[1]=l,e[2]=r,e[3]=y,e[4]=i,e[5]=c,e[6]=o,e[7]=b,e[8]=u,e[9]=d,e[10]=j,e[11]=I,e[12]=N,e[13]=C,e[14]=L,e[15]=$,e[16]=v}else o=e[6],b=e[7],u=e[8],d=e[9],j=e[10],I=e[11],N=e[12],C=e[13],L=e[14],$=e[15],v=e[16];let S;e[32]!==d||e[33]!==j?(S=s.jsx("div",{className:d,children:j}),e[32]=d,e[33]=j,e[34]=S):S=e[34];let w;e[35]!==l||e[36]!==a||e[37]!==u?(w=u>0&&s.jsx("div",{className:"p-2 border-t border-border",children:s.jsxs(J,{variant:"ghost",size:"sm",onClick:a,className:"w-full text-xs text-muted-foreground hover:text-foreground",children:["Clear ",l.toLowerCase()]})}),e[35]=l,e[36]=a,e[37]=u,e[38]=w):w=e[38];let T;e[39]!==o||e[40]!==w||e[41]!==I||e[42]!==N||e[43]!==C||e[44]!==S?(T=s.jsxs(o,{className:I,align:N,children:[C,S,w]}),e[39]=o,e[40]=w,e[41]=I,e[42]=N,e[43]=C,e[44]=S,e[45]=T):T=e[45];let z;return e[46]!==b||e[47]!==T||e[48]!==L||e[49]!==$||e[50]!==v?(z=s.jsxs(b,{open:L,onOpenChange:$,children:[v,T]}),e[46]=b,e[47]=T,e[48]=L,e[49]=$,e[50]=v,e[51]=z):z=e[51],z}function st(t,e){return e.count-t.count}function lt(t){const e=G.c(67),{availableTags:l,availableCategories:n,selectedTags:c,selectedCategories:r,onTagChange:a,onCategoryChange:i}=t,m=l&&l.length>0||n&&n.length>0,y=c.length>0||r.length>0;if(!m)return null;let p;e[0]!==a||e[1]!==c?(p=f=>{c.includes(f)?a(c.filter(x=>x!==f)):a([...c,f])},e[0]=a,e[1]=c,e[2]=p):p=e[2];const o=p;let b;e[3]!==i||e[4]!==r?(b=f=>{r.includes(f)?i(r.filter(x=>x!==f)):i([...r,f])},e[3]=i,e[4]=r,e[5]=b):b=e[5];const u=b;let d;e[6]!==i||e[7]!==a?(d=()=>{a([]),i([])},e[6]=i,e[7]=a,e[8]=d):d=e[8];const j=d;let I,N,C,L,$,v,S;if(e[9]!==n||e[10]!==l||e[11]!==i||e[12]!==a||e[13]!==r||e[14]!==c||e[15]!==u||e[16]!==o){const f=n?tt(n,6):[];I=r,N=c,S=new Set(f.map(rt)),$="flex items-center border-b border-border";let x;e[24]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("div",{className:"flex items-center gap-2 text-muted-foreground",children:s.jsx(ae,{size:16})}),e[24]=x):x=e[24];let g;e[25]!==n||e[26]!==i||e[27]!==r||e[28]!==u?(g=n&&n.length>0&&s.jsx(ne,{label:"Categories",items:n,selectedItems:r,onToggle:u,onClear:()=>i([])}),e[25]=n,e[26]=i,e[27]=r,e[28]=u,e[29]=g):g=e[29];let R;e[30]!==l||e[31]!==a||e[32]!==c||e[33]!==o?(R=l&&l.length>0&&s.jsx(ne,{label:"Tags",items:l,selectedItems:c,onToggle:o,onClear:()=>a([])}),e[30]=l,e[31]=a,e[32]=c,e[33]=o,e[34]=R):R=e[34],e[35]!==R||e[36]!==g?(v=s.jsxs("div",{className:"flex items-center gap-3 flex-wrap px-5 py-3 border-r border-border",children:[x,g,R]}),e[35]=R,e[36]=g,e[37]=v):v=e[37],C="flex items-center gap-3 flex-wrap px-5 py-3";let P;e[38]!==r||e[39]!==u?(P=K=>{const h=r.includes(K.value);return s.jsxs("div",{onClick:()=>u(K.value),className:de("inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer",h?"bg-primary text-primary-foreground hover:bg-primary/80":"bg-muted hover:bg-accent text-muted-foreground"),children:[s.jsx("span",{children:K.value}),h&&s.jsx("span",{onClick:F=>{F.stopPropagation(),u(K.value)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:s.jsx(Y,{size:12})})]},K.value)},e[38]=r,e[39]=u,e[40]=P):P=e[40],L=f.map(P),e[9]=n,e[10]=l,e[11]=i,e[12]=a,e[13]=r,e[14]=c,e[15]=u,e[16]=o,e[17]=I,e[18]=N,e[19]=C,e[20]=L,e[21]=$,e[22]=v,e[23]=S}else I=e[17],N=e[18],C=e[19],L=e[20],$=e[21],v=e[22],S=e[23];let w;if(e[41]!==I||e[42]!==u||e[43]!==S){let f;e[45]!==S?(f=g=>!S.has(g),e[45]=S,e[46]=f):f=e[46];let x;e[47]!==u?(x=g=>s.jsxs("div",{onClick:()=>u(g),className:"inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer bg-primary text-primary-foreground hover:bg-accent/50",children:[s.jsx("span",{children:g}),s.jsx("span",{onClick:R=>{R.stopPropagation(),u(g)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:s.jsx(Y,{size:12})})]},`cat-${g}`),e[47]=u,e[48]=x):x=e[48],w=I.filter(f).map(x),e[41]=I,e[42]=u,e[43]=S,e[44]=w}else w=e[44];let T;if(e[49]!==N||e[50]!==o){let f;e[52]!==o?(f=x=>s.jsxs("div",{onClick:()=>o(x),className:"inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer bg-primary text-primary-foreground hover:bg-accent/50",children:[s.jsx("span",{children:x}),s.jsx("span",{onClick:g=>{g.stopPropagation(),o(x)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:s.jsx(Y,{size:12})})]},`tag-${x}`),e[52]=o,e[53]=f):f=e[53],T=N.map(f),e[49]=N,e[50]=o,e[51]=T}else T=e[51];let z;e[54]!==j||e[55]!==y?(z=y&&s.jsxs(J,{variant:"ghost",size:"sm",onClick:j,className:"h-7 text-xs text-muted-foreground hover:text-foreground gap-1 px-2",children:[s.jsx(Y,{size:14}),"Clear all"]}),e[54]=j,e[55]=y,e[56]=z):z=e[56];let A;e[57]!==z||e[58]!==C||e[59]!==L||e[60]!==w||e[61]!==T?(A=s.jsxs("div",{className:C,children:[L,w,T,z]}),e[57]=z,e[58]=C,e[59]=L,e[60]=w,e[61]=T,e[62]=A):A=e[62];let k;return e[63]!==A||e[64]!==$||e[65]!==v?(k=s.jsxs("div",{className:$,children:[v,A]}),e[63]=A,e[64]=$,e[65]=v,e[66]=k):k=e[66],k}function rt(t){return t.value}function nt(t,e){if(!e)return t;const l=e.toLowerCase();return t.filter(n=>(n.name||n.title||"").toLowerCase().includes(l)||(n.description||n.server.description||"").toLowerCase().includes(l))}function ot(t){return t.verified===!0||t._meta?.["mcp.mesh"]?.verified===!0}function it(t){const e=G.c(54),{registryId:l,listToolName:n,filtersToolName:c}=t,[r,a]=D.useState(""),i=Qe(r,300),m=oe(),{org:y}=X(),{scrollRef:p,saveScrollPosition:o,handleScroll:b}=Ye(`store-discovery:${l}`);let u;e[0]!==i||e[1]!==c||e[2]!==n||e[3]!==l?(u={registryId:l,listToolName:n,filtersToolName:c,search:i},e[0]=i,e[1]=c,e[2]=n,e[3]=l,e[4]=u):u=e[4];const{items:d,hasMore:j,isLoadingMore:I,isInitialLoading:N,isFetching:C,loadMore:L,availableTags:$,availableCategories:v,selectedTags:S,selectedCategories:w,setSelectedTags:T,setSelectedCategories:z,hasActiveFilters:A}=Xe(u);let k,f,x,g;e[5]!==i||e[6]!==C||e[7]!==N||e[8]!==d||e[9]!==r?(k=r?nt(d,r):d,f=(r!==i||C)&&!N&&!!r,g=k.filter(ot),x=k.filter(M=>!g.find(_=>_.id===M.id)),e[5]=i,e[6]=C,e[7]=N,e[8]=d,e[9]=r,e[10]=k,e[11]=f,e[12]=x,e[13]=g):(k=e[10],f=e[11],x=e[12],g=e[13]);const R=x;let P;e[14]!==m||e[15]!==y.slug||e[16]!==l||e[17]!==o?(P=M=>{o();const _=Le(M.name||M.title||M.server.title||""),H=M.server.name;m({to:"/$org/$project/store/$appName",params:{org:y.slug,project:ie,appName:_},search:{registryId:l,serverName:H}})},e[14]=m,e[15]=y.slug,e[16]=l,e[17]=o,e[18]=P):P=e[18];const K=P;let h;e[19]!==b||e[20]!==j||e[21]!==I||e[22]!==L?(h=M=>{if(b(),!j||I)return;const _=M.currentTarget;_.scrollHeight-_.scrollTop-_.clientHeight<200&&L()},e[19]=b,e[20]=j,e[21]=I,e[22]=L,e[23]=h):h=e[23];const F=h;let E;e[24]!==f||e[25]!==r?(E=s.jsx(ze,{value:r,onChange:a,placeholder:"Search for an MCP Server...",isSearching:f}),e[24]=f,e[25]=r,e[26]=E):E=e[26];let O;e[27]!==v||e[28]!==$||e[29]!==w||e[30]!==S||e[31]!==z||e[32]!==T?(O=s.jsx(lt,{availableTags:$,availableCategories:v,selectedTags:S,selectedCategories:w,onTagChange:T,onCategoryChange:z}),e[27]=v,e[28]=$,e[29]=w,e[30]=S,e[31]=z,e[32]=T,e[33]=O):O=e[33];let V;e[34]!==R||e[35]!==k||e[36]!==K||e[37]!==A||e[38]!==j||e[39]!==N||e[40]!==I||e[41]!==f||e[42]!==d||e[43]!==r||e[44]!==g?(V=s.jsx("div",{className:"p-5",children:s.jsx("div",{children:N?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(Z,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading items..."})]}):d.length===0&&!A?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(Ne,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No items available"}),s.jsx("p",{className:"text-muted-foreground",children:"This store doesn't have any available items yet."})]}):d.length===0&&A&&!r?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(ae,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No matching items"}),s.jsx("p",{className:"text-muted-foreground",children:"Try adjusting your filters to find more results."})]}):r&&k.length===0&&!f?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(ce,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No results found"}),s.jsx("p",{className:"text-muted-foreground",children:"Try adjusting your search terms."})]}):s.jsxs("div",{className:"flex flex-col gap-8",children:[f&&k.length===0&&s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(Z,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Searching..."})]}),g.length>0&&s.jsx(re,{items:g,title:"Verified",onItemClick:K}),R.length>0&&s.jsx(re,{items:R,title:g.length>0?"All":"",onItemClick:K}),j&&I&&s.jsx("div",{className:"flex justify-center py-8",children:s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[s.jsx(Z,{size:20,className:"animate-spin"}),s.jsx("span",{className:"text-sm",children:"Loading more items..."})]})})]})})}),e[34]=R,e[35]=k,e[36]=K,e[37]=A,e[38]=j,e[39]=N,e[40]=I,e[41]=f,e[42]=d,e[43]=r,e[44]=g,e[45]=V):V=e[45];let W;e[46]!==F||e[47]!==p||e[48]!==V?(W=s.jsx("div",{ref:p,className:"flex-1 overflow-y-auto",onScroll:F,children:V}),e[46]=F,e[47]=p,e[48]=V,e[49]=W):W=e[49];let q;return e[50]!==E||e[51]!==O||e[52]!==W?(q=s.jsxs("div",{className:"flex flex-col h-full",children:[E,O,W]}),e[50]=E,e[51]=O,e[52]=W,e[53]=q):q=e[53],q}function at(t){const e=G.c(8),{registryId:l}=t,n=$e(l),c=n?.tools;let r;e[0]!==c?(r=we(c),e[0]=c,e[1]=r):r=e[1];const a=r;if(!a)throw new Error("This registry does not support listing store items.");const i=n?.tools;let m;e[2]!==i?(m=Te(i),e[2]=i,e[3]=m):m=e[3];const p=m||void 0;let o;return e[4]!==a||e[5]!==l||e[6]!==p?(o=s.jsx(it,{registryId:l,listToolName:a,filtersToolName:p}),e[4]=a,e[5]=l,e[6]=p,e[7]=o):o=e[7],o}function ct(t){const e=G.c(15),{registries:l,value:n,onValueChange:c,onAddWellKnown:r,wellKnownRegistries:a,placeholder:i}=t,m=i===void 0?"Select a registry...":i;let y;e[0]!==m?(y=s.jsx(Oe,{size:"sm",className:"w-auto min-w-[160px]",children:s.jsx(Ve,{placeholder:m})}),e[0]=m,e[1]=y):y=e[1];let p;e[2]!==l?(p=l.map(mt),e[2]=l,e[3]=p):p=e[3];let o;e[4]!==r||e[5]!==a?(o=a.length>0&&s.jsxs("div",{className:"border-t border-border pt-1",children:[s.jsx("p",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:"Other known registries"}),a.map(d=>s.jsxs("button",{onClick:j=>{j.preventDefault(),j.stopPropagation(),r(d)},className:"relative flex w-full cursor-pointer items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none hover:bg-accent hover:text-accent-foreground",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[d.icon?s.jsx("img",{src:d.icon,alt:d.title,className:"w-4 h-4 rounded"}):s.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:d.title.slice(0,1).toUpperCase()}),s.jsx("span",{className:"flex-1",children:d.title})]}),s.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center text-muted-foreground",children:s.jsx(qe,{size:16})})]},d.id??d.title))]}),e[4]=r,e[5]=a,e[6]=o):o=e[6];let b;e[7]!==p||e[8]!==o?(b=s.jsxs(_e,{children:[p,o]}),e[7]=p,e[8]=o,e[9]=b):b=e[9];let u;return e[10]!==c||e[11]!==y||e[12]!==b||e[13]!==n?(u=s.jsxs(We,{value:n,onValueChange:c,children:[y,b]}),e[10]=c,e[11]=y,e[12]=b,e[13]=n,e[14]=u):u=e[14],u}function mt(t){return s.jsx(Me,{className:"cursor-pointer",value:t.id??t.name,children:s.jsxs("div",{className:"flex items-center gap-2",children:[t.icon?s.jsx("img",{src:t.icon,alt:t.name,className:"w-4 h-4 rounded"}):s.jsx("div",{className:"w-4 h-4 rounded from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:t.name.slice(0,1).toUpperCase()}),s.jsx("span",{children:t.name})]})},t.id??t.name)}function dt({registries:t,onConnected:e}){const l=me(),{org:{slug:n}}=X(),{data:c}=ge.useSession(),r=oe(),[a,i]=D.useState(!1),m=t[0],y=async()=>{if(!(!m||!c?.user?.id)){i(!0);try{const o=await l.create.mutateAsync(m);e?.(o.id)}finally{i(!1)}}},p=()=>{r({to:"/$org/$project/mcps",params:{org:n,project:ie},search:{action:"create"}})};return s.jsx(Ge,{image:s.jsx("img",{src:"/store-empty-state.svg",alt:"No store connected",width:336,height:320,className:"max-w-full h-auto"}),title:"Connect to registry",description:"Connect to discover and use Connections from the community.",actions:s.jsxs(s.Fragment,{children:[s.jsxs(J,{variant:"outline",onClick:y,disabled:a||!m,children:[m?.icon&&s.jsx("img",{src:m.icon,alt:"",className:"size-4"}),a?"Installing...":"Install Registry"]}),s.jsx(J,{variant:"outline",onClick:p,children:"Custom Connection"})]})})}function Xt(){const t=G.c(42),{org:e}=X(),l=ke(),n=me(),c=pe(),r=c.location.pathname.includes("/store/")&&c.location.pathname.split("/").length>3,a=He(l);let i;t[0]!==a?(i=a.map(xt),t[0]=a,t[1]=i):i=t[1];const m=i;let y;t[2]!==e.slug?(y=Ue.selectedRegistry(e.slug),t[2]=e.slug,t[3]=y):y=t[3];const[p,o]=Je(y,ut);let b;if(t[4]!==a||t[5]!==p){let h;t[7]!==p?(h=F=>F.id===p,t[7]=p,t[8]=h):h=t[8],b=a.find(h),t[4]=a,t[5]=p,t[6]=b}else b=t[6];const d=b?.id||a[0]?.id||"";let j;t[9]!==e.id?(j=Re(e.id),t[9]=e.id,t[10]=j):j=t[10];let I;t[11]!==j?(I=[j],t[11]=j,t[12]=I):I=t[12];const N=I;let C;t[13]===Symbol.for("react.memo_cache_sentinel")?(C=[Pe()],t[13]=C):C=t[13];const L=C;let $;t[14]!==n.create||t[15]!==o?($=async h=>{const F=await n.create.mutateAsync(h);o(F.id)},t[14]=n.create,t[15]=o,t[16]=$):$=t[16];const v=$;let S;t[17]!==a?(S=new Set(a.map(ft)),t[17]=a,t[18]=S):S=t[18];const w=S;let T;t[19]!==w||t[20]!==N?(T=N.filter(h=>h.id&&!w.has(h.id)),t[19]=w,t[20]=N,t[21]=T):T=t[21];const z=T;let A;t[22]!==w?(A=L.filter(h=>h.id&&!w.has(h.id)),t[22]=w,t[23]=A):A=t[23];const k=A;if(r){let h;return t[24]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(he,{}),t[24]=h):h=t[24],h}let f;t[25]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(U.Header.Left,{children:s.jsx(je,{children:s.jsx(ve,{children:s.jsx(ye,{children:s.jsx(be,{children:"Store"})})})})}),t[25]=f):f=t[25];let x;t[26]!==v?(x=async h=>v(h),t[26]=v,t[27]=x):x=t[27];let g;t[28]!==z||t[29]!==d||t[30]!==m||t[31]!==o||t[32]!==x?(g=s.jsxs(U.Header,{children:[f,s.jsx(U.Header.Right,{children:s.jsx(ct,{wellKnownRegistries:z,registries:m,value:d,onValueChange:o,onAddWellKnown:x,placeholder:"Select store..."})})]}),t[28]=z,t[29]=d,t[30]=m,t[31]=o,t[32]=x,t[33]=g):g=t[33];let R;t[34]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[s.jsx(Z,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading store items..."})]}),t[34]=R):R=t[34];let P;t[35]!==k||t[36]!==d||t[37]!==o?(P=s.jsx(U.Content,{children:s.jsx(D.Suspense,{fallback:R,children:d?s.jsx(at,{registryId:d}):s.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:s.jsx(dt,{registries:k,onConnected:h=>{o(h)}})})})}),t[35]=k,t[36]=d,t[37]=o,t[38]=P):P=t[38];let K;return t[39]!==g||t[40]!==P?(K=s.jsxs(U,{children:[g,P]}),t[39]=g,t[40]=P,t[41]=K):K=t[41],K}function ft(t){return t.id}function ut(t){return t??""}function xt(t){return{id:t.id,name:t.title,icon:t.icon||void 0}}export{Xt as default};
@@ -1 +1 @@
1
- import{c as n,j as t,$ as o}from"./index-CCcWAtA_.js";function c(){const s=n.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[t.jsx(o,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No storage connected"}),t.jsx("p",{className:"text-muted-foreground text-center max-w-md",children:"Connect an S3-compatible storage service to browse and manage files."})]}),s[0]=e):e=s[0],e}export{c as default};
1
+ import{c as n,j as t,$ as o}from"./index-BV-rIyOx.js";function c(){const s=n.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[t.jsx(o,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No storage connected"}),t.jsx("p",{className:"text-muted-foreground text-center max-w-md",children:"Connect an S3-compatible storage service to browse and manage files."})]}),s[0]=e):e=s[0],e}export{c as default};
@@ -1 +1 @@
1
- import{c as w,j as s,r as S,$ as y}from"./index-CCcWAtA_.js";import{i as _}from"./Check-CTaDpFbx.js";import{t as $}from"./ChevronDown-BmbIYWgz.js";function k(x){const e=w.c(32),{connections:l,selectedConnectionId:n,onConnectionChange:N}=x,[r,z]=S.useState(!1),C=S.useRef(null);let p;if(e[0]!==l||e[1]!==n){let t;e[3]!==n?(t=u=>u.id===n,e[3]=n,e[4]=t):t=e[4],p=l.find(t),e[0]=l,e[1]=n,e[2]=p}else p=e[2];const i=p;let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j=t=>{C.current?.contains(t.relatedTarget)||z(!1)},e[5]=j):j=e[5];const R=j;if(l.length===1){let t;e[6]!==i?(t=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[6]=i,e[7]=t):t=e[7];const u=i?.title||"Storage";let f;e[8]!==u?(f=s.jsx("span",{children:u}),e[8]=u,e[9]=f):f=e[9];let h;return e[10]!==t||e[11]!==f?(h=s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[t,f]}),e[10]=t,e[11]=f,e[12]=h):h=e[12],h}let o;e[13]!==r?(o=()=>z(!r),e[13]=r,e[14]=o):o=e[14];let a;e[15]!==i?(a=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[15]=i,e[16]=a):a=e[16];const v=i?.title||"Select storage";let c;e[17]!==v?(c=s.jsx("span",{children:v}),e[17]=v,e[18]=c):c=e[18];let b;e[19]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx($,{size:14}),e[19]=b):b=e[19];let d;e[20]!==o||e[21]!==a||e[22]!==c?(d=s.jsxs("button",{type:"button",onClick:o,className:"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-md border border-border bg-background hover:bg-accent transition-colors",children:[a,c,b]}),e[20]=o,e[21]=a,e[22]=c,e[23]=d):d=e[23];let m;e[24]!==l||e[25]!==r||e[26]!==N||e[27]!==n?(m=r&&s.jsx("div",{className:"absolute left-0 top-full mt-1 z-50 min-w-48 rounded-md border border-border bg-popover p-1 shadow-md",children:l.map(t=>s.jsxs("button",{type:"button",onClick:()=>{N(t.id),z(!1)},className:"flex items-center gap-2 w-full px-2 py-1.5 text-sm rounded-sm hover:bg-accent transition-colors",children:[t.icon?s.jsx("img",{src:t.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),s.jsx("span",{className:"flex-1 text-left",children:t.title}),t.id===n&&s.jsx(_,{size:14,className:"text-primary"})]},t.id))}),e[24]=l,e[25]=r,e[26]=N,e[27]=n,e[28]=m):m=e[28];let g;return e[29]!==d||e[30]!==m?(g=s.jsxs("div",{className:"relative",ref:C,onBlur:R,children:[d,m]}),e[29]=d,e[30]=m,e[31]=g):g=e[31],g}function O(x){const e=w.c(2);let l;return e[0]!==x?(l=s.jsx(k,{...x}),e[0]=x,e[1]=l):l=e[1],l}export{O as default};
1
+ import{c as w,j as s,r as S,$ as y}from"./index-BV-rIyOx.js";import{i as _}from"./Check-Bkb61eVw.js";import{t as $}from"./ChevronDown-DqJTvBdv.js";function k(x){const e=w.c(32),{connections:l,selectedConnectionId:n,onConnectionChange:N}=x,[r,z]=S.useState(!1),C=S.useRef(null);let p;if(e[0]!==l||e[1]!==n){let t;e[3]!==n?(t=u=>u.id===n,e[3]=n,e[4]=t):t=e[4],p=l.find(t),e[0]=l,e[1]=n,e[2]=p}else p=e[2];const i=p;let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j=t=>{C.current?.contains(t.relatedTarget)||z(!1)},e[5]=j):j=e[5];const R=j;if(l.length===1){let t;e[6]!==i?(t=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[6]=i,e[7]=t):t=e[7];const u=i?.title||"Storage";let f;e[8]!==u?(f=s.jsx("span",{children:u}),e[8]=u,e[9]=f):f=e[9];let h;return e[10]!==t||e[11]!==f?(h=s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[t,f]}),e[10]=t,e[11]=f,e[12]=h):h=e[12],h}let o;e[13]!==r?(o=()=>z(!r),e[13]=r,e[14]=o):o=e[14];let a;e[15]!==i?(a=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[15]=i,e[16]=a):a=e[16];const v=i?.title||"Select storage";let c;e[17]!==v?(c=s.jsx("span",{children:v}),e[17]=v,e[18]=c):c=e[18];let b;e[19]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx($,{size:14}),e[19]=b):b=e[19];let d;e[20]!==o||e[21]!==a||e[22]!==c?(d=s.jsxs("button",{type:"button",onClick:o,className:"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-md border border-border bg-background hover:bg-accent transition-colors",children:[a,c,b]}),e[20]=o,e[21]=a,e[22]=c,e[23]=d):d=e[23];let m;e[24]!==l||e[25]!==r||e[26]!==N||e[27]!==n?(m=r&&s.jsx("div",{className:"absolute left-0 top-full mt-1 z-50 min-w-48 rounded-md border border-border bg-popover p-1 shadow-md",children:l.map(t=>s.jsxs("button",{type:"button",onClick:()=>{N(t.id),z(!1)},className:"flex items-center gap-2 w-full px-2 py-1.5 text-sm rounded-sm hover:bg-accent transition-colors",children:[t.icon?s.jsx("img",{src:t.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),s.jsx("span",{className:"flex-1 text-left",children:t.title}),t.id===n&&s.jsx(_,{size:14,className:"text-primary"})]},t.id))}),e[24]=l,e[25]=r,e[26]=N,e[27]=n,e[28]=m):m=e[28];let g;return e[29]!==d||e[30]!==m?(g=s.jsxs("div",{className:"relative",ref:C,onBlur:R,children:[d,m]}),e[29]=d,e[30]=m,e[31]=g):g=e[31],g}function O(x){const e=w.c(2);let l;return e[0]!==x?(l=s.jsx(k,{...x}),e[0]=x,e[1]=l):l=e[1],l}export{O as default};
@@ -1 +1 @@
1
- import{r as i,am as $,j as c,as as z,at as L,al as O,_,an as g,au as w,av as E,aw as G,ax as j,ay as H,az as K,aq as q,aA as B,aB as U,aC as V,aD as W,aE as Z,aF as J,c as R}from"./index-CCcWAtA_.js";import{c as Q}from"./utils-CnoQZeDK.js";var m="Popover",[b]=q(m,[j]),P=j(),[X,d]=b(m),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),[x,f]=$({prop:r,defaultProp:n??!1,onChange:a,caller:m});return c.jsx(z,{...p,children:c.jsx(X,{scope:e,contentId:L(),triggerRef:l,open:x,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=m;var F="PopoverAnchor",Y=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})});Y.displayName=F;var y="PopoverTrigger",S=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=d(y,o),a=P(o),s=O(e,n.triggerRef),p=c.jsx(_.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})});S.displayName=y;var A="PopoverPortal",[ee,oe]=b(A,{forceMount:void 0}),D=t=>{const{__scopePopover:e,forceMount:o,children:r,container:n}=t,a=d(A,e);return c.jsx(ee,{scope:e,forceMount:o,children:c.jsx(E,{present:o||a.open,children:c.jsx(G,{asChild:!0,container:n,children:r})})})};D.displayName=A;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=B("PopoverContent.RemoveScroll"),re=i.forwardRef((t,e)=>{const o=d(v,t.__scopePopover),r=i.useRef(null),n=O(e,r),a=i.useRef(!1);return i.useEffect(()=>{const s=r.current;if(s)return H(s)},[]),c.jsx(K,{as:te,allowPinchZoom:!0,children:c.jsx(T,{...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(T,{...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()}})}),T=i.forwardRef((t,e)=>{const{__scopePopover:o,trapFocus:r,onOpenAutoFocus:n,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEscapeKeyDown:p,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:h,...x}=t,f=d(v,o),C=P(o);return U(),c.jsx(V,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:n,onUnmountAutoFocus:a,children:c.jsx(W,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:h,onEscapeKeyDown:p,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>f.onOpenChange(!1),children:c.jsx(Z,{"data-state":I(f.open),role:"dialog",id:f.contentId,...C,...x,ref:e,style:{...x.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)"}})})})}),k="PopoverClose",ae=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=d(k,o);return c.jsx(_.button,{type:"button",...r,ref:e,onClick:g(t.onClick,()=>n.onOpenChange(!1))})});ae.displayName=k;var se="PopoverArrow",ce=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=P(o);return c.jsx(J,{...n,...r,ref:e})});ce.displayName=se;function I(t){return t?"open":"closed"}var ie=N,pe=S,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=Q("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{ge as P,Pe as a,ve as b};
1
+ import{r as i,am as $,j as c,as as z,at as L,al as O,_,an as g,au as w,av as E,aw as G,ax as j,ay as H,az as K,aq as q,aA as B,aB as U,aC as V,aD as W,aE as Z,aF as J,c as R}from"./index-BV-rIyOx.js";import{c as Q}from"./utils-CfR4kXxZ.js";var m="Popover",[b]=q(m,[j]),P=j(),[X,d]=b(m),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),[x,f]=$({prop:r,defaultProp:n??!1,onChange:a,caller:m});return c.jsx(z,{...p,children:c.jsx(X,{scope:e,contentId:L(),triggerRef:l,open:x,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=m;var F="PopoverAnchor",Y=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})});Y.displayName=F;var y="PopoverTrigger",S=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=d(y,o),a=P(o),s=O(e,n.triggerRef),p=c.jsx(_.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})});S.displayName=y;var A="PopoverPortal",[ee,oe]=b(A,{forceMount:void 0}),D=t=>{const{__scopePopover:e,forceMount:o,children:r,container:n}=t,a=d(A,e);return c.jsx(ee,{scope:e,forceMount:o,children:c.jsx(E,{present:o||a.open,children:c.jsx(G,{asChild:!0,container:n,children:r})})})};D.displayName=A;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=B("PopoverContent.RemoveScroll"),re=i.forwardRef((t,e)=>{const o=d(v,t.__scopePopover),r=i.useRef(null),n=O(e,r),a=i.useRef(!1);return i.useEffect(()=>{const s=r.current;if(s)return H(s)},[]),c.jsx(K,{as:te,allowPinchZoom:!0,children:c.jsx(T,{...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(T,{...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()}})}),T=i.forwardRef((t,e)=>{const{__scopePopover:o,trapFocus:r,onOpenAutoFocus:n,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEscapeKeyDown:p,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:h,...x}=t,f=d(v,o),C=P(o);return U(),c.jsx(V,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:n,onUnmountAutoFocus:a,children:c.jsx(W,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:h,onEscapeKeyDown:p,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>f.onOpenChange(!1),children:c.jsx(Z,{"data-state":I(f.open),role:"dialog",id:f.contentId,...C,...x,ref:e,style:{...x.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)"}})})})}),k="PopoverClose",ae=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=d(k,o);return c.jsx(_.button,{type:"button",...r,ref:e,onClick:g(t.onClick,()=>n.onOpenChange(!1))})});ae.displayName=k;var se="PopoverArrow",ce=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=P(o);return c.jsx(J,{...n,...r,ref:e})});ce.displayName=se;function I(t){return t?"open":"closed"}var ie=N,pe=S,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=Q("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{ge as P,Pe as a,ve as b};
@@ -1 +1 @@
1
- import{c as j,j as s,r as S,S as x,a as b,u as y,O as h,l as N,P as v,m as P}from"./index-CCcWAtA_.js";import{u as $}from"./use-project-DLsFLh3O.js";import{B as _}from"./button-BKtq_PYU.js";import"./useQuery-Dp4Sp9Q1.js";import"./constants-PBHJ4h9F.js";import"./utils-CnoQZeDK.js";function z(e){const t=j.c(12),{projectSlug:m,orgSlug:c,error:i}=e,r=P();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("h1",{className:"text-xl font-semibold",children:"Failed to load project"}),t[0]=o):o=t[0];let l;t[1]!==m?(l=s.jsxs("p",{className:"text-muted-foreground text-center",children:['There was an error loading the project "',m,'".']}),t[1]=m,t[2]=l):l=t[2];let n;t[3]!==i.message?(n=s.jsx("p",{className:"text-sm text-muted-foreground",children:i.message}),t[3]=i.message,t[4]=n):n=t[4];let u;t[5]!==r||t[6]!==c?(u=s.jsx(_,{variant:"link",onClick:()=>r({to:"/$org/$project",params:{org:c,project:h}}),children:"Go to organization home"}),t[5]=r,t[6]=c,t[7]=u):u=t[7];let d;return t[8]!==l||t[9]!==n||t[10]!==u?(d=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 p-8",children:[o,l,n,u]}),t[8]=l,t[9]=n,t[10]=u,t[11]=d):d=t[11],d}function k(e){const t=j.c(9),{projectSlug:m,orgSlug:c}=e,i=P();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("h1",{className:"text-xl font-semibold",children:"Project not found"}),t[0]=r):r=t[0];let o;t[1]!==m?(o=s.jsxs("p",{className:"text-muted-foreground text-center",children:['The project "',m,'" does not exist in this organization.']}),t[1]=m,t[2]=o):o=t[2];let l;t[3]!==i||t[4]!==c?(l=s.jsx(_,{variant:"link",onClick:()=>i({to:"/$org/$project",params:{org:c,project:h}}),children:"Go to organization home"}),t[3]=i,t[4]=c,t[5]=l):l=t[5];let n;return t[6]!==o||t[7]!==l?(n=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 p-8",children:[r,o,l]}),t[6]=o,t[7]=l,t[8]=n):n=t[8],n}function C(){const e=j.c(22);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const m=b(t),{org:c}=y(),i=m.org,r=m.project,{data:o,isLoading:l,error:n}=$(c.id,r);if(l){let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(x,{}),e[1]=a):a=e[1],a}if(n){let a;return e[2]!==n||e[3]!==i||e[4]!==r?(a=s.jsx(z,{projectSlug:r,orgSlug:i,error:n}),e[2]=n,e[3]=i,e[4]=r,e[5]=a):a=e[5],a}if(!o){let a;return e[6]!==i||e[7]!==r?(a=s.jsx(k,{projectSlug:r,orgSlug:i}),e[6]=i,e[7]=r,e[8]=a):a=e[8],a}const u=o.slug===h;let d;e[9]!==o.description||e[10]!==o.enabledPlugins||e[11]!==o.id||e[12]!==o.name||e[13]!==o.organizationId||e[14]!==o.slug||e[15]!==o.ui||e[16]!==u?(d={id:o.id,organizationId:o.organizationId,slug:o.slug,name:o.name,description:o.description,enabledPlugins:o.enabledPlugins,ui:o.ui,isOrgAdmin:u},e[9]=o.description,e[10]=o.enabledPlugins,e[11]=o.id,e[12]=o.name,e[13]=o.organizationId,e[14]=o.slug,e[15]=o.ui,e[16]=u,e[17]=d):d=e[17];const p=d;let f;e[18]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(S.Suspense,{fallback:s.jsx(x,{}),children:s.jsx(N,{})}),e[18]=f):f=e[18];let g;return e[19]!==p||e[20]!==c?(g=s.jsx(v,{org:c,project:p,children:f}),e[19]=p,e[20]=c,e[21]=g):g=e[21],g}function T(){const e=j.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(S.Suspense,{fallback:s.jsx(x,{}),children:s.jsx(C,{})}),e[0]=t):t=e[0],t}export{T as default};
1
+ import{c as j,j as s,r as S,S as x,a as b,u as y,O as h,l as N,P as v,m as P}from"./index-BV-rIyOx.js";import{u as $}from"./use-project-CzroiUzj.js";import{B as _}from"./button-Cl3WMTWk.js";import"./useQuery-DDYln2BW.js";import"./constants-1q3hobyw.js";import"./utils-CfR4kXxZ.js";function z(e){const t=j.c(12),{projectSlug:m,orgSlug:c,error:i}=e,r=P();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("h1",{className:"text-xl font-semibold",children:"Failed to load project"}),t[0]=o):o=t[0];let l;t[1]!==m?(l=s.jsxs("p",{className:"text-muted-foreground text-center",children:['There was an error loading the project "',m,'".']}),t[1]=m,t[2]=l):l=t[2];let n;t[3]!==i.message?(n=s.jsx("p",{className:"text-sm text-muted-foreground",children:i.message}),t[3]=i.message,t[4]=n):n=t[4];let u;t[5]!==r||t[6]!==c?(u=s.jsx(_,{variant:"link",onClick:()=>r({to:"/$org/$project",params:{org:c,project:h}}),children:"Go to organization home"}),t[5]=r,t[6]=c,t[7]=u):u=t[7];let d;return t[8]!==l||t[9]!==n||t[10]!==u?(d=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 p-8",children:[o,l,n,u]}),t[8]=l,t[9]=n,t[10]=u,t[11]=d):d=t[11],d}function k(e){const t=j.c(9),{projectSlug:m,orgSlug:c}=e,i=P();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("h1",{className:"text-xl font-semibold",children:"Project not found"}),t[0]=r):r=t[0];let o;t[1]!==m?(o=s.jsxs("p",{className:"text-muted-foreground text-center",children:['The project "',m,'" does not exist in this organization.']}),t[1]=m,t[2]=o):o=t[2];let l;t[3]!==i||t[4]!==c?(l=s.jsx(_,{variant:"link",onClick:()=>i({to:"/$org/$project",params:{org:c,project:h}}),children:"Go to organization home"}),t[3]=i,t[4]=c,t[5]=l):l=t[5];let n;return t[6]!==o||t[7]!==l?(n=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 p-8",children:[r,o,l]}),t[6]=o,t[7]=l,t[8]=n):n=t[8],n}function C(){const e=j.c(22);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const m=b(t),{org:c}=y(),i=m.org,r=m.project,{data:o,isLoading:l,error:n}=$(c.id,r);if(l){let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(x,{}),e[1]=a):a=e[1],a}if(n){let a;return e[2]!==n||e[3]!==i||e[4]!==r?(a=s.jsx(z,{projectSlug:r,orgSlug:i,error:n}),e[2]=n,e[3]=i,e[4]=r,e[5]=a):a=e[5],a}if(!o){let a;return e[6]!==i||e[7]!==r?(a=s.jsx(k,{projectSlug:r,orgSlug:i}),e[6]=i,e[7]=r,e[8]=a):a=e[8],a}const u=o.slug===h;let d;e[9]!==o.description||e[10]!==o.enabledPlugins||e[11]!==o.id||e[12]!==o.name||e[13]!==o.organizationId||e[14]!==o.slug||e[15]!==o.ui||e[16]!==u?(d={id:o.id,organizationId:o.organizationId,slug:o.slug,name:o.name,description:o.description,enabledPlugins:o.enabledPlugins,ui:o.ui,isOrgAdmin:u},e[9]=o.description,e[10]=o.enabledPlugins,e[11]=o.id,e[12]=o.name,e[13]=o.organizationId,e[14]=o.slug,e[15]=o.ui,e[16]=u,e[17]=d):d=e[17];const p=d;let f;e[18]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(S.Suspense,{fallback:s.jsx(x,{}),children:s.jsx(N,{})}),e[18]=f):f=e[18];let g;return e[19]!==p||e[20]!==c?(g=s.jsx(v,{org:c,project:p,children:f}),e[19]=p,e[20]=c,e[21]=g):g=e[21],g}function T(){const e=j.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(S.Suspense,{fallback:s.jsx(x,{}),children:s.jsx(C,{})}),e[0]=t):t=e[0],t}export{T as default};
@@ -1 +1 @@
1
- import{c as H,u as W,v as X,O as Y,h as oe,k as ae,j as s,o as ce,s as G,K as U,t as R,r as q,aO as te,bp as ue,m as de,g as ge}from"./index-CCcWAtA_.js";import{P as Z}from"./index-D5w8F0R7.js";import{B as fe,a as pe,b as he,c as xe}from"./breadcrumb-JfdGMaRd.js";import{u as ee}from"./useMutation-Cn2d2ilG.js";import{a as ie,u as re}from"./constants-PBHJ4h9F.js";import{B as L}from"./button-BKtq_PYU.js";import{I as V}from"./input-Dh6Cjukb.js";import{T as je}from"./textarea-D6y1LKj_.js";import{F as Q,d as M,a as me,b as $,c as K,e as se,f as J,L as be}from"./form-DQap4sDh.js";import{u as ye}from"./useQuery-Dp4Sp9Q1.js";import{S as ve}from"./switch-TZYuSAHJ.js";import{h as Ne}from"./use-connection-BCPygOxC.js";import{a as Ce,c as Se}from"./use-binding-ucSDtQ56.js";import{u as Pe}from"./use-install-from-registry-f8JxKFFW.js";import{i as we}from"./Loading01-B78uc8_j.js";import{s as Ie}from"./Plus-B1DSIk_Y.js";import{S as Ee,a as Fe,b as De,c as _e,d as le}from"./select-CJ01X7RE.js";import{c as Oe}from"./utils-CnoQZeDK.js";import{i as Te}from"./Upload01-CtypJgSZ.js";import{i as Ae}from"./X-mZzFkOTX.js";import{c as ze,h as Be,d as ke,b as Re,A as Le,e as Ue,g as qe,a as Me,f as $e}from"./alert-dialog-BN06wH-l.js";import"./ChevronRight-C7PRdwhN.js";import"./binder-CbgCr5Rm.js";import"./extract-connection-data-CCyj_Y1X.js";import"./constants-DIAAKB_c.js";import"./github-icon-Dp3wHhYE.js";import"./registry-utils-eTnhYK1Z.js";import"./generate-id-Dyweu44Y.js";import"./index-BMXxQz0A.js";import"./Check-CTaDpFbx.js";import"./ChevronDown-BmbIYWgz.js";const Ke=ce({name:G().min(1,"Name is required").max(200,"Name is too long"),description:G().max(1e3,"Description is too long").nullable()});function Ge(){const e=H.c(58),{org:t,project:i}=W(),o=X(),d=i.slug===Y;let g;e[0]!==t.id?(g={connectionId:ie,orgId:t.id},e[0]=t.id,e[1]=g):g=e[1];const u=re(g);let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=oe(Ke),e[2]=x):x=e[2];const j=i.name??"",b=i.description??"";let a;e[3]!==j||e[4]!==b?(a={resolver:x,values:{name:j,description:b}},e[3]=j,e[4]=b,e[5]=a):a=e[5];const c=ae(a);let f;e[6]!==u||e[7]!==i.id?(f=async B=>{const _=await u.callTool({name:"PROJECT_UPDATE",arguments:{projectId:i.id,name:B.name,description:B.description||null}});return _.structuredContent??_},e[6]=u,e[7]=i.id,e[8]=f):f=e[8];let p;e[9]!==c||e[10]!==t.id||e[11]!==i.slug||e[12]!==o?(p=()=>{o.invalidateQueries({queryKey:U.project(t.id,i.slug)}),o.invalidateQueries({queryKey:U.projects(t.id)}),R.success("Project updated successfully"),c.reset(c.getValues())},e[9]=c,e[10]=t.id,e[11]=i.slug,e[12]=o,e[13]=p):p=e[13];let w;e[14]!==f||e[15]!==p?(w={mutationFn:f,onSuccess:p,onError:Qe},e[14]=f,e[15]=p,e[16]=w):w=e[16];const m=ee(w);let y;e[17]!==m?(y=async B=>{await m.mutateAsync(B)},e[17]=m,e[18]=y):y=e[18];const P=y,C=c.formState.isDirty;let I;e[19]!==c||e[20]!==P?(I=c.handleSubmit(P),e[19]=c,e[20]=P,e[21]=I):I=e[21];let S;e[22]!==d||e[23]!==m.isPending?(S=B=>{const{field:_}=B;return s.jsxs($,{children:[s.jsx(K,{children:"Project Name"}),s.jsx(M,{children:s.jsx(V,{placeholder:"My Project",..._,disabled:d||m.isPending})}),d&&s.jsx(se,{children:"The organization admin project name cannot be changed."}),s.jsx(J,{})]})},e[22]=d,e[23]=m.isPending,e[24]=S):S=e[24];let n;e[25]!==c.control||e[26]!==S?(n=s.jsx(Q,{control:c.control,name:"name",render:S}),e[25]=c.control,e[26]=S,e[27]=n):n=e[27];let r;e[28]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(K,{children:"Slug"}),e[28]=r):r=e[28];let l;e[29]!==i.slug?(l=s.jsx(M,{children:s.jsx(V,{value:i.slug,disabled:!0,className:"bg-muted"})}),e[29]=i.slug,e[30]=l):l=e[30];let h;e[31]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(se,{children:"The project slug cannot be changed after creation."}),e[31]=h):h=e[31];let v;e[32]!==l?(v=s.jsxs($,{children:[r,l,h]}),e[32]=l,e[33]=v):v=e[33];let N;e[34]!==m.isPending?(N=B=>{const{field:_}=B;return s.jsxs($,{children:[s.jsx(K,{children:"Description"}),s.jsx(M,{children:s.jsx(je,{placeholder:"Optional project description...",rows:3,..._,value:_.value??"",disabled:m.isPending})}),s.jsx(J,{})]})},e[34]=m.isPending,e[35]=N):N=e[35];let F;e[36]!==c.control||e[37]!==N?(F=s.jsx(Q,{control:c.control,name:"description",render:N}),e[36]=c.control,e[37]=N,e[38]=F):F=e[38];const O=!C||m.isPending,T=m.isPending?"Saving...":"Save Changes";let D;e[39]!==O||e[40]!==T?(D=s.jsx(L,{type:"submit",disabled:O,className:"min-w-24",children:T}),e[39]=O,e[40]=T,e[41]=D):D=e[41];let A;e[42]!==c||e[43]!==C||e[44]!==m.isPending?(A=C&&s.jsx(L,{type:"button",variant:"outline",onClick:()=>c.reset(),disabled:m.isPending,children:"Cancel"}),e[42]=c,e[43]=C,e[44]=m.isPending,e[45]=A):A=e[45];let z;e[46]!==D||e[47]!==A?(z=s.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[D,A]}),e[46]=D,e[47]=A,e[48]=z):z=e[48];let E;e[49]!==n||e[50]!==v||e[51]!==F||e[52]!==z||e[53]!==I?(E=s.jsxs("form",{onSubmit:I,className:"space-y-6",children:[n,v,F,z]}),e[49]=n,e[50]=v,e[51]=F,e[52]=z,e[53]=I,e[54]=E):E=e[54];let k;return e[55]!==c||e[56]!==E?(k=s.jsx(me,{...c,children:E}),e[55]=c,e[56]=E,e[57]=k):k=e[57],k}function Qe(e){R.error("Failed to update project: "+(e instanceof Error?e.message:"Unknown error"))}function Je({value:e,onValueChange:t,placeholder:i="Select a connection...",binding:o,bindingType:d,onAddNew:g,className:u,disabled:x=!1}){const[j,b]=q.useState(!1),{installByBinding:a,isInstalling:c}=Pe(),f=j||c,p=Ne(),w=Ce({connections:p,binding:typeof o=="string"?o:void 0}),m=!o||!p?p??[]:typeof o=="string"?w:Array.isArray(o)&&o.length>0?p.filter(n=>Se(n,o)):p,y=(()=>{if(!d?.startsWith("@"))return null;const[n,r]=d.replace("@","").split("/");return n&&r?{scope:n,appName:r}:null})(),P=(()=>{let n=m;const r=Array.isArray(o)&&o.length>0;if(y&&!r&&(n=n.filter(l=>{const h=l.app_name,v=l.metadata?.scopeName;return h===y.appName&&v===y.scope})),e&&!n.some(l=>l.id===e)){const l=p?.find(h=>h.id===e);if(l)return[l,...n]}return n})(),C=d?.startsWith("@"),I=async()=>{if(C&&d){b(!0);try{const n=await a(d);n&&t(n.id)}finally{b(!1)}return}g?.()},S=P.find(n=>n.id===e);return s.jsxs(Ee,{value:e??"none",onValueChange:n=>t(n==="none"?null:n),disabled:x,children:[s.jsx(Fe,{size:"sm",className:Oe("w-[200px]",u),children:s.jsx(De,{placeholder:i,children:S?s.jsxs("div",{className:"flex items-center gap-2",children:[S.icon?s.jsx("img",{src:S.icon,alt:S.title,className:"w-4 h-4 rounded shrink-0"}):s.jsx("div",{className:"w-4 h-4 rounded bg-gradient-to-br from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary shrink-0",children:S.title.slice(0,1).toUpperCase()}),s.jsx("span",{className:"truncate",children:S.title})]}):i})}),s.jsxs(_e,{children:[s.jsx(le,{value:"none",children:"No connection"}),P.length===0?s.jsx("div",{className:"px-2 py-4 text-center text-sm text-muted-foreground",children:"No compatible connections found"}):P.map(n=>s.jsx(le,{value:n.id,children:s.jsxs("div",{className:"flex items-center gap-2",children:[n.icon?s.jsx("img",{src:n.icon,alt:n.title,className:"w-4 h-4 rounded"}):s.jsx("div",{className:"w-4 h-4 rounded bg-gradient-to-br from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:n.title.slice(0,1).toUpperCase()}),s.jsx("span",{children:n.title})]})},n.id)),(g||C)&&s.jsx("div",{className:"border-t border-border",children:s.jsx(L,{onPointerDown:n=>n.stopPropagation(),onClick:n=>{n.preventDefault(),n.stopPropagation(),I()},disabled:f||x,variant:"ghost",className:"w-full justify-start gap-2 px-2 py-2 h-auto hover:bg-muted rounded-md text-sm disabled:opacity-50 disabled:cursor-not-allowed",type:"button",children:f?s.jsxs(s.Fragment,{children:[s.jsx(we,{size:16,className:"animate-spin"}),s.jsx("span",{children:"Connecting..."})]}):s.jsxs(s.Fragment,{children:[s.jsx(Ie,{size:16}),s.jsx("span",{children:"Add Connection"})]})})})]})]})}const Ve=e=>{if(!e||typeof e!="object")return!1;const t=e;return t.type==="text"&&typeof t.text=="string"&&t.text.trim().toLowerCase().startsWith("error")},ne=e=>{const t=e.structuredContent??e,i=t&&typeof t=="object"?t:null,o=i?.content?.[0]?.text&&typeof i.content[0].text=="string"?i.content[0].text:null;if(i?.isError)throw new Error(o??"Tool call failed");if(Ve(t))throw new Error(t.text);return t};function He(e){return e.requiresMcpBinding===!0?!0:e.binding!==void 0}function We(e){const t=H.c(48),{plugin:i,isEnabled:o,isSaving:d,pendingBinding:g,description:u,label:x,icon:j,projectId:b,client:a,onBindingChange:c,onToggle:f}=e;let p;t[0]!==i?(p=He(i),t[0]=i,t[1]=p):p=t[1];const w=p;let m;t[2]!==i.id||t[3]!==b?(m=U.projectPluginConfig(b??"",i.id),t[2]=i.id,t[3]=b,t[4]=m):m=t[4];let y;t[5]!==a||t[6]!==i.id||t[7]!==b?(y=async()=>{if(!b)throw new Error("Project ID is required to load plugin config.");const E=await a.callTool({name:"PROJECT_PLUGIN_CONFIG_GET",arguments:{projectId:b,pluginId:i.id}});return ne(E)},t[5]=a,t[6]=i.id,t[7]=b,t[8]=y):y=t[8];const P=!!b&&w;let C;t[9]!==m||t[10]!==y||t[11]!==P?(C={queryKey:m,queryFn:y,enabled:P},t[9]=m,t[10]=y,t[11]=P,t[12]=C):C=t[12];const{data:I,isLoading:S}=ye(C),n=I?.config?.connectionId??null,r=g!==void 0?g:n;let l;t[13]!==j?(l=j&&s.jsx("div",{className:"flex-shrink-0 text-muted-foreground [&>svg]:size-4",children:j}),t[13]=j,t[14]=l):l=t[14];let h;t[15]!==x?(h=s.jsx("div",{className:"text-sm font-medium text-foreground",children:x}),t[15]=x,t[16]=h):h=t[16];let v;t[17]!==u?(v=u&&s.jsx("p",{className:"text-xs text-muted-foreground",children:u}),t[17]=u,t[18]=v):v=t[18];let N;t[19]!==h||t[20]!==v?(N=s.jsxs("div",{className:"min-w-0",children:[h,v]}),t[19]=h,t[20]=v,t[21]=N):N=t[21];let F;t[22]!==l||t[23]!==N?(F=s.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[l,N]}),t[22]=l,t[23]=N,t[24]=F):F=t[24];let O;t[25]!==f||t[26]!==i.id?(O=E=>f(i.id,E),t[25]=f,t[26]=i.id,t[27]=O):O=t[27];let T;t[28]!==o||t[29]!==d||t[30]!==O?(T=s.jsx(ve,{checked:o,onCheckedChange:O,disabled:d}),t[28]=o,t[29]=d,t[30]=O,t[31]=T):T=t[31];let D;t[32]!==F||t[33]!==T?(D=s.jsxs("div",{className:"flex items-center justify-between gap-4",children:[F,T]}),t[32]=F,t[33]=T,t[34]=D):D=t[34];let A;t[35]!==S||t[36]!==o||t[37]!==d||t[38]!==w||t[39]!==c||t[40]!==i.binding||t[41]!==i.id||t[42]!==r||t[43]!==n?(A=o&&w&&s.jsxs("div",{className:"mt-3 pl-7 flex items-center gap-3",children:[s.jsx(be,{className:"text-xs text-muted-foreground w-24",children:"Connection"}),s.jsx(Je,{value:r??null,onValueChange:E=>c(i.id,E,n),binding:i.binding,placeholder:"Select connection...",className:"w-56",disabled:d||S})]}),t[35]=S,t[36]=o,t[37]=d,t[38]=w,t[39]=c,t[40]=i.binding,t[41]=i.id,t[42]=r,t[43]=n,t[44]=A):A=t[44];let z;return t[45]!==D||t[46]!==A?(z=s.jsxs("div",{className:"py-3",children:[D,A]}),t[45]=D,t[46]=A,t[47]=z):z=t[47],z}function Ze(){const{org:e,project:t}=W(),i=X(),o=re({connectionId:ie,orgId:e.id}),[d,g]=q.useState({}),[u,x]=q.useState({}),[j,b]=q.useState(!1),a=t.enabledPlugins??[],c=n=>{const r=d[n];return r!==void 0?r:a.includes(n)},f=()=>{const n=new Set(a);for(const[r,l]of Object.entries(d))l?n.add(r):n.delete(r);return Array.from(n)},p=Object.keys(d).length>0||Object.keys(u).length>0,w=(n,r)=>{const l=a.includes(n);g(r===l?h=>{const{[n]:v,...N}=h;return N}:h=>({...h,[n]:r}))},m=(n,r,l)=>{if(r===l){x(h=>{const{[n]:v,...N}=h;return N});return}x(h=>({...h,[n]:r}))},y=ee({mutationFn:async n=>{const r=[];if(n.updatePlugins){const l=await o.callTool({name:"PROJECT_UPDATE",arguments:{projectId:t.id,enabledPlugins:n.enabledPlugins}});r.push(ne(l))}if(n.bindingUpdates.length>0){const l=await Promise.all(n.bindingUpdates.map(async({pluginId:h,connectionId:v})=>{const N=await o.callTool({name:"PROJECT_PLUGIN_CONFIG_UPDATE",arguments:{projectId:t.id,pluginId:h,connectionId:v}});return ne(N)}));r.push(...l)}return r},onSuccess:(n,r)=>{r.updatePlugins&&(i.invalidateQueries({queryKey:U.project(e.id,t.slug)}),i.invalidateQueries({queryKey:U.projects(e.id)})),r.bindingUpdates.forEach(({pluginId:l})=>{i.invalidateQueries({queryKey:U.projectPluginConfig(t.id??"",l)})}),g({}),x({}),R.success("Plugins updated successfully")},onError:n=>{R.error("Failed to update plugins: "+(n instanceof Error?n.message:"Unknown error"))},onSettled:()=>{b(!1)}}),P=()=>{b(!0),y.mutate({enabledPlugins:f(),updatePlugins:Object.keys(d).length>0,bindingUpdates:Object.entries(u).map(([n,r])=>({pluginId:n,connectionId:r}))})},C=()=>{g({}),x({})},I=n=>ue.find(r=>r.pluginId===n),S=n=>te.find(l=>l.id===n)?.description??null;return te.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No plugins available."}):s.jsxs("div",{className:"space-y-4",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Enable or disable plugins for this project. Enabled plugins will appear in the sidebar."}),s.jsx("div",{className:"divide-y divide-border border-y border-border",children:te.map(n=>{const r=I(n.id),l=S(n.id),h=c(n.id);return s.jsx(We,{plugin:n,isEnabled:h,isSaving:j,pendingBinding:u[n.id],description:l,label:r?.label??n.id,icon:r?.icon,projectId:t.id,client:o,onBindingChange:m,onToggle:w},n.id)})}),s.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[s.jsx(L,{variant:"outline",onClick:C,disabled:!p||j,children:"Cancel"}),s.jsx(L,{onClick:P,disabled:!p||j,className:"min-w-24",children:j?"Saving...":"Save Changes"})]})]})}const Ye=ce({name:G().min(1,"Name is required").max(255,"Name is too long"),slug:G().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:G().optional()});function Xe(e){const t=H.c(24),{value:i,onChange:o,name:d}=e,g=q.useRef(null);let u;t[0]!==o?(u=S=>{const n=S.target.files?.[0];if(n){if(n.size>2097152){R.error("Image must be smaller than 2MB");return}const r=new FileReader;r.onerror=()=>{const l=r.error;console.error("FileReader error:",l),R.error(l?.message||"Failed to read image file. Please try again."),g.current&&(g.current.value="")},r.onloadend=()=>{if(r.readyState===FileReader.DONE&&r.result){const l=r.result;o(l)}},r.readAsDataURL(n)}},t[0]=o,t[1]=u):u=t[1];const x=u;let j;t[2]===Symbol.for("react.memo_cache_sentinel")?(j=()=>{g.current?.click()},t[2]=j):j=t[2];const b=j;let a;t[3]!==o?(a=S=>{S.stopPropagation(),o("")},t[3]=o,t[4]=a):a=t[4];const c=a;let f;t[5]!==x?(f=s.jsx("input",{type:"file",ref:g,className:"hidden",accept:"image/*",onChange:x}),t[5]=x,t[6]=f):f=t[6];let p;t[7]!==c||t[8]!==d||t[9]!==i?(p=i?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:i,alt:d||"Organization logo",className:"w-full h-full object-cover"})}),s.jsx("button",{type:"button",onClick:c,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(Ae,{className:"h-3 w-3"})})]}):s.jsxs("button",{type:"button",onClick:b,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(Te,{className:"h-5 w-5"}),s.jsx("span",{className:"text-xs",children:"Upload"})]}),t[7]=c,t[8]=d,t[9]=i,t[10]=p):p=t[10];const w=i?"Change Logo":"Upload Logo";let m;t[11]!==w?(m=s.jsx(L,{type:"button",variant:"outline",size:"sm",onClick:b,className:"mb-2",children:w}),t[11]=w,t[12]=m):m=t[12];let y;t[13]!==c||t[14]!==i?(y=i&&s.jsx(L,{type:"button",variant:"ghost",size:"sm",onClick:c,className:"ml-2",children:"Remove"}),t[13]=c,t[14]=i,t[15]=y):y=t[15];let P;t[16]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Recommended: Square image, at least 200x200px. Max 2MB."}),t[16]=P):P=t[16];let C;t[17]!==m||t[18]!==y?(C=s.jsxs("div",{className:"flex-1",children:[m,y,P]}),t[17]=m,t[18]=y,t[19]=C):C=t[19];let I;return t[20]!==C||t[21]!==f||t[22]!==p?(I=s.jsxs("div",{className:"flex items-start gap-4",children:[f,p,C]}),t[20]=C,t[21]=f,t[22]=p,t[23]=I):I=t[23],I}function et(){const e=de(),{org:t,project:i}=W(),o=X(),[d,g]=q.useState(!1),u=ae({resolver:oe(Ye),values:{name:t.name??"",slug:t.slug??"",logo:t.logo??""}}),x=ee({mutationFn:async a=>{const c={name:a.name,slug:a.slug};a.logo&&(c.logo=a.logo);const f=await ge.organization.update({organizationId:t.id,data:c});if(f?.error)throw new Error(f.error.message||"Failed to update organization");return f},onSuccess:a=>{o.invalidateQueries({queryKey:U.organizations()}),o.invalidateQueries({queryKey:U.activeOrganization(t.slug)}),R.success("Organization settings updated successfully"),a?.data?.slug&&a.data.slug!==t.slug&&e({to:"/$org/$project/settings",params:{org:a.data.slug,project:i.slug}})},onError:a=>{R.error(a instanceof Error?a.message:"Failed to update organization")},onSettled:()=>{g(!1)}}),j=a=>{g(!0),x.mutate(a)},b=u.formState.isDirty;return s.jsx(me,{...u,children:s.jsxs("form",{onSubmit:u.handleSubmit(j),className:"space-y-6",children:[s.jsx(Q,{control:u.control,name:"name",render:({field:a})=>s.jsxs($,{children:[s.jsx(K,{children:"Organization Name"}),s.jsx(M,{children:s.jsx(V,{placeholder:"My Organization",...a,disabled:d})}),s.jsx(J,{})]})}),s.jsx(Q,{control:u.control,name:"slug",render:({field:a})=>s.jsxs($,{children:[s.jsx(K,{children:"Organization Slug"}),s.jsx(M,{children:s.jsx(V,{placeholder:"my-organization",...a,disabled:d,onChange:c=>{const f=c.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");a.onChange(f)}})}),s.jsx(se,{children:"Used in URLs. Only lowercase letters, numbers, and hyphens are allowed."}),s.jsx(J,{})]})}),s.jsx(Q,{control:u.control,name:"logo",render:({field:a})=>s.jsxs($,{children:[s.jsx(K,{children:"Logo"}),s.jsx(M,{children:s.jsx(Xe,{value:a.value,onChange:a.onChange,name:u.watch("name")})}),s.jsx(J,{})]})}),s.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[s.jsx(L,{type:"submit",disabled:!b||d,className:"min-w-24",children:d?"Saving...":"Save Changes"}),b&&s.jsx(L,{type:"button",variant:"outline",onClick:()=>u.reset(),disabled:d,children:"Cancel"})]})]})})}function tt(){const e=H.c(44),{org:t,project:i}=W(),o=de(),d=X(),[g,u]=q.useState(""),[x,j]=q.useState(!1),b=i.slug===Y;let a;e[0]!==t.id?(a={connectionId:ie,orgId:t.id},e[0]=t.id,e[1]=a):a=e[1];const c=re(a);let f;e[2]!==c||e[3]!==i.id?(f=async()=>{const _=await c.callTool({name:"PROJECT_DELETE",arguments:{projectId:i.id}});return _.structuredContent??_},e[2]=c,e[3]=i.id,e[4]=f):f=e[4];let p;e[5]!==o||e[6]!==t.id||e[7]!==t.slug||e[8]!==d?(p=_=>{_.success?(d.invalidateQueries({queryKey:U.projects(t.id)}),R.success("Project deleted"),o({to:"/$org/$project",params:{org:t.slug,project:Y}})):R.error(_.message??"Failed to delete project")},e[5]=o,e[6]=t.id,e[7]=t.slug,e[8]=d,e[9]=p):p=e[9];let w;e[10]!==f||e[11]!==p?(w={mutationFn:f,onSuccess:p,onError:st},e[10]=f,e[11]=p,e[12]=w):w=e[12];const m=ee(w);if(b)return null;const y=g===i.name;let P;e[13]!==m?(P=()=>{m.mutate()},e[13]=m,e[14]=P):P=e[14];const C=P;let I;e[15]===Symbol.for("react.memo_cache_sentinel")?(I=_=>{j(_),_||u("")},e[15]=I):I=e[15];const S=I;let n;e[16]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{children:[s.jsx("h3",{className:"font-semibold text-destructive",children:"Danger Zone"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Irreversible and destructive actions."})]}),e[16]=n):n=e[16];let r;e[17]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Be,{asChild:!0,children:s.jsx(L,{variant:"destructive",children:"Delete Project"})}),e[17]=r):r=e[17];let l;e[18]!==i.name?(l=s.jsxs(ze,{children:['Delete "',i.name,'"?']}),e[18]=i.name,e[19]=l):l=e[19];let h;e[20]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(ke,{children:"This action cannot be undone. All project data will be permanently deleted."}),e[20]=h):h=e[20];let v;e[21]!==l?(v=s.jsxs(Re,{children:[l,h]}),e[21]=l,e[22]=v):v=e[22];let N;e[23]!==i.name?(N=s.jsxs("p",{className:"text-sm mb-2",children:["Type ",s.jsx("strong",{children:i.name})," to confirm:"]}),e[23]=i.name,e[24]=N):N=e[24];let F;e[25]===Symbol.for("react.memo_cache_sentinel")?(F=_=>u(_.target.value),e[25]=F):F=e[25];let O;e[26]!==g||e[27]!==i.name?(O=s.jsx(V,{value:g,onChange:F,placeholder:i.name}),e[26]=g,e[27]=i.name,e[28]=O):O=e[28];let T;e[29]!==N||e[30]!==O?(T=s.jsxs("div",{className:"py-4",children:[N,O]}),e[29]=N,e[30]=O,e[31]=T):T=e[31];let D;e[32]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(Le,{children:"Cancel"}),e[32]=D):D=e[32];const A=!y||m.isPending,z=m.isPending?"Deleting...":"Delete Project";let E;e[33]!==C||e[34]!==A||e[35]!==z?(E=s.jsxs(Ue,{children:[D,s.jsx(qe,{onClick:C,disabled:A,className:"bg-destructive hover:bg-destructive/90 text-destructive-foreground",children:z})]}),e[33]=C,e[34]=A,e[35]=z,e[36]=E):E=e[36];let k;e[37]!==v||e[38]!==T||e[39]!==E?(k=s.jsxs(Me,{children:[v,T,E]}),e[37]=v,e[38]=T,e[39]=E,e[40]=k):k=e[40];let B;return e[41]!==x||e[42]!==k?(B=s.jsxs("div",{className:"border border-destructive/50 rounded-lg p-4 space-y-4",children:[n,s.jsxs($e,{open:x,onOpenChange:S,children:[r,k]})]}),e[41]=x,e[42]=k,e[43]=B):B=e[43],B}function st(e){R.error("Failed to delete project: "+(e instanceof Error?e.message:"Unknown error"))}function At(){const e=H.c(10),{project:t}=W(),i=t.slug===Y;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Z.Header,{children:s.jsx(Z.Header.Left,{children:s.jsx(fe,{children:s.jsx(pe,{children:s.jsx(he,{children:s.jsx(xe,{children:"Settings"})})})})})}),e[0]=o):o=e[0];let d;e[1]!==i?(d=i&&s.jsxs("section",{className:"space-y-4",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(et,{})]}),e[1]=i,e[2]=d):d=e[2];let g;e[3]!==i?(g=!i&&s.jsxs("section",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"General"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Basic project information."})]}),s.jsx(Ge,{})]}),e[3]=i,e[4]=g):g=e[4];let u,x;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsxs("section",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Plugins"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Manage which plugins are enabled and configure them."})]}),s.jsx(Ze,{})]}),x=s.jsx(tt,{}),e[5]=u,e[6]=x):(u=e[5],x=e[6]);let j;return e[7]!==d||e[8]!==g?(j=s.jsxs(Z,{children:[o,s.jsx(Z.Content,{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-8",children:[d,g,u,x]})})})})})]}),e[7]=d,e[8]=g,e[9]=j):j=e[9],j}export{At as default};
1
+ import{c as H,u as W,v as X,O as Y,h as oe,k as ae,j as s,o as ce,s as G,K as U,t as R,r as q,aO as te,bp as ue,m as de,g as ge}from"./index-BV-rIyOx.js";import{P as Z}from"./index-9vOB29ZB.js";import{B as fe,a as pe,b as he,c as xe}from"./breadcrumb-Cvo4WJJ5.js";import{u as ee}from"./useMutation-BOrtlNTb.js";import{a as ie,u as re}from"./constants-1q3hobyw.js";import{B as L}from"./button-Cl3WMTWk.js";import{I as V}from"./input-Dv5qvD5N.js";import{T as je}from"./textarea-DK_SwVx9.js";import{F as Q,d as M,a as me,b as $,c as K,e as se,f as J,L as be}from"./form-qYB4UriD.js";import{u as ye}from"./useQuery-DDYln2BW.js";import{S as ve}from"./switch-B-1QAIh-.js";import{h as Ne}from"./use-connection-B8DnjeO8.js";import{a as Ce,c as Se}from"./use-binding-BVOuBiur.js";import{u as Pe}from"./use-install-from-registry-ClVbT6BY.js";import{i as we}from"./Loading01-DOPFYU4m.js";import{s as Ie}from"./Plus-WaQ7hmj5.js";import{S as Ee,a as Fe,b as De,c as _e,d as le}from"./select-ODRW9YrY.js";import{c as Oe}from"./utils-CfR4kXxZ.js";import{i as Te}from"./Upload01-Dc0hOrKX.js";import{i as Ae}from"./X-DUGfq2_H.js";import{c as ze,h as Be,d as ke,b as Re,A as Le,e as Ue,g as qe,a as Me,f as $e}from"./alert-dialog-B4H6MrIT.js";import"./ChevronRight-BBcOJkyP.js";import"./binder-C4CQlgMb.js";import"./extract-connection-data-CQQ4ZZEG.js";import"./constants-DzWq-50V.js";import"./github-icon-Dp3wHhYE.js";import"./registry-utils-CqOx6XXE.js";import"./generate-id-Dyweu44Y.js";import"./index-BYzsWn1B.js";import"./Check-Bkb61eVw.js";import"./ChevronDown-DqJTvBdv.js";const Ke=ce({name:G().min(1,"Name is required").max(200,"Name is too long"),description:G().max(1e3,"Description is too long").nullable()});function Ge(){const e=H.c(58),{org:t,project:i}=W(),o=X(),d=i.slug===Y;let g;e[0]!==t.id?(g={connectionId:ie,orgId:t.id},e[0]=t.id,e[1]=g):g=e[1];const u=re(g);let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=oe(Ke),e[2]=x):x=e[2];const j=i.name??"",b=i.description??"";let a;e[3]!==j||e[4]!==b?(a={resolver:x,values:{name:j,description:b}},e[3]=j,e[4]=b,e[5]=a):a=e[5];const c=ae(a);let f;e[6]!==u||e[7]!==i.id?(f=async B=>{const _=await u.callTool({name:"PROJECT_UPDATE",arguments:{projectId:i.id,name:B.name,description:B.description||null}});return _.structuredContent??_},e[6]=u,e[7]=i.id,e[8]=f):f=e[8];let p;e[9]!==c||e[10]!==t.id||e[11]!==i.slug||e[12]!==o?(p=()=>{o.invalidateQueries({queryKey:U.project(t.id,i.slug)}),o.invalidateQueries({queryKey:U.projects(t.id)}),R.success("Project updated successfully"),c.reset(c.getValues())},e[9]=c,e[10]=t.id,e[11]=i.slug,e[12]=o,e[13]=p):p=e[13];let w;e[14]!==f||e[15]!==p?(w={mutationFn:f,onSuccess:p,onError:Qe},e[14]=f,e[15]=p,e[16]=w):w=e[16];const m=ee(w);let y;e[17]!==m?(y=async B=>{await m.mutateAsync(B)},e[17]=m,e[18]=y):y=e[18];const P=y,C=c.formState.isDirty;let I;e[19]!==c||e[20]!==P?(I=c.handleSubmit(P),e[19]=c,e[20]=P,e[21]=I):I=e[21];let S;e[22]!==d||e[23]!==m.isPending?(S=B=>{const{field:_}=B;return s.jsxs($,{children:[s.jsx(K,{children:"Project Name"}),s.jsx(M,{children:s.jsx(V,{placeholder:"My Project",..._,disabled:d||m.isPending})}),d&&s.jsx(se,{children:"The organization admin project name cannot be changed."}),s.jsx(J,{})]})},e[22]=d,e[23]=m.isPending,e[24]=S):S=e[24];let n;e[25]!==c.control||e[26]!==S?(n=s.jsx(Q,{control:c.control,name:"name",render:S}),e[25]=c.control,e[26]=S,e[27]=n):n=e[27];let r;e[28]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(K,{children:"Slug"}),e[28]=r):r=e[28];let l;e[29]!==i.slug?(l=s.jsx(M,{children:s.jsx(V,{value:i.slug,disabled:!0,className:"bg-muted"})}),e[29]=i.slug,e[30]=l):l=e[30];let h;e[31]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(se,{children:"The project slug cannot be changed after creation."}),e[31]=h):h=e[31];let v;e[32]!==l?(v=s.jsxs($,{children:[r,l,h]}),e[32]=l,e[33]=v):v=e[33];let N;e[34]!==m.isPending?(N=B=>{const{field:_}=B;return s.jsxs($,{children:[s.jsx(K,{children:"Description"}),s.jsx(M,{children:s.jsx(je,{placeholder:"Optional project description...",rows:3,..._,value:_.value??"",disabled:m.isPending})}),s.jsx(J,{})]})},e[34]=m.isPending,e[35]=N):N=e[35];let F;e[36]!==c.control||e[37]!==N?(F=s.jsx(Q,{control:c.control,name:"description",render:N}),e[36]=c.control,e[37]=N,e[38]=F):F=e[38];const O=!C||m.isPending,T=m.isPending?"Saving...":"Save Changes";let D;e[39]!==O||e[40]!==T?(D=s.jsx(L,{type:"submit",disabled:O,className:"min-w-24",children:T}),e[39]=O,e[40]=T,e[41]=D):D=e[41];let A;e[42]!==c||e[43]!==C||e[44]!==m.isPending?(A=C&&s.jsx(L,{type:"button",variant:"outline",onClick:()=>c.reset(),disabled:m.isPending,children:"Cancel"}),e[42]=c,e[43]=C,e[44]=m.isPending,e[45]=A):A=e[45];let z;e[46]!==D||e[47]!==A?(z=s.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[D,A]}),e[46]=D,e[47]=A,e[48]=z):z=e[48];let E;e[49]!==n||e[50]!==v||e[51]!==F||e[52]!==z||e[53]!==I?(E=s.jsxs("form",{onSubmit:I,className:"space-y-6",children:[n,v,F,z]}),e[49]=n,e[50]=v,e[51]=F,e[52]=z,e[53]=I,e[54]=E):E=e[54];let k;return e[55]!==c||e[56]!==E?(k=s.jsx(me,{...c,children:E}),e[55]=c,e[56]=E,e[57]=k):k=e[57],k}function Qe(e){R.error("Failed to update project: "+(e instanceof Error?e.message:"Unknown error"))}function Je({value:e,onValueChange:t,placeholder:i="Select a connection...",binding:o,bindingType:d,onAddNew:g,className:u,disabled:x=!1}){const[j,b]=q.useState(!1),{installByBinding:a,isInstalling:c}=Pe(),f=j||c,p=Ne(),w=Ce({connections:p,binding:typeof o=="string"?o:void 0}),m=!o||!p?p??[]:typeof o=="string"?w:Array.isArray(o)&&o.length>0?p.filter(n=>Se(n,o)):p,y=(()=>{if(!d?.startsWith("@"))return null;const[n,r]=d.replace("@","").split("/");return n&&r?{scope:n,appName:r}:null})(),P=(()=>{let n=m;const r=Array.isArray(o)&&o.length>0;if(y&&!r&&(n=n.filter(l=>{const h=l.app_name,v=l.metadata?.scopeName;return h===y.appName&&v===y.scope})),e&&!n.some(l=>l.id===e)){const l=p?.find(h=>h.id===e);if(l)return[l,...n]}return n})(),C=d?.startsWith("@"),I=async()=>{if(C&&d){b(!0);try{const n=await a(d);n&&t(n.id)}finally{b(!1)}return}g?.()},S=P.find(n=>n.id===e);return s.jsxs(Ee,{value:e??"none",onValueChange:n=>t(n==="none"?null:n),disabled:x,children:[s.jsx(Fe,{size:"sm",className:Oe("w-[200px]",u),children:s.jsx(De,{placeholder:i,children:S?s.jsxs("div",{className:"flex items-center gap-2",children:[S.icon?s.jsx("img",{src:S.icon,alt:S.title,className:"w-4 h-4 rounded shrink-0"}):s.jsx("div",{className:"w-4 h-4 rounded bg-gradient-to-br from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary shrink-0",children:S.title.slice(0,1).toUpperCase()}),s.jsx("span",{className:"truncate",children:S.title})]}):i})}),s.jsxs(_e,{children:[s.jsx(le,{value:"none",children:"No connection"}),P.length===0?s.jsx("div",{className:"px-2 py-4 text-center text-sm text-muted-foreground",children:"No compatible connections found"}):P.map(n=>s.jsx(le,{value:n.id,children:s.jsxs("div",{className:"flex items-center gap-2",children:[n.icon?s.jsx("img",{src:n.icon,alt:n.title,className:"w-4 h-4 rounded"}):s.jsx("div",{className:"w-4 h-4 rounded bg-gradient-to-br from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:n.title.slice(0,1).toUpperCase()}),s.jsx("span",{children:n.title})]})},n.id)),(g||C)&&s.jsx("div",{className:"border-t border-border",children:s.jsx(L,{onPointerDown:n=>n.stopPropagation(),onClick:n=>{n.preventDefault(),n.stopPropagation(),I()},disabled:f||x,variant:"ghost",className:"w-full justify-start gap-2 px-2 py-2 h-auto hover:bg-muted rounded-md text-sm disabled:opacity-50 disabled:cursor-not-allowed",type:"button",children:f?s.jsxs(s.Fragment,{children:[s.jsx(we,{size:16,className:"animate-spin"}),s.jsx("span",{children:"Connecting..."})]}):s.jsxs(s.Fragment,{children:[s.jsx(Ie,{size:16}),s.jsx("span",{children:"Add Connection"})]})})})]})]})}const Ve=e=>{if(!e||typeof e!="object")return!1;const t=e;return t.type==="text"&&typeof t.text=="string"&&t.text.trim().toLowerCase().startsWith("error")},ne=e=>{const t=e.structuredContent??e,i=t&&typeof t=="object"?t:null,o=i?.content?.[0]?.text&&typeof i.content[0].text=="string"?i.content[0].text:null;if(i?.isError)throw new Error(o??"Tool call failed");if(Ve(t))throw new Error(t.text);return t};function He(e){return e.requiresMcpBinding===!0?!0:e.binding!==void 0}function We(e){const t=H.c(48),{plugin:i,isEnabled:o,isSaving:d,pendingBinding:g,description:u,label:x,icon:j,projectId:b,client:a,onBindingChange:c,onToggle:f}=e;let p;t[0]!==i?(p=He(i),t[0]=i,t[1]=p):p=t[1];const w=p;let m;t[2]!==i.id||t[3]!==b?(m=U.projectPluginConfig(b??"",i.id),t[2]=i.id,t[3]=b,t[4]=m):m=t[4];let y;t[5]!==a||t[6]!==i.id||t[7]!==b?(y=async()=>{if(!b)throw new Error("Project ID is required to load plugin config.");const E=await a.callTool({name:"PROJECT_PLUGIN_CONFIG_GET",arguments:{projectId:b,pluginId:i.id}});return ne(E)},t[5]=a,t[6]=i.id,t[7]=b,t[8]=y):y=t[8];const P=!!b&&w;let C;t[9]!==m||t[10]!==y||t[11]!==P?(C={queryKey:m,queryFn:y,enabled:P},t[9]=m,t[10]=y,t[11]=P,t[12]=C):C=t[12];const{data:I,isLoading:S}=ye(C),n=I?.config?.connectionId??null,r=g!==void 0?g:n;let l;t[13]!==j?(l=j&&s.jsx("div",{className:"flex-shrink-0 text-muted-foreground [&>svg]:size-4",children:j}),t[13]=j,t[14]=l):l=t[14];let h;t[15]!==x?(h=s.jsx("div",{className:"text-sm font-medium text-foreground",children:x}),t[15]=x,t[16]=h):h=t[16];let v;t[17]!==u?(v=u&&s.jsx("p",{className:"text-xs text-muted-foreground",children:u}),t[17]=u,t[18]=v):v=t[18];let N;t[19]!==h||t[20]!==v?(N=s.jsxs("div",{className:"min-w-0",children:[h,v]}),t[19]=h,t[20]=v,t[21]=N):N=t[21];let F;t[22]!==l||t[23]!==N?(F=s.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[l,N]}),t[22]=l,t[23]=N,t[24]=F):F=t[24];let O;t[25]!==f||t[26]!==i.id?(O=E=>f(i.id,E),t[25]=f,t[26]=i.id,t[27]=O):O=t[27];let T;t[28]!==o||t[29]!==d||t[30]!==O?(T=s.jsx(ve,{checked:o,onCheckedChange:O,disabled:d}),t[28]=o,t[29]=d,t[30]=O,t[31]=T):T=t[31];let D;t[32]!==F||t[33]!==T?(D=s.jsxs("div",{className:"flex items-center justify-between gap-4",children:[F,T]}),t[32]=F,t[33]=T,t[34]=D):D=t[34];let A;t[35]!==S||t[36]!==o||t[37]!==d||t[38]!==w||t[39]!==c||t[40]!==i.binding||t[41]!==i.id||t[42]!==r||t[43]!==n?(A=o&&w&&s.jsxs("div",{className:"mt-3 pl-7 flex items-center gap-3",children:[s.jsx(be,{className:"text-xs text-muted-foreground w-24",children:"Connection"}),s.jsx(Je,{value:r??null,onValueChange:E=>c(i.id,E,n),binding:i.binding,placeholder:"Select connection...",className:"w-56",disabled:d||S})]}),t[35]=S,t[36]=o,t[37]=d,t[38]=w,t[39]=c,t[40]=i.binding,t[41]=i.id,t[42]=r,t[43]=n,t[44]=A):A=t[44];let z;return t[45]!==D||t[46]!==A?(z=s.jsxs("div",{className:"py-3",children:[D,A]}),t[45]=D,t[46]=A,t[47]=z):z=t[47],z}function Ze(){const{org:e,project:t}=W(),i=X(),o=re({connectionId:ie,orgId:e.id}),[d,g]=q.useState({}),[u,x]=q.useState({}),[j,b]=q.useState(!1),a=t.enabledPlugins??[],c=n=>{const r=d[n];return r!==void 0?r:a.includes(n)},f=()=>{const n=new Set(a);for(const[r,l]of Object.entries(d))l?n.add(r):n.delete(r);return Array.from(n)},p=Object.keys(d).length>0||Object.keys(u).length>0,w=(n,r)=>{const l=a.includes(n);g(r===l?h=>{const{[n]:v,...N}=h;return N}:h=>({...h,[n]:r}))},m=(n,r,l)=>{if(r===l){x(h=>{const{[n]:v,...N}=h;return N});return}x(h=>({...h,[n]:r}))},y=ee({mutationFn:async n=>{const r=[];if(n.updatePlugins){const l=await o.callTool({name:"PROJECT_UPDATE",arguments:{projectId:t.id,enabledPlugins:n.enabledPlugins}});r.push(ne(l))}if(n.bindingUpdates.length>0){const l=await Promise.all(n.bindingUpdates.map(async({pluginId:h,connectionId:v})=>{const N=await o.callTool({name:"PROJECT_PLUGIN_CONFIG_UPDATE",arguments:{projectId:t.id,pluginId:h,connectionId:v}});return ne(N)}));r.push(...l)}return r},onSuccess:(n,r)=>{r.updatePlugins&&(i.invalidateQueries({queryKey:U.project(e.id,t.slug)}),i.invalidateQueries({queryKey:U.projects(e.id)})),r.bindingUpdates.forEach(({pluginId:l})=>{i.invalidateQueries({queryKey:U.projectPluginConfig(t.id??"",l)})}),g({}),x({}),R.success("Plugins updated successfully")},onError:n=>{R.error("Failed to update plugins: "+(n instanceof Error?n.message:"Unknown error"))},onSettled:()=>{b(!1)}}),P=()=>{b(!0),y.mutate({enabledPlugins:f(),updatePlugins:Object.keys(d).length>0,bindingUpdates:Object.entries(u).map(([n,r])=>({pluginId:n,connectionId:r}))})},C=()=>{g({}),x({})},I=n=>ue.find(r=>r.pluginId===n),S=n=>te.find(l=>l.id===n)?.description??null;return te.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No plugins available."}):s.jsxs("div",{className:"space-y-4",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Enable or disable plugins for this project. Enabled plugins will appear in the sidebar."}),s.jsx("div",{className:"divide-y divide-border border-y border-border",children:te.map(n=>{const r=I(n.id),l=S(n.id),h=c(n.id);return s.jsx(We,{plugin:n,isEnabled:h,isSaving:j,pendingBinding:u[n.id],description:l,label:r?.label??n.id,icon:r?.icon,projectId:t.id,client:o,onBindingChange:m,onToggle:w},n.id)})}),s.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[s.jsx(L,{variant:"outline",onClick:C,disabled:!p||j,children:"Cancel"}),s.jsx(L,{onClick:P,disabled:!p||j,className:"min-w-24",children:j?"Saving...":"Save Changes"})]})]})}const Ye=ce({name:G().min(1,"Name is required").max(255,"Name is too long"),slug:G().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:G().optional()});function Xe(e){const t=H.c(24),{value:i,onChange:o,name:d}=e,g=q.useRef(null);let u;t[0]!==o?(u=S=>{const n=S.target.files?.[0];if(n){if(n.size>2097152){R.error("Image must be smaller than 2MB");return}const r=new FileReader;r.onerror=()=>{const l=r.error;console.error("FileReader error:",l),R.error(l?.message||"Failed to read image file. Please try again."),g.current&&(g.current.value="")},r.onloadend=()=>{if(r.readyState===FileReader.DONE&&r.result){const l=r.result;o(l)}},r.readAsDataURL(n)}},t[0]=o,t[1]=u):u=t[1];const x=u;let j;t[2]===Symbol.for("react.memo_cache_sentinel")?(j=()=>{g.current?.click()},t[2]=j):j=t[2];const b=j;let a;t[3]!==o?(a=S=>{S.stopPropagation(),o("")},t[3]=o,t[4]=a):a=t[4];const c=a;let f;t[5]!==x?(f=s.jsx("input",{type:"file",ref:g,className:"hidden",accept:"image/*",onChange:x}),t[5]=x,t[6]=f):f=t[6];let p;t[7]!==c||t[8]!==d||t[9]!==i?(p=i?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:i,alt:d||"Organization logo",className:"w-full h-full object-cover"})}),s.jsx("button",{type:"button",onClick:c,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(Ae,{className:"h-3 w-3"})})]}):s.jsxs("button",{type:"button",onClick:b,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(Te,{className:"h-5 w-5"}),s.jsx("span",{className:"text-xs",children:"Upload"})]}),t[7]=c,t[8]=d,t[9]=i,t[10]=p):p=t[10];const w=i?"Change Logo":"Upload Logo";let m;t[11]!==w?(m=s.jsx(L,{type:"button",variant:"outline",size:"sm",onClick:b,className:"mb-2",children:w}),t[11]=w,t[12]=m):m=t[12];let y;t[13]!==c||t[14]!==i?(y=i&&s.jsx(L,{type:"button",variant:"ghost",size:"sm",onClick:c,className:"ml-2",children:"Remove"}),t[13]=c,t[14]=i,t[15]=y):y=t[15];let P;t[16]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Recommended: Square image, at least 200x200px. Max 2MB."}),t[16]=P):P=t[16];let C;t[17]!==m||t[18]!==y?(C=s.jsxs("div",{className:"flex-1",children:[m,y,P]}),t[17]=m,t[18]=y,t[19]=C):C=t[19];let I;return t[20]!==C||t[21]!==f||t[22]!==p?(I=s.jsxs("div",{className:"flex items-start gap-4",children:[f,p,C]}),t[20]=C,t[21]=f,t[22]=p,t[23]=I):I=t[23],I}function et(){const e=de(),{org:t,project:i}=W(),o=X(),[d,g]=q.useState(!1),u=ae({resolver:oe(Ye),values:{name:t.name??"",slug:t.slug??"",logo:t.logo??""}}),x=ee({mutationFn:async a=>{const c={name:a.name,slug:a.slug};a.logo&&(c.logo=a.logo);const f=await ge.organization.update({organizationId:t.id,data:c});if(f?.error)throw new Error(f.error.message||"Failed to update organization");return f},onSuccess:a=>{o.invalidateQueries({queryKey:U.organizations()}),o.invalidateQueries({queryKey:U.activeOrganization(t.slug)}),R.success("Organization settings updated successfully"),a?.data?.slug&&a.data.slug!==t.slug&&e({to:"/$org/$project/settings",params:{org:a.data.slug,project:i.slug}})},onError:a=>{R.error(a instanceof Error?a.message:"Failed to update organization")},onSettled:()=>{g(!1)}}),j=a=>{g(!0),x.mutate(a)},b=u.formState.isDirty;return s.jsx(me,{...u,children:s.jsxs("form",{onSubmit:u.handleSubmit(j),className:"space-y-6",children:[s.jsx(Q,{control:u.control,name:"name",render:({field:a})=>s.jsxs($,{children:[s.jsx(K,{children:"Organization Name"}),s.jsx(M,{children:s.jsx(V,{placeholder:"My Organization",...a,disabled:d})}),s.jsx(J,{})]})}),s.jsx(Q,{control:u.control,name:"slug",render:({field:a})=>s.jsxs($,{children:[s.jsx(K,{children:"Organization Slug"}),s.jsx(M,{children:s.jsx(V,{placeholder:"my-organization",...a,disabled:d,onChange:c=>{const f=c.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");a.onChange(f)}})}),s.jsx(se,{children:"Used in URLs. Only lowercase letters, numbers, and hyphens are allowed."}),s.jsx(J,{})]})}),s.jsx(Q,{control:u.control,name:"logo",render:({field:a})=>s.jsxs($,{children:[s.jsx(K,{children:"Logo"}),s.jsx(M,{children:s.jsx(Xe,{value:a.value,onChange:a.onChange,name:u.watch("name")})}),s.jsx(J,{})]})}),s.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[s.jsx(L,{type:"submit",disabled:!b||d,className:"min-w-24",children:d?"Saving...":"Save Changes"}),b&&s.jsx(L,{type:"button",variant:"outline",onClick:()=>u.reset(),disabled:d,children:"Cancel"})]})]})})}function tt(){const e=H.c(44),{org:t,project:i}=W(),o=de(),d=X(),[g,u]=q.useState(""),[x,j]=q.useState(!1),b=i.slug===Y;let a;e[0]!==t.id?(a={connectionId:ie,orgId:t.id},e[0]=t.id,e[1]=a):a=e[1];const c=re(a);let f;e[2]!==c||e[3]!==i.id?(f=async()=>{const _=await c.callTool({name:"PROJECT_DELETE",arguments:{projectId:i.id}});return _.structuredContent??_},e[2]=c,e[3]=i.id,e[4]=f):f=e[4];let p;e[5]!==o||e[6]!==t.id||e[7]!==t.slug||e[8]!==d?(p=_=>{_.success?(d.invalidateQueries({queryKey:U.projects(t.id)}),R.success("Project deleted"),o({to:"/$org/$project",params:{org:t.slug,project:Y}})):R.error(_.message??"Failed to delete project")},e[5]=o,e[6]=t.id,e[7]=t.slug,e[8]=d,e[9]=p):p=e[9];let w;e[10]!==f||e[11]!==p?(w={mutationFn:f,onSuccess:p,onError:st},e[10]=f,e[11]=p,e[12]=w):w=e[12];const m=ee(w);if(b)return null;const y=g===i.name;let P;e[13]!==m?(P=()=>{m.mutate()},e[13]=m,e[14]=P):P=e[14];const C=P;let I;e[15]===Symbol.for("react.memo_cache_sentinel")?(I=_=>{j(_),_||u("")},e[15]=I):I=e[15];const S=I;let n;e[16]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{children:[s.jsx("h3",{className:"font-semibold text-destructive",children:"Danger Zone"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Irreversible and destructive actions."})]}),e[16]=n):n=e[16];let r;e[17]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Be,{asChild:!0,children:s.jsx(L,{variant:"destructive",children:"Delete Project"})}),e[17]=r):r=e[17];let l;e[18]!==i.name?(l=s.jsxs(ze,{children:['Delete "',i.name,'"?']}),e[18]=i.name,e[19]=l):l=e[19];let h;e[20]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(ke,{children:"This action cannot be undone. All project data will be permanently deleted."}),e[20]=h):h=e[20];let v;e[21]!==l?(v=s.jsxs(Re,{children:[l,h]}),e[21]=l,e[22]=v):v=e[22];let N;e[23]!==i.name?(N=s.jsxs("p",{className:"text-sm mb-2",children:["Type ",s.jsx("strong",{children:i.name})," to confirm:"]}),e[23]=i.name,e[24]=N):N=e[24];let F;e[25]===Symbol.for("react.memo_cache_sentinel")?(F=_=>u(_.target.value),e[25]=F):F=e[25];let O;e[26]!==g||e[27]!==i.name?(O=s.jsx(V,{value:g,onChange:F,placeholder:i.name}),e[26]=g,e[27]=i.name,e[28]=O):O=e[28];let T;e[29]!==N||e[30]!==O?(T=s.jsxs("div",{className:"py-4",children:[N,O]}),e[29]=N,e[30]=O,e[31]=T):T=e[31];let D;e[32]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(Le,{children:"Cancel"}),e[32]=D):D=e[32];const A=!y||m.isPending,z=m.isPending?"Deleting...":"Delete Project";let E;e[33]!==C||e[34]!==A||e[35]!==z?(E=s.jsxs(Ue,{children:[D,s.jsx(qe,{onClick:C,disabled:A,className:"bg-destructive hover:bg-destructive/90 text-destructive-foreground",children:z})]}),e[33]=C,e[34]=A,e[35]=z,e[36]=E):E=e[36];let k;e[37]!==v||e[38]!==T||e[39]!==E?(k=s.jsxs(Me,{children:[v,T,E]}),e[37]=v,e[38]=T,e[39]=E,e[40]=k):k=e[40];let B;return e[41]!==x||e[42]!==k?(B=s.jsxs("div",{className:"border border-destructive/50 rounded-lg p-4 space-y-4",children:[n,s.jsxs($e,{open:x,onOpenChange:S,children:[r,k]})]}),e[41]=x,e[42]=k,e[43]=B):B=e[43],B}function st(e){R.error("Failed to delete project: "+(e instanceof Error?e.message:"Unknown error"))}function At(){const e=H.c(10),{project:t}=W(),i=t.slug===Y;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Z.Header,{children:s.jsx(Z.Header.Left,{children:s.jsx(fe,{children:s.jsx(pe,{children:s.jsx(he,{children:s.jsx(xe,{children:"Settings"})})})})})}),e[0]=o):o=e[0];let d;e[1]!==i?(d=i&&s.jsxs("section",{className:"space-y-4",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(et,{})]}),e[1]=i,e[2]=d):d=e[2];let g;e[3]!==i?(g=!i&&s.jsxs("section",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"General"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Basic project information."})]}),s.jsx(Ge,{})]}),e[3]=i,e[4]=g):g=e[4];let u,x;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsxs("section",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Plugins"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Manage which plugins are enabled and configure them."})]}),s.jsx(Ze,{})]}),x=s.jsx(tt,{}),e[5]=u,e[6]=x):(u=e[5],x=e[6]);let j;return e[7]!==d||e[8]!==g?(j=s.jsxs(Z,{children:[o,s.jsx(Z.Content,{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-8",children:[d,g,u,x]})})})})})]}),e[7]=d,e[8]=g,e[9]=j):j=e[9],j}export{At as default};
@@ -1 +1 @@
1
- import{aW as U,c as O,u as H,j as s,aN as G,r as I,m as M,O as V}from"./index-CCcWAtA_.js";import{a as q}from"./use-project-DLsFLh3O.js";import{P as D}from"./index-D5w8F0R7.js";import{C as F}from"./collection-search-MQc1JOFA.js";import{A as J}from"./avatar-2G5ouaDu.js";import{c as K}from"./utils-CnoQZeDK.js";import{f as W}from"./formatDistanceToNow-Cb2QZZJn.js";import{E as R}from"./empty-state-B8XrD0Ub.js";import{C as Q}from"./create-project-dialog-BxxiVX3V.js";import{B as X,a as Y,b as Z,c as ee}from"./breadcrumb-JfdGMaRd.js";import{B as T}from"./button-BKtq_PYU.js";import"./useQuery-Dp4Sp9Q1.js";import"./constants-PBHJ4h9F.js";import"./Loading01-B78uc8_j.js";import"./SearchMd-rxhL9uWW.js";import"./input-Dh6Cjukb.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./useMutation-Cn2d2ilG.js";import"./dialog-B8Jtq_Yp.js";import"./X-mZzFkOTX.js";import"./form-DQap4sDh.js";import"./textarea-D6y1LKj_.js";import"./Check-CTaDpFbx.js";import"./ChevronRight-C7PRdwhN.js";const te=U("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);function se(t){const e=O.c(58),{project:l,onSettingsClick:c}=t,{org:r}=H(),d=l.ui?.themeColor??"#60a5fa",b=l.ui?.bannerColor??d,m=l.ui?.banner?`url(${l.ui.banner})`:void 0;let i;e[0]!==b||e[1]!==m?(i={backgroundColor:b,backgroundImage:m,backgroundSize:"cover",backgroundPosition:"center"},e[0]=b,e[1]=m,e[2]=i):i=e[2];const _=i;let u;e[3]!==r.slug||e[4]!==l.slug?(u={org:r.slug,project:l.slug},e[3]=r.slug,e[4]=l.slug,e[5]=u):u=e[5];let f;e[6]!==c?(f=B=>{B.preventDefault(),B.stopPropagation(),c?.(B)},e[6]=c,e[7]=f):f=e[7];let x,v;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=K("absolute top-3 right-3 size-6 rounded-md flex items-center justify-center","bg-black/20 hover:bg-black/40 transition-colors","opacity-0 group-hover:opacity-100"),v=s.jsx(te,{className:"size-3.5 text-white"}),e[8]=x,e[9]=v):(x=e[8],v=e[9]);let g;e[10]!==f?(g=s.jsx("button",{type:"button",onClick:f,className:x,children:v}),e[10]=f,e[11]=g):g=e[11];let p;e[12]!==_||e[13]!==g?(p=s.jsx("div",{className:"h-20 relative",style:_,children:g}),e[12]=_,e[13]=g,e[14]=p):p=e[14];let n;e[15]!==l.name||e[16]!==l.ui||e[17]!==d?(n=l.ui?.icon?s.jsx("img",{src:l.ui.icon,alt:"",className:"size-8 rounded-md object-cover"}):s.jsx("div",{className:"size-8 rounded-md flex items-center justify-center",style:{backgroundColor:d},children:s.jsx("span",{className:"text-sm font-medium text-white",children:l.name.charAt(0).toUpperCase()})}),e[15]=l.name,e[16]=l.ui,e[17]=d,e[18]=n):n=e[18];let a;e[19]!==l.name?(a=s.jsx("h3",{className:"font-medium text-base text-foreground truncate",children:l.name}),e[19]=l.name,e[20]=a):a=e[20];let h;e[21]!==l.updatedAt?(h=W(new Date(l.updatedAt),{addSuffix:!0}),e[21]=l.updatedAt,e[22]=h):h=e[22];let j;e[23]!==h?(j=s.jsxs("p",{className:"text-sm text-muted-foreground",children:["Edited"," ",h]}),e[23]=h,e[24]=j):j=e[24];let N;e[25]!==a||e[26]!==j?(N=s.jsxs("div",{className:"flex flex-col",children:[a,j]}),e[25]=a,e[26]=j,e[27]=N):N=e[27];let C;e[28]!==n||e[29]!==N?(C=s.jsxs("div",{className:"flex flex-col gap-4",children:[n,N]}),e[28]=n,e[29]=N,e[30]=C):C=e[30];let k;e[31]!==l.boundConnections?(k=l.boundConnections.slice(0,4).map(le),e[31]=l.boundConnections,e[32]=k):k=e[32];let P;e[33]!==l.boundConnections.length?(P=l.boundConnections.length>4&&s.jsx("div",{className:"-mr-2 rounded-md border border-background",children:s.jsxs("div",{className:"size-6 rounded-md bg-background border border-black/10 shadow-sm flex items-center justify-center text-xs text-muted-foreground",children:["+",l.boundConnections.length-4]})}),e[33]=l.boundConnections.length,e[34]=P):P=e[34];let y;e[35]!==k||e[36]!==P?(y=s.jsxs("div",{className:"flex pr-2",children:[k,P]}),e[35]=k,e[36]=P,e[37]=y):y=e[37];const z=r.logo??void 0;let w;e[38]!==r.name||e[39]!==z?(w=s.jsx(J,{url:z,fallback:r.name,size:"2xs",className:"shrink-0 rounded",objectFit:"cover"}),e[38]=r.name,e[39]=z,e[40]=w):w=e[40];let S;e[41]!==r.name?(S=s.jsx("span",{className:"truncate max-w-20",children:r.name}),e[41]=r.name,e[42]=S):S=e[42];let o;e[43]!==w||e[44]!==S?(o=s.jsxs("div",{className:"flex items-center gap-2 text-xs text-foreground",children:[w,S]}),e[43]=w,e[44]=S,e[45]=o):o=e[45];let L;e[46]!==y||e[47]!==o?(L=s.jsxs("div",{className:"flex items-center justify-between mt-4",children:[y,o]}),e[46]=y,e[47]=o,e[48]=L):L=e[48];let $;e[49]!==C||e[50]!==L?($=s.jsxs("div",{className:"flex flex-col flex-1 justify-between p-4",children:[C,L]}),e[49]=C,e[50]=L,e[51]=$):$=e[51];let A;e[52]!==$||e[53]!==p?(A=s.jsxs("div",{className:"border border-border rounded-xl overflow-hidden bg-card",children:[p,$]}),e[52]=$,e[53]=p,e[54]=A):A=e[54];let E;return e[55]!==A||e[56]!==u?(E=s.jsx(G,{to:"/$org/$project",params:u,className:"block group",children:A}),e[55]=A,e[56]=u,e[57]=E):E=e[57],E}function le(t){return s.jsx("div",{className:"-mr-2 rounded-md border border-background",children:s.jsx(re,{connection:t})},t.id)}function re(t){const e=O.c(13),{connection:l}=t;if(l.icon){let m;e[0]!==l.icon||e[1]!==l.title?(m=s.jsx("img",{src:l.icon,alt:l.title,className:"size-4 object-cover"}),e[0]=l.icon,e[1]=l.title,e[2]=m):m=e[2];let i;return e[3]!==l.title||e[4]!==m?(i=s.jsx("div",{className:"size-6 rounded-md bg-background border border-black/10 shadow-sm flex items-center justify-center overflow-hidden",title:l.title,children:m}),e[3]=l.title,e[4]=m,e[5]=i):i=e[5],i}const c=l.title;let r;e[6]!==l.title?(r=l.title.charAt(0).toUpperCase(),e[6]=l.title,e[7]=r):r=e[7];let d;e[8]!==r?(d=s.jsx("span",{className:"text-[10px] text-muted-foreground font-medium",children:r}),e[8]=r,e[9]=d):d=e[9];let b;return e[10]!==l.title||e[11]!==d?(b=s.jsx("div",{className:"size-6 rounded-md bg-background border border-black/10 shadow-sm flex items-center justify-center overflow-hidden",title:c,children:d}),e[10]=l.title,e[11]=d,e[12]=b):b=e[12],b}function $e(){const t=O.c(40),{org:e}=H(),{data:l,isLoading:c}=q(e.id),[r,d]=I.useState(""),[b,m]=I.useState(!1),i=M();let _,u,f,x,v,g,p,n,a;if(t[0]!==c||t[1]!==i||t[2]!==e.slug||t[3]!==l||t[4]!==r){const C=l?.filter(ie)?.filter(o=>o.name.toLowerCase().includes(r.toLowerCase())||o.description?.toLowerCase().includes(r.toLowerCase()))??[];let k;t[14]!==i||t[15]!==e.slug?(k=o=>{i({to:"/$org/$project/settings",params:{org:e.slug,project:o}})},t[14]=i,t[15]=e.slug,t[16]=k):k=t[16];const P=k;let y;t[17]===Symbol.for("react.memo_cache_sentinel")?(y=()=>{m(!0)},t[17]=y):y=t[17];const z=y;u=D;let w;t[18]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(D.Header.Left,{children:s.jsx(X,{children:s.jsx(Y,{children:s.jsx(Z,{children:s.jsx(ee,{children:"Projects"})})})})}),t[18]=w):w=t[18],t[19]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs(D.Header,{children:[w,s.jsx(D.Header.Right,{children:s.jsx(T,{onClick:z,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Create new project"})})]}),t[19]=n):n=t[19];let S;t[20]===Symbol.for("react.memo_cache_sentinel")?(S=o=>{o.key==="Escape"&&(d(""),o.target.blur())},t[20]=S):S=t[20],t[21]!==r?(a=s.jsx(F,{value:r,onChange:d,placeholder:"Search for a project...",onKeyDown:S}),t[21]=r,t[22]=a):a=t[22],_=D.Content,f="@container",t[23]!==c?(x=c&&s.jsx("div",{className:"p-5",children:s.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:[...Array(4)].map(oe)})}),t[23]=c,t[24]=x):x=t[24],v=!c&&C.length===0&&r&&s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(R,{title:"No projects found",description:`No projects match "${r}"`})}),g=!c&&C.length===0&&!r&&s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(R,{title:"No projects yet",description:"Create a project to get started.",actions:s.jsx(T,{onClick:z,children:"Create new project"})})}),p=!c&&C.length>0&&s.jsx("div",{className:"p-5",children:s.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:C.map(o=>s.jsx(se,{project:o,onSettingsClick:()=>P(o.slug)},o.id))})}),t[0]=c,t[1]=i,t[2]=e.slug,t[3]=l,t[4]=r,t[5]=_,t[6]=u,t[7]=f,t[8]=x,t[9]=v,t[10]=g,t[11]=p,t[12]=n,t[13]=a}else _=t[5],u=t[6],f=t[7],x=t[8],v=t[9],g=t[10],p=t[11],n=t[12],a=t[13];let h;t[25]!==_||t[26]!==f||t[27]!==x||t[28]!==v||t[29]!==g||t[30]!==p?(h=s.jsxs(_,{className:f,children:[x,v,g,p]}),t[25]=_,t[26]=f,t[27]=x,t[28]=v,t[29]=g,t[30]=p,t[31]=h):h=t[31];let j;t[32]!==b?(j=s.jsx(Q,{open:b,onOpenChange:m}),t[32]=b,t[33]=j):j=t[33];let N;return t[34]!==u||t[35]!==n||t[36]!==a||t[37]!==h||t[38]!==j?(N=s.jsxs(u,{children:[n,a,h,j]}),t[34]=u,t[35]=n,t[36]=a,t[37]=h,t[38]=j,t[39]=N):N=t[39],N}function oe(t,e){return s.jsx("div",{className:"h-[240px] rounded-xl bg-muted animate-pulse"},e)}function ie(t){return t.slug!==V}export{$e as default};
1
+ import{aW as U,c as O,u as H,j as s,aN as G,r as I,m as M,O as V}from"./index-BV-rIyOx.js";import{a as q}from"./use-project-CzroiUzj.js";import{P as D}from"./index-9vOB29ZB.js";import{C as F}from"./collection-search-Aeh0FXZR.js";import{A as J}from"./avatar-B-AS-16N.js";import{c as K}from"./utils-CfR4kXxZ.js";import{f as W}from"./formatDistanceToNow-Cb2QZZJn.js";import{E as R}from"./empty-state-oU8PNga_.js";import{C as Q}from"./create-project-dialog-49RtElmv.js";import{B as X,a as Y,b as Z,c as ee}from"./breadcrumb-Cvo4WJJ5.js";import{B as T}from"./button-Cl3WMTWk.js";import"./useQuery-DDYln2BW.js";import"./constants-1q3hobyw.js";import"./Loading01-DOPFYU4m.js";import"./SearchMd-Ds-ERWzq.js";import"./input-Dv5qvD5N.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./useMutation-BOrtlNTb.js";import"./dialog-BmGDp4UV.js";import"./X-DUGfq2_H.js";import"./form-qYB4UriD.js";import"./textarea-DK_SwVx9.js";import"./Check-Bkb61eVw.js";import"./ChevronRight-BBcOJkyP.js";const te=U("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);function se(t){const e=O.c(58),{project:l,onSettingsClick:c}=t,{org:r}=H(),d=l.ui?.themeColor??"#60a5fa",b=l.ui?.bannerColor??d,m=l.ui?.banner?`url(${l.ui.banner})`:void 0;let i;e[0]!==b||e[1]!==m?(i={backgroundColor:b,backgroundImage:m,backgroundSize:"cover",backgroundPosition:"center"},e[0]=b,e[1]=m,e[2]=i):i=e[2];const _=i;let u;e[3]!==r.slug||e[4]!==l.slug?(u={org:r.slug,project:l.slug},e[3]=r.slug,e[4]=l.slug,e[5]=u):u=e[5];let f;e[6]!==c?(f=B=>{B.preventDefault(),B.stopPropagation(),c?.(B)},e[6]=c,e[7]=f):f=e[7];let x,v;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=K("absolute top-3 right-3 size-6 rounded-md flex items-center justify-center","bg-black/20 hover:bg-black/40 transition-colors","opacity-0 group-hover:opacity-100"),v=s.jsx(te,{className:"size-3.5 text-white"}),e[8]=x,e[9]=v):(x=e[8],v=e[9]);let g;e[10]!==f?(g=s.jsx("button",{type:"button",onClick:f,className:x,children:v}),e[10]=f,e[11]=g):g=e[11];let p;e[12]!==_||e[13]!==g?(p=s.jsx("div",{className:"h-20 relative",style:_,children:g}),e[12]=_,e[13]=g,e[14]=p):p=e[14];let n;e[15]!==l.name||e[16]!==l.ui||e[17]!==d?(n=l.ui?.icon?s.jsx("img",{src:l.ui.icon,alt:"",className:"size-8 rounded-md object-cover"}):s.jsx("div",{className:"size-8 rounded-md flex items-center justify-center",style:{backgroundColor:d},children:s.jsx("span",{className:"text-sm font-medium text-white",children:l.name.charAt(0).toUpperCase()})}),e[15]=l.name,e[16]=l.ui,e[17]=d,e[18]=n):n=e[18];let a;e[19]!==l.name?(a=s.jsx("h3",{className:"font-medium text-base text-foreground truncate",children:l.name}),e[19]=l.name,e[20]=a):a=e[20];let h;e[21]!==l.updatedAt?(h=W(new Date(l.updatedAt),{addSuffix:!0}),e[21]=l.updatedAt,e[22]=h):h=e[22];let j;e[23]!==h?(j=s.jsxs("p",{className:"text-sm text-muted-foreground",children:["Edited"," ",h]}),e[23]=h,e[24]=j):j=e[24];let N;e[25]!==a||e[26]!==j?(N=s.jsxs("div",{className:"flex flex-col",children:[a,j]}),e[25]=a,e[26]=j,e[27]=N):N=e[27];let C;e[28]!==n||e[29]!==N?(C=s.jsxs("div",{className:"flex flex-col gap-4",children:[n,N]}),e[28]=n,e[29]=N,e[30]=C):C=e[30];let k;e[31]!==l.boundConnections?(k=l.boundConnections.slice(0,4).map(le),e[31]=l.boundConnections,e[32]=k):k=e[32];let P;e[33]!==l.boundConnections.length?(P=l.boundConnections.length>4&&s.jsx("div",{className:"-mr-2 rounded-md border border-background",children:s.jsxs("div",{className:"size-6 rounded-md bg-background border border-black/10 shadow-sm flex items-center justify-center text-xs text-muted-foreground",children:["+",l.boundConnections.length-4]})}),e[33]=l.boundConnections.length,e[34]=P):P=e[34];let y;e[35]!==k||e[36]!==P?(y=s.jsxs("div",{className:"flex pr-2",children:[k,P]}),e[35]=k,e[36]=P,e[37]=y):y=e[37];const z=r.logo??void 0;let w;e[38]!==r.name||e[39]!==z?(w=s.jsx(J,{url:z,fallback:r.name,size:"2xs",className:"shrink-0 rounded",objectFit:"cover"}),e[38]=r.name,e[39]=z,e[40]=w):w=e[40];let S;e[41]!==r.name?(S=s.jsx("span",{className:"truncate max-w-20",children:r.name}),e[41]=r.name,e[42]=S):S=e[42];let o;e[43]!==w||e[44]!==S?(o=s.jsxs("div",{className:"flex items-center gap-2 text-xs text-foreground",children:[w,S]}),e[43]=w,e[44]=S,e[45]=o):o=e[45];let L;e[46]!==y||e[47]!==o?(L=s.jsxs("div",{className:"flex items-center justify-between mt-4",children:[y,o]}),e[46]=y,e[47]=o,e[48]=L):L=e[48];let $;e[49]!==C||e[50]!==L?($=s.jsxs("div",{className:"flex flex-col flex-1 justify-between p-4",children:[C,L]}),e[49]=C,e[50]=L,e[51]=$):$=e[51];let A;e[52]!==$||e[53]!==p?(A=s.jsxs("div",{className:"border border-border rounded-xl overflow-hidden bg-card",children:[p,$]}),e[52]=$,e[53]=p,e[54]=A):A=e[54];let E;return e[55]!==A||e[56]!==u?(E=s.jsx(G,{to:"/$org/$project",params:u,className:"block group",children:A}),e[55]=A,e[56]=u,e[57]=E):E=e[57],E}function le(t){return s.jsx("div",{className:"-mr-2 rounded-md border border-background",children:s.jsx(re,{connection:t})},t.id)}function re(t){const e=O.c(13),{connection:l}=t;if(l.icon){let m;e[0]!==l.icon||e[1]!==l.title?(m=s.jsx("img",{src:l.icon,alt:l.title,className:"size-4 object-cover"}),e[0]=l.icon,e[1]=l.title,e[2]=m):m=e[2];let i;return e[3]!==l.title||e[4]!==m?(i=s.jsx("div",{className:"size-6 rounded-md bg-background border border-black/10 shadow-sm flex items-center justify-center overflow-hidden",title:l.title,children:m}),e[3]=l.title,e[4]=m,e[5]=i):i=e[5],i}const c=l.title;let r;e[6]!==l.title?(r=l.title.charAt(0).toUpperCase(),e[6]=l.title,e[7]=r):r=e[7];let d;e[8]!==r?(d=s.jsx("span",{className:"text-[10px] text-muted-foreground font-medium",children:r}),e[8]=r,e[9]=d):d=e[9];let b;return e[10]!==l.title||e[11]!==d?(b=s.jsx("div",{className:"size-6 rounded-md bg-background border border-black/10 shadow-sm flex items-center justify-center overflow-hidden",title:c,children:d}),e[10]=l.title,e[11]=d,e[12]=b):b=e[12],b}function $e(){const t=O.c(40),{org:e}=H(),{data:l,isLoading:c}=q(e.id),[r,d]=I.useState(""),[b,m]=I.useState(!1),i=M();let _,u,f,x,v,g,p,n,a;if(t[0]!==c||t[1]!==i||t[2]!==e.slug||t[3]!==l||t[4]!==r){const C=l?.filter(ie)?.filter(o=>o.name.toLowerCase().includes(r.toLowerCase())||o.description?.toLowerCase().includes(r.toLowerCase()))??[];let k;t[14]!==i||t[15]!==e.slug?(k=o=>{i({to:"/$org/$project/settings",params:{org:e.slug,project:o}})},t[14]=i,t[15]=e.slug,t[16]=k):k=t[16];const P=k;let y;t[17]===Symbol.for("react.memo_cache_sentinel")?(y=()=>{m(!0)},t[17]=y):y=t[17];const z=y;u=D;let w;t[18]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(D.Header.Left,{children:s.jsx(X,{children:s.jsx(Y,{children:s.jsx(Z,{children:s.jsx(ee,{children:"Projects"})})})})}),t[18]=w):w=t[18],t[19]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs(D.Header,{children:[w,s.jsx(D.Header.Right,{children:s.jsx(T,{onClick:z,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Create new project"})})]}),t[19]=n):n=t[19];let S;t[20]===Symbol.for("react.memo_cache_sentinel")?(S=o=>{o.key==="Escape"&&(d(""),o.target.blur())},t[20]=S):S=t[20],t[21]!==r?(a=s.jsx(F,{value:r,onChange:d,placeholder:"Search for a project...",onKeyDown:S}),t[21]=r,t[22]=a):a=t[22],_=D.Content,f="@container",t[23]!==c?(x=c&&s.jsx("div",{className:"p-5",children:s.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:[...Array(4)].map(oe)})}),t[23]=c,t[24]=x):x=t[24],v=!c&&C.length===0&&r&&s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(R,{title:"No projects found",description:`No projects match "${r}"`})}),g=!c&&C.length===0&&!r&&s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(R,{title:"No projects yet",description:"Create a project to get started.",actions:s.jsx(T,{onClick:z,children:"Create new project"})})}),p=!c&&C.length>0&&s.jsx("div",{className:"p-5",children:s.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:C.map(o=>s.jsx(se,{project:o,onSettingsClick:()=>P(o.slug)},o.id))})}),t[0]=c,t[1]=i,t[2]=e.slug,t[3]=l,t[4]=r,t[5]=_,t[6]=u,t[7]=f,t[8]=x,t[9]=v,t[10]=g,t[11]=p,t[12]=n,t[13]=a}else _=t[5],u=t[6],f=t[7],x=t[8],v=t[9],g=t[10],p=t[11],n=t[12],a=t[13];let h;t[25]!==_||t[26]!==f||t[27]!==x||t[28]!==v||t[29]!==g||t[30]!==p?(h=s.jsxs(_,{className:f,children:[x,v,g,p]}),t[25]=_,t[26]=f,t[27]=x,t[28]=v,t[29]=g,t[30]=p,t[31]=h):h=t[31];let j;t[32]!==b?(j=s.jsx(Q,{open:b,onOpenChange:m}),t[32]=b,t[33]=j):j=t[33];let N;return t[34]!==u||t[35]!==n||t[36]!==a||t[37]!==h||t[38]!==j?(N=s.jsxs(u,{children:[n,a,h,j]}),t[34]=u,t[35]=n,t[36]=a,t[37]=h,t[38]=j,t[39]=N):N=t[39],N}function oe(t,e){return s.jsx("div",{className:"h-[240px] rounded-xl bg-muted animate-pulse"},e)}function ie(t){return t.slug!==V}export{$e as default};
@@ -1 +1 @@
1
- import"./index-CCcWAtA_.js";import{c as o}from"./constants-PBHJ4h9F.js";function f(t){return t?t.find(n=>n.name.endsWith("_LIST"))?.name??"":""}function u(t){return t?t.find(n=>n.name.endsWith("_FILTERS"))?.name??"":""}function m(t){if(!t)return[];const e=[];for(const n of t){let r=[];if(Array.isArray(n))r=n;else if(typeof n=="object"&&n!==null){const i=Object.keys(n).find(a=>Array.isArray(n[a]));i&&(r=n[i])}e.push(...r)}return e}const c={"streamable-http":"HTTP",http:"HTTP",sse:"SSE",stdio:"STDIO",websocket:"Websocket"};function y(t){return t?c[t]??t.toUpperCase():null}function T(t){return t?t.match(/schemas\/([\d-]+)/)?.[1]??null:null}function d(t){if(!t)return[];if(Array.isArray(t))return t;if(typeof t=="object"&&t!==null){const e=Object.keys(t).find(n=>Array.isArray(t[n]));if(e)return t[e]}return[]}async function h(t,e,n,r){const i=await o({connectionId:t,orgId:e});try{const a=await i.callTool({name:n,arguments:r});return a.structuredContent??a}finally{await i.close().catch(console.error)}}export{m as a,u as b,h as c,T as d,d as e,f,y as g};
1
+ import"./index-BV-rIyOx.js";import{c as o}from"./constants-1q3hobyw.js";function f(t){return t?t.find(n=>n.name.endsWith("_LIST"))?.name??"":""}function u(t){return t?t.find(n=>n.name.endsWith("_FILTERS"))?.name??"":""}function m(t){if(!t)return[];const e=[];for(const n of t){let r=[];if(Array.isArray(n))r=n;else if(typeof n=="object"&&n!==null){const i=Object.keys(n).find(a=>Array.isArray(n[a]));i&&(r=n[i])}e.push(...r)}return e}const c={"streamable-http":"HTTP",http:"HTTP",sse:"SSE",stdio:"STDIO",websocket:"Websocket"};function y(t){return t?c[t]??t.toUpperCase():null}function T(t){return t?t.match(/schemas\/([\d-]+)/)?.[1]??null:null}function d(t){if(!t)return[];if(Array.isArray(t))return t;if(typeof t=="object"&&t!==null){const e=Object.keys(t).find(n=>Array.isArray(t[n]));if(e)return t[e]}return[]}async function h(t,e,n,r){const i=await o({connectionId:t,orgId:e});try{const a=await i.callTool({name:n,arguments:r});return a.structuredContent??a}finally{await i.close().catch(console.error)}}export{m as a,u as b,h as c,T as d,d as e,f,y as g};
@@ -1 +1 @@
1
- import{r as f,aX as Pn,c as He,j as he}from"./index-CCcWAtA_.js";import{c as Je}from"./utils-CnoQZeDK.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:X,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:_=>{X(M.current,_)}}),[S,L,N,R,G,X]);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 q(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(X=>X.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||q(p,h))&&!q(r,h)&&v(),u&&(p==null||!q(p,h))&&q(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 Xe({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 Xn=100,me={getItem:n=>(Oe(me),me.getItem(n)),setItem:(n,e)=>{Oe(me),me.setItem(n,e)}},qe={};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=Xe({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=qe[n];m==null&&(m=Vn(On,Xn),qe[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}"`),!q(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))}}},[]),X=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(q($,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&&q(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=Xe({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&&$&&q(k,d)?q(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:X,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,X,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 qn({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:X}=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]),qn({disabled:t,handleId:W,resizeHandler:H,panelGroupElement:X});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{nt as R,et as a,Qn as b};
1
+ import{r as f,aX as Pn,c as He,j as he}from"./index-BV-rIyOx.js";import{c as Je}from"./utils-CfR4kXxZ.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:X,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:_=>{X(M.current,_)}}),[S,L,N,R,G,X]);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 q(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(X=>X.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||q(p,h))&&!q(r,h)&&v(),u&&(p==null||!q(p,h))&&q(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 Xe({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 Xn=100,me={getItem:n=>(Oe(me),me.getItem(n)),setItem:(n,e)=>{Oe(me),me.setItem(n,e)}},qe={};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=Xe({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=qe[n];m==null&&(m=Vn(On,Xn),qe[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}"`),!q(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))}}},[]),X=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(q($,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&&q(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=Xe({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&&$&&q(k,d)?q(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:X,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,X,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 qn({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:X}=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]),qn({disabled:t,handleId:W,resizeHandler:H,panelGroupElement:X});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{nt as R,et as a,Qn as b};