decocms 3.99.1 → 3.99.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 (212) hide show
  1. package/dist/client/assets/{AlertCircle-VcwplCRi.js → AlertCircle-D8nl7USt.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-CAv7CUnJ.js → ArrowUpRight-DgG9Xs3P.js} +1 -1
  3. package/dist/client/assets/{CheckCircle-V30FMM2D.js → CheckCircle-yOjX9PZe.js} +1 -1
  4. package/dist/client/assets/{ChevronDown-URo4LveF.js → ChevronDown-DXzUoD2e.js} +1 -1
  5. package/dist/client/assets/{ChevronLeft-aMkPes9N.js → ChevronLeft-DopUTXew.js} +1 -1
  6. package/dist/client/assets/{ChevronRight-oz8o6WPV.js → ChevronRight-j760Iee-.js} +1 -1
  7. package/dist/client/assets/{ChevronUp-HJUE3-BD.js → ChevronUp-CADhYHt4.js} +1 -1
  8. package/dist/client/assets/{DotsVertical-QF46dzdi.js → DotsVertical-AD-a2Knc.js} +1 -1
  9. package/dist/client/assets/{Eye-BSiFxHQB.js → Eye-CQQama2s.js} +1 -1
  10. package/dist/client/assets/{FilterLines-CEzORaPw.js → FilterLines-CehUrsTR.js} +1 -1
  11. package/dist/client/assets/{Globe01-wGomueqV.js → Globe01-CaIgPTxT.js} +1 -1
  12. package/dist/client/assets/{Globe04-CsKOsQ4z.js → Globe04-CuT114AV.js} +1 -1
  13. package/dist/client/assets/{HardDrive-BuI4Q48l.js → HardDrive-lZvAMErY.js} +1 -1
  14. package/dist/client/assets/{Key01-r6MDYdDw.js → Key01-BAEB0MKB.js} +1 -1
  15. package/dist/client/assets/{LayoutLeft-BFxGsVdk.js → LayoutLeft-Fadct960.js} +1 -1
  16. package/dist/client/assets/{LinkExternal01-BWnRnxGs.js → LinkExternal01-Dh2g8Xye.js} +1 -1
  17. package/dist/client/assets/{Monitor01-SEZLDRFN.js → Monitor01-_MTiHAuD.js} +1 -1
  18. package/dist/client/assets/{Palette-CEjENuG4.js → Palette-hlsbFMfV.js} +1 -1
  19. package/dist/client/assets/{Play-BDoh8EAp.js → Play-CfbRRa8r.js} +1 -1
  20. package/dist/client/assets/{Plus-Bw9lc6SR.js → Plus-CdiQoMoJ.js} +1 -1
  21. package/dist/client/assets/{SearchMd-BMfw7gZ4.js → SearchMd-D1HSgOeu.js} +1 -1
  22. package/dist/client/assets/{Settings02-DbH9OAzT.js → Settings02-D-O2SNJf.js} +1 -1
  23. package/dist/client/assets/{Shield01-C1R4fpvK.js → Shield01-DOrMIO9W.js} +1 -1
  24. package/dist/client/assets/{Star01-BwAv907s.js → Star01-BNUohd1g.js} +1 -1
  25. package/dist/client/assets/{Stars01-D1icdaCh.js → Stars01-DMt3zew5.js} +1 -1
  26. package/dist/client/assets/{Stars02-PPXsboxW.js → Stars02-BUidkUMX.js} +1 -1
  27. package/dist/client/assets/{Sun-Dw86eVev.js → Sun-CrWUbEJD.js} +1 -1
  28. package/dist/client/assets/{SwitchHorizontal01-F_1MjTR3.js → SwitchHorizontal01-CB8Z7BL9.js} +1 -1
  29. package/dist/client/assets/{Tool01-DvTGD1Yt.js → Tool01-Dt-TbXDn.js} +1 -1
  30. package/dist/client/assets/{Trash01-d58N8w5a.js → Trash01-BVvGX_KK.js} +1 -1
  31. package/dist/client/assets/{Upload01-C_hHbDSF.js → Upload01-Prj9a2xY.js} +1 -1
  32. package/dist/client/assets/{User01-BDtU1dk1.js → User01-CaU7xtcd.js} +1 -1
  33. package/dist/client/assets/{Users01-PX3eYoC8.js → Users01-BRnzISUs.js} +1 -1
  34. package/dist/client/assets/{Users03-CL71IAQ8.js → Users03-DwMxpPU3.js} +1 -1
  35. package/dist/client/assets/{X-D7X7Z50V.js → X-C-TqNtc2.js} +1 -1
  36. package/dist/client/assets/{XCircle-PlbEvjyp.js → XCircle-DAqTWvWp.js} +1 -1
  37. package/dist/client/assets/{XClose-BbuWQhNb.js → XClose-DlK2hm1P.js} +1 -1
  38. package/dist/client/assets/{Zap-BQKeuD4l.js → Zap-5n0DTezT.js} +1 -1
  39. package/dist/client/assets/{ZapSquare-CvkoTQDM.js → ZapSquare-DD_XuIyF.js} +1 -1
  40. package/dist/client/assets/{ZoomOut-DxqRFWA_.js → ZoomOut-VAm9p2Hl.js} +1 -1
  41. package/dist/client/assets/{access-gate-6AWas-Ss.js → access-gate-Bb0qjuIO.js} +1 -1
  42. package/dist/client/assets/{add-section-modal-jgpkoBcW.js → add-section-modal-ZfYc_Xn6.js} +1 -1
  43. package/dist/client/assets/{agent-icon-B2N3zGQH.js → agent-icon-Tlh3oNKM.js} +1 -1
  44. package/dist/client/assets/{agents-list-Cd9i8250.js → agents-list-DG6ttARV.js} +1 -1
  45. package/dist/client/assets/{ai-providers-CG207wTX.js → ai-providers-KlM-uWQ0.js} +1 -1
  46. package/dist/client/assets/{alert-Cg3WXwSx.js → alert-19iuIUZ1.js} +1 -1
  47. package/dist/client/assets/{alert-dialog-DvWgcmQI.js → alert-dialog-DESqZhA2.js} +1 -1
  48. package/dist/client/assets/{app-editor-tLSi5KV_.js → app-editor-C0ZGI6j9.js} +1 -1
  49. package/dist/client/assets/{auth-DZDiXt1m.js → auth-BR3aJLVt.js} +1 -1
  50. package/dist/client/assets/{auth-catchall-kuEh1_rd.js → auth-catchall-DV_XFERR.js} +1 -1
  51. package/dist/client/assets/{auth-entry-CavsOUDq.js → auth-entry-WLY89UlS.js} +1 -1
  52. package/dist/client/assets/{auth-split-layout-dFpcxyJe.js → auth-split-layout-D8MR1i_O.js} +1 -1
  53. package/dist/client/assets/{authenticate-and-persist-oauth-CGYbK6H8.js → authenticate-and-persist-oauth-DlE0FF2e.js} +1 -1
  54. package/dist/client/assets/{automation-list-row-CAUoBpVq.js → automation-list-row-D2uPOFxN.js} +1 -1
  55. package/dist/client/assets/{automation-runs-DyKvgj21.js → automation-runs-irK0CDv6.js} +1 -1
  56. package/dist/client/assets/{automations-wXAz-GXj.js → automations-DLGkAvdI.js} +1 -1
  57. package/dist/client/assets/{avatar-Dv3IrttI.js → avatar-DKl_SvPY.js} +1 -1
  58. package/dist/client/assets/{badge-toKsUzoB.js → badge-CPOFnH5f.js} +1 -1
  59. package/dist/client/assets/{block-document-DRbnuwCo.js → block-document-C_nFcvPT.js} +1 -1
  60. package/dist/client/assets/{brand-context-BaVxi4M4.js → brand-context-CmJN3ec7.js} +1 -1
  61. package/dist/client/assets/{buckets-BKwGKvkZ.js → buckets-BEbuFGaG.js} +1 -1
  62. package/dist/client/assets/{capability-load-error-BRyHg_Rt.js → capability-load-error-BULhLJ9o.js} +1 -1
  63. package/dist/client/assets/{card-Chq65iX4.js → card-CCz6n2PT.js} +1 -1
  64. package/dist/client/assets/{category-editor-LeiO5-YX.js → category-editor-BEu80DLc.js} +1 -1
  65. package/dist/client/assets/{chat-context-Bspy4m-d.js → chat-context-C-somJSY.js} +1 -1
  66. package/dist/client/assets/{checkbox-KUrNOBQk.js → checkbox-DXMAgfVg.js} +1 -1
  67. package/dist/client/assets/{cli-auth-success-B36KwAFt.js → cli-auth-success-Dv2HlRuI.js} +1 -1
  68. package/dist/client/assets/{collection-detail-CbhoYXmP.js → collection-detail-BunbCR6D.js} +1 -1
  69. package/dist/client/assets/{collection-display-button-DNbt3d2y.js → collection-display-button-DsLpaXK_.js} +1 -1
  70. package/dist/client/assets/{collection-search-BPoBI_I5.js → collection-search-9Z9J-flr.js} +1 -1
  71. package/dist/client/assets/{collection-tabs-FH3-RtUV.js → collection-tabs-BkVwtVd6.js} +1 -1
  72. package/dist/client/assets/{command-DMsCjDdA.js → command-CD_UfdIZ.js} +1 -1
  73. package/dist/client/assets/{commerce-onboarding-Cv30K_3D.js → commerce-onboarding-BiVomJ-b.js} +1 -1
  74. package/dist/client/assets/{connect-desktop-dialog-G37q3fkg.js → connect-desktop-dialog-DhsRqyJo.js} +1 -1
  75. package/dist/client/assets/{connection-card-BG_Nwlzj.js → connection-card-Cm-r3F3U.js} +1 -1
  76. package/dist/client/assets/{connection-detail-oU0C71F8.js → connection-detail-C_0Hpkc4.js} +1 -1
  77. package/dist/client/assets/{connection-form-helpers-DLOiycDJ.js → connection-form-helpers-CzldBL3R.js} +1 -1
  78. package/dist/client/assets/{connections-BgFAjnb1.js → connections-Be1_sFRI.js} +1 -1
  79. package/dist/client/assets/{context-menu-BRDnNrnF.js → context-menu-BMjlqCBa.js} +1 -1
  80. package/dist/client/assets/{decopilot-DfFzELja.js → decopilot-CzHxKRA2.js} +1 -1
  81. package/dist/client/assets/{decopilot-sse-pool-TIer_srZ.js → decopilot-sse-pool-9lyDYS1g.js} +1 -1
  82. package/dist/client/assets/{dialog-CxQBoX40.js → dialog-BYnY80tb.js} +1 -1
  83. package/dist/client/assets/{domain-settings-gFWo85oP.js → domain-settings-Be5Onfyn.js} +1 -1
  84. package/dist/client/assets/{drawer-CoRZTii0.js → drawer-DSWLLvbj.js} +1 -1
  85. package/dist/client/assets/{dropdown-menu-5CWPgj7f.js → dropdown-menu-B_-Um9OQ.js} +1 -1
  86. package/dist/client/assets/{empty-state-B-ezQrZT.js → empty-state-Di1r-g_a.js} +1 -1
  87. package/dist/client/assets/{extract-connection-data-BaXkJtVr.js → extract-connection-data-sR3PfR1q.js} +1 -1
  88. package/dist/client/assets/{file-explorer-CwlDpz6e.js → file-explorer-hz_GCFqU.js} +1 -1
  89. package/dist/client/assets/{file-type-icon-Cd8oKt-R.js → file-type-icon-MmuXAAgi.js} +1 -1
  90. package/dist/client/assets/{files-CkNnfKPK.js → files-D4PhY45Y.js} +1 -1
  91. package/dist/client/assets/{form-CpFt_4sy.js → form-DyV_U4Fx.js} +1 -1
  92. package/dist/client/assets/{general-9kWrBaDN.js → general-CBtZaIU7.js} +1 -1
  93. package/dist/client/assets/{github-repo-picker-CvyWRbaM.js → github-repo-picker-B4YgsSnm.js} +1 -1
  94. package/dist/client/assets/{hooks-BAG9TZjZ.js → hooks-B4h0KjiG.js} +1 -1
  95. package/dist/client/assets/{import-from-deco-dialog-ga5lUGZx.js → import-from-deco-dialog-DQBHcufQ.js} +1 -1
  96. package/dist/client/assets/{index-BLMNER8l.js → index--rRbpAQ9.js} +1 -1
  97. package/dist/client/assets/{index-DZCgQXLz.js → index-2MM6p12e.js} +1 -1
  98. package/dist/client/assets/{index-CiVkOVzW.js → index-53LWl5CV.js} +6 -6
  99. package/dist/client/assets/{index-BAfXUZ9K.js → index-9DIboil-.js} +1 -1
  100. package/dist/client/assets/{index-ALZP0-mx.js → index-BG_EZ_gC.js} +1 -1
  101. package/dist/client/assets/{index-DPI_0XE-.js → index-BSpZjkyI.js} +1 -1
  102. package/dist/client/assets/{index-I8Uum3Jx.js → index-C5w7M3ak.js} +3 -3
  103. package/dist/client/assets/{index-DS2I5JM3.js → index-C94qgHMJ.js} +1 -1
  104. package/dist/client/assets/{index-BwC0cAdP.js → index-CfIbeCCb.js} +1 -1
  105. package/dist/client/assets/{index-DUdLsOJu.js → index-Cx9raLNH.js} +1 -1
  106. package/dist/client/assets/{index-BU8Nad-n.js → index-DJPcb21Y.js} +1 -1
  107. package/dist/client/assets/{index-JhgoGL0k.js → index-Dsuwnck-.js} +1 -1
  108. package/dist/client/assets/{index-C_Ih0jtP.js → index-T5P3sRB3.js} +1 -1
  109. package/dist/client/assets/{index-BeB2S664.js → index-mv0f5ZIA.js} +1 -1
  110. package/dist/client/assets/{index-redirect-CP9ATXDl.js → index-redirect-D6vRUTKb.js} +1 -1
  111. package/dist/client/assets/{input-CutcETvq.js → input-agFYfi3v.js} +1 -1
  112. package/dist/client/assets/{integration-icon-D3W1euXX.js → integration-icon-CE7Y49fT.js} +1 -1
  113. package/dist/client/assets/{label-DtGUWURu.js → label-A5aaknkU.js} +1 -1
  114. package/dist/client/assets/{login-DUTSfri0.js → login-Ccc0MFum.js} +1 -1
  115. package/dist/client/assets/{mcp-oauth-CSZ5TVrK.js → mcp-oauth-BsM22i8Z.js} +1 -1
  116. package/dist/client/assets/{members-Dq59tJj1.js → members-Cxv-yFRF.js} +1 -1
  117. package/dist/client/assets/{monaco-editor-x5JEAvo5.js → monaco-editor-CK4_aHmD.js} +1 -1
  118. package/dist/client/assets/{monitoring-stats-row-BsPY2-bU.js → monitoring-stats-row-C_tu4yGv.js} +1 -1
  119. package/dist/client/assets/{oauth-callback-BXF1WEWL.js → oauth-callback-BGRjz4pz.js} +1 -1
  120. package/dist/client/assets/{oauth-callback-ai-provider-MpQ7zAqW.js → oauth-callback-ai-provider-D6VPZnFo.js} +1 -1
  121. package/dist/client/assets/{onboarding-CKZFzjtY.js → onboarding-DuFslM5N.js} +1 -1
  122. package/dist/client/assets/{org-install-DVysq6Hz.js → org-install-HxIFGE3M.js} +1 -1
  123. package/dist/client/assets/{org-layout-hE5dYTZz.js → org-layout-Bz6JE5ap.js} +1 -1
  124. package/dist/client/assets/{organization-choice-y8WYOYM0.js → organization-choice-BtKnPkHP.js} +1 -1
  125. package/dist/client/assets/{page-seo-form-gPXTm6pw.js → page-seo-form-DjBw0txl.js} +1 -1
  126. package/dist/client/assets/page-seo-sheet-Ddik0L9a.js +1 -0
  127. package/dist/client/assets/{popover-C8AJAJSa.js → popover-DXCLs7Mh.js} +1 -1
  128. package/dist/client/assets/{post-editor-DrZmKifS.js → post-editor-aN1M0k3q.js} +1 -1
  129. package/dist/client/assets/{preview-dialog-D1-LAakL.js → preview-dialog-DwVGd6qW.js} +1 -1
  130. package/dist/client/assets/{primitives-D7qGIw1V.js → primitives-DHDblW6s.js} +1 -1
  131. package/dist/client/assets/{profile-DwtHhCaD.js → profile-BHOgJciD.js} +1 -1
  132. package/dist/client/assets/project-app-view-Dds52VxM.js +1 -0
  133. package/dist/client/assets/record-editor-DWU1kNnR.js +1 -0
  134. package/dist/client/assets/registry-BQ5Yq-6B.js +2 -0
  135. package/dist/client/assets/{registry-layout-CZALtE-Q.js → registry-layout-DQnSen4T.js} +1 -1
  136. package/dist/client/assets/{require-capability-DAovjPYR.js → require-capability-DyXOtXgQ.js} +1 -1
  137. package/dist/client/assets/{required-auth-layout-BFGUeccA.js → required-auth-layout-CluuNdrt.js} +1 -1
  138. package/dist/client/assets/{reset-password-CrnrgmIx.js → reset-password-CfcV_Ol7.js} +1 -1
  139. package/dist/client/assets/{roles-DRg1cyfq.js → roles-BCXCHheI.js} +1 -1
  140. package/dist/client/assets/{save-status-BmnvufMt.js → save-status-Dg-HdKmb.js} +1 -1
  141. package/dist/client/assets/{scroll-area-DnauLcxE.js → scroll-area-BFd5bzOG.js} +1 -1
  142. package/dist/client/assets/{search-input-BVF4N9EW.js → search-input-DBcneL-Z.js} +1 -1
  143. package/dist/client/assets/{secrets-DPqx_gXC.js → secrets-DKKr0DS-.js} +1 -1
  144. package/dist/client/assets/{sections-editor-BLU0buUC.js → sections-editor-Da2BXnWh.js} +1 -1
  145. package/dist/client/assets/{select-CeO9pIG_.js → select--NMtIJXa.js} +1 -1
  146. package/dist/client/assets/{select-model-mprfSN1i.js → select-model-B8wcKRbd.js} +1 -1
  147. package/dist/client/assets/{seo-editor-Dyh0ncgL.js → seo-editor-CpXgkLht.js} +1 -1
  148. package/dist/client/assets/{settings-layout-BcPbOkgS.js → settings-layout-kC9Zv916.js} +1 -1
  149. package/dist/client/assets/{settings-section-B3kXnqLg.js → settings-section-Cv3fX46A.js} +1 -1
  150. package/dist/client/assets/{sheet-CaSXRGPU.js → sheet-CG7AqhVD.js} +1 -1
  151. package/dist/client/assets/{shell-controls-D2Qn9uVj.js → shell-controls-BD9OqBnx.js} +1 -1
  152. package/dist/client/assets/{shell-layout-BgovnITR.js → shell-layout-Cz9jaH1b.js} +1 -1
  153. package/dist/client/assets/{shell-route-loading-w2qYEgt-.js → shell-route-loading-DX7cr59C.js} +1 -1
  154. package/dist/client/assets/{sidebar-BNKGZwsk.js → sidebar-C8Zfra_F.js} +1 -1
  155. package/dist/client/assets/{skeleton-1BUBAFib.js → skeleton-sBC4lQNI.js} +1 -1
  156. package/dist/client/assets/{sortable.esm-BQBGtGRV.js → sortable.esm-YhwgmY_a.js} +1 -1
  157. package/dist/client/assets/{sso-B5RA5Egt.js → sso-CMBwbNfn.js} +1 -1
  158. package/dist/client/assets/{store-Ni3ANns9.js → store-Cl_1LRh_.js} +1 -1
  159. package/dist/client/assets/store-registry-B8Uu7fXQ.js +2 -0
  160. package/dist/client/assets/{studio-tools-bjPFQfXc.js → studio-tools-BJLBgOee.js} +1 -1
  161. package/dist/client/assets/{switch-B9PlH85E.js → switch-V6piMM6A.js} +1 -1
  162. package/dist/client/assets/{table-Bh38Wtyx.js → table-CO4yX7RA.js} +1 -1
  163. package/dist/client/assets/{tabs-C0RM8s7M.js → tabs-DGpCIiez.js} +1 -1
  164. package/dist/client/assets/{task-status-sw3Y4pwg.js → task-status-CyBXqR4E.js} +1 -1
  165. package/dist/client/assets/{textarea-CvR7iHW3.js → textarea-Dgff3Gg2.js} +1 -1
  166. package/dist/client/assets/{toggle-group-qpErv2AC.js → toggle-group-DRhh44eR.js} +1 -1
  167. package/dist/client/assets/{toolbar-CB27CeHy.js → toolbar-QoRJzy-G.js} +1 -1
  168. package/dist/client/assets/{tooltip-Cs84Kx7a.js → tooltip-CgNWIJOM.js} +1 -1
  169. package/dist/client/assets/{types-pQkRXbdZ.js → types-CXz6VYrK.js} +1 -1
  170. package/dist/client/assets/{use-ai-providers-BgadC07_.js → use-ai-providers-Dw8zktiy.js} +1 -1
  171. package/dist/client/assets/{use-automations-P1MHR3DS.js → use-automations-1dr86I_A.js} +1 -1
  172. package/dist/client/assets/{use-capability-BUm2GwYJ.js → use-capability-DVHDSFWa.js} +1 -1
  173. package/dist/client/assets/{use-clock-tick-DNfOIVGO.js → use-clock-tick-CmvqvAhs.js} +1 -1
  174. package/dist/client/assets/{use-collections-KLUYE1x1.js → use-collections-BYKClwvP.js} +1 -1
  175. package/dist/client/assets/{use-connection-BcZ8SPdu.js → use-connection-BnTFSsXk.js} +1 -1
  176. package/dist/client/assets/{use-copy-3_Rhxcs5.js → use-copy-Cz-l8dwG.js} +1 -1
  177. package/dist/client/assets/{use-create-virtual-mcp-BUg1GOjA.js → use-create-virtual-mcp-Dc3lK-qn.js} +1 -1
  178. package/dist/client/assets/{use-debounced-autosave-CSkDAooO.js → use-debounced-autosave-mT469Qcu.js} +1 -1
  179. package/dist/client/assets/{use-delete-connection-CRtYZbhZ.js → use-delete-connection-Tmvu17mo.js} +1 -1
  180. package/dist/client/assets/{use-file-configs-YBpYKsXP.js → use-file-configs-BY2cpVcw.js} +1 -1
  181. package/dist/client/assets/{use-infinite-scroll-BJoUj4tJ.js → use-infinite-scroll-10P3vgT3.js} +1 -1
  182. package/dist/client/assets/{use-join-requests-7lEKJyAD.js → use-join-requests-CrmgeiIm.js} +1 -1
  183. package/dist/client/assets/{use-mcp-client-Bq9g8m5J.js → use-mcp-client-Ci_r6Z9X.js} +1 -1
  184. package/dist/client/assets/{use-mcp-prompts-B5FIxmOZ.js → use-mcp-prompts-Brfbccg_.js} +1 -1
  185. package/dist/client/assets/{use-mcp-tools-LraQQ1bu.js → use-mcp-tools-C3Vng-X-.js} +1 -1
  186. package/dist/client/assets/{use-members-D283HZiN.js → use-members-B81Cwsvd.js} +1 -1
  187. package/dist/client/assets/{use-mobile-C0mpADhR.js → use-mobile-COxfHS-K.js} +1 -1
  188. package/dist/client/assets/{use-navigate-to-agent-CRQ9sIAj.js → use-navigate-to-agent-Cp82Pt97.js} +1 -1
  189. package/dist/client/assets/{use-org-auth-client-WATciLg3.js → use-org-auth-client-C5HFWhiz.js} +1 -1
  190. package/dist/client/assets/{use-org-sso-HWNvOeDC.js → use-org-sso-BrX2nnoi.js} +1 -1
  191. package/dist/client/assets/{use-organization-roles-Cyp5dthQ.js → use-organization-roles-kcsQY_C9.js} +1 -1
  192. package/dist/client/assets/{use-organization-settings-oh1iUWuA.js → use-organization-settings-D1CXb2Mk.js} +1 -1
  193. package/dist/client/assets/{use-registry-connections-d6Abj3O4.js → use-registry-connections-DxwnrcKA.js} +1 -1
  194. package/dist/client/assets/{use-secrets-CkVHtz_G.js → use-secrets-B-XWgN3K.js} +1 -1
  195. package/dist/client/assets/{use-status-sounds-MBoAiBsc.js → use-status-sounds-SD_W2P9L.js} +1 -1
  196. package/dist/client/assets/{use-view-mode-Dhn_wt1k.js → use-view-mode-C99Hv44a.js} +1 -1
  197. package/dist/client/assets/{use-virtual-mcp-C5aoCVVQ.js → use-virtual-mcp-C76Ypnz5.js} +1 -1
  198. package/dist/client/assets/useInfiniteQuery-Dd70hn1g.js +1 -0
  199. package/dist/client/assets/useSuspenseInfiniteQuery-8qs6htsj.js +1 -0
  200. package/dist/client/assets/{useSuspenseQueries-C6KWJru5.js → useSuspenseQueries-CT-DHsCI.js} +1 -1
  201. package/dist/client/assets/{variant-calendar-krPIZ_Rp.js → variant-calendar-BHRaDzz9.js} +1 -1
  202. package/dist/client/assets/{view-mode-toggle-DTMt6lCZ.js → view-mode-toggle-XGoB5RsL.js} +1 -1
  203. package/dist/client/index.html +1 -1
  204. package/dist/server/cli.js +1 -1
  205. package/package.json +1 -1
  206. package/dist/client/assets/page-seo-sheet-CpMq28JR.js +0 -1
  207. package/dist/client/assets/project-app-view-H9YA_3uu.js +0 -1
  208. package/dist/client/assets/record-editor-C64a4aNL.js +0 -1
  209. package/dist/client/assets/registry-CxYUBbU6.js +0 -2
  210. package/dist/client/assets/store-registry-kIHn_jDR.js +0 -2
  211. package/dist/client/assets/useInfiniteQuery-RfoATJAI.js +0 -1
  212. package/dist/client/assets/useSuspenseInfiniteQuery-DBiSYggu.js +0 -1
