decocms 4.373.6 → 4.373.8

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 (368) hide show
  1. package/dist/client/assets/{AlertCircle-D3eYSD-F.js → AlertCircle-1_aD--dB.js} +1 -1
  2. package/dist/client/assets/{AreaChart-DwaiozPI.js → AreaChart-DL1NARLv.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-pKUucwnA.js → ArrowLeft-DbYZw4_2.js} +1 -1
  4. package/dist/client/assets/{ArrowRight-dpr4pl9N.js → ArrowRight-DNQSixjP.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-CYYVNB-P.js → ArrowUp-CSKb51sC.js} +1 -1
  6. package/dist/client/assets/{CartesianChart-C0zj7nlT.js → CartesianChart-C7UCTRH5.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-GeSGM969.js → CheckCircle-Cc6CY47i.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-D3WR1M0A.js → ChevronUp-C9Nhfb-x.js} +1 -1
  9. package/dist/client/assets/{Copy01-DqrZOvVi.js → Copy01-BjLGbqnG.js} +1 -1
  10. package/dist/client/assets/{CreditCard01-VmFyjxYd.js → CreditCard01-ByBlbqPe.js} +1 -1
  11. package/dist/client/assets/{DotsVertical-CD4T7H6_.js → DotsVertical-Czhni7yG.js} +1 -1
  12. package/dist/client/assets/{Download01-BRqjontI.js → Download01-CDh7RxaN.js} +1 -1
  13. package/dist/client/assets/{ErrorBarContext-DL2J6Vap.js → ErrorBarContext-Dwimm_GG.js} +1 -1
  14. package/dist/client/assets/{Eye-CI6aKDnd.js → Eye-BKjf_vUO.js} +1 -1
  15. package/dist/client/assets/{Globe01-DF7y1beg.js → Globe01-k6r26TAV.js} +1 -1
  16. package/dist/client/assets/{Globe04-BFA3LOH7.js → Globe04-DFGUZ8EW.js} +1 -1
  17. package/dist/client/assets/{Image01-B6W5URkI.js → Image01-DpNFr3GM.js} +1 -1
  18. package/dist/client/assets/{Key01-BB4eK9Eq.js → Key01-BkaZy7Ah.js} +1 -1
  19. package/dist/client/assets/{LayoutLeft-DEnYqvHT.js → LayoutLeft-D1fYrUGp.js} +1 -1
  20. package/dist/client/assets/{Line-DrZZSRLC.js → Line-B72CBrVS.js} +1 -1
  21. package/dist/client/assets/{Link01-DVDPoM5q.js → Link01-D45u3Kwy.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-DpqcCYOT.js → LinkExternal01-CZLsVISw.js} +1 -1
  23. package/dist/client/assets/{Monitor01-DKEZpVnT.js → Monitor01-BjQTJmPT.js} +1 -1
  24. package/dist/client/assets/{Package-BYLXGnrw.js → Package-MW9FV2l6.js} +1 -1
  25. package/dist/client/assets/{Palette-CJjjIC-G.js → Palette-D2r_rP7A.js} +1 -1
  26. package/dist/client/assets/{Play-DJHXfM-U.js → Play-CQYqv81V.js} +1 -1
  27. package/dist/client/assets/{Plus-CFFsuHFf.js → Plus-DWnlhQEG.js} +1 -1
  28. package/dist/client/assets/{SearchLg-DgqRTz9C.js → SearchLg-BeTAUTWq.js} +1 -1
  29. package/dist/client/assets/{SearchMd-DRk1Er2c.js → SearchMd-BCQ1CyGA.js} +1 -1
  30. package/dist/client/assets/{Sector-WqXSCDB7.js → Sector-BE44p-SO.js} +1 -1
  31. package/dist/client/assets/{Settings02-DsaxolGj.js → Settings02-S2K24EWO.js} +1 -1
  32. package/dist/client/assets/{Share07-NUMfhSqd.js → Share07-BaevX8Mw.js} +1 -1
  33. package/dist/client/assets/{Stars01-DwhcksvZ.js → Stars01-DxWX4pOr.js} +1 -1
  34. package/dist/client/assets/{Sun-C0V63ie9.js → Sun-edqgTWqM.js} +1 -1
  35. package/dist/client/assets/{Tool01-d_iK_DkH.js → Tool01-BOTbO9xX.js} +1 -1
  36. package/dist/client/assets/{Tool02-cweQ69Nx.js → Tool02-CyM8jIXw.js} +1 -1
  37. package/dist/client/assets/{Trash01-Desmqajq.js → Trash01-CDngQkql.js} +1 -1
  38. package/dist/client/assets/{TrendUp01-B7gk74Ha.js → TrendUp01-CsEPcUzR.js} +1 -1
  39. package/dist/client/assets/{Upload01-DelvmgfV.js → Upload01-D48ElPif.js} +1 -1
  40. package/dist/client/assets/{User01-CbDoD5mb.js → User01-CEit44ru.js} +1 -1
  41. package/dist/client/assets/{UserSquare-Bje-nfYn.js → UserSquare-sbsbnvWo.js} +1 -1
  42. package/dist/client/assets/{Users01-BqKNBiO6.js → Users01-Drj4BA_j.js} +1 -1
  43. package/dist/client/assets/{X-CTlWdd97.js → X-Cr1LzzwP.js} +1 -1
  44. package/dist/client/assets/{XCircle-D6WY1ym8.js → XCircle-DoUWUf9d.js} +1 -1
  45. package/dist/client/assets/{XClose-DS_Db3B_.js → XClose-DA1jDjt_.js} +1 -1
  46. package/dist/client/assets/{Zap-XRJ8YEEc.js → Zap-C8hEZAXG.js} +1 -1
  47. package/dist/client/assets/{ZoomOut-DBByf2mh.js → ZoomOut-D-FhOF2X.js} +1 -1
  48. package/dist/client/assets/{access-gate-BPsOGNar.js → access-gate-DN6XyU54.js} +1 -1
  49. package/dist/client/assets/{add-connection-dialog-TAht4cuO.js → add-connection-dialog-B2QrTqPz.js} +1 -1
  50. package/dist/client/assets/{agent-analytics-BU1-PzkI.js → agent-analytics-DU5TPtWM.js} +1 -1
  51. package/dist/client/assets/agent-app-Dlen_0Di.js +1 -0
  52. package/dist/client/assets/{agent-assets-BrYlDhjI.js → agent-assets-DcW1ORPj.js} +1 -1
  53. package/dist/client/assets/{agent-automation-DRIwy8Ar.js → agent-automation-9xM1Gtnb.js} +1 -1
  54. package/dist/client/assets/{agent-automations-BHxYXOUj.js → agent-automations-CmiwlkHP.js} +1 -1
  55. package/dist/client/assets/{agent-connect-sources-wRyuYv4j.js → agent-connect-sources-DQnuiEX7.js} +1 -1
  56. package/dist/client/assets/agent-deck-CNwv_Xxg.js +1 -0
  57. package/dist/client/assets/{agent-e2e-DY_ih97m.js → agent-e2e-B1yu3LmN.js} +1 -1
  58. package/dist/client/assets/{agent-experiments-dhU9xmuI.js → agent-experiments-DcMUbiO3.js} +1 -1
  59. package/dist/client/assets/agent-file-CYm8MPZc.js +1 -0
  60. package/dist/client/assets/{agent-git-Cnyq85Ut.js → agent-git-46vyb24u.js} +1 -1
  61. package/dist/client/assets/{agent-hosting-Bfupqb3A.js → agent-hosting-BSY1HOZj.js} +1 -1
  62. package/dist/client/assets/{agent-icon-BRULiLDc.js → agent-icon-Ds4wUFQr.js} +1 -1
  63. package/dist/client/assets/agent-library-file-BuTSLi66.js +1 -0
  64. package/dist/client/assets/{agent-monitor-aF5mIseh.js → agent-monitor-vTks-T2X.js} +1 -1
  65. package/dist/client/assets/{agent-overview-CUKcQOax.js → agent-overview-ByGWdLe6.js} +1 -1
  66. package/dist/client/assets/agent-settings-DYymML90.js +1 -0
  67. package/dist/client/assets/{agent-site-editor-BrClI9uN.js → agent-site-editor-DjTgNacN.js} +1 -1
  68. package/dist/client/assets/agent-site-editor-code-D3yflCXW.js +2 -0
  69. package/dist/client/assets/{agent-site-editor-content-aGIy9wkn.js → agent-site-editor-content-CHcFmRvs.js} +2 -2
  70. package/dist/client/assets/agent-site-editor-preview-DgGl4ejp.js +518 -0
  71. package/dist/client/assets/agent-view-Dly6F-Vf.js +1 -0
  72. package/dist/client/assets/{agent-view-guard-S1hwNIOS.js → agent-view-guard-CiTb-IfK.js} +1 -1
  73. package/dist/client/assets/{agents-list-BRkUdqSH.js → agents-list-D-o8r0uS.js} +1 -1
  74. package/dist/client/assets/{ai-providers-BCwuu37Q.js → ai-providers-2qCkDYbv.js} +1 -1
  75. package/dist/client/assets/{alert-B1s9CJD8.js → alert-DjtybrS0.js} +1 -1
  76. package/dist/client/assets/{alert-dialog-DqO-3R76.js → alert-dialog-CVY7NpNS.js} +1 -1
  77. package/dist/client/assets/{api-keys-MUj_Ov5B.js → api-keys-DhnkXPQZ.js} +1 -1
  78. package/dist/client/assets/api-keys-SHbXzKXe.js +1 -0
  79. package/dist/client/assets/app-editor-BVTQM-H0.js +1 -0
  80. package/dist/client/assets/{asset-utils-CcZCvpL7.js → asset-utils-R2NmFVJk.js} +1 -1
  81. package/dist/client/assets/{auth-catchall-CKeXgRzB.js → auth-catchall-HC-N9ZSa.js} +1 -1
  82. package/dist/client/assets/{auth-entry-DzpuiHht.js → auth-entry-DKvENBOx.js} +1 -1
  83. package/dist/client/assets/{auth-CXaWU5n-.js → auth-gLcu1CpT.js} +1 -1
  84. package/dist/client/assets/{auth-split-layout-B9R0oKiN.js → auth-split-layout-B0sFfkaP.js} +1 -1
  85. package/dist/client/assets/{authenticate-and-persist-oauth-D7P0kNl_.js → authenticate-and-persist-oauth-w1UaCnqr.js} +1 -1
  86. package/dist/client/assets/{automation-list-row-DhIsdNHC.js → automation-list-row-BWqCCVZt.js} +1 -1
  87. package/dist/client/assets/{automation-runs-JqP5LSua.js → automation-runs-ChsLWdft.js} +1 -1
  88. package/dist/client/assets/{automations-Bvrg2Ist.js → automations-BCNLJx72.js} +1 -1
  89. package/dist/client/assets/{autosend-Bpehk8fy.js → autosend-BcXsN51P.js} +1 -1
  90. package/dist/client/assets/{avatar-Didv6efi.js → avatar-qzN7CafM.js} +1 -1
  91. package/dist/client/assets/{badge-BNCSp2s3.js → badge-Jn9rjNBm.js} +1 -1
  92. package/dist/client/assets/{block-document-DGTOwJRV.js → block-document-CS7Dc6Jk.js} +1 -1
  93. package/dist/client/assets/{blocks-preview-workspace-context-MbXHAD_k.js → blocks-preview-workspace-context-CkWQ4HXu.js} +1 -1
  94. package/dist/client/assets/{breadcrumb-Boq-3hHe.js → breadcrumb-DxmYUb0I.js} +1 -1
  95. package/dist/client/assets/{buckets-D2ABK9h6.js → buckets-Bve35Vnp.js} +1 -1
  96. package/dist/client/assets/{build-improve-prompt-doc-Cokn8AIT.js → build-improve-prompt-doc-3sm8qZxG.js} +1 -1
  97. package/dist/client/assets/{bulk-category-panel-CGL0cNkF.js → bulk-category-panel-PSXvOwnQ.js} +1 -1
  98. package/dist/client/assets/{calendar-Dm4fhyz-.js → calendar-CSr2hmIz.js} +1 -1
  99. package/dist/client/assets/{capability-load-error-B0iwFf7_.js → capability-load-error-Cdp84b5C.js} +1 -1
  100. package/dist/client/assets/category-editor-2S0eDZog.js +1 -0
  101. package/dist/client/assets/{chart-Akk0F8wU.js → chart-FOXwCLGv.js} +1 -1
  102. package/dist/client/assets/{chat-context-iYlkLZJd.js → chat-context-B6h2xdo0.js} +1 -1
  103. package/dist/client/assets/{chat-draft-BT2YB8qY.js → chat-draft-VxzhQrWJ.js} +1 -1
  104. package/dist/client/assets/{checkbox-CEMIbeLG.js → checkbox-CeU6IqeR.js} +1 -1
  105. package/dist/client/assets/{choose-editor-D7H3RTiD.js → choose-editor-BPTc6Ttm.js} +1 -1
  106. package/dist/client/assets/{cli-auth-success-sL-AfU_l.js → cli-auth-success-e04cXoeC.js} +1 -1
  107. package/dist/client/assets/{client-icons-CceCjUyO.js → client-icons-D01N1JIB.js} +1 -1
  108. package/dist/client/assets/{collapsible-Ddmiof2Z.js → collapsible-1Kj_Hjxx.js} +1 -1
  109. package/dist/client/assets/{collection-detail-UAstqg8H.js → collection-detail-J302oKJK.js} +1 -1
  110. package/dist/client/assets/{collection-display-button-Cqjn8K7c.js → collection-display-button-DFru68mT.js} +1 -1
  111. package/dist/client/assets/{collection-search-DJYVC05l.js → collection-search-CY6qtMl2.js} +1 -1
  112. package/dist/client/assets/{collection-table-wrapper-qc6gW6SL.js → collection-table-wrapper-wS8JTYNq.js} +1 -1
  113. package/dist/client/assets/{collection-tabs-anNBFHFb.js → collection-tabs-C75WAB0u.js} +1 -1
  114. package/dist/client/assets/{combobox-CGYz-V_6.js → combobox-BhSInoyS.js} +1 -1
  115. package/dist/client/assets/{command-Dt5rZk11.js → command-CApdc7tB.js} +1 -1
  116. package/dist/client/assets/{companion-mcps-section-C6ViuDC1.js → companion-mcps-section-B9Du9wa_.js} +1 -1
  117. package/dist/client/assets/{connect-DlhT2_a0.js → connect-Cn0VFLPZ.js} +1 -1
  118. package/dist/client/assets/{connect-layout-UA_ojwUJ.js → connect-layout-CqRKUl7K.js} +1 -1
  119. package/dist/client/assets/{connection-BgOyoL-N.js → connection-DHsoRZa4.js} +1 -1
  120. package/dist/client/assets/{connection-card-DxPN8sYJ.js → connection-card-B4Lfzhnd.js} +1 -1
  121. package/dist/client/assets/{connection-detail-D4jYnX4w.js → connection-detail-DEVK6-mo.js} +1 -1
  122. package/dist/client/assets/{connection-form-helpers-BgtFrKr_.js → connection-form-helpers-Do68AahQ.js} +1 -1
  123. package/dist/client/assets/{connections-C1YycoCL.js → connections-CcxQm1vB.js} +1 -1
  124. package/dist/client/assets/{create-organization-dialog-B4051f2Y.js → create-organization-dialog-RGp21FdA.js} +1 -1
  125. package/dist/client/assets/{decofile-api-qrEn75pC.js → decofile-api-xtxqfgRa.js} +1 -1
  126. package/dist/client/assets/decopilot-BgEg3OT6.js +4 -0
  127. package/dist/client/assets/{dialog-BG4c8Ew3.js → dialog-Dl5zPv9e.js} +1 -1
  128. package/dist/client/assets/{discover-CZhPBem-.js → discover-B68h516y.js} +1 -1
  129. package/dist/client/assets/{domain-settings-B5xKTZUy.js → domain-settings-D74bsHDK.js} +1 -1
  130. package/dist/client/assets/{download-app-dialog-BUFOH47d.js → download-app-dialog-t4N-N3uU.js} +1 -1
  131. package/dist/client/assets/{drawer-HsdaIuzu.js → drawer-CgkgucN1.js} +1 -1
  132. package/dist/client/assets/{editor-D6niHdLA.js → editor-T3L5r0Fu.js} +1 -1
  133. package/dist/client/assets/{empty-state-BI6nLRJ9.js → empty-state-CKSGQb76.js} +1 -1
  134. package/dist/client/assets/{empty-state-DtKYrRQz.js → empty-state-jlXAM_Vx.js} +1 -1
  135. package/dist/client/assets/{extract-connection-data-BN2GqRYG.js → extract-connection-data-DcLFWp9p.js} +1 -1
  136. package/dist/client/assets/{feature-gate-CBjka-VN.js → feature-gate-B-yrcMj6.js} +1 -1
  137. package/dist/client/assets/{feature-paywall-CRwtygFs.js → feature-paywall-DlNMP7aX.js} +1 -1
  138. package/dist/client/assets/{file-explorer-Dm8CypxL.js → file-explorer-DuCWREXF.js} +1 -1
  139. package/dist/client/assets/{file-preview-C81z-6bM.js → file-preview-CaI7fK9R.js} +1 -1
  140. package/dist/client/assets/{file-share-button-DZuygGvz.js → file-share-button-DnOchcN5.js} +1 -1
  141. package/dist/client/assets/{file-type-icon-DpJWy5M2.js → file-type-icon-VOg1Vfy5.js} +1 -1
  142. package/dist/client/assets/{folder-icon-Bm639N0Y.js → folder-icon-jICbufb_.js} +1 -1
  143. package/dist/client/assets/{form-Dky9WQSJ.js → form-C_kDn5va.js} +1 -1
  144. package/dist/client/assets/{gateway-client-QdZQKIDo.js → gateway-client-CSBLiew8.js} +1 -1
  145. package/dist/client/assets/{general-D__F-EyS.js → general-s-LpWgDM.js} +1 -1
  146. package/dist/client/assets/{github-icon-B_0P_4Xb.js → github-icon-DVQ1NwUu.js} +1 -1
  147. package/dist/client/assets/{home-CDgdAzeZ.js → home-DV89XXOG.js} +1 -1
  148. package/dist/client/assets/{hooks-Dr4SK9lF.js → hooks-B2mYVhP_.js} +1 -1
  149. package/dist/client/assets/{hooks-BP4OlUD4.js → hooks-DvQkdYJL.js} +1 -1
  150. package/dist/client/assets/{icon-button-DcEuCL60.js → icon-button-CByYJZRV.js} +1 -1
  151. package/dist/client/assets/{index-ClSKfzUE.js → index-545LRaIz.js} +1 -1
  152. package/dist/client/assets/{index-BJVVvEJb.js → index-BLPQEXIu.js} +1 -1
  153. package/dist/client/assets/index-BNah-P_g.css +1 -0
  154. package/dist/client/assets/{index-DfOmiBMV.js → index-C6HQEiEx.js} +1 -1
  155. package/dist/client/assets/{index-v_Uq46OW.js → index-CARHKa4M.js} +1 -1
  156. package/dist/client/assets/{index-C4voA6sY.js → index-CGR18BSj.js} +1 -1
  157. package/dist/client/assets/{index-cOIC2Zfa.js → index-CNUd9Lae.js} +1 -1
  158. package/dist/client/assets/{index-CHtlQTUQ.js → index-Ci3mCUbP.js} +1 -1
  159. package/dist/client/assets/{index-BwRzUgh0.js → index-CkeC_MxK.js} +1 -1
  160. package/dist/client/assets/{index-CcHKaTn6.js → index-CpZ_1mN7.js} +1 -1
  161. package/dist/client/assets/{index-B9-heAAa.js → index-Dn-pE_oF.js} +2 -2
  162. package/dist/client/assets/{index-1S4uBH3x.js → index-DnDIM2xu.js} +1 -1
  163. package/dist/client/assets/{index-BvpMJL9X.js → index-O9d00ugp.js} +1 -1
  164. package/dist/client/assets/{index-Dc_i1Bik.js → index-WCc3fcxd.js} +1 -1
  165. package/dist/client/assets/{index-5QMOhTWH.js → index-ctxca5Ua.js} +1 -1
  166. package/dist/client/assets/{index-redirect-CT5fA9So.js → index-redirect-lO7wa7N_.js} +1 -1
  167. package/dist/client/assets/{infiniteQueryObserver-Dj9z-_Ba.js → infiniteQueryObserver-ZTOME-Yd.js} +1 -1
  168. package/dist/client/assets/{infra-billing-C_FQsgB0.js → infra-billing-DEXSrufy.js} +1 -1
  169. package/dist/client/assets/{input-Bsj5KDt6.js → input-B4lbwedr.js} +1 -1
  170. package/dist/client/assets/input-CcdXXTty.js +8 -0
  171. package/dist/client/assets/{input-D7UnEeXl.js → input-DfvK3BvZ.js} +1 -1
  172. package/dist/client/assets/{integration-icon-B6dtorjO.js → integration-icon-BbMj8xyp.js} +1 -1
  173. package/dist/client/assets/{label-BO4yFijb.js → label-nMs4JvQM.js} +1 -1
  174. package/dist/client/assets/{last-preview-page-Dv830AIe.js → last-preview-page-BP1aM3EQ.js} +1 -1
  175. package/dist/client/assets/{layout-Bxh_his-.js → layout-ecXPoMWs.js} +1 -1
  176. package/dist/client/assets/{legacy-agents-deep-qsw3IhVI.js → legacy-agents-deep-BnkOa_92.js} +1 -1
  177. package/dist/client/assets/{legacy-main-redirect-C6TKhr8-.js → legacy-main-redirect-Be3GXpEP.js} +1 -1
  178. package/dist/client/assets/{library-CfLbpWZK.js → library-BdS1qibY.js} +1 -1
  179. package/dist/client/assets/{login-CZbYiPIn.js → login-B4q0HQCV.js} +1 -1
  180. package/dist/client/assets/{markdown-BF4hkzaL.js → markdown-D50yVO4b.js} +1 -1
  181. package/dist/client/assets/{mcp-app-renderer-Bxmf7t4w.js → mcp-app-renderer-C46rwnJa.js} +1 -1
  182. package/dist/client/assets/{mcp-oauth-DzKWzujJ.js → mcp-oauth-D9zitCdn.js} +1 -1
  183. package/dist/client/assets/{members-CDm04dqD.js → members-wCJ1T-Jh.js} +1 -1
  184. package/dist/client/assets/{message-templates-Dqw35wcK.js → message-templates-DGuaJC7Y.js} +1 -1
  185. package/dist/client/assets/{mini-report-page-DImPoXRk.js → mini-report-page-CP1mebuW.js} +1 -1
  186. package/dist/client/assets/{mock-board-BmIzs8Cs.js → mock-board-CbTe5OBn.js} +3 -3
  187. package/dist/client/assets/{monaco-editor-CLDMxU3Q.js → monaco-editor-DwetGl4M.js} +2 -2
  188. package/dist/client/assets/{monitoring-stats-row-1O6-pYvX.js → monitoring-stats-row-DJ9fN0yN.js} +1 -1
  189. package/dist/client/assets/{multi-select-DJ-p4Z1M.js → multi-select-BE1NAYiV.js} +1 -1
  190. package/dist/client/assets/{mustache-7izSLTr2.js → mustache-wFLLi-RJ.js} +1 -1
  191. package/dist/client/assets/{oauth-callback-D4wX3DB9.js → oauth-callback-D8JHxvY7.js} +1 -1
  192. package/dist/client/assets/{oauth-callback-ai-provider-BkM4OhqK.js → oauth-callback-ai-provider-DomKyrb4.js} +1 -1
  193. package/dist/client/assets/{onboarding-QU_kmcMD.js → onboarding-DJcRNmWh.js} +1 -1
  194. package/dist/client/assets/{optimistic-project-sidebar-views-CyseA3Te.js → optimistic-project-sidebar-views-DMDmcznJ.js} +1 -1
  195. package/dist/client/assets/{org-file-open-context-BJOB9JXS.js → org-file-open-context-bJmEvFz7.js} +1 -1
  196. package/dist/client/assets/{organization-choice-Yyr2HSJT.js → organization-choice-B_p1WFTG.js} +1 -1
  197. package/dist/client/assets/{orgs-BV2AvFmU.js → orgs-BwgDyUJv.js} +1 -1
  198. package/dist/client/assets/{page-seo-form-BsO0DrNN.js → page-seo-form-CESXJ0d5.js} +1 -1
  199. package/dist/client/assets/pair-B93l5mBb.js +47 -0
  200. package/dist/client/assets/{plan-ladder-DokAEKuN.js → plan-ladder--9AA86Vw.js} +1 -1
  201. package/dist/client/assets/{popover-DM5IZa3t.js → popover-2ypE52tC.js} +1 -1
  202. package/dist/client/assets/{post-calendar-C-e5-TV2.js → post-calendar-DHFYHW34.js} +1 -1
  203. package/dist/client/assets/{post-editor-BcTEdZP9.js → post-editor-C2pNflme.js} +1 -1
  204. package/dist/client/assets/{preview-content-D4gN_IR-.js → preview-content-B2uHD2ji.js} +1 -1
  205. package/dist/client/assets/{preview-dialog-CUXp3Zgx.js → preview-dialog-BBrtVo7w.js} +1 -1
  206. package/dist/client/assets/{primitives-B5JG2jIM.js → primitives-BAuykeIS.js} +1 -1
  207. package/dist/client/assets/{profile-CT7SVHWT.js → profile-SaxqZy8C.js} +1 -1
  208. package/dist/client/assets/{project-app-view-CnjyPq4z.js → project-app-view-DMevjOJJ.js} +1 -1
  209. package/dist/client/assets/{project-feed-CWn-Lv0t.js → project-feed-BeIKiBhK.js} +1 -1
  210. package/dist/client/assets/{project-icon-Ba4aI2hq.js → project-icon-DcxLNBvR.js} +1 -1
  211. package/dist/client/assets/project-reports-Zx7QBvUm.js +1 -0
  212. package/dist/client/assets/project-tasks-DognbToz.js +1 -0
  213. package/dist/client/assets/{prompts-W3xLcrYm.js → prompts-BPaifu-G.js} +1 -1
  214. package/dist/client/assets/record-editor-B4oaFr3X.js +1 -0
  215. package/dist/client/assets/{redirect-editor-BMH4ehui.js → redirect-editor-DKcp7e1n.js} +1 -1
  216. package/dist/client/assets/registry-Cmuz9TXo.js +2 -0
  217. package/dist/client/assets/{registry-layout-B6_xJXmc.js → registry-layout-10KQ6qzs.js} +1 -1
  218. package/dist/client/assets/reports-Al2NBjvI.js +1 -0
  219. package/dist/client/assets/{reports-B4eXifzx.js → reports-BTFMjh6T.js} +1 -1
  220. package/dist/client/assets/{reports-onboarding-ZAUri_6S.js → reports-onboarding-SI9K65FB.js} +1 -1
  221. package/dist/client/assets/{reports-tab-D4AGFGPc.js → reports-tab-BZPtKneq.js} +2 -2
  222. package/dist/client/assets/{repositories-Buk76J8t.js → repositories-2YbqPWsA.js} +1 -1
  223. package/dist/client/assets/{repository-import-picker-ebb6WNSx.js → repository-import-picker-CC5rjGza.js} +1 -1
  224. package/dist/client/assets/{repository-picker-B9Ygev7q.js → repository-picker-oVfzv-hF.js} +1 -1
  225. package/dist/client/assets/{require-capability-DhJhDP-L.js → require-capability-BUixtCV_.js} +1 -1
  226. package/dist/client/assets/{required-auth-layout-Cac00Ws4.js → required-auth-layout-c8IKViEL.js} +1 -1
  227. package/dist/client/assets/{reset-password-B8vf7L1c.js → reset-password-BcCSqEgi.js} +1 -1
  228. package/dist/client/assets/{resizable-C3bWrtWT.js → resizable-C5i5wwZj.js} +1 -1
  229. package/dist/client/assets/{review-settings-C-hBeg41.js → review-settings-4QW7vK7s.js} +1 -1
  230. package/dist/client/assets/{rich-text-link-control-CvYxTCJj.js → rich-text-link-control-Beqn4IaU.js} +1 -1
  231. package/dist/client/assets/{roles-Dh9UUZcV.js → roles-14p4u72x.js} +1 -1
  232. package/dist/client/assets/{route-DwkJPD1w.js → route-7BgI5Woy.js} +1 -1
  233. package/dist/client/assets/{route-Bb-xA0Ol.js → route-D1BgROGd.js} +1 -1
  234. package/dist/client/assets/route-DyAzwdqu.js +1 -0
  235. package/dist/client/assets/{route-page-header-BfHqQiDS.js → route-page-header-BZt7tMeI.js} +1 -1
  236. package/dist/client/assets/runnable-block-editor-DLCoyC1l.js +16 -0
  237. package/dist/client/assets/{sandbox-lifecycle-context-DfY4dZfw.js → sandbox-lifecycle-context-BElwiIKp.js} +1 -1
  238. package/dist/client/assets/{schema-6mN0bvm3.js → schema-BJjGrX8W.js} +1 -1
  239. package/dist/client/assets/{scroll-area-D7qbBjMH.js → scroll-area-DglU8OjO.js} +1 -1
  240. package/dist/client/assets/{search-input-Ck0252jm.js → search-input-B0JWJqt0.js} +1 -1
  241. package/dist/client/assets/{search-toggle-BLXBsyeS.js → search-toggle-DAzXUHXL.js} +1 -1
  242. package/dist/client/assets/{secrets-CqlL4cwb.js → secrets-DfOK53jt.js} +1 -1
  243. package/dist/client/assets/{sections-editor-S86e9po8.js → sections-editor-JwUGjbSO.js} +1 -1
  244. package/dist/client/assets/{select-CGIEs0gc.js → select-CQa_dQzn.js} +1 -1
  245. package/dist/client/assets/{select-model-B_ckG0Vk.js → select-model-CyVGvEjL.js} +1 -1
  246. package/dist/client/assets/{seo-editor-CiJSQ0hg.js → seo-editor-BVsw5Vxc.js} +1 -1
  247. package/dist/client/assets/{separator-Lx1_tt_L.js → separator-B4rqYwHA.js} +1 -1
  248. package/dist/client/assets/{settings-tab-08jTQ5mn.js → settings-tab-LDWtDGaS.js} +1 -1
  249. package/dist/client/assets/{sheet-BCMwxEJt.js → sheet-CFcU_I-W.js} +1 -1
  250. package/dist/client/assets/{shell-layout-C1-8bBsl.js → shell-layout-Cu8BQ2YY.js} +1 -1
  251. package/dist/client/assets/{sidebar-CpgCLs_P.js → sidebar-BV5Lpxrt.js} +1 -1
  252. package/dist/client/assets/{skill-preview-B9Fe89d7.js → skill-preview-n1yWNAQL.js} +1 -1
  253. package/dist/client/assets/{skills-DEDSoqR0.js → skills-DGx6RRr9.js} +1 -1
  254. package/dist/client/assets/{sso-Bcqdho85.js → sso-BUsjtg7A.js} +1 -1
  255. package/dist/client/assets/{store-Cs5Bmze9.js → store-Bg3pg157.js} +1 -1
  256. package/dist/client/assets/store-registry-D0DynT60.js +2 -0
  257. package/dist/client/assets/{switch-B7r0dQcL.js → switch-RF4lhbzX.js} +1 -1
  258. package/dist/client/assets/{synced-repos-CMjTOFt-.js → synced-repos-Dev_EZMx.js} +1 -1
  259. package/dist/client/assets/{table-DgtBm1fC.js → table-BciFqWlt.js} +1 -1
  260. package/dist/client/assets/{tabs-8a-KIKo5.js → tabs-CpJgNx30.js} +1 -1
  261. package/dist/client/assets/{task-board-CiWJ5lUh.js → task-board-DxUiBcDP.js} +1 -1
  262. package/dist/client/assets/{task-route-CN2ffNmY.js → task-route-D0p98pAa.js} +1 -1
  263. package/dist/client/assets/{task-status-DPBgrE0W.js → task-status-W7i54FBc.js} +1 -1
  264. package/dist/client/assets/{taskboard-analytics-DtbeRtX6.js → taskboard-analytics-QY1OXppw.js} +1 -1
  265. package/dist/client/assets/{tasks-Csxrv5NN.js → tasks-B6HzEGHt.js} +1 -1
  266. package/dist/client/assets/tasks-mk0xpRui.js +1 -0
  267. package/dist/client/assets/{textarea-B4b4OfxE.js → textarea-DTACqjWS.js} +1 -1
  268. package/dist/client/assets/{thread-button-DPSOj2uV.js → thread-button-BDPXLKAH.js} +1 -1
  269. package/dist/client/assets/{thread-intent-D_ZAwkxt.js → thread-intent-DOmgYGxo.js} +1 -1
  270. package/dist/client/assets/{thread-route-Bb_Mex6m.js → thread-route-CQvzElwe.js} +1 -1
  271. package/dist/client/assets/{thread-route-MBCO8DTC.js → thread-route-DH7EC64o.js} +1 -1
  272. package/dist/client/assets/{thread-sheet-body-C_Vpg-fX.js → thread-sheet-body-Cn07EcYl.js} +1 -1
  273. package/dist/client/assets/{toggle-group-DG19r_KQ.js → toggle-group-8GW330jn.js} +1 -1
  274. package/dist/client/assets/{toolbar-icon-button-6kpUmydY.js → toolbar-icon-button-BR3O5nbS.js} +1 -1
  275. package/dist/client/assets/{tooltip-DB_mQQ5y.js → tooltip-C6ST3NpK.js} +1 -1
  276. package/dist/client/assets/{track-DVuJubzn.js → track-CbmiGiqA.js} +1 -1
  277. package/dist/client/assets/{types-C5y87H9S.js → types-CCxzQATz.js} +1 -1
  278. package/dist/client/assets/{usage-stats-rVm4rZXJ.js → usage-stats-BrYXmxF3.js} +1 -1
  279. package/dist/client/assets/{use-ai-providers-ChLr6stH.js → use-ai-providers-DUHhmQc6.js} +1 -1
  280. package/dist/client/assets/{use-automations-D29wqp0p.js → use-automations-U42Dldb-.js} +1 -1
  281. package/dist/client/assets/{use-autosave-DzXheZOH.js → use-autosave-edwInapC.js} +1 -1
  282. package/dist/client/assets/{use-connect-companion-C9XVvNbQ.js → use-connect-companion-C8SW5ee7.js} +1 -1
  283. package/dist/client/assets/{use-connection-CxUZdVtx.js → use-connection-zRPDIQ_n.js} +1 -1
  284. package/dist/client/assets/{use-copy-n0GWSVkA.js → use-copy-CIAIrC4p.js} +1 -1
  285. package/dist/client/assets/{use-create-virtual-mcp-Cqo-Z1Nz.js → use-create-virtual-mcp-VQEANfyF.js} +1 -1
  286. package/dist/client/assets/{use-date-fns-locale-DRlG3NUT.js → use-date-fns-locale-DeWcS2U7.js} +1 -1
  287. package/dist/client/assets/{use-debounced-autosave-0DRMOIhZ.js → use-debounced-autosave-CU5jh2Bj.js} +1 -1
  288. package/dist/client/assets/{use-debounced-value-D9Q5Remb.js → use-debounced-value-B3_m5S__.js} +1 -1
  289. package/dist/client/assets/{use-deco-credits-D_VcXnYT.js → use-deco-credits-B92-uMQD.js} +1 -1
  290. package/dist/client/assets/{use-decopilot-events-M5cJZFyY.js → use-decopilot-events-7Ia-4Ojl.js} +1 -1
  291. package/dist/client/assets/{use-delete-connection-D1JqYId6.js → use-delete-connection-Dnlrdtet.js} +1 -1
  292. package/dist/client/assets/{use-deployment-admin-CURK73vg.js → use-deployment-admin-CxktJ2MS.js} +1 -1
  293. package/dist/client/assets/{use-entitlements-BNCg22H6.js → use-entitlements-CJrgpU-3.js} +1 -1
  294. package/dist/client/assets/{use-fast-preview-draft-url-CamuNqdc.js → use-fast-preview-draft-url-Dg3eP3_b.js} +1 -1
  295. package/dist/client/assets/{use-file-configs-CtFInHrx.js → use-file-configs-BRGqSXQ6.js} +1 -1
  296. package/dist/client/assets/{use-in-settings-BVlXs-Md.js → use-in-settings-B8vln_7N.js} +1 -1
  297. package/dist/client/assets/{use-infinite-scroll-DWMzEhh9.js → use-infinite-scroll-CWZ-jt-q.js} +1 -1
  298. package/dist/client/assets/{use-join-requests--jRCdkZk.js → use-join-requests-CmLwY10S.js} +1 -1
  299. package/dist/client/assets/{use-main-panel-tabs-BoYcNsqs.js → use-main-panel-tabs-Cskdmhh-.js} +1 -1
  300. package/dist/client/assets/{use-mcp-auth-status-_gtuZE1M.js → use-mcp-auth-status-tmqmYFZf.js} +1 -1
  301. package/dist/client/assets/{use-mcp-client-QkBFbC3f.js → use-mcp-client-ixAVEgas.js} +1 -1
  302. package/dist/client/assets/{use-mcp-prompts-DvwjTF0b.js → use-mcp-prompts-2U0nS-wa.js} +1 -1
  303. package/dist/client/assets/{use-mcp-tools-Dqs2rAUi.js → use-mcp-tools-IEW4h9lj.js} +1 -1
  304. package/dist/client/assets/{use-members-aplVIbSX.js → use-members-CthmHZKF.js} +1 -1
  305. package/dist/client/assets/{use-mobile-z5LlRP9d.js → use-mobile-cGAaNUys.js} +1 -1
  306. package/dist/client/assets/{use-navigate-to-agent-B82Qcige.js → use-navigate-to-agent-BCAq2VrI.js} +1 -1
  307. package/dist/client/assets/{use-open-billing-url-6XxQw3Eh.js → use-open-billing-url-CqH0MvxG.js} +1 -1
  308. package/dist/client/assets/{use-org-auth-client-LTupMcfa.js → use-org-auth-client-CLrcF9If.js} +1 -1
  309. package/dist/client/assets/{use-org-fs-CP-M8wtZ.js → use-org-fs-DES7wpqb.js} +1 -1
  310. package/dist/client/assets/{use-org-repo-syncs-ug_mDBgC.js → use-org-repo-syncs-E3XPDOag.js} +1 -1
  311. package/dist/client/assets/{use-org-sso-jTEc7oSr.js → use-org-sso-Dv-UbNYl.js} +1 -1
  312. package/dist/client/assets/{use-organization-roles-BC9sU7Oz.js → use-organization-roles-BWlsyW31.js} +1 -1
  313. package/dist/client/assets/{use-organization-settings-CcUVu9tG.js → use-organization-settings-BfcOMNYp.js} +1 -1
  314. package/dist/client/assets/{use-panel-navigate-C1nn8JtC.js → use-panel-navigate-BWSWcls2.js} +1 -1
  315. package/dist/client/assets/{use-project-native-view-presence-dy3A_Smb.js → use-project-native-view-presence-D4KcE4ZV.js} +1 -1
  316. package/dist/client/assets/{use-project-scope-BC5vNotn.js → use-project-scope-BXLyS9dJ.js} +1 -1
  317. package/dist/client/assets/{use-registry-connections-D949LAVQ.js → use-registry-connections-D-bmaapw.js} +1 -1
  318. package/dist/client/assets/{use-releases-DbvQa9X0.js → use-releases-gwSkm006.js} +1 -1
  319. package/dist/client/assets/{use-reports-diagnostic-CvqD5Npp.js → use-reports-diagnostic-Bcblv5Yi.js} +1 -1
  320. package/dist/client/assets/{use-route-default-main-4UlGpexs.js → use-route-default-main-Cqwf9yFF.js} +1 -1
  321. package/dist/client/assets/{use-secrets-DQ0yv8Dx.js → use-secrets-BoxjTT25.js} +1 -1
  322. package/dist/client/assets/{use-section-preview-base-A8bn_b5M.js → use-section-preview-base-DqYppapS.js} +1 -1
  323. package/dist/client/assets/{use-session-runtime-D8PkcXOC.js → use-session-runtime-BjRK3zxG.js} +1 -1
  324. package/dist/client/assets/{use-tags-eYRRTNnb.js → use-tags-DoOM8lEs.js} +1 -1
  325. package/dist/client/assets/{use-task-board-analytics-D-kcn1Zu.js → use-task-board-analytics-Cs9CJCjT.js} +1 -1
  326. package/dist/client/assets/{use-task-metadata-DZMFkATI.js → use-task-metadata-DoKY3xZE.js} +1 -1
  327. package/dist/client/assets/{use-thread-outputs-DTZIvT49.js → use-thread-outputs-U4dosc_t.js} +1 -1
  328. package/dist/client/assets/{use-view-mode-DxPHENE7.js → use-view-mode-BstGnCoQ.js} +1 -1
  329. package/dist/client/assets/{use-virtual-mcp-fKIjaLUZ.js → use-virtual-mcp-DpRXFoRT.js} +1 -1
  330. package/dist/client/assets/useInfiniteQuery-oFY--skC.js +1 -0
  331. package/dist/client/assets/{useQueries-CivyO6wT.js → useQueries-D-H6sgTA.js} +1 -1
  332. package/dist/client/assets/useSuspenseInfiniteQuery-CeJnbkNg.js +1 -0
  333. package/dist/client/assets/{users-CUvKzNap.js → users-BYszNity.js} +1 -1
  334. package/dist/client/assets/{utils-DSkbGbRW.js → utils-BcWFUEDf.js} +1 -1
  335. package/dist/client/assets/{variant-calendar-DjBw6GgF.js → variant-calendar-CjdpLWMM.js} +1 -1
  336. package/dist/client/assets/{variant-matcher-override-DIc1blpZ.js → variant-matcher-override-tS-jImDP.js} +1 -1
  337. package/dist/client/assets/{view-mode-toggle-BEII9Hz5.js → view-mode-toggle-6iRVDc1B.js} +1 -1
  338. package/dist/client/assets/{virtual-mcp-BuIha-KP.js → virtual-mcp-BPECS6-J.js} +1 -1
  339. package/dist/client/index.html +2 -2
  340. package/dist/server/cli.js +1 -1
  341. package/dist/server/server.js +1 -1
  342. package/package.json +1 -1
  343. package/dist/client/assets/agent-app-DB0n9kOL.js +0 -1
  344. package/dist/client/assets/agent-deck-Bw6Hm4Fs.js +0 -1
  345. package/dist/client/assets/agent-file-B3o36mvT.js +0 -1
  346. package/dist/client/assets/agent-library-file-C6aVVhO7.js +0 -1
  347. package/dist/client/assets/agent-settings-BXN1E4GQ.js +0 -1
  348. package/dist/client/assets/agent-site-editor-code-lUlSWpIf.js +0 -2
  349. package/dist/client/assets/agent-site-editor-preview-BkdcHe-G.js +0 -518
  350. package/dist/client/assets/agent-view-DfomKgn9.js +0 -1
  351. package/dist/client/assets/api-keys-q9NetUp4.js +0 -1
  352. package/dist/client/assets/app-editor--D9yS_3r.js +0 -1
  353. package/dist/client/assets/category-editor-J_clPaRt.js +0 -1
  354. package/dist/client/assets/decopilot-DUPu0_xK.js +0 -4
  355. package/dist/client/assets/index-BOHOyAF8.css +0 -1
  356. package/dist/client/assets/input-DQJIevdV.js +0 -8
  357. package/dist/client/assets/pair-BUORk8Dw.js +0 -47
  358. package/dist/client/assets/project-reports-CT0QZktU.js +0 -1
  359. package/dist/client/assets/project-tasks-BBYQxnPi.js +0 -1
  360. package/dist/client/assets/record-editor-J2Uasy2O.js +0 -1
  361. package/dist/client/assets/registry-CCMThGEu.js +0 -2
  362. package/dist/client/assets/reports-DolpTcLc.js +0 -1
  363. package/dist/client/assets/route-sCTIOnzJ.js +0 -1
  364. package/dist/client/assets/runnable-block-editor-3WdOeD3r.js +0 -16
  365. package/dist/client/assets/store-registry-B9NkoB0_.js +0 -2
  366. package/dist/client/assets/tasks-snZl8AHp.js +0 -1
  367. package/dist/client/assets/useInfiniteQuery-BQbzbaMU.js +0 -1
  368. package/dist/client/assets/useSuspenseInfiniteQuery-ydSR9RDy.js +0 -1
