decocms 4.83.0 → 4.83.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (231) hide show
  1. package/dist/client/assets/{AlertCircle-DPEsW7A8.js → AlertCircle-C-LWGksh.js} +1 -1
  2. package/dist/client/assets/{AreaChart-BDBkVxFA.js → AreaChart-BuQ7pYh_.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-B_VVATf8.js → ArrowUp-BeEo8zxR.js} +1 -1
  4. package/dist/client/assets/{ArrowUpRight-DPt871Ex.js → ArrowUpRight-Cpd1Kvoc.js} +1 -1
  5. package/dist/client/assets/{CheckCircle-Bhjgrg4k.js → CheckCircle-D6vue6JR.js} +1 -1
  6. package/dist/client/assets/{ChevronDown-ClEtq8UA.js → ChevronDown-Chms7f47.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-B9DmLAKh.js → ChevronRight-DGKhdwsU.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-Y_qcNB-R.js → ChevronUp-B2kc02W-.js} +1 -1
  9. package/dist/client/assets/{Copy01-tOHQDVdb.js → Copy01-BLPcoB-x.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-CmHvBgAo.js → DotsVertical-Bv_Wu1PR.js} +1 -1
  11. package/dist/client/assets/{Eye-DkqzK9v4.js → Eye--S6NkM5F.js} +1 -1
  12. package/dist/client/assets/{FilterLines-Da90Z39y.js → FilterLines-CVyIbk7P.js} +1 -1
  13. package/dist/client/assets/{Globe01-BptLpR6D.js → Globe01-D8U_-ef0.js} +1 -1
  14. package/dist/client/assets/{Globe04-5erCJGew.js → Globe04-Cf7fSPDC.js} +1 -1
  15. package/dist/client/assets/{HardDrive-BWMqpfxS.js → HardDrive-BDXue_9V.js} +1 -1
  16. package/dist/client/assets/{Image01-XM4bpaLw.js → Image01-BOJVTyLq.js} +1 -1
  17. package/dist/client/assets/{Key01-ByxRAii_.js → Key01-DgOZ1Vl-.js} +1 -1
  18. package/dist/client/assets/{LayoutLeft-B9Jd6ymK.js → LayoutLeft-uipFY-Sc.js} +1 -1
  19. package/dist/client/assets/{LinkExternal01-CKVW-eEM.js → LinkExternal01-Cq7tHe_6.js} +1 -1
  20. package/dist/client/assets/{Monitor01-ClZ2KmM9.js → Monitor01-C0kqyHBJ.js} +1 -1
  21. package/dist/client/assets/{Package-CDoMKJ25.js → Package-2_HSkxNk.js} +1 -1
  22. package/dist/client/assets/{Palette-Dj74Mlc6.js → Palette-DUf6RWjx.js} +1 -1
  23. package/dist/client/assets/{Play-D5sDqr8I.js → Play-D27HpOrJ.js} +1 -1
  24. package/dist/client/assets/{Plus-JOcsz2OW.js → Plus-CX4xPpn4.js} +1 -1
  25. package/dist/client/assets/{SearchLg-BHMKxNfO.js → SearchLg-EiBSceY9.js} +1 -1
  26. package/dist/client/assets/{SearchMd-C-NJ_45S.js → SearchMd-CjaEgvWB.js} +1 -1
  27. package/dist/client/assets/{Settings02-CVFCJqEn.js → Settings02-5t6-pGmO.js} +1 -1
  28. package/dist/client/assets/{Shield01-Bj6HGuxh.js → Shield01-DxxbOkrj.js} +1 -1
  29. package/dist/client/assets/{Star01-QG8pK1yw.js → Star01-DBLmagOx.js} +1 -1
  30. package/dist/client/assets/{Stars01-DqPZujie.js → Stars01-D-dD7V12.js} +1 -1
  31. package/dist/client/assets/{Stars02-D1eOi134.js → Stars02-BHQ6SybJ.js} +1 -1
  32. package/dist/client/assets/{Sun-DHI7Rs1S.js → Sun-7RqH2_Dg.js} +1 -1
  33. package/dist/client/assets/{SwitchHorizontal01-D8ShLQwH.js → SwitchHorizontal01-Dm27fxw8.js} +1 -1
  34. package/dist/client/assets/{Tool01-C6ssLf07.js → Tool01-Bk7pamHg.js} +1 -1
  35. package/dist/client/assets/{Tool02-BHHNM_g4.js → Tool02-CngweHED.js} +1 -1
  36. package/dist/client/assets/{Trash01-BtophoGC.js → Trash01-Bi1KaIxH.js} +1 -1
  37. package/dist/client/assets/{TrendUp01-WOe5Y0pM.js → TrendUp01-DsSWSiUz.js} +1 -1
  38. package/dist/client/assets/{Upload01-CXhKVCP8.js → Upload01-BWPUocl6.js} +1 -1
  39. package/dist/client/assets/{User01-uwH1s6Qn.js → User01-s23e9wZl.js} +1 -1
  40. package/dist/client/assets/{Users01-suVU8oKl.js → Users01-CNMhmtlD.js} +1 -1
  41. package/dist/client/assets/{Users03-Zrh5Q_ci.js → Users03-CTnD7KhC.js} +1 -1
  42. package/dist/client/assets/{X-BolYo4iB.js → X-CLk-1WTe.js} +1 -1
  43. package/dist/client/assets/{XCircle-CnJ70X3w.js → XCircle-2O_4kWp7.js} +1 -1
  44. package/dist/client/assets/{XClose-BdaQO-2_.js → XClose-DSEAQFLe.js} +1 -1
  45. package/dist/client/assets/{Zap-BzNhtsnx.js → Zap-BAgOs3IO.js} +1 -1
  46. package/dist/client/assets/{ZapSquare-DMvgJwuD.js → ZapSquare-T3uj9o0S.js} +1 -1
  47. package/dist/client/assets/{ZoomOut-B5XPtpBa.js → ZoomOut-B7mxhvah.js} +1 -1
  48. package/dist/client/assets/{access-gate-CjWAQSdR.js → access-gate-avJTtHpg.js} +1 -1
  49. package/dist/client/assets/{add-section-modal-CyW16nLc.js → add-section-modal-BL-x5qaG.js} +1 -1
  50. package/dist/client/assets/{agent-icon-BGgFt2fk.js → agent-icon-D18juLx-.js} +1 -1
  51. package/dist/client/assets/{agents-list-MwwVi6Ba.js → agents-list-DLkLGDrw.js} +1 -1
  52. package/dist/client/assets/{ai-providers-DAP6QknZ.js → ai-providers-KsLhnp0X.js} +1 -1
  53. package/dist/client/assets/{alert-Beqn0Fvg.js → alert-Bele4j8y.js} +1 -1
  54. package/dist/client/assets/{alert-dialog-CwKyb2j-.js → alert-dialog-BNeEAttR.js} +1 -1
  55. package/dist/client/assets/{app-editor-DseSILWA.js → app-editor-B0BrwnQg.js} +1 -1
  56. package/dist/client/assets/{auth-D4bTHSVX.js → auth-D4yHRD2-.js} +1 -1
  57. package/dist/client/assets/{auth-catchall-BKLc7QKI.js → auth-catchall-CNZ3D5s7.js} +1 -1
  58. package/dist/client/assets/{auth-entry-1PWVON9e.js → auth-entry-C-qYM8sO.js} +1 -1
  59. package/dist/client/assets/{auth-split-layout-B6cSVZVN.js → auth-split-layout-DYTsk60r.js} +1 -1
  60. package/dist/client/assets/{authenticate-and-persist-oauth-Bt8Gm2rH.js → authenticate-and-persist-oauth-BlDhuvWq.js} +1 -1
  61. package/dist/client/assets/{automation-list-row-P3Wfaud1.js → automation-list-row-XKqqDi6F.js} +1 -1
  62. package/dist/client/assets/{automation-runs-0Gp5Pl3p.js → automation-runs-C0y-Gi-l.js} +25 -25
  63. package/dist/client/assets/{automations-B1Pch092.js → automations-DdZPK7BE.js} +1 -1
  64. package/dist/client/assets/{autosend-kl7RNqnt.js → autosend-Pu6JcU1z.js} +1 -1
  65. package/dist/client/assets/{avatar-BxCDP7Ot.js → avatar-CB-s6LW3.js} +1 -1
  66. package/dist/client/assets/{badge-CJKB36w7.js → badge-D2OV8wRl.js} +1 -1
  67. package/dist/client/assets/{block-document-BNPa3FEr.js → block-document-CMsWkopF.js} +1 -1
  68. package/dist/client/assets/{brand-context-D3Rlfh4r.js → brand-context-DWWqlpVW.js} +1 -1
  69. package/dist/client/assets/{buckets-eqtPNxJ7.js → buckets-Bml_f-qW.js} +1 -1
  70. package/dist/client/assets/{bulk-category-panel-CzrR4JyW.js → bulk-category-panel-CwTU2Dke.js} +1 -1
  71. package/dist/client/assets/{calendar-DeTvDsBF.js → calendar-Cy0H8dDP.js} +1 -1
  72. package/dist/client/assets/{capability-load-error-DB_oh7IY.js → capability-load-error-C8Uwu5_s.js} +1 -1
  73. package/dist/client/assets/{card-9tKE7GXF.js → card-BJLhqcLf.js} +1 -1
  74. package/dist/client/assets/{category-editor-BQbsXApg.js → category-editor-CfWwzNXf.js} +1 -1
  75. package/dist/client/assets/{chat-context-CwNi3A6G.js → chat-context-BzGsRBEi.js} +1 -1
  76. package/dist/client/assets/{checkbox-Diqx1FoE.js → checkbox-fY0uDGwg.js} +1 -1
  77. package/dist/client/assets/{cli-auth-success-DvYAFC0B.js → cli-auth-success-B08QkmvU.js} +1 -1
  78. package/dist/client/assets/{collection-detail-Cv0k2_GT.js → collection-detail-BZt_Ibwr.js} +1 -1
  79. package/dist/client/assets/{collection-display-button-hHnJ4_g2.js → collection-display-button-Cc0b3ED_.js} +1 -1
  80. package/dist/client/assets/{collection-search-kUG_oKbb.js → collection-search-Bv843kn7.js} +1 -1
  81. package/dist/client/assets/{collection-table-wrapper-B9yKUfMg.js → collection-table-wrapper-DjmKYjAk.js} +1 -1
  82. package/dist/client/assets/{collection-tabs-BTDZrBXn.js → collection-tabs-B6yGaiCr.js} +1 -1
  83. package/dist/client/assets/{command-N0I3WfMj.js → command-DWwqFTuu.js} +1 -1
  84. package/dist/client/assets/{commerce-onboarding-BySa1y-W.js → commerce-onboarding-dLv4vpps.js} +1 -1
  85. package/dist/client/assets/{companions-core-CXFBjxtL.js → companions-core-NOLgowrv.js} +1 -1
  86. package/dist/client/assets/{connect-desktop-dialog-ChBtls8K.js → connect-desktop-dialog-DEpb0pcU.js} +1 -1
  87. package/dist/client/assets/{connection-card-D0_c6gO9.js → connection-card-o0DDUNHv.js} +1 -1
  88. package/dist/client/assets/{connection-detail-BE-m8wny.js → connection-detail-Cswj6S4W.js} +1 -1
  89. package/dist/client/assets/{connection-form-helpers-BYaB09EC.js → connection-form-helpers-EPDDGUte.js} +1 -1
  90. package/dist/client/assets/{connections-BFAOtXPe.js → connections-6qWoAdqX.js} +1 -1
  91. package/dist/client/assets/{decopilot-sse-pool-BLGL0LsS.js → decopilot-sse-pool-D-2tGt-o.js} +1 -1
  92. package/dist/client/assets/{dialog-BxyVzjQ3.js → dialog-BFqbrhnG.js} +1 -1
  93. package/dist/client/assets/{domain-settings-BK0JpUz3.js → domain-settings-IW5nZczN.js} +1 -1
  94. package/dist/client/assets/{drawer-CQKQzuhR.js → drawer-Cl_dvusi.js} +1 -1
  95. package/dist/client/assets/{dropdown-menu-BScjo8--.js → dropdown-menu-EfeTZxQL.js} +1 -1
  96. package/dist/client/assets/{empty-state-es2nRb_j.js → empty-state-DQOY2xmV.js} +1 -1
  97. package/dist/client/assets/{extract-connection-data-C2_0wEKz.js → extract-connection-data-C6T0yo3M.js} +1 -1
  98. package/dist/client/assets/{file-explorer-ipUahnFG.js → file-explorer-BIc5X5VW.js} +1 -1
  99. package/dist/client/assets/{file-type-icon-L2ARwYHI.js → file-type-icon-D2keXo94.js} +1 -1
  100. package/dist/client/assets/{files-CEyq4COK.js → files-CSH75kzv.js} +1 -1
  101. package/dist/client/assets/{form-BBrmDTao.js → form-CGKisGk6.js} +1 -1
  102. package/dist/client/assets/{general-mpELEztz.js → general-BfoX5LCV.js} +1 -1
  103. package/dist/client/assets/{github-repo-picker-ClgZW6LI.js → github-repo-picker-BRMhPL_0.js} +1 -1
  104. package/dist/client/assets/{hooks-faeU6CoI.js → hooks-BSMoXVbD.js} +1 -1
  105. package/dist/client/assets/{index-DJmEqij6.js → index-BCsh3PYH.js} +1 -1
  106. package/dist/client/assets/{index-D521UaSg.js → index-BKqtjTbw.js} +1 -1
  107. package/dist/client/assets/{index-CesmbZpg.js → index-BmwqFaiy.js} +5 -5
  108. package/dist/client/assets/{index-DNRNEGzF.js → index-ByT194y-.js} +1 -1
  109. package/dist/client/assets/{index-CxWNtx9x.js → index-CAIYhjul.js} +3 -3
  110. package/dist/client/assets/{index-BXoUOnNS.js → index-CUgYJaPV.js} +1 -1
  111. package/dist/client/assets/{index-DIB09EG-.js → index-CXCcDBTq.js} +1 -1
  112. package/dist/client/assets/{index-D1EuIdjV.js → index-ChtsFoQQ.js} +1 -1
  113. package/dist/client/assets/{index-DxY7xoBM.js → index-D2HwJQV5.js} +2 -2
  114. package/dist/client/assets/{index-DI-ckLEU.js → index-DSgOediN.js} +1 -1
  115. package/dist/client/assets/{index-8daa3oHu.js → index-DrJmHyyo.js} +1 -1
  116. package/dist/client/assets/{index-B7DxR0_h.js → index-H4hcES42.js} +1 -1
  117. package/dist/client/assets/{index-HF6wstce.js → index-Rb2bYeF_.js} +1 -1
  118. package/dist/client/assets/{index-DU67rOKJ.js → index-S3X52veH.js} +1 -1
  119. package/dist/client/assets/{index-redirect-B1CSBKQb.js → index-redirect-CEHG6qWB.js} +1 -1
  120. package/dist/client/assets/{input-C9EhK1Lu.js → input-Dzav8ivG.js} +1 -1
  121. package/dist/client/assets/{integration-icon-Bz3MOu79.js → integration-icon-Db96f3jT.js} +1 -1
  122. package/dist/client/assets/{invite-member-dialog-B4o_u0Yn.js → invite-member-dialog-9O6Lre1u.js} +1 -1
  123. package/dist/client/assets/{label-JPT2W8Pg.js → label-DaAsoL9V.js} +1 -1
  124. package/dist/client/assets/{layout-DDwESlPa.js → layout-Br8401sd.js} +1 -1
  125. package/dist/client/assets/{login-CyRsInne.js → login-DceebZPc.js} +1 -1
  126. package/dist/client/assets/{mcp-oauth-DUn-Fuzj.js → mcp-oauth-Bzb4iSTT.js} +1 -1
  127. package/dist/client/assets/{members-C17VYqOT.js → members-DJky7gY8.js} +1 -1
  128. package/dist/client/assets/{monaco-editor-DYNno9ow.js → monaco-editor-c4RVis_9.js} +1 -1
  129. package/dist/client/assets/{monitoring-stats-row-B1B3SvpD.js → monitoring-stats-row-CgDrRjXa.js} +1 -1
  130. package/dist/client/assets/{multi-select-CTnDksvV.js → multi-select-DswivzJU.js} +1 -1
  131. package/dist/client/assets/{oauth-callback-C2RnV8Ra.js → oauth-callback-N8Kmr_2u.js} +1 -1
  132. package/dist/client/assets/{oauth-callback-ai-provider-qznLDLZZ.js → oauth-callback-ai-provider-B07g_XT9.js} +1 -1
  133. package/dist/client/assets/{onboarding-DUVBk0XQ.js → onboarding-BKAjTwg-.js} +1 -1
  134. package/dist/client/assets/{org-install-DQ2uKUYH.js → org-install-HCB4vzUC.js} +1 -1
  135. package/dist/client/assets/{org-layout-Bln5VKHy.js → org-layout-C0Q-q-fX.js} +1 -1
  136. package/dist/client/assets/{organization-choice-BzUmyMzq.js → organization-choice-D9DKvqVz.js} +1 -1
  137. package/dist/client/assets/{orgs-CQnP3RnF.js → orgs-BrqG5BVm.js} +1 -1
  138. package/dist/client/assets/{page-seo-form-BtLUHPsW.js → page-seo-form-DZCzqL8q.js} +1 -1
  139. package/dist/client/assets/page-seo-sheet-MkscnSYp.js +1 -0
  140. package/dist/client/assets/{popover-BPf7qyUL.js → popover-Zrs8wv0F.js} +1 -1
  141. package/dist/client/assets/{post-editor-BLwE05et.js → post-editor-CdSGWiLa.js} +1 -1
  142. package/dist/client/assets/{primitives-DdZDjvVV.js → primitives-CSHAedU0.js} +1 -1
  143. package/dist/client/assets/{profile-8a3_1Shi.js → profile-L8yVo8jE.js} +1 -1
  144. package/dist/client/assets/project-app-view-D7_4EXf8.js +1 -0
  145. package/dist/client/assets/record-editor-sr_hR6uA.js +1 -0
  146. package/dist/client/assets/redirect-editor-DYiAiFDJ.js +1 -0
  147. package/dist/client/assets/registry-2F4l4D0M.js +2 -0
  148. package/dist/client/assets/{registry-layout-DTk5e6HH.js → registry-layout-ftVzyud_.js} +2 -2
  149. package/dist/client/assets/{reports-qdBRQ4pV.js → reports--rTbu3V7.js} +1 -1
  150. package/dist/client/assets/{require-capability-Bspi0oGk.js → require-capability-BYn5Rk3O.js} +1 -1
  151. package/dist/client/assets/{required-auth-layout-0AnIaBaR.js → required-auth-layout-CoT_XXkN.js} +1 -1
  152. package/dist/client/assets/{reset-password-D0qvkNvH.js → reset-password-CgNFAvmH.js} +1 -1
  153. package/dist/client/assets/{roles-BwrRDzH5.js → roles-DMRweu6k.js} +1 -1
  154. package/dist/client/assets/{search-input-Bdl49Lyd.js → search-input-Cq8-y1F0.js} +1 -1
  155. package/dist/client/assets/{secrets-BGFKYnKe.js → secrets-CmPAp_up.js} +1 -1
  156. package/dist/client/assets/{sections-editor-BKlLtB36.js → sections-editor-wyl18rw9.js} +1 -1
  157. package/dist/client/assets/select-model-DI8jnYOT.js +4 -0
  158. package/dist/client/assets/{select-BjS6pi0R.js → select-peZlJuYe.js} +1 -1
  159. package/dist/client/assets/{self-tool-result-CzsRIvtg.js → self-tool-result-DYrHsoN8.js} +1 -1
  160. package/dist/client/assets/{seo-editor-CMScpL2i.js → seo-editor-BJVKSK5H.js} +1 -1
  161. package/dist/client/assets/{settings-layout-Cbmu_dvI.js → settings-layout-CPUHm_YX.js} +1 -1
  162. package/dist/client/assets/{settings-section-C5ntTZ3s.js → settings-section-B1GgY2if.js} +1 -1
  163. package/dist/client/assets/{shell-controls-CZu8nt18.js → shell-controls-C_p4ZmTF.js} +1 -1
  164. package/dist/client/assets/{shell-layout-ElsOHGco.js → shell-layout-CTslVDtx.js} +1 -1
  165. package/dist/client/assets/{sidebar-Du3GhEXu.js → sidebar-BjlDvhlo.js} +1 -1
  166. package/dist/client/assets/{skeleton-DYrRZj58.js → skeleton-DeOjoVUO.js} +1 -1
  167. package/dist/client/assets/{sso-DwHclfbW.js → sso-D363gW46.js} +1 -1
  168. package/dist/client/assets/{store-D1pr97wp.js → store-DvP7myd4.js} +1 -1
  169. package/dist/client/assets/store-registry-r9GmOZET.js +2 -0
  170. package/dist/client/assets/{studio-tools-HHcBk3Yy.js → studio-tools-C0-5Z8k5.js} +1 -1
  171. package/dist/client/assets/{switch-Co9VnPF1.js → switch-DG2ijYXZ.js} +1 -1
  172. package/dist/client/assets/{table-7Pa2oc8U.js → table-fSAZqdik.js} +1 -1
  173. package/dist/client/assets/{tabs-DIYXMj-h.js → tabs-59hacXBf.js} +1 -1
  174. package/dist/client/assets/{textarea-azsnX4mp.js → textarea-B9TUwSCj.js} +1 -1
  175. package/dist/client/assets/{toggle-group-_FACvaFN.js → toggle-group-CP4FEYCM.js} +1 -1
  176. package/dist/client/assets/{toolbar-WAIhuPvK.js → toolbar-Bn_kiKpu.js} +1 -1
  177. package/dist/client/assets/{toolbar-icon-button-CFa583yL.js → toolbar-icon-button-DChgCAZk.js} +1 -1
  178. package/dist/client/assets/{tooltip-CTQ3jqyw.js → tooltip-DBcnpVTx.js} +1 -1
  179. package/dist/client/assets/{use-ai-providers-C3gvqXwZ.js → use-ai-providers-B0J5EZdH.js} +1 -1
  180. package/dist/client/assets/{use-automations-CV0g4TCD.js → use-automations-CajzdSeA.js} +1 -1
  181. package/dist/client/assets/{use-autosave-BUYSmKJl.js → use-autosave-BvYo7aS2.js} +1 -1
  182. package/dist/client/assets/{use-capability-DzMeZG_B.js → use-capability-CEtXiCRz.js} +1 -1
  183. package/dist/client/assets/{use-clock-tick-4n-sf8En.js → use-clock-tick-r_qU_UzB.js} +1 -1
  184. package/dist/client/assets/{use-collections-CR5m--3v.js → use-collections-DHkHvLr2.js} +1 -1
  185. package/dist/client/assets/{use-connection-Bja1yNlO.js → use-connection-DRK2N5z2.js} +1 -1
  186. package/dist/client/assets/{use-copy-BV3KPbyw.js → use-copy-BHgKL0On.js} +1 -1
  187. package/dist/client/assets/{use-create-virtual-mcp-Uhf3saYW.js → use-create-virtual-mcp-DaHNk0Ix.js} +1 -1
  188. package/dist/client/assets/{use-debounced-autosave-CrTBH0r8.js → use-debounced-autosave-CBxkub0J.js} +1 -1
  189. package/dist/client/assets/{use-debounced-value-DiZ6agyj.js → use-debounced-value-Bc5YBXDl.js} +1 -1
  190. package/dist/client/assets/{use-deco-credits-CrWRWg5d.js → use-deco-credits-CbUWlpHm.js} +1 -1
  191. package/dist/client/assets/{use-decopilot-events-By89abVN.js → use-decopilot-events-lkWlYZO4.js} +1 -1
  192. package/dist/client/assets/{use-delete-connection-rmpivgwt.js → use-delete-connection-Bz-L6aVH.js} +1 -1
  193. package/dist/client/assets/{use-deployment-admin-Dx9ZkF6I.js → use-deployment-admin-BmRZ12zi.js} +1 -1
  194. package/dist/client/assets/{use-file-configs-CKVr-c7q.js → use-file-configs-CRDwG08w.js} +1 -1
  195. package/dist/client/assets/{use-infinite-scroll-B1UJmYzB.js → use-infinite-scroll-C_OzT98l.js} +1 -1
  196. package/dist/client/assets/{use-join-requests-C6fMCeHB.js → use-join-requests-x3YhuWSS.js} +1 -1
  197. package/dist/client/assets/{use-mcp-auth-status-wzWeSyhc.js → use-mcp-auth-status-RbS9dxNI.js} +1 -1
  198. package/dist/client/assets/{use-mcp-client-CodYj4lk.js → use-mcp-client-BRDJsS2i.js} +1 -1
  199. package/dist/client/assets/{use-mcp-tools-DhezZmhh.js → use-mcp-tools-TLy2HClY.js} +1 -1
  200. package/dist/client/assets/{use-members-C5exRENp.js → use-members-T2DIW2PV.js} +1 -1
  201. package/dist/client/assets/{use-mobile-DmC5AwHK.js → use-mobile-COWtBi3l.js} +1 -1
  202. package/dist/client/assets/{use-navigate-to-agent-VNxYrStf.js → use-navigate-to-agent-DWAHU44q.js} +1 -1
  203. package/dist/client/assets/{use-org-auth-client-C-_6T-I_.js → use-org-auth-client-BICeQnTF.js} +1 -1
  204. package/dist/client/assets/{use-org-sso-D9Zrv9Ex.js → use-org-sso-Bd_0B726.js} +1 -1
  205. package/dist/client/assets/{use-organization-roles-kfhFanV-.js → use-organization-roles-DobbYYRj.js} +1 -1
  206. package/dist/client/assets/{use-organization-settings-C02fN1Pg.js → use-organization-settings-BJBqMmWF.js} +1 -1
  207. package/dist/client/assets/{use-registry-app-CntYFu2c.js → use-registry-app-C_q3DUZv.js} +1 -1
  208. package/dist/client/assets/{use-registry-connections-CSTpfPSI.js → use-registry-connections-CmUf1QlB.js} +1 -1
  209. package/dist/client/assets/{use-secrets-59JvHtO0.js → use-secrets-O5sD2Bgz.js} +1 -1
  210. package/dist/client/assets/{use-status-sounds-CrVwkBda.js → use-status-sounds-B96xiiHa.js} +1 -1
  211. package/dist/client/assets/{use-view-mode-Ba0ZEqUw.js → use-view-mode-BJOrvC1j.js} +1 -1
  212. package/dist/client/assets/{use-virtual-mcp-Bs6Z3XqB.js → use-virtual-mcp-63tB8KYL.js} +1 -1
  213. package/dist/client/assets/useInfiniteQuery-BSKFC7YM.js +1 -0
  214. package/dist/client/assets/{useRouterState-BStHehOf.js → useRouterState-BNyrcIx8.js} +1 -1
  215. package/dist/client/assets/useSuspenseInfiniteQuery-Cwnl9Xjp.js +1 -0
  216. package/dist/client/assets/{users-DXYde7XY.js → users-DWHrGlvz.js} +1 -1
  217. package/dist/client/assets/{variant-calendar-BlhvVxku.js → variant-calendar-BVX3kYfI.js} +1 -1
  218. package/dist/client/assets/{view-mode-toggle-Behabpts.js → view-mode-toggle-DBojFra_.js} +1 -1
  219. package/dist/client/index.html +1 -1
  220. package/dist/server/cli.js +5 -5
  221. package/dist/server/server.js +5 -5
  222. package/package.json +1 -1
  223. package/dist/client/assets/page-seo-sheet-DG0rFMaK.js +0 -1
  224. package/dist/client/assets/project-app-view-C5gaZj3T.js +0 -1
  225. package/dist/client/assets/record-editor-DvEIA6tV.js +0 -1
  226. package/dist/client/assets/redirect-editor-BplQQqRM.js +0 -1
  227. package/dist/client/assets/registry-Bq_80-6l.js +0 -2
  228. package/dist/client/assets/select-model-Bj5d_bo2.js +0 -4
  229. package/dist/client/assets/store-registry-Q6zoLWY_.js +0 -2
  230. package/dist/client/assets/useInfiniteQuery-GqUtQwTk.js +0 -1
  231. package/dist/client/assets/useSuspenseInfiniteQuery-oEtZEsYD.js +0 -1
