decocms 4.581.0 → 4.582.0

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 (422) hide show
  1. package/dist/client/assets/{AlertCircle-BNgT9H-9.js → AlertCircle-D-4TK36c.js} +1 -1
  2. package/dist/client/assets/{AreaChart-CizTxrut.js → AreaChart-CkFdSy1i.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-CzuIgcZK.js → ArrowLeft-B34wRVvp.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-DX0Oa8sk.js → ArrowUp-Cf_Jm-4W.js} +1 -1
  5. package/dist/client/assets/{BookOpen01-BDEDqARy.js → BookOpen01-Cu2i97yZ.js} +1 -1
  6. package/dist/client/assets/{CartesianChart-D3UU8n4G.js → CartesianChart-gyi9lPG0.js} +1 -1
  7. package/dist/client/assets/{CategoricalChart-BXx_yOPa.js → CategoricalChart-DplIvctj.js} +1 -1
  8. package/dist/client/assets/{CheckCircle-DGPVeuCJ.js → CheckCircle-D-W30b_A.js} +1 -1
  9. package/dist/client/assets/{ChevronSelectorVertical-CI140ew9.js → ChevronSelectorVertical-BORaKUYt.js} +1 -1
  10. package/dist/client/assets/{ChevronUp-B9DaDvS3.js → ChevronUp-s7k4XU_p.js} +1 -1
  11. package/dist/client/assets/{CreditCard01-BmpzvB5e.js → CreditCard01-C2QL2326.js} +1 -1
  12. package/dist/client/assets/{Globe04-BpbOo7AZ.js → Globe04-dU-sELuJ.js} +1 -1
  13. package/dist/client/assets/{Key01-Cpl2DWV2.js → Key01-zay6mYZz.js} +1 -1
  14. package/dist/client/assets/{LinkBroken01-l43AWgbv.js → LinkBroken01-D4Fzd5qu.js} +1 -1
  15. package/dist/client/assets/{Minus-DyKaWISs.js → Minus-BikCplhC.js} +1 -1
  16. package/dist/client/assets/{Monitor01-BdFmkSiY.js → Monitor01-DLndo6aP.js} +1 -1
  17. package/dist/client/assets/{Play-BDaEp7vE.js → Play-D_FIXuay.js} +1 -1
  18. package/dist/client/assets/{Plus-Dxw22W7_.js → Plus-D2V2-fTF.js} +1 -1
  19. package/dist/client/assets/ReferenceLine-BHHh91iS.js +1 -0
  20. package/dist/client/assets/{SearchMd-DuFQ9UgF.js → SearchMd-DUXCcvZJ.js} +1 -1
  21. package/dist/client/assets/{ShoppingBag01-Bf_3Yh5l.js → ShoppingBag01-Dak2svm7.js} +1 -1
  22. package/dist/client/assets/{Sun-vurMVi6G.js → Sun-BFXO9tQN.js} +1 -1
  23. package/dist/client/assets/{SwitchHorizontal01-C-rlzvYe.js → SwitchHorizontal01-2Pb5aRtq.js} +1 -1
  24. package/dist/client/assets/{Tool01-D4x0RZqM.js → Tool01-s83oNDoy.js} +1 -1
  25. package/dist/client/assets/{Tooltip-BKPDgiqg.js → Tooltip-D91NYjQw.js} +1 -1
  26. package/dist/client/assets/{Trash01-CGrA2ON1.js → Trash01-Bu2u0WVA.js} +1 -1
  27. package/dist/client/assets/{Upload01-6kkhuzxl.js → Upload01-mgXAmijc.js} +1 -1
  28. package/dist/client/assets/{UserSquare-nHYvjai8.js → UserSquare-DE5Uc7_R.js} +1 -1
  29. package/dist/client/assets/{Users01-e2r7hqMU.js → Users01-C3CmvyvK.js} +1 -1
  30. package/dist/client/assets/{XClose-CBDYK_AJ.js → XClose-l5OHkJlr.js} +1 -1
  31. package/dist/client/assets/{Zap-DfRMi_rk.js → Zap-DN6rNQ1C.js} +1 -1
  32. package/dist/client/assets/{access-gate-3uWjt152.js → access-gate-CLxhnjg9.js} +1 -1
  33. package/dist/client/assets/{add-connection-dialog-CsWthpZ9.js → add-connection-dialog-ZYFX175e.js} +1 -1
  34. package/dist/client/assets/agent-app-Cimvv1NW.js +1 -0
  35. package/dist/client/assets/agent-assets-CXtexOn6.js +1 -0
  36. package/dist/client/assets/{agent-automation-B9u566HN.js → agent-automation-DnUzn_Xt.js} +3 -3
  37. package/dist/client/assets/{agent-automations-C6qoE6-c.js → agent-automations-D4hO7Hf6.js} +1 -1
  38. package/dist/client/assets/agent-blog-C6-P3uCx.js +2 -0
  39. package/dist/client/assets/{agent-blog-post-D4VabN4w.js → agent-blog-post-tCR4iQAk.js} +2 -2
  40. package/dist/client/assets/{agent-calendar-B1gsu6Ys.js → agent-calendar-DqwMJ6TI.js} +1 -1
  41. package/dist/client/assets/{agent-capabilities-BobB8G3S.js → agent-capabilities-DWTuevMP.js} +1 -1
  42. package/dist/client/assets/{agent-connect-sources-D7PAwbiu.js → agent-connect-sources-CQDMgwdR.js} +1 -1
  43. package/dist/client/assets/agent-deck-CTEHtbNm.js +1 -0
  44. package/dist/client/assets/{agent-e2e-BqPOwNTz.js → agent-e2e-CgIk5HXH.js} +1 -1
  45. package/dist/client/assets/agent-experiments-DWa03yYa.js +1 -0
  46. package/dist/client/assets/{agent-file-Ctv4ydWn.js → agent-file-C8OplG41.js} +1 -1
  47. package/dist/client/assets/{agent-hosting-BwGgYisC.js → agent-hosting-DZwc-hYc.js} +1 -1
  48. package/dist/client/assets/{agent-icon-7pgGOyab.js → agent-icon-DHk7TnW1.js} +1 -1
  49. package/dist/client/assets/agent-library-Bhlc7QbZ.js +1 -0
  50. package/dist/client/assets/agent-library-file-NZe3W-xa.js +1 -0
  51. package/dist/client/assets/agent-overview-BjxnoHtS.js +1 -0
  52. package/dist/client/assets/{agent-releases-nWFHpAct.js → agent-releases-DJXEsnr4.js} +2 -2
  53. package/dist/client/assets/agent-settings-IyhNx_G4.js +1 -0
  54. package/dist/client/assets/{agent-site-editor-Beg3HEIb.js → agent-site-editor-LnCUJUlb.js} +1 -1
  55. package/dist/client/assets/agent-site-editor-code-B371nTRh.js +2 -0
  56. package/dist/client/assets/agent-site-editor-content-B6-iieBO.js +1 -0
  57. package/dist/client/assets/agent-site-editor-preview-Dt3bOYz8.js +1 -0
  58. package/dist/client/assets/agent-view-BIybMP8S.js +1 -0
  59. package/dist/client/assets/{agent-view-guard-Cke4S3ir.js → agent-view-guard-BkBbWqXx.js} +1 -1
  60. package/dist/client/assets/{ai-providers-ZTS5TR34.js → ai-providers-CPyrRCb2.js} +1 -1
  61. package/dist/client/assets/{alert-CwJgunZE.js → alert-I1_CrCmh.js} +1 -1
  62. package/dist/client/assets/{analytics-sections-D0V5jY1C.js → analytics-sections-BrNKTJt8.js} +1 -1
  63. package/dist/client/assets/api-keys-BFjbEQH6.js +1 -0
  64. package/dist/client/assets/{api-keys-Buv3-6nf.js → api-keys-CQiDxx3i.js} +1 -1
  65. package/dist/client/assets/{app-editor-DalU60Mc.js → app-editor-Bu-6D-sg.js} +1 -1
  66. package/dist/client/assets/{asset-utils-DwPuRMbV.js → asset-utils-B-KuVMuY.js} +1 -1
  67. package/dist/client/assets/{auth-DNlWgaIH.js → auth-Dh-2aYdX.js} +1 -1
  68. package/dist/client/assets/{auth-catchall-CmRd1j4n.js → auth-catchall-DXrxcWBf.js} +1 -1
  69. package/dist/client/assets/{auth-entry-4GYbBxwp.js → auth-entry-NtnP78Ol.js} +1 -1
  70. package/dist/client/assets/{auth-split-layout-6Kr3YCmt.js → auth-split-layout-FNYje5VL.js} +1 -1
  71. package/dist/client/assets/{authenticate-and-persist-oauth-DpD35C_P.js → authenticate-and-persist-oauth-DOEkiQ_u.js} +1 -1
  72. package/dist/client/assets/{automation-list-row-_Hy4DAtc.js → automation-list-row-CE7SXhaQ.js} +1 -1
  73. package/dist/client/assets/{automation-runs-D3xh6rqy.js → automation-runs-C2quHBYd.js} +1 -1
  74. package/dist/client/assets/{automations-TJ3lg--K.js → automations-DPaT01e7.js} +1 -1
  75. package/dist/client/assets/{badge-DJzADYLN.js → badge-BGmWPELn.js} +1 -1
  76. package/dist/client/assets/{block-document-CLlHaiqy.js → block-document-CuBMSVVn.js} +3 -3
  77. package/dist/client/assets/{blocks-preview-workspace-context-CLkDzb1Y.js → blocks-preview-workspace-context-MbfgZRXf.js} +1 -1
  78. package/dist/client/assets/{blocks-tab-states-Dos-yNvu.js → blocks-tab-states-DdvH_zgH.js} +1 -1
  79. package/dist/client/assets/{blog-preview-url-B9WnCIII.js → blog-preview-url-BoKhflQE.js} +1 -1
  80. package/dist/client/assets/{blog-schema-BNmzJDEb.js → blog-schema-EWcl-SDU.js} +1 -1
  81. package/dist/client/assets/{blog-source-gate-DKGtTR_Q.js → blog-source-gate-ChrbmkH2.js} +1 -1
  82. package/dist/client/assets/{blog-view-gate-CQ9aPosu.js → blog-view-gate-BPhH6bKz.js} +1 -1
  83. package/dist/client/assets/{buckets-Bi-uiwLZ.js → buckets-lH8mvjw2.js} +1 -1
  84. package/dist/client/assets/{build-improve-prompt-doc-D2ZrR4ET.js → build-improve-prompt-doc-ZkNhFh73.js} +1 -1
  85. package/dist/client/assets/{calendar-DVn2WJPG.js → calendar-DD1b_D7F.js} +1 -1
  86. package/dist/client/assets/{capability-load-error-BQYVgnjq.js → capability-load-error-CmORVXZR.js} +1 -1
  87. package/dist/client/assets/{category-editor-BiRVC1cc.js → category-editor-CIxCWDky.js} +1 -1
  88. package/dist/client/assets/{category-tree-jh72wtxu.js → category-tree-ArvPlYX5.js} +1 -1
  89. package/dist/client/assets/{chart-Ddie86U1.js → chart-q3aX-DjJ.js} +1 -1
  90. package/dist/client/assets/{chat-context-ChgzPsES.js → chat-context-B9rZ1ojJ.js} +1 -1
  91. package/dist/client/assets/{chat-draft-B2tS32RP.js → chat-draft-BsgbOfj3.js} +1 -1
  92. package/dist/client/assets/{checkbox-CQfIpQ5a.js → checkbox-JFndFNuZ.js} +1 -1
  93. package/dist/client/assets/{choose-editor-Bwogocbp.js → choose-editor-DvmC-iMO.js} +1 -1
  94. package/dist/client/assets/{cli-auth-success-DbSIbWbL.js → cli-auth-success-CTMmXIbK.js} +1 -1
  95. package/dist/client/assets/{client-icons-yH-3z7dy.js → client-icons-CvP_xTjP.js} +1 -1
  96. package/dist/client/assets/{cms-settings-editor-DuNBWNJd.js → cms-settings-editor-9nWJpKcE.js} +1 -1
  97. package/dist/client/assets/{cms-store-drafts-DGLCde3H.js → cms-store-drafts-Cp0f_S-1.js} +1 -1
  98. package/dist/client/assets/{collapsible-fuf-L_qO.js → collapsible-B4lmmxiu.js} +1 -1
  99. package/dist/client/assets/{collection-detail-CJvo4hBg.js → collection-detail-DLSsSNsw.js} +1 -1
  100. package/dist/client/assets/{collection-display-button-zHygXgth.js → collection-display-button-L-gJFCO8.js} +1 -1
  101. package/dist/client/assets/{collection-search-DIXRttD3.js → collection-search-j-a5PWZI.js} +1 -1
  102. package/dist/client/assets/{collection-table-wrapper-Bp116wWk.js → collection-table-wrapper-BbdjpVWW.js} +1 -1
  103. package/dist/client/assets/{collection-tabs-nxDU_6IX.js → collection-tabs-DHj6Urx3.js} +1 -1
  104. package/dist/client/assets/{combobox-BOO1GhW0.js → combobox-CBPCAqF_.js} +1 -1
  105. package/dist/client/assets/{command-BBpufUKx.js → command-DCUf4RGf.js} +1 -1
  106. package/dist/client/assets/{companion-mcps-section-Cw9eOzvy.js → companion-mcps-section-C-0h9QLB.js} +1 -1
  107. package/dist/client/assets/{config-DZ1AmUim.js → config-gK1vyYpA.js} +1 -1
  108. package/dist/client/assets/{connect-QNbrI0M1.js → connect-BjmhjHJY.js} +2 -2
  109. package/dist/client/assets/{connect-layout-CmTu9QhZ.js → connect-layout-BiGf7x_Q.js} +1 -1
  110. package/dist/client/assets/{connect-source-dialog-DgL9lhtn.js → connect-source-dialog-C9cU78Fo.js} +1 -1
  111. package/dist/client/assets/{connection-CP9XigF8.js → connection-CG7u8AbM.js} +1 -1
  112. package/dist/client/assets/{connection-card-C84CXoEt.js → connection-card-C5XxA3Cv.js} +1 -1
  113. package/dist/client/assets/{connection-detail-3J7QgUsN.js → connection-detail-DpiK53yx.js} +1 -1
  114. package/dist/client/assets/{connection-form-helpers-vw6gzBiD.js → connection-form-helpers-B2Vjms_B.js} +1 -1
  115. package/dist/client/assets/{connection-slug-CI3A8_ee.js → connection-slug-C9_jBSFl.js} +1 -1
  116. package/dist/client/assets/{connections-BHsWCRN2.js → connections-COV9Ow5m.js} +1 -1
  117. package/dist/client/assets/{content-tab-UCeaV9ZK.js → content-tab-Ct80gvFF.js} +3 -3
  118. package/dist/client/assets/{context-CqcUfuqw.js → context-BvzzvYU9.js} +1 -1
  119. package/dist/client/assets/{context-menu-DTU6qOVz.js → context-menu-B7ywEyjT.js} +1 -1
  120. package/dist/client/assets/{context-shell-DqR6-S0A.js → context-shell-C6vXZZrB.js} +3 -3
  121. package/dist/client/assets/{core.esm-DCJ7aKR3.js → core.esm-B-QMfivo.js} +1 -1
  122. package/dist/client/assets/{create-organization-dialog-DKxaQrfF.js → create-organization-dialog-CfD4gWck.js} +1 -1
  123. package/dist/client/assets/{delete-copy-sYXKk3Pf.js → delete-copy-CPJVDDbB.js} +1 -1
  124. package/dist/client/assets/{device-hint-D11AIkCQ.js → device-hint-CwVsFX34.js} +1 -1
  125. package/dist/client/assets/discover-BoR_YGj-.js +1 -0
  126. package/dist/client/assets/{domain-settings-DBmeAU8w.js → domain-settings-Dgpsy8Ru.js} +1 -1
  127. package/dist/client/assets/{drawer-DyYc7c6p.js → drawer-DRyRdlMw.js} +1 -1
  128. package/dist/client/assets/{editor-Cx1cLsfT.js → editor-FceeQfS7.js} +2 -2
  129. package/dist/client/assets/{editor-classes-5OQkwYAb.js → editor-classes-D9FopdtJ.js} +1 -1
  130. package/dist/client/assets/{empty-message-BxCQf5X6.js → empty-message-ILKuHEfQ.js} +1 -1
  131. package/dist/client/assets/{empty-state-COfoPZ3l.js → empty-state-BmCMJHsS.js} +1 -1
  132. package/dist/client/assets/{empty-state-A6nZ3Khe.js → empty-state-GIO1CyUk.js} +1 -1
  133. package/dist/client/assets/{experiments-tab-choice-DaaymsEH.js → experiments-tab-choice-CAU_bLj1.js} +1 -1
  134. package/dist/client/assets/{extract-connection-data-Cfb1bv3l.js → extract-connection-data-BKW6jN3t.js} +1 -1
  135. package/dist/client/assets/{feature-gate-CESZ0bbT.js → feature-gate-2lTAc4xs.js} +1 -1
  136. package/dist/client/assets/{feature-paywall-D4s9Ps36.js → feature-paywall-DrXSdvNQ.js} +1 -1
  137. package/dist/client/assets/{file-explorer-syldxbM0.js → file-explorer-SB0BRdQa.js} +1 -1
  138. package/dist/client/assets/{file-preview-B5GYsNzx.js → file-preview-mmsBTOqH.js} +1 -1
  139. package/dist/client/assets/{file-share-button-O89-cSWp.js → file-share-button-BmXIU90b.js} +1 -1
  140. package/dist/client/assets/{file-type-icon-CK3whZmM.js → file-type-icon-CLz3IVP9.js} +1 -1
  141. package/dist/client/assets/{folder-icon-B0bQ9NL4.js → folder-icon-DczOK4X3.js} +1 -1
  142. package/dist/client/assets/{form-CKh2Qm-8.js → form-B_7ux469.js} +1 -1
  143. package/dist/client/assets/{frame-navigation-c9xPkylV.js → frame-navigation-BFx5wDUC.js} +1 -1
  144. package/dist/client/assets/{general-4YbTEBSJ.js → general-CPM5iXZa.js} +1 -1
  145. package/dist/client/assets/{github-icon-D3u8oGuo.js → github-icon-1x8ZI6aO.js} +1 -1
  146. package/dist/client/assets/held-block-view-CwWI05W1.js +3 -0
  147. package/dist/client/assets/{home-7FPOWVs4.js → home-CYIjoH-m.js} +1 -1
  148. package/dist/client/assets/{home-overview-D_b45WGe.js → home-overview-BvhVg2vV.js} +1 -1
  149. package/dist/client/assets/{hosted-reconcile-j0Z_Am5O.js → hosted-reconcile-J9x487tr.js} +1 -1
  150. package/dist/client/assets/{icon-button-Bd1QIQSI.js → icon-button-DoWTRkdN.js} +1 -1
  151. package/dist/client/assets/{index-BtpIwkuJ.js → index-249EXZ6B.js} +1 -1
  152. package/dist/client/assets/{index-BzeTLGQv.js → index-3FmhyOXc.js} +1 -1
  153. package/dist/client/assets/{index-DdNgZUci.js → index-B-Ig6PCZ.js} +1 -1
  154. package/dist/client/assets/{index-CB2dsreI.js → index-BW4kEj0q.js} +1 -1
  155. package/dist/client/assets/{index-B1ZkAVAg.js → index-BWer9hfc.js} +1 -1
  156. package/dist/client/assets/{index-BK7R90SQ.js → index-BcW9W_hK.js} +1 -1
  157. package/dist/client/assets/{index-DYPWHH-M.css → index-BtRGS8vq.css} +1 -1
  158. package/dist/client/assets/index-CFMb9ZoK.js +4 -0
  159. package/dist/client/assets/{index-Ctd-FMgv.js → index-CFoO-AVG.js} +1 -1
  160. package/dist/client/assets/{index-D1SFZrX0.js → index-CITQS6NN.js} +1 -1
  161. package/dist/client/assets/{index-mWjBJsbL.js → index-D-5KT7YJ.js} +1 -1
  162. package/dist/client/assets/{index-RtIgAXvS.js → index-D4fWOfQV.js} +1 -1
  163. package/dist/client/assets/{index-BqA84bKQ.js → index-D9wygnbU.js} +5 -5
  164. package/dist/client/assets/{index-ClzeL0fX.js → index-DT6cEtD6.js} +1 -1
  165. package/dist/client/assets/{index-CC3v5-e4.js → index-DpIy5MwJ.js} +1 -1
  166. package/dist/client/assets/{index-Dnajt-Ss.js → index-OqiiY1Yn.js} +1 -1
  167. package/dist/client/assets/{index-Bx5tjmDd.js → index-mxlRzmxc.js} +1 -1
  168. package/dist/client/assets/{index-redirect-DqohMHdx.js → index-redirect-CJIC9mkE.js} +1 -1
  169. package/dist/client/assets/{index-BUdfGMTq.js → index-rmNLmONI.js} +1 -1
  170. package/dist/client/assets/{infiniteQueryObserver-amUGbo-h.js → infiniteQueryObserver-oJohchTM.js} +1 -1
  171. package/dist/client/assets/{infra-billing-aV_8QlC0.js → infra-billing-BmRwy4ol.js} +1 -1
  172. package/dist/client/assets/{input-CfL5_z7D.js → input-8RS_xi7t.js} +4 -4
  173. package/dist/client/assets/{input-D3jDgHNU.js → input-BKW9wk8M.js} +1 -1
  174. package/dist/client/assets/{integration-icon-C9sCBDDr.js → integration-icon-BPaLmZuD.js} +1 -1
  175. package/dist/client/assets/item-actions-1298TOwC.js +1 -0
  176. package/dist/client/assets/{jira-icon-CcSFFwnZ.js → jira-icon-DjiAFXC-.js} +1 -1
  177. package/dist/client/assets/{label-Ducx0j9M.js → label-CzgbmbQw.js} +1 -1
  178. package/dist/client/assets/{layout-DCetvNif.js → layout-CUqOdrCT.js} +1 -1
  179. package/dist/client/assets/{legacy-admin-welcome-dialog-C1mvlaj8.js → legacy-admin-welcome-dialog-D_Hj5ND0.js} +1 -1
  180. package/dist/client/assets/{legacy-agents-deep-BrG2c50d.js → legacy-agents-deep-CzKSWS31.js} +1 -1
  181. package/dist/client/assets/{legacy-main-redirect-B0LLa-b2.js → legacy-main-redirect-DS2vLtmG.js} +1 -1
  182. package/dist/client/assets/library-Brt6n-TA.js +1 -0
  183. package/dist/client/assets/{library-tab-y1C-Q300.js → library-tab-CH65a0_i.js} +1 -1
  184. package/dist/client/assets/{login-DnAhZq8E.js → login-BB30sN9A.js} +1 -1
  185. package/dist/client/assets/{markdown-DTS1cwWT.js → markdown-Ck8Lzm4U.js} +1 -1
  186. package/dist/client/assets/match-site-slug-config-B47_xZCi.js +1 -0
  187. package/dist/client/assets/{mcp-app-renderer-DEXD8Qqv.js → mcp-app-renderer-Bo8RWBFo.js} +1 -1
  188. package/dist/client/assets/{mcp-oauth-C8CUMukq.js → mcp-oauth-3agwb6e9.js} +1 -1
  189. package/dist/client/assets/{mcp-oauth-CMXtLqpM.js → mcp-oauth-D2OwpRg0.js} +1 -1
  190. package/dist/client/assets/{members-CUn6ovIa.js → members-ChISvAMj.js} +1 -1
  191. package/dist/client/assets/{memory-DEndhGVA.js → memory-C27haG4J.js} +2 -2
  192. package/dist/client/assets/{mock-board-hNoqXmUR.js → mock-board-BywyOk2L.js} +4 -4
  193. package/dist/client/assets/{monaco-editor-BKbGnxf4.js → monaco-editor-Dfffv6IO.js} +1 -1
  194. package/dist/client/assets/{monitoring-T940h_oR.js → monitoring-CHShsrek.js} +1 -1
  195. package/dist/client/assets/{monitoring-stats-row-2tRkF4-m.js → monitoring-stats-row-D7LX-cE_.js} +1 -1
  196. package/dist/client/assets/{multi-select-GBdcv1ph.js → multi-select-B4TjM0bb.js} +1 -1
  197. package/dist/client/assets/{mustache-CNh4n0Td.js → mustache-DTIKPLCX.js} +1 -1
  198. package/dist/client/assets/{named-rule-step-7q8hws5D.js → named-rule-step-DvAWHM_a.js} +1 -1
  199. package/dist/client/assets/{named-rule-view-cnpqxYzZ.js → named-rule-view-BNe6XoGj.js} +1 -1
  200. package/dist/client/assets/{new-project-dialog-BOtGKQPA.js → new-project-dialog-MxeroDTr.js} +1 -1
  201. package/dist/client/assets/{oauth-callback-DG0XUetw.js → oauth-callback-BAHxkyHL.js} +1 -1
  202. package/dist/client/assets/{oauth-callback-ai-provider-DeIO_gxm.js → oauth-callback-ai-provider-0HSc9az8.js} +1 -1
  203. package/dist/client/assets/{oauth-consent-D-6r1X7a.js → oauth-consent-B6XJ_dp8.js} +1 -1
  204. package/dist/client/assets/{onboarding-CWuOwe9b.js → onboarding-CpC02gHH.js} +1 -1
  205. package/dist/client/assets/{openai-conversation-DLhmBPPN.js → openai-conversation-PDrYjlY3.js} +2 -2
  206. package/dist/client/assets/{optimistic-project-sidebar-views-CvZPbOqN.js → optimistic-project-sidebar-views-DEmaeFuw.js} +1 -1
  207. package/dist/client/assets/{order-monitor-day-CyPFX5Di.js → order-monitor-day-CWMt_zZN.js} +1 -1
  208. package/dist/client/assets/{organization-choice-Cw-WUBNy.js → organization-choice-DJG3VWvN.js} +1 -1
  209. package/dist/client/assets/{orgs-BiS6luDN.js → orgs-Dk0Ii4jK.js} +1 -1
  210. package/dist/client/assets/{own-accounts-section-BqkowOV8.js → own-accounts-section-h1niaKS8.js} +1 -1
  211. package/dist/client/assets/{pair-NNIqbXGE.js → pair-Cd8NH003.js} +1 -1
  212. package/dist/client/assets/{parse-sections-D5t3BRqc.js → parse-sections-C45nXdFm.js} +2 -2
  213. package/dist/client/assets/{plan-D05Kl9P6.js → plan-D9R1-AZQ.js} +1 -1
  214. package/dist/client/assets/{plan-ladder-CiVpDo1G.js → plan-ladder-ClYEg_1y.js} +1 -1
  215. package/dist/client/assets/{plan-usage-card-DRsDd5Ch.js → plan-usage-card-DmepxGNe.js} +2 -2
  216. package/dist/client/assets/{popover-fDNjdHxM.js → popover-DbdL41A-.js} +1 -1
  217. package/dist/client/assets/post-calendar-BodpNGCL.js +1 -0
  218. package/dist/client/assets/post-editor-CVR7WxMp.js +2 -0
  219. package/dist/client/assets/{preview-content-DkAXLl1L.js → preview-content-CAIaH_bT.js} +1 -1
  220. package/dist/client/assets/{preview-dialog-N7_y9qxA.js → preview-dialog-CAVf21hW.js} +1 -1
  221. package/dist/client/assets/{preview-panel-oVdKWth1.js → preview-panel-DcRdLvZD.js} +1 -1
  222. package/dist/client/assets/{preview-tab-BWI7aVoc.js → preview-tab-Da5MFmuu.js} +21 -15
  223. package/dist/client/assets/{product-picker-dialog-Dr51YJVY.js → product-picker-dialog-n0_PqHbz.js} +1 -1
  224. package/dist/client/assets/{profile-BXOGbnau.js → profile-C2zVoVuX.js} +1 -1
  225. package/dist/client/assets/project-app-view-DL5XMDyp.js +1 -0
  226. package/dist/client/assets/{project-apps-DN56tnxe.js → project-apps-Oyn1Gnz0.js} +1 -1
  227. package/dist/client/assets/{project-icon-C60MdZm4.js → project-icon-D3VravgB.js} +1 -1
  228. package/dist/client/assets/{project-index-Dv-ZwV38.js → project-index-CZL_Bcej.js} +1 -1
  229. package/dist/client/assets/project-reports-CC7ptk4l.js +1 -0
  230. package/dist/client/assets/project-tasks-DMyDSLCM.js +1 -0
  231. package/dist/client/assets/{projects-By-y5Jp6.js → projects-3knV1Wr_.js} +1 -1
  232. package/dist/client/assets/{projects-empty-state-N3hmoiH1.js → projects-empty-state-ChOzUybQ.js} +1 -1
  233. package/dist/client/assets/{prompts-DTm9aAYf.js → prompts-Cs8yzamL.js} +1 -1
  234. package/dist/client/assets/{record-editor-PaaqLZHk.js → record-editor-CkMBdekB.js} +1 -1
  235. package/dist/client/assets/{redirect-editor-B2Eu0M_z.js → redirect-editor-DhGl9GBV.js} +1 -1
  236. package/dist/client/assets/{reports-sOqJNuXD.js → reports-DDPJwQn7.js} +1 -1
  237. package/dist/client/assets/{reports-onboarding-i6k1gG6Q.js → reports-onboarding-DMi5ETfa.js} +1 -1
  238. package/dist/client/assets/{reports-tab-DSRN7hVk.js → reports-tab-tHGof2FW.js} +2 -2
  239. package/dist/client/assets/reports-x6uGEsmu.js +1 -0
  240. package/dist/client/assets/{repositories-BrLF1Aq0.js → repositories-BTQbxkj9.js} +1 -1
  241. package/dist/client/assets/repositories-W2INiIpb.js +1 -0
  242. package/dist/client/assets/{repository-binding-CekCSlJ1.js → repository-binding-C2KfYomQ.js} +1 -1
  243. package/dist/client/assets/{repository-picker-UWrxu6_V.js → repository-picker-BQc3OAcG.js} +1 -1
  244. package/dist/client/assets/{require-capability-C5tMOw5q.js → require-capability-BQcAZUwY.js} +1 -1
  245. package/dist/client/assets/{required-auth-layout-Cpnwi031.js → required-auth-layout-BszE36jh.js} +1 -1
  246. package/dist/client/assets/{reset-password-BYIakrjI.js → reset-password-BVb2l5We.js} +1 -1
  247. package/dist/client/assets/{resizable-Czy-co3c.js → resizable-B34lmUXk.js} +1 -1
  248. package/dist/client/assets/{resolve-tab-icon-C3kFsoiU.js → resolve-tab-icon-DGM8yJyS.js} +1 -1
  249. package/dist/client/assets/{review-settings-frbemaNj.js → review-settings-BacW9etz.js} +1 -1
  250. package/dist/client/assets/{role-color-BjM31aAV.js → role-color-DUV_b0hq.js} +1 -1
  251. package/dist/client/assets/{roles-BSFp9Lh1.js → roles-Ce95RFET.js} +1 -1
  252. package/dist/client/assets/{route-DCjkGlFk.js → route-ByQoYEQ1.js} +1 -1
  253. package/dist/client/assets/{route-BiurJAiU.js → route-CZrJA2Du.js} +1 -1
  254. package/dist/client/assets/route-DwOjJhPU.js +1 -0
  255. package/dist/client/assets/{sandbox-git-api-WjmMCJsj.js → sandbox-git-api-Bxa573Th.js} +1 -1
  256. package/dist/client/assets/{sandbox-lifecycle-context-Ba3XN5SW.js → sandbox-lifecycle-context-oW4CAFSP.js} +1 -1
  257. package/dist/client/assets/save-status-Cf9701GC.js +1 -0
  258. package/dist/client/assets/{schema-CZJq0dLP.js → schema-DqcJORUD.js} +1 -1
  259. package/dist/client/assets/{schema-CXcca4Yf.js → schema-gnANfn26.js} +1 -1
  260. package/dist/client/assets/{scroll-area-CFXsBb2M.js → scroll-area-mLdPDQZk.js} +1 -1
  261. package/dist/client/assets/{search-input-SNpnMeEh.js → search-input-DbkaTSNM.js} +1 -1
  262. package/dist/client/assets/{search-toggle-cAgGYPjr.js → search-toggle-yUKGBwRs.js} +1 -1
  263. package/dist/client/assets/{secret-picker-CoNx1OUZ.js → secret-picker-C8Xe_qFX.js} +1 -1
  264. package/dist/client/assets/{secrets-7PqmB5m-.js → secrets-7vsHBI_C.js} +1 -1
  265. package/dist/client/assets/{section-array-field-BPHe_2nS.js → section-array-field-ah4STHLi.js} +1 -1
  266. package/dist/client/assets/{sections-DIGnapH7.js → sections-DwAaRTqc.js} +1 -1
  267. package/dist/client/assets/{sections-editor-BPeB4JuU.js → sections-editor-Cw7rVBET.js} +1 -1
  268. package/dist/client/assets/{select-DKwtgT2c.js → select-C2TZ6w0T.js} +1 -1
  269. package/dist/client/assets/{select-model-bK-HmI0T.js → select-model-CfeDs1cS.js} +1 -1
  270. package/dist/client/assets/{seo-editor-B8a-ygHx.js → seo-editor-BtwYLJ0f.js} +1 -1
  271. package/dist/client/assets/{separator-BvEs4sKx.js → separator-D7JbMKRF.js} +1 -1
  272. package/dist/client/assets/settings-tab-Bt6v_h7A.js +1 -0
  273. package/dist/client/assets/{sheet-Cn6zqTHK.js → sheet-mGT77pmX.js} +1 -1
  274. package/dist/client/assets/{shell-layout-CMWsc7Ga.js → shell-layout-DElHwXzP.js} +1 -1
  275. package/dist/client/assets/{site-draft-actions-Dqjp6JXE.js → site-draft-actions-BWcvrVJJ.js} +5 -5
  276. package/dist/client/assets/{site-draft-view-DMbuCO3k.js → site-draft-view-BYRbX7hq.js} +1 -1
  277. package/dist/client/assets/site-editor-DtYKhDUe.js +1 -0
  278. package/dist/client/assets/{site-editor-toast-BTadFdcN.js → site-editor-toast-fJQVfqa6.js} +1 -1
  279. package/dist/client/assets/{skills-BO2UAT-k.js → skills-BVBJsFpt.js} +1 -1
  280. package/dist/client/assets/{slider-C8eFjzSI.js → slider-_L8nnrvM.js} +1 -1
  281. package/dist/client/assets/{sortable.esm-C-oiWjvx.js → sortable.esm-Dw4xFH50.js} +1 -1
  282. package/dist/client/assets/{sso-CajDON15.js → sso-jLEvOfRs.js} +1 -1
  283. package/dist/client/assets/{suggestion-SovccGL1.js → suggestion-CV5YiylC.js} +1 -1
  284. package/dist/client/assets/{super-agent-icon-BPwu34XK.js → super-agent-icon-tF39Whlb.js} +1 -1
  285. package/dist/client/assets/{switch-CaR5PIVi.js → switch-B0tv99B3.js} +1 -1
  286. package/dist/client/assets/{synced-repos-DVx1NnZs.js → synced-repos-BOeEsDnA.js} +1 -1
  287. package/dist/client/assets/{tab-icon-glyph-BWlOwicm.js → tab-icon-glyph-BgVegBho.js} +1 -1
  288. package/dist/client/assets/{table-GheKU3yj.js → table-CV4RoALe.js} +1 -1
  289. package/dist/client/assets/{tabs-1aecnZxz.js → tabs-DgvT8Pj5.js} +1 -1
  290. package/dist/client/assets/{task-board-DYqWLLmQ.js → task-board-DvkfyL0D.js} +1 -1
  291. package/dist/client/assets/{task-route-lZI9xEQu.js → task-route-DvThF15k.js} +1 -1
  292. package/dist/client/assets/{task-status-sKuwZfC5.js → task-status-B4zkOwKe.js} +1 -1
  293. package/dist/client/assets/{taskboard-analytics-CC44Sfeb.js → taskboard-analytics-wmnzdjd1.js} +1 -1
  294. package/dist/client/assets/{tasks-QuF-w60s.js → tasks-B0KKqEdX.js} +3 -3
  295. package/dist/client/assets/tasks-x5QR56dC.js +1 -0
  296. package/dist/client/assets/{textarea-BC5J6m5c.js → textarea-DM0e8Qi7.js} +1 -1
  297. package/dist/client/assets/{thread-analytics--cpXNe0v.js → thread-analytics-BhQM5Fjz.js} +1 -1
  298. package/dist/client/assets/{thread-intent-DWdkWFbM.js → thread-intent-CaGJ1BhS.js} +1 -1
  299. package/dist/client/assets/{thread-route-TkYSs_wZ.js → thread-route-B-GLI-gf.js} +1 -1
  300. package/dist/client/assets/{thread-route-zZ-NhxUn.js → thread-route-DgzeVZc_.js} +1 -1
  301. package/dist/client/assets/{thread-sheet-body-BYVjGhFL.js → thread-sheet-body-CtA9qKg3.js} +1 -1
  302. package/dist/client/assets/{time-range-picker-DMCZWDg9.js → time-range-picker-CngcAO-k.js} +1 -1
  303. package/dist/client/assets/{toggle-group-BGTfs-aX.js → toggle-group-Cu1mfNzX.js} +1 -1
  304. package/dist/client/assets/{tool-namespace-D1tEk-rn.js → tool-namespace-DBtCIV7f.js} +1 -1
  305. package/dist/client/assets/{tool-set-selector-E3d0uIwk.js → tool-set-selector-CKA5xrb6.js} +1 -1
  306. package/dist/client/assets/{toolbar-icon-button-utT3ySvv.js → toolbar-icon-button-VHIAKSnc.js} +1 -1
  307. package/dist/client/assets/{tooltip-TH6OTMa1.js → tooltip-CVxFMGcO.js} +1 -1
  308. package/dist/client/assets/{tooltipContext-DvIDN2Xh.js → tooltipContext-BptH8Zj7.js} +1 -1
  309. package/dist/client/assets/{track-BgU3Gaat.js → track-vSgJeDn7.js} +1 -1
  310. package/dist/client/assets/{types-CUaVQ6GM.js → types-Bz47I97G.js} +5 -5
  311. package/dist/client/assets/{url-slug-U3fC_LSu.js → url-slug-BR0vmMxN.js} +1 -1
  312. package/dist/client/assets/{usage-stats-BgRx8ojv.js → usage-stats-Dr1e2NVB.js} +1 -1
  313. package/dist/client/assets/{use-ai-providers-BQ4cXHYk.js → use-ai-providers-DTX4zdTq.js} +1 -1
  314. package/dist/client/assets/{use-apply-named-rule-BkzR-L_k.js → use-apply-named-rule-OLP0GHWV.js} +1 -1
  315. package/dist/client/assets/use-ask-in-chat-Dom4oae3.js +1 -0
  316. package/dist/client/assets/{use-automations-D73FKpK0.js → use-automations-8WbgZhli.js} +1 -1
  317. package/dist/client/assets/{use-autosave-DnSqypPy.js → use-autosave-rNMlQ4zg.js} +1 -1
  318. package/dist/client/assets/use-blocks-v8-project-Ol6SuT-M.js +1 -0
  319. package/dist/client/assets/{use-chat-layout-state-DhWMeYGY.js → use-chat-layout-state-DM5US5qS.js} +1 -1
  320. package/dist/client/assets/{use-cms-publish-actions-DYW-ZBMI.js → use-cms-publish-actions-B-aKIQS2.js} +1 -1
  321. package/dist/client/assets/{use-connect-companion-DSAJf4aL.js → use-connect-companion-BcVm5W-r.js} +1 -1
  322. package/dist/client/assets/{use-connection-Cm2NxfjB.js → use-connection-Lv1GX4XO.js} +1 -1
  323. package/dist/client/assets/{use-content-sync-BYfkK2UQ.js → use-content-sync-CSFDJJ2I.js} +1 -1
  324. package/dist/client/assets/{use-copy-D19rl06v.js → use-copy-B2pKd0TM.js} +1 -1
  325. package/dist/client/assets/{use-date-fns-locale-DRwJQrtP.js → use-date-fns-locale-D1sid-Du.js} +1 -1
  326. package/dist/client/assets/{use-debounced-autosave-ByXvCGtw.js → use-debounced-autosave-yF8PgiVs.js} +1 -1
  327. package/dist/client/assets/{use-debounced-value-CbRaNTJb.js → use-debounced-value-BAQPYGcf.js} +1 -1
  328. package/dist/client/assets/{use-deco-credits-BzZax3AU.js → use-deco-credits-DHv1UkQ9.js} +1 -1
  329. package/dist/client/assets/{use-decopilot-events-DjBmVlF5.js → use-decopilot-events-DGoOKMj0.js} +1 -1
  330. package/dist/client/assets/{use-delete-block-Bmw2DEn_.js → use-delete-block-y2vOypSK.js} +1 -1
  331. package/dist/client/assets/{use-delete-connection-XfH3saNO.js → use-delete-connection-TX_vnMiY.js} +1 -1
  332. package/dist/client/assets/{use-deployment-admin-E8whHqZV.js → use-deployment-admin-BTOwWmd_.js} +1 -1
  333. package/dist/client/assets/{use-entitlements-CrqU38x1.js → use-entitlements-DpylFAUx.js} +1 -1
  334. package/dist/client/assets/{use-fast-preview-draft-url-Br8m5G_K.js → use-fast-preview-draft-url-OHnSoOh2.js} +1 -1
  335. package/dist/client/assets/{use-file-configs-Cb7TGwCU.js → use-file-configs-CG-6B_hv.js} +1 -1
  336. package/dist/client/assets/{use-id-selection-BKmrVwI0.js → use-id-selection-DufR_IM-.js} +1 -1
  337. package/dist/client/assets/{use-inbox-feed-pHAZt3_K.js → use-inbox-feed-C9Mwe9dc.js} +1 -1
  338. package/dist/client/assets/{use-infinite-scroll-BkFOSUvv.js → use-infinite-scroll-uPmbLXy7.js} +1 -1
  339. package/dist/client/assets/{use-join-requests-CJn0V1s3.js → use-join-requests-C9270cag.js} +1 -1
  340. package/dist/client/assets/{use-main-panel-tabs-BmFZ-_OL.js → use-main-panel-tabs-DUVnwi3u.js} +1 -1
  341. package/dist/client/assets/{use-mcp-auth-status-4GKPMGKk.js → use-mcp-auth-status-DENAEdO_.js} +1 -1
  342. package/dist/client/assets/{use-mcp-client-d3hjTGOk.js → use-mcp-client-BZnIK-Y4.js} +2 -2
  343. package/dist/client/assets/{use-mcp-prompts-D9iX-pNG.js → use-mcp-prompts-Dtbvjt4h.js} +1 -1
  344. package/dist/client/assets/{use-mcp-tools-4sj0IJhc.js → use-mcp-tools-ubXBMl6b.js} +1 -1
  345. package/dist/client/assets/{use-mobile-BSwhKw5s.js → use-mobile-C5u1Qie9.js} +1 -1
  346. package/dist/client/assets/{use-move-blocks-DUZO8kls.js → use-move-blocks-FpNNMdYb.js} +1 -1
  347. package/dist/client/assets/{use-navigate-to-agent-ClknH49I.js → use-navigate-to-agent-DtRhmnlg.js} +1 -1
  348. package/dist/client/assets/use-never-published-CqQvHtX-.js +1 -0
  349. package/dist/client/assets/{use-org-fs-Tz3YgtJ1.js → use-org-fs-Cd0Vep23.js} +1 -1
  350. package/dist/client/assets/{use-org-repo-syncs-BzT6K1ie.js → use-org-repo-syncs-SJRy46mf.js} +1 -1
  351. package/dist/client/assets/{use-org-sso-DKQA9PvY.js → use-org-sso-COBiertF.js} +1 -1
  352. package/dist/client/assets/{use-organization-settings-O_jt8YRI.js → use-organization-settings-CRwm0586.js} +1 -1
  353. package/dist/client/assets/use-project-native-view-presence-BnSN9oER.js +1 -0
  354. package/dist/client/assets/{use-project-scope-CDU7oHZd.js → use-project-scope-lI2ukIh1.js} +1 -1
  355. package/dist/client/assets/{use-recent-apps-SulI7knF.js → use-recent-apps-CnCq1w_A.js} +1 -1
  356. package/dist/client/assets/{use-reports-diagnostic-DvKdZxC0.js → use-reports-diagnostic-DgRjbmEf.js} +1 -1
  357. package/dist/client/assets/{use-sandbox-events-f-PdmD_K.js → use-sandbox-events-BZs_wcMW.js} +2 -2
  358. package/dist/client/assets/{use-secrets-iJZc87R8.js → use-secrets-jhGB5cvg.js} +1 -1
  359. package/dist/client/assets/{use-section-preview-base-DlVsTPHR.js → use-section-preview-base-CxqwLEJO.js} +1 -1
  360. package/dist/client/assets/{use-sidebar-collapsed-BXzuI2Yh.js → use-sidebar-collapsed-BWtKakyD.js} +1 -1
  361. package/dist/client/assets/{use-tags-szK0WGVw.js → use-tags-CBIw_9wj.js} +1 -1
  362. package/dist/client/assets/{use-task-board-analytics-Dsx3ztNk.js → use-task-board-analytics-DVdYIVtB.js} +1 -1
  363. package/dist/client/assets/{use-task-board-events-bOYbxitP.js → use-task-board-events-n_cm8Gyp.js} +1 -1
  364. package/dist/client/assets/{use-task-board-item-prs-DXBDSC_j.js → use-task-board-item-prs-KjQVKJGy.js} +1 -1
  365. package/dist/client/assets/{use-task-board-items-2NnjAMJe.js → use-task-board-items-gM-MOBw8.js} +1 -1
  366. package/dist/client/assets/{use-task-board-prompts-BnnaRxj0.js → use-task-board-prompts-5OmBV-BO.js} +1 -1
  367. package/dist/client/assets/{use-task-metadata-GAS3u4HU.js → use-task-metadata-xW_FzRqh.js} +1 -1
  368. package/dist/client/assets/{use-thread-outputs-D6gtHOkS.js → use-thread-outputs-CN7E968n.js} +1 -1
  369. package/dist/client/assets/{use-view-draft-kind-vGVmYJM5.js → use-view-draft-kind-BsykP2yK.js} +1 -1
  370. package/dist/client/assets/{use-voice-input-B4K2dw_4.js → use-voice-input-seZQKt1s.js} +1 -1
  371. package/dist/client/assets/useInfiniteQuery-Bz8irSN1.js +1 -0
  372. package/dist/client/assets/{useQueries-CkzTLDl3.js → useQueries-BruvTC1j.js} +1 -1
  373. package/dist/client/assets/useSuspenseInfiniteQuery-DKXKbUjm.js +1 -0
  374. package/dist/client/assets/{users-BAENndTE.js → users-ByNwcAJI.js} +1 -1
  375. package/dist/client/assets/{utils-GS2Z_6Er.js → utils-BoDmGD4u.js} +1 -1
  376. package/dist/client/assets/{variant-calendar-DhSlXJST.js → variant-calendar-BsyPkd78.js} +1 -1
  377. package/dist/client/assets/{variant-matcher-override-DBCe5xDS.js → variant-matcher-override-CbZkMadE.js} +1 -1
  378. package/dist/client/assets/{view-header-BkLkYp5J.js → view-header-tBobsCC8.js} +1 -1
  379. package/dist/client/assets/{virtual-mcp-D-X8xp1B.js → virtual-mcp-BJ1dRL5Y.js} +1 -1
  380. package/dist/client/assets/{watch-sse-pool-BhRvBapO.js → watch-sse-pool-HKLsGoUY.js} +1 -1
  381. package/dist/client/index.html +2 -2
  382. package/dist/server/server.js +3 -3
  383. package/package.json +1 -1
  384. package/dist/client/assets/ReferenceLine-CdPtulni.js +0 -1
  385. package/dist/client/assets/agent-app-i42F64Tf.js +0 -1
  386. package/dist/client/assets/agent-assets-yhsnLz6V.js +0 -1
  387. package/dist/client/assets/agent-blog-BANd-DOA.js +0 -2
  388. package/dist/client/assets/agent-deck-CJ6F_9XA.js +0 -1
  389. package/dist/client/assets/agent-experiments-JXbeMR67.js +0 -1
  390. package/dist/client/assets/agent-library-CgajOXjC.js +0 -1
  391. package/dist/client/assets/agent-library-file-ROPjoIiT.js +0 -1
  392. package/dist/client/assets/agent-overview-CRECfM0R.js +0 -1
  393. package/dist/client/assets/agent-settings-CQz4H--G.js +0 -1
  394. package/dist/client/assets/agent-site-editor-code-BmJC3uHD.js +0 -2
  395. package/dist/client/assets/agent-site-editor-content-COiXn4LP.js +0 -1
  396. package/dist/client/assets/agent-site-editor-preview-DdkTHBKn.js +0 -1
  397. package/dist/client/assets/agent-view-DP-yHMET.js +0 -1
  398. package/dist/client/assets/api-keys-CA73zf8R.js +0 -1
  399. package/dist/client/assets/discover-DOTkM1SJ.js +0 -1
  400. package/dist/client/assets/held-block-view-9GD7sW5O.js +0 -3
  401. package/dist/client/assets/index-HLnjLjm4.js +0 -4
  402. package/dist/client/assets/item-actions-DxYkkZP8.js +0 -1
  403. package/dist/client/assets/library-D0Nyw5vF.js +0 -1
  404. package/dist/client/assets/match-site-slug-config-D3fUJ6vX.js +0 -1
  405. package/dist/client/assets/post-calendar-CgP7AZe7.js +0 -1
  406. package/dist/client/assets/post-editor-fRXyfFpy.js +0 -2
  407. package/dist/client/assets/project-app-view-Dn9IxbKG.js +0 -1
  408. package/dist/client/assets/project-reports-yBeAoZj_.js +0 -1
  409. package/dist/client/assets/project-tasks-Da304fiF.js +0 -1
  410. package/dist/client/assets/reports-D1vOcKYh.js +0 -1
  411. package/dist/client/assets/repositories-BeyQS9t-.js +0 -1
  412. package/dist/client/assets/route-Dghp6bLe.js +0 -1
  413. package/dist/client/assets/save-status-CaR8n7_Z.js +0 -1
  414. package/dist/client/assets/settings-tab-V10cXQt_.js +0 -1
  415. package/dist/client/assets/site-editor-BhMaxdEz.js +0 -1
  416. package/dist/client/assets/tasks-ChIHxZhb.js +0 -1
  417. package/dist/client/assets/use-ask-in-chat-D9_rhHLE.js +0 -1
  418. package/dist/client/assets/use-blocks-v8-project-DVyeNJpE.js +0 -1
  419. package/dist/client/assets/use-never-published-Ct02Nsux.js +0 -1
  420. package/dist/client/assets/use-project-native-view-presence-DFdZfmUA.js +0 -1
  421. package/dist/client/assets/useInfiniteQuery-DAPRIetj.js +0 -1
  422. package/dist/client/assets/useSuspenseInfiniteQuery-D1yN9E9_.js +0 -1
@@ -1,4 +0,0 @@
1
- import{gV as $e,gW as Ze,hs as xn,ht as ks,c as Y,b as X,r as H,j as t,B as Z,h as it,m as ye,_ as Ms,X as _s,Z as Vs,Y as Je,ap as Gt,an as qt,ao as Ht,t as ie,R as Xe,a4 as Ae,a5 as Ts,hu as gn,v as at,D as lt,y as Ft,L as $t,I as Se,F as vn,ah as bn,ag as jn,gf as Fe,as as Ds,ge as ke,gT as Oe,ak as ft,d as pt,i as Ps,K as At,hv as yn,hw as wn,hx as Sn,$ as Ct,e4 as ve,hy as je,n as Ke,P as Nn,u as Cn,bu as rt,q as Et,e as Os,fF as Qt,ab as kn,x as ht,aT as Is,w as xt,av as Mn,cF as _n,E as Me,dY as Vn,a as Tn,hz as zt,hA as Dn,b3 as Pn,af as On,aE as In,aD as Fn,bv as $n,a7 as An,hr as En,aN as zn,aM as Rn,aJ as Ln,aH as Un,aI as Bn,aL as Yn,aK as Wn,b5 as Kn,aS as Gn}from"./index-BqA84bKQ.js";import{g as qn}from"./extract-connection-data-Cfb1bv3l.js";import{b as Hn}from"./chat-context-ChgzPsES.js";import{U as Qn,b as Xn}from"./build-improve-prompt-doc-D2ZrR4ET.js";import{E as Jn}from"./empty-state-A6nZ3Khe.js";import{g as Zn}from"./shell-layout-CMWsc7Ga.js";import{g as gt,n as ei,a as Xt,e as ti,u as si,f as ni}from"./use-date-fns-locale-DRwJQrtP.js";import{a as ii}from"./mcp-oauth-CMXtLqpM.js";import{T as ut}from"./textarea-BC5J6m5c.js";import{c as _e,T as Ve,a as Te}from"./tooltip-TH6OTMa1.js";import{u as Rt,a as Fs,b as ai}from"./use-connection-Cm2NxfjB.js";import{u as $s,g as As,c as li,i as ri}from"./repository-binding-CekCSlJ1.js";import{i as Jt}from"./mcp-oauth-C8CUMukq.js";import{bu as oi,m as Es,bv as ci,bw as di,aZ as ui,am as mi,aq as fi,bx as pi,by as zs,bz as Rs,bA as hi,ar as xi,bB as gi,bC as kt,bD as Zt,A as es,L as vi,bE as bi,bF as ji,h as Ls,D as ts,k as yi,j as wi,ak as Si,n as Ni,v as Ci,u as ki,r as Mi,q as _i,g as Us,e as vt,aV as Vi,a7 as Ti,O as Di}from"./agent-icon-7pgGOyab.js";import{s as ze}from"./Plus-Dxw22W7_.js";import{t as dt,a as Pi,b as Oi}from"./Tool01-D4x0RZqM.js";import{s as bt}from"./Trash01-CGrA2ON1.js";import{u as ss}from"./use-debounced-autosave-ByXvCGtw.js";import{A as Ii}from"./add-connection-dialog-CsWthpZ9.js";import{i as Dt}from"./SearchMd-DuFQ9UgF.js";import{F as ns}from"./file-type-icon-CK3whZmM.js";import{k as Fi,l as $i,p as Ai,q as Ei}from"./use-org-fs-Tz3YgtJ1.js";import{C as zi}from"./collection-tabs-nxDU_6IX.js";import{T as Bs,u as Ys}from"./use-mcp-auth-status-4GKPMGKk.js";import{I as jt}from"./integration-icon-C9sCBDDr.js";import{C as Ri}from"./checkbox-CQfIpQ5a.js";import{u as yt}from"./use-mcp-client-d3hjTGOk.js";import{a as Ws}from"./use-mcp-tools-4sj0IJhc.js";import{u as Li}from"./use-mcp-prompts-D9iX-pNG.js";import{g as Ui}from"./connection-slug-CI3A8_ee.js";import{c as De,b as Re,a as Le,d as Ue,S as Be}from"./select-DKwtgT2c.js";import{s as Ks}from"./XClose-CBDYK_AJ.js";import{t as Pt}from"./utils-CVEq3hMx.js";import{S as et}from"./switch-CaR5PIVi.js";import{a as Gs,b as qs,P as Hs}from"./popover-fDNjdHxM.js";import{S as Bi}from"./scroll-area-CFXsBb2M.js";import{i as Yi}from"./Upload01-6kkhuzxl.js";import{a as Wi}from"./SwitchHorizontal01-C-rlzvYe.js";import{i as Ki}from"./Monitor01-BdFmkSiY.js";import{g as Gi}from"./types-CUaVQ6GM.js";import{a as Qs,c as qi}from"./agent-capabilities-BobB8G3S.js";import{b as Hi}from"./use-view-draft-kind-vGVmYJM5.js";import{u as Qi,p as Xi,g as Ot,o as is,r as It,h as Ji,a as Zi,j as as,t as ea,k as ta,l as sa,b as na}from"./use-project-native-view-presence-DFdZfmUA.js";import{a as Xs,u as ia,i as aa,o as la,r as ls,p as ra,w as oa,b as rs}from"./optimistic-project-sidebar-views-CvZPbOqN.js";import{a as ca,P as da,i as ua}from"./sections-DIGnapH7.js";import{i as Lt}from"./Key01-Cpl2DWV2.js";import{u as ma}from"./use-copy-D19rl06v.js";import{L as we}from"./label-Ducx0j9M.js";import{h as fa}from"./roles-DW32thi2.js";import{b as pa,u as ha}from"./use-blocks-v8-project-DVyeNJpE.js";import{s as Js,o as xa,C as Zs,r as ga}from"./thread-intent-DWdkWFbM.js";import{V as va,E as wt,R as os,r as en,C as ba,w as ja}from"./virtual-mcp-D-X8xp1B.js";import{b as ya,a as wa,D as Sa}from"./drawer-DyYc7c6p.js";import{u as Na}from"./use-mobile-BSwhKw5s.js";import{d as St}from"./delay-CnY5UFtP.js";import{b as Ca}from"./sandbox-url-D3mC8qhT.js";import{S as ka,a as Ma,b as _a}from"./secret-picker-CoNx1OUZ.js";import{u as Va,a as Ta}from"./use-secrets-iJZc87R8.js";import{o as cs}from"./omit-server-managed-metadata-L5IhjRZB.js";import{G as Da}from"./github-icon-D3u8oGuo.js";import{R as Pa}from"./repository-picker-UWrxu6_V.js";import{n as ds}from"./app-preview-url-9Od4s8Sz.js";import{a as Oa}from"./use-organization-settings-O_jt8YRI.js";import{r as Ia}from"./serial-task-queue-CGOeQgpr.js";function nt(a,e){const s=gt(),n=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??s.weekStartsOn??s.locale?.options?.weekStartsOn??0,i=$e(a,e?.in),l=i.getDay(),d=(l<n?7:0)+l-n;return i.setDate(i.getDate()-d),i.setHours(0,0,0,0),i}function mt(a,e){return nt(a,{...e,weekStartsOn:1})}function tn(a,e){const s=$e(a,e?.in),n=s.getFullYear(),i=Ze(s,0);i.setFullYear(n+1,0,4),i.setHours(0,0,0,0);const l=mt(i),d=Ze(s,0);d.setFullYear(n,0,4),d.setHours(0,0,0,0);const r=mt(d);return s.getTime()>=l.getTime()?n+1:s.getTime()>=r.getTime()?n:n-1}function us(a,e){const s=$e(a,e?.in);return s.setHours(0,0,0,0),s}function Fa(a,e,s){const[n,i]=ei(s?.in,a,e),l=us(n),d=us(i),r=+l-Xt(l),f=+d-Xt(d);return Math.round((r-f)/xn)}function $a(a,e){const s=tn(a,e),n=Ze(a,0);return n.setFullYear(s,0,4),n.setHours(0,0,0,0),mt(n)}function Aa(a){return a instanceof Date||typeof a=="object"&&Object.prototype.toString.call(a)==="[object Date]"}function Ea(a){return!(!Aa(a)&&typeof a!="number"||isNaN(+$e(a)))}function za(a,e){const s=$e(a,e?.in);return s.setFullYear(s.getFullYear(),0,1),s.setHours(0,0,0,0),s}function Ra(a,e){const s=$e(a,e?.in);return Fa(s,za(s))+1}function La(a,e){const s=$e(a,e?.in),n=+mt(s)-+$a(s);return Math.round(n/ks)+1}function sn(a,e){const s=$e(a,e?.in),n=s.getFullYear(),i=gt(),l=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,d=Ze(e?.in||a,0);d.setFullYear(n+1,0,l),d.setHours(0,0,0,0);const r=nt(d,e),f=Ze(e?.in||a,0);f.setFullYear(n,0,l),f.setHours(0,0,0,0);const o=nt(f,e);return+s>=+r?n+1:+s>=+o?n:n-1}function Ua(a,e){const s=gt(),n=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,i=sn(a,e),l=Ze(e?.in||a,0);return l.setFullYear(i,0,n),l.setHours(0,0,0,0),nt(l,e)}function Ba(a,e){const s=$e(a,e?.in),n=+nt(s,e)-+Ua(s,e);return Math.round(n/ks)+1}function ae(a,e){const s=a<0?"-":"",n=Math.abs(a).toString().padStart(e,"0");return s+n}const Ee={y(a,e){const s=a.getFullYear(),n=s>0?s:1-s;return ae(e==="yy"?n%100:n,e.length)},M(a,e){const s=a.getMonth();return e==="M"?String(s+1):ae(s+1,2)},d(a,e){return ae(a.getDate(),e.length)},a(a,e){const s=a.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return s.toUpperCase();case"aaa":return s;case"aaaaa":return s[0];default:return s==="am"?"a.m.":"p.m."}},h(a,e){return ae(a.getHours()%12||12,e.length)},H(a,e){return ae(a.getHours(),e.length)},m(a,e){return ae(a.getMinutes(),e.length)},s(a,e){return ae(a.getSeconds(),e.length)},S(a,e){const s=e.length,n=a.getMilliseconds(),i=Math.trunc(n*Math.pow(10,s-3));return ae(i,e.length)}},Qe={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},ms={G:function(a,e,s){const n=a.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return s.era(n,{width:"abbreviated"});case"GGGGG":return s.era(n,{width:"narrow"});default:return s.era(n,{width:"wide"})}},y:function(a,e,s){if(e==="yo"){const n=a.getFullYear(),i=n>0?n:1-n;return s.ordinalNumber(i,{unit:"year"})}return Ee.y(a,e)},Y:function(a,e,s,n){const i=sn(a,n),l=i>0?i:1-i;if(e==="YY"){const d=l%100;return ae(d,2)}return e==="Yo"?s.ordinalNumber(l,{unit:"year"}):ae(l,e.length)},R:function(a,e){const s=tn(a);return ae(s,e.length)},u:function(a,e){const s=a.getFullYear();return ae(s,e.length)},Q:function(a,e,s){const n=Math.ceil((a.getMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return ae(n,2);case"Qo":return s.ordinalNumber(n,{unit:"quarter"});case"QQQ":return s.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return s.quarter(n,{width:"narrow",context:"formatting"});default:return s.quarter(n,{width:"wide",context:"formatting"})}},q:function(a,e,s){const n=Math.ceil((a.getMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return ae(n,2);case"qo":return s.ordinalNumber(n,{unit:"quarter"});case"qqq":return s.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return s.quarter(n,{width:"narrow",context:"standalone"});default:return s.quarter(n,{width:"wide",context:"standalone"})}},M:function(a,e,s){const n=a.getMonth();switch(e){case"M":case"MM":return Ee.M(a,e);case"Mo":return s.ordinalNumber(n+1,{unit:"month"});case"MMM":return s.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return s.month(n,{width:"narrow",context:"formatting"});default:return s.month(n,{width:"wide",context:"formatting"})}},L:function(a,e,s){const n=a.getMonth();switch(e){case"L":return String(n+1);case"LL":return ae(n+1,2);case"Lo":return s.ordinalNumber(n+1,{unit:"month"});case"LLL":return s.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return s.month(n,{width:"narrow",context:"standalone"});default:return s.month(n,{width:"wide",context:"standalone"})}},w:function(a,e,s,n){const i=Ba(a,n);return e==="wo"?s.ordinalNumber(i,{unit:"week"}):ae(i,e.length)},I:function(a,e,s){const n=La(a);return e==="Io"?s.ordinalNumber(n,{unit:"week"}):ae(n,e.length)},d:function(a,e,s){return e==="do"?s.ordinalNumber(a.getDate(),{unit:"date"}):Ee.d(a,e)},D:function(a,e,s){const n=Ra(a);return e==="Do"?s.ordinalNumber(n,{unit:"dayOfYear"}):ae(n,e.length)},E:function(a,e,s){const n=a.getDay();switch(e){case"E":case"EE":case"EEE":return s.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return s.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(n,{width:"short",context:"formatting"});default:return s.day(n,{width:"wide",context:"formatting"})}},e:function(a,e,s,n){const i=a.getDay(),l=(i-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(l);case"ee":return ae(l,2);case"eo":return s.ordinalNumber(l,{unit:"day"});case"eee":return s.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return s.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(i,{width:"short",context:"formatting"});default:return s.day(i,{width:"wide",context:"formatting"})}},c:function(a,e,s,n){const i=a.getDay(),l=(i-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(l);case"cc":return ae(l,e.length);case"co":return s.ordinalNumber(l,{unit:"day"});case"ccc":return s.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return s.day(i,{width:"narrow",context:"standalone"});case"cccccc":return s.day(i,{width:"short",context:"standalone"});default:return s.day(i,{width:"wide",context:"standalone"})}},i:function(a,e,s){const n=a.getDay(),i=n===0?7:n;switch(e){case"i":return String(i);case"ii":return ae(i,e.length);case"io":return s.ordinalNumber(i,{unit:"day"});case"iii":return s.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return s.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return s.day(n,{width:"short",context:"formatting"});default:return s.day(n,{width:"wide",context:"formatting"})}},a:function(a,e,s){const i=a.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return s.dayPeriod(i,{width:"narrow",context:"formatting"});default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(a,e,s){const n=a.getHours();let i;switch(n===12?i=Qe.noon:n===0?i=Qe.midnight:i=n/12>=1?"pm":"am",e){case"b":case"bb":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return s.dayPeriod(i,{width:"narrow",context:"formatting"});default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(a,e,s){const n=a.getHours();let i;switch(n>=17?i=Qe.evening:n>=12?i=Qe.afternoon:n>=4?i=Qe.morning:i=Qe.night,e){case"B":case"BB":case"BBB":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return s.dayPeriod(i,{width:"narrow",context:"formatting"});default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(a,e,s){if(e==="ho"){let n=a.getHours()%12;return n===0&&(n=12),s.ordinalNumber(n,{unit:"hour"})}return Ee.h(a,e)},H:function(a,e,s){return e==="Ho"?s.ordinalNumber(a.getHours(),{unit:"hour"}):Ee.H(a,e)},K:function(a,e,s){const n=a.getHours()%12;return e==="Ko"?s.ordinalNumber(n,{unit:"hour"}):ae(n,e.length)},k:function(a,e,s){let n=a.getHours();return n===0&&(n=24),e==="ko"?s.ordinalNumber(n,{unit:"hour"}):ae(n,e.length)},m:function(a,e,s){return e==="mo"?s.ordinalNumber(a.getMinutes(),{unit:"minute"}):Ee.m(a,e)},s:function(a,e,s){return e==="so"?s.ordinalNumber(a.getSeconds(),{unit:"second"}):Ee.s(a,e)},S:function(a,e){return Ee.S(a,e)},X:function(a,e,s){const n=a.getTimezoneOffset();if(n===0)return"Z";switch(e){case"X":return ps(n);case"XXXX":case"XX":return We(n);default:return We(n,":")}},x:function(a,e,s){const n=a.getTimezoneOffset();switch(e){case"x":return ps(n);case"xxxx":case"xx":return We(n);default:return We(n,":")}},O:function(a,e,s){const n=a.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+fs(n,":");default:return"GMT"+We(n,":")}},z:function(a,e,s){const n=a.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+fs(n,":");default:return"GMT"+We(n,":")}},t:function(a,e,s){const n=Math.trunc(+a/1e3);return ae(n,e.length)},T:function(a,e,s){return ae(+a,e.length)}};function fs(a,e=""){const s=a>0?"-":"+",n=Math.abs(a),i=Math.trunc(n/60),l=n%60;return l===0?s+String(i):s+String(i)+e+ae(l,2)}function ps(a,e){return a%60===0?(a>0?"-":"+")+ae(Math.abs(a)/60,2):We(a,e)}function We(a,e=""){const s=a>0?"-":"+",n=Math.abs(a),i=ae(Math.trunc(n/60),2),l=ae(n%60,2);return s+i+e+l}const hs=(a,e)=>{switch(a){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},nn=(a,e)=>{switch(a){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},Ya=(a,e)=>{const s=a.match(/(P+)(p+)?/)||[],n=s[1],i=s[2];if(!i)return hs(a,e);let l;switch(n){case"P":l=e.dateTime({width:"short"});break;case"PP":l=e.dateTime({width:"medium"});break;case"PPP":l=e.dateTime({width:"long"});break;default:l=e.dateTime({width:"full"});break}return l.replace("{{date}}",hs(n,e)).replace("{{time}}",nn(i,e))},Wa={p:nn,P:Ya},Ka=/^D+$/,Ga=/^Y+$/,qa=["D","DD","YY","YYYY"];function Ha(a){return Ka.test(a)}function Qa(a){return Ga.test(a)}function Xa(a,e,s){const n=Ja(a,e,s);if(console.warn(n),qa.includes(a))throw new RangeError(n)}function Ja(a,e,s){const n=a[0]==="Y"?"years":"days of the month";return`Use \`${a.toLowerCase()}\` instead of \`${a}\` (in \`${e}\`) for formatting ${n} to the input \`${s}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Za=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,el=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,tl=/^'([^]*?)'?$/,sl=/''/g,nl=/[a-zA-Z]/;function il(a,e,s){const n=gt(),i=s?.locale??n.locale??ti,l=s?.firstWeekContainsDate??s?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,d=s?.weekStartsOn??s?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=$e(a,s?.in);if(!Ea(r))throw new RangeError("Invalid time value");let f=e.match(el).map(p=>{const m=p[0];if(m==="p"||m==="P"){const u=Wa[m];return u(p,i.formatLong)}return p}).join("").match(Za).map(p=>{if(p==="''")return{isToken:!1,value:"'"};const m=p[0];if(m==="'")return{isToken:!1,value:al(p)};if(ms[m])return{isToken:!0,value:p};if(m.match(nl))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return{isToken:!1,value:p}});i.localize.preprocessor&&(f=i.localize.preprocessor(r,f));const o={firstWeekContainsDate:l,weekStartsOn:d,locale:i};return f.map(p=>{if(!p.isToken)return p.value;const m=p.value;(!s?.useAdditionalWeekYearTokens&&Qa(m)||!s?.useAdditionalDayOfYearTokens&&Ha(m))&&Xa(m,e,String(a));const u=ms[m[0]];return u(r,m,i.localize,o)}).join("")}function al(a){const e=a.match(tl);return e?e[1].replace(sl,"'"):a}const an=25*1024*1024,Mt="home",_t="knowledge";function xs(a){return a==null?"":a<1024?`${a} B`:a<1024*1024?`${(a/1024).toFixed(0)} KB`:`${(a/(1024*1024)).toFixed(1)} MB`}function Ye(a){return a.split("/").pop()??a}function ll(a){const e=Y.c(64),{form:s}=a,n=X(),{upload:i}=Fi(Mt),l=$i(),d=H.useRef(null),[r,f]=H.useState(!1),[o,p]=H.useState(""),[m,u]=H.useState(!1);let h;e[0]!==r?(h={enabled:r},e[0]=r,e[1]=h):h=e[1];const{data:c}=Ai(60,h),x=c===void 0?[]:c;let g;e[2]!==r?(g={enabled:r},e[2]=r,e[3]=g):g=e[3];const{data:v}=Ei(g),j=v===void 0?[]:v;let y;e[4]!==s?(y=()=>s.getValues("metadata.knowledge")??[],e[4]=s,e[5]=y):y=e[5];const[b,w]=H.useState(y);let S;e[6]!==s?(S=I=>{w(I),s.setValue("metadata.knowledge",I,{shouldDirty:!0})},e[6]=s,e[7]=S):S=e[7];const C=S;let N;e[8]!==l||e[9]!==b||e[10]!==C||e[11]!==n||e[12]!==i?(N=async I=>{if(!I||I.length===0)return;const te=Array.from(I),Pe=te.filter(fl),he=te.filter(ml);if(he.length>0&&ie.warning(n("virtualMcp.filesSection.fileTooLargeTitle"),{description:n("virtualMcp.filesSection.fileTooLargeDescription",{names:he.map(ul).join(", ")})}),Pe.length!==0){try{await i.mutateAsync({dir:_t,files:Pe})}catch(D){const le=D;ie.error(le instanceof Error?le.message:n("virtualMcp.filesSection.failedUploadFile"));return}C([...b,...Pe.map(D=>({id:crypto.randomUUID(),name:D.name,volume:Mt,path:`${_t}/${D.name}`,url:l(Mt,`${_t}/${D.name}`),contentType:D.type||null,size:D.size,addedAt:new Date().toISOString()}))])}},e[8]=l,e[9]=b,e[10]=C,e[11]=n,e[12]=i,e[13]=N):N=e[13];const k=N;let V;e[14]!==l||e[15]!==b||e[16]!==C?(V=I=>{b.some(te=>te.volume===I.volume&&te.path===I.path)||(C([...b,{id:crypto.randomUUID(),name:Ye(I.path),volume:I.volume,path:I.path,url:l(I.volume,I.path),contentType:null,size:I.size??null,addedAt:new Date().toISOString()}]),f(!1))},e[14]=l,e[15]=b,e[16]=C,e[17]=V):V=e[17];const T=V;let _;e[18]!==l||e[19]!==b||e[20]!==C?(_=I=>{b.some(te=>te.volume===I.volume&&te.path===I.path)||(C([...b,{id:crypto.randomUUID(),name:Ye(I.path),kind:"skill",volume:I.volume,path:I.path,url:l(I.volume,I.path),contentType:null,size:null,addedAt:new Date().toISOString()}]),f(!1))},e[18]=l,e[19]=b,e[20]=C,e[21]=_):_=e[21];const $=_;let F;e[22]!==b||e[23]!==C?(F=I=>{C(b.filter(te=>te.id!==I))},e[22]=b,e[23]=C,e[24]=F):F=e[24];const A=F;let P;e[25]===Symbol.for("react.memo_cache_sentinel")?(P=I=>{f(I),I&&p("")},e[25]=P):P=e[25];const q=P;let Q;e[26]!==b?(Q=new Set(b.map(dl)),e[26]=b,e[27]=Q):Q=e[27];const R=Q,z=o.toLowerCase();let K;e[28]!==R?(K=I=>!R.has(`${I.volume}/${I.path}`),e[28]=R,e[29]=K):K=e[29];const E=x.filter(cl).filter(K).filter(I=>Ye(I.path).toLowerCase().includes(z)).slice(0,5);let B;e[30]!==R?(B=I=>!R.has(`${I.volume}/${I.path}`),e[30]=R,e[31]=B):B=e[31];const G=j.filter(B).filter(I=>Ye(I.path).toLowerCase().includes(z)).slice(0,5),J=I=>t.jsxs(Ms,{open:r,onOpenChange:q,children:[t.jsx(_s,{asChild:!0,children:I}),t.jsxs(Vs,{align:"end",className:"w-56",children:[t.jsxs(Je,{onSelect:()=>{d.current?.click()},children:[t.jsx(oi,{size:16}),n("virtualMcp.filesSection.uploadFile")]}),t.jsxs(Gt,{children:[t.jsxs(qt,{className:"gap-2 [&_svg:not([class*='text-'])]:text-muted-foreground",children:[t.jsx(Es,{size:16}),n("virtualMcp.filesSection.selectFileOrFolder")]}),t.jsxs(Ht,{className:"w-72 p-0",children:[t.jsxs("div",{className:"flex items-center gap-2 border-b px-3",children:[t.jsx(Dt,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("input",{value:o,onChange:te=>p(te.target.value),onKeyDown:ol,placeholder:n("virtualMcp.filesSection.searchFilesPlaceholder"),className:"h-10 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),t.jsx("div",{className:"max-h-64 overflow-y-auto p-1",children:E.length===0?t.jsx("p",{className:"px-2 py-3 text-center text-sm text-muted-foreground",children:n("virtualMcp.filesSection.noFilesFound")}):E.map(te=>t.jsxs(Je,{onSelect:()=>T(te),children:[t.jsx(ns,{filename:Ye(te.path),className:"h-5 w-4 shrink-0"}),t.jsx("span",{className:"flex-1 truncate",children:Ye(te.path)}),te.size!=null&&t.jsx("span",{className:"text-xs text-muted-foreground",children:xs(te.size)})]},`${te.volume}/${te.path}`))})]})]}),t.jsxs(Gt,{children:[t.jsxs(qt,{className:"gap-2 [&_svg:not([class*='text-'])]:text-muted-foreground",children:[t.jsx(dt,{size:16}),n("virtualMcp.filesSection.selectSkill")]}),t.jsxs(Ht,{className:"w-72 p-0",children:[t.jsxs("div",{className:"flex items-center gap-2 border-b px-3",children:[t.jsx(Dt,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("input",{value:o,onChange:te=>p(te.target.value),onKeyDown:rl,placeholder:n("virtualMcp.filesSection.searchSkillsPlaceholder"),className:"h-10 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),t.jsx("div",{className:"max-h-64 overflow-y-auto p-1",children:G.length===0?t.jsx("p",{className:"px-2 py-3 text-center text-sm text-muted-foreground",children:n("virtualMcp.filesSection.noSkillsFound")}):G.map(te=>t.jsxs(Je,{onSelect:()=>$(te),children:[t.jsx(dt,{size:16,className:"shrink-0"}),t.jsx("span",{className:"flex-1 truncate",children:Ye(te.path)})]},`${te.volume}/${te.path}`))})]})]})]})]}),ee="flex flex-col gap-3";let M;e[32]!==n?(M=n("virtualMcp.filesSection.filesAndSkills"),e[32]=n,e[33]=M):M=e[33];let O;e[34]!==M?(O=t.jsx("h2",{className:"text-sm font-medium text-foreground",children:M}),e[34]=M,e[35]=O):O=e[35];let L;e[36]!==n?(L=n("virtualMcp.filesSection.description"),e[36]=n,e[37]=L):L=e[37];let U;e[38]!==L?(U=t.jsx("p",{className:"text-sm text-muted-foreground",children:L}),e[38]=L,e[39]=U):U=e[39];let W;e[40]!==O||e[41]!==U?(W=t.jsxs("div",{className:"flex flex-col gap-1",children:[O,U]}),e[40]=O,e[41]=U,e[42]=W):W=e[42];const re=b.length>0&&J(t.jsxs(Z,{variant:"outline",size:"sm",disabled:i.isPending,children:[i.isPending?t.jsx(it,{size:"xs"}):t.jsx(ze,{size:14}),n("virtualMcp.filesSection.add")]}));let oe;e[43]!==W||e[44]!==re?(oe=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[W,re]}),e[43]=W,e[44]=re,e[45]=oe):oe=e[45];let me;e[46]!==k?(me=t.jsx("input",{ref:d,type:"file",multiple:!0,className:"hidden",onChange:I=>{k(I.target.files),I.target.value=""}}),e[46]=k,e[47]=me):me=e[47];let ne,ue;e[48]===Symbol.for("react.memo_cache_sentinel")?(ne=I=>{I.preventDefault(),u(!0)},ue=()=>u(!1),e[48]=ne,e[49]=ue):(ne=e[48],ue=e[49]);let fe;e[50]!==k?(fe=I=>{I.preventDefault(),I.stopPropagation(),u(!1),k(I.dataTransfer.files)},e[50]=k,e[51]=fe):fe=e[51];const pe=m&&"outline outline-2 outline-dashed outline-primary";let ce;e[52]!==pe?(ce=ye("flex flex-col gap-2 rounded-lg",pe),e[52]=pe,e[53]=ce):ce=e[53];const xe=b.length===0?J(t.jsxs("button",{type:"button",className:"flex items-center gap-3 px-3 py-2.5 rounded-lg border border-dashed border-border hover:bg-accent transition-colors w-full text-left cursor-pointer",children:[t.jsx("div",{className:"flex items-center justify-center size-8 rounded-md text-muted-foreground/75 border border-dashed border-border shrink-0",children:t.jsx(ze,{size:16})}),t.jsx("span",{className:"text-sm text-muted-foreground flex-1",children:n("virtualMcp.filesSection.noFilesOrSkillsYet")})]})):b.map(I=>t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 surface",children:[I.kind==="skill"?t.jsx("div",{className:"flex items-center justify-center h-8 w-6.5 shrink-0 rounded-md bg-muted text-muted-foreground",children:t.jsx(dt,{size:16})}):t.jsx(ns,{filename:I.name,className:"h-8 w-6.5 shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:I.name}),t.jsx("p",{className:"text-xs text-muted-foreground",children:I.kind==="skill"?n("virtualMcp.filesSection.kindSkill"):I.size!=null?xs(I.size):n("virtualMcp.filesSection.kindFile")})]}),t.jsx(Z,{variant:"ghost",size:"icon",onClick:()=>A(I.id),"aria-label":n("virtualMcp.filesSection.removeAriaLabel",{name:I.name}),children:t.jsx(bt,{size:16})})]},I.id));let be;e[54]!==ne||e[55]!==ue||e[56]!==fe||e[57]!==ce||e[58]!==xe?(be=t.jsx("div",{onDragOver:ne,onDragLeave:ue,onDrop:fe,className:ce,children:xe}),e[54]=ne,e[55]=ue,e[56]=fe,e[57]=ce,e[58]=xe,e[59]=be):be=e[59];let de;return e[60]!==oe||e[61]!==me||e[62]!==be?(de=t.jsxs("section",{className:ee,children:[oe,me,be]}),e[60]=oe,e[61]=me,e[62]=be,e[63]=de):de=e[63],de}function rl(a){return a.stopPropagation()}function ol(a){return a.stopPropagation()}function cl(a){return a.kind!=="dir"}function dl(a){return`${a.volume}/${a.path}`}function ul(a){return a.name}function ml(a){return a.size>an}function fl(a){return a.size<=an}function st(){const a=Y.c(1);let e;return a[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"flex items-center justify-center h-32",children:t.jsx(it,{className:"size-6 text-muted-foreground"})}),a[0]=e):e=a[0],e}function ct(a,e){return({error:s})=>s?.message?.includes("Method not found")||s?.code===-32601?t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:a})}):t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[t.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:t.jsx(Ts,{className:"h-6 w-6 text-destructive"})}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h3",{className:"text-lg font-medium",children:e("virtualMcp.dependencySelectionDialog.somethingWentWrong")}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto",children:s?.message?s.message.length>200?`${s.message.slice(0,200)}...`:s.message:e("virtualMcp.dependencySelectionDialog.unexpectedError")})]})]})}function ln(a){const e=Y.c(23),{item:s,isSelected:n,onToggle:i,disabled:l}=a,d=l?"cursor-not-allowed opacity-50":"cursor-pointer",r=n?"bg-accent/25":"hover:bg-accent";let f;e[0]!==d||e[1]!==r?(f=ye("flex items-start gap-3 p-4 rounded-lg transition-colors",d,r),e[0]=d,e[1]=r,e[2]=f):f=e[2];let o;e[3]!==s.name?(o=t.jsx("p",{className:"text-sm font-medium leading-none truncate",children:s.name}),e[3]=s.name,e[4]=o):o=e[4];let p;e[5]!==s.tags?(p=s.tags&&t.jsx("span",{className:"shrink-0",children:s.tags}),e[5]=s.tags,e[6]=p):p=e[6];let m;e[7]!==o||e[8]!==p?(m=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[o,p]}),e[7]=o,e[8]=p,e[9]=m):m=e[9];let u;e[10]!==s.description?(u=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:s.description}),e[10]=s.description,e[11]=u):u=e[11];let h;e[12]!==m||e[13]!==u?(h=t.jsxs("div",{className:"flex-1 min-w-0 space-y-2",children:[m,u]}),e[12]=m,e[13]=u,e[14]=h):h=e[14];let c;e[15]!==l||e[16]!==n||e[17]!==i?(c=t.jsx(Ri,{checked:n,onCheckedChange:i,disabled:l,className:"mt-0.5"}),e[15]=l,e[16]=n,e[17]=i,e[18]=c):c=e[18];let x;return e[19]!==f||e[20]!==h||e[21]!==c?(x=t.jsxs("label",{className:f,children:[h,c]}),e[19]=f,e[20]=h,e[21]=c,e[22]=x):x=e[22],x}function pl(a){const e=Y.c(35),{activeTab:s,onTabChange:n,showSelectAll:i,isAllSelected:l,handleSelectAll:d}=a,r=X();let f;e[0]!==r?(f=r("virtualMcp.dependencySelectionDialog.tabTools"),e[0]=r,e[1]=f):f=e[1];let o;e[2]!==f?(o={id:"tools",label:f},e[2]=f,e[3]=o):o=e[3];let p;e[4]!==r?(p=r("virtualMcp.dependencySelectionDialog.tabActive"),e[4]=r,e[5]=p):p=e[5];let m;e[6]!==p?(m={id:"active",label:p},e[6]=p,e[7]=m):m=e[7];let u;e[8]!==r?(u=r("virtualMcp.dependencySelectionDialog.tabResources"),e[8]=r,e[9]=u):u=e[9];let h;e[10]!==u?(h={id:"resources",label:u},e[10]=u,e[11]=h):h=e[11];let c;e[12]!==r?(c=r("virtualMcp.dependencySelectionDialog.tabPrompts"),e[12]=r,e[13]=c):c=e[13];let x;e[14]!==c?(x={id:"prompts",label:c},e[14]=c,e[15]=x):x=e[15];let g;e[16]!==o||e[17]!==m||e[18]!==h||e[19]!==x?(g=[o,m,h,x],e[16]=o,e[17]=m,e[18]=h,e[19]=x,e[20]=g):g=e[20];let v;e[21]!==n?(v=w=>n(w),e[21]=n,e[22]=v):v=e[22];let j;e[23]!==s||e[24]!==v||e[25]!==g?(j=t.jsx(zi,{tabs:g,activeTab:s,onTabChange:v}),e[23]=s,e[24]=v,e[25]=g,e[26]=j):j=e[26];let y;e[27]!==d||e[28]!==l||e[29]!==i||e[30]!==r?(y=i&&t.jsx("button",{type:"button",onClick:d,className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:r(l?"virtualMcp.dependencySelectionDialog.deselectAll":"virtualMcp.dependencySelectionDialog.selectAll")}),e[27]=d,e[28]=l,e[29]=i,e[30]=r,e[31]=y):y=e[31];let b;return e[32]!==j||e[33]!==y?(b=t.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-t border-border shrink-0",children:[j,y]}),e[32]=j,e[33]=y,e[34]=b):b=e[34],b}function Ut(a){const e=Y.c(13),{items:s,selections:n,onToggle:i,emptyMessage:l,disabled:d}=a;let r,f,o;if(e[0]!==d||e[1]!==l||e[2]!==s||e[3]!==i||e[4]!==n){o=Symbol.for("react.early_return_sentinel");e:{const m=s.map(hl);if(s.length===0){let u;e[8]!==l?(u=t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:l})}),e[8]=l,e[9]=u):u=e[9],o=u;break e}r="flex-1 overflow-auto px-4 py-3 space-y-1",f=s.map(u=>t.jsx(ln,{item:u,isSelected:n===null||n?.includes(u.id),onToggle:()=>i(u.id,m),disabled:d},u.id))}e[0]=d,e[1]=l,e[2]=s,e[3]=i,e[4]=n,e[5]=r,e[6]=f,e[7]=o}else r=e[5],f=e[6],o=e[7];if(o!==Symbol.for("react.early_return_sentinel"))return o;let p;return e[10]!==r||e[11]!==f?(p=t.jsx("div",{className:r,children:f}),e[10]=r,e[11]=f,e[12]=p):p=e[12],p}function hl(a){return a.id}function xl(a){const e=Y.c(22),{connectionId:s,toolSelections:n,onToggleTool:i}=a,l=X(),{org:d}=Ae();let r;e[0]!==s||e[1]!==d.id||e[2]!==d.slug?(r={connectionId:s,orgId:d.id,orgSlug:d.slug},e[0]=s,e[1]=d.id,e[2]=d.slug,e[3]=r):r=e[3];const f=yt(r);let o;e[4]!==f?(o={client:f},e[4]=f,e[5]=o):o=e[5];const{data:p}=Ws(o),m=p.tools;let u,h,c;if(e[6]!==p.tools||e[7]!==i||e[8]!==l||e[9]!==n){c=Symbol.for("react.early_return_sentinel");e:{const g=m.map(vl);let v;e[13]!==n?(v=b=>n===null||n.includes(b.name),e[13]=n,e[14]=v):v=e[14];const y=p.tools.filter(v).map(gl);if(y.length===0){let b;e[15]!==l?(b=l("virtualMcp.dependencySelectionDialog.noActiveToolsSelected"),e[15]=l,e[16]=b):b=e[16];let w;e[17]!==b?(w=t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:b})}),e[17]=b,e[18]=w):w=e[18],c=w;break e}u="flex-1 overflow-auto px-4 py-3 space-y-1",h=y.map(b=>t.jsx(ln,{item:b,isSelected:!0,onToggle:()=>i(b.id,g)},b.id))}e[6]=p.tools,e[7]=i,e[8]=l,e[9]=n,e[10]=u,e[11]=h,e[12]=c}else u=e[10],h=e[11],c=e[12];if(c!==Symbol.for("react.early_return_sentinel"))return c;let x;return e[19]!==u||e[20]!==h?(x=t.jsx("div",{className:u,children:h}),e[19]=u,e[20]=h,e[21]=x):x=e[21],x}function gl(a){return{id:a.name,name:a.name,description:a.description,tags:t.jsx(Bs,{annotations:a.annotations,_meta:a._meta})}}function vl(a){return a.name}function bl(a){const e=Y.c(16),{connectionId:s,selections:n,onToggle:i,disabled:l}=a,{org:d}=Ae();let r;e[0]!==s||e[1]!==d.id||e[2]!==d.slug?(r={connectionId:s,orgId:d.id,orgSlug:d.slug},e[0]=s,e[1]=d.id,e[2]=d.slug,e[3]=r):r=e[3];const f=yt(r);let o;e[4]!==f?(o={client:f},e[4]=f,e[5]=o):o=e[5];const{data:p}=Ws(o);let m;e[6]!==p.tools?(m=p.tools.map(jl),e[6]=p.tools,e[7]=m):m=e[7];const u=m,h=X();let c;e[8]!==h?(c=h("virtualMcp.dependencySelectionDialog.noToolsAvailable"),e[8]=h,e[9]=c):c=e[9];let x;return e[10]!==l||e[11]!==u||e[12]!==i||e[13]!==n||e[14]!==c?(x=t.jsx(Ut,{items:u,selections:n,onToggle:i,emptyMessage:c,disabled:l}),e[10]=l,e[11]=u,e[12]=i,e[13]=n,e[14]=c,e[15]=x):x=e[15],x}function jl(a){return{id:a.name,name:a.name,description:a.description,tags:t.jsx(Bs,{annotations:a.annotations,_meta:a._meta})}}function yl(a){const e=Y.c(16),{connectionId:s,selections:n,onToggle:i,disabled:l}=a,{org:d}=Ae();let r;e[0]!==s||e[1]!==d.id||e[2]!==d.slug?(r={connectionId:s,orgId:d.id,orgSlug:d.slug},e[0]=s,e[1]=d.id,e[2]=d.slug,e[3]=r):r=e[3];const f=yt(r);let o;e[4]!==f?(o={client:f},e[4]=f,e[5]=o):o=e[5];const{data:p}=gn(o);let m;e[6]!==p.resources?(m=p.resources.map(wl),e[6]=p.resources,e[7]=m):m=e[7];const u=m,h=X();let c;e[8]!==h?(c=h("virtualMcp.dependencySelectionDialog.noResourcesAvailable"),e[8]=h,e[9]=c):c=e[9];let x;return e[10]!==l||e[11]!==u||e[12]!==i||e[13]!==n||e[14]!==c?(x=t.jsx(Ut,{items:u,selections:n,onToggle:i,emptyMessage:c,disabled:l}),e[10]=l,e[11]=u,e[12]=i,e[13]=n,e[14]=c,e[15]=x):x=e[15],x}function wl(a){return{id:a.name||a.uri,name:a.name||a.uri,description:a.description}}function Sl(a){const e=Y.c(16),{connectionId:s,selections:n,onToggle:i,disabled:l}=a,{org:d}=Ae();let r;e[0]!==s||e[1]!==d.id||e[2]!==d.slug?(r={connectionId:s,orgId:d.id,orgSlug:d.slug},e[0]=s,e[1]=d.id,e[2]=d.slug,e[3]=r):r=e[3];const f=yt(r);let o;e[4]!==f?(o={client:f},e[4]=f,e[5]=o):o=e[5];const{data:p}=Li(o);let m;e[6]!==p.prompts?(m=p.prompts.map(Nl),e[6]=p.prompts,e[7]=m):m=e[7];const u=m,h=X();let c;e[8]!==h?(c=h("virtualMcp.dependencySelectionDialog.noPromptsAvailable"),e[8]=h,e[9]=c):c=e[9];let x;return e[10]!==l||e[11]!==u||e[12]!==i||e[13]!==n||e[14]!==c?(x=t.jsx(Ut,{items:u,selections:n,onToggle:i,emptyMessage:c,disabled:l}),e[10]=l,e[11]=u,e[12]=i,e[13]=n,e[14]=c,e[15]=x):x=e[15],x}function Nl(a){return{id:a.name,name:a.name,description:a.description}}function Cl(a){const e=Y.c(58),{currentConnection:s,activeTab:n,selectedId:i,formData:l,toggleTool:d,toggleResource:r,togglePrompt:f,toggleAllTools:o,toggleAllResources:p,toggleAllPrompts:m,onTabChange:u}=a,h=X(),c=l[i],x=n==="tools"?c?.tools===null:n==="resources"?c?.resources===null:n==="prompts"?c?.prompts===null:!1,g=n!=="active";let v;e[0]!==n||e[1]!==i||e[2]!==m||e[3]!==p||e[4]!==o?(v=()=>{n==="tools"?o(i):n==="resources"?p(i):n==="prompts"&&m(i)},e[0]=n,e[1]=i,e[2]=m,e[3]=p,e[4]=o,e[5]=v):v=e[5];const j=v;let y;e[6]!==s.icon||e[7]!==s.title?(y=t.jsx(jt,{icon:s.icon,name:s.title,size:"sm",className:"shrink-0"}),e[6]=s.icon,e[7]=s.title,e[8]=y):y=e[8];let b;e[9]!==s.title?(b=t.jsx("h2",{className:"text-base font-semibold truncate",children:s.title}),e[9]=s.title,e[10]=b):b=e[10];let w;e[11]!==s.description?(w=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s.description}),e[11]=s.description,e[12]=w):w=e[12];let S;e[13]!==b||e[14]!==w?(S=t.jsxs("div",{className:"flex-1 min-w-0",children:[b,w]}),e[13]=b,e[14]=w,e[15]=S):S=e[15];let C;e[16]!==y||e[17]!==S?(C=t.jsx("div",{className:"px-6 pt-5 pb-4 shrink-0",children:t.jsxs("div",{className:"flex items-center gap-3",children:[y,S]})}),e[16]=y,e[17]=S,e[18]=C):C=e[18];let N;e[19]!==n||e[20]!==j||e[21]!==x||e[22]!==u||e[23]!==g?(N=t.jsx(pl,{activeTab:n,onTabChange:u,showSelectAll:g,isAllSelected:x,handleSelectAll:j}),e[19]=n,e[20]=j,e[21]=x,e[22]=u,e[23]=g,e[24]=N):N=e[24];let k;e[25]!==n||e[26]!==l||e[27]!==i||e[28]!==h||e[29]!==d?(k=n==="active"&&t.jsx(Xe,{fallback:ct(h("virtualMcp.dependencySelectionDialog.toolsNotSupported"),h),children:t.jsx(H.Suspense,{fallback:t.jsx(st,{}),children:t.jsx(xl,{connectionId:i,toolSelections:l[i]?l[i].tools:[],onToggleTool:(A,P)=>d(i,A,P)})})}),e[25]=n,e[26]=l,e[27]=i,e[28]=h,e[29]=d,e[30]=k):k=e[30];let V;e[31]!==n||e[32]!==l||e[33]!==i||e[34]!==h||e[35]!==d?(V=n==="tools"&&t.jsx(Xe,{fallback:ct(h("virtualMcp.dependencySelectionDialog.toolsNotSupported"),h),children:t.jsx(H.Suspense,{fallback:t.jsx(st,{}),children:t.jsx(bl,{connectionId:i,selections:l[i]?l[i].tools:[],onToggle:(A,P)=>d(i,A,P)})})}),e[31]=n,e[32]=l,e[33]=i,e[34]=h,e[35]=d,e[36]=V):V=e[36];let T;e[37]!==n||e[38]!==l||e[39]!==i||e[40]!==h||e[41]!==r?(T=n==="resources"&&t.jsx(Xe,{fallback:ct(h("virtualMcp.dependencySelectionDialog.resourcesNotSupported"),h),children:t.jsx(H.Suspense,{fallback:t.jsx(st,{}),children:t.jsx(yl,{connectionId:i,selections:l[i]?l[i].resources:[],onToggle:(A,P)=>r(i,A,P)})})}),e[37]=n,e[38]=l,e[39]=i,e[40]=h,e[41]=r,e[42]=T):T=e[42];let _;e[43]!==n||e[44]!==l||e[45]!==i||e[46]!==h||e[47]!==f?(_=n==="prompts"&&t.jsx(Xe,{fallback:ct(h("virtualMcp.dependencySelectionDialog.promptsNotSupported"),h),children:t.jsx(H.Suspense,{fallback:t.jsx(st,{}),children:t.jsx(Sl,{connectionId:i,selections:l[i]?l[i].prompts:[],onToggle:(A,P)=>f(i,A,P)})})}),e[43]=n,e[44]=l,e[45]=i,e[46]=h,e[47]=f,e[48]=_):_=e[48];let $;e[49]!==T||e[50]!==_||e[51]!==k||e[52]!==V?($=t.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col",children:[k,V,T,_]}),e[49]=T,e[50]=_,e[51]=k,e[52]=V,e[53]=$):$=e[53];let F;return e[54]!==$||e[55]!==C||e[56]!==N?(F=t.jsxs(t.Fragment,{children:[C,N,$]}),e[54]=$,e[55]=C,e[56]=N,e[57]=F):F=e[57],F}function kl(a){const e=Y.c(7),{onClose:s}=a,n=X();let i;e[0]!==s?(i=()=>s(!1),e[0]=s,e[1]=i):i=e[1];let l;e[2]!==n?(l=n("virtualMcp.dependencySelectionDialog.done"),e[2]=n,e[3]=l):l=e[3];let d;return e[4]!==i||e[5]!==l?(d=t.jsx(Ft,{className:"px-6 py-4 border-t border-border shrink-0",children:t.jsx(Z,{variant:"outline",onClick:i,children:l})}),e[4]=i,e[5]=l,e[6]=d):d=e[6],d}function Ml(a){const e=Y.c(23),{connectionId:s,onAuthenticate:n,children:i}=a,l=X();let d;e[0]!==s?(d={connectionId:s},e[0]=s,e[1]=d):d=e[1];const r=Ys(d);if(r.supportsOAuth&&!r.isAuthenticated){let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex items-center justify-center size-12 rounded-full bg-muted",children:t.jsx(ci,{size:22,className:"text-muted-foreground"})}),e[2]=p):p=e[2];let m;e[3]!==l?(m=l("virtualMcp.dependencySelectionDialog.authorizationRequired"),e[3]=l,e[4]=m):m=e[4];let u;e[5]!==m?(u=t.jsx("p",{className:"text-sm font-medium",children:m}),e[5]=m,e[6]=u):u=e[6];let h;e[7]!==l?(h=l("virtualMcp.dependencySelectionDialog.authorizationDescription"),e[7]=l,e[8]=h):h=e[8];let c;e[9]!==h?(c=t.jsx("p",{className:"text-xs text-muted-foreground max-w-xs",children:h}),e[9]=h,e[10]=c):c=e[10];let x;e[11]!==u||e[12]!==c?(x=t.jsxs("div",{className:"space-y-1",children:[u,c]}),e[11]=u,e[12]=c,e[13]=x):x=e[13];let g;e[14]!==s||e[15]!==n||e[16]!==l?(g=n&&t.jsx(Z,{variant:"outline",size:"sm",onClick:()=>n(s),children:l("virtualMcp.dependencySelectionDialog.authorize")}),e[14]=s,e[15]=n,e[16]=l,e[17]=g):g=e[17];let v;return e[18]!==x||e[19]!==g?(v=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-4 p-8 text-center",children:[p,x,g]}),e[18]=x,e[19]=g,e[20]=v):v=e[20],v}let o;return e[21]!==i?(o=t.jsx(t.Fragment,{children:i}),e[21]=i,e[22]=o):o=e[22],o}function _l(a){const e={};for(const s of a)e[s.connection_id]={tools:s.selected_tools,resources:s.selected_resources??null,prompts:s.selected_prompts??null};return e}function gs(a){return Object.entries(a).map(([e,s])=>({connection_id:e,selected_tools:s.tools,selected_resources:s.resources,selected_prompts:s.prompts}))}function vs(a,e,s,n){const i=a[e]??{tools:null,resources:null,prompts:null};return{...a,[e]:{...i,[s]:n}}}function Vl(a,e){return e.type==="SET_ACTIVE_TAB"?{...a,activeTab:e.payload}:a}function Tl(a){const e=Y.c(49),{open:s,onOpenChange:n,selectedId:i,form:l,connections:d,onAuthenticate:r}=a;let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f={activeTab:"tools"},e[0]=f):f=e[0];const[o,p]=H.useReducer(Vl,f),m=Rt(i??"");let u;e[1]!==d?(u=d??[],e[1]=d,e[2]=u):u=e[2];let h;e[3]!==u?(h=_l(u),e[3]=u,e[4]=h):h=e[4];const c=h;let x;e[5]!==l||e[6]!==c?(x=(E,B,G,J)=>{const ee=c[E]?.[B];let M;ee===null?M=J.filter(O=>O!==G):ee?.includes(G)?M=ee.filter(O=>O!==G):(M=[...ee??[],G],M.length===J.length&&(M=null)),l.setValue("connections",gs(vs(c,E,B,M)),{shouldDirty:!0,shouldTouch:!0})},e[5]=l,e[6]=c,e[7]=x):x=e[7];const g=x;let v;e[8]!==l||e[9]!==c?(v=(E,B)=>{const J=c[E]?.[B]===null?[]:null;l.setValue("connections",gs(vs(c,E,B,J)),{shouldDirty:!0,shouldTouch:!0})},e[8]=l,e[9]=c,e[10]=v):v=e[10];const j=v;let y;e[11]!==g?(y=(E,B,G)=>g(E,"tools",B,G),e[11]=g,e[12]=y):y=e[12];const b=y;let w;e[13]!==g?(w=(E,B,G)=>g(E,"resources",B,G),e[13]=g,e[14]=w):w=e[14];const S=w;let C;e[15]!==g?(C=(E,B,G)=>g(E,"prompts",B,G),e[15]=g,e[16]=C):C=e[16];const N=C;let k;e[17]!==j?(k=E=>j(E,"tools"),e[17]=j,e[18]=k):k=e[18];const V=k;let T;e[19]!==j?(T=E=>j(E,"resources"),e[19]=j,e[20]=T):T=e[20];const _=T;let $;e[21]!==j?($=E=>j(E,"prompts"),e[21]=j,e[22]=$):$=e[22];const F=$;if(!i||!m)return null;let A;e[23]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(st,{}),e[23]=A):A=e[23];let P;e[24]===Symbol.for("react.memo_cache_sentinel")?(P=E=>p({type:"SET_ACTIVE_TAB",payload:E}),e[24]=P):P=e[24];let q;e[25]!==m||e[26]!==o.activeTab||e[27]!==c||e[28]!==i||e[29]!==F||e[30]!==_||e[31]!==V||e[32]!==N||e[33]!==S||e[34]!==b?(q=t.jsx(Cl,{currentConnection:m,activeTab:o.activeTab,selectedId:i,formData:c,toggleTool:b,toggleResource:S,togglePrompt:N,toggleAllTools:V,toggleAllResources:_,toggleAllPrompts:F,onTabChange:P},i),e[25]=m,e[26]=o.activeTab,e[27]=c,e[28]=i,e[29]=F,e[30]=_,e[31]=V,e[32]=N,e[33]=S,e[34]=b,e[35]=q):q=e[35];let Q;e[36]!==r||e[37]!==i||e[38]!==q?(Q=t.jsx(H.Suspense,{fallback:A,children:t.jsx(Ml,{connectionId:i,onAuthenticate:r,children:q})}),e[36]=r,e[37]=i,e[38]=q,e[39]=Q):Q=e[39];let R;e[40]!==n?(R=t.jsx(kl,{onClose:n}),e[40]=n,e[41]=R):R=e[41];let z;e[42]!==Q||e[43]!==R?(z=t.jsxs(at,{className:"sm:max-w-2xl h-[75vh] max-h-[75vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[Q,R]}),e[42]=Q,e[43]=R,e[44]=z):z=e[44];let K;return e[45]!==n||e[46]!==s||e[47]!==z?(K=t.jsx(lt,{open:s,onOpenChange:n,children:z}),e[45]=n,e[46]=s,e[47]=z,e[48]=K):K=e[48],K}const bs="__new_instance__";function Dl(a){const e=Y.c(25),{connection_id:s,usedConnectionIds:n,onOpenSettings:i,onRemove:l,onAuthenticate:d,onSwitchInstance:r,onNewInstance:f}=a,o=Rt(s),{org:p}=Ae();if(!o){let g;return e[0]!==l?(g=t.jsx(Fl,{onRemove:l}),e[0]=l,e[1]=g):g=e[1],g}let m;e[2]!==o?(m=Ui(o),e[2]=o,e[3]=m):m=e[3];const u=m;let h;e[4]!==s?(h=t.jsx(Il,{connection_id:s}),e[4]=s,e[5]=h):h=e[5];let c;e[6]!==o.app_name||e[7]!==o.connection_type||e[8]!==o.description||e[9]!==o.icon||e[10]!==o.status||e[11]!==o.title||e[12]!==s||e[13]!==d||e[14]!==f||e[15]!==i||e[16]!==l||e[17]!==r||e[18]!==p.slug||e[19]!==u||e[20]!==n?(c=t.jsx(Ol,{connection_id:s,connectionTitle:o.title,connectionDescription:o.description,connectionIcon:o.icon,connectionType:o.connection_type,connectionStatus:o.status,slug:u,orgSlug:p.slug,appName:o.app_name,usedConnectionIds:n,onOpenSettings:i,onRemove:l,onAuthenticate:d,onSwitchInstance:r,onNewInstance:f}),e[6]=o.app_name,e[7]=o.connection_type,e[8]=o.description,e[9]=o.icon,e[10]=o.status,e[11]=o.title,e[12]=s,e[13]=d,e[14]=f,e[15]=i,e[16]=l,e[17]=r,e[18]=p.slug,e[19]=u,e[20]=n,e[21]=c):c=e[21];let x;return e[22]!==h||e[23]!==c?(x=t.jsx(H.Suspense,{fallback:h,children:c}),e[22]=h,e[23]=c,e[24]=x):x=e[24],x}function Pl(a){const e=Y.c(24),{appName:s,connectionId:n,usedConnectionIds:i,onSwitchInstance:l,onNewInstance:d}=a,r=X();let f;e[0]!==s?(f={filters:[{column:"app_name",value:s}]},e[0]=s,e[1]=f):f=e[1];const o=ai(f);if(o.length<=1&&!d)return null;let p;e[2]!==n||e[3]!==d||e[4]!==l?(p=g=>{g===bs?d?.():l(n,g)},e[2]=n,e[3]=d,e[4]=l,e[5]=p):p=e[5];let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Re,{size:"xs",className:"w-auto gap-1 shadow-none",children:t.jsx(Le,{})}),e[6]=m):m=e[6];let u;if(e[7]!==n||e[8]!==o||e[9]!==i){let g;e[11]!==n||e[12]!==i?(g=v=>t.jsx(De,{value:v.id,className:"text-xs",disabled:v.id!==n&&i.has(v.id),children:v.title},v.id),e[11]=n,e[12]=i,e[13]=g):g=e[13],u=o.map(g),e[7]=n,e[8]=o,e[9]=i,e[10]=u}else u=e[10];let h;e[14]!==d||e[15]!==r?(h=d&&t.jsxs(De,{value:bs,className:"text-xs text-muted-foreground",children:["+ ",r("virtualMcp.connectionItem.newInstance")]}),e[14]=d,e[15]=r,e[16]=h):h=e[16];let c;e[17]!==u||e[18]!==h?(c=t.jsxs(Ue,{children:[u,h]}),e[17]=u,e[18]=h,e[19]=c):c=e[19];let x;return e[20]!==n||e[21]!==p||e[22]!==c?(x=t.jsxs(Be,{value:n,onValueChange:p,children:[m,c]}),e[20]=n,e[21]=p,e[22]=c,e[23]=x):x=e[23],x}function Ol({connection_id:a,connectionTitle:e,connectionDescription:s,connectionIcon:n,connectionType:i,connectionStatus:l,slug:d,orgSlug:r,appName:f,usedConnectionIds:o,onOpenSettings:p,onRemove:m,onAuthenticate:u,onSwitchInstance:h,onNewInstance:c}){const x=Ys({connectionId:a}),g=Fs(),j=!(i==="VIRTUAL")&&x.supportsOAuth&&!x.isAuthenticated,y=l!=="active",b=X(),w=async S=>{try{await g.update.mutateAsync({id:a,data:{status:S}}),ie.success(b(S==="active"?"virtualMcp.connectionItem.connectionEnabled":"virtualMcp.connectionItem.connectionDisabled"))}catch{ie.error(b("virtualMcp.connectionItem.failedToUpdateConnection"))}};return t.jsxs("div",{className:ye("surface overflow-hidden transition-colors",(j||y)&&"shadow-edge-destructive bg-destructive/5"),children:[t.jsxs($t,{to:"/$org/settings/connections/$appSlug",params:{org:r,appSlug:d},className:"flex items-center gap-3 px-4 py-3 cursor-pointer hover:bg-accent transition-colors",children:[t.jsx(jt,{icon:n,name:e,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:e}),j?t.jsx("span",{className:"text-xs text-destructive font-medium",children:b("virtualMcp.connectionItem.needsAuthorization")}):y?t.jsx("span",{className:"text-xs text-destructive font-medium",children:b(l==="error"?"virtualMcp.connectionItem.disabledError":"virtualMcp.connectionItem.disabled")}):s&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s})]}),j?t.jsx(Z,{variant:"outline",size:"sm",className:"shrink-0",onClick:S=>{S.preventDefault(),S.stopPropagation(),u(a)},children:b("virtualMcp.connectionItem.authorize")}):y?t.jsxs(Z,{variant:"outline",size:"sm",className:"gap-1.5 shrink-0",onClick:S=>{S.preventDefault(),S.stopPropagation(),w("active")},children:[t.jsx(di,{size:13}),b("virtualMcp.connectionItem.enable")]}):t.jsxs(_e,{delayDuration:0,children:[t.jsx(Ve,{asChild:!0,children:t.jsx("span",{className:"inline-flex items-center justify-center rounded-md h-7 w-7 hover:bg-accent text-muted-foreground shrink-0 transition-colors",children:t.jsx(Pi,{size:16})})}),t.jsx(Te,{side:"bottom",children:b("virtualMcp.connectionItem.connectionSettings")})]})]}),t.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 border-t border-border bg-muted/25",children:[f&&t.jsx(Pl,{appName:f,connectionId:a,usedConnectionIds:o,onSwitchInstance:h,onNewInstance:c}),t.jsxs("div",{className:"flex items-center gap-0.5 ml-auto",children:[t.jsxs(_e,{delayDuration:0,children:[t.jsx(Ve,{asChild:!0,children:t.jsx(Z,{variant:"ghost",size:"icon-sm",onClick:p,"aria-label":b("virtualMcp.connectionItem.configureResources"),children:t.jsx(ui,{size:13})})}),t.jsx(Te,{side:"bottom",children:b("virtualMcp.connectionItem.configureResources")})]}),!y&&t.jsxs(_e,{delayDuration:0,children:[t.jsx(Ve,{asChild:!0,children:t.jsx(Z,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground",onClick:()=>w("inactive"),"aria-label":b("virtualMcp.connectionItem.disableConnection"),children:t.jsx(mi,{size:13})})}),t.jsx(Te,{side:"bottom",children:b("virtualMcp.connectionItem.disable")})]}),t.jsxs(_e,{delayDuration:0,children:[t.jsx(Ve,{asChild:!0,children:t.jsx(Z,{variant:"ghost-destructive",size:"icon-sm",onClick:m,"aria-label":b("virtualMcp.connectionItem.removeConnection"),children:t.jsx(Ks,{size:13})})}),t.jsx(Te,{side:"bottom",children:b("virtualMcp.connectionItem.remove")})]})]})]})]})}function Il(a){const e=Y.c(17),{connection_id:s}=a,n=Rt(s);if(!n){let m;return e[0]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(rn,{}),e[0]=m):m=e[0],m}let i;e[1]!==n.icon||e[2]!==n.title?(i=t.jsx(jt,{icon:n.icon,name:n.title,size:"sm",className:"shrink-0"}),e[1]=n.icon,e[2]=n.title,e[3]=i):i=e[3];let l;e[4]!==n.title?(l=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[4]=n.title,e[5]=l):l=e[5];let d;e[6]!==n.description?(d=n.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n.description}),e[6]=n.description,e[7]=d):d=e[7];let r;e[8]!==l||e[9]!==d?(r=t.jsxs("div",{className:"flex-1 min-w-0",children:[l,d]}),e[8]=l,e[9]=d,e[10]=r):r=e[10];let f;e[11]!==i||e[12]!==r?(f=t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[i,r]}),e[11]=i,e[12]=r,e[13]=f):f=e[13];let o;e[14]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"flex items-center px-4 py-2 border-t border-border bg-muted/25",children:t.jsx("div",{className:"h-5 w-20 rounded bg-muted animate-pulse"})}),e[14]=o):o=e[14];let p;return e[15]!==f?(p=t.jsxs("div",{className:"surface overflow-hidden",children:[f,o]}),e[15]=f,e[16]=p):p=e[16],p}function Fl(a){const e=Y.c(20),{onRemove:s}=a,n=X();let i;e[0]!==n?(i=n("virtualMcp.connectionItem.connectionNotFound"),e[0]=n,e[1]=i):i=e[1];let l;e[2]!==i?(l=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm text-destructive font-medium truncate",children:i})}),e[2]=i,e[3]=l):l=e[3];let d;e[4]!==n?(d=n("virtualMcp.connectionItem.removeConnection"),e[4]=n,e[5]=d):d=e[5];let r;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Ks,{size:13}),e[6]=r):r=e[6];let f;e[7]!==s||e[8]!==d?(f=t.jsx(Ve,{asChild:!0,children:t.jsx(Z,{variant:"ghost-destructive",size:"icon-sm",className:"shrink-0",onClick:s,"aria-label":d,children:r})}),e[7]=s,e[8]=d,e[9]=f):f=e[9];let o;e[10]!==n?(o=n("virtualMcp.connectionItem.remove"),e[10]=n,e[11]=o):o=e[11];let p;e[12]!==o?(p=t.jsx(Te,{side:"bottom",children:o}),e[12]=o,e[13]=p):p=e[13];let m;e[14]!==f||e[15]!==p?(m=t.jsxs(_e,{delayDuration:0,children:[f,p]}),e[14]=f,e[15]=p,e[16]=m):m=e[16];let u;return e[17]!==l||e[18]!==m?(u=t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 rounded-xl border border-destructive/50 bg-destructive/5",children:[l,m]}),e[17]=l,e[18]=m,e[19]=u):u=e[19],u}function rn(){const a=Y.c(3);let e;a[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"size-8 rounded-md bg-muted animate-pulse shrink-0"}),a[0]=e):e=a[0];let s;a[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[e,t.jsxs("div",{className:"flex-1 space-y-1.5",children:[t.jsx("div",{className:"h-4 w-32 rounded bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-48 rounded bg-muted animate-pulse"})]})]}),a[1]=s):s=a[1];let n;return a[2]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsxs("div",{className:"surface overflow-hidden",children:[s,t.jsx("div",{className:"flex items-center px-4 py-2 border-t border-border bg-muted/25",children:t.jsx("div",{className:"h-5 w-20 rounded bg-muted animate-pulse"})})]}),a[2]=n):n=a[2],n}function on(a){const e=Y.c(85),{value:s,onChange:n,onColorChange:i,name:l,size:d,className:r,avatarClassName:f,showHoverOverlay:o,disabled:p}=a,m=d===void 0?"lg":d,u=o===void 0?!0:o,h=p===void 0?!1:p,c=X(),[x,g]=H.useState(!1),[v,j]=H.useState("icons"),[y,b]=H.useState(""),[w,S]=H.useState("blue");let C;e[0]!==s?(C=fi(s),e[0]=s,e[1]=C):C=e[1];const N=C,k=N.type==="icon"||N.type==="url"&&N.color?N.color:w;let V;e[2]!==n||e[3]!==k?(V=he=>{n(kt(he,k))},e[2]=n,e[3]=k,e[4]=V):V=e[4];const T=V;let _;e[5]!==n||e[6]!==i||e[7]!==N.name||e[8]!==N.type||e[9]!==N.url?(_=he=>{S(he),i?.(he),N.type==="icon"?n(kt(N.name,he)):N.type==="url"&&n(Zt(N.url,he))},e[5]=n,e[6]=i,e[7]=N.name,e[8]=N.type,e[9]=N.url,e[10]=_):_=e[10];const $=_;let F;e[11]!==n||e[12]!==k?(F=he=>{n(Zt(he,k)),g(!1)},e[11]=n,e[12]=k,e[13]=F):F=e[13];const A=F;let P;e[14]!==n||e[15]!==k?(P=()=>{const he=zs(),D=he[Math.floor(Math.random()*he.length)];n(kt(D,k))},e[14]=n,e[15]=k,e[16]=P):P=e[16];const q=P,Q=h?!1:x;let R;e[17]!==c?(R=c("common.iconPicker.changeIcon"),e[17]=c,e[18]=R):R=e[18];const z=h?"cursor-default opacity-50":"cursor-pointer";let K;e[19]!==r||e[20]!==m||e[21]!==z?(K=ye("relative group overflow-hidden",z,pi(m),r),e[19]=r,e[20]=m,e[21]=z,e[22]=K):K=e[22];let E;e[23]!==f||e[24]!==l||e[25]!==m||e[26]!==s?(E=t.jsx(es,{icon:s,name:l,size:m,className:f}),e[23]=f,e[24]=l,e[25]=m,e[26]=s,e[27]=E):E=e[27];let B;e[28]!==h||e[29]!==u?(B=u&&!h&&t.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity",children:t.jsx(vi,{size:16,className:"text-white"})}),e[28]=h,e[29]=u,e[30]=B):B=e[30];let G;e[31]!==h||e[32]!==R||e[33]!==K||e[34]!==E||e[35]!==B?(G=t.jsx(Gs,{asChild:!0,children:t.jsxs("button",{type:"button","data-testid":"icon-picker-trigger","aria-label":R,disabled:h,className:K,children:[E,B]})}),e[31]=h,e[32]=R,e[33]=K,e[34]=E,e[35]=B,e[36]=G):G=e[36];let J;e[37]!==l||e[38]!==s?(J=t.jsx("div",{className:"flex items-center justify-center py-4",children:t.jsx(es,{icon:s,name:l,size:"xl"})}),e[37]=l,e[38]=s,e[39]=J):J=e[39];let ee;e[40]!==v?(ee=he=>{if(he.key!=="ArrowLeft"&&he.key!=="ArrowRight")return;he.preventDefault();const D=v==="icons"?"upload":"icons";j(D),document.getElementById(`icon-picker-tab-${D}`)?.focus()},e[40]=v,e[41]=ee):ee=e[41];const M=v==="icons",O=v==="icons"?0:-1;let L;e[42]===Symbol.for("react.memo_cache_sentinel")?(L=()=>j("icons"),e[42]=L):L=e[42];const U=v==="icons"?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground";let W;e[43]!==U?(W=ye("px-3 py-2 text-sm font-medium border-b-2 -mb-px transition-colors",U),e[43]=U,e[44]=W):W=e[44];let re;e[45]!==c?(re=c("common.iconPicker.iconsTab"),e[45]=c,e[46]=re):re=e[46];let oe;e[47]!==M||e[48]!==O||e[49]!==W||e[50]!==re?(oe=t.jsx("button",{id:"icon-picker-tab-icons",type:"button",role:"tab","aria-selected":M,"aria-controls":"icon-picker-panel-icons",tabIndex:O,onClick:L,className:W,children:re}),e[47]=M,e[48]=O,e[49]=W,e[50]=re,e[51]=oe):oe=e[51];const me=v==="upload",ne=v==="upload"?0:-1;let ue;e[52]===Symbol.for("react.memo_cache_sentinel")?(ue=()=>j("upload"),e[52]=ue):ue=e[52];const fe=v==="upload"?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground";let pe;e[53]!==fe?(pe=ye("px-3 py-2 text-sm font-medium border-b-2 -mb-px transition-colors",fe),e[53]=fe,e[54]=pe):pe=e[54];let ce;e[55]!==c?(ce=c("common.iconPicker.uploadTab"),e[55]=c,e[56]=ce):ce=e[56];let xe;e[57]!==me||e[58]!==ne||e[59]!==pe||e[60]!==ce?(xe=t.jsx("button",{id:"icon-picker-tab-upload",type:"button",role:"tab","aria-selected":me,"aria-controls":"icon-picker-panel-upload",tabIndex:ne,onClick:ue,className:pe,children:ce}),e[57]=me,e[58]=ne,e[59]=pe,e[60]=ce,e[61]=xe):xe=e[61];let be;e[62]===Symbol.for("react.memo_cache_sentinel")?(be=t.jsx("div",{className:"flex-1"}),e[62]=be):be=e[62];let de;e[63]!==ee||e[64]!==oe||e[65]!==xe?(de=t.jsxs("div",{role:"tablist","aria-label":"Icon source",className:"flex items-center border-b border-border px-3",onKeyDown:ee,children:[oe,xe,be]}),e[63]=ee,e[64]=oe,e[65]=xe,e[66]=de):de=e[66];let I;e[67]!==$||e[68]!==q||e[69]!==T||e[70]!==A||e[71]!==N.name||e[72]!==N.type||e[73]!==y||e[74]!==k||e[75]!==v?(I=v==="icons"?t.jsx("div",{id:"icon-picker-panel-icons",role:"tabpanel","aria-labelledby":"icon-picker-tab-icons",children:t.jsx(zl,{search:y,onSearchChange:b,selectedColor:k,onColorChange:$,onSelectIcon:T,onRandom:q,currentIconName:N.type==="icon"?N.name:null})}):t.jsx("div",{id:"icon-picker-panel-upload",role:"tabpanel","aria-labelledby":"icon-picker-tab-upload",children:t.jsx(Rl,{onUpload:A})}),e[67]=$,e[68]=q,e[69]=T,e[70]=A,e[71]=N.name,e[72]=N.type,e[73]=y,e[74]=k,e[75]=v,e[76]=I):I=e[76];let te;e[77]!==J||e[78]!==de||e[79]!==I?(te=t.jsx(qs,{align:"start",className:"w-80 p-0",onOpenAutoFocus:$l,children:t.jsxs("div",{className:"flex flex-col",children:[J,de,I]})}),e[77]=J,e[78]=de,e[79]=I,e[80]=te):te=e[80];let Pe;return e[81]!==G||e[82]!==te||e[83]!==Q?(Pe=t.jsxs(Hs,{open:Q,onOpenChange:g,children:[G,te]}),e[81]=G,e[82]=te,e[83]=Q,e[84]=Pe):Pe=e[84],Pe}function $l(a){return a.preventDefault()}function Al(a){const e=Y.c(33),{selectedColor:s,onColorChange:n}=a,i=X(),[l,d]=H.useState(!1);let r,f,o,p,m,u,h;if(e[0]!==l||e[1]!==s){const w=Rs(s);f=Hs,u=l,h=d,r=Gs,m=!0,o="button",p=ye("h-6 w-6 rounded-full shrink-0 ring-2 ring-offset-2 ring-offset-background transition-all cursor-pointer hover:scale-110",w.dot,"ring-foreground/20"),e[0]=l,e[1]=s,e[2]=r,e[3]=f,e[4]=o,e[5]=p,e[6]=m,e[7]=u,e[8]=h}else r=e[2],f=e[3],o=e[4],p=e[5],m=e[6],u=e[7],h=e[8];let c;e[9]!==i?(c=i("common.iconPicker.changeColor"),e[9]=i,e[10]=c):c=e[10];let x;e[11]!==i?(x=i("common.iconPicker.changeColor"),e[11]=i,e[12]=x):x=e[12];let g;e[13]!==o||e[14]!==p||e[15]!==c||e[16]!==x?(g=t.jsx("button",{type:o,className:p,title:c,"aria-label":x}),e[13]=o,e[14]=p,e[15]=c,e[16]=x,e[17]=g):g=e[17];let v;e[18]!==r||e[19]!==m||e[20]!==g?(v=t.jsx(r,{asChild:m,children:g}),e[18]=r,e[19]=m,e[20]=g,e[21]=v):v=e[21];let j;e[22]!==n||e[23]!==s?(j=ji.map(w=>t.jsx("button",{type:"button",onClick:()=>{n(w.name),d(!1)},className:ye("h-5 w-5 rounded-full transition-all shrink-0 cursor-pointer",w.dot,s===w.name?"ring-2 ring-offset-1 ring-offset-background ring-foreground/30 scale-110":"hover:scale-110"),title:w.name,"aria-label":w.name},w.name)),e[22]=n,e[23]=s,e[24]=j):j=e[24];let y;e[25]!==j?(y=t.jsx(qs,{align:"start",side:"right",sideOffset:8,className:"w-auto p-2",onOpenAutoFocus:El,children:t.jsx("div",{className:"grid grid-cols-4 gap-1",children:j})}),e[25]=j,e[26]=y):y=e[26];let b;return e[27]!==f||e[28]!==y||e[29]!==u||e[30]!==h||e[31]!==v?(b=t.jsxs(f,{open:u,onOpenChange:h,children:[v,y]}),e[27]=f,e[28]=y,e[29]=u,e[30]=h,e[31]=v,e[32]=b):b=e[32],b}function El(a){return a.preventDefault()}function zl(a){const e=Y.c(55),{search:s,onSearchChange:n,selectedColor:i,onColorChange:l,onSelectIcon:d,onRandom:r,currentIconName:f}=a,o=X();let p,m,u,h,c,x,g;if(e[0]!==f||e[1]!==l||e[2]!==r||e[3]!==n||e[4]!==d||e[5]!==s||e[6]!==i||e[7]!==o){const w=zs(),S=Rs(i);m=hi(w,s),x="flex flex-col";let C;e[15]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(Dt,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none"}),e[15]=C):C=e[15];let N;e[16]!==n?(N=P=>n(P.target.value),e[16]=n,e[17]=N):N=e[17];let k;e[18]!==o?(k=o("common.iconPicker.filterPlaceholder"),e[18]=o,e[19]=k):k=e[19];let V;e[20]!==s||e[21]!==N||e[22]!==k?(V=t.jsxs("div",{className:"relative flex-1",children:[C,t.jsx(Se,{value:s,onChange:N,placeholder:k,size:"sm",className:"text-xs pl-7"})]}),e[20]=s,e[21]=N,e[22]=k,e[23]=V):V=e[23];let T;e[24]!==o?(T=o("common.iconPicker.randomIcon"),e[24]=o,e[25]=T):T=e[25];let _;e[26]!==o?(_=o("common.iconPicker.randomIcon"),e[26]=o,e[27]=_):_=e[27];let $;e[28]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(bi,{className:"size-3.5 text-muted-foreground"}),e[28]=$):$=e[28];let F;e[29]!==r||e[30]!==T||e[31]!==_?(F=t.jsx(Z,{type:"button",variant:"outline",size:"icon",onClick:r,className:"shrink-0",title:T,"aria-label":_,children:$}),e[29]=r,e[30]=T,e[31]=_,e[32]=F):F=e[32];let A;e[33]!==l||e[34]!==i?(A=t.jsx(Al,{selectedColor:i,onColorChange:l}),e[33]=l,e[34]=i,e[35]=A):A=e[35],e[36]!==F||e[37]!==A||e[38]!==V?(g=t.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[V,F,A]}),e[36]=F,e[37]=A,e[38]=V,e[39]=g):g=e[39],p=Bi,c="h-56",u="grid grid-cols-9 gap-0.5 px-2 pb-2",h=m.map(P=>{const q=xi(P);return q?t.jsx("button",{type:"button",onClick:()=>d(P),className:ye("h-8 w-8 flex items-center justify-center rounded-lg transition-colors cursor-pointer",f===P?ye(S.bg,S.text):ye(S.text,"hover:bg-accent")),title:P,"aria-label":gi(P),children:t.jsx(q,{size:18})},P):null}),e[0]=f,e[1]=l,e[2]=r,e[3]=n,e[4]=d,e[5]=s,e[6]=i,e[7]=o,e[8]=p,e[9]=m,e[10]=u,e[11]=h,e[12]=c,e[13]=x,e[14]=g}else p=e[8],m=e[9],u=e[10],h=e[11],c=e[12],x=e[13],g=e[14];let v;e[40]!==u||e[41]!==h?(v=t.jsx("div",{className:u,children:h}),e[40]=u,e[41]=h,e[42]=v):v=e[42];let j;e[43]!==m.length||e[44]!==o?(j=m.length===0&&t.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:o("common.iconPicker.noIconsFound")}),e[43]=m.length,e[44]=o,e[45]=j):j=e[45];let y;e[46]!==p||e[47]!==c||e[48]!==v||e[49]!==j?(y=t.jsxs(p,{className:c,children:[v,j]}),e[46]=p,e[47]=c,e[48]=v,e[49]=j,e[50]=y):y=e[50];let b;return e[51]!==x||e[52]!==g||e[53]!==y?(b=t.jsxs("div",{className:x,children:[g,y]}),e[51]=x,e[52]=g,e[53]=y,e[54]=b):b=e[54],b}function Rl(a){const e=Y.c(46),{onUpload:s}=a,n=X(),i=H.useRef(null);let l;e[0]!==s||e[1]!==n?(l=F=>{const A=F.target.files?.[0];if(!A)return;if(A.size>2097152){ie.error(n("common.iconPicker.imageTooLarge")),F.target.value="";return}const P=new FileReader;P.onerror=()=>{ie.error(n("common.iconPicker.failedToReadImage")),i.current&&(i.current.value="")},P.onloadend=()=>{P.readyState===FileReader.DONE&&P.result&&s(P.result),i.current&&(i.current.value="")},P.readAsDataURL(A)},e[0]=s,e[1]=n,e[2]=l):l=e[2];const d=l,[r,f]=H.useState("");let o;e[3]!==s||e[4]!==r?(o=()=>{const F=r.trim();F&&(s(F),f(""))},e[3]=s,e[4]=r,e[5]=o):o=e[5];const p=o;let m;e[6]!==d?(m=t.jsx("input",{type:"file",ref:i,className:"hidden",accept:"image/*",onChange:d}),e[6]=d,e[7]=m):m=e[7];let u;e[8]===Symbol.for("react.memo_cache_sentinel")?(u=()=>i.current?.click(),e[8]=u):u=e[8];let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(Yi,{size:20}),e[9]=h):h=e[9];let c;e[10]!==n?(c=n("common.iconPicker.uploadHint"),e[10]=n,e[11]=c):c=e[11];let x;e[12]!==c?(x=t.jsxs("button",{type:"button",onClick:u,className:"h-24 rounded-lg border-2 border-dashed border-border hover:border-foreground/50 hover:bg-accent transition-colors flex flex-col items-center justify-center gap-2 text-muted-foreground hover:text-foreground",children:[h,t.jsx("span",{className:"text-xs",children:c})]}),e[12]=c,e[13]=x):x=e[13];let g;e[14]!==n?(g=n("common.iconPicker.or"),e[14]=n,e[15]=g):g=e[15];let v;e[16]!==g?(v=t.jsx("span",{className:"text-xs text-muted-foreground",children:g}),e[16]=g,e[17]=v):v=e[17];let j;e[18]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{className:"flex-1 h-px bg-border"}),e[18]=j):j=e[18];let y;e[19]!==v?(y=t.jsxs("div",{className:"flex items-center gap-2",children:[v,j]}),e[19]=v,e[20]=y):y=e[20];let b;e[21]===Symbol.for("react.memo_cache_sentinel")?(b=F=>f(F.target.value),e[21]=b):b=e[21];let w;e[22]!==n?(w=n("common.iconPicker.pasteUrlPlaceholder"),e[22]=n,e[23]=w):w=e[23];let S;e[24]!==p?(S=F=>{F.key==="Enter"&&(F.preventDefault(),p())},e[24]=p,e[25]=S):S=e[25];let C;e[26]!==r||e[27]!==w||e[28]!==S?(C=t.jsx(Se,{value:r,onChange:b,placeholder:w,className:"h-8 text-xs flex-1",onKeyDown:S}),e[26]=r,e[27]=w,e[28]=S,e[29]=C):C=e[29];let N;e[30]!==r?(N=r.trim(),e[30]=r,e[31]=N):N=e[31];const k=!N;let V;e[32]!==n?(V=n("common.iconPicker.apply"),e[32]=n,e[33]=V):V=e[33];let T;e[34]!==p||e[35]!==k||e[36]!==V?(T=t.jsx(Z,{variant:"outline",className:"shrink-0",onClick:p,disabled:k,children:V}),e[34]=p,e[35]=k,e[36]=V,e[37]=T):T=e[37];let _;e[38]!==C||e[39]!==T?(_=t.jsxs("div",{className:"flex items-center gap-1.5",children:[C,T]}),e[38]=C,e[39]=T,e[40]=_):_=e[40];let $;return e[41]!==y||e[42]!==_||e[43]!==m||e[44]!==x?($=t.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[m,x,y,_]}),e[41]=y,e[42]=_,e[43]=m,e[44]=x,e[45]=$):$=e[45],$}function Ll(a){const e=Y.c(14),{viewId:s}=a;if(s==="overview"){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Ls,{size:16}),e[0]=i):i=e[0],i}if(s==="context"){let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Es,{size:16}),e[1]=i):i=e[1],i}if(s==="monitor"){let i;return e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(yi,{size:16}),e[2]=i):i=e[2],i}if(s==="plan"){let i;return e[3]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(wi,{size:16}),e[3]=i):i=e[3],i}if(s==="reports"){let i;return e[4]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Si,{size:16}),e[4]=i):i=e[4],i}if(s==="board"){let i;return e[5]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Ni,{size:16}),e[5]=i):i=e[5],i}if(s==="site-editor"){let i;return e[6]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Ki,{size:16}),e[6]=i):i=e[6],i}if(s==="assets"){let i;return e[7]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Oi,{size:16}),e[7]=i):i=e[7],i}if(s==="releases"){let i;return e[8]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Ci,{size:16}),e[8]=i):i=e[8],i}if(s==="hosting"){let i;return e[9]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(bn,{size:16}),e[9]=i):i=e[9],i}if(s==="e2e"){let i;return e[10]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ki,{size:16}),e[10]=i):i=e[10],i}if(s==="calendar"){let i;return e[11]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Mi,{size:16}),e[11]=i):i=e[11],i}if(s==="experiments"){let i;return e[12]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(_i,{size:16}),e[12]=i):i=e[12],i}let n;return e[13]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(Us,{size:16}),e[13]=n):n=e[13],n}function cn(a){const e=Y.c(51),{pinned:s,canSetMainView:n,onOpen:i,onTogglePin:l,onSetMainView:d}=a,r=X(),f=s?"text-foreground":"text-muted-foreground/40";let o;e[0]!==f?(o=ye("size-7",f),e[0]=f,e[1]=o):o=e[1];let p;e[2]!==s||e[3]!==r?(p=r(s?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[2]=s,e[3]=r,e[4]=p):p=e[4];let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(ts,{size:16}),e[5]=m):m=e[5];let u;e[6]!==l||e[7]!==s||e[8]!==o||e[9]!==p?(u=t.jsx(Ve,{asChild:!0,children:t.jsx(Z,{variant:"ghost",size:"icon",className:o,"aria-label":p,"aria-pressed":s,onClick:l,children:m})}),e[6]=l,e[7]=s,e[8]=o,e[9]=p,e[10]=u):u=e[10];let h;e[11]!==s||e[12]!==r?(h=r(s?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[11]=s,e[12]=r,e[13]=h):h=e[13];let c;e[14]!==h?(c=t.jsx(Te,{side:"top",children:h}),e[14]=h,e[15]=c):c=e[15];let x;e[16]!==u||e[17]!==c?(x=t.jsxs(_e,{delayDuration:0,children:[u,c]}),e[16]=u,e[17]=c,e[18]=x):x=e[18];let g;e[19]!==r?(g=r("virtualMcp.settings.views.rowActions"),e[19]=r,e[20]=g):g=e[20];let v;e[21]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(Wi,{size:16}),e[21]=v):v=e[21];let j;e[22]!==g?(j=t.jsx(_s,{asChild:!0,children:t.jsx(Z,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground","aria-label":g,children:v})}),e[22]=g,e[23]=j):j=e[23];let y;e[24]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(vn,{size:14}),e[24]=y):y=e[24];let b;e[25]!==r?(b=r("virtualMcp.settings.views.open"),e[25]=r,e[26]=b):b=e[26];let w;e[27]!==i||e[28]!==b?(w=t.jsxs(Je,{onClick:i,children:[y,b]}),e[27]=i,e[28]=b,e[29]=w):w=e[29];let S;e[30]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(ts,{size:14}),e[30]=S):S=e[30];let C;e[31]!==s||e[32]!==r?(C=r(s?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[31]=s,e[32]=r,e[33]=C):C=e[33];let N;e[34]!==l||e[35]!==C?(N=t.jsxs(Je,{onClick:l,children:[S,C]}),e[34]=l,e[35]=C,e[36]=N):N=e[36];let k;e[37]!==n||e[38]!==d||e[39]!==r?(k=n&&t.jsxs(Je,{onClick:d,children:[t.jsx(Ls,{size:14}),r("virtualMcp.settings.views.setMainView")]}),e[37]=n,e[38]=d,e[39]=r,e[40]=k):k=e[40];let V;e[41]!==w||e[42]!==N||e[43]!==k?(V=t.jsxs(Vs,{align:"end",children:[w,N,k]}),e[41]=w,e[42]=N,e[43]=k,e[44]=V):V=e[44];let T;e[45]!==j||e[46]!==V?(T=t.jsxs(Ms,{children:[j,V]}),e[45]=j,e[46]=V,e[47]=T):T=e[47];let _;return e[48]!==T||e[49]!==x?(_=t.jsxs("div",{className:"flex items-center gap-1",children:[x,T]}),e[48]=T,e[49]=x,e[50]=_):_=e[50],_}const js=a=>a.stopPropagation();function Ul(a){const e=Y.c(8),{icon:s,title:n}=a;let i;e[0]!==s||e[1]!==n?(i=t.jsx(jt,{icon:s,name:n,size:"xs",className:"shrink-0"}),e[0]=s,e[1]=n,e[2]=i):i=e[2];let l;e[3]!==n?(l=t.jsx("span",{className:"text-xs text-muted-foreground",children:n}),e[3]=n,e[4]=l):l=e[4];let d;return e[5]!==i||e[6]!==l?(d=t.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 bg-muted/30",children:[i,l]}),e[5]=i,e[6]=l,e[7]=d):d=e[7],d}function Bl(a){const e=Y.c(42),{views:s,viewId:n}=a;let i;e[0]!==n||e[1]!==s?(i=s.pinned(n),e[0]=n,e[1]=s,e[2]=i):i=e[2];const l=i;let d;e[3]!==n?(d=t.jsx(Ll,{viewId:n}),e[3]=n,e[4]=d):d=e[4];const r=s.labels[n];let f;e[5]!==n||e[6]!==s?(f=()=>s.openView(n),e[5]=n,e[6]=s,e[7]=f):f=e[7];let o;e[8]!==l||e[9]!==n||e[10]!==s?(o=l&&s.canBeMainView(n)&&!s.isMainView(n),e[8]=l,e[9]=n,e[10]=s,e[11]=o):o=e[11];let p;e[12]!==n||e[13]!==s?(p=()=>s.openView(n),e[12]=n,e[13]=s,e[14]=p):p=e[14];let m;e[15]!==l||e[16]!==n||e[17]!==s?(m=()=>s.togglePin(n,!l),e[15]=l,e[16]=n,e[17]=s,e[18]=m):m=e[18];let u;e[19]!==n||e[20]!==s?(u=()=>s.setMainView(n),e[19]=n,e[20]=s,e[21]=u):u=e[21];let h;e[22]!==l||e[23]!==o||e[24]!==p||e[25]!==m||e[26]!==u?(h=t.jsx(cn,{pinned:l,canSetMainView:o,onOpen:p,onTogglePin:m,onSetMainView:u}),e[22]=l,e[23]=o,e[24]=p,e[25]=m,e[26]=u,e[27]=h):h=e[27];let c;e[28]!==n||e[29]!==s?(c=()=>s.openView(n),e[28]=n,e[29]=s,e[30]=c):c=e[30];let x;e[31]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(Ds,{size:16}),e[31]=x):x=e[31];let g;e[32]!==c?(g=t.jsx("span",{onClick:c,className:"flex cursor-pointer items-center text-muted-foreground",children:x}),e[32]=c,e[33]=g):g=e[33];let v;e[34]!==g||e[35]!==h?(v=t.jsxs("div",{className:"flex items-center gap-1",children:[h,g]}),e[34]=g,e[35]=h,e[36]=v):v=e[36];let j;return e[37]!==v||e[38]!==d||e[39]!==r||e[40]!==f?(j=t.jsx(Fe,{icon:d,title:r,onClick:f,action:v}),e[37]=v,e[38]=d,e[39]=r,e[40]=f,e[41]=j):j=e[41],j}function Yl(a){const e=Y.c(75),{views:s}=a,n=X();let i;e[0]!==n?(i=n("virtualMcp.settings.views.defaults"),e[0]=n,e[1]=i):i=e[1];let l;e[2]!==n?(l=n("virtualMcp.layoutTabContent.mainView"),e[2]=n,e[3]=l):l=e[3];let d;e[4]!==n?(d=n("virtualMcp.layoutTabContent.mainViewDescription"),e[4]=n,e[5]=d):d=e[5];const r=s.noMainView?"none":"set",f=s.noMainView?void 0:s.defaultMainView,o=s.setMainView;let p;e[6]!==n?(p=n("virtualMcp.layoutTabContent.mainView"),e[6]=n,e[7]=p):p=e[7];let m;e[8]!==n?(m=n("virtualMcp.layoutTabContent.noMainView"),e[8]=n,e[9]=m):m=e[9];let u;e[10]!==m?(u=t.jsx(Le,{placeholder:m}),e[10]=m,e[11]=u):u=e[11];let h;e[12]!==p||e[13]!==u?(h=t.jsx(Re,{"aria-label":p,size:"sm",className:"w-36 shrink-0 @min-xl/project-settings:w-44",children:u}),e[12]=p,e[13]=u,e[14]=h):h=e[14];let c;e[15]!==s.defaultMainOptions?(c=s.defaultMainOptions.map(Wl),e[15]=s.defaultMainOptions,e[16]=c):c=e[16];let x;e[17]!==c?(x=t.jsx(Ue,{children:c}),e[17]=c,e[18]=x):x=e[18];let g;e[19]!==h||e[20]!==x||e[21]!==r||e[22]!==f||e[23]!==s.setMainView?(g=t.jsxs(Be,{value:f,onValueChange:o,children:[h,x]},r),e[19]=h,e[20]=x,e[21]=r,e[22]=f,e[23]=s.setMainView,e[24]=g):g=e[24];let v;e[25]!==g||e[26]!==l||e[27]!==d?(v=t.jsx(Fe,{title:l,description:d,action:g}),e[25]=g,e[26]=l,e[27]=d,e[28]=v):v=e[28];let j;e[29]!==n?(j=n("virtualMcp.layoutTabContent.showChat"),e[29]=n,e[30]=j):j=e[30];let y;e[31]!==n?(y=n("virtualMcp.layoutTabContent.showChatDescription"),e[31]=n,e[32]=y):y=e[32];let b;e[33]!==n?(b=n("virtualMcp.layoutTabContent.showChat"),e[33]=n,e[34]=b):b=e[34];const w=s.noMainView?!0:s.chatDefaultOpen;let S;e[35]!==b||e[36]!==w||e[37]!==s.noMainView||e[38]!==s.setChatDefaultOpen?(S=t.jsx(Ve,{asChild:!0,children:t.jsx("span",{className:"shrink-0",children:t.jsx(et,{"aria-label":b,checked:w,disabled:s.noMainView,onCheckedChange:s.setChatDefaultOpen})})}),e[35]=b,e[36]=w,e[37]=s.noMainView,e[38]=s.setChatDefaultOpen,e[39]=S):S=e[39];let C;e[40]!==n||e[41]!==s.noMainView?(C=s.noMainView&&t.jsx(Te,{side:"top",children:n("virtualMcp.layoutTabContent.chatAlwaysShown")}),e[40]=n,e[41]=s.noMainView,e[42]=C):C=e[42];let N;e[43]!==S||e[44]!==C?(N=t.jsxs(_e,{delayDuration:0,children:[S,C]}),e[43]=S,e[44]=C,e[45]=N):N=e[45];let k;e[46]!==j||e[47]!==y||e[48]!==N?(k=t.jsx(Fe,{title:j,description:y,action:N}),e[46]=j,e[47]=y,e[48]=N,e[49]=k):k=e[49];let V;e[50]!==v||e[51]!==k?(V=t.jsxs(ke,{children:[v,k]}),e[50]=v,e[51]=k,e[52]=V):V=e[52];let T;e[53]!==i||e[54]!==V?(T=t.jsx(Oe,{title:i,children:V}),e[53]=i,e[54]=V,e[55]=T):T=e[55];let _;e[56]!==n?(_=n("virtualMcp.settings.views.sidebar"),e[56]=n,e[57]=_):_=e[57];let $;e[58]!==s.navViews||e[59]!==s.projectViews?($=[...s.navViews,...s.projectViews],e[58]=s.navViews,e[59]=s.projectViews,e[60]=$):$=e[60];let F;e[61]!==$||e[62]!==s?(F=$.map(R=>t.jsx(Bl,{views:s,viewId:R},R)),e[61]=$,e[62]=s,e[63]=F):F=e[63];let A;e[64]!==s?(A=s.connectionsData.flatMap(R=>[t.jsx(Ul,{icon:R.icon,title:R.title},`${R.id}:header`),...R.uiTools.map(z=>{const K=s.pinnedAppViews.find(J=>J.connectionId===R.id&&J.toolName===z.name),E=!!K,B=jn(R.id,z.name),G=`ext-apps:${R.id}:${z.name}`;return t.jsx(Fe,{onClick:()=>s.openView(B),icon:E?t.jsx("span",{onClick:js,children:t.jsx(on,{value:K.icon??null,name:K.label||z.name,size:"xs",showHoverOverlay:!1,onChange:J=>s.setAppViewIcon(R.id,z.name,J)})}):t.jsx(Us,{size:16}),title:E?t.jsx("span",{onClick:js,children:t.jsx(Se,{value:K.label,onChange:J=>s.setAppViewLabel(R.id,z.name,J.target.value),onBlur:s.commitAppViewLabel,"aria-label":z.title??Pt(z.name),className:"h-7 w-full max-w-52 text-sm"})}):z.title??Pt(z.name),action:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(cn,{pinned:E,canSetMainView:E&&!s.isMainView(G),onOpen:()=>s.openView(B),onTogglePin:()=>s.toggleAppViewPin(R.id,z.name),onSetMainView:()=>s.setMainView(G)}),t.jsx("span",{onClick:()=>s.openView(B),className:"flex cursor-pointer items-center text-muted-foreground",children:t.jsx(Ds,{size:16})})]})},`${R.id}:${z.name}`)})]),e[64]=s,e[65]=A):A=e[65];let P;e[66]!==F||e[67]!==A?(P=t.jsxs(ke,{children:[F,A]}),e[66]=F,e[67]=A,e[68]=P):P=e[68];let q;e[69]!==_||e[70]!==P?(q=t.jsx(Oe,{title:_,children:P}),e[69]=_,e[70]=P,e[71]=q):q=e[71];let Q;return e[72]!==T||e[73]!==q?(Q=t.jsxs(t.Fragment,{children:[T,q]}),e[72]=T,e[73]=q,e[74]=Q):Q=e[74],Q}function Wl(a){return t.jsx(De,{value:a.value,children:a.label},a.value)}const dn="site-editor",un={context:Ct.library,monitor:Ct.monitoring,plan:Ct.plan};function ys(a){return Object.hasOwn(un,a)}const Kl=new Set([dn,"content"]);function Gl({virtualMcpId:a,form:e,flushAndSave:s}){const n=X(),i=ft(),{openPanel:l}=Hi(),d=pt(),{org:r}=Ae(),f=$s(a),o=Qi(f),p=Xs(a),m=ia(a),u=(f?.connections??[]).map(M=>M.connection_id).sort(),{data:h}=Ps({queryKey:At.projectConnectionDetails(a,u),enabled:u.length>0,queryFn:async()=>await Promise.all(u.map(async O=>{try{const{item:L}=await i.call("COLLECTION_CONNECTIONS_GET",{id:O}),U=(L?.tools??[]).flatMap(W=>{const re=Gi(W._meta);return re?[{name:W.name,title:W.title,description:W.description,resourceUri:re}]:[]});return{fetchOk:!0,id:O,title:L?.title??O,icon:L?.icon??null,uiTools:U}}catch{return{fetchOk:!1,id:O,title:O,icon:null,uiTools:[]}}}))}),c=(h??[]).filter(M=>M.uiTools.length>0),x=new Set([...yn,...wn]),g=e.watch("metadata.ui.pinnedViews")??[],v=e.watch("metadata.ui.layout")??null,j=v?.defaultMainView??null,y=v?.chatDefaultOpen??!1,b=Qs(f?.metadata),w=Xi(b,o.presence),S=e.watch("metadata.sidebarViewsSeen"),C=Ot(It({sidebarViews:e.watch("metadata.sidebarViews"),ui:{layout:v}}),e.watch("metadata.sidebarViewsVersion"),is(S,w)),N=m??(f?Ot(It(f.metadata),f.metadata.sidebarViewsVersion,is(f.metadata.sidebarViewsSeen,w)):C),k=(()=>{if(!j||j.type==="chat")return"";const M=Sn(j.type);return M==="instructions"||M==="connections"||M==="layout"?"settings":Kl.has(M)?dn:x.has(M)?M:`${M}:${j.id??""}:${j.toolName??""}`})(),V=k==="",T=M=>{const[O,L,U]=M.split(":");return O?x.has(O)?{type:O}:O==="ext-apps"&&L?{type:"ext-apps",id:L,toolName:U||void 0}:null:null},_=M=>{e.setValue("metadata.ui.pinnedViews",M,{shouldDirty:!0})},$=M=>{e.setValue("metadata.ui.layout",{...v,...M},{shouldDirty:!0})},F=H.useRef(!1);if(h&&h.length>0&&!F.current){F.current=!0;const M=new Set((h??[]).filter(W=>W.fetchOk).map(W=>W.id)),O=new Set(c.flatMap(W=>W.uiTools.map(re=>`${W.id}:${re.name}`))),L=new Set(u),U=g.filter(W=>L.has(W.connectionId)&&(!M.has(W.connectionId)||O.has(`${W.connectionId}:${W.toolName}`)));U.length!==g.length&&(_(U),j?.type==="ext-apps"&&!U.some(W=>W.connectionId===j.id&&W.toolName===j.toolName)&&$({defaultMainView:{type:"settings"}}))}const A=(M,O)=>{if(g.some(U=>U.connectionId===M&&U.toolName===O)){const U=g.filter(re=>!(re.connectionId===M&&re.toolName===O));_(U);const W=`ext-apps:${M}:${O}`;k===W&&$({defaultMainView:{type:"settings"}})}else{const U=c.find(W=>W.id===M)?.uiTools.find(W=>W.name===O)?.title;_([...g,{connectionId:M,toolName:O,label:U??Pt(O),icon:null}])}s()},P=(M,O,L)=>{_(g.map(U=>U.connectionId===M&&U.toolName===O?{...U,label:L}:U))},q=()=>{s()},Q=(M,O,L)=>{_(g.map(U=>U.connectionId===M&&U.toolName===O?{...U,icon:L}:U)),s()},R=M=>{$({defaultMainView:T(M)}),s()},z=(M,O)=>{const L=ea(N,M,O,1);e.setValue("metadata.sidebarViews",L,{shouldDirty:!0}),e.setValue("metadata.sidebarViewsVersion",1,{shouldDirty:!0}),e.setValue("metadata.sidebarViewsSeen",ta(f?.metadata.sidebarViewsSeen??S,w,L),{shouldDirty:!0}),p.stage(L,N);const U=sa(j,M,O);U!==j&&$({defaultMainView:U})},K=Ji(w),E=Zi(N,w,1),B={overview:n("sidebar.navDestinations.overview"),context:n("sidebar.navDestinations.context"),monitor:n("sidebar.navDestinations.monitor"),plan:n("sidebar.navDestinations.plan"),reports:n("sidebar.navDestinations.reports"),board:n("sidebar.navDestinations.spineTasks"),"site-editor":n("virtualMcp.layoutTabContent.siteEditor"),blog:n("sidebar.projectNav.blog"),assets:n("common.mainPanelTabs.assets"),releases:n("common.mainPanelTabs.releases"),hosting:n("common.mainPanelTabs.hosting"),e2e:n("common.mainPanelTabs.e2e"),automations:n("virtualMcp.layoutTabContent.automations"),calendar:n("common.mainPanelTabs.calendar"),experiments:n("common.mainPanelTabs.experiments")},G=[{value:"overview",label:n("sidebar.navDestinations.overview")}];for(const M of E)M!=="automations"&&M!=="overview"&&(ys(M)||G.push({value:M,label:B[M]}));for(const M of g)G.push({value:`ext-apps:${M.connectionId}:${M.toolName}`,label:M.label||M.toolName});E.includes("automations")&&G.push({value:"automations",label:B.automations}),G.push({value:"settings",label:n("virtualMcp.layoutTabContent.settings")});const J=M=>{if(ys(M)){d({to:un[M],params:{org:r.slug,agentId:a}});return}l(M,{virtualmcpid:a})},ee=new Set(as);return{navViews:as,projectViews:K.filter(M=>!ee.has(M)),labels:B,pinned:M=>N.includes(M),isMainView:M=>k===M,canBeMainView:M=>G.some(O=>O.value===M),defaultMainView:k,defaultMainOptions:G,noMainView:V,chatDefaultOpen:y,connectionsData:c,pinnedAppViews:g,openView:J,togglePin:(M,O)=>z(M,O),setMainView:R,setChatDefaultOpen:M=>{$({chatDefaultOpen:M}),s()},toggleAppViewPin:A,setAppViewIcon:Q,setAppViewLabel:P,commitAppViewLabel:q}}function ql(a){const e=Y.c(55),{form:s,onCommit:n}=a,i=X(),l=H.useId();let d;e[0]!==i?(d=i("virtualMcp.settings.identity.icon"),e[0]=i,e[1]=d):d=e[1];let r;e[2]!==d?(r=t.jsx("p",{className:"text-sm font-medium",children:d}),e[2]=d,e[3]=r):r=e[3];let f;e[4]!==i?(f=i("virtualMcp.settings.identity.iconDescription"),e[4]=i,e[5]=f):f=e[5];let o;e[6]!==f?(o=t.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:f}),e[6]=f,e[7]=o):o=e[7];let p;e[8]!==r||e[9]!==o?(p=t.jsxs("div",{children:[r,o]}),e[8]=r,e[9]=o,e[10]=p):p=e[10];let m;e[11]!==s||e[12]!==n||e[13]!==i?(m=T=>{const{field:_}=T;return t.jsx("div",{className:"justify-self-start",children:t.jsx(on,{value:_.value??null,onChange:$=>{_.onChange($),n()},onColorChange:$=>{s.setValue("metadata.ui.themeColor",$,{shouldDirty:!0}),n()},name:s.watch("title")||i("virtualMcp.virtualMcp.agentNameFallback"),size:"md",avatarClassName:"[&_svg]:w-1/2 [&_svg]:h-1/2"})})},e[11]=s,e[12]=n,e[13]=i,e[14]=m):m=e[14];let u;e[15]!==s.control||e[16]!==m?(u=t.jsx(ve,{name:"icon",control:s.control,render:m}),e[15]=s.control,e[16]=m,e[17]=u):u=e[17];let h;e[18]!==p||e[19]!==u?(h=t.jsxs(je,{className:"grid gap-3 @min-xl/project-settings:grid-cols-[180px_minmax(0,1fr)] @min-xl/project-settings:gap-8",children:[p,u]}),e[18]=p,e[19]=u,e[20]=h):h=e[20];const c=`${l}-name`;let x;e[21]!==i?(x=i("virtualMcp.settings.identity.name"),e[21]=i,e[22]=x):x=e[22];let g;e[23]!==x||e[24]!==c?(g=t.jsx("label",{htmlFor:c,className:"text-sm font-medium",children:x}),e[23]=x,e[24]=c,e[25]=g):g=e[25];let v;e[26]!==l||e[27]!==n||e[28]!==i?(v=T=>{const{field:_}=T;return t.jsx(Se,{..._,id:`${l}-name`,value:_.value??"",onBlur:()=>{_.onBlur(),n()},placeholder:i("virtualMcp.virtualMcp.agentNamePlaceholder")})},e[26]=l,e[27]=n,e[28]=i,e[29]=v):v=e[29];let j;e[30]!==s.control||e[31]!==v?(j=t.jsx(ve,{name:"title",control:s.control,render:v}),e[30]=s.control,e[31]=v,e[32]=j):j=e[32];let y;e[33]!==g||e[34]!==j?(y=t.jsxs(je,{className:"grid gap-3 @min-xl/project-settings:grid-cols-[180px_minmax(0,1fr)] @min-xl/project-settings:gap-8",children:[g,j]}),e[33]=g,e[34]=j,e[35]=y):y=e[35];const b=`${l}-description`;let w;e[36]!==i?(w=i("virtualMcp.settings.identity.description"),e[36]=i,e[37]=w):w=e[37];let S;e[38]!==b||e[39]!==w?(S=t.jsx("label",{htmlFor:b,className:"text-sm font-medium",children:w}),e[38]=b,e[39]=w,e[40]=S):S=e[40];let C;e[41]!==l||e[42]!==n||e[43]!==i?(C=T=>{const{field:_}=T;return t.jsx(ut,{..._,id:`${l}-description`,value:_.value??"",onBlur:()=>{_.onBlur(),n()},placeholder:i("virtualMcp.virtualMcp.descriptionPlaceholder"),className:"min-h-24 resize-y"})},e[41]=l,e[42]=n,e[43]=i,e[44]=C):C=e[44];let N;e[45]!==s.control||e[46]!==C?(N=t.jsx(ve,{name:"description",control:s.control,render:C}),e[45]=s.control,e[46]=C,e[47]=N):N=e[47];let k;e[48]!==S||e[49]!==N?(k=t.jsxs(je,{className:"grid gap-3 @min-xl/project-settings:grid-cols-[180px_minmax(0,1fr)] @min-xl/project-settings:gap-8",children:[S,N]}),e[48]=S,e[49]=N,e[50]=k):k=e[50];let V;return e[51]!==y||e[52]!==k||e[53]!==h?(V=t.jsxs(ke,{children:[h,y,k]}),e[51]=y,e[52]=k,e[53]=h,e[54]=V):V=e[54],V}function Hl(a){const e=Y.c(8),{section:s}=a,n=X();let i;e[0]!==n?(i=n("virtualMcp.settings.navigation"),e[0]=n,e[1]=i):i=e[1];let l;e[2]!==s||e[3]!==n?(l=ca.map(r=>{const{titleKey:f}=da[r];return t.jsx(Ke.Tab,{active:s===r,asChild:!0,children:t.jsx($t,{to:".",activeOptions:{exact:!0,explicitUndefined:!0},search:o=>({...o,section:r==="general"?void 0:r}),children:n(f)})},r)}),e[2]=s,e[3]=n,e[4]=l):l=e[4];let d;if(e[5]!==i||e[6]!==l){const r=t.jsx(Ke.Tabs,{"aria-label":i,children:l});d=t.jsx(Nn.Toolbar.Left.Portal,{fallback:r,children:r}),e[5]=i,e[6]=l,e[7]=d}else d=e[7];return d}function Ql(){const a=Y.c(8),e=pt();let s;a[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},a[0]=s):s=a[0];const{section:n}=Cn(s);let i;a[1]!==n?(i=ua(n)?n:"general",a[1]=n,a[2]=i):i=a[2];let l;a[3]!==e?(l=r=>e({to:".",search:f=>({...f,section:r??void 0})}),a[3]=e,a[4]=l):l=a[4];let d;return a[5]!==i||a[6]!==l?(d={section:i,openSection:l},a[5]=i,a[6]=l,a[7]=d):d=a[7],d}function mn(a){const e=Y.c(20),{value:s,label:n,copiedLabel:i,variant:l,size:d,className:r,copiedClassName:f}=a,o=l===void 0?"ghost":l,p=d===void 0?"icon-sm":d,{handleCopy:m,copied:u}=ma();let h;e[0]!==m||e[1]!==s?(h=()=>{m(s).catch(Xl)},e[0]=m,e[1]=s,e[2]=h):h=e[2];const c=u&&f;let x;e[3]!==r||e[4]!==c?(x=ye(r,c),e[3]=r,e[4]=c,e[5]=x):x=e[5];let g;e[6]!==u?(g=u?t.jsx(rt,{className:"text-success"}):t.jsx(vt,{}),e[6]=u,e[7]=g):g=e[7];let v;e[8]!==n||e[9]!==p||e[10]!==h||e[11]!==x||e[12]!==g||e[13]!==o?(v=t.jsx(Z,{type:"button",variant:o,size:p,"aria-label":n,onClick:h,className:x,children:g}),e[8]=n,e[9]=p,e[10]=h,e[11]=x,e[12]=g,e[13]=o,e[14]=v):v=e[14];const j=u?i:"";let y;e[15]!==j?(y=t.jsx("span",{className:"sr-only","aria-live":"polite",children:j}),e[15]=j,e[16]=y):y=e[16];let b;return e[17]!==v||e[18]!==y?(b=t.jsxs(t.Fragment,{children:[v,y]}),e[17]=v,e[18]=y,e[19]=b):b=e[19],b}function Xl(){}function Jl(a){const e=Y.c(14),{id:s,value:n,copyLabel:i,copiedLabel:l,className:d}=a;let r;e[0]!==d?(r=ye("relative h-fit",d),e[0]=d,e[1]=r):r=e[1];let f;e[2]!==s||e[3]!==n?(f=t.jsx(Se,{id:s,value:n,readOnly:!0,disabled:!0,className:"pr-10 font-mono"}),e[2]=s,e[3]=n,e[4]=f):f=e[4];let o;e[5]===Symbol.for("react.memo_cache_sentinel")?(o=ye("absolute top-1/2 right-1 -translate-y-1/2 transition-opacity","opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 focus-visible:opacity-100 pointer-coarse:opacity-100"),e[5]=o):o=e[5];let p;e[6]!==l||e[7]!==i||e[8]!==n?(p=t.jsx(mn,{value:n,label:i,copiedLabel:l,className:o,copiedClassName:"opacity-100"}),e[6]=l,e[7]=i,e[8]=n,e[9]=p):p=e[9];let m;return e[10]!==r||e[11]!==f||e[12]!==p?(m=t.jsxs("div",{className:r,children:[f,p]}),e[10]=r,e[11]=f,e[12]=p,e[13]=m):m=e[13],m}function Zl(a){const e=Y.c(106),{orgSlug:s,virtualMcpId:n,site:i}=a,l=X(),d=Et();let r;e[0]!==s||e[1]!==n?(r=At.hostedSiteTokens(s,n),e[0]=s,e[1]=n,e[2]=r):r=e[2];const f=r,[o,p]=H.useState(null),m=H.useId();let u;e[3]!==i?(u=async()=>Qt(i,"site-tokens"),e[3]=i,e[4]=u):u=e[4];let h;e[5]!==f||e[6]!==u?(h={queryKey:f,queryFn:u},e[5]=f,e[6]=u,e[7]=h):h=e[7];const c=Ps(h);let x;e[8]!==i?(x=async()=>Qt(i,"site-tokens",{method:"POST"}),e[8]=i,e[9]=x):x=e[9];let g;e[10]===Symbol.for("react.memo_cache_sentinel")?(g=de=>{const{token:I}=de;return p(I)},e[10]=g):g=e[10];let v;e[11]!==f||e[12]!==d?(v=()=>d.invalidateQueries({queryKey:f}),e[11]=f,e[12]=d,e[13]=v):v=e[13];let j;e[14]!==x||e[15]!==v?(j={mutationFn:x,onSuccess:g,onError:er,onSettled:v},e[14]=x,e[15]=v,e[16]=j):j=e[16];const y=Os(j);let b;e[17]!==c.data?.tokens?(b=c.data?.tokens??[],e[17]=c.data?.tokens,e[18]=b):b=e[18];const w=b,S=c.data?.site;let C;e[19]!==l?(C=l("siteTokens.title"),e[19]=l,e[20]=C):C=e[20];let N;e[21]!==l?(N=l("siteTokens.description"),e[21]=l,e[22]=N):N=e[22];let k;e[23]!==l?(k=l("siteTokens.siteId"),e[23]=l,e[24]=k):k=e[24];let V;e[25]!==m||e[26]!==k?(V=t.jsx("label",{htmlFor:m,className:"text-sm font-medium",children:k}),e[25]=m,e[26]=k,e[27]=V):V=e[27];let T;e[28]!==l?(T=l("siteTokens.siteIdDescription"),e[28]=l,e[29]=T):T=e[29];let _;e[30]!==T?(_=t.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:T}),e[30]=T,e[31]=_):_=e[31];let $;e[32]!==S||e[33]!==m||e[34]!==l?($=S?t.jsx(Jl,{id:m,value:S,copyLabel:l("siteTokens.copySiteId"),copiedLabel:l("siteTokens.siteIdCopied"),className:"min-w-0 flex-1"}):t.jsx("p",{className:"min-w-0 flex-1 font-mono text-xs text-muted-foreground",children:"—"}),e[32]=S,e[33]=m,e[34]=l,e[35]=$):$=e[35];const F=!c.data||y.isPending;let A;e[36]!==y?(A=()=>y.mutate(),e[36]=y,e[37]=A):A=e[37];let P;e[38]!==y.isPending?(P=y.isPending?t.jsx(it,{className:"size-3.5"}):t.jsx(ze,{size:14}),e[38]=y.isPending,e[39]=P):P=e[39];let q;e[40]!==l?(q=l("siteTokens.issue"),e[40]=l,e[41]=q):q=e[41];let Q;e[42]!==F||e[43]!==A||e[44]!==P||e[45]!==q?(Q=t.jsxs(Z,{type:"button",size:"sm",className:"shrink-0",disabled:F,onClick:A,children:[P,q]}),e[42]=F,e[43]=A,e[44]=P,e[45]=q,e[46]=Q):Q=e[46];let R;e[47]!==$||e[48]!==Q?(R=t.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[$,Q]}),e[47]=$,e[48]=Q,e[49]=R):R=e[49];let z;e[50]!==V||e[51]!==_||e[52]!==R?(z=t.jsxs(je,{className:"group",children:[V,_,R]}),e[50]=V,e[51]=_,e[52]=R,e[53]=z):z=e[53];let K;e[54]!==c.error||e[55]!==c.isError?(K=c.isError?t.jsx(je,{children:t.jsx("p",{className:"text-xs text-destructive",children:c.error.message})}):null,e[54]=c.error,e[55]=c.isError,e[56]=K):K=e[56];let E;if(e[57]!==l||e[58]!==w){let de;e[60]!==l?(de=I=>t.jsx(je,{children:t.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[t.jsx(Lt,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"truncate font-mono text-xs",children:I.kid}),t.jsx("p",{className:"text-xs text-muted-foreground",children:l("siteTokens.issuedAgo",{when:kn(new Date(I.iat*1e3))})})]})]})},I.kid),e[60]=l,e[61]=de):de=e[61],E=w.map(de),e[57]=l,e[58]=w,e[59]=E}else E=e[59];let B;e[62]!==z||e[63]!==K||e[64]!==E?(B=t.jsxs(ke,{children:[z,K,E]}),e[62]=z,e[63]=K,e[64]=E,e[65]=B):B=e[65];const G=o!==null;let J;e[66]===Symbol.for("react.memo_cache_sentinel")?(J=de=>!de&&p(null),e[66]=J):J=e[66];let ee;e[67]!==l?(ee=l("siteTokens.createdTitle"),e[67]=l,e[68]=ee):ee=e[68];let M;e[69]!==ee?(M=t.jsx(ht,{children:ee}),e[69]=ee,e[70]=M):M=e[70];let O;e[71]!==l?(O=l("siteTokens.createdDescription"),e[71]=l,e[72]=O):O=e[72];let L;e[73]!==O?(L=t.jsx(Is,{children:O}),e[73]=O,e[74]=L):L=e[74];let U;e[75]!==M||e[76]!==L?(U=t.jsxs(xt,{children:[M,L]}),e[75]=M,e[76]=L,e[77]=U):U=e[77];let W;e[78]!==l?(W=l("siteTokens.createdTitle"),e[78]=l,e[79]=W):W=e[79];const re=o??"";let oe;e[80]!==W||e[81]!==re?(oe=t.jsx(Se,{readOnly:!0,"aria-label":W,value:re,className:"font-mono text-xs"}),e[80]=W,e[81]=re,e[82]=oe):oe=e[82];let me;e[83]!==o||e[84]!==l?(me=o?t.jsx(mn,{value:o,label:l("siteTokens.copy"),copiedLabel:l("siteTokens.copied"),variant:"outline",size:"icon",className:"shrink-0"}):null,e[83]=o,e[84]=l,e[85]=me):me=e[85];let ne;e[86]!==oe||e[87]!==me?(ne=t.jsxs("div",{className:"flex items-center gap-2",children:[oe,me]}),e[86]=oe,e[87]=me,e[88]=ne):ne=e[88];let ue;e[89]===Symbol.for("react.memo_cache_sentinel")?(ue=()=>p(null),e[89]=ue):ue=e[89];let fe;e[90]!==l?(fe=l("siteTokens.done"),e[90]=l,e[91]=fe):fe=e[91];let pe;e[92]!==fe?(pe=t.jsx(Ft,{children:t.jsx(Z,{onClick:ue,children:fe})}),e[92]=fe,e[93]=pe):pe=e[93];let ce;e[94]!==U||e[95]!==ne||e[96]!==pe?(ce=t.jsxs(at,{className:"sm:max-w-lg",children:[U,ne,pe]}),e[94]=U,e[95]=ne,e[96]=pe,e[97]=ce):ce=e[97];let xe;e[98]!==G||e[99]!==ce?(xe=t.jsx(lt,{open:G,onOpenChange:J,children:ce}),e[98]=G,e[99]=ce,e[100]=xe):xe=e[100];let be;return e[101]!==N||e[102]!==B||e[103]!==xe||e[104]!==C?(be=t.jsxs(Oe,{title:C,description:N,children:[B,xe]}),e[101]=N,e[102]=B,e[103]=xe,e[104]=C,e[105]=be):be=e[105],be}function er(a){return ie.error(a.message)}function tr(a){const e=Y.c(31),{virtualMcp:s}=a,n=X(),{org:i}=Ae(),{roleSlug:l}=Mn();let d;e[0]!==s?(d=pa(s),e[0]=s,e[1]=d):d=e[1];const r=d,f=ft(),o=Et();let p;e[2]!==f||e[3]!==s?(p=C=>f.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:s.id,data:{blocksV8:C}}),e[2]=f,e[3]=s,e[4]=p):p=e[4];let m;e[5]!==i||e[6]!==o?(m=()=>_n(o,i.id),e[5]=i,e[6]=o,e[7]=m):m=e[7];let u;e[8]!==p||e[9]!==m?(u={mutationFn:p,onError:sr,onSettled:m},e[8]=p,e[9]=m,e[10]=u):u=e[10];const h=Os(u);if(!fa(l))return null;const c=h.isPending?h.variables:r;let x;e[11]!==n?(x=n("virtualMcp.settings.blocksV8Site.label"),e[11]=n,e[12]=x):x=e[12];let g;e[13]!==x?(g=t.jsx(we,{htmlFor:"blocks-v8-site",className:"font-normal text-foreground",children:x}),e[13]=x,e[14]=g):g=e[14];let v;e[15]!==n?(v=n("virtualMcp.settings.blocksV8Site.description"),e[15]=n,e[16]=v):v=e[16];let j;e[17]!==v?(j=t.jsx("p",{className:"text-xs text-muted-foreground",children:v}),e[17]=v,e[18]=j):j=e[18];let y;e[19]!==g||e[20]!==j?(y=t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[g,j]}),e[19]=g,e[20]=j,e[21]=y):y=e[21];let b;e[22]!==h?(b=C=>h.mutate(C),e[22]=h,e[23]=b):b=e[23];let w;e[24]!==c||e[25]!==b||e[26]!==h.isPending?(w=t.jsx(et,{id:"blocks-v8-site",className:"shrink-0",checked:c,disabled:h.isPending,onCheckedChange:b}),e[24]=c,e[25]=b,e[26]=h.isPending,e[27]=w):w=e[27];let S;return e[28]!==w||e[29]!==y?(S=t.jsx(Oe,{children:t.jsx(ke,{children:t.jsx(je,{children:t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[y,w]})})})}),e[28]=w,e[29]=y,e[30]=S):S=e[30],S}function sr(a){return ie.error(a.message)}function nr(a){const e=Y.c(8),{control:s,previewServerUrl:n}=a,i=X();let l;e[0]!==n?(l=Js(n),e[0]=n,e[1]=l):l=e[1];const d=!!l;let r;e[2]!==d||e[3]!==i?(r=o=>{const{field:p}=o;return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(we,{htmlFor:"fast-preview",className:"font-normal text-foreground",children:i("sandbox.cmsSettings.fastPreview.label")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i(d?"sandbox.cmsSettings.fastPreview.description":"sandbox.cmsSettings.fastPreview.needsPreviewServerUrl")})]}),t.jsx(et,{id:"fast-preview",className:"shrink-0",checked:!!p.value&&d,disabled:!d,onCheckedChange:m=>p.onChange(m)})]})},e[2]=d,e[3]=i,e[4]=r):r=e[4];let f;return e[5]!==s||e[6]!==r?(f=t.jsx(ve,{control:s,name:"metadata.fastPreview",render:r}),e[5]=s,e[6]=r,e[7]=f):f=e[7],f}function ir(a){const e=Y.c(5),{control:s,fastPreview:n}=a,i=X();if(!n)return null;let l;e[0]!==i?(l=r=>{const{field:f}=r;return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(we,{htmlFor:"fast-preview-in-place",className:"font-normal text-foreground",children:i("sandbox.cmsSettings.fastPreviewInPlace.label")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.cmsSettings.fastPreviewInPlace.description")})]}),t.jsx(et,{id:"fast-preview-in-place",className:"shrink-0",checked:!!f.value,onCheckedChange:o=>f.onChange(o)})]})},e[0]=i,e[1]=l):l=e[1];let d;return e[2]!==s||e[3]!==l?(d=t.jsx(ve,{control:s,name:"metadata.fastPreviewInPlace",render:l}),e[2]=s,e[3]=l,e[4]=d):d=e[4],d}function ar(a){const e=Y.c(18),{control:s,isBlocksV8:n}=a,i=n===void 0?!1:n,l=X();let d;e[0]!==l?(d=l("sandbox.previewServerUrlField.label"),e[0]=l,e[1]=d):d=e[1];let r;e[2]!==d?(r=t.jsx(we,{htmlFor:"preview-server-url",children:d}),e[2]=d,e[3]=r):r=e[3];let f;e[4]!==l?(f=c=>{const{field:x}=c,g=x.value??"";return t.jsx(Se,{id:"preview-server-url",type:"url",inputMode:"url",placeholder:l("sandbox.previewServerUrlField.placeholder"),value:g,onChange:v=>x.onChange(v.target.value===""?null:v.target.value),onBlur:()=>{x.onChange(xa(g)),x.onBlur()}})},e[4]=l,e[5]=f):f=e[5];let o;e[6]!==s||e[7]!==f?(o=t.jsx(ve,{control:s,name:"metadata.previewServerUrl",render:f}),e[6]=s,e[7]=f,e[8]=o):o=e[8];const p=i?"sandbox.previewServerUrlField.descriptionBlocksV8":"sandbox.previewServerUrlField.description";let m;e[9]!==l||e[10]!==p?(m=l(p),e[9]=l,e[10]=p,e[11]=m):m=e[11];let u;e[12]!==m?(u=t.jsx("p",{className:"text-xs text-muted-foreground",children:m}),e[12]=m,e[13]=u):u=e[13];let h;return e[14]!==r||e[15]!==o||e[16]!==u?(h=t.jsxs("div",{className:"space-y-2",children:[r,o,u]}),e[14]=r,e[15]=o,e[16]=u,e[17]=h):h=e[17],h}function lr(a){const e=Y.c(15),{control:s,isBlocksV8:n,previewServerUrl:i,fastPreview:l}=a,d=X(),r=n||!!l;let f;e[0]!==s||e[1]!==n?(f=t.jsx(je,{children:t.jsx(ar,{control:s,isBlocksV8:n})}),e[0]=s,e[1]=n,e[2]=f):f=e[2];let o;e[3]!==s||e[4]!==n||e[5]!==i||e[6]!==d?(o=n?!Js(i)&&t.jsx(je,{children:t.jsx("p",{className:"text-xs text-muted-foreground",children:d("sandbox.cmsSettings.blocksV8.needsPreviewServerUrl")})}):t.jsx(je,{children:t.jsx(nr,{control:s,previewServerUrl:i})}),e[3]=s,e[4]=n,e[5]=i,e[6]=d,e[7]=o):o=e[7];let p;e[8]!==s||e[9]!==r?(p=r&&t.jsx(je,{children:t.jsx(ir,{control:s,fastPreview:r})}),e[8]=s,e[9]=r,e[10]=p):p=e[10];let m;return e[11]!==f||e[12]!==o||e[13]!==p?(m=t.jsxs(t.Fragment,{children:[f,o,p]}),e[11]=f,e[12]=o,e[13]=p,e[14]=m):m=e[14],m}const Vt={tools:null,resources:null,prompts:null},rr=va.pick({status:!0,title:!0,description:!0,icon:!0,metadata:!0,connections:!0});function or(a){const s=new TextEncoder().encode(a),n=Array.from(s,i=>String.fromCharCode(i)).join("");return btoa(n)}function fn(a){return{"x-studio-client":a,"x-mesh-client":a}}function cr(a){const e=Y.c(15),{url:s,agentId:n}=a,i=X(),[l,d]=H.useState(!1);let r;e[0]!==n||e[1]!==i||e[2]!==s?(r=async()=>{Me("agent_connect_action",{agent_id:n,action:"copy_url"}),await navigator.clipboard.writeText(s),d(!0),ie.success(i("virtualMcp.virtualMcpShareModal.agentUrlCopied")),await St(2e3),d(!1)},e[0]=n,e[1]=i,e[2]=s,e[3]=r):r=e[3];const f=r;let o;e[4]!==l?(o=l?t.jsx(rt,{size:20,className:"text-success"}):t.jsx(vt,{size:20}),e[4]=l,e[5]=o):o=e[5];let p;e[6]!==l||e[7]!==i?(p=i(l?"virtualMcp.virtualMcpShareModal.copied":"virtualMcp.virtualMcpShareModal.copyUrl"),e[6]=l,e[7]=i,e[8]=p):p=e[8];let m;e[9]!==p?(m=t.jsx("span",{className:"text-xs font-medium",children:p}),e[9]=p,e[10]=m):m=e[10];let u;return e[11]!==f||e[12]!==o||e[13]!==m?(u=t.jsxs(Z,{type:"button",variant:"outline",onClick:f,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[o,m]}),e[11]=f,e[12]=o,e[13]=m,e[14]=u):u=e[14],u}function dr(a){const e=Y.c(13),{url:s,serverName:n,agentId:i}=a,l=X();let d;e[0]!==i||e[1]!==n||e[2]!==l||e[3]!==s?(d=()=>{Me("agent_connect_action",{agent_id:i,action:"install_cursor"});const u=Zs(n),h={type:"http",url:s,headers:fn("Cursor")},c=or(JSON.stringify(h,null,2)),x=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(u)}&config=${encodeURIComponent(c)}`;window.open(x,"_blank"),ie.success(l("virtualMcp.virtualMcpShareModal.openingCursor"))},e[0]=i,e[1]=n,e[2]=l,e[3]=s,e[4]=d):d=e[4];const r=d;let f;e[5]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("img",{src:"/logos/cursor.svg",alt:"Cursor",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(11%) sepia(8%) saturate(785%) hue-rotate(1deg) brightness(95%) contrast(89%)"}}),e[5]=f):f=e[5];let o;e[6]!==l?(o=l("virtualMcp.virtualMcpShareModal.installOnCursor"),e[6]=l,e[7]=o):o=e[7];let p;e[8]!==o?(p=t.jsx("span",{className:"text-xs font-medium",children:o}),e[8]=o,e[9]=p):p=e[9];let m;return e[10]!==r||e[11]!==p?(m=t.jsxs(Z,{type:"button",variant:"outline",onClick:r,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[f,p]}),e[10]=r,e[11]=p,e[12]=m):m=e[12],m}function ur(a){const e=Y.c(16),{url:s,serverName:n,agentId:i}=a,l=X(),[d,r]=H.useState(!1);let f;e[0]!==i||e[1]!==n||e[2]!==l||e[3]!==s?(f=async()=>{Me("agent_connect_action",{agent_id:i,action:"install_claude_code"});const c=Zs(n),x={type:"http",url:s,headers:fn("Claude Code")},g=JSON.stringify(x,null,2),v=`claude mcp add-json "${c}" '${g.replace(/'/g,"'\\''")}' --scope user`;await navigator.clipboard.writeText(v),r(!0),ie.success(l("virtualMcp.virtualMcpShareModal.claudeCodeCommandCopied")),await St(2e3),r(!1)},e[0]=i,e[1]=n,e[2]=l,e[3]=s,e[4]=f):f=e[4];const o=f;let p;e[5]!==d?(p=d?t.jsx(rt,{size:20,className:"text-success"}):t.jsx("img",{src:"/logos/Claude Code.svg",alt:"Claude Code",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(55%) sepia(31%) saturate(1264%) hue-rotate(331deg) brightness(92%) contrast(86%)"}}),e[5]=d,e[6]=p):p=e[6];let m;e[7]!==d||e[8]!==l?(m=l(d?"virtualMcp.virtualMcpShareModal.copied":"virtualMcp.virtualMcpShareModal.installOnClaudeCode"),e[7]=d,e[8]=l,e[9]=m):m=e[9];let u;e[10]!==m?(u=t.jsx("span",{className:"text-xs font-medium",children:m}),e[10]=m,e[11]=u):u=e[11];let h;return e[12]!==o||e[13]!==p||e[14]!==u?(h=t.jsxs(Z,{type:"button",variant:"outline",onClick:o,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[p,u]}),e[12]=o,e[13]=p,e[14]=u,e[15]=h):h=e[15],h}const mr=720*60*60;function fr({virtualMcp:a}){const e=X(),s=ft(),[n,i]=H.useState(null),[l,d]=H.useState(!1),[r,f]=H.useState(!1),o=a.id,p=a.title||`agent-${o.slice(0,8)}`,m=n?`bunx @decocms/typegen@latest --mcp ${o} --key ${n} --output client.ts`:`bunx @decocms/typegen@latest --mcp ${o} --key <api-key> --output client.ts`,u=async()=>{d(!0);try{const{key:c}=await s.call("API_KEY_CREATE",{name:`typegen-${p}`,permissions:{[o]:["*"]},expiresIn:mr});if(!c)throw new Error("No key in response");i(c),Me("agent_typegen_key_generated",{agent_id:o})}catch{Me("agent_typegen_key_failed",{agent_id:o}),ie.error(e("virtualMcp.virtualMcpShareModal.failedGenerateApiKey"))}finally{d(!1)}},h=async()=>{Me("agent_connect_action",{agent_id:o,action:"typegen_copy_command",has_api_key:!!n}),await navigator.clipboard.writeText(m),f(!0),ie.success(e("virtualMcp.virtualMcpShareModal.commandCopied")),await St(2e3),f(!1)};return t.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsx("h4",{className:"text-sm font-medium text-foreground",children:e("virtualMcp.virtualMcpShareModal.generateTypedClient")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:e("virtualMcp.virtualMcpShareModal.generateTypedClientDescription")})]}),!n&&t.jsxs(Z,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:u,disabled:l,children:[l?t.jsx(it,{className:"size-3.5"}):t.jsx(Lt,{size:14}),t.jsx("span",{children:e(l?"virtualMcp.virtualMcpShareModal.generating":"virtualMcp.virtualMcpShareModal.generateApiKey")})]})]}),n&&t.jsx("p",{className:"rounded-md border border-warning/20 bg-warning/10 px-3 py-2 text-xs text-warning",children:e("virtualMcp.virtualMcpShareModal.storeKeySecurely")}),t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:e("virtualMcp.virtualMcpShareModal.generateClientLabel")}),t.jsx("div",{className:"rounded-md border border-input bg-muted/50 px-3 py-2.5",children:t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx("code",{className:"min-w-0 flex-1 break-all font-mono text-xs text-muted-foreground",children:m}),t.jsx(Z,{type:"button",variant:"ghost",size:"icon-xs",className:"shrink-0",onClick:h,children:r?t.jsx(rt,{size:12,className:"text-success"}):t.jsx(vt,{size:12})})]})}),t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:e("virtualMcp.virtualMcpShareModal.runtimeVariables")}),t.jsx(pr,{apiKey:n,agentId:o})]})}function pr(a){const e=Y.c(21),{apiKey:s,agentId:n}=a,[i,l]=H.useState(!1),d=window.location.origin,r=s?`STUDIO_API_KEY=${s}`:"STUDIO_API_KEY=<api-key>",f=`STUDIO_BASE_URL=${d}`,o=`${r}
2
- ${f}`;let p;e[0]!==n||e[1]!==s||e[2]!==o?(p=async()=>{Me("agent_connect_action",{agent_id:n,action:"typegen_copy_env",has_api_key:!!s}),await navigator.clipboard.writeText(o),l(!0),await St(2e3),l(!1)},e[0]=n,e[1]=s,e[2]=o,e[3]=p):p=e[3];const m=p,u=!s;let h;e[4]!==u?(h=ye({"opacity-50":u}),e[4]=u,e[5]=h):h=e[5];let c;e[6]!==r||e[7]!==h?(c=t.jsx("span",{className:h,children:r}),e[6]=r,e[7]=h,e[8]=c):c=e[8];let x,g;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("br",{}),g=t.jsx("span",{children:f}),e[9]=x,e[10]=g):(x=e[9],g=e[10]);let v;e[11]!==c?(v=t.jsxs("code",{className:"min-w-0 flex-1 font-mono text-xs text-muted-foreground",children:[c,x,g]}),e[11]=c,e[12]=v):v=e[12];let j;e[13]!==i?(j=i?t.jsx(rt,{size:12,className:"text-success"}):t.jsx(vt,{size:12}),e[13]=i,e[14]=j):j=e[14];let y;e[15]!==m||e[16]!==j?(y=t.jsx(Z,{type:"button",variant:"ghost",size:"icon-xs",className:"shrink-0",onClick:m,children:j}),e[15]=m,e[16]=j,e[17]=y):y=e[17];let b;return e[18]!==v||e[19]!==y?(b=t.jsx("div",{className:"rounded-md border border-input bg-muted/50 px-3 py-2.5",children:t.jsxs("div",{className:"flex items-start gap-2",children:[v,y]})}),e[18]=v,e[19]=y,e[20]=b):b=e[20],b}function hr(a){const e=Y.c(3),{virtualMcp:s}=a;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"h-20 animate-pulse rounded-md bg-muted"}),e[0]=n):n=e[0];let i;return e[1]!==s?(i=t.jsx(H.Suspense,{fallback:n,children:t.jsx(fr,{virtualMcp:s})}),e[1]=s,e[2]=i):i=e[2],i}function xr(a){const e=Y.c(45),{open:s,onOpenChange:n,virtualMcp:i}=a,l=X(),{org:d}=Ae(),r=`/api/${d.slug}/mcp/virtual-mcp/${i.id}`;let f;e[0]!==r?(f=new URL(r,window.location.origin),e[0]=r,e[1]=f):f=e[1];const o=f;let p;e[2]!==i.id||e[3]!==i.title?(p=i.title||`agent-${i.id?.slice(0,8)??"default"}`,e[2]=i.id,e[3]=i.title,e[4]=p):p=e[4];const m=p,u=Na();let h;e[5]!==i.id||e[6]!==o.href?(h=t.jsx(cr,{url:o.href,agentId:i.id}),e[5]=i.id,e[6]=o.href,e[7]=h):h=e[7];let c,x;e[8]!==m||e[9]!==i.id||e[10]!==o.href?(c=t.jsx(dr,{url:o.href,serverName:m,agentId:i.id}),x=t.jsx(ur,{url:o.href,serverName:m,agentId:i.id}),e[8]=m,e[9]=i.id,e[10]=o.href,e[11]=c,e[12]=x):(c=e[11],x=e[12]);let g;e[13]!==h||e[14]!==c||e[15]!==x?(g=t.jsx("div",{className:"flex flex-col gap-3 pt-2",children:t.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[h,c,x]})}),e[13]=h,e[14]=c,e[15]=x,e[16]=g):g=e[16];let v;e[17]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("div",{className:"border-t border-border"}),e[17]=v):v=e[17];let j;e[18]!==i?(j=t.jsx(hr,{virtualMcp:i}),e[18]=i,e[19]=j):j=e[19];let y;e[20]!==g||e[21]!==j?(y=t.jsxs("div",{className:"flex flex-col gap-6",children:[g,v,j]}),e[20]=g,e[21]=j,e[22]=y):y=e[22];const b=y;if(u){let k;e[23]!==l?(k=l("virtualMcp.virtualMcpShareModal.connect"),e[23]=l,e[24]=k):k=e[24];let V;e[25]!==k?(V=t.jsx(ya,{className:"mt-4 mb-4 text-base font-semibold",children:k}),e[25]=k,e[26]=V):V=e[26];let T;e[27]!==b||e[28]!==V?(T=t.jsx(wa,{children:t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 pb-6 [touch-action:pan-y]",children:[V,b]})}),e[27]=b,e[28]=V,e[29]=T):T=e[29];let _;return e[30]!==n||e[31]!==s||e[32]!==T?(_=t.jsx(Sa,{open:s,onOpenChange:n,children:T}),e[30]=n,e[31]=s,e[32]=T,e[33]=_):_=e[33],_}let w;e[34]!==l?(w=l("virtualMcp.virtualMcpShareModal.connect"),e[34]=l,e[35]=w):w=e[35];let S;e[36]!==w?(S=t.jsx(xt,{children:t.jsx(ht,{children:w})}),e[36]=w,e[37]=S):S=e[37];let C;e[38]!==b||e[39]!==S?(C=t.jsxs(at,{className:"max-h-[80vh] overflow-y-auto sm:max-w-2xl",children:[S,b]}),e[38]=b,e[39]=S,e[40]=C):C=e[40];let N;return e[41]!==n||e[42]!==s||e[43]!==C?(N=t.jsx(lt,{open:s,onOpenChange:n,children:C}),e[41]=n,e[42]=s,e[43]=C,e[44]=N):N=e[44],N}const gr=/^[A-Za-z_][A-Za-z0-9_]*$/;function vr(a){const e={},s=a.split(/\r?\n/);for(let n=0;n<s.length;n++){let i=(s[n]??"").trim();if(!i||i.startsWith("#"))continue;i.startsWith("export ")&&(i=i.slice(7).trim());const l=i.indexOf("=");if(l<0)throw new Error(`Line ${n+1}: missing '='`);const d=i.slice(0,l).trim();if(!gr.test(d))throw new Error(`Line ${n+1}: invalid key "${d}"`);let r=i.slice(l+1).trim();r.length>=2&&(r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'"))&&(r=r.slice(1,-1)),e[d]=r}return e}function br(a){const e=Y.c(28),{control:s,form:n,virtualMcpId:i,orgSlug:l,sandboxMap:d}=a,r=X();let f;e[0]!==r?(f=r("sandbox.envVarsField.title"),e[0]=r,e[1]=f):f=e[1];let o;e[2]!==f?(o=t.jsx("div",{className:"flex items-baseline justify-between gap-2",children:t.jsx(we,{className:"font-normal text-foreground",children:f})}),e[2]=f,e[3]=o):o=e[3];let p;e[4]!==r?(p=r("sandbox.envVarsField.description"),e[4]=r,e[5]=p):p=e[5];let m;e[6]!==p?(m=t.jsx("p",{className:"text-xs text-muted-foreground",children:p}),e[6]=p,e[7]=m):m=e[7];let u;e[8]!==s||e[9]!==n||e[10]!==l||e[11]!==d||e[12]!==i?(u=t.jsx(jr,{control:s,form:n,virtualMcpId:i,orgSlug:l,sandboxMap:d}),e[8]=s,e[9]=n,e[10]=l,e[11]=d,e[12]=i,e[13]=u):u=e[13];let h;e[14]!==r?(h=j=>{const{error:y}=j;return t.jsx("div",{className:"rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:y?.message??r("sandbox.envVarsField.failedToLoadSecrets")})},e[14]=r,e[15]=h):h=e[15];let c;e[16]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(Vn,{className:"h-9 w-full"}),e[16]=c):c=e[16];let x;e[17]!==s||e[18]!==n?(x=t.jsx(H.Suspense,{fallback:c,children:t.jsx(wr,{control:s,form:n})}),e[17]=s,e[18]=n,e[19]=x):x=e[19];let g;e[20]!==h||e[21]!==x?(g=t.jsx(Xe,{fallback:h,children:x}),e[20]=h,e[21]=x,e[22]=g):g=e[22];let v;return e[23]!==o||e[24]!==m||e[25]!==u||e[26]!==g?(v=t.jsxs("div",{className:"space-y-2",children:[o,m,u,g]}),e[23]=o,e[24]=m,e[25]=u,e[26]=g,e[27]=v):v=e[27],v}function jr(a){const e=Y.c(33),{control:s,form:n,virtualMcpId:i,orgSlug:l,sandboxMap:d}=a,r=X(),o=Tn.useSession().data?.user?.id,p="metadata.runtime.env";let m;e[0]!==n?(m=()=>JSON.stringify(ws(n.getValues(p))),e[0]=n,e[1]=m):m=e[1];const[u,h]=H.useState(m);let c;e[2]!==s?(c={control:s,name:p},e[2]=s,e[3]=c):c=e[3];const x=zt(c);let g;e[4]!==x?(g=JSON.stringify(ws(x)),e[4]=x,e[5]=g):g=e[5];const v=g,j=v!==u;let y;e[6]!==d||e[7]!==o?(y=o?Object.keys(d?.[o]??{}):[],e[6]=d,e[7]=o,e[8]=y):y=e[8];const b=y,w=b.length>0,[S,C]=H.useState(!1);if(!j||!w)return null;let N;e[9]!==v||e[10]!==l||e[11]!==r||e[12]!==b||e[13]!==i?(N=async()=>{C(!0);const q=await Promise.allSettled(b.map(async R=>{const z=Ca({orgSlug:l,virtualMcpId:i,branch:R,threadId:null},"setup/start",{force:"1"}),K=await fetch(z,{method:"POST"});if(!K.ok){const E=await K.text().catch(()=>K.statusText);throw new Error(E||K.statusText)}}));C(!1);const Q=q.filter(yr).length;Q===0?(h(v),ie.success(b.length===1?r("sandbox.envVarsField.restartedSingle"):r("sandbox.envVarsField.restartedMultiple",{count:b.length}))):ie.error(r("sandbox.envVarsField.restartFailed",{failed:Q,total:b.length}))},e[9]=v,e[10]=l,e[11]=r,e[12]=b,e[13]=i,e[14]=N):N=e[14];const k=N;let V;e[15]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx(Ts,{className:"size-3.5 shrink-0"}),e[15]=V):V=e[15];let T;e[16]!==r?(T=r("sandbox.envVarsField.sandboxRunningNotice"),e[16]=r,e[17]=T):T=e[17];let _;e[18]!==T?(_=t.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-warning",children:[V,t.jsx("span",{className:"truncate",children:T})]}),e[18]=T,e[19]=_):_=e[19];let $;e[20]!==S?($=S?t.jsx(it,{className:"size-3.5"}):t.jsx(Pn,{className:"size-3.5"}),e[20]=S,e[21]=$):$=e[21];let F;e[22]!==S||e[23]!==r?(F=r(S?"sandbox.envVarsField.restarting":"sandbox.envVarsField.restartDev"),e[22]=S,e[23]=r,e[24]=F):F=e[24];let A;e[25]!==k||e[26]!==S||e[27]!==F||e[28]!==$?(A=t.jsxs(Z,{type:"button",variant:"outline",size:"sm",onClick:k,disabled:S,className:"shrink-0",children:[$,F]}),e[25]=k,e[26]=S,e[27]=F,e[28]=$,e[29]=A):A=e[29];let P;return e[30]!==A||e[31]!==_?(P=t.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-md border border-warning/20 bg-warning/10 px-3 py-2 text-xs",children:[_,A]}),e[30]=A,e[31]=_,e[32]=P):P=e[32],P}function yr(a){return a.status==="rejected"}function wr(a){const e=Y.c(62),{control:s,form:n}=a,i=X(),l="metadata.runtime.env";let d;e[0]!==s?(d={control:s,name:l},e[0]=s,e[1]=d):d=e[1];const r=Dn(d),{fields:f,append:o,remove:p}=r;let m;e[2]!==n?(m=(z,K)=>{n.setValue(`${l}.${z}`,K,{shouldDirty:!0,shouldTouch:!0})},e[2]=n,e[3]=m):m=e[3];const u=m,h=Va();let c;if(e[4]!==h){c=new Map;for(const z of h)c.set(z.id,z);e[4]=h,e[5]=c}else c=e[5];const[x,g]=H.useState(null);let v;e[6]!==o?(v=()=>{o({key:"",kind:"literal",value:""})},e[6]=o,e[7]=v):v=e[7];const j=v;let y;e[8]!==o||e[9]!==n||e[10]!==i?(y=async()=>{let z;try{z=await navigator.clipboard.readText()}catch{ie.error(i("sandbox.envVarsField.clipboardReadFailed"));return}if(!z.trim()){ie.error(i("sandbox.envVarsField.clipboardEmpty"));return}let K;try{K=vr(z)}catch(M){const O=M;ie.error(O.message);return}const E=Object.entries(K);if(E.length===0){ie.error(i("sandbox.envVarsField.nothingToAdd"));return}const B=n.getValues(l)??[],G=new Set;for(const M of B){const O=(M.key??"").trim();O&&G.add(O)}let J=0,ee=0;for(const[M,O]of E){if(G.has(M)){ee++;continue}o({key:M,kind:"literal",value:O}),G.add(M),J++}J===0&&ee>0?ie.message(i("sandbox.envVarsField.allKeysExist",{count:ee})):ie.success(ee>0?i("sandbox.envVarsField.addedWithSkipped",{added:J,skipped:ee}):i("sandbox.envVarsField.added",{added:J}))},e[8]=o,e[9]=n,e[10]=i,e[11]=y):y=e[11];const b=y;let w;if(e[12]!==s||e[13]!==f||e[14]!==n||e[15]!==p||e[16]!==c||e[17]!==h||e[18]!==u){let z;e[20]!==s||e[21]!==n||e[22]!==p||e[23]!==c||e[24]!==h||e[25]!==u?(z=(K,E)=>t.jsx("li",{className:"rounded-md border border-border bg-background",children:t.jsx(Sr,{index:E,control:s,form:n,onUpdateEntry:u,fieldPath:l,secrets:h,secretById:c,onSaveAsSecret:(B,G)=>g({kind:"save-literal",index:E,presetKey:B,presetValue:G}),onCreateNewSecret:B=>g({kind:"create-new",index:E,presetKey:B}),onRemove:()=>p(E)})},K.id),e[20]=s,e[21]=n,e[22]=p,e[23]=c,e[24]=h,e[25]=u,e[26]=z):z=e[26],w=f.map(z),e[12]=s,e[13]=f,e[14]=n,e[15]=p,e[16]=c,e[17]=h,e[18]=u,e[19]=w}else w=e[19];let S;e[27]!==w?(S=t.jsx("ul",{className:"space-y-2",children:w}),e[27]=w,e[28]=S):S=e[28];let C;e[29]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(ze,{className:"size-3.5"}),e[29]=C):C=e[29];let N;e[30]!==i?(N=i("sandbox.envVarsField.addEnvVar"),e[30]=i,e[31]=N):N=e[31];let k;e[32]!==j||e[33]!==N?(k=t.jsxs(Z,{type:"button",variant:"outline",size:"sm",onClick:j,className:"flex-1",children:[C,N]}),e[32]=j,e[33]=N,e[34]=k):k=e[34];let V;e[35]!==i?(V=i("sandbox.envVarsField.pasteDotenvAriaLabel"),e[35]=i,e[36]=V):V=e[36];let T;e[37]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(Vi,{className:"size-3.5"}),e[37]=T):T=e[37];let _;e[38]!==i?(_=i("sandbox.envVarsField.pasteDotenv"),e[38]=i,e[39]=_):_=e[39];let $;e[40]!==b||e[41]!==V||e[42]!==_?($=t.jsx(Ve,{asChild:!0,children:t.jsxs(Z,{type:"button",variant:"outline",size:"sm",onClick:b,"aria-label":V,children:[T,_]})}),e[40]=b,e[41]=V,e[42]=_,e[43]=$):$=e[43];let F;e[44]!==i?(F=i("sandbox.envVarsField.pasteDotenvTooltip"),e[44]=i,e[45]=F):F=e[45];let A;e[46]!==F?(A=t.jsx(Te,{children:F}),e[46]=F,e[47]=A):A=e[47];let P;e[48]!==$||e[49]!==A?(P=t.jsxs(_e,{children:[$,A]}),e[48]=$,e[49]=A,e[50]=P):P=e[50];let q;e[51]!==P||e[52]!==k?(q=t.jsxs("div",{className:"flex items-center gap-2",children:[k,P]}),e[51]=P,e[52]=k,e[53]=q):q=e[53];let Q;e[54]!==x||e[55]!==n||e[56]!==u?(Q=x!==null?t.jsx(Cr,{mode:x,onClose:()=>g(null),onSaved:z=>{const K=n.getValues(`${l}.${x.index}.key`)?.trim()??"";u(x.index,{key:K,kind:"secret",secretId:z}),g(null)}}):null,e[54]=x,e[55]=n,e[56]=u,e[57]=Q):Q=e[57];let R;return e[58]!==q||e[59]!==Q||e[60]!==S?(R=t.jsxs("div",{className:"space-y-2",children:[S,q,Q]}),e[58]=q,e[59]=Q,e[60]=S,e[61]=R):R=e[61],R}function Sr(a){const e=Y.c(77),{index:s,control:n,form:i,onUpdateEntry:l,fieldPath:d,secrets:r,secretById:f,onSaveAsSecret:o,onCreateNewSecret:p,onRemove:m}=a,u=X(),h=`${d}.${s}.key`,c=`${d}.${s}.value`,x=`${d}.${s}.secretId`,g=`${d}.${s}.kind`;let v;e[0]!==n||e[1]!==g?(v={control:n,name:g},e[0]=n,e[1]=g,e[2]=v):v=e[2];const y=zt(v)==="secret"?"secret":"literal";let b;e[3]!==i||e[4]!==s||e[5]!==h||e[6]!==o||e[7]!==l||e[8]!==c?(b=O=>{const L=i.getValues(h)?.trim()??"";if(O==="literal"){l(s,{key:L,kind:"literal",value:""});return}const U=i.getValues(c)??"";if(U.length>0){o(L,U);return}l(s,{key:L,kind:"secret",secretId:""})},e[3]=i,e[4]=s,e[5]=h,e[6]=o,e[7]=l,e[8]=c,e[9]=b):b=e[9];const w=b;let S;e[10]!==s||e[11]!==u?(S=O=>{const{field:L}=O,U=(L.value??"").trim(),W=U.length>0&&!wt.test(U);return t.jsxs("div",{className:"space-y-1",children:[t.jsx(Se,{...L,value:L.value??"",placeholder:u("sandbox.envVarsField.keyPlaceholder"),spellCheck:!1,autoComplete:"off",autoCapitalize:"off",autoCorrect:"off",className:ye("font-mono",W&&"border-destructive focus-visible:ring-destructive"),"aria-invalid":W,"aria-label":u("sandbox.envVarsField.envVarKeyLabel",{index:s+1}),onBlur:re=>{const oe=re.target.value.trim();L.onChange(oe),L.onBlur()}}),W?t.jsx("p",{className:"text-2xs text-destructive",children:u("sandbox.envVarsField.invalidKeyMessage")}):null]})},e[10]=s,e[11]=u,e[12]=S):S=e[12];let C;e[13]!==n||e[14]!==h||e[15]!==S?(C=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx(ve,{control:n,name:h,render:S})}),e[13]=n,e[14]=h,e[15]=S,e[16]=C):C=e[16];let N;e[17]!==w?(N=O=>w(O),e[17]=w,e[18]=N):N=e[18];let k;e[19]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(Re,{className:"h-9 w-[110px]",children:t.jsx(Le,{})}),e[19]=k):k=e[19];let V;e[20]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx(Lt,{className:"size-3.5"}),e[20]=V):V=e[20];let T;e[21]!==u?(T=u("sandbox.envVarsField.literal"),e[21]=u,e[22]=T):T=e[22];let _;e[23]!==T?(_=t.jsx(De,{value:"literal",children:t.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[V,T]})}),e[23]=T,e[24]=_):_=e[24];let $;e[25]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(On,{className:"size-3.5"}),e[25]=$):$=e[25];let F;e[26]!==u?(F=u("sandbox.envVarsField.secret"),e[26]=u,e[27]=F):F=e[27];let A;e[28]!==F?(A=t.jsx(De,{value:"secret",children:t.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[$,F]})}),e[28]=F,e[29]=A):A=e[29];let P;e[30]!==A||e[31]!==_?(P=t.jsxs(Ue,{children:[_,A]}),e[30]=A,e[31]=_,e[32]=P):P=e[32];let q;e[33]!==y||e[34]!==P||e[35]!==N?(q=t.jsx("div",{className:"shrink-0",children:t.jsxs(Be,{value:y,onValueChange:N,children:[k,P]})}),e[33]=y,e[34]=P,e[35]=N,e[36]=q):q=e[36];let Q;e[37]!==n||e[38]!==i||e[39]!==s||e[40]!==h||e[41]!==y||e[42]!==p||e[43]!==f||e[44]!==x||e[45]!==r||e[46]!==u||e[47]!==c?(Q=t.jsx("div",{className:"flex flex-[2] min-w-0 items-center gap-1",children:y==="literal"?t.jsx(ve,{control:n,name:c,render:O=>{const{field:L}=O;return t.jsx(Se,{...L,value:L.value??"",type:"password",placeholder:u("sandbox.envVarsField.valuePlaceholder"),spellCheck:!1,autoComplete:"off",className:"font-mono","aria-label":u("sandbox.envVarsField.envVarValueLabel",{index:s+1}),onBlur:U=>{L.onChange(U.target.value),L.onBlur()}})}}):t.jsxs(t.Fragment,{children:[t.jsx(ve,{control:n,name:x,render:O=>{const{field:L}=O;return t.jsxs(Be,{value:L.value||"",onValueChange:U=>L.onChange(U),children:[t.jsx(Re,{className:ye("h-9 w-full",!L.value&&"text-muted-foreground"),"aria-label":u("sandbox.envVarsField.secretAriaLabel",{index:s+1}),children:t.jsx(Le,{placeholder:u("sandbox.envVarsField.pickSecretPlaceholder"),children:t.jsx(ka,{field:L,secretById:f})})}),t.jsx(Ue,{children:r.length===0?t.jsx("div",{className:"px-2 py-2 text-xs text-muted-foreground",children:u("sandbox.envVarsField.noSecretsYet")}):r.map(Nr)})]})}}),t.jsxs(_e,{children:[t.jsx(Ve,{asChild:!0,children:t.jsx(Z,{type:"button",variant:"ghost",size:"icon","aria-label":u("sandbox.envVarsField.createNewSecretAriaLabel"),onClick:()=>{const O=i.getValues(h)?.trim()??"";p(O)},children:t.jsx(ze,{className:"size-3.5"})})}),t.jsx(Te,{children:u("sandbox.envVarsField.createNewSecret")})]})]})}),e[37]=n,e[38]=i,e[39]=s,e[40]=h,e[41]=y,e[42]=p,e[43]=f,e[44]=x,e[45]=r,e[46]=u,e[47]=c,e[48]=Q):Q=e[48];let R;e[49]!==i||e[50]!==h||e[51]!==y||e[52]!==o||e[53]!==u||e[54]!==c?(R=y==="literal"?t.jsxs(_e,{children:[t.jsx(Ve,{asChild:!0,children:t.jsx(Z,{type:"button",variant:"ghost",size:"icon","aria-label":u("sandbox.envVarsField.saveAsSecretAriaLabel"),onClick:()=>{const O=i.getValues(h)?.trim()??"",L=i.getValues(c)??"";o(O,L)},children:t.jsx(Ti,{className:"size-3.5"})})}),t.jsx(Te,{children:u("sandbox.envVarsField.saveAsSecret")})]}):null,e[49]=i,e[50]=h,e[51]=y,e[52]=o,e[53]=u,e[54]=c,e[55]=R):R=e[55];let z;e[56]!==u?(z=u("sandbox.envVarsField.removeEnvVarAriaLabel"),e[56]=u,e[57]=z):z=e[57];let K;e[58]===Symbol.for("react.memo_cache_sentinel")?(K=t.jsx(bt,{className:"size-3.5"}),e[58]=K):K=e[58];let E;e[59]!==m||e[60]!==z?(E=t.jsx(Ve,{asChild:!0,children:t.jsx(Z,{type:"button",variant:"ghost",size:"icon","aria-label":z,onClick:m,children:K})}),e[59]=m,e[60]=z,e[61]=E):E=e[61];let B;e[62]!==u?(B=u("sandbox.envVarsField.remove"),e[62]=u,e[63]=B):B=e[63];let G;e[64]!==B?(G=t.jsx(Te,{children:B}),e[64]=B,e[65]=G):G=e[65];let J;e[66]!==E||e[67]!==G?(J=t.jsxs(_e,{children:[E,G]}),e[66]=E,e[67]=G,e[68]=J):J=e[68];let ee;e[69]!==R||e[70]!==J?(ee=t.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[R,J]}),e[69]=R,e[70]=J,e[71]=ee):ee=e[71];let M;return e[72]!==q||e[73]!==Q||e[74]!==ee||e[75]!==C?(M=t.jsxs("div",{className:"flex flex-col gap-2 p-2 sm:flex-row sm:items-center",children:[C,q,Q,ee]}),e[72]=q,e[73]=Q,e[74]=ee,e[75]=C,e[76]=M):M=e[76],M}function Nr(a){return t.jsx(De,{value:a.id,children:t.jsxs("span",{className:"inline-flex items-center gap-2",children:[t.jsx(_a,{scope:a.scope}),t.jsx("span",{className:"font-mono",children:a.name})]})},a.id)}function Cr({mode:a,onClose:e,onSaved:s}){const n=X(),i=a.kind==="save-literal"?a.presetValue:"",l=a.presetKey,[d,r]=H.useState(()=>kr(l)),[f,o]=H.useState("organization"),[p,m]=H.useState(i),[u,h]=H.useState(""),c=Ta(),x=d.trim(),g=p.length>0&&x.length>0&&Ma.test(x),v=async b=>{if(b.preventDefault(),!!g)try{const w=await c.mutateAsync({scope:f,name:x,value:p,description:u.trim()||void 0});ie.success(n("sandbox.envVarsField.secretSaved",{name:w.name})),s(w.id)}catch(w){ie.error(w instanceof Error?w.message:n("sandbox.envVarsField.failedToSaveSecret"))}},j=a.kind==="save-literal"?n("sandbox.envVarsField.saveValueAsSecretTitle"):n("sandbox.envVarsField.createNewSecretTitle"),y=a.kind==="save-literal"?n("sandbox.envVarsField.saveValueAsSecretDescription"):n("sandbox.envVarsField.createNewSecretDescription");return t.jsx(lt,{open:!0,onOpenChange:b=>{b||e()},children:t.jsxs(at,{className:"sm:max-w-md",children:[t.jsxs(xt,{children:[t.jsx(ht,{children:j}),t.jsx(Is,{children:y})]}),t.jsxs("form",{onSubmit:v,className:"space-y-4",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(we,{htmlFor:"save-secret-scope",children:n("sandbox.envVarsField.scopeLabel")}),t.jsxs(Be,{value:f,onValueChange:b=>o(b),children:[t.jsx(Re,{id:"save-secret-scope",children:t.jsx(Le,{})}),t.jsxs(Ue,{children:[t.jsx(De,{value:"organization",children:n("sandbox.envVarsField.scopeOrganization")}),t.jsx(De,{value:"user",children:n("sandbox.envVarsField.scopePrivate")})]})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(we,{htmlFor:"save-secret-name",children:n("sandbox.envVarsField.nameLabel")}),t.jsx(Se,{id:"save-secret-name",value:d,onChange:b=>r(b.target.value),placeholder:n("sandbox.envVarsField.namePlaceholder"),autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:n("sandbox.envVarsField.nameHelperText")})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(we,{htmlFor:"save-secret-value",children:n("sandbox.envVarsField.valueLabel")}),t.jsx(Se,{id:"save-secret-value",type:"password",value:p,onChange:b=>m(b.target.value),placeholder:n("sandbox.envVarsField.secretValuePlaceholder"),autoComplete:"new-password",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(we,{htmlFor:"save-secret-description",children:n("sandbox.envVarsField.descriptionLabel")}),t.jsx(ut,{id:"save-secret-description",value:u,onChange:b=>h(b.target.value),rows:2,placeholder:n("sandbox.envVarsField.descriptionPlaceholder")})]}),t.jsxs(Ft,{children:[t.jsx(Z,{type:"button",variant:"outline",onClick:e,disabled:c.isPending,children:n("sandbox.envVarsField.cancel")}),t.jsx(Z,{type:"submit",disabled:!g||c.isPending,children:c.isPending?n("sandbox.envVarsField.saving"):n("sandbox.envVarsField.saveSecret")})]})]})]})})}function ws(a){if(!Array.isArray(a))return[];const e=[];for(const s of a){if(!s||typeof s!="object")continue;const n=s,i=(n.key??"").trim();if(!(!i||!wt.test(i))){if(n.kind==="literal"){e.push({key:i,kind:"literal",value:n.value??""});continue}n.kind==="secret"&&n.secretId&&e.push({key:i,kind:"secret",secretId:n.secretId})}}return e}function kr(a){const e=a.trim();return e&&wt.test(e)?e:""}function Mr({repository:a}){const e=a.path.split("/");return{owner:e.slice(0,-1).join("/"),name:e.at(-1)??a.path,url:a.webUrl,repositoryId:a.id}}function _r(a){const e=Y.c(30),{repo:s,onConnect:n}=a,i=X(),[l,d]=H.useState(!1);let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Da,{size:20,className:"text-foreground/70"}),e[0]=r):r=e[0];let f;e[1]!==s||e[2]!==i?(f=s?`${s.owner}/${s.name}`:i("virtualMcp.settings.repository.none"),e[1]=s,e[2]=i,e[3]=f):f=e[3];let o;e[4]!==s||e[5]!==i?(o=s?s.url:i("virtualMcp.settings.repository.noneDescription"),e[4]=s,e[5]=i,e[6]=o):o=e[6];const p=s?"outline":"default";let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=()=>d(!0),e[7]=m):m=e[7];let u;e[8]!==s||e[9]!==i?(u=i(s?"virtualMcp.settings.repository.change":"virtualMcp.settings.repository.connect"),e[8]=s,e[9]=i,e[10]=u):u=e[10];let h;e[11]!==p||e[12]!==u?(h=t.jsx(Z,{size:"sm",variant:p,onClick:m,children:u}),e[11]=p,e[12]=u,e[13]=h):h=e[13];let c;e[14]!==f||e[15]!==o||e[16]!==h?(c=t.jsx(ke,{children:t.jsx(Fe,{icon:r,title:f,description:o,action:h})}),e[14]=f,e[15]=o,e[16]=h,e[17]=c):c=e[17];let x;e[18]!==i?(x=i("virtualMcp.settings.repository.connect"),e[18]=i,e[19]=x):x=e[19];let g;e[20]!==n||e[21]!==i?(g=async y=>{await n(Mr(y)),d(!1),ie.success(i("virtualMcp.settings.repository.connected",{name:y.repository.path}))},e[20]=n,e[21]=i,e[22]=g):g=e[22];let v;e[23]!==l||e[24]!==g||e[25]!==x?(v=t.jsx(Pa,{open:l,onOpenChange:d,title:x,onPicked:g,onError:Vr}),e[23]=l,e[24]=g,e[25]=x,e[26]=v):v=e[26];let j;return e[27]!==v||e[28]!==c?(j=t.jsxs(Oe,{children:[c,v]}),e[27]=v,e[28]=c,e[29]=j):j=e[29],j}function Vr(a){return ie.error(a)}const Tr={npm:{install:"npm install",run:a=>`npm run ${a}`,runtime:"node"},pnpm:{install:"pnpm install",run:a=>`pnpm run ${a}`,runtime:"node"},yarn:{install:"yarn install",run:a=>`yarn run ${a}`,runtime:"node"},bun:{install:"bun install",run:a=>`bun run ${a}`,runtime:"bun"},deno:{install:"deno install",run:a=>`deno task ${a}`,runtime:"deno"}};function Dr(a){const e=a.trim();if(e==="")return{ok:!0,value:null};if(!/^\d+$/.test(e))return{ok:!1};const s=Number(e);return s<1||s>65535?{ok:!1}:{ok:!0,value:String(s)}}const Pr=Object.keys(Tr),Tt="__none__";function Or(a){const e=Y.c(47),{control:s}=a,n=X(),i=H.useRef(null);let l;e[0]!==n?(l=n("sandbox.runtimeFields.packageManager"),e[0]=n,e[1]=l):l=e[1];let d;e[2]!==l?(d=t.jsx(we,{htmlFor:"runtime-pm",children:l}),e[2]=l,e[3]=d):d=e[3];let r;e[4]!==n?(r=N=>{const{field:k}=N;return t.jsxs(Be,{value:k.value??Tt,onValueChange:V=>k.onChange(V===Tt?null:V),children:[t.jsx(Re,{id:"runtime-pm",children:t.jsx(Le,{placeholder:n("sandbox.runtimeFields.autoDetect")})}),t.jsxs(Ue,{children:[t.jsx(De,{value:Tt,children:n("sandbox.runtimeFields.autoDetect")}),Pr.map(Fr)]})]})},e[4]=n,e[5]=r):r=e[5];let f;e[6]!==s||e[7]!==r?(f=t.jsx(ve,{control:s,name:"metadata.runtime.selected",render:r}),e[6]=s,e[7]=r,e[8]=f):f=e[8];let o;e[9]!==d||e[10]!==f?(o=t.jsxs("div",{className:"space-y-2",children:[d,f]}),e[9]=d,e[10]=f,e[11]=o):o=e[11];let p;e[12]!==n?(p=n("sandbox.runtimeFields.packagePath"),e[12]=n,e[13]=p):p=e[13];let m;e[14]!==p?(m=t.jsx(we,{htmlFor:"runtime-path",children:p}),e[14]=p,e[15]=m):m=e[15];let u;e[16]!==s?(u=t.jsx(ve,{control:s,name:"metadata.runtime.path",render:Ir}),e[16]=s,e[17]=u):u=e[17];let h;e[18]!==n?(h=n("sandbox.runtimeFields.packagePathDescription"),e[18]=n,e[19]=h):h=e[19];let c;e[20]!==h?(c=t.jsx("p",{className:"text-xs text-muted-foreground",children:h}),e[20]=h,e[21]=c):c=e[21];let x;e[22]!==c||e[23]!==m||e[24]!==u?(x=t.jsxs("div",{className:"space-y-2",children:[m,u,c]}),e[22]=c,e[23]=m,e[24]=u,e[25]=x):x=e[25];let g;e[26]!==n?(g=n("sandbox.runtimeFields.devServerPort"),e[26]=n,e[27]=g):g=e[27];let v;e[28]!==g?(v=t.jsx(we,{htmlFor:"runtime-port",children:g}),e[28]=g,e[29]=v):v=e[29];let j;e[30]!==n?(j=N=>{const{field:k}=N;return t.jsx(Se,{ref:i,id:"runtime-port",inputMode:"numeric",placeholder:n("sandbox.runtimeFields.auto"),defaultValue:k.value??"",onBlur:V=>{const T=Dr(V.target.value);T.ok?k.onChange(T.value):i.current&&(i.current.value=k.value??"")}})},e[30]=n,e[31]=j):j=e[31];let y;e[32]!==s||e[33]!==j?(y=t.jsx(ve,{control:s,name:"metadata.runtime.port",render:j}),e[32]=s,e[33]=j,e[34]=y):y=e[34];let b;e[35]!==n?(b=n("sandbox.runtimeFields.devServerPortDescription"),e[35]=n,e[36]=b):b=e[36];let w;e[37]!==b?(w=t.jsx("p",{className:"text-xs text-muted-foreground",children:b}),e[37]=b,e[38]=w):w=e[38];let S;e[39]!==v||e[40]!==y||e[41]!==w?(S=t.jsxs("div",{className:"space-y-2",children:[v,y,w]}),e[39]=v,e[40]=y,e[41]=w,e[42]=S):S=e[42];let C;return e[43]!==x||e[44]!==S||e[45]!==o?(C=t.jsxs("div",{className:"space-y-5",children:[o,x,S]}),e[43]=x,e[44]=S,e[45]=o,e[46]=C):C=e[46],C}function Ir(a){const{field:e}=a;return t.jsx(Se,{id:"runtime-path",placeholder:".",defaultValue:e.value??"",onBlur:s=>{const n=s.target.value.trim();e.onChange(n===""?null:n)}})}function Fr(a){return t.jsx(De,{value:a,children:a},a)}function $r(a){const e=Y.c(10),{control:s}=a,n=X(),[i,l]=H.useState(null),[d,r]=H.useState(null),f=zt({control:s,name:"metadata.runtime.path"})??"";let o;e[0]!==f?(o=ds(f),e[0]=f,e[1]=o):o=e[1];const p=o;let m;e[2]!==i||e[3]!==d||e[4]!==p||e[5]!==n?(m=h=>{const{field:c}=h,x=c.value??[],g=j=>c.onChange(j.length?j:null),v=()=>{if(i===null)return;const j=ds(i);if(!j){l(null),r(null);return}if(j===p||x.some(y=>y.path===j)){r(n("sandbox.runtimeApps.duplicate"));return}g([...x,{path:j}]),l(null),r(null)};return t.jsxs("div",{className:"space-y-2",children:[t.jsx(we,{htmlFor:"runtime-apps-draft",children:n("sandbox.runtimeApps.title")}),x.length>0&&t.jsx("ul",{className:"space-y-1.5",children:x.map(j=>t.jsxs("li",{className:"flex h-9 items-center gap-2 rounded-md border border-border px-3",children:[t.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-xs",children:j.path}),t.jsx(Z,{type:"button",variant:"ghost",size:"icon-sm","aria-label":n("sandbox.runtimeApps.remove",{path:j.path}),onClick:()=>g(x.filter(y=>y.path!==j.path)),children:t.jsx(bt,{})})]},j.path))}),i!==null?t.jsx(Se,{id:"runtime-apps-draft",autoFocus:!0,placeholder:"apps/checkout",value:i,"aria-invalid":!!d,onChange:j=>{l(j.target.value),r(null)},onBlur:v,onKeyDown:j=>{j.key==="Enter"?(j.preventDefault(),v()):j.key==="Escape"&&(l(null),r(null))}}):x.length<os&&t.jsxs(Z,{id:"runtime-apps-draft",type:"button",variant:"outline",size:"sm",onClick:()=>l(""),children:[t.jsx(ze,{}),n("sandbox.runtimeApps.add")]}),d?t.jsx("p",{className:"text-xs text-destructive",children:d}):t.jsx("p",{className:"text-xs text-muted-foreground",children:n("sandbox.runtimeApps.description",{max:String(os)})})]})},e[2]=i,e[3]=d,e[4]=p,e[5]=n,e[6]=m):m=e[6];let u;return e[7]!==s||e[8]!==m?(u=t.jsx(ve,{control:s,name:"metadata.runtime.apps",render:m}),e[7]=s,e[8]=m,e[9]=u):u=e[9],u}function Ar(a){const e=Y.c(5),{control:s}=a,n=X();let i;e[0]!==n?(i=d=>{const{field:r}=d;return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(we,{htmlFor:"field-description-tooltips",className:"font-normal text-foreground",children:n("sandbox.fieldDescriptionTooltipsField.label")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:n("sandbox.fieldDescriptionTooltipsField.description")})]}),t.jsx(et,{id:"field-description-tooltips",className:"shrink-0",checked:r.value??!1,onCheckedChange:f=>r.onChange(f)})]})},e[0]=n,e[1]=i):i=e[1];let l;return e[2]!==s||e[3]!==i?(l=t.jsx(ve,{control:s,name:"metadata.fieldDescriptionTooltips",render:i}),e[2]=s,e[3]=i,e[4]=l):l=e[4],l}function Er(a){const e=Y.c(5),{control:s}=a,n=X();let i;e[0]!==n?(i=d=>{const{field:r}=d;return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(we,{htmlFor:"legacy-blog-post-format",className:"font-normal text-foreground",children:n("sandbox.legacyBlogPostFormatField.label")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:n("sandbox.legacyBlogPostFormatField.description")})]}),t.jsx(et,{id:"legacy-blog-post-format",className:"shrink-0",checked:r.value??!1,onCheckedChange:f=>r.onChange(f)})]})},e[0]=n,e[1]=i):i=e[1];let l;return e[2]!==s||e[3]!==i?(l=t.jsx(ve,{control:s,name:"metadata.legacyBlogPostFormat",render:i}),e[2]=s,e[3]=i,e[4]=l):l=e[4],l}function zr(a){const e=Y.c(32),{control:s,onCommit:n}=a,i=X();let l;e[0]!==i?(l=i("virtualMcp.virtualMcp.publishPolicySmart"),e[0]=i,e[1]=l):l=e[1];let d;e[2]!==i?(d=i("virtualMcp.virtualMcp.publishPolicySmartDescription"),e[2]=i,e[3]=d):d=e[3];let r;e[4]!==l||e[5]!==d?(r={value:"smart",label:l,description:d},e[4]=l,e[5]=d,e[6]=r):r=e[6];let f;e[7]!==i?(f=i("virtualMcp.virtualMcp.publishPolicyCodeReview"),e[7]=i,e[8]=f):f=e[8];let o;e[9]!==i?(o=i("virtualMcp.virtualMcp.publishPolicyCodeReviewDescription"),e[9]=i,e[10]=o):o=e[10];let p;e[11]!==f||e[12]!==o?(p={value:"code-review",label:f,description:o},e[11]=f,e[12]=o,e[13]=p):p=e[13];let m;e[14]!==i?(m=i("virtualMcp.virtualMcp.publishPolicyOpen"),e[14]=i,e[15]=m):m=e[15];let u;e[16]!==i?(u=i("virtualMcp.virtualMcp.publishPolicyOpenDescription"),e[16]=i,e[17]=u):u=e[17];let h;e[18]!==m||e[19]!==u?(h={value:"open",label:m,description:u},e[18]=m,e[19]=u,e[20]=h):h=e[20];let c;e[21]!==r||e[22]!==p||e[23]!==h?(c=[r,p,h],e[21]=r,e[22]=p,e[23]=h,e[24]=c):c=e[24];const x=c;let g;e[25]!==n||e[26]!==x||e[27]!==i?(g=j=>{const{field:y}=j,b=y.value??"smart";return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(we,{htmlFor:"publish-policy",className:"font-normal text-foreground",children:i("virtualMcp.virtualMcp.publishing")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("virtualMcp.virtualMcp.publishingDescription")})]}),t.jsxs(Be,{value:b,onValueChange:w=>{y.onChange(w),n()},children:[t.jsx(Re,{id:"publish-policy",className:"w-44 shrink-0",children:t.jsx(Le,{})}),t.jsx(Ue,{className:"max-w-80",children:x.map(Rr)})]})]})},e[25]=n,e[26]=x,e[27]=i,e[28]=g):g=e[28];let v;return e[29]!==s||e[30]!==g?(v=t.jsx(ve,{name:"metadata.publishPolicy",control:s,render:g}),e[29]=s,e[30]=g,e[31]=v):v=e[31],v}function Rr(a){return t.jsx(De,{value:a.value,description:a.description,children:a.label},a.value)}function Lr(a){const e=Y.c(24),{control:s,onCommit:n}=a,i=X();let l;e[0]!==i?(l=i("sandbox.cmsSettings.contentEditing.off"),e[0]=i,e[1]=l):l=e[1];let d;e[2]!==i?(d=i("sandbox.cmsSettings.contentEditing.offDescription"),e[2]=i,e[3]=d):d=e[3];let r;e[4]!==l||e[5]!==d?(r={value:"off",label:l,description:d},e[4]=l,e[5]=d,e[6]=r):r=e[6];let f;e[7]!==i?(f=i("sandbox.cmsSettings.contentEditing.on"),e[7]=i,e[8]=f):f=e[8];let o;e[9]!==i?(o=i("sandbox.cmsSettings.contentEditing.onDescription"),e[9]=i,e[10]=o):o=e[10];let p;e[11]!==f||e[12]!==o?(p={value:"on",label:f,description:o},e[11]=f,e[12]=o,e[13]=p):p=e[13];let m;e[14]!==r||e[15]!==p?(m=[r,p],e[14]=r,e[15]=p,e[16]=m):m=e[16];const u=m;let h;e[17]!==n||e[18]!==u||e[19]!==i?(h=x=>{const{field:g}=x,v=g.value??null,j=en(v);return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(we,{htmlFor:"content-editing-mode",className:"font-normal text-foreground",children:i("sandbox.cmsSettings.contentEditing.title")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.cmsSettings.contentEditing.description")})]}),t.jsxs(Be,{value:j,onValueChange:y=>{const b=ba.safeParse(y);b.success&&(g.onChange(ja(v,b.data)),n())},children:[t.jsx(Re,{id:"content-editing-mode",className:"w-44 shrink-0",children:t.jsx(Le,{})}),t.jsx(Ue,{className:"max-w-80",children:u.map(Ur)})]})]})},e[17]=n,e[18]=u,e[19]=i,e[20]=h):h=e[20];let c;return e[21]!==s||e[22]!==h?(c=t.jsx(ve,{name:"metadata.ui.layout",control:s,render:h}),e[21]=s,e[22]=h,e[23]=c):c=e[23],c}function Ur(a){return t.jsx(De,{value:a.value,description:a.description,children:a.label},a.value)}function Ss(a){const e=a.metadata?.sidebarViews,s=a.metadata?.sidebarViewsVersion;return{effectiveViews:[...Ot(It(a.metadata),s)],rawViews:e===null?null:e?[...e]:void 0,version:s,seen:a.metadata?.sidebarViewsSeen??void 0}}function Ns(a,e){return a===e?!0:!a||!e||a.length!==e.length?!1:a.every((s,n)=>s===e[n])}function Br(a,e){switch(e.type){case"SET_SHARE_DIALOG_OPEN":return{...a,shareDialogOpen:e.payload};case"SET_ADD_DIALOG_OPEN":return{...a,addDialogOpen:e.payload};case"OPEN_SETTINGS":return{...a,settingsDialogOpen:!0,settingsConnectionId:e.payload};case"CLOSE_SETTINGS":return{...a,settingsDialogOpen:!1,settingsConnectionId:null};default:return a}}function Yr(a,e){switch(e.type){case"accumulate":{const s=a??{start:e.now,fields:new Set,saveCount:0,instructionsLength:null},n=new Set(s.fields);for(const i of e.fields)n.add(i);return{...s,fields:n,saveCount:s.saveCount+1,instructionsLength:e.instructionsLength??s.instructionsLength}}case"reset":return null}}function Wr(a){const e=a.metadata?.runtime?.env;if(!e||e.length===0)return a;const s=e.filter(n=>{if(!n||typeof n!="object")return!1;const i=(n.key??"").trim();return!i||!wt.test(i)?!1:n.kind==="literal"?!0:n.kind==="secret"?!!n.secretId:!1});return s.length===e.length?a:{...a,metadata:{...a.metadata,runtime:{...a.metadata?.runtime??{},env:s}}}}async function Kr(a,e){const s=a?.idToken??null;if(s){const i=Cs(s);if(i)return i}const n=a?.userinfoEndpoint??null;if(n)try{const i=await fetch(n,{headers:{Authorization:`Bearer ${e}`}});if(i.ok){const l=await i.json(),d=typeof l.email=="string"?l.email:typeof l.upn=="string"?l.upn:typeof l.preferred_username=="string"?l.preferred_username:null;if(d)return d}}catch{}return Cs(e)}function Cs(a){try{const e=a.split(".");if(e.length===3&&e[1]){const s=JSON.parse(atob(e[1].replace(/-/g,"+").replace(/_/g,"/")));if(typeof s.email=="string")return s.email;if(typeof s.upn=="string")return s.upn;if(typeof s.preferred_username=="string")return s.preferred_username}}catch{}return null}function Gr({virtualMcp:a,contextSection:e}){const s=X(),n=si(),{org:i}=Ae(),l=li(),{data:d}=ri([a.id]),r=d?.get(a.id)?.last_used_at,f=Fs(),o=Et(),p=ft(),m=Xs(a.id),u=JSON.stringify([i.id,a.id]),h=aa(a.metadata,m.snapshot()),c=In({resolver:Fn(rr),defaultValues:{...a,metadata:{...cs(a.metadata),previewServerUrl:ga(a.metadata),...h}}}),x=c.watch("connections"),g=Oa("multi_app_preview"),v=qi(a),j=Qs(a?.metadata),y=j&&en(c.watch("metadata.ui.layout"))==="off",b=As(a),w=b?{owner:b.owner,name:b.name,url:b.url}:null,[S,C]=H.useReducer(Br,{shareDialogOpen:!1,addDialogOpen:!1,settingsDialogOpen:!1,settingsConnectionId:null}),[N,k]=H.useState(!1),[V,T]=H.useState(!1),{openSidePanel:_}=Zn(),{sendMessage:$}=Hn(),F=async()=>{if(V)return;const D=c.getValues("metadata.instructions");if(D?.trim()){T(!0);try{R(),Me("agent_instructions_improve_clicked",{agent_id:a.id,instructions_length:D.length}),_();const le=Gn(i.id);await $({tiptapDoc:Xn({managerAgentId:le.id,managerName:le.title,kind:"agent",id:a.id,instructions:D})})}finally{T(!1)}}},[A,P]=H.useReducer(Yr,null),q=()=>{A!==null&&(Me("agent_updated",{agent_id:a.id,fields:Array.from(A.fields),instructions_length:A.instructionsLength,save_count:A.saveCount,edit_duration_ms:Date.now()-A.start}),P({type:"reset"}))},{schedule:Q,flush:R}=ss({delayMs:3e4,save:async()=>q()}),z=async()=>{const D=m.snapshot(),le={predicate:Ne=>rs(Ne.queryKey,i.id)},se=async()=>(await o.invalidateQueries({predicate:Ne=>rs(Ne.queryKey,i.id),refetchType:"all"}),ls(o,i.id,a.id)),ge=(Ne,He)=>{if(Ne){Ns(c.getValues("metadata.sidebarViews"),Ne.rawViews)||c.setValue("metadata.sidebarViews",Ne.rawViews,{shouldDirty:!1}),c.getValues("metadata.sidebarViewsVersion")!==Ne.version&&c.setValue("metadata.sidebarViewsVersion",Ne.version,{shouldDirty:!1}),Ns(c.getValues("metadata.sidebarViewsSeen"),Ne.seen)||c.setValue("metadata.sidebarViewsSeen",Ne.seen,{shouldDirty:!1});return}He!==null&&(c.setValue("metadata.sidebarViews",[...He],{shouldDirty:!1}),c.setValue("metadata.sidebarViewsVersion",na,{shouldDirty:!1}))},Ce=la(D),Ie=Object.keys(c.control._formState.dirtyFields);if(Ie.length===0&&!Ce){await m.settle({snapshot:D,saved:!0,authoritativeViews:D?.persistedViews});return}const Ge=Ie.length>0?Ie:["metadata"],ot=Ge.includes("metadata"),qe=c.getValues();c.reset(qe,{keepValues:!0});const tt=Wr(qe),pn=ls(o,i.id,a.id),hn=ra({sidebarViews:tt.metadata?.sidebarViews,sidebarViewsVersion:tt.metadata?.sidebarViewsVersion},D,pn?.metadata);tt.metadata={...cs(tt.metadata),...hn};let Nt;try{Nt=await l.update.mutateAsync({id:a.id,data:tt})}catch(Ne){let He=null;try{He=await se()}catch{}const Wt=He?Ss(He):null,Kt=await m.settle({snapshot:D,saved:!1,authoritativeViews:Wt?.effectiveViews});throw Kt.settledLatest&&ge(Wt,Kt.reconciledViews),Ne}await o.cancelQueries(le),oa(o,i.id,Nt);const Bt=Ss(Nt),Yt=await m.settle({snapshot:D,saved:!0,authoritativeViews:Bt.effectiveViews});Yt.settledLatest&&ge(Bt,Yt.reconciledViews),P({type:"accumulate",now:Date.now(),fields:Ge,instructionsLength:ot?qe.metadata?.instructions?.length??0:null}),Q()},K=()=>Ia(u,z),{schedule:E,flush:B}=ss({save:K});H.useEffect(()=>{const D=c.watch(()=>E());return()=>D.unsubscribe()},[]);const G=()=>{Me("connections_dialog_opened",{source:"agent_settings",mode:"add"}),C({type:"SET_ADD_DIALOG_OPEN",payload:!0})},J=async D=>{const le=c.getValues("connections");if(le.some(Ce=>Ce.connection_id===D))return;c.setValue("connections",[...le,{connection_id:D,selected_tools:Vt.tools,selected_resources:Vt.resources,selected_prompts:Vt.prompts}],{shouldDirty:!0}),C({type:"SET_ADD_DIALOG_OPEN",payload:!1});const se=new URL(`/api/${i.slug}/mcp/${D}`,window.location.origin),ge=await Jt({url:se.href,token:null,orgId:i.id});ge.supportsOAuth&&!ge.isAuthenticated&&await U(D)},ee=D=>{const se=c.getValues("connections").filter(ge=>ge.connection_id!==D);c.setValue("connections",se,{shouldDirty:!0})},M=(D,le)=>{const se=c.getValues("connections");if(se.some(ge=>ge.connection_id===le)){ie.error(s("virtualMcp.virtualMcp.instanceAlreadyAdded"));return}c.setValue("connections",se.map(ge=>ge.connection_id===D?{...ge,connection_id:le}:ge),{shouldDirty:!0})},O=async D=>{if(c.getValues("connections").find(se=>se.connection_id===D))try{const{item:se}=await p.call("COLLECTION_CONNECTIONS_GET",{id:D});if(!se)return;const ge=se.title.replace(/\s*\(.*?\)\s*$/,""),Ce=qn("conn"),Ie=`${ge} (${Date.now().toString(36).slice(-4)})`;await f.create.mutateAsync({id:Ce,title:Ie,description:se.description??null,connection_type:se.connection_type,connection_url:se.connection_url??null,connection_token:null,icon:se.icon??null,app_name:se.app_name??null,app_id:se.app_id??null,connection_headers:se.connection_headers??null});const Ge=new URL(`/api/${i.slug}/mcp/${Ce}`,window.location.origin),ot=await Jt({url:Ge.href,token:null,orgId:i.id});if(ot.supportsOAuth&&!ot.isAuthenticated){const qe=await U(Ce);if(!qe){await f.delete.mutateAsync(Ce);return}await f.update.mutateAsync({id:Ce,data:{title:`${ge} (${qe})`}})}M(D,Ce),ie.success(s("virtualMcp.virtualMcp.newInstanceCreated"))}catch(se){console.error("Failed to create instance:",se),ie.error(s("virtualMcp.virtualMcp.failedToCreateInstance"))}},L=D=>{C({type:"OPEN_SETTINGS",payload:D})},U=async D=>{const{token:le,tokenInfo:se,error:ge}=await ii({connectionId:D,orgSlug:i.slug,scope:"offline_access"});if(ge||!le)return ie.error(s("virtualMcp.virtualMcp.authenticationFailed",{error:ge??""})),null;if(se)try{const Ie=await fetch(`/api/${i.slug}/connections/${D}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:se.accessToken,refreshToken:se.refreshToken,expiresIn:se.expiresIn,scope:se.scope,clientId:se.clientId,clientSecret:se.clientSecret,tokenEndpoint:se.tokenEndpoint})});if(!Ie.ok)console.error("Failed to save OAuth token:",await Ie.text()),await f.update.mutateAsync({id:D,data:{connection_token:le}});else try{await f.update.mutateAsync({id:D,data:{}})}catch(Ge){console.warn("Failed to refresh connection tools after OAuth:",Ge)}}catch(Ie){console.error("Error saving OAuth token:",Ie),await f.update.mutateAsync({id:D,data:{connection_token:le}})}else await f.update.mutateAsync({id:D,data:{connection_token:le}});const Ce=new URL(`/api/${i.slug}/mcp/${D}`,window.location.origin);return await o.invalidateQueries({queryKey:At.isMCPAuthenticated(Ce.href,null)}),ie.success(s("virtualMcp.virtualMcp.authenticationSuccessful")),Kr(se,le)},W=()=>{const D=c.getValues("metadata.instructions")??"",le=s("virtualMcp.virtualMcp.promptTemplateContent"),se=D.trim()?`${D}
3
-
4
- ${le}`:le;c.setValue("metadata.instructions",se,{shouldDirty:!0})},re=new Set(x.map(D=>D.connection_id)),{section:oe}=Ql(),me=e!==null,ne=e==="instructions"?null:e??oe,ue=ne==="general",fe=me?e==="instructions":ue,pe=ha(a.id),ce=$n(a.metadata),xe=Gl({virtualMcpId:a.id,form:c,flushAndSave:B}),be=pt(),[de,I]=H.useState(!1),te=async()=>{R();try{await l.delete.mutateAsync(a.id),Me("agent_deleted",{agent_id:a.id,source:"agent_detail"}),ie.success(s("virtualMcp.virtualMcp.agentDeleted",{title:a.title})),be({to:"/$org",params:{org:i.slug}})}catch{}},Pe=t.jsxs(Z,{variant:"outline",size:"sm",onClick:()=>{Me("agent_connect_modal_opened",{agent_id:a.id}),C({type:"SET_SHARE_DIALOG_OPEN",payload:!0})},children:[t.jsx(An,{size:14}),s("virtualMcp.virtualMcp.connect")]}),he=t.jsxs("div",{className:"flex items-center gap-2",children:[!c.watch("metadata.instructions")?.trim()&&t.jsx(Z,{variant:"outline",size:"sm",onClick:W,children:s("virtualMcp.virtualMcp.promptTemplate")}),t.jsxs(Z,{variant:"outline",size:"sm",disabled:V||!c.watch("metadata.instructions")?.trim(),onClick:F,children:[t.jsx(dt,{size:13}),s("virtualMcp.virtualMcp.improve")]})]});return t.jsxs(Ke,{children:[t.jsxs(t.Fragment,{children:[!me&&t.jsxs(t.Fragment,{children:[t.jsx(Ke.Title,{children:s("virtualMcp.settings.title")}),t.jsx(Hl,{section:ne??"general"})]}),t.jsx(Ke.Actions,{secondary:ne==="connections"?Pe:void 0,children:ne==="connections"?t.jsxs(Z,{size:"sm",onClick:G,children:[t.jsx(ze,{size:14}),s("virtualMcp.virtualMcp.addConnection")]}):ne==="general"?Pe:null}),t.jsx(Ke.Content,{children:t.jsx(Ke.Container,{width:"standard",className:"@container/project-settings",children:t.jsxs(En,{children:[ne==="views"&&t.jsx(Yl,{views:xe}),ue&&t.jsx(ql,{form:c,onCommit:B}),ne==="connections"&&t.jsx("section",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:x.length===0?t.jsxs("button",{type:"button",onClick:G,className:"flex items-center gap-3 px-3 py-2.5 rounded-lg border border-dashed border-border hover:bg-accent transition-colors w-full text-left cursor-pointer",children:[t.jsx("div",{className:"flex items-center justify-center size-8 rounded-md text-muted-foreground/75 border border-dashed border-border shrink-0",children:t.jsx(ze,{size:16})}),t.jsx("span",{className:"text-sm text-muted-foreground",children:s("virtualMcp.virtualMcp.noConnectionsYet")})]}):x.map(D=>t.jsx(Xe,{fallback:()=>null,children:t.jsx(H.Suspense,{fallback:t.jsx(rn,{}),children:t.jsx(Dl,{connection_id:D.connection_id,usedConnectionIds:re,onOpenSettings:()=>L(D.connection_id),onRemove:()=>ee(D.connection_id),onAuthenticate:U,onSwitchInstance:M,onNewInstance:()=>O(D.connection_id)})})},D.connection_id))})}),fe&&t.jsxs("section",{className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground",children:s("virtualMcp.virtualMcp.instructions")}),he]}),t.jsx(ve,{name:"metadata.instructions",control:c.control,render:({field:D})=>t.jsxs("div",{className:"relative rounded-xl shadow-edge bg-card focus-within-ring",children:[t.jsx(ut,{...D,value:D.value??"",onChange:le=>{D.onChange(le)},onBlur:()=>{D.onBlur(),B()},placeholder:s("virtualMcp.virtualMcp.instructionsPlaceholder"),className:"min-h-[200px] max-h-[360px] overflow-auto resize-none text-base text-muted-foreground placeholder:text-muted-foreground/40 leading-relaxed border-0 shadow-none px-4 py-3 pr-11 focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent",style:{boxShadow:"none"}}),t.jsxs(_e,{delayDuration:0,children:[t.jsx(Ve,{asChild:!0,children:t.jsx(Z,{type:"button",variant:"ghost",size:"icon-sm",className:"absolute top-2 right-2 text-muted-foreground",onClick:()=>k(!0),"aria-label":s("virtualMcp.virtualMcp.openFullscreenEditor"),children:t.jsx(Di,{size:14})})}),t.jsx(Te,{side:"left",children:s("virtualMcp.virtualMcp.fullscreen")})]})]})})]}),fe&&t.jsx(ll,{form:c}),ne==="site"&&!j&&t.jsx(Oe,{children:t.jsx(ke,{children:t.jsx(Fe,{title:s("virtualMcp.settings.cmsEmptyTitle"),description:s("virtualMcp.settings.cmsEmpty"),action:t.jsx(Z,{size:"sm",variant:"outline",asChild:!0,children:t.jsx($t,{to:".",search:{section:"repository"},children:s("virtualMcp.settings.repository.open")})})})})}),ne==="site"&&j&&t.jsx(Oe,{title:s("sandbox.cmsSettings.title"),children:t.jsxs(ke,{children:[t.jsx(je,{children:t.jsx(Lr,{control:c.control,onCommit:B})}),!y&&t.jsx(je,{children:t.jsx(Ar,{control:c.control})}),!y&&t.jsx(je,{children:t.jsx(Er,{control:c.control})}),!y&&v&&t.jsx(je,{children:t.jsx(zr,{control:c.control,onCommit:B})})]})}),ne==="site"&&!y&&t.jsx(Oe,{title:s("sandbox.cmsSettings.preview.title"),description:s("sandbox.cmsSettings.preview.description"),children:t.jsx(ke,{children:t.jsx(lr,{control:c.control,isBlocksV8:pe,previewServerUrl:c.watch("metadata.previewServerUrl"),fastPreview:c.watch("metadata.fastPreview")})})}),ne==="site"&&t.jsx(tr,{virtualMcp:a}),ne==="site"&&pe&&ce&&t.jsx(Zl,{orgSlug:i.slug,virtualMcpId:a.id,site:ce}),ne==="repository"&&t.jsx(_r,{repo:w,onConnect:D=>(c.setValue("metadata.repository",D,{shouldDirty:!0}),B())}),ne==="repository"&&t.jsx(Oe,{title:s("virtualMcp.settings.repository.runtimeTitle"),description:s("virtualMcp.settings.repository.runtimeDescription"),children:t.jsxs(ke,{children:[t.jsx(je,{children:t.jsx(Or,{control:c.control})}),g&&t.jsx(je,{children:t.jsx($r,{control:c.control})}),t.jsx(je,{children:t.jsx(br,{control:c.control,form:c,virtualMcpId:a.id,orgSlug:i.slug,sandboxMap:a.metadata.sandboxMap})})]})}),ue&&t.jsx(Oe,{title:s("virtualMcp.settings.groups.details"),children:t.jsxs(ke,{children:[t.jsx(Fe,{title:s("virtualMcp.virtualMcp.createdBy"),action:t.jsx(Qn,{id:a.created_by,size:"2xs",className:"text-sm text-muted-foreground"})}),t.jsx(Fe,{title:s("virtualMcp.virtualMcp.created"),action:t.jsx("span",{className:"text-sm text-muted-foreground",children:il(new Date(a.created_at),"PP",{locale:n})})}),t.jsx(Fe,{title:s("virtualMcp.virtualMcp.lastUsedLabel"),action:t.jsx("span",{className:"text-sm text-muted-foreground",children:r?ni(new Date(r),{addSuffix:!0,locale:n}):s("virtualMcp.virtualMcp.neverUsed")})})]})}),ue&&t.jsx(Oe,{title:s("virtualMcp.settings.groups.advanced"),children:t.jsx(ke,{children:t.jsx(Fe,{title:s("virtualMcp.virtualMcp.deleteAgent"),description:s("virtualMcp.virtualMcp.deleteAgentDescription"),action:t.jsxs(Z,{variant:"outline",size:"sm",className:"text-destructive hover:bg-destructive/10 hover:text-destructive",onClick:()=>I(!0),children:[t.jsx(bt,{size:14}),s("virtualMcp.virtualMcp.deleteAgent")]})})})})]})})},e??ne)]}),t.jsx(zn,{open:de,onOpenChange:I,children:t.jsxs(Rn,{children:[t.jsxs(Ln,{children:[t.jsx(Un,{children:s("virtualMcp.virtualMcp.deleteAgentConfirm")}),t.jsx(Bn,{children:s("virtualMcp.virtualMcp.deleteAgentConfirmDescription",{title:a.title})})]}),t.jsxs(Yn,{children:[t.jsx(Wn,{children:s("virtualMcp.virtualMcp.cancel")}),t.jsx(Kn,{onClick:te,variant:"destructive",children:s("virtualMcp.virtualMcp.delete")})]})]})}),t.jsx(Ii,{open:S.addDialogOpen,onOpenChange:D=>C({type:"SET_ADD_DIALOG_OPEN",payload:D}),agentId:a.id,addedConnectionIds:re,onAdd:J}),t.jsx(Tl,{open:S.settingsDialogOpen,onOpenChange:D=>{D||C({type:"CLOSE_SETTINGS"})},selectedId:S.settingsConnectionId,form:c,connections:x,onAuthenticate:U}),t.jsx(xr,{open:S.shareDialogOpen,onOpenChange:D=>C({type:"SET_SHARE_DIALOG_OPEN",payload:D}),virtualMcp:a}),t.jsx(lt,{open:N,onOpenChange:k,children:t.jsxs(at,{className:"w-[90vw] sm:max-w-6xl h-[85vh] flex flex-col p-0 gap-0",children:[t.jsx(xt,{className:"px-6 pt-6 pb-3 border-b border-border shrink-0",children:t.jsx(ht,{children:s("virtualMcp.virtualMcp.instructions")})}),t.jsx("div",{className:"flex-1 min-h-0 p-6",children:t.jsx(ve,{name:"metadata.instructions",control:c.control,render:({field:D})=>t.jsx(ut,{...D,value:D.value??"",onChange:le=>{D.onChange(le)},onBlur:()=>{D.onBlur(),B()},placeholder:s("virtualMcp.virtualMcp.instructionsPlaceholder"),className:"w-full h-full resize-none text-base text-muted-foreground placeholder:text-muted-foreground/40 leading-relaxed rounded-xl shadow-edge px-4 py-3 focus-ring bg-card border-0",style:{boxShadow:"none"}})})})]})})]})}function ac(a){const e=Y.c(22),{virtualMcpId:s,contextSection:n}=a,i=n===void 0?null:n,l=X(),d=pt(),{org:r}=Ae(),f=$s(s);if(!f){let u;e[0]!==l?(u=l("virtualMcp.virtualMcp.spaceNotFound"),e[0]=l,e[1]=u):u=e[1];let h;e[2]!==l?(h=l("virtualMcp.virtualMcp.spaceNotFoundDescription"),e[2]=l,e[3]=h):h=e[3];let c;e[4]!==d||e[5]!==r.slug?(c=()=>d({to:"/$org",params:{org:r.slug}}),e[4]=d,e[5]=r.slug,e[6]=c):c=e[6];let x;e[7]!==l?(x=l("virtualMcp.virtualMcp.backToSpaces"),e[7]=l,e[8]=x):x=e[8];let g;e[9]!==c||e[10]!==x?(g=t.jsx(Z,{variant:"outline",onClick:c,children:x}),e[9]=c,e[10]=x,e[11]=g):g=e[11];let v;return e[12]!==u||e[13]!==h||e[14]!==g?(v=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Jn,{title:u,description:h,actions:g})}),e[12]=u,e[13]=h,e[14]=g,e[15]=v):v=e[15],v}let o;e[16]!==f?(o=As(f)?.connectionId??"",e[16]=f,e[17]=o):o=e[17];const p=`${f.id}:${o}`;let m;return e[18]!==i||e[19]!==p||e[20]!==f?(m=t.jsx(Gr,{virtualMcp:f,contextSection:i},p),e[18]=i,e[19]=p,e[20]=f,e[21]=m):m=e[21],m}export{ac as V};
@@ -1 +0,0 @@
1
- import{c as G,j as t,m as M,r as E,b as Z,D as Jt,v as Xt,w as Ps,x as es,aT as _s,I as nn,y as Ds,B as re,ak as an,bc as ts,t as xe,bq as tt,br as et,X as Et,bs as gs,Z as It,_ as Rt,b2 as Bs,aU as on,Y as ie,as as ln,bm as rn,au as Zt,am as cn}from"./index-BqA84bKQ.js";import{s as dn}from"./date-utils-CrvIKg-s.js";import{D as un,e as mn,t as As,v as xn,w as fn,F as pn,x as gn,y as hn,P as hs,z as bs,A as Ls,E as ss,G as bn,H as ns,j as ne,I as jn,J as yn,K as st,L as zs,M as vn,N as Nn,O as js,Q as Mt,R as rs,T as wn,U as Sn,a as kn}from"./category-tree-jh72wtxu.js";import{i as Kt}from"./AlertCircle-BNgT9H-9.js";import{a8 as Cn,a9 as Tn,aa as as,R as Fs,e as cs,n as Pn,ab as $s,a2 as _n,a0 as Dn,ac as Bn}from"./agent-icon-7pgGOyab.js";import{i as An}from"./CheckCircle-DGPVeuCJ.js";import{t as os}from"./ChevronUp-B9DaDvS3.js";import{i as Ln}from"./SwitchHorizontal01-C-rlzvYe.js";import{s as ls,i as zn,d as Fn}from"./UserSquare-nHYvjai8.js";import{s as $n}from"./Plus-Dxw22W7_.js";import{s as Os}from"./Trash01-CGrA2ON1.js";import{i as qt}from"./Upload01-6kkhuzxl.js";import{B as ds}from"./badge-DJzADYLN.js";import{E as On}from"./empty-state-COfoPZ3l.js";import{C as us}from"./checkbox-CQfIpQ5a.js";import{b as Es,u as En,a as In,l as Rn,c as Mn,i as Kn,p as Gn,s as Hn}from"./delete-copy-sYXKk3Pf.js";import{u as Un}from"./use-ai-providers-BQ4cXHYk.js";import{r as Vn,L as Yn,u as Is}from"./use-never-published-Ct02Nsux.js";import{L as $t}from"./label-Ducx0j9M.js";import{T as ys}from"./textarea-BC5J6m5c.js";import{u as Wn}from"./use-file-configs-Cb7TGwCU.js";import{MonacoCodeEditor as Qn}from"./monaco-editor-BKbGnxf4.js";import{T as Ze,a as qe,c as Je}from"./tooltip-TH6OTMa1.js";import{c as Zn}from"./Tool01-D4x0RZqM.js";function Ja(d){const e=G.c(6),{hasItems:s,emptyLabel:n,emptyHint:i}=d;let a;e[0]!==i||e[1]!==n||e[2]!==s?(a=s?"No results match your search.":t.jsxs(t.Fragment,{children:[t.jsx("div",{children:n}),t.jsx("div",{className:"mt-1 text-muted-foreground/80",children:i})]}),e[0]=i,e[1]=n,e[2]=s,e[3]=a):a=e[3];let r;return e[4]!==a?(r=t.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:a}),e[4]=a,e[5]=r):r=e[5],r}function Xa(d){const e=G.c(18),{icon:s,label:n,count:i,mark:a,active:r,onClick:o,indent:x,"aria-current":u}=d,c=x&&"pl-6",f=r?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent hover:text-foreground";let g;e[0]!==c||e[1]!==f?(g=M("flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-left text-sm transition-colors cursor-pointer",c,f),e[0]=c,e[1]=f,e[2]=g):g=e[2];let m;e[3]!==s?(m=t.jsx(s,{size:16,className:"shrink-0"}),e[3]=s,e[4]=m):m=e[4];let l;e[5]!==n?(l=t.jsx("span",{className:"flex-1 truncate",children:n}),e[5]=n,e[6]=l):l=e[6];let b;e[7]!==r||e[8]!==i?(b=i!==void 0&&t.jsx("span",{className:M("shrink-0 text-xs tabular-nums",r?"text-accent-foreground/70":"text-muted-foreground/70"),children:i}),e[7]=r,e[8]=i,e[9]=b):b=e[9];let y;return e[10]!==u||e[11]!==a||e[12]!==o||e[13]!==g||e[14]!==m||e[15]!==l||e[16]!==b?(y=t.jsxs("button",{type:"button",onClick:o,"aria-current":u,className:g,children:[m,l,a,b]}),e[10]=u,e[11]=a,e[12]=o,e[13]=g,e[14]=m,e[15]=l,e[16]=b,e[17]=y):y=e[17],y}function eo(d){const e=G.c(5),{icon:s,label:n}=d;let i;e[0]!==s?(i=s&&t.jsx(s,{size:13,className:"shrink-0"}),e[0]=s,e[1]=i):i=e[1];let a;return e[2]!==n||e[3]!==i?(a=t.jsxs("div",{className:"mt-3 flex items-center gap-1.5 px-2.5 pb-1 pt-1 text-xs font-medium text-muted-foreground/70",children:[i,n]}),e[2]=n,e[3]=i,e[4]=a):a=e[4],a}function to(d,e){const[s,n]=E.useState(d);return d!==null&&(d.title!==s?.title||d.description!==s?.description)&&n(d),d??(e?s:null)}function Gt(d){const e=String(d.getMonth()+1).padStart(2,"0"),s=String(d.getDate()).padStart(2,"0");return`${d.getFullYear()}-${e}-${s}`}const Rs=/^(\d{4})-(\d{2})-(\d{2})$/;function Ht(d){const e=d.trim();if(!e)return null;const s=Rs.exec(e);if(s){const i=Number(s[1]),a=Number(s[2])-1,r=Number(s[3]),o=new Date(i,a,r);return o.getMonth()===a&&o.getDate()===r?o:null}const n=new Date(e);return Number.isNaN(n.getTime())?null:dn(n)}function so(d,{legacyContent:e=!1}={}){const s=new Date(d.getFullYear(),d.getMonth(),d.getDate(),un);return{...mn("posts",{legacyContent:e}),status:"scheduled",scheduledDatetime:s.toISOString(),date:Gt(d)}}function qn(d){if(typeof d!="string")return null;const e=d.trim();if(!e)return null;if(Rs.test(e))return Ht(e);const s=new Date(e);return Number.isNaN(s.getTime())?null:s}function no(d,e){const s=qn(d.scheduledDatetime);if(!s)return null;const n=new Date(e.getFullYear(),e.getMonth(),e.getDate(),s.getHours(),s.getMinutes(),s.getSeconds(),s.getMilliseconds()),i={...d,scheduledDatetime:n.toISOString()};return(typeof d.date=="string"?d.date:"")===Gt(s)&&(i.date=Gt(n)),i}function Jn(d){return Ht(d.scheduledDatetime)??Ht(d.date)}function ao(d){const e=new Map,s=[];for(const i of d){const a={post:i,scheduled:Ht(i.scheduledDatetime)!==null},r=Jn(i);if(!r){s.push(a);continue}const o=Gt(r),x=e.get(o);x?x.push(a):e.set(o,[a])}const n=(i,a)=>Number(a.scheduled)-Number(i.scheduled)||i.post.title.localeCompare(a.post.title);for(const i of e.values())i.sort(n);return s.sort(n),{byDay:e,undated:s}}const Ot=[{id:"campaign",label:"sandbox.generatePost.stepCampaign"},{id:"format",label:"sandbox.generatePost.stepFormat"},{id:"extra",label:"sandbox.generatePost.stepExtra"}],Xn=[1,2,3],ea={companyName:"sandbox.blogBrand.companyNameLabel",language:"sandbox.blogBrand.languageLabel",description:"sandbox.blogBrand.descriptionLabel",tone:"sandbox.blogBrand.toneLabel",targetAudience:"sandbox.blogBrand.audienceLabel",dos:"sandbox.blogBrand.tabDos",avoid:"sandbox.blogBrand.tabGuardrails"};function ta({open:d,onOpenChange:e,decofile:s,hasAi:n,onGenerate:i}){const a=Z(),r=Wn(),[o,x]=E.useState("campaign"),[u,c]=E.useState(""),[f,g]=E.useState(""),[m,l]=E.useState(""),[b,y]=E.useState(""),[N,w]=E.useState(1),{merged:T}=As(s),S=xn(T),C=fn(s).filter(j=>j.status!=="finished"),_=C.find(j=>j.key===u),P=s[pn],h=gn(hn(P?.formats)),k=()=>{x("campaign"),c(""),g(""),l(""),y(""),w(1)},B=j=>{e(j),j||k()},A=Ot.findIndex(j=>j.id===o),F=o==="campaign"?!!_:o==="format"?f.trim().length>0&&m.trim().length>0:!0,D=o==="extra",L=()=>{_&&(i({campaign:_,format:{name:f.trim(),value:m.trim()},extraInstructions:b.trim()||void 0,count:N,fileConfigId:Vn(r.data?.configs??[],null,typeof window<"u"?window.localStorage.getItem(Yn):null)??void 0}),B(!1))};return t.jsx(Jt,{open:d,onOpenChange:B,children:t.jsxs(Xt,{className:"flex max-h-[85vh] flex-col sm:max-w-2xl",children:[t.jsxs(Ps,{children:[t.jsx(es,{children:a("sandbox.generatePost.title")}),t.jsx(_s,{children:a("sandbox.generatePost.subtitle")})]}),S.length>0?t.jsx("p",{className:"text-sm text-muted-foreground",children:a("sandbox.generatePost.blockedBrand",{fields:S.map(j=>a(ea[j])).join(", ")})}):t.jsxs(t.Fragment,{children:[t.jsx("ol",{className:"flex shrink-0 items-center gap-1.5 text-xs",children:Ot.map((j,z)=>t.jsx("li",{className:M("rounded-md px-2 py-1",z===A?"bg-primary text-primary-foreground":z<A?"text-foreground":"text-muted-foreground"),children:a(j.label)},j.id))}),t.jsxs("div",{className:"min-h-0 flex-1 space-y-4 overflow-y-auto py-1",children:[o==="campaign"&&t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"text-xs text-muted-foreground",children:a("sandbox.generatePost.campaignHint")}),C.length===0?t.jsx("p",{className:"rounded-lg border border-dashed px-3 py-6 text-center text-sm text-muted-foreground",children:a("sandbox.generatePost.noCampaigns")}):t.jsx(sa,{campaigns:C,chosen:u,onChoose:c})]}),o==="format"&&t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"text-xs text-muted-foreground",children:a("sandbox.generatePost.formatHint")}),t.jsx(hs,{options:h.map(j=>j.name),value:f,onChange:j=>{g(j),l(h.find(z=>z.name===j)?.value??"")}}),t.jsxs("div",{className:"space-y-2",children:[t.jsx($t,{htmlFor:"generate-format-name",children:a("sandbox.generatePost.formatNameLabel")}),t.jsx(nn,{id:"generate-format-name",value:f,onChange:j=>g(j.target.value),placeholder:a("sandbox.generatePost.formatNamePlaceholder")})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx($t,{htmlFor:"generate-format-value",children:a("sandbox.generatePost.formatValueLabel")}),t.jsx(ys,{id:"generate-format-value",value:m,onChange:j=>l(j.target.value),placeholder:a("sandbox.generatePost.formatValuePlaceholder"),rows:4})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:a("sandbox.generatePost.formatBlocksHint")})]}),o==="extra"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx($t,{htmlFor:"generate-extra",children:a("sandbox.generatePost.extraLabel")}),t.jsx(ys,{id:"generate-extra",value:b,onChange:j=>y(j.target.value),placeholder:a("sandbox.generatePost.extraPlaceholder"),rows:4})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx($t,{children:a("sandbox.generatePost.countLabel")}),t.jsx(hs,{options:Xn.map(String),value:String(N),onChange:j=>w(Number(j)||1)}),t.jsx("p",{className:"text-xs text-muted-foreground",children:a("sandbox.generatePost.countHint")})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:a("sandbox.generatePost.coverHint")})]})]}),t.jsxs(Ds,{className:"shrink-0 sm:justify-between",children:[t.jsx(re,{type:"button",variant:"outline",disabled:A===0,onClick:()=>x(Ot[A-1].id),children:a("sandbox.generatePost.back")}),D?t.jsxs(re,{type:"button",disabled:!n,onClick:L,children:[t.jsx(ls,{size:14}),a("sandbox.generatePost.generate",{count:String(N)})]}):t.jsx(re,{type:"button",disabled:!F,onClick:()=>x(Ot[A+1].id),children:a("sandbox.generatePost.next")})]})]})]})})}function sa(d){const e=G.c(11),{campaigns:s,chosen:n,onChoose:i}=d,a=Z();let r;if(e[0]!==s||e[1]!==n||e[2]!==i||e[3]!==a){let x;e[5]!==n||e[6]!==i||e[7]!==a?(x=u=>t.jsx("li",{children:t.jsxs("button",{type:"button",onClick:()=>i(u.key),className:M("w-full cursor-pointer rounded-lg border bg-card p-2.5 text-left transition-colors hover:border-primary/40",n===u.key&&"border-primary"),children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("p",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:u.name||a("sandbox.campaigns.untitled")}),t.jsx(ds,{variant:"outline",size:"sm",className:"shrink-0",children:u.intent.products.length>0?a("sandbox.generatePost.campaignProducts",{count:String(u.intent.products.length)}):a("sandbox.generatePost.campaignNoProducts")})]}),u.trigger.note&&t.jsx("p",{className:"line-clamp-2 text-xs text-muted-foreground",children:u.trigger.note})]})},u.key),e[5]=n,e[6]=i,e[7]=a,e[8]=x):x=e[8],r=s.map(x),e[0]=s,e[1]=n,e[2]=i,e[3]=a,e[4]=r}else r=e[4];let o;return e[9]!==r?(o=t.jsx("ul",{className:"space-y-1.5",children:r}),e[9]=r,e[10]=o):o=e[10],o}function na(d){const e=[];for(let s=0;e.length<js;s+=1){const n=e.length;for(const i of d){const a=i.images?.[s];if(a&&(e.push(a),e.length>=js))return e}if(e.length===n)break}return e}const aa={"no-store-data":"sandbox.generatePost.gapNoStoreData","sections-dropped":"sandbox.generatePost.gapSectionsDropped","no-bucket":"sandbox.generatePost.gapNoBucket","no-image-model":"sandbox.generatePost.gapNoImageModel","images-failed":"sandbox.generatePost.gapImagesFailed","drafts-failed":"sandbox.generatePost.gapDraftsFailed"};function oa({orgSlug:d,virtualMcpId:e,branch:s,decofile:n,meta:i,onStarted:a}){const r=Z(),o=an(),x=Es(),u=Is({orgSlug:d,virtualMcpId:e,branch:s});return async c=>{const f={campaignKey:c.campaign.key,format:c.format,brief:c.campaign.trigger.note},g=bs(Ls({title:c.campaign.name,planning:f,now:new Date}),"generating",new Date),m=Array.from({length:c.count},()=>ts(ss())),{merged:l}=As(n),b=bn(l),y=ns(n,"categories").map(({payload:h})=>({name:ne(h.name),slug:ne(h.slug)})).filter(h=>h.slug),N=jn(n),w=yn(c.format,i,n,{hideDefaults:x}),T=Object.fromEntries(w.map(h=>[h.name,h.example])),S=async(h,k=m.length)=>{for(const B of m.slice(h,k))try{await u.mutateAsync({blockKey:B,data:st(B,bs(g,"draft",new Date))})}catch(A){console.warn("[generatePost] could not reset a card",A)}},C=async(h,k)=>{if(!k.fileConfigId||h.length===0)return new Map;try{const B=await o.call("BLOG_POST_ILLUSTRATE",{requests:h.map((A,F)=>({id:String(F),prompt:A.cover.prompt,alt:A.cover.alt})),productImages:na(k.campaign.intent.products),companyName:b.companyName??"",fileConfigId:k.fileConfigId});return new Map(B.images.map(A=>[A.id,A.url]))}catch(B){return console.warn("[generatePost] illustrating failed",B),new Map}};let _=0;try{for(const h of m)await u.mutateAsync({blockKey:h,data:st(h,g)}),_+=1}catch(h){await S(0,_),xe.error(h instanceof Error?h.message:r("sandbox.generatePost.failed"));return}a?.(m);let P=0;try{const h=await o.call("BLOG_SITE_GROUND",{virtualMcpId:e,purpose:"post",focus:`${c.campaign.name}: ${c.campaign.trigger.note}`,language:b.language}).catch(D=>{console.warn("[generatePost] grounding failed",D)}),k=await o.call("BLOG_POST_DRAFT",{virtualMcpId:e,grounding:h?{report:h.report,outcome:h.outcome}:void 0,brand:{companyName:b.companyName,description:b.description,language:b.language,storeUrl:b.storeUrl,targetAudience:b.targetAudience,tone:b.tone,dos:b.dos,avoid:b.avoid,vocabulary:b.vocabulary,voiceExamples:b.voiceExamples},campaign:{name:c.campaign.name,period:c.campaign.period,trigger:c.campaign.trigger,intent:{objective:c.campaign.intent.objective,targets:c.campaign.intent.targets,products:c.campaign.intent.products,keywords:c.campaign.intent.keywords},guardrails:c.campaign.guardrails},format:c.format,blocks:w,categories:y,authors:N.map(({name:D,email:L})=>({name:D,email:L})),extraInstructions:c.extraInstructions?.trim()||void 0,count:c.count}),B=await C(k.posts,c),A=zs(i,{hideDefaults:x}),F=vn(n).map(D=>D.slug);for(const[D,L]of k.posts.entries()){const j=m[D];if(!j)break;const z=Nn({draft:{...L,cover:{...L.cover,url:B.get(String(D))??""}},resolveTypes:A,productShapes:T,categories:y,authors:N,planning:f,takenSlugs:F,now:new Date});F.push(ne(z.slug)),await u.mutateAsync({blockKey:j,data:st(j,z)}),P=D+1}await S(P),k.posts.length>0&&xe.success(r("sandbox.generatePost.done",{count:String(k.posts.length)}));for(const D of k.gaps)xe.warning(r(aa[D.code],{count:D.count??0}))}catch(h){await S(P),xe.error(h instanceof Error?h.message:r("sandbox.generatePost.failed"))}}}const vs="__all__",Ns={"date-desc":"sandbox.postToolbar.sortNewestFirst","date-asc":"sandbox.postToolbar.sortOldestFirst",az:"sandbox.postToolbar.sortTitleAZ",za:"sandbox.postToolbar.sortTitleZA"},la={"date-desc":"sandbox.postToolbar.sortNewest","date-asc":"sandbox.postToolbar.sortOldest",az:"sandbox.postToolbar.sortAZ",za:"sandbox.postToolbar.sortZA"},ws="status:";function Ss(d){if(!d.startsWith(ws))return null;const e=d.slice(ws.length);return rs.includes(e)?e:null}const ks=E.forwardRef(function(e,s){const n=G.c(20);let i,a,r,o,x;n[0]!==e?({icon:i,active:a,value:x,className:r,...o}=e,n[0]=e,n[1]=i,n[2]=a,n[3]=r,n[4]=o,n[5]=x):(i=n[1],a=n[2],r=n[3],o=n[4],x=n[5]);const u=a?"text-foreground":"text-muted-foreground";let c;n[6]!==r||n[7]!==u?(c=M("gap-1 px-1.5 text-xs",u,r),n[6]=r,n[7]=u,n[8]=c):c=n[8];let f;n[9]!==i?(f=t.jsx(i,{size:14,className:"shrink-0"}),n[9]=i,n[10]=f):f=n[10];let g;n[11]!==x?(g=x&&t.jsx("span",{className:"min-w-0 flex-1 truncate",children:x}),n[11]=x,n[12]=g):g=n[12];let m;n[13]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(os,{size:12,className:"shrink-0 opacity-60"}),n[13]=m):m=n[13];let l;return n[14]!==o||n[15]!==s||n[16]!==c||n[17]!==f||n[18]!==g?(l=t.jsxs(re,{ref:s,type:"button",variant:"ghost",size:"sm",className:c,...o,children:[f,g,m]}),n[14]=o,n[15]=s,n[16]=c,n[17]=f,n[18]=g,n[19]=l):l=n[19],l});function ms(d){const e=G.c(2),{count:s}=d;let n;return e[0]!==s?(n=t.jsx("span",{className:"ml-auto pl-3 text-xs text-muted-foreground tabular-nums",children:s}),e[0]=s,e[1]=n):n=e[1],n}function ia(d){const e=G.c(19),{value:s,onChange:n}=d,i=Z();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(zn,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),e[0]=a):a=e[0];let r;e[1]!==n?(r=g=>n(g.target.value),e[1]=n,e[2]=r):r=e[2];let o;e[3]!==i?(o=i("sandbox.postToolbar.searchPlaceholder"),e[3]=i,e[4]=o):o=e[4];let x;e[5]!==i?(x=i("sandbox.postToolbar.searchAriaLabel"),e[5]=i,e[6]=x):x=e[6];let u;e[7]!==r||e[8]!==o||e[9]!==x||e[10]!==s?(u=t.jsx("input",{type:"text",value:s,onChange:r,placeholder:o,"aria-label":x,className:"min-w-0 flex-1 bg-transparent py-0.5 text-sm outline-none placeholder:text-muted-foreground"}),e[7]=r,e[8]=o,e[9]=x,e[10]=s,e[11]=u):u=e[11];let c;e[12]!==n||e[13]!==i||e[14]!==s?(c=s&&t.jsx(Ms,{label:i("sandbox.postToolbar.clearSearch"),onClick:()=>n("")}),e[12]=n,e[13]=i,e[14]=s,e[15]=c):c=e[15];let f;return e[16]!==u||e[17]!==c?(f=t.jsxs("div",{className:"flex items-center gap-2 border-b px-2.5 py-1.5",children:[a,u,c]}),e[16]=u,e[17]=c,e[18]=f):f=e[18],f}function ra(d){const e=G.c(100),{categories:s,authors:n,statusCounts:i,categoryFilter:a,authorFilter:r,statusFilter:o,sort:x,onCategoryFilterChange:u,onAuthorFilterChange:c,onStatusFilterChange:f,onSortChange:g}=d,m=Z();let l;if(e[0]!==s||e[1]!==a){let $;e[3]!==a?($=le=>le.slug===a,e[3]=a,e[4]=$):$=e[4],l=s.find($),e[0]=s,e[1]=a,e[2]=l}else l=e[2];const b=l;let y;if(e[5]!==r||e[6]!==n){let $;e[8]!==r?($=le=>le.email===r,e[8]=r,e[9]=$):$=e[9],y=n.find($),e[5]=r,e[6]=n,e[7]=y}else y=e[7];const N=y,w=!!(a||r||o);let T;e[10]!==N?.name||e[11]!==b?.name||e[12]!==o||e[13]!==m?(T=b?.name??N?.name??m(o?Mt[o]:"sandbox.postToolbar.filterLabel"),e[10]=N?.name,e[11]=b?.name,e[12]=o,e[13]=m,e[14]=T):T=e[14];const S=T,C=a?`cat:${a}`:r?`author:${r}`:o?`status:${o}`:vs;let _;e[15]!==c||e[16]!==u||e[17]!==f?(_=()=>{u(null),c(null),f(null)},e[15]=c,e[16]=u,e[17]=f,e[18]=_):_=e[18];const P=_;let h;e[19]!==P||e[20]!==c||e[21]!==u||e[22]!==f?(h=$=>{$.startsWith("cat:")?(c(null),f(null),u($.slice(4))):$.startsWith("author:")?(u(null),f(null),c($.slice(7))):Ss($)?(u(null),c(null),f(Ss($))):P()},e[19]=P,e[20]=c,e[21]=u,e[22]=f,e[23]=h):h=e[23];const k=h;let B;e[24]!==S||e[25]!==w?(B=t.jsx(Et,{asChild:!0,children:t.jsx(ks,{icon:Cn,active:w,value:S,className:"min-w-0 shrink"})}),e[24]=S,e[25]=w,e[26]=B):B=e[26];let A;e[27]!==m?(A=m("sandbox.postToolbar.filterBy"),e[27]=m,e[28]=A):A=e[28];let F;e[29]!==A?(F=t.jsx(et,{children:A}),e[29]=A,e[30]=F):F=e[30];let D;e[31]!==m?(D=m("sandbox.postToolbar.allPosts"),e[31]=m,e[32]=D):D=e[32];let L;e[33]!==D?(L=t.jsx(tt,{value:vs,children:D}),e[33]=D,e[34]=L):L=e[34];let j;e[35]!==m?(j=m("sandbox.postToolbar.statusLabel"),e[35]=m,e[36]=j):j=e[36];let z;e[37]!==j?(z=t.jsx(et,{className:"text-muted-foreground/70",children:j}),e[37]=j,e[38]=z):z=e[38];let O;e[39]!==i||e[40]!==m?(O=rs.map($=>t.jsxs(tt,{value:`status:${$}`,children:[t.jsx("span",{className:"min-w-0 flex-1 truncate",children:m(Mt[$])}),t.jsx(ms,{count:i[$]??0})]},`status:${$}`)),e[39]=i,e[40]=m,e[41]=O):O=e[41];let I;e[42]!==s.length||e[43]!==m?(I=s.length>0&&t.jsx(et,{className:"text-muted-foreground/70",children:m("sandbox.postToolbar.categoryLabel")}),e[42]=s.length,e[43]=m,e[44]=I):I=e[44];let V;e[45]!==s?(V=s.map(da),e[45]=s,e[46]=V):V=e[46];let H;e[47]!==n.length||e[48]!==m?(H=n.length>0&&t.jsx(et,{className:"text-muted-foreground/70",children:m("sandbox.postToolbar.authorLabel")}),e[47]=n.length,e[48]=m,e[49]=H):H=e[49];let Y;e[50]!==n?(Y=n.map(ca),e[50]=n,e[51]=Y):Y=e[51];let U;e[52]!==C||e[53]!==k||e[54]!==L||e[55]!==z||e[56]!==O||e[57]!==I||e[58]!==V||e[59]!==H||e[60]!==Y?(U=t.jsxs(gs,{value:C,onValueChange:k,children:[L,z,O,I,V,H,Y]}),e[52]=C,e[53]=k,e[54]=L,e[55]=z,e[56]=O,e[57]=I,e[58]=V,e[59]=H,e[60]=Y,e[61]=U):U=e[61];let Q;e[62]!==U||e[63]!==F?(Q=t.jsxs(It,{align:"start",className:"max-h-96 w-60 overflow-y-auto",children:[F,U]}),e[62]=U,e[63]=F,e[64]=Q):Q=e[64];let q;e[65]!==Q||e[66]!==B?(q=t.jsxs(Rt,{children:[B,Q]}),e[65]=Q,e[66]=B,e[67]=q):q=e[67];let ee;e[68]!==P||e[69]!==w||e[70]!==m?(ee=w&&t.jsx(Ms,{label:m("sandbox.postToolbar.clearFilter"),onClick:P}),e[68]=P,e[69]=w,e[70]=m,e[71]=ee):ee=e[71];const fe=la[x];let W;e[72]!==m||e[73]!==fe?(W=m(fe),e[72]=m,e[73]=fe,e[74]=W):W=e[74];let te;e[75]!==W?(te=t.jsx(Et,{asChild:!0,children:t.jsx(ks,{icon:Tn,active:!0,value:W})}),e[75]=W,e[76]=te):te=e[76];let ce;e[77]!==m?(ce=m("sandbox.postToolbar.sortBy"),e[77]=m,e[78]=ce):ce=e[78];let ae;e[79]!==ce?(ae=t.jsx(et,{children:ce}),e[79]=ce,e[80]=ae):ae=e[80];let se;e[81]!==g?(se=$=>g($),e[81]=g,e[82]=se):se=e[82];let pe;e[83]===Symbol.for("react.memo_cache_sentinel")?(pe=Object.keys(Ns),e[83]=pe):pe=e[83];let J;e[84]!==m?(J=pe.map($=>t.jsx(tt,{value:$,children:m(Ns[$])},$)),e[84]=m,e[85]=J):J=e[85];let de;e[86]!==x||e[87]!==se||e[88]!==J?(de=t.jsx(gs,{value:x,onValueChange:se,children:J}),e[86]=x,e[87]=se,e[88]=J,e[89]=de):de=e[89];let X;e[90]!==ae||e[91]!==de?(X=t.jsxs(It,{align:"end",className:"w-44",children:[ae,de]}),e[90]=ae,e[91]=de,e[92]=X):X=e[92];let ue;e[93]!==te||e[94]!==X?(ue=t.jsx("div",{className:"ml-auto shrink-0",children:t.jsxs(Rt,{children:[te,X]})}),e[93]=te,e[94]=X,e[95]=ue):ue=e[95];let oe;return e[96]!==q||e[97]!==ee||e[98]!==ue?(oe=t.jsxs("div",{className:"flex min-w-0 items-center gap-1 overflow-hidden border-b px-2 py-1.5",children:[q,ee,ue]}),e[96]=q,e[97]=ee,e[98]=ue,e[99]=oe):oe=e[99],oe}function ca(d){return t.jsxs(tt,{value:`author:${d.email}`,children:[t.jsx("span",{className:"min-w-0 flex-1 truncate",children:d.name}),t.jsx(ms,{count:d.count})]},`author:${d.email}`)}function da(d){return t.jsxs(tt,{value:`cat:${d.slug}`,children:[t.jsx("span",{className:"min-w-0 flex-1 truncate",children:d.name}),t.jsx(ms,{count:d.count})]},`cat:${d.slug}`)}function Ms(d){const e=G.c(4),{label:s,onClick:n}=d;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Bs,{size:12}),e[0]=i):i=e[0];let a;return e[1]!==s||e[2]!==n?(a=t.jsx("button",{type:"button","aria-label":s,onClick:n,className:"flex h-6 w-6 shrink-0 items-center justify-center text-muted-foreground transition-colors hover:bg-accent hover:text-foreground cursor-pointer rounded-lg",children:i}),e[1]=s,e[2]=n,e[3]=a):a=e[3],a}function ua(d){const e=G.c(18),{checked:s,disabled:n,onToggle:i}=d,a=Z();let r;e[0]!==i?(r=()=>i(),e[0]=i,e[1]=r):r=e[1];let o;e[2]!==s||e[3]!==a?(o=a(s?"sandbox.postToolbar.deselectAllPosts":"sandbox.postToolbar.selectAllPosts"),e[2]=s,e[3]=a,e[4]=o):o=e[4];let x;e[5]!==s||e[6]!==n||e[7]!==r||e[8]!==o?(x=t.jsx(Ze,{asChild:!0,children:t.jsx("span",{className:"flex shrink-0 items-center px-1.5",onClick:ma,children:t.jsx(us,{checked:s,disabled:n,onCheckedChange:r,"aria-label":o})})}),e[5]=s,e[6]=n,e[7]=r,e[8]=o,e[9]=x):x=e[9];let u;e[10]!==s||e[11]!==a?(u=a(s?"sandbox.postToolbar.deselectAll":"sandbox.postToolbar.selectAll"),e[10]=s,e[11]=a,e[12]=u):u=e[12];let c;e[13]!==u?(c=t.jsx(qe,{side:"bottom",children:u}),e[13]=u,e[14]=c):c=e[14];let f;return e[15]!==x||e[16]!==c?(f=t.jsxs(Je,{children:[x,c]}),e[15]=x,e[16]=c,e[17]=f):f=e[17],f}function ma(d){return d.stopPropagation()}function xa(d){const e=G.c(42),{count:s,allSelected:n,onToggleSelectAll:i,onArchive:a,onExit:r}=d,o=Z();let x;e[0]!==n||e[1]!==i?(x=t.jsx(ua,{checked:n,onToggle:i}),e[0]=n,e[1]=i,e[2]=x):x=e[2];let u;e[3]!==s||e[4]!==o?(u=o("sandbox.postToolbar.itemsSelected",{count:s}),e[3]=s,e[4]=o,e[5]=u):u=e[5];let c;e[6]!==u?(c=t.jsx("span",{className:"text-xs font-medium tabular-nums",children:u}),e[6]=u,e[7]=c):c=e[7];const f=s===0;let g;e[8]!==o?(g=o("sandbox.postToolbar.archiveSelectedPosts"),e[8]=o,e[9]=g):g=e[9];let m;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(on,{size:14}),e[10]=m):m=e[10];let l;e[11]!==a||e[12]!==f||e[13]!==g?(l=t.jsx(Ze,{asChild:!0,children:t.jsx(re,{type:"button",variant:"ghost",size:"icon-sm",disabled:f,onClick:a,"aria-label":g,children:m})}),e[11]=a,e[12]=f,e[13]=g,e[14]=l):l=e[14];let b;e[15]!==o?(b=o("sandbox.postToolbar.archiveSelected"),e[15]=o,e[16]=b):b=e[16];let y;e[17]!==b?(y=t.jsx(qe,{side:"bottom",children:b}),e[17]=b,e[18]=y):y=e[18];let N;e[19]!==l||e[20]!==y?(N=t.jsxs(Je,{children:[l,y]}),e[19]=l,e[20]=y,e[21]=N):N=e[21];let w;e[22]!==o?(w=o("sandbox.postToolbar.exitSelection"),e[22]=o,e[23]=w):w=e[23];let T;e[24]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(Bs,{size:14}),e[24]=T):T=e[24];let S;e[25]!==r||e[26]!==w?(S=t.jsx(Ze,{asChild:!0,children:t.jsx(re,{type:"button",variant:"ghost",size:"icon-sm",onClick:r,"aria-label":w,children:T})}),e[25]=r,e[26]=w,e[27]=S):S=e[27];let C;e[28]!==o?(C=o("sandbox.postToolbar.exitSelection"),e[28]=o,e[29]=C):C=e[29];let _;e[30]!==C?(_=t.jsx(qe,{side:"bottom",children:C}),e[30]=C,e[31]=_):_=e[31];let P;e[32]!==S||e[33]!==_?(P=t.jsxs(Je,{children:[S,_]}),e[32]=S,e[33]=_,e[34]=P):P=e[34];let h;e[35]!==N||e[36]!==P?(h=t.jsxs("div",{className:"ml-auto flex items-center gap-0.5",children:[N,P]}),e[35]=N,e[36]=P,e[37]=h):h=e[37];let k;return e[38]!==x||e[39]!==h||e[40]!==c?(k=t.jsxs("div",{className:"flex items-center gap-0.5 border-b bg-accent/40 px-2 py-1.5",children:[x,c,h]}),e[38]=x,e[39]=h,e[40]=c,e[41]=k):k=e[41],k}const fa={draft:"outline",generating:"secondary",awaiting_review:"warning",scheduled:"secondary",published:"success",archived:"outline"},is="generating",pa=[is,...rs.filter(d=>d!==is)],Cs=d=>d.scheduledDatetime||d.date||"",ga=(d,e)=>Cs(e).localeCompare(Cs(d)),ha=d=>d==="scheduled"||d==="published",Ks="application/x-post-key";function oo(d){const e=G.c(170),{orgSlug:s,virtualMcpId:n,branch:i,decofile:a,view:r,selectedKey:o,onViewChange:x,onOpen:u,onClose:c,move:f,meta:g,renderDetail:m}=d,l=Z();let b;e[0]!==i||e[1]!==s||e[2]!==n?(b={orgSlug:s,virtualMcpId:n,branch:i},e[0]=i,e[1]=s,e[2]=n,e[3]=b):b=e[3];const y=Is(b),N=Un().length>0,w=En(),T=Es(),S=In(n),C=w&&!S,[_,P]=E.useState(null),[h,k]=E.useState(!1),[B,A]=E.useState(!1),[F,D]=E.useState(!1),[L,j]=E.useState(""),z=E.useRef(null);let O;e[4]===Symbol.for("react.memo_cache_sentinel")?(O={},e[4]=O):O=e[4];const[I,V]=E.useState(O);let H;e[5]!==I?(H=(p,v)=>I[p]??v,e[5]=I,e[6]=H):H=e[6];const Y=H;let U;e[7]===Symbol.for("react.memo_cache_sentinel")?(U=(p,v)=>V(R=>({...R,[p]:v})),e[7]=U):U=e[7];const Q=U;let q;e[8]!==u?(q=p=>{const v=p[0];v&&u(v)},e[8]=u,e[9]=q):q=e[9];let ee;e[10]!==i||e[11]!==a||e[12]!==g||e[13]!==s||e[14]!==q||e[15]!==n?(ee={orgSlug:s,virtualMcpId:n,branch:i,decofile:a,meta:g,onStarted:q},e[10]=i,e[11]=a,e[12]=g,e[13]=s,e[14]=q,e[15]=n,e[16]=ee):ee=e[16];const fe=oa(ee),W=wn(a);let te;e[17]!==a?(te=p=>kn(a[p],"posts"),e[17]=a,e[18]=te):te=e[18];const ce=te,ae=o&&W.some(p=>p.key===o)?o:W[0]?.key??null;let se;e[19]!==f||e[20]!==l?(se=async p=>{await f.apply(p.key,"archived")&&xe.success(l("sandbox.postBoard.archived"))},e[19]=f,e[20]=l,e[21]=se):se=e[21];const pe=se,[J,de]=E.useState(null),[X,ue]=E.useState(null),[oe,$]=E.useState(null),[le,Hs]=E.useState("date-desc"),[xs,Us]=E.useState("");let nt;e[22]===Symbol.for("react.memo_cache_sentinel")?(nt=new Set,e[22]=nt):nt=e[22];const[ge,at]=E.useState(nt),Vs=W.reduce(Na,{}),fs=p=>{const v=new Map;for(const R of W)for(const me of p(R))v.set(me,(v.get(me)??0)+1);return v},Ys=fs(va),Ws=fs(ya),Qs=ns(a,"categories").map(p=>{const{payload:v}=p;return{slug:ne(v.slug),name:ne(v.name)||ne(v.slug),count:Ys.get(ne(v.slug))??0}}),Zs=ns(a,"authors").map(p=>{const{payload:v}=p;return{email:ne(v.email),name:ne(v.name)||ne(v.email),count:Ws.get(ne(v.email))??0}}),Ut=xs.trim().toLowerCase();let ot;e[23]!==J?(ot=p=>!J||p.categorySlugs.includes(J),e[23]=J,e[24]=ot):ot=e[24];let lt;e[25]!==X?(lt=p=>!X||p.authorEmails.includes(X),e[25]=X,e[26]=lt):lt=e[26];let it;e[27]!==oe?(it=p=>!oe||p.status===oe,e[27]=oe,e[28]=it):it=e[28];let rt;e[29]!==le?(rt=(p,v)=>{if(le==="az")return p.title.localeCompare(v.title);if(le==="za")return v.title.localeCompare(p.title);const R=(p.scheduledDatetime||p.date).localeCompare(v.scheduledDatetime||v.date);return le==="date-asc"?R:-R},e[29]=le,e[30]=rt):rt=e[30];const Xe=W.filter(ot).filter(lt).filter(it).filter(p=>!Ut||p.title.toLowerCase().includes(Ut)||p.slug.toLowerCase().includes(Ut)).sort(rt),ps=ge.size>0;let ct;e[31]===Symbol.for("react.memo_cache_sentinel")?(ct=p=>at(v=>{const R=new Set(v);return R.delete(p)||R.add(p),R}),e[31]=ct):ct=e[31];const qs=ct,Js=()=>at(p=>Xe.every(v=>p.has(v.key))?new Set:new Set(Xe.map(ja)));let dt;e[32]!==f||e[33]!==ge||e[34]!==l?(dt=async()=>{let p=0;for(const v of ge)await f.apply(v,"archived")&&(p=p+1);at(new Set),p>0&&xe.success(l("sandbox.postBoard.archived"))},e[32]=f,e[33]=ge,e[34]=l,e[35]=dt):dt=e[35];const Xs=dt;let ut;e[36]!==f?(ut=(p,v)=>{P(null),f.apply(v,p)},e[36]=f,e[37]=ut):ut=e[37];const en=ut;let mt;e[38]!==S||e[39]!==u||e[40]!==y?(mt=()=>{const p=ts(ss()),v=Ls({title:"",now:new Date,legacyContent:S});y.mutate({blockKey:p,data:st(p,v)}),u(p)},e[38]=S,e[39]=u,e[40]=y,e[41]=mt):mt=e[41];const xt=mt;let ft;e[42]!==T||e[43]!==S||e[44]!==g?(ft=p=>{if(S){const{title:me,content:K}=Kn(p);return K||me.trim()?{title:me,body:{content:K}}:null}const v=Gn(p),R=Hn(v.sections,zs(g,{hideDefaults:T}));return R.length>0||v.title.trim()?{title:v.title,body:{sections:R}}:null},e[42]=T,e[43]=S,e[44]=g,e[45]=ft):ft=e[45];const tn=ft,sn=()=>{const p=tn(L);if(!p){xe.error(l("sandbox.postBoard.importEmpty"));return}const v=ts(ss()),R=Mn({...p,takenSlugs:W.map(ba).filter(Boolean),now:new Date});y.mutate({blockKey:v,data:st(v,R)}),D(!1),j(""),xe.success(l("sandbox.postBoard.imported")),u(v)},Vt=r==="list";let he;e[46]!==x?(he=()=>x("list"),e[46]=x,e[47]=he):he=e[47];let pt;e[48]===Symbol.for("react.memo_cache_sentinel")?(pt=t.jsx(Ln,{size:14}),e[48]=pt):pt=e[48];let be;e[49]!==l?(be=l("sandbox.postBoard.viewList"),e[49]=l,e[50]=be):be=e[50];let je;e[51]!==Vt||e[52]!==he||e[53]!==be?(je=t.jsx(Ts,{active:Vt,onClick:he,icon:pt,label:be}),e[51]=Vt,e[52]=he,e[53]=be,e[54]=je):je=e[54];const Yt=r==="board";let ye;e[55]!==x?(ye=()=>x("board"),e[55]=x,e[56]=ye):ye=e[56];let gt;e[57]===Symbol.for("react.memo_cache_sentinel")?(gt=t.jsx(Pn,{size:14}),e[57]=gt):gt=e[57];let ve;e[58]!==l?(ve=l("sandbox.postBoard.viewBoard"),e[58]=l,e[59]=ve):ve=e[59];let Ne;e[60]!==Yt||e[61]!==ye||e[62]!==ve?(Ne=t.jsx(Ts,{active:Yt,onClick:ye,icon:gt,label:ve}),e[60]=Yt,e[61]=ye,e[62]=ve,e[63]=Ne):Ne=e[63];let ht;e[64]!==je||e[65]!==Ne?(ht=t.jsx("div",{className:"flex items-center gap-3",children:t.jsxs("div",{className:"flex items-center gap-0.5 rounded-lg border p-0.5",children:[je,Ne]})}),e[64]=je,e[65]=Ne,e[66]=ht):ht=e[66];let bt;e[67]===Symbol.for("react.memo_cache_sentinel")?(bt=t.jsx($n,{size:14}),e[67]=bt):bt=e[67];let we;e[68]!==l?(we=l("sandbox.postBoard.newPost"),e[68]=l,e[69]=we):we=e[69];let jt;e[70]===Symbol.for("react.memo_cache_sentinel")?(jt=t.jsx(os,{size:14}),e[70]=jt):jt=e[70];let Se;e[71]!==we?(Se=t.jsx(Et,{asChild:!0,children:t.jsxs(re,{type:"button",size:"sm",children:[bt,we,jt]})}),e[71]=we,e[72]=Se):Se=e[72];let ke;e[73]!==C||e[74]!==l?(ke=C&&t.jsxs(ie,{onClick:()=>A(!0),children:[t.jsx(ls,{size:14}),t.jsxs("div",{className:"flex flex-col",children:[t.jsx("span",{children:l("sandbox.postBoard.newPostGenerate")}),t.jsx("span",{className:"text-xs text-muted-foreground",children:l("sandbox.postBoard.newPostGenerateHint")})]})]}),e[73]=C,e[74]=l,e[75]=ke):ke=e[75];let yt;e[76]===Symbol.for("react.memo_cache_sentinel")?(yt=t.jsx(Fn,{size:14}),e[76]=yt):yt=e[76];let Ce;e[77]!==l?(Ce=l("sandbox.postBoard.newPostWrite"),e[77]=l,e[78]=Ce):Ce=e[78];let Te;e[79]!==Ce?(Te=t.jsx("span",{children:Ce}),e[79]=Ce,e[80]=Te):Te=e[80];let Pe;e[81]!==l?(Pe=l("sandbox.postBoard.newPostWriteHint"),e[81]=l,e[82]=Pe):Pe=e[82];let _e;e[83]!==Pe?(_e=t.jsx("span",{className:"text-xs text-muted-foreground",children:Pe}),e[83]=Pe,e[84]=_e):_e=e[84];let De;e[85]!==Te||e[86]!==_e?(De=t.jsxs("div",{className:"flex flex-col",children:[Te,_e]}),e[85]=Te,e[86]=_e,e[87]=De):De=e[87];let Be;e[88]!==De||e[89]!==xt?(Be=t.jsxs(ie,{onClick:xt,children:[yt,De]}),e[88]=De,e[89]=xt,e[90]=Be):Be=e[90];let vt,Nt;e[91]===Symbol.for("react.memo_cache_sentinel")?(vt=()=>D(!0),Nt=t.jsx(qt,{size:14}),e[91]=vt,e[92]=Nt):(vt=e[91],Nt=e[92]);let Ae;e[93]!==l?(Ae=l("sandbox.postBoard.importContent"),e[93]=l,e[94]=Ae):Ae=e[94];let Le;e[95]!==Ae?(Le=t.jsx("span",{children:Ae}),e[95]=Ae,e[96]=Le):Le=e[96];let ze;e[97]!==l?(ze=l("sandbox.postBoard.importContentHint"),e[97]=l,e[98]=ze):ze=e[98];let Fe;e[99]!==ze?(Fe=t.jsx("span",{className:"text-xs text-muted-foreground",children:ze}),e[99]=ze,e[100]=Fe):Fe=e[100];let $e;e[101]!==Le||e[102]!==Fe?($e=t.jsxs(ie,{onClick:vt,children:[Nt,t.jsxs("div",{className:"flex flex-col",children:[Le,Fe]})]}),e[101]=Le,e[102]=Fe,e[103]=$e):$e=e[103];let Oe;e[104]!==ke||e[105]!==Be||e[106]!==$e?(Oe=t.jsxs(It,{align:"end",className:"w-56",children:[ke,Be,$e]}),e[104]=ke,e[105]=Be,e[106]=$e,e[107]=Oe):Oe=e[107];let wt;e[108]!==Se||e[109]!==Oe?(wt=t.jsxs(Rt,{children:[Se,Oe]}),e[108]=Se,e[109]=Oe,e[110]=wt):wt=e[110];let St;e[111]!==C||e[112]!==a||e[113]!==B||e[114]!==fe||e[115]!==N?(St=C&&t.jsx(ta,{open:B,onOpenChange:A,decofile:a,hasAi:N,onGenerate:p=>{fe(p)}}),e[111]=C,e[112]=a,e[113]=B,e[114]=fe,e[115]=N,e[116]=St):St=e[116];let Ee;e[117]!==l?(Ee=l("sandbox.postBoard.importTitle"),e[117]=l,e[118]=Ee):Ee=e[118];let Ie;e[119]!==Ee?(Ie=t.jsx(es,{children:Ee}),e[119]=Ee,e[120]=Ie):Ie=e[120];let Re;e[121]!==l?(Re=l("sandbox.postBoard.importDescription"),e[121]=l,e[122]=Re):Re=e[122];let Me;e[123]!==Re?(Me=t.jsx(_s,{children:Re}),e[123]=Re,e[124]=Me):Me=e[124];let kt;e[125]!==Ie||e[126]!==Me?(kt=t.jsxs(Ps,{children:[Ie,Me]}),e[125]=Ie,e[126]=Me,e[127]=kt):kt=e[127];const Wt=Rn(L)?"html":"markdown";let Ct;e[128]===Symbol.for("react.memo_cache_sentinel")?(Ct=p=>j(p??""),e[128]=Ct):Ct=e[128];let Ke;e[129]!==L||e[130]!==Wt?(Ke=t.jsx("div",{className:"h-72 overflow-hidden rounded-[var(--studio-control-radius,var(--radius-xl))] border bg-[var(--studio-input-background)]",children:t.jsx(Qn,{code:L,language:Wt,height:"100%",autoFocus:!0,onChange:Ct})}),e[129]=L,e[130]=Wt,e[131]=Ke):Ke=e[131];let Tt;e[132]===Symbol.for("react.memo_cache_sentinel")?(Tt=t.jsx("input",{ref:z,type:"file",accept:".html,.htm,.md,.markdown,.txt",className:"hidden",onChange:async p=>{const v=p.target.files?.[0];v&&j(await v.text()),p.target.value=""}}),e[132]=Tt):Tt=e[132];let Pt,_t;e[133]===Symbol.for("react.memo_cache_sentinel")?(Pt=()=>z.current?.click(),_t=t.jsx(qt,{size:14}),e[133]=Pt,e[134]=_t):(Pt=e[133],_t=e[134]);let Ge;e[135]!==l?(Ge=l("sandbox.postBoard.importUpload"),e[135]=l,e[136]=Ge):Ge=e[136];let He;e[137]!==Ge?(He=t.jsxs(re,{type:"button",variant:"outline",size:"sm",onClick:Pt,children:[_t,Ge]}),e[137]=Ge,e[138]=He):He=e[138];let Dt;e[139]!==Ke||e[140]!==He?(Dt=t.jsxs("div",{className:"space-y-3",children:[Ke,Tt,He]}),e[139]=Ke,e[140]=He,e[141]=Dt):Dt=e[141];let Bt;e[142]!==L?(Bt=L.trim(),e[142]=L,e[143]=Bt):Bt=e[143];let At;e[144]===Symbol.for("react.memo_cache_sentinel")?(At=t.jsx(qt,{size:14}),e[144]=At):At=e[144];let Lt;e[145]!==l?(Lt=l("sandbox.postBoard.importRun"),e[145]=l,e[146]=Lt):Lt=e[146];let zt;e[147]!==h||e[148]!==c||e[149]!==m||e[150]!==o||e[151]!==r?(zt=r==="board"&&o&&h&&m&&t.jsx("div",{className:"absolute inset-0 z-30 flex flex-col bg-background",children:m(o,{expanded:!0,onToggleExpand:()=>k(!1),onClose:()=>{k(!1),c?.()}})}),e[147]=h,e[148]=c,e[149]=m,e[150]=o,e[151]=r,e[152]=zt):zt=e[152];const Qt=r==="board"&&!!o&&!h;let Ue;e[153]!==c?(Ue=p=>{p||(k(!1),c?.())},e[153]=c,e[154]=Ue):Ue=e[154];let Ve;e[155]!==l?(Ve=l("sandbox.collectionsSidebar.posts"),e[155]=l,e[156]=Ve):Ve=e[156];let Ye;e[157]!==Ve?(Ye=t.jsx(es,{className:"sr-only",children:Ve}),e[157]=Ve,e[158]=Ye):Ye=e[158];let We;e[159]!==c||e[160]!==m||e[161]!==o?(We=o&&m?t.jsx(E.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(as,{size:20,className:"animate-spin text-muted-foreground"})}),children:m(o,{expanded:!1,onToggleExpand:()=>k(!0),onClose:()=>c?.()})}):null,e[159]=c,e[160]=m,e[161]=o,e[162]=We):We=e[162];let Qe;e[163]!==Ye||e[164]!==We?(Qe=t.jsxs(Xt,{closeButtonClassName:"hidden",className:"left-auto right-4 top-4 bottom-4 flex h-auto translate-x-0 translate-y-0 flex-col gap-0 overflow-hidden p-0 sm:max-w-3xl",children:[Ye,We]}),e[163]=Ye,e[164]=We,e[165]=Qe):Qe=e[165];let Ft;return e[166]!==Qt||e[167]!==Ue||e[168]!==Qe?(Ft=t.jsx(Jt,{open:Qt,onOpenChange:Ue,children:Qe}),e[166]=Qt,e[167]=Ue,e[168]=Qe,e[169]=Ft):Ft=e[169],t.jsxs("div",{className:"relative flex h-full min-w-0 flex-col",children:[t.jsxs("div",{className:"flex shrink-0 flex-wrap items-center justify-between gap-3 border-b px-6 py-3",children:[ht,t.jsxs("div",{className:"flex items-center gap-2",children:[wt,St,t.jsx(Jt,{open:F,onOpenChange:D,children:t.jsxs(Xt,{className:"max-h-[85vh] sm:max-w-2xl",children:[kt,Dt,t.jsx(Ds,{children:t.jsxs(re,{type:"button",disabled:!Bt,onClick:sn,children:[At,Lt]})})]})})]})]}),W.length===0?t.jsx(On,{className:"flex-1",icon:t.jsx(ls,{size:22}),title:l("sandbox.postBoard.emptyTitle"),description:l("sandbox.postBoard.emptyDescription"),buttonProps:{children:l("sandbox.postBoard.newPost"),onClick:xt}}):r==="board"?t.jsx("div",{className:"flex min-h-0 flex-1 gap-3 overflow-x-auto p-4",children:pa.map(p=>{const v=l(Mt[p]),R=W.filter(K=>K.status===p);ha(p)&&R.sort(ga);const me=Y(p,R.length===0);return t.jsxs(E.Fragment,{children:[t.jsx("div",{onDragOver:K=>{K.preventDefault(),P(p)},onDragLeave:()=>P(K=>K===p?null:K),onDrop:K=>{K.preventDefault(),en(p,K.dataTransfer.getData(Ks))},className:M("flex shrink-0 flex-col rounded-xl border bg-muted/30 transition-colors",me?"w-11":"w-72",_===p&&"border-primary bg-primary/5"),children:me?t.jsxs("button",{type:"button",onClick:()=>Q(p,!1),"aria-label":l("sandbox.postBoard.expandLane",{lane:v}),"aria-expanded":!1,className:"flex min-h-0 flex-1 cursor-pointer flex-col items-center gap-2 py-2.5 text-muted-foreground hover:text-foreground",children:[t.jsx(ln,{size:14,className:"shrink-0"}),t.jsx("span",{className:"text-xs tabular-nums",children:R.length}),t.jsx("span",{className:"[writing-mode:vertical-rl] text-sm font-medium",children:v})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-2 px-3 py-2.5 text-sm font-medium",children:[t.jsxs("button",{type:"button",onClick:()=>Q(p,!0),"aria-label":l("sandbox.postBoard.collapseLane",{lane:v}),"aria-expanded":!0,className:"flex min-w-0 cursor-pointer items-center gap-1.5 text-left hover:text-muted-foreground",children:[t.jsx(os,{size:14,className:"shrink-0"}),t.jsx("span",{className:"truncate",children:v})]}),t.jsx("span",{className:"text-xs tabular-nums text-muted-foreground",children:R.length})]}),t.jsx("div",{className:"min-h-0 flex-1 space-y-2 overflow-y-auto px-2 pb-2",children:R.length===0?t.jsx("p",{className:"px-1 py-6 text-center text-xs text-muted-foreground",children:l("sandbox.postBoard.laneEmpty")}):R.map(K=>t.jsx(ka,{post:K,payload:ce(K.key),moving:f.isMoving(K.key),onOpen:()=>u(K.key),onArchive:K.status==="archived"?void 0:()=>{pe(K)}},K.key))})]})}),p===is&&t.jsx("div",{"aria-hidden":!0,className:"my-1 w-px shrink-0 self-stretch bg-border"})]},p)})}):t.jsxs("div",{className:"flex min-h-0 flex-1",children:[t.jsxs("div",{className:M("flex flex-col",m?"w-80 shrink-0 border-r":"min-w-0 flex-1"),children:[t.jsx(ia,{value:xs,onChange:Us}),ps?t.jsx(xa,{count:ge.size,allSelected:Xe.length>0&&Xe.every(p=>ge.has(p.key)),onToggleSelectAll:Js,onArchive:()=>{Xs()},onExit:()=>at(new Set)}):t.jsx(ra,{categories:Qs,authors:Zs,statusCounts:Vs,categoryFilter:J,authorFilter:X,statusFilter:oe,sort:le,onCategoryFilterChange:de,onAuthorFilterChange:ue,onStatusFilterChange:$,onSortChange:Hs}),t.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:t.jsx(wa,{posts:Xe,selectedKey:m?ae:null,selectionActive:ps,selectedKeys:ge,onToggleSelect:qs,onOpen:u,isMoving:f.isMoving,onArchive:p=>{pe(p)}})})]}),m&&t.jsx("div",{className:"min-w-0 flex-1 overflow-hidden",children:ae?t.jsx(E.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(as,{size:20,className:"animate-spin text-muted-foreground"})}),children:m(ae)}):t.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center text-sm text-muted-foreground",children:l("sandbox.postBoard.selectPrompt")})})]}),zt,Ft]})}function ba(d){return d.slug}function ja(d){return d.key}function ya(d){return d.authorEmails}function va(d){return d.categorySlugs}function Na(d,e){return d[e.status]=(d[e.status]??0)+1,d}function Ts(d){const e=G.c(7),{active:s,onClick:n,icon:i,label:a}=d,r=s?"bg-accent text-accent-foreground":"text-muted-foreground hover:text-foreground";let o;e[0]!==r?(o=M("inline-flex cursor-pointer items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",r),e[0]=r,e[1]=o):o=e[1];let x;return e[2]!==i||e[3]!==a||e[4]!==n||e[5]!==o?(x=t.jsxs("button",{type:"button",onClick:n,className:o,children:[i,a]}),e[2]=i,e[3]=a,e[4]=n,e[5]=o,e[6]=x):x=e[6],x}function wa(d){const e=G.c(23),{posts:s,selectedKey:n,selectionActive:i,selectedKeys:a,onToggleSelect:r,onOpen:o,isMoving:x,onArchive:u}=d,c=Z();if(s.length===0){let m;e[0]!==c?(m=c("sandbox.postList.noMatches"),e[0]=c,e[1]=m):m=e[1];let l;return e[2]!==m?(l=t.jsx("p",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:m}),e[2]=m,e[3]=l):l=e[3],l}let f;if(e[4]!==x||e[5]!==u||e[6]!==o||e[7]!==r||e[8]!==s||e[9]!==n||e[10]!==a||e[11]!==i){let m;e[13]!==x||e[14]!==u||e[15]!==o||e[16]!==r||e[17]!==n||e[18]!==a||e[19]!==i?(m=l=>t.jsx(Sa,{post:l,selected:l.key===n,selectionActive:i,checked:a.has(l.key),onToggleSelect:()=>r(l.key),moving:x(l.key),onOpen:()=>o(l.key),onArchive:l.status==="archived"?void 0:()=>u(l)},l.key),e[13]=x,e[14]=u,e[15]=o,e[16]=r,e[17]=n,e[18]=a,e[19]=i,e[20]=m):m=e[20],f=s.map(m),e[4]=x,e[5]=u,e[6]=o,e[7]=r,e[8]=s,e[9]=n,e[10]=a,e[11]=i,e[12]=f}else f=e[12];let g;return e[21]!==f?(g=t.jsx("ul",{className:"divide-y",children:f}),e[21]=f,e[22]=g):g=e[22],g}function Sa(d){const e=G.c(60),{post:s,selected:n,selectionActive:i,checked:a,onToggleSelect:r,moving:o,onOpen:x,onArchive:u}=d,c=Z(),f=s.status==="awaiting_review"&&s.missing.length>0,g=s.status==="scheduled"||s.status==="published",m=i||a?"opacity-100":"opacity-0 focus-within:opacity-100 group-hover/row:opacity-100";let l;e[0]!==m?(l=M("absolute left-3 top-3 z-10 transition-opacity",m),e[0]=m,e[1]=l):l=e[1];let b;e[2]!==r?(b=()=>r(),e[2]=r,e[3]=b):b=e[3];let y;e[4]!==s.title||e[5]!==c?(y=s.title||c("sandbox.postBoard.untitled"),e[4]=s.title,e[5]=c,e[6]=y):y=e[6];let N;e[7]!==a||e[8]!==b||e[9]!==y?(N=t.jsx(us,{checked:a,onCheckedChange:b,"aria-label":y}),e[7]=a,e[8]=b,e[9]=y,e[10]=N):N=e[10];let w;e[11]!==l||e[12]!==N?(w=t.jsx("span",{className:l,children:N}),e[11]=l,e[12]=N,e[13]=w):w=e[13];let T;e[14]!==o||e[15]!==u||e[16]!==i?(T=u&&!i&&t.jsx(Gs,{onArchive:u,disabled:o,className:"top-2.5"}),e[14]=o,e[15]=u,e[16]=i,e[17]=T):T=e[17];let S;e[18]!==x||e[19]!==r||e[20]!==i?(S=()=>i?r():x(),e[18]=x,e[19]=r,e[20]=i,e[21]=S):S=e[21];const C=n?"bg-accent text-accent-foreground":"bg-card hover:bg-accent";let _;e[22]!==C?(_=M("flex w-full cursor-pointer flex-col gap-1.5 py-2.5 pl-10 pr-3 text-left text-sm transition-colors",C),e[22]=C,e[23]=_):_=e[23];let P;e[24]!==s.title||e[25]!==c?(P=s.title||c("sandbox.postBoard.untitled"),e[24]=s.title,e[25]=c,e[26]=P):P=e[26];let h;e[27]!==P?(h=t.jsx("span",{className:"min-w-0 truncate pr-6 font-medium",children:P}),e[27]=P,e[28]=h):h=e[28];const k=fa[s.status],B=Mt[s.status];let A;e[29]!==c||e[30]!==B?(A=c(B),e[29]=c,e[30]=B,e[31]=A):A=e[31];let F;e[32]!==k||e[33]!==A?(F=t.jsx(ds,{variant:k,className:"shrink-0",children:A}),e[32]=k,e[33]=A,e[34]=F):F=e[34];let D;e[35]!==f||e[36]!==s.missing?(D=f&&t.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-warning",children:[t.jsx(Kt,{size:12}),s.missing.length]}),e[35]=f,e[36]=s.missing,e[37]=D):D=e[37];let L;e[38]!==s.duplicateTitle||e[39]!==c?(L=s.duplicateTitle&&t.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-warning",title:c("sandbox.postBoard.duplicateTitle"),children:[t.jsx(cs,{size:12,"aria-hidden":!0}),t.jsx("span",{className:"sr-only",children:c("sandbox.postBoard.duplicateTitle")})]}),e[38]=s.duplicateTitle,e[39]=c,e[40]=L):L=e[40];let j;e[41]!==g||e[42]!==s.date||e[43]!==s.scheduledDatetime?(j=g&&t.jsxs("span",{className:"inline-flex items-center gap-1 text-xs tabular-nums text-muted-foreground",children:[t.jsx(Fs,{size:12}),(s.scheduledDatetime||s.date||"").slice(0,10)]}),e[41]=g,e[42]=s.date,e[43]=s.scheduledDatetime,e[44]=j):j=e[44];let z;e[45]!==F||e[46]!==D||e[47]!==L||e[48]!==j?(z=t.jsxs("div",{className:"flex items-center gap-2",children:[F,D,L,j]}),e[45]=F,e[46]=D,e[47]=L,e[48]=j,e[49]=z):z=e[49];let O;e[50]!==n||e[51]!==_||e[52]!==h||e[53]!==z||e[54]!==S?(O=t.jsxs("button",{type:"button",onClick:S,"aria-current":n,className:_,children:[h,z]}),e[50]=n,e[51]=_,e[52]=h,e[53]=z,e[54]=S,e[55]=O):O=e[55];let I;return e[56]!==O||e[57]!==w||e[58]!==T?(I=t.jsxs("li",{className:"group/row relative",children:[w,T,O]}),e[56]=O,e[57]=w,e[58]=T,e[59]=I):I=e[59],I}function ka(d){const e=G.c(50),{post:s,payload:n,moving:i,onOpen:a,onArchive:r}=d,o=Z(),x=s.status!=="generating"&&!i;let u;e[0]!==n?(u=Sn(n),e[0]=n,e[1]=u):u=e[1];const c=u,f=!x&&"opacity-80";let g;e[2]!==f?(g=M("group/card relative rounded-lg bg-card shadow-edge transition-shadow hover:shadow-lift",f),e[2]=f,e[3]=g):g=e[3];let m;e[4]!==i||e[5]!==r?(m=r&&t.jsx(Gs,{onArchive:r,disabled:i,className:"top-2"}),e[4]=i,e[5]=r,e[6]=m):m=e[6];let l;e[7]!==s.key?(l=A=>A.dataTransfer.setData(Ks,s.key),e[7]=s.key,e[8]=l):l=e[8];const b=x?"cursor-grab active:cursor-grabbing":"cursor-pointer";let y;e[9]!==b?(y=M("block w-full p-3 text-left",b),e[9]=b,e[10]=y):y=e[10];let N;e[11]!==s.title||e[12]!==o?(N=s.title||o("sandbox.postBoard.untitled"),e[11]=s.title,e[12]=o,e[13]=N):N=e[13];let w;e[14]!==N?(w=t.jsx("p",{className:"line-clamp-2 pr-6 text-sm font-medium",children:N}),e[14]=N,e[15]=w):w=e[15];let T;e[16]!==c||e[17]!==s.status?(T=s.status==="draft"&&c.format?.name&&t.jsx(ds,{variant:"outline",className:"max-w-full truncate",children:c.format.name}),e[16]=c,e[17]=s.status,e[18]=T):T=e[18];let S;e[19]!==s.status||e[20]!==o?(S=s.status==="generating"&&t.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground",children:[t.jsx(as,{size:12,className:"animate-spin"}),o("sandbox.postBoard.generatingLabel")]}),e[19]=s.status,e[20]=o,e[21]=S):S=e[21];let C;e[22]!==s.missing||e[23]!==s.status||e[24]!==o?(C=s.status==="awaiting_review"&&(s.missing.length>0?t.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-warning",children:[t.jsx(Kt,{size:12}),o("sandbox.postBoard.nIssues",{count:String(s.missing.length)})]}):t.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-success",children:[t.jsx(An,{size:12}),o("sandbox.postBoard.readyToSchedule")]})),e[22]=s.missing,e[23]=s.status,e[24]=o,e[25]=C):C=e[25];let _;e[26]!==s.date||e[27]!==s.scheduledDatetime||e[28]!==s.status?(_=(s.status==="scheduled"||s.status==="published")&&t.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground",children:[t.jsx(Fs,{size:12}),(s.scheduledDatetime||s.date||"").slice(0,10)]}),e[26]=s.date,e[27]=s.scheduledDatetime,e[28]=s.status,e[29]=_):_=e[29];let P;e[30]!==s.duplicateTitle||e[31]!==o?(P=s.duplicateTitle&&t.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-warning",children:[t.jsx(cs,{size:12,"aria-hidden":!0}),o("sandbox.postBoard.duplicateTitle")]}),e[30]=s.duplicateTitle,e[31]=o,e[32]=P):P=e[32];let h;e[33]!==T||e[34]!==S||e[35]!==C||e[36]!==_||e[37]!==P?(h=t.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5",children:[T,S,C,_,P]}),e[33]=T,e[34]=S,e[35]=C,e[36]=_,e[37]=P,e[38]=h):h=e[38];let k;e[39]!==x||e[40]!==a||e[41]!==h||e[42]!==l||e[43]!==y||e[44]!==w?(k=t.jsxs("button",{type:"button",draggable:x,onDragStart:l,onClick:a,className:y,children:[w,h]}),e[39]=x,e[40]=a,e[41]=h,e[42]=l,e[43]=y,e[44]=w,e[45]=k):k=e[45];let B;return e[46]!==k||e[47]!==g||e[48]!==m?(B=t.jsxs("div",{className:g,children:[m,k]}),e[46]=k,e[47]=g,e[48]=m,e[49]=B):B=e[49],B}function Gs(d){const e=G.c(13),{label:s,onArchive:n,disabled:i,className:a}=d,r=Z();let o;e[0]!==s||e[1]!==r?(o=s??r("sandbox.postBoard.delete"),e[0]=s,e[1]=r,e[2]=o):o=e[2];const x=o;let u;e[3]!==n?(u=m=>{m.stopPropagation(),n()},e[3]=n,e[4]=u):u=e[4];let c;e[5]!==a?(c=M("absolute right-2 z-10 opacity-0 transition-opacity focus-visible:opacity-100 group-hover/card:opacity-100 group-hover/row:opacity-100",a),e[5]=a,e[6]=c):c=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(Os,{className:"size-3.25"}),e[7]=f):f=e[7];let g;return e[8]!==i||e[9]!==u||e[10]!==c||e[11]!==x?(g=t.jsx(re,{variant:"ghost-destructive",size:"icon-xs",type:"button",disabled:i,"aria-label":x,title:x,onClick:u,className:c,children:f}),e[8]=i,e[9]=u,e[10]=c,e[11]=x,e[12]=g):g=e[12],g}function lo(d){const e=G.c(54),{icon:s,logoUrl:n,title:i,subtitle:a,active:r,accent:o,variantCount:x,trailing:u,selectable:c,selectionActive:f,selected:g,invalid:m,invalidReason:l,warning:b,warningReason:y,onToggleSelect:N,onClick:w,menu:T}=d,S=Z(),C=o==="global";let _;e[0]!==s||e[1]!==r||e[2]!==C||e[3]!==n?(_=n?t.jsx("img",{src:n,alt:"",className:"size-8 shrink-0 rounded-lg object-cover bg-muted"}):t.jsx("span",{className:M("flex size-8 shrink-0 items-center justify-center rounded-lg",C?"bg-global-section/15":"bg-muted"),children:t.jsx(s,{size:16,className:M("shrink-0",!C&&(r?"text-accent-foreground":"text-muted-foreground")),style:C?{color:rn}:void 0})}),e[0]=s,e[1]=r,e[2]=C,e[3]=n,e[4]=_):_=e[4];const P=_,h=r?C?"bg-global-section/15 text-global-section-fg dark:text-global-section-fg-dark":"bg-accent text-accent-foreground":C?"hover:bg-global-section/10":"hover:bg-accent";let k;e[5]!==h?(k=M("group relative flex min-w-0 items-center rounded-md transition-colors",h),e[5]=h,e[6]=k):k=e[6];let B;e[7]!==N||e[8]!==c||e[9]!==g||e[10]!==f||e[11]!==S||e[12]!==i?(B=c&&t.jsx("span",{className:M("flex shrink-0 items-center pl-2.5 transition-opacity",g||f?"opacity-100":"opacity-0 group-hover:opacity-100 focus-within:opacity-100"),onClick:Ca,children:t.jsx(us,{checked:g,onCheckedChange:()=>N?.(),"aria-label":S("sandbox.itemRow.selectItem",{title:i})})}),e[7]=N,e[8]=c,e[9]=g,e[10]=f,e[11]=S,e[12]=i,e[13]=B):B=e[13];const A=m&&!r&&"text-destructive";let F;e[14]!==A?(F=M("block truncate text-sm font-medium",A),e[14]=A,e[15]=F):F=e[15];let D;e[16]!==F||e[17]!==i?(D=t.jsx("span",{className:F,children:i}),e[16]=F,e[17]=i,e[18]=D):D=e[18];const L=r?"text-accent-foreground/70":"text-muted-foreground";let j;e[19]!==L?(j=M("block truncate text-xs",L),e[19]=L,e[20]=j):j=e[20];let z;e[21]!==a||e[22]!==j?(z=t.jsx("span",{className:j,children:a}),e[21]=a,e[22]=j,e[23]=z):z=e[23];let O;e[24]!==z||e[25]!==D?(O=t.jsxs("span",{className:"min-w-0 flex-1",children:[D,z]}),e[24]=z,e[25]=D,e[26]=O):O=e[26];let I;e[27]!==r||e[28]!==S||e[29]!==x?(I=x!==void 0&&x>1&&t.jsxs(Je,{children:[t.jsx(Ze,{asChild:!0,children:t.jsxs("span",{className:M("flex shrink-0 items-center gap-1 text-xs font-medium",r?"text-accent-foreground/70":"text-muted-foreground"),children:[t.jsx($s,{size:14}),x]})}),t.jsx(qe,{side:"bottom",children:S("sandbox.itemRow.variantCount",{count:x})})]}),e[27]=r,e[28]=S,e[29]=x,e[30]=I):I=e[30];let V;e[31]!==b||e[32]!==y?(V=b&&t.jsxs(Je,{children:[t.jsx(Ze,{asChild:!0,children:t.jsx("span",{className:"flex shrink-0 items-center text-warning",children:t.jsx(Kt,{size:14})})}),y&&t.jsx(qe,{side:"bottom",children:y})]}),e[31]=b,e[32]=y,e[33]=V):V=e[33];let H;e[34]!==r||e[35]!==m||e[36]!==l?(H=m&&t.jsxs(Je,{children:[t.jsx(Ze,{asChild:!0,children:t.jsx("span",{className:M("flex shrink-0 items-center",r?"text-accent-foreground":"text-destructive"),children:t.jsx(Kt,{size:14})})}),l&&t.jsx(qe,{side:"bottom",children:l})]}),e[34]=r,e[35]=m,e[36]=l,e[37]=H):H=e[37];let Y;e[38]!==w||e[39]!==P||e[40]!==O||e[41]!==I||e[42]!==V||e[43]!==H||e[44]!==u?(Y=t.jsxs("button",{type:"button",onClick:w,className:"flex min-w-0 flex-1 items-center gap-2.5 rounded-lg px-2.5 py-2 text-left cursor-pointer",children:[P,O,I,V,H,u]}),e[38]=w,e[39]=P,e[40]=O,e[41]=I,e[42]=V,e[43]=H,e[44]=u,e[45]=Y):Y=e[45];let U;e[46]!==r||e[47]!==T?(U=T&&t.jsx("div",{className:M("pr-1 opacity-0 transition-opacity group-hover:opacity-100",r&&"opacity-100"),children:T}),e[46]=r,e[47]=T,e[48]=U):U=e[48];let Q;return e[49]!==Y||e[50]!==U||e[51]!==k||e[52]!==B?(Q=t.jsxs("div",{className:k,children:[B,Y,U]}),e[49]=Y,e[50]=U,e[51]=k,e[52]=B,e[53]=Q):Q=e[53],Q}function Ca(d){return d.stopPropagation()}function io(d){const e=G.c(31),{onDuplicate:s,onRename:n,onAddVariant:i,onEditSeo:a,onViewJson:r,onDiscard:o,onDelete:x}=d,u=Z();let c;e[0]!==u?(c=u("sandbox.itemActions.moreActions"),e[0]=u,e[1]=c):c=e[1];let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(cn,{size:14}),e[2]=f):f=e[2];let g;e[3]!==c?(g=t.jsx(Et,{asChild:!0,children:t.jsx("button",{type:"button","aria-label":c,className:"flex h-7 w-7 items-center justify-center rounded-lg text-muted-foreground hover:bg-background hover:text-foreground cursor-pointer",onClick:Ta,children:f})}),e[3]=c,e[4]=g):g=e[4];let m;e[5]!==n||e[6]!==u?(m=n&&t.jsxs(ie,{onClick:n,children:[t.jsx(Zn,{size:14}),u("sandbox.itemActions.rename")]}),e[5]=n,e[6]=u,e[7]=m):m=e[7];let l;e[8]!==s||e[9]!==u?(l=s&&t.jsxs(ie,{onClick:s,children:[t.jsx(cs,{size:14}),u("sandbox.itemActions.duplicate")]}),e[8]=s,e[9]=u,e[10]=l):l=e[10];let b;e[11]!==i||e[12]!==u?(b=i&&t.jsxs(t.Fragment,{children:[t.jsx(Zt,{}),t.jsxs(ie,{onClick:i,className:"cursor-pointer text-success focus:text-success",children:[t.jsx($s,{size:14}),u("sandbox.itemActions.addVariant")]})]}),e[11]=i,e[12]=u,e[13]=b):b=e[13];let y;e[14]!==a||e[15]!==r||e[16]!==u?(y=(a||r)&&t.jsxs(t.Fragment,{children:[t.jsx(Zt,{}),a&&t.jsxs(ie,{onClick:a,children:[t.jsx(_n,{size:14}),u("sandbox.itemActions.editSeo")]}),r&&t.jsxs(ie,{onClick:r,children:[t.jsx(Dn,{size:14}),u("sandbox.itemActions.viewJson")]})]}),e[14]=a,e[15]=r,e[16]=u,e[17]=y):y=e[17];let N;e[18]!==x||e[19]!==o||e[20]!==u?(N=(o||x)&&t.jsxs(t.Fragment,{children:[t.jsx(Zt,{}),o&&t.jsxs(ie,{onClick:o,children:[t.jsx(Bn,{size:14}),u("sandbox.itemActions.discardChanges")]}),x&&t.jsxs(ie,{onClick:x,className:"text-destructive focus:text-destructive",children:[t.jsx(Os,{size:14}),u("sandbox.itemActions.delete")]})]}),e[18]=x,e[19]=o,e[20]=u,e[21]=N):N=e[21];let w;e[22]!==m||e[23]!==l||e[24]!==b||e[25]!==y||e[26]!==N?(w=t.jsxs(It,{align:"end",className:"w-44",children:[m,l,b,y,N]}),e[22]=m,e[23]=l,e[24]=b,e[25]=y,e[26]=N,e[27]=w):w=e[27];let T;return e[28]!==g||e[29]!==w?(T=t.jsxs(Rt,{children:[g,w]}),e[28]=g,e[29]=w,e[30]=T):T=e[30],T}function Ta(d){return d.stopPropagation()}export{Xa as C,lo as I,Ja as L,oo as P,io as a,eo as b,Gt as d,ao as g,no as r,so as s,to as u};
@@ -1 +0,0 @@
1
- import{c as $,d as A,u as J,j as m,n as U}from"./index-BqA84bKQ.js";import{a4 as q,J as z,R as D}from"./chat-context-ChgzPsES.js";import{u as F}from"./use-mobile-BSwhKw5s.js";import{u as G,C as R}from"./index-mWjBJsbL.js";import{C as B,o as K,d as Q}from"./context-shell-DqR6-S0A.js";import{L as E}from"./preview-panel-oVdKWth1.js";import{L as V}from"./library-tab-y1C-Q300.js";import"./use-view-draft-kind-vGVmYJM5.js";import"./thread-route-TkYSs_wZ.js";import"./use-project-scope-CDU7oHZd.js";import"./repository-binding-CekCSlJ1.js";import"./use-mcp-client-d3hjTGOk.js";import"./auth-DNlWgaIH.js";import"./use-organization-settings-O_jt8YRI.js";import"./schema-CZJq0dLP.js";import"./task-board-DYqWLLmQ.js";import"./thread-intent-DWdkWFbM.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-BhRvBapO.js";import"./use-entitlements-CrqU38x1.js";import"./use-ai-providers-BQ4cXHYk.js";import"./use-decopilot-events-DjBmVlF5.js";import"./use-sidebar-collapsed-BXzuI2Yh.js";import"./use-chat-layout-state-DhWMeYGY.js";import"./agent-icon-7pgGOyab.js";import"./AlertCircle-BNgT9H-9.js";import"./Tool01-D4x0RZqM.js";import"./ArrowUp-DX0Oa8sk.js";import"./ArrowLeft-CzuIgcZK.js";import"./LinkBroken01-l43AWgbv.js";import"./BookOpen01-BDEDqARy.js";import"./Globe04-BpbOo7AZ.js";import"./CheckCircle-DGPVeuCJ.js";import"./ChevronUp-B9DaDvS3.js";import"./ChevronSelectorVertical-CI140ew9.js";import"./UserSquare-nHYvjai8.js";import"./CreditCard01-BmpzvB5e.js";import"./SwitchHorizontal01-C-rlzvYe.js";import"./Key01-Cpl2DWV2.js";import"./Minus-DyKaWISs.js";import"./Monitor01-BdFmkSiY.js";import"./Sun-vurMVi6G.js";import"./Play-BDaEp7vE.js";import"./Plus-Dxw22W7_.js";import"./SearchMd-DuFQ9UgF.js";import"./ShoppingBag01-Bf_3Yh5l.js";import"./Trash01-CGrA2ON1.js";import"./Upload01-6kkhuzxl.js";import"./Users01-e2r7hqMU.js";import"./XClose-CBDYK_AJ.js";import"./Zap-DfRMi_rk.js";import"./tooltip-TH6OTMa1.js";import"./index-BzeTLGQv.js";import"./toolbar-icon-button-utT3ySvv.js";import"./shell-layout-CMWsc7Ga.js";import"./use-deployment-admin-E8whHqZV.js";import"./admin-fetch-BhTJlAsX.js";import"./command-BBpufUKx.js";import"./index-Bx5tjmDd.js";import"./integration-icon-C9sCBDDr.js";import"./project-icon-C60MdZm4.js";import"./use-navigate-to-agent-ClknH49I.js";import"./use-debounced-value-CbRaNTJb.js";import"./new-project-dialog-BOtGKQPA.js";import"./label-Ducx0j9M.js";import"./repository-picker-UWrxu6_V.js";import"./github-icon-D3u8oGuo.js";import"./useInfiniteQuery-DAPRIetj.js";import"./infiniteQueryObserver-amUGbo-h.js";import"./collection-search-DIXRttD3.js";import"./legacy-admin-welcome-dialog-C1mvlaj8.js";import"./drawer-DyYc7c6p.js";import"./required-auth-layout-Cpnwi031.js";import"./use-org-sso-DKQA9PvY.js";import"./sheet-Cn6zqTHK.js";import"./resizable-Czy-co3c.js";import"./require-capability-C5tMOw5q.js";import"./access-gate-3uWjt152.js";import"./capability-load-error-BQYVgnjq.js";import"./sections-DIGnapH7.js";import"./textarea-BC5J6m5c.js";import"./empty-state-A6nZ3Khe.js";import"./use-ask-in-chat-D9_rhHLE.js";import"./use-org-fs-Tz3YgtJ1.js";import"./preview-content-DkAXLl1L.js";import"./icon-button-Bd1QIQSI.js";import"./file-share-button-O89-cSWp.js";import"./popover-fDNjdHxM.js";import"./file-preview-B5GYsNzx.js";import"./utils-GS2Z_6Er.js";import"./editor-Cx1cLsfT.js";import"./file-type-icon-CK3whZmM.js";import"./markdown-DTS1cwWT.js";import"./use-copy-D19rl06v.js";import"./search-input-SNpnMeEh.js";import"./use-org-repo-syncs-BzT6K1ie.js";import"./preview-dialog-N7_y9qxA.js";import"./folder-icon-B0bQ9NL4.js";import"./empty-state-COfoPZ3l.js";import"./table-GheKU3yj.js";function ze(){const t=$.c(56),_=A();let b;t[0]===Symbol.for("react.memo_cache_sentinel")?(b={strict:!1},t[0]=b):b=t[0];const{preview:e,expanded:k,section:M}=J(b);let j;t[1]!==M?(j=K(M),t[1]=M,t[2]=j):j=t[2];const l=j;let v;t[3]!==_?(v=i=>_({to:".",search:r=>({...r,...i.path!==void 0&&{path:i.path},preview:i.preview,expanded:i.expanded})}),t[3]=_,t[4]=v):v=t[4];const o=v;let y;t[5]!==o?(y=()=>o({}),t[5]=o,t[6]=y):y=t[6];const p=y,H=F(),C=G().threadOpen&&!H;if(l!=="files"){let i;t[7]!==l?(i=m.jsx(Q,{section:l}),t[7]=l,t[8]=i):i=t[8];let r;return t[9]!==l||t[10]!==i?(r=m.jsx(R.Content,{children:m.jsx(B,{section:l,children:i})}),t[9]=l,t[10]=i,t[11]=r):r=t[11],r}if(e&&(k||C)){let i,r,n,s,f;if(t[12]!==p||t[13]!==e||t[14]!==o){let T;t[20]!==e?(T=e.lastIndexOf("/"),t[20]=e,t[21]=T):T=t[21];const I=e.slice(0,Math.max(T,0));r=R.Content,i=U.Breadcrumbs,n="page",t[22]!==p?(s={onSelect:p},t[22]=p,t[23]=s):s=t[23];let L;t[24]!==o?(L=O=>({key:`folder:${O.path}`,label:O.label,onSelect:()=>o({path:O.path})}),t[24]=o,t[25]=L):L=t[25];const N=q(I,D).map(L);let u;t[26]!==e?(u=z(e),t[26]=e,t[27]=u):u=t[27];let P;t[28]!==u?(P={key:"file",label:u},t[28]=u,t[29]=P):P=t[29],f=[...N,P],t[12]=p,t[13]=e,t[14]=o,t[15]=i,t[16]=r,t[17]=n,t[18]=s,t[19]=f}else i=t[15],r=t[16],n=t[17],s=t[18],f=t[19];let c;t[30]!==i||t[31]!==n||t[32]!==s||t[33]!==f?(c=m.jsx(i,{after:n,parent:s,items:f}),t[30]=i,t[31]=n,t[32]=s,t[33]=f,t[34]=c):c=t[34];let d;t[35]!==C||t[36]!==e||t[37]!==o?(d=C?void 0:()=>o({preview:e}),t[35]=C,t[36]=e,t[37]=o,t[38]=d):d=t[38];let h;t[39]!==d?(h={expanded:!0,onToggle:d},t[39]=d,t[40]=h):h=t[40];let x;t[41]!==p||t[42]!==e||t[43]!==h?(x=m.jsx(E,{previewPath:e,onClose:p,expand:h},e),t[41]=p,t[42]=e,t[43]=h,t[44]=x):x=t[44];let w;return t[45]!==r||t[46]!==x||t[47]!==c?(w=m.jsxs(r,{children:[c,x]}),t[45]=r,t[46]=x,t[47]=c,t[48]=w):w=t[48],w}let a;t[49]!==p||t[50]!==e||t[51]!==o?(a=e&&m.jsx(E,{variant:"aside",previewPath:e,onClose:p,expand:{expanded:!1,onToggle:()=>o({preview:e,expanded:!0})}},e),t[49]=p,t[50]=e,t[51]=o,t[52]=a):a=t[52];let g;t[53]===Symbol.for("react.memo_cache_sentinel")?(g=m.jsx(B,{section:"files",children:m.jsx(V,{filePreview:"side"})}),t[53]=g):g=t[53];let S;return t[54]!==a?(S=m.jsx(R.Content,{aside:a,children:g}),t[54]=a,t[55]=S):S=t[55],S}export{ze as default};
@@ -1 +0,0 @@
1
- function s(r,t){if(!t)return null;const e=t.toLowerCase();return r.find(o=>{const n=o.bucket.toLowerCase();return o.siteSlug?.toLowerCase()===e||n===e||n===`deco-assets-${e}`})??null}export{s as m};