decocms 4.335.4 → 4.335.5

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 (257) hide show
  1. package/dist/client/assets/{AlertCircle-BawGC1kp.js → AlertCircle-DkXErK78.js} +1 -1
  2. package/dist/client/assets/{AreaChart-DpgNjYbJ.js → AreaChart-C8rXR_Do.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-DAHOvtJW.js → ArrowLeft-nyFzJAF7.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-BYkw_uv9.js → ArrowUp-BsH1JQDE.js} +1 -1
  5. package/dist/client/assets/{Check-D50Qz8pd.js → Check-DhPzBUin.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-DYo4yeC6.js → CheckCircle-DbWErBsi.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-B366HM4z.js → ChevronRight-Cgzp06X7.js} +1 -1
  8. package/dist/client/assets/{ChevronSelectorVertical-hDysfF54.js → ChevronSelectorVertical-4msYrwrQ.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-DiPLvM5v.js → ChevronUp-BHEDGf01.js} +1 -1
  10. package/dist/client/assets/{Copy01-wjgNpbHM.js → Copy01-B2wknoSd.js} +1 -1
  11. package/dist/client/assets/{CreditCard01-BARv2b55.js → CreditCard01-BqFQTNVJ.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-C5ZAJeIV.js → DotsVertical-CJKQ5OKe.js} +1 -1
  13. package/dist/client/assets/{Download01-Cp8tCYEj.js → Download01-B92LLlkv.js} +1 -1
  14. package/dist/client/assets/{ErrorBarContext-DMR3NBxM.js → ErrorBarContext-Ceqv17JV.js} +1 -1
  15. package/dist/client/assets/{Eye-04eGXQWm.js → Eye-COEW3kab.js} +1 -1
  16. package/dist/client/assets/{GitBranch01-BkBspkIH.js → GitBranch01-BYv7lYbJ.js} +1 -1
  17. package/dist/client/assets/{Globe01-B3WKrszB.js → Globe01-CpHtL3_S.js} +1 -1
  18. package/dist/client/assets/{HardDrive-B1lGKQQL.js → HardDrive-s6aHvTkZ.js} +1 -1
  19. package/dist/client/assets/{Image01-DuMpyolM.js → Image01-DzmzghUe.js} +1 -1
  20. package/dist/client/assets/{Key01-DBgMeUTs.js → Key01-BE_KAWE-.js} +1 -1
  21. package/dist/client/assets/{Link01-Dn9-GB6A.js → Link01-Bu-GiSBD.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-B5R9GWYR.js → LinkExternal01-B1ZpJJPQ.js} +1 -1
  23. package/dist/client/assets/{Monitor01-B82ksyKe.js → Monitor01-B5pQXW2m.js} +1 -1
  24. package/dist/client/assets/{Package-Dne4I7eU.js → Package-CVhm08ke.js} +1 -1
  25. package/dist/client/assets/{Palette-C4PW0nnS.js → Palette-BcF_s5q5.js} +1 -1
  26. package/dist/client/assets/{Play-CaESL_5l.js → Play-BtxbJVzC.js} +1 -1
  27. package/dist/client/assets/{Plus-6QlnmG7X.js → Plus-CsKngGuQ.js} +1 -1
  28. package/dist/client/assets/{SearchMd-ryPT7rxv.js → SearchMd-W7yXXDTJ.js} +1 -1
  29. package/dist/client/assets/{Sector-CZCIYKSf.js → Sector-Cw15cdya.js} +1 -1
  30. package/dist/client/assets/{Settings02-4GByZEin.js → Settings02-C-aI-tWH.js} +1 -1
  31. package/dist/client/assets/{Share07-BKp8_1LW.js → Share07-BAIRkREV.js} +1 -1
  32. package/dist/client/assets/{Shield01-CoHqiHHO.js → Shield01-C4vXcSMh.js} +1 -1
  33. package/dist/client/assets/{Stars01-CV8WfUpL.js → Stars01-0Qvp46bC.js} +1 -1
  34. package/dist/client/assets/{Sun-D9qQ8V1c.js → Sun-BiuHyV4K.js} +1 -1
  35. package/dist/client/assets/{Tool01-CepDUjO3.js → Tool01-Lpy5rhsr.js} +1 -1
  36. package/dist/client/assets/{Tool02-DdG_5-W8.js → Tool02-g0s22FxS.js} +1 -1
  37. package/dist/client/assets/{Trash01-C6Ou_hlQ.js → Trash01-D7ZPlmCM.js} +1 -1
  38. package/dist/client/assets/{TrendUp01-DrNdYLD4.js → TrendUp01-DuwufgFk.js} +1 -1
  39. package/dist/client/assets/{Upload01-DkBOH9fh.js → Upload01-BG4c8c9K.js} +1 -1
  40. package/dist/client/assets/{User01-C-2ChFyL.js → User01-DS4N984M.js} +1 -1
  41. package/dist/client/assets/{UserSquare-DrToBYR4.js → UserSquare-Dwn5UlhY.js} +1 -1
  42. package/dist/client/assets/{Users01-CRoUmw6V.js → Users01-D6PoAtch.js} +1 -1
  43. package/dist/client/assets/{Users03-DN1IDxHZ.js → Users03-Dmh-Hpx0.js} +1 -1
  44. package/dist/client/assets/{XCircle-CBWbsT40.js → XCircle-C-_3rX1F.js} +1 -1
  45. package/dist/client/assets/{XClose-A4VFkjrc.js → XClose-wQ6j1uwj.js} +1 -1
  46. package/dist/client/assets/{Zap-DP8syq_X.js → Zap-CX8wcGAM.js} +1 -1
  47. package/dist/client/assets/{ZoomOut-DTYLnleU.js → ZoomOut-BDRyaej7.js} +1 -1
  48. package/dist/client/assets/{access-gate-ta9zuKWv.js → access-gate-_Vfpq2gY.js} +1 -1
  49. package/dist/client/assets/{agent-icon-BRoPbkxd.js → agent-icon-CLvBDlBI.js} +1 -1
  50. package/dist/client/assets/{agents-list-C0r18LDs.js → agents-list-uJI4xQB3.js} +1 -1
  51. package/dist/client/assets/{ai-providers-j1NPv67A.js → ai-providers-BJ6E9ewb.js} +1 -1
  52. package/dist/client/assets/{alert-Cx4zhMzx.js → alert-8fh2nE-F.js} +1 -1
  53. package/dist/client/assets/{alert-dialog-DQkitV36.js → alert-dialog-DCuxpr9z.js} +1 -1
  54. package/dist/client/assets/{analytics-tab-CSiIjm1o.js → analytics-tab-9Otlp_6n.js} +1 -1
  55. package/dist/client/assets/api-keys-C-mBCgMY.js +1 -0
  56. package/dist/client/assets/{api-keys-Y6hdDGVF.js → api-keys-CQCP6k9I.js} +1 -1
  57. package/dist/client/assets/app-editor-DaesYL_L.js +1 -0
  58. package/dist/client/assets/{auth-BonfJbpi.js → auth-BEBPh5eQ.js} +1 -1
  59. package/dist/client/assets/{auth-catchall-BO4gTv7Q.js → auth-catchall-D5HTWfy1.js} +1 -1
  60. package/dist/client/assets/{auth-entry-CRPmcnXA.js → auth-entry-jzIKNpot.js} +1 -1
  61. package/dist/client/assets/{auth-split-layout-DkuNxQTt.js → auth-split-layout-_26EcRfh.js} +1 -1
  62. package/dist/client/assets/{authenticate-and-persist-oauth-BXIxJO7G.js → authenticate-and-persist-oauth-CawOOdZR.js} +1 -1
  63. package/dist/client/assets/{automation-list-row-CmtWVLX6.js → automation-list-row-BzTbowTj.js} +1 -1
  64. package/dist/client/assets/{automation-runs-CFfbViJw.js → automation-runs-D20mZNyW.js} +1 -1
  65. package/dist/client/assets/{automations-BH9v-Bo7.js → automations-DvF_1xiP.js} +1 -1
  66. package/dist/client/assets/{autosend-DQusdBG_.js → autosend-DVckbPpo.js} +1 -1
  67. package/dist/client/assets/{avatar-BUe1abT6.js → avatar-B8mdJCa-.js} +1 -1
  68. package/dist/client/assets/{badge-BjiEQuif.js → badge-DtjY8TtR.js} +1 -1
  69. package/dist/client/assets/{block-document-Cj4OnoOw.js → block-document-g-lLT_T2.js} +1 -1
  70. package/dist/client/assets/{breadcrumb-CxF2wYfL.js → breadcrumb-CJ_vjC7z.js} +1 -1
  71. package/dist/client/assets/{buckets-Z4Pi6QIs.js → buckets-D2cDuuTg.js} +1 -1
  72. package/dist/client/assets/{bulk-category-panel-BZRf9CUh.js → bulk-category-panel-DQ_-gX4G.js} +1 -1
  73. package/dist/client/assets/{capability-load-error-BcT3mAZI.js → capability-load-error-B6H4F98O.js} +1 -1
  74. package/dist/client/assets/{cards-DW1vhrc1.js → cards-DhOPI6sE.js} +1 -1
  75. package/dist/client/assets/{category-editor-DE4Xjik0.js → category-editor-DZAmeto9.js} +1 -1
  76. package/dist/client/assets/{cdn-tab-D4G5-rGw.js → cdn-tab-DIOi-X7j.js} +1 -1
  77. package/dist/client/assets/{chart-Bd4b_fVC.js → chart-BHNtxmZ5.js} +1 -1
  78. package/dist/client/assets/{chat-context-b0GmCrhs.js → chat-context-DEDhjfBk.js} +1 -1
  79. package/dist/client/assets/{checkbox-Bhj4AUZs.js → checkbox-Be7jzOoS.js} +1 -1
  80. package/dist/client/assets/{choose-editor-DcKlxPyH.js → choose-editor-zQOdE8Ej.js} +1 -1
  81. package/dist/client/assets/{cli-auth-success-mUIAj9X0.js → cli-auth-success-BcdOQIta.js} +1 -1
  82. package/dist/client/assets/{client-icons-DCR8EFIh.js → client-icons-D-00vmrI.js} +1 -1
  83. package/dist/client/assets/{collection-detail-DAGScCtV.js → collection-detail-CkhC6mv-.js} +1 -1
  84. package/dist/client/assets/{collection-display-button-NvPvsKPR.js → collection-display-button-Bys_SBuK.js} +1 -1
  85. package/dist/client/assets/{collection-search-BCsXpSHE.js → collection-search-BZvxdZ2z.js} +1 -1
  86. package/dist/client/assets/{collection-table-wrapper-CcjzxNLW.js → collection-table-wrapper-9R-Qm9Z1.js} +1 -1
  87. package/dist/client/assets/{collection-tabs-CquGY0e9.js → collection-tabs-B3_daFGe.js} +1 -1
  88. package/dist/client/assets/{command-_eMlwt6K.js → command-BYsoEu13.js} +1 -1
  89. package/dist/client/assets/{commerce-onboarding-DvIkWZy6.js → commerce-onboarding-uwX2SpER.js} +1 -1
  90. package/dist/client/assets/{connect-BhFzvomI.js → connect-BfufI0uK.js} +1 -1
  91. package/dist/client/assets/{connect-layout-BziJud9I.js → connect-layout-X-hnfLrm.js} +1 -1
  92. package/dist/client/assets/{connection-Dhn66lIi.js → connection-CHgRA4wn.js} +1 -1
  93. package/dist/client/assets/{connection-card-C9cMC74v.js → connection-card--LN_jYcC.js} +1 -1
  94. package/dist/client/assets/{connection-detail-C_d_GO5N.js → connection-detail-BN_4XbCJ.js} +1 -1
  95. package/dist/client/assets/{connection-form-helpers-BCJYrFWh.js → connection-form-helpers--H0qnET4.js} +1 -1
  96. package/dist/client/assets/{connections-CKAPcyfx.js → connections-D2VogeP2.js} +1 -1
  97. package/dist/client/assets/{create-organization-dialog-4cBtmtGy.js → create-organization-dialog-CSkXKpbv.js} +1 -1
  98. package/dist/client/assets/{decopilot-sse-pool-B-fcCk-K.js → decopilot-sse-pool-CPDW4Qwb.js} +1 -1
  99. package/dist/client/assets/{dialog-CqKyQDlv.js → dialog-U2qFdhAX.js} +1 -1
  100. package/dist/client/assets/differenceInSeconds-C3x8sHUj.js +1 -0
  101. package/dist/client/assets/{domain-settings-rsmsli5t.js → domain-settings-DwgCvEBh.js} +1 -1
  102. package/dist/client/assets/{drawer-BnFsDyq0.js → drawer-CsIZzUcP.js} +1 -1
  103. package/dist/client/assets/{dropdown-menu-C2mZs1a5.js → dropdown-menu-D_Miiz9f.js} +1 -1
  104. package/dist/client/assets/{e2e-tab-CmVSnkMr.js → e2e-tab-B7qw7BdB.js} +1 -1
  105. package/dist/client/assets/{editor-Cin_5tu-.js → editor-DNe4bLdj.js} +1 -1
  106. package/dist/client/assets/{empty-state-CVOgJpTh.js → empty-state-Xpm1QK7i.js} +1 -1
  107. package/dist/client/assets/{empty-state-BfG2Bmb1.js → empty-state-bjpeaW-Z.js} +1 -1
  108. package/dist/client/assets/{extract-connection-data-CQY-ygil.js → extract-connection-data-BLCrhV7i.js} +1 -1
  109. package/dist/client/assets/{file-explorer-C39GwJYn.js → file-explorer-Dxgn4j_H.js} +1 -1
  110. package/dist/client/assets/{file-type-icon-DLS5OPI-.js → file-type-icon-CyHtRlEV.js} +1 -1
  111. package/dist/client/assets/{folder-icon-KLloGijH.js → folder-icon-DEEGyAQl.js} +1 -1
  112. package/dist/client/assets/{form-BT0_lKIF.js → form-8hUmXBGb.js} +1 -1
  113. package/dist/client/assets/{format-time-BnbuEtat.js → format-time-BtXRrtv4.js} +1 -1
  114. package/dist/client/assets/{general-Cw2aImbX.js → general-C1znYUI0.js} +1 -1
  115. package/dist/client/assets/{github-icon-DT8soM3-.js → github-icon-Cjn4Ny1J.js} +1 -1
  116. package/dist/client/assets/{github-repo-picker-B2eN4ZfY.js → github-repo-picker-Z1yfkJA2.js} +1 -1
  117. package/dist/client/assets/{hooks-Dq2_eaLg.js → hooks-CypM9t3s.js} +1 -1
  118. package/dist/client/assets/{hosting-tab-B9rrIEHx.js → hosting-tab-kius9-Gy.js} +1 -1
  119. package/dist/client/assets/{index-BdpKgdHi.js → index-BEywsCAt.js} +1 -1
  120. package/dist/client/assets/{index-weBGyocH.js → index-BYFW0DhO.js} +2 -2
  121. package/dist/client/assets/{index-32TCcut-.js → index-BoXYmQW_.js} +1 -1
  122. package/dist/client/assets/{index-Bvn7iwD5.js → index-C8dM3vjB.js} +1 -1
  123. package/dist/client/assets/{index-Cd2okj64.js → index-CFfAxyoZ.js} +1 -1
  124. package/dist/client/assets/{index-Cru7mZmr.js → index-CLP5ehJj.js} +1 -1
  125. package/dist/client/assets/{index-CLfdz-Nf.js → index-CTPaXMYq.js} +1 -1
  126. package/dist/client/assets/index-CUOGPjNf.js +823 -0
  127. package/dist/client/assets/{index-DGwcFVmZ.js → index-DFjj2z0x.js} +1 -1
  128. package/dist/client/assets/{index-CN5UL2xs.js → index-d0MmeExy.js} +1 -1
  129. package/dist/client/assets/{index-redirect-DyiKnyn8.js → index-redirect-BzZikeln.js} +1 -1
  130. package/dist/client/assets/{infra-billing-DqVf4yB0.js → infra-billing-Ba9WSVbM.js} +1 -1
  131. package/dist/client/assets/{input-CFnTtw2k.js → input-C2C9h9WJ.js} +1 -1
  132. package/dist/client/assets/{integration-icon-DRrrpuyS.js → integration-icon-BKkvkxjs.js} +1 -1
  133. package/dist/client/assets/{invite-member-dialog-B_nbbtBp.js → invite-member-dialog-DU4Y1udC.js} +1 -1
  134. package/dist/client/assets/{label-MlXrew-u.js → label-ChpEwj_L.js} +1 -1
  135. package/dist/client/assets/{layout-C_lx84HD.js → layout-BmFRY6YO.js} +1 -1
  136. package/dist/client/assets/{login-CqEdAL0i.js → login-CEq9YHAK.js} +1 -1
  137. package/dist/client/assets/{markdown-A8j5Qvc3.js → markdown-BDX_1DK9.js} +1 -1
  138. package/dist/client/assets/{mcp-app-renderer-Da9POrmv.js → mcp-app-renderer-Cj0SSXRd.js} +1 -1
  139. package/dist/client/assets/{mcp-oauth-_QOCWffw.js → mcp-oauth-C7fK1Egn.js} +1 -1
  140. package/dist/client/assets/{members--WPsqdt3.js → members-BIQIwfvI.js} +1 -1
  141. package/dist/client/assets/{monaco-editor-CKT0_nEP.js → monaco-editor-COGgBpMd.js} +1 -1
  142. package/dist/client/assets/{monitoring-stats-row-tPH6uGRR.js → monitoring-stats-row-D_1E_gzz.js} +1 -1
  143. package/dist/client/assets/{multi-select-B-S-Xb9-.js → multi-select-z570vxLS.js} +1 -1
  144. package/dist/client/assets/{oauth-callback-B6VALoxf.js → oauth-callback-DCOxtIHb.js} +1 -1
  145. package/dist/client/assets/{oauth-callback-ai-provider-0flaQQ7e.js → oauth-callback-ai-provider-CjpGeCHk.js} +1 -1
  146. package/dist/client/assets/{onboarding-x2RTFfmW.js → onboarding-k3m1QoNC.js} +1 -1
  147. package/dist/client/assets/{org-layout-NCxshhcB.js → org-layout-E8Zv_sdI.js} +1 -1
  148. package/dist/client/assets/{organization-choice-ltEF0-KQ.js → organization-choice-Ta0_QMfC.js} +1 -1
  149. package/dist/client/assets/{orgs-DmoPeZFE.js → orgs-zQDkYYY4.js} +1 -1
  150. package/dist/client/assets/{page-seo-form-C3Aunaar.js → page-seo-form-CKPuyl-E.js} +1 -1
  151. package/dist/client/assets/{popover-dodrM04j.js → popover-CmOKcG2M.js} +1 -1
  152. package/dist/client/assets/{post-calendar-bmfTmaL6.js → post-calendar-VErAmHAl.js} +1 -1
  153. package/dist/client/assets/{post-editor-SpHrxC7t.js → post-editor-DHf2sKhc.js} +1 -1
  154. package/dist/client/assets/{primitives-DPvJzv1K.js → primitives-ja9G6O8P.js} +1 -1
  155. package/dist/client/assets/{profile-CSZS-QNP.js → profile-lk8DFEh3.js} +1 -1
  156. package/dist/client/assets/{project-app-view-1sp0oB0K.js → project-app-view-B8HifYoQ.js} +1 -1
  157. package/dist/client/assets/{project-icon-F4BdYNaJ.js → project-icon-BwZ8B5Nt.js} +1 -1
  158. package/dist/client/assets/{prompts-Bs4ozupN.js → prompts-DFqtxdoB.js} +1 -1
  159. package/dist/client/assets/pt-BR-z8aNQunR.js +1 -0
  160. package/dist/client/assets/record-editor-XgONmsuo.js +1 -0
  161. package/dist/client/assets/redirect-editor-Df7pHfkk.js +1 -0
  162. package/dist/client/assets/registry--Eiz0SYA.js +2 -0
  163. package/dist/client/assets/{registry-layout-B2U7_fFB.js → registry-layout-6xiCaqpj.js} +1 -1
  164. package/dist/client/assets/{reports-zZPN7lBN.js → reports-Bv1Tw2QT.js} +1 -1
  165. package/dist/client/assets/{require-capability-B48NtYdb.js → require-capability-BFQmtnxP.js} +1 -1
  166. package/dist/client/assets/{required-auth-layout-DxMLFYG_.js → required-auth-layout-BlZwF6cH.js} +1 -1
  167. package/dist/client/assets/{reset-password-WaCZpZil.js → reset-password-DrzhSJWg.js} +1 -1
  168. package/dist/client/assets/{review-settings-53EpRpGO.js → review-settings-3kGqSvY5.js} +1 -1
  169. package/dist/client/assets/{roles-BJ1OpBCB.js → roles-Br7dsm1F.js} +1 -1
  170. package/dist/client/assets/{schema-CMNTDy4A.js → schema-UMHi6Dfe.js} +1 -1
  171. package/dist/client/assets/{scroll-area-C_cHkZF7.js → scroll-area-shLIOrXE.js} +1 -1
  172. package/dist/client/assets/{search-input-J6NuIFHz.js → search-input-DTZZQgYe.js} +1 -1
  173. package/dist/client/assets/{secrets-c7Jrvv5H.js → secrets-6Y-p69m4.js} +1 -1
  174. package/dist/client/assets/{sections-editor-BCTdCZec.js → sections-editor-BMl5PAY7.js} +1 -1
  175. package/dist/client/assets/{select-vFCmbR33.js → select-DtIUmOWr.js} +1 -1
  176. package/dist/client/assets/{select-model-Dj7N0cyA.js → select-model-DXeyWR4L.js} +1 -1
  177. package/dist/client/assets/{self-tool-result-CeMjOtPq.js → self-tool-result-D5oDSMGv.js} +1 -1
  178. package/dist/client/assets/{seo-editor-C_NbHFip.js → seo-editor-uek53oSS.js} +1 -1
  179. package/dist/client/assets/settings-layout-COwYZpQX.js +1 -0
  180. package/dist/client/assets/settings-sidebar-tiZ-qpIN.js +1 -0
  181. package/dist/client/assets/{shell-controls-BmYdBLDp.js → shell-controls-Bju_X5xx.js} +1 -1
  182. package/dist/client/assets/{shell-layout-CRQj4_aW.js → shell-layout-DcJ2OL9P.js} +1 -1
  183. package/dist/client/assets/{skill-preview-BYjF0_Nr.js → skill-preview-CWU61utM.js} +1 -1
  184. package/dist/client/assets/{skills-J3_FU-Fk.js → skills-BbqmEZC_.js} +1 -1
  185. package/dist/client/assets/{sso-BNKikXI1.js → sso-Dmu8oInz.js} +1 -1
  186. package/dist/client/assets/{store-5cPEEs-4.js → store-B3gDaZAM.js} +1 -1
  187. package/dist/client/assets/store-registry-BkdPJ-P1.js +2 -0
  188. package/dist/client/assets/{switch-T5LrSBrw.js → switch--5EfNQI5.js} +1 -1
  189. package/dist/client/assets/{synced-repos-BfOZXh6-.js → synced-repos-CukpYenC.js} +1 -1
  190. package/dist/client/assets/{table-CHKwG1gN.js → table-DyTYCFjs.js} +1 -1
  191. package/dist/client/assets/{tabs-CdOMDht3.js → tabs-C40AAyFe.js} +1 -1
  192. package/dist/client/assets/{task-board-CQ-3ZPwA.js → task-board-DOll2CPC.js} +1 -1
  193. package/dist/client/assets/{task-route-D37LOthe.js → task-route-DOwSG1cM.js} +1 -1
  194. package/dist/client/assets/{tasks-0aJV4DxN.js → tasks--1FIMuSH.js} +1 -1
  195. package/dist/client/assets/{textarea-DPeZ6xxO.js → textarea-BqKXwvHp.js} +1 -1
  196. package/dist/client/assets/{thread-intent-CcWHzfkw.js → thread-intent-BGpE5f0m.js} +1 -1
  197. package/dist/client/assets/{thread-route-B8U1rz53.js → thread-route-Dnvi0Gyz.js} +1 -1
  198. package/dist/client/assets/{toggle-group-C2G8ll2X.js → toggle-group-Bg9UxZnH.js} +1 -1
  199. package/dist/client/assets/{toolbar-DvObSBys.js → toolbar-Dov4ap4F.js} +1 -1
  200. package/dist/client/assets/{toolbar-icon-button-lmaFup2h.js → toolbar-icon-button-DNTK2U9T.js} +1 -1
  201. package/dist/client/assets/{track-CimVJAlT.js → track-DSv-HBp2.js} +1 -1
  202. package/dist/client/assets/{types-DdSDF2P_.js → types-QSIn08FY.js} +1 -1
  203. package/dist/client/assets/{use-ai-providers-BIIefz3U.js → use-ai-providers-TPGH2tOh.js} +1 -1
  204. package/dist/client/assets/{use-automations-CVjhC86A.js → use-automations-Cht-yWCv.js} +1 -1
  205. package/dist/client/assets/{use-autosave-B-pvSoqg.js → use-autosave-B90W2GZU.js} +1 -1
  206. package/dist/client/assets/{use-connection-C0PxJ5SV.js → use-connection-CTdE4vps.js} +1 -1
  207. package/dist/client/assets/{use-copy-c3VKc4aO.js → use-copy-rWugYGnz.js} +1 -1
  208. package/dist/client/assets/{use-create-virtual-mcp-Bkb-dPNa.js → use-create-virtual-mcp-DA3Yl-aU.js} +1 -1
  209. package/dist/client/assets/{use-debounced-autosave-B7pm8_yo.js → use-debounced-autosave-B8o54x5H.js} +1 -1
  210. package/dist/client/assets/{use-debounced-value-D4xMKhQx.js → use-debounced-value--9PTnjO2.js} +1 -1
  211. package/dist/client/assets/{use-decopilot-events-Dy9qX9Gr.js → use-decopilot-events-R7r7gJde.js} +1 -1
  212. package/dist/client/assets/{use-delete-connection-CWcunwsJ.js → use-delete-connection-P0qKIKu9.js} +1 -1
  213. package/dist/client/assets/{use-deployment-admin-_kPMz7Lq.js → use-deployment-admin-BPw4zd_K.js} +1 -1
  214. package/dist/client/assets/{use-destination-route-GypAYhp8.js → use-destination-route-Yiz1Yyiq.js} +1 -1
  215. package/dist/client/assets/{use-file-configs-CAGnWxDH.js → use-file-configs-LRMUkmhG.js} +1 -1
  216. package/dist/client/assets/{use-infinite-scroll-CmJNRT41.js → use-infinite-scroll-vUX1oplI.js} +1 -1
  217. package/dist/client/assets/{use-join-requests-Ck6Ncm4p.js → use-join-requests-C8VI7j2w.js} +1 -1
  218. package/dist/client/assets/{use-mcp-auth-status-Bb8E9QEq.js → use-mcp-auth-status-3Q04dybz.js} +1 -1
  219. package/dist/client/assets/{use-mcp-client-DbyyfwFL.js → use-mcp-client-B8KExIQP.js} +1 -1
  220. package/dist/client/assets/{use-mcp-prompts-CsSNH5CL.js → use-mcp-prompts-DqFxtfai.js} +1 -1
  221. package/dist/client/assets/{use-members-Bjha068Y.js → use-members-BHp3tATO.js} +1 -1
  222. package/dist/client/assets/{use-navigate-to-agent-C0f7F1ii.js → use-navigate-to-agent-CUlgd9lK.js} +1 -1
  223. package/dist/client/assets/{use-org-auth-client-BigyyemQ.js → use-org-auth-client-CgYm4ea4.js} +1 -1
  224. package/dist/client/assets/{use-org-notice-P1qnXHWT.js → use-org-notice-C5n8woPc.js} +1 -1
  225. package/dist/client/assets/{use-org-sso-CAY5lnB6.js → use-org-sso-CeKGwleH.js} +1 -1
  226. package/dist/client/assets/{use-organization-roles-C6_B89sW.js → use-organization-roles-DF5taRAS.js} +1 -1
  227. package/dist/client/assets/{use-organization-settings-CYKZsssD.js → use-organization-settings-xhFeNBEl.js} +1 -1
  228. package/dist/client/assets/{use-panel-navigate-DhHRD0vs.js → use-panel-navigate-s8WzziEf.js} +1 -1
  229. package/dist/client/assets/{use-registry-connections-B5BQuLSP.js → use-registry-connections-QYmYiae-.js} +1 -1
  230. package/dist/client/assets/{use-secrets-CKxZifey.js → use-secrets-CiP4DqpE.js} +1 -1
  231. package/dist/client/assets/{use-section-preview-base-C_KIWBbX.js → use-section-preview-base-BJUC-5QY.js} +1 -1
  232. package/dist/client/assets/{use-status-sounds-BYP0fHF7.js → use-status-sounds-Bx6EMZ1N.js} +1 -1
  233. package/dist/client/assets/{use-tags-heuT8B5T.js → use-tags-CU0743CE.js} +1 -1
  234. package/dist/client/assets/{use-view-mode-1L7Auq80.js → use-view-mode-D9GxxTRm.js} +1 -1
  235. package/dist/client/assets/{use-virtual-mcp-Cz_si5KP.js → use-virtual-mcp-WZp5R4vZ.js} +1 -1
  236. package/dist/client/assets/useInfiniteQuery-C6i4yfVE.js +1 -0
  237. package/dist/client/assets/useSuspenseInfiniteQuery-CCla4NuB.js +1 -0
  238. package/dist/client/assets/{users-DzAipJ2h.js → users-CmUeSgSj.js} +1 -1
  239. package/dist/client/assets/{variant-calendar-OCDzsbSq.js → variant-calendar-Berln5Bi.js} +1 -1
  240. package/dist/client/assets/{view-mode-toggle-CCcVUJ4z.js → view-mode-toggle-CAwCj5Nl.js} +1 -1
  241. package/dist/client/index.html +1 -1
  242. package/dist/server/cli.js +1 -1
  243. package/dist/server/server.js +1 -1
  244. package/package.json +1 -1
  245. package/dist/client/assets/api-keys-DleEuEE3.js +0 -1
  246. package/dist/client/assets/app-editor-DX0Q8L_M.js +0 -1
  247. package/dist/client/assets/differenceInSeconds-NQ4PDo0z.js +0 -1
  248. package/dist/client/assets/index-Cte8O9kW.js +0 -823
  249. package/dist/client/assets/pt-BR-CLy76QW2.js +0 -1
  250. package/dist/client/assets/record-editor-q6xGGJdo.js +0 -1
  251. package/dist/client/assets/redirect-editor-DEiKow0E.js +0 -1
  252. package/dist/client/assets/registry-D6HHrCD_.js +0 -2
  253. package/dist/client/assets/settings-layout-C9VX-BJG.js +0 -1
  254. package/dist/client/assets/settings-sidebar-BK9LTxfw.js +0 -1
  255. package/dist/client/assets/store-registry-C4Ow0plu.js +0 -2
  256. package/dist/client/assets/useInfiniteQuery-C47LPQTE.js +0 -1
  257. package/dist/client/assets/useSuspenseInfiniteQuery-DtPmDJxo.js +0 -1