@@ -1,4 +1,4 @@
1
- import{bx as zl,j as q,aM as lt,bM as zn,r as Ve,F as b0,l as Gb,c as Ke,b as E0,e as T0,B as $b}from"./index-CxWNtx9x.js";import{i as zb}from"./ChevronUp-Y_qcNB-R.js";import{a as jb}from"./Copy01-tOHQDVdb.js";import{e as S0,g as y0,f as A0,a as _0}from"./dialog-BxyVzjQ3.js";import{n as I0}from"./Globe01-BptLpR6D.js";import{k as k0,n as R0}from"./ZoomOut-B5XPtpBa.js";import{u as N0}from"./use-mobile-DmC5AwHK.js";import{h as C0}from"./tab-id-BijBBRwE.js";function jl(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Nt=jl();function Vb(e){Nt=e}var ln={exec:()=>null};function le(e,t=""){let n=typeof e=="string"?e:e.source;const r={replace:(a,i)=>{let o=typeof i=="string"?i:i.source;return o=o.replace(xe.caret,"$1"),n=n.replace(a,o),r},getRegex:()=>new RegExp(n,t)};return r}var xe={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},v0=/^(?:[ \t]*(?:\n|$))+/,w0=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,x0=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,_n=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,O0=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Vl=/(?:[*+-]|\d{1,9}[.)])/,Yb=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Wb=le(Yb).replace(/bull/g,Vl).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),L0=le(Yb).replace(/bull/g,Vl).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Yl=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,D0=/^[^\n]+/,Wl=/(?!\s*\])(?:\\.|[^\[\]\\])+/,M0=le(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Wl).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),P0=le(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Vl).getRegex(),er="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Kl=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,F0=le("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Kl).replace("tag",er).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Kb=le(Yl).replace("hr",_n).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",er).getRegex(),B0=le(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Kb).getRegex(),Xl={blockquote:B0,code:w0,def:M0,fences:x0,heading:O0,hr:_n,html:F0,lheading:Wb,list:P0,newline:v0,paragraph:Kb,table:ln,text:D0},Mc=le("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",_n).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",er).getRegex(),U0={...Xl,lheading:L0,table:Mc,paragraph:le(Yl).replace("hr",_n).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Mc).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",er).getRegex()},H0={...Xl,html:le(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Kl).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ln,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:le(Yl).replace("hr",_n).replace("heading",` *#{1,6} *[^
1
+ import{bx as zl,j as q,aM as lt,bM as zn,r as Ve,F as b0,l as Gb,c as Ke,b as E0,e as T0,B as $b}from"./index-CAIYhjul.js";import{i as zb}from"./ChevronUp-B2kc02W-.js";import{a as jb}from"./Copy01-BLPcoB-x.js";import{e as S0,g as y0,f as A0,a as _0}from"./dialog-BFqbrhnG.js";import{n as I0}from"./Globe01-D8U_-ef0.js";import{k as k0,n as R0}from"./ZoomOut-B7mxhvah.js";import{u as N0}from"./use-mobile-COWtBi3l.js";import{h as C0}from"./tab-id-BijBBRwE.js";function jl(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Nt=jl();function Vb(e){Nt=e}var ln={exec:()=>null};function le(e,t=""){let n=typeof e=="string"?e:e.source;const r={replace:(a,i)=>{let o=typeof i=="string"?i:i.source;return o=o.replace(xe.caret,"$1"),n=n.replace(a,o),r},getRegex:()=>new RegExp(n,t)};return r}var xe={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},v0=/^(?:[ \t]*(?:\n|$))+/,w0=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,x0=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,_n=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,O0=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Vl=/(?:[*+-]|\d{1,9}[.)])/,Yb=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Wb=le(Yb).replace(/bull/g,Vl).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),L0=le(Yb).replace(/bull/g,Vl).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Yl=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,D0=/^[^\n]+/,Wl=/(?!\s*\])(?:\\.|[^\[\]\\])+/,M0=le(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Wl).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),P0=le(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Vl).getRegex(),er="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Kl=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,F0=le("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Kl).replace("tag",er).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Kb=le(Yl).replace("hr",_n).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",er).getRegex(),B0=le(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Kb).getRegex(),Xl={blockquote:B0,code:w0,def:M0,fences:x0,heading:O0,hr:_n,html:F0,lheading:Wb,list:P0,newline:v0,paragraph:Kb,table:ln,text:D0},Mc=le("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",_n).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",er).getRegex(),U0={...Xl,lheading:L0,table:Mc,paragraph:le(Yl).replace("hr",_n).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Mc).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",er).getRegex()},H0={...Xl,html:le(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Kl).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ln,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:le(Yl).replace("hr",_n).replace("heading",` *#{1,6} *[^
2
2
  ]`).replace("lheading",Wb).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},q0=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,G0=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Xb=/^( {2,}|\\)\n(?!\s*$)/,$0=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,tr=/[\p{P}\p{S}]/u,Zl=/[\s\p{P}\p{S}]/u,Zb=/[^\s\p{P}\p{S}]/u,z0=le(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Zl).getRegex(),Qb=/(?!~)[\p{P}\p{S}]/u,j0=/(?!~)[\s\p{P}\p{S}]/u,V0=/(?:[^\s\p{P}\p{S}]|~)/u,Y0=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Jb=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,W0=le(Jb,"u").replace(/punct/g,tr).getRegex(),K0=le(Jb,"u").replace(/punct/g,Qb).getRegex(),eE="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",X0=le(eE,"gu").replace(/notPunctSpace/g,Zb).replace(/punctSpace/g,Zl).replace(/punct/g,tr).getRegex(),Z0=le(eE,"gu").replace(/notPunctSpace/g,V0).replace(/punctSpace/g,j0).replace(/punct/g,Qb).getRegex(),Q0=le("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Zb).replace(/punctSpace/g,Zl).replace(/punct/g,tr).getRegex(),J0=le(/\\(punct)/,"gu").replace(/punct/g,tr).getRegex(),eS=le(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),tS=le(Kl).replace("(?:-->|$)","-->").getRegex(),nS=le("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",tS).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),jn=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,rS=le(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",jn).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),tE=le(/^!?\[(label)\]\[(ref)\]/).replace("label",jn).replace("ref",Wl).getRegex(),nE=le(/^!?\[(ref)\](?:\[\])?/).replace("ref",Wl).getRegex(),aS=le("reflink|nolink(?!\\()","g").replace("reflink",tE).replace("nolink",nE).getRegex(),Ql={_backpedal:ln,anyPunctuation:J0,autolink:eS,blockSkip:Y0,br:Xb,code:G0,del:ln,emStrongLDelim:W0,emStrongRDelimAst:X0,emStrongRDelimUnd:Q0,escape:q0,link:rS,nolink:nE,punctuation:z0,reflink:tE,reflinkSearch:aS,tag:nS,text:$0,url:ln},iS={...Ql,link:le(/^!?\[(label)\]\((.*?)\)/).replace("label",jn).getRegex(),reflink:le(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",jn).getRegex()},_l={...Ql,emStrongRDelimAst:Z0,emStrongLDelim:K0,url:le(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},oS={..._l,br:le(Xb).replace("{2,}","*").getRegex(),text:le(_l.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},xn={normal:Xl,gfm:U0,pedantic:H0},Jt={normal:Ql,gfm:_l,breaks:oS,pedantic:iS},sS={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Pc=e=>sS[e];function Je(e,t){if(t){if(xe.escapeTest.test(e))return e.replace(xe.escapeReplace,Pc)}else if(xe.escapeTestNoEncode.test(e))return e.replace(xe.escapeReplaceNoEncode,Pc);return e}function Fc(e){try{e=encodeURI(e).replace(xe.percentDecode,"%")}catch{return null}return e}function Bc(e,t){const n=e.replace(xe.findPipe,(i,o,s)=>{let u=!1,l=o;for(;--l>=0&&s[l]==="\\";)u=!u;return u?"|":" |"}),r=n.split(xe.splitPipe);let a=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;a<r.length;a++)r[a]=r[a].trim().replace(xe.slashPipe,"|");return r}function en(e,t,n){const r=e.length;if(r===0)return"";let a=0;for(;a<r&&e.charAt(r-a-1)===t;)a++;return e.slice(0,r-a)}function uS(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function Uc(e,t,n,r,a){const i=t.href,o=t.title||null,s=e[1].replace(a.other.outputLinkReplace,"$1");r.state.inLink=!0;const u={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:i,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,u}function lS(e,t,n){const r=e.match(n.other.indentCodeCompensation);if(r===null)return t;const a=r[1];return t.split(`
3
3
  `).map(i=>{const o=i.match(n.other.beginningSpace);if(o===null)return i;const[s]=o;return s.length>=a.length?i.slice(a.length):i}).join(`
4
4
  `)}var Vn=class{options;rules;lexer;constructor(e){this.options=e||Nt}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:en(n,`