@@ -0,0 +1,518 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/sections-editor-JwUGjbSO.js","assets/index-Dn-pE_oF.js","assets/index-BNah-P_g.css","assets/chat-context-B6h2xdo0.js","assets/use-panel-navigate-BWSWcls2.js","assets/thread-route-DH7EC64o.js","assets/use-project-scope-BXLyS9dJ.js","assets/use-virtual-mcp-DpRXFoRT.js","assets/use-mcp-client-ixAVEgas.js","assets/auth-gLcu1CpT.js","assets/github-repo-BknN0SVI.js","assets/autosend-BcXsN51P.js","assets/thread-intent-DOmgYGxo.js","assets/slugify-CEUa2lfQ.js","assets/hooks-DvQkdYJL.js","assets/backoff-8mStPHYB.js","assets/task-board-DxUiBcDP.js","assets/schema-BJjGrX8W.js","assets/use-is-desktop-app-BNujXJc_.js","assets/use-entitlements-CJrgpU-3.js","assets/use-ai-providers-DUHhmQc6.js","assets/location-oTTXFrSF.js","assets/use-decopilot-events-7Ia-4Ojl.js","assets/use-organization-settings-BfcOMNYp.js","assets/ChevronUp-C9Nhfb-x.js","assets/agent-icon-Ds4wUFQr.js","assets/AlertCircle-1_aD--dB.js","assets/Tool01-BOTbO9xX.js","assets/ArrowUp-CSKb51sC.js","assets/ArrowLeft-DbYZw4_2.js","assets/Tool02-CyM8jIXw.js","assets/ArrowRight-DNQSixjP.js","assets/TrendUp01-CsEPcUzR.js","assets/ZoomOut-D-FhOF2X.js","assets/Globe04-DFGUZ8EW.js","assets/CheckCircle-Cc6CY47i.js","assets/UserSquare-sbsbnvWo.js","assets/Copy01-BjLGbqnG.js","assets/CreditCard01-ByBlbqPe.js","assets/DotsVertical-Czhni7yG.js","assets/Download01-CDh7RxaN.js","assets/Settings02-S2K24EWO.js","assets/Eye-BKjf_vUO.js","assets/Share07-BaevX8Mw.js","assets/Globe01-k6r26TAV.js","assets/XClose-DA1jDjt_.js","assets/Image01-DpNFr3GM.js","assets/Key01-BkaZy7Ah.js","assets/LayoutLeft-D1fYrUGp.js","assets/Link01-D45u3Kwy.js","assets/LinkExternal01-CZLsVISw.js","assets/Monitor01-BjQTJmPT.js","assets/Sun-edqgTWqM.js","assets/Package-MW9FV2l6.js","assets/Palette-D2r_rP7A.js","assets/Play-CQYqv81V.js","assets/Plus-DWnlhQEG.js","assets/SearchLg-BeTAUTWq.js","assets/SearchMd-BCQ1CyGA.js","assets/Stars01-DxWX4pOr.js","assets/Trash01-CDngQkql.js","assets/Upload01-D48ElPif.js","assets/User01-CEit44ru.js","assets/Users01-Drj4BA_j.js","assets/XCircle-DoUWUf9d.js","assets/X-Cr1LzzwP.js","assets/Zap-C8hEZAXG.js","assets/scroll-area-DglU8OjO.js","assets/select-CQa_dQzn.js","assets/index-CpZ_1mN7.js","assets/tooltip-C6ST3NpK.js","assets/dialog-Dl5zPv9e.js","assets/input-DfvK3BvZ.js","assets/runnable-block-editor-DLCoyC1l.js","assets/use-session-runtime-BjRK3zxG.js","assets/decofile-api-xtxqfgRa.js","assets/utils-BcWFUEDf.js","assets/sandbox-url-D3mC8qhT.js","assets/claim-phase-copy-0btUuJoC.js","assets/sandbox-start-errors-BK_aDCyt.js","assets/pair-B93l5mBb.js","assets/format-time-BtXRrtv4.js","assets/differenceInSeconds-C3x8sHUj.js","assets/collapsible-1Kj_Hjxx.js","assets/use-copy-CIAIrC4p.js","assets/usage-stats-BrYXmxF3.js","assets/markdown-D50yVO4b.js","assets/org-file-open-context-bJmEvFz7.js","assets/use-mobile-cGAaNUys.js","assets/content-blocks-o63cs2vh.js","assets/mcp-app-renderer-C46rwnJa.js","assets/types-CCxzQATz.js","assets/omit-sandbox-map-jj4lCB2U.js","assets/gateway-client-CSBLiew8.js","assets/tool-namespace-DmnQIdtF.js","assets/utils-CVEq3hMx.js","assets/shell-layout-Cu8BQ2YY.js","assets/avatar-qzN7CafM.js","assets/download-app-dialog-t4N-N3uU.js","assets/command-CApdc7tB.js","assets/index-Ci3mCUbP.js","assets/integration-icon-BbMj8xyp.js","assets/project-icon-DcxLNBvR.js","assets/required-auth-layout-c8IKViEL.js","assets/use-org-sso-Dv-UbNYl.js","assets/shell-layout-CE2Eihra.css","assets/sheet-CFcU_I-W.js","assets/use-connection-zRPDIQ_n.js","assets/use-navigate-to-agent-BCAq2VrI.js","assets/use-mcp-prompts-2U0nS-wa.js","assets/index-CGR18BSj.js","assets/form-C_kDn5va.js","assets/label-nMs4JvQM.js","assets/use-thread-outputs-U4dosc_t.js","assets/file-type-icon-VOg1Vfy5.js","assets/popover-2ypE52tC.js","assets/monaco-editor-DwetGl4M.js","assets/editor-T3L5r0Fu.js","assets/calendar-CSr2hmIz.js","assets/textarea-DTACqjWS.js","assets/rich-text-link-control-Beqn4IaU.js","assets/switch-RF4lhbzX.js","assets/safe-image-url-D5z803Ot.js","assets/search-input-B0JWJqt0.js","assets/tabs-CpJgNx30.js","assets/use-debounced-value-B3_m5S__.js","assets/use-file-configs-BRGqSXQ6.js","assets/asset-utils-R2NmFVJk.js","assets/useInfiniteQuery-oFY--skC.js","assets/infiniteQueryObserver-ZTOME-Yd.js","assets/match-site-slug-config-D3fUJ6vX.js","assets/toggle-group-8GW330jn.js","assets/alert-dialog-CVY7NpNS.js","assets/sandbox-git-api-CMdpE2TE.js","assets/mustache-wFLLi-RJ.js","assets/page-seo-form-CESXJ0d5.js","assets/use-section-preview-base-DqYppapS.js","assets/section-preview-url-Csj0_ZDg.js","assets/variant-matcher-override-tS-jImDP.js"])))=>i.map(i=>d[i]);
2
+ import{r as x,ao as Ft,aI as et,ap as Ee,c as ue,b as Le,j as n,K as as,e as is,h as Mt,B as Je,aJ as os,a0 as mn,aK as ls,Z as cs,l as ze,aH as Hn,P as Zt,q as ds,t as Un}from"./index-Dn-pE_oF.js";import{A as us}from"./agent-view-guard-CiTb-IfK.js";import{F as ms}from"./feature-gate-B-yrcMj6.js";import{a as ps,b as Bt}from"./chat-context-B6h2xdo0.js";import{t as Wn}from"./ChevronUp-C9Nhfb-x.js";import{v as fr,D as fs,E as hs,j as Xt,F as en,G as Vn,H as qn,I as Gn,z as gs,J as tn}from"./agent-icon-Ds4wUFQr.js";import{n as ln}from"./LinkExternal01-CZLsVISw.js";import{s as Jn}from"./Plus-DWnlhQEG.js";import{i as vs}from"./SearchLg-BeTAUTWq.js";import{P as xs,a as bs,b as ys}from"./popover-2ypE52tC.js";import{a as ft,b as ht,c as hr,d as gr,e as vr,C as xr}from"./command-CApdc7tB.js";import{d as ws,a as ks}from"./use-virtual-mcp-DpRXFoRT.js";import{c as br,d as pn,f as Ps}from"./sandbox-lifecycle-context-BElwiIKp.js";import{e as Ss,d as js}from"./backoff-8mStPHYB.js";import{a as Es}from"./thread-intent-DOmgYGxo.js";import{u as yr}from"./use-session-runtime-BjRK3zxG.js";import{u as Ns}from"./use-mobile-cGAaNUys.js";import{c as lt,T as ct,a as dt}from"./tooltip-C6ST3NpK.js";import{T as Ie}from"./toolbar-icon-button-BR3O5nbS.js";import{b as Cs,a as Rs,u as wr,g as Ts,c as Ls,B as nn,P as Os,r as _s,R as As,d as Ds,e as fn,f as kr,h as $s,l as Fs,m as Ms,i as Bs,p as zs,j as Is,S as rn}from"./runnable-block-editor-DLCoyC1l.js";import{w as Ot}from"./variant-matcher-override-tS-jImDP.js";import{N as Ks,b as Hs,s as tt,n as hn,c as Pr,f as Ke,v as Sr,h as Us,e as Ws,d as Vs,j as qs,k as Yn}from"./claim-phase-copy-0btUuJoC.js";import{r as Gs,w as Js,D as Ys,b as Qn,a as Qs}from"./section-preview-url-Csj0_ZDg.js";import{u as Zs}from"./use-fast-preview-draft-url-Dg3eP3_b.js";import{r as jr,l as Er,u as Xs,w as ea}from"./last-preview-page-BP1aM3EQ.js";import{u as ta}from"./use-is-desktop-app-BNujXJc_.js";import{a as na,c as Nr}from"./shell-layout-Cu8BQ2YY.js";import{u as cn}from"./useQueries-D-H6sgTA.js";import{i as ra}from"./ArrowRight-DNQSixjP.js";import{b as Cr,D as Rr,c as Tr,d as Lr,e as sa}from"./dialog-Dl5zPv9e.js";import{I as Zn}from"./input-DfvK3BvZ.js";import{u as Or}from"./blocks-preview-workspace-context-CkWQ4HXu.js";import{i as aa}from"./AlertCircle-1_aD--dB.js";import{E as gn}from"./empty-state-CKSGQb76.js";import{i as ia}from"./X-Cr1LzzwP.js";import{M as oa}from"./monaco-editor-DwetGl4M.js";import{R as Xn,a as _t,b as er}from"./resizable-C5i5wwZj.js";import{r as la}from"./virtual-mcp-BPECS6-J.js";import{b as sn}from"./use-project-scope-BXLyS9dJ.js";import{G as tr}from"./github-icon-DVQ1NwUu.js";import{R as ca}from"./repository-import-picker-CC5rjGza.js";import{r as da}from"./use-main-panel-tabs-Cskdmhh-.js";import{u as ua}from"./use-task-metadata-DoKY3xZE.js";import{b as ma}from"./thread-route-DH7EC64o.js";import"./use-panel-navigate-BWSWcls2.js";import"./feature-paywall-DlNMP7aX.js";import"./plan-ladder--9AA86Vw.js";import"./use-entitlements-CJrgpU-3.js";import"./autosend-BcXsN51P.js";import"./hooks-DvQkdYJL.js";import"./use-mcp-client-ixAVEgas.js";import"./auth-gLcu1CpT.js";import"./task-board-DxUiBcDP.js";import"./schema-BJjGrX8W.js";import"./use-ai-providers-DUHhmQc6.js";import"./location-oTTXFrSF.js";import"./use-decopilot-events-7Ia-4Ojl.js";import"./use-organization-settings-BfcOMNYp.js";import"./Tool01-BOTbO9xX.js";import"./ArrowUp-CSKb51sC.js";import"./ArrowLeft-DbYZw4_2.js";import"./Tool02-CyM8jIXw.js";import"./TrendUp01-CsEPcUzR.js";import"./ZoomOut-D-FhOF2X.js";import"./Globe04-DFGUZ8EW.js";import"./CheckCircle-Cc6CY47i.js";import"./UserSquare-sbsbnvWo.js";import"./Copy01-BjLGbqnG.js";import"./CreditCard01-ByBlbqPe.js";import"./DotsVertical-Czhni7yG.js";import"./Download01-CDh7RxaN.js";import"./Settings02-S2K24EWO.js";import"./Eye-BKjf_vUO.js";import"./Share07-BaevX8Mw.js";import"./Globe01-k6r26TAV.js";import"./XClose-DA1jDjt_.js";import"./Image01-DpNFr3GM.js";import"./Key01-BkaZy7Ah.js";import"./LayoutLeft-D1fYrUGp.js";import"./Link01-D45u3Kwy.js";import"./Monitor01-BjQTJmPT.js";import"./Sun-edqgTWqM.js";import"./Package-MW9FV2l6.js";import"./Palette-D2r_rP7A.js";import"./Play-CQYqv81V.js";import"./SearchMd-BCQ1CyGA.js";import"./Stars01-DxWX4pOr.js";import"./Trash01-CDngQkql.js";import"./Upload01-D48ElPif.js";import"./User01-CEit44ru.js";import"./Users01-Drj4BA_j.js";import"./XCircle-DoUWUf9d.js";import"./Zap-C8hEZAXG.js";import"./index-Ci3mCUbP.js";import"./sandbox-url-D3mC8qhT.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./slugify-CEUa2lfQ.js";import"./index-CpZ_1mN7.js";import"./decofile-api-xtxqfgRa.js";import"./utils-BcWFUEDf.js";import"./pair-B93l5mBb.js";import"./format-time-BtXRrtv4.js";import"./differenceInSeconds-C3x8sHUj.js";import"./collapsible-1Kj_Hjxx.js";import"./use-copy-CIAIrC4p.js";import"./usage-stats-BrYXmxF3.js";import"./markdown-D50yVO4b.js";import"./org-file-open-context-bJmEvFz7.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-C46rwnJa.js";import"./types-CCxzQATz.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./gateway-client-CSBLiew8.js";import"./tool-namespace-DmnQIdtF.js";import"./utils-CVEq3hMx.js";import"./sheet-CFcU_I-W.js";import"./integration-icon-BbMj8xyp.js";import"./use-connection-zRPDIQ_n.js";import"./use-navigate-to-agent-BCAq2VrI.js";import"./github-repo-BknN0SVI.js";import"./use-mcp-prompts-2U0nS-wa.js";import"./index-CGR18BSj.js";import"./form-C_kDn5va.js";import"./label-nMs4JvQM.js";import"./use-thread-outputs-U4dosc_t.js";import"./file-type-icon-VOg1Vfy5.js";import"./scroll-area-DglU8OjO.js";import"./select-CQa_dQzn.js";import"./calendar-CSr2hmIz.js";import"./textarea-DTACqjWS.js";import"./rich-text-link-control-Beqn4IaU.js";import"./switch-RF4lhbzX.js";import"./safe-image-url-D5z803Ot.js";import"./search-input-B0JWJqt0.js";import"./tabs-CpJgNx30.js";import"./use-debounced-value-B3_m5S__.js";import"./use-file-configs-BRGqSXQ6.js";import"./asset-utils-R2NmFVJk.js";import"./useInfiniteQuery-oFY--skC.js";import"./infiniteQueryObserver-ZTOME-Yd.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./toggle-group-8GW330jn.js";import"./alert-dialog-CVY7NpNS.js";import"./sandbox-git-api-CMdpE2TE.js";import"./avatar-qzN7CafM.js";import"./download-app-dialog-t4N-N3uU.js";import"./project-icon-DcxLNBvR.js";import"./required-auth-layout-c8IKViEL.js";import"./use-org-sso-Dv-UbNYl.js";import"./editor-T3L5r0Fu.js";import"./repository-picker-oVfzv-hF.js";import"./collection-search-CY6qtMl2.js";import"./use-route-default-main-Cqwf9yFF.js";import"./use-mcp-tools-IEW4h9lj.js";import"./index-DnDIM2xu.js";import"./drawer-CgkgucN1.js";import"./input-CcdXXTty.js";import"./chat-draft-VxzhQrWJ.js";import"./use-deco-credits-B92-uMQD.js";import"./use-open-billing-url-CqH0MvxG.js";import"./decopilot-BgEg3OT6.js";import"./checkbox-CeU6IqeR.js";import"./ai-providers-logos-DD3qZ33J.js";import"./index-WCc3fcxd.js";import"./input-B4lbwedr.js";import"./hooks-B2mYVhP_.js";import"./use-org-fs-DES7wpqb.js";import"./question-004-sINsf4GQ.js";import"./use-members-CthmHZKF.js";import"./use-org-auth-client-CLrcF9If.js";import"./add-connection-dialog-B2QrTqPz.js";import"./extract-connection-data-DcLFWp9p.js";import"./metadata-dUsYcpuu.js";import"./github-D4UJ99TO.js";import"./connection-DHsoRZa4.js";import"./connection-card-B4Lfzhnd.js";import"./use-registry-connections-D-bmaapw.js";import"./retry-i8LvYSZg.js";import"./connection-slug-CITJ0kGN.js";import"./connection-form-helpers-Do68AahQ.js";import"./authenticate-and-persist-oauth-w1UaCnqr.js";import"./mcp-oauth-D9zitCdn.js";import"./collection-tabs-C75WAB0u.js";import"./badge-Jn9rjNBm.js";import"./use-infinite-scroll-CWZ-jt-q.js";import"./useSuspenseInfiniteQuery-CeJnbkNg.js";import"./use-project-native-view-presence-D4KcE4ZV.js";import"./site-slug-uya6Wp4-.js";const pa={mode:"none",iframeBase:null,showBlockingOverlay:!1,showWakingPill:!1};function fa(t){const{previewState:e,progressStatus:s,fastPreviewActive:r=!1,fastPreviewReady:i=!1,codingSession:u=!1}=t,c=u?null:t.previewServerUrl;return e.kind==="suspended"||e.kind==="errored"?pa:r&&i&&c?{mode:"production",iframeBase:c,showBlockingOverlay:!1,showWakingPill:!1}:!r&&e.kind==="iframe"&&s!=="doing"?{mode:"sandbox",iframeBase:e.previewUrl,showBlockingOverlay:!1,showWakingPill:!1}:c?{mode:"production",iframeBase:c,showBlockingOverlay:!1,showWakingPill:!0}:{mode:"none",iframeBase:null,showBlockingOverlay:!0,showWakingPill:!1}}const ha=1e4,ga=1e3,va=3e4;function xa({iframeRef:t,src:e,active:s}){const r=x.useRef(0),i=x.useRef(null),u=x.useRef(null),c=x.useRef(e),d=x.useRef(s);c.current=e,d.current=s;const o=()=>{i.current&&clearTimeout(i.current),u.current&&clearTimeout(u.current),i.current=null,u.current=null},l=()=>{i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{i.current=null,h()},ha)},h=()=>{if(!d.current||!c.current)return;u.current&&clearTimeout(u.current);const E=Ss(va,ga,r.current,2,.5);r.current+=1,u.current=setTimeout(()=>{u.current=null;const g=t.current,P=c.current;!g||!P||!d.current||(g.src=P,l())},E)},p=()=>{r.current=0,o()},f=()=>{i.current&&(clearTimeout(i.current),i.current=null),h()};return x.useEffect(()=>{if(o(),r.current=0,!(!s||!e))return l(),o},[e,s]),{handleLoad:p,handleError:f}}var nr;(function(t){t.WINDOW_RESIZED="tauri://resize",t.WINDOW_MOVED="tauri://move",t.WINDOW_CLOSE_REQUESTED="tauri://close-requested",t.WINDOW_DESTROYED="tauri://destroyed",t.WINDOW_FOCUS="tauri://focus",t.WINDOW_BLUR="tauri://blur",t.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",t.WINDOW_THEME_CHANGED="tauri://theme-changed",t.WINDOW_CREATED="tauri://window-created",t.WINDOW_SUSPENDED="tauri://suspended",t.WINDOW_RESUMED="tauri://resumed",t.WEBVIEW_CREATED="tauri://webview-created",t.DRAG_ENTER="tauri://drag-enter",t.DRAG_OVER="tauri://drag-over",t.DRAG_DROP="tauri://drag-drop",t.DRAG_LEAVE="tauri://drag-leave"})(nr||(nr={}));const ba=Ft({tag:Ee(),id:Ee(),classes:Ee(),text:Ee(),html:Ee(),manifestKey:Ee().nullable(),componentName:Ee().nullable(),parents:Ee(),url:Ee(),path:Ee(),viewport:Ft({width:et(),height:et()}),position:Ft({x:et(),y:et()})}),ya=`(function() {
3
+ if (window.__visualEditorActive) return;
4
+ window.__visualEditorActive = true;
5
+
6
+ var cursorStyle = document.createElement("style");
7
+ cursorStyle.textContent = "* { cursor: default !important; }";
8
+ document.head.appendChild(cursorStyle);
9
+
10
+ var highlight = document.createElement("div");
11
+ highlight.style.cssText = "position:fixed;pointer-events:none;outline:2px solid #a855f7;background:rgba(168,85,247,0.08);border-radius:2px;z-index:2147483647;display:none;";
12
+ document.body.appendChild(highlight);
13
+
14
+ var badge = document.createElement("div");
15
+ badge.style.cssText = "position:fixed;pointer-events:none;background:#a855f7;color:white;font:11px/1 monospace;padding:2px 6px;border-radius:2px;z-index:2147483647;display:none;white-space:nowrap;max-width:240px;overflow:hidden;text-overflow:ellipsis;";
16
+ document.body.appendChild(badge);
17
+
18
+ var lastTarget = null;
19
+ var rafPending = false;
20
+ var moveHandler = function(e) {
21
+ if (rafPending) return;
22
+ rafPending = true;
23
+ var target = e.target;
24
+ requestAnimationFrame(function() {
25
+ rafPending = false;
26
+ var el = target;
27
+ if (!el || el === highlight || el === badge) return;
28
+ if (el === lastTarget) return;
29
+ lastTarget = el;
30
+ var r = el.getBoundingClientRect();
31
+ highlight.style.display = "block";
32
+ highlight.style.top = r.top + "px";
33
+ highlight.style.left = r.left + "px";
34
+ highlight.style.width = r.width + "px";
35
+ highlight.style.height = r.height + "px";
36
+ var tag = el.tagName.toLowerCase();
37
+ var id = el.id ? "#" + el.id : "";
38
+ var cls = el.className && typeof el.className === "string"
39
+ ? "." + el.className.trim().split(/\\s+/).slice(0, 2).join(".")
40
+ : "";
41
+ badge.textContent = tag + id + cls;
42
+ badge.style.display = "block";
43
+ badge.style.top = Math.max(0, r.top - 20) + "px";
44
+ badge.style.left = r.left + "px";
45
+ });
46
+ };
47
+ document.addEventListener("mousemove", moveHandler, true);
48
+
49
+ var outHandler = function(e) {
50
+ if (!e.relatedTarget || e.relatedTarget === document.documentElement) {
51
+ highlight.style.display = "none";
52
+ badge.style.display = "none";
53
+ lastTarget = null;
54
+ }
55
+ };
56
+ document.addEventListener("mouseout", outHandler, true);
57
+
58
+ var clickHandler = function(e) {
59
+ e.preventDefault();
60
+ e.stopImmediatePropagation();
61
+ var el = e.target;
62
+ if (!el || el === highlight || el === badge) return;
63
+
64
+ highlight.style.outline = "2px solid #a855f7";
65
+ highlight.style.background = "rgba(168,85,247,0.15)";
66
+ setTimeout(function() {
67
+ highlight.style.outline = "2px solid #a855f7";
68
+ highlight.style.background = "rgba(168,85,247,0.08)";
69
+ }, 400);
70
+
71
+ var tag = el.tagName.toLowerCase();
72
+ var id = el.id || "";
73
+ var classes = el.className && typeof el.className === "string" ? el.className.trim() : "";
74
+ var text = (el.textContent || "").trim().slice(0, 200);
75
+ var html = (el.outerHTML || "").slice(0, 800).replace(/\\svalue=("[^"]*"|'[^']*'|\\S+)/gi, "");
76
+
77
+ var closestSection = el.closest("section[data-manifest-key]");
78
+ var manifestKey = closestSection ? closestSection.getAttribute("data-manifest-key") : null;
79
+
80
+ var ancestor = el;
81
+ var componentName = null;
82
+ for (var i = 0; i < 10 && ancestor; i++) {
83
+ if (ancestor.dataset) componentName = ancestor.dataset.componentName || componentName;
84
+ ancestor = ancestor.parentElement;
85
+ }
86
+
87
+ var parents = [];
88
+ var p = el.parentElement;
89
+ for (var j = 0; j < 4 && p && p !== document.body; j++) {
90
+ var pTag = p.tagName ? p.tagName.toLowerCase() : "";
91
+ var pId = p.id ? "#" + p.id : "";
92
+ var pCls = p.className && typeof p.className === "string"
93
+ ? "." + p.className.trim().split(/\\s+/)[0]
94
+ : "";
95
+ parents.unshift(pTag + pId + pCls);
96
+ p = p.parentElement;
97
+ }
98
+
99
+ window.parent.postMessage({
100
+ type: "visual-editor::element-clicked",
101
+ payload: {
102
+ tag: tag, id: id, classes: classes, text: text, html: html,
103
+ manifestKey: manifestKey, componentName: componentName,
104
+ parents: parents.join(" > "),
105
+ url: window.location.href, path: window.location.pathname,
106
+ viewport: { width: window.innerWidth, height: window.innerHeight },
107
+ position: { x: Math.round(e.clientX), y: Math.round(e.clientY) }
108
+ }
109
+ }, "*");
110
+ };
111
+ document.addEventListener("click", clickHandler, true);
112
+
113
+ window.addEventListener("message", function(e) {
114
+ // Only Studio's own postMessage (source === this frame's parent) may drive the bridge — a nested/downstream frame's forged message can't deactivate the editor.
115
+ if (e.source !== window.parent) return;
116
+ // Parent-driven clear: the cross-origin iframe can't self-detect a frame exit.
117
+ if (e.data && e.data.type === "visual-editor::clear-hover") {
118
+ highlight.style.display = "none";
119
+ badge.style.display = "none";
120
+ lastTarget = null;
121
+ return;
122
+ }
123
+ if (e.data && e.data.type === "visual-editor::deactivate") {
124
+ highlight.remove();
125
+ badge.remove();
126
+ cursorStyle.remove();
127
+ document.removeEventListener("mousemove", moveHandler, true);
128
+ document.removeEventListener("mouseout", outHandler, true);
129
+ document.removeEventListener("click", clickHandler, true);
130
+ window.__visualEditorActive = false;
131
+ }
132
+ });
133
+ })();`;function wa(t,e){const s=t.map(()=>null),r=[];for(let f=0;f<t.length;f++)t[f]!==null&&r.push(f);const i=r.length,u=e.length;if(!i||!u)return s;const c=(f,E)=>{const g=t[r[f]??0];return!g||!g.length?1:g.indexOf(e[E]??"")>=0?2:0},d=[],o=[];for(let f=0;f<=i;f++)d.push(new Array(u+1).fill(0)),o.push(new Array(u+1).fill(2));for(let f=1;f<=i;f++){const E=d[f-1]??[],g=d[f]??[],P=o[f]??[];for(let b=1;b<=u;b++){let v=E[b]??0,R=2;const y=g[b-1]??0;y>v&&(v=y,R=0);const w=c(f-1,b-1),k=(E[b-1]??0)+w;w>0&&k>v&&(v=k,R=1),g[b]=v,P[b]=R}}let l=0,h=i,p=u;for(;h>0&&p>0;){const f=o[h]?.[p]??2;f===1?(s[r[h-1]??0]=p-1,l++,h--,p--):f===0?p--:h--}if(l===0&&u===i)for(let f=0;f<i;f++)s[r[f]??0]=f;return s}const ka=Ft({sectionIndex:et(),manifestKey:Ee(),clickSeq:et()}),rr=`(function() {
134
+ if (window.__cmsEditorActive) return;
135
+ window.__cmsEditorActive = true;
136
+
137
+ // Preserve scroll across variant-override navigations and save-reloads.
138
+ // Selecting a variant rebuilds the iframe src (new x-deco-matchers-override)
139
+ // or reloads it, which would otherwise jump to the top. We persist the scroll
140
+ // offset to sessionStorage (survives reload, same-origin) keyed by pathname
141
+ // (the override only changes the query, so the key is stable), then restore it
142
+ // on the next load — retried for ~1s so it outlasts re-hydration and lazy
143
+ // sections that grow the page after load. The recency guard avoids restoring a
144
+ // stale offset on a genuinely fresh visit.
145
+ var SCROLL_KEY = "__cms_preview_scroll:" + location.pathname;
146
+ var saveScroll = function() {
147
+ try {
148
+ sessionStorage.setItem(SCROLL_KEY, JSON.stringify({
149
+ x: window.scrollX, y: window.scrollY, t: Date.now()
150
+ }));
151
+ } catch (_) {}
152
+ };
153
+ var saveScrollPending = false;
154
+ window.addEventListener("scroll", function() {
155
+ if (saveScrollPending) return;
156
+ saveScrollPending = true;
157
+ requestAnimationFrame(function() { saveScrollPending = false; saveScroll(); });
158
+ }, { passive: true });
159
+ (function restoreScroll() {
160
+ var raw = null;
161
+ try { raw = sessionStorage.getItem(SCROLL_KEY); } catch (_) {}
162
+ if (!raw) return;
163
+ var saved = null;
164
+ try { saved = JSON.parse(raw); } catch (_) { return; }
165
+ if (!saved || (Date.now() - saved.t) > 10000) return;
166
+ if (!saved.x && !saved.y) return;
167
+ var attempts = 0;
168
+ var apply = function() {
169
+ attempts++;
170
+ window.scrollTo(saved.x || 0, saved.y || 0);
171
+ if (attempts < 8) setTimeout(apply, 120);
172
+ };
173
+ apply();
174
+ })();
175
+
176
+ var highlight = document.createElement("div");
177
+ highlight.style.cssText = "position:absolute;pointer-events:none;outline:2px solid #06b6d4;background:rgba(6,182,212,0.06);border-radius:2px;z-index:2147483647;display:none;";
178
+ document.body.appendChild(highlight);
179
+
180
+ var badge = document.createElement("div");
181
+ badge.style.cssText = "position:absolute;pointer-events:none;background:#06b6d4;color:white;font:11px/1 monospace;padding:2px 6px;border-radius:2px;z-index:2147483647;display:none;white-space:nowrap;max-width:240px;overflow:hidden;text-overflow:ellipsis;";
182
+ document.body.appendChild(badge);
183
+
184
+ var isTopLevelSection = function(el) {
185
+ return el && el.parentElement
186
+ ? !el.parentElement.closest("section[data-manifest-key]")
187
+ : true;
188
+ };
189
+
190
+ // All top-level page sections in DOM order (deco renders page sections as
191
+ // <section data-manifest-key>; nested islands/sections carry the attribute
192
+ // too, hence the top-level filter). This is the full DOM run, framework
193
+ // sections included — getAllSections() narrows it to the editable window.
194
+ var topLevelSections = function() {
195
+ return Array.from(document.querySelectorAll("section[data-manifest-key]"))
196
+ .filter(isTopLevelSection);
197
+ };
198
+
199
+ // Acceptable DOM keys per section; [] = wildcard, null = renders nothing.
200
+ var sectionCandidates = [];
201
+
202
+ // Stringified from section-alignment.ts so both sides share one copy.
203
+ var alignSections = ${wa.toString()};
204
+
205
+ // Indexed like the decofile array; unmapped entries stay null (not clickable).
206
+ var computeAlignment = function(tops) {
207
+ var domKeys = tops.map(function(s) { return s.getAttribute("data-manifest-key"); });
208
+ return alignSections(sectionCandidates, domKeys).map(function(idx) {
209
+ return idx === null ? null : tops[idx];
210
+ });
211
+ };
212
+
213
+ // Editable sections, indexed to match the decofile array the panel uses.
214
+ // Recomputed from the live DOM each call (cheap, rAF-throttled) so it
215
+ // self-heals as client-rendered/lazy sections mount. Until the editor sends
216
+ // candidates, fall back to the full top-level run.
217
+ var getAllSections = function() {
218
+ var tops = topLevelSections();
219
+ return sectionCandidates.length ? computeAlignment(tops) : tops;
220
+ };
221
+
222
+ // Resolve to the OUTERMOST page-level section (clicking nested content still
223
+ // maps to the top-level section the panel indexes); null if it isn't in the
224
+ // aligned editable set (a framework section deco injected).
225
+ var findSection = function(el, out) {
226
+ var node = el;
227
+ var found = null;
228
+ while (node && node !== document.body) {
229
+ if (node.tagName === "SECTION" && node.hasAttribute && node.hasAttribute("data-manifest-key")) {
230
+ found = node;
231
+ }
232
+ node = node.parentElement;
233
+ }
234
+ if (!found) return null;
235
+ var sections = getAllSections();
236
+ if (out) out.sections = sections;
237
+ return sections.indexOf(found) >= 0 ? found : null;
238
+ };
239
+
240
+ // A Lazy wrapper's key is just the loader — show the inner section's instead.
241
+ var LAZY_KEYS = [
242
+ "website/sections/Rendering/Lazy.tsx",
243
+ "website/sections/Rendering/SingleDeferred.tsx"
244
+ ];
245
+ var isLazyKey = function(key) {
246
+ return LAZY_KEYS.some(function(s) { return key.endsWith(s); });
247
+ };
248
+ var displayKey = function(section) {
249
+ var key = section.getAttribute("data-manifest-key") || "section";
250
+ if (isLazyKey(key)) {
251
+ var inner = section.querySelector("section[data-manifest-key]");
252
+ if (inner) return inner.getAttribute("data-manifest-key") || key;
253
+ }
254
+ return key;
255
+ };
256
+
257
+ // Per-section metadata sent by the editor, aligned by index with
258
+ // getAllSections(). labels: names the DOM can't carry (a global section or a
259
+ // global inside async rendering); kinds: section type that drives the color.
260
+ var sectionLabels = [];
261
+ var sectionKinds = [];
262
+ var labelFor = function(section, sections) {
263
+ var idx = (sections || getAllSections()).indexOf(section);
264
+ if (idx >= 0 && sectionLabels[idx]) return sectionLabels[idx];
265
+ return displayKey(section);
266
+ };
267
+ var kindFor = function(section, sections) {
268
+ var idx = (sections || getAllSections()).indexOf(section);
269
+ return (idx >= 0 && sectionKinds[idx]) || "normal";
270
+ };
271
+
272
+ // Highlight palette by section kind: global = light purple, variant = green,
273
+ // normal = blue.
274
+ var COLORS = {
275
+ normal: { solid: "#06b6d4", bg: "rgba(6,182,212,0.06)", active: "rgba(6,182,212,0.18)" },
276
+ global: { solid: "#c084fc", bg: "rgba(192,132,252,0.10)", active: "rgba(192,132,252,0.22)" },
277
+ variant: { solid: "#22c55e", bg: "rgba(34,197,94,0.08)", active: "rgba(34,197,94,0.20)" }
278
+ };
279
+ var applyColor = function(kind) {
280
+ var c = COLORS[kind] || COLORS.normal;
281
+ highlight.style.outline = "2px solid " + c.solid;
282
+ highlight.style.background = c.bg;
283
+ badge.style.background = c.solid;
284
+ };
285
+
286
+ var lastSection = null;
287
+ var lastLabel = "";
288
+ var lastKind = "normal";
289
+ var rafPending = false;
290
+ // True while an in-place render fetch/swap is in flight; suppresses hover so it can't re-show the overlay right before the swap snapshots it.
291
+ var renderPending = false;
292
+
293
+ // Document-relative coordinates (rect + scroll) on absolutely-positioned
294
+ // nodes, so the browser scrolls the highlight together with the page
295
+ // natively — no per-frame JS repositioning, no scroll lag.
296
+ var positionHighlight = function(section) {
297
+ var r = section.getBoundingClientRect();
298
+ var top = r.top + window.scrollY;
299
+ var left = r.left + window.scrollX;
300
+ highlight.style.display = "block";
301
+ highlight.style.top = top + "px";
302
+ highlight.style.left = left + "px";
303
+ highlight.style.width = r.width + "px";
304
+ highlight.style.height = r.height + "px";
305
+ badge.textContent = lastLabel || displayKey(section);
306
+ badge.style.display = "block";
307
+ badge.style.top = Math.max(0, top - 20) + "px";
308
+ badge.style.left = left + "px";
309
+ };
310
+
311
+ var moveHandler = function(e) {
312
+ if (renderPending || rafPending) return;
313
+ rafPending = true;
314
+ var target = e.target;
315
+ requestAnimationFrame(function() {
316
+ rafPending = false;
317
+ if (renderPending) return;
318
+ if (!target || target === highlight || target === badge) return;
319
+ var out = {};
320
+ var section = findSection(target, out);
321
+ if (section === lastSection) return;
322
+ lastSection = section;
323
+ if (!section) {
324
+ highlight.style.display = "none";
325
+ badge.style.display = "none";
326
+ return;
327
+ }
328
+ lastLabel = labelFor(section, out.sections);
329
+ lastKind = kindFor(section, out.sections);
330
+ applyColor(lastKind);
331
+ positionHighlight(section);
332
+ });
333
+ };
334
+ document.addEventListener("mousemove", moveHandler, true);
335
+
336
+ // Window scroll is handled natively by the absolute positioning above; this
337
+ // only re-syncs on resize and on scrolls inside nested scroll containers
338
+ // (capture=true catches those), where document coordinates do shift.
339
+ var reposition = function() {
340
+ if (!lastSection || highlight.style.display === "none") return;
341
+ if (rafPending) return;
342
+ rafPending = true;
343
+ requestAnimationFrame(function() {
344
+ rafPending = false;
345
+ if (lastSection && highlight.style.display !== "none") positionHighlight(lastSection);
346
+ });
347
+ };
348
+ window.addEventListener("scroll", reposition, { capture: true, passive: true });
349
+ window.addEventListener("resize", reposition, { passive: true });
350
+
351
+ var outHandler = function(e) {
352
+ if (!e.relatedTarget || e.relatedTarget === document.documentElement) {
353
+ highlight.style.display = "none";
354
+ badge.style.display = "none";
355
+ lastSection = null;
356
+ }
357
+ };
358
+ document.addEventListener("mouseout", outHandler, true);
359
+
360
+ var clickSeq = 0;
361
+
362
+ // Blocks observes clicks to select sections in the side panel; it must not
363
+ // cancel the iframe page's own handlers or native control behavior.
364
+ var clickHandler = function(e) {
365
+ var target = e.target;
366
+ if (!target || target === highlight || target === badge) return;
367
+ var out = {};
368
+ var section = findSection(target, out);
369
+ if (!section) return;
370
+
371
+ var sectionIndex = out.sections.indexOf(section);
372
+ var manifestKey = section.getAttribute("data-manifest-key") || "";
373
+
374
+ var c = COLORS[lastKind] || COLORS.normal;
375
+ highlight.style.outline = "2px solid " + c.solid;
376
+ highlight.style.background = c.active;
377
+ setTimeout(function() {
378
+ highlight.style.background = c.bg;
379
+ }, 400);
380
+
381
+ clickSeq++;
382
+ window.parent.postMessage({
383
+ type: "cms-editor::section-clicked",
384
+ payload: { sectionIndex: sectionIndex, manifestKey: manifestKey, clickSeq: clickSeq }
385
+ }, "*");
386
+ };
387
+ document.addEventListener("click", clickHandler, true);
388
+
389
+ /**
390
+ * Navigation is disabled while editing: leaving the page would leave the
391
+ * panel editing the previous page's sections. Only the default action of a
392
+ * real navigation is cancelled, never propagation — in-page controls must
393
+ * keep working (#5567).
394
+ */
395
+ var isNavigatingAnchor = function(a) {
396
+ if (!a) return false;
397
+ var href = a.getAttribute("href");
398
+ if (!href) return false;
399
+ var trimmed = href.trim();
400
+ if (!trimmed || trimmed.charAt(0) === "#") return false;
401
+ if (/^javascript:/i.test(trimmed)) return false;
402
+ // Same document + fragment only scrolls.
403
+ try {
404
+ var url = new URL(a.href, location.href);
405
+ if (url.href.split("#")[0] === location.href.split("#")[0]) return false;
406
+ } catch (_) {}
407
+ return true;
408
+ };
409
+ var navBlocker = function(e) {
410
+ var el = e.target;
411
+ var a = el && el.closest ? el.closest("a") : null;
412
+ if (!isNavigatingAnchor(a)) return;
413
+ e.preventDefault();
414
+ };
415
+ document.addEventListener("click", navBlocker, true);
416
+
417
+ var submitBlocker = function(e) { e.preventDefault(); };
418
+ document.addEventListener("submit", submitBlocker, true);
419
+
420
+ // Fast Preview in-place render: POST merged decofile to /live/previews, swap the HTML in (document/window listeners survive; overlay nodes get re-attached).
421
+ var renderCtrl = null;
422
+ var renderQueue = Promise.resolve();
423
+ var TRANSITION_TAG =
424
+ "<style id=\\"deco-disable-transitions\\">* { transition: none !important; }</style></head>";
425
+ var renderInPlace = function(src, body) {
426
+ if (renderCtrl) renderCtrl.abort();
427
+ var ctrl = new AbortController();
428
+ renderCtrl = ctrl;
429
+ renderPending = true;
430
+ highlight.style.display = "none";
431
+ badge.style.display = "none";
432
+ window.parent.postMessage({ type: "cms-editor::render-start" }, "*");
433
+ renderQueue = renderQueue.then(function() {
434
+ return fetch(src, {
435
+ method: "POST",
436
+ body: body,
437
+ signal: ctrl.signal,
438
+ headers: { accept: "text/html", "content-type": "application/json" }
439
+ }).then(function(res) {
440
+ if (!res.ok) throw new Error("render " + res.status);
441
+ return res.text();
442
+ }).then(function(html) {
443
+ var swap = function() {
444
+ document.documentElement.innerHTML = html.replace("</head>", TRANSITION_TAG);
445
+ document.body.appendChild(highlight);
446
+ document.body.appendChild(badge);
447
+ // Old section is gone; hide the overlay until the next hover repositions it.
448
+ highlight.style.display = "none";
449
+ badge.style.display = "none";
450
+ lastSection = null;
451
+ };
452
+ var headHtml = html.slice(html.indexOf("<head>"), html.indexOf("</head>") + 7);
453
+ var doc = new DOMParser().parseFromString(headHtml, "text/html");
454
+ var sheets = Array.prototype.map.call(
455
+ doc.head.querySelectorAll("link[rel=\\"stylesheet\\"]"),
456
+ function(el) { return el.href ? fetch(el.href).catch(function() {}) : null; }
457
+ );
458
+ return Promise.all(sheets).then(function() {
459
+ if (typeof document.startViewTransition === "function") {
460
+ return document.startViewTransition(swap).finished;
461
+ }
462
+ swap();
463
+ });
464
+ }).then(function() {
465
+ var t = document.getElementById("deco-disable-transitions");
466
+ if (t) t.remove();
467
+ if (ctrl === renderCtrl) renderPending = false;
468
+ window.parent.postMessage({ type: "cms-editor::render-end" }, "*");
469
+ }).catch(function(err) {
470
+ if (ctrl === renderCtrl) renderPending = false;
471
+ if (err && err.name === "AbortError") return;
472
+ window.parent.postMessage({ type: "cms-editor::render-error" }, "*");
473
+ });
474
+ });
475
+ };
476
+
477
+ window.addEventListener("message", function(e) {
478
+ // Only Studio's own postMessage (source === this frame's parent) may drive the bridge — forged senders can't trigger the render fetch/swap.
479
+ if (e.source !== window.parent) return;
480
+ if (e.data && e.data.type === "cms-editor::render" && typeof e.data.src === "string") {
481
+ renderInPlace(e.data.src, e.data.body);
482
+ return;
483
+ }
484
+ if (e.data && e.data.type === "cms-editor::set-labels" && Array.isArray(e.data.labels)) {
485
+ sectionLabels = e.data.labels;
486
+ if (Array.isArray(e.data.kinds)) sectionKinds = e.data.kinds;
487
+ if (Array.isArray(e.data.keys)) sectionCandidates = e.data.keys;
488
+ if (lastSection) {
489
+ lastLabel = labelFor(lastSection);
490
+ lastKind = kindFor(lastSection);
491
+ applyColor(lastKind);
492
+ if (highlight.style.display !== "none") positionHighlight(lastSection);
493
+ }
494
+ return;
495
+ }
496
+ // Parent-driven clear: the cross-origin iframe can't self-detect a frame exit.
497
+ if (e.data && e.data.type === "cms-editor::clear-hover") {
498
+ highlight.style.display = "none";
499
+ badge.style.display = "none";
500
+ lastSection = null;
501
+ return;
502
+ }
503
+ if (e.data && e.data.type === "cms-editor::deactivate") {
504
+ highlight.remove();
505
+ badge.remove();
506
+ document.removeEventListener("mousemove", moveHandler, true);
507
+ document.removeEventListener("mouseout", outHandler, true);
508
+ document.removeEventListener("click", clickHandler, true);
509
+ // Or the page stays unnavigable after leaving Blocks mode.
510
+ document.removeEventListener("click", navBlocker, true);
511
+ document.removeEventListener("submit", submitBlocker, true);
512
+ window.removeEventListener("scroll", reposition, { capture: true });
513
+ window.removeEventListener("resize", reposition);
514
+ window.__cmsEditorActive = false;
515
+ }
516
+ });
517
+ })();`;function dn(t,e){let s=t,r=typeof s?.__resolveType=="string"?s.__resolveType:"";for(let i=0;r&&i<5;i++){const u=e[r];if(u&&typeof u=="object"&&"__resolveType"in u){const c=u.__resolveType;if(typeof c=="string"&&c&&c!==r){s=u,r=c;continue}}break}if(!r)return[];if(r.includes("flags/multivariate")){const i=Array.isArray(s.variants)?s.variants:[];if(i.length===0||i.every(d=>d?.rule?.__resolveType===Ks))return null;const c=[];for(const d of i){const o=d?.value;if(o&&typeof o=="object")for(const l of dn(o,e)??[])c.includes(l)||c.push(l)}return c}if(Hs(r)){const i=s.section&&typeof s.section=="object"?dn(s.section,e):[];return i===null?null:i.length?[r,...i]:[r]}return[r]}function Xe(t){return t.replace(/[`*_]/g,"\\$&")}function Pa(t,e){const s=[`The user selected an element on the live preview and asked: **"${Xe(e.trim())}"**`,"","For text content changes, locate the correct source file and apply the change.","For code and CSS changes, understand which component the user is referring to and apply changes to the correct component.",""];t.manifestKey&&s.push(`**Section resolveType:** \`${Xe(t.manifestKey)}\``,"","This is a Deco resolveType, not a literal file path. The leading segment is the app name, not a directory — the actual source file lives under a sections directory whose root varies by site (commonly `sections/`, `src/sections/`, or `site/sections/`). Locate the file by searching for the trailing path (e.g. the component filename), don't assume the resolveType is a valid path on disk.","");const r=`<${t.tag}${t.classes?` class="${Xe(t.classes)}"`:""}>`;s.push(`**Clicked element:** \`${r}\``),t.parents&&s.push(`**DOM breadcrumb:** ${Xe(t.parents)} > ${t.tag}`),t.text&&s.push(`**Text content:** "${Xe(t.text)}"`),t.componentName&&s.push(`**Component name:** ${Xe(t.componentName)}`);const i=t.html.replace(/```/g,"`` `");return s.push("","**HTML snippet:**","```html",i,"```"),s.push("","Please read the source file, locate the element, and apply the requested change."),s.join(`
518
+ `)}function Sa(t,e,s=320,r=44,i=12){const{x:u,y:c}=t,{width:d,height:o}=e,l=Math.max(i,Math.min(u-s/2,d-s-i)),p=c/o>.68?Math.max(i,c-r-18):Math.min(c+18,o-r-i);return{leftPct:l/d*100,topPct:p/o*100}}function ja(t){const e=ue.c(45),{element:s,onDismiss:r}=t,[i,u]=x.useState(""),c=x.useRef(null),{sendMessage:d}=ps(),{openSidePanel:o}=na(),l=Le();let h;e[0]!==s||e[1]!==i||e[2]!==r||e[3]!==o||e[4]!==d?(h=()=>{if(!i.trim())return;const B=Pa(s,i);o(),d({parts:[{type:"text",text:B}]}),r()},e[0]=s,e[1]=i,e[2]=r,e[3]=o,e[4]=d,e[5]=h):h=e[5];const p=h;let f;e[6]!==s.position||e[7]!==s.viewport?(f=Sa(s.position,s.viewport),e[6]=s.position,e[7]=s.viewport,e[8]=f):f=e[8];const E=f,g=`${E.leftPct}%`,P=`${E.topPct}%`;let b;e[9]!==g||e[10]!==P?(b={left:g,top:P,width:"320px"},e[9]=g,e[10]=P,e[11]=b):b=e[11];let v;e[12]!==p?(v=B=>{B.preventDefault(),p()},e[12]=p,e[13]=v):v=e[13];let R;e[14]===Symbol.for("react.memo_cache_sentinel")?(R=B=>u(B.target.value),e[14]=R):R=e[14];let y;e[15]!==r?(y=B=>{B.key==="Escape"&&r()},e[15]=r,e[16]=y):y=e[16];let w;e[17]!==l?(w=l("sandbox.visualEditorPrompt.inputPlaceholder"),e[17]=l,e[18]=w):w=e[18];let k;e[19]!==i||e[20]!==y||e[21]!==w?(k=n.jsx("input",{ref:c,autoFocus:!0,type:"text",value:i,onChange:R,onKeyDown:y,placeholder:w,className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground"}),e[19]=i,e[20]=y,e[21]=w,e[22]=k):k=e[22];let S;e[23]!==i?(S=i.trim(),e[23]=i,e[24]=S):S=e[24];const T=!S;let j;e[25]!==l?(j=l("sandbox.visualEditorPrompt.sendButton"),e[25]=l,e[26]=j):j=e[26];let H;e[27]!==l?(H=l("sandbox.visualEditorPrompt.sendButton"),e[27]=l,e[28]=H):H=e[28];let J;e[29]!==H?(J=n.jsx("title",{children:H}),e[29]=H,e[30]=J):J=e[30];let M;e[31]===Symbol.for("react.memo_cache_sentinel")?(M=n.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e[31]=M):M=e[31];let L;e[32]!==J?(L=n.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[J,M]}),e[32]=J,e[33]=L):L=e[33];let _;e[34]!==T||e[35]!==j||e[36]!==L?(_=n.jsx("button",{type:"submit",disabled:T,className:"flex h-6 w-6 shrink-0 items-center justify-center classic:rounded-full compact:rounded-lg bg-foreground text-background transition-opacity disabled:opacity-30",title:j,children:L}),e[34]=T,e[35]=j,e[36]=L,e[37]=_):_=e[37];let A;e[38]!==k||e[39]!==_||e[40]!==v?(A=n.jsxs("form",{className:"pointer-events-auto flex w-full items-center gap-1.5 rounded-xl border border-border bg-background/95 px-3 py-1.5 shadow-lg backdrop-blur",onSubmit:v,children:[k,_]}),e[38]=k,e[39]=_,e[40]=v,e[41]=A):A=e[41];let W;return e[42]!==A||e[43]!==b?(W=n.jsx("div",{className:"absolute z-30 pointer-events-none",style:b,children:A}),e[42]=A,e[43]=b,e[44]=W):W=e[44],W}const sr="site-links",Ea=/details?page|\bpdp\b/i,Na=/listingpage|\bplp\b/i;function Ca(t,e,s){const r=new Set;for(const d of s)Ea.test(d)&&r.add("product"),Na.test(d)&&r.add("category");const i=tt(hn(t)),u=i[i.length-1],c=i[i.length-2];return u?.type==="text"&&u.text==="/p"&&c?.type==="param"&&c.name===e&&r.add("product"),e==="*"&&i.some(d=>d.type==="param"&&d.name==="*")&&r.add("category"),r}const Ra=["rosa","preto","pink","black"];function At(t,e){const s=e.trim();return s?t(s):Ra.flatMap(r=>t(r))}function Ta(t,e){const s=e.trim(),r=[];/^\d+$/.test(s)&&r.push({resolveType:t,props:{ids:[s]}});const u=s.includes("-")&&!/\s/.test(s)?s.replace(/-+/g," "):s;return r.push({resolveType:t,props:{query:u,count:10}}),r}const _r=new Set(["vtex","shopify","shopify-mcp","magento","wake","linx","linx-impulse","nuvemshop","vnda","wap","salesforce"]);function vn(t){return t.split("/")[0]??""}function La(t){const e=new Set;for(const s of t){const r=vn(s);_r.has(r)&&e.add(r)}return e}function Oa(t,e){const s=vn(t);return!_r.has(s)||e.size===0?!0:e.has(s)}const _a=[{kind:"product",test:t=>t==="vtex/loaders/intelligentSearch/productList.ts",clientFilter:!1,buildRequests:(t,e)=>At(s=>Ta(t,s),e),optionsFromPayload:Dt},{kind:"product",test:t=>/magento\/.*products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>At(s=>[{resolveType:t,props:{props:{search:s,pageSize:10,currentPage:1}}}],e),optionsFromPayload:Dt},{kind:"product",test:t=>/algolia\/.*products?\/(list|suggestions)(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>At(s=>[{resolveType:t,props:{term:s,hitsPerPage:10}}],e),optionsFromPayload:Dt},{kind:"product",test:t=>/products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>At(s=>[{resolveType:t,props:{query:s,term:s,count:10,hitsPerPage:10}}],e),optionsFromPayload:Dt},{kind:"category",test:t=>t==="vtex/loaders/categories/tree.ts"||/categor(y|ies).*tree/i.test(t),clientFilter:!0,buildRequests:t=>[{resolveType:t,props:{}}],optionsFromPayload:za}];function Aa(t,e,s=new Set){const r=[...e],i=d=>{const o=[];for(const l of _a){if(l.kind!==d)continue;const h=r.find(p=>l.test(p)&&Oa(p,s));h&&o.push({cand:l,resolveType:h})}return o.find(l=>s.has(vn(l.resolveType)))??o[0]},u=(d,o,l)=>({kind:d.kind,id:`${d.kind}:${o}`,resolveType:o,clientFilter:d.clientFilter,isFallback:l,buildRequests:h=>d.buildRequests(o,h),optionsFromPayload:d.optionsFromPayload}),c=[];for(const d of["product","category"]){if(!t.has(d))continue;const o=i(d);o&&c.push(u(o.cand,o.resolveType,!1))}return t.size>0&&c.push(Da(t.has("category")?"category":"product")),c}function Da(t){return{kind:t,id:sr,resolveType:sr,clientFilter:!0,isFallback:!0,homepageLinks:!0,optionsFromPayload:(e,s)=>Wa(e,s)}}function Ge(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function $a(t,e,s){const r=new Set,i=new Set,u=c=>{if(Array.isArray(c)){for(const l of c)u(l);return}const d=Ge(c);if(!d)return;const o=d.__resolveType;if(typeof o=="string"){if(s(o))r.add(o);else if(o in e&&!i.has(o)){i.add(o);const l=Ge(e[o])?.__resolveType;typeof l=="string"&&s(l)&&r.add(o),u(e[o])}}for(const l of Object.values(d))u(l)};return u(t),r}function Ar(t){const e=new Set,s=[];for(const r of t)for(const i of r)e.has(i.value)||(e.add(i.value),s.push(i));return s}function Dr(t){try{return decodeURIComponent(t)}catch{return t}}function Fa(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ma(t){const e=[];let s="^";for(const r of t)r.type==="text"?s+=Fa(r.text):(e.push(r.name),s+=r.name==="*"?"(.+)":"([^/]+)");return{pattern:new RegExp(`${s}$`),order:e}}function $r(t,e,s){if(typeof t!="string"||!t)return null;let r;try{r=new URL(t,"https://placeholder.invalid").pathname}catch{return null}r=r.replace(/\/+$/,"");const i=tt(hn(e)),{pattern:u,order:c}=Ma(i),d=c.indexOf(s);if(d===-1)return null;const o=r.match(u);if(!o)return null;const l=o[d+1]?.replace(/^\/+|\/+$/g,"");return l?Dr(l):null}function Dt(t,e){const s=Ge(t),r=Array.isArray(t)?t:Array.isArray(s?.products)?s.products:Array.isArray(s?.list)?s.list:[],i=[],u=new Set;for(const c of r){const d=Ge(c);if(!d)continue;const o=$r(d.url,e.template,e.paramName);if(!o||u.has(o))continue;u.add(o);const l=Ge(d.isVariantOf),h=typeof l?.name=="string"&&l.name||typeof d.name=="string"&&d.name||o,p=Array.isArray(d.image)?Ge(d.image[0]):null,f=typeof p?.url=="string"?p.url:void 0;i.push({value:o,label:h,image:f})}return i}function Ba(t){if(typeof t!="string"||!t)return null;let e;try{e=new URL(t,"https://placeholder.invalid").pathname}catch{return null}const s=e.replace(/^\/+|\/+$/g,"");return s?Dr(s):null}function za(t){const e=[],s=new Set,r=(i,u)=>{const c=Ge(i);if(!c)return;const d=typeof c.name=="string"&&c.name?c.name:"",o=d?[...u,d]:u,l=Ba(c.url);if(l&&!s.has(l)&&(s.add(l),e.push({value:l,label:o.join(" › ")||l})),Array.isArray(c.children))for(const h of c.children)r(h,o)};if(Array.isArray(t))for(const i of t)r(i,[]);return e}const Ia=new Set(["login","logout","signin","sign-in","signup","sign-up","register","account","myaccount","my-account","minha-conta","conta","cart","carrinho","checkout","wishlist","favoritos","favorites","orders","pedidos","help","hc","sac","atendimento","contato","contact","institucional","newsletter","customer","sales","catalogsearch","search","busca","privacy-policy-cookie-restriction-mode"]);function Ka(t){return(t.split("/").filter(Boolean).pop()??t).replace(/[-_]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,s=>s.toUpperCase())}function Ha(t){if(typeof t!="string"||!t)return[];const e=[],s=/<a\b[^>]*?\bhref="([^"]+)"[^>]*>([\s\S]*?)<\/a>/gi;let r,i=0;for(;(r=s.exec(t))!==null&&i++<5e3;){const u=r[1]??"",c=(r[2]??"").replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim();e.push({href:u,text:c})}return e}function Ua(t){if(typeof t!="string"||!t)return[];const e=[],s=new Set,r=/"@type":"Product"[\s\S]{0,600}?(?:"url"|\burl):"([^"]+)"[\s\S]{0,300}?(?:"name"|\bname):"([^"]+)"/g,i=/(?:"image"|\bimage):\s*\[\s*\{[\s\S]{0,400}?(?:"url"|\burl):"([^"]+)"/;let u,c=0;for(;(u=r.exec(t))!==null&&c++<3e3;){const d=(u[1]??"").replace(/\\\//g,"/");if(!d||s.has(d))continue;s.add(d);const o=t.slice(u.index,u.index+900).match(i)?.[1]?.replace(/\\\//g,"/");e.push({url:d,name:u[2]??"",image:o||void 0})}return e}function Wa(t,e){const s=[],r=new Set,i=(u,c,d,o)=>{if(s.length>=200)return;const l=$r(u,e.template,e.paramName);!l||r.has(l)||e.paramName==="*"&&/(^|\/)p$/.test(l)||d==="category"&&Ia.has(l.split("/")[0]??"")||(r.add(l),s.push({value:l,label:c&&c.length<=80?c:Ka(l),kind:d,image:o}))};for(const{url:u,name:c,image:d}of Ua(t))i(u,c,"product",d);for(const{href:u,text:c}of Ha(t))u.startsWith("/")&&!u.startsWith("//")&&i(u,c,"category");return s}function ut(t,e,s=50){const r=e.trim().toLowerCase();return(r?t.filter(u=>u.label.toLowerCase().includes(r)||u.value.toLowerCase().includes(r)):t).slice(0,s)}const Fr=1e4;function Va(t){return{product:{noun:t("sandbox.pathParamPickerChip.kindProductNoun"),heading:t("sandbox.pathParamPickerChip.kindProductHeading")},category:{noun:t("sandbox.pathParamPickerChip.kindCategoryNoun"),heading:t("sandbox.pathParamPickerChip.kindCategoryHeading")}}}async function qa(t,{resolveType:e,props:s}){const r=await fetch(Cs(t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({__resolveType:e,...s}),signal:AbortSignal.timeout(Fr)});if(!r.ok)throw new Error(`Failed to fetch options: ${r.status}`);return r.json()}async function ar(t,e){const s=await fetch(Rs(t,e),{signal:AbortSignal.timeout(Fr)});if(!s.ok)throw new Error(`Failed to fetch page: ${s.status}`);return s.text()}async function Ga(t,e,s){const r=e.optionsFromPayload(await ar(t,"/"),s),i=r.find(c=>c.kind==="category");if(!i)return r;const u=Ke(s.template,{[s.paramName]:i.value});if(u==="/")return r;try{const c=e.optionsFromPayload(await ar(t,u),s).filter(d=>d.kind==="product");return Ar([r,c])}catch{return r}}function Ja(t,e,s){return as.sandboxInvoke(`${t.orgSlug}/${t.virtualMcpId}/${t.branch}`,`path-param-${e.id}:${e.clientFilter?"":s}`)}async function Ya(t,e,s,r){if(e.homepageLinks)return Ga(t,e,r);const i=e.buildRequests?.(s)??[];if(i.length===0)return[];const u=await Promise.allSettled(i.map(d=>qa(t,d))),c=u.filter(d=>d.status==="fulfilled").map(d=>d.value);if(c.length===0){const d=u.find(o=>o.status==="rejected");throw d?d.reason:new Error("Failed to fetch options")}return Ar(c.map(d=>e.optionsFromPayload(d,r)))}function un(t,e,s,r,i){return{queryKey:Ja(t,e,s),queryFn:()=>Ya(t,e,s,r),enabled:i,staleTime:6e4,retry:1}}function mt(t){const e=ue.c(16),{heading:s,iconKind:r,options:i,template:u,paramName:c,keyPrefix:d,onSelect:o}=t;if(i.length===0)return null;let l;if(e[0]!==r||e[1]!==d||e[2]!==o||e[3]!==i||e[4]!==c||e[5]!==u){let p;e[7]!==r||e[8]!==d||e[9]!==o||e[10]!==c||e[11]!==u?(p=f=>n.jsxs(ht,{value:`${d}:${f.value}`,className:"gap-3 py-2",onSelect:()=>o(f.value),children:[r==="product"&&n.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center overflow-hidden rounded-md border border-border bg-muted",children:f.image?n.jsx("img",{src:f.image,alt:"",referrerPolicy:"no-referrer",className:"h-full w-full object-cover"}):n.jsx(fr,{size:14,className:"text-muted-foreground"})}),n.jsxs("span",{className:"min-w-0 flex-1",children:[n.jsx("span",{className:"block truncate text-sm",children:f.label}),n.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:Ke(u,{[c]:f.value})})]})]},`${d}:${f.value}`),e[7]=r,e[8]=d,e[9]=o,e[10]=c,e[11]=u,e[12]=p):p=e[12],l=i.map(p),e[0]=r,e[1]=d,e[2]=o,e[3]=i,e[4]=c,e[5]=u,e[6]=l}else l=e[6];let h;return e[13]!==s||e[14]!==l?(h=n.jsx(ft,{heading:s,children:l}),e[13]=s,e[14]=l,e[15]=h):h=e[15],h}function ir(t){const e=ue.c(2),{text:s}=t;let r;return e[0]!==s?(r=n.jsx("div",{className:"px-2 py-2 text-xs text-muted-foreground",children:s}),e[0]=s,e[1]=r):r=e[1],r}function or(t){const e=ue.c(52),{sources:s,template:r,paramName:i,value:u,sandboxRef:c,onCommit:d}=t,o=Le(),[l,h]=x.useState(!1),[p,f]=x.useState(""),[E,g]=x.useState(""),P=x.useRef(null),b=i==="*"?o("sandbox.preview.catchAllParamLabel"):`:${i}`,v=Va(o),y=[...new Set(s.map(V=>v[V.kind].noun))].join(" or ");let w;e[0]!==o||e[1]!==y?(w=o("sandbox.pathParamPickerChip.searchPlaceholder",{options:y}),e[0]=o,e[1]=y,e[2]=w):w=e[2];const k=w,S={template:r,paramName:i};let T;e[3]!==p?(T=(V,Z)=>({source:V,query:Z,options:V.clientFilter?ut(Z.data??[],p):Z.data??[]}),e[3]=p,e[4]=T):T=e[4];const j=T,H=s.filter(si),J=s.filter(ri),M=cn({queries:H.map(V=>un(c,V,E,S,l))});let L;e[5]!==M||e[6]!==j?(L=(V,Z)=>j(V,M[Z]),e[5]=M,e[6]=j,e[7]=L):L=e[7];const _=H.map(L),A=_.length===0||_.every(ni),W=cn({queries:J.map(V=>un(c,V,E,S,l&&A))});let B;e[8]!==W||e[9]!==j?(B=(V,Z)=>j(V,W[Z]),e[8]=W,e[9]=j,e[10]=B):B=e[10];const X=J.map(B),I=A?X:_,$=I.length===1&&I[0]?.source.homepageLinks?I[0]:null,C=$&&!$.query.isLoading&&!$.query.isError?$?.query.data??[]:[],se=ut(C.filter(ti),p),Y=ut(C.filter(ei),p),Ne=se.length>0&&Y.length>0,ee=V=>{h(V),P.current&&clearTimeout(P.current),f(V?u:""),g(V?u:"")};let F;e[11]===Symbol.for("react.memo_cache_sentinel")?(F=V=>{f(V),P.current&&clearTimeout(P.current),P.current=setTimeout(()=>{g(V)},300)},e[11]=F):F=e[11];const ae=F,q=V=>{d(V),ee(!1)},Q=Pr(p),we=Ke(r,{[i]:Q}),te=Rr,K=Cr,me="flex h-[85svh] flex-col gap-0 overflow-hidden p-0 sm:h-[520px] sm:max-w-[560px]",fe=Xa;let ne;e[12]!==b||e[13]!==o?(ne=o("sandbox.pathParamPickerChip.pickValueTitle",{paramLabel:b}),e[12]=b,e[13]=o,e[14]=ne):ne=e[14];let re;e[15]!==ne?(re=n.jsx(Tr,{className:"sr-only",children:n.jsx(Lr,{children:ne})}),e[15]=ne,e[16]=re):re=e[16];let xe;e[17]===Symbol.for("react.memo_cache_sentinel")?(xe=n.jsx(fr,{size:16,className:"shrink-0 text-foreground"}),e[17]=xe):xe=e[17];let le;e[18]!==o?(le=o("sandbox.pathParamPickerChip.pickValueHeading"),e[18]=o,e[19]=le):le=e[19];let he;e[20]!==b?(he=n.jsx("span",{className:"rounded-sm bg-special/15 px-1 py-0.5 font-mono text-[12px] text-special",children:b}),e[20]=b,e[21]=he):he=e[21];let ie;e[22]!==le||e[23]!==he?(ie=n.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-3 border-b border-border px-4",children:[xe,n.jsxs("span",{className:"text-sm font-medium text-foreground",children:[le," ",he]})]}),e[22]=le,e[23]=he,e[24]=ie):ie=e[24];const ge=gr,nt=!1,Oe="min-h-0 flex-1";let be;e[25]!==k||e[26]!==p?(be=n.jsx(vr,{autoFocus:!0,placeholder:k,value:p,onValueChange:ae}),e[25]=k,e[26]=p,e[27]=be):be=e[27];const Ce=hr,zt="flex max-h-none min-h-0 flex-1 flex-col overflow-hidden";let pe;e[28]!==o?(pe=o("sandbox.pathParamPickerChip.noResults"),e[28]=o,e[29]=pe):pe=e[29];let _e;e[30]!==pe?(_e=n.jsx(xr,{children:pe}),e[30]=pe,e[31]=_e):_e=e[31];const He=Q&&n.jsx(ft,{className:"shrink-0",children:n.jsxs(ht,{value:`__raw__:${Q}`,className:"gap-3 py-2",onSelect:()=>q(Q),children:[n.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-md border border-dashed border-border bg-muted",children:n.jsx(ra,{size:14,className:"text-muted-foreground"})}),n.jsxs("span",{className:"min-w-0 flex-1",children:[n.jsx("span",{className:"block truncate text-sm",children:o("sandbox.pathParamPickerChip.useRawValue",{rawTerm:Q,paramLabel:b})}),n.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:we})]})]})}),$e=Ne?n.jsxs("div",{className:"flex min-h-0 flex-1",children:[n.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto border-r border-border",children:n.jsx(mt,{heading:v.category.heading,iconKind:"category",options:se,template:r,paramName:i,keyPrefix:`${$?.source.id}:cat`,onSelect:q})}),n.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:n.jsx(mt,{heading:v.product.heading,iconKind:"product",options:Y,template:r,paramName:i,keyPrefix:`${$?.source.id}:prod`,onSelect:q})})]}):n.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:I.map(V=>{const{source:Z,query:G,options:ve}=V,{noun:Ae}=v[Z.kind];if(G.isLoading)return n.jsx(ir,{text:o("sandbox.pathParamPickerChip.loading",{noun:Ae})},Z.id);if(G.isError)return n.jsx(ir,{text:o("sandbox.pathParamPickerChip.couldNotLoad")},Z.id);if(Z.homepageLinks){const gt=G.data??[];return n.jsxs(x.Fragment,{children:[n.jsx(mt,{heading:v.category.heading,iconKind:"category",options:ut(gt.filter(Za),p),template:r,paramName:i,keyPrefix:`${Z.id}:cat`,onSelect:q}),n.jsx(mt,{heading:v.product.heading,iconKind:"product",options:ut(gt.filter(Qa),p),template:r,paramName:i,keyPrefix:`${Z.id}:prod`,onSelect:q})]},Z.id)}return n.jsx(mt,{heading:I.length>1?v[Z.kind].heading:void 0,iconKind:Z.kind,options:ve,template:r,paramName:i,keyPrefix:Z.id,onSelect:q},Z.id)})});let ke;e[32]!==Ce||e[33]!==_e||e[34]!==He||e[35]!==$e?(ke=n.jsxs(Ce,{className:zt,children:[_e,He,$e]}),e[32]=Ce,e[33]=_e,e[34]=He,e[35]=$e,e[36]=ke):ke=e[36];let Fe;e[37]!==ge||e[38]!==be||e[39]!==ke?(Fe=n.jsxs(ge,{shouldFilter:nt,className:Oe,children:[be,ke]}),e[37]=ge,e[38]=be,e[39]=ke,e[40]=Fe):Fe=e[40];let ye;e[41]!==K||e[42]!==re||e[43]!==ie||e[44]!==Fe||e[45]!==fe?(ye=n.jsxs(K,{className:me,onClick:fe,children:[re,ie,Fe]}),e[41]=K,e[42]=re,e[43]=ie,e[44]=Fe,e[45]=fe,e[46]=ye):ye=e[46];let Ue;return e[47]!==te||e[48]!==ee||e[49]!==l||e[50]!==ye?(Ue=n.jsx(te,{open:l,onOpenChange:ee,children:ye}),e[47]=te,e[48]=ee,e[49]=l,e[50]=ye,e[51]=Ue):Ue=e[51],n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",title:o("sandbox.pathParamPickerChip.buttonTitle",{paramLabel:b}),className:"max-w-64 shrink-0 cursor-pointer truncate classic:rounded-sm compact:rounded-lg bg-special/15 px-1 py-0.5 text-[12px] text-special hover:bg-special/25",onClick:V=>{V.stopPropagation(),ee(!0)},children:u||b}),Ue]})}function Qa(t){return t.kind==="product"}function Za(t){return t.kind!=="product"}function Xa(t){return t.stopPropagation()}function ei(t){return t.kind==="product"}function ti(t){return t.kind!=="product"}function ni(t){return!t.query.isLoading&&(t.query.isError||t.options.length===0)}function ri(t){return t.isFallback}function si(t){return!t.isFallback}function ai(t){const e=ue.c(8),{sources:s,template:r,paramName:i,sandboxRef:u,onFill:c}=t;let d,o;if(e[0]!==i||e[1]!==u||e[2]!==s||e[3]!==r){const E={template:r,paramName:i},g=s.filter(ii);o=cn,d=g.map(P=>un(u,P,"",E,!0)),e[0]=i,e[1]=u,e[2]=s,e[3]=r,e[4]=d,e[5]=o}else d=e[4],o=e[5];let l;e[6]!==d?(l={queries:d},e[6]=d,e[7]=l):l=e[7];const h=o(l),[p,f]=x.useState(!1);if(!p)for(const E of h){if(E.isLoading)break;const g=E.data?.[0];if(g){f(!0),queueMicrotask(()=>c(g.value));break}}return null}function ii(t){return!t.isFallback}function lr(t){const e=ue.c(31),{name:s,value:r,onCommit:i}=t,u=Le(),[c,d]=x.useState(r),[o,l]=x.useState(!1),h=x.useRef(!1);let p;e[0]!==s||e[1]!==u?(p=s==="*"?u("sandbox.preview.catchAllParamLabel"):`:${s}`,e[0]=s,e[1]=u,e[2]=p):p=e[2];const f=p,E=c||f;let g;e[3]!==E?(g=n.jsx("span",{"aria-hidden":!0,className:"invisible whitespace-pre px-1 py-0.5 text-[12px]",children:E}),e[3]=E,e[4]=g):g=e[4];let P;e[5]!==f||e[6]!==u?(P=u("sandbox.preview.valueForParam",{label:f}),e[5]=f,e[6]=u,e[7]=P):P=e[7];let b,v;e[8]===Symbol.for("react.memo_cache_sentinel")?(b=j=>d(j.target.value),v=()=>l(!0),e[8]=b,e[9]=v):(b=e[8],v=e[9]);let R;e[10]!==r?(R=j=>{j.key==="Enter"&&j.currentTarget.blur(),j.key==="Escape"&&(h.current=!0,d(r),j.currentTarget.blur())},e[10]=r,e[11]=R):R=e[11];let y;e[12]!==c||e[13]!==i||e[14]!==r?(y=()=>{if(l(!1),h.current){h.current=!1;return}const j=Pr(c);d(j),j!==r&&i(j)},e[12]=c,e[13]=i,e[14]=r,e[15]=y):y=e[15];let w;e[16]!==c||e[17]!==f||e[18]!==P||e[19]!==R||e[20]!==y?(w=n.jsx("input",{type:"text",value:c,placeholder:f,title:P,spellCheck:!1,className:"absolute inset-0 rounded-sm bg-special/15 px-1 text-[12px] text-special outline-none placeholder:text-special/60 focus:bg-special/25",onClick:oi,onChange:b,onFocus:v,onKeyDown:R,onBlur:y}),e[16]=c,e[17]=f,e[18]=P,e[19]=R,e[20]=y,e[21]=w):w=e[21];let k;e[22]!==g||e[23]!==w?(k=n.jsxs("span",{className:"relative inline-flex max-w-64 shrink-0 items-center overflow-hidden",children:[g,w]}),e[22]=g,e[23]=w,e[24]=k):k=e[24];let S;e[25]!==o||e[26]!==u?(S=o&&n.jsxs("span",{className:"pointer-events-none ml-1.5 flex shrink-0 items-center gap-1 whitespace-nowrap rounded-sm border border-border bg-muted px-1 py-0.5 text-[10px] text-muted-foreground",children:[n.jsx(fs,{size:10}),u("sandbox.preview.enterToGo")]}),e[25]=o,e[26]=u,e[27]=S):S=e[27];let T;return e[28]!==S||e[29]!==k?(T=n.jsxs(n.Fragment,{children:[k,S]}),e[28]=S,e[29]=k,e[30]=T):T=e[30],T}function oi(t){return t.stopPropagation()}function li(t){if(t.activeGlobalSectionName)return t.activeGlobalSectionName;const e=t.iframeBase;if(!e)return t.noServerLabel;try{const s=new URL(e),r=t.resolvedPath==="/"?"":t.resolvedPath;return`${s.host}${r}`}catch{return e}}function ci(t){return t.showPreviewToolbar&&t.contentEditingEnabled}function di(t){const e=ue.c(5);let s;e[0]!==t?(s=t??{orgSlug:"",virtualMcpId:"",branch:""},e[0]=t,e[1]=s):s=e[1];const r=wr(s);let i;return e[2]!==t||e[3]!==r?(i={mutationFn:async u=>{const{name:c,path:d,template:o}=u;if(!t?.virtualMcpId||!t.branch)throw new Error("Sandbox not ready");const l=Ts(c),h=o?{...o,name:c,path:d}:Ls(c,d);return await r.mutateAsync({blockKey:l,data:h}),{key:l,name:c,path:d}}},e[2]=t,e[3]=r,e[4]=i):i=e[4],is(i)}function ui(t){const e=ue.c(89),{open:s,onOpenChange:r,isPending:i,error:u,templates:c,onSubmit:d}=t,o=i===void 0?!1:i,l=Le();let h;e[0]!==l?(h=l("sectionsEditor.createPageModal.defaultPageName"),e[0]=l,e[1]=h):h=e[1];const[p,f]=x.useState(h);let E;e[2]!==l?(E=l("sectionsEditor.createPageModal.defaultPagePath"),e[2]=l,e[3]=E):E=e[3];const[g,P]=x.useState(E),[b,v]=x.useState(nn),[R,y]=x.useState(null),[w,k]=x.useState(s);s!==w&&(k(s),s&&(f(l("sectionsEditor.createPageModal.defaultPageName")),P(l("sectionsEditor.createPageModal.defaultPagePath")),v(nn),y(null)));const S=!!c?.length;let T;e[4]!==o||e[5]!==r?(T=le=>{!le&&!o&&(y(null),r(!1))},e[4]=o,e[5]=r,e[6]=T):T=e[6];const j=T;let H;e[7]!==o||e[8]!==p||e[9]!==d||e[10]!==g||e[11]!==S||e[12]!==b?(H=async le=>{le.preventDefault();const he=p.trim(),ie=g.trim();if(!he||!ie||o)return;const ge=Sr(ie);if(ge){y(ge);return}y(null),await d({name:he,path:ie,templateKey:S&&b!==nn?b:null})},e[7]=o,e[8]=p,e[9]=d,e[10]=g,e[11]=S,e[12]=b,e[13]=H):H=e[13];const J=H,M=R??u;let L;e[14]!==l?(L=l("sectionsEditor.createPageModal.title"),e[14]=l,e[15]=L):L=e[15];let _;e[16]!==L?(_=n.jsx(Tr,{children:n.jsx(Lr,{children:L})}),e[16]=L,e[17]=_):_=e[17];let A;e[18]!==l?(A=l("sectionsEditor.createPageModal.nameLabel"),e[18]=l,e[19]=A):A=e[19];let W;e[20]!==A?(W=n.jsx("label",{htmlFor:"new-page-name",className:"text-xs font-medium text-muted-foreground",children:A}),e[20]=A,e[21]=W):W=e[21];let B;e[22]===Symbol.for("react.memo_cache_sentinel")?(B=le=>f(le.target.value),e[22]=B):B=e[22];let X;e[23]!==l?(X=l("sectionsEditor.createPageModal.namePlaceholder"),e[23]=l,e[24]=X):X=e[24];let I;e[25]!==o||e[26]!==p||e[27]!==X?(I=n.jsx(Zn,{id:"new-page-name",value:p,onChange:B,placeholder:X,autoFocus:!0,disabled:o}),e[25]=o,e[26]=p,e[27]=X,e[28]=I):I=e[28];let $;e[29]!==I||e[30]!==W?($=n.jsxs("div",{className:"space-y-1.5",children:[W,I]}),e[29]=I,e[30]=W,e[31]=$):$=e[31];let U;e[32]!==l?(U=l("sectionsEditor.createPageModal.pathLabel"),e[32]=l,e[33]=U):U=e[33];let C;e[34]!==U?(C=n.jsx("label",{htmlFor:"new-page-path",className:"text-xs font-medium text-muted-foreground",children:U}),e[34]=U,e[35]=C):C=e[35];let se;e[36]===Symbol.for("react.memo_cache_sentinel")?(se=le=>P(le.target.value),e[36]=se):se=e[36];let Y;e[37]!==l?(Y=l("sectionsEditor.createPageModal.pathPlaceholder"),e[37]=l,e[38]=Y):Y=e[38];let Ne;e[39]!==o||e[40]!==g||e[41]!==Y?(Ne=n.jsx(Zn,{id:"new-page-path",value:g,onChange:se,placeholder:Y,disabled:o}),e[39]=o,e[40]=g,e[41]=Y,e[42]=Ne):Ne=e[42];let ee;e[43]!==C||e[44]!==Ne?(ee=n.jsxs("div",{className:"space-y-1.5",children:[C,Ne]}),e[43]=C,e[44]=Ne,e[45]=ee):ee=e[45];let F;e[46]!==o||e[47]!==S||e[48]!==l||e[49]!==b||e[50]!==c?(F=S&&n.jsxs("div",{className:"space-y-1.5",children:[n.jsx("label",{htmlFor:"new-page-template",className:"text-xs font-medium text-muted-foreground",children:l("sectionsEditor.createPageModal.templateLabel")}),n.jsx(Os,{id:"new-page-template",value:b,onChange:v,templates:c??[],disabled:o})]}),e[46]=o,e[47]=S,e[48]=l,e[49]=b,e[50]=c,e[51]=F):F=e[51];let ae;e[52]!==M?(ae=M&&n.jsx("p",{className:"text-xs text-destructive",children:M}),e[52]=M,e[53]=ae):ae=e[53];let q;e[54]!==$||e[55]!==ee||e[56]!==F||e[57]!==ae?(q=n.jsxs("div",{className:"space-y-4 py-4",children:[$,ee,F,ae]}),e[54]=$,e[55]=ee,e[56]=F,e[57]=ae,e[58]=q):q=e[58];let Q;e[59]!==r?(Q=()=>r(!1),e[59]=r,e[60]=Q):Q=e[60];let we;e[61]!==l?(we=l("sectionsEditor.createPageModal.cancelButton"),e[61]=l,e[62]=we):we=e[62];let te;e[63]!==o||e[64]!==Q||e[65]!==we?(te=n.jsx(Je,{type:"button",variant:"outline",onClick:Q,disabled:o,children:we}),e[63]=o,e[64]=Q,e[65]=we,e[66]=te):te=e[66];let K;e[67]!==o||e[68]!==p||e[69]!==g?(K=!p.trim()||!g.trim()||o,e[67]=o,e[68]=p,e[69]=g,e[70]=K):K=e[70];let me;e[71]!==o||e[72]!==l?(me=o?n.jsxs(n.Fragment,{children:[n.jsx(Mt,{className:"size-3.5"}),l("sectionsEditor.createPageModal.creatingButton")]}):l("sectionsEditor.createPageModal.createButton"),e[71]=o,e[72]=l,e[73]=me):me=e[73];let fe;e[74]!==K||e[75]!==me?(fe=n.jsx(Je,{type:"submit",disabled:K,children:me}),e[74]=K,e[75]=me,e[76]=fe):fe=e[76];let ne;e[77]!==te||e[78]!==fe?(ne=n.jsxs(sa,{children:[te,fe]}),e[77]=te,e[78]=fe,e[79]=ne):ne=e[79];let re;e[80]!==J||e[81]!==q||e[82]!==ne||e[83]!==_?(re=n.jsx(Cr,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:J,children:[_,q,ne]})}),e[80]=J,e[81]=q,e[82]=ne,e[83]=_,e[84]=re):re=e[84];let xe;return e[85]!==j||e[86]!==s||e[87]!==re?(xe=n.jsx(Rr,{open:s,onOpenChange:j,children:re}),e[85]=j,e[86]=s,e[87]=re,e[88]=xe):xe=e[88],xe}function mi(t){const e=ue.c(29),{orgSlug:s,virtualMcpId:r,branch:i,previewUrl:u,meta:c,decofile:d,blockKey:o}=t,l=Le();let h;e[0]!==i||e[1]!==s||e[2]!==r?(h={orgSlug:s,virtualMcpId:r,branch:i},e[0]=i,e[1]=s,e[2]=r,e[3]=h):h=e[3];const p=wr(h);let f;e[4]!==p?(f=Ds((k,S)=>p.mutate({blockKey:k,data:S})),e[4]=p,e[5]=f):f=e[5];const E=f;let g;e[6]!==o||e[7]!==d?(g=_s(d,o),e[6]=o,e[7]=d,e[8]=g):g=e[8];const{resolveType:P,props:b,title:v}=g;if(!P){let k;e[9]!==l?(k=l("sandbox.preview.loaderNoLongerExists"),e[9]=l,e[10]=k):k=e[10];let S;return e[11]!==k?(S=n.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center text-sm text-muted-foreground",children:k}),e[11]=k,e[12]=S):S=e[12],S}const R=`loader:${o}`;let y;e[13]!==o||e[14]!==P||e[15]!==v?(y={mode:"saved",blockKey:o,resolveType:P,title:v},e[13]=o,e[14]=P,e[15]=v,e[16]=y):y=e[16];let w;return e[17]!==i||e[18]!==d||e[19]!==c||e[20]!==s||e[21]!==u||e[22]!==b||e[23]!==p.isPending||e[24]!==E||e[25]!==R||e[26]!==y||e[27]!==r?(w=n.jsx(As,{orgSlug:s,virtualMcpId:r,branch:i,previewUrl:u,meta:c,decofile:d,kind:"loaders",target:y,initialValue:b,isCreating:p.isPending,onCreate:pi,onSaveReferencedBlock:E,showRun:!1},R),e[17]=i,e[18]=d,e[19]=c,e[20]=s,e[21]=u,e[22]=b,e[23]=p.isPending,e[24]=E,e[25]=R,e[26]=y,e[27]=r,e[28]=w):w=e[28],w}async function pi(){}function fi(t){if(t instanceof Error&&"status"in t&&typeof t.status=="number")return t.status}function cr(t){return{status:t.status,hasData:t.data!==void 0,errorStatus:fi(t.error)}}function hi(t){switch(t){case"clone-failed":case"install-failed":case"start-failed":return"terminal-error";case"idle":case"cloning":return"booting";case"checking-out":case"installing":case"starting":case"running":case"crashed":return"snapshot-readable"}}function gi(t){if(t.fastPreviewActive)return t.decofile.status==="error"&&!t.decofile.hasData||t.meta.status==="error"&&!t.meta.hasData?{kind:"error",source:"data"}:!t.decofile.hasData||!t.meta.hasData?{kind:"loading"}:t.hasEditableContent?{kind:"content"}:{kind:"empty",reason:"no-content"};const e=hi(t.lifecyclePhase);if(e==="terminal-error")return{kind:"error",source:"sandbox"};if(e==="booting")return{kind:"loading"};const s=t.decofile.status==="error"&&!t.decofile.hasData||t.meta.status==="error"&&!t.meta.hasData;return s&&t.lifecyclePhase==="checking-out"?{kind:"loading"}:[t.decofile,t.meta].some(i=>i.status==="error"&&!i.hasData&&i.errorStatus===404)?{kind:"empty",reason:"framework-missing"}:s?t.lifecyclePhase==="running"||t.lifecyclePhase==="crashed"?{kind:"error",source:"data"}:{kind:"loading"}:!t.decofile.hasData||!t.meta.hasData?{kind:"loading"}:t.hasEditableContent?{kind:"content"}:{kind:"empty",reason:"no-content"}}const vi="https://github.com/decocms/blocks";function xi(){const t=ue.c(14),e=Le();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(hs,{size:48,className:"text-muted-foreground"}),t[0]=s):s=t[0];let r;t[1]!==e?(r=e("mainPanelTabs.blocksTabStates.emptyStateTitle"),t[1]=e,t[2]=r):r=t[2];let i;t[3]!==e?(i=e("mainPanelTabs.blocksTabStates.emptyStateDescription"),t[3]=e,t[4]=i):i=t[4];let u;t[5]!==e?(u=e("mainPanelTabs.blocksTabStates.setupContentEditing"),t[5]=e,t[6]=u):u=t[6];let c;t[7]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(ln,{size:14}),t[7]=c):c=t[7];let d;t[8]!==u?(d=n.jsx(Je,{size:"sm",asChild:!0,children:n.jsxs("a",{href:vi,target:"_blank",rel:"noreferrer",children:[u,c]})}),t[8]=u,t[9]=d):d=t[9];let o;return t[10]!==r||t[11]!==i||t[12]!==d?(o=n.jsx(gn,{className:"h-full w-full",image:s,title:r,description:i,actions:d}),t[10]=r,t[11]=i,t[12]=d,t[13]=o):o=t[13],o}function bi(t){const e=ue.c(15),{source:s,onRetry:r}=t,i=Le();let u;e[0]!==s||e[1]!==i?(u=i(s==="sandbox"?"mainPanelTabs.blocksTabStates.errorStateSandbox":"mainPanelTabs.blocksTabStates.errorStateData"),e[0]=s,e[1]=i,e[2]=u):u=e[2];const c=u;let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(aa,{size:48,className:"text-muted-foreground"}),e[3]=d):d=e[3];let o;e[4]!==i?(o=i("mainPanelTabs.blocksTabStates.errorStateTitle"),e[4]=i,e[5]=o):o=e[5];let l;e[6]!==i?(l=i("mainPanelTabs.blocksTabStates.retry"),e[6]=i,e[7]=l):l=e[7];let h;e[8]!==r||e[9]!==l?(h=n.jsx(Je,{variant:"outline",size:"sm",onClick:r,children:l}),e[8]=r,e[9]=l,e[10]=h):h=e[10];let p;return e[11]!==c||e[12]!==o||e[13]!==h?(p=n.jsx(gn,{image:d,title:o,description:c,actions:h}),e[11]=c,e[12]=o,e[13]=h,e[14]=p):p=e[14],p}const yi=x.lazy(()=>os(()=>import("./sections-editor-JwUGjbSO.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138])).then(t=>({default:t.SectionsEditor})));function dr(t){const e=ue.c(49),{virtualMcpId:s,externalSelection:r,onViewJsonFile:i}=t,u=r===void 0?null:r,{org:c}=mn(),{currentBranch:d,taskId:o}=Bt(),l=br(),h=pn(),p=Or(),f=l.lifecycle.phase==="running",E=h.previewUrl;let g;e[0]!==d||e[1]!==c||e[2]!==E||e[3]!==o||e[4]!==s?(g=d?{orgSlug:c.slug,virtualMcpId:s,branch:d,threadId:o??null,previewUrl:E}:null,e[0]=d,e[1]=c,e[2]=E,e[3]=o,e[4]=s,e[5]=g):g=e[5];const P=g;let b;e[6]!==f?(b={fetchEnabled:f},e[6]=f,e[7]=b):b=e[7];const v=fn(P,b);let R;e[8]!==f?(R={fetchEnabled:f},e[8]=f,e[9]=R):R=e[9];const y=kr(P,R),w=gi({lifecyclePhase:l.lifecycle.phase,decofile:cr(v),meta:cr(y),hasEditableContent:Us(v.data,y.data),fastPreviewActive:yr(s).runtime==="cms"}),k=wi;if(w.kind==="loading"){let C;return e[10]===Symbol.for("react.memo_cache_sentinel")?(C=k(n.jsx(ls,{})),e[10]=C):C=e[10],C}if(w.kind==="empty"){let C;return e[11]===Symbol.for("react.memo_cache_sentinel")?(C=k(n.jsx(xi,{})),e[11]=C):C=e[11],C}if(w.kind==="error"){let C;e[12]!==v||e[13]!==h||e[14]!==y||e[15]!==w.source?(C=()=>{if(w.source==="sandbox"){h.retry();return}Promise.all([v.refetch(),y.refetch()])},e[12]=v,e[13]=h,e[14]=y,e[15]=w.source,e[16]=C):C=e[16];const se=C;let Y;return e[17]!==se||e[18]!==w.source?(Y=k(n.jsx(bi,{source:w.source,onRetry:se})),e[17]=se,e[18]=w.source,e[19]=Y):Y=e[19],Y}let S;e[20]===Symbol.for("react.memo_cache_sentinel")?(S=C=>k(n.jsx("div",{className:"h-full min-h-0",children:C})),e[20]=S):S=e[20];const T=S,j=p.state.target;if(j?.kind==="loader"&&v.data&&y.data){const C=d??"",se=E??null;let Y;return e[21]!==v.data||e[22]!==y.data||e[23]!==c.slug||e[24]!==C||e[25]!==se||e[26]!==j.key||e[27]!==s?(Y=T(n.jsx(mi,{orgSlug:c.slug,virtualMcpId:s,branch:C,previewUrl:se,meta:y.data,decofile:v.data,blockKey:j.key})),e[21]=v.data,e[22]=y.data,e[23]=c.slug,e[24]=C,e[25]=se,e[26]=j.key,e[27]=s,e[28]=Y):Y=e[28],Y}let H;e[29]!==d||e[30]!==c.slug||e[31]!==j||e[32]!==s?(H=j||!d?null:jr(Er(c.slug,s,d)),e[29]=d,e[30]=c.slug,e[31]=j,e[32]=s,e[33]=H):H=e[33];const J=H;let M="/",L=null,_=null;j?.kind==="page"?(M=j.path,L=j.key):j?.kind==="section"?_=j.key:J&&(M=J.path,L=J.pageKey);const A=L?`page:${L}`:_?`section:${_}`:`path:${M}`;let W;e[34]===Symbol.for("react.memo_cache_sentinel")?(W=n.jsx("div",{className:"h-full flex items-center justify-center",children:n.jsx(Mt,{className:"size-5 text-muted-foreground"})}),e[34]=W):W=e[34];const B=d??"",X=E??void 0,I=_?null:u,$=!!L&&p.state.editSeoPageKey===L;let U;return e[35]!==_||e[36]!==L||e[37]!==M||e[38]!==A||e[39]!==i||e[40]!==c.slug||e[41]!==I||e[42]!==$||e[43]!==B||e[44]!==X||e[45]!==s||e[46]!==p.consumeEditSeo||e[47]!==p.setVariantOverride?(U=T(n.jsx(x.Suspense,{fallback:W,children:n.jsx(yi,{orgSlug:c.slug,virtualMcpId:s,branch:B,previewReady:!0,previewUrl:X,currentPath:M,activePageBlockKey:L,activeGlobalBlockKey:_,externalSelection:I,initialEditSeo:$,onExitSeo:p.consumeEditSeo,onVariantPreviewOverride:p.setVariantOverride,onViewJsonFile:i},A)})),e[35]=_,e[36]=L,e[37]=M,e[38]=A,e[39]=i,e[40]=c.slug,e[41]=I,e[42]=$,e[43]=B,e[44]=X,e[45]=s,e[46]=p.consumeEditSeo,e[47]=p.setVariantOverride,e[48]=U):U=e[48],U}function wi(t){return n.jsx("div",{"data-testid":"blocks-panel",className:"h-full min-h-0 overflow-hidden",children:t})}function ur(t){const e=ue.c(44),{virtualMcpId:s,pageKey:r,onClose:i,ref:u}=t,c=Le(),{org:d}=mn(),{currentBranch:o,taskId:l}=Bt(),p=pn().previewUrl;let f;e[0]!==o||e[1]!==d.slug||e[2]!==p||e[3]!==l||e[4]!==s?(f=o?{orgSlug:d.slug,virtualMcpId:s,branch:o,threadId:l??null,previewUrl:p}:null,e[0]=o,e[1]=d.slug,e[2]=p,e[3]=l,e[4]=s,e[5]=f):f=e[5];const g=fn(f),P=o??"";let b;e[6]!==d.slug||e[7]!==P||e[8]!==s?(b={orgSlug:d.slug,virtualMcpId:s,branch:P},e[6]=d.slug,e[7]=P,e[8]=s,e[9]=b):b=e[9];const{save:v,flush:R}=$s(b),y=g.data?.[r],w=g.data===void 0&&g.isLoading,k=g.data!==void 0&&y===void 0,S=!o||k||w;let T;e[10]!==y?(T=y===void 0?"":JSON.stringify(y,null,2),e[10]=y,e[11]=T):T=e[11];const j=T;let H;e[12]!==r||e[13]!==S||e[14]!==v?(H=U=>{if(S)return;let C;try{C=JSON.parse(U)}catch{return}C===null||typeof C!="object"||Array.isArray(C)||v(r,C)},e[12]=r,e[13]=S,e[14]=v,e[15]=H):H=e[15];const J=H;let M;e[16]!==R?(M=()=>({flush:R}),e[16]=R,e[17]=M):M=e[17],x.useImperativeHandle(u,M);let L;e[18]!==c?(L=c("sectionsEditor.pageJsonDialog.titleShort"),e[18]=c,e[19]=L):L=e[19];let _;e[20]!==L?(_=n.jsx("div",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:L}),e[20]=L,e[21]=_):_=e[21];let A;e[22]!==c?(A=c("sectionsEditor.pageJsonDialog.close"),e[22]=c,e[23]=A):A=e[23];let W;e[24]===Symbol.for("react.memo_cache_sentinel")?(W=n.jsx(ia,{size:14}),e[24]=W):W=e[24];let B;e[25]!==i||e[26]!==A?(B=n.jsx(Je,{variant:"ghost",size:"icon",onClick:i,"aria-label":A,className:"size-7 shrink-0",children:W}),e[25]=i,e[26]=A,e[27]=B):B=e[27];let X;e[28]!==B||e[29]!==_?(X=n.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b px-3 py-2.5",children:[_,B]}),e[28]=B,e[29]=_,e[30]=X):X=e[30];let I;e[31]!==g.data||e[32]!==R||e[33]!==j||e[34]!==w||e[35]!==k||e[36]!==r||e[37]!==S||e[38]!==J||e[39]!==c?(I=w?n.jsx("div",{className:"flex flex-1 items-center justify-center",children:n.jsx(Mt,{className:"size-5 text-muted-foreground"})}):k?n.jsxs("div",{className:"p-4 text-xs font-mono text-foreground/60",children:["// ",c("sectionsEditor.pageJsonDialog.pageNotFound")]}):n.jsx("div",{className:"min-h-0 flex-1",children:n.jsx(oa,{code:j,language:"json",readOnly:S,height:"100%",onChange:U=>J(U??""),onSave:U=>{J(U),R()}},`${r}:${g.data===void 0?"loading":"ready"}`)}),e[31]=g.data,e[32]=R,e[33]=j,e[34]=w,e[35]=k,e[36]=r,e[37]=S,e[38]=J,e[39]=c,e[40]=I):I=e[40];let $;return e[41]!==X||e[42]!==I?($=n.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-background",children:[X,I]}),e[41]=X,e[42]=I,e[43]=$):$=e[43],$}function Mr(t){return t.contentEditingEnabled&&!t.isMobile}function ki(t,e){return t!=="visual"?"visual":e?"blocks":"preview"}function Pi(t){return Mr({contentEditingEnabled:Nr(t.cmsMode),isMobile:t.isMobile})?"blocks":"preview"}function Si(t){return t.editingMode==="blocks"&&!t.blocksEditingEnabled||t.editingMode==="visual"&&!t.sandboxDisplay?"preview":t.editingMode}const ji=500,Ei={mobile:{width:412,height:823},tablet:{width:1024,height:1366},desktop:{width:1280,height:800}},mr=1,an=["desktop","mobile","tablet"],$t={mobile:"sandbox.preview.deviceMobile",tablet:"sandbox.preview.deviceTablet",desktop:"sandbox.preview.deviceDesktop"};function pr(t,e){try{const s=new URL(t,window.location.href);return s.searchParams.set("deviceHint",e),s.href}catch{return t}}function Ni(t){if(!t)return null;try{const e=new URL(t,window.location.href);return e.searchParams.set("__decoFBT","0"),e.searchParams.set("__deco_ssr","1"),e.href}catch{return t}}function pt(t){if(!t)return null;try{return new URL(t,window.location.href).origin}catch{return null}}function on(t,e){try{return new URL(t,e).href}catch{return null}}function Ci(t,e){if(!e.inPlaceRenderActive)return{pin:e.draftPreviewUrl?{path:e.resolvedPath,url:e.draftPreviewUrl}:null,effective:e.draftPreviewUrl};if(e.draftPreviewUrl!==null&&t?.path!==e.resolvedPath){const s={path:e.resolvedPath,url:e.draftPreviewUrl};return{pin:s,effective:s.url}}return{pin:t,effective:t?.url??null}}function Ri(t,e){return!t||t.nav!==e.nav?!1:t.content!==e.content}function Ti(t,e,s){const r=t.toLowerCase(),i=e.toLowerCase(),u=i.split("/").filter(Boolean),c=o=>{if(o===s)return 100;const l=o.indexOf(s);if(l===-1)return 0;let h=40;return l===0?h+=30:/[\s/-]/.test(o[l-1]??"")&&(h+=20),h+=Math.round(s.length/o.length*20),h};let d=Math.max(c(r),c(i));return u.at(-1)===s?d=Math.max(d,95):u.includes(s)&&(d=Math.max(d,90)),d}function Li(t,e){try{t.contentWindow?.location.reload()}catch{e&&(t.src=e)}}function Oi({virtualMcpId:t}){const e=cs(),s=x.useRef(null),r=Le(),i=ta(),u=Ns(),{currentBranch:c,taskId:d,virtualMcpId:o}=Bt(),l=Or(),h=ws(o===t?t:null),p=yr(t),f=la(h?.metadata?.ui?.layout??null),E=Nr(f),g=Mr({contentEditingEnabled:E,isMobile:u}),[P,b]=x.useState(()=>Pi({cmsMode:f,isMobile:u})),[v,R]=x.useState("desktop"),[y,w]=x.useState(null),[k,S]=x.useState(null),T=x.useRef(null),j=x.useRef(null),[H,J]=x.useState(!1),M=x.useRef(null),L=()=>{M.current?.flush(),J(!1)},_=()=>J(a=>(a&&M.current?.flush(),!a)),[A,W]=x.useState({width:0,height:0}),[B,X]=x.useState(null),[I,$]=x.useState(!1),[U,C]=x.useState(""),[se,Y]=x.useState(!1),[Ne,ee]=x.useState(),[F,ae]=x.useState(null),[q,Q]=x.useState(null),[we,te]=x.useState(null),[K,me]=x.useState(()=>l.state.target?.kind==="page"?l.state.target.path:"/"),[fe,ne]=x.useState(()=>l.state.target?.kind==="page"?l.state.target.key:null),[re,xe]=x.useState({}),[le,he]=x.useState(!1),ie=x.useRef(null),ge=()=>{he(!0),ie.current&&clearTimeout(ie.current),ie.current=setTimeout(()=>he(!1),15e3)},nt=()=>{ie.current&&(clearTimeout(ie.current),ie.current=null),he(!1)},{org:Oe}=mn(),be=br(),Ce=pn(),zt=Ce.vmEntry,pe=Ce.previewUrl,_e=be.lifecycle.phase,He=_e==="running",$e=h?.id===t?Es(h.metadata):null,ke=h?.id===t&&p.runtime==="cms",Fe=p.projectDefault==="cms",ye=Gs({sandboxUrl:pe,previewServerUrl:$e,fastPreviewActive:ke}),Ue=t&&c?{orgSlug:Oe.slug,virtualMcpId:t,branch:c,threadId:d??null,previewUrl:pe}:null,V=fn(Ue,{fetchEnabled:He}),Z=kr(Ue,{fetchEnabled:He}),G=V.data,ve=Z.data,Ae=G?Ws(G).sort((a,m)=>a.name.localeCompare(m.name)):[],gt=t&&c?{orgSlug:Oe.slug,virtualMcpId:t,branch:c}:null,xn=di(gt),vt=G&&ve?Vs(G,ve):[],bn=G&&ve?Fs(ve,G,"loaders"):[],Me=U?(()=>{const a=U.toLowerCase();return Ae.map(m=>({page:m,score:Ti(m.name,m.path,a)})).filter(({score:m})=>m>0).sort((m,N)=>N.score-m.score||m.page.path.length-N.page.path.length).map(({page:m})=>m)})():Ae,Ye=vt.filter(a=>{if(!U)return!0;const m=U.toLowerCase();return a.name.toLowerCase().includes(m)||a.key.toLowerCase().includes(m)||a.resolveType.toLowerCase().includes(m)}),It=g?bn:[],rt=It.filter(a=>{if(!U)return!0;const m=U.toLowerCase();return a.title.toLowerCase().includes(m)||a.key.toLowerCase().includes(m)||a.resolveType.toLowerCase().includes(m)}),We=q?bn.find(a=>a.key===q)??null:null,Re=hn,xt=F||q?null:qs(Ae,K,fe),Kt=F?F.name:We?.title??xt?.name,D=xt?.key??null,bt=xt?.path??null,Be=(D?re[D]:void 0)??{},Pe=Ke(K,Be),yt={};if(He&&pe&&ve&&G){const a=Ms(ve,"loaders"),m=D?G[D]:void 0,N=$a(m,G,oe=>a.has(oe)),O=La(N);for(const oe of tt(K)){if(oe.type!=="param")continue;const De=Ca(K,oe.name,N),je=Aa(De,a,O);je.length>0&&(yt[oe.name]=je)}}const Qe=t&&c?{orgSlug:Oe.slug,virtualMcpId:t,branch:c,threadId:d??null}:null,yn=G&&D?Bs(G,D,0):[],wn=G?zs(yn,G):[],Ht=wn.map(a=>a.isSavedBlock?a.label:""),Ut=wn.map(a=>a.isSavedBlock?"global":a.isMultivariate?"variant":"normal"),Wt=yn.map(a=>dn(a,G??{})),kn=x.useRef(null),Te=x.useRef(null),Br=be.status.state==="paused",Vt=be.phase,Pn=Is({claimPhase:Vt,lifecycle:be.lifecycle}),Ve=Ce.previewState,zr=Ce.userStopped,Ir=Xs(Oe.slug,t??"",c??""),{url:qe}=Zs(ke&&t&&c?{orgSlug:Oe.slug,virtualMcpId:t,branch:c,previewServerUrl:$e??null,path:Pe}:null),Kr=Fe&&p.runtime==="sandbox",z=fa({previewState:Ve,progressStatus:Pn.status,previewServerUrl:$e,fastPreviewActive:ke,fastPreviewReady:!!qe,codingSession:Kr}),st=z.mode!=="none",Sn=z.mode==="production"&&z.iframeBase?pt(z.iframeBase):null,Hr=!i,Ze=z.mode==="production"?Sn:pt(pe),Ur=h?.id===t&&h.metadata?.fastPreviewInPlace===!0,at=z.mode==="production"&&ke&&Ur&&g&&P==="blocks",jn=x.useRef(null),{pin:Wr,effective:Vr}=Ci(jn.current,{inPlaceRenderActive:at,draftPreviewUrl:qe,resolvedPath:Pe});jn.current=Wr;const Se=Ni(z.mode==="sandbox"?Ot(pr(we??on(Pe,z.iframeBase)??z.iframeBase,v),l.state.variantOverride??[]):z.mode==="production"&&Hr?Ot(pr(Js(we??Vr??on(Pe,z.iframeBase)??z.iframeBase,z.showWakingPill?Ys:null),v),l.state.variantOverride??[]):null);x.useEffect(()=>{},[i,Sn,B]);const qt="sandbox.preview.openInNewTab",En=qe??(z.iframeBase?on(Pe,z.iframeBase):null),qr=z.mode==="production"?En?Ot(En,l.state.variantOverride??[]):null:Se??z.iframeBase,Nn=async()=>{const a=qr;if(a){window.open(a,"_blank","noopener");return}},wt=t&&c?Er(Oe.slug,t,c):null,kt=a=>{wt&&ea(wt,a)},ce=l.state.target;x.useEffect(()=>{if(!(!ce||!ye||!ve))if(ce.kind==="page"){const a=re[ce.key]??{};Te.current=Ke(ce.path,a),ae(null),Q(null),te(null),ne(ce.key),me(ce.path),kt({path:ce.path,pageKey:ce.key,params:a})}else if(ce.kind==="loader")Te.current=null,ae(null),Q(ce.key),te(null);else{const a=vt.find(m=>m.key===ce.key);if(a){Te.current=null;const m=Yn(ve);Q(null),ae(a),te(Qn(ye,m,a.key))}}},[ce,ye,ve,re]),x.useEffect(()=>{!D||bt===null||ce?.kind==="page"&&ce.key===D&&ce.path===bt||l.selectTarget({kind:"page",key:D,path:bt})},[D,bt,ce]);const[Cn,Gr]=x.useState(null);if(Ve.kind==="iframe"&&Cn!==Ve.previewUrl){const a=Cn!==null;Gr(Ve.previewUrl);const m=wt?jr(wt):null;if(m){if(Te.current=Ke(m.path,m.params),me(m.path),ne(m.pageKey),te(null),ae(null),Q(null),m.pageKey&&Object.keys(m.params).length>0){const N=m.pageKey;xe(O=>({...O,[N]:m.params}))}}else a&&(Te.current=null,me("/"),te(null),ne(null),ae(null),Q(null))}kn.current=Se;const Rn=xa({iframeRef:T,src:z.mode==="sandbox"?Se:null,active:z.mode==="sandbox"}),Tn=x.useRef(null);x.useEffect(()=>{if(!qe||!Se||Tn.current===qe)return;Tn.current=qe;const a=T.current;a&&a.getAttribute("src")!==Se&&(ge(),a.src=Se)},[qe,Se]);const Ln=()=>{const a=T.current?.contentWindow,m=Ze;if(!a||!m||!G||!D)return;const N=G[D];if(!N||typeof N!="object")return;const O=Qs({previewBaseUrl:m,pageBlock:N,decofile:G,path:Pe,pathTemplate:K});if(!O)return;const oe=Ot(O.src,l.state.variantOverride??[]);a.postMessage({type:"cms-editor::render",src:oe,body:O.body},m)},Gt=x.useRef(null);x.useEffect(()=>{if(!at||F||q||!D||!G){Gt.current=null;return}const a={nav:JSON.stringify({page:D,path:Pe,pathTemplate:K}),content:JSON.stringify(G)},m=Ri(Gt.current,a);Gt.current=a,m&&Ln()},[G,at,F,q,D,Pe,K]);const Jt=x.useRef(null);x.useEffect(()=>{if(!at||F||q||!D||!G){Jt.current=null;return}const a=JSON.stringify(l.state.variantOverride??null),m=Jt.current;Jt.current={page:D,sig:a},!(!m||m.page!==D||m.sig===a)&&Ln()},[l.state.variantOverride,at,F,q,D]);const Jr=!!t&&!!c&&!be.notFound&&!zr&&!Br&&(Vt?.kind==="ready"||_e!=="idle"),de=Si({editingMode:P,sandboxDisplay:z.mode==="sandbox",blocksEditingEnabled:g});x.useEffect(()=>{const a=Ze;if(!a)return;const m=N=>{if(N.origin===a)if(N.data?.type==="visual-editor::element-clicked"){const O=ba.safeParse(N.data.payload);O.success&&w(O.data)}else if(N.data?.type==="cms-editor::section-clicked"){const O=ka.safeParse(N.data.payload);O.success&&S({index:O.data.sectionIndex,seq:O.data.clickSeq})}else N.data?.type==="cms-editor::render-start"?ge():N.data?.type==="cms-editor::render-end"?(nt(),T.current?.contentWindow?.postMessage({type:"cms-editor::set-labels",labels:Ht,kinds:Ut,keys:Wt},a)):N.data?.type==="cms-editor::render-error"&&nt()};return window.addEventListener("message",m),()=>window.removeEventListener("message",m)},[Ze,Ht,Ut,Wt]);const On=()=>{const a=T.current?.contentWindow,m=pt(pe);!a||!m||a.postMessage({type:"visual-editor::activate",script:ya},m)},Yr=()=>{const a=T.current?.contentWindow,m=pt(pe);!a||!m||a.postMessage({type:"visual-editor::deactivate"},m)},Yt=()=>{const a=T.current?.contentWindow,m=Ze;!a||!m||(a.postMessage(z.mode==="production"?{type:"editor::inject",args:{script:rr}}:{type:"visual-editor::activate",script:rr},m),a.postMessage({type:"cms-editor::set-labels",labels:Ht,kinds:Ut,keys:Wt},m))},Qr=()=>{const a=T.current?.contentWindow,m=Ze;!a||!m||a.postMessage({type:"cms-editor::deactivate"},m)},Zr=()=>{const a=T.current?.contentWindow,m=Ze;!a||!m||(a.postMessage({type:"cms-editor::clear-hover"},m),a.postMessage({type:"visual-editor::clear-hover"},m))},Qt=a=>{if(a==="blocks"&&!g)return;const m=P;!u&&a!==m&&(a==="blocks"?j.current?.resize("30%"):j.current?.collapse()),a!=="blocks"&&L(),b(a),w(null),S(null),a!=="blocks"&&Q(null),m==="visual"&&Yr(),a==="visual"&&On(),m==="blocks"&&a!=="blocks"&&Qr(),a==="blocks"&&Yt()},_n=()=>{Qt(ki(P,g))},An=()=>{if(!T.current||!Se)return;ge();const a=T.current;a.src=Se};Ps(()=>{const a=T.current;if(!a)return;ge();const m=document.activeElement,N=a.tabIndex;a.tabIndex=-1,a.style.pointerEvents="none",a.blur(),Li(a,kn.current);let O;const oe=()=>{clearTimeout(O),a.tabIndex=N,a.style.pointerEvents="";const De=document.activeElement;(!De||De===document.body||De===a)&&m?.focus(),a.removeEventListener("load",oe)};a.addEventListener("load",oe),O=setTimeout(oe,3e3)});const Dn=()=>{const a=an.indexOf(v);R(an[(a+1)%an.length])},it=(a,m)=>{if(!D)return;const N=D,O={...Be,[a]:m};Te.current=Ke(K,O),xe(oe=>({...oe,[N]:O})),kt({path:K,pageKey:N,params:O})},Pt=li({iframeBase:z.iframeBase,resolvedPath:Pe,activeGlobalSectionName:F?.name??null,noServerLabel:r("sandbox.preview.noServerRunning")}),St=a=>{const m=re[a.key]??{},N=Ke(a.path,m);(F||Re(N)!==Re(Pe))&&ge(),Te.current=N,ae(null),Q(null),te(null),S(null),ne(a.key),me(a.path),kt({path:a.path,pageKey:a.key,params:m}),l.selectTarget({kind:"page",key:a.key,path:a.path})},$n=a=>{if(!ye||!ve){Un.error(r("sandbox.preview.previewMetadataNotReady"));return}ge(),Te.current=null;const m=Yn(ve),N=Qn(ye,m,a.key);ae(a),Q(null),te(N),S(null),l.selectTarget({kind:"section",key:a.key})},Fn=a=>{g&&(ae(null),Q(a.key),te(null),Qt("blocks"),l.selectTarget({kind:"loader",key:a.key}))},Xr=async({name:a,path:m,templateKey:N})=>{if(!t||!c)return;const O=Sr(m);if(O){ee(O);return}const oe=m.trim().startsWith("/")?m.trim():`/${m.trim()}`;if(Ae.some(je=>Re(je.path)===Re(oe))){ee(r("sandbox.preview.pageAlreadyExists",{path:oe}));return}let De;if(N&&(De=G?.[N],!De)){ee(r("sandbox.preview.templateNoLongerExists"));return}ee(void 0);try{const je=await xn.mutateAsync({name:a,path:oe,template:De});Y(!1),Un.success(r("sandbox.preview.pageCreated",{name:a})),await js(ji),St({key:je.key,name:je.name,path:je.path}),Qt("blocks")}catch(je){ee(je instanceof Error?je.message:r("sandbox.preview.failedToCreatePage"))}},ot=st&&(Jr||z.mode==="production"),Mn=ci({showPreviewToolbar:ot,contentEditingEnabled:E}),jt=()=>{$(!1),C("")},Et=pt($e??pe),Nt=F?.name??We?.title??xt?.name,Ct=F?`section:${F.key}`:q?`loader:${q}`:D?`page:${D}`:void 0,es=ot?Mn?n.jsxs(xs,{open:I,onOpenChange:a=>{$(a),a||C("")},children:[n.jsx(bs,{asChild:!0,children:n.jsxs("button",{type:"button","aria-label":r("sandbox.preview.choosePage"),"data-testid":"preview-page-picker",title:F||We?Nt:[Et,Nt,K].filter(Boolean).join(" · "),className:"group/page-picker flex h-7 w-fit min-w-0 items-stretch overflow-hidden whitespace-nowrap rounded-lg border border-border/60 bg-background text-left text-xs text-muted-foreground transition-colors hover:border-border focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[!F&&!We&&Et&&n.jsx("span",{"data-testid":"preview-page-origin",className:"flex min-w-0 max-w-56 items-center border-r border-border/60 bg-muted/60 px-2 font-mono text-muted-foreground @max-xl/panel-toolbar:max-w-1/4",children:n.jsx("span",{className:"truncate",children:Et})}),n.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-1.5 px-2 transition-colors group-hover/page-picker:bg-accent/50 group-data-[state=open]/page-picker:bg-accent/50",children:[F&&n.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded bg-global-section/14 px-1.5 py-0.5 text-[11px] font-medium text-global-section-fg dark:text-global-section-fg-dark",children:[n.jsx(Xt,{size:11}),r("sandbox.preview.globalBadge")]}),We&&n.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded bg-muted px-1.5 py-0.5 text-[11px] font-medium text-muted-foreground",children:[n.jsx(en,{size:11}),r("sandbox.preview.loaderBadge")]}),(Nt||!Et)&&n.jsx("span",{className:"min-w-0 truncate font-medium text-foreground",children:Nt??Pt}),!F&&!We&&n.jsx("span",{"data-testid":"preview-page-path",className:"ml-auto min-w-0 truncate text-right font-mono text-muted-foreground",children:K}),n.jsx(Wn,{size:12,className:ze("shrink-0 transition-transform",I&&"rotate-180")})]})]})}),n.jsxs(ys,{className:"w-112 max-w-[calc(100vw-2rem)] p-0",align:"center",sideOffset:8,children:[n.jsxs(gr,{shouldFilter:!1,defaultValue:Ct,children:[n.jsx(vr,{value:U,onValueChange:C,placeholder:r("sandbox.preview.searchPagesAndComponents")}),n.jsxs(hr,{className:"max-h-80",children:[n.jsx(xr,{children:Ae.length===0&&vt.length===0&&It.length===0?r("sandbox.preview.noPagesFound"):r("sandbox.preview.noSearchResults")}),Me.length>0&&n.jsx(ft,{children:Me.map(a=>n.jsxs(ht,{value:`page:${a.key}`,"aria-current":Ct===`page:${a.key}`||void 0,title:`${a.name} · ${a.path}`,onSelect:()=>{jt(),St(a)},className:"gap-3 px-3 py-2.5 aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",children:[n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm",children:a.name}),n.jsx("span",{className:"min-w-0 max-w-1/2 truncate text-right font-mono text-xs text-muted-foreground",children:a.path})]},a.key))}),Ye.length>0&&n.jsx(ft,{heading:r("sandbox.preview.globalComponents"),children:Ye.map(a=>n.jsx(ht,{value:`section:${a.key}`,"aria-current":Ct===`section:${a.key}`||void 0,className:"aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",onSelect:()=>{jt(),$n(a)},children:n.jsx("span",{className:"truncate",children:a.name})},a.key))}),rt.length>0&&n.jsx(ft,{heading:r("sandbox.preview.globalLoaders"),children:rt.map(a=>n.jsx(ht,{value:`loader:${a.key}`,"aria-current":Ct===`loader:${a.key}`||void 0,className:"aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",onSelect:()=>{jt(),Fn(a)},children:n.jsx("span",{className:"truncate",children:a.title})},a.key))})]})]}),!F&&!q&&tt(K).some(a=>a.type!=="text")&&n.jsx("div",{className:"flex flex-wrap items-center gap-1 border-t px-3 py-3 text-xs text-muted-foreground",children:tt(K).map((a,m)=>{if(a.type==="text")return n.jsx("span",{children:a.text},`text-${m}`);const N=yt[a.name];return N&&Qe?n.jsx(or,{sources:N,template:K,paramName:a.name,value:Be[a.name]??"",sandboxRef:Qe,onCommit:O=>it(a.name,O)},`${D}:${a.name}`):n.jsx(lr,{name:a.name,value:Be[a.name]??"",onCommit:O=>it(a.name,O)},`${D}:${a.name}`)})}),n.jsx("div",{className:"border-t p-1.5",children:n.jsxs(Je,{variant:"ghost",className:"w-full justify-start",onClick:()=>{jt(),ee(void 0),Y(!0)},children:[n.jsx(Jn,{size:16}),r("sandbox.preview.createNewPage")]})})]})]}):n.jsx("span",{className:"min-w-0 truncate text-xs text-muted-foreground",children:Pt}):null,Bn=ot||E?n.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[n.jsxs(lt,{children:[n.jsx(ct,{asChild:!0,children:n.jsx(Ie,{onClick:Dn,"aria-label":r($t[v]),children:v==="mobile"?n.jsx(Vn,{size:16}):v==="tablet"?n.jsx(qn,{size:16}):n.jsx(Gn,{size:16})})}),n.jsx(dt,{children:r($t[v])})]}),es,n.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[n.jsx(Ie,{onClick:()=>{Nn()},"aria-label":r(qt),children:n.jsx(ln,{size:16})}),n.jsx(Ie,{onClick:An,"aria-label":r("sandbox.preview.refresh"),children:n.jsx(Hn,{size:16})})]})]}):null,Rt=!e&&ot?n.jsxs(n.Fragment,{children:[n.jsxs(lt,{children:[n.jsx(ct,{asChild:!0,children:n.jsx(Ie,{onClick:An,"aria-label":r("sandbox.preview.refresh"),children:n.jsx(Hn,{size:16})})}),n.jsx(dt,{side:"bottom",children:r("sandbox.preview.refresh")})]}),Mn?n.jsxs("div",{ref:s,className:"relative min-w-0 w-64 shrink",children:[n.jsxs("div",{className:"flex h-7 w-full min-w-0 items-center rounded-md border border-border bg-background transition-colors duration-200 hover:bg-accent",children:[n.jsxs("div",{className:"flex h-full min-w-0 flex-1 cursor-pointer items-center gap-1 pl-2 pr-1",onClick:()=>$(a=>!a),children:[F&&n.jsxs("span",{className:"shrink-0 inline-flex items-center gap-1 rounded bg-global-section/14 px-1.5 py-0.5 text-[11px] font-medium text-global-section-fg dark:text-global-section-fg-dark",children:[n.jsx(Xt,{size:11}),r("sandbox.preview.globalBadge")]}),We&&n.jsxs("span",{className:"shrink-0 inline-flex items-center gap-1 rounded bg-muted px-1.5 py-0.5 text-[11px] font-medium text-muted-foreground",children:[n.jsx(en,{size:11}),r("sandbox.preview.loaderBadge")]}),n.jsx("span",{className:ze("text-[13px] font-medium text-foreground",Kt==null?"min-w-0 flex-1 truncate":"min-w-0 shrink truncate"),children:Kt??Pt}),!F&&!q&&Kt!=null&&K&&n.jsx("span",{className:"flex min-w-0 flex-1 items-center overflow-hidden whitespace-nowrap text-[12px] text-muted-foreground",children:tt(K).map((a,m)=>{if(a.type==="text")return n.jsx("span",{className:ze(m===0?"min-w-0 truncate":"shrink-0"),children:a.text},`text-${m}`);const N=yt[a.name];return N&&Qe?n.jsx(or,{sources:N,template:K,paramName:a.name,value:Be[a.name]??"",sandboxRef:Qe,onCommit:O=>it(a.name,O)},`${D}:${a.name}`):n.jsx(lr,{name:a.name,value:Be[a.name]??"",onCommit:O=>it(a.name,O)},`${D}:${a.name}`)})})]}),n.jsx("button",{type:"button",className:"flex h-full shrink-0 items-center pl-1 pr-2",onClick:()=>$(a=>!a),"aria-label":r("sandbox.preview.choosePage"),"aria-expanded":I,children:n.jsx(Wn,{size:12,className:ze("shrink-0 text-muted-foreground transition-transform",I&&"rotate-180")})})]}),I&&n.jsxs("div",{className:"absolute left-1/2 top-full z-50 mt-1.5 w-[500px] max-w-[calc(100vw-2rem)] -translate-x-1/2 overflow-hidden rounded-lg border bg-popover shadow-lg",children:[n.jsxs("div",{className:"px-2 h-10 flex items-center gap-2 border-b",children:[n.jsx(vs,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),n.jsx("input",{type:"text",value:U,onChange:a=>C(a.target.value),onKeyDown:a=>{if(a.key!=="Enter")return;const m=U.trim();if(!m)return;const N=Me.find(O=>Re(O.path)===Re(m));N&&(a.preventDefault(),$(!1),C(""),St(N))},placeholder:r("sandbox.preview.searchPagesAndComponents"),className:"w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground",autoFocus:!0})]}),n.jsx("div",{className:"p-1.5 border-b",children:n.jsxs("button",{type:"button",className:"flex w-full items-center gap-2.5 rounded-md px-3 py-2.5 text-left text-sm hover:bg-accent hover:text-accent-foreground",onMouseDown:a=>{a.preventDefault(),$(!1),C(""),ee(void 0),Y(!0)},children:[n.jsx(Jn,{size:16,className:"shrink-0 text-muted-foreground"}),n.jsx("span",{className:"flex-1 font-medium",children:r("sandbox.preview.createNewPage")})]})}),Me.length===0&&Ye.length===0&&rt.length===0?n.jsx("div",{className:"px-4 py-5 text-center text-xs text-muted-foreground",children:Ae.length===0&&vt.length===0&&It.length===0?r("sandbox.preview.noPagesFound"):r("sandbox.preview.noSearchResults")}):n.jsxs("div",{className:"max-h-80 overflow-y-auto overscroll-contain",children:[Me.length>0&&n.jsx("div",{className:"p-1.5",children:Me.map(a=>n.jsxs("button",{type:"button",className:"flex w-full items-center gap-3 rounded-md px-3 py-2.5 text-left text-sm hover:bg-accent hover:text-accent-foreground",onMouseDown:m=>{m.preventDefault(),$(!1),C(""),St(a)},children:[n.jsx(gs,{size:16,className:"shrink-0 text-muted-foreground"}),n.jsx("span",{className:"min-w-0 flex-1 truncate font-medium",children:a.name}),n.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:a.path})]},a.key))}),Ye.length>0&&n.jsxs("div",{className:ze("p-1.5",Me.length>0&&"border-t"),children:[n.jsx("div",{className:"px-3 py-2 text-xs font-medium text-muted-foreground",children:r("sandbox.preview.globalComponents")}),Ye.map(a=>n.jsxs("button",{type:"button",className:"flex w-full items-center gap-3 rounded-md px-3 py-2.5 text-left text-sm hover:bg-accent hover:text-accent-foreground",onMouseDown:m=>{m.preventDefault(),$(!1),C(""),$n(a)},children:[n.jsx(Xt,{size:16,className:"shrink-0 text-muted-foreground"}),n.jsx("span",{className:"min-w-0 flex-1 truncate font-medium",children:a.name}),n.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:a.resolveType.split("/").pop()?.replace(/\.tsx?$/,"")})]},a.key))]}),rt.length>0&&n.jsxs("div",{className:ze("p-1.5",(Me.length>0||Ye.length>0)&&"border-t"),children:[n.jsx("div",{className:"px-3 py-2 text-xs font-medium text-muted-foreground",children:r("sandbox.preview.globalLoaders")}),rt.map(a=>n.jsxs("button",{type:"button",className:"flex w-full items-center gap-3 rounded-md px-3 py-2.5 text-left text-sm hover:bg-accent hover:text-accent-foreground",onMouseDown:m=>{m.preventDefault(),$(!1),C(""),Fn(a)},children:[n.jsx(en,{size:16,className:"shrink-0 text-muted-foreground"}),n.jsx("span",{className:"min-w-0 flex-1 truncate font-medium",children:a.title}),n.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:a.resolveType.split("/").pop()?.replace(/\.tsx?$/,"")})]},a.key))]})]})]})]}):n.jsx("span",{className:"min-w-0 truncate px-2 text-[13px] text-muted-foreground",children:Pt}),n.jsxs(lt,{children:[n.jsx(ct,{asChild:!0,children:n.jsx(Ie,{"aria-label":r(qt),onClick:()=>{Nn()},children:n.jsx(ln,{size:16})})}),n.jsx(dt,{side:"bottom",children:r(qt)})]})]}):null,ts=Rt?n.jsx("div",{className:"flex min-w-0 items-center gap-0.5",children:Rt}):null,zn=z.mode==="sandbox",Tt=Ei[v],Lt=v==="desktop"&&(A.width===0||A.width>=Tt.width+2*mr),In=Lt?1:Math.min(A.width>0?A.width/(Tt.width+2*mr):1,1),ns=Lt?{width:"100%",height:"100%"}:{width:`${Tt.width}px`,height:A.height>0?`${A.height/In}px`:`${Tt.height}px`,transform:`scale(${In})`,transformOrigin:"top center"},Kn=zn&&(ot||E)?n.jsx(Ie,{onClick:_n,"aria-pressed":de==="visual","aria-label":r("sandbox.preview.visualEditor"),active:de==="visual",children:n.jsx(tn,{size:16})}):null,rs=!e&&st?n.jsx("div",{className:"absolute bottom-4 left-1/2 z-20 -translate-x-1/2 scale-125",children:n.jsxs("div",{className:"flex items-center gap-0.5 rounded-full border bg-background/60 p-1 shadow-lg backdrop-blur-md",children:[zn&&n.jsxs(n.Fragment,{children:[n.jsxs(lt,{children:[n.jsx(ct,{asChild:!0,children:n.jsx(Ie,{onClick:_n,"aria-pressed":de==="visual","aria-label":r("sandbox.preview.visualEditor"),active:de==="visual",className:"rounded-full",children:n.jsx(tn,{size:16})})}),n.jsx(dt,{side:"top",children:r("sandbox.preview.visualEditor")})]}),n.jsx("div",{className:"mx-0.5 h-5 w-px bg-border"})]}),n.jsxs(lt,{children:[n.jsx(ct,{asChild:!0,children:n.jsx(Ie,{onClick:Dn,"aria-label":r($t[v]),className:"rounded-full",children:n.jsxs("span",{className:"flex items-center justify-center animate-device-icon-pop",children:[v==="mobile"&&n.jsx(Vn,{size:16}),v==="tablet"&&n.jsx(qn,{size:16}),v==="desktop"&&n.jsx(Gn,{size:16})]},v)})}),n.jsx(dt,{side:"top",children:r($t[v])})]})]})}):null,ss=!!q&&de==="blocks";return n.jsxs("div",{className:"flex flex-col w-full h-full",children:[Qe&&Object.entries(yt).map(([a,m])=>(Be[a]??"")===""?n.jsx(ai,{sources:m,template:K,paramName:a,sandboxRef:Qe,onFill:N=>it(a,N)},`${D}:${a}`):null),e?n.jsxs(n.Fragment,{children:[n.jsx(Zt.Toolbar.Center.Portal,{fallback:n.jsx("div",{className:"flex min-w-0 items-center justify-center border-b p-2",children:Bn}),children:Bn}),n.jsx(Zt.Toolbar.Right.Portal,{fallback:Kn,children:Kn})]}):n.jsx(n.Fragment,{children:n.jsx(Zt.Topbar.Center.Portal,{fallback:Rt&&n.jsxs("div",{className:"@container/panel-header relative flex h-12 shrink-0 items-center gap-2 border-b border-border/60 px-3 md:px-4",children:[n.jsx("div",{className:"flex-1"}),n.jsx("div",{className:"flex min-w-0 shrink items-center justify-center gap-0.5",children:Rt}),n.jsx("div",{className:"flex-1"})]}),children:ts})}),n.jsx("div",{className:"flex-1 overflow-hidden compact:relative",children:ss?n.jsxs("div",{className:"relative h-full min-h-0 overflow-hidden",children:[n.jsx(dr,{virtualMcpId:t,externalSelection:k,onViewJsonFile:_}),H&&D&&n.jsx("div",{className:"absolute inset-0 z-10",children:n.jsx(ur,{ref:M,virtualMcpId:t,pageKey:D,onClose:L})})]}):n.jsxs(Xn,{orientation:"horizontal",disabled:de!=="blocks",className:"relative isolate",children:[n.jsx(_t,{ref:j,id:"preview-blocks-editor",defaultSize:de==="blocks"?"30%":"0%",minSize:"20%",collapsible:!0,collapsedSize:"0%",className:"min-w-0 overflow-hidden",children:de==="blocks"&&n.jsx(dr,{virtualMcpId:t,externalSelection:k,onViewJsonFile:_})}),de==="blocks"&&n.jsx(er,{withHandle:!0}),n.jsx(_t,{id:"preview-canvas",defaultSize:de==="blocks"?"70%":"100%",minSize:"35%",className:"min-w-0 overflow-hidden compact:relative compact:z-0",children:n.jsxs(Xn,{orientation:"horizontal",disabled:!(H&&D),children:[H&&D&&n.jsxs(n.Fragment,{children:[n.jsx(_t,{id:"preview-json-editor",defaultSize:"43%",minSize:"20%",className:"min-w-0 overflow-hidden",children:n.jsx(ur,{ref:M,virtualMcpId:t,pageKey:D,onClose:L})}),n.jsx(er,{withHandle:!0})]}),n.jsx(_t,{id:"preview-canvas-inner",minSize:"30%",className:"min-w-0 overflow-hidden",children:n.jsxs("div",{ref:a=>{if(!a)return;const m=()=>W(O=>O.width===a.clientWidth&&O.height===a.clientHeight?O:{width:a.clientWidth,height:a.clientHeight});m();const N=new ResizeObserver(m);return N.observe(a),()=>N.disconnect()},className:ze("h-full relative overflow-clip flex justify-center",st&&!Lt&&"bg-muted/30"),children:[(le||Ir)&&st&&n.jsx("div",{className:"absolute inset-x-0 top-0 z-40 h-1 overflow-hidden",children:n.jsx("div",{className:"absolute inset-y-0 left-0 rounded-r-full bg-brand shadow-[0_0_6px] shadow-brand/60 animate-preview-ramp"})}),z.showBlockingOverlay&&n.jsx("div",{className:"absolute inset-0 z-30",children:n.jsx(rn,{kind:"starting",progress:Pn,claimPhase:Vt})}),Ve.kind==="suspended"&&n.jsx("div",{className:"absolute inset-0 z-30",children:n.jsx(rn,{kind:"suspended",onResume:Ce.resume})}),Ve.kind==="errored"&&n.jsx("div",{className:"absolute inset-0 z-30",children:n.jsx(rn,{kind:"errored",error:Ve.error,onRetry:Ce.retry,connectionsHref:`/${Oe.slug}/settings/connections`})}),z.showWakingPill&&n.jsxs("div",{className:"absolute top-4 left-1/2 z-20 flex max-w-md -translate-x-1/2 items-start gap-3 rounded-xl border border-border bg-muted px-4 py-3 shadow-lg pointer-events-none select-none",children:[n.jsx(Mt,{className:"size-4.5 mt-0.5 shrink-0 text-muted-foreground"}),n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsx("span",{className:"text-sm font-medium text-foreground",children:r("sandbox.preview.startingPreview")}),n.jsx("span",{className:"text-xs text-muted-foreground",children:r("sandbox.preview.startingPreviewHint")})]})]}),de==="visual"&&!y&&n.jsxs("div",{className:"absolute top-2 left-1/2 -translate-x-1/2 z-20 flex items-center gap-1.5 rounded-full border border-violet-400/40 bg-violet-500/90 px-3 py-1 text-xs font-medium text-white shadow-md backdrop-blur-sm pointer-events-none select-none",children:[n.jsx(tn,{size:12}),r("sandbox.preview.clickElementToAsk")]}),de==="visual"&&y&&n.jsx(ja,{element:y,onDismiss:()=>w(null)}),rs,st&&Se&&n.jsx("div",{className:ze("shrink-0",!Lt&&"border-x border-border bg-background shadow-sm"),style:ns,onMouseLeave:Zr,children:n.jsx("iframe",{ref:T,src:Se,className:"w-full h-full border-0",title:r("sandbox.preview.devServerPreviewTitle"),onError:Rn.handleError,onLoad:()=>{if(Rn.handleLoad(),nt(),z.mode!=="sandbox"){z.mode==="production"&&!z.showWakingPill&&de==="blocks"&&Yt();return}if(ds("vm_preview_loaded",{view_mode:de,vm_id:zt?.sandboxHandle??null}),!F)try{const a=T.current?.contentWindow?.location?.pathname;if(!a)return;const m=Te.current;if(m!==null&&(Te.current=null,Re(a)!==Re(m))||Re(a)===Re(Pe))return;me(a),kt({path:a,pageKey:fe,params:Be})}catch{}de==="visual"&&On(),de==="blocks"&&Yt()}},z.iframeBase)})]})})]})})]})}),n.jsx(ui,{open:se,onOpenChange:Y,isPending:xn.isPending,error:Ne,templates:Ae,onSubmit:Xr})]})}function _i(t){const e=ue.c(22),{virtualMcpId:s}=t,r=Le(),i=ks(s),{activeTask:u,taskId:c,currentBranch:d}=Bt(),o=ua(c),[l,h]=x.useState(!1);if(da({threadId:c,sandboxBranch:u?.branch??d,agentHasRepo:sn(i?.metadata),threadHasRepo:sn(o)||sn(u?.metadata)})==="none"){let E;e[0]===Symbol.for("react.memo_cache_sentinel")?(E=n.jsx("div",{className:"flex size-14 items-center justify-center rounded-full bg-muted",children:n.jsx(tr,{className:"size-7 text-foreground"})}),e[0]=E):E=e[0];let g;e[1]!==r?(g=r("mainPanelTabs.previewTab.noSourceToPreview"),e[1]=r,e[2]=g):g=e[2];let P;e[3]!==r?(P=r("mainPanelTabs.previewTab.connectGithubDescription"),e[3]=r,e[4]=P):P=e[4];let b,v;e[5]===Symbol.for("react.memo_cache_sentinel")?(b=()=>h(!0),v=n.jsx(tr,{className:"size-4"}),e[5]=b,e[6]=v):(b=e[5],v=e[6]);let R;e[7]!==r?(R=r("mainPanelTabs.previewTab.connectGithub"),e[7]=r,e[8]=R):R=e[8];let y;e[9]!==R?(y=n.jsxs(Je,{onClick:b,children:[v,R]}),e[9]=R,e[10]=y):y=e[10];let w;e[11]!==g||e[12]!==P||e[13]!==y?(w=n.jsx(gn,{className:"h-full",image:E,title:g,description:P,actions:y}),e[11]=g,e[12]=P,e[13]=y,e[14]=w):w=e[14];let k;e[15]!==l?(k=n.jsx(ca,{open:l,onOpenChange:h,mode:"agent"}),e[15]=l,e[16]=k):k=e[16];let S;return e[17]!==w||e[18]!==k?(S=n.jsxs(n.Fragment,{children:[w,k]}),e[17]=w,e[18]=k,e[19]=S):S=e[19],S}let f;return e[20]!==s?(f=n.jsx(Oi,{virtualMcpId:s}),e[20]=s,e[21]=f):f=e[21],f}function ld(){const t=ue.c(2),e=ma();let s;return t[0]!==e?(s=n.jsx(us,{tabId:"site-editor",children:n.jsx(ms,{feature:"cms",children:n.jsx(_i,{virtualMcpId:e})})}),t[0]=e,t[1]=s):s=t[1],s}export{ld as default};