@@ -1,4 +1,4 @@
1
- import{r as L,aQ as Ye,c as V,j as s,o as Oe,s as re,D as le,m as me,n as Ae,p as Te,d as ce,K as ee,t as J,B as Z,w as Q,z as Xe,l as de,k as Qe,b as Je,E as Ze,a8 as et}from"./index-I8Uum3Jx.js";import{C as tt}from"./checkbox-KUrNOBQk.js";import{I as ne}from"./input-CutcETvq.js";import{d as st,b as it,c as nt,S as lt,a as ot}from"./select-CeO9pIG_.js";import{S as H}from"./skeleton-1BUBAFib.js";import{i as ze,b as Re,c as rt,a as at,s as ct}from"./Settings02-DbH9OAzT.js";import{c as dt,a as ut,d as mt,i as ht}from"./Tool01-DvTGD1Yt.js";import{i as ft}from"./Key01-r6MDYdDw.js";import{i as Pe}from"./SearchMd-BMfw7gZ4.js";import{c as he,u as pt,b as xt}from"./use-ai-providers-BgadC07_.js";import{S as ge,b as gt}from"./chat-context-Bspy4m-d.js";import{g as fe}from"./ai-providers-logos-DD3qZ33J.js";import{i as vt}from"./Monitor01-SEZLDRFN.js";import{i as bt}from"./AlertCircle-VcwplCRi.js";import{D as Le,a as yt,b as jt,c as St,d as Nt,e as kt}from"./dialog-CxQBoX40.js";import{u as ue}from"./studio-tools-bjPFQfXc.js";import{i as wt}from"./ChevronRight-oz8o6WPV.js";import{A as _t}from"./avatar-Dv3IrttI.js";import{S as ve,a as be,b as $e}from"./settings-section-B3kXnqLg.js";import{s as Fe}from"./Eye-BSiFxHQB.js";import{u as Ct,C as It}from"./connect-desktop-dialog-G37q3fkg.js";import{t as ye}from"./ChevronDown-URo4LveF.js";import{t as Et}from"./Stars01-D1icdaCh.js";function ie(i,e,t){let n=t.initialDeps??[],l,o=!0;function r(){var a,c,u;let d;t.key&&((a=t.debug)!=null&&a.call(t))&&(d=Date.now());const f=i();if(!(f.length!==n.length||f.some((b,g)=>n[g]!==b)))return l;n=f;let m;if(t.key&&((c=t.debug)!=null&&c.call(t))&&(m=Date.now()),l=e(...f),t.key&&((u=t.debug)!=null&&u.call(t))){const b=Math.round((Date.now()-d)*100)/100,g=Math.round((Date.now()-m)*100)/100,y=g/16,j=(_,N)=>{for(_=String(_);_.length<N;)_=" "+_;return _};console.info(`%c⏱ ${j(g,5)} /${j(b,5)} ms`,`
1
+ import{r as L,aQ as Ye,c as V,j as s,o as Oe,s as re,D as le,m as me,n as Ae,p as Te,d as ce,K as ee,t as J,B as Z,w as Q,z as Xe,l as de,k as Qe,b as Je,E as Ze,a8 as et}from"./index-C5w7M3ak.js";import{C as tt}from"./checkbox-DXMAgfVg.js";import{I as ne}from"./input-agFYfi3v.js";import{d as st,b as it,c as nt,S as lt,a as ot}from"./select--NMtIJXa.js";import{S as H}from"./skeleton-sBC4lQNI.js";import{i as ze,b as Re,c as rt,a as at,s as ct}from"./Settings02-D-O2SNJf.js";import{c as dt,a as ut,d as mt,i as ht}from"./Tool01-Dt-TbXDn.js";import{i as ft}from"./Key01-BAEB0MKB.js";import{i as Pe}from"./SearchMd-D1HSgOeu.js";import{c as he,u as pt,b as xt}from"./use-ai-providers-Dw8zktiy.js";import{S as ge,b as gt}from"./chat-context-C-somJSY.js";import{g as fe}from"./ai-providers-logos-DD3qZ33J.js";import{i as vt}from"./Monitor01-_MTiHAuD.js";import{i as bt}from"./AlertCircle-D8nl7USt.js";import{D as Le,a as yt,b as jt,c as St,d as Nt,e as kt}from"./dialog-BYnY80tb.js";import{u as ue}from"./studio-tools-BJLBgOee.js";import{i as wt}from"./ChevronRight-j760Iee-.js";import{A as _t}from"./avatar-DKl_SvPY.js";import{S as ve,a as be,b as $e}from"./settings-section-Cv3fX46A.js";import{s as Fe}from"./Eye-CQQama2s.js";import{u as Ct,C as It}from"./connect-desktop-dialog-DhsRqyJo.js";import{t as ye}from"./ChevronDown-DXzUoD2e.js";import{t as Et}from"./Stars01-DMt3zew5.js";function ie(i,e,t){let n=t.initialDeps??[],l,o=!0;function r(){var a,c,u;let d;t.key&&((a=t.debug)!=null&&a.call(t))&&(d=Date.now());const f=i();if(!(f.length!==n.length||f.some((b,g)=>n[g]!==b)))return l;n=f;let m;if(t.key&&((c=t.debug)!=null&&c.call(t))&&(m=Date.now()),l=e(...f),t.key&&((u=t.debug)!=null&&u.call(t))){const b=Math.round((Date.now()-d)*100)/100,g=Math.round((Date.now()-m)*100)/100,y=g/16,j=(_,N)=>{for(_=String(_);_.length<N;)_=" "+_;return _};console.info(`%c⏱ ${j(g,5)} /${j(b,5)} ms`,`
2
2
  font-size: .6rem;
3
3
  font-weight: bold;
4
4
  color: hsl(${Math.max(0,Math.min(120-120*y,120))}deg 100% 31%);`,t?.key)}return t?.onChange&&!(o&&t.skipInitialOnChange)&&t.onChange(l),o=!1,l}return r.updateDeps=a=>{n=a},r}function je(i,e){if(i===void 0)throw new Error("Unexpected undefined");return i}const Mt=(i,e)=>Math.abs(i-e)<1.01,Ot=(i,e,t)=>{let n;return function(...l){i.clearTimeout(n),n=i.setTimeout(()=>e.apply(this,l),t)}},Se=i=>{const{offsetWidth:e,offsetHeight:t}=i;return{width:e,height:t}},At=i=>i,Tt=i=>{const e=Math.max(i.startIndex-i.overscan,0),t=Math.min(i.endIndex+i.overscan,i.count-1),n=[];for(let l=e;l<=t;l++)n.push(l);return n},zt=(i,e)=>{const t=i.scrollElement;if(!t)return;const n=i.targetWindow;if(!n)return;const l=r=>{const{width:a,height:c}=r;e({width:Math.round(a),height:Math.round(c)})};if(l(Se(t)),!n.ResizeObserver)return()=>{};const o=new n.ResizeObserver(r=>{const a=()=>{const c=r[0];if(c?.borderBoxSize){const u=c.borderBoxSize[0];if(u){l({width:u.inlineSize,height:u.blockSize});return}}l(Se(t))};i.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return o.observe(t,{box:"border-box"}),()=>{o.unobserve(t)}},Ne={passive:!0},ke=typeof window>"u"?!0:"onscrollend"in window,Rt=(i,e)=>{const t=i.scrollElement;if(!t)return;const n=i.targetWindow;if(!n)return;let l=0;const o=i.options.useScrollendEvent&&ke?()=>{}:Ot(n,()=>{e(l,!1)},i.options.isScrollingResetDelay),r=d=>()=>{const{horizontal:f,isRtl:p}=i.options;l=f?t.scrollLeft*(p&&-1||1):t.scrollTop,o(),e(l,d)},a=r(!0),c=r(!1);t.addEventListener("scroll",a,Ne);const u=i.options.useScrollendEvent&&ke;return u&&t.addEventListener("scrollend",c,Ne),()=>{t.removeEventListener("scroll",a),u&&t.removeEventListener("scrollend",c)}},Pt=(i,e,t)=>{if(e?.borderBoxSize){const n=e.borderBoxSize[0];if(n)return Math.round(n[t.options.horizontal?"inlineSize":"blockSize"])}return i[t.options.horizontal?"offsetWidth":"offsetHeight"]},Lt=(i,{adjustments:e=0,behavior:t},n)=>{var l,o;const r=i+e;(o=(l=n.scrollElement)==null?void 0:l.scrollTo)==null||o.call(l,{[n.options.horizontal?"left":"top"]:r,behavior:t})};class $t{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var t,n,l;return((l=(n=(t=this.targetWindow)==null?void 0:t.performance)==null?void 0:n.now)==null?void 0:l.call(n))??Date.now()},this.observer=(()=>{let t=null;const n=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(l=>{l.forEach(o=>{const r=()=>{const a=o.target,c=this.indexFromElement(a);if(!a.isConnected){this.observer.unobserve(a);return}this.shouldMeasureDuringScroll(c)&&this.resizeItem(c,this.options.measureElement(a,o,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()})}));return{disconnect:()=>{var l;(l=n())==null||l.disconnect(),t=null},observe:l=>{var o;return(o=n())==null?void 0:o.observe(l,{box:"border-box"})},unobserve:l=>{var o;return(o=n())==null?void 0:o.unobserve(l)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach(([n,l])=>{typeof l>"u"&&delete t[n]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:At,rangeExtractor:Tt,onChange:()=>{},measureElement:Pt,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",...t}},this.notify=t=>{var n,l;(l=(n=this.options).onChange)==null||l.call(n,this,t)},this.maybeNotify=ie(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const n=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==n){if(this.cleanup(),!n){this.maybeNotify();return}this.scrollElement=n,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(l=>{this.observer.observe(l)}),this.unsubs.push(this.options.observeElementRect(this,l=>{this.scrollRect=l,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(l,o)=>{this.scrollAdjustments=0,this.scrollDirection=o?this.getScrollOffset()<l?"forward":"backward":null,this.scrollOffset=l,this.isScrolling=o,this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(t,n)=>{const l=new Map,o=new Map;for(let r=n-1;r>=0;r--){const a=t[r];if(l.has(a.lane))continue;const c=o.get(a.lane);if(c==null||a.end>c.end?o.set(a.lane,a):a.end<c.end&&l.set(a.lane,!0),l.size===this.options.lanes)break}return o.size===this.options.lanes?Array.from(o.values()).sort((r,a)=>r.end===a.end?r.index-a.index:r.end-a.end)[0]:void 0},this.getMeasurementOptions=ie(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(t,n,l,o,r,a,c)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:n,scrollMargin:l,getItemKey:o,enabled:r,lanes:a,laneAssignmentMode:c}),{key:!1}),this.getMeasurements=ie(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:n,scrollMargin:l,getItemKey:o,enabled:r,lanes:a,laneAssignmentMode:c},u)=>{if(!r)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(const m of this.laneAssignments.keys())m>=t&&this.laneAssignments.delete(m);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(m=>{this.itemSizeCache.set(m.key,m.size)}));const d=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===t&&(this.lanesSettling=!1);const f=this.measurementsCache.slice(0,d),p=new Array(a).fill(void 0);for(let m=0;m<d;m++){const b=f[m];b&&(p[b.lane]=m)}for(let m=d;m<t;m++){const b=o(m),g=this.laneAssignments.get(m);let y,j;const _=c==="estimate"||u.has(b);if(g!==void 0&&this.options.lanes>1){y=g;const v=p[y],k=v!==void 0?f[v]:void 0;j=k?k.end+this.options.gap:n+l}else{const v=this.options.lanes===1?f[m-1]:this.getFurthestMeasurement(f,m);j=v?v.end+this.options.gap:n+l,y=v?v.lane:m%this.options.lanes,this.options.lanes>1&&_&&this.laneAssignments.set(m,y)}const N=u.get(b),I=typeof N=="number"?N:this.options.estimateSize(m),E=j+I;f[m]={index:m,start:j,size:I,end:E,key:b,lane:y},p[y]=m}return this.measurementsCache=f,f},{key:!1,debug:()=>this.options.debug}),this.calculateRange=ie(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,n,l,o)=>this.range=t.length>0&&n>0?Ft({measurements:t,outerSize:n,scrollOffset:l,lanes:o}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=ie(()=>{let t=null,n=null;const l=this.calculateRange();return l&&(t=l.startIndex,n=l.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,n]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,n]},(t,n,l,o,r)=>o===null||r===null?[]:t({startIndex:o,endIndex:r,overscan:n,count:l}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=t=>{const n=this.options.indexAttribute,l=t.getAttribute(n);return l?parseInt(l,10):(console.warn(`Missing attribute name '${n}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=t=>{var n;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const l=this.scrollState.index??((n=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:n.index);if(l!==void 0&&this.range){const o=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,l-o),a=Math.min(this.options.count-1,l+o);return t>=r&&t<=a}return!0},this.measureElement=t=>{if(!t){this.elementsCache.forEach((r,a)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(a))});return}const n=this.indexFromElement(t),l=this.options.getItemKey(n),o=this.elementsCache.get(l);o!==t&&(o&&this.observer.unobserve(o),this.observer.observe(t),this.elementsCache.set(l,t)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,void 0,this))},this.resizeItem=(t,n)=>{var l;const o=this.measurementsCache[t];if(!o)return;const r=this.itemSizeCache.get(o.key)??o.size,a=n-r;a!==0&&(((l=this.scrollState)==null?void 0:l.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(o,a,this):o.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(o.index),this.itemSizeCache=new Map(this.itemSizeCache.set(o.key,n)),this.notify(!1))},this.getVirtualItems=ie(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,n)=>{const l=[];for(let o=0,r=t.length;o<r;o++){const a=t[o],c=n[a];l.push(c)}return l},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const n=this.getMeasurements();if(n.length!==0)return je(n[Ke(0,n.length-1,l=>je(n[l]).start,t)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const t=this.scrollElement.document.documentElement;return this.options.horizontal?t.scrollWidth-this.scrollElement.innerWidth:t.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(t,n,l=0)=>{if(!this.scrollElement)return 0;const o=this.getSize(),r=this.getScrollOffset();n==="auto"&&(n=t>=r+o?"end":"start"),n==="center"?t+=(l-o)/2:n==="end"&&(t-=o);const a=this.getMaxScrollOffset();return Math.max(Math.min(a,t),0)},this.getOffsetForIndex=(t,n="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const l=this.getSize(),o=this.getScrollOffset(),r=this.measurementsCache[t];if(!r)return;if(n==="auto")if(r.end>=o+l-this.options.scrollPaddingEnd)n="end";else if(r.start<=o+this.options.scrollPaddingStart)n="start";else return[o,n];if(n==="end"&&t===this.options.count-1)return[this.getMaxScrollOffset(),n];const a=n==="end"?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,n,r.size),n]},this.scrollToOffset=(t,{align:n="start",behavior:l="auto"}={})=>{const o=this.getOffsetForAlignment(t,n),r=this.now();this.scrollState={index:null,align:n,behavior:l,startedAt:r,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:l}),this.scheduleScrollReconcile()},this.scrollToIndex=(t,{align:n="auto",behavior:l="auto"}={})=>{t=Math.max(0,Math.min(t,this.options.count-1));const o=this.getOffsetForIndex(t,n);if(!o)return;const[r,a]=o,c=this.now();this.scrollState={index:t,align:a,behavior:l,startedAt:c,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:l}),this.scheduleScrollReconcile()},this.scrollBy=(t,{behavior:n="auto"}={})=>{const l=this.getScrollOffset()+t,o=this.now();this.scrollState={index:null,align:"start",behavior:n,startedAt:o,lastTargetOffset:l,stableFrames:0},this._scrollToOffset(l,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{var t;const n=this.getMeasurements();let l;if(n.length===0)l=this.options.paddingStart;else if(this.options.lanes===1)l=((t=n[n.length-1])==null?void 0:t.end)??0;else{const o=Array(this.options.lanes).fill(null);let r=n.length-1;for(;r>=0&&o.some(a=>a===null);){const a=n[r];o[a.lane]===null&&(o[a.lane]=a.end),r--}l=Math.max(...o.filter(a=>a!==null))}return Math.max(l-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(t,{adjustments:n,behavior:l})=>{this.options.scrollToFn(t,{behavior:l,adjustments:n},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(e)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const n=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,l=n?n[0]:this.scrollState.lastTargetOffset,o=1,r=l!==this.scrollState.lastTargetOffset;if(!r&&Mt(l,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=o){this.scrollState=null;return}}else this.scrollState.stableFrames=0,r&&(this.scrollState.lastTargetOffset=l,this.scrollState.behavior="auto",this._scrollToOffset(l,{adjustments:void 0,behavior:"auto"}));this.scheduleScrollReconcile()}}const Ke=(i,e,t,n)=>{for(;i<=e;){const l=(i+e)/2|0,o=t(l);if(o<n)i=l+1;else if(o>n)e=l-1;else return l}return i>0?i-1:0};function Ft({measurements:i,outerSize:e,scrollOffset:t,lanes:n}){const l=i.length-1,o=c=>i[c].start;if(i.length<=n)return{startIndex:0,endIndex:l};let r=Ke(0,l,o,t),a=r;if(n===1)for(;a<l&&i[a].end<t+e;)a++;else if(n>1){const c=Array(n).fill(0);for(;a<l&&c.some(d=>d<t+e);){const d=i[a];c[d.lane]=d.end,a++}const u=Array(n).fill(t+e);for(;r>=0&&u.some(d=>d>=t);){const d=i[r];u[d.lane]=d.start,r--}r=Math.max(0,r-r%n),a=Math.min(l,a+(n-1-a%n))}return{startIndex:r,endIndex:a}}const we=typeof document<"u"?L.useLayoutEffect:L.useEffect;function Kt({useFlushSync:i=!0,...e}){const t=L.useReducer(()=>({}),{})[1],n={...e,onChange:(o,r)=>{var a;i&&r?Ye.flushSync(t):t(),(a=e.onChange)==null||a.call(e,o,r)}},[l]=L.useState(()=>new $t(n));return l.setOptions(n),we(()=>l._didMount(),[]),we(()=>l._willUpdate()),l}function Dt(i){return Kt({observeElementRect:zt,observeElementOffset:Rt,scrollToFn:Lt,...i})}const ae=[{id:"openai",name:"OpenAI",description:"GPT-4, GPT-5, and other OpenAI models",logo:"https://decoims.com/decocms/b51001ef-ae58-4db4-8a75-9e6d2df2dd8e/openai.png",baseUrlPlaceholder:"https://api.openai.com/v1",defaultBaseUrl:"https://api.openai.com/v1",apiKeyRecommended:!0,helpText:"Use your OpenAI API key (starts with sk-)."},{id:"litellm",name:"LiteLLM",description:"Connect to a LiteLLM gateway your team manages",logo:"https://decoims.com/decocms/e974ae05-ad64-4b4a-8444-d9705f019b85/litellm.png",baseUrlPlaceholder:"http://localhost:4000",apiKeyRecommended:!0,helpText:"Point at your LiteLLM proxy. The base URL should be the root of the proxy (we'll append /v1)."},{id:"ollama",name:"Ollama",description:"Run open-source models on your own computer",logo:"https://decoims.com/decocms/2bb2f822-5288-4b7c-a541-dcbef76525a0/ollama.png",baseUrlPlaceholder:"http://localhost:11434",apiKeyRecommended:!1,helpText:"Ollama exposes /v1 by default — no API key required for local use."},{id:"lm-studio",name:"LM Studio",description:"Open models running through LM Studio",logo:"https://decoims.com/decocms/9f0ab1a9-d2d5-4f3e-9de0-aadd4926428d/lmstudio.webp",baseUrlPlaceholder:"http://localhost:1234",apiKeyRecommended:!1,helpText:"Start the local server in LM Studio, then paste its base URL here."},{id:"vllm",name:"vLLM",description:"Connect to your team's self-hosted vLLM server",logo:"https://decoims.com/decocms/b6c60e4f-a4aa-443c-981f-ad0f31640e22/vllm.png",baseUrlPlaceholder:"http://localhost:8000",apiKeyRecommended:!1}];function _e(i){if(i)return ae.find(e=>e.id===i)}const Ce=4;function oe(i){const e=V.c(8),{logo:t,name:n,description:l,onClick:o}=i;let r;e[0]!==t||e[1]!==n?(r=t?s.jsx("img",{src:t,alt:n,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(_t,{fallback:n.charAt(0),className:"size-8 bg-primary/10 text-primary"}),e[0]=t,e[1]=n,e[2]=r):r=e[2];let a;return e[3]!==l||e[4]!==n||e[5]!==o||e[6]!==r?(a=s.jsx($e,{onClick:o,icon:r,title:n,description:l}),e[3]=l,e[4]=n,e[5]=o,e[6]=r,e[7]=a):a=e[7],a}function De(i){const e=V.c(32),{providers:t,onSelect:n,onShowAll:l}=i;let o;e[0]!==t?(o=t.find(Ht),e[0]=t,e[1]=o):o=e[1];const r=o;let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a={openrouter:0,llmapi:1,anthropic:2,google:3},e[2]=a):a=e[2];const c=a;let u;if(e[3]!==n||e[4]!==t){let N;e[6]===Symbol.for("react.memo_cache_sentinel")?(N=(x,O)=>{const A=c[x.id]??Number.MAX_SAFE_INTEGER,z=c[O.id]??Number.MAX_SAFE_INTEGER;return A-z},e[6]=N):N=e[6];const I=t.filter(Vt).sort(N);let E;e[7]!==t?(E=t.find(Wt),e[7]=t,e[8]=E):E=e[8];const v=E;let k;e[9]===Symbol.for("react.memo_cache_sentinel")?(k=ae.find(Bt),e[9]=k):k=e[9];const C=k;let w;e[10]!==n?(w=x=>s.jsx(oe,{logo:x.logo,name:x.name,description:x.description,onClick:()=>n({kind:"provider",provider:x})},x.id),e[10]=n,e[11]=w):w=e[11];let h,S;e[12]!==n||e[13]!==v?(h=v&&C?[s.jsx(oe,{logo:C.logo,name:C.name,description:C.description,onClick:()=>n({kind:"openai-compatible",provider:v,preset:C})},C.id)]:[],S=v?[...ae.filter(Ut).map(x=>s.jsx(oe,{logo:x.logo,name:x.name,description:x.description,onClick:()=>n({kind:"openai-compatible",provider:v,preset:x})},x.id)),s.jsx(oe,{logo:v.logo,name:"Custom OpenAI-compatible",description:"Bring your own model server (advanced)",onClick:()=>n({kind:"openai-compatible",provider:v,preset:null})},"custom")]:[],e[12]=n,e[13]=v,e[14]=h,e[15]=S):(h=e[14],S=e[15]),u=[...I.map(w),...h,...S],e[3]=n,e[4]=t,e[5]=u}else u=e[5];const d=u,f=d.length-Ce,p=!!l&&f>0;let m;e[16]!==d||e[17]!==p?(m=p?d.slice(0,Ce):d,e[16]=d,e[17]=p,e[18]=m):m=e[18];const b=m;let g;e[19]!==r||e[20]!==n?(g=r&&s.jsx(ve,{children:s.jsxs("div",{className:"relative rounded-xl border border-violet-400/30 bg-gradient-to-br from-violet-50/50 via-transparent to-lime-50/30 dark:from-violet-950/20 dark:to-lime-950/10 p-1.5",children:[s.jsx("div",{className:"absolute inset-0 rounded-xl bg-gradient-to-br from-violet-400/5 to-lime-400/5 pointer-events-none"}),s.jsx("p",{className:"text-xs font-medium text-violet-700 dark:text-violet-400 mb-1.5 px-2 pt-2 relative",children:"Recommended — 100+ models, pay as you go"}),s.jsx(be,{className:"relative",children:s.jsx(oe,{logo:r.logo,name:r.name,description:r.description,onClick:()=>n({kind:"provider",provider:r})})})]})}),e[19]=r,e[20]=n,e[21]=g):g=e[21];let y;e[22]!==f||e[23]!==l||e[24]!==p?(y=p&&s.jsx($e,{onClick:l,title:`${f} more provider${f===1?"":"s"}`,action:s.jsx(wt,{size:16,className:"text-muted-foreground"})}),e[22]=f,e[23]=l,e[24]=p,e[25]=y):y=e[25];let j;e[26]!==y||e[27]!==b?(j=s.jsx(ve,{children:s.jsxs(be,{children:[b,y]})}),e[26]=y,e[27]=b,e[28]=j):j=e[28];let _;return e[29]!==g||e[30]!==j?(_=s.jsxs("div",{className:"flex flex-col gap-6",children:[g,j]}),e[29]=g,e[30]=j,e[31]=_):_=e[31],_}function Ut(i){return i.id!=="openai"}function Bt(i){return i.id==="openai"}function Wt(i){return i.id==="openai-compatible"}function Vt(i){return i.id!=="deco"&&i.id!=="openai-compatible"}function Ht(i){return i.id==="deco"}const qt=Oe({label:re().optional(),apiKey:re().min(1,"API key is required")});function Gt(i){const e=V.c(59),{providerId:t,onCancel:n,onSuccess:l}=i,{org:o}=le(),r=ue(),a=me(),[c,u]=L.useState(!1);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d={resolver:Ae(qt),defaultValues:{label:"",apiKey:""}},e[0]=d):d=e[0];const{register:f,handleSubmit:p,formState:m}=Te(d),{errors:b}=m;let g;e[1]!==t||e[2]!==r?(g=async M=>{await r.call("AI_PROVIDER_KEY_CREATE",{providerId:t,label:M.label||"Personal key",apiKey:M.apiKey})},e[1]=t,e[2]=r,e[3]=g):g=e[3];let y;e[4]!==l||e[5]!==o||e[6]!==a?(y=()=>{a.invalidateQueries({queryKey:ee.aiProviderKeys(o.id)}),a.invalidateQueries({queryKey:ee.aiProviders(o.id)}),J.success("Key saved successfully"),l()},e[4]=l,e[5]=o,e[6]=a,e[7]=y):y=e[7];let j;e[8]!==g||e[9]!==y?(j={mutationFn:g,onSuccess:y,onError:Yt},e[8]=g,e[9]=y,e[10]=j):j=e[10];const{mutate:_,isPending:N,error:I}=ce(j);let E;e[11]!==_?(E=M=>_(M),e[11]=_,e[12]=E):E=e[12];let v;e[13]!==p||e[14]!==E?(v=p(E),e[13]=p,e[14]=E,e[15]=v):v=e[15];let k;e[16]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Label"}),e[16]=k):k=e[16];let C;e[17]!==f?(C=f("label"),e[17]=f,e[18]=C):C=e[18];let w;e[19]!==C?(w=s.jsxs("div",{className:"space-y-1",children:[k,s.jsx(ne,{placeholder:"e.g. Personal key",...C,className:"h-8 text-sm"})]}),e[19]=C,e[20]=w):w=e[20];let h;e[21]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"API Key"}),e[21]=h):h=e[21];const S=c?"text":"password";let x;e[22]!==f?(x=f("apiKey"),e[22]=f,e[23]=x):x=e[23];let O;e[24]!==S||e[25]!==x?(O=s.jsx(ne,{type:S,placeholder:"sk-...",...x,className:"ph-no-capture h-8 text-sm pr-8"}),e[24]=S,e[25]=x,e[26]=O):O=e[26];let A;e[27]!==c?(A=()=>u(!c),e[27]=c,e[28]=A):A=e[28];let z;e[29]!==c?(z=c?s.jsx(ze,{size:14}):s.jsx(Fe,{size:14}),e[29]=c,e[30]=z):z=e[30];let T;e[31]!==A||e[32]!==z?(T=s.jsx("button",{type:"button",onClick:A,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:z}),e[31]=A,e[32]=z,e[33]=T):T=e[33];let U;e[34]!==O||e[35]!==T?(U=s.jsxs("div",{className:"relative",children:[O,T]}),e[34]=O,e[35]=T,e[36]=U):U=e[36];let $;e[37]!==b.apiKey?($=b.apiKey&&s.jsx("p",{className:"text-xs text-destructive",children:b.apiKey.message}),e[37]=b.apiKey,e[38]=$):$=e[38];let R;e[39]!==U||e[40]!==$?(R=s.jsxs("div",{className:"space-y-1",children:[h,U,$]}),e[39]=U,e[40]=$,e[41]=R):R=e[41];let K;e[42]!==I?(K=I&&s.jsx("p",{className:"text-xs text-destructive",children:I.message}),e[42]=I,e[43]=K):K=e[43];let F;e[44]!==N||e[45]!==n?(F=s.jsx(Z,{type:"button",variant:"ghost",size:"sm",onClick:n,disabled:N,children:"Cancel"}),e[44]=N,e[45]=n,e[46]=F):F=e[46];const B=N?"Saving...":"Save Key";let D;e[47]!==N||e[48]!==B?(D=s.jsx(Z,{type:"submit",size:"sm",disabled:N,children:B}),e[47]=N,e[48]=B,e[49]=D):D=e[49];let P;e[50]!==F||e[51]!==D?(P=s.jsxs(Le,{children:[F,D]}),e[50]=F,e[51]=D,e[52]=P):P=e[52];let W;return e[53]!==w||e[54]!==R||e[55]!==K||e[56]!==P||e[57]!==v?(W=s.jsxs("form",{onSubmit:v,className:"space-y-3",children:[w,R,K,P]}),e[53]=w,e[54]=R,e[55]=K,e[56]=P,e[57]=v,e[58]=W):W=e[58],W}function Yt(i){J.error(`Failed to save key: ${i.message}`)}const Xt=Oe({label:re().optional(),baseUrl:re().min(1,"Base URL is required"),apiKey:re().optional()});function Qt(i){const e=V.c(70),{preset:t,onCancel:n,onSuccess:l}=i,{org:o}=le(),r=ue(),a=me(),[c,u]=L.useState(!1);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=Ae(Xt),e[0]=d):d=e[0];const f=t?.defaultBaseUrl??"";let p;e[1]!==f?(p={resolver:d,defaultValues:{label:"",baseUrl:f,apiKey:""}},e[1]=f,e[2]=p):p=e[2];const{register:m,handleSubmit:b,formState:g}=Te(p),{errors:y}=g;let j;e[3]!==t||e[4]!==r?(j=async se=>{const Ge=JSON.stringify({baseUrl:se.baseUrl,apiKey:se.apiKey||""});await r.call("AI_PROVIDER_KEY_CREATE",{providerId:"openai-compatible",label:se.label||t?.name||se.baseUrl,apiKey:Ge,...t?{presetId:t.id}:{}})},e[3]=t,e[4]=r,e[5]=j):j=e[5];let _;e[6]!==l||e[7]!==o||e[8]!==a?(_=()=>{a.invalidateQueries({queryKey:ee.aiProviderKeys(o.id)}),a.invalidateQueries({queryKey:ee.aiProviders(o.id)}),J.success("Connection saved successfully"),l()},e[6]=l,e[7]=o,e[8]=a,e[9]=_):_=e[9];let N;e[10]!==j||e[11]!==_?(N={mutationFn:j,onSuccess:_,onError:Jt},e[10]=j,e[11]=_,e[12]=N):N=e[12];const{mutate:I,isPending:E,error:v}=ce(N),k=t?`e.g. ${t.name} prod, ${t.name} dev`:"e.g. My OpenAI-compatible server",C=t?.baseUrlPlaceholder??"http://localhost:4000/v1";let w;e[13]!==I?(w=se=>I(se),e[13]=I,e[14]=w):w=e[14];let h;e[15]!==b||e[16]!==w?(h=b(w),e[15]=b,e[16]=w,e[17]=h):h=e[17];let S;e[18]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Label"}),e[18]=S):S=e[18];let x;e[19]!==m?(x=m("label"),e[19]=m,e[20]=x):x=e[20];let O;e[21]!==k||e[22]!==x?(O=s.jsxs("div",{className:"space-y-1",children:[S,s.jsx(ne,{placeholder:k,...x,className:"h-8 text-sm"})]}),e[21]=k,e[22]=x,e[23]=O):O=e[23];let A;e[24]!==C||e[25]!==y||e[26]!==t?.defaultBaseUrl||e[27]!==m?(A=t?.defaultBaseUrl?s.jsx("input",{type:"hidden",...m("baseUrl")}):s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Base URL"}),s.jsx(ne,{type:"url",placeholder:C,...m("baseUrl"),className:"h-8 text-sm"}),y.baseUrl&&s.jsx("p",{className:"text-xs text-destructive",children:y.baseUrl.message})]}),e[24]=C,e[25]=y,e[26]=t?.defaultBaseUrl,e[27]=m,e[28]=A):A=e[28];const z=t?.apiKeyRecommended?"recommended":"optional";let T;e[29]!==z?(T=s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["API Key"," ",s.jsxs("span",{className:"text-muted-foreground/60",children:["(",z,")"]})]}),e[29]=z,e[30]=T):T=e[30];const U=c?"text":"password";let $;e[31]!==m?($=m("apiKey"),e[31]=m,e[32]=$):$=e[32];let R;e[33]!==U||e[34]!==$?(R=s.jsx(ne,{type:U,placeholder:"sk-...",...$,className:"ph-no-capture h-8 text-sm pr-8"}),e[33]=U,e[34]=$,e[35]=R):R=e[35];let K;e[36]!==c?(K=()=>u(!c),e[36]=c,e[37]=K):K=e[37];let F;e[38]!==c?(F=c?s.jsx(ze,{size:14}):s.jsx(Fe,{size:14}),e[38]=c,e[39]=F):F=e[39];let B;e[40]!==K||e[41]!==F?(B=s.jsx("button",{type:"button",onClick:K,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:F}),e[40]=K,e[41]=F,e[42]=B):B=e[42];let D;e[43]!==R||e[44]!==B?(D=s.jsxs("div",{className:"relative",children:[R,B]}),e[43]=R,e[44]=B,e[45]=D):D=e[45];let P;e[46]!==T||e[47]!==D?(P=s.jsxs("div",{className:"space-y-1",children:[T,D]}),e[46]=T,e[47]=D,e[48]=P):P=e[48];let W;e[49]!==t?(W=t?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:t.helpText}),e[49]=t,e[50]=W):W=e[50];let M;e[51]!==v?(M=v&&s.jsx("p",{className:"text-xs text-destructive",children:v.message}),e[51]=v,e[52]=M):M=e[52];let q;e[53]!==E||e[54]!==n?(q=s.jsx(Z,{type:"button",variant:"ghost",size:"sm",onClick:n,disabled:E,children:"Cancel"}),e[53]=E,e[54]=n,e[55]=q):q=e[55];const X=E?"Saving...":"Save Connection";let Y;e[56]!==E||e[57]!==X?(Y=s.jsx(Z,{type:"submit",size:"sm",disabled:E,children:X}),e[56]=E,e[57]=X,e[58]=Y):Y=e[58];let G;e[59]!==q||e[60]!==Y?(G=s.jsxs(Le,{children:[q,Y]}),e[59]=q,e[60]=Y,e[61]=G):G=e[61];let te;return e[62]!==O||e[63]!==A||e[64]!==P||e[65]!==W||e[66]!==M||e[67]!==G||e[68]!==h?(te=s.jsxs("form",{onSubmit:h,className:"space-y-3",children:[O,A,P,W,M,G]}),e[62]=O,e[63]=A,e[64]=P,e[65]=W,e[66]=M,e[67]=G,e[68]=h,e[69]=te):te=e[69],te}function Jt(i){J.error(`Failed to save connection: ${i.message}`)}const Zt={kind:"closed"};function es(i,e){switch(e.type){case"open":return i.kind==="closed"?{kind:"grid"}:i;case"close":return{kind:"closed"};case"back":switch(i.kind){case"form":case"oauth-pending":case"provision-pending":case"provision-error":return{kind:"grid"};default:return i}case"select-form":return i.kind!=="grid"?i:{kind:"form",providerId:e.providerId,presetId:e.presetId};case"select-oauth":return i.kind!=="grid"?i:{kind:"oauth-pending",providerId:e.providerId,stateToken:e.stateToken};case"oauth-failed":return i.kind==="oauth-pending"?{kind:"grid"}:i;case"select-provision":return i.kind!=="grid"?i:{kind:"provision-pending",providerId:e.providerId};case"provision-error":return i.kind!=="provision-pending"?i:{kind:"provision-error",providerId:i.providerId,error:e.error};case"retry-provision":return i.kind!=="provision-error"?i:{kind:"provision-pending",providerId:i.providerId}}}function ts(i){switch(i.kind){case"form":case"oauth-pending":case"provision-pending":case"provision-error":return i.providerId;default:return null}}function ss({open:i,onOpenChange:e,initialProvider:t}){const l=he()?.providers??[],{org:o}=le(),r=ue(),a=me(),[c,u]=L.useReducer(es,Zt),d=L.useRef(!1);L.useEffect(()=>{i&&c.kind==="closed"?u({type:"open"}):!i&&c.kind!=="closed"&&u({type:"close"})},[i,c.kind]);const f=()=>{d.current=!1,u({type:"close"}),e(!1)},p=()=>{a.invalidateQueries({queryKey:ee.aiProviderKeys(o.id)}),a.invalidateQueries({queryKey:ee.aiProviders(o.id)})},{mutate:m}=ce({mutationFn:async({providerId:h,code:S,stateToken:x,label:O})=>(await r.call("AI_PROVIDER_OAUTH_EXCHANGE",{providerId:h,code:S,stateToken:x,label:O}),h),onSuccess:h=>{Q("ai_provider_oauth_succeeded",{provider_id:h}),p();const S=l.find(x=>x.id===h);J.success(`${S?.name??"Provider"} connected successfully`),f()},onError:(h,S)=>{Q("ai_provider_oauth_failed",{provider_id:S.providerId,error:h.message}),J.error(`OAuth connection failed: ${h.message}`),u({type:"oauth-failed"})}}),{mutate:b}=ce({mutationFn:async h=>(await r.call("AI_PROVIDER_PROVISION_KEY",{providerId:h}),h),onSuccess:h=>{Q("ai_provider_provision_succeeded",{provider_id:h}),p();const S=l.find(x=>x.id===h);J.success(`${S?.name??"Provider"} connected successfully`),f()},onError:(h,S)=>{Q("ai_provider_provision_failed",{provider_id:S,error:h.message}),u({type:"provision-error",error:h.message})}}),g=async h=>{const{provider:S}=h,x=h.kind==="openai-compatible"?h.preset?.id??null:null,O=S.supportedMethods.includes("oauth-pkce"),A=S.supportedMethods.includes("api-key");if(S.supportsProvision===!0){Q("ai_provider_connect_clicked",{provider_id:S.id,method:"provision"}),u({type:"select-provision",providerId:S.id}),b(S.id);return}if(O){Q("ai_provider_connect_clicked",{provider_id:S.id,method:"oauth-pkce"});try{const T=await r.call("AI_PROVIDER_OAUTH_URL",{providerId:S.id,callbackUrl:`${window.location.origin}/oauth/callback/ai-provider`});if(!T?.url)throw new Error("Invalid response from AI_PROVIDER_OAUTH_URL");u({type:"select-oauth",providerId:S.id,stateToken:T.stateToken}),window.open(T.url,"AiProviderOAuth","width=600,height=700")}catch(T){J.error(`Failed to start OAuth: ${T instanceof Error?T.message:String(T)}`)}return}A&&(Q("ai_provider_connect_clicked",{provider_id:S.id,...x!==null?{preset_id:x}:{},method:"api-key"}),u({type:"select-form",providerId:S.id,presetId:x}))},y=L.useRef(g);y.current=g;const j=L.useRef(t);j.current=t,L.useEffect(()=>{!j.current||c.kind!=="grid"||d.current||(d.current=!0,y.current(j.current))},[c.kind]);const _=c.kind==="oauth-pending"?c.stateToken:null,N=c.kind==="oauth-pending"?c.providerId:null;L.useEffect(()=>{if(c.kind!=="oauth-pending")return;let h=!1;const S=c.stateToken,x=c.providerId,O=z=>{if(z.origin!==window.location.origin||z.data?.type!=="AI_PROVIDER_OAUTH_CALLBACK")return;const{code:T,stateToken:U}=z.data;if(U!==S){J.error("Security check failed: State token mismatch"),u({type:"oauth-failed"});return}h=!0;const $=l.find(R=>R.id===x);m({providerId:x,code:T,stateToken:S,label:$?.name??x})};window.addEventListener("message",O);const A=setTimeout(()=>{h||(Q("ai_provider_oauth_timeout",{provider_id:x}),u({type:"oauth-failed"}),J.error("Connection timed out"))},12e4);return()=>{window.removeEventListener("message",O),clearTimeout(A)}},[c.kind,_,N,m]);const I=ts(c),E=I?l.find(h=>h.id===I):null,k=(c.kind==="form"&&c.presetId?ae.find(h=>h.id===c.presetId):null)?.name??E?.name??"Connect an AI provider",C=c.kind!=="grid"&&c.kind!=="closed",w=()=>{t?f():u({type:"back"})};return s.jsx(yt,{open:c.kind!=="closed",onOpenChange:h=>!h&&f(),children:s.jsxs(jt,{className:"sm:max-w-md max-h-[90vh] overflow-y-auto",children:[s.jsxs(St,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[C&&s.jsx(Z,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:w,children:s.jsx(Re,{size:16})}),s.jsx(Nt,{children:k})]}),c.kind==="grid"&&!t&&s.jsx(kt,{children:"Pick a provider — we'll handle the rest."})]}),c.kind==="grid"&&!t&&s.jsx(De,{providers:l,onSelect:g}),c.kind==="form"&&(c.providerId==="openai-compatible"?s.jsx(Qt,{preset:c.presetId?ae.find(h=>h.id===c.presetId):void 0,onCancel:()=>u({type:"back"}),onSuccess:()=>{p(),f()}}):s.jsx(Gt,{providerId:c.providerId,onCancel:()=>u({type:"back"}),onSuccess:()=>{p(),f()}})),c.kind==="oauth-pending"&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[s.jsx(ge,{size:"lg"}),s.jsx("p",{className:"text-sm text-muted-foreground text-center",children:"Authorize the connection in the popup window. This dialog will close once authorization completes."})]}),c.kind==="provision-pending"&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[s.jsx(ge,{size:"lg"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Connecting…"})]}),c.kind==="provision-error"&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-6",children:[s.jsx(bt,{size:28,className:"text-destructive"}),s.jsx("p",{className:"text-sm text-foreground text-center",children:c.error}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Z,{variant:"outline",size:"sm",onClick:()=>u({type:"back"}),children:"Back"}),s.jsx(Z,{size:"sm",onClick:()=>{u({type:"retry-provision"}),b(c.providerId)},children:"Retry"})]})]})]})})}function is(){const i=V.c(7),{org:e}=le(),t=ue();let n;i[0]!==e.id?(n=ee.defaultBrand(e.id),i[0]=e.id,i[1]=n):n=i[1];let l;i[2]!==t?(l=async()=>{const{items:a}=await t.call("BRAND_CONTEXT_LIST",{});return(Array.isArray(a)?a:[]).find(ns)??null},i[2]=t,i[3]=l):l=i[3];let o;i[4]!==n||i[5]!==l?(o={queryKey:n,queryFn:l},i[4]=n,i[5]=l,i[6]=o):o=i[6];const{data:r}=Qe(o);return r??null}function ns(i){return i.isDefault&&!i.archivedAt}function ls(i){const e=i.colors;if(!e)return null;if(Array.isArray(e)){const t=e.find(l=>typeof l=="object"&&l!==null&&"label"in l&&/primary|brand|main/i.test(l.label)),n=t?t.value:e[0]?.value;return typeof n=="string"?n:null}if(typeof e=="object"){const t=e;return t.primary??Object.values(t)[0]??null}return null}function os(i){const e=V.c(39);let t;e[0]!==i?(t=i===void 0?{}:i,e[0]=i,e[1]=t):t=e[1];const{title:n,description:l}=t,{org:o}=le(),{localMode:r}=Xe(),a=is(),c=Ct(),[u,d]=L.useState(null),[f,p]=L.useState(!1),[m,b]=L.useState(!1),g=he();let y;e[2]!==g?.providers?(y=g?.providers??[],e[2]=g?.providers,e[3]=y):y=e[3];const j=y,_=o.name;let N;e[4]!==a?(N=a?ls(a):null,e[4]=a,e[5]=N):N=e[5];const I=N,E=a?.favicon??a?.logo??null,v=n??(_?`${_} is ready for agents`:"Your agents are almost ready"),k=l??(r?"Connect a provider, or run `bunx decocms@latest link` on your desktop for Claude Code, Codex, and local files.":"Connect a provider — or run `bunx decocms@latest link` on your desktop to use Claude Code, Codex, or your local files."),C=!!(E||I);let w;e[6]!==I?(w=I?{backgroundColor:`${I}18`,borderColor:`${I}30`}:void 0,e[6]=I,e[7]=w):w=e[7];const h=w,S=C?"flex items-center justify-center size-14 rounded-2xl border":"flex items-center justify-center size-14 rounded-2xl bg-muted border border-border";let x;e[8]!==S||e[9]!==h||e[10]!==E||e[11]!==c||e[12]!==I?(x=E?s.jsx("div",{className:S,style:h,children:s.jsx("img",{src:E,alt:"",className:"size-7 rounded object-contain"})}):s.jsx("button",{type:"button",onClick:()=>b(!0),"aria-label":c.online?"Desktop linked":"Connect your desktop",className:de(S,"cursor-pointer transition-colors hover:bg-accent"),style:h,children:s.jsxs("span",{className:"relative inline-flex items-center justify-center",children:[s.jsx(vt,{size:24,style:I?{color:I}:void 0,className:de(!I&&"text-muted-foreground")}),c.online&&s.jsx("span",{className:"absolute -top-0.5 -right-0.5 size-2.5 rounded-full bg-success ring-2 ring-background animate-pulse"})]})}),e[8]=S,e[9]=h,e[10]=E,e[11]=c,e[12]=I,e[13]=x):x=e[13];let O;e[14]!==v?(O=s.jsx("p",{className:"text-xl font-semibold text-foreground tracking-tight",children:v}),e[14]=v,e[15]=O):O=e[15];let A;e[16]!==k?(A=s.jsx("p",{className:"text-sm text-muted-foreground max-w-md",children:k}),e[16]=k,e[17]=A):A=e[17];let z;e[18]!==O||e[19]!==A?(z=s.jsxs("div",{className:"space-y-2",children:[O,A]}),e[18]=O,e[19]=A,e[20]=z):z=e[20];let T;e[21]!==x||e[22]!==z?(T=s.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[x,z]}),e[21]=x,e[22]=z,e[23]=T):T=e[23];let U,$;e[24]===Symbol.for("react.memo_cache_sentinel")?(U=M=>d(M),$=()=>p(!0),e[24]=U,e[25]=$):(U=e[24],$=e[25]);let R;e[26]!==j?(R=s.jsx("div",{className:"w-full",children:s.jsx(De,{providers:j,onSelect:U,onShowAll:$})}),e[26]=j,e[27]=R):R=e[27];const K=u!==null||f;let F;e[28]===Symbol.for("react.memo_cache_sentinel")?(F=M=>{M||(d(null),p(!1))},e[28]=F):F=e[28];const B=u??void 0;let D;e[29]!==K||e[30]!==B?(D=s.jsx(ss,{open:K,onOpenChange:F,initialProvider:B}),e[29]=K,e[30]=B,e[31]=D):D=e[31];let P;e[32]!==m?(P=s.jsx(It,{open:m,onOpenChange:b}),e[32]=m,e[33]=P):P=e[33];let W;return e[34]!==R||e[35]!==D||e[36]!==P||e[37]!==T?(W=s.jsxs("div",{className:"flex flex-col items-center gap-8 w-full max-w-3xl px-4",children:[T,R,D,P]}),e[34]=R,e[35]=D,e[36]=P,e[37]=T,e[38]=W):W=e[38],W}function pe(i){const e=i.title.includes(": ");return{provider:e?i.title.split(": ")[0]??"":i.modelId.split("/")[0]??"",displayName:e?i.title.split(": ").slice(1).join(": "):i.title}}function rs(i){return i<32e3?{level:1,label:"Small",description:"Short conversations"}:i<2e5?{level:2,label:"Medium",description:"Good for most tasks"}:i<5e5?{level:3,label:"Large",description:"Long projects & research"}:{level:4,label:"Very large",description:"Massive files & data"}}const as=["bg-destructive","bg-warning","bg-success","bg-success"],cs=["text-success","text-warning","text-warning","text-destructive"];function ds(i){const e=Math.round(i*.75/1e3);return e>=1?`~${e}K words`:`~${Math.round(i*.75)} words`}function us(i){return i<1?{level:1,label:"Cheap"}:i<5?{level:2,label:"Moderate"}:i<15?{level:3,label:"High"}:{level:4,label:"Expensive"}}const ms={text:{icon:s.jsx(mt,{className:"size-3.5"}),label:"Text"},vision:{icon:s.jsx(ut,{className:"size-3.5"}),label:"Vision"},image:{icon:s.jsx(rt,{className:"size-3.5"}),label:"Image"},tools:{icon:s.jsx(dt,{className:"size-3.5"}),label:"Tools"},reasoning:{icon:s.jsx(Et,{className:"size-3.5"}),label:"Reasoning"},"web-search":{icon:s.jsx(Pe,{className:"size-3.5"}),label:"Web search"}};function hs(i){const e=V.c(5),{capability:t}=i;let n;e[0]!==t?(n=ms[t]??{icon:null,label:t.charAt(0).toUpperCase()+t.slice(1)},e[0]=t,e[1]=n):n=e[1];const l=n;let o;return e[2]!==l.icon||e[3]!==l.label?(o=s.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground border border-border rounded px-2 py-0.5",children:[l.icon,l.label]}),e[2]=l.icon,e[3]=l.label,e[4]=o):o=e[4],o}function fs(i){const e=V.c(49),{model:t,compact:n}=i,l=n===void 0?!1:n;if(!t){let v;return e[0]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"Hover to preview"}),e[0]=v):v=e[0],v}const o=t.costs?.input!=null?t.costs.input*1e6:null,r=t.costs?.output!=null?t.costs.output*1e6:null;let a;e[1]!==t?(a=pe(t),e[1]=t,e[2]=a):a=e[2];const{provider:c,displayName:u}=a;if(l){let v;e[3]!==t.limits?(v=t.limits?.contextWindow&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Context"}),s.jsxs("span",{className:"text-foreground font-medium",children:[t.limits.contextWindow.toLocaleString()," tokens"]})]}),e[3]=t.limits,e[4]=v):v=e[4];let k;e[5]!==o?(k=o!=null&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Input"}),s.jsxs("span",{className:"text-foreground font-medium",children:["$",o.toFixed(2)," / 1M"]})]}),e[5]=o,e[6]=k):k=e[6];let C;e[7]!==r?(C=r!=null&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Output"}),s.jsxs("span",{className:"text-foreground font-medium",children:["$",r.toFixed(2)," / 1M"]})]}),e[7]=r,e[8]=C):C=e[8];let w;e[9]!==t.limits?(w=t.limits?.maxOutputTokens&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Output limit"}),s.jsxs("span",{className:"text-foreground font-medium",children:[t.limits.maxOutputTokens.toLocaleString()," tokens"]})]}),e[9]=t.limits,e[10]=w):w=e[10];let h;return e[11]!==v||e[12]!==k||e[13]!==C||e[14]!==w?(h=s.jsxs("div",{className:"flex flex-col gap-2 pt-3 pb-3 px-3 text-xs",children:[v,k,C,w]}),e[11]=v,e[12]=k,e[13]=C,e[14]=w,e[15]=h):h=e[15],h}let d;e[16]!==c?(d=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:c}),e[16]=c,e[17]=d):d=e[17];let f;e[18]!==t.logo||e[19]!==t.title?(f=t.logo&&s.jsx("img",{src:t.logo,className:"size-6 shrink-0 rounded-md dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[18]=t.logo,e[19]=t.title,e[20]=f):f=e[20];let p;e[21]!==u?(p=s.jsx("p",{className:"text-lg font-semibold leading-snug tracking-tight",children:u}),e[21]=u,e[22]=p):p=e[22];let m;e[23]!==f||e[24]!==p?(m=s.jsxs("div",{className:"flex items-center gap-2.5",children:[f,p]}),e[23]=f,e[24]=p,e[25]=m):m=e[25];let b;e[26]!==t.modelId?(b=s.jsx("p",{className:"text-xs text-muted-foreground/50 font-mono",children:t.modelId}),e[26]=t.modelId,e[27]=b):b=e[27];let g;e[28]!==d||e[29]!==m||e[30]!==b?(g=s.jsxs("div",{className:"flex flex-col gap-1 pt-1 pr-6",children:[d,m,b]}),e[28]=d,e[29]=m,e[30]=b,e[31]=g):g=e[31];let y;e[32]!==t.capabilities?(y=t.capabilities&&t.capabilities.length>0&&s.jsx("div",{className:"flex flex-wrap items-center gap-1.5 pb-4 border-b border-border",children:[...new Set(t.capabilities)].map(ps)}),e[32]=t.capabilities,e[33]=y):y=e[33];let j;e[34]!==t.limits?(j=t.limits?.contextWindow&&(()=>{const{level:v,label:k,description:C}=rs(t.limits.contextWindow);return s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Context window"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex items-center gap-0.5",children:[1,2,3,4].map(w=>s.jsx("div",{className:de("w-2 h-2 rounded-full",w<=v?as[v-1]:"bg-muted")},w))}),s.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:k}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:["— ",C]})]}),s.jsxs("span",{className:"text-sm text-muted-foreground",children:[t.limits.contextWindow.toLocaleString()," tokens"]})]})})(),e[34]=t.limits,e[35]=j):j=e[35];let _;e[36]!==t.limits?(_=t.limits?.maxOutputTokens&&s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Output limit"}),s.jsxs("div",{className:"flex items-baseline gap-2",children:[s.jsxs("span",{className:"text-sm text-foreground",children:[t.limits.maxOutputTokens.toLocaleString()," tokens"]}),s.jsx("span",{className:"text-sm text-muted-foreground",children:ds(t.limits.maxOutputTokens)})]})]}),e[36]=t.limits,e[37]=_):_=e[37];let N;e[38]!==o||e[39]!==r?(N=(o!=null||r!=null)&&(()=>{const{level:v,label:k}=o!=null?us(o):{level:0,label:""};return s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Pricing"}),o!=null&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex items-center",children:[1,2,3,4].map(C=>s.jsx("span",{className:de("text-sm font-bold leading-none",C<=v?cs[v-1]:"text-muted-foreground/20"),children:"$"},C))}),s.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:k})]}),s.jsxs("div",{className:"flex flex-col gap-1",children:[o!=null&&s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Input"}),s.jsxs("span",{className:"text-xs text-foreground",children:["$",o.toFixed(2)," / 1M tokens"]})]}),r!=null&&s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Output"}),s.jsxs("span",{className:"text-xs text-foreground",children:["$",r.toFixed(2)," / 1M tokens"]})]})]})]})})(),e[38]=o,e[39]=r,e[40]=N):N=e[40];let I;e[41]!==j||e[42]!==_||e[43]!==N?(I=s.jsxs("div",{className:"flex flex-col gap-6",children:[j,_,N]}),e[41]=j,e[42]=_,e[43]=N,e[44]=I):I=e[44];let E;return e[45]!==I||e[46]!==g||e[47]!==y?(E=s.jsxs("div",{className:"flex flex-col gap-5 py-1 px-1.5",children:[g,y,I]}),e[45]=I,e[46]=g,e[47]=y,e[48]=E):E=e[48],E}function ps(i){return s.jsx(hs,{capability:i},i)}function ai(i){const e=V.c(19),{model:t,placeholder:n,isLoading:l}=i,o=n===void 0?"Select model":n;if(l===void 0?!1:l){let g;return e[0]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(H,{className:"w-5 h-5 rounded-sm shrink-0"}),s.jsx(H,{className:"w-16 h-3 hidden md:block"})]}),e[0]=g):g=e[0],g}if(!t){let g;e[1]!==o?(g=s.jsx("span",{className:"text-sm text-muted-foreground",children:o}),e[1]=o,e[2]=g):g=e[2];let y;e[3]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(ye,{size:14,className:"text-muted-foreground opacity-50 shrink-0"}),e[3]=y):y=e[3];let j;return e[4]!==g?(j=s.jsxs("div",{className:"flex items-center gap-1.5",children:[g,y]}),e[4]=g,e[5]=j):j=e[5],j}let a;e[6]!==t?(a=pe(t),e[6]=t,e[7]=a):a=e[7];const{displayName:c}=a;let u;e[8]!==t?(u=fe(t),e[8]=t,e[9]=u):u=e[9];const d=u;let f;e[10]!==t.title||e[11]!==d?(f=s.jsx("img",{src:d,className:"w-3.5 h-3.5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[10]=t.title,e[11]=d,e[12]=f):f=e[12];let p;e[13]!==c?(p=s.jsx("span",{className:"text-sm truncate whitespace-nowrap text-muted-foreground max-w-[100px] sm:max-w-none",children:c}),e[13]=c,e[14]=p):p=e[14];let m;e[15]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(ye,{size:14,className:"text-muted-foreground opacity-50 shrink-0"}),e[15]=m):m=e[15];let b;return e[16]!==f||e[17]!==p?(b=s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0 overflow-hidden",children:[f,p,m]}),e[16]=f,e[17]=p,e[18]=b):b=e[18],b}const xs=["vision","image","file","audio","video"],Ue=["image/png","image/jpeg","image/gif","image/webp"],Be=["application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"];function xe(i){const e=i?.capabilities;return e?xs.some(t=>e.includes(t)):!1}function ci(i,e){if(!i)return!1;if(i.startsWith("text/"))return!0;const t=e?.capabilities??[],n=t.includes("vision")||t.includes("image"),l=t.includes("file"),o=t.includes("audio"),r=t.includes("video");return!!(n&&Ue.includes(i)||l&&i==="application/pdf"||o&&i.startsWith("audio/")||r&&i.startsWith("video/")||xe(e)&&Be.includes(i))}function di(i){const e=i?.capabilities??[],t=["text/*"];return(e.includes("vision")||e.includes("image"))&&t.push(...Ue),e.includes("file")&&t.push("application/pdf"),e.includes("audio")&&t.push("audio/*"),e.includes("video")&&t.push("video/*"),xe(i)&&t.push(...Be),t.join(",")}function ui(i){const e=i?.capabilities??[],t=[];return(e.includes("vision")||e.includes("image"))&&t.push("images"),e.includes("file")&&t.push("PDFs"),e.includes("audio")&&t.push("audio"),e.includes("video")&&t.push("video"),xe(i)&&t.push("Office files"),t.length===0?"text only":t.length===1?t[0]:t.length===2?`${t[0]} and ${t[1]}`:`${t.slice(0,-1).join(", ")}, and ${t.at(-1)}`}const We=["smarter","faster","cheaper"],Ve={smarter:"Smarter",faster:"Faster",cheaper:"Cheaper"},gs=[{tier:"smarter",prefixes:["anthropic/claude-opus-4.8","anthropic/claude-sonnet-4.6","anthropic/claude-4.6-sonnet","openai/gpt-5.3-codex","google/gemini-3-pro","google/gemini-2.5-pro","cohere/command-r-plus","cohere/command-a"]},{tier:"faster",prefixes:["anthropic/claude-haiku-4.5","anthropic/claude-4.5-haiku","google/gemini-3-flash","openai/gpt-5.1-codex-mini","x-ai/grok-code-fast","x-ai/grok-3","mistralai/mistral-large","mistralai/codestral","mistralai/mistral-medium","minimax/minimax-m1"]},{tier:"cheaper",prefixes:["google/gemini-2.5-flash-lite","google/gemini-2.5-flash","google/gemini-2.0-flash","deepseek/deepseek-v3","openai/gpt-oss-120b","mistralai/mistral-small","mistralai/pixtral","cohere/command-r"]}],vs=gs.flatMap(({tier:i,prefixes:e})=>e.map(t=>({tier:i,prefix:t}))).sort((i,e)=>e.prefix.length-i.prefix.length),bs="google/gemini-2.5-pro",Ie=new Map;function ys(i){const e=Ie.get(i);if(e!==void 0)return e;let t=null;if(i.endsWith(":free"))t="cheaper";else for(const{tier:n,prefix:l}of vs)if(i.startsWith(l)){if(l===bs&&i.length>l.length&&i[l.length]==="-"){const r=i[l.length+1];if(!r||!/\d/.test(r))continue}t=n;break}return Ie.set(i,t),t}function Ee(i){const e={smarter:[],faster:[],cheaper:[],other:[]};for(const t of i){const n=ys(t.modelId);e[n??"other"].push(t)}for(const t of Object.keys(e))e[t].sort((n,l)=>n.title.localeCompare(l.title));return e}const He="mesh:model-shortlist:",js=new Set(["anthropic/claude-opus-4.8","anthropic/claude-sonnet-4.6","anthropic/claude-4.6-sonnet","anthropic/claude-sonnet-4.6:extended","openai/gpt-5.3-codex","google/gemini-3-pro-preview","google/gemini-2.5-pro","anthropic/claude-haiku-4.5","anthropic/claude-haiku-4.5-20251001","anthropic/claude-4.5-haiku","google/gemini-3-flash-preview","openai/gpt-5.1-codex-mini","x-ai/grok-code-fast-1","google/gemini-2.5-flash","deepseek/deepseek-v3.2","google/gemini-2.5-flash-lite","openai/gpt-oss-120b:free"]);function Ss(i){try{const e=localStorage.getItem(He+i);return e?new Set(JSON.parse(e)):null}catch{return null}}function Ns(i,e){localStorage.setItem(He+i,JSON.stringify([...e]))}function ks(i){const e=V.c(21),{model:t,onHover:n}=i;let l;e[0]!==t?(l=pe(t),e[0]=t,e[1]=l):l=e[1];const{displayName:o,provider:r}=l;let a;e[2]!==t?(a=fe(t),e[2]=t,e[3]=a):a=e[3];const c=a;let u;e[4]!==t||e[5]!==n?(u=()=>n(t),e[4]=t,e[5]=n,e[6]=u):u=e[6];let d;e[7]!==t.title||e[8]!==c?(d=s.jsx("img",{src:c,className:"w-4 h-4 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[7]=t.title,e[8]=c,e[9]=d):d=e[9];let f;e[10]!==o?(f=s.jsx("span",{className:"text-sm text-foreground leading-tight truncate",children:o}),e[10]=o,e[11]=f):f=e[11];let p;e[12]!==r?(p=s.jsx("span",{className:"text-xs text-muted-foreground/60 leading-tight",children:r}),e[12]=r,e[13]=p):p=e[13];let m;e[14]!==f||e[15]!==p?(m=s.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[f,p]}),e[14]=f,e[15]=p,e[16]=m):m=e[16];let b;return e[17]!==u||e[18]!==d||e[19]!==m?(b=s.jsxs("div",{className:"flex items-center gap-2.5 py-2 px-3 hover:bg-accent cursor-pointer rounded-lg",onMouseEnter:u,children:[d,m]}),e[17]=u,e[18]=d,e[19]=m,e[20]=b):b=e[20],b}function ws(i){const e=V.c(10),{error:t,onRetry:n}=i;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"bg-destructive/10 p-2 rounded-full",children:s.jsx(et,{className:"size-5 text-destructive"})}),e[0]=l):l=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("p",{className:"text-sm font-medium text-foreground",children:"Failed to load models"}),e[1]=o):o=e[1];const r=t?.message||"Could not fetch models from this provider.";let a;e[2]!==r?(a=s.jsxs("div",{className:"flex flex-col gap-1",children:[o,s.jsxs("p",{className:"text-xs text-muted-foreground max-w-[260px]",children:[r," Try another provider or retry."]})]}),e[2]=r,e[3]=a):a=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(ct,{className:"size-3.5"}),e[4]=c):c=e[4];let u;e[5]!==n?(u=s.jsx("div",{className:"flex items-center gap-2",children:s.jsxs(Z,{variant:"outline",size:"sm",onClick:n,className:"gap-1.5",children:[c,"Retry"]})}),e[5]=n,e[6]=u):u=e[6];let d;return e[7]!==a||e[8]!==u?(d=s.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-4 py-8 text-center",children:[l,a,u]}),e[7]=a,e[8]=u,e[9]=d):d=e[9],d}function _s(){const i=V.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex-1 overflow-y-auto p-2 space-y-1",children:Array.from({length:6}).map(Cs)}),i[0]=e):e=i[0],e}function Cs(i,e){return s.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 rounded-lg",children:[s.jsx(H,{className:"size-5 shrink-0 rounded-sm"}),s.jsx(H,{className:"flex-1 h-4"}),s.jsx(H,{className:"w-16 h-5 shrink-0 rounded-md"})]},e)}function Me(i){const e=V.c(12),{label:t,models:n,onSelect:l,onHover:o}=i;if(n.length===0)return null;let r;e[0]!==t?(r=s.jsx("div",{className:"text-xs font-medium text-muted-foreground px-3 pt-3 pb-1",children:t}),e[0]=t,e[1]=r):r=e[1];let a;if(e[2]!==n||e[3]!==o||e[4]!==l){let u;e[6]!==o||e[7]!==l?(u=d=>s.jsx("div",{onClick:()=>l(d),className:"cursor-pointer",children:s.jsx(ks,{model:d,onHover:o})},d.modelId),e[6]=o,e[7]=l,e[8]=u):u=e[8],a=n.map(u),e[2]=n,e[3]=o,e[4]=l,e[5]=a}else a=e[5];let c;return e[9]!==r||e[10]!==a?(c=s.jsxs("div",{children:[r,a]}),e[9]=r,e[10]=a,e[11]=c):c=e[11],c}function Is(i){const e=V.c(21),{model:t,isChecked:n,onToggle:l,onHover:o}=i,[r,a]=L.useState(n);r!==n&&a(n);let c;e[0]!==t?(c=fe(t),e[0]=t,e[1]=c):c=e[1];const u=c;let d;e[2]!==t||e[3]!==o?(d=()=>o(t),e[2]=t,e[3]=o,e[4]=d):d=e[4];let f;e[5]!==t.modelId||e[6]!==l?(f=()=>{a(Es),l(t.modelId)},e[5]=t.modelId,e[6]=l,e[7]=f):f=e[7];let p;e[8]!==r||e[9]!==f?(p=s.jsx(tt,{checked:r,onCheckedChange:f}),e[8]=r,e[9]=f,e[10]=p):p=e[10];let m;e[11]!==u||e[12]!==t.title?(m=s.jsx("img",{src:u,className:"w-5 h-5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[11]=u,e[12]=t.title,e[13]=m):m=e[13];let b;e[14]!==t.title?(b=s.jsx("span",{className:"text-sm text-foreground flex-1 min-w-0 line-clamp-1",children:t.title}),e[14]=t.title,e[15]=b):b=e[15];let g;return e[16]!==d||e[17]!==p||e[18]!==m||e[19]!==b?(g=s.jsxs("label",{className:"flex items-center gap-3 min-h-8 py-2.5 px-3 hover:bg-accent cursor-pointer rounded-lg",onMouseEnter:d,children:[p,m,b]}),e[16]=d,e[17]=p,e[18]=m,e[19]=b,e[20]=g):g=e[20],g}function Es(i){return!i}function Ms(i){const e=[];for(const t of We)if(i[t].length>0){e.push({type:"header",label:Ve[t]});for(const n of i[t])e.push({type:"model",model:n})}if(i.other.length>0){e.push({type:"header",label:"Other"});for(const t of i.other)e.push({type:"model",model:t})}return e}function Os({items:i,shortlistSet:e,onToggle:t,onHover:n}){const l=L.useRef(null),o=Dt({count:i.length,getScrollElement:()=>l.current,estimateSize:r=>i[r]?.type==="header"?36:44,overscan:6});return s.jsx("div",{ref:l,className:"flex-1 overflow-y-auto",children:s.jsx("div",{className:"relative",style:{height:o.getTotalSize()},children:o.getVirtualItems().map(r=>{const a=i[r.index];return a?s.jsx("div",{"data-index":r.index,ref:o.measureElement,className:"absolute left-0 right-0 top-0 px-0.5",style:{transform:`translateY(${r.start}px)`},children:a.type==="header"?s.jsx("div",{className:"text-xs font-medium text-muted-foreground px-3 pt-3 pb-1",children:a.label}):s.jsx(Is,{model:a.model,isChecked:e.has(a.model.modelId),onToggle:t,onHover:n})},r.key):null})})})}function As(i){const e=V.c(23),{keyId:t,searchTerm:n,onHover:l,onModelSelect:o,managing:r,onToggleManage:a,filterModels:c}=i,{models:u}=xt(t),d=c?u.filter(c):u.filter(Ts);let f;e[0]!==t?(f=()=>(t?Ss(t):null)??js,e[0]=t,e[1]=f):f=e[1];const[p,m]=L.useState(f),[,b]=L.useTransition();let g;e[2]!==t||e[3]!==b?(g=h=>{t&&b(()=>{m(S=>{const x=new Set(S);return x.has(h)?x.delete(h):x.add(h),Ns(t,x),x})})},e[2]=t,e[3]=b,e[4]=g):g=e[4];const y=g,j=n.toLowerCase().trim(),_=h=>j?h.filter(S=>S.title.toLowerCase().includes(j)||S.modelId.toLowerCase().includes(j)):h;if(r){const h=Ee(_(d)),S=Ms(h);let x;e[5]!==p?(x=T=>p.has(T.modelId),e[5]=p,e[6]=x):x=e[6];const O=d.filter(x).length;let A;e[7]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(Re,{size:14}),e[7]=A):A=e[7];let z;return e[8]!==a?(z=s.jsxs("button",{type:"button",onClick:a,className:"flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground cursor-pointer",children:[A,"Back"]}),e[8]=a,e[9]=z):z=e[9],s.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[s.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border",children:[z,s.jsxs("span",{className:"text-xs text-muted-foreground",children:[O," selected"]})]}),s.jsx(Os,{items:S,shortlistSet:p,onToggle:y,onHover:l})]})}let N;e[10]!==p?(N=h=>p.has(h.modelId),e[10]=p,e[11]=N):N=e[11];const I=d.filter(N),E=I.length>0?I:d,v=Ee(_(E));let k;e[12]!==v||e[13]!==l||e[14]!==o?(k=We.map(h=>s.jsx(Me,{label:Ve[h],models:v[h],onSelect:o,onHover:l},h)),e[12]=v,e[13]=l,e[14]=o,e[15]=k):k=e[15];let C;e[16]!==v.other||e[17]!==l||e[18]!==o?(C=s.jsx(Me,{label:"Other",models:v.other,onSelect:o,onHover:l}),e[16]=v.other,e[17]=l,e[18]=o,e[19]=C):C=e[19];let w;return e[20]!==k||e[21]!==C?(w=s.jsxs("div",{className:"flex-1 overflow-y-auto px-0.5 pt-1 [touch-action:pan-y]",children:[k,C]}),e[20]=k,e[21]=C,e[22]=w):w=e[22],w}function Ts(i){return i.asyncResearch!==!0}function mi(){const i=V.c(6);let e;i[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"border-b border-border h-12 bg-background/95 backdrop-blur sticky top-0 z-10",children:s.jsxs("div",{className:"flex items-center gap-2.5 h-12 px-4",children:[s.jsx(H,{className:"size-4 shrink-0"}),s.jsx(H,{className:"flex-1 h-6"}),s.jsx(H,{className:"w-[140px] h-8 shrink-0"})]})}),i[0]=e):e=i[0];let t;i[1]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsxs("div",{className:"flex-1 flex flex-col md:border-r md:w-[420px] md:min-w-[420px] min-h-0 overflow-hidden",children:[e,s.jsx("div",{className:"flex-1 overflow-y-auto p-2 space-y-1",children:Array.from({length:8}).map(zs)})]}),i[1]=t):t=i[1];let n;i[2]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[s.jsx(H,{className:"size-6 shrink-0"}),s.jsx(H,{className:"h-6 w-32"})]}),i[2]=n):n=i[2];let l;i[3]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs("div",{className:"flex flex-col gap-3 py-2 px-0",children:[n,s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(H,{className:"h-6 w-20 rounded-md"}),s.jsx(H,{className:"h-6 w-24 rounded-md"})]})]}),i[3]=l):l=i[3];let o;i[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(H,{className:"h-4 w-24"}),s.jsx(H,{className:"h-4 w-32"})]}),i[4]=o):o=i[4];let r;return i[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("div",{className:"flex flex-col md:flex-row h-full sm:h-[460px] min-h-0",children:[t,s.jsx("div",{className:"hidden md:block md:w-[320px] md:shrink-0 p-3",children:s.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[l,s.jsxs("div",{className:"flex flex-col gap-4",children:[o,s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(H,{className:"h-4 w-16"}),s.jsx(H,{className:"h-4 w-40"})]})]})]})})]}),i[5]=r):r=i[5],r}function zs(i,e){return s.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 rounded-lg",children:[s.jsx(H,{className:"size-5 shrink-0 rounded-sm"}),s.jsx(H,{className:"flex-1 h-4"}),s.jsx(H,{className:"w-16 h-5 shrink-0 rounded-md"})]},e)}function qe(i){const e=V.c(49),{onClose:t,credentialId:n,onCredentialChange:l,selectedModel:o,onModelChange:r,filterModels:a}=i,[c,u]=L.useState(null),[d,f]=L.useState(""),[p,m]=L.useState(!1),b=L.useRef(null),g=he(),y=pt();let j;e[0]!==g?.providers?(j=Object.fromEntries((g?.providers??[]).map(Ls)),e[0]=g?.providers,e[1]=j):j=e[1];const _=j,N=Je(),{org:I}=le();let E;e[2]!==l?(E=M=>{l(M),u(null)},e[2]=l,e[3]=E):E=e[3];const v=E;let k;e[4]!==n||e[5]!==t||e[6]!==r?(k=M=>{n&&(r(M),f(""),t())},e[4]=n,e[5]=t,e[6]=r,e[7]=k):k=e[7];const C=k;if(y.length===0){let M;return e[8]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsx("div",{className:"flex items-center justify-center p-8 w-full sm:w-[740px]",children:s.jsx(os,{})}),e[8]=M):M=e[8],M}let w;e[9]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(Pe,{size:16,className:"text-muted-foreground shrink-0"}),e[9]=w):w=e[9];const h=p?"Search all models...":"Search for a model...";let S;e[10]===Symbol.for("react.memo_cache_sentinel")?(S=M=>f(M.target.value),e[10]=S):S=e[10];let x;e[11]!==d||e[12]!==h?(x=s.jsx(ne,{ref:b,type:"text",placeholder:h,value:d,onChange:S,className:"flex-1 min-w-0 border-0 !shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"}),e[11]=d,e[12]=h,e[13]=x):x=e[13];let O;e[14]!==n||e[15]!==v||e[16]!==y||e[17]!==_?(O=y.length>0&&s.jsxs(st,{value:n??"",onValueChange:v,children:[s.jsxs(it,{size:"sm",className:"w-auto max-w-[140px] h-8 shrink-0 gap-1.5 px-2 [&>svg:last-child]:hidden",onClick:Ps,children:[s.jsx(nt,{placeholder:"Key",children:(()=>{const M=y.find(te=>te.id===n),q=M?_[M.providerId]:void 0,X=_e(M?.presetId),Y=X?.logo??q?.logo,G=X?.name??q?.name??M?.providerId??"Key";return s.jsxs("span",{className:"flex items-center gap-1.5 min-w-0",children:[Y?s.jsx("img",{src:Y,alt:G,className:"w-4 h-4 rounded shrink-0 dark:bg-white dark:rounded-sm dark:p-px"}):s.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary shrink-0",children:G.slice(0,1).toUpperCase()}),s.jsx("span",{className:"text-xs truncate",children:G})]})})()}),s.jsx(ht,{className:"size-4 opacity-50 shrink-0 pointer-events-none"})]}),s.jsx(lt,{children:y.map(M=>{const q=_[M.providerId],X=_e(M.presetId),Y=X?.logo??q?.logo,G=X?.name??q?.name??M.providerId;return s.jsx(ot,{value:M.id,children:s.jsxs("div",{className:"flex items-center gap-2",children:[Y?s.jsx("img",{src:Y,alt:G,className:"w-4 h-4 rounded dark:bg-white dark:rounded-sm dark:p-px"}):s.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:G.slice(0,1).toUpperCase()}),s.jsxs("span",{children:[G," — ",M.label]})]})},M.id)})})]}),e[14]=n,e[15]=v,e[16]=y,e[17]=_,e[18]=O):O=e[18];let A;e[19]!==x||e[20]!==O?(A=s.jsx("div",{className:"border-b border-border h-12 bg-background/95 backdrop-blur sticky top-0 z-10",children:s.jsxs("label",{className:"flex items-center gap-2.5 h-12 px-4 pr-12 md:pr-4 cursor-text",children:[w,x,O]})}),e[19]=x,e[20]=O,e[21]=A):A=e[21];let z;e[22]!==n?(z=M=>{const{error:q,resetError:X}=M;return s.jsx(ws,{error:q,onRetry:X,credentialId:n??void 0})},e[22]=n,e[23]=z):z=e[23];let T;e[24]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx(_s,{}),e[24]=T):T=e[24];const U=n??void 0;let $;e[25]===Symbol.for("react.memo_cache_sentinel")?($=()=>m(Rs),e[25]=$):$=e[25];let R;e[26]!==a||e[27]!==C||e[28]!==p||e[29]!==d||e[30]!==U?(R=s.jsx(L.Suspense,{fallback:T,children:s.jsx(As,{keyId:U,searchTerm:d,onHover:u,onModelSelect:C,managing:p,onToggleManage:$,filterModels:a})}),e[26]=a,e[27]=C,e[28]=p,e[29]=d,e[30]=U,e[31]=R):R=e[31];let K;e[32]!==n||e[33]!==z||e[34]!==R?(K=s.jsx(Ze,{fallback:z,children:R},n),e[32]=n,e[33]=z,e[34]=R,e[35]=K):K=e[35];let F;e[36]!==p||e[37]!==N||e[38]!==I?(F=!p&&s.jsxs("div",{className:"border-t border-border flex",children:[s.jsxs("button",{type:"button",onClick:()=>L.startTransition(()=>m(!0)),className:"flex items-center gap-2 flex-1 px-4 py-2.5 text-xs text-muted-foreground hover:text-foreground hover:bg-accent cursor-pointer",children:[s.jsx(at,{className:"size-3.5 shrink-0"}),"Manage models"]}),s.jsx("div",{className:"w-px bg-border shrink-0"}),s.jsxs("button",{type:"button",onClick:()=>N({to:"/$org/settings/ai-providers",params:{org:I.slug}}),className:"flex items-center gap-2 flex-1 px-4 py-2.5 text-xs text-muted-foreground hover:text-foreground hover:bg-accent cursor-pointer",children:[s.jsx(ft,{className:"size-3.5 shrink-0"}),"Manage API keys"]})]}),e[36]=p,e[37]=N,e[38]=I,e[39]=F):F=e[39];let B;e[40]!==K||e[41]!==F||e[42]!==A?(B=s.jsxs("div",{className:"flex-1 flex flex-col md:border-r md:w-[420px] md:min-w-[420px] min-h-0 overflow-hidden",children:[A,K,F]}),e[40]=K,e[41]=F,e[42]=A,e[43]=B):B=e[43];const D=c??o??null;let P;e[44]!==D?(P=s.jsx("div",{className:"hidden md:flex md:flex-col md:w-[320px] md:shrink-0 p-3",children:s.jsx(fs,{model:D})}),e[44]=D,e[45]=P):P=e[45];let W;return e[46]!==B||e[47]!==P?(W=s.jsxs("div",{className:"flex flex-col md:flex-row h-full sm:h-[460px] min-h-0",children:[B,P]}),e[46]=B,e[47]=P,e[48]=W):W=e[48],W}function Rs(i){return!i}function Ps(i){return i.stopPropagation()}function Ls(i){return[i.id,i]}function $s(i){const e=V.c(12),{onClose:t}=i,{credentialId:n,setCredentialId:l,selectedModel:o,setModel:r}=gt();let a;e[0]!==l?(a=d=>{Q("chat_credential_changed",{credential_id:d}),l(d)},e[0]=l,e[1]=a):a=e[1];let c;e[2]!==n||e[3]!==o?.modelId||e[4]!==r?(c=d=>{n&&(Q("chat_model_changed",{from_model_id:o?.modelId??null,to_model_id:d.modelId,to_model_provider:d.providerId??null,credential_id:n}),r({...d,keyId:n}))},e[2]=n,e[3]=o?.modelId,e[4]=r,e[5]=c):c=e[5];let u;return e[6]!==n||e[7]!==t||e[8]!==o||e[9]!==a||e[10]!==c?(u=s.jsx(qe,{onClose:t,credentialId:n,onCredentialChange:a,selectedModel:o,onModelChange:c}),e[6]=n,e[7]=t,e[8]=o,e[9]=a,e[10]=c,e[11]=u):u=e[11],u}function hi(i){const e=V.c(2),{onClose:t}=i;let n;return e[0]!==t?(n=s.jsx($s,{onClose:t}),e[0]=t,e[1]=n):n=e[1],n}function fi(i){const e=V.c(2);let t;return e[0]!==i?(t=s.jsx(qe,{...i}),e[0]=i,e[1]=t):t=e[1],t}export{ss as C,fi as D,mi as M,os as N,ae as O,De as P,ai as S,di as a,hi as b,ui as g,ci as i,xe as m};
@@ -1 +1 @@
1
- import"./index-I8Uum3Jx.js";import{e as w}from"./backoff-CrEUbyZT.js";const A={STEP:"decopilot.step",FINISH:"decopilot.finish",THREAD_STATUS:"decopilot.thread.status"},p=Object.values(A),y=3e4,v=1e3;function _(n){const{buildUrl:u,eventTypes:d,name:a,crossTab:f=!1}=n,o=new Map,i=f&&typeof BroadcastChannel<"u"&&typeof navigator<"u"&&typeof navigator.locks<"u";if(i&&!a)throw new Error("createSSESubscription: `name` is required when crossTab");function l(e,t){e.bootDone=!0;for(const s of e.handlers)try{s(t)}catch{}}function h(e){for(const t of e.reconnectHandlers)try{t()}catch{}}function E(e){const t=new EventSource(u(e.key));e.es=t,t.onopen=()=>{e.reconnectAttempt=0,e.bootDone&&(h(e),e.channel?.postMessage({kind:"reconnect"})),e.bootDone=!0},t.onerror=()=>{e.es===t&&t.readyState===EventSource.CLOSED&&b(e)};const s=r=>{e.channel?.postMessage({kind:"event",type:r.type,data:r.data}),l(e,r)};for(const r of d)t.addEventListener(r,s)}function b(e){if(e.refCount<=0||e.reconnectTimer)return;const t=w(y,v,e.reconnectAttempt,2,0);e.reconnectAttempt++,e.reconnectTimer=setTimeout(()=>{e.reconnectTimer=null,!(e.refCount<=0||!e.isLeader)&&(e.es?.close(),E(e))},t)}function T(e){if(e.refCount<=0){e.releaseLeadership?.(),e.releaseLeadership=null;return}e.isLeader=!0,E(e)}function S(e){if(!i){T(e);return}e.lockAbort=new AbortController,navigator.locks.request(`sse-leader:${a}:${e.key}`,{signal:e.lockAbort.signal},()=>new Promise(t=>{e.releaseLeadership=t,T(e)})).catch(()=>{})}function C(e,t){t.kind==="event"?l(e,new MessageEvent(t.type,{data:t.data})):t.kind==="reconnect"&&h(e)}function m(e){const t=o.get(e);if(t)return t;const s={key:e,refCount:0,handlers:new Set,reconnectHandlers:new Set,bootDone:!1,es:null,isLeader:!1,reconnectAttempt:0,reconnectTimer:null,channel:null,lockAbort:null,releaseLeadership:null};if(o.set(e,s),i){const r=new BroadcastChannel(`sse:${a}:${e}`);r.onmessage=c=>C(s,c.data),s.channel=r}return S(s),s}function L(e){e.reconnectTimer&&(clearTimeout(e.reconnectTimer),e.reconnectTimer=null),e.es?.close(),e.es=null,e.releaseLeadership?.(),e.releaseLeadership=null,e.lockAbort?.abort(),e.lockAbort=null,e.channel?.close(),e.channel=null,o.delete(e.key)}return{subscribe(e,t,s){const r=m(e);r.refCount++,r.handlers.add(t),s&&r.reconnectHandlers.add(s);let c=!1;return()=>{c||(c=!0,r.handlers.delete(t),s&&r.reconnectHandlers.delete(s),r.refCount--,r.refCount<=0&&L(r))}}}}function k(n,u){const d=new Set(u);return{subscribe(a,f,o){const i=l=>{d.has(l.type)&&f(l)};return n.subscribe(a,i,o)}}}const D=[...p],g=[...p],O=_({name:"watch",buildUrl:n=>`/api/${encodeURIComponent(n)}/watch?types=${D.join(",")}`,eventTypes:g,crossTab:!0}),H=k(O,[...p]),P=H;export{A as D,P as d};
1
+ import"./index-C5w7M3ak.js";import{e as w}from"./backoff-CrEUbyZT.js";const A={STEP:"decopilot.step",FINISH:"decopilot.finish",THREAD_STATUS:"decopilot.thread.status"},p=Object.values(A),y=3e4,v=1e3;function _(n){const{buildUrl:u,eventTypes:d,name:a,crossTab:f=!1}=n,o=new Map,i=f&&typeof BroadcastChannel<"u"&&typeof navigator<"u"&&typeof navigator.locks<"u";if(i&&!a)throw new Error("createSSESubscription: `name` is required when crossTab");function l(e,t){e.bootDone=!0;for(const s of e.handlers)try{s(t)}catch{}}function h(e){for(const t of e.reconnectHandlers)try{t()}catch{}}function E(e){const t=new EventSource(u(e.key));e.es=t,t.onopen=()=>{e.reconnectAttempt=0,e.bootDone&&(h(e),e.channel?.postMessage({kind:"reconnect"})),e.bootDone=!0},t.onerror=()=>{e.es===t&&t.readyState===EventSource.CLOSED&&b(e)};const s=r=>{e.channel?.postMessage({kind:"event",type:r.type,data:r.data}),l(e,r)};for(const r of d)t.addEventListener(r,s)}function b(e){if(e.refCount<=0||e.reconnectTimer)return;const t=w(y,v,e.reconnectAttempt,2,0);e.reconnectAttempt++,e.reconnectTimer=setTimeout(()=>{e.reconnectTimer=null,!(e.refCount<=0||!e.isLeader)&&(e.es?.close(),E(e))},t)}function T(e){if(e.refCount<=0){e.releaseLeadership?.(),e.releaseLeadership=null;return}e.isLeader=!0,E(e)}function S(e){if(!i){T(e);return}e.lockAbort=new AbortController,navigator.locks.request(`sse-leader:${a}:${e.key}`,{signal:e.lockAbort.signal},()=>new Promise(t=>{e.releaseLeadership=t,T(e)})).catch(()=>{})}function C(e,t){t.kind==="event"?l(e,new MessageEvent(t.type,{data:t.data})):t.kind==="reconnect"&&h(e)}function m(e){const t=o.get(e);if(t)return t;const s={key:e,refCount:0,handlers:new Set,reconnectHandlers:new Set,bootDone:!1,es:null,isLeader:!1,reconnectAttempt:0,reconnectTimer:null,channel:null,lockAbort:null,releaseLeadership:null};if(o.set(e,s),i){const r=new BroadcastChannel(`sse:${a}:${e}`);r.onmessage=c=>C(s,c.data),s.channel=r}return S(s),s}function L(e){e.reconnectTimer&&(clearTimeout(e.reconnectTimer),e.reconnectTimer=null),e.es?.close(),e.es=null,e.releaseLeadership?.(),e.releaseLeadership=null,e.lockAbort?.abort(),e.lockAbort=null,e.channel?.close(),e.channel=null,o.delete(e.key)}return{subscribe(e,t,s){const r=m(e);r.refCount++,r.handlers.add(t),s&&r.reconnectHandlers.add(s);let c=!1;return()=>{c||(c=!0,r.handlers.delete(t),s&&r.reconnectHandlers.delete(s),r.refCount--,r.refCount<=0&&L(r))}}}}function k(n,u){const d=new Set(u);return{subscribe(a,f,o){const i=l=>{d.has(l.type)&&f(l)};return n.subscribe(a,i,o)}}}const D=[...p],g=[...p],O=_({name:"watch",buildUrl:n=>`/api/${encodeURIComponent(n)}/watch?types=${D.join(",")}`,eventTypes:g,crossTab:!0}),H=k(O,[...p]),P=H;export{A as D,P as d};
@@ -1 +1 @@
1
- import{c as n,j as i,cC as u,l as c,bT as m,dr as x,ds as j,cD as N,cE as b,dt as g,du as D}from"./index-I8Uum3Jx.js";import{i as h}from"./X-D7X7Z50V.js";function z(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(u,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(D,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(N,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function w(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(g,{"data-slot":"dialog-close",...t}),e[2]=t,e[3]=s):s=e[3],s}function y(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/45 backdrop-blur-[0.15px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(b,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function $(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(h,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(g,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function T(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(y,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx($,{className:a}),e[8]=a,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(p=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(m,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=p):p=e[14],p}function E(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function R(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function B(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function O(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(j,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{R as D,z as a,T as b,E as c,B as d,O as e,w as f,v as g,y as h,k as i};
1
+ import{c as n,j as i,cC as u,l as c,bT as m,dr as x,ds as j,cD as N,cE as b,dt as g,du as D}from"./index-C5w7M3ak.js";import{i as h}from"./X-C-TqNtc2.js";function z(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(u,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(D,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(N,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function w(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(g,{"data-slot":"dialog-close",...t}),e[2]=t,e[3]=s):s=e[3],s}function y(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/45 backdrop-blur-[0.15px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(b,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function $(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(h,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(g,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function T(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(y,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx($,{className:a}),e[8]=a,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(p=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(m,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=p):p=e[14],p}function E(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function R(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function B(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function O(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(j,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{R as D,z as a,T as b,E as c,B as d,O as e,w as f,v as g,y as h,k as i};
@@ -1 +1 @@
1
- import{c as X,D as H,m as U,r as W,K as J,k as ee,d as Z,w as te,t as p,j as i,B as $}from"./index-I8Uum3Jx.js";import{u as ie}from"./studio-tools-bjPFQfXc.js";import{b as se,S as ne,a as oe}from"./settings-section-B3kXnqLg.js";import{B as Q}from"./badge-toKsUzoB.js";import{I as ae}from"./input-CutcETvq.js";import{d as re,b as le,c as ce,S as de,a as me}from"./select-CeO9pIG_.js";const ue={off:"Off",auto:"Auto-join",request:"Require approval"};function fe(e,t){switch(e){case"auto":return`Anyone with a verified @${t} email joins automatically.`;case"request":return`People with a verified @${t} email can request to join; an admin approves.`;default:return"Not discoverable — no one can find or join through this domain."}}function be(){const e=X.c(69),{org:t}=H(),u=U(),s=ie(),[l,x]=W.useState("");let r;e[0]!==t.id?(r=J.organizationDomains(t.id),e[0]=t.id,e[1]=r):r=e[1];let c;e[2]!==s?(c=()=>s.call("ORGANIZATION_DOMAIN_LIST",{}),e[2]=s,e[3]=c):c=e[3];let d;e[4]!==r||e[5]!==c?(d={queryKey:r,queryFn:c},e[4]=r,e[5]=c,e[6]=d):d=e[6];const{data:f,isPending:j}=ee(d);let m;e[7]!==t.id||e[8]!==u?(m=()=>u.invalidateQueries({queryKey:J.organizationDomains(t.id)}),e[7]=t.id,e[8]=u,e[9]=m):m=e[9];const n=m;let N;e[10]!==s?(N=o=>s.call("ORGANIZATION_DOMAIN_ADD",{domain:o}),e[10]=s,e[11]=N):N=e[11];let v;e[12]!==n||e[13]!==t.id?(v=()=>{te("organization_domain_added",{organization_id:t.id}),x(""),n(),p.success("Domain added")},e[12]=n,e[13]=t.id,e[14]=v):v=e[14];let P;e[15]!==N||e[16]!==v?(P={mutationFn:N,onSuccess:v,onError:je},e[15]=N,e[16]=v,e[17]=P):P=e[17];const h=Z(P);let S;e[18]!==s?(S=o=>{const{id:a,joinMode:g}=o;return s.call("ORGANIZATION_DOMAIN_UPDATE",{id:a,joinMode:g})},e[18]=s,e[19]=S):S=e[19];let y;e[20]!==n?(y=()=>{n(),p.success("Join mode updated")},e[20]=n,e[21]=y):y=e[21];let R;e[22]!==S||e[23]!==y?(R={mutationFn:S,onSuccess:y,onError:ge},e[22]=S,e[23]=y,e[24]=R):R=e[24];const F=Z(R);let _;e[25]!==s?(_=o=>s.call("ORGANIZATION_DOMAIN_VERIFY",{id:o}),e[25]=s,e[26]=_):_=e[26];let D;e[27]!==n?(D=o=>{n(),o.verified?p.success("Domain verified"):p.error("TXT record not found yet — DNS can take a few minutes.")},e[27]=n,e[28]=D):D=e[28];let V;e[29]!==_||e[30]!==D?(V={mutationFn:_,onSuccess:D,onError:he},e[29]=_,e[30]=D,e[31]=V):V=e[31];const A=Z(V);let I;e[32]!==s?(I=o=>s.call("ORGANIZATION_DOMAIN_REMOVE",{id:o}),e[32]=s,e[33]=I):I=e[33];let b;e[34]!==n?(b=()=>{n(),p.success("Domain removed")},e[34]=n,e[35]=b):b=e[35];let q;e[36]!==I||e[37]!==b?(q={mutationFn:I,onSuccess:b,onError:xe},e[36]=I,e[37]=b,e[38]=q):q=e[38];const E=Z(q);if(j)return null;let z;e[39]!==f?.domains?(z=f?.domains??[],e[39]=f?.domains,e[40]=z):z=e[40];const K=z;let O;if(e[41]!==K||e[42]!==E||e[43]!==F||e[44]!==A){let o;e[46]!==E||e[47]!==F||e[48]!==A?(o=a=>{const g=a.verificationStatus==="verified";return i.jsx(se,{title:i.jsxs("span",{className:"flex items-center gap-2",children:[a.domain,g?i.jsx(Q,{variant:"secondary",children:"Verified"}):i.jsx(Q,{variant:"outline",children:"Pending"})]}),description:g?fe(a.joinMode,a.domain):"Add the DNS record below, then verify.",action:i.jsxs("div",{className:"flex items-center gap-2",children:[g&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-xs text-muted-foreground",children:"Join mode"}),i.jsxs(re,{value:a.joinMode,onValueChange:Y=>F.mutate({id:a.id,joinMode:Y}),children:[i.jsx(le,{className:"w-44",size:"sm",children:i.jsx(ce,{})}),i.jsx(de,{children:["off","auto","request"].map(pe)})]})]}),!g&&i.jsx($,{size:"sm",variant:"outline",onClick:()=>A.mutate(a.id),disabled:A.isPending,children:"Verify"}),i.jsx($,{size:"sm",variant:"ghost",onClick:()=>E.mutate(a.id),disabled:E.isPending,children:"Remove"})]}),children:!g&&a.recordName&&a.recordValue&&i.jsx(Ne,{recordName:a.recordName,recordValue:a.recordValue})},a.id)},e[46]=E,e[47]=F,e[48]=A,e[49]=o):o=e[49],O=K.map(o),e[41]=K,e[42]=E,e[43]=F,e[44]=A,e[45]=O}else O=e[45];let B;e[50]===Symbol.for("react.memo_cache_sentinel")?(B=o=>x(o.target.value),e[50]=B):B=e[50];let M;e[51]!==l?(M=i.jsx(ae,{value:l,onChange:B,placeholder:"acme.com",className:"max-w-xs"}),e[51]=l,e[52]=M):M=e[52];let T;e[53]!==h||e[54]!==l?(T=()=>h.mutate(l.trim()),e[53]=h,e[54]=l,e[55]=T):T=e[55];let C;e[56]!==h.isPending||e[57]!==l?(C=!l.trim()||h.isPending,e[56]=h.isPending,e[57]=l,e[58]=C):C=e[58];const L=h.isPending?"Adding…":"Add domain";let w;e[59]!==T||e[60]!==C||e[61]!==L?(w=i.jsx($,{size:"sm",onClick:T,disabled:C,children:L}),e[59]=T,e[60]=C,e[61]=L,e[62]=w):w=e[62];let k;e[63]!==M||e[64]!==w?(k=i.jsxs("div",{className:"flex items-center gap-2 p-4",children:[M,w]}),e[63]=M,e[64]=w,e[65]=k):k=e[65];let G;return e[66]!==O||e[67]!==k?(G=i.jsx(ne,{title:"Email domains",description:"Let people with a matching email domain discover and join this organization.",children:i.jsxs(oe,{children:[O,k]})}),e[66]=O,e[67]=k,e[68]=G):G=e[68],G}function pe(e){return i.jsx(me,{value:e,children:ue[e]},e)}function xe(e){return p.error(e instanceof Error?e.message:"Failed to remove")}function he(e){return p.error(e instanceof Error?e.message:"Failed to verify")}function ge(e){return p.error(e instanceof Error?e.message:"Failed to update")}function je(e){return p.error(e instanceof Error?e.message:"Failed to add domain")}function Ne(e){const t=X.c(16),{recordName:u,recordValue:s}=e,l=ve;let x;t[0]===Symbol.for("react.memo_cache_sentinel")?(x=i.jsx("p",{className:"text-muted-foreground",children:"Add this TXT record at your DNS provider, then click Verify:"}),t[0]=x):x=t[0];let r;t[1]!==u?(r=()=>l(u),t[1]=u,t[2]=r):r=t[2];let c;t[3]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx("span",{className:"text-muted-foreground",children:"TXT "}),t[3]=c):c=t[3];let d;t[4]!==u||t[5]!==r?(d=i.jsxs("button",{type:"button",className:"text-left font-mono break-all hover:underline",onClick:r,children:[c,u]}),t[4]=u,t[5]=r,t[6]=d):d=t[6];let f;t[7]!==s?(f=()=>l(s),t[7]=s,t[8]=f):f=t[8];let j;t[9]===Symbol.for("react.memo_cache_sentinel")?(j=i.jsx("span",{className:"text-muted-foreground",children:"value "}),t[9]=j):j=t[9];let m;t[10]!==s||t[11]!==f?(m=i.jsxs("button",{type:"button",className:"text-left font-mono break-all hover:underline",onClick:f,children:[j,s]}),t[10]=s,t[11]=f,t[12]=m):m=t[12];let n;return t[13]!==d||t[14]!==m?(n=i.jsxs("div",{className:"mt-3 rounded-lg border border-border bg-muted/40 p-3 text-xs space-y-2",children:[x,i.jsxs("div",{className:"grid gap-1",children:[d,m]})]}),t[13]=d,t[14]=m,t[15]=n):n=t[15],n}function ve(e){navigator.clipboard?.writeText(e),p.success("Copied")}export{be as D};
1
+ import{c as X,D as H,m as U,r as W,K as J,k as ee,d as Z,w as te,t as p,j as i,B as $}from"./index-C5w7M3ak.js";import{u as ie}from"./studio-tools-BJLBgOee.js";import{b as se,S as ne,a as oe}from"./settings-section-Cv3fX46A.js";import{B as Q}from"./badge-CPOFnH5f.js";import{I as ae}from"./input-agFYfi3v.js";import{d as re,b as le,c as ce,S as de,a as me}from"./select--NMtIJXa.js";const ue={off:"Off",auto:"Auto-join",request:"Require approval"};function fe(e,t){switch(e){case"auto":return`Anyone with a verified @${t} email joins automatically.`;case"request":return`People with a verified @${t} email can request to join; an admin approves.`;default:return"Not discoverable — no one can find or join through this domain."}}function be(){const e=X.c(69),{org:t}=H(),u=U(),s=ie(),[l,x]=W.useState("");let r;e[0]!==t.id?(r=J.organizationDomains(t.id),e[0]=t.id,e[1]=r):r=e[1];let c;e[2]!==s?(c=()=>s.call("ORGANIZATION_DOMAIN_LIST",{}),e[2]=s,e[3]=c):c=e[3];let d;e[4]!==r||e[5]!==c?(d={queryKey:r,queryFn:c},e[4]=r,e[5]=c,e[6]=d):d=e[6];const{data:f,isPending:j}=ee(d);let m;e[7]!==t.id||e[8]!==u?(m=()=>u.invalidateQueries({queryKey:J.organizationDomains(t.id)}),e[7]=t.id,e[8]=u,e[9]=m):m=e[9];const n=m;let N;e[10]!==s?(N=o=>s.call("ORGANIZATION_DOMAIN_ADD",{domain:o}),e[10]=s,e[11]=N):N=e[11];let v;e[12]!==n||e[13]!==t.id?(v=()=>{te("organization_domain_added",{organization_id:t.id}),x(""),n(),p.success("Domain added")},e[12]=n,e[13]=t.id,e[14]=v):v=e[14];let P;e[15]!==N||e[16]!==v?(P={mutationFn:N,onSuccess:v,onError:je},e[15]=N,e[16]=v,e[17]=P):P=e[17];const h=Z(P);let S;e[18]!==s?(S=o=>{const{id:a,joinMode:g}=o;return s.call("ORGANIZATION_DOMAIN_UPDATE",{id:a,joinMode:g})},e[18]=s,e[19]=S):S=e[19];let y;e[20]!==n?(y=()=>{n(),p.success("Join mode updated")},e[20]=n,e[21]=y):y=e[21];let R;e[22]!==S||e[23]!==y?(R={mutationFn:S,onSuccess:y,onError:ge},e[22]=S,e[23]=y,e[24]=R):R=e[24];const F=Z(R);let _;e[25]!==s?(_=o=>s.call("ORGANIZATION_DOMAIN_VERIFY",{id:o}),e[25]=s,e[26]=_):_=e[26];let D;e[27]!==n?(D=o=>{n(),o.verified?p.success("Domain verified"):p.error("TXT record not found yet — DNS can take a few minutes.")},e[27]=n,e[28]=D):D=e[28];let V;e[29]!==_||e[30]!==D?(V={mutationFn:_,onSuccess:D,onError:he},e[29]=_,e[30]=D,e[31]=V):V=e[31];const A=Z(V);let I;e[32]!==s?(I=o=>s.call("ORGANIZATION_DOMAIN_REMOVE",{id:o}),e[32]=s,e[33]=I):I=e[33];let b;e[34]!==n?(b=()=>{n(),p.success("Domain removed")},e[34]=n,e[35]=b):b=e[35];let q;e[36]!==I||e[37]!==b?(q={mutationFn:I,onSuccess:b,onError:xe},e[36]=I,e[37]=b,e[38]=q):q=e[38];const E=Z(q);if(j)return null;let z;e[39]!==f?.domains?(z=f?.domains??[],e[39]=f?.domains,e[40]=z):z=e[40];const K=z;let O;if(e[41]!==K||e[42]!==E||e[43]!==F||e[44]!==A){let o;e[46]!==E||e[47]!==F||e[48]!==A?(o=a=>{const g=a.verificationStatus==="verified";return i.jsx(se,{title:i.jsxs("span",{className:"flex items-center gap-2",children:[a.domain,g?i.jsx(Q,{variant:"secondary",children:"Verified"}):i.jsx(Q,{variant:"outline",children:"Pending"})]}),description:g?fe(a.joinMode,a.domain):"Add the DNS record below, then verify.",action:i.jsxs("div",{className:"flex items-center gap-2",children:[g&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-xs text-muted-foreground",children:"Join mode"}),i.jsxs(re,{value:a.joinMode,onValueChange:Y=>F.mutate({id:a.id,joinMode:Y}),children:[i.jsx(le,{className:"w-44",size:"sm",children:i.jsx(ce,{})}),i.jsx(de,{children:["off","auto","request"].map(pe)})]})]}),!g&&i.jsx($,{size:"sm",variant:"outline",onClick:()=>A.mutate(a.id),disabled:A.isPending,children:"Verify"}),i.jsx($,{size:"sm",variant:"ghost",onClick:()=>E.mutate(a.id),disabled:E.isPending,children:"Remove"})]}),children:!g&&a.recordName&&a.recordValue&&i.jsx(Ne,{recordName:a.recordName,recordValue:a.recordValue})},a.id)},e[46]=E,e[47]=F,e[48]=A,e[49]=o):o=e[49],O=K.map(o),e[41]=K,e[42]=E,e[43]=F,e[44]=A,e[45]=O}else O=e[45];let B;e[50]===Symbol.for("react.memo_cache_sentinel")?(B=o=>x(o.target.value),e[50]=B):B=e[50];let M;e[51]!==l?(M=i.jsx(ae,{value:l,onChange:B,placeholder:"acme.com",className:"max-w-xs"}),e[51]=l,e[52]=M):M=e[52];let T;e[53]!==h||e[54]!==l?(T=()=>h.mutate(l.trim()),e[53]=h,e[54]=l,e[55]=T):T=e[55];let C;e[56]!==h.isPending||e[57]!==l?(C=!l.trim()||h.isPending,e[56]=h.isPending,e[57]=l,e[58]=C):C=e[58];const L=h.isPending?"Adding…":"Add domain";let w;e[59]!==T||e[60]!==C||e[61]!==L?(w=i.jsx($,{size:"sm",onClick:T,disabled:C,children:L}),e[59]=T,e[60]=C,e[61]=L,e[62]=w):w=e[62];let k;e[63]!==M||e[64]!==w?(k=i.jsxs("div",{className:"flex items-center gap-2 p-4",children:[M,w]}),e[63]=M,e[64]=w,e[65]=k):k=e[65];let G;return e[66]!==O||e[67]!==k?(G=i.jsx(ne,{title:"Email domains",description:"Let people with a matching email domain discover and join this organization.",children:i.jsxs(oe,{children:[O,k]})}),e[66]=O,e[67]=k,e[68]=G):G=e[68],G}function pe(e){return i.jsx(me,{value:e,children:ue[e]},e)}function xe(e){return p.error(e instanceof Error?e.message:"Failed to remove")}function he(e){return p.error(e instanceof Error?e.message:"Failed to verify")}function ge(e){return p.error(e instanceof Error?e.message:"Failed to update")}function je(e){return p.error(e instanceof Error?e.message:"Failed to add domain")}function Ne(e){const t=X.c(16),{recordName:u,recordValue:s}=e,l=ve;let x;t[0]===Symbol.for("react.memo_cache_sentinel")?(x=i.jsx("p",{className:"text-muted-foreground",children:"Add this TXT record at your DNS provider, then click Verify:"}),t[0]=x):x=t[0];let r;t[1]!==u?(r=()=>l(u),t[1]=u,t[2]=r):r=t[2];let c;t[3]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx("span",{className:"text-muted-foreground",children:"TXT "}),t[3]=c):c=t[3];let d;t[4]!==u||t[5]!==r?(d=i.jsxs("button",{type:"button",className:"text-left font-mono break-all hover:underline",onClick:r,children:[c,u]}),t[4]=u,t[5]=r,t[6]=d):d=t[6];let f;t[7]!==s?(f=()=>l(s),t[7]=s,t[8]=f):f=t[8];let j;t[9]===Symbol.for("react.memo_cache_sentinel")?(j=i.jsx("span",{className:"text-muted-foreground",children:"value "}),t[9]=j):j=t[9];let m;t[10]!==s||t[11]!==f?(m=i.jsxs("button",{type:"button",className:"text-left font-mono break-all hover:underline",onClick:f,children:[j,s]}),t[10]=s,t[11]=f,t[12]=m):m=t[12];let n;return t[13]!==d||t[14]!==m?(n=i.jsxs("div",{className:"mt-3 rounded-lg border border-border bg-muted/40 p-3 text-xs space-y-2",children:[x,i.jsxs("div",{className:"grid gap-1",children:[d,m]})]}),t[13]=d,t[14]=m,t[15]=n):n=t[15],n}function ve(e){navigator.clipboard?.writeText(e),p.success("Copied")}export{be as D};
@@ -1 +1 @@
1
- import{c as d,j as s,cu as i,l as c}from"./index-I8Uum3Jx.js";function x(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Root,{"data-slot":"drawer",...t}),e[2]=t,e[3]=a):a=e[3],a}function v(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Trigger,{"data-slot":"drawer-trigger",...t}),e[2]=t,e[3]=a):a=e[3],a}function w(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Portal,{"data-slot":"drawer-portal",...t}),e[2]=t,e[3]=a):a=e[3],a}function b(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Close,{"data-slot":"drawer-close",...t}),e[2]=t,e[3]=a):a=e[3],a}function m(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Overlay,{"data-slot":"drawer-overlay",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function g(l){const e=d.c(12);let t,a,r;e[0]!==l?({className:a,children:t,...r}=l,e[0]=l,e[1]=t,e[2]=a,e[3]=r):(t=e[1],a=e[2],r=e[3]);let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(m,{}),e[4]=o):o=e[4];let n;e[5]!==a?(n=c("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[95vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",a),e[5]=a,e[6]=n):n=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),e[7]=f):f=e[7];let u;return e[8]!==t||e[9]!==r||e[10]!==n?(u=s.jsxs(w,{"data-slot":"drawer-portal",children:[o,s.jsxs(i.Content,{"data-slot":"drawer-content",className:n,...r,children:[f,t]})]}),e[8]=t,e[9]=r,e[10]=n,e[11]=u):u=e[11],u}function h(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("flex flex-col gap-1.5 px-4 py-2",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx("div",{"data-slot":"drawer-header",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function j(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("mt-auto flex flex-col gap-2 p-4",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx("div",{"data-slot":"drawer-footer",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function D(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("text-foreground font-semibold",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Title,{"data-slot":"drawer-title",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function N(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Description,{"data-slot":"drawer-description",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}export{x as D,g as a,D as b,h as c,N as d,b as e,j as f,v as g};
1
+ import{c as d,j as s,cu as i,l as c}from"./index-C5w7M3ak.js";function x(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Root,{"data-slot":"drawer",...t}),e[2]=t,e[3]=a):a=e[3],a}function v(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Trigger,{"data-slot":"drawer-trigger",...t}),e[2]=t,e[3]=a):a=e[3],a}function w(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Portal,{"data-slot":"drawer-portal",...t}),e[2]=t,e[3]=a):a=e[3],a}function b(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Close,{"data-slot":"drawer-close",...t}),e[2]=t,e[3]=a):a=e[3],a}function m(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Overlay,{"data-slot":"drawer-overlay",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function g(l){const e=d.c(12);let t,a,r;e[0]!==l?({className:a,children:t,...r}=l,e[0]=l,e[1]=t,e[2]=a,e[3]=r):(t=e[1],a=e[2],r=e[3]);let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(m,{}),e[4]=o):o=e[4];let n;e[5]!==a?(n=c("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[95vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",a),e[5]=a,e[6]=n):n=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),e[7]=f):f=e[7];let u;return e[8]!==t||e[9]!==r||e[10]!==n?(u=s.jsxs(w,{"data-slot":"drawer-portal",children:[o,s.jsxs(i.Content,{"data-slot":"drawer-content",className:n,...r,children:[f,t]})]}),e[8]=t,e[9]=r,e[10]=n,e[11]=u):u=e[11],u}function h(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("flex flex-col gap-1.5 px-4 py-2",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx("div",{"data-slot":"drawer-header",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function j(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("mt-auto flex flex-col gap-2 p-4",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx("div",{"data-slot":"drawer-footer",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function D(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("text-foreground font-semibold",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Title,{"data-slot":"drawer-title",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function N(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Description,{"data-slot":"drawer-description",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}export{x as D,g as a,D as b,h as c,N as d,b as e,j as f,v as g};
@@ -1 +1 @@
1
- import{c,j as d,dY as f,dZ as m,l as u,d_ as g,d$ as x,e0 as v,e1 as b,e2 as h,e3 as w,e4 as j,e5 as N,e6 as z,e7 as _,e8 as y,e9 as p}from"./index-I8Uum3Jx.js";import{i as $}from"./ChevronUp-HJUE3-BD.js";import{i as D}from"./ChevronRight-oz8o6WPV.js";import{i as M}from"./DotsVertical-QF46dzdi.js";function C(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(f,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=s):s=e[3],s}function T(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(m,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function E(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,sideOffset:o,...s}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);const n=o===void 0?4:o;let r;e[4]!==t?(r=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border p-1 shadow-md",t),e[4]=t,e[5]=r):r=e[5];let i;return e[6]!==s||e[7]!==n||e[8]!==r?(i=d.jsx(x,{children:d.jsx(v,{"data-slot":"dropdown-menu-content",sideOffset:n,className:r,...s})}),e[6]=s,e[7]=n,e[8]=r,e[9]=i):i=e[9],i}function G(a){const e=c.c(12);let t,s,o,n;e[0]!==a?({className:t,inset:s,variant:n,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);const r=n===void 0?"default":n;let i;e[5]!==t?(i=u("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[5]=t,e[6]=i):i=e[6];let l;return e[7]!==s||e[8]!==o||e[9]!==i||e[10]!==r?(l=d.jsx(g,{"data-slot":"dropdown-menu-item","data-inset":s,"data-variant":r,className:i,...o}),e[7]=s,e[8]=o,e[9]=i,e[10]=r,e[11]=l):l=e[11],l}function L(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:o,children:s,checked:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==o?(r=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=r):r=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:d.jsx(p,{children:d.jsx($,{className:"size-4"})})}),e[7]=i):i=e[7];let l;return e[8]!==t||e[9]!==s||e[10]!==n||e[11]!==r?(l=d.jsxs(h,{"data-slot":"dropdown-menu-checkbox-item",className:r,checked:t,...n,children:[i,s]}),e[8]=t,e[9]=s,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function O(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(_,{"data-slot":"dropdown-menu-radio-group",...t}),e[2]=t,e[3]=s):s=e[3],s}function P(a){const e=c.c(11);let t,s,o;e[0]!==a?({className:s,children:t,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==s?(n=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),e[4]=s,e[5]=n):n=e[5];let r;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=d.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:d.jsx(p,{children:d.jsx(M,{className:"size-2 fill-current"})})}),e[6]=r):r=e[6];let i;return e[7]!==t||e[8]!==o||e[9]!==n?(i=d.jsxs(y,{"data-slot":"dropdown-menu-radio-item",className:n,...o,children:[r,t]}),e[7]=t,e[8]=o,e[9]=n,e[10]=i):i=e[10],i}function Y(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,inset:s,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==t?(n=u("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",t),e[4]=t,e[5]=n):n=e[5];let r;return e[6]!==s||e[7]!==o||e[8]!==n?(r=d.jsx(b,{"data-slot":"dropdown-menu-label","data-inset":s,className:n,...o}),e[6]=s,e[7]=o,e[8]=n,e[9]=r):r=e[9],r}function Z(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("bg-border -mx-1 my-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=d.jsx(w,{"data-slot":"dropdown-menu-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}function q(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(j,{"data-slot":"dropdown-menu-sub",...t}),e[2]=t,e[3]=s):s=e[3],s}function A(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:s,inset:o,children:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==s?(r=u("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",s),e[5]=s,e[6]=r):r=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(D,{className:"ml-auto size-4"}),e[7]=i):i=e[7];let l;return e[8]!==t||e[9]!==o||e[10]!==n||e[11]!==r?(l=d.jsxs(N,{"data-slot":"dropdown-menu-sub-trigger","data-inset":o,className:r,...n,children:[t,i]}),e[8]=t,e[9]=o,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function B(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=d.jsx(z,{"data-slot":"dropdown-menu-sub-content",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}export{C as D,T as a,E as b,G as c,q as d,A as e,B as f,Z as g,Y as h,P as i,O as j,L as k};
1
+ import{c,j as d,dY as f,dZ as m,l as u,d_ as g,d$ as x,e0 as v,e1 as b,e2 as h,e3 as w,e4 as j,e5 as N,e6 as z,e7 as _,e8 as y,e9 as p}from"./index-C5w7M3ak.js";import{i as $}from"./ChevronUp-CADhYHt4.js";import{i as D}from"./ChevronRight-j760Iee-.js";import{i as M}from"./DotsVertical-AD-a2Knc.js";function C(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(f,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=s):s=e[3],s}function T(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(m,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function E(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,sideOffset:o,...s}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);const n=o===void 0?4:o;let r;e[4]!==t?(r=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border p-1 shadow-md",t),e[4]=t,e[5]=r):r=e[5];let i;return e[6]!==s||e[7]!==n||e[8]!==r?(i=d.jsx(x,{children:d.jsx(v,{"data-slot":"dropdown-menu-content",sideOffset:n,className:r,...s})}),e[6]=s,e[7]=n,e[8]=r,e[9]=i):i=e[9],i}function G(a){const e=c.c(12);let t,s,o,n;e[0]!==a?({className:t,inset:s,variant:n,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);const r=n===void 0?"default":n;let i;e[5]!==t?(i=u("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[5]=t,e[6]=i):i=e[6];let l;return e[7]!==s||e[8]!==o||e[9]!==i||e[10]!==r?(l=d.jsx(g,{"data-slot":"dropdown-menu-item","data-inset":s,"data-variant":r,className:i,...o}),e[7]=s,e[8]=o,e[9]=i,e[10]=r,e[11]=l):l=e[11],l}function L(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:o,children:s,checked:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==o?(r=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=r):r=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:d.jsx(p,{children:d.jsx($,{className:"size-4"})})}),e[7]=i):i=e[7];let l;return e[8]!==t||e[9]!==s||e[10]!==n||e[11]!==r?(l=d.jsxs(h,{"data-slot":"dropdown-menu-checkbox-item",className:r,checked:t,...n,children:[i,s]}),e[8]=t,e[9]=s,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function O(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(_,{"data-slot":"dropdown-menu-radio-group",...t}),e[2]=t,e[3]=s):s=e[3],s}function P(a){const e=c.c(11);let t,s,o;e[0]!==a?({className:s,children:t,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==s?(n=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),e[4]=s,e[5]=n):n=e[5];let r;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=d.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:d.jsx(p,{children:d.jsx(M,{className:"size-2 fill-current"})})}),e[6]=r):r=e[6];let i;return e[7]!==t||e[8]!==o||e[9]!==n?(i=d.jsxs(y,{"data-slot":"dropdown-menu-radio-item",className:n,...o,children:[r,t]}),e[7]=t,e[8]=o,e[9]=n,e[10]=i):i=e[10],i}function Y(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,inset:s,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==t?(n=u("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",t),e[4]=t,e[5]=n):n=e[5];let r;return e[6]!==s||e[7]!==o||e[8]!==n?(r=d.jsx(b,{"data-slot":"dropdown-menu-label","data-inset":s,className:n,...o}),e[6]=s,e[7]=o,e[8]=n,e[9]=r):r=e[9],r}function Z(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("bg-border -mx-1 my-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=d.jsx(w,{"data-slot":"dropdown-menu-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}function q(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(j,{"data-slot":"dropdown-menu-sub",...t}),e[2]=t,e[3]=s):s=e[3],s}function A(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:s,inset:o,children:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==s?(r=u("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",s),e[5]=s,e[6]=r):r=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(D,{className:"ml-auto size-4"}),e[7]=i):i=e[7];let l;return e[8]!==t||e[9]!==o||e[10]!==n||e[11]!==r?(l=d.jsxs(N,{"data-slot":"dropdown-menu-sub-trigger","data-inset":o,className:r,...n,children:[t,i]}),e[8]=t,e[9]=o,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function B(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=d.jsx(z,{"data-slot":"dropdown-menu-sub-content",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}export{C as D,T as a,E as b,G as c,q as d,A as e,B as f,Z as g,Y as h,P as i,O as j,L as k};
@@ -1 +1 @@
1
- import{c as v,l as N,j as t}from"./index-I8Uum3Jx.js";function y(){const x=v.c(1);let e;return x[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("img",{src:"/empty-state-cards.png",alt:"",width:336,height:320,"aria-hidden":"true"}),x[0]=e):e=x[0],e}function C(x){const e=v.c(24),{image:f,title:p,description:u,actions:o,className:h,descriptionClassName:j,actionsClassName:g}=x;let s;e[0]!==h?(s=N("flex flex-1 flex-col items-center justify-center gap-8 p-4",h),e[0]=h,e[1]=s):s=e[1];let l;e[2]!==f?(l=f!==null&&t.jsx("div",{className:"flex items-center justify-center",children:f??t.jsx(y,{})}),e[2]=f,e[3]=l):l=e[3];let i;e[4]!==p?(i=t.jsx("h3",{className:"text-lg font-medium text-foreground",children:p}),e[4]=p,e[5]=i):i=e[5];let c;e[6]!==j?(c=N("text-sm text-muted-foreground text-center max-w-[300px]",j),e[6]=j,e[7]=c):c=e[7];let a;e[8]!==u||e[9]!==c?(a=t.jsx("div",{className:c,children:u}),e[8]=u,e[9]=c,e[10]=a):a=e[10];let n;e[11]!==i||e[12]!==a?(n=t.jsxs("div",{className:"flex flex-col items-center gap-2",children:[i,a]}),e[11]=i,e[12]=a,e[13]=n):n=e[13];let r;e[14]!==o||e[15]!==g?(r=o&&t.jsx("div",{className:N("flex items-center gap-2",g),children:o}),e[14]=o,e[15]=g,e[16]=r):r=e[16];let m;e[17]!==n||e[18]!==r?(m=t.jsxs("div",{className:"flex flex-col items-center gap-4",children:[n,r]}),e[17]=n,e[18]=r,e[19]=m):m=e[19];let d;return e[20]!==s||e[21]!==l||e[22]!==m?(d=t.jsxs("div",{className:s,children:[l,m]}),e[20]=s,e[21]=l,e[22]=m,e[23]=d):d=e[23],d}export{C as E};
1
+ import{c as v,l as N,j as t}from"./index-C5w7M3ak.js";function y(){const x=v.c(1);let e;return x[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("img",{src:"/empty-state-cards.png",alt:"",width:336,height:320,"aria-hidden":"true"}),x[0]=e):e=x[0],e}function C(x){const e=v.c(24),{image:f,title:p,description:u,actions:o,className:h,descriptionClassName:j,actionsClassName:g}=x;let s;e[0]!==h?(s=N("flex flex-1 flex-col items-center justify-center gap-8 p-4",h),e[0]=h,e[1]=s):s=e[1];let l;e[2]!==f?(l=f!==null&&t.jsx("div",{className:"flex items-center justify-center",children:f??t.jsx(y,{})}),e[2]=f,e[3]=l):l=e[3];let i;e[4]!==p?(i=t.jsx("h3",{className:"text-lg font-medium text-foreground",children:p}),e[4]=p,e[5]=i):i=e[5];let c;e[6]!==j?(c=N("text-sm text-muted-foreground text-center max-w-[300px]",j),e[6]=j,e[7]=c):c=e[7];let a;e[8]!==u||e[9]!==c?(a=t.jsx("div",{className:c,children:u}),e[8]=u,e[9]=c,e[10]=a):a=e[10];let n;e[11]!==i||e[12]!==a?(n=t.jsxs("div",{className:"flex flex-col items-center gap-2",children:[i,a]}),e[11]=i,e[12]=a,e[13]=n):n=e[13];let r;e[14]!==o||e[15]!==g?(r=o&&t.jsx("div",{className:N("flex items-center gap-2",g),children:o}),e[14]=o,e[15]=g,e[16]=r):r=e[16];let m;e[17]!==n||e[18]!==r?(m=t.jsxs("div",{className:"flex flex-col items-center gap-4",children:[n,r]}),e[17]=n,e[18]=r,e[19]=m):m=e[19];let d;return e[20]!==s||e[21]!==l||e[22]!==m?(d=t.jsxs("div",{className:s,children:[l,m]}),e[20]=s,e[21]=l,e[22]=m,e[23]=d):d=e[23],d}export{C as E};
@@ -1 +1 @@
1
- import"./index-I8Uum3Jx.js";import{W as T,e as O}from"./use-mcp-client-Bq9g8m5J.js";function x(e){if(!e)return null;const t=typeof e=="string"?e:e.url;if(!t)return null;const n=t.match(/github\.com[/:]([^/]+)\/([^/]+?)(?:\.git)?\/?$/);return n?{owner:n[1]||"",repo:n[2]||""}:null}function U(e){const t=x(e);if(!t)return null;const n=`https://github.com/${t.owner}.png`;return`https://images.weserv.nl/?url=${encodeURIComponent(n)}&output=webp`}function H(e,t){return e===T.REGISTRY(t)||e===T.COMMUNITY_REGISTRY(t)}function q(e,t){return H(e,t)?"COLLECTION_REGISTRY_APP_LIST":"REGISTRY_ITEM_LIST"}function B(e){if(!e)return[];const t=[];for(const n of e){let a=[];if(Array.isArray(n))a=n;else if(typeof n=="object"&&n!==null){const r=Object.keys(n).find(o=>Array.isArray(n[o]));r&&(a=n[r])}t.push(...a)}return t}const L={"streamable-http":"HTTP",http:"HTTP",sse:"SSE",stdio:"STDIO",websocket:"Websocket"};function Y(e){return e?L[e]??e.toUpperCase():null}function J(e){if(!e)return[];if(Array.isArray(e))return e;if(typeof e=="object"&&e!==null){const t=Object.keys(e).find(n=>Array.isArray(e[n]));if(t)return e[t]}return[]}async function Q(e,t,n,a,r){const o=await O({connectionId:e,orgId:t,orgSlug:n});try{const s=await o.callTool({name:a,arguments:r});return s.structuredContent??s}finally{await o.close().catch(console.error)}}const D="mcp.mesh";let G="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",$=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=G[n[e]&63];return t};function j(e){return`${e}_${$()}`}function K(e){return e._meta?.["mcp.mesh"]?.appName||e.server?.name||null}function V(e){if(!e?.url)return"Unknown";try{return new URL(e.url).hostname}catch{return e.url}}function W(e){const t=e?.identifier||e?.name;return t?t.replace(/^@[^/]+\//,"").replace(/[-_]/g," ").replace(/\b\w/g,a=>a.toUpperCase()):"Unknown"}function X(e,t,n,a){const r=e.server,o=e._meta?.[D],s=new Date().toISOString(),I=o?.friendlyName||o?.friendly_name||e.title||r?.title||r?.name||"Unnamed MCP Server",R=r?.description||null,k=r?.icons?.[0]?.src||U(r?.repository)||null,i=o?.oauth_config,w=i&&typeof i.authorizationEndpoint=="string"&&typeof i.tokenEndpoint=="string"&&typeof i.clientId=="string"&&Array.isArray(i.scopes)&&(i.grantType==="authorization_code"||i.grantType==="client_credentials")?i:null,A=o?.configuration_state,C=o?.configuration_scopes,P=r?.repository?{url:r.repository.url,source:r.repository.source,subfolder:r.repository.subfolder}:null,p=r?.packages??[],d=r?.remotes??[],v=a?.packageIndex??0,S=a?.remoteIndex??0,y=p.length>0&&a?.packageIndex!==void 0,c=y?p[v]:null,l=y?null:d[S];let u,f,h=null;if(c){const _=c.identifier||c.name;u="STDIO",f="";const m={};if(c.environmentVariables)for(const b of c.environmentVariables)b.name&&(m[b.name]="");h={command:"npx",args:_?["-y",_]:[],...Object.keys(m).length>0&&{envVars:m}}}else l?(u=Y(l.type)||"HTTP",f=l.url||""):(u="HTTP",f="");const N=d.length>1,M=p.length>1;let g="";c&&M?g=` (${W(c)})`:l&&N&&(g=` (${V(l)})`);const E=I+g;return{id:j("conn"),title:E,description:R,icon:k,app_name:K(e),app_id:o?.id||e.id||null,connection_type:u,connection_url:f,connection_token:null,connection_headers:h,oauth_config:w,configuration_state:A??null,configuration_scopes:C??null,metadata:{source:"store",registry_item_id:e.id,verified:o?.verified??!1,scopeName:o?.scopeName??null,toolsCount:o?.tools?.length??0,publishedAt:o?.publishedAt??null,repository:P},created_at:s,updated_at:s,created_by:n,organization_id:t,tools:null,bindings:null,status:"inactive"}}export{j as a,K as b,Q as c,J as d,X as e,B as f,U as g,q as i};
1
+ import"./index-C5w7M3ak.js";import{W as T,e as O}from"./use-mcp-client-Ci_r6Z9X.js";function x(e){if(!e)return null;const t=typeof e=="string"?e:e.url;if(!t)return null;const n=t.match(/github\.com[/:]([^/]+)\/([^/]+?)(?:\.git)?\/?$/);return n?{owner:n[1]||"",repo:n[2]||""}:null}function U(e){const t=x(e);if(!t)return null;const n=`https://github.com/${t.owner}.png`;return`https://images.weserv.nl/?url=${encodeURIComponent(n)}&output=webp`}function H(e,t){return e===T.REGISTRY(t)||e===T.COMMUNITY_REGISTRY(t)}function q(e,t){return H(e,t)?"COLLECTION_REGISTRY_APP_LIST":"REGISTRY_ITEM_LIST"}function B(e){if(!e)return[];const t=[];for(const n of e){let a=[];if(Array.isArray(n))a=n;else if(typeof n=="object"&&n!==null){const r=Object.keys(n).find(o=>Array.isArray(n[o]));r&&(a=n[r])}t.push(...a)}return t}const L={"streamable-http":"HTTP",http:"HTTP",sse:"SSE",stdio:"STDIO",websocket:"Websocket"};function Y(e){return e?L[e]??e.toUpperCase():null}function J(e){if(!e)return[];if(Array.isArray(e))return e;if(typeof e=="object"&&e!==null){const t=Object.keys(e).find(n=>Array.isArray(e[n]));if(t)return e[t]}return[]}async function Q(e,t,n,a,r){const o=await O({connectionId:e,orgId:t,orgSlug:n});try{const s=await o.callTool({name:a,arguments:r});return s.structuredContent??s}finally{await o.close().catch(console.error)}}const D="mcp.mesh";let G="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",$=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=G[n[e]&63];return t};function j(e){return`${e}_${$()}`}function K(e){return e._meta?.["mcp.mesh"]?.appName||e.server?.name||null}function V(e){if(!e?.url)return"Unknown";try{return new URL(e.url).hostname}catch{return e.url}}function W(e){const t=e?.identifier||e?.name;return t?t.replace(/^@[^/]+\//,"").replace(/[-_]/g," ").replace(/\b\w/g,a=>a.toUpperCase()):"Unknown"}function X(e,t,n,a){const r=e.server,o=e._meta?.[D],s=new Date().toISOString(),I=o?.friendlyName||o?.friendly_name||e.title||r?.title||r?.name||"Unnamed MCP Server",R=r?.description||null,k=r?.icons?.[0]?.src||U(r?.repository)||null,i=o?.oauth_config,w=i&&typeof i.authorizationEndpoint=="string"&&typeof i.tokenEndpoint=="string"&&typeof i.clientId=="string"&&Array.isArray(i.scopes)&&(i.grantType==="authorization_code"||i.grantType==="client_credentials")?i:null,A=o?.configuration_state,C=o?.configuration_scopes,P=r?.repository?{url:r.repository.url,source:r.repository.source,subfolder:r.repository.subfolder}:null,p=r?.packages??[],d=r?.remotes??[],v=a?.packageIndex??0,S=a?.remoteIndex??0,y=p.length>0&&a?.packageIndex!==void 0,c=y?p[v]:null,l=y?null:d[S];let u,f,h=null;if(c){const _=c.identifier||c.name;u="STDIO",f="";const m={};if(c.environmentVariables)for(const b of c.environmentVariables)b.name&&(m[b.name]="");h={command:"npx",args:_?["-y",_]:[],...Object.keys(m).length>0&&{envVars:m}}}else l?(u=Y(l.type)||"HTTP",f=l.url||""):(u="HTTP",f="");const N=d.length>1,M=p.length>1;let g="";c&&M?g=` (${W(c)})`:l&&N&&(g=` (${V(l)})`);const E=I+g;return{id:j("conn"),title:E,description:R,icon:k,app_name:K(e),app_id:o?.id||e.id||null,connection_type:u,connection_url:f,connection_token:null,connection_headers:h,oauth_config:w,configuration_state:A??null,configuration_scopes:C??null,metadata:{source:"store",registry_item_id:e.id,verified:o?.verified??!1,scopeName:o?.scopeName??null,toolsCount:o?.tools?.length??0,publishedAt:o?.publishedAt??null,repository:P},created_at:s,updated_at:s,created_by:n,organization_id:t,tools:null,bindings:null,status:"inactive"}}export{j as a,K as b,Q as c,J as d,X as e,B as f,U as g,q as i};
@@ -1,2 +1,2 @@
1
- import{c as Ke,r as l,j as i,i as re,B as fe,l as Ve,m as ut,t as $,K as Te}from"./index-I8Uum3Jx.js";import{F as mt,l as pt}from"./index-DPI_0XE-.js";import{i as ht,au as xt,av as gt,aw as ae,ax as yt,U as $e}from"./agent-icon-B2N3zGQH.js";import{a as wt}from"./Tool01-DvTGD1Yt.js";import{s as jt}from"./XClose-BbuWQhNb.js";import{S as bt}from"./scroll-area-DnauLcxE.js";import{T as Oe,a as Re,b as ze}from"./tooltip-Cs84Kx7a.js";import{f as vt,a as Ct,b as Nt,c as St,d as Dt,e as kt,A as Ft,g as Lt}from"./alert-dialog-DvWgcmQI.js";import{u as Et}from"./chat-context-Bspy4m-d.js";import{b as Pt}from"./shell-layout-BgovnITR.js";import{al as le,am as Ae,an as Tt}from"./index-CiVkOVzW.js";import{d as $t,e as Ot,c as Rt,D as zt,b as At,a as Wt}from"./dialog-CxQBoX40.js";import{I as We}from"./input-CutcETvq.js";import{b as It,C as _,a as Ie,c as Mt,d as Kt}from"./context-menu-BRDnNrnF.js";import{t as Vt}from"./ChevronDown-URo4LveF.js";import{i as Bt}from"./ChevronRight-oz8o6WPV.js";import{b as Gt}from"./ZoomOut-DxqRFWA_.js";import{E as qt,z as Me,A as he,B as Qt,C as Ut,D as Jt,G as M,I as ce,g as xe,J as ge,K as Ht,M as Xt,N as ye,O as de,P as we,Q as Yt,U as Zt}from"./preview-dialog-D1-LAakL.js";import"./AlertCircle-VcwplCRi.js";import"./SwitchHorizontal01-F_1MjTR3.js";import"./Settings02-DbH9OAzT.js";import"./XCircle-PlbEvjyp.js";import"./ArrowUpRight-CAv7CUnJ.js";import"./ZapSquare-CvkoTQDM.js";import"./Users03-CL71IAQ8.js";import"./CheckCircle-V30FMM2D.js";import"./ChevronUp-HJUE3-BD.js";import"./ChevronLeft-aMkPes9N.js";import"./DotsVertical-QF46dzdi.js";import"./Stars02-PPXsboxW.js";import"./Eye-BSiFxHQB.js";import"./Globe01-wGomueqV.js";import"./FilterLines-CEzORaPw.js";import"./Star01-BwAv907s.js";import"./Globe04-CsKOsQ4z.js";import"./HardDrive-BuI4Q48l.js";import"./Key01-r6MDYdDw.js";import"./LayoutLeft-BFxGsVdk.js";import"./LinkExternal01-BWnRnxGs.js";import"./Monitor01-SEZLDRFN.js";import"./Sun-Dw86eVev.js";import"./Palette-CEjENuG4.js";import"./Play-BDoh8EAp.js";import"./Plus-Bw9lc6SR.js";import"./SearchMd-BMfw7gZ4.js";import"./Shield01-C1R4fpvK.js";import"./Stars01-D1icdaCh.js";import"./Trash01-d58N8w5a.js";import"./Upload01-C_hHbDSF.js";import"./User01-BDtU1dk1.js";import"./Users01-PX3eYoC8.js";import"./X-D7X7Z50V.js";import"./Zap-BQKeuD4l.js";import"./use-clock-tick-DNfOIVGO.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-3_Rhxcs5.js";import"./file-type-icon-Cd8oKt-R.js";import"./use-mobile-C0mpADhR.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-pQkRXbdZ.js";import"./use-mcp-client-Bq9g8m5J.js";import"./auth-DZDiXt1m.js";import"./hooks-BAG9TZjZ.js";import"./decopilot-sse-pool-TIer_srZ.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./studio-tools-bjPFQfXc.js";import"./sheet-CaSXRGPU.js";import"./integration-icon-D3W1euXX.js";import"./use-virtual-mcp-C5aoCVVQ.js";import"./use-collections-KLUYE1x1.js";import"./use-navigate-to-agent-CRQ9sIAj.js";import"./use-connection-BcZ8SPdu.js";import"./use-mcp-prompts-B5FIxmOZ.js";import"./form-CpFt_4sy.js";import"./label-DtGUWURu.js";import"./select-CeO9pIG_.js";import"./use-ai-providers-BgadC07_.js";import"./use-organization-settings-oh1iUWuA.js";import"./avatar-Dv3IrttI.js";import"./required-auth-layout-BFGUeccA.js";import"./use-org-sso-HWNvOeDC.js";import"./index-C_Ih0jtP.js";import"./drawer-CoRZTii0.js";import"./collection-search-BPoBI_I5.js";import"./tabs-C0RM8s7M.js";import"./toggle-group-qpErv2AC.js";import"./sortable.esm-BQBGtGRV.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-BG_Nwlzj.js";import"./use-registry-connections-d6Abj3O4.js";import"./useInfiniteQuery-RfoATJAI.js";import"./use-infinite-scroll-BJoUj4tJ.js";import"./extract-connection-data-BaXkJtVr.js";import"./card-Chq65iX4.js";import"./collection-tabs-FH3-RtUV.js";import"./badge-toKsUzoB.js";import"./textarea-CvR7iHW3.js";import"./connection-form-helpers-DLOiycDJ.js";import"./authenticate-and-persist-oauth-CGYbK6H8.js";import"./mcp-oauth-CSZ5TVrK.js";import"./useSuspenseInfiniteQuery-DBiSYggu.js";import"./connect-desktop-dialog-G37q3fkg.js";import"./decopilot-DfFzELja.js";import"./checkbox-KUrNOBQk.js";import"./skeleton-1BUBAFib.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-B3kXnqLg.js";import"./popover-C8AJAJSa.js";import"./command-DMsCjDdA.js";import"./index-BLMNER8l.js";import"./dropdown-menu-5CWPgj7f.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-MBoAiBsc.js";import"./empty-state-B-ezQrZT.js";import"./toolbar-CB27CeHy.js";import"./use-mcp-tools-LraQQ1bu.js";import"./use-capability-BUm2GwYJ.js";import"./shell-route-loading-w2qYEgt-.js";import"./index-JhgoGL0k.js";import"./switch-B9PlH85E.js";import"./use-debounced-autosave-CSkDAooO.js";import"./index-BU8Nad-n.js";import"./sidebar-BNKGZwsk.js";import"./search-input-BVF4N9EW.js";import"./github-repo-picker-CvyWRbaM.js";import"./use-secrets-CkVHtz_G.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./view-mode-toggle-DTMt6lCZ.js";import"./automation-runs-DyKvgj21.js";import"./table-Bh38Wtyx.js";import"./use-members-D283HZiN.js";import"./use-org-auth-client-WATciLg3.js";import"./task-status-sw3Y4pwg.js";import"./use-automations-P1MHR3DS.js";import"./use-file-configs-YBpYKsXP.js";import"./monaco-editor-x5JEAvo5.js";import"./select-model-mprfSN1i.js";import"./automation-list-row-CAUoBpVq.js";const _t={"new-file":{title:"New File",description:"Enter a name for the new file.",submit:"Create",placeholder:"filename.ts"},"new-folder":{title:"New Folder",description:"Enter a name for the new folder.",submit:"Create",placeholder:"folder-name"},rename:{title:"Rename",description:"Enter a new name for this item.",submit:"Rename",placeholder:"new-name"}};function en(y){const e=Ke.c(51),{open:c,mode:K,initialName:X,parentLabel:Q,isPending:A,onSubmit:V,onOpenChange:P}=y,W=X===void 0?"":X,o=A===void 0?!1:A,[p,O]=l.useState(W),[I,B]=l.useState(c),f=_t[K];c!==I&&(B(c),c&&O(W));let F;e[0]!==o||e[1]!==P?(F=E=>{!E&&!o&&P(!1)},e[0]=o,e[1]=P,e[2]=F):F=e[2];const U=F;let G;e[3]!==o||e[4]!==p||e[5]!==V?(G=async E=>{E.preventDefault();const z=p.trim();!z||o||await V(z)},e[3]=o,e[4]=p,e[5]=V,e[6]=G):G=e[6];const q=G;let L;e[7]!==f.title?(L=i.jsx($t,{children:f.title}),e[7]=f.title,e[8]=L):L=e[8];let N;e[9]!==f.description?(N=i.jsx(Ot,{children:f.description}),e[9]=f.description,e[10]=N):N=e[10];let R;e[11]!==L||e[12]!==N?(R=i.jsxs(Rt,{children:[L,N]}),e[11]=L,e[12]=N,e[13]=R):R=e[13];let S;e[14]!==Q?(S=Q&&i.jsxs("div",{className:"space-y-1.5",children:[i.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Location"}),i.jsx(We,{value:Q,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[14]=Q,e[15]=S):S=e[15];let D;e[16]===Symbol.for("react.memo_cache_sentinel")?(D=i.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[16]=D):D=e[16];let j;e[17]===Symbol.for("react.memo_cache_sentinel")?(j=E=>O(E.target.value),e[17]=j):j=e[17];let b;e[18]!==f.placeholder||e[19]!==o||e[20]!==p?(b=i.jsxs("div",{className:"space-y-1.5",children:[D,i.jsx(We,{id:"file-explorer-name",value:p,onChange:j,placeholder:f.placeholder,autoFocus:!0,disabled:o})]}),e[18]=f.placeholder,e[19]=o,e[20]=p,e[21]=b):b=e[21];let h;e[22]!==b||e[23]!==S?(h=i.jsxs("div",{className:"space-y-4 py-4",children:[S,b]}),e[22]=b,e[23]=S,e[24]=h):h=e[24];let x;e[25]!==P?(x=()=>P(!1),e[25]=P,e[26]=x):x=e[26];let v;e[27]!==o||e[28]!==x?(v=i.jsx(fe,{type:"button",variant:"outline",onClick:x,disabled:o,children:"Cancel"}),e[27]=o,e[28]=x,e[29]=v):v=e[29];let C;e[30]!==o||e[31]!==p?(C=!p.trim()||o,e[30]=o,e[31]=p,e[32]=C):C=e[32];let u;e[33]!==f.submit||e[34]!==o?(u=o?i.jsxs(i.Fragment,{children:[i.jsx(re,{size:14,className:"animate-spin"}),"Saving…"]}):f.submit,e[33]=f.submit,e[34]=o,e[35]=u):u=e[35];let k;e[36]!==C||e[37]!==u?(k=i.jsx(fe,{type:"submit",disabled:C,children:u}),e[36]=C,e[37]=u,e[38]=k):k=e[38];let m;e[39]!==v||e[40]!==k?(m=i.jsxs(zt,{children:[v,k]}),e[39]=v,e[40]=k,e[41]=m):m=e[41];let g;e[42]!==q||e[43]!==h||e[44]!==m||e[45]!==R?(g=i.jsx(At,{className:"sm:max-w-md",children:i.jsxs("form",{onSubmit:q,children:[R,h,m]})}),e[42]=q,e[43]=h,e[44]=m,e[45]=R,e[46]=g):g=e[46];let T;return e[47]!==U||e[48]!==c||e[49]!==g?(T=i.jsx(Wt,{open:c,onOpenChange:U,children:g}),e[47]=U,e[48]=c,e[49]=g,e[50]=T):T=e[50],T}const tn="#d9a441";function nn(y){const e=Ke.c(45),{node:c,depth:K,isExpanded:X,isSelected:Q,isLoading:A,fileVisual:V,onOpen:P,onSelect:W,onNewFile:o,onNewFolder:p,onCopyPath:O,onCopyRelativePath:I,onRename:B,onDelete:f}=y,F=A===void 0?!1:A,U=c.kind==="directory",{Icon:G,color:q}=V,L=Q&&"bg-accent";let N;e[0]!==L?(N=Ve("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",L),e[0]=L,e[1]=N):N=e[1];const R=`${K*14+8}px`;let S;e[2]!==R?(S={paddingLeft:R},e[2]=R,e[3]=S):S=e[3];let D;e[4]!==P||e[5]!==W?(D=()=>{W(),P()},e[4]=P,e[5]=W,e[6]=D):D=e[6];let j;e[7]!==G||e[8]!==q||e[9]!==U||e[10]!==X||e[11]!==F?(j=U?i.jsxs(i.Fragment,{children:[F?i.jsx(re,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):X?i.jsx(Vt,{size:14,className:"shrink-0 text-muted-foreground"}):i.jsx(Bt,{size:14,className:"shrink-0 text-muted-foreground"}),i.jsx(Gt,{size:16,className:"shrink-0",style:{color:tn}})]}):i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"w-3.5 shrink-0"}),i.jsx(G,{size:16,className:"shrink-0",style:{color:q}})]}),e[7]=G,e[8]=q,e[9]=U,e[10]=X,e[11]=F,e[12]=j):j=e[12];let b;e[13]!==c.name?(b=i.jsx("span",{className:"truncate",children:c.name}),e[13]=c.name,e[14]=b):b=e[14];let h;e[15]!==N||e[16]!==S||e[17]!==D||e[18]!==j||e[19]!==b?(h=i.jsx(It,{asChild:!0,children:i.jsxs("button",{type:"button",className:N,style:S,onClick:D,children:[j,b]})}),e[15]=N,e[16]=S,e[17]=D,e[18]=j,e[19]=b,e[20]=h):h=e[20];let x;e[21]!==o?(x=i.jsx(_,{onSelect:o,children:"New File"}),e[21]=o,e[22]=x):x=e[22];let v;e[23]!==p?(v=i.jsx(_,{onSelect:p,children:"New Folder"}),e[23]=p,e[24]=v):v=e[24];let C;e[25]===Symbol.for("react.memo_cache_sentinel")?(C=i.jsx(Ie,{}),e[25]=C):C=e[25];let u;e[26]!==O?(u=i.jsx(_,{onSelect:O,children:"Copy Path"}),e[26]=O,e[27]=u):u=e[27];let k;e[28]!==I?(k=i.jsx(_,{onSelect:I,children:"Copy Relative Path"}),e[28]=I,e[29]=k):k=e[29];let m;e[30]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(Ie,{}),e[30]=m):m=e[30];let g;e[31]!==B?(g=i.jsx(_,{onSelect:B,children:"Rename"}),e[31]=B,e[32]=g):g=e[32];let T;e[33]!==f?(T=i.jsx(_,{variant:"destructive",onSelect:f,children:"Delete"}),e[33]=f,e[34]=T):T=e[34];let E;e[35]!==x||e[36]!==v||e[37]!==u||e[38]!==k||e[39]!==g||e[40]!==T?(E=i.jsxs(Mt,{className:"w-52",children:[x,v,C,u,k,m,g,T]}),e[35]=x,e[36]=v,e[37]=u,e[38]=k,e[39]=g,e[40]=T,e[41]=E):E=e[41];let z;return e[42]!==E||e[43]!==h?(z=i.jsxs(Kt,{children:[h,E]}),e[42]=E,e[43]=h,e[44]=z):z=e[44],z}pt.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});function je(y,e,c,K){return`/api/${y}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(c)}/${K}`}function rn(y){const e=M(y);return!e||e.includes("..")||e.includes("\\")?!1:e.startsWith(".deco/blocks/")||!e.startsWith("/")&&!e.includes("://")}const sn="#94a3b8";function on(y){const e=y.toLowerCase();return e.endsWith(".tsx")||e.endsWith(".ts")?{Icon:ae,color:"#3b82f6"}:e.endsWith(".jsx")||e.endsWith(".js")||e.endsWith(".mjs")||e.endsWith(".cjs")?{Icon:ae,color:"#d9a441"}:e.endsWith(".json")?{Icon:yt,color:"#cb9b3f"}:e.endsWith(".css")||e.endsWith(".scss")?{Icon:ae,color:"#06b6d4"}:e.endsWith(".html")||e.endsWith(".xml")?{Icon:ae,color:"#f97316"}:/\.(png|jpe?g|gif|webp|avif|ico|svg)$/.test(e)?{Icon:wt,color:"#a855f7"}:e.endsWith(".md")||e.endsWith(".mdx")?{Icon:$e,color:"#64748b"}:{Icon:$e,color:sn}}function Ii({orgSlug:y,virtualMcpId:e,branch:c,openPath:K}){const[X,Q]=l.useState({files:[],directories:[],truncated:!1}),{files:A,directories:V}=X,[P,W]=l.useState(new Set),[o,p]=l.useState(null),[O,I]=l.useState(null),[B,f]=l.useState([]),[F,U]=l.useState(""),[G,q]=l.useState(!1),[L,N]=l.useState(!1),[,R]=l.useState(new Set),[S,D]=l.useState(new Set),j=l.useRef(0),b=l.useRef(null),h=l.useRef(new Set),x=l.useRef(new Map);function v(t){R(n=>{const r=typeof t=="function"?t(n):t;return h.current=r,r})}const[C,u]=l.useState(new Map),k=l.useRef(null),[m,g]=l.useState(null),{sendMessage:T}=Et(),{setChatOpen:E}=Pt(),z=ut(),[w,J]=l.useState(null),[H,ue]=l.useState(null),[ee,ie]=l.useState(!1);async function te(t,n){const r=await fetch(je(y,e,c,t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!r.ok){const s=await r.json().catch(()=>({}));throw new Error(s.error??`Request failed (${r.status})`)}return r.json()}async function se(){z.invalidateQueries({queryKey:Ae(y,e,c)})}function be(t,n){navigator.clipboard.writeText(n).then(()=>$.success(`${t} copied`),()=>$.error(`Failed to copy ${t.toLowerCase()}`))}function Be(t){const n=Yt(t);if(!n)return;const r=`${y}/${e}/${c}`;z.setQueryData(Te.decofile(r),s=>{if(!s)return s;const{[n]:a,...d}=s;return d}),z.invalidateQueries({queryKey:Te.liveMeta(r)})}function Ge(t){const n=t.kind==="file"?[t.path]:A.filter(r=>r.startsWith(".deco/blocks/")).map(r=>ce(r)).filter(r=>r===t.path||r.startsWith(`${t.path}/`));for(const r of n)Be(r)}function qe(t){const n=ce(t);return B.filter(r=>{if(r!==n&&!r.startsWith(`${n}/`))return!1;const s=C.get(r);return!!(s?.loaded&&s.editorValue!==s.savedContent)})}function ve(t){f(n=>n.map(r=>t(r)).filter(r=>r!==null)),p(n=>n&&t(n)),u(n=>{const r=new Map;for(const[s,a]of n){const d=t(s);d&&r.set(d,a)}return r}),I(n=>{if(!n)return n;const r=t(n.path);return r?r===n.path?n:{...n,path:r,name:r.split("/").pop()??r}:null})}function Qe(t){const n=ce(t);I(r=>r&&(r.path===n||r.path.startsWith(`${n}/`)?null:r)),ve(r=>r===n||r.startsWith(`${n}/`)?null:r)}async function Ue(t){if(!w)return;const n=de(w.parentDir,t);if(we(n,A,V))throw new Error(`"${t}" already exists`);await te("write",{path:M(n),content:""}),await ne(),await se(),J(null),me(n)}async function Je(t){if(!w)return;const n=de(w.parentDir,t);if(we(n,A,V))throw new Error(`"${t}" already exists`);const r=M(n);await te("mkdir",{path:r}),Q(s=>({...s,directories:s.directories.includes(r)?s.directories:[...s.directories,r]})),await ne(),await se(),J(null),W(s=>{const a=new Set(s);for(const d of he(n))a.add(d);return a.add(n),a}),I({name:t,path:n,kind:"directory",children:[]})}async function He(t){if(!w)return;const n=w.node.path,r=ye(n),s=de(r,t);if(s===n){J(null);return}if(we(s,A,V))throw new Error(`"${t}" already exists`);await te("rename",{from:M(n),to:M(s)}),ve(a=>a===n?s:a.startsWith(`${n}/`)?de(s,a.slice(n.length+1)):a),await ne(),await se(),J(null)}async function Xe(t){ie(!0);try{await te("unlink",{path:M(t.path),recursive:t.kind==="directory"}),Ge(t),Qe(t.path),await ne(),await se(),ue(null),$.success(`Deleted "${t.name}"`)}catch(n){$.error(n instanceof Error?n.message:"Delete failed")}finally{ie(!1)}}async function Ye(t){const n=Xt(t);if(n){$.error(n);return}ie(!0);try{w?.mode==="new-file"?(await Ue(t),$.success(`Created "${t}"`)):w?.mode==="new-folder"?(await Je(t),$.success(`Created folder "${t}"`)):w?.mode==="rename"&&(await He(t),$.success(`Renamed to "${t}"`))}catch(r){$.error(r instanceof Error?r.message:"Operation failed")}finally{ie(!1)}}const Ce=l.useRef(!1);Ce.current||(Ce.current=!0,b.current=ne());const[Ze,_e]=l.useState(null);if(K&&K!==Ze){_e(K);const t=K;queueMicrotask(()=>{rn(t)&&me(t).catch(n=>{$.error(n instanceof Error?n.message:"Failed to open file")})})}async function Ne(t){const n=await te("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function Se(t,n,r){if(r!==j.current)return!1;let s=!1;return Q(a=>{const d=n?Zt(a.files,a.directories,t,a.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return s=!!d.truncated,{files:d.files,directories:d.directories,truncated:s}}),s&&$.warning("File list truncated — some files may be hidden"),s}async function et(t){const n=x.current.get(t);if(n)return n;const r=j.current,s=(async()=>{const a=await Ne({pattern:"**/*",path:M(t),limit:Me}),d=Se(a,!0,r);return!d&&r===j.current&&v(Y=>{const oe=new Set(Y);return oe.add(t),oe}),d})();x.current.set(t,s);try{return await s}finally{x.current.delete(t)}}async function De(t){if(!ge(t,h.current))return!1;D(n=>new Set(n).add(t));try{return await et(t)}finally{D(n=>{const r=new Set(n);return r.delete(t),r})}}async function tt(t){const n=new Set(h.current);for(const r of he(t)){if(!ge(r,n))continue;if(await De(r))throw new Error("Folder listing truncated — expand again to load more");n.add(r)}}async function ne(){const t=++j.current;x.current.clear(),q(!0),v(new Set),W(new Set),D(new Set);try{const n=await Ne({pattern:"**/*",limit:Me,maxDepth:qt});Se(n,!1,t),N(!0)}catch{L&&$.error("Failed to refresh file tree")}finally{q(!1)}}async function ke(t){if(!C.get(t)?.loaded){u(r=>{const s=new Map(r);return s.set(t,{savedContent:"",editorValue:"",loaded:!1}),s});try{const r=await fetch(je(y,e,c,"read"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:M(t),full:!0})});if(!r.ok)return;const s=await r.json(),a=Ht(s.content??"");u(d=>{const Y=new Map(d);return Y.set(t,{savedContent:a,editorValue:a,loaded:!0}),Y})}catch{}}}async function nt(t,n){try{const r=await fetch(je(y,e,c,"write"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:M(t),content:n})});if(!r.ok){le("file save failed",{path:t,status:r.status});return}le("file saved via sandbox /write",{path:t}),z.invalidateQueries({queryKey:Ae(y,e,c)});try{const s=await Tt(y,e,c);le("git status after save",s)}catch(s){le("git status after save failed",{path:t,error:s instanceof Error?s.message:String(s)})}u(s=>{const a=new Map(s),d=a.get(t);return d&&a.set(t,{...d,savedContent:n}),a})}catch{}}function rt(t){p(t),I({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),g(null),B.includes(t)||f(n=>[...n,t]),ke(t)}function it(t){f(n=>{const r=n.filter(s=>s!==t);return o===t&&p(r[r.length-1]??null),r}),u(n=>{const r=new Map(n);return r.delete(t),r})}function Fe(t){W(n=>{const r=new Set(n);return r.has(t)?r.delete(t):r.add(t),r})}async function st(t){if(ge(t,h.current))try{if(await De(t))return}catch(n){$.error(n instanceof Error?n.message:"Failed to load folder");return}Fe(t)}async function ot(t,n){if(n){Fe(t);return}await st(t)}async function me(t){await b.current,await tt(t);const n=he(t);W(r=>{const s=new Set(r);for(const a of n)s.add(a);return s}),rt(t)}function at(){return O?.kind==="directory"?O.path:O?.kind==="file"?ye(O.path):o?ye(o):"/"}function Le(t){const n=at();J({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const lt=Qt(A,V),Ee=Ut(lt,P),Pe=F?Ee.filter(t=>t.node.name.toLowerCase().includes(F.toLowerCase())):Ee,Z=o?C.get(o):null,ct=Z?.loaded&&Z.editorValue!==Z.savedContent,pe=H?qe(H.path):[],dt=(t,n)=>{k.current=t,t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!o)return;const r=t.getValue();await nt(o,r)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const r=t.getSelection(),s=t.getModel();if(!r||!s||!o)return;const a=s.getValueInRange(r);g({filePath:o,lineStart:r.startLineNumber,lineEnd:r.endLineNumber,selectedCode:a})})};function ft(t){if(!m)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${m.filePath}\``,`**Lines:** ${m.lineStart}–${m.lineEnd}`];if(m.selectedCode){const r=xe(m.filePath),s=m.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+r,s,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),E(!0),T({parts:[{type:"text",text:n.join(`
1
+ import{c as Ke,r as l,j as i,i as re,B as fe,l as Ve,m as ut,t as $,K as Te}from"./index-C5w7M3ak.js";import{F as mt,l as pt}from"./index-BSpZjkyI.js";import{i as ht,au as xt,av as gt,aw as ae,ax as yt,U as $e}from"./agent-icon-Tlh3oNKM.js";import{a as wt}from"./Tool01-Dt-TbXDn.js";import{s as jt}from"./XClose-DlK2hm1P.js";import{S as bt}from"./scroll-area-BFd5bzOG.js";import{T as Oe,a as Re,b as ze}from"./tooltip-CgNWIJOM.js";import{f as vt,a as Ct,b as Nt,c as St,d as Dt,e as kt,A as Ft,g as Lt}from"./alert-dialog-DESqZhA2.js";import{u as Et}from"./chat-context-C-somJSY.js";import{b as Pt}from"./shell-layout-Cz9jaH1b.js";import{al as le,am as Ae,an as Tt}from"./index-53LWl5CV.js";import{d as $t,e as Ot,c as Rt,D as zt,b as At,a as Wt}from"./dialog-BYnY80tb.js";import{I as We}from"./input-agFYfi3v.js";import{b as It,C as _,a as Ie,c as Mt,d as Kt}from"./context-menu-BMjlqCBa.js";import{t as Vt}from"./ChevronDown-DXzUoD2e.js";import{i as Bt}from"./ChevronRight-j760Iee-.js";import{b as Gt}from"./ZoomOut-VAm9p2Hl.js";import{E as qt,z as Me,A as he,B as Qt,C as Ut,D as Jt,G as M,I as ce,g as xe,J as ge,K as Ht,M as Xt,N as ye,O as de,P as we,Q as Yt,U as Zt}from"./preview-dialog-DwVGd6qW.js";import"./AlertCircle-D8nl7USt.js";import"./SwitchHorizontal01-CB8Z7BL9.js";import"./Settings02-D-O2SNJf.js";import"./XCircle-DAqTWvWp.js";import"./ArrowUpRight-DgG9Xs3P.js";import"./ZapSquare-DD_XuIyF.js";import"./Users03-DwMxpPU3.js";import"./CheckCircle-yOjX9PZe.js";import"./ChevronUp-CADhYHt4.js";import"./ChevronLeft-DopUTXew.js";import"./DotsVertical-AD-a2Knc.js";import"./Stars02-BUidkUMX.js";import"./Eye-CQQama2s.js";import"./Globe01-CaIgPTxT.js";import"./FilterLines-CehUrsTR.js";import"./Star01-BNUohd1g.js";import"./Globe04-CuT114AV.js";import"./HardDrive-lZvAMErY.js";import"./Key01-BAEB0MKB.js";import"./LayoutLeft-Fadct960.js";import"./LinkExternal01-Dh2g8Xye.js";import"./Monitor01-_MTiHAuD.js";import"./Sun-CrWUbEJD.js";import"./Palette-hlsbFMfV.js";import"./Play-CfbRRa8r.js";import"./Plus-CdiQoMoJ.js";import"./SearchMd-D1HSgOeu.js";import"./Shield01-DOrMIO9W.js";import"./Stars01-DMt3zew5.js";import"./Trash01-BVvGX_KK.js";import"./Upload01-Prj9a2xY.js";import"./User01-CaU7xtcd.js";import"./Users01-BRnzISUs.js";import"./X-C-TqNtc2.js";import"./Zap-5n0DTezT.js";import"./use-clock-tick-CmvqvAhs.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-Cz-l8dwG.js";import"./file-type-icon-MmuXAAgi.js";import"./use-mobile-COxfHS-K.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-CXz6VYrK.js";import"./use-mcp-client-Ci_r6Z9X.js";import"./auth-BR3aJLVt.js";import"./hooks-B4h0KjiG.js";import"./decopilot-sse-pool-9lyDYS1g.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./studio-tools-BJLBgOee.js";import"./sheet-CG7AqhVD.js";import"./integration-icon-CE7Y49fT.js";import"./use-virtual-mcp-C76Ypnz5.js";import"./use-collections-BYKClwvP.js";import"./use-navigate-to-agent-Cp82Pt97.js";import"./use-connection-BnTFSsXk.js";import"./use-mcp-prompts-Brfbccg_.js";import"./form-DyV_U4Fx.js";import"./label-A5aaknkU.js";import"./select--NMtIJXa.js";import"./use-ai-providers-Dw8zktiy.js";import"./use-organization-settings-D1CXb2Mk.js";import"./avatar-DKl_SvPY.js";import"./required-auth-layout-CluuNdrt.js";import"./use-org-sso-BrX2nnoi.js";import"./index-T5P3sRB3.js";import"./drawer-DSWLLvbj.js";import"./collection-search-9Z9J-flr.js";import"./tabs-DGpCIiez.js";import"./toggle-group-DRhh44eR.js";import"./sortable.esm-YhwgmY_a.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-Cm-r3F3U.js";import"./use-registry-connections-DxwnrcKA.js";import"./useInfiniteQuery-Dd70hn1g.js";import"./use-infinite-scroll-10P3vgT3.js";import"./extract-connection-data-sR3PfR1q.js";import"./card-CCz6n2PT.js";import"./collection-tabs-BkVwtVd6.js";import"./badge-CPOFnH5f.js";import"./textarea-Dgff3Gg2.js";import"./connection-form-helpers-CzldBL3R.js";import"./authenticate-and-persist-oauth-DlE0FF2e.js";import"./mcp-oauth-BsM22i8Z.js";import"./useSuspenseInfiniteQuery-8qs6htsj.js";import"./connect-desktop-dialog-DhsRqyJo.js";import"./decopilot-CzHxKRA2.js";import"./checkbox-DXMAgfVg.js";import"./skeleton-sBC4lQNI.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-Cv3fX46A.js";import"./popover-DXCLs7Mh.js";import"./command-CD_UfdIZ.js";import"./index--rRbpAQ9.js";import"./dropdown-menu-B_-Um9OQ.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-SD_W2P9L.js";import"./empty-state-Di1r-g_a.js";import"./toolbar-QoRJzy-G.js";import"./use-mcp-tools-C3Vng-X-.js";import"./use-capability-DVHDSFWa.js";import"./shell-route-loading-DX7cr59C.js";import"./index-Dsuwnck-.js";import"./switch-V6piMM6A.js";import"./use-debounced-autosave-mT469Qcu.js";import"./index-DJPcb21Y.js";import"./sidebar-C8Zfra_F.js";import"./search-input-DBcneL-Z.js";import"./github-repo-picker-B4YgsSnm.js";import"./use-secrets-B-XWgN3K.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./view-mode-toggle-XGoB5RsL.js";import"./automation-runs-irK0CDv6.js";import"./table-CO4yX7RA.js";import"./use-members-B81Cwsvd.js";import"./use-org-auth-client-C5HFWhiz.js";import"./task-status-CyBXqR4E.js";import"./use-automations-1dr86I_A.js";import"./use-file-configs-BY2cpVcw.js";import"./monaco-editor-CK4_aHmD.js";import"./select-model-B8wcKRbd.js";import"./automation-list-row-D2uPOFxN.js";const _t={"new-file":{title:"New File",description:"Enter a name for the new file.",submit:"Create",placeholder:"filename.ts"},"new-folder":{title:"New Folder",description:"Enter a name for the new folder.",submit:"Create",placeholder:"folder-name"},rename:{title:"Rename",description:"Enter a new name for this item.",submit:"Rename",placeholder:"new-name"}};function en(y){const e=Ke.c(51),{open:c,mode:K,initialName:X,parentLabel:Q,isPending:A,onSubmit:V,onOpenChange:P}=y,W=X===void 0?"":X,o=A===void 0?!1:A,[p,O]=l.useState(W),[I,B]=l.useState(c),f=_t[K];c!==I&&(B(c),c&&O(W));let F;e[0]!==o||e[1]!==P?(F=E=>{!E&&!o&&P(!1)},e[0]=o,e[1]=P,e[2]=F):F=e[2];const U=F;let G;e[3]!==o||e[4]!==p||e[5]!==V?(G=async E=>{E.preventDefault();const z=p.trim();!z||o||await V(z)},e[3]=o,e[4]=p,e[5]=V,e[6]=G):G=e[6];const q=G;let L;e[7]!==f.title?(L=i.jsx($t,{children:f.title}),e[7]=f.title,e[8]=L):L=e[8];let N;e[9]!==f.description?(N=i.jsx(Ot,{children:f.description}),e[9]=f.description,e[10]=N):N=e[10];let R;e[11]!==L||e[12]!==N?(R=i.jsxs(Rt,{children:[L,N]}),e[11]=L,e[12]=N,e[13]=R):R=e[13];let S;e[14]!==Q?(S=Q&&i.jsxs("div",{className:"space-y-1.5",children:[i.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Location"}),i.jsx(We,{value:Q,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[14]=Q,e[15]=S):S=e[15];let D;e[16]===Symbol.for("react.memo_cache_sentinel")?(D=i.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[16]=D):D=e[16];let j;e[17]===Symbol.for("react.memo_cache_sentinel")?(j=E=>O(E.target.value),e[17]=j):j=e[17];let b;e[18]!==f.placeholder||e[19]!==o||e[20]!==p?(b=i.jsxs("div",{className:"space-y-1.5",children:[D,i.jsx(We,{id:"file-explorer-name",value:p,onChange:j,placeholder:f.placeholder,autoFocus:!0,disabled:o})]}),e[18]=f.placeholder,e[19]=o,e[20]=p,e[21]=b):b=e[21];let h;e[22]!==b||e[23]!==S?(h=i.jsxs("div",{className:"space-y-4 py-4",children:[S,b]}),e[22]=b,e[23]=S,e[24]=h):h=e[24];let x;e[25]!==P?(x=()=>P(!1),e[25]=P,e[26]=x):x=e[26];let v;e[27]!==o||e[28]!==x?(v=i.jsx(fe,{type:"button",variant:"outline",onClick:x,disabled:o,children:"Cancel"}),e[27]=o,e[28]=x,e[29]=v):v=e[29];let C;e[30]!==o||e[31]!==p?(C=!p.trim()||o,e[30]=o,e[31]=p,e[32]=C):C=e[32];let u;e[33]!==f.submit||e[34]!==o?(u=o?i.jsxs(i.Fragment,{children:[i.jsx(re,{size:14,className:"animate-spin"}),"Saving…"]}):f.submit,e[33]=f.submit,e[34]=o,e[35]=u):u=e[35];let k;e[36]!==C||e[37]!==u?(k=i.jsx(fe,{type:"submit",disabled:C,children:u}),e[36]=C,e[37]=u,e[38]=k):k=e[38];let m;e[39]!==v||e[40]!==k?(m=i.jsxs(zt,{children:[v,k]}),e[39]=v,e[40]=k,e[41]=m):m=e[41];let g;e[42]!==q||e[43]!==h||e[44]!==m||e[45]!==R?(g=i.jsx(At,{className:"sm:max-w-md",children:i.jsxs("form",{onSubmit:q,children:[R,h,m]})}),e[42]=q,e[43]=h,e[44]=m,e[45]=R,e[46]=g):g=e[46];let T;return e[47]!==U||e[48]!==c||e[49]!==g?(T=i.jsx(Wt,{open:c,onOpenChange:U,children:g}),e[47]=U,e[48]=c,e[49]=g,e[50]=T):T=e[50],T}const tn="#d9a441";function nn(y){const e=Ke.c(45),{node:c,depth:K,isExpanded:X,isSelected:Q,isLoading:A,fileVisual:V,onOpen:P,onSelect:W,onNewFile:o,onNewFolder:p,onCopyPath:O,onCopyRelativePath:I,onRename:B,onDelete:f}=y,F=A===void 0?!1:A,U=c.kind==="directory",{Icon:G,color:q}=V,L=Q&&"bg-accent";let N;e[0]!==L?(N=Ve("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",L),e[0]=L,e[1]=N):N=e[1];const R=`${K*14+8}px`;let S;e[2]!==R?(S={paddingLeft:R},e[2]=R,e[3]=S):S=e[3];let D;e[4]!==P||e[5]!==W?(D=()=>{W(),P()},e[4]=P,e[5]=W,e[6]=D):D=e[6];let j;e[7]!==G||e[8]!==q||e[9]!==U||e[10]!==X||e[11]!==F?(j=U?i.jsxs(i.Fragment,{children:[F?i.jsx(re,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):X?i.jsx(Vt,{size:14,className:"shrink-0 text-muted-foreground"}):i.jsx(Bt,{size:14,className:"shrink-0 text-muted-foreground"}),i.jsx(Gt,{size:16,className:"shrink-0",style:{color:tn}})]}):i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"w-3.5 shrink-0"}),i.jsx(G,{size:16,className:"shrink-0",style:{color:q}})]}),e[7]=G,e[8]=q,e[9]=U,e[10]=X,e[11]=F,e[12]=j):j=e[12];let b;e[13]!==c.name?(b=i.jsx("span",{className:"truncate",children:c.name}),e[13]=c.name,e[14]=b):b=e[14];let h;e[15]!==N||e[16]!==S||e[17]!==D||e[18]!==j||e[19]!==b?(h=i.jsx(It,{asChild:!0,children:i.jsxs("button",{type:"button",className:N,style:S,onClick:D,children:[j,b]})}),e[15]=N,e[16]=S,e[17]=D,e[18]=j,e[19]=b,e[20]=h):h=e[20];let x;e[21]!==o?(x=i.jsx(_,{onSelect:o,children:"New File"}),e[21]=o,e[22]=x):x=e[22];let v;e[23]!==p?(v=i.jsx(_,{onSelect:p,children:"New Folder"}),e[23]=p,e[24]=v):v=e[24];let C;e[25]===Symbol.for("react.memo_cache_sentinel")?(C=i.jsx(Ie,{}),e[25]=C):C=e[25];let u;e[26]!==O?(u=i.jsx(_,{onSelect:O,children:"Copy Path"}),e[26]=O,e[27]=u):u=e[27];let k;e[28]!==I?(k=i.jsx(_,{onSelect:I,children:"Copy Relative Path"}),e[28]=I,e[29]=k):k=e[29];let m;e[30]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(Ie,{}),e[30]=m):m=e[30];let g;e[31]!==B?(g=i.jsx(_,{onSelect:B,children:"Rename"}),e[31]=B,e[32]=g):g=e[32];let T;e[33]!==f?(T=i.jsx(_,{variant:"destructive",onSelect:f,children:"Delete"}),e[33]=f,e[34]=T):T=e[34];let E;e[35]!==x||e[36]!==v||e[37]!==u||e[38]!==k||e[39]!==g||e[40]!==T?(E=i.jsxs(Mt,{className:"w-52",children:[x,v,C,u,k,m,g,T]}),e[35]=x,e[36]=v,e[37]=u,e[38]=k,e[39]=g,e[40]=T,e[41]=E):E=e[41];let z;return e[42]!==E||e[43]!==h?(z=i.jsxs(Kt,{children:[h,E]}),e[42]=E,e[43]=h,e[44]=z):z=e[44],z}pt.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});function je(y,e,c,K){return`/api/${y}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(c)}/${K}`}function rn(y){const e=M(y);return!e||e.includes("..")||e.includes("\\")?!1:e.startsWith(".deco/blocks/")||!e.startsWith("/")&&!e.includes("://")}const sn="#94a3b8";function on(y){const e=y.toLowerCase();return e.endsWith(".tsx")||e.endsWith(".ts")?{Icon:ae,color:"#3b82f6"}:e.endsWith(".jsx")||e.endsWith(".js")||e.endsWith(".mjs")||e.endsWith(".cjs")?{Icon:ae,color:"#d9a441"}:e.endsWith(".json")?{Icon:yt,color:"#cb9b3f"}:e.endsWith(".css")||e.endsWith(".scss")?{Icon:ae,color:"#06b6d4"}:e.endsWith(".html")||e.endsWith(".xml")?{Icon:ae,color:"#f97316"}:/\.(png|jpe?g|gif|webp|avif|ico|svg)$/.test(e)?{Icon:wt,color:"#a855f7"}:e.endsWith(".md")||e.endsWith(".mdx")?{Icon:$e,color:"#64748b"}:{Icon:$e,color:sn}}function Ii({orgSlug:y,virtualMcpId:e,branch:c,openPath:K}){const[X,Q]=l.useState({files:[],directories:[],truncated:!1}),{files:A,directories:V}=X,[P,W]=l.useState(new Set),[o,p]=l.useState(null),[O,I]=l.useState(null),[B,f]=l.useState([]),[F,U]=l.useState(""),[G,q]=l.useState(!1),[L,N]=l.useState(!1),[,R]=l.useState(new Set),[S,D]=l.useState(new Set),j=l.useRef(0),b=l.useRef(null),h=l.useRef(new Set),x=l.useRef(new Map);function v(t){R(n=>{const r=typeof t=="function"?t(n):t;return h.current=r,r})}const[C,u]=l.useState(new Map),k=l.useRef(null),[m,g]=l.useState(null),{sendMessage:T}=Et(),{setChatOpen:E}=Pt(),z=ut(),[w,J]=l.useState(null),[H,ue]=l.useState(null),[ee,ie]=l.useState(!1);async function te(t,n){const r=await fetch(je(y,e,c,t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!r.ok){const s=await r.json().catch(()=>({}));throw new Error(s.error??`Request failed (${r.status})`)}return r.json()}async function se(){z.invalidateQueries({queryKey:Ae(y,e,c)})}function be(t,n){navigator.clipboard.writeText(n).then(()=>$.success(`${t} copied`),()=>$.error(`Failed to copy ${t.toLowerCase()}`))}function Be(t){const n=Yt(t);if(!n)return;const r=`${y}/${e}/${c}`;z.setQueryData(Te.decofile(r),s=>{if(!s)return s;const{[n]:a,...d}=s;return d}),z.invalidateQueries({queryKey:Te.liveMeta(r)})}function Ge(t){const n=t.kind==="file"?[t.path]:A.filter(r=>r.startsWith(".deco/blocks/")).map(r=>ce(r)).filter(r=>r===t.path||r.startsWith(`${t.path}/`));for(const r of n)Be(r)}function qe(t){const n=ce(t);return B.filter(r=>{if(r!==n&&!r.startsWith(`${n}/`))return!1;const s=C.get(r);return!!(s?.loaded&&s.editorValue!==s.savedContent)})}function ve(t){f(n=>n.map(r=>t(r)).filter(r=>r!==null)),p(n=>n&&t(n)),u(n=>{const r=new Map;for(const[s,a]of n){const d=t(s);d&&r.set(d,a)}return r}),I(n=>{if(!n)return n;const r=t(n.path);return r?r===n.path?n:{...n,path:r,name:r.split("/").pop()??r}:null})}function Qe(t){const n=ce(t);I(r=>r&&(r.path===n||r.path.startsWith(`${n}/`)?null:r)),ve(r=>r===n||r.startsWith(`${n}/`)?null:r)}async function Ue(t){if(!w)return;const n=de(w.parentDir,t);if(we(n,A,V))throw new Error(`"${t}" already exists`);await te("write",{path:M(n),content:""}),await ne(),await se(),J(null),me(n)}async function Je(t){if(!w)return;const n=de(w.parentDir,t);if(we(n,A,V))throw new Error(`"${t}" already exists`);const r=M(n);await te("mkdir",{path:r}),Q(s=>({...s,directories:s.directories.includes(r)?s.directories:[...s.directories,r]})),await ne(),await se(),J(null),W(s=>{const a=new Set(s);for(const d of he(n))a.add(d);return a.add(n),a}),I({name:t,path:n,kind:"directory",children:[]})}async function He(t){if(!w)return;const n=w.node.path,r=ye(n),s=de(r,t);if(s===n){J(null);return}if(we(s,A,V))throw new Error(`"${t}" already exists`);await te("rename",{from:M(n),to:M(s)}),ve(a=>a===n?s:a.startsWith(`${n}/`)?de(s,a.slice(n.length+1)):a),await ne(),await se(),J(null)}async function Xe(t){ie(!0);try{await te("unlink",{path:M(t.path),recursive:t.kind==="directory"}),Ge(t),Qe(t.path),await ne(),await se(),ue(null),$.success(`Deleted "${t.name}"`)}catch(n){$.error(n instanceof Error?n.message:"Delete failed")}finally{ie(!1)}}async function Ye(t){const n=Xt(t);if(n){$.error(n);return}ie(!0);try{w?.mode==="new-file"?(await Ue(t),$.success(`Created "${t}"`)):w?.mode==="new-folder"?(await Je(t),$.success(`Created folder "${t}"`)):w?.mode==="rename"&&(await He(t),$.success(`Renamed to "${t}"`))}catch(r){$.error(r instanceof Error?r.message:"Operation failed")}finally{ie(!1)}}const Ce=l.useRef(!1);Ce.current||(Ce.current=!0,b.current=ne());const[Ze,_e]=l.useState(null);if(K&&K!==Ze){_e(K);const t=K;queueMicrotask(()=>{rn(t)&&me(t).catch(n=>{$.error(n instanceof Error?n.message:"Failed to open file")})})}async function Ne(t){const n=await te("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function Se(t,n,r){if(r!==j.current)return!1;let s=!1;return Q(a=>{const d=n?Zt(a.files,a.directories,t,a.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return s=!!d.truncated,{files:d.files,directories:d.directories,truncated:s}}),s&&$.warning("File list truncated — some files may be hidden"),s}async function et(t){const n=x.current.get(t);if(n)return n;const r=j.current,s=(async()=>{const a=await Ne({pattern:"**/*",path:M(t),limit:Me}),d=Se(a,!0,r);return!d&&r===j.current&&v(Y=>{const oe=new Set(Y);return oe.add(t),oe}),d})();x.current.set(t,s);try{return await s}finally{x.current.delete(t)}}async function De(t){if(!ge(t,h.current))return!1;D(n=>new Set(n).add(t));try{return await et(t)}finally{D(n=>{const r=new Set(n);return r.delete(t),r})}}async function tt(t){const n=new Set(h.current);for(const r of he(t)){if(!ge(r,n))continue;if(await De(r))throw new Error("Folder listing truncated — expand again to load more");n.add(r)}}async function ne(){const t=++j.current;x.current.clear(),q(!0),v(new Set),W(new Set),D(new Set);try{const n=await Ne({pattern:"**/*",limit:Me,maxDepth:qt});Se(n,!1,t),N(!0)}catch{L&&$.error("Failed to refresh file tree")}finally{q(!1)}}async function ke(t){if(!C.get(t)?.loaded){u(r=>{const s=new Map(r);return s.set(t,{savedContent:"",editorValue:"",loaded:!1}),s});try{const r=await fetch(je(y,e,c,"read"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:M(t),full:!0})});if(!r.ok)return;const s=await r.json(),a=Ht(s.content??"");u(d=>{const Y=new Map(d);return Y.set(t,{savedContent:a,editorValue:a,loaded:!0}),Y})}catch{}}}async function nt(t,n){try{const r=await fetch(je(y,e,c,"write"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:M(t),content:n})});if(!r.ok){le("file save failed",{path:t,status:r.status});return}le("file saved via sandbox /write",{path:t}),z.invalidateQueries({queryKey:Ae(y,e,c)});try{const s=await Tt(y,e,c);le("git status after save",s)}catch(s){le("git status after save failed",{path:t,error:s instanceof Error?s.message:String(s)})}u(s=>{const a=new Map(s),d=a.get(t);return d&&a.set(t,{...d,savedContent:n}),a})}catch{}}function rt(t){p(t),I({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),g(null),B.includes(t)||f(n=>[...n,t]),ke(t)}function it(t){f(n=>{const r=n.filter(s=>s!==t);return o===t&&p(r[r.length-1]??null),r}),u(n=>{const r=new Map(n);return r.delete(t),r})}function Fe(t){W(n=>{const r=new Set(n);return r.has(t)?r.delete(t):r.add(t),r})}async function st(t){if(ge(t,h.current))try{if(await De(t))return}catch(n){$.error(n instanceof Error?n.message:"Failed to load folder");return}Fe(t)}async function ot(t,n){if(n){Fe(t);return}await st(t)}async function me(t){await b.current,await tt(t);const n=he(t);W(r=>{const s=new Set(r);for(const a of n)s.add(a);return s}),rt(t)}function at(){return O?.kind==="directory"?O.path:O?.kind==="file"?ye(O.path):o?ye(o):"/"}function Le(t){const n=at();J({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const lt=Qt(A,V),Ee=Ut(lt,P),Pe=F?Ee.filter(t=>t.node.name.toLowerCase().includes(F.toLowerCase())):Ee,Z=o?C.get(o):null,ct=Z?.loaded&&Z.editorValue!==Z.savedContent,pe=H?qe(H.path):[],dt=(t,n)=>{k.current=t,t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!o)return;const r=t.getValue();await nt(o,r)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const r=t.getSelection(),s=t.getModel();if(!r||!s||!o)return;const a=s.getValueInRange(r);g({filePath:o,lineStart:r.startLineNumber,lineEnd:r.endLineNumber,selectedCode:a})})};function ft(t){if(!m)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${m.filePath}\``,`**Lines:** ${m.lineStart}–${m.lineEnd}`];if(m.selectedCode){const r=xe(m.filePath),s=m.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+r,s,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),E(!0),T({parts:[{type:"text",text:n.join(`
2
2
  `)}]}),g(null)}return G&&!L?i.jsx("div",{className:"flex items-center justify-center h-full w-full",children:i.jsx(re,{size:20,className:"animate-spin text-muted-foreground"})}):i.jsxs("div",{className:"flex h-full w-full overflow-hidden",children:[i.jsxs("div",{className:"w-64 shrink-0 border-r flex flex-col overflow-hidden",children:[i.jsxs("div",{className:"flex items-center gap-1 p-2 border-b",children:[i.jsxs("div",{className:"relative min-w-0 flex-1",children:[i.jsx(ht,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),i.jsx("input",{type:"text",value:F,onChange:t=>U(t.target.value),placeholder:"Search files...","aria-label":"Search files",className:"w-full rounded-md border border-input bg-transparent pl-7 pr-2 py-1.5 text-xs outline-none placeholder:text-muted-foreground focus:ring-1 focus:ring-ring"})]}),i.jsxs(Oe,{children:[i.jsx(Re,{asChild:!0,children:i.jsx(fe,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New file",onClick:()=>Le("new-file"),children:i.jsx(xt,{size:14})})}),i.jsx(ze,{side:"bottom",children:"New file"})]}),i.jsxs(Oe,{children:[i.jsx(Re,{asChild:!0,children:i.jsx(fe,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New folder",onClick:()=>Le("new-folder"),children:i.jsx(gt,{size:14})})}),i.jsx(ze,{side:"bottom",children:"New folder"})]})]}),i.jsx(bt,{className:"flex-1",children:i.jsxs("div",{className:"py-1",children:[Pe.map(t=>{const{node:n,depth:r}=t,s=n.kind==="directory",a=P.has(n.path),d=O?.path===n.path,Y=Jt(n.path,n.kind),oe=s&&S.has(n.path);return i.jsx(nn,{node:n,depth:r,isExpanded:a,isSelected:d,isLoading:oe,fileVisual:on(n.name),onSelect:()=>I(n),onOpen:()=>{s?ot(n.path,a):me(n.path)},onNewFile:()=>J({mode:"new-file",node:n,parentDir:Y}),onNewFolder:()=>J({mode:"new-folder",node:n,parentDir:Y}),onCopyPath:()=>be("Path",ce(n.path)),onCopyRelativePath:()=>be("Relative path",M(n.path)),onRename:()=>J({mode:"rename",node:n,parentDir:Y}),onDelete:()=>ue(n)},n.path)}),L&&Pe.length===0&&i.jsx("div",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:F?`No files match "${F}"`:"No files found"})]})})]}),i.jsxs("div",{className:"relative flex-1 flex flex-col overflow-hidden",children:[B.length>0&&i.jsx("div",{className:"flex items-center border-b overflow-x-auto shrink-0",children:B.map(t=>{const n=C.get(t),r=n?.loaded&&n.editorValue!==n.savedContent,s=o===t,a=t.split("/").pop()??t;return i.jsxs("div",{className:Ve("flex items-center gap-1 px-3 py-1.5 text-xs border-r cursor-pointer transition-colors",s?"bg-background text-foreground":"bg-muted/50 text-muted-foreground hover:bg-accent"),onClick:()=>{p(t),ke(t)},onKeyDown:()=>{},role:"tab",tabIndex:0,"aria-selected":s,children:[i.jsx("span",{className:"truncate max-w-32",children:a}),r&&i.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-foreground/60 shrink-0"}),i.jsx("button",{type:"button",className:"ml-1 rounded p-0.5 hover:bg-accent-foreground/10",onClick:d=>{d.stopPropagation(),it(t)},children:i.jsx(jt,{size:12})})]},t)})}),m&&i.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 z-20 mt-2",style:{width:"360px"},children:i.jsxs("form",{className:"flex w-full items-center gap-1.5 rounded-xl border border-border bg-background/95 px-3 py-1.5 shadow-lg backdrop-blur",onSubmit:t=>{t.preventDefault();const r=t.currentTarget.elements.namedItem("askAiInput");r.value.trim()&&ft(r.value)},children:[i.jsx("input",{name:"askAiInput",autoFocus:!0,type:"text",placeholder:"Ask the AI...",className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground",onKeyDown:t=>{t.stopPropagation(),t.key==="Escape"&&g(null)}}),i.jsx("button",{type:"submit",className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-foreground text-background transition-opacity",title:"Send",children:i.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[i.jsx("title",{children:"Send"}),i.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}),i.jsx("div",{className:"flex-1 overflow-hidden",children:o&&Z?.loaded?i.jsx(mt,{language:xe(o),theme:document.documentElement.classList.contains("dark")?"vs-dark":"light",value:Z.editorValue,path:o,onChange:t=>{const n=o;n&&u(r=>{const s=new Map(r),a=s.get(n);return a&&s.set(n,{...a,editorValue:t??""}),s})},onMount:dt,loading:i.jsx("div",{className:"flex items-center justify-center h-full w-full",children:i.jsx(re,{size:20,className:"animate-spin text-muted-foreground"})}),options:{fontSize:13,scrollBeyondLastLine:!1,automaticLayout:!0,lineNumbersMinChars:2,wordWrap:"on",minimap:{enabled:!1},padding:{top:12,bottom:12},scrollbar:{vertical:"auto",horizontal:"auto",verticalScrollbarSize:8,horizontalScrollbarSize:8}}},o):o&&!Z?.loaded?i.jsx("div",{className:"flex items-center justify-center h-full w-full",children:i.jsx(re,{size:20,className:"animate-spin text-muted-foreground"})}):i.jsx("div",{className:"flex items-center justify-center h-full w-full text-sm text-muted-foreground",children:"Select a file to edit"})}),o&&i.jsxs("div",{className:"flex items-center justify-between px-3 py-1 border-t text-[11px] text-muted-foreground shrink-0",children:[i.jsx("span",{className:"truncate",children:o}),i.jsxs("span",{children:[ct?"Modified":"Saved"," ·"," ",xe(o)]})]})]}),i.jsx(en,{open:w!==null,mode:w?.mode??"new-file",initialName:w?.mode==="rename"?w.node.name:"",parentLabel:w&&w.mode!=="rename"?w.parentDir==="/"?"/":M(w.parentDir):void 0,isPending:ee,onSubmit:Ye,onOpenChange:t=>{!t&&!ee&&J(null)}}),i.jsx(vt,{open:H!==null,onOpenChange:t=>{!t&&!ee&&ue(null)},children:i.jsxs(Ct,{children:[i.jsxs(Nt,{children:[i.jsxs(St,{children:["Delete ",H?.kind==="directory"?"folder":"file","?"]}),i.jsxs(Dt,{children:["This will permanently delete"," ",i.jsx("span",{className:"font-mono",children:H?.name}),H?.kind==="directory"?" and everything inside it.":".",pe.length>0&&i.jsxs(i.Fragment,{children:[" ",pe.length===1?"One open file has unsaved changes that will be lost.":`${pe.length} open files have unsaved changes that will be lost.`]})]})]}),i.jsxs(kt,{children:[i.jsx(Ft,{disabled:ee,children:"Cancel"}),i.jsx(Lt,{disabled:ee||!H,onClick:t=>{t.preventDefault(),H&&Xe(H)},children:"Delete"})]})]})})]})}export{Ii as FileExplorer};
@@ -1,4 +1,4 @@
1
- import{bA as zl,j as q,ah as lt,bS as zn,r as Ve,bT as b0,l as Gb,c as Ke,b as E0,e as T0,B as $b}from"./index-I8Uum3Jx.js";import{i as zb}from"./ChevronUp-HJUE3-BD.js";import{a as jb}from"./Eye-BSiFxHQB.js";import{a as S0,g as y0,h as A0,d as _0}from"./dialog-CxQBoX40.js";import{n as I0}from"./Globe01-wGomueqV.js";import{j as k0,n as R0}from"./ZoomOut-DxqRFWA_.js";import{u as N0}from"./use-mobile-C0mpADhR.js";import{m as C0}from"./tab-id-BptcWVWa.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{bA as zl,j as q,ah as lt,bS as zn,r as Ve,bT as b0,l as Gb,c as Ke,b as E0,e as T0,B as $b}from"./index-C5w7M3ak.js";import{i as zb}from"./ChevronUp-CADhYHt4.js";import{a as jb}from"./Eye-CQQama2s.js";import{a as S0,g as y0,h as A0,d as _0}from"./dialog-BYnY80tb.js";import{n as I0}from"./Globe01-CaIgPTxT.js";import{j as k0,n as R0}from"./ZoomOut-VAm9p2Hl.js";import{u as N0}from"./use-mobile-COxfHS-K.js";import{m as C0}from"./tab-id-BptcWVWa.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-I8Uum3Jx.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-C5w7M3ak.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};