@@ -1 +1 @@
1
- import{c as a,e as o,j as i,N as l}from"./index-CxWNtx9x.js";function m(){const e=a.c(3);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const{org:r}=o(t);let s;return e[1]!==r?(s=i.jsx(l,{to:"/$org/files",params:{org:r},replace:!0}),e[1]=r,e[2]=s):s=e[2],s}export{m as default};
1
+ import{c as a,e as o,j as i,N as l}from"./index-CAIYhjul.js";function m(){const e=a.c(3);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const{org:r}=o(t);let s;return e[1]!==r?(s=i.jsx(l,{to:"/$org/files",params:{org:r},replace:!0}),e[1]=r,e[2]=s):s=e[2],s}export{m as default};
@@ -1 +1 @@
1
- import{dC as C,c as d,j as c,ah as j,r as f,l as p,bd as b,dD as h,dE as v}from"./index-CxWNtx9x.js";import{L as N}from"./label-JPT2W8Pg.js";const E=C,g=f.createContext({}),M=t=>{const e=d.c(9);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;e[2]!==s.name?(o={name:s.name},e[2]=s.name,e[3]=o):o=e[3];let n;e[4]!==s?(n=c.jsx(j,{...s}),e[4]=s,e[5]=n):n=e[5];let r;return e[6]!==o||e[7]!==n?(r=c.jsx(g.Provider,{value:o,children:n}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r},x=()=>{const t=d.c(13),e=f.useContext(g),s=f.useContext($),{getFieldState:o}=h();let n;t[0]!==e.name?(n={name:e.name},t[0]=e.name,t[1]=n):n=t[1];const r=v(n);let a;t[2]!==e.name||t[3]!==r||t[4]!==o?(a=o(e.name,r),t[2]=e.name,t[3]=r,t[4]=o,t[5]=a):a=t[5];const l=a;if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=s,m=`${i}-form-item`,F=`${i}-form-item-description`,I=`${i}-form-item-message`;let u;return t[6]!==e.name||t[7]!==l||t[8]!==i||t[9]!==m||t[10]!==F||t[11]!==I?(u={id:i,name:e.name,formItemId:m,formDescriptionId:F,formMessageId:I,...l},t[6]=e.name,t[7]=l,t[8]=i,t[9]=m,t[10]=F,t[11]=I,t[12]=u):u=t[12],u},$=f.createContext({});function w(t){const e=d.c(13);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const n=f.useId();let r;e[3]!==n?(r={id:n},e[3]=n,e[4]=r):r=e[4];let a;e[5]!==s?(a=p("grid gap-2",s),e[5]=s,e[6]=a):a=e[6];let l;e[7]!==o||e[8]!==a?(l=c.jsx("div",{"data-slot":"form-item",className:a,...o}),e[7]=o,e[8]=a,e[9]=l):l=e[9];let i;return e[10]!==r||e[11]!==l?(i=c.jsx($.Provider,{value:r,children:l}),e[10]=r,e[11]=l,e[12]=i):i=e[12],i}function L(t){const e=d.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formItemId:r}=x(),a=!!n;let l;e[3]!==s?(l=p("text-foreground data-[error=true]:text-destructive",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==r||e[6]!==o||e[7]!==a||e[8]!==l?(i=c.jsx(N,{"data-slot":"form-label","data-error":a,className:l,htmlFor:r,...o}),e[5]=r,e[6]=o,e[7]=a,e[8]=l,e[9]=i):i=e[9],i}function P(t){const e=d.c(7);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];const{error:o,formItemId:n,formDescriptionId:r,formMessageId:a}=x(),l=o?`${r} ${a}`:`${r}`,i=!!o;let m;return e[2]!==n||e[3]!==s||e[4]!==l||e[5]!==i?(m=c.jsx(b,{"data-slot":"form-control",id:n,"aria-describedby":l,"aria-invalid":i,...s}),e[2]=n,e[3]=s,e[4]=l,e[5]=i,e[6]=m):m=e[6],m}function y(t){const e=d.c(9);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{formDescriptionId:n}=x();let r;e[3]!==s?(r=p("text-muted-foreground text-sm",s),e[3]=s,e[4]=r):r=e[4];let a;return e[5]!==n||e[6]!==o||e[7]!==r?(a=c.jsx("p",{"data-slot":"form-description",id:n,className:r,...o}),e[5]=n,e[6]=o,e[7]=r,e[8]=a):a=e[8],a}function R(t){const e=d.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formMessageId:r}=x(),a=n?String(n?.message??""):o.children;if(!a)return null;let l;e[3]!==s?(l=p("text-destructive text-sm",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==a||e[6]!==r||e[7]!==o||e[8]!==l?(i=c.jsx("p",{"data-slot":"form-message",id:r,className:l,...o,children:a}),e[5]=a,e[6]=r,e[7]=o,e[8]=l,e[9]=i):i=e[9],i}export{M as F,E as a,w as b,L as c,P as d,y as e,R as f};
1
+ import{dC as C,c as d,j as c,ah as j,r as f,l as p,bd as b,dD as h,dE as v}from"./index-CAIYhjul.js";import{L as N}from"./label-DaAsoL9V.js";const E=C,g=f.createContext({}),M=t=>{const e=d.c(9);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;e[2]!==s.name?(o={name:s.name},e[2]=s.name,e[3]=o):o=e[3];let n;e[4]!==s?(n=c.jsx(j,{...s}),e[4]=s,e[5]=n):n=e[5];let r;return e[6]!==o||e[7]!==n?(r=c.jsx(g.Provider,{value:o,children:n}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r},x=()=>{const t=d.c(13),e=f.useContext(g),s=f.useContext($),{getFieldState:o}=h();let n;t[0]!==e.name?(n={name:e.name},t[0]=e.name,t[1]=n):n=t[1];const r=v(n);let a;t[2]!==e.name||t[3]!==r||t[4]!==o?(a=o(e.name,r),t[2]=e.name,t[3]=r,t[4]=o,t[5]=a):a=t[5];const l=a;if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=s,m=`${i}-form-item`,F=`${i}-form-item-description`,I=`${i}-form-item-message`;let u;return t[6]!==e.name||t[7]!==l||t[8]!==i||t[9]!==m||t[10]!==F||t[11]!==I?(u={id:i,name:e.name,formItemId:m,formDescriptionId:F,formMessageId:I,...l},t[6]=e.name,t[7]=l,t[8]=i,t[9]=m,t[10]=F,t[11]=I,t[12]=u):u=t[12],u},$=f.createContext({});function w(t){const e=d.c(13);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const n=f.useId();let r;e[3]!==n?(r={id:n},e[3]=n,e[4]=r):r=e[4];let a;e[5]!==s?(a=p("grid gap-2",s),e[5]=s,e[6]=a):a=e[6];let l;e[7]!==o||e[8]!==a?(l=c.jsx("div",{"data-slot":"form-item",className:a,...o}),e[7]=o,e[8]=a,e[9]=l):l=e[9];let i;return e[10]!==r||e[11]!==l?(i=c.jsx($.Provider,{value:r,children:l}),e[10]=r,e[11]=l,e[12]=i):i=e[12],i}function L(t){const e=d.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formItemId:r}=x(),a=!!n;let l;e[3]!==s?(l=p("text-foreground data-[error=true]:text-destructive",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==r||e[6]!==o||e[7]!==a||e[8]!==l?(i=c.jsx(N,{"data-slot":"form-label","data-error":a,className:l,htmlFor:r,...o}),e[5]=r,e[6]=o,e[7]=a,e[8]=l,e[9]=i):i=e[9],i}function P(t){const e=d.c(7);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];const{error:o,formItemId:n,formDescriptionId:r,formMessageId:a}=x(),l=o?`${r} ${a}`:`${r}`,i=!!o;let m;return e[2]!==n||e[3]!==s||e[4]!==l||e[5]!==i?(m=c.jsx(b,{"data-slot":"form-control",id:n,"aria-describedby":l,"aria-invalid":i,...s}),e[2]=n,e[3]=s,e[4]=l,e[5]=i,e[6]=m):m=e[6],m}function y(t){const e=d.c(9);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{formDescriptionId:n}=x();let r;e[3]!==s?(r=p("text-muted-foreground text-sm",s),e[3]=s,e[4]=r):r=e[4];let a;return e[5]!==n||e[6]!==o||e[7]!==r?(a=c.jsx("p",{"data-slot":"form-description",id:n,className:r,...o}),e[5]=n,e[6]=o,e[7]=r,e[8]=a):a=e[8],a}function R(t){const e=d.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formMessageId:r}=x(),a=n?String(n?.message??""):o.children;if(!a)return null;let l;e[3]!==s?(l=p("text-destructive text-sm",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==a||e[6]!==r||e[7]!==o||e[8]!==l?(i=c.jsx("p",{"data-slot":"form-message",id:r,className:l,...o,children:a}),e[5]=a,e[6]=r,e[7]=o,e[8]=l,e[9]=i):i=e[9],i}export{M as F,E as a,w as b,L as c,P as d,y as e,R as f};
@@ -1 +1 @@
1
- import{b as K,C as B,n as M,M as Q,J as Z,d as V,p as T,t as w,K as L,j as n,ah as P,H,I as k,c as E,r as I,B as Y,D as q,s as J}from"./index-CxWNtx9x.js";import{P as N}from"./index-BXoUOnNS.js";import{u as W}from"./use-org-auth-client-C-_6T-I_.js";import{u as X}from"./use-debounced-autosave-CrTBH0r8.js";import{A as ee}from"./avatar-BxCDP7Ot.js";import{I as $}from"./input-C9EhK1Lu.js";import{S as G,a as U,b as A,c as te}from"./settings-section-C5ntTZ3s.js";import{D as ne}from"./domain-settings-BK0JpUz3.js";import{u as ae}from"./studio-tools-HHcBk3Yy.js";import{c as oe,b as se,d as ie,A as re,e as le,g as ce,a as ue,f as de}from"./alert-dialog-CwKyb2j-.js";import{R as me}from"./require-capability-Bspi0oGk.js";import"./sidebar-Du3GhEXu.js";import"./LayoutLeft-B9Jd6ymK.js";import"./use-mobile-DmC5AwHK.js";import"./X-BolYo4iB.js";import"./tooltip-CTQ3jqyw.js";import"./User01-uwH1s6Qn.js";import"./card-9tKE7GXF.js";import"./ArrowUpRight-DPt871Ex.js";import"./badge-CJKB36w7.js";import"./select-BjS6pi0R.js";import"./ChevronUp-Y_qcNB-R.js";import"./ChevronDown-ClEtq8UA.js";import"./use-capability-DzMeZG_B.js";import"./access-gate-CjWAQSdR.js";import"./capability-load-error-DB_oh7IY.js";const ge=new Set([".well-known","_admin","api","auth","cli","commerce-onboarding","dbos-queue-depth","health","hosted-run-pending","login","mcp","metrics","oauth","oauth-proxy","onboarding","org","report","reset-password"]);function fe(e){return typeof e=="string"&&ge.has(e.trim().toLowerCase())}const pe=H({name:k().min(1,"Name is required").max(255,"Name is too long"),slug:k().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens").refine(e=>!fe(e),"This organization URL is reserved by Studio"),logo:k().optional()});function he(e){const t=E.c(13),{value:v,onChange:h,name:s,disabled:d}=e,m=I.useRef(null);let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=()=>m.current?.click(),t[0]=l):l=t[0];const r=l;let c;t[1]!==h?(c=x=>{const j=x.target.files?.[0];if(!j)return;if(j.size>2097152){w.error("Image must be smaller than 2MB");return}const u=new FileReader;u.onerror=xe,u.onloadend=()=>{u.result&&h(u.result),m.current&&(m.current.value="")},u.readAsDataURL(j)},t[1]=h,t[2]=c):c=t[2];const a=c;let o;t[3]!==d||t[4]!==a?(o=n.jsx("input",{ref:m,type:"file",accept:"image/*",onChange:a,className:"hidden",disabled:d}),t[3]=d,t[4]=a,t[5]=o):o=t[5];const i=v||void 0,p=s??"?";let g;t[6]!==i||t[7]!==p?(g=n.jsx(ee,{url:i,fallback:p,shape:"square",size:"base"}),t[6]=i,t[7]=p,t[8]=g):g=t[8];let f;return t[9]!==d||t[10]!==o||t[11]!==g?(f=n.jsxs("button",{type:"button",onClick:r,disabled:d,className:"rounded-lg overflow-hidden hover:ring-2 hover:ring-border transition-all disabled:opacity-50","aria-label":"Upload organization logo",children:[o,g]}),t[9]=d,t[10]=o,t[11]=g,t[12]=f):f=t[12],f}function xe(){return w.error("Failed to read image")}function je(){const e=K(),{org:t}=B(),v=W(),h=M(),s=Q({resolver:Z(pe),values:{name:t.name??"",slug:t.slug??"",logo:t.logo??""}}),d=V({mutationFn:async a=>{const o={name:a.name,slug:a.slug};a.logo&&(o.logo=a.logo);const i=await v.organization.update({data:o});if(i?.error)throw new Error(i.error.message||"Failed to update organization");return i},onSuccess:(a,o)=>{T("organization_settings_updated",{organization_id:t.id,fields:Object.keys(o)}),h.invalidateQueries({queryKey:L.organizations()}),h.invalidateQueries({queryKey:L.activeOrganization(t.slug)}),w.success("Organization updated successfully"),a?.data?.slug&&a.data.slug!==t.slug&&e({to:"/$org/settings/general",params:{org:a.data.slug}})},onError:(a,o)=>{T("organization_settings_update_failed",{organization_id:t.id,fields:Object.keys(o),error:a instanceof Error?a.message:String(a)}),w.error(a instanceof Error?a.message:"Failed to update organization")}}),{schedule:m,flush:l}=X({save:async()=>{const a=s.control._formState.dirtyFields;if(Object.keys(a).length===0||!await s.trigger())return;const i=s.getValues(),p=s.control._defaultValues;s.reset(i,{keepValues:!0});try{await d.mutateAsync(i)}catch{s.reset(p,{keepValues:!0})}}}),r=s.formState.errors,c=typeof window<"u"?`${window.location.host}/`:"";return n.jsx(G,{children:n.jsxs(U,{children:[n.jsx(A,{title:"Logo",description:"Recommended size is 256x256px",action:n.jsx(he,{value:s.watch("logo"),onChange:a=>{s.setValue("logo",a??"",{shouldDirty:!0}),l()},name:s.watch("name")})}),n.jsx(A,{title:"Name",action:n.jsx(P,{control:s.control,name:"name",render:({field:a})=>n.jsx($,{id:"org-name",...a,onChange:o=>{a.onChange(o),m()},onBlur:()=>{a.onBlur(),l()},placeholder:"Organization name",className:"w-[280px]"})})}),n.jsx(A,{title:"URL",action:n.jsxs("div",{className:"flex items-center w-[280px] rounded-md border border-input bg-input/30 focus-within:ring-2 focus-within:ring-ring/50 overflow-hidden",children:[c&&n.jsx("span",{className:"pl-3 text-sm text-muted-foreground select-none",children:c}),n.jsx(P,{control:s.control,name:"slug",render:({field:a})=>n.jsx("input",{id:"org-slug",value:a.value??"",name:a.name,ref:a.ref,placeholder:"my-organization",className:"flex-1 min-w-0 bg-transparent px-2 py-1.5 text-sm text-foreground placeholder:text-muted-foreground/60 outline-none",onChange:o=>{const i=o.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");s.setValue("slug",i,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0}),m()},onBlur:()=>{a.onBlur(),l()}})})]})}),(r.name||r.slug||r.logo)&&n.jsxs("div",{className:"px-5 pb-3 flex flex-col gap-1",children:[r.name&&n.jsx("p",{className:"text-xs text-destructive",children:r.name.message}),r.slug&&n.jsx("p",{className:"text-xs text-destructive",children:r.slug.message}),r.logo&&n.jsx("p",{className:"text-xs text-destructive",children:r.logo.message})]})]})})}function ve(){const e=E.c(42),{org:t}=B(),[v,h]=I.useState(!1),[s,d]=I.useState(""),m=ae();let l;e[0]!==t.id||e[1]!==m?(l=async()=>{await m.call("ORGANIZATION_DELETE",{id:t.id})},e[0]=t.id,e[1]=m,e[2]=l):l=e[2];let r;e[3]!==t.id||e[4]!==t.slug?(r=()=>{T("organization_deleted",{organization_id:t.id}),localStorage.getItem(q.lastOrgSlug())===t.slug&&localStorage.removeItem(q.lastOrgSlug()),J(),w.success("Organization deleted"),window.location.href="/"},e[3]=t.id,e[4]=t.slug,e[5]=r):r=e[5];let c;e[6]!==l||e[7]!==r?(c={mutationFn:l,onSuccess:r,onError:be},e[6]=l,e[7]=r,e[8]=c):c=e[8];const a=V(c);let o;e[9]===Symbol.for("react.memo_cache_sentinel")?(o=()=>h(!0),e[9]=o):o=e[9];let i;e[10]!==a.isPending?(i=n.jsx(G,{title:"Danger Zone",description:"Irreversible actions that affect your entire organization.",children:n.jsx(U,{className:"border-destructive/40",children:n.jsx(A,{title:"Delete organization",description:"Permanently delete this organization and all of its data. This action cannot be undone.",action:n.jsx(Y,{variant:"destructive",size:"sm",onClick:o,disabled:a.isPending,children:"Delete"})})})}),e[10]=a.isPending,e[11]=i):i=e[11];let p;e[12]===Symbol.for("react.memo_cache_sentinel")?(p=O=>{h(O),O||d("")},e[12]=p):p=e[12];let g;e[13]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(oe,{children:"Delete Organization?"}),e[13]=g):g=e[13];let f;e[14]!==t.name?(f=n.jsxs("p",{children:["This will permanently delete all data associated with"," ",n.jsx("span",{className:"font-medium text-foreground",children:t.name}),". This action cannot be undone."]}),e[14]=t.name,e[15]=f):f=e[15];let x;e[16]!==t.name?(x=n.jsxs("p",{className:"mt-3 mb-1.5",children:["Type"," ",n.jsx("span",{className:"font-medium text-foreground",children:t.name})," ","to confirm:"]}),e[16]=t.name,e[17]=x):x=e[17];let j;e[18]===Symbol.for("react.memo_cache_sentinel")?(j=O=>d(O.target.value),e[18]=j):j=e[18];let u;e[19]!==s||e[20]!==t.name?(u=n.jsx($,{value:s,onChange:j,placeholder:t.name,autoFocus:!0}),e[19]=s,e[20]=t.name,e[21]=u):u=e[21];let b;e[22]!==u||e[23]!==f||e[24]!==x?(b=n.jsxs(se,{children:[g,n.jsx(ie,{asChild:!0,children:n.jsxs("div",{children:[f,x,u]})})]}),e[22]=u,e[23]=f,e[24]=x,e[25]=b):b=e[25];let _;e[26]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx(re,{children:"Cancel"}),e[26]=_):_=e[26];let y;e[27]!==a?(y=()=>a.mutate(),e[27]=a,e[28]=y):y=e[28];const R=s!==t.name||a.isPending,F=a.isPending?"Deleting…":"Delete organization";let S;e[29]!==y||e[30]!==R||e[31]!==F?(S=n.jsxs(le,{children:[_,n.jsx(ce,{onClick:y,disabled:R,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90 disabled:opacity-50",children:F})]}),e[29]=y,e[30]=R,e[31]=F,e[32]=S):S=e[32];let z;e[33]!==b||e[34]!==S?(z=n.jsxs(ue,{children:[b,S]}),e[33]=b,e[34]=S,e[35]=z):z=e[35];let C;e[36]!==v||e[37]!==z?(C=n.jsx(de,{open:v,onOpenChange:p,children:z}),e[36]=v,e[37]=z,e[38]=C):C=e[38];let D;return e[39]!==C||e[40]!==i?(D=n.jsxs(n.Fragment,{children:[i,C]}),e[39]=C,e[40]=i,e[41]=D):D=e[41],D}function be(e){w.error(e instanceof Error?e.message:"Failed to delete organization")}function ye(){const e=E.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(N,{children:n.jsx(N.Content,{children:n.jsx(N.Body,{children:n.jsxs(te,{children:[n.jsx(N.Title,{children:"Organization"}),n.jsx(je,{}),n.jsx(ne,{}),n.jsx(ve,{})]})})})}),e[0]=t):t=e[0],t}function Ze(){const e=E.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(me,{capability:"org:manage",area:"general settings",children:n.jsx(ye,{})}),e[0]=t):t=e[0],t}export{Ze as default};
1
+ import{b as K,C as B,n as M,M as Q,J as Z,d as V,p as T,t as w,K as L,j as n,ah as P,H,I as k,c as E,r as I,B as Y,D as q,s as J}from"./index-CAIYhjul.js";import{P as N}from"./index-CUgYJaPV.js";import{u as W}from"./use-org-auth-client-BICeQnTF.js";import{u as X}from"./use-debounced-autosave-CBxkub0J.js";import{A as ee}from"./avatar-CB-s6LW3.js";import{I as $}from"./input-Dzav8ivG.js";import{S as G,a as U,b as A,c as te}from"./settings-section-B1GgY2if.js";import{D as ne}from"./domain-settings-IW5nZczN.js";import{u as ae}from"./studio-tools-C0-5Z8k5.js";import{c as oe,b as se,d as ie,A as re,e as le,g as ce,a as ue,f as de}from"./alert-dialog-BNeEAttR.js";import{R as me}from"./require-capability-BYn5Rk3O.js";import"./sidebar-BjlDvhlo.js";import"./LayoutLeft-uipFY-Sc.js";import"./use-mobile-COWtBi3l.js";import"./X-CLk-1WTe.js";import"./tooltip-DBcnpVTx.js";import"./User01-s23e9wZl.js";import"./card-BJLhqcLf.js";import"./ArrowUpRight-Cpd1Kvoc.js";import"./badge-D2OV8wRl.js";import"./select-peZlJuYe.js";import"./ChevronUp-B2kc02W-.js";import"./ChevronDown-Chms7f47.js";import"./use-capability-CEtXiCRz.js";import"./access-gate-avJTtHpg.js";import"./capability-load-error-C8Uwu5_s.js";const ge=new Set([".well-known","_admin","api","auth","cli","commerce-onboarding","dbos-queue-depth","health","hosted-run-pending","login","mcp","metrics","oauth","oauth-proxy","onboarding","org","report","reset-password"]);function fe(e){return typeof e=="string"&&ge.has(e.trim().toLowerCase())}const pe=H({name:k().min(1,"Name is required").max(255,"Name is too long"),slug:k().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens").refine(e=>!fe(e),"This organization URL is reserved by Studio"),logo:k().optional()});function he(e){const t=E.c(13),{value:v,onChange:h,name:s,disabled:d}=e,m=I.useRef(null);let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=()=>m.current?.click(),t[0]=l):l=t[0];const r=l;let c;t[1]!==h?(c=x=>{const j=x.target.files?.[0];if(!j)return;if(j.size>2097152){w.error("Image must be smaller than 2MB");return}const u=new FileReader;u.onerror=xe,u.onloadend=()=>{u.result&&h(u.result),m.current&&(m.current.value="")},u.readAsDataURL(j)},t[1]=h,t[2]=c):c=t[2];const a=c;let o;t[3]!==d||t[4]!==a?(o=n.jsx("input",{ref:m,type:"file",accept:"image/*",onChange:a,className:"hidden",disabled:d}),t[3]=d,t[4]=a,t[5]=o):o=t[5];const i=v||void 0,p=s??"?";let g;t[6]!==i||t[7]!==p?(g=n.jsx(ee,{url:i,fallback:p,shape:"square",size:"base"}),t[6]=i,t[7]=p,t[8]=g):g=t[8];let f;return t[9]!==d||t[10]!==o||t[11]!==g?(f=n.jsxs("button",{type:"button",onClick:r,disabled:d,className:"rounded-lg overflow-hidden hover:ring-2 hover:ring-border transition-all disabled:opacity-50","aria-label":"Upload organization logo",children:[o,g]}),t[9]=d,t[10]=o,t[11]=g,t[12]=f):f=t[12],f}function xe(){return w.error("Failed to read image")}function je(){const e=K(),{org:t}=B(),v=W(),h=M(),s=Q({resolver:Z(pe),values:{name:t.name??"",slug:t.slug??"",logo:t.logo??""}}),d=V({mutationFn:async a=>{const o={name:a.name,slug:a.slug};a.logo&&(o.logo=a.logo);const i=await v.organization.update({data:o});if(i?.error)throw new Error(i.error.message||"Failed to update organization");return i},onSuccess:(a,o)=>{T("organization_settings_updated",{organization_id:t.id,fields:Object.keys(o)}),h.invalidateQueries({queryKey:L.organizations()}),h.invalidateQueries({queryKey:L.activeOrganization(t.slug)}),w.success("Organization updated successfully"),a?.data?.slug&&a.data.slug!==t.slug&&e({to:"/$org/settings/general",params:{org:a.data.slug}})},onError:(a,o)=>{T("organization_settings_update_failed",{organization_id:t.id,fields:Object.keys(o),error:a instanceof Error?a.message:String(a)}),w.error(a instanceof Error?a.message:"Failed to update organization")}}),{schedule:m,flush:l}=X({save:async()=>{const a=s.control._formState.dirtyFields;if(Object.keys(a).length===0||!await s.trigger())return;const i=s.getValues(),p=s.control._defaultValues;s.reset(i,{keepValues:!0});try{await d.mutateAsync(i)}catch{s.reset(p,{keepValues:!0})}}}),r=s.formState.errors,c=typeof window<"u"?`${window.location.host}/`:"";return n.jsx(G,{children:n.jsxs(U,{children:[n.jsx(A,{title:"Logo",description:"Recommended size is 256x256px",action:n.jsx(he,{value:s.watch("logo"),onChange:a=>{s.setValue("logo",a??"",{shouldDirty:!0}),l()},name:s.watch("name")})}),n.jsx(A,{title:"Name",action:n.jsx(P,{control:s.control,name:"name",render:({field:a})=>n.jsx($,{id:"org-name",...a,onChange:o=>{a.onChange(o),m()},onBlur:()=>{a.onBlur(),l()},placeholder:"Organization name",className:"w-[280px]"})})}),n.jsx(A,{title:"URL",action:n.jsxs("div",{className:"flex items-center w-[280px] rounded-md border border-input bg-input/30 focus-within:ring-2 focus-within:ring-ring/50 overflow-hidden",children:[c&&n.jsx("span",{className:"pl-3 text-sm text-muted-foreground select-none",children:c}),n.jsx(P,{control:s.control,name:"slug",render:({field:a})=>n.jsx("input",{id:"org-slug",value:a.value??"",name:a.name,ref:a.ref,placeholder:"my-organization",className:"flex-1 min-w-0 bg-transparent px-2 py-1.5 text-sm text-foreground placeholder:text-muted-foreground/60 outline-none",onChange:o=>{const i=o.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");s.setValue("slug",i,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0}),m()},onBlur:()=>{a.onBlur(),l()}})})]})}),(r.name||r.slug||r.logo)&&n.jsxs("div",{className:"px-5 pb-3 flex flex-col gap-1",children:[r.name&&n.jsx("p",{className:"text-xs text-destructive",children:r.name.message}),r.slug&&n.jsx("p",{className:"text-xs text-destructive",children:r.slug.message}),r.logo&&n.jsx("p",{className:"text-xs text-destructive",children:r.logo.message})]})]})})}function ve(){const e=E.c(42),{org:t}=B(),[v,h]=I.useState(!1),[s,d]=I.useState(""),m=ae();let l;e[0]!==t.id||e[1]!==m?(l=async()=>{await m.call("ORGANIZATION_DELETE",{id:t.id})},e[0]=t.id,e[1]=m,e[2]=l):l=e[2];let r;e[3]!==t.id||e[4]!==t.slug?(r=()=>{T("organization_deleted",{organization_id:t.id}),localStorage.getItem(q.lastOrgSlug())===t.slug&&localStorage.removeItem(q.lastOrgSlug()),J(),w.success("Organization deleted"),window.location.href="/"},e[3]=t.id,e[4]=t.slug,e[5]=r):r=e[5];let c;e[6]!==l||e[7]!==r?(c={mutationFn:l,onSuccess:r,onError:be},e[6]=l,e[7]=r,e[8]=c):c=e[8];const a=V(c);let o;e[9]===Symbol.for("react.memo_cache_sentinel")?(o=()=>h(!0),e[9]=o):o=e[9];let i;e[10]!==a.isPending?(i=n.jsx(G,{title:"Danger Zone",description:"Irreversible actions that affect your entire organization.",children:n.jsx(U,{className:"border-destructive/40",children:n.jsx(A,{title:"Delete organization",description:"Permanently delete this organization and all of its data. This action cannot be undone.",action:n.jsx(Y,{variant:"destructive",size:"sm",onClick:o,disabled:a.isPending,children:"Delete"})})})}),e[10]=a.isPending,e[11]=i):i=e[11];let p;e[12]===Symbol.for("react.memo_cache_sentinel")?(p=O=>{h(O),O||d("")},e[12]=p):p=e[12];let g;e[13]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(oe,{children:"Delete Organization?"}),e[13]=g):g=e[13];let f;e[14]!==t.name?(f=n.jsxs("p",{children:["This will permanently delete all data associated with"," ",n.jsx("span",{className:"font-medium text-foreground",children:t.name}),". This action cannot be undone."]}),e[14]=t.name,e[15]=f):f=e[15];let x;e[16]!==t.name?(x=n.jsxs("p",{className:"mt-3 mb-1.5",children:["Type"," ",n.jsx("span",{className:"font-medium text-foreground",children:t.name})," ","to confirm:"]}),e[16]=t.name,e[17]=x):x=e[17];let j;e[18]===Symbol.for("react.memo_cache_sentinel")?(j=O=>d(O.target.value),e[18]=j):j=e[18];let u;e[19]!==s||e[20]!==t.name?(u=n.jsx($,{value:s,onChange:j,placeholder:t.name,autoFocus:!0}),e[19]=s,e[20]=t.name,e[21]=u):u=e[21];let b;e[22]!==u||e[23]!==f||e[24]!==x?(b=n.jsxs(se,{children:[g,n.jsx(ie,{asChild:!0,children:n.jsxs("div",{children:[f,x,u]})})]}),e[22]=u,e[23]=f,e[24]=x,e[25]=b):b=e[25];let _;e[26]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx(re,{children:"Cancel"}),e[26]=_):_=e[26];let y;e[27]!==a?(y=()=>a.mutate(),e[27]=a,e[28]=y):y=e[28];const R=s!==t.name||a.isPending,F=a.isPending?"Deleting…":"Delete organization";let S;e[29]!==y||e[30]!==R||e[31]!==F?(S=n.jsxs(le,{children:[_,n.jsx(ce,{onClick:y,disabled:R,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90 disabled:opacity-50",children:F})]}),e[29]=y,e[30]=R,e[31]=F,e[32]=S):S=e[32];let z;e[33]!==b||e[34]!==S?(z=n.jsxs(ue,{children:[b,S]}),e[33]=b,e[34]=S,e[35]=z):z=e[35];let C;e[36]!==v||e[37]!==z?(C=n.jsx(de,{open:v,onOpenChange:p,children:z}),e[36]=v,e[37]=z,e[38]=C):C=e[38];let D;return e[39]!==C||e[40]!==i?(D=n.jsxs(n.Fragment,{children:[i,C]}),e[39]=C,e[40]=i,e[41]=D):D=e[41],D}function be(e){w.error(e instanceof Error?e.message:"Failed to delete organization")}function ye(){const e=E.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(N,{children:n.jsx(N.Content,{children:n.jsx(N.Body,{children:n.jsxs(te,{children:[n.jsx(N.Title,{children:"Organization"}),n.jsx(je,{}),n.jsx(ne,{}),n.jsx(ve,{})]})})})}),e[0]=t):t=e[0],t}function Ze(){const e=E.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(me,{capability:"org:manage",area:"general settings",children:n.jsx(ye,{})}),e[0]=t):t=e[0],t}export{Ze as default};
@@ -1 +1 @@
1
- import{C as B,a as Y,n as $,r as T,ac as H,c as R,j as t,i as z,d as Q,t as O,dF as W,K as G,m as X,B as Z,l as F,v as ee,w as te}from"./index-CxWNtx9x.js";import{D as ne,a as se,d as oe,e as ie}from"./dialog-BxyVzjQ3.js";import{C as re}from"./collection-search-kUG_oKbb.js";import{u as le}from"./use-debounced-value-DiZ6agyj.js";import{b as M,u as ae}from"./use-connection-Bja1yNlO.js";import{u as U,S as V}from"./use-mcp-client-CodYj4lk.js";import{a as K}from"./authenticate-and-persist-oauth-Bt8Gm2rH.js";import{b as J}from"./Settings02-CVFCJqEn.js";import{L as ce}from"./agent-icon-BGgFt2fk.js";import{u as ue,G as P}from"./use-registry-app-CntYFu2c.js";import{e as de}from"./extract-connection-data-C2_0wEKz.js";import{c as me}from"./use-navigate-to-agent-VNxYrStf.js";import{p as q,f as fe}from"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import{g as xe}from"./github-repo-scope-DjMZbiKa.js";const ge="deco/mcp-github";function he(N){const{org:e}=B(),{data:i}=Y.useSession(),f=M(),v=$(),[g,s]=T.useState("idle"),[h,x]=T.useState(null),[p,C]=T.useState(null),{data:b,isLoading:l}=ue(ge,{enabled:N.enabled}),o=T.useRef(!1);N.enabled&&b&&!l&&!o.current&&i?.user?.id&&g==="idle"&&(o.current=!0,a());async function a(){if(!(!b||!i?.user?.id||!e))try{s("installing"),x(null);const r=de(b,e.id,i.user.id,{remoteIndex:0});if(!r.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:y}=await f.create.mutateAsync(r);s("authenticating");const d=await K({connectionId:y,orgId:e.id,orgSlug:e.slug,persistFallback:n=>f.update.mutateAsync({id:y,data:{connection_token:n}}).then(()=>{})});if(d.ran&&!d.ok){try{await f.delete.mutateAsync(y)}catch{}throw new Error(d.error&&d.error!=="no token received"?d.error:"No token received from GitHub")}H(v,e.id),C(r),s("ready")}catch(r){x(r instanceof Error?r.message:String(r)),s("error")}}function c(){s("idle"),x(null),C(null),o.current=!1}return N.enabled&&l&&g==="idle"?{status:"installing",error:null,connection:null,retry:c}:{status:g,error:h,connection:p,retry:c}}function Oe(N){const e=R.c(22),{open:i,onOpenChange:f,title:v,onImportComplete:g,mode:s}=N,h=s===void 0?"agent":s,x=v??(h==="connection"?"Add repo":"Import from GitHub"),[p,C]=T.useState(null);let b;e[0]!==x?(b=t.jsx(ne,{className:"sr-only",children:t.jsx(se,{children:x})}),e[0]=x,e[1]=b):b=e[1];let l;e[2]!==x||e[3]!==p?(l=t.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3 shrink-0",children:p?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>C(null),className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors shrink-0","aria-label":"Back to accounts",children:t.jsx(J,{size:16})}),t.jsx("img",{src:p.avatarUrl,alt:p.login,className:"size-5 rounded-full ring-1 ring-border shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:p.login})]}):t.jsxs(t.Fragment,{children:[t.jsx(P,{className:"size-4 text-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:x})]})}),e[2]=x,e[3]=p,e[4]=l):l=e[4];let o;e[5]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(z,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=o):o=e[5];let a;e[6]!==f?(a=()=>f(!1),e[6]=f,e[7]=a):a=e[7];let c;e[8]!==h||e[9]!==g||e[10]!==i||e[11]!==p||e[12]!==a?(c=t.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-w-0",children:t.jsx(T.Suspense,{fallback:o,children:t.jsx(pe,{open:i,onComplete:a,selectedInstallation:p,onSelectInstallation:C,onImportComplete:g,mode:h})})}),e[8]=h,e[9]=g,e[10]=i,e[11]=p,e[12]=a,e[13]=c):c=e[13];let r;e[14]!==b||e[15]!==l||e[16]!==c?(r=t.jsxs(oe,{className:"sm:max-w-[560px] h-[85svh] sm:h-[520px] p-0 gap-0 overflow-hidden flex flex-col",children:[b,l,c]}),e[14]=b,e[15]=l,e[16]=c,e[17]=r):r=e[17];let u;return e[18]!==f||e[19]!==i||e[20]!==r?(u=t.jsx(ie,{open:i,onOpenChange:f,children:r}),e[18]=f,e[19]=i,e[20]=r,e[21]=u):u=e[21],u}function pe({open:N,onComplete:e,selectedInstallation:i,onSelectInstallation:f,onImportComplete:v,mode:g="agent"}){const{org:s}=B(),h=$(),x=me(),[p,C]=T.useState(null),b=ae({slug:"mcp-github"}),l=xe(b),o=he({enabled:N&&l.length===0}),a=l.length===1?l[0]??null:p,c=U({connectionId:a?.id??"",orgId:s.id,orgSlug:s.slug}),r=U({connectionId:V,orgId:s.id,orgSlug:s.slug}),u=async(n,j)=>{try{const k=await c.callTool({name:"get_file_contents",arguments:{owner:n.owner,repo:n.name,path:j}});if(k.isError)return null;const I=k.content?.find(m=>m.type==="resource")?.resource?.text;if(!I)return null;try{const m=JSON.parse(I);return typeof m=="string"?m:JSON.stringify(m)}catch{return I}}catch{return null}},y=(n,j)=>{Promise.all([u(j,"AGENTS.md"),u(j,"CLAUDE.md")]).then(async([S,k])=>{const w=S??k??null;w&&(await r.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:n,data:{metadata:{instructions:w}}}}),H(h,s.id))}).catch(S=>{console.error("GitHub instructions fetch failed:",S)})},d=Q({mutationFn:async n=>{if(!a||!i)throw new Error("No GitHub connection or installation");const j=i.installationId;if(g==="connection"){const{childConnectionId:w}=await q({orgSlug:s.slug,sourceConnection:a,installationId:j,owner:n.owner,repo:n.name,githubCallTool:I=>c.callTool(I),selfCallTool:I=>r.callTool(I),orgShared:!0});return{virtualMcpId:null,repo:n,connectionId:w,item:null}}const{childConnectionId:S}=await q({orgSlug:s.slug,sourceConnection:a,installationId:j,owner:n.owner,repo:n.name,githubCallTool:w=>c.callTool(w),selfCallTool:w=>r.callTool(w)});let k=null;try{const w=await r.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:n.name,description:n.description||"Imported from GitHub",pinned:!1,icon:null,metadata:{githubRepo:{owner:n.owner,name:n.name,url:n.url,installationId:j,connectionId:S},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:S}]}}}),I=w.structuredContent??w,m=I.item?.id;if(!I.item||!m)throw new Error("Failed to create the imported agent");return k=m,{virtualMcpId:m,repo:n,connectionId:S,item:I.item}}catch(w){throw k&&await r.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:k}}).catch(()=>{}),await r.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:S,force:!0}}).catch(()=>{}),w}},onSuccess:({virtualMcpId:n,repo:j,connectionId:S,item:k})=>{if(g==="connection"||!n||!k){H(h,s.id),W(h,s.id),O.success(`Added ${j.name}`),e();return}if(h.setQueryData(G.collectionItem(r,s.id,"","VIRTUAL_MCP",n),{item:k}),H(h,s.id),y(n,j),v){v({virtualMcpId:n,repo:j,connectionId:S});return}O.success(`Imported ${j.name} from GitHub`),e(),localStorage.setItem("mesh:sidebar-open",JSON.stringify(!1)),x(n)},onError:n=>{O.error("Failed to import repo: "+(n instanceof Error?n.message:"Unknown error"))}});return o.status==="installing"||o.status==="authenticating"?t.jsx(D,{status:o.status,error:null,retry:o.retry}):o.status==="error"?t.jsx(D,{status:"error",error:o.error,retry:o.retry}):l.length===0&&o.status==="idle"?t.jsx(D,{status:"installing",error:null,retry:o.retry}):l.length>1&&!a?t.jsxs("div",{className:"flex flex-col py-2",children:[t.jsx("div",{className:"px-4 py-2",children:t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Select a connection"})}),l.map(n=>t.jsxs("button",{type:"button",onClick:()=>C(n),className:"flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left",children:[n.icon?t.jsx("img",{src:n.icon,alt:n.title,className:"size-7 rounded-full shrink-0"}):t.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:t.jsx(P,{className:"size-3.5 text-muted-foreground"})}),t.jsx("span",{className:"text-sm font-medium",children:n.title})]},n.id))]}):a?i?t.jsx(Ne,{connectionId:a.id,orgId:s.id,orgSlug:s.slug,installation:i,onSelectRepo:n=>d.mutate(n),isSaving:d.isPending}):t.jsx(be,{connectionId:a.id,orgId:s.id,orgSlug:s.slug,onSelect:f,showBackButton:l.length>1,onBack:()=>C(null)}):null}function be(N){const e=R.c(47),{connectionId:i,orgId:f,orgSlug:v,onSelect:g,showBackButton:s,onBack:h}=N;let x;e[0]!==f||e[1]!==v?(x={connectionId:V,orgId:f,orgSlug:v},e[0]=f,e[1]=v,e[2]=x):x=e[2];const p=U(x),C=$(),b=M();let l;e[3]!==i||e[4]!==f?(l=G.githubUserOrgs(f,i),e[3]=i,e[4]=f,e[5]=l):l=e[5];let o;e[6]!==i||e[7]!==p?(o=()=>fe(m=>p.callTool(m),i),e[6]=i,e[7]=p,e[8]=o):o=e[8];let a;e[9]!==l||e[10]!==o?(a={queryKey:l,queryFn:o},e[9]=l,e[10]=o,e[11]=a):a=e[11];const c=X(a);let r;e[12]!==b||e[13]!==i||e[14]!==c||e[15]!==f||e[16]!==v||e[17]!==C?(r={mutationFn:async()=>{const m=await K({connectionId:i,orgId:f,orgSlug:v,persistFallback:E=>b.update.mutateAsync({id:i,data:{connection_token:E}}).then(je)});if(m.ran&&!m.ok)throw new Error(m.error??"no token received");const _=new URL(`/api/${v}/mcp/${i}`,window.location.origin);await C.invalidateQueries({queryKey:G.isMCPAuthenticated(_.href,null)}),await C.invalidateQueries({queryKey:G.mcpClientPrefix()}),await c.refetch()},onError:ye},e[12]=b,e[13]=i,e[14]=c,e[15]=f,e[16]=v,e[17]=C,e[18]=r):r=e[18];const u=Q(r);if(c.isLoading){let m;return e[19]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(z,{size:18,className:"animate-spin text-muted-foreground"})}),e[19]=m):m=e[19],m}if(c.isError){let m,_;e[20]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("p",{className:"text-sm text-destructive",children:"Failed to load GitHub accounts"}),_=t.jsx("p",{className:"text-xs text-muted-foreground max-w-[280px] leading-relaxed",children:"Your GitHub connection may have expired. Reconnect to restore access."}),e[20]=m,e[21]=_):(m=e[20],_=e[21]);let E;e[22]!==u?(E=()=>u.mutate(),e[22]=u,e[23]=E):E=e[23];let A;e[24]!==u.isPending?(A=u.isPending?t.jsx(z,{size:14,className:"animate-spin"}):t.jsx(P,{className:"size-3.5"}),e[24]=u.isPending,e[25]=A):A=e[25];let L;return e[26]!==u.isPending||e[27]!==E||e[28]!==A?(L=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-6 text-center",children:[m,_,t.jsxs(Z,{type:"button",variant:"outline",size:"sm",onClick:E,disabled:u.isPending,children:[A,"Reconnect GitHub"]})]}),e[26]=u.isPending,e[27]=E,e[28]=A,e[29]=L):L=e[29],L}const y=c.data;if(!y)return null;let d;e[30]!==h||e[31]!==s?(d=s&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:h,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(J,{size:12}),"Change connection"]})}),e[30]=h,e[31]=s,e[32]=d):d=e[32];let n;if(e[33]!==y.installations||e[34]!==g){let m;e[36]!==g?(m=_=>t.jsxs("button",{type:"button",onClick:()=>g(_),className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left group",children:[t.jsx("img",{src:_.avatarUrl,alt:_.login,className:"size-7 rounded-full shrink-0 ring-1 ring-border"}),t.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[t.jsx("span",{className:"text-sm font-medium leading-none",children:_.login}),_.type==="User"&&t.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"Personal account"})]}),t.jsx("span",{className:"text-xs text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:"Select →"})]},_.installationId),e[36]=g,e[37]=m):m=e[37],n=y.installations.map(m),e[33]=y.installations,e[34]=g,e[35]=n}else n=e[35];let j;e[38]!==n?(j=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden [scrollbar-gutter:stable]",children:n}),e[38]=n,e[39]=j):j=e[39];const S=y.appSlug?`https://github.com/apps/${y.appSlug}/installations/new`:"https://github.com/settings/installations";let k;e[40]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx("span",{className:"underline underline-offset-2",children:"Install the GitHub App"}),e[40]=k):k=e[40];let w;e[41]!==S?(w=t.jsx("div",{className:"px-4 py-3 border-t border-border shrink-0",children:t.jsxs("a",{href:S,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:["Account not listed?"," ",k]})}),e[41]=S,e[42]=w):w=e[42];let I;return e[43]!==w||e[44]!==d||e[45]!==j?(I=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[d,j,w]}),e[43]=w,e[44]=d,e[45]=j,e[46]=I):I=e[46],I}function ye(N){O.error("Failed to reconnect GitHub: "+(N instanceof Error?N.message:"Unknown error"))}function je(){}function Ne(N){const e=R.c(20),{connectionId:i,orgId:f,orgSlug:v,installation:g,onSelectRepo:s,isSaving:h}=N,[x,p]=T.useState(""),C=le(x,300),b=T.useDeferredValue(C),l=x!==b;let o;e[0]!==l||e[1]!==x?(o=t.jsx(re,{placeholder:"Search repositories...",value:x,onChange:p,isSearching:l}),e[0]=l,e[1]=x,e[2]=o):o=e[2];const a=l?"opacity-40":"opacity-100";let c;e[3]!==a?(c=F("flex-1 overflow-hidden flex flex-col transition-opacity duration-150",a),e[3]=a,e[4]=c):c=e[4];let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(z,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=r):r=e[5];let u;e[6]!==i||e[7]!==b||e[8]!==g||e[9]!==h||e[10]!==s||e[11]!==f||e[12]!==v?(u=t.jsx(T.Suspense,{fallback:r,children:t.jsx(ve,{connectionId:i,orgId:f,orgSlug:v,installation:g,query:b,onSelectRepo:s,isSaving:h})}),e[6]=i,e[7]=b,e[8]=g,e[9]=h,e[10]=s,e[11]=f,e[12]=v,e[13]=u):u=e[13];let y;e[14]!==c||e[15]!==u?(y=t.jsx("div",{className:c,children:u}),e[14]=c,e[15]=u,e[16]=y):y=e[16];let d;return e[17]!==o||e[18]!==y?(d=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[o,y]}),e[17]=o,e[18]=y,e[19]=d):d=e[19],d}function ve(N){const e=R.c(29),{connectionId:i,orgId:f,orgSlug:v,installation:g,query:s,onSelectRepo:h,isSaving:x}=N;let p;e[0]!==i||e[1]!==f||e[2]!==v?(p={connectionId:i,orgId:f,orgSlug:v},e[0]=i,e[1]=f,e[2]=v,e[3]=p):p=e[3];const C=U(p),b=g.type==="User"?"user":"org",l=s?`${b}:${g.login} ${s} in:name`:`${b}:${g.login}`;let o;e[4]!==i||e[5]!==g.login||e[6]!==f||e[7]!==s?(o=G.githubOrgRepos(f,i,g.login,s),e[4]=i,e[5]=g.login,e[6]=f,e[7]=s,e[8]=o):o=e[8];let a;e[9]!==C||e[10]!==l?(a=async d=>{const{signal:n}=d,S=(await C.callTool({name:"search_repositories",arguments:{query:l,page:1,perPage:30}},void 0,{signal:n})).content?.[0]?.text;if(!S)throw new Error("No response from search_repositories");return(JSON.parse(S).items??[]).map(we)},e[9]=C,e[10]=l,e[11]=a):a=e[11];let c;e[12]!==o||e[13]!==a?(c={queryKey:o,queryFn:a},e[12]=o,e[13]=a,e[14]=c):c=e[14];const{data:r}=ee(c);if(r.length===0){let d;e[15]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("p",{className:"text-sm text-muted-foreground",children:"No repositories found"}),e[15]=d):d=e[15];let n;e[16]!==s?(n=s&&t.jsx("p",{className:"text-xs text-muted-foreground/60",children:"Try a different search term"}),e[16]=s,e[17]=n):n=e[17];let j;return e[18]!==n?(j=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-1",children:[d,n]}),e[18]=n,e[19]=j):j=e[19],j}let u;if(e[20]!==x||e[21]!==h||e[22]!==r){let d;e[24]!==x||e[25]!==h?(d=n=>t.jsxs("button",{type:"button",onClick:()=>h(n),disabled:x,className:"flex items-start gap-3 px-4 py-3 hover:bg-accent transition-colors text-left disabled:opacity-50 disabled:cursor-not-allowed",children:[t.jsx(P,{className:"size-4 text-muted-foreground mt-0.5 shrink-0"}),t.jsx("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:t.jsx("span",{className:"text-sm font-medium truncate",children:n.name})}),t.jsxs("span",{className:"flex items-center gap-1 text-xs font-medium text-muted-foreground border border-border rounded px-1.5 py-0.5 shrink-0 leading-none",children:[n.private?t.jsx(te,{size:10}):t.jsx(ce,{size:10}),n.private?"Private":"Public"]})]},n.fullName),e[24]=x,e[25]=h,e[26]=d):d=e[26],u=r.map(d),e[20]=x,e[21]=h,e[22]=r,e[23]=u}else u=e[23];let y;return e[27]!==u?(y=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden flex flex-col [scrollbar-gutter:stable]",children:u}),e[27]=u,e[28]=y):y=e[28],y}function we(N){return{name:N.name,fullName:N.full_name,owner:N.full_name.split("/")[0]??"",url:N.html_url,private:N.private,description:N.description,updatedAt:N.updated_at}}function D(N){const e=R.c(33),{status:i,error:f,retry:v}=N;if(i==="error"){let S;e[0]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("div",{className:"size-10 rounded-full bg-destructive/10 flex items-center justify-center",children:t.jsx(P,{className:"size-5 text-destructive"})}),e[0]=S):S=e[0];let k;e[1]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx("p",{className:"text-sm font-medium",children:"Connection failed"}),e[1]=k):k=e[1];const w=f??"Something went wrong while connecting to GitHub.";let I;e[2]!==w?(I=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[k,t.jsx("p",{className:"text-xs text-muted-foreground max-w-[260px] leading-relaxed",children:w})]}),e[2]=w,e[3]=I):I=e[3];let m;e[4]!==v?(m=t.jsx("button",{type:"button",onClick:v,className:"text-xs font-medium text-foreground border border-border rounded-md px-3 py-1.5 hover:bg-accent transition-colors",children:"Try again"}),e[4]=v,e[5]=m):m=e[5];let _;return e[6]!==I||e[7]!==m?(_=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[S,I,m]}),e[6]=I,e[7]=m,e[8]=_):_=e[8],_}const g=i==="authenticating";let s;e[9]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("div",{className:"size-10 rounded-full bg-muted flex items-center justify-center",children:t.jsx(P,{className:"size-5 text-foreground"})}),e[9]=s):s=e[9];let h;e[10]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsxs("div",{className:"relative size-10",children:[s,t.jsx("div",{className:"absolute -bottom-0.5 -right-0.5 size-4 rounded-full bg-background flex items-center justify-center",children:t.jsx(z,{size:12,className:"animate-spin text-muted-foreground"})})]}),e[10]=h):h=e[10];const x=g?"Authenticating with GitHub":"Setting up GitHub";let p;e[11]!==x?(p=t.jsx("p",{className:"text-sm font-medium",children:x}),e[11]=x,e[12]=p):p=e[12];const C=g?"Complete the OAuth flow in your browser":"Installing the GitHub connection...";let b;e[13]!==C?(b=t.jsx("p",{className:"text-xs text-muted-foreground",children:C}),e[13]=C,e[14]=b):b=e[14];let l;e[15]!==p||e[16]!==b?(l=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[p,b]}),e[15]=p,e[16]=b,e[17]=l):l=e[17];const o=g?"bg-muted-foreground/30":"bg-foreground animate-pulse";let a;e[18]!==o?(a=F("size-1.5 rounded-full",o),e[18]=o,e[19]=a):a=e[19];let c;e[20]!==a?(c=t.jsx("span",{className:a}),e[20]=a,e[21]=c):c=e[21];const r=g?"bg-foreground animate-pulse":"bg-muted-foreground/30";let u;e[22]!==r?(u=F("size-1.5 rounded-full",r),e[22]=r,e[23]=u):u=e[23];let y;e[24]!==u?(y=t.jsx("span",{className:u}),e[24]=u,e[25]=y):y=e[25];let d;e[26]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("span",{className:"size-1.5 rounded-full bg-muted-foreground/30"}),e[26]=d):d=e[26];let n;e[27]!==c||e[28]!==y?(n=t.jsxs("div",{className:"flex items-center gap-1.5",children:[c,y,d]}),e[27]=c,e[28]=y,e[29]=n):n=e[29];let j;return e[30]!==n||e[31]!==l?(j=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[h,l,n]}),e[30]=n,e[31]=l,e[32]=j):j=e[32],j}export{Oe as G,he as u};
1
+ import{C as B,a as Y,n as $,r as T,ac as H,c as R,j as t,i as z,d as Q,t as O,dF as W,K as G,m as X,B as Z,l as F,v as ee,w as te}from"./index-CAIYhjul.js";import{D as ne,a as se,d as oe,e as ie}from"./dialog-BFqbrhnG.js";import{C as re}from"./collection-search-Bv843kn7.js";import{u as le}from"./use-debounced-value-Bc5YBXDl.js";import{b as M,u as ae}from"./use-connection-DRK2N5z2.js";import{u as U,S as V}from"./use-mcp-client-BRDJsS2i.js";import{a as K}from"./authenticate-and-persist-oauth-BlDhuvWq.js";import{b as J}from"./Settings02-5t6-pGmO.js";import{L as ce}from"./agent-icon-D18juLx-.js";import{u as ue,G as P}from"./use-registry-app-C_q3DUZv.js";import{e as de}from"./extract-connection-data-C6T0yo3M.js";import{c as me}from"./use-navigate-to-agent-DWAHU44q.js";import{p as q,f as fe}from"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import{g as xe}from"./github-repo-scope-DjMZbiKa.js";const ge="deco/mcp-github";function he(N){const{org:e}=B(),{data:i}=Y.useSession(),f=M(),v=$(),[g,s]=T.useState("idle"),[h,x]=T.useState(null),[p,C]=T.useState(null),{data:b,isLoading:l}=ue(ge,{enabled:N.enabled}),o=T.useRef(!1);N.enabled&&b&&!l&&!o.current&&i?.user?.id&&g==="idle"&&(o.current=!0,a());async function a(){if(!(!b||!i?.user?.id||!e))try{s("installing"),x(null);const r=de(b,e.id,i.user.id,{remoteIndex:0});if(!r.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:y}=await f.create.mutateAsync(r);s("authenticating");const d=await K({connectionId:y,orgId:e.id,orgSlug:e.slug,persistFallback:n=>f.update.mutateAsync({id:y,data:{connection_token:n}}).then(()=>{})});if(d.ran&&!d.ok){try{await f.delete.mutateAsync(y)}catch{}throw new Error(d.error&&d.error!=="no token received"?d.error:"No token received from GitHub")}H(v,e.id),C(r),s("ready")}catch(r){x(r instanceof Error?r.message:String(r)),s("error")}}function c(){s("idle"),x(null),C(null),o.current=!1}return N.enabled&&l&&g==="idle"?{status:"installing",error:null,connection:null,retry:c}:{status:g,error:h,connection:p,retry:c}}function Oe(N){const e=R.c(22),{open:i,onOpenChange:f,title:v,onImportComplete:g,mode:s}=N,h=s===void 0?"agent":s,x=v??(h==="connection"?"Add repo":"Import from GitHub"),[p,C]=T.useState(null);let b;e[0]!==x?(b=t.jsx(ne,{className:"sr-only",children:t.jsx(se,{children:x})}),e[0]=x,e[1]=b):b=e[1];let l;e[2]!==x||e[3]!==p?(l=t.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3 shrink-0",children:p?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>C(null),className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors shrink-0","aria-label":"Back to accounts",children:t.jsx(J,{size:16})}),t.jsx("img",{src:p.avatarUrl,alt:p.login,className:"size-5 rounded-full ring-1 ring-border shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:p.login})]}):t.jsxs(t.Fragment,{children:[t.jsx(P,{className:"size-4 text-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:x})]})}),e[2]=x,e[3]=p,e[4]=l):l=e[4];let o;e[5]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(z,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=o):o=e[5];let a;e[6]!==f?(a=()=>f(!1),e[6]=f,e[7]=a):a=e[7];let c;e[8]!==h||e[9]!==g||e[10]!==i||e[11]!==p||e[12]!==a?(c=t.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-w-0",children:t.jsx(T.Suspense,{fallback:o,children:t.jsx(pe,{open:i,onComplete:a,selectedInstallation:p,onSelectInstallation:C,onImportComplete:g,mode:h})})}),e[8]=h,e[9]=g,e[10]=i,e[11]=p,e[12]=a,e[13]=c):c=e[13];let r;e[14]!==b||e[15]!==l||e[16]!==c?(r=t.jsxs(oe,{className:"sm:max-w-[560px] h-[85svh] sm:h-[520px] p-0 gap-0 overflow-hidden flex flex-col",children:[b,l,c]}),e[14]=b,e[15]=l,e[16]=c,e[17]=r):r=e[17];let u;return e[18]!==f||e[19]!==i||e[20]!==r?(u=t.jsx(ie,{open:i,onOpenChange:f,children:r}),e[18]=f,e[19]=i,e[20]=r,e[21]=u):u=e[21],u}function pe({open:N,onComplete:e,selectedInstallation:i,onSelectInstallation:f,onImportComplete:v,mode:g="agent"}){const{org:s}=B(),h=$(),x=me(),[p,C]=T.useState(null),b=ae({slug:"mcp-github"}),l=xe(b),o=he({enabled:N&&l.length===0}),a=l.length===1?l[0]??null:p,c=U({connectionId:a?.id??"",orgId:s.id,orgSlug:s.slug}),r=U({connectionId:V,orgId:s.id,orgSlug:s.slug}),u=async(n,j)=>{try{const k=await c.callTool({name:"get_file_contents",arguments:{owner:n.owner,repo:n.name,path:j}});if(k.isError)return null;const I=k.content?.find(m=>m.type==="resource")?.resource?.text;if(!I)return null;try{const m=JSON.parse(I);return typeof m=="string"?m:JSON.stringify(m)}catch{return I}}catch{return null}},y=(n,j)=>{Promise.all([u(j,"AGENTS.md"),u(j,"CLAUDE.md")]).then(async([S,k])=>{const w=S??k??null;w&&(await r.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:n,data:{metadata:{instructions:w}}}}),H(h,s.id))}).catch(S=>{console.error("GitHub instructions fetch failed:",S)})},d=Q({mutationFn:async n=>{if(!a||!i)throw new Error("No GitHub connection or installation");const j=i.installationId;if(g==="connection"){const{childConnectionId:w}=await q({orgSlug:s.slug,sourceConnection:a,installationId:j,owner:n.owner,repo:n.name,githubCallTool:I=>c.callTool(I),selfCallTool:I=>r.callTool(I),orgShared:!0});return{virtualMcpId:null,repo:n,connectionId:w,item:null}}const{childConnectionId:S}=await q({orgSlug:s.slug,sourceConnection:a,installationId:j,owner:n.owner,repo:n.name,githubCallTool:w=>c.callTool(w),selfCallTool:w=>r.callTool(w)});let k=null;try{const w=await r.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:n.name,description:n.description||"Imported from GitHub",pinned:!1,icon:null,metadata:{githubRepo:{owner:n.owner,name:n.name,url:n.url,installationId:j,connectionId:S},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:S}]}}}),I=w.structuredContent??w,m=I.item?.id;if(!I.item||!m)throw new Error("Failed to create the imported agent");return k=m,{virtualMcpId:m,repo:n,connectionId:S,item:I.item}}catch(w){throw k&&await r.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:k}}).catch(()=>{}),await r.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:S,force:!0}}).catch(()=>{}),w}},onSuccess:({virtualMcpId:n,repo:j,connectionId:S,item:k})=>{if(g==="connection"||!n||!k){H(h,s.id),W(h,s.id),O.success(`Added ${j.name}`),e();return}if(h.setQueryData(G.collectionItem(r,s.id,"","VIRTUAL_MCP",n),{item:k}),H(h,s.id),y(n,j),v){v({virtualMcpId:n,repo:j,connectionId:S});return}O.success(`Imported ${j.name} from GitHub`),e(),localStorage.setItem("mesh:sidebar-open",JSON.stringify(!1)),x(n)},onError:n=>{O.error("Failed to import repo: "+(n instanceof Error?n.message:"Unknown error"))}});return o.status==="installing"||o.status==="authenticating"?t.jsx(D,{status:o.status,error:null,retry:o.retry}):o.status==="error"?t.jsx(D,{status:"error",error:o.error,retry:o.retry}):l.length===0&&o.status==="idle"?t.jsx(D,{status:"installing",error:null,retry:o.retry}):l.length>1&&!a?t.jsxs("div",{className:"flex flex-col py-2",children:[t.jsx("div",{className:"px-4 py-2",children:t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Select a connection"})}),l.map(n=>t.jsxs("button",{type:"button",onClick:()=>C(n),className:"flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left",children:[n.icon?t.jsx("img",{src:n.icon,alt:n.title,className:"size-7 rounded-full shrink-0"}):t.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:t.jsx(P,{className:"size-3.5 text-muted-foreground"})}),t.jsx("span",{className:"text-sm font-medium",children:n.title})]},n.id))]}):a?i?t.jsx(Ne,{connectionId:a.id,orgId:s.id,orgSlug:s.slug,installation:i,onSelectRepo:n=>d.mutate(n),isSaving:d.isPending}):t.jsx(be,{connectionId:a.id,orgId:s.id,orgSlug:s.slug,onSelect:f,showBackButton:l.length>1,onBack:()=>C(null)}):null}function be(N){const e=R.c(47),{connectionId:i,orgId:f,orgSlug:v,onSelect:g,showBackButton:s,onBack:h}=N;let x;e[0]!==f||e[1]!==v?(x={connectionId:V,orgId:f,orgSlug:v},e[0]=f,e[1]=v,e[2]=x):x=e[2];const p=U(x),C=$(),b=M();let l;e[3]!==i||e[4]!==f?(l=G.githubUserOrgs(f,i),e[3]=i,e[4]=f,e[5]=l):l=e[5];let o;e[6]!==i||e[7]!==p?(o=()=>fe(m=>p.callTool(m),i),e[6]=i,e[7]=p,e[8]=o):o=e[8];let a;e[9]!==l||e[10]!==o?(a={queryKey:l,queryFn:o},e[9]=l,e[10]=o,e[11]=a):a=e[11];const c=X(a);let r;e[12]!==b||e[13]!==i||e[14]!==c||e[15]!==f||e[16]!==v||e[17]!==C?(r={mutationFn:async()=>{const m=await K({connectionId:i,orgId:f,orgSlug:v,persistFallback:E=>b.update.mutateAsync({id:i,data:{connection_token:E}}).then(je)});if(m.ran&&!m.ok)throw new Error(m.error??"no token received");const _=new URL(`/api/${v}/mcp/${i}`,window.location.origin);await C.invalidateQueries({queryKey:G.isMCPAuthenticated(_.href,null)}),await C.invalidateQueries({queryKey:G.mcpClientPrefix()}),await c.refetch()},onError:ye},e[12]=b,e[13]=i,e[14]=c,e[15]=f,e[16]=v,e[17]=C,e[18]=r):r=e[18];const u=Q(r);if(c.isLoading){let m;return e[19]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(z,{size:18,className:"animate-spin text-muted-foreground"})}),e[19]=m):m=e[19],m}if(c.isError){let m,_;e[20]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("p",{className:"text-sm text-destructive",children:"Failed to load GitHub accounts"}),_=t.jsx("p",{className:"text-xs text-muted-foreground max-w-[280px] leading-relaxed",children:"Your GitHub connection may have expired. Reconnect to restore access."}),e[20]=m,e[21]=_):(m=e[20],_=e[21]);let E;e[22]!==u?(E=()=>u.mutate(),e[22]=u,e[23]=E):E=e[23];let A;e[24]!==u.isPending?(A=u.isPending?t.jsx(z,{size:14,className:"animate-spin"}):t.jsx(P,{className:"size-3.5"}),e[24]=u.isPending,e[25]=A):A=e[25];let L;return e[26]!==u.isPending||e[27]!==E||e[28]!==A?(L=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-6 text-center",children:[m,_,t.jsxs(Z,{type:"button",variant:"outline",size:"sm",onClick:E,disabled:u.isPending,children:[A,"Reconnect GitHub"]})]}),e[26]=u.isPending,e[27]=E,e[28]=A,e[29]=L):L=e[29],L}const y=c.data;if(!y)return null;let d;e[30]!==h||e[31]!==s?(d=s&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:h,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(J,{size:12}),"Change connection"]})}),e[30]=h,e[31]=s,e[32]=d):d=e[32];let n;if(e[33]!==y.installations||e[34]!==g){let m;e[36]!==g?(m=_=>t.jsxs("button",{type:"button",onClick:()=>g(_),className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left group",children:[t.jsx("img",{src:_.avatarUrl,alt:_.login,className:"size-7 rounded-full shrink-0 ring-1 ring-border"}),t.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[t.jsx("span",{className:"text-sm font-medium leading-none",children:_.login}),_.type==="User"&&t.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"Personal account"})]}),t.jsx("span",{className:"text-xs text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:"Select →"})]},_.installationId),e[36]=g,e[37]=m):m=e[37],n=y.installations.map(m),e[33]=y.installations,e[34]=g,e[35]=n}else n=e[35];let j;e[38]!==n?(j=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden [scrollbar-gutter:stable]",children:n}),e[38]=n,e[39]=j):j=e[39];const S=y.appSlug?`https://github.com/apps/${y.appSlug}/installations/new`:"https://github.com/settings/installations";let k;e[40]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx("span",{className:"underline underline-offset-2",children:"Install the GitHub App"}),e[40]=k):k=e[40];let w;e[41]!==S?(w=t.jsx("div",{className:"px-4 py-3 border-t border-border shrink-0",children:t.jsxs("a",{href:S,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:["Account not listed?"," ",k]})}),e[41]=S,e[42]=w):w=e[42];let I;return e[43]!==w||e[44]!==d||e[45]!==j?(I=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[d,j,w]}),e[43]=w,e[44]=d,e[45]=j,e[46]=I):I=e[46],I}function ye(N){O.error("Failed to reconnect GitHub: "+(N instanceof Error?N.message:"Unknown error"))}function je(){}function Ne(N){const e=R.c(20),{connectionId:i,orgId:f,orgSlug:v,installation:g,onSelectRepo:s,isSaving:h}=N,[x,p]=T.useState(""),C=le(x,300),b=T.useDeferredValue(C),l=x!==b;let o;e[0]!==l||e[1]!==x?(o=t.jsx(re,{placeholder:"Search repositories...",value:x,onChange:p,isSearching:l}),e[0]=l,e[1]=x,e[2]=o):o=e[2];const a=l?"opacity-40":"opacity-100";let c;e[3]!==a?(c=F("flex-1 overflow-hidden flex flex-col transition-opacity duration-150",a),e[3]=a,e[4]=c):c=e[4];let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(z,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=r):r=e[5];let u;e[6]!==i||e[7]!==b||e[8]!==g||e[9]!==h||e[10]!==s||e[11]!==f||e[12]!==v?(u=t.jsx(T.Suspense,{fallback:r,children:t.jsx(ve,{connectionId:i,orgId:f,orgSlug:v,installation:g,query:b,onSelectRepo:s,isSaving:h})}),e[6]=i,e[7]=b,e[8]=g,e[9]=h,e[10]=s,e[11]=f,e[12]=v,e[13]=u):u=e[13];let y;e[14]!==c||e[15]!==u?(y=t.jsx("div",{className:c,children:u}),e[14]=c,e[15]=u,e[16]=y):y=e[16];let d;return e[17]!==o||e[18]!==y?(d=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[o,y]}),e[17]=o,e[18]=y,e[19]=d):d=e[19],d}function ve(N){const e=R.c(29),{connectionId:i,orgId:f,orgSlug:v,installation:g,query:s,onSelectRepo:h,isSaving:x}=N;let p;e[0]!==i||e[1]!==f||e[2]!==v?(p={connectionId:i,orgId:f,orgSlug:v},e[0]=i,e[1]=f,e[2]=v,e[3]=p):p=e[3];const C=U(p),b=g.type==="User"?"user":"org",l=s?`${b}:${g.login} ${s} in:name`:`${b}:${g.login}`;let o;e[4]!==i||e[5]!==g.login||e[6]!==f||e[7]!==s?(o=G.githubOrgRepos(f,i,g.login,s),e[4]=i,e[5]=g.login,e[6]=f,e[7]=s,e[8]=o):o=e[8];let a;e[9]!==C||e[10]!==l?(a=async d=>{const{signal:n}=d,S=(await C.callTool({name:"search_repositories",arguments:{query:l,page:1,perPage:30}},void 0,{signal:n})).content?.[0]?.text;if(!S)throw new Error("No response from search_repositories");return(JSON.parse(S).items??[]).map(we)},e[9]=C,e[10]=l,e[11]=a):a=e[11];let c;e[12]!==o||e[13]!==a?(c={queryKey:o,queryFn:a},e[12]=o,e[13]=a,e[14]=c):c=e[14];const{data:r}=ee(c);if(r.length===0){let d;e[15]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("p",{className:"text-sm text-muted-foreground",children:"No repositories found"}),e[15]=d):d=e[15];let n;e[16]!==s?(n=s&&t.jsx("p",{className:"text-xs text-muted-foreground/60",children:"Try a different search term"}),e[16]=s,e[17]=n):n=e[17];let j;return e[18]!==n?(j=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-1",children:[d,n]}),e[18]=n,e[19]=j):j=e[19],j}let u;if(e[20]!==x||e[21]!==h||e[22]!==r){let d;e[24]!==x||e[25]!==h?(d=n=>t.jsxs("button",{type:"button",onClick:()=>h(n),disabled:x,className:"flex items-start gap-3 px-4 py-3 hover:bg-accent transition-colors text-left disabled:opacity-50 disabled:cursor-not-allowed",children:[t.jsx(P,{className:"size-4 text-muted-foreground mt-0.5 shrink-0"}),t.jsx("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:t.jsx("span",{className:"text-sm font-medium truncate",children:n.name})}),t.jsxs("span",{className:"flex items-center gap-1 text-xs font-medium text-muted-foreground border border-border rounded px-1.5 py-0.5 shrink-0 leading-none",children:[n.private?t.jsx(te,{size:10}):t.jsx(ce,{size:10}),n.private?"Private":"Public"]})]},n.fullName),e[24]=x,e[25]=h,e[26]=d):d=e[26],u=r.map(d),e[20]=x,e[21]=h,e[22]=r,e[23]=u}else u=e[23];let y;return e[27]!==u?(y=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden flex flex-col [scrollbar-gutter:stable]",children:u}),e[27]=u,e[28]=y):y=e[28],y}function we(N){return{name:N.name,fullName:N.full_name,owner:N.full_name.split("/")[0]??"",url:N.html_url,private:N.private,description:N.description,updatedAt:N.updated_at}}function D(N){const e=R.c(33),{status:i,error:f,retry:v}=N;if(i==="error"){let S;e[0]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("div",{className:"size-10 rounded-full bg-destructive/10 flex items-center justify-center",children:t.jsx(P,{className:"size-5 text-destructive"})}),e[0]=S):S=e[0];let k;e[1]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx("p",{className:"text-sm font-medium",children:"Connection failed"}),e[1]=k):k=e[1];const w=f??"Something went wrong while connecting to GitHub.";let I;e[2]!==w?(I=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[k,t.jsx("p",{className:"text-xs text-muted-foreground max-w-[260px] leading-relaxed",children:w})]}),e[2]=w,e[3]=I):I=e[3];let m;e[4]!==v?(m=t.jsx("button",{type:"button",onClick:v,className:"text-xs font-medium text-foreground border border-border rounded-md px-3 py-1.5 hover:bg-accent transition-colors",children:"Try again"}),e[4]=v,e[5]=m):m=e[5];let _;return e[6]!==I||e[7]!==m?(_=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[S,I,m]}),e[6]=I,e[7]=m,e[8]=_):_=e[8],_}const g=i==="authenticating";let s;e[9]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("div",{className:"size-10 rounded-full bg-muted flex items-center justify-center",children:t.jsx(P,{className:"size-5 text-foreground"})}),e[9]=s):s=e[9];let h;e[10]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsxs("div",{className:"relative size-10",children:[s,t.jsx("div",{className:"absolute -bottom-0.5 -right-0.5 size-4 rounded-full bg-background flex items-center justify-center",children:t.jsx(z,{size:12,className:"animate-spin text-muted-foreground"})})]}),e[10]=h):h=e[10];const x=g?"Authenticating with GitHub":"Setting up GitHub";let p;e[11]!==x?(p=t.jsx("p",{className:"text-sm font-medium",children:x}),e[11]=x,e[12]=p):p=e[12];const C=g?"Complete the OAuth flow in your browser":"Installing the GitHub connection...";let b;e[13]!==C?(b=t.jsx("p",{className:"text-xs text-muted-foreground",children:C}),e[13]=C,e[14]=b):b=e[14];let l;e[15]!==p||e[16]!==b?(l=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[p,b]}),e[15]=p,e[16]=b,e[17]=l):l=e[17];const o=g?"bg-muted-foreground/30":"bg-foreground animate-pulse";let a;e[18]!==o?(a=F("size-1.5 rounded-full",o),e[18]=o,e[19]=a):a=e[19];let c;e[20]!==a?(c=t.jsx("span",{className:a}),e[20]=a,e[21]=c):c=e[21];const r=g?"bg-foreground animate-pulse":"bg-muted-foreground/30";let u;e[22]!==r?(u=F("size-1.5 rounded-full",r),e[22]=r,e[23]=u):u=e[23];let y;e[24]!==u?(y=t.jsx("span",{className:u}),e[24]=u,e[25]=y):y=e[25];let d;e[26]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("span",{className:"size-1.5 rounded-full bg-muted-foreground/30"}),e[26]=d):d=e[26];let n;e[27]!==c||e[28]!==y?(n=t.jsxs("div",{className:"flex items-center gap-1.5",children:[c,y,d]}),e[27]=c,e[28]=y,e[29]=n):n=e[29];let j;return e[30]!==n||e[31]!==l?(j=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[h,l,n]}),e[30]=n,e[31]=l,e[32]=j):j=e[32],j}export{Oe as G,he as u};
@@ -1,4 +1,4 @@
1
- import{dx as St,dy as It,bi as N,I as c,dz as de,bo as ze,bv as Et,bh as Tt,aW as wt,ag as O,af as G,ad as oe,H as _,bj as m,b3 as F,dA as Mt,dB as I,ae as At,t as ge,c as Ee,r as W,C as Ot,j as Ct}from"./index-CxWNtx9x.js";import{S as Nt,u as Rt}from"./use-mcp-client-CodYj4lk.js";import{d as xt,D as Pt}from"./decopilot-sse-pool-BLGL0LsS.js";import{d as Dt}from"./delay-CnY5UFtP.js";import{e as kt}from"./backoff-CrEUbyZT.js";var re;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function a(s){throw new Error}t.assertNever=a,t.arrayToEnum=s=>{const o={};for(const i of s)o[i]=i;return o},t.getValidEnumValues=s=>{const o=t.objectKeys(s).filter(n=>typeof s[s[n]]!="number"),i={};for(const n of o)i[n]=s[n];return t.objectValues(i)},t.objectValues=s=>t.objectKeys(s).map(function(o){return s[o]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const o=[];for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&o.push(i);return o},t.find=(s,o)=>{for(const i of s)if(o(i))return i},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,o=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(o)}t.joinValues=r,t.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(re||(re={}));var Ae;(function(t){t.mergeShapes=(e,a)=>({...e,...a})})(Ae||(Ae={}));re.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);re.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class ce extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const a=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,a):this.__proto__=a,this.name="ZodError",this.issues=e}format(e){const a=e||function(o){return o.message},r={_errors:[]},s=o=>{for(const i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)r._errors.push(a(i));else{let n=r,p=0;for(;p<i.path.length;){const u=i.path[p];p===i.path.length-1?(n[u]=n[u]||{_errors:[]},n[u]._errors.push(a(i))):n[u]=n[u]||{_errors:[]},n=n[u],p++}}};return s(this),r}static assert(e){if(!(e instanceof ce))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,re.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=a=>a.message){const a=Object.create(null),r=[];for(const s of this.issues)if(s.path.length>0){const o=s.path[0];a[o]=a[o]||[],a[o].push(e(s))}else r.push(e(s));return{formErrors:r,fieldErrors:a}}get formErrors(){return this.flatten()}}ce.create=t=>new ce(t);var Oe;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Oe||(Oe={}));var h;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(h||(h={}));var Je="vercel.ai.error",Lt=Symbol.for(Je),Ce,Ne,Z=class We extends(Ne=Error,Ce=Lt,Ne){constructor({name:e,message:a,cause:r}){super(a),this[Ce]=!0,this.name=e,this.cause=r}static isInstance(e){return We.hasMarker(e,Je)}static hasMarker(e,a){const r=Symbol.for(a);return e!=null&&typeof e=="object"&&r in e&&typeof e[r]=="boolean"&&e[r]===!0}};function Ge(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var Ye="AI_InvalidArgumentError",He=`vercel.ai.error.${Ye}`,jt=Symbol.for(He),Re,xe,Zt=class extends(xe=Z,Re=jt,xe){constructor({message:t,cause:e,argument:a}){super({name:Ye,message:t,cause:e}),this[Re]=!0,this.argument=a}static isInstance(t){return Z.hasMarker(t,He)}},qe="AI_JSONParseError",Xe=`vercel.ai.error.${qe}`,$t=Symbol.for(Xe),Pe,De,ke=class extends(De=Z,Pe=$t,De){constructor({text:t,cause:e}){super({name:qe,message:`JSON parsing failed: Text: ${t}.
1
+ import{dx as St,dy as It,bi as N,I as c,dz as de,bo as ze,bv as Et,bh as Tt,aW as wt,ag as O,af as G,ad as oe,H as _,bj as m,b3 as F,dA as Mt,dB as I,ae as At,t as ge,c as Ee,r as W,C as Ot,j as Ct}from"./index-CAIYhjul.js";import{S as Nt,u as Rt}from"./use-mcp-client-BRDJsS2i.js";import{d as xt,D as Pt}from"./decopilot-sse-pool-D-2tGt-o.js";import{d as Dt}from"./delay-CnY5UFtP.js";import{e as kt}from"./backoff-CrEUbyZT.js";var re;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function a(s){throw new Error}t.assertNever=a,t.arrayToEnum=s=>{const o={};for(const i of s)o[i]=i;return o},t.getValidEnumValues=s=>{const o=t.objectKeys(s).filter(n=>typeof s[s[n]]!="number"),i={};for(const n of o)i[n]=s[n];return t.objectValues(i)},t.objectValues=s=>t.objectKeys(s).map(function(o){return s[o]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const o=[];for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&o.push(i);return o},t.find=(s,o)=>{for(const i of s)if(o(i))return i},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,o=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(o)}t.joinValues=r,t.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(re||(re={}));var Ae;(function(t){t.mergeShapes=(e,a)=>({...e,...a})})(Ae||(Ae={}));re.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);re.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class ce extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const a=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,a):this.__proto__=a,this.name="ZodError",this.issues=e}format(e){const a=e||function(o){return o.message},r={_errors:[]},s=o=>{for(const i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)r._errors.push(a(i));else{let n=r,p=0;for(;p<i.path.length;){const u=i.path[p];p===i.path.length-1?(n[u]=n[u]||{_errors:[]},n[u]._errors.push(a(i))):n[u]=n[u]||{_errors:[]},n=n[u],p++}}};return s(this),r}static assert(e){if(!(e instanceof ce))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,re.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=a=>a.message){const a=Object.create(null),r=[];for(const s of this.issues)if(s.path.length>0){const o=s.path[0];a[o]=a[o]||[],a[o].push(e(s))}else r.push(e(s));return{formErrors:r,fieldErrors:a}}get formErrors(){return this.flatten()}}ce.create=t=>new ce(t);var Oe;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Oe||(Oe={}));var h;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(h||(h={}));var Je="vercel.ai.error",Lt=Symbol.for(Je),Ce,Ne,Z=class We extends(Ne=Error,Ce=Lt,Ne){constructor({name:e,message:a,cause:r}){super(a),this[Ce]=!0,this.name=e,this.cause=r}static isInstance(e){return We.hasMarker(e,Je)}static hasMarker(e,a){const r=Symbol.for(a);return e!=null&&typeof e=="object"&&r in e&&typeof e[r]=="boolean"&&e[r]===!0}};function Ge(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var Ye="AI_InvalidArgumentError",He=`vercel.ai.error.${Ye}`,jt=Symbol.for(He),Re,xe,Zt=class extends(xe=Z,Re=jt,xe){constructor({message:t,cause:e,argument:a}){super({name:Ye,message:t,cause:e}),this[Re]=!0,this.argument=a}static isInstance(t){return Z.hasMarker(t,He)}},qe="AI_JSONParseError",Xe=`vercel.ai.error.${qe}`,$t=Symbol.for(Xe),Pe,De,ke=class extends(De=Z,Pe=$t,De){constructor({text:t,cause:e}){super({name:qe,message:`JSON parsing failed: Text: ${t}.
2
2
  Error message: ${Ge(e)}`,cause:e}),this[Pe]=!0,this.text=t}static isInstance(t){return Z.hasMarker(t,Xe)}},Qe="AI_TypeValidationError",Ke=`vercel.ai.error.${Qe}`,Ut=Symbol.for(Ke),Le,je,X=class ve extends(je=Z,Le=Ut,je){constructor({value:e,cause:a,context:r}){let s="Type validation failed";if(r?.field&&(s+=` for ${r.field}`),r?.entityName||r?.entityId){s+=" (";const o=[];r.entityName&&o.push(r.entityName),r.entityId&&o.push(`id: "${r.entityId}"`),s+=o.join(", "),s+=")"}super({name:Qe,message:`${s}: Value: ${JSON.stringify(e)}.
3
3
  Error message: ${Ge(a)}`,cause:a}),this[Le]=!0,this.value=e,this.context=r}static isInstance(e){return Z.hasMarker(e,Ke)}static wrap({value:e,cause:a,context:r}){var s,o,i;return ve.isInstance(a)&&a.value===e&&((s=a.context)==null?void 0:s.field)===r?.field&&((o=a.context)==null?void 0:o.entityName)===r?.entityName&&((i=a.context)==null?void 0:i.entityId)===r?.entityId?a:new ve({value:e,cause:a,context:r})}},ie=({prefix:t,size:e=16,alphabet:a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:r="-"}={})=>{const s=()=>{const o=a.length,i=new Array(e);for(let n=0;n<e;n++)i[n]=a[Math.random()*o|0];return i.join("")};if(t==null)return s;if(a.includes(r))throw new Zt({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${a}".`});return()=>`${t}${r}${s()}`};ie();var Ft=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,Bt=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function Ze(t){const e=JSON.parse(t);return e===null||typeof e!="object"||Ft.test(t)===!1&&Bt.test(t)===!1?e:Vt(e)}function Vt(t){let e=[t];for(;e.length;){const a=e;e=[];for(const r of a){if(Object.prototype.hasOwnProperty.call(r,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(r,"constructor")&&r.constructor!==null&&typeof r.constructor=="object"&&Object.prototype.hasOwnProperty.call(r.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(const s in r){const o=r[s];o&&typeof o=="object"&&e.push(o)}}}return t}function zt(t){const{stackTraceLimit:e}=Error;try{Error.stackTraceLimit=0}catch{return Ze(t)}try{return Ze(t)}finally{Error.stackTraceLimit=e}}function Te(t){if(t.type==="object"||Array.isArray(t.type)&&t.type.includes("object")){t.additionalProperties=!1;const{properties:a}=t;if(a!=null)for(const r of Object.keys(a))a[r]=z(a[r])}t.items!=null&&(t.items=Array.isArray(t.items)?t.items.map(z):z(t.items)),t.anyOf!=null&&(t.anyOf=t.anyOf.map(z)),t.allOf!=null&&(t.allOf=t.allOf.map(z)),t.oneOf!=null&&(t.oneOf=t.oneOf.map(z));const{definitions:e}=t;if(e!=null)for(const a of Object.keys(e))e[a]=z(e[a]);return t}function z(t){return typeof t=="boolean"?t:Te(t)}var Jt=Symbol("Let zodToJsonSchema decide on which parser to use"),$e={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},Wt=t=>typeof t=="string"?{...$e,name:t}:{...$e,...t};function R(){return{}}function Gt(t,e){var a,r,s;const o={type:"array"};return(a=t.type)!=null&&a._def&&((s=(r=t.type)==null?void 0:r._def)==null?void 0:s.typeName)!==h.ZodAny&&(o.items=b(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&(o.minItems=t.minLength.value),t.maxLength&&(o.maxItems=t.maxLength.value),t.exactLength&&(o.minItems=t.exactLength.value,o.maxItems=t.exactLength.value),o}function Yt(t){const e={type:"integer",format:"int64"};if(!t.checks)return e;for(const a of t.checks)switch(a.kind){case"min":a.inclusive?e.minimum=a.value:e.exclusiveMinimum=a.value;break;case"max":a.inclusive?e.maximum=a.value:e.exclusiveMaximum=a.value;break;case"multipleOf":e.multipleOf=a.value;break}return e}function Ht(){return{type:"boolean"}}function et(t,e){return b(t.type._def,e)}var qt=(t,e)=>b(t.innerType._def,e);function tt(t,e,a){const r=a??e.dateStrategy;if(Array.isArray(r))return{anyOf:r.map((s,o)=>tt(t,e,s))};switch(r){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return Xt(t)}}var Xt=t=>{const e={type:"integer",format:"unix-time"};for(const a of t.checks)switch(a.kind){case"min":e.minimum=a.value;break;case"max":e.maximum=a.value;break}return e};function Qt(t,e){return{...b(t.innerType._def,e),default:t.defaultValue()}}function Kt(t,e){return e.effectStrategy==="input"?b(t.schema._def,e):R()}function ea(t){return{type:"string",enum:Array.from(t.values)}}var ta=t=>"type"in t&&t.type==="string"?!1:"allOf"in t;function aa(t,e){const a=[b(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),b(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(s=>!!s),r=[];return a.forEach(s=>{if(ta(s))r.push(...s.allOf);else{let o=s;if("additionalProperties"in s&&s.additionalProperties===!1){const{additionalProperties:i,...n}=s;o=n}r.push(o)}}),r.length?{allOf:r}:void 0}function ra(t){const e=typeof t.value;return e!=="bigint"&&e!=="number"&&e!=="boolean"&&e!=="string"?{type:Array.isArray(t.value)?"array":"object"}:{type:e==="bigint"?"integer":e,const:t.value}}var me=void 0,P={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(me===void 0&&(me=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),me),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function at(t,e){const a={type:"string"};if(t.checks)for(const r of t.checks)switch(r.kind){case"min":a.minLength=typeof a.minLength=="number"?Math.max(a.minLength,r.value):r.value;break;case"max":a.maxLength=typeof a.maxLength=="number"?Math.min(a.maxLength,r.value):r.value;break;case"email":switch(e.emailStrategy){case"format:email":D(a,"email",r.message,e);break;case"format:idn-email":D(a,"idn-email",r.message,e);break;case"pattern:zod":A(a,P.email,r.message,e);break}break;case"url":D(a,"uri",r.message,e);break;case"uuid":D(a,"uuid",r.message,e);break;case"regex":A(a,r.regex,r.message,e);break;case"cuid":A(a,P.cuid,r.message,e);break;case"cuid2":A(a,P.cuid2,r.message,e);break;case"startsWith":A(a,RegExp(`^${he(r.value,e)}`),r.message,e);break;case"endsWith":A(a,RegExp(`${he(r.value,e)}$`),r.message,e);break;case"datetime":D(a,"date-time",r.message,e);break;case"date":D(a,"date",r.message,e);break;case"time":D(a,"time",r.message,e);break;case"duration":D(a,"duration",r.message,e);break;case"length":a.minLength=typeof a.minLength=="number"?Math.max(a.minLength,r.value):r.value,a.maxLength=typeof a.maxLength=="number"?Math.min(a.maxLength,r.value):r.value;break;case"includes":{A(a,RegExp(he(r.value,e)),r.message,e);break}case"ip":{r.version!=="v6"&&D(a,"ipv4",r.message,e),r.version!=="v4"&&D(a,"ipv6",r.message,e);break}case"base64url":A(a,P.base64url,r.message,e);break;case"jwt":A(a,P.jwt,r.message,e);break;case"cidr":{r.version!=="v6"&&A(a,P.ipv4Cidr,r.message,e),r.version!=="v4"&&A(a,P.ipv6Cidr,r.message,e);break}case"emoji":A(a,P.emoji(),r.message,e);break;case"ulid":{A(a,P.ulid,r.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{D(a,"binary",r.message,e);break}case"contentEncoding:base64":{a.contentEncoding="base64";break}case"pattern:zod":{A(a,P.base64,r.message,e);break}}break}case"nanoid":A(a,P.nanoid,r.message,e)}return a}function he(t,e){return e.patternStrategy==="escape"?na(t):t}var sa=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function na(t){let e="";for(let a=0;a<t.length;a++)sa.has(t[a])||(e+="\\"),e+=t[a];return e}function D(t,e,a,r){var s;t.format||(s=t.anyOf)!=null&&s.some(o=>o.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format}),delete t.format),t.anyOf.push({format:e,...a&&r.errorMessages&&{errorMessage:{format:a}}})):t.format=e}function A(t,e,a,r){var s;t.pattern||(s=t.allOf)!=null&&s.some(o=>o.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern}),delete t.pattern),t.allOf.push({pattern:Ue(e,r),...a&&r.errorMessages&&{errorMessage:{pattern:a}}})):t.pattern=Ue(e,r)}function Ue(t,e){var a;if(!e.applyRegexFlags||!t.flags)return t.source;const r={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},s=r.i?t.source.toLowerCase():t.source;let o="",i=!1,n=!1,p=!1;for(let u=0;u<s.length;u++){if(i){o+=s[u],i=!1;continue}if(r.i){if(n){if(s[u].match(/[a-z]/)){p?(o+=s[u],o+=`${s[u-2]}-${s[u]}`.toUpperCase(),p=!1):s[u+1]==="-"&&((a=s[u+2])!=null&&a.match(/[a-z]/))?(o+=s[u],p=!0):o+=`${s[u]}${s[u].toUpperCase()}`;continue}}else if(s[u].match(/[a-z]/)){o+=`[${s[u]}${s[u].toUpperCase()}]`;continue}}if(r.m){if(s[u]==="^"){o+=`(^|(?<=[\r
4
4
  ]))`;continue}else if(s[u]==="$"){o+=`($|(?=[\r
@@ -1 +1 @@
1
- import{r as h}from"./index-CxWNtx9x.js";var w=(o,i,l,s,c,t,m,d)=>{let r=document.documentElement,u=["light","dark"];function n(e){(Array.isArray(o)?o:[o]).forEach(a=>{let p=a==="class",S=p&&t?c.map(f=>t[f]||f):c;p?(r.classList.remove(...S),r.classList.add(t&&t[e]?t[e]:e)):r.setAttribute(a,e)}),y(e)}function y(e){d&&u.includes(e)&&(r.style.colorScheme=e)}function g(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(s)n(s);else try{let e=localStorage.getItem(i)||l,a=m&&e==="system"?g():e;n(a)}catch{}};h.createContext(void 0);h.memo(({forcedTheme:o,storageKey:i,attribute:l,enableSystem:s,enableColorScheme:c,defaultTheme:t,value:m,themes:d,nonce:r,scriptProps:u})=>{let n=JSON.stringify([l,i,t,o,d,m,s,c]).slice(1,-1);return h.createElement("script",{...u,suppressHydrationWarning:!0,nonce:typeof window>"u"?r:"",dangerouslySetInnerHTML:{__html:`(${w.toString()})(${n})`}})});
1
+ import{r as h}from"./index-CAIYhjul.js";var w=(o,i,l,s,c,t,m,d)=>{let r=document.documentElement,u=["light","dark"];function n(e){(Array.isArray(o)?o:[o]).forEach(a=>{let p=a==="class",S=p&&t?c.map(f=>t[f]||f):c;p?(r.classList.remove(...S),r.classList.add(t&&t[e]?t[e]:e)):r.setAttribute(a,e)}),y(e)}function y(e){d&&u.includes(e)&&(r.style.colorScheme=e)}function g(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(s)n(s);else try{let e=localStorage.getItem(i)||l,a=m&&e==="system"?g():e;n(a)}catch{}};h.createContext(void 0);h.memo(({forcedTheme:o,storageKey:i,attribute:l,enableSystem:s,enableColorScheme:c,defaultTheme:t,value:m,themes:d,nonce:r,scriptProps:u})=>{let n=JSON.stringify([l,i,t,o,d,m,s,c]).slice(1,-1);return h.createElement("script",{...u,suppressHydrationWarning:!0,nonce:typeof window>"u"?r:"",dangerouslySetInnerHTML:{__html:`(${w.toString()})(${n})`}})});
@@ -1,4 +1,4 @@
1
- import{c as $,C as de,n as Ze,d as We,K as X,m as ie,aY as wn,r as S,ap as Cs,l as ce,j as r,U as $s,i as Ps,B as J,aL as jn,t as ue,w as Es,L as Ds,e as Ts,b as kn,u as Sn,E as Et}from"./index-CxWNtx9x.js";import{s as Nn}from"./Eye-DkqzK9v4.js";import{a as ut}from"./Palette-Dj74Mlc6.js";import{s as Fs}from"./Plus-JOcsz2OW.js";import{i as Is}from"./SearchLg-BHMKxNfO.js";import{i as ft}from"./Upload01-CXhKVCP8.js";import{s as zn}from"./XClose-BdaQO-2_.js";import{i as Ut}from"./Zap-BzNhtsnx.js";import{u as Cn}from"./use-mobile-DmC5AwHK.js";import{f as Ms,a as Ls,b as Os,c as Rs,d as As,e as _s,A as Us,g as Bs}from"./alert-dialog-CwKyb2j-.js";import{D as $n,a as Ue,d as Je,e as et,i as Pn,h as Hs,c as qs}from"./dialog-BxyVzjQ3.js";import{I as Ve}from"./input-C9EhK1Lu.js";import{F as ke,M as Bt,d as En}from"./file-type-icon-L2ARwYHI.js";import{T as Ks}from"./toolbar-WAIhuPvK.js";import{a as Ws}from"./Package-CDoMKJ25.js";import{u as Gs}from"./use-debounced-value-DiZ6agyj.js";import{p as gt,b as le,a as Me,c as Dn,d as Vs}from"./location-BpLtHjTZ.js";import{b as Xs,f as at,s as Qs,c as tn,d as Ys,g as Zs,i as Js,h as Tn,a as Fn,j as el,e as tl}from"./ZoomOut-B5XPtpBa.js";import{S as ae}from"./skeleton-DYrRZj58.js";import{T as nl}from"./textarea-azsnX4mp.js";import{t as sl}from"./ChevronDown-ClEtq8UA.js";import{i as ll,n as rl}from"./ChevronUp-Y_qcNB-R.js";import{i as ht}from"./X-BolYo4iB.js";import{P as il,b as ol,a as al}from"./popover-BPf7qyUL.js";import{b as be,T as ye,a as ve}from"./tooltip-CTQ3jqyw.js";import{a as cl}from"./Copy01-tOHQDVdb.js";import{n as Xe,i as bt}from"./Globe01-BptLpR6D.js";import{i as In}from"./Key01-ByxRAii_.js";import{n as Mn}from"./LinkExternal01-CKVW-eEM.js";import{l as dl,F as ul}from"./index-DIB09EG-.js";import{a as fl}from"./Image01-XM4bpaLw.js";import{D as Ht,a as qt,c as Kt,d as Fe}from"./dropdown-menu-BScjo8--.js";import{i as hl}from"./LayoutLeft-B9Jd6ymK.js";import{i as ml}from"./ChevronRight-B9DmLAKh.js";import{t as pl}from"./Stars01-DqPZujie.js";import{i as Ln}from"./DotsVertical-CmHvBgAo.js";import{s as On}from"./Trash01-BtophoGC.js";function Rn(n){return n.contentHash??`${n.size}-${n.updatedAt}`}function pe(n,e,t,s){const l=new URLSearchParams(s).toString();return`/api/${encodeURIComponent(n)}/fs/${encodeURIComponent(e)}/${t}${l?`?${l}`:""}`}async function fe(n,e,t){const s=await fetch(n,e);if(s.ok||t?.allow404&&s.status===404)return s;let l="";try{l=(await s.json()).error??""}catch{}throw new Error(l||`HTTP ${s.status}`)}function Wt(n,e){const t=$.c(11),{org:s}=de();let l;t[0]!==s.id||t[1]!==e||t[2]!==n?(l=X.orgFsList(s.id,n,e),t[0]=s.id,t[1]=e,t[2]=n,t[3]=l):l=t[3];let i;t[4]!==s.slug||t[5]!==e||t[6]!==n?(i=async()=>(await(await fe(pe(s.slug,n,"list",{path:e}))).json()).entries.toSorted(xl),t[4]=s.slug,t[5]=e,t[6]=n,t[7]=i):i=t[7];let o;return t[8]!==l||t[9]!==i?(o={queryKey:l,placeholderData:wn,queryFn:i},t[8]=l,t[9]=i,t[10]=o):o=t[10],ie(o)}function xl(n,e){return n.kind!==e.kind?n.kind==="dir"?-1:1:n.path.localeCompare(e.path)}function An(n,e,t){const s=$.c(15),{org:l}=de();let i;s[0]!==l.id||s[1]!==e||s[2]!==n?(i=X.orgFsStat(l.id,n??"",e),s[0]=l.id,s[1]=e,s[2]=n,s[3]=i):i=s[3];const o=n!==null;let a;s[4]!==t?(a=t?.refetchIntervalWhenAbsent?f=>f.state.data?!1:t.refetchIntervalWhenAbsent??!1:void 0,s[4]=t,s[5]=a):a=s[5];let c;s[6]!==l.slug||s[7]!==e||s[8]!==n?(c=async()=>{const f=await fe(pe(l.slug,n??"","stat",{path:e}),void 0,{allow404:!0});return f.status===404?null:(await f.json()).entry},s[6]=l.slug,s[7]=e,s[8]=n,s[9]=c):c=s[9];let d;return s[10]!==i||s[11]!==o||s[12]!==a||s[13]!==c?(d={queryKey:i,enabled:o,refetchInterval:a,queryFn:c},s[10]=i,s[11]=o,s[12]=a,s[13]=c,s[14]=d):d=s[14],ie(d)}function gl(n){const e=$.c(9),{org:t}=de();let s;e[0]!==t.id||e[1]!==n?(s=X.orgFsUsage(t.id,n),e[0]=t.id,e[1]=n,e[2]=s):s=e[2];let l;e[3]!==t.slug||e[4]!==n?(l=async()=>await(await fe(pe(t.slug,n,"usage"))).json(),e[3]=t.slug,e[4]=n,e[5]=l):l=e[5];let i;return e[6]!==s||e[7]!==l?(i={queryKey:s,queryFn:l},e[6]=s,e[7]=l,e[8]=i):i=e[8],ie(i)}function bl(n,e){const t=$.c(9),s=n===void 0?60:n,{org:l}=de();let i;t[0]!==l.id?(i=X.orgFsRecent(l.id),t[0]=l.id,t[1]=i):i=t[1];const o=e?.enabled;let a;t[2]!==s||t[3]!==l.slug?(a=async()=>(await(await fe(`/api/${encodeURIComponent(l.slug)}/fs/recent?limit=${s}`)).json()).entries,t[2]=s,t[3]=l.slug,t[4]=a):a=t[4];let c;return t[5]!==i||t[6]!==o||t[7]!==a?(c={queryKey:i,enabled:o,queryFn:a},t[5]=i,t[6]=o,t[7]=a,t[8]=c):c=t[8],ie(c)}function yl(n,e){const t=$.c(11),s=50,{org:l}=de();let i;t[0]!==l.id||t[1]!==n?(i=X.orgFsSearch(l.id,n),t[0]=l.id,t[1]=n,t[2]=i):i=t[2];const o=n.length>0;let a;t[3]!==s||t[4]!==l.slug||t[5]!==n?(a=async()=>(await(await fe(`/api/${encodeURIComponent(l.slug)}/fs/search?q=${encodeURIComponent(n)}&limit=${s}`)).json()).entries,t[3]=s,t[4]=l.slug,t[5]=n,t[6]=a):a=t[6];let c;return t[7]!==i||t[8]!==o||t[9]!==a?(c={queryKey:i,enabled:o,placeholderData:wn,queryFn:a},t[7]=i,t[8]=o,t[9]=a,t[10]=c):c=t[10],ie(c)}function Lo(n){const e=$.c(8),{org:t}=de();let s;e[0]!==t.id?(s=X.orgFsSkills(t.id),e[0]=t.id,e[1]=s):s=e[1];const l=n?.enabled;let i;e[2]!==t.slug?(i=async()=>{const a=await fe(`/api/${encodeURIComponent(t.slug)}/fs/skills`),{skills:c}=await a.json();return c.map(vl)},e[2]=t.slug,e[3]=i):i=e[3];let o;return e[4]!==s||e[5]!==l||e[6]!==i?(o={queryKey:s,enabled:l,queryFn:i},e[4]=s,e[5]=l,e[6]=i,e[7]=o):o=e[7],ie(o)}function vl(n){return{volume:n.volume,path:n.path}}async function Oo(n){const e=await fe(`/api/${encodeURIComponent(n)}/fs/skills`),{skills:t}=await e.json();return t}async function wl(n,e,t){return(await fe(pe(n,e,"read",{path:t}))).text()}const jl=new Set(["md","mdx","markdown","txt","text"]),kl=25,Sl=64*1024,Nl=256*1024,zl=4;function Cl(n){const e=n.lastIndexOf(".");return e===-1?!1:jl.has(n.slice(e+1).toLowerCase())}async function Ro(n,e,t){const s=t?`${t}/`:"",l=u=>u.startsWith(s)?u.slice(s.length):u,i=[],o=[],a=[{path:t,depth:0}];for(;a.length>0;){const u=a.shift();if(!u)break;let h;try{h=(await(await fe(pe(n,e,"list",{path:u.path}))).json()).entries}catch{continue}for(const m of[...h].sort((p,g)=>p.path.localeCompare(g.path))){if(m.kind==="dir"){u.depth<zl&&a.push({path:m.path,depth:u.depth+1});continue}Cl(m.path)&&m.size<=Sl&&i.length<kl?i.push(m.path):o.push(l(m.path))}}const c=await Promise.all(i.map(u=>wl(n,e,u).catch(()=>null))),d=[];let f=0;return i.forEach((u,h)=>{const m=c[h];if(m==null||f+m.length>Nl){o.push(l(u));return}f+=m.length,d.push({relPath:l(u),content:m})}),d.sort((u,h)=>u.relPath==="SKILL.md"?-1:h.relPath==="SKILL.md"?1:u.relPath.localeCompare(h.relPath)),o.sort(),{files:d,omittedPaths:o}}function _n(){const n=$.c(7),{org:e}=de();let t;n[0]!==e.id?(t=X.orgFsPublicSets(e.id),n[0]=e.id,n[1]=t):t=n[1];let s;n[2]!==e.slug?(s=async()=>(await(await fe(`/api/${encodeURIComponent(e.slug)}/fs/public-sets`)).json()).sets,n[2]=e.slug,n[3]=s):s=n[3];let l;return n[4]!==t||n[5]!==s?(l={queryKey:t,staleTime:3e5,queryFn:s},n[4]=t,n[5]=s,n[6]=l):l=n[6],ie(l)}function $l(n){const e=$.c(3),{org:t}=de();let s;return e[0]!==t.slug||e[1]!==n?(s=l=>pe(t.slug,n,"read",{path:l}),e[0]=t.slug,e[1]=n,e[2]=s):s=e[2],s}function tt(){const n=$.c(2),{org:e}=de();let t;return n[0]!==e.slug?(t=(s,l)=>pe(e.slug,s,"read",{path:l}),n[0]=e.slug,n[1]=t):t=n[1],t}function Un(n){const e=$.c(3),{org:t}=de();let s;return e[0]!==t||e[1]!==n?(s={mutationFn:async l=>(await(await fe(pe(t.slug,n,"file",{path:l.path}),{method:"PUT",headers:{"content-type":l.contentType??"text/html; charset=utf-8"},body:l.body})).json()).entry},e[0]=t,e[1]=n,e[2]=s):s=e[2],We(s)}function Pl(n){const e=$.c(18),{org:t}=de(),s=Ze();let l;e[0]!==t||e[1]!==n?(l=async d=>(await(await fe(pe(t.slug,n,"public",{path:d.path}),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({mode:d.mode,password:d.password})})).json()).entry,e[0]=t,e[1]=n,e[2]=l):l=e[2];let i;e[3]!==t||e[4]!==s||e[5]!==n?(i=async d=>{const f=X.orgFsStat(t.id,n,d.path);await s.cancelQueries({queryKey:f});const u=s.getQueryData(f),h=d.mode!=="private";return s.setQueryData(f,m=>m&&{...m,readPublic:h,effectivePublic:h,shareMode:d.mode}),{key:f,previous:u}},e[3]=t,e[4]=s,e[5]=n,e[6]=i):i=e[6];let o;e[7]!==s?(o=(d,f,u)=>{u&&s.setQueryData(u.key,u.previous)},e[7]=s,e[8]=o):o=e[8];let a;e[9]!==t||e[10]!==s||e[11]!==n?(a=(d,f,u)=>{s.invalidateQueries({queryKey:X.orgFsStat(t.id,n,u.path)}),s.invalidateQueries({queryKey:X.orgFsVolume(t.id,n)}),s.invalidateQueries({queryKey:X.orgFsRecent(t.id)}),s.invalidateQueries({queryKey:X.orgFsSearchRoot(t.id)})},e[9]=t,e[10]=s,e[11]=n,e[12]=a):a=e[12];let c;return e[13]!==l||e[14]!==i||e[15]!==o||e[16]!==a?(c={mutationFn:l,onMutate:i,onError:o,onSettled:a},e[13]=l,e[14]=i,e[15]=o,e[16]=a,e[17]=c):c=e[17],We(c)}function Ot(n){const e=$.c(26),{org:t}=de(),s=Ze();let l;e[0]!==t||e[1]!==s||e[2]!==n?(l=()=>{s.invalidateQueries({queryKey:X.orgFsVolume(t.id,n)}),s.invalidateQueries({queryKey:X.orgFsRecent(t.id)}),s.invalidateQueries({queryKey:X.orgFsSearchRoot(t.id)})},e[0]=t,e[1]=s,e[2]=n,e[3]=l):l=e[3];const i=l;let o;e[4]!==t||e[5]!==n?(o=async b=>{for(const x of b.files){const y=b.dir?`${b.dir}/${x.name}`:x.name;await fe(pe(t.slug,n,"file",{path:y}),{method:"PUT",headers:{"content-type":x.type||"application/octet-stream"},body:x})}},e[4]=t,e[5]=n,e[6]=o):o=e[6];let a;e[7]!==i||e[8]!==o?(a={mutationFn:o,onSettled:i},e[7]=i,e[8]=o,e[9]=a):a=e[9];const c=We(a);let d;e[10]!==t||e[11]!==n?(d=async b=>{await fe(pe(t.slug,n,"dir",{path:b}),{method:"POST"})},e[10]=t,e[11]=n,e[12]=d):d=e[12];let f;e[13]!==i||e[14]!==d?(f={mutationFn:d,onSuccess:i},e[13]=i,e[14]=d,e[15]=f):f=e[15];const u=We(f);let h;e[16]!==t||e[17]!==n?(h=async b=>{await fe(pe(t.slug,n,"file",{path:b}),{method:"DELETE"})},e[16]=t,e[17]=n,e[18]=h):h=e[18];let m;e[19]!==i||e[20]!==h?(m={mutationFn:h,onSuccess:i},e[19]=i,e[20]=h,e[21]=m):m=e[21];const p=We(m);let g;return e[22]!==u||e[23]!==p||e[24]!==c?(g={upload:c,mkdir:u,remove:p},e[22]=u,e[23]=p,e[24]=c,e[25]=g):g=e[25],g}const yt=S.createContext(null);yt.displayName="PanelGroupContext";const se={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"},Gt=10,Te=S.useLayoutEffect,nn=Cs.useId,El=typeof nn=="function"?nn:()=>null;let Dl=0;function Vt(n=null){const e=El(),t=S.useRef(n||e||null);return t.current===null&&(t.current=""+Dl++),n??t.current}function Bn({children:n,className:e="",collapsedSize:t,collapsible:s,defaultSize:l,forwardedRef:i,id:o,maxSize:a,minSize:c,onCollapse:d,onExpand:f,onResize:u,order:h,style:m,tagName:p="div",...g}){const b=S.useContext(yt);if(b===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:x,expandPanel:y,getPanelSize:j,getPanelStyle:N,groupId:C,isPanelCollapsed:k,reevaluatePanelConstraints:w,registerPanel:B,resizePanel:R,unregisterPanel:_}=b,v=Vt(o),I=S.useRef({callbacks:{onCollapse:d,onExpand:f,onResize:u},constraints:{collapsedSize:t,collapsible:s,defaultSize:l,maxSize:a,minSize:c},id:v,idIsFromProps:o!==void 0,order:h});S.useRef({didLogMissingDefaultSizeWarning:!1}),Te(()=>{const{callbacks:U,constraints:O}=I.current,H={...O};I.current.id=v,I.current.idIsFromProps=o!==void 0,I.current.order=h,U.onCollapse=d,U.onExpand=f,U.onResize=u,O.collapsedSize=t,O.collapsible=s,O.defaultSize=l,O.maxSize=a,O.minSize=c,(H.collapsedSize!==O.collapsedSize||H.collapsible!==O.collapsible||H.maxSize!==O.maxSize||H.minSize!==O.minSize)&&w(I.current,H)}),Te(()=>{const U=I.current;return B(U),()=>{_(U)}},[h,v,B,_]),S.useImperativeHandle(i,()=>({collapse:()=>{x(I.current)},expand:U=>{y(I.current,U)},getId(){return v},getSize(){return j(I.current)},isCollapsed(){return k(I.current)},isExpanded(){return!k(I.current)},resize:U=>{R(I.current,U)}}),[x,y,j,k,v,R]);const Z=N(I.current,l);return S.createElement(p,{...g,children:n,className:e,id:v,style:{...Z,...m},[se.groupId]:C,[se.panel]:"",[se.panelCollapsible]:s||void 0,[se.panelId]:v,[se.panelSize]:parseFloat(""+Z.flexGrow).toFixed(1)})}const Hn=S.forwardRef((n,e)=>S.createElement(Bn,{...n,forwardedRef:e}));Bn.displayName="Panel";Hn.displayName="forwardRef(Panel)";let Rt=null,dt=-1,ze=null;function Tl(n,e){if(e){const t=(e&Vn)!==0,s=(e&Xn)!==0,l=(e&Qn)!==0,i=(e&Yn)!==0;if(t)return l?"se-resize":i?"ne-resize":"e-resize";if(s)return l?"sw-resize":i?"nw-resize":"w-resize";if(l)return"s-resize";if(i)return"n-resize"}switch(n){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function Fl(){ze!==null&&(document.head.removeChild(ze),Rt=null,ze=null,dt=-1)}function Dt(n,e){var t,s;const l=Tl(n,e);if(Rt!==l){if(Rt=l,ze===null&&(ze=document.createElement("style"),document.head.appendChild(ze)),dt>=0){var i;(i=ze.sheet)===null||i===void 0||i.removeRule(dt)}dt=(t=(s=ze.sheet)===null||s===void 0?void 0:s.insertRule(`*{cursor: ${l} !important;}`))!==null&&t!==void 0?t:-1}}function qn(n){return n.type==="keydown"}function Kn(n){return n.type.startsWith("pointer")}function Wn(n){return n.type.startsWith("mouse")}function vt(n){if(Kn(n)){if(n.isPrimary)return{x:n.clientX,y:n.clientY}}else if(Wn(n))return{x:n.clientX,y:n.clientY};return{x:1/0,y:1/0}}function Il(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function Ml(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 Ll(n,e){if(n===e)throw new Error("Cannot compare node with itself");const t={a:rn(n),b:rn(e)};let s;for(;t.a.at(-1)===t.b.at(-1);)n=t.a.pop(),e=t.b.pop(),s=n;G(s,"Stacking order can only be calculated for elements with a common ancestor");const l={a:ln(sn(t.a)),b:ln(sn(t.b))};if(l.a===l.b){const i=s.childNodes,o={a:t.a.at(-1),b:t.b.at(-1)};let a=i.length;for(;a--;){const c=i[a];if(c===o.a)return 1;if(c===o.b)return-1}}return Math.sign(l.a-l.b)}const Ol=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Rl(n){var e;const t=getComputedStyle((e=Gn(n))!==null&&e!==void 0?e:n).display;return t==="flex"||t==="inline-flex"}function Al(n){const e=getComputedStyle(n);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||Rl(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"||Ol.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function sn(n){let e=n.length;for(;e--;){const t=n[e];if(G(t,"Missing node"),Al(t))return t}return null}function ln(n){return n&&Number(getComputedStyle(n).zIndex)||0}function rn(n){const e=[];for(;n;)e.push(n),n=Gn(n);return e}function Gn(n){const{parentNode:e}=n;return e&&e instanceof ShadowRoot?e.host:e}const Vn=1,Xn=2,Qn=4,Yn=8,_l=Il()==="coarse";let xe=[],_e=!1,De=new Map,wt=new Map;const Qe=new Set;function Ul(n,e,t,s,l){var i;const{ownerDocument:o}=e,a={direction:t,element:e,hitAreaMargins:s,setResizeHandlerState:l},c=(i=De.get(o))!==null&&i!==void 0?i:0;return De.set(o,c+1),Qe.add(a),mt(),function(){var f;wt.delete(n),Qe.delete(a);const u=(f=De.get(o))!==null&&f!==void 0?f:1;if(De.set(o,u-1),mt(),u===1&&De.delete(o),xe.includes(a)){const h=xe.indexOf(a);h>=0&&xe.splice(h,1),Qt(),l("up",!0,null)}}}function Bl(n){const{target:e}=n,{x:t,y:s}=vt(n);_e=!0,Xt({target:e,x:t,y:s}),mt(),xe.length>0&&(pt("down",n),n.preventDefault(),Zn(e)||n.stopImmediatePropagation())}function Tt(n){const{x:e,y:t}=vt(n);if(_e&&n.buttons===0&&(_e=!1,pt("up",n)),!_e){const{target:s}=n;Xt({target:s,x:e,y:t})}pt("move",n),Qt(),xe.length>0&&n.preventDefault()}function Ft(n){const{target:e}=n,{x:t,y:s}=vt(n);wt.clear(),_e=!1,xe.length>0&&(n.preventDefault(),Zn(e)||n.stopImmediatePropagation()),pt("up",n),Xt({target:e,x:t,y:s}),Qt(),mt()}function Zn(n){let e=n;for(;e;){if(e.hasAttribute(se.resizeHandle))return!0;e=e.parentElement}return!1}function Xt({target:n,x:e,y:t}){xe.splice(0);let s=null;(n instanceof HTMLElement||n instanceof SVGElement)&&(s=n),Qe.forEach(l=>{const{element:i,hitAreaMargins:o}=l,a=i.getBoundingClientRect(),{bottom:c,left:d,right:f,top:u}=a,h=_l?o.coarse:o.fine;if(e>=d-h&&e<=f+h&&t>=u-h&&t<=c+h){if(s!==null&&document.contains(s)&&i!==s&&!i.contains(s)&&!s.contains(i)&&Ll(s,i)>0){let p=s,g=!1;for(;p&&!p.contains(i);){if(Ml(p.getBoundingClientRect(),a)){g=!0;break}p=p.parentElement}if(g)return}xe.push(l)}})}function It(n,e){wt.set(n,e)}function Qt(){let n=!1,e=!1;xe.forEach(s=>{const{direction:l}=s;l==="horizontal"?n=!0:e=!0});let t=0;wt.forEach(s=>{t|=s}),n&&e?Dt("intersection",t):n?Dt("horizontal",t):e?Dt("vertical",t):Fl()}let Mt=new AbortController;function mt(){Mt.abort(),Mt=new AbortController;const n={capture:!0,signal:Mt.signal};Qe.size&&(_e?(xe.length>0&&De.forEach((e,t)=>{const{body:s}=t;e>0&&(s.addEventListener("contextmenu",Ft,n),s.addEventListener("pointerleave",Tt,n),s.addEventListener("pointermove",Tt,n))}),window.addEventListener("pointerup",Ft,n),window.addEventListener("pointercancel",Ft,n)):De.forEach((e,t)=>{const{body:s}=t;e>0&&(s.addEventListener("pointerdown",Bl,n),s.addEventListener("pointermove",Tt,n))}))}function pt(n,e){Qe.forEach(t=>{const{setResizeHandlerState:s}=t,l=xe.includes(t);s(n,l,e)})}function Hl(){const[n,e]=S.useState(0);return S.useCallback(()=>e(t=>t+1),[])}function G(n,e){if(!n)throw console.error(e),Error(e)}function Ie(n,e,t=Gt){return n.toFixed(t)===e.toFixed(t)?0:n>e?1:-1}function we(n,e,t=Gt){return Ie(n,e,t)===0}function me(n,e,t){return Ie(n,e,t)===0}function ql(n,e,t){if(n.length!==e.length)return!1;for(let s=0;s<n.length;s++){const l=n[s],i=e[s];if(!me(l,i,t))return!1}return!0}function Ae({panelConstraints:n,panelIndex:e,size:t}){const s=n[e];G(s!=null,`Panel constraints not found for index ${e}`);let{collapsedSize:l=0,collapsible:i,maxSize:o=100,minSize:a=0}=s;if(Ie(t,a)<0)if(i){const c=(l+a)/2;Ie(t,c)<0?t=l:t=a}else t=a;return t=Math.min(o,t),t=parseFloat(t.toFixed(Gt)),t}function He({delta:n,initialLayout:e,panelConstraints:t,pivotIndices:s,prevLayout:l,trigger:i}){if(me(n,0))return e;const o=[...e],[a,c]=s;G(a!=null,"Invalid first pivot index"),G(c!=null,"Invalid second pivot index");let d=0;if(i==="keyboard"){{const u=n<0?c:a,h=t[u];G(h,`Panel constraints not found for index ${u}`);const{collapsedSize:m=0,collapsible:p,minSize:g=0}=h;if(p){const b=e[u];if(G(b!=null,`Previous layout not found for panel index ${u}`),me(b,m)){const x=g-b;Ie(x,Math.abs(n))>0&&(n=n<0?0-x:x)}}}{const u=n<0?a:c,h=t[u];G(h,`No panel constraints found for index ${u}`);const{collapsedSize:m=0,collapsible:p,minSize:g=0}=h;if(p){const b=e[u];if(G(b!=null,`Previous layout not found for panel index ${u}`),me(b,g)){const x=b-m;Ie(x,Math.abs(n))>0&&(n=n<0?0-x:x)}}}}{const u=n<0?1:-1;let h=n<0?c:a,m=0;for(;;){const g=e[h];G(g!=null,`Previous layout not found for panel index ${h}`);const x=Ae({panelConstraints:t,panelIndex:h,size:100})-g;if(m+=x,h+=u,h<0||h>=t.length)break}const p=Math.min(Math.abs(n),Math.abs(m));n=n<0?0-p:p}{let h=n<0?a:c;for(;h>=0&&h<t.length;){const m=Math.abs(n)-Math.abs(d),p=e[h];G(p!=null,`Previous layout not found for panel index ${h}`);const g=p-m,b=Ae({panelConstraints:t,panelIndex:h,size:g});if(!me(p,b)&&(d+=p-b,o[h]=b,d.toPrecision(3).localeCompare(Math.abs(n).toPrecision(3),void 0,{numeric:!0})>=0))break;n<0?h--:h++}}if(ql(l,o))return l;{const u=n<0?c:a,h=e[u];G(h!=null,`Previous layout not found for panel index ${u}`);const m=h+d,p=Ae({panelConstraints:t,panelIndex:u,size:m});if(o[u]=p,!me(p,m)){let g=m-p,x=n<0?c:a;for(;x>=0&&x<t.length;){const y=o[x];G(y!=null,`Previous layout not found for panel index ${x}`);const j=y+g,N=Ae({panelConstraints:t,panelIndex:x,size:j});if(me(y,N)||(g-=N-y,o[x]=N),me(g,0))break;n>0?x--:x++}}}const f=o.reduce((u,h)=>h+u,0);return me(f,100)?o:l}function Kl({layout:n,panelsArray:e,pivotIndices:t}){let s=0,l=100,i=0,o=0;const a=t[0];G(a!=null,"No pivot index found"),e.forEach((u,h)=>{const{constraints:m}=u,{maxSize:p=100,minSize:g=0}=m;h===a?(s=g,l=p):(i+=g,o+=p)});const c=Math.min(l,100-i),d=Math.max(s,100-o),f=n[a];return{valueMax:c,valueMin:d,valueNow:f}}function Ye(n,e=document){return Array.from(e.querySelectorAll(`[${se.resizeHandleId}][data-panel-group-id="${n}"]`))}function Jn(n,e,t=document){const l=Ye(n,t).findIndex(i=>i.getAttribute(se.resizeHandleId)===e);return l??null}function es(n,e,t){const s=Jn(n,e,t);return s!=null?[s,s+1]:[-1,-1]}function ts(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 s=e.querySelector(`[data-panel-group][data-panel-group-id="${n}"]`);return s||null}function jt(n,e=document){const t=e.querySelector(`[${se.resizeHandleId}="${n}"]`);return t||null}function Wl(n,e,t,s=document){var l,i,o,a;const c=jt(e,s),d=Ye(n,s),f=c?d.indexOf(c):-1,u=(l=(i=t[f])===null||i===void 0?void 0:i.id)!==null&&l!==void 0?l:null,h=(o=(a=t[f+1])===null||a===void 0?void 0:a.id)!==null&&o!==void 0?o:null;return[u,h]}function Gl({committedValuesRef:n,eagerValuesRef:e,groupId:t,layout:s,panelDataArray:l,panelGroupElement:i,setLayout:o}){S.useRef({didWarnAboutMissingResizeHandle:!1}),Te(()=>{if(!i)return;const a=Ye(t,i);for(let c=0;c<l.length-1;c++){const{valueMax:d,valueMin:f,valueNow:u}=Kl({layout:s,panelsArray:l,pivotIndices:[c,c+1]}),h=a[c];if(h!=null){const m=l[c];G(m,`No panel data found for index "${c}"`),h.setAttribute("aria-controls",m.id),h.setAttribute("aria-valuemax",""+Math.round(d)),h.setAttribute("aria-valuemin",""+Math.round(f)),h.setAttribute("aria-valuenow",u!=null?""+Math.round(u):"")}}return()=>{a.forEach((c,d)=>{c.removeAttribute("aria-controls"),c.removeAttribute("aria-valuemax"),c.removeAttribute("aria-valuemin"),c.removeAttribute("aria-valuenow")})}},[t,s,l,i]),S.useEffect(()=>{if(!i)return;const a=e.current;G(a,"Eager values not found");const{panelDataArray:c}=a,d=ts(t,i);G(d!=null,`No group found for id "${t}"`);const f=Ye(t,i);G(f,`No resize handles found for group id "${t}"`);const u=f.map(h=>{const m=h.getAttribute(se.resizeHandleId);G(m,"Resize handle element has no handle id attribute");const[p,g]=Wl(t,m,c,i);if(p==null||g==null)return()=>{};const b=x=>{if(!x.defaultPrevented)switch(x.key){case"Enter":{x.preventDefault();const y=c.findIndex(j=>j.id===p);if(y>=0){const j=c[y];G(j,`No panel data found for index ${y}`);const N=s[y],{collapsedSize:C=0,collapsible:k,minSize:w=0}=j.constraints;if(N!=null&&k){const B=He({delta:me(N,C)?w-C:C-N,initialLayout:s,panelConstraints:c.map(R=>R.constraints),pivotIndices:es(t,m,i),prevLayout:s,trigger:"keyboard"});s!==B&&o(B)}}break}}};return h.addEventListener("keydown",b),()=>{h.removeEventListener("keydown",b)}});return()=>{u.forEach(h=>h())}},[i,n,e,t,s,l,o])}function on(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 ns(n,e){const t=n==="horizontal",{x:s,y:l}=vt(e);return t?s:l}function Vl(n,e,t,s,l){const i=t==="horizontal",o=jt(e,l);G(o,`No resize handle element found for id "${e}"`);const a=o.getAttribute(se.groupId);G(a,"Resize handle element has no group id attribute");let{initialCursorPosition:c}=s;const d=ns(t,n),f=ts(a,l);G(f,`No group element found for id "${a}"`);const u=f.getBoundingClientRect(),h=i?u.width:u.height;return(d-c)/h*100}function Xl(n,e,t,s,l,i){if(qn(n)){const o=t==="horizontal";let a=0;n.shiftKey?a=100:l!=null?a=l:a=10;let c=0;switch(n.key){case"ArrowDown":c=o?0:a;break;case"ArrowLeft":c=o?-a:0;break;case"ArrowRight":c=o?a:0;break;case"ArrowUp":c=o?0:-a;break;case"End":c=100;break;case"Home":c=-100;break}return c}else return s==null?0:Vl(n,e,t,s,i)}function Ql({panelDataArray:n}){const e=Array(n.length),t=n.map(i=>i.constraints);let s=0,l=100;for(let i=0;i<n.length;i++){const o=t[i];G(o,`Panel constraints not found for index ${i}`);const{defaultSize:a}=o;a!=null&&(s++,e[i]=a,l-=a)}for(let i=0;i<n.length;i++){const o=t[i];G(o,`Panel constraints not found for index ${i}`);const{defaultSize:a}=o;if(a!=null)continue;const c=n.length-s,d=l/c;s++,e[i]=d,l-=d}return e}function Le(n,e,t){e.forEach((s,l)=>{const i=n[l];G(i,`Panel data not found for index ${l}`);const{callbacks:o,constraints:a,id:c}=i,{collapsedSize:d=0,collapsible:f}=a,u=t[c];if(u==null||s!==u){t[c]=s;const{onCollapse:h,onExpand:m,onResize:p}=o;p&&p(s,u),f&&(h||m)&&(m&&(u==null||we(u,d))&&!we(s,d)&&m(),h&&(u==null||!we(u,d))&&we(s,d)&&h())}})}function ct(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 Yl({defaultSize:n,dragState:e,layout:t,panelData:s,panelIndex:l,precision:i=3}){const o=t[l];let a;return o==null?a=n!=null?n.toPrecision(i):"1":s.length===1?a="1":a=o.toPrecision(i),{flexBasis:0,flexGrow:a,flexShrink:1,overflow:"hidden",pointerEvents:e!==null?"none":void 0}}function Zl(n,e=10){let t=null;return(...l)=>{t!==null&&clearTimeout(t),t=setTimeout(()=>{n(...l)},e)}}function an(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 ss(n){return`react-resizable-panels:${n}`}function ls(n){return n.map(e=>{const{constraints:t,id:s,idIsFromProps:l,order:i}=e;return l?s:i?`${i}:${JSON.stringify(t)}`:JSON.stringify(t)}).sort((e,t)=>e.localeCompare(t)).join(",")}function rs(n,e){try{const t=ss(n),s=e.getItem(t);if(s){const l=JSON.parse(s);if(typeof l=="object"&&l!=null)return l}}catch{}return null}function Jl(n,e,t){var s,l;const i=(s=rs(n,t))!==null&&s!==void 0?s:{},o=ls(e);return(l=i[o])!==null&&l!==void 0?l:null}function er(n,e,t,s,l){var i;const o=ss(n),a=ls(e),c=(i=rs(n,l))!==null&&i!==void 0?i:{};c[a]={expandToSizes:Object.fromEntries(t.entries()),layout:s};try{l.setItem(o,JSON.stringify(c))}catch(d){console.error(d)}}function cn({layout:n,panelConstraints:e}){const t=[...n],s=t.reduce((i,o)=>i+o,0);if(t.length!==e.length)throw Error(`Invalid ${e.length} panel layout: ${t.map(i=>`${i}%`).join(", ")}`);if(!me(s,100)&&t.length>0)for(let i=0;i<e.length;i++){const o=t[i];G(o!=null,`No layout data found for index ${i}`);const a=100/s*o;t[i]=a}let l=0;for(let i=0;i<e.length;i++){const o=t[i];G(o!=null,`No layout data found for index ${i}`);const a=Ae({panelConstraints:e,panelIndex:i,size:o});o!=a&&(l+=o-a,t[i]=a)}if(!me(l,0))for(let i=0;i<e.length;i++){const o=t[i];G(o!=null,`No layout data found for index ${i}`);const a=o+l,c=Ae({panelConstraints:e,panelIndex:i,size:a});if(o!==c&&(l-=c-o,t[i]=c,me(l,0)))break}return t}const tr=100,qe={getItem:n=>(an(qe),qe.getItem(n)),setItem:(n,e)=>{an(qe),qe.setItem(n,e)}},dn={};function is({autoSaveId:n=null,children:e,className:t="",direction:s,forwardedRef:l,id:i=null,onLayout:o=null,keyboardResizeBy:a=null,storage:c=qe,style:d,tagName:f="div",...u}){const h=Vt(i),m=S.useRef(null),[p,g]=S.useState(null),[b,x]=S.useState([]),y=Hl(),j=S.useRef({}),N=S.useRef(new Map),C=S.useRef(0),k=S.useRef({autoSaveId:n,direction:s,dragState:p,id:h,keyboardResizeBy:a,onLayout:o,storage:c}),w=S.useRef({layout:b,panelDataArray:[],panelDataArrayChanged:!1});S.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),S.useImperativeHandle(l,()=>({getId:()=>k.current.id,getLayout:()=>{const{layout:z}=w.current;return z},setLayout:z=>{const{onLayout:F}=k.current,{layout:M,panelDataArray:L}=w.current,D=cn({layout:z,panelConstraints:L.map(A=>A.constraints)});on(M,D)||(x(D),w.current.layout=D,F&&F(D),Le(L,D,j.current))}}),[]),Te(()=>{k.current.autoSaveId=n,k.current.direction=s,k.current.dragState=p,k.current.id=h,k.current.onLayout=o,k.current.storage=c}),Gl({committedValuesRef:k,eagerValuesRef:w,groupId:h,layout:b,panelDataArray:w.current.panelDataArray,setLayout:x,panelGroupElement:m.current}),S.useEffect(()=>{const{panelDataArray:z}=w.current;if(n){if(b.length===0||b.length!==z.length)return;let F=dn[n];F==null&&(F=Zl(er,tr),dn[n]=F);const M=[...z],L=new Map(N.current);F(n,M,L,b,c)}},[n,b,c]),S.useEffect(()=>{});const B=S.useCallback(z=>{const{onLayout:F}=k.current,{layout:M,panelDataArray:L}=w.current;if(z.constraints.collapsible){const D=L.map(he=>he.constraints),{collapsedSize:A=0,panelSize:Q,pivotIndices:te}=Ee(L,z,M);if(G(Q!=null,`Panel size not found for panel "${z.id}"`),!we(Q,A)){N.current.set(z.id,Q);const P=Oe(L,z)===L.length-1?Q-A:A-Q,V=He({delta:P,initialLayout:M,panelConstraints:D,pivotIndices:te,prevLayout:M,trigger:"imperative-api"});ct(M,V)||(x(V),w.current.layout=V,F&&F(V),Le(L,V,j.current))}}},[]),R=S.useCallback((z,F)=>{const{onLayout:M}=k.current,{layout:L,panelDataArray:D}=w.current;if(z.constraints.collapsible){const A=D.map(ne=>ne.constraints),{collapsedSize:Q=0,panelSize:te=0,minSize:he=0,pivotIndices:P}=Ee(D,z,L),V=F??he;if(we(te,Q)){const ne=N.current.get(z.id),ge=ne!=null&&ne>=V?ne:V,$e=Oe(D,z)===D.length-1?te-ge:ge-te,oe=He({delta:$e,initialLayout:L,panelConstraints:A,pivotIndices:P,prevLayout:L,trigger:"imperative-api"});ct(L,oe)||(x(oe),w.current.layout=oe,M&&M(oe),Le(D,oe,j.current))}}},[]),_=S.useCallback(z=>{const{layout:F,panelDataArray:M}=w.current,{panelSize:L}=Ee(M,z,F);return G(L!=null,`Panel size not found for panel "${z.id}"`),L},[]),v=S.useCallback((z,F)=>{const{panelDataArray:M}=w.current,L=Oe(M,z);return Yl({defaultSize:F,dragState:p,layout:b,panelData:M,panelIndex:L})},[p,b]),I=S.useCallback(z=>{const{layout:F,panelDataArray:M}=w.current,{collapsedSize:L=0,collapsible:D,panelSize:A}=Ee(M,z,F);return G(A!=null,`Panel size not found for panel "${z.id}"`),D===!0&&we(A,L)},[]),Z=S.useCallback(z=>{const{layout:F,panelDataArray:M}=w.current,{collapsedSize:L=0,collapsible:D,panelSize:A}=Ee(M,z,F);return G(A!=null,`Panel size not found for panel "${z.id}"`),!D||Ie(A,L)>0},[]),U=S.useCallback(z=>{const{panelDataArray:F}=w.current;F.push(z),F.sort((M,L)=>{const D=M.order,A=L.order;return D==null&&A==null?0:D==null?-1:A==null?1:D-A}),w.current.panelDataArrayChanged=!0,y()},[y]);Te(()=>{if(w.current.panelDataArrayChanged){w.current.panelDataArrayChanged=!1;const{autoSaveId:z,onLayout:F,storage:M}=k.current,{layout:L,panelDataArray:D}=w.current;let A=null;if(z){const te=Jl(z,D,M);te&&(N.current=new Map(Object.entries(te.expandToSizes)),A=te.layout)}A==null&&(A=Ql({panelDataArray:D}));const Q=cn({layout:A,panelConstraints:D.map(te=>te.constraints)});on(L,Q)||(x(Q),w.current.layout=Q,F&&F(Q),Le(D,Q,j.current))}}),Te(()=>{const z=w.current;return()=>{z.layout=[]}},[]);const O=S.useCallback(z=>{let F=!1;const M=m.current;return M&&window.getComputedStyle(M,null).getPropertyValue("direction")==="rtl"&&(F=!0),function(D){D.preventDefault();const A=m.current;if(!A)return()=>null;const{direction:Q,dragState:te,id:he,keyboardResizeBy:P,onLayout:V}=k.current,{layout:ne,panelDataArray:ge}=w.current,{initialLayout:Se}=te??{},$e=es(he,z,A);let oe=Xl(D,z,Q,te,P,A);const rt=Q==="horizontal";rt&&F&&(oe=-oe);const $t=ge.map(Pt=>Pt.constraints),Pe=He({delta:oe,initialLayout:Se??ne,panelConstraints:$t,pivotIndices:$e,prevLayout:ne,trigger:qn(D)?"keyboard":"mouse-or-touch"}),it=!ct(ne,Pe);(Kn(D)||Wn(D))&&C.current!=oe&&(C.current=oe,!it&&oe!==0?rt?It(z,oe<0?Vn:Xn):It(z,oe<0?Qn:Yn):It(z,0)),it&&(x(Pe),w.current.layout=Pe,V&&V(Pe),Le(ge,Pe,j.current))}},[]),H=S.useCallback((z,F)=>{const{onLayout:M}=k.current,{layout:L,panelDataArray:D}=w.current,A=D.map(ne=>ne.constraints),{panelSize:Q,pivotIndices:te}=Ee(D,z,L);G(Q!=null,`Panel size not found for panel "${z.id}"`);const P=Oe(D,z)===D.length-1?Q-F:F-Q,V=He({delta:P,initialLayout:L,panelConstraints:A,pivotIndices:te,prevLayout:L,trigger:"imperative-api"});ct(L,V)||(x(V),w.current.layout=V,M&&M(V),Le(D,V,j.current))},[]),W=S.useCallback((z,F)=>{const{layout:M,panelDataArray:L}=w.current,{collapsedSize:D=0,collapsible:A}=F,{collapsedSize:Q=0,collapsible:te,maxSize:he=100,minSize:P=0}=z.constraints,{panelSize:V}=Ee(L,z,M);V!=null&&(A&&te&&we(V,D)?we(D,Q)||H(z,Q):V<P?H(z,P):V>he&&H(z,he))},[H]),q=S.useCallback((z,F)=>{const{direction:M}=k.current,{layout:L}=w.current;if(!m.current)return;const D=jt(z,m.current);G(D,`Drag handle element not found for id "${z}"`);const A=ns(M,F);g({dragHandleId:z,dragHandleRect:D.getBoundingClientRect(),initialCursorPosition:A,initialLayout:L})},[]),ee=S.useCallback(()=>{g(null)},[]),Y=S.useCallback(z=>{const{panelDataArray:F}=w.current,M=Oe(F,z);M>=0&&(F.splice(M,1),delete j.current[z.id],w.current.panelDataArrayChanged=!0,y())},[y]),T=S.useMemo(()=>({collapsePanel:B,direction:s,dragState:p,expandPanel:R,getPanelSize:_,getPanelStyle:v,groupId:h,isPanelCollapsed:I,isPanelExpanded:Z,reevaluatePanelConstraints:W,registerPanel:U,registerResizeHandle:O,resizePanel:H,startDragging:q,stopDragging:ee,unregisterPanel:Y,panelGroupElement:m.current}),[B,p,s,R,_,v,h,I,Z,W,U,O,H,q,ee,Y]),K={display:"flex",flexDirection:s==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return S.createElement(yt.Provider,{value:T},S.createElement(f,{...u,children:e,className:t,id:i,ref:m,style:{...K,...d},[se.group]:"",[se.groupDirection]:s,[se.groupId]:h}))}const os=S.forwardRef((n,e)=>S.createElement(is,{...n,forwardedRef:e}));is.displayName="PanelGroup";os.displayName="forwardRef(PanelGroup)";function Oe(n,e){return n.findIndex(t=>t===e||t.id===e.id)}function Ee(n,e,t){const s=Oe(n,e),i=s===n.length-1?[s-1,s]:[s,s+1],o=t[s];return{...e.constraints,panelSize:o,pivotIndices:i}}function nr({disabled:n,handleId:e,resizeHandler:t,panelGroupElement:s}){S.useEffect(()=>{if(n||t==null||s==null)return;const l=jt(e,s);if(l==null)return;const i=o=>{if(!o.defaultPrevented)switch(o.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{o.preventDefault(),t(o);break}case"F6":{o.preventDefault();const a=l.getAttribute(se.groupId);G(a,`No group element found for id "${a}"`);const c=Ye(a,s),d=Jn(a,e,s);G(d!==null,`No resize element found for id "${e}"`);const f=o.shiftKey?d>0?d-1:c.length-1:d+1<c.length?d+1:0;c[f].focus();break}}};return l.addEventListener("keydown",i),()=>{l.removeEventListener("keydown",i)}},[s,n,e,t])}function as({children:n=null,className:e="",disabled:t=!1,hitAreaMargins:s,id:l,onBlur:i,onClick:o,onDragging:a,onFocus:c,onPointerDown:d,onPointerUp:f,style:u={},tabIndex:h=0,tagName:m="div",...p}){var g,b;const x=S.useRef(null),y=S.useRef({onClick:o,onDragging:a,onPointerDown:d,onPointerUp:f});S.useEffect(()=>{y.current.onClick=o,y.current.onDragging=a,y.current.onPointerDown=d,y.current.onPointerUp=f});const j=S.useContext(yt);if(j===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:N,groupId:C,registerResizeHandle:k,startDragging:w,stopDragging:B,panelGroupElement:R}=j,_=Vt(l),[v,I]=S.useState("inactive"),[Z,U]=S.useState(!1),[O,H]=S.useState(null),W=S.useRef({state:v});Te(()=>{W.current.state=v}),S.useEffect(()=>{if(t)H(null);else{const T=k(_);H(()=>T)}},[t,_,k]);const q=(g=s?.coarse)!==null&&g!==void 0?g:15,ee=(b=s?.fine)!==null&&b!==void 0?b:5;S.useEffect(()=>{if(t||O==null)return;const T=x.current;G(T,"Element ref not attached");let K=!1;return Ul(_,T,N,{coarse:q,fine:ee},(F,M,L)=>{if(!M){I("inactive");return}switch(F){case"down":{I("drag"),K=!1,G(L,'Expected event to be defined for "down" action'),w(_,L);const{onDragging:D,onPointerDown:A}=y.current;D?.(!0),A?.();break}case"move":{const{state:D}=W.current;K=!0,D!=="drag"&&I("hover"),G(L,'Expected event to be defined for "move" action'),O(L);break}case"up":{I("hover"),B();const{onClick:D,onDragging:A,onPointerUp:Q}=y.current;A?.(!1),Q?.(),K||D?.();break}}})},[q,N,t,ee,k,_,O,w,B]),nr({disabled:t,handleId:_,resizeHandler:O,panelGroupElement:R});const Y={touchAction:"none",userSelect:"none"};return S.createElement(m,{...p,children:n,className:e,id:l,onBlur:()=>{U(!1),i?.()},onFocus:()=>{U(!0),c?.()},ref:x,role:"separator",style:{...Y,...u},tabIndex:h,[se.groupDirection]:N,[se.groupId]:C,[se.resizeHandle]:"",[se.resizeHandleActive]:v==="drag"?"pointer":Z?"keyboard":void 0,[se.resizeHandleEnabled]:!t,[se.resizeHandleId]:_,[se.resizeHandleState]:v})}as.displayName="PanelResizeHandle";function sr(n){const e=$.c(10);let t,s,l;e[0]!==n?({className:t,ref:l,...s}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=l):(t=e[1],s=e[2],l=e[3]);let i;e[4]!==t?(i=ce("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",t),e[4]=t,e[5]=i):i=e[5];let o;return e[6]!==s||e[7]!==l||e[8]!==i?(o=r.jsx(os,{ref:l,"data-slot":"resizable-panel-group",className:i,...s}),e[6]=s,e[7]=l,e[8]=i,e[9]=o):o=e[9],o}function un(n){const e=$.c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let s;return e[2]!==t?(s=r.jsx(Hn,{"data-slot":"resizable-panel",...t}),e[2]=t,e[3]=s):s=e[3],s}function lr(n){const e=$.c(12);let t,s,l;e[0]!==n?({withHandle:l,className:t,...s}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=l):(t=e[1],s=e[2],l=e[3]);let i;e[4]!==t?(i=ce("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]=i):i=e[5];let o;e[6]!==l?(o=l&&r.jsx("div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:r.jsx(Xs,{className:"size-2.5"})}),e[6]=l,e[7]=o):o=e[7];let a;return e[8]!==s||e[9]!==i||e[10]!==o?(a=r.jsx(as,{"data-slot":"resizable-handle",className:i,...s,children:o}),e[8]=s,e[9]=i,e[10]=o,e[11]=a):a=e[11],a}function rr(n){if(!n||n.includes("\\")||n.includes("..")||n.includes("\0"))return!0;try{const e=decodeURIComponent(n);if(e.includes("\\")||e.includes("..")||e.includes("\0"))return!0;if(e!==n&&e.includes("/")){const t=(n.match(/\//g)??[]).length;if((e.match(/\//g)??[]).length>t)return!0}return!1}catch{return!0}}function ir(n){if(rr(n))throw new Error(`Invalid block key: ${n||"(empty)"}`)}function or(n){try{return decodeURIComponent(n)}catch{return n}}function ar(n){return ir(n),encodeURIComponent(n)}function cr(n){return`.deco/blocks/${ar(n)}.json`}function Ao(n){return`/${cr(n)}`}const _o=1e4,dr=3;function At(n){return n.trim()?(n.startsWith("/")?n:`/${n}`).replace(/\/+/g,"/"):"/"}function kt(n){return n.startsWith("/")?n.slice(1):n}function Uo(n){const e=kt(n);return!e||e.includes("..")||e.includes("\\")?!1:e.startsWith(".deco/blocks/")||!e.startsWith("/")&&!e.includes("://")}function xt(n){return n.trim()?n.startsWith("/")?n:`/${n}`:"/"}function ur(n){const e=xt(n);if(e==="/")return"/";const t=e.split("/").filter(Boolean);return t.pop(),t.length===0?"/":`/${t.join("/")}`}function Bo(n,e){const t=e.replace(/^\/+|\/+$/g,"");return xt(t?`${n==="/"?"":n}/${t}`:n)}function Ho(n,e){return e==="directory"?n:ur(n)}function qo(n){const e=n.trim();return e?e.includes("/")||e.includes("\\")||e.includes("..")||e.includes("\0")?"Name cannot contain /, \\, or ..":null:"Name is required"}function fr(n){const e=kt(n);return e?e.split("/").filter(Boolean).length:0}function Ko(n,e,t,s=!1){return{files:[...new Set([...n,...t.files])],directories:[...new Set([...e,...t.directories??[]])],truncated:s||!!t.truncated}}function Wo(n,e){return fr(n)>=dr&&!e.has(n)}function Go(n,e,t=[]){const s=kt(n);if(e.includes(s)||t.includes(s))return!0;if(!s)return!1;const l=`${s}/`;return e.some(i=>i.startsWith(l))||t.some(i=>i.startsWith(l))}function Vo(n){const e=kt(n),t=".deco/blocks/";if(!e.startsWith(t)||!e.endsWith(".json"))return null;const s=e.slice(t.length,-5);return or(s)}function hr(n){if(!n)return"plaintext";const e=n.toLowerCase();return e.endsWith(".tsx")||e.endsWith(".ts")?"typescript":e.endsWith(".jsx")||e.endsWith(".js")||e.endsWith(".mjs")||e.endsWith(".cjs")?"javascript":e.endsWith(".json")?"json":e.endsWith(".md")||e.endsWith(".mdx")?"markdown":e.endsWith(".css")?"css":e.endsWith(".scss")?"scss":e.endsWith(".html")?"html":e.endsWith(".yaml")||e.endsWith(".yml")?"yaml":e.endsWith(".xml")||e.endsWith(".svg")?"xml":e.endsWith(".py")?"python":e.endsWith(".sql")?"sql":e.endsWith(".sh")?"shell":"plaintext"}const mr="#94a3b8";function Xo(n){const e=n.toLowerCase();return e.endsWith(".tsx")||e.endsWith(".ts")?{Icon:at,color:"#3b82f6"}:e.endsWith(".jsx")||e.endsWith(".js")||e.endsWith(".mjs")||e.endsWith(".cjs")?{Icon:at,color:"#d9a441"}:e.endsWith(".json")?{Icon:Qs,color:"#cb9b3f"}:e.endsWith(".css")||e.endsWith(".scss")?{Icon:at,color:"#06b6d4"}:e.endsWith(".html")||e.endsWith(".xml")?{Icon:at,color:"#f97316"}:/\.(png|jpe?g|gif|webp|avif|ico|svg)$/.test(e)?{Icon:fl,color:"#a855f7"}:e.endsWith(".md")||e.endsWith(".mdx")?{Icon:tn,color:"#64748b"}:{Icon:tn,color:mr}}function Qo(n){const e=At(n).split("/").filter(Boolean),t=["/"];let s="";for(const l of e.slice(0,-1))s+=`/${l}`,t.push(s);return t}function Yo(n,e=[]){const t={children:[]},s=i=>{const a=At(i).split("/").filter(Boolean);let c=t,d="";for(const f of a){d+=`/${f}`;let u=c.children.find(h=>h.name===f);u?u.kind==="file"&&(u.kind="directory"):(u={name:f,path:d,kind:"directory",children:[]},c.children.push(u)),c=u}};for(const i of n){const a=At(i).split("/").filter(Boolean);let c=t,d="";a.forEach((f,u)=>{d+=`/${f}`;const h=u===a.length-1;let m=c.children.find(p=>p.name===f);m||(m={name:f,path:d,kind:h?"file":"directory",children:[]},c.children.push(m)),c=m})}for(const i of e)s(xt(i));const l=i=>{i.sort((o,a)=>o.kind!==a.kind?o.kind==="directory"?-1:1:o.name.localeCompare(a.name));for(const o of i)o.children.length>0&&l(o.children)};return l(t.children),t.children}function pr(n,e,t=0){const s=[];for(const l of n)l.name!==".gitkeep"&&(s.push({node:l,depth:t}),l.kind==="directory"&&l.children.length>0&&e.has(l.path)&&s.push(...pr(l.children,e,t+1)));return s}function Zo(n){return n.split(`
1
+ import{c as $,C as de,n as Ze,d as We,K as X,m as ie,aY as wn,r as S,ap as Cs,l as ce,j as r,U as $s,i as Ps,B as J,aL as jn,t as ue,w as Es,L as Ds,e as Ts,b as kn,u as Sn,E as Et}from"./index-CAIYhjul.js";import{s as Nn}from"./Eye--S6NkM5F.js";import{a as ut}from"./Palette-DUf6RWjx.js";import{s as Fs}from"./Plus-CX4xPpn4.js";import{i as Is}from"./SearchLg-EiBSceY9.js";import{i as ft}from"./Upload01-BWPUocl6.js";import{s as zn}from"./XClose-DSEAQFLe.js";import{i as Ut}from"./Zap-BAgOs3IO.js";import{u as Cn}from"./use-mobile-COWtBi3l.js";import{f as Ms,a as Ls,b as Os,c as Rs,d as As,e as _s,A as Us,g as Bs}from"./alert-dialog-BNeEAttR.js";import{D as $n,a as Ue,d as Je,e as et,i as Pn,h as Hs,c as qs}from"./dialog-BFqbrhnG.js";import{I as Ve}from"./input-Dzav8ivG.js";import{F as ke,M as Bt,d as En}from"./file-type-icon-D2keXo94.js";import{T as Ks}from"./toolbar-Bn_kiKpu.js";import{a as Ws}from"./Package-2_HSkxNk.js";import{u as Gs}from"./use-debounced-value-Bc5YBXDl.js";import{p as gt,b as le,a as Me,c as Dn,d as Vs}from"./location-BpLtHjTZ.js";import{b as Xs,f as at,s as Qs,c as tn,d as Ys,g as Zs,i as Js,h as Tn,a as Fn,j as el,e as tl}from"./ZoomOut-B7mxhvah.js";import{S as ae}from"./skeleton-DeOjoVUO.js";import{T as nl}from"./textarea-B9TUwSCj.js";import{t as sl}from"./ChevronDown-Chms7f47.js";import{i as ll,n as rl}from"./ChevronUp-B2kc02W-.js";import{i as ht}from"./X-CLk-1WTe.js";import{P as il,b as ol,a as al}from"./popover-Zrs8wv0F.js";import{b as be,T as ye,a as ve}from"./tooltip-DBcnpVTx.js";import{a as cl}from"./Copy01-BLPcoB-x.js";import{n as Xe,i as bt}from"./Globe01-D8U_-ef0.js";import{i as In}from"./Key01-DgOZ1Vl-.js";import{n as Mn}from"./LinkExternal01-Cq7tHe_6.js";import{l as dl,F as ul}from"./index-CXCcDBTq.js";import{a as fl}from"./Image01-BOJVTyLq.js";import{D as Ht,a as qt,c as Kt,d as Fe}from"./dropdown-menu-EfeTZxQL.js";import{i as hl}from"./LayoutLeft-uipFY-Sc.js";import{i as ml}from"./ChevronRight-DGKhdwsU.js";import{t as pl}from"./Stars01-D-dD7V12.js";import{i as Ln}from"./DotsVertical-Bv_Wu1PR.js";import{s as On}from"./Trash01-Bi1KaIxH.js";function Rn(n){return n.contentHash??`${n.size}-${n.updatedAt}`}function pe(n,e,t,s){const l=new URLSearchParams(s).toString();return`/api/${encodeURIComponent(n)}/fs/${encodeURIComponent(e)}/${t}${l?`?${l}`:""}`}async function fe(n,e,t){const s=await fetch(n,e);if(s.ok||t?.allow404&&s.status===404)return s;let l="";try{l=(await s.json()).error??""}catch{}throw new Error(l||`HTTP ${s.status}`)}function Wt(n,e){const t=$.c(11),{org:s}=de();let l;t[0]!==s.id||t[1]!==e||t[2]!==n?(l=X.orgFsList(s.id,n,e),t[0]=s.id,t[1]=e,t[2]=n,t[3]=l):l=t[3];let i;t[4]!==s.slug||t[5]!==e||t[6]!==n?(i=async()=>(await(await fe(pe(s.slug,n,"list",{path:e}))).json()).entries.toSorted(xl),t[4]=s.slug,t[5]=e,t[6]=n,t[7]=i):i=t[7];let o;return t[8]!==l||t[9]!==i?(o={queryKey:l,placeholderData:wn,queryFn:i},t[8]=l,t[9]=i,t[10]=o):o=t[10],ie(o)}function xl(n,e){return n.kind!==e.kind?n.kind==="dir"?-1:1:n.path.localeCompare(e.path)}function An(n,e,t){const s=$.c(15),{org:l}=de();let i;s[0]!==l.id||s[1]!==e||s[2]!==n?(i=X.orgFsStat(l.id,n??"",e),s[0]=l.id,s[1]=e,s[2]=n,s[3]=i):i=s[3];const o=n!==null;let a;s[4]!==t?(a=t?.refetchIntervalWhenAbsent?f=>f.state.data?!1:t.refetchIntervalWhenAbsent??!1:void 0,s[4]=t,s[5]=a):a=s[5];let c;s[6]!==l.slug||s[7]!==e||s[8]!==n?(c=async()=>{const f=await fe(pe(l.slug,n??"","stat",{path:e}),void 0,{allow404:!0});return f.status===404?null:(await f.json()).entry},s[6]=l.slug,s[7]=e,s[8]=n,s[9]=c):c=s[9];let d;return s[10]!==i||s[11]!==o||s[12]!==a||s[13]!==c?(d={queryKey:i,enabled:o,refetchInterval:a,queryFn:c},s[10]=i,s[11]=o,s[12]=a,s[13]=c,s[14]=d):d=s[14],ie(d)}function gl(n){const e=$.c(9),{org:t}=de();let s;e[0]!==t.id||e[1]!==n?(s=X.orgFsUsage(t.id,n),e[0]=t.id,e[1]=n,e[2]=s):s=e[2];let l;e[3]!==t.slug||e[4]!==n?(l=async()=>await(await fe(pe(t.slug,n,"usage"))).json(),e[3]=t.slug,e[4]=n,e[5]=l):l=e[5];let i;return e[6]!==s||e[7]!==l?(i={queryKey:s,queryFn:l},e[6]=s,e[7]=l,e[8]=i):i=e[8],ie(i)}function bl(n,e){const t=$.c(9),s=n===void 0?60:n,{org:l}=de();let i;t[0]!==l.id?(i=X.orgFsRecent(l.id),t[0]=l.id,t[1]=i):i=t[1];const o=e?.enabled;let a;t[2]!==s||t[3]!==l.slug?(a=async()=>(await(await fe(`/api/${encodeURIComponent(l.slug)}/fs/recent?limit=${s}`)).json()).entries,t[2]=s,t[3]=l.slug,t[4]=a):a=t[4];let c;return t[5]!==i||t[6]!==o||t[7]!==a?(c={queryKey:i,enabled:o,queryFn:a},t[5]=i,t[6]=o,t[7]=a,t[8]=c):c=t[8],ie(c)}function yl(n,e){const t=$.c(11),s=50,{org:l}=de();let i;t[0]!==l.id||t[1]!==n?(i=X.orgFsSearch(l.id,n),t[0]=l.id,t[1]=n,t[2]=i):i=t[2];const o=n.length>0;let a;t[3]!==s||t[4]!==l.slug||t[5]!==n?(a=async()=>(await(await fe(`/api/${encodeURIComponent(l.slug)}/fs/search?q=${encodeURIComponent(n)}&limit=${s}`)).json()).entries,t[3]=s,t[4]=l.slug,t[5]=n,t[6]=a):a=t[6];let c;return t[7]!==i||t[8]!==o||t[9]!==a?(c={queryKey:i,enabled:o,placeholderData:wn,queryFn:a},t[7]=i,t[8]=o,t[9]=a,t[10]=c):c=t[10],ie(c)}function Lo(n){const e=$.c(8),{org:t}=de();let s;e[0]!==t.id?(s=X.orgFsSkills(t.id),e[0]=t.id,e[1]=s):s=e[1];const l=n?.enabled;let i;e[2]!==t.slug?(i=async()=>{const a=await fe(`/api/${encodeURIComponent(t.slug)}/fs/skills`),{skills:c}=await a.json();return c.map(vl)},e[2]=t.slug,e[3]=i):i=e[3];let o;return e[4]!==s||e[5]!==l||e[6]!==i?(o={queryKey:s,enabled:l,queryFn:i},e[4]=s,e[5]=l,e[6]=i,e[7]=o):o=e[7],ie(o)}function vl(n){return{volume:n.volume,path:n.path}}async function Oo(n){const e=await fe(`/api/${encodeURIComponent(n)}/fs/skills`),{skills:t}=await e.json();return t}async function wl(n,e,t){return(await fe(pe(n,e,"read",{path:t}))).text()}const jl=new Set(["md","mdx","markdown","txt","text"]),kl=25,Sl=64*1024,Nl=256*1024,zl=4;function Cl(n){const e=n.lastIndexOf(".");return e===-1?!1:jl.has(n.slice(e+1).toLowerCase())}async function Ro(n,e,t){const s=t?`${t}/`:"",l=u=>u.startsWith(s)?u.slice(s.length):u,i=[],o=[],a=[{path:t,depth:0}];for(;a.length>0;){const u=a.shift();if(!u)break;let h;try{h=(await(await fe(pe(n,e,"list",{path:u.path}))).json()).entries}catch{continue}for(const m of[...h].sort((p,g)=>p.path.localeCompare(g.path))){if(m.kind==="dir"){u.depth<zl&&a.push({path:m.path,depth:u.depth+1});continue}Cl(m.path)&&m.size<=Sl&&i.length<kl?i.push(m.path):o.push(l(m.path))}}const c=await Promise.all(i.map(u=>wl(n,e,u).catch(()=>null))),d=[];let f=0;return i.forEach((u,h)=>{const m=c[h];if(m==null||f+m.length>Nl){o.push(l(u));return}f+=m.length,d.push({relPath:l(u),content:m})}),d.sort((u,h)=>u.relPath==="SKILL.md"?-1:h.relPath==="SKILL.md"?1:u.relPath.localeCompare(h.relPath)),o.sort(),{files:d,omittedPaths:o}}function _n(){const n=$.c(7),{org:e}=de();let t;n[0]!==e.id?(t=X.orgFsPublicSets(e.id),n[0]=e.id,n[1]=t):t=n[1];let s;n[2]!==e.slug?(s=async()=>(await(await fe(`/api/${encodeURIComponent(e.slug)}/fs/public-sets`)).json()).sets,n[2]=e.slug,n[3]=s):s=n[3];let l;return n[4]!==t||n[5]!==s?(l={queryKey:t,staleTime:3e5,queryFn:s},n[4]=t,n[5]=s,n[6]=l):l=n[6],ie(l)}function $l(n){const e=$.c(3),{org:t}=de();let s;return e[0]!==t.slug||e[1]!==n?(s=l=>pe(t.slug,n,"read",{path:l}),e[0]=t.slug,e[1]=n,e[2]=s):s=e[2],s}function tt(){const n=$.c(2),{org:e}=de();let t;return n[0]!==e.slug?(t=(s,l)=>pe(e.slug,s,"read",{path:l}),n[0]=e.slug,n[1]=t):t=n[1],t}function Un(n){const e=$.c(3),{org:t}=de();let s;return e[0]!==t||e[1]!==n?(s={mutationFn:async l=>(await(await fe(pe(t.slug,n,"file",{path:l.path}),{method:"PUT",headers:{"content-type":l.contentType??"text/html; charset=utf-8"},body:l.body})).json()).entry},e[0]=t,e[1]=n,e[2]=s):s=e[2],We(s)}function Pl(n){const e=$.c(18),{org:t}=de(),s=Ze();let l;e[0]!==t||e[1]!==n?(l=async d=>(await(await fe(pe(t.slug,n,"public",{path:d.path}),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({mode:d.mode,password:d.password})})).json()).entry,e[0]=t,e[1]=n,e[2]=l):l=e[2];let i;e[3]!==t||e[4]!==s||e[5]!==n?(i=async d=>{const f=X.orgFsStat(t.id,n,d.path);await s.cancelQueries({queryKey:f});const u=s.getQueryData(f),h=d.mode!=="private";return s.setQueryData(f,m=>m&&{...m,readPublic:h,effectivePublic:h,shareMode:d.mode}),{key:f,previous:u}},e[3]=t,e[4]=s,e[5]=n,e[6]=i):i=e[6];let o;e[7]!==s?(o=(d,f,u)=>{u&&s.setQueryData(u.key,u.previous)},e[7]=s,e[8]=o):o=e[8];let a;e[9]!==t||e[10]!==s||e[11]!==n?(a=(d,f,u)=>{s.invalidateQueries({queryKey:X.orgFsStat(t.id,n,u.path)}),s.invalidateQueries({queryKey:X.orgFsVolume(t.id,n)}),s.invalidateQueries({queryKey:X.orgFsRecent(t.id)}),s.invalidateQueries({queryKey:X.orgFsSearchRoot(t.id)})},e[9]=t,e[10]=s,e[11]=n,e[12]=a):a=e[12];let c;return e[13]!==l||e[14]!==i||e[15]!==o||e[16]!==a?(c={mutationFn:l,onMutate:i,onError:o,onSettled:a},e[13]=l,e[14]=i,e[15]=o,e[16]=a,e[17]=c):c=e[17],We(c)}function Ot(n){const e=$.c(26),{org:t}=de(),s=Ze();let l;e[0]!==t||e[1]!==s||e[2]!==n?(l=()=>{s.invalidateQueries({queryKey:X.orgFsVolume(t.id,n)}),s.invalidateQueries({queryKey:X.orgFsRecent(t.id)}),s.invalidateQueries({queryKey:X.orgFsSearchRoot(t.id)})},e[0]=t,e[1]=s,e[2]=n,e[3]=l):l=e[3];const i=l;let o;e[4]!==t||e[5]!==n?(o=async b=>{for(const x of b.files){const y=b.dir?`${b.dir}/${x.name}`:x.name;await fe(pe(t.slug,n,"file",{path:y}),{method:"PUT",headers:{"content-type":x.type||"application/octet-stream"},body:x})}},e[4]=t,e[5]=n,e[6]=o):o=e[6];let a;e[7]!==i||e[8]!==o?(a={mutationFn:o,onSettled:i},e[7]=i,e[8]=o,e[9]=a):a=e[9];const c=We(a);let d;e[10]!==t||e[11]!==n?(d=async b=>{await fe(pe(t.slug,n,"dir",{path:b}),{method:"POST"})},e[10]=t,e[11]=n,e[12]=d):d=e[12];let f;e[13]!==i||e[14]!==d?(f={mutationFn:d,onSuccess:i},e[13]=i,e[14]=d,e[15]=f):f=e[15];const u=We(f);let h;e[16]!==t||e[17]!==n?(h=async b=>{await fe(pe(t.slug,n,"file",{path:b}),{method:"DELETE"})},e[16]=t,e[17]=n,e[18]=h):h=e[18];let m;e[19]!==i||e[20]!==h?(m={mutationFn:h,onSuccess:i},e[19]=i,e[20]=h,e[21]=m):m=e[21];const p=We(m);let g;return e[22]!==u||e[23]!==p||e[24]!==c?(g={upload:c,mkdir:u,remove:p},e[22]=u,e[23]=p,e[24]=c,e[25]=g):g=e[25],g}const yt=S.createContext(null);yt.displayName="PanelGroupContext";const se={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"},Gt=10,Te=S.useLayoutEffect,nn=Cs.useId,El=typeof nn=="function"?nn:()=>null;let Dl=0;function Vt(n=null){const e=El(),t=S.useRef(n||e||null);return t.current===null&&(t.current=""+Dl++),n??t.current}function Bn({children:n,className:e="",collapsedSize:t,collapsible:s,defaultSize:l,forwardedRef:i,id:o,maxSize:a,minSize:c,onCollapse:d,onExpand:f,onResize:u,order:h,style:m,tagName:p="div",...g}){const b=S.useContext(yt);if(b===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:x,expandPanel:y,getPanelSize:j,getPanelStyle:N,groupId:C,isPanelCollapsed:k,reevaluatePanelConstraints:w,registerPanel:B,resizePanel:R,unregisterPanel:_}=b,v=Vt(o),I=S.useRef({callbacks:{onCollapse:d,onExpand:f,onResize:u},constraints:{collapsedSize:t,collapsible:s,defaultSize:l,maxSize:a,minSize:c},id:v,idIsFromProps:o!==void 0,order:h});S.useRef({didLogMissingDefaultSizeWarning:!1}),Te(()=>{const{callbacks:U,constraints:O}=I.current,H={...O};I.current.id=v,I.current.idIsFromProps=o!==void 0,I.current.order=h,U.onCollapse=d,U.onExpand=f,U.onResize=u,O.collapsedSize=t,O.collapsible=s,O.defaultSize=l,O.maxSize=a,O.minSize=c,(H.collapsedSize!==O.collapsedSize||H.collapsible!==O.collapsible||H.maxSize!==O.maxSize||H.minSize!==O.minSize)&&w(I.current,H)}),Te(()=>{const U=I.current;return B(U),()=>{_(U)}},[h,v,B,_]),S.useImperativeHandle(i,()=>({collapse:()=>{x(I.current)},expand:U=>{y(I.current,U)},getId(){return v},getSize(){return j(I.current)},isCollapsed(){return k(I.current)},isExpanded(){return!k(I.current)},resize:U=>{R(I.current,U)}}),[x,y,j,k,v,R]);const Z=N(I.current,l);return S.createElement(p,{...g,children:n,className:e,id:v,style:{...Z,...m},[se.groupId]:C,[se.panel]:"",[se.panelCollapsible]:s||void 0,[se.panelId]:v,[se.panelSize]:parseFloat(""+Z.flexGrow).toFixed(1)})}const Hn=S.forwardRef((n,e)=>S.createElement(Bn,{...n,forwardedRef:e}));Bn.displayName="Panel";Hn.displayName="forwardRef(Panel)";let Rt=null,dt=-1,ze=null;function Tl(n,e){if(e){const t=(e&Vn)!==0,s=(e&Xn)!==0,l=(e&Qn)!==0,i=(e&Yn)!==0;if(t)return l?"se-resize":i?"ne-resize":"e-resize";if(s)return l?"sw-resize":i?"nw-resize":"w-resize";if(l)return"s-resize";if(i)return"n-resize"}switch(n){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function Fl(){ze!==null&&(document.head.removeChild(ze),Rt=null,ze=null,dt=-1)}function Dt(n,e){var t,s;const l=Tl(n,e);if(Rt!==l){if(Rt=l,ze===null&&(ze=document.createElement("style"),document.head.appendChild(ze)),dt>=0){var i;(i=ze.sheet)===null||i===void 0||i.removeRule(dt)}dt=(t=(s=ze.sheet)===null||s===void 0?void 0:s.insertRule(`*{cursor: ${l} !important;}`))!==null&&t!==void 0?t:-1}}function qn(n){return n.type==="keydown"}function Kn(n){return n.type.startsWith("pointer")}function Wn(n){return n.type.startsWith("mouse")}function vt(n){if(Kn(n)){if(n.isPrimary)return{x:n.clientX,y:n.clientY}}else if(Wn(n))return{x:n.clientX,y:n.clientY};return{x:1/0,y:1/0}}function Il(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function Ml(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 Ll(n,e){if(n===e)throw new Error("Cannot compare node with itself");const t={a:rn(n),b:rn(e)};let s;for(;t.a.at(-1)===t.b.at(-1);)n=t.a.pop(),e=t.b.pop(),s=n;G(s,"Stacking order can only be calculated for elements with a common ancestor");const l={a:ln(sn(t.a)),b:ln(sn(t.b))};if(l.a===l.b){const i=s.childNodes,o={a:t.a.at(-1),b:t.b.at(-1)};let a=i.length;for(;a--;){const c=i[a];if(c===o.a)return 1;if(c===o.b)return-1}}return Math.sign(l.a-l.b)}const Ol=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Rl(n){var e;const t=getComputedStyle((e=Gn(n))!==null&&e!==void 0?e:n).display;return t==="flex"||t==="inline-flex"}function Al(n){const e=getComputedStyle(n);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||Rl(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"||Ol.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function sn(n){let e=n.length;for(;e--;){const t=n[e];if(G(t,"Missing node"),Al(t))return t}return null}function ln(n){return n&&Number(getComputedStyle(n).zIndex)||0}function rn(n){const e=[];for(;n;)e.push(n),n=Gn(n);return e}function Gn(n){const{parentNode:e}=n;return e&&e instanceof ShadowRoot?e.host:e}const Vn=1,Xn=2,Qn=4,Yn=8,_l=Il()==="coarse";let xe=[],_e=!1,De=new Map,wt=new Map;const Qe=new Set;function Ul(n,e,t,s,l){var i;const{ownerDocument:o}=e,a={direction:t,element:e,hitAreaMargins:s,setResizeHandlerState:l},c=(i=De.get(o))!==null&&i!==void 0?i:0;return De.set(o,c+1),Qe.add(a),mt(),function(){var f;wt.delete(n),Qe.delete(a);const u=(f=De.get(o))!==null&&f!==void 0?f:1;if(De.set(o,u-1),mt(),u===1&&De.delete(o),xe.includes(a)){const h=xe.indexOf(a);h>=0&&xe.splice(h,1),Qt(),l("up",!0,null)}}}function Bl(n){const{target:e}=n,{x:t,y:s}=vt(n);_e=!0,Xt({target:e,x:t,y:s}),mt(),xe.length>0&&(pt("down",n),n.preventDefault(),Zn(e)||n.stopImmediatePropagation())}function Tt(n){const{x:e,y:t}=vt(n);if(_e&&n.buttons===0&&(_e=!1,pt("up",n)),!_e){const{target:s}=n;Xt({target:s,x:e,y:t})}pt("move",n),Qt(),xe.length>0&&n.preventDefault()}function Ft(n){const{target:e}=n,{x:t,y:s}=vt(n);wt.clear(),_e=!1,xe.length>0&&(n.preventDefault(),Zn(e)||n.stopImmediatePropagation()),pt("up",n),Xt({target:e,x:t,y:s}),Qt(),mt()}function Zn(n){let e=n;for(;e;){if(e.hasAttribute(se.resizeHandle))return!0;e=e.parentElement}return!1}function Xt({target:n,x:e,y:t}){xe.splice(0);let s=null;(n instanceof HTMLElement||n instanceof SVGElement)&&(s=n),Qe.forEach(l=>{const{element:i,hitAreaMargins:o}=l,a=i.getBoundingClientRect(),{bottom:c,left:d,right:f,top:u}=a,h=_l?o.coarse:o.fine;if(e>=d-h&&e<=f+h&&t>=u-h&&t<=c+h){if(s!==null&&document.contains(s)&&i!==s&&!i.contains(s)&&!s.contains(i)&&Ll(s,i)>0){let p=s,g=!1;for(;p&&!p.contains(i);){if(Ml(p.getBoundingClientRect(),a)){g=!0;break}p=p.parentElement}if(g)return}xe.push(l)}})}function It(n,e){wt.set(n,e)}function Qt(){let n=!1,e=!1;xe.forEach(s=>{const{direction:l}=s;l==="horizontal"?n=!0:e=!0});let t=0;wt.forEach(s=>{t|=s}),n&&e?Dt("intersection",t):n?Dt("horizontal",t):e?Dt("vertical",t):Fl()}let Mt=new AbortController;function mt(){Mt.abort(),Mt=new AbortController;const n={capture:!0,signal:Mt.signal};Qe.size&&(_e?(xe.length>0&&De.forEach((e,t)=>{const{body:s}=t;e>0&&(s.addEventListener("contextmenu",Ft,n),s.addEventListener("pointerleave",Tt,n),s.addEventListener("pointermove",Tt,n))}),window.addEventListener("pointerup",Ft,n),window.addEventListener("pointercancel",Ft,n)):De.forEach((e,t)=>{const{body:s}=t;e>0&&(s.addEventListener("pointerdown",Bl,n),s.addEventListener("pointermove",Tt,n))}))}function pt(n,e){Qe.forEach(t=>{const{setResizeHandlerState:s}=t,l=xe.includes(t);s(n,l,e)})}function Hl(){const[n,e]=S.useState(0);return S.useCallback(()=>e(t=>t+1),[])}function G(n,e){if(!n)throw console.error(e),Error(e)}function Ie(n,e,t=Gt){return n.toFixed(t)===e.toFixed(t)?0:n>e?1:-1}function we(n,e,t=Gt){return Ie(n,e,t)===0}function me(n,e,t){return Ie(n,e,t)===0}function ql(n,e,t){if(n.length!==e.length)return!1;for(let s=0;s<n.length;s++){const l=n[s],i=e[s];if(!me(l,i,t))return!1}return!0}function Ae({panelConstraints:n,panelIndex:e,size:t}){const s=n[e];G(s!=null,`Panel constraints not found for index ${e}`);let{collapsedSize:l=0,collapsible:i,maxSize:o=100,minSize:a=0}=s;if(Ie(t,a)<0)if(i){const c=(l+a)/2;Ie(t,c)<0?t=l:t=a}else t=a;return t=Math.min(o,t),t=parseFloat(t.toFixed(Gt)),t}function He({delta:n,initialLayout:e,panelConstraints:t,pivotIndices:s,prevLayout:l,trigger:i}){if(me(n,0))return e;const o=[...e],[a,c]=s;G(a!=null,"Invalid first pivot index"),G(c!=null,"Invalid second pivot index");let d=0;if(i==="keyboard"){{const u=n<0?c:a,h=t[u];G(h,`Panel constraints not found for index ${u}`);const{collapsedSize:m=0,collapsible:p,minSize:g=0}=h;if(p){const b=e[u];if(G(b!=null,`Previous layout not found for panel index ${u}`),me(b,m)){const x=g-b;Ie(x,Math.abs(n))>0&&(n=n<0?0-x:x)}}}{const u=n<0?a:c,h=t[u];G(h,`No panel constraints found for index ${u}`);const{collapsedSize:m=0,collapsible:p,minSize:g=0}=h;if(p){const b=e[u];if(G(b!=null,`Previous layout not found for panel index ${u}`),me(b,g)){const x=b-m;Ie(x,Math.abs(n))>0&&(n=n<0?0-x:x)}}}}{const u=n<0?1:-1;let h=n<0?c:a,m=0;for(;;){const g=e[h];G(g!=null,`Previous layout not found for panel index ${h}`);const x=Ae({panelConstraints:t,panelIndex:h,size:100})-g;if(m+=x,h+=u,h<0||h>=t.length)break}const p=Math.min(Math.abs(n),Math.abs(m));n=n<0?0-p:p}{let h=n<0?a:c;for(;h>=0&&h<t.length;){const m=Math.abs(n)-Math.abs(d),p=e[h];G(p!=null,`Previous layout not found for panel index ${h}`);const g=p-m,b=Ae({panelConstraints:t,panelIndex:h,size:g});if(!me(p,b)&&(d+=p-b,o[h]=b,d.toPrecision(3).localeCompare(Math.abs(n).toPrecision(3),void 0,{numeric:!0})>=0))break;n<0?h--:h++}}if(ql(l,o))return l;{const u=n<0?c:a,h=e[u];G(h!=null,`Previous layout not found for panel index ${u}`);const m=h+d,p=Ae({panelConstraints:t,panelIndex:u,size:m});if(o[u]=p,!me(p,m)){let g=m-p,x=n<0?c:a;for(;x>=0&&x<t.length;){const y=o[x];G(y!=null,`Previous layout not found for panel index ${x}`);const j=y+g,N=Ae({panelConstraints:t,panelIndex:x,size:j});if(me(y,N)||(g-=N-y,o[x]=N),me(g,0))break;n>0?x--:x++}}}const f=o.reduce((u,h)=>h+u,0);return me(f,100)?o:l}function Kl({layout:n,panelsArray:e,pivotIndices:t}){let s=0,l=100,i=0,o=0;const a=t[0];G(a!=null,"No pivot index found"),e.forEach((u,h)=>{const{constraints:m}=u,{maxSize:p=100,minSize:g=0}=m;h===a?(s=g,l=p):(i+=g,o+=p)});const c=Math.min(l,100-i),d=Math.max(s,100-o),f=n[a];return{valueMax:c,valueMin:d,valueNow:f}}function Ye(n,e=document){return Array.from(e.querySelectorAll(`[${se.resizeHandleId}][data-panel-group-id="${n}"]`))}function Jn(n,e,t=document){const l=Ye(n,t).findIndex(i=>i.getAttribute(se.resizeHandleId)===e);return l??null}function es(n,e,t){const s=Jn(n,e,t);return s!=null?[s,s+1]:[-1,-1]}function ts(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 s=e.querySelector(`[data-panel-group][data-panel-group-id="${n}"]`);return s||null}function jt(n,e=document){const t=e.querySelector(`[${se.resizeHandleId}="${n}"]`);return t||null}function Wl(n,e,t,s=document){var l,i,o,a;const c=jt(e,s),d=Ye(n,s),f=c?d.indexOf(c):-1,u=(l=(i=t[f])===null||i===void 0?void 0:i.id)!==null&&l!==void 0?l:null,h=(o=(a=t[f+1])===null||a===void 0?void 0:a.id)!==null&&o!==void 0?o:null;return[u,h]}function Gl({committedValuesRef:n,eagerValuesRef:e,groupId:t,layout:s,panelDataArray:l,panelGroupElement:i,setLayout:o}){S.useRef({didWarnAboutMissingResizeHandle:!1}),Te(()=>{if(!i)return;const a=Ye(t,i);for(let c=0;c<l.length-1;c++){const{valueMax:d,valueMin:f,valueNow:u}=Kl({layout:s,panelsArray:l,pivotIndices:[c,c+1]}),h=a[c];if(h!=null){const m=l[c];G(m,`No panel data found for index "${c}"`),h.setAttribute("aria-controls",m.id),h.setAttribute("aria-valuemax",""+Math.round(d)),h.setAttribute("aria-valuemin",""+Math.round(f)),h.setAttribute("aria-valuenow",u!=null?""+Math.round(u):"")}}return()=>{a.forEach((c,d)=>{c.removeAttribute("aria-controls"),c.removeAttribute("aria-valuemax"),c.removeAttribute("aria-valuemin"),c.removeAttribute("aria-valuenow")})}},[t,s,l,i]),S.useEffect(()=>{if(!i)return;const a=e.current;G(a,"Eager values not found");const{panelDataArray:c}=a,d=ts(t,i);G(d!=null,`No group found for id "${t}"`);const f=Ye(t,i);G(f,`No resize handles found for group id "${t}"`);const u=f.map(h=>{const m=h.getAttribute(se.resizeHandleId);G(m,"Resize handle element has no handle id attribute");const[p,g]=Wl(t,m,c,i);if(p==null||g==null)return()=>{};const b=x=>{if(!x.defaultPrevented)switch(x.key){case"Enter":{x.preventDefault();const y=c.findIndex(j=>j.id===p);if(y>=0){const j=c[y];G(j,`No panel data found for index ${y}`);const N=s[y],{collapsedSize:C=0,collapsible:k,minSize:w=0}=j.constraints;if(N!=null&&k){const B=He({delta:me(N,C)?w-C:C-N,initialLayout:s,panelConstraints:c.map(R=>R.constraints),pivotIndices:es(t,m,i),prevLayout:s,trigger:"keyboard"});s!==B&&o(B)}}break}}};return h.addEventListener("keydown",b),()=>{h.removeEventListener("keydown",b)}});return()=>{u.forEach(h=>h())}},[i,n,e,t,s,l,o])}function on(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 ns(n,e){const t=n==="horizontal",{x:s,y:l}=vt(e);return t?s:l}function Vl(n,e,t,s,l){const i=t==="horizontal",o=jt(e,l);G(o,`No resize handle element found for id "${e}"`);const a=o.getAttribute(se.groupId);G(a,"Resize handle element has no group id attribute");let{initialCursorPosition:c}=s;const d=ns(t,n),f=ts(a,l);G(f,`No group element found for id "${a}"`);const u=f.getBoundingClientRect(),h=i?u.width:u.height;return(d-c)/h*100}function Xl(n,e,t,s,l,i){if(qn(n)){const o=t==="horizontal";let a=0;n.shiftKey?a=100:l!=null?a=l:a=10;let c=0;switch(n.key){case"ArrowDown":c=o?0:a;break;case"ArrowLeft":c=o?-a:0;break;case"ArrowRight":c=o?a:0;break;case"ArrowUp":c=o?0:-a;break;case"End":c=100;break;case"Home":c=-100;break}return c}else return s==null?0:Vl(n,e,t,s,i)}function Ql({panelDataArray:n}){const e=Array(n.length),t=n.map(i=>i.constraints);let s=0,l=100;for(let i=0;i<n.length;i++){const o=t[i];G(o,`Panel constraints not found for index ${i}`);const{defaultSize:a}=o;a!=null&&(s++,e[i]=a,l-=a)}for(let i=0;i<n.length;i++){const o=t[i];G(o,`Panel constraints not found for index ${i}`);const{defaultSize:a}=o;if(a!=null)continue;const c=n.length-s,d=l/c;s++,e[i]=d,l-=d}return e}function Le(n,e,t){e.forEach((s,l)=>{const i=n[l];G(i,`Panel data not found for index ${l}`);const{callbacks:o,constraints:a,id:c}=i,{collapsedSize:d=0,collapsible:f}=a,u=t[c];if(u==null||s!==u){t[c]=s;const{onCollapse:h,onExpand:m,onResize:p}=o;p&&p(s,u),f&&(h||m)&&(m&&(u==null||we(u,d))&&!we(s,d)&&m(),h&&(u==null||!we(u,d))&&we(s,d)&&h())}})}function ct(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 Yl({defaultSize:n,dragState:e,layout:t,panelData:s,panelIndex:l,precision:i=3}){const o=t[l];let a;return o==null?a=n!=null?n.toPrecision(i):"1":s.length===1?a="1":a=o.toPrecision(i),{flexBasis:0,flexGrow:a,flexShrink:1,overflow:"hidden",pointerEvents:e!==null?"none":void 0}}function Zl(n,e=10){let t=null;return(...l)=>{t!==null&&clearTimeout(t),t=setTimeout(()=>{n(...l)},e)}}function an(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 ss(n){return`react-resizable-panels:${n}`}function ls(n){return n.map(e=>{const{constraints:t,id:s,idIsFromProps:l,order:i}=e;return l?s:i?`${i}:${JSON.stringify(t)}`:JSON.stringify(t)}).sort((e,t)=>e.localeCompare(t)).join(",")}function rs(n,e){try{const t=ss(n),s=e.getItem(t);if(s){const l=JSON.parse(s);if(typeof l=="object"&&l!=null)return l}}catch{}return null}function Jl(n,e,t){var s,l;const i=(s=rs(n,t))!==null&&s!==void 0?s:{},o=ls(e);return(l=i[o])!==null&&l!==void 0?l:null}function er(n,e,t,s,l){var i;const o=ss(n),a=ls(e),c=(i=rs(n,l))!==null&&i!==void 0?i:{};c[a]={expandToSizes:Object.fromEntries(t.entries()),layout:s};try{l.setItem(o,JSON.stringify(c))}catch(d){console.error(d)}}function cn({layout:n,panelConstraints:e}){const t=[...n],s=t.reduce((i,o)=>i+o,0);if(t.length!==e.length)throw Error(`Invalid ${e.length} panel layout: ${t.map(i=>`${i}%`).join(", ")}`);if(!me(s,100)&&t.length>0)for(let i=0;i<e.length;i++){const o=t[i];G(o!=null,`No layout data found for index ${i}`);const a=100/s*o;t[i]=a}let l=0;for(let i=0;i<e.length;i++){const o=t[i];G(o!=null,`No layout data found for index ${i}`);const a=Ae({panelConstraints:e,panelIndex:i,size:o});o!=a&&(l+=o-a,t[i]=a)}if(!me(l,0))for(let i=0;i<e.length;i++){const o=t[i];G(o!=null,`No layout data found for index ${i}`);const a=o+l,c=Ae({panelConstraints:e,panelIndex:i,size:a});if(o!==c&&(l-=c-o,t[i]=c,me(l,0)))break}return t}const tr=100,qe={getItem:n=>(an(qe),qe.getItem(n)),setItem:(n,e)=>{an(qe),qe.setItem(n,e)}},dn={};function is({autoSaveId:n=null,children:e,className:t="",direction:s,forwardedRef:l,id:i=null,onLayout:o=null,keyboardResizeBy:a=null,storage:c=qe,style:d,tagName:f="div",...u}){const h=Vt(i),m=S.useRef(null),[p,g]=S.useState(null),[b,x]=S.useState([]),y=Hl(),j=S.useRef({}),N=S.useRef(new Map),C=S.useRef(0),k=S.useRef({autoSaveId:n,direction:s,dragState:p,id:h,keyboardResizeBy:a,onLayout:o,storage:c}),w=S.useRef({layout:b,panelDataArray:[],panelDataArrayChanged:!1});S.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),S.useImperativeHandle(l,()=>({getId:()=>k.current.id,getLayout:()=>{const{layout:z}=w.current;return z},setLayout:z=>{const{onLayout:F}=k.current,{layout:M,panelDataArray:L}=w.current,D=cn({layout:z,panelConstraints:L.map(A=>A.constraints)});on(M,D)||(x(D),w.current.layout=D,F&&F(D),Le(L,D,j.current))}}),[]),Te(()=>{k.current.autoSaveId=n,k.current.direction=s,k.current.dragState=p,k.current.id=h,k.current.onLayout=o,k.current.storage=c}),Gl({committedValuesRef:k,eagerValuesRef:w,groupId:h,layout:b,panelDataArray:w.current.panelDataArray,setLayout:x,panelGroupElement:m.current}),S.useEffect(()=>{const{panelDataArray:z}=w.current;if(n){if(b.length===0||b.length!==z.length)return;let F=dn[n];F==null&&(F=Zl(er,tr),dn[n]=F);const M=[...z],L=new Map(N.current);F(n,M,L,b,c)}},[n,b,c]),S.useEffect(()=>{});const B=S.useCallback(z=>{const{onLayout:F}=k.current,{layout:M,panelDataArray:L}=w.current;if(z.constraints.collapsible){const D=L.map(he=>he.constraints),{collapsedSize:A=0,panelSize:Q,pivotIndices:te}=Ee(L,z,M);if(G(Q!=null,`Panel size not found for panel "${z.id}"`),!we(Q,A)){N.current.set(z.id,Q);const P=Oe(L,z)===L.length-1?Q-A:A-Q,V=He({delta:P,initialLayout:M,panelConstraints:D,pivotIndices:te,prevLayout:M,trigger:"imperative-api"});ct(M,V)||(x(V),w.current.layout=V,F&&F(V),Le(L,V,j.current))}}},[]),R=S.useCallback((z,F)=>{const{onLayout:M}=k.current,{layout:L,panelDataArray:D}=w.current;if(z.constraints.collapsible){const A=D.map(ne=>ne.constraints),{collapsedSize:Q=0,panelSize:te=0,minSize:he=0,pivotIndices:P}=Ee(D,z,L),V=F??he;if(we(te,Q)){const ne=N.current.get(z.id),ge=ne!=null&&ne>=V?ne:V,$e=Oe(D,z)===D.length-1?te-ge:ge-te,oe=He({delta:$e,initialLayout:L,panelConstraints:A,pivotIndices:P,prevLayout:L,trigger:"imperative-api"});ct(L,oe)||(x(oe),w.current.layout=oe,M&&M(oe),Le(D,oe,j.current))}}},[]),_=S.useCallback(z=>{const{layout:F,panelDataArray:M}=w.current,{panelSize:L}=Ee(M,z,F);return G(L!=null,`Panel size not found for panel "${z.id}"`),L},[]),v=S.useCallback((z,F)=>{const{panelDataArray:M}=w.current,L=Oe(M,z);return Yl({defaultSize:F,dragState:p,layout:b,panelData:M,panelIndex:L})},[p,b]),I=S.useCallback(z=>{const{layout:F,panelDataArray:M}=w.current,{collapsedSize:L=0,collapsible:D,panelSize:A}=Ee(M,z,F);return G(A!=null,`Panel size not found for panel "${z.id}"`),D===!0&&we(A,L)},[]),Z=S.useCallback(z=>{const{layout:F,panelDataArray:M}=w.current,{collapsedSize:L=0,collapsible:D,panelSize:A}=Ee(M,z,F);return G(A!=null,`Panel size not found for panel "${z.id}"`),!D||Ie(A,L)>0},[]),U=S.useCallback(z=>{const{panelDataArray:F}=w.current;F.push(z),F.sort((M,L)=>{const D=M.order,A=L.order;return D==null&&A==null?0:D==null?-1:A==null?1:D-A}),w.current.panelDataArrayChanged=!0,y()},[y]);Te(()=>{if(w.current.panelDataArrayChanged){w.current.panelDataArrayChanged=!1;const{autoSaveId:z,onLayout:F,storage:M}=k.current,{layout:L,panelDataArray:D}=w.current;let A=null;if(z){const te=Jl(z,D,M);te&&(N.current=new Map(Object.entries(te.expandToSizes)),A=te.layout)}A==null&&(A=Ql({panelDataArray:D}));const Q=cn({layout:A,panelConstraints:D.map(te=>te.constraints)});on(L,Q)||(x(Q),w.current.layout=Q,F&&F(Q),Le(D,Q,j.current))}}),Te(()=>{const z=w.current;return()=>{z.layout=[]}},[]);const O=S.useCallback(z=>{let F=!1;const M=m.current;return M&&window.getComputedStyle(M,null).getPropertyValue("direction")==="rtl"&&(F=!0),function(D){D.preventDefault();const A=m.current;if(!A)return()=>null;const{direction:Q,dragState:te,id:he,keyboardResizeBy:P,onLayout:V}=k.current,{layout:ne,panelDataArray:ge}=w.current,{initialLayout:Se}=te??{},$e=es(he,z,A);let oe=Xl(D,z,Q,te,P,A);const rt=Q==="horizontal";rt&&F&&(oe=-oe);const $t=ge.map(Pt=>Pt.constraints),Pe=He({delta:oe,initialLayout:Se??ne,panelConstraints:$t,pivotIndices:$e,prevLayout:ne,trigger:qn(D)?"keyboard":"mouse-or-touch"}),it=!ct(ne,Pe);(Kn(D)||Wn(D))&&C.current!=oe&&(C.current=oe,!it&&oe!==0?rt?It(z,oe<0?Vn:Xn):It(z,oe<0?Qn:Yn):It(z,0)),it&&(x(Pe),w.current.layout=Pe,V&&V(Pe),Le(ge,Pe,j.current))}},[]),H=S.useCallback((z,F)=>{const{onLayout:M}=k.current,{layout:L,panelDataArray:D}=w.current,A=D.map(ne=>ne.constraints),{panelSize:Q,pivotIndices:te}=Ee(D,z,L);G(Q!=null,`Panel size not found for panel "${z.id}"`);const P=Oe(D,z)===D.length-1?Q-F:F-Q,V=He({delta:P,initialLayout:L,panelConstraints:A,pivotIndices:te,prevLayout:L,trigger:"imperative-api"});ct(L,V)||(x(V),w.current.layout=V,M&&M(V),Le(D,V,j.current))},[]),W=S.useCallback((z,F)=>{const{layout:M,panelDataArray:L}=w.current,{collapsedSize:D=0,collapsible:A}=F,{collapsedSize:Q=0,collapsible:te,maxSize:he=100,minSize:P=0}=z.constraints,{panelSize:V}=Ee(L,z,M);V!=null&&(A&&te&&we(V,D)?we(D,Q)||H(z,Q):V<P?H(z,P):V>he&&H(z,he))},[H]),q=S.useCallback((z,F)=>{const{direction:M}=k.current,{layout:L}=w.current;if(!m.current)return;const D=jt(z,m.current);G(D,`Drag handle element not found for id "${z}"`);const A=ns(M,F);g({dragHandleId:z,dragHandleRect:D.getBoundingClientRect(),initialCursorPosition:A,initialLayout:L})},[]),ee=S.useCallback(()=>{g(null)},[]),Y=S.useCallback(z=>{const{panelDataArray:F}=w.current,M=Oe(F,z);M>=0&&(F.splice(M,1),delete j.current[z.id],w.current.panelDataArrayChanged=!0,y())},[y]),T=S.useMemo(()=>({collapsePanel:B,direction:s,dragState:p,expandPanel:R,getPanelSize:_,getPanelStyle:v,groupId:h,isPanelCollapsed:I,isPanelExpanded:Z,reevaluatePanelConstraints:W,registerPanel:U,registerResizeHandle:O,resizePanel:H,startDragging:q,stopDragging:ee,unregisterPanel:Y,panelGroupElement:m.current}),[B,p,s,R,_,v,h,I,Z,W,U,O,H,q,ee,Y]),K={display:"flex",flexDirection:s==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return S.createElement(yt.Provider,{value:T},S.createElement(f,{...u,children:e,className:t,id:i,ref:m,style:{...K,...d},[se.group]:"",[se.groupDirection]:s,[se.groupId]:h}))}const os=S.forwardRef((n,e)=>S.createElement(is,{...n,forwardedRef:e}));is.displayName="PanelGroup";os.displayName="forwardRef(PanelGroup)";function Oe(n,e){return n.findIndex(t=>t===e||t.id===e.id)}function Ee(n,e,t){const s=Oe(n,e),i=s===n.length-1?[s-1,s]:[s,s+1],o=t[s];return{...e.constraints,panelSize:o,pivotIndices:i}}function nr({disabled:n,handleId:e,resizeHandler:t,panelGroupElement:s}){S.useEffect(()=>{if(n||t==null||s==null)return;const l=jt(e,s);if(l==null)return;const i=o=>{if(!o.defaultPrevented)switch(o.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{o.preventDefault(),t(o);break}case"F6":{o.preventDefault();const a=l.getAttribute(se.groupId);G(a,`No group element found for id "${a}"`);const c=Ye(a,s),d=Jn(a,e,s);G(d!==null,`No resize element found for id "${e}"`);const f=o.shiftKey?d>0?d-1:c.length-1:d+1<c.length?d+1:0;c[f].focus();break}}};return l.addEventListener("keydown",i),()=>{l.removeEventListener("keydown",i)}},[s,n,e,t])}function as({children:n=null,className:e="",disabled:t=!1,hitAreaMargins:s,id:l,onBlur:i,onClick:o,onDragging:a,onFocus:c,onPointerDown:d,onPointerUp:f,style:u={},tabIndex:h=0,tagName:m="div",...p}){var g,b;const x=S.useRef(null),y=S.useRef({onClick:o,onDragging:a,onPointerDown:d,onPointerUp:f});S.useEffect(()=>{y.current.onClick=o,y.current.onDragging=a,y.current.onPointerDown=d,y.current.onPointerUp=f});const j=S.useContext(yt);if(j===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:N,groupId:C,registerResizeHandle:k,startDragging:w,stopDragging:B,panelGroupElement:R}=j,_=Vt(l),[v,I]=S.useState("inactive"),[Z,U]=S.useState(!1),[O,H]=S.useState(null),W=S.useRef({state:v});Te(()=>{W.current.state=v}),S.useEffect(()=>{if(t)H(null);else{const T=k(_);H(()=>T)}},[t,_,k]);const q=(g=s?.coarse)!==null&&g!==void 0?g:15,ee=(b=s?.fine)!==null&&b!==void 0?b:5;S.useEffect(()=>{if(t||O==null)return;const T=x.current;G(T,"Element ref not attached");let K=!1;return Ul(_,T,N,{coarse:q,fine:ee},(F,M,L)=>{if(!M){I("inactive");return}switch(F){case"down":{I("drag"),K=!1,G(L,'Expected event to be defined for "down" action'),w(_,L);const{onDragging:D,onPointerDown:A}=y.current;D?.(!0),A?.();break}case"move":{const{state:D}=W.current;K=!0,D!=="drag"&&I("hover"),G(L,'Expected event to be defined for "move" action'),O(L);break}case"up":{I("hover"),B();const{onClick:D,onDragging:A,onPointerUp:Q}=y.current;A?.(!1),Q?.(),K||D?.();break}}})},[q,N,t,ee,k,_,O,w,B]),nr({disabled:t,handleId:_,resizeHandler:O,panelGroupElement:R});const Y={touchAction:"none",userSelect:"none"};return S.createElement(m,{...p,children:n,className:e,id:l,onBlur:()=>{U(!1),i?.()},onFocus:()=>{U(!0),c?.()},ref:x,role:"separator",style:{...Y,...u},tabIndex:h,[se.groupDirection]:N,[se.groupId]:C,[se.resizeHandle]:"",[se.resizeHandleActive]:v==="drag"?"pointer":Z?"keyboard":void 0,[se.resizeHandleEnabled]:!t,[se.resizeHandleId]:_,[se.resizeHandleState]:v})}as.displayName="PanelResizeHandle";function sr(n){const e=$.c(10);let t,s,l;e[0]!==n?({className:t,ref:l,...s}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=l):(t=e[1],s=e[2],l=e[3]);let i;e[4]!==t?(i=ce("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",t),e[4]=t,e[5]=i):i=e[5];let o;return e[6]!==s||e[7]!==l||e[8]!==i?(o=r.jsx(os,{ref:l,"data-slot":"resizable-panel-group",className:i,...s}),e[6]=s,e[7]=l,e[8]=i,e[9]=o):o=e[9],o}function un(n){const e=$.c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let s;return e[2]!==t?(s=r.jsx(Hn,{"data-slot":"resizable-panel",...t}),e[2]=t,e[3]=s):s=e[3],s}function lr(n){const e=$.c(12);let t,s,l;e[0]!==n?({withHandle:l,className:t,...s}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=l):(t=e[1],s=e[2],l=e[3]);let i;e[4]!==t?(i=ce("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]=i):i=e[5];let o;e[6]!==l?(o=l&&r.jsx("div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:r.jsx(Xs,{className:"size-2.5"})}),e[6]=l,e[7]=o):o=e[7];let a;return e[8]!==s||e[9]!==i||e[10]!==o?(a=r.jsx(as,{"data-slot":"resizable-handle",className:i,...s,children:o}),e[8]=s,e[9]=i,e[10]=o,e[11]=a):a=e[11],a}function rr(n){if(!n||n.includes("\\")||n.includes("..")||n.includes("\0"))return!0;try{const e=decodeURIComponent(n);if(e.includes("\\")||e.includes("..")||e.includes("\0"))return!0;if(e!==n&&e.includes("/")){const t=(n.match(/\//g)??[]).length;if((e.match(/\//g)??[]).length>t)return!0}return!1}catch{return!0}}function ir(n){if(rr(n))throw new Error(`Invalid block key: ${n||"(empty)"}`)}function or(n){try{return decodeURIComponent(n)}catch{return n}}function ar(n){return ir(n),encodeURIComponent(n)}function cr(n){return`.deco/blocks/${ar(n)}.json`}function Ao(n){return`/${cr(n)}`}const _o=1e4,dr=3;function At(n){return n.trim()?(n.startsWith("/")?n:`/${n}`).replace(/\/+/g,"/"):"/"}function kt(n){return n.startsWith("/")?n.slice(1):n}function Uo(n){const e=kt(n);return!e||e.includes("..")||e.includes("\\")?!1:e.startsWith(".deco/blocks/")||!e.startsWith("/")&&!e.includes("://")}function xt(n){return n.trim()?n.startsWith("/")?n:`/${n}`:"/"}function ur(n){const e=xt(n);if(e==="/")return"/";const t=e.split("/").filter(Boolean);return t.pop(),t.length===0?"/":`/${t.join("/")}`}function Bo(n,e){const t=e.replace(/^\/+|\/+$/g,"");return xt(t?`${n==="/"?"":n}/${t}`:n)}function Ho(n,e){return e==="directory"?n:ur(n)}function qo(n){const e=n.trim();return e?e.includes("/")||e.includes("\\")||e.includes("..")||e.includes("\0")?"Name cannot contain /, \\, or ..":null:"Name is required"}function fr(n){const e=kt(n);return e?e.split("/").filter(Boolean).length:0}function Ko(n,e,t,s=!1){return{files:[...new Set([...n,...t.files])],directories:[...new Set([...e,...t.directories??[]])],truncated:s||!!t.truncated}}function Wo(n,e){return fr(n)>=dr&&!e.has(n)}function Go(n,e,t=[]){const s=kt(n);if(e.includes(s)||t.includes(s))return!0;if(!s)return!1;const l=`${s}/`;return e.some(i=>i.startsWith(l))||t.some(i=>i.startsWith(l))}function Vo(n){const e=kt(n),t=".deco/blocks/";if(!e.startsWith(t)||!e.endsWith(".json"))return null;const s=e.slice(t.length,-5);return or(s)}function hr(n){if(!n)return"plaintext";const e=n.toLowerCase();return e.endsWith(".tsx")||e.endsWith(".ts")?"typescript":e.endsWith(".jsx")||e.endsWith(".js")||e.endsWith(".mjs")||e.endsWith(".cjs")?"javascript":e.endsWith(".json")?"json":e.endsWith(".md")||e.endsWith(".mdx")?"markdown":e.endsWith(".css")?"css":e.endsWith(".scss")?"scss":e.endsWith(".html")?"html":e.endsWith(".yaml")||e.endsWith(".yml")?"yaml":e.endsWith(".xml")||e.endsWith(".svg")?"xml":e.endsWith(".py")?"python":e.endsWith(".sql")?"sql":e.endsWith(".sh")?"shell":"plaintext"}const mr="#94a3b8";function Xo(n){const e=n.toLowerCase();return e.endsWith(".tsx")||e.endsWith(".ts")?{Icon:at,color:"#3b82f6"}:e.endsWith(".jsx")||e.endsWith(".js")||e.endsWith(".mjs")||e.endsWith(".cjs")?{Icon:at,color:"#d9a441"}:e.endsWith(".json")?{Icon:Qs,color:"#cb9b3f"}:e.endsWith(".css")||e.endsWith(".scss")?{Icon:at,color:"#06b6d4"}:e.endsWith(".html")||e.endsWith(".xml")?{Icon:at,color:"#f97316"}:/\.(png|jpe?g|gif|webp|avif|ico|svg)$/.test(e)?{Icon:fl,color:"#a855f7"}:e.endsWith(".md")||e.endsWith(".mdx")?{Icon:tn,color:"#64748b"}:{Icon:tn,color:mr}}function Qo(n){const e=At(n).split("/").filter(Boolean),t=["/"];let s="";for(const l of e.slice(0,-1))s+=`/${l}`,t.push(s);return t}function Yo(n,e=[]){const t={children:[]},s=i=>{const a=At(i).split("/").filter(Boolean);let c=t,d="";for(const f of a){d+=`/${f}`;let u=c.children.find(h=>h.name===f);u?u.kind==="file"&&(u.kind="directory"):(u={name:f,path:d,kind:"directory",children:[]},c.children.push(u)),c=u}};for(const i of n){const a=At(i).split("/").filter(Boolean);let c=t,d="";a.forEach((f,u)=>{d+=`/${f}`;const h=u===a.length-1;let m=c.children.find(p=>p.name===f);m||(m={name:f,path:d,kind:h?"file":"directory",children:[]},c.children.push(m)),c=m})}for(const i of e)s(xt(i));const l=i=>{i.sort((o,a)=>o.kind!==a.kind?o.kind==="directory"?-1:1:o.name.localeCompare(a.name));for(const o of i)o.children.length>0&&l(o.children)};return l(t.children),t.children}function pr(n,e,t=0){const s=[];for(const l of n)l.name!==".gitkeep"&&(s.push({node:l,depth:t}),l.kind==="directory"&&l.children.length>0&&e.has(l.path)&&s.push(...pr(l.children,e,t+1)));return s}function Zo(n){return n.split(`
2
2
  `).map(e=>{const t=e.match(/^\d+\t(.*)/);return t?t[1]:e}).join(`
3
3
  `)}dl.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});function xr(n){const e=$.c(11),{value:t,filename:s}=n,[l]=$s(),i=l.theme==="dark"||l.theme==="system"&&typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches;let o;e[0]!==s?(o=hr(s),e[0]=s,e[1]=o):o=e[1];const a=i?"vs-dark":"light";let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=r.jsx("div",{className:"flex h-full w-full items-center justify-center",children:r.jsx(Ps,{size:20,className:"animate-spin text-muted-foreground"})}),e[2]=c):c=e[2];let d,f;e[3]===Symbol.for("react.memo_cache_sentinel")?(d={enabled:!1},f={top:12,bottom:12},e[3]=d,e[4]=f):(d=e[3],f=e[4]);let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u={readOnly:!0,domReadOnly:!0,fontSize:13,scrollBeyondLastLine:!1,automaticLayout:!0,lineNumbersMinChars:3,wordWrap:"on",minimap:d,padding:f,renderLineHighlight:"none",scrollbar:{vertical:"auto",horizontal:"auto",verticalScrollbarSize:8,horizontalScrollbarSize:8}},e[5]=u):u=e[5];let h;return e[6]!==s||e[7]!==o||e[8]!==a||e[9]!==t?(h=r.jsx(ul,{path:s,language:o,value:t,theme:a,loading:c,options:u},s),e[6]=s,e[7]=o,e[8]=a,e[9]=t,e[10]=h):h=e[10],h}function cs(n){return n<1024?`${n} B`:n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/(1024*1024)).toFixed(1)} MB`}const gr=new Set(["png","jpg","jpeg","gif","webp","svg","avif"]),br=new Set(["txt","json","csv","tsv","log","yaml","yml","xml","toml","ts","tsx","js","jsx","py","rb","go","rs","java","sh","sql"]),fn=2*1024*1024;function yr(n,e){const t=n.split(".").pop()?.toLowerCase()??"";return gr.has(t)?"image":t==="pdf"?"pdf":t==="html"||t==="htm"?"html":t==="md"||t==="markdown"?e<=fn?"markdown":"download":br.has(t)&&e<=fn?"text":"download"}function ds(){const n=$.c(2);let e;n[0]===Symbol.for("react.memo_cache_sentinel")?(e=r.jsx(ae,{className:"h-6 w-2/3"}),n[0]=e):e=n[0];let t;return n[1]===Symbol.for("react.memo_cache_sentinel")?(t=r.jsx("div",{className:"flex h-full w-full items-center justify-center",children:r.jsxs("div",{className:"flex w-3/4 max-w-md flex-col gap-3 p-6",children:[e,r.jsxs("div",{className:"flex flex-col gap-1.5",children:[r.jsx(ae,{className:"h-3 w-full"}),r.jsx(ae,{className:"h-3 w-5/6"}),r.jsx(ae,{className:"h-3 w-2/3"})]})]})}),n[1]=t):t=n[1],t}function us(n){const e=$.c(20),{file:t,note:s}=n;let l;e[0]!==t.filename?(l=r.jsx(ke,{filename:t.filename,className:"h-12 w-10"}),e[0]=t.filename,e[1]=l):l=e[1];let i;e[2]!==t.filename?(i=r.jsx("span",{className:"text-sm font-medium text-foreground",children:t.filename}),e[2]=t.filename,e[3]=i):i=e[3];let o;e[4]!==t.size?(o=cs(t.size),e[4]=t.size,e[5]=o):o=e[5];const a=s?` · ${s}`:"";let c;e[6]!==o||e[7]!==a?(c=r.jsxs("span",{className:"text-xs text-muted-foreground",children:[o,a]}),e[6]=o,e[7]=a,e[8]=c):c=e[8];let d;e[9]!==i||e[10]!==c?(d=r.jsxs("div",{className:"flex flex-col items-center gap-0.5",children:[i,c]}),e[9]=i,e[10]=c,e[11]=d):d=e[11];let f;e[12]===Symbol.for("react.memo_cache_sentinel")?(f=r.jsx(Xe,{size:14}),e[12]=f):f=e[12];let u;e[13]!==t.downloadUrl||e[14]!==t.filename?(u=r.jsx(J,{asChild:!0,variant:"outline",size:"sm",children:r.jsxs("a",{href:t.downloadUrl,download:t.filename,children:[f,"Download"]})}),e[13]=t.downloadUrl,e[14]=t.filename,e[15]=u):u=e[15];let h;return e[16]!==l||e[17]!==d||e[18]!==u?(h=r.jsx("div",{className:"flex h-full w-full items-center justify-center",children:r.jsxs("div",{className:"flex flex-col items-center gap-3 rounded-xl border border-border bg-muted/30 px-10 py-8",children:[l,d,u]})}),e[16]=l,e[17]=d,e[18]=u,e[19]=h):h=e[19],h}function hn(n){const e=$.c(16),{file:t,markdown:s}=n;let l;e[0]!==t.downloadUrl?(l=X.fileText(t.downloadUrl),e[0]=t.downloadUrl,e[1]=l):l=e[1];let i;e[2]!==t.downloadUrl?(i=async()=>{const u=await fetch(t.downloadUrl,{credentials:"include"});if(!u.ok)throw new Error(`fetch failed: ${u.status}`);return u.text()},e[2]=t.downloadUrl,e[3]=i):i=e[3];let o;e[4]!==l||e[5]!==i?(o={queryKey:l,queryFn:i,staleTime:6e4,retry:!1},e[4]=l,e[5]=i,e[6]=o):o=e[6];const{data:a,isPending:c,isError:d}=ie(o);if(c){let u;return e[7]===Symbol.for("react.memo_cache_sentinel")?(u=r.jsx(ds,{}),e[7]=u):u=e[7],u}if(d||a===void 0){let u;return e[8]!==t?(u=r.jsx(us,{file:t,note:"preview unavailable"}),e[8]=t,e[9]=u):u=e[9],u}if(s){const u=`file-preview-${t.key}`;let h;return e[10]!==a||e[11]!==u?(h=r.jsx("div",{className:"h-full overflow-y-auto",children:r.jsx("div",{className:"prose prose-sm dark:prose-invert mx-auto max-w-3xl px-6 py-6",children:r.jsx(Bt,{id:u,text:a})})}),e[10]=a,e[11]=u,e[12]=h):h=e[12],h}let f;return e[13]!==a||e[14]!==t.filename?(f=r.jsx(xr,{value:a,filename:t.filename}),e[13]=a,e[14]=t.filename,e[15]=f):f=e[15],f}function fs(n){const e=$.c(15),{file:t}=n;switch(yr(t.filename,t.size)){case"image":{let l;return e[0]!==t.downloadUrl||e[1]!==t.filename?(l=r.jsx("div",{className:"flex h-full w-full items-center justify-center overflow-auto bg-muted/30 p-4",children:r.jsx("img",{src:t.downloadUrl,alt:t.filename,className:"max-h-full max-w-full rounded-lg object-contain"})}),e[0]=t.downloadUrl,e[1]=t.filename,e[2]=l):l=e[2],l}case"pdf":{let l;return e[3]!==t.downloadUrl||e[4]!==t.filename?(l=r.jsx("iframe",{src:t.downloadUrl,title:t.filename,className:"block h-full w-full bg-white"}),e[3]=t.downloadUrl,e[4]=t.filename,e[5]=l):l=e[5],l}case"html":{let l;return e[6]!==t.downloadUrl||e[7]!==t.filename?(l=r.jsx("iframe",{src:t.downloadUrl,title:t.filename,sandbox:"allow-scripts",className:"block h-full w-full bg-white"}),e[6]=t.downloadUrl,e[7]=t.filename,e[8]=l):l=e[8],l}case"markdown":{let l;return e[9]!==t?(l=r.jsx(hn,{file:t,markdown:!0}),e[9]=t,e[10]=l):l=e[10],l}case"text":{let l;return e[11]!==t?(l=r.jsx(hn,{file:t,markdown:!1}),e[11]=t,e[12]=l):l=e[12],l}default:{let l;return e[13]!==t?(l=r.jsx(us,{file:t}),e[13]=t,e[14]=l):l=e[14],l}}}function vr(n){const e=$.c(40),{readUrl:t,editor:s,downloadName:l,trailing:i}=n;let o;e[0]!==t?(o=new URL(t,window.location.origin).toString(),e[0]=t,e[1]=o):o=e[1];const a=o;let c;e[2]!==s?(c=s.deckDetected&&r.jsxs(be,{children:[r.jsx(ye,{asChild:!0,children:r.jsx(J,{variant:s.railOpen?"secondary":"ghost",size:"icon","aria-label":s.railOpen?"Hide slide list":"Show slide list",onClick:()=>s.setRailOpen(!s.railOpen),children:r.jsx(hl,{size:14})})}),r.jsx(ve,{side:"bottom",children:s.railOpen?"Hide slide list":"Show slide list"})]}),e[2]=s,e[3]=c):c=e[3];let d;e[4]!==a?(d=()=>window.open(a,"_blank","noopener"),e[4]=a,e[5]=d):d=e[5];let f;e[6]!==a?(f=r.jsx("span",{className:"truncate",children:a}),e[6]=a,e[7]=f):f=e[7];let u;e[8]!==a||e[9]!==d||e[10]!==f?(u=r.jsx("button",{type:"button",onClick:d,className:"flex min-w-0 flex-1 items-center rounded-md px-2 py-1 text-left text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",title:a,children:f}),e[8]=a,e[9]=d,e[10]=f,e[11]=u):u=e[11];let h;e[12]!==s.agentUpdated||e[13]!==s.reload?(h=s.agentUpdated&&r.jsxs(be,{children:[r.jsx(ye,{asChild:!0,children:r.jsxs(J,{variant:"outline",size:"sm",className:"h-7 gap-1 text-xs",onClick:s.reload,children:[r.jsx(jn,{size:12}),"Agent updated — reload"]})}),r.jsx(ve,{side:"bottom",children:"The agent rewrote this deck while you were editing. Reloading discards unsaved differences."})]}),e[12]=s.agentUpdated,e[13]=s.reload,e[14]=h):h=e[14];let m;e[15]!==s.saving?(m=s.saving&&r.jsx("span",{className:"px-1 text-xs text-muted-foreground",children:"Saving…"}),e[15]=s.saving,e[16]=m):m=e[16];let p;e[17]!==s?(p=s.deckDetected&&s.writable&&r.jsxs(be,{children:[r.jsx(ye,{asChild:!0,children:r.jsx(J,{variant:s.editMode?"secondary":"ghost",size:"icon","aria-label":s.editMode?"Done editing":"Edit inline",className:ce(s.editMode&&"text-primary"),onClick:()=>s.setEditMode(!s.editMode),children:r.jsx(Ys,{size:14})})}),r.jsx(ve,{side:"bottom",children:s.editMode?"Done editing":"Edit inline (text, reorder, delete)"})]}),e[17]=s,e[18]=p):p=e[18];let g;e[19]!==a||e[20]!==l||e[21]!==s.deckDetected?(g=s.deckDetected?r.jsxs(Ht,{children:[r.jsx(qt,{asChild:!0,children:r.jsx(J,{variant:"ghost",size:"icon","aria-label":"Download",children:r.jsx(Xe,{size:14})})}),r.jsxs(Kt,{align:"end",children:[r.jsxs(Fe,{onClick:()=>window.open(`${a}#print`,"_blank","noopener"),children:[r.jsx(Zs,{size:14}),"Export as PDF"]}),r.jsx(Fe,{asChild:!0,children:r.jsxs("a",{href:a,download:l,children:[r.jsx(Js,{size:14}),"Download HTML"]})})]})]}):r.jsxs(be,{children:[r.jsx(ye,{asChild:!0,children:r.jsx(J,{variant:"ghost",size:"icon","aria-label":"Download",asChild:!0,children:r.jsx("a",{href:a,download:l,children:r.jsx(Xe,{size:14})})})}),r.jsx(ve,{side:"bottom",children:"Download"})]}),e[19]=a,e[20]=l,e[21]=s.deckDetected,e[22]=g):g=e[22];let b;e[23]!==a?(b=()=>window.open(a,"_blank","noopener"),e[23]=a,e[24]=b):b=e[24];let x;e[25]===Symbol.for("react.memo_cache_sentinel")?(x=r.jsx(Mn,{size:14}),e[25]=x):x=e[25];let y;e[26]!==b?(y=r.jsx(ye,{asChild:!0,children:r.jsx(J,{variant:"ghost",size:"icon","aria-label":"Open in new tab",onClick:b,children:x})}),e[26]=b,e[27]=y):y=e[27];let j;e[28]===Symbol.for("react.memo_cache_sentinel")?(j=r.jsx(ve,{side:"bottom",children:"Open in new tab"}),e[28]=j):j=e[28];let N;e[29]!==y?(N=r.jsxs(be,{children:[y,j]}),e[29]=y,e[30]=N):N=e[30];let C;return e[31]!==N||e[32]!==c||e[33]!==u||e[34]!==h||e[35]!==m||e[36]!==p||e[37]!==g||e[38]!==i?(C=r.jsxs("div",{className:"flex h-9 shrink-0 items-center gap-1 border-b border-border/60 px-2",children:[c,u,h,m,p,g,N,i]}),e[31]=N,e[32]=c,e[33]=u,e[34]=h,e[35]=m,e[36]=p,e[37]=g,e[38]=i,e[39]=C):C=e[39],C}const Re=1;function wr(n){if(typeof n!="object"||n===null||n.v!==Re||n.source!=="deck-viewer")return null;const e=n;return e.type==="ready"||e.type==="state"||e.type==="op"&&typeof e.opId=="string"&&e.op?e:null}class Ne extends Error{constructor(e,t){super(e),this.code=t,this.name="DeckOpError"}code}function hs(n){return[...n.children].filter(e=>!/^(TEMPLATE|SCRIPT|STYLE)$/.test(e.tagName))}function jr(n){const t=new DOMParser().parseFromString(n,"text/html").querySelector("deck-viewer");return t?hs(t).length:null}function kr(n,e){const t=new DOMParser().parseFromString(n,"text/html"),s=t.querySelector("deck-viewer");if(!s)throw new Ne("no <deck-viewer> element in source","no-viewer");const l=hs(s),i=e.kind==="move"?e.from:e.at,o=l[i];if(!o)throw new Ne(`slide index ${i} out of range (${l.length})`,"stale-index");switch(e.kind){case"remove":{if(l.length<=1)throw new Ne("cannot remove the last slide","bad-op");o.remove();break}case"duplicate":{const c=o.cloneNode(!0);c.removeAttribute("id");for(const d of c.querySelectorAll("[id]"))d.removeAttribute("id");o.after(c);break}case"move":{if(e.to<0||e.to>=l.length)throw new Ne(`move target ${e.to} out of range`,"stale-index");if(e.to!==e.from){const c=e.to<e.from?l[e.to]:l[e.to].nextSibling;s.insertBefore(o,c)}break}case"set-attr":{if(!/^[a-zA-Z][\w-]*$/.test(e.name))throw new Ne(`invalid attribute name: ${e.name}`,"bad-op");o.setAttribute(e.name,e.value);break}case"remove-attr":{o.removeAttribute(e.name);break}case"replace":{const d=new DOMParser().parseFromString(e.html,"text/html").body.firstElementChild;if(!d)throw new Ne("replace html has no root element","bad-op");o.replaceWith(t.importNode(d,!0));break}default:throw new Ne(`unknown op kind: ${e.kind}`,"bad-op")}return`${n.trimStart().toLowerCase().startsWith("<!doctype")?`<!DOCTYPE html>
4
4
  `:""}${t.documentElement.outerHTML}