@@ -1 +1 @@
1
- import{u as R}from"./use-org-auth-client-BigyyemQ.js";import{G as b,m as P,K as y}from"./index-weBGyocH.js";const w=[{value:"owner",label:"Owner",isBuiltin:!0},{value:"admin",label:"Admin",isBuiltin:!0},{value:"user",label:"User",isBuiltin:!0}];function B(t){return t.replace(/-/g," ").replace(/\b\w/g,n=>n.toUpperCase())}function O(t){if(!t)return{staticPermissions:[],allowsAllStaticPermissions:!1,connectionIds:[],allowsAllConnections:!1,toolNames:[],allowsAllTools:!1,modelCount:0,allowsAllModels:!1};const n=[];let i=!1;const u=[];let c=!1;const a=new Set;let s=!1,f=0,e=!1;for(const[l,o]of Object.entries(t)){if(l==="self"){o.includes("*")?i=!0:n.push(...o);continue}if(l==="models"){o.includes("*:*")?e=!0:f=o.length;continue}if(l==="*"){if(c=!0,o.includes("*"))s=!0;else for(const r of o)a.add(r);continue}if(u.push(l),o.includes("*"))s=!0;else for(const r of o)a.add(r)}return{staticPermissions:n,allowsAllStaticPermissions:i,connectionIds:u,allowsAllConnections:c,toolNames:Array.from(a),allowsAllTools:s,modelCount:f,allowsAllModels:e}}function I(){const{locator:t}=b(),n=R(),{data:i,isLoading:u,error:c,refetch:a}=P({queryKey:y.organizationRoles(t),queryFn:async()=>{try{const e=await n.organization.listRoles();return e?.error?(console.error("[useOrganizationRoles] API error:",e.error),[]):e?.data??[]}catch(e){return console.error("[useOrganizationRoles] Fetch error:",e),[]}},staleTime:3e4}),s=w.map(e=>({role:e.value,label:e.label,isBuiltin:e.isBuiltin}));if(i&&Array.isArray(i))for(const e of i){const l=e.role;if(!l||w.some(h=>h.value===l))continue;const{staticPermissions:o,allowsAllStaticPermissions:r,connectionIds:g,allowsAllConnections:m,toolNames:p,allowsAllTools:d,modelCount:C,allowsAllModels:A}=O(e.permission);s.push({id:e.id,role:l,label:B(l),isBuiltin:!1,permission:e.permission??void 0,staticPermissionCount:r?-1:o.length,allowsAllStaticPermissions:r,connectionCount:m?-1:g.length,allowsAllConnections:m,toolCount:d?-1:p.length,allowsAllTools:d,modelCount:A?-1:C,allowsAllModels:A})}const f=s.filter(e=>!e.isBuiltin);return{roles:s,customRoles:f,builtinRoles:s.filter(e=>e.isBuiltin),isLoading:u,error:c,refetch:a}}export{I as u};
1
+ import{u as R}from"./use-org-auth-client-CgYm4ea4.js";import{G as b,m as P,K as y}from"./index-BYFW0DhO.js";const w=[{value:"owner",label:"Owner",isBuiltin:!0},{value:"admin",label:"Admin",isBuiltin:!0},{value:"user",label:"User",isBuiltin:!0}];function B(t){return t.replace(/-/g," ").replace(/\b\w/g,n=>n.toUpperCase())}function O(t){if(!t)return{staticPermissions:[],allowsAllStaticPermissions:!1,connectionIds:[],allowsAllConnections:!1,toolNames:[],allowsAllTools:!1,modelCount:0,allowsAllModels:!1};const n=[];let i=!1;const u=[];let c=!1;const a=new Set;let s=!1,f=0,e=!1;for(const[l,o]of Object.entries(t)){if(l==="self"){o.includes("*")?i=!0:n.push(...o);continue}if(l==="models"){o.includes("*:*")?e=!0:f=o.length;continue}if(l==="*"){if(c=!0,o.includes("*"))s=!0;else for(const r of o)a.add(r);continue}if(u.push(l),o.includes("*"))s=!0;else for(const r of o)a.add(r)}return{staticPermissions:n,allowsAllStaticPermissions:i,connectionIds:u,allowsAllConnections:c,toolNames:Array.from(a),allowsAllTools:s,modelCount:f,allowsAllModels:e}}function I(){const{locator:t}=b(),n=R(),{data:i,isLoading:u,error:c,refetch:a}=P({queryKey:y.organizationRoles(t),queryFn:async()=>{try{const e=await n.organization.listRoles();return e?.error?(console.error("[useOrganizationRoles] API error:",e.error),[]):e?.data??[]}catch(e){return console.error("[useOrganizationRoles] Fetch error:",e),[]}},staleTime:3e4}),s=w.map(e=>({role:e.value,label:e.label,isBuiltin:e.isBuiltin}));if(i&&Array.isArray(i))for(const e of i){const l=e.role;if(!l||w.some(h=>h.value===l))continue;const{staticPermissions:o,allowsAllStaticPermissions:r,connectionIds:g,allowsAllConnections:m,toolNames:p,allowsAllTools:d,modelCount:C,allowsAllModels:A}=O(e.permission);s.push({id:e.id,role:l,label:B(l),isBuiltin:!1,permission:e.permission??void 0,staticPermissionCount:r?-1:o.length,allowsAllStaticPermissions:r,connectionCount:m?-1:g.length,allowsAllConnections:m,toolCount:d?-1:p.length,allowsAllTools:d,modelCount:A?-1:C,allowsAllModels:A})}const f=s.filter(e=>!e.isBuiltin);return{roles:s,customRoles:f,builtinRoles:s.filter(e=>e.isBuiltin),isLoading:u,error:c,refetch:a}}export{I as u};
@@ -1 +1 @@
1
- import{a as h,c as l,G as p,m as E,bE as R,K as T,bu as w,a7 as M,n as N,e as F}from"./index-weBGyocH.js";import{W as P}from"./constants-BRGHAWVM.js";import{D as z,o as $,a as D}from"./schema-CMNTDy4A.js";import{r as U}from"./task-board-CQ-3ZPwA.js";const b={organizationId:"",sidebar_items:null,enabled_plugins:null,registry_config:null,simple_mode:null,default_home_agents:null,flags:null},A={tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}};function O(t,e){return{queryKey:T.organizationSettings(e),queryFn:async()=>{try{return await R(t,"ORGANIZATION_SETTINGS_GET",{})}catch{return{...b,organizationId:e}}},staleTime:6e4}}function f(t){const e=l.c(6),{org:n}=p();let s;e[0]!==n.id||e[1]!==n.slug?(s=O(n.slug,n.id),e[0]=n.id,e[1]=n.slug,e[2]=s):s=e[2];const o=t;let i;return e[3]!==s||e[4]!==o?(i={...s,select:o},e[3]=s,e[4]=o,e[5]=i):i=e[5],E(i)}function j(t,e){const n=l.c(3);let s;n[0]!==t||n[1]!==e?(s=O(e,t),n[0]=t,n[1]=e,n[2]=s):s=n[2];const{data:o}=E(s);return o??null}function S(){const t=l.c(9),{org:e}=p(),n=M(),s=N();let o;t[0]!==e||t[1]!==n?(o=async r=>{const u=await n.call("ORGANIZATION_SETTINGS_UPDATE",{organizationId:e.id,...r});if(!u)throw new Error("ORGANIZATION_SETTINGS_UPDATE returned no payload");return u},t[0]=e,t[1]=n,t[2]=o):o=t[2];let i;t[3]!==e||t[4]!==s?(i=r=>{s.setQueryData(T.organizationSettings(e.id),u=>({...u??b,...r}))},t[3]=e,t[4]=s,t[5]=i):i=t[5];let a;return t[6]!==o||t[7]!==i?(a={mutationFn:o,onSuccess:i},t[6]=o,t[7]=i,t[8]=a):a=t[8],F(a)}function k(t){return t?.tiers?{tiers:{fast:t.tiers.fast??null,smart:t.tiers.smart??null,thinking:t.tiers.thinking??null,image:t.tiers.image??null,web_search:t.tiers.web_search??null,deep_research:t.tiers.deep_research??null}}:A}function B(){const{data:t}=f(L);return t??A}function L(t){return k(t.simple_mode)}function V(){const t=l.c(7),e=S();let n,s;t[0]!==e?(n=(i,a)=>e.mutate({simple_mode:i},a),s=(i,a)=>e.mutateAsync({simple_mode:i},a),t[0]=e,t[1]=n,t[2]=s):(n=t[1],s=t[2]);let o;return t[3]!==e||t[4]!==n||t[5]!==s?(o={...e,mutate:n,mutateAsync:s},t[3]=e,t[4]=n,t[5]=s,t[6]=o):o=t[6],o}function H(){return c("reports_only")}function c(t){const e=l.c(5);let n;e[0]!==t?(n=i=>$(i.flags,t),e[0]=t,e[1]=n):n=e[1];const{data:s}=f(n);let o;return e[2]!==s||e[3]!==t?(o=s??z.has(t),e[2]=s,e[3]=t,e[4]=o):o=e[4],o}function G(t){return!!t&&t.trim().toLowerCase().endsWith("@deco.cx")}function J(){const{data:t}=h.useSession();return G(t?.user?.email)}function X(){const t=l.c(8),{data:e}=h.useSession(),n=w();let s;t[0]!==n.auth.localMode||t[1]!==e?.user?.email?(s=n.auth.localMode===!0||G(e?.user?.email),t[0]=n.auth.localMode,t[1]=e?.user?.email,t[2]=s):s=t[2];const o=s,i=n.hostingControlPlaneGa===!0,a=n.monitorGa===!0,r=c("hosting_enabled"),u=c("deco_analytics_enabled"),C=c("e2e_enabled"),I=c("monitor_enabled"),d=o||i||r,g=o||i||u,_=o||i||C,y=o||a||I;let m;return t[3]!==d||t[4]!==g||t[5]!==_||t[6]!==y?(m={hosting:d,analytics:g,e2e:_,monitor:y},t[3]=d,t[4]=g,t[5]=_,t[6]=y,t[7]=m):m=t[7],m}function tt(){const{data:t}=f(v);return t??!1}function v(t){return D(t.flags)}function et(){const{data:t}=f(x);return t??!0}function x(t){return U(t.flags)}function nt(){const t=l.c(7),e=S();let n,s;t[0]!==e?(n=(i,a,r)=>e.mutate({flags:{[i]:a}},r),s=(i,a,r)=>e.mutateAsync({flags:{[i]:a}},r),t[0]=e,t[1]=n,t[2]=s):(n=t[1],s=t[2]);let o;return t[3]!==e||t[4]!==n||t[5]!==s?(o={...e,mutate:n,mutateAsync:s},t[3]=e,t[4]=n,t[5]=s,t[6]=o):o=t[6],o}function K(){const{data:t}=f(Q);return t??null}function Q(t){return t.registry_config}function st(){const t=l.c(7),e=S();let n,s;t[0]!==e?(n=(i,a)=>e.mutate({registry_config:i},a),s=(i,a)=>e.mutateAsync({registry_config:i},a),t[0]=e,t[1]=n,t[2]=s):(n=t[1],s=t[2]);let o;return t[3]!==e||t[4]!==n||t[5]!==s?(o={...e,mutate:n,mutateAsync:s},t[3]=e,t[4]=n,t[5]=s,t[6]=o):o=t[6],o}function ot(){const t=l.c(5),{org:e}=p(),n=K();let s;t[0]!==e.id?(s=P.REGISTRY(e.id),t[0]=e.id,t[1]=s):s=t[1];const o=s;let i;return t[2]!==o||t[3]!==n?(i=a=>{if(!n)return a===o;const r=n.registries[a];return r?r.enabled:a===o},t[2]=o,t[3]=n,t[4]=i):i=t[4],i}export{H as a,B as b,et as c,X as d,ot as e,j as f,V as g,K as h,tt as i,nt as j,st as k,J as l,c as u};
1
+ import{a as h,c as l,G as p,m as E,bE as R,K as T,bu as w,a7 as M,n as N,e as F}from"./index-BYFW0DhO.js";import{W as P}from"./constants-BRGHAWVM.js";import{D as z,o as $,a as D}from"./schema-UMHi6Dfe.js";import{r as U}from"./task-board-DOll2CPC.js";const b={organizationId:"",sidebar_items:null,enabled_plugins:null,registry_config:null,simple_mode:null,default_home_agents:null,flags:null},A={tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}};function O(t,e){return{queryKey:T.organizationSettings(e),queryFn:async()=>{try{return await R(t,"ORGANIZATION_SETTINGS_GET",{})}catch{return{...b,organizationId:e}}},staleTime:6e4}}function f(t){const e=l.c(6),{org:n}=p();let s;e[0]!==n.id||e[1]!==n.slug?(s=O(n.slug,n.id),e[0]=n.id,e[1]=n.slug,e[2]=s):s=e[2];const o=t;let i;return e[3]!==s||e[4]!==o?(i={...s,select:o},e[3]=s,e[4]=o,e[5]=i):i=e[5],E(i)}function j(t,e){const n=l.c(3);let s;n[0]!==t||n[1]!==e?(s=O(e,t),n[0]=t,n[1]=e,n[2]=s):s=n[2];const{data:o}=E(s);return o??null}function S(){const t=l.c(9),{org:e}=p(),n=M(),s=N();let o;t[0]!==e||t[1]!==n?(o=async r=>{const u=await n.call("ORGANIZATION_SETTINGS_UPDATE",{organizationId:e.id,...r});if(!u)throw new Error("ORGANIZATION_SETTINGS_UPDATE returned no payload");return u},t[0]=e,t[1]=n,t[2]=o):o=t[2];let i;t[3]!==e||t[4]!==s?(i=r=>{s.setQueryData(T.organizationSettings(e.id),u=>({...u??b,...r}))},t[3]=e,t[4]=s,t[5]=i):i=t[5];let a;return t[6]!==o||t[7]!==i?(a={mutationFn:o,onSuccess:i},t[6]=o,t[7]=i,t[8]=a):a=t[8],F(a)}function k(t){return t?.tiers?{tiers:{fast:t.tiers.fast??null,smart:t.tiers.smart??null,thinking:t.tiers.thinking??null,image:t.tiers.image??null,web_search:t.tiers.web_search??null,deep_research:t.tiers.deep_research??null}}:A}function B(){const{data:t}=f(L);return t??A}function L(t){return k(t.simple_mode)}function V(){const t=l.c(7),e=S();let n,s;t[0]!==e?(n=(i,a)=>e.mutate({simple_mode:i},a),s=(i,a)=>e.mutateAsync({simple_mode:i},a),t[0]=e,t[1]=n,t[2]=s):(n=t[1],s=t[2]);let o;return t[3]!==e||t[4]!==n||t[5]!==s?(o={...e,mutate:n,mutateAsync:s},t[3]=e,t[4]=n,t[5]=s,t[6]=o):o=t[6],o}function H(){return c("reports_only")}function c(t){const e=l.c(5);let n;e[0]!==t?(n=i=>$(i.flags,t),e[0]=t,e[1]=n):n=e[1];const{data:s}=f(n);let o;return e[2]!==s||e[3]!==t?(o=s??z.has(t),e[2]=s,e[3]=t,e[4]=o):o=e[4],o}function G(t){return!!t&&t.trim().toLowerCase().endsWith("@deco.cx")}function J(){const{data:t}=h.useSession();return G(t?.user?.email)}function X(){const t=l.c(8),{data:e}=h.useSession(),n=w();let s;t[0]!==n.auth.localMode||t[1]!==e?.user?.email?(s=n.auth.localMode===!0||G(e?.user?.email),t[0]=n.auth.localMode,t[1]=e?.user?.email,t[2]=s):s=t[2];const o=s,i=n.hostingControlPlaneGa===!0,a=n.monitorGa===!0,r=c("hosting_enabled"),u=c("deco_analytics_enabled"),C=c("e2e_enabled"),I=c("monitor_enabled"),d=o||i||r,g=o||i||u,_=o||i||C,y=o||a||I;let m;return t[3]!==d||t[4]!==g||t[5]!==_||t[6]!==y?(m={hosting:d,analytics:g,e2e:_,monitor:y},t[3]=d,t[4]=g,t[5]=_,t[6]=y,t[7]=m):m=t[7],m}function tt(){const{data:t}=f(v);return t??!1}function v(t){return D(t.flags)}function et(){const{data:t}=f(x);return t??!0}function x(t){return U(t.flags)}function nt(){const t=l.c(7),e=S();let n,s;t[0]!==e?(n=(i,a,r)=>e.mutate({flags:{[i]:a}},r),s=(i,a,r)=>e.mutateAsync({flags:{[i]:a}},r),t[0]=e,t[1]=n,t[2]=s):(n=t[1],s=t[2]);let o;return t[3]!==e||t[4]!==n||t[5]!==s?(o={...e,mutate:n,mutateAsync:s},t[3]=e,t[4]=n,t[5]=s,t[6]=o):o=t[6],o}function K(){const{data:t}=f(Q);return t??null}function Q(t){return t.registry_config}function st(){const t=l.c(7),e=S();let n,s;t[0]!==e?(n=(i,a)=>e.mutate({registry_config:i},a),s=(i,a)=>e.mutateAsync({registry_config:i},a),t[0]=e,t[1]=n,t[2]=s):(n=t[1],s=t[2]);let o;return t[3]!==e||t[4]!==n||t[5]!==s?(o={...e,mutate:n,mutateAsync:s},t[3]=e,t[4]=n,t[5]=s,t[6]=o):o=t[6],o}function ot(){const t=l.c(5),{org:e}=p(),n=K();let s;t[0]!==e.id?(s=P.REGISTRY(e.id),t[0]=e.id,t[1]=s):s=t[1];const o=s;let i;return t[2]!==o||t[3]!==n?(i=a=>{if(!n)return a===o;const r=n.registries[a];return r?r.enabled:a===o},t[2]=o,t[3]=n,t[4]=i):i=t[4],i}export{H as a,B as b,et as c,X as d,ot as e,j as f,V as g,K as h,tt as i,nt as j,st as k,J as l,c as u};
@@ -1 +1 @@
1
- import{c as g,k as E,f as R,u as N,eM as k,d as x,y as O,eN as $,aS as M}from"./index-weBGyocH.js";import{u as L,D as l}from"./use-destination-route-GypAYhp8.js";function F(){const e=g.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t={select:U},e[0]=t):t=e[0],E(t)}function U(e){for(let t=e.matches.length-1;t>=0;t--){const a=e.matches[t]?.staticData.defaultMain;if(a)return a}return null}const j={board:l.tasks,files:l.library,reports:l.reports,overview:l.home,discover:l.discover};function w(){const e=g.c(5);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const a=R(t);let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},e[1]=r):r=e[1];const s=N(r);let n;return e[2]!==a.panel||e[3]!==s?(n=k(a.panel,s),e[2]=a.panel,e[3]=s,e[4]=n):n=e[4],n}function Y(e){const t=g.c(6),a=w(),r=F();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},t[0]=s):s=t[0];const n=N(s);let c;return t[1]!==e||t[2]!==a||t[3]!==r||t[4]!==n.mainpanel?(c=M({panelTabId:a,mainPanelParam:n.mainpanel,routeDefaultMain:r,metadata:e}),t[1]=e,t[2]=a,t[3]=r,t[4]=n.mainpanel,t[5]=c):c=t[5],c.activeTab}function q(){const e=g.c(15),t=x();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[0]=a):a=e[0];const r=R(a);let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},e[1]=s):s=e[1];const n=N(s).virtualmcpid,c=r.org??"",S=L()===l.agents,d=r.taskId;let h;e[2]!==d?(h=(m,u,o)=>f=>{const i=u?{...f}:{thread:f.thread,sidepanel:f.sidepanel};return d&&(i.thread=d),{...o?.search?o.search(i):i,...m,mainpanel:void 0}},e[2]=d,e[3]=h):h=e[3];const T=h;let b;e[4]!==n||e[5]!==t||e[6]!==T||e[7]!==S||e[8]!==c?(b=(m,u)=>{const{panel:o,payload:f}=O(m),i=u?.replace??!0,I=!!o&&$(o),D=T(f,S&&!I,u);if(o&&I){const p=j[o];if(p===l.tasks){t({to:p,params:{org:c,taskKey:void 0},search:D,replace:i});return}t({to:p,params:{org:c},search:D,replace:i});return}const A=u?.virtualmcpid??n;t({to:l.agents,params:{org:c,panel:o},search:p=>({...D(p),virtualmcpid:A}),replace:i})},e[4]=n,e[5]=t,e[6]=T,e[7]=S,e[8]=c,e[9]=b):b=e[9];const P=b;let _;e[10]!==t?(_=m=>t({to:".",search:B,replace:m?.replace??!0}),e[10]=t,e[11]=_):_=e[11];const y=_;let v;return e[12]!==y||e[13]!==P?(v={openPanel:P,closePanel:y},e[12]=y,e[13]=P,e[14]=v):v=e[14],v}function B(e){return{...e,mainpanel:!1}}export{q as a,F as b,Y as c,w as u};
1
+ import{c as g,k as E,f as R,u as N,eM as k,d as x,y as O,eN as $,aS as M}from"./index-BYFW0DhO.js";import{u as L,D as l}from"./use-destination-route-Yiz1Yyiq.js";function F(){const e=g.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t={select:U},e[0]=t):t=e[0],E(t)}function U(e){for(let t=e.matches.length-1;t>=0;t--){const a=e.matches[t]?.staticData.defaultMain;if(a)return a}return null}const j={board:l.tasks,files:l.library,reports:l.reports,overview:l.home,discover:l.discover};function w(){const e=g.c(5);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const a=R(t);let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},e[1]=r):r=e[1];const s=N(r);let n;return e[2]!==a.panel||e[3]!==s?(n=k(a.panel,s),e[2]=a.panel,e[3]=s,e[4]=n):n=e[4],n}function Y(e){const t=g.c(6),a=w(),r=F();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},t[0]=s):s=t[0];const n=N(s);let c;return t[1]!==e||t[2]!==a||t[3]!==r||t[4]!==n.mainpanel?(c=M({panelTabId:a,mainPanelParam:n.mainpanel,routeDefaultMain:r,metadata:e}),t[1]=e,t[2]=a,t[3]=r,t[4]=n.mainpanel,t[5]=c):c=t[5],c.activeTab}function q(){const e=g.c(15),t=x();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[0]=a):a=e[0];const r=R(a);let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},e[1]=s):s=e[1];const n=N(s).virtualmcpid,c=r.org??"",S=L()===l.agents,d=r.taskId;let h;e[2]!==d?(h=(m,u,o)=>f=>{const i=u?{...f}:{thread:f.thread,sidepanel:f.sidepanel};return d&&(i.thread=d),{...o?.search?o.search(i):i,...m,mainpanel:void 0}},e[2]=d,e[3]=h):h=e[3];const T=h;let b;e[4]!==n||e[5]!==t||e[6]!==T||e[7]!==S||e[8]!==c?(b=(m,u)=>{const{panel:o,payload:f}=O(m),i=u?.replace??!0,I=!!o&&$(o),D=T(f,S&&!I,u);if(o&&I){const p=j[o];if(p===l.tasks){t({to:p,params:{org:c,taskKey:void 0},search:D,replace:i});return}t({to:p,params:{org:c},search:D,replace:i});return}const A=u?.virtualmcpid??n;t({to:l.agents,params:{org:c,panel:o},search:p=>({...D(p),virtualmcpid:A}),replace:i})},e[4]=n,e[5]=t,e[6]=T,e[7]=S,e[8]=c,e[9]=b):b=e[9];const P=b;let _;e[10]!==t?(_=m=>t({to:".",search:B,replace:m?.replace??!0}),e[10]=t,e[11]=_):_=e[11];const y=_;let v;return e[12]!==y||e[13]!==P?(v={openPanel:P,closePanel:y},e[12]=y,e[13]=P,e[14]=v):v=e[14],v}function B(e){return{...e,mainpanel:!1}}export{q as a,F as b,Y as c,w as u};
@@ -1 +1 @@
1
- import{c as C,G as R}from"./index-weBGyocH.js";import{u as p}from"./use-connection-C0PxJ5SV.js";import{W as a}from"./constants-BRGHAWVM.js";import{h as y}from"./use-organization-settings-CYKZsssD.js";function G(){const e=C.c(19),{org:i}=R(),o=y();let l;e[0]!==i.id?(l=a.REGISTRY(i.id),e[0]=i.id,e[1]=l):l=e[1];const d=l;let f;e[2]!==i.id?(f=a.COMMUNITY_REGISTRY(i.id),e[2]=i.id,e[3]=f):f=e[3];const g=f;let r;e[4]!==g||e[5]!==d?(r=[d,g],e[4]=g,e[5]=d,e[6]=r):r=e[6];let t;if(e[7]!==o||e[8]!==r){if(t=new Set(r),o?.registries){let s;e[10]!==o.registries?(s=Object.keys(o.registries),e[10]=o.registries,e[11]=s):s=e[11];for(const u of s)t.add(u)}e[7]=o,e[8]=r,e[9]=t}else t=e[9];const m=p();let n;e[12]!==m?(n=m??[],e[12]=m,e[13]=n):n=e[13];let c;if(e[14]!==t||e[15]!==n){let s;e[17]!==t?(s=u=>t.has(u.id),e[17]=t,e[18]=s):s=e[18],c=n.filter(s),e[14]=t,e[15]=n,e[16]=c}else c=e[16];return c}export{G as u};
1
+ import{c as C,G as R}from"./index-BYFW0DhO.js";import{u as p}from"./use-connection-CTdE4vps.js";import{W as a}from"./constants-BRGHAWVM.js";import{h as y}from"./use-organization-settings-xhFeNBEl.js";function G(){const e=C.c(19),{org:i}=R(),o=y();let l;e[0]!==i.id?(l=a.REGISTRY(i.id),e[0]=i.id,e[1]=l):l=e[1];const d=l;let f;e[2]!==i.id?(f=a.COMMUNITY_REGISTRY(i.id),e[2]=i.id,e[3]=f):f=e[3];const g=f;let r;e[4]!==g||e[5]!==d?(r=[d,g],e[4]=g,e[5]=d,e[6]=r):r=e[6];let t;if(e[7]!==o||e[8]!==r){if(t=new Set(r),o?.registries){let s;e[10]!==o.registries?(s=Object.keys(o.registries),e[10]=o.registries,e[11]=s):s=e[11];for(const u of s)t.add(u)}e[7]=o,e[8]=r,e[9]=t}else t=e[9];const m=p();let n;e[12]!==m?(n=m??[],e[12]=m,e[13]=n):n=e[13];let c;if(e[14]!==t||e[15]!==n){let s;e[17]!==t?(s=u=>t.has(u.id),e[17]=t,e[18]=s):s=e[18],c=n.filter(s),e[14]=t,e[15]=n,e[16]=c}else c=e[16];return c}export{G as u};
@@ -1 +1 @@
1
- import{c as u,G as c,a7 as r,K as l,x as d,n as f,e as S}from"./index-weBGyocH.js";function C(){const e=u.c(7),{org:n}=c(),a=r();let i;e[0]!==n.id?(i=l.secrets(n.id),e[0]=n.id,e[1]=i):i=e[1];let t;e[2]!==a?(t=async()=>await a.call("SECRET_LIST",{}),e[2]=a,e[3]=t):t=e[3];let s;e[4]!==i||e[5]!==t?(s={queryKey:i,staleTime:6e4,queryFn:t},e[4]=i,e[5]=t,e[6]=s):s=e[6];const{data:o}=d(s);return o.secrets}function m(){const e=u.c(8),{org:n}=c(),a=r(),i=f();let t;e[0]!==a?(t=async y=>await a.call("SECRET_CREATE",{...y}),e[0]=a,e[1]=t):t=e[1];let s;e[2]!==n||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:l.secrets(n.id)})},e[2]=n,e[3]=i,e[4]=s):s=e[4];let o;return e[5]!==t||e[6]!==s?(o={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=o):o=e[7],S(o)}export{m as a,C as u};
1
+ import{c as u,G as c,a7 as r,K as l,x as d,n as f,e as S}from"./index-BYFW0DhO.js";function C(){const e=u.c(7),{org:n}=c(),a=r();let i;e[0]!==n.id?(i=l.secrets(n.id),e[0]=n.id,e[1]=i):i=e[1];let t;e[2]!==a?(t=async()=>await a.call("SECRET_LIST",{}),e[2]=a,e[3]=t):t=e[3];let s;e[4]!==i||e[5]!==t?(s={queryKey:i,staleTime:6e4,queryFn:t},e[4]=i,e[5]=t,e[6]=s):s=e[6];const{data:o}=d(s);return o.secrets}function m(){const e=u.c(8),{org:n}=c(),a=r(),i=f();let t;e[0]!==a?(t=async y=>await a.call("SECRET_CREATE",{...y}),e[0]=a,e[1]=t):t=e[1];let s;e[2]!==n||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:l.secrets(n.id)})},e[2]=n,e[3]=i,e[4]=s):s=e[4];let o;return e[5]!==t||e[6]!==s?(o={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=o):o=e[7],S(o)}export{m as a,C as u};
@@ -1 +1 @@
1
- import{c as q,b as K,r as w,j as s,l as Q}from"./index-weBGyocH.js";import{ah as _}from"./agent-icon-BRoPbkxd.js";import{i as Y}from"./SearchMd-ryPT7rxv.js";import{D as Z,b as ee,d as te,c as se}from"./dialog-CqKyQDlv.js";import{I as re}from"./input-CFnTtw2k.js";import{k as le,l as oe,m as ie,o as X,G as ne,p as ce,q as ae}from"./index-Cte8O9kW.js";const fe=12,D=new Set,F=new Set;function ue(){for(const r of F)r()}function de(r){return D.has(r)?!0:D.size>=fe?!1:(D.add(r),!0)}function J(r){D.delete(r)&&ue()}function me(r){return F.add(r),()=>{F.delete(r)}}function ve(r,e){const t=w.useRef(!1),[d,i]=w.useState(!1),o=w.useRef(null),f=w.useRef(null),c=w.useRef(null),l=w.useRef(r);l.current=r;const[a]=w.useState(()=>{const n=()=>{c.current?.(),c.current=null},u=()=>t.current?!0:de(e)?(t.current=!0,i(!0),n(),!0):!1;return v=>{if(f.current=v,o.current&&(o.current.disconnect(),o.current=null),n(),!v){t.current&&(J(e),t.current=!1,i(!1));return}queueMicrotask(()=>{if(f.current!==v)return;const x=new IntersectionObserver(m=>{if(m[0]?.isIntersecting??!1){!u()&&!c.current&&(c.current=me(()=>{f.current===v&&u()}));return}n(),t.current&&(J(e),t.current=!1,i(!1))},{root:l.current.current,rootMargin:"160px 0px"});x.observe(v),o.current=x})}});return{ref:a,iframeActive:d}}function pe(r){const e=q.c(8),{previewUrl:t,title:d,scrollRootRef:i,slotId:o}=r,{ref:f,iframeActive:c}=ve(i,o),[l,a]=w.useState(!1);let n;e[0]!==c||e[1]!==l||e[2]!==t||e[3]!==d?(n=c?s.jsxs(s.Fragment,{children:[!l&&s.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-muted/40",children:s.jsx(_,{className:"h-8 w-8 animate-pulse text-muted-foreground/40"})}),s.jsx("iframe",{src:t,title:`Preview ${d}`,sandbox:"allow-scripts allow-same-origin",referrerPolicy:"no-referrer",className:"pointer-events-none h-[200%] w-[200%] origin-top-left scale-50 border-0 bg-white",tabIndex:-1,onLoad:()=>a(!0)})]}):s.jsx("div",{className:"flex h-full items-center justify-center",children:s.jsx(_,{className:"h-8 w-8 text-muted-foreground/30"})}),e[0]=c,e[1]=l,e[2]=t,e[3]=d,e[4]=n):n=e[4];let u;return e[5]!==f||e[6]!==n?(u=s.jsx("div",{ref:f,className:"relative aspect-[16/10] w-full overflow-hidden bg-muted/40",children:n}),e[5]=f,e[6]=n,e[7]=u):u=e[7],u}function xe(r){const e=q.c(26),{entry:t,previewUrl:d,scrollRootRef:i,onSelect:o}=r,f=t.isSavedBlock&&"border-global-section/35 hover:bg-global-section/8";let c;e[0]!==f?(c=Q("group flex flex-col overflow-hidden rounded-lg border bg-card text-left transition-colors","hover:border-primary/40 hover:bg-accent/30",f),e[0]=f,e[1]=c):c=e[1];let l;e[2]!==t.resolveType||e[3]!==t.title||e[4]!==d||e[5]!==i?(l=s.jsx(pe,{previewUrl:d,title:t.title,scrollRootRef:i,slotId:t.resolveType}),e[2]=t.resolveType,e[3]=t.title,e[4]=d,e[5]=i,e[6]=l):l=e[6];let a;e[7]!==t.isSavedBlock?(a=t.isSavedBlock?{color:ne}:void 0,e[7]=t.isSavedBlock,e[8]=a):a=e[8];let n;e[9]!==a?(n=s.jsx(_,{className:"h-4 w-4 shrink-0",style:a}),e[9]=a,e[10]=n):n=e[10];let u;e[11]!==t.title?(u=s.jsx("p",{className:"truncate text-sm font-medium",children:t.title}),e[11]=t.title,e[12]=u):u=e[12];let v;e[13]!==t.description?(v=t.description&&s.jsx("p",{className:"truncate text-xs text-muted-foreground",children:t.description}),e[13]=t.description,e[14]=v):v=e[14];let x;e[15]!==u||e[16]!==v?(x=s.jsxs("div",{className:"min-w-0 flex-1",children:[u,v]}),e[15]=u,e[16]=v,e[17]=x):x=e[17];let m;e[18]!==n||e[19]!==x?(m=s.jsxs("div",{className:"flex items-center gap-2 border-t px-3 py-2.5",children:[n,x]}),e[18]=n,e[19]=x,e[20]=m):m=e[20];let h;return e[21]!==o||e[22]!==c||e[23]!==l||e[24]!==m?(h=s.jsxs("button",{type:"button",onClick:o,className:c,children:[l,m]}),e[21]=o,e[22]=c,e[23]=l,e[24]=m,e[25]=h):h=e[25],h}function Ne(r){const e=q.c(51),{open:t,onOpenChange:d,meta:i,decofile:o,previewBaseUrl:f,onSelect:c}=r,l=K(),[a,n]=w.useState(""),[u,v]=w.useState(t),x=w.useRef(null);t!==u&&(v(t),t&&n(""));let m,h,S,b,j,N,R,y,g,C,T;if(e[0]!==o||e[1]!==i||e[2]!==d||e[3]!==c||e[4]!==t||e[5]!==f||e[6]!==a||e[7]!==l){const z=t&&i&&o?le(i,o):[],W=i?oe(i):"",G=o?ie(o):void 0,H=new Map;if(t&&W)for(const p of z)H.set(p.resolveType,X(f,W,p.previewBlock,G));const M=a.trim().toLowerCase(),V=M?z.filter(p=>p.title.toLowerCase().includes(M)||p.resolveType.toLowerCase().includes(M)||p.description?.toLowerCase().includes(M)):z;h=Z,C=t,T=d,m=ee,R="top-3 right-3",y="flex h-[90vh] max-h-[90vh] w-[96vw] max-w-[96vw] sm:max-w-[96vw] flex-col gap-0 overflow-hidden p-0";let U;e[19]!==l?(U=l("sectionsEditor.addSectionModal.title"),e[19]=l,e[20]=U):U=e[20];let A;e[21]!==U?(A=s.jsx(te,{children:U}),e[21]=U,e[22]=A):A=e[22];let O;e[23]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(Y,{size:14,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),e[23]=O):O=e[23];let $;e[24]===Symbol.for("react.memo_cache_sentinel")?($=p=>n(p.target.value),e[24]=$):$=e[24];let B;e[25]!==l?(B=l("sectionsEditor.addSectionModal.searchPlaceholder"),e[25]=l,e[26]=B):B=e[26];let k;e[27]!==a||e[28]!==B?(k=s.jsxs("div",{className:"relative pt-2",children:[O,s.jsx(re,{value:a,onChange:$,placeholder:B,className:"h-9 pl-8"})]}),e[27]=a,e[28]=B,e[29]=k):k=e[29],e[30]!==A||e[31]!==k?(g=s.jsxs(se,{className:"shrink-0 border-b px-4 py-3 text-left",children:[A,k]}),e[30]=A,e[31]=k,e[32]=g):g=e[32],j=x,N="min-h-0 flex-1 overflow-y-auto",S="p-4",b=V.length===0?s.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:l("sectionsEditor.addSectionModal.noSectionsFound")}):s.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:V.map(p=>s.jsx(xe,{entry:p,scrollRootRef:x,previewUrl:H.get(p.resolveType)??X(f,W,p.previewBlock,G),onSelect:()=>c(p)},p.resolveType))}),e[0]=o,e[1]=i,e[2]=d,e[3]=c,e[4]=t,e[5]=f,e[6]=a,e[7]=l,e[8]=m,e[9]=h,e[10]=S,e[11]=b,e[12]=j,e[13]=N,e[14]=R,e[15]=y,e[16]=g,e[17]=C,e[18]=T}else m=e[8],h=e[9],S=e[10],b=e[11],j=e[12],N=e[13],R=e[14],y=e[15],g=e[16],C=e[17],T=e[18];let P;e[33]!==S||e[34]!==b?(P=s.jsx("div",{className:S,children:b}),e[33]=S,e[34]=b,e[35]=P):P=e[35];let I;e[36]!==P||e[37]!==j||e[38]!==N?(I=s.jsx("div",{ref:j,className:N,children:P}),e[36]=P,e[37]=j,e[38]=N,e[39]=I):I=e[39];let L;e[40]!==m||e[41]!==I||e[42]!==R||e[43]!==y||e[44]!==g?(L=s.jsxs(m,{closeButtonClassName:R,className:y,children:[g,I]}),e[40]=m,e[41]=I,e[42]=R,e[43]=y,e[44]=g,e[45]=L):L=e[45];let E;return e[46]!==h||e[47]!==L||e[48]!==C||e[49]!==T?(E=s.jsx(h,{open:C,onOpenChange:T,children:L}),e[46]=h,e[47]=L,e[48]=C,e[49]=T,e[50]=E):E=e[50],E}function Re(r){const e=q.c(4),{previewServerUrl:t,runtime:d}=ce(r.virtualMcpId),i=d==="cms";let o;return e[0]!==i||e[1]!==r.sandboxUrl||e[2]!==t?(o=ae({sandboxUrl:r.sandboxUrl,previewServerUrl:t,fastPreviewActive:i}),e[0]=i,e[1]=r.sandboxUrl,e[2]=t,e[3]=o):o=e[3],o}export{Ne as A,Re as u};
1
+ import{c as q,b as K,r as w,j as s,l as Q}from"./index-BYFW0DhO.js";import{ah as _}from"./agent-icon-CLvBDlBI.js";import{i as Y}from"./SearchMd-W7yXXDTJ.js";import{D as Z,b as ee,d as te,c as se}from"./dialog-U2qFdhAX.js";import{I as re}from"./input-C2C9h9WJ.js";import{k as le,l as oe,m as ie,o as X,G as ne,p as ce,q as ae}from"./index-CUOGPjNf.js";const fe=12,D=new Set,F=new Set;function ue(){for(const r of F)r()}function de(r){return D.has(r)?!0:D.size>=fe?!1:(D.add(r),!0)}function J(r){D.delete(r)&&ue()}function me(r){return F.add(r),()=>{F.delete(r)}}function ve(r,e){const t=w.useRef(!1),[d,i]=w.useState(!1),o=w.useRef(null),f=w.useRef(null),c=w.useRef(null),l=w.useRef(r);l.current=r;const[a]=w.useState(()=>{const n=()=>{c.current?.(),c.current=null},u=()=>t.current?!0:de(e)?(t.current=!0,i(!0),n(),!0):!1;return v=>{if(f.current=v,o.current&&(o.current.disconnect(),o.current=null),n(),!v){t.current&&(J(e),t.current=!1,i(!1));return}queueMicrotask(()=>{if(f.current!==v)return;const x=new IntersectionObserver(m=>{if(m[0]?.isIntersecting??!1){!u()&&!c.current&&(c.current=me(()=>{f.current===v&&u()}));return}n(),t.current&&(J(e),t.current=!1,i(!1))},{root:l.current.current,rootMargin:"160px 0px"});x.observe(v),o.current=x})}});return{ref:a,iframeActive:d}}function pe(r){const e=q.c(8),{previewUrl:t,title:d,scrollRootRef:i,slotId:o}=r,{ref:f,iframeActive:c}=ve(i,o),[l,a]=w.useState(!1);let n;e[0]!==c||e[1]!==l||e[2]!==t||e[3]!==d?(n=c?s.jsxs(s.Fragment,{children:[!l&&s.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-muted/40",children:s.jsx(_,{className:"h-8 w-8 animate-pulse text-muted-foreground/40"})}),s.jsx("iframe",{src:t,title:`Preview ${d}`,sandbox:"allow-scripts allow-same-origin",referrerPolicy:"no-referrer",className:"pointer-events-none h-[200%] w-[200%] origin-top-left scale-50 border-0 bg-white",tabIndex:-1,onLoad:()=>a(!0)})]}):s.jsx("div",{className:"flex h-full items-center justify-center",children:s.jsx(_,{className:"h-8 w-8 text-muted-foreground/30"})}),e[0]=c,e[1]=l,e[2]=t,e[3]=d,e[4]=n):n=e[4];let u;return e[5]!==f||e[6]!==n?(u=s.jsx("div",{ref:f,className:"relative aspect-[16/10] w-full overflow-hidden bg-muted/40",children:n}),e[5]=f,e[6]=n,e[7]=u):u=e[7],u}function xe(r){const e=q.c(26),{entry:t,previewUrl:d,scrollRootRef:i,onSelect:o}=r,f=t.isSavedBlock&&"border-global-section/35 hover:bg-global-section/8";let c;e[0]!==f?(c=Q("group flex flex-col overflow-hidden rounded-lg border bg-card text-left transition-colors","hover:border-primary/40 hover:bg-accent/30",f),e[0]=f,e[1]=c):c=e[1];let l;e[2]!==t.resolveType||e[3]!==t.title||e[4]!==d||e[5]!==i?(l=s.jsx(pe,{previewUrl:d,title:t.title,scrollRootRef:i,slotId:t.resolveType}),e[2]=t.resolveType,e[3]=t.title,e[4]=d,e[5]=i,e[6]=l):l=e[6];let a;e[7]!==t.isSavedBlock?(a=t.isSavedBlock?{color:ne}:void 0,e[7]=t.isSavedBlock,e[8]=a):a=e[8];let n;e[9]!==a?(n=s.jsx(_,{className:"h-4 w-4 shrink-0",style:a}),e[9]=a,e[10]=n):n=e[10];let u;e[11]!==t.title?(u=s.jsx("p",{className:"truncate text-sm font-medium",children:t.title}),e[11]=t.title,e[12]=u):u=e[12];let v;e[13]!==t.description?(v=t.description&&s.jsx("p",{className:"truncate text-xs text-muted-foreground",children:t.description}),e[13]=t.description,e[14]=v):v=e[14];let x;e[15]!==u||e[16]!==v?(x=s.jsxs("div",{className:"min-w-0 flex-1",children:[u,v]}),e[15]=u,e[16]=v,e[17]=x):x=e[17];let m;e[18]!==n||e[19]!==x?(m=s.jsxs("div",{className:"flex items-center gap-2 border-t px-3 py-2.5",children:[n,x]}),e[18]=n,e[19]=x,e[20]=m):m=e[20];let h;return e[21]!==o||e[22]!==c||e[23]!==l||e[24]!==m?(h=s.jsxs("button",{type:"button",onClick:o,className:c,children:[l,m]}),e[21]=o,e[22]=c,e[23]=l,e[24]=m,e[25]=h):h=e[25],h}function Ne(r){const e=q.c(51),{open:t,onOpenChange:d,meta:i,decofile:o,previewBaseUrl:f,onSelect:c}=r,l=K(),[a,n]=w.useState(""),[u,v]=w.useState(t),x=w.useRef(null);t!==u&&(v(t),t&&n(""));let m,h,S,b,j,N,R,y,g,C,T;if(e[0]!==o||e[1]!==i||e[2]!==d||e[3]!==c||e[4]!==t||e[5]!==f||e[6]!==a||e[7]!==l){const z=t&&i&&o?le(i,o):[],W=i?oe(i):"",G=o?ie(o):void 0,H=new Map;if(t&&W)for(const p of z)H.set(p.resolveType,X(f,W,p.previewBlock,G));const M=a.trim().toLowerCase(),V=M?z.filter(p=>p.title.toLowerCase().includes(M)||p.resolveType.toLowerCase().includes(M)||p.description?.toLowerCase().includes(M)):z;h=Z,C=t,T=d,m=ee,R="top-3 right-3",y="flex h-[90vh] max-h-[90vh] w-[96vw] max-w-[96vw] sm:max-w-[96vw] flex-col gap-0 overflow-hidden p-0";let U;e[19]!==l?(U=l("sectionsEditor.addSectionModal.title"),e[19]=l,e[20]=U):U=e[20];let A;e[21]!==U?(A=s.jsx(te,{children:U}),e[21]=U,e[22]=A):A=e[22];let O;e[23]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(Y,{size:14,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),e[23]=O):O=e[23];let $;e[24]===Symbol.for("react.memo_cache_sentinel")?($=p=>n(p.target.value),e[24]=$):$=e[24];let B;e[25]!==l?(B=l("sectionsEditor.addSectionModal.searchPlaceholder"),e[25]=l,e[26]=B):B=e[26];let k;e[27]!==a||e[28]!==B?(k=s.jsxs("div",{className:"relative pt-2",children:[O,s.jsx(re,{value:a,onChange:$,placeholder:B,className:"h-9 pl-8"})]}),e[27]=a,e[28]=B,e[29]=k):k=e[29],e[30]!==A||e[31]!==k?(g=s.jsxs(se,{className:"shrink-0 border-b px-4 py-3 text-left",children:[A,k]}),e[30]=A,e[31]=k,e[32]=g):g=e[32],j=x,N="min-h-0 flex-1 overflow-y-auto",S="p-4",b=V.length===0?s.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:l("sectionsEditor.addSectionModal.noSectionsFound")}):s.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:V.map(p=>s.jsx(xe,{entry:p,scrollRootRef:x,previewUrl:H.get(p.resolveType)??X(f,W,p.previewBlock,G),onSelect:()=>c(p)},p.resolveType))}),e[0]=o,e[1]=i,e[2]=d,e[3]=c,e[4]=t,e[5]=f,e[6]=a,e[7]=l,e[8]=m,e[9]=h,e[10]=S,e[11]=b,e[12]=j,e[13]=N,e[14]=R,e[15]=y,e[16]=g,e[17]=C,e[18]=T}else m=e[8],h=e[9],S=e[10],b=e[11],j=e[12],N=e[13],R=e[14],y=e[15],g=e[16],C=e[17],T=e[18];let P;e[33]!==S||e[34]!==b?(P=s.jsx("div",{className:S,children:b}),e[33]=S,e[34]=b,e[35]=P):P=e[35];let I;e[36]!==P||e[37]!==j||e[38]!==N?(I=s.jsx("div",{ref:j,className:N,children:P}),e[36]=P,e[37]=j,e[38]=N,e[39]=I):I=e[39];let L;e[40]!==m||e[41]!==I||e[42]!==R||e[43]!==y||e[44]!==g?(L=s.jsxs(m,{closeButtonClassName:R,className:y,children:[g,I]}),e[40]=m,e[41]=I,e[42]=R,e[43]=y,e[44]=g,e[45]=L):L=e[45];let E;return e[46]!==h||e[47]!==L||e[48]!==C||e[49]!==T?(E=s.jsx(h,{open:C,onOpenChange:T,children:L}),e[46]=h,e[47]=L,e[48]=C,e[49]=T,e[50]=E):E=e[50],E}function Re(r){const e=q.c(4),{previewServerUrl:t,runtime:d}=ce(r.virtualMcpId),i=d==="cms";let o;return e[0]!==i||e[1]!==r.sandboxUrl||e[2]!==t?(o=ae({sandboxUrl:r.sandboxUrl,previewServerUrl:t,fastPreviewActive:i}),e[0]=i,e[1]=r.sandboxUrl,e[2]=t,e[3]=o):o=e[3],o}export{Ne as A,Re as u};
@@ -1 +1 @@
1
- import{c as r,v as u}from"./index-weBGyocH.js";import{p as i,q as c}from"./question-004-sINsf4GQ.js";import{u as f}from"./use-decopilot-events-Dy9qX9Gr.js";const p=new Set(["completed","failed","requires_action"]);function q(s){const e=r.c(5),[n]=u();let t;e[0]!==n?(t=o=>{n.enableSounds&&p.has(o.data.status)&&i(c.dataUri).catch(l)},e[0]=n,e[1]=t):t=e[1];let a;e[2]!==s||e[3]!==t?(a={orgSlug:s,onTaskStatus:t},e[2]=s,e[3]=t,e[4]=a):a=e[4],f(a)}function l(s){console.warn("[status-sounds] playback failed:",s)}export{q as u};
1
+ import{c as r,v as u}from"./index-BYFW0DhO.js";import{p as i,q as c}from"./question-004-sINsf4GQ.js";import{u as f}from"./use-decopilot-events-R7r7gJde.js";const p=new Set(["completed","failed","requires_action"]);function q(s){const e=r.c(5),[n]=u();let t;e[0]!==n?(t=o=>{n.enableSounds&&p.has(o.data.status)&&i(c.dataUri).catch(l)},e[0]=n,e[1]=t):t=e[1];let a;e[2]!==s||e[3]!==t?(a={orgSlug:s,onTaskStatus:t},e[2]=s,e[3]=t,e[4]=a):a=e[4],f(a)}function l(s){console.warn("[status-sounds] playback failed:",s)}export{q as u};
@@ -1 +1 @@
1
- import{c as u,G as f,a7 as y,m,n as g,e as T,K as l,t as E}from"./index-weBGyocH.js";function K(){const e=u.c(7),{locator:t}=f(),o=y();let n;e[0]!==t?(n=l.tags(t),e[0]=t,e[1]=n):n=e[1];let s;e[2]!==o?(s=async()=>{const{tags:r}=await o.call("TAGS_LIST",{});return r},e[2]=o,e[3]=s):s=e[3];let a;return e[4]!==n||e[5]!==s?(a={queryKey:n,queryFn:s,staleTime:3e4},e[4]=n,e[5]=s,e[6]=a):a=e[6],m(a)}function p(){const e=u.c(8),t=g(),{locator:o}=f(),n=y();let s;e[0]!==n?(s=async c=>{const{tag:i}=await n.call("TAGS_CREATE",typeof c=="string"?{name:c}:c);return i},e[0]=n,e[1]=s):s=e[1];let a;e[2]!==o||e[3]!==t?(a=()=>{t.invalidateQueries({queryKey:l.tags(o)})},e[2]=o,e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r={mutationFn:s,onSuccess:a,onError:S},e[5]=s,e[6]=a,e[7]=r):r=e[7],T(r)}function S(e){E.error(e instanceof Error?e.message:"Failed to create tag")}function C(){const e=u.c(8),t=g(),{locator:o}=f(),n=y();let s;e[0]!==n?(s=async c=>{await n.call("TAGS_DELETE",{tagId:c})},e[0]=n,e[1]=s):s=e[1];let a;e[2]!==o||e[3]!==t?(a=()=>{t.invalidateQueries({queryKey:l.tags(o)}),t.invalidateQueries({queryKey:l.taskBoardItems(o)})},e[2]=o,e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r={mutationFn:s,onSuccess:a,onError:q},e[5]=s,e[6]=a,e[7]=r):r=e[7],T(r)}function q(e){E.error(e instanceof Error?e.message:"Failed to delete tag")}function G(e){const t=u.c(10),{locator:o}=f(),n=y();let s;t[0]!==o||t[1]!==e?(s=l.memberTags(o,e),t[0]=o,t[1]=e,t[2]=s):s=t[2];let a;t[3]!==e||t[4]!==n?(a=async()=>{const{tags:i}=await n.call("MEMBER_TAGS_GET",{memberId:e});return i},t[3]=e,t[4]=n,t[5]=a):a=t[5];const r=!!e;let c;return t[6]!==s||t[7]!==a||t[8]!==r?(c={queryKey:s,queryFn:a,staleTime:3e4,enabled:r},t[6]=s,t[7]=a,t[8]=r,t[9]=c):c=t[9],m(c)}function M(){const e=u.c(8),t=g(),{locator:o}=f(),n=y();let s;e[0]!==n?(s=async c=>{const{memberId:i,tagIds:d}=c;return await n.call("MEMBER_TAGS_SET",{memberId:i,tagIds:d})},e[0]=n,e[1]=s):s=e[1];let a;e[2]!==o||e[3]!==t?(a=(c,i)=>{t.invalidateQueries({queryKey:l.memberTags(o,i.memberId)})},e[2]=o,e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r={mutationFn:s,onSuccess:a,onError:_},e[5]=s,e[6]=a,e[7]=r):r=e[7],T(r)}function _(e){E.error(e instanceof Error?e.message:"Failed to update member tags")}export{p as a,C as b,G as c,M as d,K as u};
1
+ import{c as u,G as f,a7 as y,m,n as g,e as T,K as l,t as E}from"./index-BYFW0DhO.js";function K(){const e=u.c(7),{locator:t}=f(),o=y();let n;e[0]!==t?(n=l.tags(t),e[0]=t,e[1]=n):n=e[1];let s;e[2]!==o?(s=async()=>{const{tags:r}=await o.call("TAGS_LIST",{});return r},e[2]=o,e[3]=s):s=e[3];let a;return e[4]!==n||e[5]!==s?(a={queryKey:n,queryFn:s,staleTime:3e4},e[4]=n,e[5]=s,e[6]=a):a=e[6],m(a)}function p(){const e=u.c(8),t=g(),{locator:o}=f(),n=y();let s;e[0]!==n?(s=async c=>{const{tag:i}=await n.call("TAGS_CREATE",typeof c=="string"?{name:c}:c);return i},e[0]=n,e[1]=s):s=e[1];let a;e[2]!==o||e[3]!==t?(a=()=>{t.invalidateQueries({queryKey:l.tags(o)})},e[2]=o,e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r={mutationFn:s,onSuccess:a,onError:S},e[5]=s,e[6]=a,e[7]=r):r=e[7],T(r)}function S(e){E.error(e instanceof Error?e.message:"Failed to create tag")}function C(){const e=u.c(8),t=g(),{locator:o}=f(),n=y();let s;e[0]!==n?(s=async c=>{await n.call("TAGS_DELETE",{tagId:c})},e[0]=n,e[1]=s):s=e[1];let a;e[2]!==o||e[3]!==t?(a=()=>{t.invalidateQueries({queryKey:l.tags(o)}),t.invalidateQueries({queryKey:l.taskBoardItems(o)})},e[2]=o,e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r={mutationFn:s,onSuccess:a,onError:q},e[5]=s,e[6]=a,e[7]=r):r=e[7],T(r)}function q(e){E.error(e instanceof Error?e.message:"Failed to delete tag")}function G(e){const t=u.c(10),{locator:o}=f(),n=y();let s;t[0]!==o||t[1]!==e?(s=l.memberTags(o,e),t[0]=o,t[1]=e,t[2]=s):s=t[2];let a;t[3]!==e||t[4]!==n?(a=async()=>{const{tags:i}=await n.call("MEMBER_TAGS_GET",{memberId:e});return i},t[3]=e,t[4]=n,t[5]=a):a=t[5];const r=!!e;let c;return t[6]!==s||t[7]!==a||t[8]!==r?(c={queryKey:s,queryFn:a,staleTime:3e4,enabled:r},t[6]=s,t[7]=a,t[8]=r,t[9]=c):c=t[9],m(c)}function M(){const e=u.c(8),t=g(),{locator:o}=f(),n=y();let s;e[0]!==n?(s=async c=>{const{memberId:i,tagIds:d}=c;return await n.call("MEMBER_TAGS_SET",{memberId:i,tagIds:d})},e[0]=n,e[1]=s):s=e[1];let a;e[2]!==o||e[3]!==t?(a=(c,i)=>{t.invalidateQueries({queryKey:l.memberTags(o,i.memberId)})},e[2]=o,e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r={mutationFn:s,onSuccess:a,onError:_},e[5]=s,e[6]=a,e[7]=r):r=e[7],T(r)}function _(e){E.error(e instanceof Error?e.message:"Failed to update member tags")}export{p as a,C as b,G as c,M as d,K as u};
@@ -1 +1 @@
1
- import{c as p,J as w,r as f}from"./index-weBGyocH.js";function I(M,b){const e=p.c(12),d=b===void 0?"cards":b,o=w(),g=f.useRef(o),s=M?`deco-view-mode-${M}`:"deco-view-mode";let i;e[0]!==d||e[1]!==s?(i=()=>{const r=globalThis.localStorage?.getItem(s);return r==="cards"||r==="table"?r:d},e[0]=d,e[1]=s,e[2]=i):i=e[2];const[t,m]=f.useState(i);let l;e[3]!==s?(l=r=>{m(r),globalThis.localStorage?.setItem(s,r)},e[3]=s,e[4]=l):l=e[4];const u=l;let c,a;e[5]!==o||e[6]!==t?(c=()=>{!g.current&&o&&t==="table"&&m("cards"),g.current=o},a=[o,t],e[5]=o,e[6]=t,e[7]=c,e[8]=a):(c=e[7],a=e[8]),f.useEffect(c,a);let n;return e[9]!==u||e[10]!==t?(n=[t,u],e[9]=u,e[10]=t,e[11]=n):n=e[11],n}export{I as u};
1
+ import{c as p,J as w,r as f}from"./index-BYFW0DhO.js";function I(M,b){const e=p.c(12),d=b===void 0?"cards":b,o=w(),g=f.useRef(o),s=M?`deco-view-mode-${M}`:"deco-view-mode";let i;e[0]!==d||e[1]!==s?(i=()=>{const r=globalThis.localStorage?.getItem(s);return r==="cards"||r==="table"?r:d},e[0]=d,e[1]=s,e[2]=i):i=e[2];const[t,m]=f.useState(i);let l;e[3]!==s?(l=r=>{m(r),globalThis.localStorage?.setItem(s,r)},e[3]=s,e[4]=l):l=e[4];const u=l;let c,a;e[5]!==o||e[6]!==t?(c=()=>{!g.current&&o&&t==="table"&&m("cards"),g.current=o},a=[o,t],e[5]=o,e[6]=t,e[7]=c,e[8]=a):(c=e[7],a=e[8]),f.useEffect(c,a);let n;return e[9]!==u||e[10]!==t?(n=[t,u],e[9]=u,e[10]=t,e[11]=n):n=e[11],n}export{I as u};
@@ -1 +1 @@
1
- import{c as C,G as I,eO as S,c8 as _,K as A,eP as y,m as M,eQ as L,c7 as T,eR as U}from"./index-weBGyocH.js";import{u as p,e as V,m as R}from"./use-mcp-client-DbyyfwFL.js";import{S as g}from"./constants-BRGHAWVM.js";function h(o){const t=C.c(5);let e;t[0]!==o?(e=o===void 0?{}:o,t[0]=o,t[1]=e):e=t[1];const n=e,{org:s}=I();let i;t[2]!==s.id||t[3]!==s.slug?(i={connectionId:g,orgId:s.id,orgSlug:s.slug},t[2]=s.id,t[3]=s.slug,t[4]=i):i=t[4];const l=p(i);return S(s.id,"VIRTUAL_MCP",l,n)}function O(o){const t=C.c(14);let e;t[0]!==o?(e={},t[0]=o,t[1]=e):e=t[1];const n=e,{org:s}=I();let i;t[2]!==s.id||t[3]!==s.slug?(i={connectionId:g,orgId:s.id,orgSlug:s.slug},t[2]=s.id,t[3]=s.slug,t[4]=i):i=t[4];const l=V(i);let c;t[5]!==l||t[6]!==n||t[7]!==s.id?(c=L(s.id,"VIRTUAL_MCP",l,n),t[5]=l,t[6]=n,t[7]=s.id,t[8]=c):c=t[8];const r=!!l;let u;t[9]!==c||t[10]!==r?(u={...c,enabled:r},t[9]=c,t[10]=r,t[11]=u):u=t[11];const{data:d}=M(u);let a;return t[12]!==d?(a=d??[],t[12]=d,t[13]=a):a=t[13],a}function w(o){const t=C.c(10),{org:e}=I();let n;t[0]!==e.id||t[1]!==e.slug?(n={connectionId:g,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=n):n=t[2];const s=V(n),i=o??void 0;let l;t[3]!==s||t[4]!==e.id||t[5]!==i?(l=y(e.id,"VIRTUAL_MCP",i,s),t[3]=s,t[4]=e.id,t[5]=i,t[6]=l):l=t[6];const c=!!s&&!!o;let r;t[7]!==l||t[8]!==c?(r={...l,enabled:c},t[7]=l,t[8]=c,t[9]=r):r=t[9];const{data:u}=M(r);return u?.item??null}async function E(o,t,e={}){const n=await o.fetchQuery(R({connectionId:g,orgId:t.id,orgSlug:t.slug})),s=L(t.id,"VIRTUAL_MCP",n,e);return s.select(await o.fetchQuery(s))}function k(o){const t=C.c(18);let e;t[0]!==o?(e={},t[0]=o,t[1]=e):e=t[1];const n=e,{org:s}=I();let i;t[2]!==s.id||t[3]!==s.slug?(i={connectionId:g,orgId:s.id,orgSlug:s.slug},t[2]=s.id,t[3]=s.slug,t[4]=i):i=t[4];const l=V(i);let c;t[5]!==l||t[6]!==n||t[7]!==s.id?(c=U(s.id,"VIRTUAL_MCP",l,n),t[5]=l,t[6]=n,t[7]=s.id,t[8]=c):c=t[8];const r=!!l;let u;t[9]!==c||t[10]!==r?(u={...c,enabled:r},t[9]=c,t[10]=r,t[11]=u):u=t[11];const{data:d}=M(u);let a;t[12]!==d?.items?(a=d?.items??[],t[12]=d?.items,t[13]=a):a=t[13];const P=d?.totalCount,m=d?.hasMore;let f;return t[14]!==a||t[15]!==P||t[16]!==m?(f={items:a,totalCount:P,hasMore:m},t[14]=a,t[15]=P,t[16]=m,t[17]=f):f=t[17],f}function v(o){const t=C.c(3),{org:e}=I();let n;t[0]!==e.id||t[1]!==e.slug?(n={connectionId:g,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=n):n=t[2];const s=p(n);return T(e.id,"VIRTUAL_MCP",o??void 0,s)}function x(o){const t=C.c(15),{org:e}=I();let n;t[0]!==e.id||t[1]!==e.slug?(n={connectionId:g,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=n):n=t[2];const s=p(n);let i,l,c;t[3]!==o||t[4]!==e.id?(i=[...o].sort(),c=M,l=A.virtualMcpLastUsed(e.id,i),t[3]=o,t[4]=e.id,t[5]=i,t[6]=l,t[7]=c):(i=t[5],l=t[6],c=t[7]);const r=i.length>0;let u;t[8]!==s||t[9]!==i?(u=async()=>{const P=(await s.callTool({name:"VIRTUAL_MCP_LAST_USED_LIST",arguments:{ids:i}})).structuredContent??{items:[]},m=new Map;for(const f of P.items)m.set(f.id,f);return m},t[8]=s,t[9]=i,t[10]=u):u=t[10];let d;return t[11]!==l||t[12]!==r||t[13]!==u?(d={queryKey:l,enabled:r,staleTime:3e4,queryFn:u},t[11]=l,t[12]=r,t[13]=u,t[14]=d):d=t[14],c(d)}function B(){const o=C.c(3),{org:t}=I();let e;o[0]!==t.id||o[1]!==t.slug?(e={connectionId:g,orgId:t.id,orgSlug:t.slug},o[0]=t.id,o[1]=t.slug,o[2]=e):e=o[2];const n=p(e);return _(t.id,"VIRTUAL_MCP",n)}export{h as a,B as b,x as c,O as d,k as e,w as f,E as g,v as u};
1
+ import{c as C,G as I,eO as S,c8 as _,K as A,eP as y,m as M,eQ as L,c7 as T,eR as U}from"./index-BYFW0DhO.js";import{u as p,e as V,m as R}from"./use-mcp-client-B8KExIQP.js";import{S as g}from"./constants-BRGHAWVM.js";function h(o){const t=C.c(5);let e;t[0]!==o?(e=o===void 0?{}:o,t[0]=o,t[1]=e):e=t[1];const n=e,{org:s}=I();let i;t[2]!==s.id||t[3]!==s.slug?(i={connectionId:g,orgId:s.id,orgSlug:s.slug},t[2]=s.id,t[3]=s.slug,t[4]=i):i=t[4];const l=p(i);return S(s.id,"VIRTUAL_MCP",l,n)}function O(o){const t=C.c(14);let e;t[0]!==o?(e={},t[0]=o,t[1]=e):e=t[1];const n=e,{org:s}=I();let i;t[2]!==s.id||t[3]!==s.slug?(i={connectionId:g,orgId:s.id,orgSlug:s.slug},t[2]=s.id,t[3]=s.slug,t[4]=i):i=t[4];const l=V(i);let c;t[5]!==l||t[6]!==n||t[7]!==s.id?(c=L(s.id,"VIRTUAL_MCP",l,n),t[5]=l,t[6]=n,t[7]=s.id,t[8]=c):c=t[8];const r=!!l;let u;t[9]!==c||t[10]!==r?(u={...c,enabled:r},t[9]=c,t[10]=r,t[11]=u):u=t[11];const{data:d}=M(u);let a;return t[12]!==d?(a=d??[],t[12]=d,t[13]=a):a=t[13],a}function w(o){const t=C.c(10),{org:e}=I();let n;t[0]!==e.id||t[1]!==e.slug?(n={connectionId:g,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=n):n=t[2];const s=V(n),i=o??void 0;let l;t[3]!==s||t[4]!==e.id||t[5]!==i?(l=y(e.id,"VIRTUAL_MCP",i,s),t[3]=s,t[4]=e.id,t[5]=i,t[6]=l):l=t[6];const c=!!s&&!!o;let r;t[7]!==l||t[8]!==c?(r={...l,enabled:c},t[7]=l,t[8]=c,t[9]=r):r=t[9];const{data:u}=M(r);return u?.item??null}async function E(o,t,e={}){const n=await o.fetchQuery(R({connectionId:g,orgId:t.id,orgSlug:t.slug})),s=L(t.id,"VIRTUAL_MCP",n,e);return s.select(await o.fetchQuery(s))}function k(o){const t=C.c(18);let e;t[0]!==o?(e={},t[0]=o,t[1]=e):e=t[1];const n=e,{org:s}=I();let i;t[2]!==s.id||t[3]!==s.slug?(i={connectionId:g,orgId:s.id,orgSlug:s.slug},t[2]=s.id,t[3]=s.slug,t[4]=i):i=t[4];const l=V(i);let c;t[5]!==l||t[6]!==n||t[7]!==s.id?(c=U(s.id,"VIRTUAL_MCP",l,n),t[5]=l,t[6]=n,t[7]=s.id,t[8]=c):c=t[8];const r=!!l;let u;t[9]!==c||t[10]!==r?(u={...c,enabled:r},t[9]=c,t[10]=r,t[11]=u):u=t[11];const{data:d}=M(u);let a;t[12]!==d?.items?(a=d?.items??[],t[12]=d?.items,t[13]=a):a=t[13];const P=d?.totalCount,m=d?.hasMore;let f;return t[14]!==a||t[15]!==P||t[16]!==m?(f={items:a,totalCount:P,hasMore:m},t[14]=a,t[15]=P,t[16]=m,t[17]=f):f=t[17],f}function v(o){const t=C.c(3),{org:e}=I();let n;t[0]!==e.id||t[1]!==e.slug?(n={connectionId:g,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=n):n=t[2];const s=p(n);return T(e.id,"VIRTUAL_MCP",o??void 0,s)}function x(o){const t=C.c(15),{org:e}=I();let n;t[0]!==e.id||t[1]!==e.slug?(n={connectionId:g,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=n):n=t[2];const s=p(n);let i,l,c;t[3]!==o||t[4]!==e.id?(i=[...o].sort(),c=M,l=A.virtualMcpLastUsed(e.id,i),t[3]=o,t[4]=e.id,t[5]=i,t[6]=l,t[7]=c):(i=t[5],l=t[6],c=t[7]);const r=i.length>0;let u;t[8]!==s||t[9]!==i?(u=async()=>{const P=(await s.callTool({name:"VIRTUAL_MCP_LAST_USED_LIST",arguments:{ids:i}})).structuredContent??{items:[]},m=new Map;for(const f of P.items)m.set(f.id,f);return m},t[8]=s,t[9]=i,t[10]=u):u=t[10];let d;return t[11]!==l||t[12]!==r||t[13]!==u?(d={queryKey:l,enabled:r,staleTime:3e4,queryFn:u},t[11]=l,t[12]=r,t[13]=u,t[14]=d):d=t[14],c(d)}function B(){const o=C.c(3),{org:t}=I();let e;o[0]!==t.id||o[1]!==t.slug?(e={connectionId:g,orgId:t.id,orgSlug:t.slug},o[0]=t.id,o[1]=t.slug,o[2]=e):e=o[2];const n=p(e);return _(t.id,"VIRTUAL_MCP",n)}export{h as a,B as b,x as c,O as d,k as e,w as f,E as g,v as u};
@@ -0,0 +1 @@
1
+ import{I as u}from"./use-infinite-scroll-vUX1oplI.js";import{fe as i}from"./index-BYFW0DhO.js";function t(e,r){return i(e,u,r)}export{t as u};
@@ -0,0 +1 @@
1
+ import{I as s}from"./use-infinite-scroll-vUX1oplI.js";import{fe as u,bT as n}from"./index-BYFW0DhO.js";function a(e,r){return u({...e,enabled:!0,suspense:!0,throwOnError:n},s,r)}export{a as u};
@@ -1 +1 @@
1
- import{c as V,b as q,r as z,a as O,m as Y,e as $,j as t,P as I,K as J,t as Q,B as W}from"./index-weBGyocH.js";import{C as G}from"./collection-table-wrapper-CcjzxNLW.js";import{E as L}from"./empty-state-BfG2Bmb1.js";import{S as H}from"./search-input-J6NuIFHz.js";import{A as X}from"./avatar-BUe1abT6.js";import{B as D}from"./badge-BjiEQuif.js";import{u as Z}from"./use-debounced-value-D4xMKhQx.js";import{a as K}from"./admin-fetch-CCSvjTk1.js";import{f as ee}from"./format-time-BnbuEtat.js";import{g as se}from"./get-initials-D-f_fDFw.js";import"./table-CHKwG1gN.js";import"./ArrowUp-BYkw_uv9.js";import"./SearchMd-ryPT7rxv.js";import"./User01-C-2ChFyL.js";import"./differenceInSeconds-NQ4PDo0z.js";function ve(){const e=V.c(58),s=q(),[r,M]=z.useState("");let N;e[0]!==r?(N=r.trim(),e[0]=r,e[1]=N):N=e[1];const a=Z(N,300),{data:R}=O.useSession(),P=R?.user?.id;let n;e[2]!==a?(n=J.deploymentAdminUsers(a),e[2]=a,e[3]=n):n=e[3];let l;e[4]!==a?(l=()=>{const i=new URLSearchParams({limit:"100"});return a&&i.set("searchValue",a),K(`/api/_admin/users?${i}`)},e[4]=a,e[5]=l):l=e[5];let y;e[6]!==n||e[7]!==l?(y={queryKey:n,queryFn:l},e[6]=n,e[7]=l,e[8]=y):y=e[8];const{data:k,isLoading:_,isError:A}=Y(y);let C;e[9]===Symbol.for("react.memo_cache_sentinel")?(C=ie,e[9]=C):C=e[9];let w;e[10]!==s?(w={mutationFn:ae,onSuccess:C,onError:i=>{Q.error(i instanceof Error?i.message:s("admin.users.failedToImpersonate"))}},e[10]=s,e[11]=w):w=e[11];const E=$(w);let b;e[12]!==k?.users?(b=k?.users??[],e[12]=k?.users,e[13]=b):b=e[13];const B=b;let o;e[14]!==s?(o=s("admin.users.columnUser"),e[14]=s,e[15]=o):o=e[15];let m;e[16]!==s?(m=i=>t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(X,{url:i.image??void 0,fallback:se(i.name),shape:"circle",size:"sm"}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground truncate",children:i.name||s("admin.users.unknown")}),t.jsx("div",{className:"text-sm text-muted-foreground truncate",children:i.email})]})]}),e[16]=s,e[17]=m):m=e[17];let d;e[18]!==o||e[19]!==m?(d={id:"user",header:o,render:m,cellClassName:"flex-1 min-w-0"},e[18]=o,e[19]=m,e[20]=d):d=e[20];let c;e[21]!==s?(c=s("admin.users.columnEmail"),e[21]=s,e[22]=c):c=e[22];let u;e[23]!==s?(u=i=>i.emailVerified?t.jsx(D,{variant:"outline",className:"text-success border-success/20",children:s("admin.users.verified")}):t.jsx(D,{variant:"outline",className:"text-muted-foreground",children:s("admin.users.unverified")}),e[23]=s,e[24]=u):u=e[24];let f;e[25]!==c||e[26]!==u?(f={id:"verified",header:c,render:u,cellClassName:"w-28 shrink-0"},e[25]=c,e[26]=u,e[27]=f):f=e[27];let p;e[28]!==s?(p=s("admin.users.columnCreated"),e[28]=s,e[29]=p):p=e[29];let h;e[30]!==p?(h={id:"created",header:p,render:te,cellClassName:"w-48 shrink-0"},e[30]=p,e[31]=h):h=e[31];let x;e[32]!==P||e[33]!==E||e[34]!==s?(x={id:"actions",header:"",render:i=>t.jsx(W,{variant:"outline",size:"sm",disabled:i.id===P||E.isPending,onClick:()=>E.mutate(i.id),children:s("admin.users.impersonate")}),cellClassName:"w-32 shrink-0"},e[32]=P,e[33]=E,e[34]=s,e[35]=x):x=e[35];let T;e[36]!==f||e[37]!==h||e[38]!==x||e[39]!==d?(T=[d,f,h,x],e[36]=f,e[37]=h,e[38]=x,e[39]=d,e[40]=T):T=e[40];const F=T;let j;e[41]!==s?(j=s("admin.users.searchPlaceholder"),e[41]=s,e[42]=j):j=e[42];let g;e[43]!==r||e[44]!==j?(g=t.jsx(H,{value:r,onChange:M,placeholder:j,className:"w-full md:w-[375px]"}),e[43]=r,e[44]=j,e[45]=g):g=e[45];let S;e[46]!==a||e[47]!==A||e[48]!==s?(S=A?t.jsx(L,{title:s("admin.users.failedToLoadTitle"),description:s("admin.users.failedToLoadDescription")}):t.jsx(L,{title:s("admin.users.noUsersFoundTitle"),description:a?s("admin.users.noUsersMatchSearch",{search:a}):s("admin.users.noUsersYet")}),e[46]=a,e[47]=A,e[48]=s,e[49]=S):S=e[49];let v;e[50]!==F||e[51]!==_||e[52]!==S||e[53]!==B?(v=t.jsx(G,{columns:F,data:B,isLoading:_,emptyState:S}),e[50]=F,e[51]=_,e[52]=S,e[53]=B,e[54]=v):v=e[54];let U;return e[55]!==g||e[56]!==v?(U=t.jsx(I,{children:t.jsx(I.Content,{children:t.jsx(I.Body,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[g,v]})})})}),e[55]=g,e[56]=v,e[57]=U):U=e[57],U}function te(e){return t.jsx("span",{className:"text-sm text-foreground",children:ee(e.createdAt)})}function ie(){window.location.href="/"}function ae(e){return K("/api/_admin/impersonate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e})})}export{ve as default};
1
+ import{c as V,b as q,r as z,a as O,m as Y,e as $,j as t,P as I,K as J,t as Q,B as W}from"./index-BYFW0DhO.js";import{C as G}from"./collection-table-wrapper-9R-Qm9Z1.js";import{E as L}from"./empty-state-bjpeaW-Z.js";import{S as H}from"./search-input-DTZZQgYe.js";import{A as X}from"./avatar-B8mdJCa-.js";import{B as D}from"./badge-DtjY8TtR.js";import{u as Z}from"./use-debounced-value--9PTnjO2.js";import{a as K}from"./admin-fetch-CCSvjTk1.js";import{f as ee}from"./format-time-BtXRrtv4.js";import{g as se}from"./get-initials-D-f_fDFw.js";import"./table-DyTYCFjs.js";import"./ArrowUp-BsH1JQDE.js";import"./SearchMd-W7yXXDTJ.js";import"./User01-DS4N984M.js";import"./differenceInSeconds-C3x8sHUj.js";function ve(){const e=V.c(58),s=q(),[r,M]=z.useState("");let N;e[0]!==r?(N=r.trim(),e[0]=r,e[1]=N):N=e[1];const a=Z(N,300),{data:R}=O.useSession(),P=R?.user?.id;let n;e[2]!==a?(n=J.deploymentAdminUsers(a),e[2]=a,e[3]=n):n=e[3];let l;e[4]!==a?(l=()=>{const i=new URLSearchParams({limit:"100"});return a&&i.set("searchValue",a),K(`/api/_admin/users?${i}`)},e[4]=a,e[5]=l):l=e[5];let y;e[6]!==n||e[7]!==l?(y={queryKey:n,queryFn:l},e[6]=n,e[7]=l,e[8]=y):y=e[8];const{data:k,isLoading:_,isError:A}=Y(y);let C;e[9]===Symbol.for("react.memo_cache_sentinel")?(C=ie,e[9]=C):C=e[9];let w;e[10]!==s?(w={mutationFn:ae,onSuccess:C,onError:i=>{Q.error(i instanceof Error?i.message:s("admin.users.failedToImpersonate"))}},e[10]=s,e[11]=w):w=e[11];const E=$(w);let b;e[12]!==k?.users?(b=k?.users??[],e[12]=k?.users,e[13]=b):b=e[13];const B=b;let o;e[14]!==s?(o=s("admin.users.columnUser"),e[14]=s,e[15]=o):o=e[15];let m;e[16]!==s?(m=i=>t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(X,{url:i.image??void 0,fallback:se(i.name),shape:"circle",size:"sm"}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground truncate",children:i.name||s("admin.users.unknown")}),t.jsx("div",{className:"text-sm text-muted-foreground truncate",children:i.email})]})]}),e[16]=s,e[17]=m):m=e[17];let d;e[18]!==o||e[19]!==m?(d={id:"user",header:o,render:m,cellClassName:"flex-1 min-w-0"},e[18]=o,e[19]=m,e[20]=d):d=e[20];let c;e[21]!==s?(c=s("admin.users.columnEmail"),e[21]=s,e[22]=c):c=e[22];let u;e[23]!==s?(u=i=>i.emailVerified?t.jsx(D,{variant:"outline",className:"text-success border-success/20",children:s("admin.users.verified")}):t.jsx(D,{variant:"outline",className:"text-muted-foreground",children:s("admin.users.unverified")}),e[23]=s,e[24]=u):u=e[24];let f;e[25]!==c||e[26]!==u?(f={id:"verified",header:c,render:u,cellClassName:"w-28 shrink-0"},e[25]=c,e[26]=u,e[27]=f):f=e[27];let p;e[28]!==s?(p=s("admin.users.columnCreated"),e[28]=s,e[29]=p):p=e[29];let h;e[30]!==p?(h={id:"created",header:p,render:te,cellClassName:"w-48 shrink-0"},e[30]=p,e[31]=h):h=e[31];let x;e[32]!==P||e[33]!==E||e[34]!==s?(x={id:"actions",header:"",render:i=>t.jsx(W,{variant:"outline",size:"sm",disabled:i.id===P||E.isPending,onClick:()=>E.mutate(i.id),children:s("admin.users.impersonate")}),cellClassName:"w-32 shrink-0"},e[32]=P,e[33]=E,e[34]=s,e[35]=x):x=e[35];let T;e[36]!==f||e[37]!==h||e[38]!==x||e[39]!==d?(T=[d,f,h,x],e[36]=f,e[37]=h,e[38]=x,e[39]=d,e[40]=T):T=e[40];const F=T;let j;e[41]!==s?(j=s("admin.users.searchPlaceholder"),e[41]=s,e[42]=j):j=e[42];let g;e[43]!==r||e[44]!==j?(g=t.jsx(H,{value:r,onChange:M,placeholder:j,className:"w-full md:w-[375px]"}),e[43]=r,e[44]=j,e[45]=g):g=e[45];let S;e[46]!==a||e[47]!==A||e[48]!==s?(S=A?t.jsx(L,{title:s("admin.users.failedToLoadTitle"),description:s("admin.users.failedToLoadDescription")}):t.jsx(L,{title:s("admin.users.noUsersFoundTitle"),description:a?s("admin.users.noUsersMatchSearch",{search:a}):s("admin.users.noUsersYet")}),e[46]=a,e[47]=A,e[48]=s,e[49]=S):S=e[49];let v;e[50]!==F||e[51]!==_||e[52]!==S||e[53]!==B?(v=t.jsx(G,{columns:F,data:B,isLoading:_,emptyState:S}),e[50]=F,e[51]=_,e[52]=S,e[53]=B,e[54]=v):v=e[54];let U;return e[55]!==g||e[56]!==v?(U=t.jsx(I,{children:t.jsx(I.Content,{children:t.jsx(I.Body,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[g,v]})})})}),e[55]=g,e[56]=v,e[57]=U):U=e[57],U}function te(e){return t.jsx("span",{className:"text-sm text-foreground",children:ee(e.createdAt)})}function ie(){window.location.href="/"}function ae(e){return K("/api/_admin/impersonate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e})})}export{ve as default};
@@ -1 +1 @@
1
- import{c as K,b as X,r as Z,j as n,l as rt,a1 as ut,a4 as ht,B as tt,a2 as xt}from"./index-weBGyocH.js";import{z as gt,a4 as at,aE as bt}from"./agent-icon-BRoPbkxd.js";import{i as vt}from"./ChevronRight-B366HM4z.js";import{L as yt}from"./label-MlXrew-u.js";import{S as lt}from"./scroll-area-C_cHkZF7.js";import{S as jt}from"./switch-T5LrSBrw.js";import{V as Tt}from"./view-mode-toggle-CCcVUJ4z.js";import{bs as ct,bt as mt,bu as Nt,bv as _t,bw as kt,bx as U,by as wt}from"./index-Cte8O9kW.js";import"./AlertCircle-BawGC1kp.js";import"./Tool01-CepDUjO3.js";import"./ArrowUp-BYkw_uv9.js";import"./ArrowLeft-DAHOvtJW.js";import"./Tool02-DdG_5-W8.js";import"./XCircle-CBWbsT40.js";import"./TrendUp01-DrNdYLD4.js";import"./ZoomOut-DTYLnleU.js";import"./Users03-DN1IDxHZ.js";import"./CheckCircle-DYo4yeC6.js";import"./Check-D50Qz8pd.js";import"./ChevronUp-DiPLvM5v.js";import"./ChevronSelectorVertical-hDysfF54.js";import"./DotsVertical-C5ZAJeIV.js";import"./UserSquare-DrToBYR4.js";import"./Copy01-wjgNpbHM.js";import"./CreditCard01-BARv2b55.js";import"./Download01-Cp8tCYEj.js";import"./Settings02-4GByZEin.js";import"./Eye-04eGXQWm.js";import"./Share07-BKp8_1LW.js";import"./GitBranch01-BkBspkIH.js";import"./Globe01-B3WKrszB.js";import"./XClose-A4VFkjrc.js";import"./HardDrive-B1lGKQQL.js";import"./Image01-DuMpyolM.js";import"./Key01-DBgMeUTs.js";import"./Link01-Dn9-GB6A.js";import"./LinkExternal01-B5R9GWYR.js";import"./Monitor01-B82ksyKe.js";import"./Sun-D9qQ8V1c.js";import"./Package-Dne4I7eU.js";import"./Palette-C4PW0nnS.js";import"./Play-CaESL_5l.js";import"./Plus-6QlnmG7X.js";import"./SearchMd-ryPT7rxv.js";import"./Shield01-CoHqiHHO.js";import"./Stars01-CV8WfUpL.js";import"./Trash01-C6Ou_hlQ.js";import"./Upload01-DkBOH9fh.js";import"./User01-C-2ChFyL.js";import"./Users01-CRoUmw6V.js";import"./Zap-DP8syq_X.js";import"./select-vFCmbR33.js";import"./chat-context-b0GmCrhs.js";import"./use-panel-navigate-DhHRD0vs.js";import"./use-destination-route-GypAYhp8.js";import"./autosend-DQusdBG_.js";import"./thread-intent-CcWHzfkw.js";import"./slugify-CEUa2lfQ.js";import"./hooks-Dq2_eaLg.js";import"./use-mcp-client-DbyyfwFL.js";import"./constants-BRGHAWVM.js";import"./auth-BonfJbpi.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-B-fcCk-K.js";import"./task-board-CQ-3ZPwA.js";import"./schema-CMNTDy4A.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-Cz_si5KP.js";import"./use-ai-providers-BIIefz3U.js";import"./location-oTTXFrSF.js";import"./use-decopilot-events-Dy9qX9Gr.js";import"./thread-route-B8U1rz53.js";import"./dialog-CqKyQDlv.js";import"./use-organization-settings-CYKZsssD.js";import"./automation-runs-CFfbViJw.js";import"./useInfiniteQuery-C47LPQTE.js";import"./use-infinite-scroll-CmJNRT41.js";import"./use-connection-C0PxJ5SV.js";import"./table-CHKwG1gN.js";import"./empty-state-BfG2Bmb1.js";import"./use-members-Bjha068Y.js";import"./use-org-auth-client-BigyyemQ.js";import"./use-automations-CVjhC86A.js";import"./useSuspenseInfiniteQuery-DtPmDJxo.js";import"./avatar-BUe1abT6.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-c3VKc4aO.js";import"./markdown-A8j5Qvc3.js";import"./monaco-editor-CKT0_nEP.js";import"./editor-Cin_5tu-.js";import"./mcp-app-renderer-Da9POrmv.js";import"./types-DdSDF2P_.js";import"./shell-layout-CRQj4_aW.js";import"./project-icon-F4BdYNaJ.js";import"./github-repo-COLY3wWI.js";import"./source-system-tabs-CnEGUb4r.js";import"./command-_eMlwt6K.js";import"./index-DGwcFVmZ.js";import"./required-auth-layout-DxMLFYG_.js";import"./use-org-sso-CAY5lnB6.js";import"./use-org-notice-P1qnXHWT.js";import"./integration-icon-DRrrpuyS.js";import"./use-navigate-to-agent-C0f7F1ii.js";import"./use-mcp-prompts-CsSNH5CL.js";import"./form-BT0_lKIF.js";import"./input-CFnTtw2k.js";import"./file-type-icon-DLS5OPI-.js";import"./drawer-BnFsDyq0.js";import"./collection-search-BCsXpSHE.js";import"./tabs-CdOMDht3.js";import"./toggle-group-C2G8ll2X.js";import"./task-route-D37LOthe.js";import"./extract-connection-data-CQY-ygil.js";import"./metadata-dUsYcpuu.js";import"./connection-Dhn66lIi.js";import"./connection-card-C9cMC74v.js";import"./use-registry-connections-B5BQuLSP.js";import"./retry-CErkP7V6.js";import"./connection-slug-CITJ0kGN.js";import"./textarea-DPeZ6xxO.js";import"./connection-form-helpers-BCJYrFWh.js";import"./authenticate-and-persist-oauth-BXIxJO7G.js";import"./mcp-oauth-_QOCWffw.js";import"./collection-tabs-CquGY0e9.js";import"./badge-BjiEQuif.js";import"./use-file-configs-CAGnWxDH.js";import"./site-slug-uya6Wp4-.js";import"./dropdown-menu-C2mZs1a5.js";import"./popover-dodrM04j.js";import"./github-icon-DT8soM3-.js";import"./get-initials-D-f_fDFw.js";import"./select-model-Dj7N0cyA.js";import"./checkbox-Bhj4AUZs.js";import"./ai-providers-logos-DD3qZ33J.js";import"./folder-icon-KLloGijH.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-BYP0fHF7.js";import"./toolbar-DvObSBys.js";import"./skill-preview-BYjF0_Nr.js";import"./pt-BR-CLy76QW2.js";import"./alert-dialog-DQkitV36.js";import"./use-debounced-autosave-B7pm8_yo.js";import"./search-input-J6NuIFHz.js";import"./use-mcp-auth-status-Bb8E9QEq.js";import"./github-repo-picker-B2eN4ZfY.js";import"./use-debounced-value-D4xMKhQx.js";import"./provision-repo-scoped-github-connection-WQFARyHG.js";import"./use-secrets-CKxZifey.js";import"./client-icons-DCR8EFIh.js";import"./connect-layout-BziJud9I.js";import"./self-tool-result-CeMjOtPq.js";import"./track-CimVJAlT.js";import"./use-tags-heuT8B5T.js";import"./breadcrumb-CxF2wYfL.js";import"./toolbar-icon-button-lmaFup2h.js";import"./safe-image-url-D5z803Ot.js";import"./automation-list-row-CmtWVLX6.js";import"./site-error--i37Vnuw.js";import"./cards-DW1vhrc1.js";const Et=new Set(["website/matchers/date.ts","$live/matchers/MatchDate.ts"]),St=new Set(["website/matchers/multi.ts","$live/matchers/MatchMulti.ts"]),Ct=new Date(-864e13),Mt=new Date(864e13),At=/\/flags\/multivariate(?:\/[^/]+)?\.ts$/,$t=/\/flags\/multivariate\.ts$/;function Lt(e){let t=e;t.startsWith("pages-")&&(t=t.slice(6).replace(/-\d+$/,""));try{t=decodeURIComponent(t)}catch{}return t}function Rt(e){if(!e||typeof e!="object")return null;const{start:t,end:r}=e,o=typeof t=="string",s=typeof r=="string";if(!o&&!s)return null;const i=o?new Date(t):Ct,a=s?new Date(r):Mt;return Number.isNaN(i.getTime())||Number.isNaN(a.getTime())||o&&s&&a.getTime()<=i.getTime()?null:{start:i,end:a,openStart:!o,openEnd:!s}}function pt(e,t){if(!e||typeof e!="object")return;const r=e.__resolveType;if(typeof r=="string"){if(Et.has(r)){const o=Rt(e);o&&t.push(o);return}if(St.has(r)){const o=e.matchers;if(Array.isArray(o))for(const s of o)pt(s,t)}}}function Dt(e){if(!e||typeof e!="object")return!1;const t=e.__resolveType;if(typeof t!="string"||!At.test(t))return!1;const r=e.variants;return Array.isArray(r)}function Ot(e){if(typeof e=="string"){const c=e.trim();if(c.length===0)return null;try{const m=new URL(c).pathname.split("/").filter(Boolean),p=m[m.length-1];if(p)return decodeURIComponent(p)}catch{}return c.length>80?`${c.slice(0,77)}…`:c}if(!e||typeof e!="object")return null;const t=e,r=t.config,s=t.desktop?.media,i=[t.title,t.name,t.label,t.alt,r?.title,r?.name,r?.typeAlert?.message,s?.alt,Array.isArray(t.matcher)?t.matcher[0]:void 0];for(const c of i)if(typeof c=="string"&&c.trim().length>0)return c.trim();const a=t.__resolveType;if(typeof a=="string"){const l=(a.split("/").pop()??a).replace(/\.(tsx?|jsx?)$/i,"");if(l.length>0)return l}return null}function Pt(e){const t=[];for(let r=0;r<e.length;r++){const o=e[r];typeof o=="number"?t.length>0?t[t.length-1]+=`[${o}]`:t.push(`[${o}]`):t.push(o)}return t.join(" · ")}function Q(e,t,r,o,s){if(Dt(e)){const i=e.variants,a=e.__resolveType,c=$t.test(a)?"":Pt(o);i.forEach((l,m)=>{if(!l||typeof l!="object")return;const p=l,h=[];if(pt(p.rule,h),h.length===0)return;const g=Ot(p.value)??(c||r);for(const u of h)s.push({blockKey:t,blockLabel:r,innerPath:c,variantIndex:m,start:u.start,end:u.end,openStart:u.openStart,openEnd:u.openEnd,label:g,flagResolveType:a})});for(let l=0;l<i.length;l++){const m=i[l];m&&typeof m=="object"&&Q(m.value,t,r,[...o,"variants",l,"value"],s)}return}if(Array.isArray(e)){for(let i=0;i<e.length;i++)Q(e[i],t,r,[...o,i],s);return}if(e&&typeof e=="object")for(const[i,a]of Object.entries(e))i!=="__resolveType"&&Q(a,t,r,[...o,i],s)}function It(e){if(!e)return[];const t=[];for(const[r,o]of Object.entries(e))Q(o,r,Lt(r),[],t);return t.sort((r,o)=>r.start.getTime()-o.start.getTime())}function Vt(e){const t=[...new Set(e)].sort(),r=new Map;return t.forEach((o,s)=>{const i=s*137.508%360;r.set(o,{bg:`oklch(0.62 0.14 ${i})`,text:"white",border:`oklch(0.50 0.14 ${i})`})}),r}const Ht={bg:"oklch(0.62 0.14 0)",text:"white",border:"oklch(0.50 0.14 0)"};function dt(e,t){return e.get(t)??Ht}const ot=new Intl.DateTimeFormat("en",{dateStyle:"medium",timeStyle:"short"});function Bt(e,t){const r=e.openStart?t("sandbox.variantCalendar.always"):ot.format(e.start),o=e.openEnd?t("sandbox.variantCalendar.ongoing"):ot.format(e.end);return`${r} → ${o}`}function Ft(e){const t=K.c(18),{variant:r}=e,o=X();let s;t[0]!==r.blockLabel?(s=n.jsx("div",{className:"font-semibold",children:r.blockLabel}),t[0]=r.blockLabel,t[1]=s):s=t[1];let i;t[2]!==r.innerPath?(i=r.innerPath&&n.jsx("div",{className:"text-muted-foreground",children:r.innerPath}),t[2]=r.innerPath,t[3]=i):i=t[3];let a;t[4]!==r.blockLabel||t[5]!==r.innerPath||t[6]!==r.label?(a=r.label!==r.blockLabel&&r.label!==r.innerPath&&n.jsx("div",{className:"text-muted-foreground",children:r.label}),t[4]=r.blockLabel,t[5]=r.innerPath,t[6]=r.label,t[7]=a):a=t[7];let c;t[8]!==o||t[9]!==r?(c=Bt(r,o),t[8]=o,t[9]=r,t[10]=c):c=t[10];let l;t[11]!==c?(l=n.jsx("div",{className:"mt-1",children:c}),t[11]=c,t[12]=l):l=t[12];let m;return t[13]!==s||t[14]!==i||t[15]!==a||t[16]!==l?(m=n.jsx(xt,{children:n.jsxs("div",{className:"text-xs",children:[s,i,a,l]})}),t[13]=s,t[14]=i,t[15]=a,t[16]=l,t[17]=m):m=t[17],m}const nt=16;function zt(e,t){const r=e?"transparent":"#000 0",o=t?"transparent":"#000 100%";if(!(!e&&!t))return`linear-gradient(to right, ${r}, #000 ${nt}px, #000 calc(100% - ${nt}px), ${o})`}function ft(e){const t=K.c(26),{variant:r,color:o,style:s,children:i,fadeStart:a,fadeEnd:c}=e,l=a===void 0?!1:a,m=c===void 0?!1:c;let p;t[0]!==m||t[1]!==l?(p=zt(l,m),t[0]=m,t[1]=l,t[2]=p):p=t[2];const h=p;let f;t[3]!==l?(f=l&&{borderTopLeftRadius:0,borderBottomLeftRadius:0},t[3]=l,t[4]=f):f=t[4];let g;t[5]!==m?(g=m&&{borderTopRightRadius:0,borderBottomRightRadius:0},t[5]=m,t[6]=g):g=t[6];let u;t[7]!==h?(u=h&&{maskImage:h,WebkitMaskImage:h},t[7]=h,t[8]=u):u=t[8];let x;t[9]!==o.bg||t[10]!==o.text||t[11]!==s||t[12]!==f||t[13]!==g||t[14]!==u?(x={background:o.bg,color:o.text,borderRadius:4,...f,...g,...u,...s},t[9]=o.bg,t[10]=o.text,t[11]=s,t[12]=f,t[13]=g,t[14]=u,t[15]=x):x=t[15];let b;t[16]!==i?(b=n.jsx("span",{className:"truncate",children:i}),t[16]=i,t[17]=b):b=t[17];let E;t[18]!==x||t[19]!==b?(E=n.jsx(ut,{asChild:!0,children:n.jsx("div",{className:"absolute flex items-center px-2 text-[11px] font-medium truncate cursor-default",style:x,children:b})}),t[18]=x,t[19]=b,t[20]=E):E=t[20];let T;t[21]!==r?(T=n.jsx(Ft,{variant:r}),t[21]=r,t[22]=T):T=t[22];let d;return t[23]!==T||t[24]!==E?(d=n.jsxs(ht,{children:[E,T]}),t[23]=T,t[24]=E,t[25]=d):d=t[25],d}function nn(e){const t=K.c(72),{decofile:r}=e,o=X(),[s,i]=Z.useState("calendar"),[a,c]=Z.useState(Kt),[l,m]=Z.useState(!1);let p,h,f;if(t[0]!==r||t[1]!==l){const I=It(r);p=I.filter(Ut).length,f=l?I:I.filter(Gt),h=Vt(f.map(Wt)),t[0]=r,t[1]=l,t[2]=p,t[3]=h,t[4]=f}else p=t[2],h=t[3],f=t[4];const g=h;let u;t[5]===Symbol.for("react.memo_cache_sentinel")?(u=()=>c(mt(new Date)),t[5]=u):u=t[5];const x=u;let b;t[6]!==s?(b=()=>c(I=>s==="calendar"?U(I,-1):U(I,-3)),t[6]=s,t[7]=b):b=t[7];const E=b;let T;t[8]!==s?(T=()=>c(I=>s==="calendar"?U(I,1):U(I,3)),t[8]=s,t[9]=T):T=t[9];const d=T;let v;t[10]!==o?(v=o("sandbox.variantCalendar.today"),t[10]=o,t[11]=v):v=t[11];let y;t[12]!==v?(y=n.jsx(tt,{variant:"outline",size:"sm",onClick:x,children:v}),t[12]=v,t[13]=y):y=t[13];let N;t[14]!==o?(N=o("sandbox.variantCalendar.previous"),t[14]=o,t[15]=N):N=t[15];let A;t[16]===Symbol.for("react.memo_cache_sentinel")?(A=n.jsx(gt,{size:16}),t[16]=A):A=t[16];let _;t[17]!==E||t[18]!==N?(_=n.jsx(tt,{variant:"ghost",size:"icon",className:"size-8",onClick:E,"aria-label":N,children:A}),t[17]=E,t[18]=N,t[19]=_):_=t[19];let k;t[20]!==o?(k=o("sandbox.variantCalendar.next"),t[20]=o,t[21]=k):k=t[21];let C;t[22]===Symbol.for("react.memo_cache_sentinel")?(C=n.jsx(vt,{size:16}),t[22]=C):C=t[22];let $;t[23]!==d||t[24]!==k?($=n.jsx(tt,{variant:"ghost",size:"icon",className:"size-8",onClick:d,"aria-label":k,children:C}),t[23]=d,t[24]=k,t[25]=$):$=t[25];const L=ct[a.getMonth()];let M;t[26]!==a?(M=a.getFullYear(),t[26]=a,t[27]=M):M=t[27];let w;t[28]!==L||t[29]!==M?(w=n.jsxs("h2",{className:"ml-2 text-base font-semibold",children:[L," ",M]}),t[28]=L,t[29]=M,t[30]=w):w=t[30];let j;t[31]!==$||t[32]!==w||t[33]!==y||t[34]!==_?(j=n.jsxs("div",{className:"flex items-center gap-2",children:[y,_,$,w]}),t[31]=$,t[32]=w,t[33]=y,t[34]=_,t[35]=j):j=t[35];let R;t[36]!==p||t[37]!==l||t[38]!==o?(R=p>0&&n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(jt,{id:"show-ongoing",checked:l,onCheckedChange:m}),n.jsx(yt,{htmlFor:"show-ongoing",className:"text-xs text-muted-foreground cursor-pointer",children:o("sandbox.variantCalendar.showOngoing",{count:p})})]}),t[36]=p,t[37]=l,t[38]=o,t[39]=R):R=t[39];let B;t[40]===Symbol.for("react.memo_cache_sentinel")?(B=n.jsx(at,{}),t[40]=B):B=t[40];let V;t[41]!==o?(V=o("sandbox.variantCalendar.calendarMode"),t[41]=o,t[42]=V):V=t[42];let S;t[43]!==V?(S={value:"calendar",icon:B,label:V},t[43]=V,t[44]=S):S=t[44];let F;t[45]===Symbol.for("react.memo_cache_sentinel")?(F=n.jsx(bt,{}),t[45]=F):F=t[45];let D;t[46]!==o?(D=o("sandbox.variantCalendar.timelineMode"),t[46]=o,t[47]=D):D=t[47];let O;t[48]!==D?(O={value:"timeline",icon:F,label:D},t[48]=D,t[49]=O):O=t[49];let P;t[50]!==S||t[51]!==O?(P=[S,O],t[50]=S,t[51]=O,t[52]=P):P=t[52];let H;t[53]!==P||t[54]!==s?(H=n.jsx(Tt,{value:s,onValueChange:i,options:P}),t[53]=P,t[54]=s,t[55]=H):H=t[55];let z;t[56]!==R||t[57]!==H?(z=n.jsxs("div",{className:"flex items-center gap-4",children:[R,H]}),t[56]=R,t[57]=H,t[58]=z):z=t[58];let W;t[59]!==j||t[60]!==z?(W=n.jsxs("div",{className:"flex items-center justify-between px-4 h-12 border-b shrink-0",children:[j,z]}),t[59]=j,t[60]=z,t[61]=W):W=t[61];let G;t[62]!==g||t[63]!==a||t[64]!==p||t[65]!==l||t[66]!==f||t[67]!==s?(G=f.length===0?n.jsx(Yt,{hiddenOngoing:l?0:p}):s==="calendar"?n.jsx(Jt,{monthStart:a,variants:f,colorMap:g}):n.jsx(te,{monthStart:a,variants:f,colorMap:g}),t[62]=g,t[63]=a,t[64]=p,t[65]=l,t[66]=f,t[67]=s,t[68]=G):G=t[68];let q;return t[69]!==W||t[70]!==G?(q=n.jsxs("div",{className:"flex h-full w-full flex-col",children:[W,G]}),t[69]=W,t[70]=G,t[71]=q):q=t[71],q}function Wt(e){return e.blockKey}function Gt(e){return!e.openEnd}function Ut(e){return e.openEnd}function Kt(){return mt(new Date)}function Yt(e){const t=K.c(4),{hiddenOngoing:r}=e,o=r===void 0?0:r,s=X();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(at,{size:24,className:"text-muted-foreground/60"}),t[0]=i):i=t[0];let a;return t[1]!==o||t[2]!==s?(a=n.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-2 text-center text-sm text-muted-foreground p-6",children:[i,o>0?n.jsxs(n.Fragment,{children:[n.jsx("div",{children:s("sandbox.variantCalendar.noDatedVariants")}),n.jsx("div",{className:"text-xs text-muted-foreground/80",children:s("sandbox.variantCalendar.hiddenOngoingVariants",{count:o})})]}):n.jsxs(n.Fragment,{children:[n.jsx("div",{children:s("sandbox.variantCalendar.noScheduledVariants")}),n.jsx("div",{className:"text-xs text-muted-foreground/80",children:s("sandbox.variantCalendar.dateMatcherInfo")})]})]}),t[1]=o,t[2]=s,t[3]=a):a=t[3],a}const et=20,it=2,st=28,qt=6;function Jt(e){const t=K.c(17),{monthStart:r,variants:o,colorMap:s}=e;let i,a,c,l,m;if(t[0]!==s||t[1]!==r||t[2]!==o){const f=Nt(r),g=_t(new Date);i=lt,m="flex-1 min-h-0",a="min-w-[840px]",t[8]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx("div",{className:"grid grid-cols-7 border-b text-xs text-muted-foreground sticky top-0 bg-background z-10",children:wt.map(Xt)}),t[8]=c):c=t[8],l=f.map((u,x)=>{const b=kt(u,o),E=b.reduce(Qt,0),T=st+E*(et+it)+8;return n.jsxs("div",{className:"grid grid-cols-7 relative border-b",style:{height:T},children:[u.map((d,v)=>{const y=d.getMonth()===r.getMonth(),N=d.getTime()===g.getTime();return n.jsx("div",{className:rt("border-r last:border-r-0 px-2 pt-1.5 text-xs",y?"bg-background":"bg-muted/30 text-muted-foreground"),children:n.jsx("span",{className:rt("inline-flex h-5 min-w-5 items-center justify-center rounded-full px-1",N&&"bg-primary text-primary-foreground font-semibold"),children:d.getDate()})},v)}),b.map((d,v)=>{const y=dt(s,d.variant.blockKey),N=st+d.lane*(et+it),A=d.leftUnits/7*100,_=d.widthUnits/7*100,k=d.variant.openStart&&x===0,C=d.variant.openEnd&&x===f.length-1;return n.jsxs(ft,{variant:d.variant,color:y,fadeStart:k,fadeEnd:C,style:{top:N,left:`calc(${A}% + 2px)`,width:`calc(${_}% - 4px)`,minWidth:qt,height:et},children:[d.variant.blockLabel,d.variant.label!==d.variant.blockLabel&&n.jsxs("span",{className:"opacity-70",children:[" · ",d.variant.label]})]},`${x}-${v}`)})]},x)}),t[0]=s,t[1]=r,t[2]=o,t[3]=i,t[4]=a,t[5]=c,t[6]=l,t[7]=m}else i=t[3],a=t[4],c=t[5],l=t[6],m=t[7];let p;t[9]!==a||t[10]!==c||t[11]!==l?(p=n.jsxs("div",{className:a,children:[c,l]}),t[9]=a,t[10]=c,t[11]=l,t[12]=p):p=t[12];let h;return t[13]!==i||t[14]!==m||t[15]!==p?(h=n.jsx(i,{className:m,children:p}),t[13]=i,t[14]=m,t[15]=p,t[16]=h):h=t[16],h}function Qt(e,t){return Math.max(e,t.lane+1)}function Xt(e){return n.jsx("div",{className:"px-2 py-2 text-center uppercase tracking-wide",children:e},e)}const J=4,Zt=32,Y=240;function te(e){const t=K.c(23),{monthStart:r,variants:o,colorMap:s}=e,i=r,a=U(r,J),c=new Date,l=new Map;for(const w of o){const j=l.get(w.blockKey)??[];j.push(w),l.set(w.blockKey,j)}const m=Array.from(l.entries()).sort(oe),p=a.getTime()-i.getTime(),h=w=>(Math.max(i.getTime(),Math.min(a.getTime(),w.getTime()))-i.getTime())/p*100;let f;t[0]!==i?(f=(w,j)=>U(i,j),t[0]=i,t[1]=f):f=t[1];const g=Array.from({length:J},f),u=c.getTime()>=i.getTime()&&c.getTime()<=a.getTime()?h(c):null,x=X(),b=lt,E="flex-1 min-h-0",T="min-w-[900px] relative";let d;t[2]===Symbol.for("react.memo_cache_sentinel")?(d={width:Y},t[2]=d):d=t[2];let v;t[3]!==x?(v=x("sandbox.variantCalendar.variantBlock"),t[3]=x,t[4]=v):v=t[4];let y;t[5]!==v?(y=n.jsx("div",{className:"shrink-0 px-3 py-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground border-r",style:d,children:v}),t[5]=v,t[6]=y):y=t[6];let N;t[7]===Symbol.for("react.memo_cache_sentinel")?(N={gridTemplateColumns:`repeat(${J}, minmax(0, 1fr))`},t[7]=N):N=t[7];const A=g.map(re);let _;t[8]!==A?(_=n.jsx("div",{className:"flex-1 grid",style:N,children:A}),t[8]=A,t[9]=_):_=t[9];let k;t[10]!==y||t[11]!==_?(k=n.jsxs("div",{className:"flex border-b sticky top-0 bg-background z-10",children:[y,_]}),t[10]=y,t[11]=_,t[12]=k):k=t[12];let C;t[13]!==x||t[14]!==u?(C=u!==null&&n.jsx("div",{className:"pointer-events-none absolute top-0 bottom-0 w-px bg-primary/70 z-[5]",style:{left:`calc(${Y}px + (100% - ${Y}px) * ${u} / 100)`},children:n.jsx("span",{className:"absolute -top-0.5 -translate-x-1/2 rounded-sm bg-primary px-1.5 py-px text-[10px] font-medium text-primary-foreground",children:x("sandbox.variantCalendar.todayLabel")})}),t[13]=x,t[14]=u,t[15]=C):C=t[15];const $=m.map(w=>{const[j,R]=w,B=dt(s,j),V=R[0]?.blockLabel??j;return n.jsxs("div",{children:[n.jsx("div",{className:"flex items-center bg-muted/40 border-b text-xs font-semibold uppercase tracking-wide text-muted-foreground",style:{height:28},children:n.jsx("div",{className:"px-3 truncate",style:{width:Y},children:V})}),R.map((S,F)=>n.jsxs("div",{className:"flex border-b items-center",style:{height:Zt},children:[n.jsxs("div",{className:"flex items-center gap-2 px-3 text-sm border-r shrink-0",style:{width:Y},children:[n.jsx("span",{className:"inline-block h-2 w-2 rounded-full shrink-0",style:{background:B.bg}}),n.jsx("span",{className:"truncate text-foreground/80",children:S.label})]}),n.jsxs("div",{className:"relative flex-1 h-full",children:[n.jsx("div",{className:"absolute inset-0 grid",style:{gridTemplateColumns:`repeat(${J}, minmax(0, 1fr))`},children:g.map(ee)}),(()=>{const D=Math.max(S.start.getTime(),i.getTime()),O=Math.min(S.end.getTime(),a.getTime());if(O<=D)return null;const P=h(new Date(D)),H=h(new Date(O))-P;return n.jsx(ft,{variant:S,color:B,fadeStart:S.openStart,fadeEnd:S.openEnd,style:{top:"50%",transform:"translateY(-50%)",left:`${P}%`,width:`calc(${H}% - 2px)`,height:22},children:S.label})})()]})]},F))]},j)});let L;t[16]!==k||t[17]!==C||t[18]!==$?(L=n.jsxs("div",{className:T,children:[k,C,$]}),t[16]=k,t[17]=C,t[18]=$,t[19]=L):L=t[19];let M;return t[20]!==b||t[21]!==L?(M=n.jsx(b,{className:E,children:L}),t[20]=b,t[21]=L,t[22]=M):M=t[22],M}function ee(e,t){return n.jsx("div",{className:"border-r last:border-r-0 border-border/40"},t)}function re(e,t){return n.jsxs("div",{className:"px-2 py-2 text-xs uppercase tracking-wide text-muted-foreground border-r last:border-r-0",children:[ct[e.getMonth()]?.slice(0,3)," ",e.getFullYear()]},t)}function oe(e,t){return e[0].localeCompare(t[0])}export{nn as VariantCalendar};
1
+ import{c as K,b as X,r as Z,j as n,l as rt,a1 as ut,a4 as ht,B as tt,a2 as xt}from"./index-BYFW0DhO.js";import{z as gt,a4 as at,aE as bt}from"./agent-icon-CLvBDlBI.js";import{i as vt}from"./ChevronRight-Cgzp06X7.js";import{L as yt}from"./label-ChpEwj_L.js";import{S as lt}from"./scroll-area-shLIOrXE.js";import{S as jt}from"./switch--5EfNQI5.js";import{V as Tt}from"./view-mode-toggle-CAwCj5Nl.js";import{bs as ct,bt as mt,bu as Nt,bv as _t,bw as kt,bx as U,by as wt}from"./index-CUOGPjNf.js";import"./AlertCircle-DkXErK78.js";import"./Tool01-Lpy5rhsr.js";import"./ArrowUp-BsH1JQDE.js";import"./ArrowLeft-nyFzJAF7.js";import"./Tool02-g0s22FxS.js";import"./XCircle-C-_3rX1F.js";import"./TrendUp01-DuwufgFk.js";import"./ZoomOut-BDRyaej7.js";import"./Users03-Dmh-Hpx0.js";import"./CheckCircle-DbWErBsi.js";import"./Check-DhPzBUin.js";import"./ChevronUp-BHEDGf01.js";import"./ChevronSelectorVertical-4msYrwrQ.js";import"./DotsVertical-CJKQ5OKe.js";import"./UserSquare-Dwn5UlhY.js";import"./Copy01-B2wknoSd.js";import"./CreditCard01-BqFQTNVJ.js";import"./Download01-B92LLlkv.js";import"./Settings02-C-aI-tWH.js";import"./Eye-COEW3kab.js";import"./Share07-BAIRkREV.js";import"./GitBranch01-BYv7lYbJ.js";import"./Globe01-CpHtL3_S.js";import"./XClose-wQ6j1uwj.js";import"./HardDrive-s6aHvTkZ.js";import"./Image01-DzmzghUe.js";import"./Key01-BE_KAWE-.js";import"./Link01-Bu-GiSBD.js";import"./LinkExternal01-B1ZpJJPQ.js";import"./Monitor01-B5pQXW2m.js";import"./Sun-BiuHyV4K.js";import"./Package-CVhm08ke.js";import"./Palette-BcF_s5q5.js";import"./Play-BtxbJVzC.js";import"./Plus-CsKngGuQ.js";import"./SearchMd-W7yXXDTJ.js";import"./Shield01-C4vXcSMh.js";import"./Stars01-0Qvp46bC.js";import"./Trash01-D7ZPlmCM.js";import"./Upload01-BG4c8c9K.js";import"./User01-DS4N984M.js";import"./Users01-D6PoAtch.js";import"./Zap-CX8wcGAM.js";import"./select-DtIUmOWr.js";import"./chat-context-DEDhjfBk.js";import"./use-panel-navigate-s8WzziEf.js";import"./use-destination-route-Yiz1Yyiq.js";import"./autosend-DVckbPpo.js";import"./thread-intent-BGpE5f0m.js";import"./slugify-CEUa2lfQ.js";import"./hooks-CypM9t3s.js";import"./use-mcp-client-B8KExIQP.js";import"./constants-BRGHAWVM.js";import"./auth-BEBPh5eQ.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-CPDW4Qwb.js";import"./task-board-DOll2CPC.js";import"./schema-UMHi6Dfe.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-WZp5R4vZ.js";import"./use-ai-providers-TPGH2tOh.js";import"./location-oTTXFrSF.js";import"./use-decopilot-events-R7r7gJde.js";import"./thread-route-Dnvi0Gyz.js";import"./dialog-U2qFdhAX.js";import"./use-organization-settings-xhFeNBEl.js";import"./automation-runs-D20mZNyW.js";import"./useInfiniteQuery-C6i4yfVE.js";import"./use-infinite-scroll-vUX1oplI.js";import"./use-connection-CTdE4vps.js";import"./table-DyTYCFjs.js";import"./empty-state-bjpeaW-Z.js";import"./use-members-BHp3tATO.js";import"./use-org-auth-client-CgYm4ea4.js";import"./use-automations-Cht-yWCv.js";import"./useSuspenseInfiniteQuery-CCla4NuB.js";import"./avatar-B8mdJCa-.js";import"./format-time-BtXRrtv4.js";import"./differenceInSeconds-C3x8sHUj.js";import"./use-copy-rWugYGnz.js";import"./markdown-BDX_1DK9.js";import"./monaco-editor-COGgBpMd.js";import"./editor-DNe4bLdj.js";import"./mcp-app-renderer-Cj0SSXRd.js";import"./types-QSIn08FY.js";import"./shell-layout-DcJ2OL9P.js";import"./project-icon-BwZ8B5Nt.js";import"./github-repo-COLY3wWI.js";import"./source-system-tabs-CnEGUb4r.js";import"./command-BYsoEu13.js";import"./index-DFjj2z0x.js";import"./required-auth-layout-BlZwF6cH.js";import"./use-org-sso-CeKGwleH.js";import"./use-org-notice-C5n8woPc.js";import"./integration-icon-BKkvkxjs.js";import"./use-navigate-to-agent-CUlgd9lK.js";import"./use-mcp-prompts-DqFxtfai.js";import"./form-8hUmXBGb.js";import"./input-C2C9h9WJ.js";import"./file-type-icon-CyHtRlEV.js";import"./drawer-CsIZzUcP.js";import"./collection-search-BZvxdZ2z.js";import"./tabs-C40AAyFe.js";import"./toggle-group-Bg9UxZnH.js";import"./task-route-DOwSG1cM.js";import"./extract-connection-data-BLCrhV7i.js";import"./metadata-dUsYcpuu.js";import"./connection-CHgRA4wn.js";import"./connection-card--LN_jYcC.js";import"./use-registry-connections-QYmYiae-.js";import"./retry-CErkP7V6.js";import"./connection-slug-CITJ0kGN.js";import"./textarea-BqKXwvHp.js";import"./connection-form-helpers--H0qnET4.js";import"./authenticate-and-persist-oauth-CawOOdZR.js";import"./mcp-oauth-C7fK1Egn.js";import"./collection-tabs-B3_daFGe.js";import"./badge-DtjY8TtR.js";import"./use-file-configs-LRMUkmhG.js";import"./site-slug-uya6Wp4-.js";import"./dropdown-menu-D_Miiz9f.js";import"./popover-CmOKcG2M.js";import"./github-icon-Cjn4Ny1J.js";import"./get-initials-D-f_fDFw.js";import"./select-model-DXeyWR4L.js";import"./checkbox-Be7jzOoS.js";import"./ai-providers-logos-DD3qZ33J.js";import"./folder-icon-DEEGyAQl.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-Bx6EMZ1N.js";import"./toolbar-Dov4ap4F.js";import"./skill-preview-CWU61utM.js";import"./pt-BR-z8aNQunR.js";import"./alert-dialog-DCuxpr9z.js";import"./use-debounced-autosave-B8o54x5H.js";import"./search-input-DTZZQgYe.js";import"./use-mcp-auth-status-3Q04dybz.js";import"./github-repo-picker-Z1yfkJA2.js";import"./use-debounced-value--9PTnjO2.js";import"./provision-repo-scoped-github-connection-WQFARyHG.js";import"./use-secrets-CiP4DqpE.js";import"./client-icons-D-00vmrI.js";import"./connect-layout-X-hnfLrm.js";import"./self-tool-result-D5oDSMGv.js";import"./track-DSv-HBp2.js";import"./use-tags-CU0743CE.js";import"./breadcrumb-CJ_vjC7z.js";import"./toolbar-icon-button-DNTK2U9T.js";import"./safe-image-url-D5z803Ot.js";import"./automation-list-row-BzTbowTj.js";import"./site-error--i37Vnuw.js";import"./cards-DhOPI6sE.js";const Et=new Set(["website/matchers/date.ts","$live/matchers/MatchDate.ts"]),St=new Set(["website/matchers/multi.ts","$live/matchers/MatchMulti.ts"]),Ct=new Date(-864e13),Mt=new Date(864e13),At=/\/flags\/multivariate(?:\/[^/]+)?\.ts$/,$t=/\/flags\/multivariate\.ts$/;function Lt(e){let t=e;t.startsWith("pages-")&&(t=t.slice(6).replace(/-\d+$/,""));try{t=decodeURIComponent(t)}catch{}return t}function Rt(e){if(!e||typeof e!="object")return null;const{start:t,end:r}=e,o=typeof t=="string",s=typeof r=="string";if(!o&&!s)return null;const i=o?new Date(t):Ct,a=s?new Date(r):Mt;return Number.isNaN(i.getTime())||Number.isNaN(a.getTime())||o&&s&&a.getTime()<=i.getTime()?null:{start:i,end:a,openStart:!o,openEnd:!s}}function pt(e,t){if(!e||typeof e!="object")return;const r=e.__resolveType;if(typeof r=="string"){if(Et.has(r)){const o=Rt(e);o&&t.push(o);return}if(St.has(r)){const o=e.matchers;if(Array.isArray(o))for(const s of o)pt(s,t)}}}function Dt(e){if(!e||typeof e!="object")return!1;const t=e.__resolveType;if(typeof t!="string"||!At.test(t))return!1;const r=e.variants;return Array.isArray(r)}function Ot(e){if(typeof e=="string"){const c=e.trim();if(c.length===0)return null;try{const m=new URL(c).pathname.split("/").filter(Boolean),p=m[m.length-1];if(p)return decodeURIComponent(p)}catch{}return c.length>80?`${c.slice(0,77)}…`:c}if(!e||typeof e!="object")return null;const t=e,r=t.config,s=t.desktop?.media,i=[t.title,t.name,t.label,t.alt,r?.title,r?.name,r?.typeAlert?.message,s?.alt,Array.isArray(t.matcher)?t.matcher[0]:void 0];for(const c of i)if(typeof c=="string"&&c.trim().length>0)return c.trim();const a=t.__resolveType;if(typeof a=="string"){const l=(a.split("/").pop()??a).replace(/\.(tsx?|jsx?)$/i,"");if(l.length>0)return l}return null}function Pt(e){const t=[];for(let r=0;r<e.length;r++){const o=e[r];typeof o=="number"?t.length>0?t[t.length-1]+=`[${o}]`:t.push(`[${o}]`):t.push(o)}return t.join(" · ")}function Q(e,t,r,o,s){if(Dt(e)){const i=e.variants,a=e.__resolveType,c=$t.test(a)?"":Pt(o);i.forEach((l,m)=>{if(!l||typeof l!="object")return;const p=l,h=[];if(pt(p.rule,h),h.length===0)return;const g=Ot(p.value)??(c||r);for(const u of h)s.push({blockKey:t,blockLabel:r,innerPath:c,variantIndex:m,start:u.start,end:u.end,openStart:u.openStart,openEnd:u.openEnd,label:g,flagResolveType:a})});for(let l=0;l<i.length;l++){const m=i[l];m&&typeof m=="object"&&Q(m.value,t,r,[...o,"variants",l,"value"],s)}return}if(Array.isArray(e)){for(let i=0;i<e.length;i++)Q(e[i],t,r,[...o,i],s);return}if(e&&typeof e=="object")for(const[i,a]of Object.entries(e))i!=="__resolveType"&&Q(a,t,r,[...o,i],s)}function It(e){if(!e)return[];const t=[];for(const[r,o]of Object.entries(e))Q(o,r,Lt(r),[],t);return t.sort((r,o)=>r.start.getTime()-o.start.getTime())}function Vt(e){const t=[...new Set(e)].sort(),r=new Map;return t.forEach((o,s)=>{const i=s*137.508%360;r.set(o,{bg:`oklch(0.62 0.14 ${i})`,text:"white",border:`oklch(0.50 0.14 ${i})`})}),r}const Ht={bg:"oklch(0.62 0.14 0)",text:"white",border:"oklch(0.50 0.14 0)"};function dt(e,t){return e.get(t)??Ht}const ot=new Intl.DateTimeFormat("en",{dateStyle:"medium",timeStyle:"short"});function Bt(e,t){const r=e.openStart?t("sandbox.variantCalendar.always"):ot.format(e.start),o=e.openEnd?t("sandbox.variantCalendar.ongoing"):ot.format(e.end);return`${r} → ${o}`}function Ft(e){const t=K.c(18),{variant:r}=e,o=X();let s;t[0]!==r.blockLabel?(s=n.jsx("div",{className:"font-semibold",children:r.blockLabel}),t[0]=r.blockLabel,t[1]=s):s=t[1];let i;t[2]!==r.innerPath?(i=r.innerPath&&n.jsx("div",{className:"text-muted-foreground",children:r.innerPath}),t[2]=r.innerPath,t[3]=i):i=t[3];let a;t[4]!==r.blockLabel||t[5]!==r.innerPath||t[6]!==r.label?(a=r.label!==r.blockLabel&&r.label!==r.innerPath&&n.jsx("div",{className:"text-muted-foreground",children:r.label}),t[4]=r.blockLabel,t[5]=r.innerPath,t[6]=r.label,t[7]=a):a=t[7];let c;t[8]!==o||t[9]!==r?(c=Bt(r,o),t[8]=o,t[9]=r,t[10]=c):c=t[10];let l;t[11]!==c?(l=n.jsx("div",{className:"mt-1",children:c}),t[11]=c,t[12]=l):l=t[12];let m;return t[13]!==s||t[14]!==i||t[15]!==a||t[16]!==l?(m=n.jsx(xt,{children:n.jsxs("div",{className:"text-xs",children:[s,i,a,l]})}),t[13]=s,t[14]=i,t[15]=a,t[16]=l,t[17]=m):m=t[17],m}const nt=16;function zt(e,t){const r=e?"transparent":"#000 0",o=t?"transparent":"#000 100%";if(!(!e&&!t))return`linear-gradient(to right, ${r}, #000 ${nt}px, #000 calc(100% - ${nt}px), ${o})`}function ft(e){const t=K.c(26),{variant:r,color:o,style:s,children:i,fadeStart:a,fadeEnd:c}=e,l=a===void 0?!1:a,m=c===void 0?!1:c;let p;t[0]!==m||t[1]!==l?(p=zt(l,m),t[0]=m,t[1]=l,t[2]=p):p=t[2];const h=p;let f;t[3]!==l?(f=l&&{borderTopLeftRadius:0,borderBottomLeftRadius:0},t[3]=l,t[4]=f):f=t[4];let g;t[5]!==m?(g=m&&{borderTopRightRadius:0,borderBottomRightRadius:0},t[5]=m,t[6]=g):g=t[6];let u;t[7]!==h?(u=h&&{maskImage:h,WebkitMaskImage:h},t[7]=h,t[8]=u):u=t[8];let x;t[9]!==o.bg||t[10]!==o.text||t[11]!==s||t[12]!==f||t[13]!==g||t[14]!==u?(x={background:o.bg,color:o.text,borderRadius:4,...f,...g,...u,...s},t[9]=o.bg,t[10]=o.text,t[11]=s,t[12]=f,t[13]=g,t[14]=u,t[15]=x):x=t[15];let b;t[16]!==i?(b=n.jsx("span",{className:"truncate",children:i}),t[16]=i,t[17]=b):b=t[17];let E;t[18]!==x||t[19]!==b?(E=n.jsx(ut,{asChild:!0,children:n.jsx("div",{className:"absolute flex items-center px-2 text-[11px] font-medium truncate cursor-default",style:x,children:b})}),t[18]=x,t[19]=b,t[20]=E):E=t[20];let T;t[21]!==r?(T=n.jsx(Ft,{variant:r}),t[21]=r,t[22]=T):T=t[22];let d;return t[23]!==T||t[24]!==E?(d=n.jsxs(ht,{children:[E,T]}),t[23]=T,t[24]=E,t[25]=d):d=t[25],d}function nn(e){const t=K.c(72),{decofile:r}=e,o=X(),[s,i]=Z.useState("calendar"),[a,c]=Z.useState(Kt),[l,m]=Z.useState(!1);let p,h,f;if(t[0]!==r||t[1]!==l){const I=It(r);p=I.filter(Ut).length,f=l?I:I.filter(Gt),h=Vt(f.map(Wt)),t[0]=r,t[1]=l,t[2]=p,t[3]=h,t[4]=f}else p=t[2],h=t[3],f=t[4];const g=h;let u;t[5]===Symbol.for("react.memo_cache_sentinel")?(u=()=>c(mt(new Date)),t[5]=u):u=t[5];const x=u;let b;t[6]!==s?(b=()=>c(I=>s==="calendar"?U(I,-1):U(I,-3)),t[6]=s,t[7]=b):b=t[7];const E=b;let T;t[8]!==s?(T=()=>c(I=>s==="calendar"?U(I,1):U(I,3)),t[8]=s,t[9]=T):T=t[9];const d=T;let v;t[10]!==o?(v=o("sandbox.variantCalendar.today"),t[10]=o,t[11]=v):v=t[11];let y;t[12]!==v?(y=n.jsx(tt,{variant:"outline",size:"sm",onClick:x,children:v}),t[12]=v,t[13]=y):y=t[13];let N;t[14]!==o?(N=o("sandbox.variantCalendar.previous"),t[14]=o,t[15]=N):N=t[15];let A;t[16]===Symbol.for("react.memo_cache_sentinel")?(A=n.jsx(gt,{size:16}),t[16]=A):A=t[16];let _;t[17]!==E||t[18]!==N?(_=n.jsx(tt,{variant:"ghost",size:"icon",className:"size-8",onClick:E,"aria-label":N,children:A}),t[17]=E,t[18]=N,t[19]=_):_=t[19];let k;t[20]!==o?(k=o("sandbox.variantCalendar.next"),t[20]=o,t[21]=k):k=t[21];let C;t[22]===Symbol.for("react.memo_cache_sentinel")?(C=n.jsx(vt,{size:16}),t[22]=C):C=t[22];let $;t[23]!==d||t[24]!==k?($=n.jsx(tt,{variant:"ghost",size:"icon",className:"size-8",onClick:d,"aria-label":k,children:C}),t[23]=d,t[24]=k,t[25]=$):$=t[25];const L=ct[a.getMonth()];let M;t[26]!==a?(M=a.getFullYear(),t[26]=a,t[27]=M):M=t[27];let w;t[28]!==L||t[29]!==M?(w=n.jsxs("h2",{className:"ml-2 text-base font-semibold",children:[L," ",M]}),t[28]=L,t[29]=M,t[30]=w):w=t[30];let j;t[31]!==$||t[32]!==w||t[33]!==y||t[34]!==_?(j=n.jsxs("div",{className:"flex items-center gap-2",children:[y,_,$,w]}),t[31]=$,t[32]=w,t[33]=y,t[34]=_,t[35]=j):j=t[35];let R;t[36]!==p||t[37]!==l||t[38]!==o?(R=p>0&&n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(jt,{id:"show-ongoing",checked:l,onCheckedChange:m}),n.jsx(yt,{htmlFor:"show-ongoing",className:"text-xs text-muted-foreground cursor-pointer",children:o("sandbox.variantCalendar.showOngoing",{count:p})})]}),t[36]=p,t[37]=l,t[38]=o,t[39]=R):R=t[39];let B;t[40]===Symbol.for("react.memo_cache_sentinel")?(B=n.jsx(at,{}),t[40]=B):B=t[40];let V;t[41]!==o?(V=o("sandbox.variantCalendar.calendarMode"),t[41]=o,t[42]=V):V=t[42];let S;t[43]!==V?(S={value:"calendar",icon:B,label:V},t[43]=V,t[44]=S):S=t[44];let F;t[45]===Symbol.for("react.memo_cache_sentinel")?(F=n.jsx(bt,{}),t[45]=F):F=t[45];let D;t[46]!==o?(D=o("sandbox.variantCalendar.timelineMode"),t[46]=o,t[47]=D):D=t[47];let O;t[48]!==D?(O={value:"timeline",icon:F,label:D},t[48]=D,t[49]=O):O=t[49];let P;t[50]!==S||t[51]!==O?(P=[S,O],t[50]=S,t[51]=O,t[52]=P):P=t[52];let H;t[53]!==P||t[54]!==s?(H=n.jsx(Tt,{value:s,onValueChange:i,options:P}),t[53]=P,t[54]=s,t[55]=H):H=t[55];let z;t[56]!==R||t[57]!==H?(z=n.jsxs("div",{className:"flex items-center gap-4",children:[R,H]}),t[56]=R,t[57]=H,t[58]=z):z=t[58];let W;t[59]!==j||t[60]!==z?(W=n.jsxs("div",{className:"flex items-center justify-between px-4 h-12 border-b shrink-0",children:[j,z]}),t[59]=j,t[60]=z,t[61]=W):W=t[61];let G;t[62]!==g||t[63]!==a||t[64]!==p||t[65]!==l||t[66]!==f||t[67]!==s?(G=f.length===0?n.jsx(Yt,{hiddenOngoing:l?0:p}):s==="calendar"?n.jsx(Jt,{monthStart:a,variants:f,colorMap:g}):n.jsx(te,{monthStart:a,variants:f,colorMap:g}),t[62]=g,t[63]=a,t[64]=p,t[65]=l,t[66]=f,t[67]=s,t[68]=G):G=t[68];let q;return t[69]!==W||t[70]!==G?(q=n.jsxs("div",{className:"flex h-full w-full flex-col",children:[W,G]}),t[69]=W,t[70]=G,t[71]=q):q=t[71],q}function Wt(e){return e.blockKey}function Gt(e){return!e.openEnd}function Ut(e){return e.openEnd}function Kt(){return mt(new Date)}function Yt(e){const t=K.c(4),{hiddenOngoing:r}=e,o=r===void 0?0:r,s=X();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(at,{size:24,className:"text-muted-foreground/60"}),t[0]=i):i=t[0];let a;return t[1]!==o||t[2]!==s?(a=n.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-2 text-center text-sm text-muted-foreground p-6",children:[i,o>0?n.jsxs(n.Fragment,{children:[n.jsx("div",{children:s("sandbox.variantCalendar.noDatedVariants")}),n.jsx("div",{className:"text-xs text-muted-foreground/80",children:s("sandbox.variantCalendar.hiddenOngoingVariants",{count:o})})]}):n.jsxs(n.Fragment,{children:[n.jsx("div",{children:s("sandbox.variantCalendar.noScheduledVariants")}),n.jsx("div",{className:"text-xs text-muted-foreground/80",children:s("sandbox.variantCalendar.dateMatcherInfo")})]})]}),t[1]=o,t[2]=s,t[3]=a):a=t[3],a}const et=20,it=2,st=28,qt=6;function Jt(e){const t=K.c(17),{monthStart:r,variants:o,colorMap:s}=e;let i,a,c,l,m;if(t[0]!==s||t[1]!==r||t[2]!==o){const f=Nt(r),g=_t(new Date);i=lt,m="flex-1 min-h-0",a="min-w-[840px]",t[8]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx("div",{className:"grid grid-cols-7 border-b text-xs text-muted-foreground sticky top-0 bg-background z-10",children:wt.map(Xt)}),t[8]=c):c=t[8],l=f.map((u,x)=>{const b=kt(u,o),E=b.reduce(Qt,0),T=st+E*(et+it)+8;return n.jsxs("div",{className:"grid grid-cols-7 relative border-b",style:{height:T},children:[u.map((d,v)=>{const y=d.getMonth()===r.getMonth(),N=d.getTime()===g.getTime();return n.jsx("div",{className:rt("border-r last:border-r-0 px-2 pt-1.5 text-xs",y?"bg-background":"bg-muted/30 text-muted-foreground"),children:n.jsx("span",{className:rt("inline-flex h-5 min-w-5 items-center justify-center rounded-full px-1",N&&"bg-primary text-primary-foreground font-semibold"),children:d.getDate()})},v)}),b.map((d,v)=>{const y=dt(s,d.variant.blockKey),N=st+d.lane*(et+it),A=d.leftUnits/7*100,_=d.widthUnits/7*100,k=d.variant.openStart&&x===0,C=d.variant.openEnd&&x===f.length-1;return n.jsxs(ft,{variant:d.variant,color:y,fadeStart:k,fadeEnd:C,style:{top:N,left:`calc(${A}% + 2px)`,width:`calc(${_}% - 4px)`,minWidth:qt,height:et},children:[d.variant.blockLabel,d.variant.label!==d.variant.blockLabel&&n.jsxs("span",{className:"opacity-70",children:[" · ",d.variant.label]})]},`${x}-${v}`)})]},x)}),t[0]=s,t[1]=r,t[2]=o,t[3]=i,t[4]=a,t[5]=c,t[6]=l,t[7]=m}else i=t[3],a=t[4],c=t[5],l=t[6],m=t[7];let p;t[9]!==a||t[10]!==c||t[11]!==l?(p=n.jsxs("div",{className:a,children:[c,l]}),t[9]=a,t[10]=c,t[11]=l,t[12]=p):p=t[12];let h;return t[13]!==i||t[14]!==m||t[15]!==p?(h=n.jsx(i,{className:m,children:p}),t[13]=i,t[14]=m,t[15]=p,t[16]=h):h=t[16],h}function Qt(e,t){return Math.max(e,t.lane+1)}function Xt(e){return n.jsx("div",{className:"px-2 py-2 text-center uppercase tracking-wide",children:e},e)}const J=4,Zt=32,Y=240;function te(e){const t=K.c(23),{monthStart:r,variants:o,colorMap:s}=e,i=r,a=U(r,J),c=new Date,l=new Map;for(const w of o){const j=l.get(w.blockKey)??[];j.push(w),l.set(w.blockKey,j)}const m=Array.from(l.entries()).sort(oe),p=a.getTime()-i.getTime(),h=w=>(Math.max(i.getTime(),Math.min(a.getTime(),w.getTime()))-i.getTime())/p*100;let f;t[0]!==i?(f=(w,j)=>U(i,j),t[0]=i,t[1]=f):f=t[1];const g=Array.from({length:J},f),u=c.getTime()>=i.getTime()&&c.getTime()<=a.getTime()?h(c):null,x=X(),b=lt,E="flex-1 min-h-0",T="min-w-[900px] relative";let d;t[2]===Symbol.for("react.memo_cache_sentinel")?(d={width:Y},t[2]=d):d=t[2];let v;t[3]!==x?(v=x("sandbox.variantCalendar.variantBlock"),t[3]=x,t[4]=v):v=t[4];let y;t[5]!==v?(y=n.jsx("div",{className:"shrink-0 px-3 py-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground border-r",style:d,children:v}),t[5]=v,t[6]=y):y=t[6];let N;t[7]===Symbol.for("react.memo_cache_sentinel")?(N={gridTemplateColumns:`repeat(${J}, minmax(0, 1fr))`},t[7]=N):N=t[7];const A=g.map(re);let _;t[8]!==A?(_=n.jsx("div",{className:"flex-1 grid",style:N,children:A}),t[8]=A,t[9]=_):_=t[9];let k;t[10]!==y||t[11]!==_?(k=n.jsxs("div",{className:"flex border-b sticky top-0 bg-background z-10",children:[y,_]}),t[10]=y,t[11]=_,t[12]=k):k=t[12];let C;t[13]!==x||t[14]!==u?(C=u!==null&&n.jsx("div",{className:"pointer-events-none absolute top-0 bottom-0 w-px bg-primary/70 z-[5]",style:{left:`calc(${Y}px + (100% - ${Y}px) * ${u} / 100)`},children:n.jsx("span",{className:"absolute -top-0.5 -translate-x-1/2 rounded-sm bg-primary px-1.5 py-px text-[10px] font-medium text-primary-foreground",children:x("sandbox.variantCalendar.todayLabel")})}),t[13]=x,t[14]=u,t[15]=C):C=t[15];const $=m.map(w=>{const[j,R]=w,B=dt(s,j),V=R[0]?.blockLabel??j;return n.jsxs("div",{children:[n.jsx("div",{className:"flex items-center bg-muted/40 border-b text-xs font-semibold uppercase tracking-wide text-muted-foreground",style:{height:28},children:n.jsx("div",{className:"px-3 truncate",style:{width:Y},children:V})}),R.map((S,F)=>n.jsxs("div",{className:"flex border-b items-center",style:{height:Zt},children:[n.jsxs("div",{className:"flex items-center gap-2 px-3 text-sm border-r shrink-0",style:{width:Y},children:[n.jsx("span",{className:"inline-block h-2 w-2 rounded-full shrink-0",style:{background:B.bg}}),n.jsx("span",{className:"truncate text-foreground/80",children:S.label})]}),n.jsxs("div",{className:"relative flex-1 h-full",children:[n.jsx("div",{className:"absolute inset-0 grid",style:{gridTemplateColumns:`repeat(${J}, minmax(0, 1fr))`},children:g.map(ee)}),(()=>{const D=Math.max(S.start.getTime(),i.getTime()),O=Math.min(S.end.getTime(),a.getTime());if(O<=D)return null;const P=h(new Date(D)),H=h(new Date(O))-P;return n.jsx(ft,{variant:S,color:B,fadeStart:S.openStart,fadeEnd:S.openEnd,style:{top:"50%",transform:"translateY(-50%)",left:`${P}%`,width:`calc(${H}% - 2px)`,height:22},children:S.label})})()]})]},F))]},j)});let L;t[16]!==k||t[17]!==C||t[18]!==$?(L=n.jsxs("div",{className:T,children:[k,C,$]}),t[16]=k,t[17]=C,t[18]=$,t[19]=L):L=t[19];let M;return t[20]!==b||t[21]!==L?(M=n.jsx(b,{className:E,children:L}),t[20]=b,t[21]=L,t[22]=M):M=t[22],M}function ee(e,t){return n.jsx("div",{className:"border-r last:border-r-0 border-border/40"},t)}function re(e,t){return n.jsxs("div",{className:"px-2 py-2 text-xs uppercase tracking-wide text-muted-foreground border-r last:border-r-0",children:[ct[e.getMonth()]?.slice(0,3)," ",e.getFullYear()]},t)}function oe(e,t){return e[0].localeCompare(t[0])}export{nn as VariantCalendar};
@@ -1 +1 @@
1
- import{c as $,r as C,l as f,j as i,a4 as k,a1 as I,a2 as P}from"./index-weBGyocH.js";const M={sm:{button:"size-7",buttonWithLabel:"h-7",icon:"size-4"},md:{button:"size-9",buttonWithLabel:"h-9",icon:"size-5"},lg:{button:"size-12",buttonWithLabel:"h-12",icon:"size-6"}};function A(E){const t=$.c(27),{value:s,onValueChange:y,options:o,size:L,fullWidth:R,className:z}=E,_=L===void 0?"sm":L,m=R===void 0?!1:R;let h;t[0]===Symbol.for("react.memo_cache_sentinel")?(h=[],t[0]=h):h=t[0];const T=C.useRef(h);let x;t[1]===Symbol.for("react.memo_cache_sentinel")?(x={left:0,width:0,opacity:0},t[1]=x):x=t[1];const[d,S]=C.useState(x);let g,p;t[2]!==o||t[3]!==s?(g=()=>{const e=o.findIndex(j=>j.value===s),b=T.current[e];b&&S({left:b.offsetLeft,width:b.offsetWidth,opacity:1})},p=[s,o],t[2]=o,t[3]=s,t[4]=g,t[5]=p):(g=t[4],p=t[5]),C.useEffect(g,p);const l=M[_];let n;t[6]!==z?(n=f("relative flex gap-0 bg-muted rounded-lg",z),t[6]=z,t[7]=n):n=t[7];let a;t[8]!==l||t[9]!==m||t[10]!==y||t[11]!==o||t[12]!==s?(a=o.map((e,b)=>{const j=i.jsxs("button",{ref:V=>{T.current[b]=V},type:"button",onClick:()=>y(e.value),"aria-label":e.label,className:f("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",m?"flex-1 h-12 px-4":e.label?f(l.buttonWithLabel,"px-3"):l.button),children:[i.jsx("span",{className:f("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",l.icon,s===e.value?"text-foreground":"text-muted-foreground"),children:e.icon}),e.label&&i.jsx("span",{className:f("text-xs transition-colors ease-out duration-200 whitespace-nowrap",s===e.value?"text-foreground":"text-muted-foreground"),children:e.label})]},e.value);return e.tooltip?i.jsxs(k,{children:[i.jsx(I,{asChild:!0,children:j}),i.jsx(P,{side:"bottom",children:e.tooltip})]},e.value):j}),t[8]=l,t[9]=m,t[10]=y,t[11]=o,t[12]=s,t[13]=a):a=t[13];const w=m?"h-12":l.button;let r;t[14]!==w?(r=f("absolute z-0 bg-background rounded-lg border-shadow transition-all [transition-timing-function:var(--ease-out-cubic)] duration-200",w),t[14]=w,t[15]=r):r=t[15];const W=`${d.left}px`,N=`${d.width}px`;let c;t[16]!==d.opacity||t[17]!==W||t[18]!==N?(c={left:W,width:N,opacity:d.opacity},t[16]=d.opacity,t[17]=W,t[18]=N,t[19]=c):c=t[19];let u;t[20]!==r||t[21]!==c?(u=i.jsx("div",{className:r,style:c}),t[20]=r,t[21]=c,t[22]=u):u=t[22];let v;return t[23]!==u||t[24]!==n||t[25]!==a?(v=i.jsxs("div",{className:n,children:[a,u]}),t[23]=u,t[24]=n,t[25]=a,t[26]=v):v=t[26],v}export{A as V};
1
+ import{c as $,r as C,l as f,j as i,a4 as k,a1 as I,a2 as P}from"./index-BYFW0DhO.js";const M={sm:{button:"size-7",buttonWithLabel:"h-7",icon:"size-4"},md:{button:"size-9",buttonWithLabel:"h-9",icon:"size-5"},lg:{button:"size-12",buttonWithLabel:"h-12",icon:"size-6"}};function A(E){const t=$.c(27),{value:s,onValueChange:y,options:o,size:L,fullWidth:R,className:z}=E,_=L===void 0?"sm":L,m=R===void 0?!1:R;let h;t[0]===Symbol.for("react.memo_cache_sentinel")?(h=[],t[0]=h):h=t[0];const T=C.useRef(h);let x;t[1]===Symbol.for("react.memo_cache_sentinel")?(x={left:0,width:0,opacity:0},t[1]=x):x=t[1];const[d,S]=C.useState(x);let g,p;t[2]!==o||t[3]!==s?(g=()=>{const e=o.findIndex(j=>j.value===s),b=T.current[e];b&&S({left:b.offsetLeft,width:b.offsetWidth,opacity:1})},p=[s,o],t[2]=o,t[3]=s,t[4]=g,t[5]=p):(g=t[4],p=t[5]),C.useEffect(g,p);const l=M[_];let n;t[6]!==z?(n=f("relative flex gap-0 bg-muted rounded-lg",z),t[6]=z,t[7]=n):n=t[7];let a;t[8]!==l||t[9]!==m||t[10]!==y||t[11]!==o||t[12]!==s?(a=o.map((e,b)=>{const j=i.jsxs("button",{ref:V=>{T.current[b]=V},type:"button",onClick:()=>y(e.value),"aria-label":e.label,className:f("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",m?"flex-1 h-12 px-4":e.label?f(l.buttonWithLabel,"px-3"):l.button),children:[i.jsx("span",{className:f("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",l.icon,s===e.value?"text-foreground":"text-muted-foreground"),children:e.icon}),e.label&&i.jsx("span",{className:f("text-xs transition-colors ease-out duration-200 whitespace-nowrap",s===e.value?"text-foreground":"text-muted-foreground"),children:e.label})]},e.value);return e.tooltip?i.jsxs(k,{children:[i.jsx(I,{asChild:!0,children:j}),i.jsx(P,{side:"bottom",children:e.tooltip})]},e.value):j}),t[8]=l,t[9]=m,t[10]=y,t[11]=o,t[12]=s,t[13]=a):a=t[13];const w=m?"h-12":l.button;let r;t[14]!==w?(r=f("absolute z-0 bg-background rounded-lg border-shadow transition-all [transition-timing-function:var(--ease-out-cubic)] duration-200",w),t[14]=w,t[15]=r):r=t[15];const W=`${d.left}px`,N=`${d.width}px`;let c;t[16]!==d.opacity||t[17]!==W||t[18]!==N?(c={left:W,width:N,opacity:d.opacity},t[16]=d.opacity,t[17]=W,t[18]=N,t[19]=c):c=t[19];let u;t[20]!==r||t[21]!==c?(u=i.jsx("div",{className:r,style:c}),t[20]=r,t[21]=c,t[22]=u):u=t[22];let v;return t[23]!==u||t[24]!==n||t[25]!==a?(v=i.jsxs("div",{className:n,children:[a,u]}),t[23]=u,t[24]=n,t[25]=a,t[26]=v):v=t[26],v}export{A as V};
@@ -50,7 +50,7 @@
50
50
  <meta name="twitter:description" content="Hire specialized agents, give them access to your tools, and let them deliver real projects — with planning, verification, and observability built in." />
51
51
  <meta name="twitter:image" content="/og-image.png" />
52
52
  <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
53
- <script type="module" crossorigin src="/assets/index-weBGyocH.js"></script>
53
+ <script type="module" crossorigin src="/assets/index-BYFW0DhO.js"></script>
54
54
  <link rel="stylesheet" crossorigin href="/assets/index-X9REA_uV.css">
55
55
  </head>
56
56
  <body>
@@ -1562,7 +1562,7 @@ Usage: deco services <up|down|status>`),process.exit(1)}}var At1=D(()=>{Sb()});f
1562
1562
  `.execute($);if(Number(W.rows[0]?.cnt)===0){console.warn(`Failed to migrate ${G}/${K}, keeping in old table`);continue}}await Qg`
1563
1563
  DELETE FROM kysely_migration WHERE name = ${Q}
1564
1564
  `.execute($)}}async function _e1($){await z14($),await P14($);let Z=new Se1({db:$,provider:{getMigrations:()=>Promise.resolve(Wt0)}}),{error:Q,results:X}=await Z.migrateToLatest(),Y=0;if(X?.forEach((J)=>{if(J.status==="Success")Y++;else if(J.status==="Error")console.error(`Failed to execute migration "${J.migrationName}"`)}),Q)throw console.error("Failed to migrate"),console.error(Q),Q;return Y}async function A14($){let{keepOpen:Z=!1,database:Q,skipBetterAuth:X=!1}=$??{},Y="skipped";if(!X&&!Q)Y=await lm0();let J=Q??g$(),G=async()=>{if(!Z&&!Q)await DO(J).catch((K)=>{console.warn("Warning: Error closing database:",K)})};try{let K=await _e1(J.db);return await G(),{betterAuth:Y,kysely:K}}catch(K){throw await G(),K}}async function T14(){let $=g$(),Z=new Se1({db:$.db,provider:{getMigrations:()=>Promise.resolve(Wt0)}}),{error:Q,results:X}=await Z.migrateDown();if(X?.forEach((Y)=>{if(Y.status==="Success")console.log(`\u2705 Migration "${Y.migrationName}" rolled back successfully`);else if(Y.status==="Error")console.error(`\u274C Failed to rollback migration "${Y.migrationName}"`)}),Q)throw console.error("Failed to rollback migration"),console.error(Q),Q}var xe1=D(()=>{ke1();mm0();WQ()});async function JQ0($){let Z={...process.env},Q=r80($,Z);console.log(RE1(Q.settings.encryptionKey));let X=Q.settings.betterAuthSecret||(Q.settings.localMode?$r1(Q.settings.dataDir):""),{ensureServices:Y}=await Promise.resolve().then(() => (W70(),K70)),{outputs:J,services:G}=await Y({home:Q.settings.dataDir,externalDatabaseUrl:Q.externalDatabaseUrl,externalNatsUrl:Q.externalNatsUrl});if(!Q.skipMigrations){let{migrateBetterAuth:W}=await Promise.resolve().then(() => (mm0(),Qr1));await W(J.databaseUrl);let{createDatabase:H}=await Promise.resolve().then(() => (WQ(),jo1)),{migrateToLatest:F}=await Promise.resolve().then(() => (xe1(),ve1)),U=H(J.databaseUrl);await F({keepOpen:!0,database:U,skipBetterAuth:!0})}let K={...Q.settings,betterAuthSecret:X,databaseUrl:J.databaseUrl,natsUrls:J.natsUrls,...J.s3?{s3Endpoint:J.s3.endpoint,s3Bucket:J.s3.bucket,s3AccessKeyId:J.s3.accessKeyId,s3SecretAccessKey:J.s3.secretAccessKey,s3ForcePathStyle:J.s3.forcePathStyle}:{}};return Tt1(K),{settings:K,services:G.map((W)=>({name:W.name==="PostgreSQL"?"Postgres":W.name,port:W.port})),managedServiceNames:G.filter((W)=>W.owner==="managed").map((W)=>W.name)}}var Ht0=D(()=>{Sb();Zr1();z$()});var ge1={};e(ge1,{updateService:()=>JE,subscribeCliState:()=>Nt0,setTuiConsoleIntercepted:()=>GQ0,setServerUrl:()=>ep,setMigrationsDone:()=>sp,setDevMode:()=>I14,resetCliStateForTests:()=>R14,isTuiConsoleIntercepted:()=>KQ0,getCliState:()=>Ut0,addLogEntry:()=>AO});function fe1(){return[{name:"Postgres",status:"pending",port:0},{name:"NATS",status:"pending",port:0}]}function be1(){return{services:fe1(),migrationsStatus:"pending",serverUrl:null,logs:[]}}function R14(){aX=be1()}function ap(){for(let $ of Ft0)$()}function Ut0(){return aX}function Nt0($){return Ft0.add($),()=>Ft0.delete($)}function JE($){aX={...aX,services:aX.services.map((Z)=>Z.name===$.name?$:Z)},ap()}function sp(){aX={...aX,migrationsStatus:"done"},ap()}function ep($){aX={...aX,serverUrl:$},ap()}function AO($){let Z=[...aX.logs,$];aX={...aX,logs:Z.length>500?Z.slice(-500):Z},ap()}function I14(){aX={...aX,services:[...fe1(),{name:"API",status:"pending",port:0},{name:"Vite",status:"pending",port:0}]},ap()}function GQ0($){ye1=$}function KQ0(){return ye1}var aX,Ft0,ye1=!1;var GE=D(()=>{aX=be1();Ft0=new Set});import{createServer as he1}from"net";function q14($){return new Promise((Z)=>{let Q=he1();Q.once("error",()=>Z(!1)),Q.listen($,"0.0.0.0",()=>{Q.close(()=>Z(!0))})})}async function $n($){if(await q14($))return $;let Z=await new Promise((Q,X)=>{let Y=he1();Y.once("error",X),Y.listen(0,"0.0.0.0",()=>{let J=Y.address(),G=typeof J==="object"&&J?J.port:0;Y.close(()=>Q(G))})});return console.warn(`Port ${$} is in use, using port ${Z} instead.`),Z}var Bt0=()=>{};var Dt0={};e(Dt0,{startDevServer:()=>V14,pipeToLogStore:()=>Ot0});import{join as M14}from"path";function Ot0($){let Z=$.getReader(),Q=new TextDecoder,X="";function Y(){let J=X.split(`
1565
- `);X=J.pop()??"";for(let G of J){let K=Bun.stripANSI(G).replace(/^\[\d+\]\s*/,"").trim();if(!K)continue;AO({method:"",path:"",status:0,duration:0,timestamp:new Date,rawLine:K})}}(async()=>{try{for(;;){let{done:J,value:G}=await Z.read();if(J)break;X+=Q.decode(G,{stream:!0}),Y()}}catch{}if(X.trim()){let J=Bun.stripANSI(X).replace(/^\[\d+\]\s*/,"").trim();if(J)AO({method:"",path:"",status:0,duration:0,timestamp:new Date,rawLine:J})}})()}async function V14($){let{baseUrl:Z,noTui:Q}=$,X=process.env.HOST==="0.0.0.0"&&Boolean(process.env.PORT),Y=X?process.env.PORT:$.vitePort,J=Z||`http://localhost:${Y}`,G=X?await $n(Number(Y)+1):await $n(Number($.port)),{settings:K,services:W,managedServiceNames:H}=await JQ0({port:String(G),home:$.home,baseUrl:$.baseUrl,localMode:$.localMode,skipMigrations:$.skipMigrations,noTui:$.noTui,vitePort:$.vitePort});for(let L of W)JE({name:L.name,status:"ready",port:L.port});sp();let F=M14(import.meta.dir,"..","..","..","..",".."),U=Q===!0,N=Bun.spawn(["bun","run","dev:servers"],{cwd:F,env:{...process.env,PORT:String(K.port),VITE_PORT:String(Y),DATABASE_URL:K.databaseUrl,NATS_URL:K.natsUrls.join(","),NODE_ENV:K.nodeEnv,BASE_URL:J,DECOCMS_LOCAL_MODE:String(K.localMode),DECOCMS_HOME:K.dataDir,DATA_DIR:K.dataDir,DECO_CLI:"1",...K.betterAuthSecret?{BETTER_AUTH_SECRET:K.betterAuthSecret}:{},...K.s3Endpoint?{S3_ENDPOINT:K.s3Endpoint,S3_BUCKET:K.s3Bucket??"",S3_ACCESS_KEY_ID:K.s3AccessKeyId??"",S3_SECRET_ACCESS_KEY:K.s3SecretAccessKey??"",S3_FORCE_PATH_STYLE:String(K.s3ForcePathStyle)}:{},...K.natsCredsPath?{NATS_CREDS:K.natsCredsPath}:{}},stdio:["inherit",U?"inherit":"pipe",U?"inherit":"pipe"]});if(!U)Ot0(N.stdout),Ot0(N.stderr);ep(J),JE({name:"Vite",status:"ready",port:Number(Y)}),JE({name:"API",status:"ready",port:Number(K.port)});let O=async(L)=>{if(N.kill(L),await N.exited,H.length>0){let{stopServices:w}=await Promise.resolve().then(() => (W70(),K70));await w(K.dataDir)}};return process.on("SIGINT",()=>O("SIGINT")),process.on("SIGTERM",()=>O("SIGTERM")),{port:Number(Y),process:N}}var Lt0=D(()=>{Ht0();GE();Bt0()});var WQ0;var wt0=D(()=>{WQ0={name:"decocms",version:"4.335.4",description:"Deco CMS \u2014 Self-hostable MCP Gateway for managing AI connections and tools",author:"Deco team",repository:{type:"git",url:"git+https://github.com/decocms/studio.git",directory:"apps/api"},bugs:{url:"https://github.com/decocms/studio/issues"},type:"module",bin:{deco:"./dist/server/cli.js"},files:["dist/**/*"],scripts:{dev:"bun run migrate && bun run dev:server","dev:server":"bun run --cwd=../../packages/sandbox build && NODE_ENV=development bun --env-file=.env --hot run src/index.ts",build:"bun run build:server","build:server":"bun run scripts/bundle-server-script.ts --dist ./dist/server","generate:tool-contracts":"bun run scripts/generate-tool-contracts.ts","db:migrate":"bun run ./dist/server/migrate.js","db:migrate:dbos":"bun run ./dist/server/migrate-dbos.js",check:"tsc --noEmit",start:"bun run ./dist/server/server.js",migrate:"bun run src/database/migrate.ts","migrate:dbos":"bun run src/database/migrate-dbos.ts",test:"bun test src","better-auth:migrate":"bunx --bun @better-auth/cli migrate -y --config src/auth/index.ts",prepublishOnly:"bun run --cwd=../.. build:studio"},optionalDependencies:{"@duckdb/node-api":"^1.5.0-r.1"},dependencies:{"@ai-sdk/anthropic":"^3.0.85","@ai-sdk/google":"^3.0.83","@ai-sdk/openai":"^3.0.73","@anthropic-ai/sdk":"^0.105.0","@aws-sdk/client-s3":"^3.1013.0","@aws-sdk/client-sts":"^3.1013.0","@aws-sdk/lib-storage":"^3.1013.0","@aws-sdk/s3-request-presigner":"^3.1013.0","@clickhouse/client":"^1.8.1","@dbos-inc/dbos-sdk":"^4.21.6","@inkjs/ui":"^2.0.0","@nats-io/jetstream":"3.4.0","@nats-io/kv":"3.4.0","@nats-io/nats-core":"3.4.0","@nats-io/transport-node":"3.4.0","@openrouter/ai-sdk-provider":"^2.9.1","@opentelemetry/core":"^2.6.0","embedded-postgres":"^18.3.0-beta.16",ink:"^6.8.0",kysely:"^0.28.12","posthog-node":"^5.0.0",react:"^19.2.6","react-dom":"^19.2.6"},devDependencies:{"@ai-sdk/provider":"^3.0.10","@better-auth/sso":"1.4.1","@decocms/better-auth":"1.5.17","@decocms/bindings":"workspace:*","@decocms/mcp-utils":"workspace:*","@decocms/runtime":"workspace:*","@decocms/sandbox":"workspace:*","@decocms/shared":"workspace:*","@jitl/quickjs-wasmfile-release-sync":"0.31.0","@modelcontextprotocol/sdk":"1.29.0","@opentelemetry/api":"^1.9.0","@opentelemetry/api-logs":"^0.211.0","@opentelemetry/exporter-logs-otlp-proto":"^0.211.0","@opentelemetry/exporter-prometheus":"^0.208.0","@opentelemetry/exporter-trace-otlp-proto":"^0.207.0","@opentelemetry/instrumentation-runtime-node":"^0.24.0","@opentelemetry/resources":"^2.6.0","@opentelemetry/sdk-logs":"^0.211.0","@opentelemetry/sdk-metrics":"^2.2.0","@opentelemetry/sdk-node":"^0.207.0","@opentelemetry/sdk-trace-base":"^2.5.0","@types/bun":"^1.3.1","@types/google.maps":"^3.65.2","@types/pg":"^8.15.6","@types/react-syntax-highlighter":"^15.5.13","@vercel/nft":"^1.1.1",ai:"^6.0.208","better-auth":"1.4.22",croner:"^9.1.0",degit:"^2.8.4",hono:"^4.10.7",jose:"^6.0.11",nanoid:"^5.1.6",pg:"^8.16.3",typescript:"^7.0.2",typescript5:"npm:typescript@^5.9.3",zod:"4.3.6"},homepage:"https://github.com/decocms/studio",keywords:["mcp","model-context-protocol","ai","gateway","self-hosted","tools"],license:"MIT",publishConfig:{access:"public"}}});import{Box as S14,Text as ue1}from"ink";import{jsx as C14,jsxs as ce1}from"react/jsx-runtime";function le1({version:$}){return ce1(S14,{flexDirection:"column",marginTop:1,children:[C70.map((Z,Q)=>C14(ue1,{color:_70[Q],children:Z},Q)),ce1(ue1,{dimColor:!0,children:[" v",$]})]})}var me1=D(()=>{gp()});import{Box as KE,Text as TO}from"ink";import{Spinner as _14}from"@inkjs/ui";import{jsx as UJ,jsxs as Xg}from"react/jsx-runtime";function de1({status:$}){if($==="pending")return UJ(_14,{label:""});return UJ(TO,{color:"green",children:"\u2713"})}function v14($){return`${$.name}: ${$.port||"...."}`}function ie1({services:$,migrationsStatus:Z,home:Q,serverUrl:X}){return Xg(KE,{flexDirection:"column",paddingBottom:1,children:[UJ(le1,{version:WQ0.version}),UJ(KE,{marginBottom:1,children:UJ(TO,{dimColor:!0,children:"\u2500".repeat(80)})}),UJ(KE,{children:Xg(TO,{dimColor:!0,children:["Home: ",Q]})}),Xg(KE,{gap:2,children:[$.map((Y)=>Xg(KE,{gap:1,children:[UJ(TO,{children:v14(Y)}),UJ(de1,{status:Y.status})]},Y.name)),Xg(KE,{gap:1,children:[UJ(TO,{children:"Migrations"}),UJ(de1,{status:Z})]})]}),UJ(KE,{children:X?Xg(TO,{children:["Open in browser: ",UJ(TO,{color:"cyan",children:X})]}):UJ(TO,{dimColor:!0,children:"Starting..."})})]})}var pe1=D(()=>{wt0();me1()});import{Box as x14,Text as Zn}from"ink";import{jsx as jt0,jsxs as Et0}from"react/jsx-runtime";function f14($){if($>=500)return"red";if($>=400)return"yellow";if($>=300)return"cyan";return"green"}function ne1({logs:$}){return jt0(x14,{flexDirection:"column",children:$.map((Z,Q)=>{if(Z.rawLine)return jt0(Zn,{dimColor:!0,children:Z.rawLine},Q);let X=Z.duration<1000?`${Z.duration}ms`:`${(Z.duration/1000).toFixed(1)}s`;return Et0(Zn,{children:[Et0(Zn,{dimColor:!0,children:[Z.method.padEnd(6)," ",Z.path.padEnd(30)," "]}),jt0(Zn,{color:f14(Z.status),children:Z.status}),Et0(Zn,{dimColor:!0,children:[" ",X.padStart(8)]})]},Q)})})}var te1=()=>{};var zt0={};e(zt0,{App:()=>g14});import{Box as b14}from"ink";import{useSyncExternalStore as y14}from"react";import{jsx as oe1,jsxs as h14}from"react/jsx-runtime";function g14({home:$}){let Z=y14(Nt0,Ut0);return h14(b14,{flexDirection:"column",children:[oe1(ie1,{services:Z.services,migrationsStatus:Z.migrationsStatus,home:$,serverUrl:Z.serverUrl}),oe1(ne1,{logs:Z.logs})]})}var Pt0=D(()=>{pe1();te1();GE()});var s3="thread-gate",MU="decopilot-hosted-harness",VU="decopilot-hosted-harness-sandboxed",MG="automations",RO="background-tools",WE="task-board-github-reads";var re1="11";function ae1($){return{name:"decocms",systemDatabaseUrl:$.systemDatabaseUrl,systemDatabaseSchemaName:"dbos",systemDatabasePoolSize:$.poolSize,runAdminServer:!1,executorID:$.executorID,applicationVersion:re1,...$.listenQueues!==void 0?{listenQueues:$.listenQueues}:{}}}var se1=()=>{};import u14 from"pg";async function $0$($,Z){let{databaseUrl:Q,lockTimeoutMs:X=c14}=$,Y=$.log??((W)=>console.log(W)),J=new u14.Client({connectionString:Q});await J.connect();let G=Date.now(),K=!1;try{while(!K){if(K=(await J.query("SELECT pg_try_advisory_lock($1) AS locked",[ee1.toString()])).rows[0]?.locked===!0,K)break;if(Date.now()-G>=X)throw Error(`Timed out after ${X}ms waiting for the DBOS migration lock. Another process is still migrating the dbos schema; this pod will restart and retry.`);await U$(l14)}let W=Date.now()-G;if(W>1000)Y(`[dbos] waited ${W}ms for the migration lock; another process migrated first`);return await Z()}finally{if(K)try{await J.query("SELECT pg_advisory_unlock($1)",[ee1.toString()])}catch{}await J.end().catch(()=>{})}}var ee1=8314027461559302n,c14=600000,l14=500;var Z0$=D(()=>{t8()});function m14(){let $=(process.env.BUN_OPTIONS??"").split(/\s+/).filter(Boolean);return[...process.argv.slice(1),...$]}function At0($,Z){for(let Q=0;Q<$.length;Q++){let X=$[Q];if(X===void 0)continue;if(X===Z)return $[Q+1];if(X.startsWith(`${Z}=`))return X.slice(Z.length+1)}return}function Q0$(){let $=m14();if($.includes("--cpu-prof")){console.log(JSON.stringify({msg:"cpu-profiling-active",dir:At0($,"--cpu-prof-dir")??process.cwd(),name:At0($,"--cpu-prof-name"),markdown:$.includes("--cpu-prof-md"),intervalUs:Number(At0($,"--cpu-prof-interval")??1000),note:"profile is written on process exit"}));return}if(process.env.CPU_PROFILE)console.warn(JSON.stringify({msg:"cpu-profiling-requested-but-inactive",hint:'CPU profiling is a Bun launch flag. Set BUN_OPTIONS="--cpu-prof --cpu-prof-md --cpu-prof-dir=/tmp" before starting the process.'}))}function X0$(){if(process.env.HEAP_WATCH!=="1")return()=>{};let $=Number(process.env.HEAP_WATCH_INTERVAL_MS??60000),Z=async()=>{let Q=ZE();if(!Q)return;let X={};try{let{heapStats:Y}=await import("bun:jsc"),J=Y(),G=Object.entries(J.objectTypeCounts).sort((K,W)=>W[1]-K[1]).slice(0,20);X={objectCount:J.objectCount,heapSize:J.heapSize,top:Object.fromEntries(G)}}catch{}console.log(JSON.stringify({msg:"heap-watch",ts:new Date().toISOString(),uptimeS:Math.round(process.uptime()),rss:Q.rss,heapUsed:Q.heapUsed,heapTotal:Q.heapTotal,external:Q.external,arrayBuffers:Q.arrayBuffers,...X}))};return Z().catch(()=>{}),HQ0=setInterval(()=>void Z().catch(()=>{}),$),HQ0.unref?.(),process.on("SIGUSR2",()=>{try{let Q=Bun.generateHeapSnapshot("v8"),X=typeof Q==="string"?Q:JSON.stringify(Q),Y=`/tmp/heap-${process.pid}-${Date.now()}.heapsnapshot`;Bun.write(Y,X),console.log(JSON.stringify({msg:"heap-snapshot-written",path:Y}))}catch(Q){console.error("[heap-watch] snapshot failed:",Q)}}),()=>{if(HQ0)clearInterval(HQ0)}}var HQ0;var Y0$=()=>{};import*as d14 from"bun:jsc";function J0$(){if(process.env.STALL_WATCHDOG!=="1")return()=>{};let $=Number(process.env.STALL_WATCHDOG_MS??100),Z=Number(process.env.STALL_WATCHDOG_TICK_MS??50);try{i14()}catch(J){return console.error("[stall-watchdog] failed to start sampling profiler:",J),()=>{}}let Q,X=performance.now()+Z,Y=()=>{let J=performance.now(),G=J-X;X=J+Z;let K=[];try{K=p14()?.traces??[]}catch{}if(G>$&&K.length>0){let W=new Map;for(let F of K){let U=F.frames.find((O)=>O.sourceURL&&!/Unknown Executable/.test(O.category??""))??F.frames[0];if(!U)continue;let N=(U.sourceURL??"?").replace(/^.*\/node_modules\//,"node_modules/"),B=`${U.name??"?"} @ ${N}:${U.line??"?"}`;W.set(B,(W.get(B)??0)+1)}let H=[...W.entries()].sort((F,U)=>U[1]-F[1]).slice(0,8).map(([F,U])=>({frame:F,count:U}));console.warn(JSON.stringify({msg:"stall-stack",ts:new Date().toISOString(),lagMs:Math.round(G),samplesInWindow:K.length,top:H}))}Q=setTimeout(Y,Z),Q.unref?.()};return Q=setTimeout(Y,Z),Q.unref?.(),()=>{if(Q)clearTimeout(Q)}}var i14,p14;var G0$=D(()=>{({startSamplingProfiler:i14,samplingProfilerStackTraces:p14}=d14)});function K0$(){Q0$();let $=[X0$(),Fo1(),J0$()];return()=>{for(let Z of $)Z()}}var W0$=D(()=>{vm0();Y0$();G0$()});var HE=v((H0$)=>{Object.defineProperty(H0$,"__esModule",{value:!0});H0$.RepublishHeaders=H0$.DirectMsgHeaders=H0$.JsHeaders=H0$.AdvisoryKind=void 0;H0$.isOrderedPushConsumerOptions=n14;H0$.isPullConsumer=t14;H0$.isPushConsumer=o14;H0$.isBoundPushConsumerOptions=r14;function n14($){if($&&typeof $==="object")return"name_prefix"in $||"deliver_subject_prefix"in $||"filter_subjects"in $||"filter_subject"in $||"deliver_policy"in $||"opt_start_seq"in $||"opt_start_time"in $||"replay_policy"in $||"inactive_threshold"in $||"headers_only"in $||"deliver_prefix"in $;return!1}function t14($){return $.isPullConsumer()}function o14($){return $.isPushConsumer()}function r14($){if($&&typeof $==="object")return"deliver_subject"in $||"deliver_group"in $||"idle_heartbeat"in $;return!1}H0$.AdvisoryKind={API:"api_audit",StreamAction:"stream_action",ConsumerAction:"consumer_action",SnapshotCreate:"snapshot_create",SnapshotComplete:"snapshot_complete",RestoreCreate:"restore_create",RestoreComplete:"restore_complete",MaxDeliver:"max_deliver",Terminated:"terminated",Ack:"consumer_ack",StreamLeaderElected:"stream_leader_elected",StreamQuorumLost:"stream_quorum_lost",ConsumerLeaderElected:"consumer_leader_elected",ConsumerQuorumLost:"consumer_quorum_lost"};H0$.JsHeaders={StreamSourceHdr:"Nats-Stream-Source",LastConsumerSeqHdr:"Nats-Last-Consumer",LastStreamSeqHdr:"Nats-Last-Stream",ConsumerStalledHdr:"Nats-Consumer-Stalled",MessageSizeHdr:"Nats-Msg-Size",RollupHdr:"Nats-Rollup",RollupValueSubject:"sub",RollupValueAll:"all",PendingMessagesHdr:"Nats-Pending-Messages",PendingBytesHdr:"Nats-Pending-Bytes",RequiredApiLevel:"Nats-Required-Api-Level"};H0$.DirectMsgHeaders={Stream:"Nats-Stream",Sequence:"Nats-Sequence",TimeStamp:"Nats-Time-Stamp",Subject:"Nats-Subject",LastSequence:"Nats-Last-Sequence",NumPending:"Nats-Num-Pending"};H0$.RepublishHeaders={Stream:"Nats-Stream",Subject:"Nats-Subject",Sequence:"Nats-Sequence",LastSequence:"Nats-Last-Sequence",Size:"Nats-Msg-Size"}});var NJ=v((U0$)=>{Object.defineProperty(U0$,"__esModule",{value:!0});U0$.TD=U0$.TE=U0$.Empty=void 0;U0$.encode=J$4;U0$.decode=G$4;U0$.Empty=new Uint8Array(0);U0$.TE=new TextEncoder;U0$.TD=new TextDecoder;function Y$4(...$){let Z=0;for(let Y=0;Y<$.length;Y++)Z+=$[Y].length;let Q=new Uint8Array(Z),X=0;for(let Y=0;Y<$.length;Y++)Q.set($[Y],X),X+=$[Y].length;return Q}function J$4(...$){let Z=[];for(let Q=0;Q<$.length;Q++)Z.push(U0$.TE.encode($[Q]));if(Z.length===0)return U0$.Empty;if(Z.length===1)return Z[0];return Y$4(...Z)}function G$4($){if(!$||$.length===0)return"";return U0$.TD.decode($)}});var BJ=v((O0$)=>{Object.defineProperty(O0$,"__esModule",{value:!0});O0$.errors=O0$.PermissionViolationError=O0$.NoRespondersError=O0$.TimeoutError=O0$.RequestError=O0$.ProtocolError=O0$.ConnectionError=O0$.DrainingConnectionError=O0$.ClosedConnectionError=O0$.AuthorizationError=O0$.UserAuthenticationExpiredError=O0$.InvalidOperationError=O0$.InvalidArgumentError=O0$.InvalidSubjectError=void 0;class Rt0 extends Error{constructor($,Z){super(`illegal subject: '${$}'`,Z);this.name="InvalidSubjectError"}}O0$.InvalidSubjectError=Rt0;class FQ0 extends Error{constructor($,Z){super($,Z);this.name="InvalidArgumentError"}static format($,Z,Q){if(Array.isArray(Z)&&Z.length>1)Z=Z[0];if(Array.isArray($))$=$.map((X)=>`'${X}'`),$=$.join(",");else $=`'${$}'`;return new FQ0(`${$} ${Z}`,Q)}}O0$.InvalidArgumentError=FQ0;class It0 extends Error{constructor($,Z){super($,Z);this.name="InvalidOperationError"}}O0$.InvalidOperationError=It0;class UQ0 extends Error{constructor($,Z){super($,Z);this.name="UserAuthenticationExpiredError"}static parse($){if($.toLowerCase().indexOf("user authentication expired")!==-1)return new UQ0($);return null}}O0$.UserAuthenticationExpiredError=UQ0;class NQ0 extends Error{constructor($,Z){super($,Z);this.name="AuthorizationError"}static parse($){let Z=["authorization violation","account authentication expired","authentication timeout"],Q=$.toLowerCase();for(let X=0;X<Z.length;X++)if(Q.indexOf(Z[X])!==-1)return new NQ0($);return null}}O0$.AuthorizationError=NQ0;class qt0 extends Error{constructor(){super("closed connection");this.name="ClosedConnectionError"}}O0$.ClosedConnectionError=qt0;class Mt0 extends Error{constructor(){super("connection draining");this.name="DrainingConnectionError"}}O0$.DrainingConnectionError=Mt0;class Vt0 extends Error{constructor($,Z){super($,Z);this.name="ConnectionError"}}O0$.ConnectionError=Vt0;class kt0 extends Error{constructor($,Z){super($,Z);this.name="ProtocolError"}}O0$.ProtocolError=kt0;class St0 extends Error{constructor($="",Z){super($,Z);this.name="RequestError"}isNoResponders(){return this.cause instanceof BQ0}}O0$.RequestError=St0;class Ct0 extends Error{constructor($){super("timeout",$);this.name="TimeoutError"}}O0$.TimeoutError=Ct0;class BQ0 extends Error{subject;constructor($,Z){super(`no responders: '${$}'`,Z);this.subject=$,this.name="NoResponders"}}O0$.NoRespondersError=BQ0;class OQ0 extends Error{operation;subject;queue;constructor($,Z,Q,X,Y){super($,Y);this.name="PermissionViolationError",this.operation=Z,this.subject=Q,this.queue=X}static parse($){if(($?$.toLowerCase():"").indexOf("permissions violation")===-1)return null;let Q="publish",X="",Y=void 0,J=$.match(/(Publish|Subscription) to "(\S+)"/);if(J){if(Q=J[1].toLowerCase(),X=J[2],Q==="subscription"){let G=$.match(/using queue "(\S+)"/);if(G)Y=G[1]}}return new OQ0($,Q,X,Y)}}O0$.PermissionViolationError=OQ0;O0$.errors={AuthorizationError:NQ0,ClosedConnectionError:qt0,ConnectionError:Vt0,DrainingConnectionError:Mt0,InvalidArgumentError:FQ0,InvalidOperationError:It0,InvalidSubjectError:Rt0,NoRespondersError:BQ0,PermissionViolationError:OQ0,ProtocolError:kt0,RequestError:St0,TimeoutError:Ct0,UserAuthenticationExpiredError:UQ0}});var e3=v((E0$)=>{Object.defineProperty(E0$,"__esModule",{value:!0});E0$.SimpleMutex=E0$.Perf=void 0;E0$.extend=T$4;E0$.render=R$4;E0$.timeout=I$4;E0$.delay=q$4;E0$.deadline=M$4;E0$.deferred=vt0;E0$.debugDeferred=V$4;E0$.shuffle=k$4;E0$.collect=S$4;E0$.jitter=j0$;E0$.backoff=C$4;E0$.nanos=_$4;E0$.millis=v$4;E0$.randomToken=b$4;var A$4=NJ(),_t0=BJ();function T$4($,...Z){for(let Q=0;Q<Z.length;Q++){let X=Z[Q];Object.keys(X).forEach(function(Y){$[Y]=X[Y]})}return $}function R$4($){return A$4.TD.decode($).replace(/\n/g,"\u240A").replace(/\r/g,"\u240D")}function I$4($,Z=!0){let Q=Z?new _t0.TimeoutError:null,X,Y,J=new Promise((G,K)=>{X={cancel:()=>{if(Y)clearTimeout(Y)}},Y=setTimeout(()=>{if(Q===null)K(new _t0.TimeoutError);else K(Q)},$)});return Object.assign(J,X)}function q$4($=0){let Z,Q=new Promise((X)=>{let Y=setTimeout(()=>{X()},$);Z={cancel:()=>{if(Y)clearTimeout(Y),X()}}});return Object.assign(Q,Z)}async function M$4($,Z=1000){let Q=vt0(),X=setTimeout(()=>{Q.reject(new _t0.TimeoutError)},Z);try{return await Promise.race([$,Q])}finally{clearTimeout(X)}}function vt0(){let $={},Z=new Promise((Q,X)=>{$={resolve:Q,reject:X}});return Object.assign(Z,$)}function V$4(){let $={},Z=new Promise((Q,X)=>{$={resolve:(Y)=>{console.trace("resolve",Y),Q(Y)},reject:(Y)=>{console.trace("reject"),X(Y)}}});return Object.assign(Z,$)}function k$4($){for(let Z=$.length-1;Z>0;Z--){let Q=Math.floor(Math.random()*(Z+1));[$[Z],$[Q]]=[$[Q],$[Z]]}return $}async function S$4($){let Z=[];for await(let Q of $)Z.push(Q);return Z}class L0${timers;measures;constructor(){this.timers=new Map,this.measures=new Map}mark($){this.timers.set($,performance.now())}measure($,Z,Q){let X=this.timers.get(Z);if(X===void 0)throw Error(`${Z} is not defined`);let Y=this.timers.get(Q);if(Y===void 0)throw Error(`${Q} is not defined`);this.measures.set($,Y-X)}getEntries(){let $=[];return this.measures.forEach((Z,Q)=>{$.push({name:Q,duration:Z})}),$}}E0$.Perf=L0$;class w0${max;current;waiting;constructor($=1){this.max=$,this.current=0,this.waiting=[]}lock(){if(this.current++,this.current<=this.max)return Promise.resolve();let $=vt0();return this.waiting.push($),$}unlock(){this.current--,this.waiting.pop()?.resolve()}}E0$.SimpleMutex=w0$;function j0$($){if($===0)return 0;return Math.floor($/2+Math.random()*$)}function C$4($=[0,250,250,500,500,3000,5000]){if(!Array.isArray($))$=[0,250,250,500,500,3000,5000];let Z=$.length-1;return{backoff(Q){return j0$(Q>Z?$[Z]:$[Q])}}}function _$4($){return $*1e6}function v$4($){return Math.floor($/1e6)}var x$4="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",kU=new Uint8Array(62);for(let $=0;$<62;$++)kU[$]=x$4.charCodeAt($);var f$4=218340105584896;function b$4(){let $=Math.floor(Math.random()*f$4),Z=$%62,Q=kU[Z];$=($-Z)/62,Z=$%62;let X=kU[Z];$=($-Z)/62,Z=$%62;let Y=kU[Z];$=($-Z)/62,Z=$%62;let J=kU[Z];$=($-Z)/62,Z=$%62;let G=kU[Z];$=($-Z)/62,Z=$%62;let K=kU[Z];$=($-Z)/62,Z=$%62;let W=kU[Z];$=($-Z)/62;let H=kU[$];return String.fromCharCode(Q,X,Y,J,G,K,W,H)}});var M0$=v((I0$)=>{Object.defineProperty(I0$,"__esModule",{value:!0});I0$.nuid=I0$.NuidImpl=void 0;var s$4="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",IO=62,LQ0=12,T0$=10,P0$=33,e$4=333,A0$=LQ0+T0$,ft0=new Uint8Array(IO);for(let $=0;$<IO;$++)ft0[$]=s$4.charCodeAt($);var DQ0=4294967296,R0$=BigInt(IO)**BigInt(T0$),Qn=Number(R0$/(1n<<32n)),xt0=Number(R0$%(1n<<32n));function $84($){for(let Z=0;Z<$.length;Z++)$[Z]=Math.floor(Math.random()*256)}function Z84($){if(globalThis?.crypto?.getRandomValues)globalThis.crypto.getRandomValues($);else $84($)}class bt0{buf;cbuf;seqHi;seqLo;inc;inited;constructor(){this.buf=new Uint8Array(A0$),this.cbuf=new Uint8Array(LQ0),this.inited=!1}init(){this.inited=!0,this.setPre(),this.initSeqAndInc(),this.fillSeq()}initSeqAndInc(){let $=0;do this.seqHi=Math.floor(Math.random()*(Qn+1)),this.seqLo=Math.floor(Math.random()*DQ0);while($++<8&&this.seqHi===Qn&&this.seqLo>=xt0);if(this.seqHi===Qn&&this.seqLo>=xt0)this.seqLo=0;this.inc=Math.random()*(e$4-P0$)+P0$|0}setPre(){Z84(this.cbuf);for(let $=0;$<LQ0;$++)this.buf[$]=ft0[this.cbuf[$]%IO]}fillSeq(){let $=this.seqHi,Z=this.seqLo;for(let Q=A0$-1;Q>=LQ0;Q--){let X=Math.floor($/IO),J=($-X*IO)*DQ0+Z,G=Math.floor(J/IO),K=J-G*IO;this.buf[Q]=ft0[K],$=X,Z=G}}next(){if(!this.inited)this.init();if(this.seqLo+=this.inc,this.seqLo>=DQ0)this.seqLo-=DQ0,this.seqHi+=1;if(this.seqHi>Qn||this.seqHi===Qn&&this.seqLo>=xt0)this.setPre(),this.initSeqAndInc();this.fillSeq();let $=this.buf;return String.fromCharCode($[0],$[1],$[2],$[3],$[4],$[5],$[6],$[7],$[8],$[9],$[10],$[11],$[12],$[13],$[14],$[15],$[16],$[17],$[18],$[19],$[20],$[21])}reset(){this.init()}}I0$.NuidImpl=bt0;I0$.nuid=new bt0});var C0$=v((k0$)=>{Object.defineProperty(k0$,"__esModule",{value:!0});k0$.nuid=k0$.Nuid=void 0;var V0$=M0$();k0$.Nuid=V0$.NuidImpl;k0$.nuid=V0$.nuid});var jQ0=v((wQ0)=>{Object.defineProperty(wQ0,"__esModule",{value:!0});wQ0.nuid=wQ0.Nuid=void 0;var _0$=C0$();Object.defineProperty(wQ0,"Nuid",{enumerable:!0,get:function(){return _0$.Nuid}});Object.defineProperty(wQ0,"nuid",{enumerable:!0,get:function(){return _0$.nuid}})});var qO=v((v0$)=>{Object.defineProperty(v0$,"__esModule",{value:!0});v0$.DEFAULT_HOST=v0$.DEFAULT_PORT=v0$.Match=void 0;v0$.syncIterator=K84;v0$.createInbox=W84;var J84=jQ0(),G84=BJ();v0$.Match={Exact:"exact",CanonicalMIME:"canonical",IgnoreCase:"insensitive"};function K84($){let Z=$[Symbol.asyncIterator]();return{async next(){let Q=await Z.next();if(Q.done)return Promise.resolve(null);return Promise.resolve(Q.value)}}}function W84($=""){if($=$||"_INBOX",typeof $!=="string")throw TypeError("prefix must be a string");return $.split(".").forEach((Z)=>{if(Z==="*"||Z===">")throw G84.InvalidArgumentError.format("prefix",`cannot have wildcards ('${$}')`)}),`${$}.${J84.nuid.next()}`}v0$.DEFAULT_PORT=4222;v0$.DEFAULT_HOST="127.0.0.1"});var Xn=v((y0$)=>{Object.defineProperty(y0$,"__esModule",{value:!0});y0$.DataBuffer=void 0;var f0$=NJ();class b0${buffers;byteLength;constructor(){this.buffers=[],this.byteLength=0}static concat(...$){let Z=0;for(let Y=0;Y<$.length;Y++)Z+=$[Y].length;let Q=new Uint8Array(Z),X=0;for(let Y=0;Y<$.length;Y++)Q.set($[Y],X),X+=$[Y].length;return Q}static fromAscii($){if(!$)$="";return f0$.TE.encode($)}static toAscii($){return f0$.TD.decode($)}reset(){this.buffers.length=0,this.byteLength=0}pack(){if(this.buffers.length>1){let $=new Uint8Array(this.byteLength),Z=0;for(let Q=0;Q<this.buffers.length;Q++)$.set(this.buffers[Q],Z),Z+=this.buffers[Q].length;this.buffers.length=0,this.buffers.push($)}}shift(){if(this.buffers.length){let $=this.buffers.shift();if($)return this.byteLength-=$.length,$}return new Uint8Array(0)}drain($){if(this.buffers.length){this.pack();let Z=this.buffers.pop();if(Z){let Q=this.byteLength;if($===void 0||$>Q)$=Q;let X=Z.subarray(0,$);if(Q>$)this.buffers.push(Z.subarray($));return this.byteLength=Q-$,X}}return new Uint8Array(0)}fill($,...Z){if($)this.buffers.push($),this.byteLength+=$.length;for(let Q=0;Q<Z.length;Q++)if(Z[Q]&&Z[Q].length)this.buffers.push(Z[Q]),this.byteLength+=Z[Q].length}peek(){if(this.buffers.length)return this.pack(),this.buffers[0];return new Uint8Array(0)}size(){return this.byteLength}length(){return this.buffers.length}}y0$.DataBuffer=b0$});var FE=v((u0$)=>{Object.defineProperty(u0$,"__esModule",{value:!0});u0$.LF=u0$.CR=u0$.CRLF=u0$.CR_LF_LEN=u0$.CR_LF=void 0;u0$.setTransportFactory=L84;u0$.defaultPort=w84;u0$.getUrlParseFn=j84;u0$.newTransport=E84;u0$.getResolveFn=z84;u0$.protoLen=h0$;u0$.extractProtocolMessage=P84;var B84=NJ(),O84=qO(),D84=Xn(),OJ;function L84($){OJ=$}function w84(){return OJ!==void 0&&OJ.defaultPort!==void 0?OJ.defaultPort:O84.DEFAULT_PORT}function j84(){return OJ!==void 0&&OJ.urlParseFn?OJ.urlParseFn:void 0}function E84(){if(!OJ||typeof OJ.factory!=="function")throw Error("transport fn is not set");return OJ.factory()}function z84(){return OJ!==void 0&&OJ.dnsResolveFn?OJ.dnsResolveFn:void 0}u0$.CR_LF=`\r
1565
+ `);X=J.pop()??"";for(let G of J){let K=Bun.stripANSI(G).replace(/^\[\d+\]\s*/,"").trim();if(!K)continue;AO({method:"",path:"",status:0,duration:0,timestamp:new Date,rawLine:K})}}(async()=>{try{for(;;){let{done:J,value:G}=await Z.read();if(J)break;X+=Q.decode(G,{stream:!0}),Y()}}catch{}if(X.trim()){let J=Bun.stripANSI(X).replace(/^\[\d+\]\s*/,"").trim();if(J)AO({method:"",path:"",status:0,duration:0,timestamp:new Date,rawLine:J})}})()}async function V14($){let{baseUrl:Z,noTui:Q}=$,X=process.env.HOST==="0.0.0.0"&&Boolean(process.env.PORT),Y=X?process.env.PORT:$.vitePort,J=Z||`http://localhost:${Y}`,G=X?await $n(Number(Y)+1):await $n(Number($.port)),{settings:K,services:W,managedServiceNames:H}=await JQ0({port:String(G),home:$.home,baseUrl:$.baseUrl,localMode:$.localMode,skipMigrations:$.skipMigrations,noTui:$.noTui,vitePort:$.vitePort});for(let L of W)JE({name:L.name,status:"ready",port:L.port});sp();let F=M14(import.meta.dir,"..","..","..","..",".."),U=Q===!0,N=Bun.spawn(["bun","run","dev:servers"],{cwd:F,env:{...process.env,PORT:String(K.port),VITE_PORT:String(Y),DATABASE_URL:K.databaseUrl,NATS_URL:K.natsUrls.join(","),NODE_ENV:K.nodeEnv,BASE_URL:J,DECOCMS_LOCAL_MODE:String(K.localMode),DECOCMS_HOME:K.dataDir,DATA_DIR:K.dataDir,DECO_CLI:"1",...K.betterAuthSecret?{BETTER_AUTH_SECRET:K.betterAuthSecret}:{},...K.s3Endpoint?{S3_ENDPOINT:K.s3Endpoint,S3_BUCKET:K.s3Bucket??"",S3_ACCESS_KEY_ID:K.s3AccessKeyId??"",S3_SECRET_ACCESS_KEY:K.s3SecretAccessKey??"",S3_FORCE_PATH_STYLE:String(K.s3ForcePathStyle)}:{},...K.natsCredsPath?{NATS_CREDS:K.natsCredsPath}:{}},stdio:["inherit",U?"inherit":"pipe",U?"inherit":"pipe"]});if(!U)Ot0(N.stdout),Ot0(N.stderr);ep(J),JE({name:"Vite",status:"ready",port:Number(Y)}),JE({name:"API",status:"ready",port:Number(K.port)});let O=async(L)=>{if(N.kill(L),await N.exited,H.length>0){let{stopServices:w}=await Promise.resolve().then(() => (W70(),K70));await w(K.dataDir)}};return process.on("SIGINT",()=>O("SIGINT")),process.on("SIGTERM",()=>O("SIGTERM")),{port:Number(Y),process:N}}var Lt0=D(()=>{Ht0();GE();Bt0()});var WQ0;var wt0=D(()=>{WQ0={name:"decocms",version:"4.335.5",description:"Deco CMS \u2014 Self-hostable MCP Gateway for managing AI connections and tools",author:"Deco team",repository:{type:"git",url:"git+https://github.com/decocms/studio.git",directory:"apps/api"},bugs:{url:"https://github.com/decocms/studio/issues"},type:"module",bin:{deco:"./dist/server/cli.js"},files:["dist/**/*"],scripts:{dev:"bun run migrate && bun run dev:server","dev:server":"bun run --cwd=../../packages/sandbox build && NODE_ENV=development bun --env-file=.env --hot run src/index.ts",build:"bun run build:server","build:server":"bun run scripts/bundle-server-script.ts --dist ./dist/server","generate:tool-contracts":"bun run scripts/generate-tool-contracts.ts","db:migrate":"bun run ./dist/server/migrate.js","db:migrate:dbos":"bun run ./dist/server/migrate-dbos.js",check:"tsc --noEmit",start:"bun run ./dist/server/server.js",migrate:"bun run src/database/migrate.ts","migrate:dbos":"bun run src/database/migrate-dbos.ts",test:"bun test src","better-auth:migrate":"bunx --bun @better-auth/cli migrate -y --config src/auth/index.ts",prepublishOnly:"bun run --cwd=../.. build:studio"},optionalDependencies:{"@duckdb/node-api":"^1.5.0-r.1"},dependencies:{"@ai-sdk/anthropic":"^3.0.85","@ai-sdk/google":"^3.0.83","@ai-sdk/openai":"^3.0.73","@anthropic-ai/sdk":"^0.105.0","@aws-sdk/client-s3":"^3.1013.0","@aws-sdk/client-sts":"^3.1013.0","@aws-sdk/lib-storage":"^3.1013.0","@aws-sdk/s3-request-presigner":"^3.1013.0","@clickhouse/client":"^1.8.1","@dbos-inc/dbos-sdk":"^4.21.6","@inkjs/ui":"^2.0.0","@nats-io/jetstream":"3.4.0","@nats-io/kv":"3.4.0","@nats-io/nats-core":"3.4.0","@nats-io/transport-node":"3.4.0","@openrouter/ai-sdk-provider":"^2.9.1","@opentelemetry/core":"^2.6.0","embedded-postgres":"^18.3.0-beta.16",ink:"^6.8.0",kysely:"^0.28.12","posthog-node":"^5.0.0",react:"^19.2.6","react-dom":"^19.2.6"},devDependencies:{"@ai-sdk/provider":"^3.0.10","@better-auth/sso":"1.4.1","@decocms/better-auth":"1.5.17","@decocms/bindings":"workspace:*","@decocms/mcp-utils":"workspace:*","@decocms/runtime":"workspace:*","@decocms/sandbox":"workspace:*","@decocms/shared":"workspace:*","@jitl/quickjs-wasmfile-release-sync":"0.31.0","@modelcontextprotocol/sdk":"1.29.0","@opentelemetry/api":"^1.9.0","@opentelemetry/api-logs":"^0.211.0","@opentelemetry/exporter-logs-otlp-proto":"^0.211.0","@opentelemetry/exporter-prometheus":"^0.208.0","@opentelemetry/exporter-trace-otlp-proto":"^0.207.0","@opentelemetry/instrumentation-runtime-node":"^0.24.0","@opentelemetry/resources":"^2.6.0","@opentelemetry/sdk-logs":"^0.211.0","@opentelemetry/sdk-metrics":"^2.2.0","@opentelemetry/sdk-node":"^0.207.0","@opentelemetry/sdk-trace-base":"^2.5.0","@types/bun":"^1.3.1","@types/google.maps":"^3.65.2","@types/pg":"^8.15.6","@types/react-syntax-highlighter":"^15.5.13","@vercel/nft":"^1.1.1",ai:"^6.0.208","better-auth":"1.4.22",croner:"^9.1.0",degit:"^2.8.4",hono:"^4.10.7",jose:"^6.0.11",nanoid:"^5.1.6",pg:"^8.16.3",typescript:"^7.0.2",typescript5:"npm:typescript@^5.9.3",zod:"4.3.6"},homepage:"https://github.com/decocms/studio",keywords:["mcp","model-context-protocol","ai","gateway","self-hosted","tools"],license:"MIT",publishConfig:{access:"public"}}});import{Box as S14,Text as ue1}from"ink";import{jsx as C14,jsxs as ce1}from"react/jsx-runtime";function le1({version:$}){return ce1(S14,{flexDirection:"column",marginTop:1,children:[C70.map((Z,Q)=>C14(ue1,{color:_70[Q],children:Z},Q)),ce1(ue1,{dimColor:!0,children:[" v",$]})]})}var me1=D(()=>{gp()});import{Box as KE,Text as TO}from"ink";import{Spinner as _14}from"@inkjs/ui";import{jsx as UJ,jsxs as Xg}from"react/jsx-runtime";function de1({status:$}){if($==="pending")return UJ(_14,{label:""});return UJ(TO,{color:"green",children:"\u2713"})}function v14($){return`${$.name}: ${$.port||"...."}`}function ie1({services:$,migrationsStatus:Z,home:Q,serverUrl:X}){return Xg(KE,{flexDirection:"column",paddingBottom:1,children:[UJ(le1,{version:WQ0.version}),UJ(KE,{marginBottom:1,children:UJ(TO,{dimColor:!0,children:"\u2500".repeat(80)})}),UJ(KE,{children:Xg(TO,{dimColor:!0,children:["Home: ",Q]})}),Xg(KE,{gap:2,children:[$.map((Y)=>Xg(KE,{gap:1,children:[UJ(TO,{children:v14(Y)}),UJ(de1,{status:Y.status})]},Y.name)),Xg(KE,{gap:1,children:[UJ(TO,{children:"Migrations"}),UJ(de1,{status:Z})]})]}),UJ(KE,{children:X?Xg(TO,{children:["Open in browser: ",UJ(TO,{color:"cyan",children:X})]}):UJ(TO,{dimColor:!0,children:"Starting..."})})]})}var pe1=D(()=>{wt0();me1()});import{Box as x14,Text as Zn}from"ink";import{jsx as jt0,jsxs as Et0}from"react/jsx-runtime";function f14($){if($>=500)return"red";if($>=400)return"yellow";if($>=300)return"cyan";return"green"}function ne1({logs:$}){return jt0(x14,{flexDirection:"column",children:$.map((Z,Q)=>{if(Z.rawLine)return jt0(Zn,{dimColor:!0,children:Z.rawLine},Q);let X=Z.duration<1000?`${Z.duration}ms`:`${(Z.duration/1000).toFixed(1)}s`;return Et0(Zn,{children:[Et0(Zn,{dimColor:!0,children:[Z.method.padEnd(6)," ",Z.path.padEnd(30)," "]}),jt0(Zn,{color:f14(Z.status),children:Z.status}),Et0(Zn,{dimColor:!0,children:[" ",X.padStart(8)]})]},Q)})})}var te1=()=>{};var zt0={};e(zt0,{App:()=>g14});import{Box as b14}from"ink";import{useSyncExternalStore as y14}from"react";import{jsx as oe1,jsxs as h14}from"react/jsx-runtime";function g14({home:$}){let Z=y14(Nt0,Ut0);return h14(b14,{flexDirection:"column",children:[oe1(ie1,{services:Z.services,migrationsStatus:Z.migrationsStatus,home:$,serverUrl:Z.serverUrl}),oe1(ne1,{logs:Z.logs})]})}var Pt0=D(()=>{pe1();te1();GE()});var s3="thread-gate",MU="decopilot-hosted-harness",VU="decopilot-hosted-harness-sandboxed",MG="automations",RO="background-tools",WE="task-board-github-reads";var re1="11";function ae1($){return{name:"decocms",systemDatabaseUrl:$.systemDatabaseUrl,systemDatabaseSchemaName:"dbos",systemDatabasePoolSize:$.poolSize,runAdminServer:!1,executorID:$.executorID,applicationVersion:re1,...$.listenQueues!==void 0?{listenQueues:$.listenQueues}:{}}}var se1=()=>{};import u14 from"pg";async function $0$($,Z){let{databaseUrl:Q,lockTimeoutMs:X=c14}=$,Y=$.log??((W)=>console.log(W)),J=new u14.Client({connectionString:Q});await J.connect();let G=Date.now(),K=!1;try{while(!K){if(K=(await J.query("SELECT pg_try_advisory_lock($1) AS locked",[ee1.toString()])).rows[0]?.locked===!0,K)break;if(Date.now()-G>=X)throw Error(`Timed out after ${X}ms waiting for the DBOS migration lock. Another process is still migrating the dbos schema; this pod will restart and retry.`);await U$(l14)}let W=Date.now()-G;if(W>1000)Y(`[dbos] waited ${W}ms for the migration lock; another process migrated first`);return await Z()}finally{if(K)try{await J.query("SELECT pg_advisory_unlock($1)",[ee1.toString()])}catch{}await J.end().catch(()=>{})}}var ee1=8314027461559302n,c14=600000,l14=500;var Z0$=D(()=>{t8()});function m14(){let $=(process.env.BUN_OPTIONS??"").split(/\s+/).filter(Boolean);return[...process.argv.slice(1),...$]}function At0($,Z){for(let Q=0;Q<$.length;Q++){let X=$[Q];if(X===void 0)continue;if(X===Z)return $[Q+1];if(X.startsWith(`${Z}=`))return X.slice(Z.length+1)}return}function Q0$(){let $=m14();if($.includes("--cpu-prof")){console.log(JSON.stringify({msg:"cpu-profiling-active",dir:At0($,"--cpu-prof-dir")??process.cwd(),name:At0($,"--cpu-prof-name"),markdown:$.includes("--cpu-prof-md"),intervalUs:Number(At0($,"--cpu-prof-interval")??1000),note:"profile is written on process exit"}));return}if(process.env.CPU_PROFILE)console.warn(JSON.stringify({msg:"cpu-profiling-requested-but-inactive",hint:'CPU profiling is a Bun launch flag. Set BUN_OPTIONS="--cpu-prof --cpu-prof-md --cpu-prof-dir=/tmp" before starting the process.'}))}function X0$(){if(process.env.HEAP_WATCH!=="1")return()=>{};let $=Number(process.env.HEAP_WATCH_INTERVAL_MS??60000),Z=async()=>{let Q=ZE();if(!Q)return;let X={};try{let{heapStats:Y}=await import("bun:jsc"),J=Y(),G=Object.entries(J.objectTypeCounts).sort((K,W)=>W[1]-K[1]).slice(0,20);X={objectCount:J.objectCount,heapSize:J.heapSize,top:Object.fromEntries(G)}}catch{}console.log(JSON.stringify({msg:"heap-watch",ts:new Date().toISOString(),uptimeS:Math.round(process.uptime()),rss:Q.rss,heapUsed:Q.heapUsed,heapTotal:Q.heapTotal,external:Q.external,arrayBuffers:Q.arrayBuffers,...X}))};return Z().catch(()=>{}),HQ0=setInterval(()=>void Z().catch(()=>{}),$),HQ0.unref?.(),process.on("SIGUSR2",()=>{try{let Q=Bun.generateHeapSnapshot("v8"),X=typeof Q==="string"?Q:JSON.stringify(Q),Y=`/tmp/heap-${process.pid}-${Date.now()}.heapsnapshot`;Bun.write(Y,X),console.log(JSON.stringify({msg:"heap-snapshot-written",path:Y}))}catch(Q){console.error("[heap-watch] snapshot failed:",Q)}}),()=>{if(HQ0)clearInterval(HQ0)}}var HQ0;var Y0$=()=>{};import*as d14 from"bun:jsc";function J0$(){if(process.env.STALL_WATCHDOG!=="1")return()=>{};let $=Number(process.env.STALL_WATCHDOG_MS??100),Z=Number(process.env.STALL_WATCHDOG_TICK_MS??50);try{i14()}catch(J){return console.error("[stall-watchdog] failed to start sampling profiler:",J),()=>{}}let Q,X=performance.now()+Z,Y=()=>{let J=performance.now(),G=J-X;X=J+Z;let K=[];try{K=p14()?.traces??[]}catch{}if(G>$&&K.length>0){let W=new Map;for(let F of K){let U=F.frames.find((O)=>O.sourceURL&&!/Unknown Executable/.test(O.category??""))??F.frames[0];if(!U)continue;let N=(U.sourceURL??"?").replace(/^.*\/node_modules\//,"node_modules/"),B=`${U.name??"?"} @ ${N}:${U.line??"?"}`;W.set(B,(W.get(B)??0)+1)}let H=[...W.entries()].sort((F,U)=>U[1]-F[1]).slice(0,8).map(([F,U])=>({frame:F,count:U}));console.warn(JSON.stringify({msg:"stall-stack",ts:new Date().toISOString(),lagMs:Math.round(G),samplesInWindow:K.length,top:H}))}Q=setTimeout(Y,Z),Q.unref?.()};return Q=setTimeout(Y,Z),Q.unref?.(),()=>{if(Q)clearTimeout(Q)}}var i14,p14;var G0$=D(()=>{({startSamplingProfiler:i14,samplingProfilerStackTraces:p14}=d14)});function K0$(){Q0$();let $=[X0$(),Fo1(),J0$()];return()=>{for(let Z of $)Z()}}var W0$=D(()=>{vm0();Y0$();G0$()});var HE=v((H0$)=>{Object.defineProperty(H0$,"__esModule",{value:!0});H0$.RepublishHeaders=H0$.DirectMsgHeaders=H0$.JsHeaders=H0$.AdvisoryKind=void 0;H0$.isOrderedPushConsumerOptions=n14;H0$.isPullConsumer=t14;H0$.isPushConsumer=o14;H0$.isBoundPushConsumerOptions=r14;function n14($){if($&&typeof $==="object")return"name_prefix"in $||"deliver_subject_prefix"in $||"filter_subjects"in $||"filter_subject"in $||"deliver_policy"in $||"opt_start_seq"in $||"opt_start_time"in $||"replay_policy"in $||"inactive_threshold"in $||"headers_only"in $||"deliver_prefix"in $;return!1}function t14($){return $.isPullConsumer()}function o14($){return $.isPushConsumer()}function r14($){if($&&typeof $==="object")return"deliver_subject"in $||"deliver_group"in $||"idle_heartbeat"in $;return!1}H0$.AdvisoryKind={API:"api_audit",StreamAction:"stream_action",ConsumerAction:"consumer_action",SnapshotCreate:"snapshot_create",SnapshotComplete:"snapshot_complete",RestoreCreate:"restore_create",RestoreComplete:"restore_complete",MaxDeliver:"max_deliver",Terminated:"terminated",Ack:"consumer_ack",StreamLeaderElected:"stream_leader_elected",StreamQuorumLost:"stream_quorum_lost",ConsumerLeaderElected:"consumer_leader_elected",ConsumerQuorumLost:"consumer_quorum_lost"};H0$.JsHeaders={StreamSourceHdr:"Nats-Stream-Source",LastConsumerSeqHdr:"Nats-Last-Consumer",LastStreamSeqHdr:"Nats-Last-Stream",ConsumerStalledHdr:"Nats-Consumer-Stalled",MessageSizeHdr:"Nats-Msg-Size",RollupHdr:"Nats-Rollup",RollupValueSubject:"sub",RollupValueAll:"all",PendingMessagesHdr:"Nats-Pending-Messages",PendingBytesHdr:"Nats-Pending-Bytes",RequiredApiLevel:"Nats-Required-Api-Level"};H0$.DirectMsgHeaders={Stream:"Nats-Stream",Sequence:"Nats-Sequence",TimeStamp:"Nats-Time-Stamp",Subject:"Nats-Subject",LastSequence:"Nats-Last-Sequence",NumPending:"Nats-Num-Pending"};H0$.RepublishHeaders={Stream:"Nats-Stream",Subject:"Nats-Subject",Sequence:"Nats-Sequence",LastSequence:"Nats-Last-Sequence",Size:"Nats-Msg-Size"}});var NJ=v((U0$)=>{Object.defineProperty(U0$,"__esModule",{value:!0});U0$.TD=U0$.TE=U0$.Empty=void 0;U0$.encode=J$4;U0$.decode=G$4;U0$.Empty=new Uint8Array(0);U0$.TE=new TextEncoder;U0$.TD=new TextDecoder;function Y$4(...$){let Z=0;for(let Y=0;Y<$.length;Y++)Z+=$[Y].length;let Q=new Uint8Array(Z),X=0;for(let Y=0;Y<$.length;Y++)Q.set($[Y],X),X+=$[Y].length;return Q}function J$4(...$){let Z=[];for(let Q=0;Q<$.length;Q++)Z.push(U0$.TE.encode($[Q]));if(Z.length===0)return U0$.Empty;if(Z.length===1)return Z[0];return Y$4(...Z)}function G$4($){if(!$||$.length===0)return"";return U0$.TD.decode($)}});var BJ=v((O0$)=>{Object.defineProperty(O0$,"__esModule",{value:!0});O0$.errors=O0$.PermissionViolationError=O0$.NoRespondersError=O0$.TimeoutError=O0$.RequestError=O0$.ProtocolError=O0$.ConnectionError=O0$.DrainingConnectionError=O0$.ClosedConnectionError=O0$.AuthorizationError=O0$.UserAuthenticationExpiredError=O0$.InvalidOperationError=O0$.InvalidArgumentError=O0$.InvalidSubjectError=void 0;class Rt0 extends Error{constructor($,Z){super(`illegal subject: '${$}'`,Z);this.name="InvalidSubjectError"}}O0$.InvalidSubjectError=Rt0;class FQ0 extends Error{constructor($,Z){super($,Z);this.name="InvalidArgumentError"}static format($,Z,Q){if(Array.isArray(Z)&&Z.length>1)Z=Z[0];if(Array.isArray($))$=$.map((X)=>`'${X}'`),$=$.join(",");else $=`'${$}'`;return new FQ0(`${$} ${Z}`,Q)}}O0$.InvalidArgumentError=FQ0;class It0 extends Error{constructor($,Z){super($,Z);this.name="InvalidOperationError"}}O0$.InvalidOperationError=It0;class UQ0 extends Error{constructor($,Z){super($,Z);this.name="UserAuthenticationExpiredError"}static parse($){if($.toLowerCase().indexOf("user authentication expired")!==-1)return new UQ0($);return null}}O0$.UserAuthenticationExpiredError=UQ0;class NQ0 extends Error{constructor($,Z){super($,Z);this.name="AuthorizationError"}static parse($){let Z=["authorization violation","account authentication expired","authentication timeout"],Q=$.toLowerCase();for(let X=0;X<Z.length;X++)if(Q.indexOf(Z[X])!==-1)return new NQ0($);return null}}O0$.AuthorizationError=NQ0;class qt0 extends Error{constructor(){super("closed connection");this.name="ClosedConnectionError"}}O0$.ClosedConnectionError=qt0;class Mt0 extends Error{constructor(){super("connection draining");this.name="DrainingConnectionError"}}O0$.DrainingConnectionError=Mt0;class Vt0 extends Error{constructor($,Z){super($,Z);this.name="ConnectionError"}}O0$.ConnectionError=Vt0;class kt0 extends Error{constructor($,Z){super($,Z);this.name="ProtocolError"}}O0$.ProtocolError=kt0;class St0 extends Error{constructor($="",Z){super($,Z);this.name="RequestError"}isNoResponders(){return this.cause instanceof BQ0}}O0$.RequestError=St0;class Ct0 extends Error{constructor($){super("timeout",$);this.name="TimeoutError"}}O0$.TimeoutError=Ct0;class BQ0 extends Error{subject;constructor($,Z){super(`no responders: '${$}'`,Z);this.subject=$,this.name="NoResponders"}}O0$.NoRespondersError=BQ0;class OQ0 extends Error{operation;subject;queue;constructor($,Z,Q,X,Y){super($,Y);this.name="PermissionViolationError",this.operation=Z,this.subject=Q,this.queue=X}static parse($){if(($?$.toLowerCase():"").indexOf("permissions violation")===-1)return null;let Q="publish",X="",Y=void 0,J=$.match(/(Publish|Subscription) to "(\S+)"/);if(J){if(Q=J[1].toLowerCase(),X=J[2],Q==="subscription"){let G=$.match(/using queue "(\S+)"/);if(G)Y=G[1]}}return new OQ0($,Q,X,Y)}}O0$.PermissionViolationError=OQ0;O0$.errors={AuthorizationError:NQ0,ClosedConnectionError:qt0,ConnectionError:Vt0,DrainingConnectionError:Mt0,InvalidArgumentError:FQ0,InvalidOperationError:It0,InvalidSubjectError:Rt0,NoRespondersError:BQ0,PermissionViolationError:OQ0,ProtocolError:kt0,RequestError:St0,TimeoutError:Ct0,UserAuthenticationExpiredError:UQ0}});var e3=v((E0$)=>{Object.defineProperty(E0$,"__esModule",{value:!0});E0$.SimpleMutex=E0$.Perf=void 0;E0$.extend=T$4;E0$.render=R$4;E0$.timeout=I$4;E0$.delay=q$4;E0$.deadline=M$4;E0$.deferred=vt0;E0$.debugDeferred=V$4;E0$.shuffle=k$4;E0$.collect=S$4;E0$.jitter=j0$;E0$.backoff=C$4;E0$.nanos=_$4;E0$.millis=v$4;E0$.randomToken=b$4;var A$4=NJ(),_t0=BJ();function T$4($,...Z){for(let Q=0;Q<Z.length;Q++){let X=Z[Q];Object.keys(X).forEach(function(Y){$[Y]=X[Y]})}return $}function R$4($){return A$4.TD.decode($).replace(/\n/g,"\u240A").replace(/\r/g,"\u240D")}function I$4($,Z=!0){let Q=Z?new _t0.TimeoutError:null,X,Y,J=new Promise((G,K)=>{X={cancel:()=>{if(Y)clearTimeout(Y)}},Y=setTimeout(()=>{if(Q===null)K(new _t0.TimeoutError);else K(Q)},$)});return Object.assign(J,X)}function q$4($=0){let Z,Q=new Promise((X)=>{let Y=setTimeout(()=>{X()},$);Z={cancel:()=>{if(Y)clearTimeout(Y),X()}}});return Object.assign(Q,Z)}async function M$4($,Z=1000){let Q=vt0(),X=setTimeout(()=>{Q.reject(new _t0.TimeoutError)},Z);try{return await Promise.race([$,Q])}finally{clearTimeout(X)}}function vt0(){let $={},Z=new Promise((Q,X)=>{$={resolve:Q,reject:X}});return Object.assign(Z,$)}function V$4(){let $={},Z=new Promise((Q,X)=>{$={resolve:(Y)=>{console.trace("resolve",Y),Q(Y)},reject:(Y)=>{console.trace("reject"),X(Y)}}});return Object.assign(Z,$)}function k$4($){for(let Z=$.length-1;Z>0;Z--){let Q=Math.floor(Math.random()*(Z+1));[$[Z],$[Q]]=[$[Q],$[Z]]}return $}async function S$4($){let Z=[];for await(let Q of $)Z.push(Q);return Z}class L0${timers;measures;constructor(){this.timers=new Map,this.measures=new Map}mark($){this.timers.set($,performance.now())}measure($,Z,Q){let X=this.timers.get(Z);if(X===void 0)throw Error(`${Z} is not defined`);let Y=this.timers.get(Q);if(Y===void 0)throw Error(`${Q} is not defined`);this.measures.set($,Y-X)}getEntries(){let $=[];return this.measures.forEach((Z,Q)=>{$.push({name:Q,duration:Z})}),$}}E0$.Perf=L0$;class w0${max;current;waiting;constructor($=1){this.max=$,this.current=0,this.waiting=[]}lock(){if(this.current++,this.current<=this.max)return Promise.resolve();let $=vt0();return this.waiting.push($),$}unlock(){this.current--,this.waiting.pop()?.resolve()}}E0$.SimpleMutex=w0$;function j0$($){if($===0)return 0;return Math.floor($/2+Math.random()*$)}function C$4($=[0,250,250,500,500,3000,5000]){if(!Array.isArray($))$=[0,250,250,500,500,3000,5000];let Z=$.length-1;return{backoff(Q){return j0$(Q>Z?$[Z]:$[Q])}}}function _$4($){return $*1e6}function v$4($){return Math.floor($/1e6)}var x$4="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",kU=new Uint8Array(62);for(let $=0;$<62;$++)kU[$]=x$4.charCodeAt($);var f$4=218340105584896;function b$4(){let $=Math.floor(Math.random()*f$4),Z=$%62,Q=kU[Z];$=($-Z)/62,Z=$%62;let X=kU[Z];$=($-Z)/62,Z=$%62;let Y=kU[Z];$=($-Z)/62,Z=$%62;let J=kU[Z];$=($-Z)/62,Z=$%62;let G=kU[Z];$=($-Z)/62,Z=$%62;let K=kU[Z];$=($-Z)/62,Z=$%62;let W=kU[Z];$=($-Z)/62;let H=kU[$];return String.fromCharCode(Q,X,Y,J,G,K,W,H)}});var M0$=v((I0$)=>{Object.defineProperty(I0$,"__esModule",{value:!0});I0$.nuid=I0$.NuidImpl=void 0;var s$4="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",IO=62,LQ0=12,T0$=10,P0$=33,e$4=333,A0$=LQ0+T0$,ft0=new Uint8Array(IO);for(let $=0;$<IO;$++)ft0[$]=s$4.charCodeAt($);var DQ0=4294967296,R0$=BigInt(IO)**BigInt(T0$),Qn=Number(R0$/(1n<<32n)),xt0=Number(R0$%(1n<<32n));function $84($){for(let Z=0;Z<$.length;Z++)$[Z]=Math.floor(Math.random()*256)}function Z84($){if(globalThis?.crypto?.getRandomValues)globalThis.crypto.getRandomValues($);else $84($)}class bt0{buf;cbuf;seqHi;seqLo;inc;inited;constructor(){this.buf=new Uint8Array(A0$),this.cbuf=new Uint8Array(LQ0),this.inited=!1}init(){this.inited=!0,this.setPre(),this.initSeqAndInc(),this.fillSeq()}initSeqAndInc(){let $=0;do this.seqHi=Math.floor(Math.random()*(Qn+1)),this.seqLo=Math.floor(Math.random()*DQ0);while($++<8&&this.seqHi===Qn&&this.seqLo>=xt0);if(this.seqHi===Qn&&this.seqLo>=xt0)this.seqLo=0;this.inc=Math.random()*(e$4-P0$)+P0$|0}setPre(){Z84(this.cbuf);for(let $=0;$<LQ0;$++)this.buf[$]=ft0[this.cbuf[$]%IO]}fillSeq(){let $=this.seqHi,Z=this.seqLo;for(let Q=A0$-1;Q>=LQ0;Q--){let X=Math.floor($/IO),J=($-X*IO)*DQ0+Z,G=Math.floor(J/IO),K=J-G*IO;this.buf[Q]=ft0[K],$=X,Z=G}}next(){if(!this.inited)this.init();if(this.seqLo+=this.inc,this.seqLo>=DQ0)this.seqLo-=DQ0,this.seqHi+=1;if(this.seqHi>Qn||this.seqHi===Qn&&this.seqLo>=xt0)this.setPre(),this.initSeqAndInc();this.fillSeq();let $=this.buf;return String.fromCharCode($[0],$[1],$[2],$[3],$[4],$[5],$[6],$[7],$[8],$[9],$[10],$[11],$[12],$[13],$[14],$[15],$[16],$[17],$[18],$[19],$[20],$[21])}reset(){this.init()}}I0$.NuidImpl=bt0;I0$.nuid=new bt0});var C0$=v((k0$)=>{Object.defineProperty(k0$,"__esModule",{value:!0});k0$.nuid=k0$.Nuid=void 0;var V0$=M0$();k0$.Nuid=V0$.NuidImpl;k0$.nuid=V0$.nuid});var jQ0=v((wQ0)=>{Object.defineProperty(wQ0,"__esModule",{value:!0});wQ0.nuid=wQ0.Nuid=void 0;var _0$=C0$();Object.defineProperty(wQ0,"Nuid",{enumerable:!0,get:function(){return _0$.Nuid}});Object.defineProperty(wQ0,"nuid",{enumerable:!0,get:function(){return _0$.nuid}})});var qO=v((v0$)=>{Object.defineProperty(v0$,"__esModule",{value:!0});v0$.DEFAULT_HOST=v0$.DEFAULT_PORT=v0$.Match=void 0;v0$.syncIterator=K84;v0$.createInbox=W84;var J84=jQ0(),G84=BJ();v0$.Match={Exact:"exact",CanonicalMIME:"canonical",IgnoreCase:"insensitive"};function K84($){let Z=$[Symbol.asyncIterator]();return{async next(){let Q=await Z.next();if(Q.done)return Promise.resolve(null);return Promise.resolve(Q.value)}}}function W84($=""){if($=$||"_INBOX",typeof $!=="string")throw TypeError("prefix must be a string");return $.split(".").forEach((Z)=>{if(Z==="*"||Z===">")throw G84.InvalidArgumentError.format("prefix",`cannot have wildcards ('${$}')`)}),`${$}.${J84.nuid.next()}`}v0$.DEFAULT_PORT=4222;v0$.DEFAULT_HOST="127.0.0.1"});var Xn=v((y0$)=>{Object.defineProperty(y0$,"__esModule",{value:!0});y0$.DataBuffer=void 0;var f0$=NJ();class b0${buffers;byteLength;constructor(){this.buffers=[],this.byteLength=0}static concat(...$){let Z=0;for(let Y=0;Y<$.length;Y++)Z+=$[Y].length;let Q=new Uint8Array(Z),X=0;for(let Y=0;Y<$.length;Y++)Q.set($[Y],X),X+=$[Y].length;return Q}static fromAscii($){if(!$)$="";return f0$.TE.encode($)}static toAscii($){return f0$.TD.decode($)}reset(){this.buffers.length=0,this.byteLength=0}pack(){if(this.buffers.length>1){let $=new Uint8Array(this.byteLength),Z=0;for(let Q=0;Q<this.buffers.length;Q++)$.set(this.buffers[Q],Z),Z+=this.buffers[Q].length;this.buffers.length=0,this.buffers.push($)}}shift(){if(this.buffers.length){let $=this.buffers.shift();if($)return this.byteLength-=$.length,$}return new Uint8Array(0)}drain($){if(this.buffers.length){this.pack();let Z=this.buffers.pop();if(Z){let Q=this.byteLength;if($===void 0||$>Q)$=Q;let X=Z.subarray(0,$);if(Q>$)this.buffers.push(Z.subarray($));return this.byteLength=Q-$,X}}return new Uint8Array(0)}fill($,...Z){if($)this.buffers.push($),this.byteLength+=$.length;for(let Q=0;Q<Z.length;Q++)if(Z[Q]&&Z[Q].length)this.buffers.push(Z[Q]),this.byteLength+=Z[Q].length}peek(){if(this.buffers.length)return this.pack(),this.buffers[0];return new Uint8Array(0)}size(){return this.byteLength}length(){return this.buffers.length}}y0$.DataBuffer=b0$});var FE=v((u0$)=>{Object.defineProperty(u0$,"__esModule",{value:!0});u0$.LF=u0$.CR=u0$.CRLF=u0$.CR_LF_LEN=u0$.CR_LF=void 0;u0$.setTransportFactory=L84;u0$.defaultPort=w84;u0$.getUrlParseFn=j84;u0$.newTransport=E84;u0$.getResolveFn=z84;u0$.protoLen=h0$;u0$.extractProtocolMessage=P84;var B84=NJ(),O84=qO(),D84=Xn(),OJ;function L84($){OJ=$}function w84(){return OJ!==void 0&&OJ.defaultPort!==void 0?OJ.defaultPort:O84.DEFAULT_PORT}function j84(){return OJ!==void 0&&OJ.urlParseFn?OJ.urlParseFn:void 0}function E84(){if(!OJ||typeof OJ.factory!=="function")throw Error("transport fn is not set");return OJ.factory()}function z84(){return OJ!==void 0&&OJ.dnsResolveFn?OJ.dnsResolveFn:void 0}u0$.CR_LF=`\r
1566
1566
  `;u0$.CR_LF_LEN=u0$.CR_LF.length;u0$.CRLF=D84.DataBuffer.fromAscii(u0$.CR_LF);u0$.CR=new Uint8Array(u0$.CRLF)[0];u0$.LF=new Uint8Array(u0$.CRLF)[1];function h0$($){for(let Z=0;Z<$.length;Z++){let Q=Z+1;if($.byteLength>Q&&$[Z]===u0$.CR&&$[Q]===u0$.LF)return Q+1}return 0}function P84($){let Z=h0$($);if(Z>0){let X=new Uint8Array($).slice(0,Z);return B84.TD.decode(X)}return""}});var ct0=v((t0$)=>{Object.defineProperty(t0$,"__esModule",{value:!0});t0$.ipV4=i0$;t0$.isIP=_84;t0$.parseIP=p0$;var Yn=4,UE=16,EQ0=48,d0$=57,l0$=65,S84=70,m0$=97,C84=102,ut0=16777215;function i0$($,Z,Q,X){let Y=new Uint8Array(UE);return[0,0,0,0,0,0,0,0,0,0,255,255].forEach((G,K)=>{Y[K]=G}),Y[12]=$,Y[13]=Z,Y[14]=Q,Y[15]=X,Y}function _84($){return p0$($)!==void 0}function p0$($){for(let Z=0;Z<$.length;Z++)switch($[Z]){case".":return n0$($);case":":return v84($)}return}function n0$($){let Z=new Uint8Array(Yn);for(let Q=0;Q<Yn;Q++){if($.length===0)return;if(Q>0){if($[0]!==".")return;$=$.substring(1)}let{n:X,c:Y,ok:J}=x84($);if(!J||X>255)return;$=$.substring(Y),Z[Q]=X}return i0$(Z[0],Z[1],Z[2],Z[3])}function v84($){let Z=new Uint8Array(UE),Q=-1;if($.length>=2&&$[0]===":"&&$[1]===":"){if(Q=0,$=$.substring(2),$.length===0)return Z}let X=0;while(X<UE){let{n:Y,c:J,ok:G}=f84($);if(!G||Y>65535)return;if(J<$.length&&$[J]==="."){if(Q<0&&X!=UE-Yn)return;if(X+Yn>UE)return;let K=n0$($);if(K===void 0)return;Z[X]=K[12],Z[X+1]=K[13],Z[X+2]=K[14],Z[X+3]=K[15],$="",X+=Yn;break}if(Z[X]=Y>>8,Z[X+1]=Y,X+=2,$=$.substring(J),$.length===0)break;if($[0]!==":"||$.length==1)return;if($=$.substring(1),$[0]===":"){if(Q>=0)return;if(Q=X,$=$.substring(1),$.length===0)break}}if($.length!==0)return;if(X<UE){if(Q<0)return;let Y=UE-X;for(let J=X-1;J>=Q;J--)Z[J+Y]=Z[J];for(let J=Q+Y-1;J>=Q;J--)Z[J]=0}else if(Q>=0)return;return Z}function x84($){let Z=0,Q=0;for(Z=0;Z<$.length&&EQ0<=$.charCodeAt(Z)&&$.charCodeAt(Z)<=d0$;Z++)if(Q=Q*10+($.charCodeAt(Z)-EQ0),Q>=ut0)return{n:ut0,c:Z,ok:!1};if(Z===0)return{n:0,c:0,ok:!1};return{n:Q,c:Z,ok:!0}}function f84($){let Z=0,Q=0;for(Q=0;Q<$.length;Q++){if(EQ0<=$.charCodeAt(Q)&&$.charCodeAt(Q)<=d0$)Z*=16,Z+=$.charCodeAt(Q)-EQ0;else if(m0$<=$.charCodeAt(Q)&&$.charCodeAt(Q)<=C84)Z*=16,Z+=$.charCodeAt(Q)-m0$+10;else if(l0$<=$.charCodeAt(Q)&&$.charCodeAt(Q)<=S84)Z*=16,Z+=$.charCodeAt(Q)-l0$+10;else break;if(Z>=ut0)return{n:0,c:Q,ok:!1}}if(Q===0)return{n:0,c:Q,ok:!1};return{n:Z,c:Q,ok:!0}}});var nt0=v((r0$)=>{Object.defineProperty(r0$,"__esModule",{value:!0});r0$.Servers=r0$.ServerImpl=void 0;r0$.isIPV4OrHostname=o0$;r0$.hostPort=pt0;var lt0=FE(),mt0=e3(),dt0=ct0(),h84=qO(),u84=BJ();function o0$($){if($.indexOf("[")!==-1||$.indexOf("::")!==-1)return!1;if($.indexOf(".")!==-1)return!0;if($.split(":").length<=2)return!0;return!1}function it0($){return!o0$($)}function c84($){let Q=$.toUpperCase().indexOf("::FFFF:");if(Q!==-1&&$.indexOf(".")!==-1){let X=$.substring(Q+7);return X=X.replace("[",""),X.replace("]","")}return $}function pt0($){if($=$.trim(),$.match(/^(.*:\/\/)(.*)/m))$=$.replace(/^(.*:\/\/)(.*)/gm,"$2");if($=c84($),it0($)&&$.indexOf("[")===-1)$=`[${$}]`;let Z=it0($)?$.match(/(]:)(\d+)/):$.match(/(:)(\d+)/),Q=Z&&Z.length===3&&Z[1]&&Z[2]?parseInt(Z[2]):h84.DEFAULT_PORT,Y=new URL(`${Q===80?"https":"http"}://${$}`);Y.port=`${Q}`;let J=Y.hostname;if(J.charAt(0)==="[")J=J.substring(1,J.length-1);return{listen:Y.host,hostname:J,port:Q}}class Yg{src;listen;hostname;port;didConnect;reconnects;lastConnect;gossiped;tlsName;resolves;constructor($,Z=!1){this.src=$,this.tlsName="";let Q=pt0($);this.listen=Q.listen,this.hostname=Q.hostname,this.port=Q.port,this.didConnect=!1,this.reconnects=0,this.lastConnect=0,this.gossiped=Z}toString(){return this.listen}async resolve($){if(!$.fn||$.resolve===!1)return[this];let Z=[];if((0,dt0.isIP)(this.hostname))return[this];else{let Q=await $.fn(this.hostname);if($.debug)console.log(`resolve ${this.hostname} = ${Q.join(",")}`);for(let X of Q){let Y=this.port===80?"https":"http",J=new URL(`${Y}://${it0(X)?"["+X+"]":X}`);J.port=`${this.port}`;let G=new Yg(J.host,!1);G.tlsName=this.hostname,Z.push(G)}}if($.randomize)(0,mt0.shuffle)(Z);return this.resolves=Z,Z}}r0$.ServerImpl=Yg;class zQ0{firstSelect;servers;currentServer;tlsName;randomize;constructor($={}){this.firstSelect=!0,this.servers=[],this.tlsName="",this.randomize=$.randomize||!1}setServers($){if(!Array.isArray($)||$.length===0)throw u84.InvalidArgumentError.format("servers","cannot be empty");let Z=(0,lt0.getUrlParseFn)(),Q=new Map;for(let Y of this.servers)Q.set(Y.listen,Y);let X=[];for(let Y of $){Y=Z?Z(Y):Y;let{listen:J}=pt0(Y),G=Q.get(J);if(G)G.gossiped=!1,X.push(G);else X.push(new Yg(Y))}if(this.randomize)(0,mt0.shuffle)(X);if(this.servers=X,this.currentServer===void 0||!X.includes(this.currentServer))this.currentServer=X[0],this.firstSelect=!0}clear(){this.servers.length=0}updateTLSName(){let $=this.getCurrentServer();if(!(0,dt0.isIP)($.hostname))this.tlsName=$.hostname,this.servers.forEach((Z)=>{if(Z.gossiped)Z.tlsName=this.tlsName})}getCurrentServer(){return this.currentServer}addServer($,Z=!1){let Q=(0,lt0.getUrlParseFn)();$=Q?Q($):$;let X=new Yg($,Z);if((0,dt0.isIP)(X.hostname))X.tlsName=this.tlsName;this.servers.push(X)}selectServer(){if(this.firstSelect)return this.firstSelect=!1,this.currentServer;let $=this.servers.shift();if($)this.servers.push($),this.currentServer=$;return $}removeCurrentServer(){this.removeServer(this.currentServer)}removeServer($){if($){let Z=this.servers.indexOf($);this.servers.splice(Z,1)}}snapshot(){return zQ0.freezeAll(this.servers)}snapshotForHandler(){let $=this.currentServer;if(!$)return this.snapshot();let Z=this.servers.indexOf($);if(Z<=0)return this.snapshot();return zQ0.freezeAll([$,...this.servers.slice(0,Z),...this.servers.slice(Z+1)])}static freezeAll($){return $.map((Z)=>Object.freeze({hostname:Z.hostname,port:Z.port,listen:Z.listen,src:Z.src,tlsName:Z.tlsName,reconnects:Z.reconnects,lastConnect:Z.lastConnect,gossiped:Z.gossiped,didConnect:Z.didConnect}))}find($){return this.servers.find((Z)=>Z.listen===$.listen)}setCurrent($){this.currentServer=$}length(){return this.servers.length}next(){return this.servers.length?this.servers[0]:void 0}getServers(){return this.servers}update($,Z){let Q=[],X=[],Y=(0,lt0.getUrlParseFn)(),J=new Map;if($.connect_urls&&$.connect_urls.length>0)$.connect_urls.forEach((K)=>{K=Y?Y(K,Z):K;let W=new Yg(K,!0);J.set(K,W)});let G=[];if(this.servers.forEach((K,W)=>{let H=K.listen;if(K.gossiped&&this.currentServer.listen!==H&&J.get(H)===void 0)G.push(W);J.delete(H)}),G.reverse(),G.forEach((K)=>{let W=this.servers.splice(K,1);X=X.concat(W[0].listen)}),J.forEach((K,W)=>{this.servers.push(K),Q.push(W)}),this.randomize&&Q.length>0){let K=this.currentServer,W=this.servers.filter((H)=>H!==K);(0,mt0.shuffle)(W),this.servers=K?[K,...W]:W}return{added:Q,deleted:X}}}r0$.Servers=zQ0});var PQ0=v(($1$)=>{Object.defineProperty($1$,"__esModule",{value:!0});$1$.QueuedIteratorImpl=void 0;var tt0=e3(),s0$=BJ();class e0${inflight;processed;received;noIterator;iterClosed;done;signal;yields;filtered;pendingFiltered;ctx;_data;err;time;profile;yielding;didBreak;constructor(){this.inflight=0,this.filtered=0,this.pendingFiltered=0,this.processed=0,this.received=0,this.noIterator=!1,this.done=!1,this.signal=(0,tt0.deferred)(),this.yields=[],this.iterClosed=(0,tt0.deferred)(),this.time=0,this.yielding=!1,this.didBreak=!1,this.profile=!1}[Symbol.asyncIterator](){return this.iterate()}push($){if(this.done)return;if(this.didBreak){if(typeof $==="function"){let Z=$;try{Z()}catch(Q){}}return}if(typeof $==="function")this.pendingFiltered++;this.yields.push($),this.signal.resolve()}async*iterate(){if(this.noIterator)throw new s0$.InvalidOperationError("iterator cannot be used when a callback is registered");if(this.yielding)throw new s0$.InvalidOperationError("iterator is already yielding");this.yielding=!0;try{while(!0){if(this.yields.length===0)await this.signal;if(this.err)throw this.err;let $=this.yields;this.inflight=$.length,this.yields=[];for(let Z=0;Z<$.length;Z++){if(typeof $[Z]==="function"){this.pendingFiltered--;let X=$[Z];try{X()}catch(Y){throw Y}if(this.err)throw this.err;continue}this.processed++,this.inflight--;let Q=this.profile?Date.now():0;yield $[Z],this.time=this.profile?Date.now()-Q:0}if(this.done)break;else if(this.yields.length===0)$.length=0,this.yields=$,this.signal=(0,tt0.deferred)()}}finally{this.didBreak=!0,this.stop()}}stop($){if(this.done)return;this.err=$,this.done=!0,this.signal.resolve(),this.iterClosed.resolve($)}getProcessed(){return this.noIterator?this.received:this.processed}getPending(){return this.yields.length+this.inflight-this.pendingFiltered}getReceived(){return this.received-this.filtered}}$1$.QueuedIteratorImpl=e0$});var ot0=v((Y1$)=>{Object.defineProperty(Y1$,"__esModule",{value:!0});Y1$.MuxSubscription=void 0;var i84=qO(),Q1$=BJ();class X1${baseInbox;reqs;constructor(){this.reqs=new Map}size(){return this.reqs.size}init($){return this.baseInbox=`${(0,i84.createInbox)($)}.`,this.baseInbox}add($){if(!isNaN($.received))$.received=0;this.reqs.set($.token,$)}get($){return this.reqs.get($)}cancel($){this.reqs.delete($.token)}getToken($){let Z=$.subject||"";if(Z.indexOf(this.baseInbox)===0)return Z.substring(this.baseInbox.length);return null}all(){return Array.from(this.reqs.values())}handleError($,Z){if($)return this.all().forEach((Q)=>{Q.resolver(Z,{})}),!0;if(Z.operation==="publish"){let Q=this.all().find((X)=>{return X.requestSubject===Z.subject});if(Q)return Q.resolver(Z,{}),!0}return!1}dispatcher(){return($,Z)=>{let Q=this.getToken(Z);if(Q){let X=this.get(Q);if(X){if($===null)$=Z?.data?.length===0&&Z.headers?.code===503?new Q1$.NoRespondersError(X.requestSubject):null;X.resolver($,Z)}}}}close(){let $=new Q1$.RequestError("connection closed");this.reqs.forEach((Z)=>{Z.resolver($,{})})}}Y1$.MuxSubscription=X1$});var rt0=v((K1$)=>{Object.defineProperty(K1$,"__esModule",{value:!0});K1$.Heartbeat=void 0;var p84=e3();class G1${ph;interval;maxOut;timer;pendings;constructor($,Z,Q){this.ph=$,this.interval=Z,this.maxOut=Q,this.pendings=[]}start(){this.cancel(),this._schedule()}cancel($){if(this.timer)clearTimeout(this.timer),this.timer=void 0;if(this._reset(),$)this.ph.disconnect()}_schedule(){this.timer=setTimeout(()=>{if(this.ph.dispatchStatus({type:"ping",pendingPings:this.pendings.length+1}),this.pendings.length===this.maxOut){this.cancel(!0);return}let $=(0,p84.deferred)();this.ph.flush($).then(()=>{this._reset()}).catch(()=>{this.cancel()}),this.pendings.push($),this._schedule()},this.interval)}_reset(){this.pendings=this.pendings.filter(($)=>{return $.resolve(),!1})}}K1$.Heartbeat=G1$});var et0=v((N1$)=>{Object.defineProperty(N1$,"__esModule",{value:!0});N1$.DenoBuffer=N1$.MAX_SIZE=N1$.AssertionError=void 0;N1$.assert=F1$;N1$.concat=U1$;N1$.append=t84;N1$.readAll=o84;N1$.writeAll=r84;var n84=NJ();class at0 extends Error{constructor($){super($);this.name="AssertionError"}}N1$.AssertionError=at0;function F1$($,Z="Assertion failed."){if(!$)throw new at0(Z)}var H1$=32768;N1$.MAX_SIZE=4294967294;function AQ0($,Z,Q=0){let X=Z.byteLength-Q;if($.byteLength>X)$=$.subarray(0,X);return Z.set($,Q),$.byteLength}function U1$($,Z){if($===void 0&&Z===void 0)return new Uint8Array(0);if($===void 0)return Z;if(Z===void 0)return $;let Q=new Uint8Array($.length+Z.length);return Q.set($,0),Q.set(Z,$.length),Q}function t84($,Z){return U1$($,Uint8Array.of(Z))}class st0{_buf;_off;constructor($){if(this._off=0,$==null){this._buf=new Uint8Array(0);return}this._buf=new Uint8Array($)}bytes($={copy:!0}){if($.copy===!1)return this._buf.subarray(this._off);return this._buf.slice(this._off)}empty(){return this._buf.byteLength<=this._off}get length(){return this._buf.byteLength-this._off}get capacity(){return this._buf.buffer.byteLength}truncate($){if($===0){this.reset();return}if($<0||$>this.length)throw Error("bytes.Buffer: truncation out of range");this._reslice(this._off+$)}reset(){this._reslice(0),this._off=0}_tryGrowByReslice($){let Z=this._buf.byteLength;if($<=this.capacity-Z)return this._reslice(Z+$),Z;return-1}_reslice($){F1$($<=this._buf.buffer.byteLength),this._buf=new Uint8Array(this._buf.buffer,0,$)}readByte(){let $=new Uint8Array(1);if(this.read($))return $[0];return null}read($){if(this.empty()){if(this.reset(),$.byteLength===0)return 0;return null}let Z=AQ0(this._buf.subarray(this._off),$);return this._off+=Z,Z}writeByte($){return this.write(Uint8Array.of($))}writeString($){return this.write(n84.TE.encode($))}write($){let Z=this._grow($.byteLength);return AQ0($,this._buf,Z)}_grow($){let Z=this.length;if(Z===0&&this._off!==0)this.reset();let Q=this._tryGrowByReslice($);if(Q>=0)return Q;let X=this.capacity;if($<=Math.floor(X/2)-Z)AQ0(this._buf.subarray(this._off),this._buf);else if(X+$>N1$.MAX_SIZE)throw Error("The buffer cannot be grown beyond the maximum size.");else{let Y=new Uint8Array(Math.min(2*X+$,N1$.MAX_SIZE));AQ0(this._buf.subarray(this._off),Y),this._buf=Y}return this._off=0,this._reslice(Math.min(Z+$,N1$.MAX_SIZE)),Z}grow($){if($<0)throw Error("Buffer._grow: negative count");let Z=this._grow($);this._reslice(Z)}readFrom($){let Z=0,Q=new Uint8Array(H1$);while(!0){let X=this.capacity-this.length<H1$,Y=X?Q:new Uint8Array(this._buf.buffer,this.length),J=$.read(Y);if(J===null)return Z;if(X)this.write(Y.subarray(0,J));else this._reslice(this.length+J);Z+=J}}}N1$.DenoBuffer=st0;function o84($){let Z=new st0;return Z.readFrom($),Z.bytes()}function r84($,Z){let Q=0;while(Q<Z.length)Q+=$.write(Z.subarray(Q))}});var Qo0=v((w1$)=>{Object.defineProperty(w1$,"__esModule",{value:!0});w1$.cc=w1$.State=w1$.Parser=w1$.Kind=void 0;w1$.describe=X44;var $o0=et0(),Zo0=NJ();w1$.Kind={OK:0,ERR:1,MSG:2,INFO:3,PING:4,PONG:5};function X44($){let Z,Q="";switch($.kind){case w1$.Kind.MSG:Z="MSG";break;case w1$.Kind.OK:Z="OK";break;case w1$.Kind.ERR:Z="ERR",Q=Zo0.TD.decode($.data);break;case w1$.Kind.PING:Z="PING";break;case w1$.Kind.PONG:Z="PONG";break;case w1$.Kind.INFO:Z="INFO",Q=Zo0.TD.decode($.data)}return`${Z}: ${Q}`}function O1$(){let $={};return $.sid=-1,$.hdr=-1,$.size=-1,$}var D1$=48,Y44=57,Jg=67108864;class L1${dispatcher;state;as;drop;hdr;ma;argBuf;msgBuf;constructor($){this.dispatcher=$,this.state=w1$.State.OP_START,this.as=0,this.drop=0,this.hdr=0}parse($){let Z;for(Z=0;Z<$.length;Z++){let Q=$[Z];switch(this.state){case w1$.State.OP_START:switch(Q){case w1$.cc.M:case w1$.cc.m:this.state=w1$.State.OP_M,this.hdr=-1,this.ma=O1$();break;case w1$.cc.H:case w1$.cc.h:this.state=w1$.State.OP_H,this.hdr=0,this.ma=O1$();break;case w1$.cc.P:case w1$.cc.p:this.state=w1$.State.OP_P;break;case w1$.cc.PLUS:this.state=w1$.State.OP_PLUS;break;case w1$.cc.MINUS:this.state=w1$.State.OP_MINUS;break;case w1$.cc.I:case w1$.cc.i:this.state=w1$.State.OP_I;break;default:throw this.fail($.subarray(Z))}break;case w1$.State.OP_H:switch(Q){case w1$.cc.M:case w1$.cc.m:this.state=w1$.State.OP_M;break;default:throw this.fail($.subarray(Z))}break;case w1$.State.OP_M:switch(Q){case w1$.cc.S:case w1$.cc.s:this.state=w1$.State.OP_MS;break;default:throw this.fail($.subarray(Z))}break;case w1$.State.OP_MS:switch(Q){case w1$.cc.G:case w1$.cc.g:this.state=w1$.State.OP_MSG;break;default:throw this.fail($.subarray(Z))}break;case w1$.State.OP_MSG:switch(Q){case w1$.cc.SPACE:case w1$.cc.TAB:this.state=w1$.State.OP_MSG_SPC;break;default:throw this.fail($.subarray(Z))}break;case w1$.State.OP_MSG_SPC:switch(Q){case w1$.cc.SPACE:case w1$.cc.TAB:continue;default:this.state=w1$.State.MSG_ARG,this.as=Z}break;case w1$.State.MSG_ARG:switch(Q){case w1$.cc.CR:this.drop=1;break;case w1$.cc.NL:{let X=this.argBuf?this.argBuf.bytes():$.subarray(this.as,Z-this.drop);this.processMsgArgs(X),this.drop=0,this.as=Z+1,this.state=w1$.State.MSG_PAYLOAD,Z=this.as+this.ma.size-1;break}default:if(this.argBuf)this.argBuf.writeByte(Q)}break;case w1$.State.MSG_PAYLOAD:if(this.msgBuf)if(this.msgBuf.length>=this.ma.size){let X=this.msgBuf.bytes({copy:!1});this.dispatcher.push({kind:w1$.Kind.MSG,msg:this.ma,data:X}),this.argBuf=void 0,this.msgBuf=void 0,this.state=w1$.State.MSG_END}else{let X=this.ma.size-this.msgBuf.length,Y=$.length-Z;if(Y<X)X=Y;if(X>0)this.msgBuf.write($.subarray(Z,Z+X)),Z=Z+X-1;else this.msgBuf.writeByte(Q)}else if(Z-this.as>=this.ma.size)this.dispatcher.push({kind:w1$.Kind.MSG,msg:this.ma,data:$.subarray(this.as,Z)}),this.argBuf=void 0,this.msgBuf=void 0,this.state=w1$.State.MSG_END;break;case w1$.State.MSG_END:switch(Q){case w1$.cc.NL:this.drop=0,this.as=Z+1,this.state=w1$.State.OP_START;break;default:continue}break;case w1$.State.OP_PLUS:switch(Q){case w1$.cc.O:case w1$.cc.o:this.state=w1$.State.OP_PLUS_O;break;default:throw this.fail($.subarray(Z))}break;case w1$.State.OP_PLUS_O:switch(Q){case w1$.cc.K:case w1$.cc.k:this.state=w1$.State.OP_PLUS_OK;break;default:throw this.fail($.subarray(Z))}break;case w1$.State.OP_PLUS_OK:switch(Q){case w1$.cc.NL:this.dispatcher.push({kind:w1$.Kind.OK}),this.drop=0,this.state=w1$.State.OP_START;break}break;case w1$.State.OP_MINUS:switch(Q){case w1$.cc.E:case w1$.cc.e:this.state=w1$.State.OP_MINUS_E;break;default:throw this.fail($.subarray(Z))}break;case w1$.State.OP_MINUS_E:switch(Q){case w1$.cc.R:case w1$.cc.r:this.state=w1$.State.OP_MINUS_ER;break;default:throw this.fail($.subarray(Z))}break;case w1$.State.OP_MINUS_ER:switch(Q){case w1$.cc.R:case w1$.cc.r:this.state=w1$.State.OP_MINUS_ERR;break;default:throw this.fail($.subarray(Z))}break;case w1$.State.OP_MINUS_ERR:switch(Q){case w1$.cc.SPACE:case w1$.cc.TAB:this.state=w1$.State.OP_MINUS_ERR_SPC;break;default:throw this.fail($.subarray(Z))}break;case w1$.State.OP_MINUS_ERR_SPC:switch(Q){case w1$.cc.SPACE:case w1$.cc.TAB:continue;default:this.state=w1$.State.MINUS_ERR_ARG,this.as=Z}break;case w1$.State.MINUS_ERR_ARG:switch(Q){case w1$.cc.CR:this.drop=1;break;case w1$.cc.NL:{let X;if(this.argBuf)X=this.argBuf.bytes(),this.argBuf=void 0;else X=$.subarray(this.as,Z-this.drop);this.dispatcher.push({kind:w1$.Kind.ERR,data:X}),this.drop=0,this.as=Z+1,this.state=w1$.State.OP_START;break}default:if(this.argBuf)this.argBuf.write(Uint8Array.of(Q))}break;case w1$.State.OP_P:switch(Q){case w1$.cc.I:case w1$.cc.i:this.state=w1$.State.OP_PI;break;case w1$.cc.O:case w1$.cc.o:this.state=w1$.State.OP_PO;break;default:throw this.fail($.subarray(Z))}break;case w1$.State.OP_PO:switch(Q){case w1$.cc.N:case w1$.cc.n:this.state=w1$.State.OP_PON;break;default:throw this.fail($.subarray(Z))}break;case w1$.State.OP_PON:switch(Q){case w1$.cc.G:case w1$.cc.g:this.state=w1$.State.OP_PONG;break;default:throw this.fail($.subarray(Z))}break;case w1$.State.OP_PONG:switch(Q){case w1$.cc.NL:this.dispatcher.push({kind:w1$.Kind.PONG}),this.drop=0,this.state=w1$.State.OP_START;break}break;case w1$.State.OP_PI:switch(Q){case w1$.cc.N:case w1$.cc.n:this.state=w1$.State.OP_PIN;break;default:throw this.fail($.subarray(Z))}break;case w1$.State.OP_PIN:switch(Q){case w1$.cc.G:case w1$.cc.g:this.state=w1$.State.OP_PING;break;default:throw this.fail($.subarray(Z))}break;case w1$.State.OP_PING:switch(Q){case w1$.cc.NL:this.dispatcher.push({kind:w1$.Kind.PING}),this.drop=0,this.state=w1$.State.OP_START;break}break;case w1$.State.OP_I:switch(Q){case w1$.cc.N:case w1$.cc.n:this.state=w1$.State.OP_IN;break;default:throw this.fail($.subarray(Z))}break;case w1$.State.OP_IN:switch(Q){case w1$.cc.F:case w1$.cc.f:this.state=w1$.State.OP_INF;break;default:throw this.fail($.subarray(Z))}break;case w1$.State.OP_INF:switch(Q){case w1$.cc.O:case w1$.cc.o:this.state=w1$.State.OP_INFO;break;default:throw this.fail($.subarray(Z))}break;case w1$.State.OP_INFO:switch(Q){case w1$.cc.SPACE:case w1$.cc.TAB:this.state=w1$.State.OP_INFO_SPC;break;default:throw this.fail($.subarray(Z))}break;case w1$.State.OP_INFO_SPC:switch(Q){case w1$.cc.SPACE:case w1$.cc.TAB:continue;default:this.state=w1$.State.INFO_ARG,this.as=Z}break;case w1$.State.INFO_ARG:switch(Q){case w1$.cc.CR:this.drop=1;break;case w1$.cc.NL:{let X;if(this.argBuf)X=this.argBuf.bytes(),this.argBuf=void 0;else X=$.subarray(this.as,Z-this.drop);this.dispatcher.push({kind:w1$.Kind.INFO,data:X}),this.drop=0,this.as=Z+1,this.state=w1$.State.OP_START;break}default:if(this.argBuf)this.argBuf.writeByte(Q)}break;default:throw this.fail($.subarray(Z))}}if((this.state===w1$.State.MSG_ARG||this.state===w1$.State.MINUS_ERR_ARG||this.state===w1$.State.INFO_ARG)&&!this.argBuf)this.argBuf=new $o0.DenoBuffer($.subarray(this.as,Z-this.drop));if(this.state===w1$.State.MSG_PAYLOAD&&!this.msgBuf){if(!this.argBuf)this.cloneMsgArg();this.msgBuf=new $o0.DenoBuffer($.subarray(this.as))}}cloneMsgArg(){let $=this.ma.subject.length,Z=this.ma.reply?this.ma.reply.length:0,Q=new Uint8Array($+Z);if(Q.set(this.ma.subject),this.ma.reply)Q.set(this.ma.reply,$);if(this.argBuf=new $o0.DenoBuffer(Q),this.ma.subject=Q.subarray(0,$),this.ma.reply)this.ma.reply=Q.subarray($)}processMsgArgs($){if(this.hdr>=0)return this.processHeaderMsgArgs($);let Z=[],Q=-1;for(let X=0;X<$.length;X++)switch($[X]){case w1$.cc.SPACE:case w1$.cc.TAB:case w1$.cc.CR:case w1$.cc.NL:if(Q>=0)Z.push($.subarray(Q,X)),Q=-1;break;default:if(Q<0)Q=X}if(Q>=0)Z.push($.subarray(Q));switch(Z.length){case 3:this.ma.subject=Z[0],this.ma.sid=this.protoParseInt(Z[1]),this.ma.reply=void 0,this.ma.size=this.protoParseInt(Z[2],Jg);break;case 4:this.ma.subject=Z[0],this.ma.sid=this.protoParseInt(Z[1]),this.ma.reply=Z[2],this.ma.size=this.protoParseInt(Z[3],Jg);break;default:throw this.fail($,"processMsgArgs Parse Error")}if(this.ma.sid<0)throw this.fail($,"processMsgArgs Bad or Missing Sid Error");if(this.ma.size<0)throw this.fail($,"processMsgArgs Bad or Missing Size Error")}fail($,Z=""){if(!Z)Z=`parse error [${this.state}]`;else Z=`${Z} [${this.state}]`;return Error(`${Z}: ${Zo0.TD.decode($)}`)}processHeaderMsgArgs($){let Z=[],Q=-1;for(let X=0;X<$.length;X++)switch($[X]){case w1$.cc.SPACE:case w1$.cc.TAB:case w1$.cc.CR:case w1$.cc.NL:if(Q>=0)Z.push($.subarray(Q,X)),Q=-1;break;default:if(Q<0)Q=X}if(Q>=0)Z.push($.subarray(Q));switch(Z.length){case 4:this.ma.subject=Z[0],this.ma.sid=this.protoParseInt(Z[1]),this.ma.reply=void 0,this.ma.hdr=this.protoParseInt(Z[2],Jg),this.ma.size=this.protoParseInt(Z[3],Jg);break;case 5:this.ma.subject=Z[0],this.ma.sid=this.protoParseInt(Z[1]),this.ma.reply=Z[2],this.ma.hdr=this.protoParseInt(Z[3],Jg),this.ma.size=this.protoParseInt(Z[4],Jg);break;default:throw this.fail($,"processHeaderMsgArgs Parse Error")}if(this.ma.sid<0)throw this.fail($,"processHeaderMsgArgs Bad or Missing Sid Error");if(this.ma.hdr<0||this.ma.hdr>this.ma.size)throw this.fail($,"processHeaderMsgArgs Bad or Missing Header Size Error");if(this.ma.size<0)throw this.fail($,"processHeaderMsgArgs Bad or Missing Size Error")}protoParseInt($,Z){if($.length===0||$.length>15)return-1;let Q=0;for(let X=0;X<$.length;X++){if($[X]<D1$||$[X]>Y44)return-1;Q=Q*10+($[X]-D1$)}return Z!==void 0&&Q>Z?-1:Q}}w1$.Parser=L1$;w1$.State={OP_START:0,OP_PLUS:1,OP_PLUS_O:2,OP_PLUS_OK:3,OP_MINUS:4,OP_MINUS_E:5,OP_MINUS_ER:6,OP_MINUS_ERR:7,OP_MINUS_ERR_SPC:8,MINUS_ERR_ARG:9,OP_M:10,OP_MS:11,OP_MSG:12,OP_MSG_SPC:13,MSG_ARG:14,MSG_PAYLOAD:15,MSG_END:16,OP_H:17,OP_P:18,OP_PI:19,OP_PIN:20,OP_PING:21,OP_PO:22,OP_PON:23,OP_PONG:24,OP_I:25,OP_IN:26,OP_INF:27,OP_INFO:28,OP_INFO_SPC:29,INFO_ARG:30};w1$.cc={CR:13,E:69,e:101,F:70,f:102,G:71,g:103,H:72,h:104,I:73,i:105,K:75,k:107,M:77,m:109,MINUS:45,N:78,n:110,NL:10,O:79,o:111,P:80,p:112,PLUS:43,R:82,r:114,S:83,s:115,SPACE:32,TAB:9}});var IQ0=v((E1$)=>{Object.defineProperty(E1$,"__esModule",{value:!0});E1$.MsgHdrsImpl=void 0;E1$.canonicalMIMEHeaderKey=Yo0;E1$.headers=K44;var j1$=NJ(),$K=qO(),RQ0=BJ();function Yo0($){let F=!0,U=Array($.length);for(let N=0;N<$.length;N++){let B=$.charCodeAt(N);if(B===58||B<33||B>126)throw RQ0.InvalidArgumentError.format("header",`'${$[N]}' is not a valid character in a header name`);if(F&&97<=B&&B<=122)B-=32;else if(!F&&65<=B&&B<=90)B+=32;U[N]=B,F=B==45}return String.fromCharCode(...U)}function K44($=0,Z=""){if($===0&&Z!=="")throw RQ0.InvalidArgumentError.format("code","is required");else if($>0&&Z==="")throw RQ0.InvalidArgumentError.format("description","is required");return new Gg($,Z)}var Xo0="NATS/1.0";class Gg{_code;headers;_description;constructor($=0,Z=""){this._code=$,this._description=Z,this.headers=new Map}[Symbol.iterator](){return this.headers.entries()}size(){return this.headers.size}equals($){if($&&this.headers.size===$.headers.size&&this._code===$._code){for(let[Z,Q]of this.headers){let X=$.values(Z);if(Q.length!==X.length)return!1;let Y=[...Q].sort(),J=[...X].sort();for(let G=0;G<Y.length;G++)if(Y[G]!==J[G])return!1}return!0}return!1}static decode($){let Z=new Gg,X=j1$.TD.decode($).split(`\r
1567
1567
  `),Y=X[0];if(Y!==Xo0){let J=Y.replace(Xo0,"").trim();if(J.length>0){if(Z._code=parseInt(J,10),isNaN(Z._code))Z._code=0;let G=Z._code.toString();J=J.replace(G,""),Z._description=J.trim()}}if(X.length>=1)X.slice(1).map((J)=>{if(J){let G=J.indexOf(":");if(G>-1){let K=J.slice(0,G),W=J.slice(G+1).trim();Z.append(K,W)}}});return Z}toString(){if(this.headers.size===0&&this._code===0)return"";let $=Xo0;if(this._code>0&&this._description!=="")$+=` ${this._code} ${this._description}`;for(let[Z,Q]of this.headers)for(let X=0;X<Q.length;X++)$=`${$}\r
1568
1568
  ${Z}: ${Q[X]}`;return`${$}\r