decocms 4.517.0 → 4.518.1

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 (416) hide show
  1. package/dist/client/assets/{ActiveShapeUtils-BB436TvV.js → ActiveShapeUtils-Bis8M8cE.js} +1 -1
  2. package/dist/client/assets/{AlertCircle-Cch634f7.js → AlertCircle-CF7oV00-.js} +1 -1
  3. package/dist/client/assets/{AreaChart-CpsihjcZ.js → AreaChart-rRgwbDdY.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-CohopnCT.js → ArrowLeft-BYRX2oWU.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-DLUdomd9.js → ArrowUp-C-Wi5Wp-.js} +1 -1
  6. package/dist/client/assets/{BarChart-DC5-aC-9.js → BarChart-B-Yzzi8V.js} +1 -1
  7. package/dist/client/assets/{Building02-BHJQSDUK.js → Building02-BTo5ALb8.js} +1 -1
  8. package/dist/client/assets/{CartesianChart-dMOiAgfo.js → CartesianChart-D4q-R38l.js} +1 -1
  9. package/dist/client/assets/{CategoricalChart-BCAB1JR1.js → CategoricalChart-DTvqZVLo.js} +1 -1
  10. package/dist/client/assets/{CheckCircle-Cs8i9zYt.js → CheckCircle-B7DLXg5D.js} +1 -1
  11. package/dist/client/assets/{ChevronSelectorVertical-C5d75KyY.js → ChevronSelectorVertical-ByVW2vd8.js} +1 -1
  12. package/dist/client/assets/{ChevronUp-BT7eMKPK.js → ChevronUp-i4o2LTaN.js} +1 -1
  13. package/dist/client/assets/{Copy01-B341DqLV.js → Copy01-Ck9G4OUr.js} +1 -1
  14. package/dist/client/assets/{CreditCard01-4Fwr0tNh.js → CreditCard01-DBL8NXSk.js} +1 -1
  15. package/dist/client/assets/{DotsVertical-DbrlDgFh.js → DotsVertical-DGS_x5nz.js} +1 -1
  16. package/dist/client/assets/{ErrorBarContext-t45nElJh.js → ErrorBarContext-ClwVJba6.js} +1 -1
  17. package/dist/client/assets/{Globe04-BE6c1UDj.js → Globe04-lKXBAfc3.js} +1 -1
  18. package/dist/client/assets/{Image01-hTzc15CE.js → Image01-Cwrowq3c.js} +1 -1
  19. package/dist/client/assets/{Key01-kTu6t6u_.js → Key01-CEbPGYnm.js} +1 -1
  20. package/dist/client/assets/{Link01-hfA48cFL.js → Link01-DXqb71Uu.js} +1 -1
  21. package/dist/client/assets/{LinkBroken01-Dioz3u9i.js → LinkBroken01-DhWTb9MO.js} +1 -1
  22. package/dist/client/assets/{Minus-DqDPTtRG.js → Minus-C9yYSfDR.js} +1 -1
  23. package/dist/client/assets/{Monitor01-Bz6QaUO4.js → Monitor01-BL3DAm_1.js} +1 -1
  24. package/dist/client/assets/{Play-CByslM3d.js → Play-CZ7QKkqf.js} +1 -1
  25. package/dist/client/assets/{Plus-Dewm72je.js → Plus-BRxUqR_F.js} +1 -1
  26. package/dist/client/assets/{ReferenceLine-DV9hYxt_.js → ReferenceLine-D1hjyX4I.js} +1 -1
  27. package/dist/client/assets/{SearchMd-7Jo0ZofC.js → SearchMd-DiO3q0AT.js} +1 -1
  28. package/dist/client/assets/{Sector-D64VY8hG.js → Sector-XuiRQ9ct.js} +1 -1
  29. package/dist/client/assets/{ShoppingBag01-BStpgW0a.js → ShoppingBag01-B4aQ0-ny.js} +1 -1
  30. package/dist/client/assets/{Sun-C37Hpdko.js → Sun-DqiY7Z2B.js} +1 -1
  31. package/dist/client/assets/{SwitchHorizontal01-CrC4ThKg.js → SwitchHorizontal01-BbdJtypW.js} +1 -1
  32. package/dist/client/assets/{Tool01-2gJDR0Ho.js → Tool01-C0vFHYhV.js} +1 -1
  33. package/dist/client/assets/{Trash01-DjE7Raat.js → Trash01-bhcUMroB.js} +1 -1
  34. package/dist/client/assets/{Upload01-CYfTR3aZ.js → Upload01-BwEuXdMa.js} +1 -1
  35. package/dist/client/assets/{User01-X6IeKYZH.js → User01-DSs11bSF.js} +1 -1
  36. package/dist/client/assets/{UserSquare-pmxb5ZdZ.js → UserSquare-DXYtKMfd.js} +1 -1
  37. package/dist/client/assets/{Users01-uKJoVSle.js → Users01-CTqd0ZAH.js} +1 -1
  38. package/dist/client/assets/{XClose-BVxVAZ6V.js → XClose-CxYwKo3k.js} +1 -1
  39. package/dist/client/assets/{ZoomOut-DixQygt2.js → ZoomOut-D-Ww048N.js} +1 -1
  40. package/dist/client/assets/{access-gate-BpfEc6VH.js → access-gate-Bq22oyfg.js} +1 -1
  41. package/dist/client/assets/{add-connection-dialog-BZwLO1Ja.js → add-connection-dialog-CQYwaYCv.js} +1 -1
  42. package/dist/client/assets/agent-analytics-B-zaohtV.js +1 -0
  43. package/dist/client/assets/agent-app-BbV2xIu_.js +1 -0
  44. package/dist/client/assets/{agent-assets-e6Gk5J-Q.js → agent-assets-4YMODB__.js} +1 -1
  45. package/dist/client/assets/{agent-automation-jGwXvC8f.js → agent-automation-CmK6_mc6.js} +1 -1
  46. package/dist/client/assets/{agent-automations-DzW1crP1.js → agent-automations-BCX_o1aB.js} +1 -1
  47. package/dist/client/assets/agent-calendar-Ddf3r2JM.js +1 -0
  48. package/dist/client/assets/{agent-connect-sources-6bCKMOK5.js → agent-connect-sources-Bxy4Jo7k.js} +1 -1
  49. package/dist/client/assets/agent-deck-UP8oQtvT.js +1 -0
  50. package/dist/client/assets/{agent-e2e-DwASXEee.js → agent-e2e-BdqM7Rx1.js} +1 -1
  51. package/dist/client/assets/agent-experiments-CrVBOIKR.js +1 -0
  52. package/dist/client/assets/agent-file-Cb4leotK.js +1 -0
  53. package/dist/client/assets/{agent-hosting-BVT3wdCc.js → agent-hosting-yUCKeG5I.js} +1 -1
  54. package/dist/client/assets/{agent-icon-CiKTiUdq.js → agent-icon-CCDPFoN-.js} +1 -1
  55. package/dist/client/assets/agent-library-DMqKWgMi.js +1 -0
  56. package/dist/client/assets/agent-library-file-DOe-l166.js +1 -0
  57. package/dist/client/assets/{agent-monitor-C_MtaF0x.js → agent-monitor-DpSfxETg.js} +1 -1
  58. package/dist/client/assets/{agent-overview-BaJQVLzH.js → agent-overview-D27q04-k.js} +1 -1
  59. package/dist/client/assets/agent-releases-DhOHbzAx.js +2 -0
  60. package/dist/client/assets/agent-settings-D_kjSJft.js +1 -0
  61. package/dist/client/assets/{agent-site-editor-DGIssniL.js → agent-site-editor-CoubOLH6.js} +2 -2
  62. package/dist/client/assets/agent-site-editor-code-CdfJCg4-.js +2 -0
  63. package/dist/client/assets/agent-site-editor-content-C-o-blM5.js +1 -0
  64. package/dist/client/assets/agent-site-editor-preview-D1F79zUW.js +1 -0
  65. package/dist/client/assets/agent-view-PuW3-X6q.js +1 -0
  66. package/dist/client/assets/{agent-view-guard-Cz_9FSeB.js → agent-view-guard-BIS7z4mW.js} +1 -1
  67. package/dist/client/assets/{agents-list-BehVRlw8.js → agents-list-CpVGk57l.js} +1 -1
  68. package/dist/client/assets/{ai-providers-Cfzh0dop.js → ai-providers-C8dIcjWL.js} +1 -1
  69. package/dist/client/assets/{alert-DlpN1nbO.js → alert-CmByshZi.js} +1 -1
  70. package/dist/client/assets/{alert-dialog-BdWXpnme.js → alert-dialog-BcRtAren.js} +1 -1
  71. package/dist/client/assets/{analytics-sections-CBRurMfi.js → analytics-sections-CTEkK2Tf.js} +1 -1
  72. package/dist/client/assets/{analytics-tab-Bu3yOSFE.js → analytics-tab-DPVT4KOA.js} +1 -1
  73. package/dist/client/assets/api-keys-CNy2dZat.js +1 -0
  74. package/dist/client/assets/{api-keys-SwcfBYZn.js → api-keys-DYTxKYWP.js} +1 -1
  75. package/dist/client/assets/{app-editor-BzaLO82-.js → app-editor-C1ZA1u8T.js} +1 -1
  76. package/dist/client/assets/{asset-utils-CYj7sEud.js → asset-utils-DIN0M3zp.js} +1 -1
  77. package/dist/client/assets/{auth-catchall-CM988zgH.js → auth-catchall-vhsgYqnn.js} +1 -1
  78. package/dist/client/assets/{auth-entry-BM6bA3ji.js → auth-entry-C6zNerIy.js} +1 -1
  79. package/dist/client/assets/{auth-split-layout-BnlVBIeL.js → auth-split-layout-DKwsje6s.js} +1 -1
  80. package/dist/client/assets/{auth-DVebpHI3.js → auth-vu0NBiVX.js} +1 -1
  81. package/dist/client/assets/{authenticate-and-persist-oauth-qcbNyaRp.js → authenticate-and-persist-oauth-Dj1wDkpb.js} +1 -1
  82. package/dist/client/assets/{automation-list-row-BIlvc0v-.js → automation-list-row-DucKF7kG.js} +1 -1
  83. package/dist/client/assets/{automation-runs-jRApvuta.js → automation-runs-Ui7o3JfN.js} +1 -1
  84. package/dist/client/assets/{automations-DMHgje9o.js → automations-CmK0evd4.js} +1 -1
  85. package/dist/client/assets/{autosend-BTx7-p6a.js → autosend-ClHP6mj3.js} +1 -1
  86. package/dist/client/assets/{avatar-DjIkOwsx.js → avatar-BfW8_V1B.js} +1 -1
  87. package/dist/client/assets/{badge-BfMggcm8.js → badge-CqxA0I5-.js} +1 -1
  88. package/dist/client/assets/{block-document-DKju3Lsl.js → block-document-l9rZniOP.js} +1 -1
  89. package/dist/client/assets/{blocks-preview-workspace-context-AokvrTWO.js → blocks-preview-workspace-context-DIzgwExA.js} +1 -1
  90. package/dist/client/assets/{blocks-tab-states-5tpSikld.js → blocks-tab-states-D014yZyw.js} +1 -1
  91. package/dist/client/assets/{blog-schema-B8hGgOKc.js → blog-schema-p025Q_3k.js} +1 -1
  92. package/dist/client/assets/{buckets-DzW1ArnB.js → buckets-C4799eWK.js} +1 -1
  93. package/dist/client/assets/{build-improve-prompt-doc-BGKe2ED3.js → build-improve-prompt-doc-C9nuC795.js} +1 -1
  94. package/dist/client/assets/{calendar-kdikRXDO.js → calendar-C7UsyFmW.js} +1 -1
  95. package/dist/client/assets/{campaigns-view-CXUV2H04.js → campaigns-view-Cz4ACJMm.js} +1 -1
  96. package/dist/client/assets/{capability-load-error-BuC7MxXm.js → capability-load-error-rgxsCr8U.js} +1 -1
  97. package/dist/client/assets/category-editor-CldKargp.js +1 -0
  98. package/dist/client/assets/{chart-aHPEwhl0.js → chart-7lusH4mk.js} +1 -1
  99. package/dist/client/assets/{chat-context-BEyCIAaN.js → chat-context-DaG-xhpe.js} +1 -1
  100. package/dist/client/assets/{chat-draft-Dql_zG1A.js → chat-draft-B4qXFQ20.js} +1 -1
  101. package/dist/client/assets/{checkbox-R6Pm_B33.js → checkbox-k3S7hbYo.js} +1 -1
  102. package/dist/client/assets/{choose-editor-C1zV1Fp9.js → choose-editor-DhoxAjmj.js} +1 -1
  103. package/dist/client/assets/{cli-auth-success-Dw0y5N0L.js → cli-auth-success-9cwHK6DP.js} +1 -1
  104. package/dist/client/assets/{client-icons-C_WiAP0u.js → client-icons-XJM50Gvn.js} +1 -1
  105. package/dist/client/assets/cms-settings-editor-VytgeION.js +1 -0
  106. package/dist/client/assets/{collapsible-BcZaehP2.js → collapsible-CCUbGddy.js} +1 -1
  107. package/dist/client/assets/{collection-detail-AO17C_8B.js → collection-detail-BQphYH0i.js} +1 -1
  108. package/dist/client/assets/{collection-display-button-C0cYhq66.js → collection-display-button-DtypHbWr.js} +1 -1
  109. package/dist/client/assets/{collection-search-7sBPioRN.js → collection-search-DFZiZHgj.js} +1 -1
  110. package/dist/client/assets/{collection-table-wrapper-BzgZq6u7.js → collection-table-wrapper-D5vvhE9_.js} +1 -1
  111. package/dist/client/assets/{collection-tabs-DMsbicTn.js → collection-tabs-5oBppmJp.js} +1 -1
  112. package/dist/client/assets/{column-rules-CBkHBJjn.js → column-rules-DikbPDpl.js} +1 -1
  113. package/dist/client/assets/{combobox-CEzxugDA.js → combobox--wUI1bJn.js} +1 -1
  114. package/dist/client/assets/{command-KmLWWmqo.js → command-A6J0_nSj.js} +1 -1
  115. package/dist/client/assets/{companion-mcps-section-vJ3FRpYP.js → companion-mcps-section-DHW4_WEu.js} +1 -1
  116. package/dist/client/assets/{config-0t8v4_10.js → config-0cyLL49J.js} +1 -1
  117. package/dist/client/assets/{connect-Ceo_a42v.js → connect-Bi8fTNRc.js} +1 -1
  118. package/dist/client/assets/{connect-layout-DXn91Bwy.js → connect-layout-BXupI1uo.js} +1 -1
  119. package/dist/client/assets/{connect-source-dialog-DCA13Vr9.js → connect-source-dialog-DUESoily.js} +1 -1
  120. package/dist/client/assets/{connection-BXCm7RUN.js → connection-DP0Tkqpu.js} +1 -1
  121. package/dist/client/assets/{connection-card-DudSxk_f.js → connection-card-SGeLl-3V.js} +1 -1
  122. package/dist/client/assets/{connection-detail-Bzj7ZAYC.js → connection-detail-8iT2pzkA.js} +1 -1
  123. package/dist/client/assets/{connection-form-helpers-BCgvOrMH.js → connection-form-helpers-5dAreg1i.js} +1 -1
  124. package/dist/client/assets/{connections-DZsQ6PqI.js → connections-Ba0FzDee.js} +1 -1
  125. package/dist/client/assets/{content-tab-B8CAyeYn.js → content-tab-Co7UZ0ue.js} +3 -3
  126. package/dist/client/assets/{context-Dxx9Nppi.js → context-DSH71GyO.js} +1 -1
  127. package/dist/client/assets/{context-menu-Bup14w-O.js → context-menu-m7JMy9Ts.js} +1 -1
  128. package/dist/client/assets/{context-shell-YuMc6M7u.js → context-shell-CHo3-a1U.js} +3 -3
  129. package/dist/client/assets/{core.esm-BmE_KURk.js → core.esm-BT3eS5hh.js} +1 -1
  130. package/dist/client/assets/{create-organization-dialog-oYjru5bh.js → create-organization-dialog-t8CuAC-D.js} +1 -1
  131. package/dist/client/assets/{daily-pulse-Cj6zflmn.js → daily-pulse-EoXIBNAG.js} +1 -1
  132. package/dist/client/assets/{discover-BsfuhgQD.js → discover-r5fXEWQj.js} +1 -1
  133. package/dist/client/assets/{domain-settings-BCFlmNLU.js → domain-settings-Zd079_oe.js} +1 -1
  134. package/dist/client/assets/{drawer-Bi1-udV5.js → drawer-BfInv3z-.js} +1 -1
  135. package/dist/client/assets/{editor-DAekV0he.js → editor-CpWj2GSL.js} +1 -1
  136. package/dist/client/assets/{editor-classes-BaBC2QPU.js → editor-classes-5vsxGGPA.js} +1 -1
  137. package/dist/client/assets/{empty-state-wXIjf_EN.js → empty-state-BThdzdI0.js} +1 -1
  138. package/dist/client/assets/{empty-state-B4dSQMeM.js → empty-state-C97rGNTx.js} +1 -1
  139. package/dist/client/assets/{experiments-tab-PntzDOfu.js → experiments-tab-BQyQ_6Nt.js} +1 -1
  140. package/dist/client/assets/{experiments-tab-choice-CQ5EsK8h.js → experiments-tab-choice-CJxPrnzq.js} +1 -1
  141. package/dist/client/assets/{extract-connection-data-Bg9K46Rs.js → extract-connection-data-BJcueAXf.js} +1 -1
  142. package/dist/client/assets/{feature-gate-4u7sb4lR.js → feature-gate-DOUh8nVg.js} +1 -1
  143. package/dist/client/assets/{feature-paywall-BsVH1P4Z.js → feature-paywall-skggPdmN.js} +1 -1
  144. package/dist/client/assets/{file-explorer-CsBngoR2.js → file-explorer-BB5wuYW2.js} +1 -1
  145. package/dist/client/assets/{file-preview-CVVpAx14.js → file-preview-DYLPzEi6.js} +1 -1
  146. package/dist/client/assets/{file-share-button-Dh2OblA7.js → file-share-button-B1svbxuR.js} +1 -1
  147. package/dist/client/assets/{file-type-icon-DYeFNgMs.js → file-type-icon-Dh-YpP4t.js} +1 -1
  148. package/dist/client/assets/{folder-icon-CMfbCZZj.js → folder-icon-CPXfYDTX.js} +1 -1
  149. package/dist/client/assets/{form-BGI3x6he.js → form-Diz2j79C.js} +1 -1
  150. package/dist/client/assets/{general-AgdwRV2K.js → general-5pQPx87d.js} +1 -1
  151. package/dist/client/assets/{home-B3JLIiqG.js → home-Dnlsm-wz.js} +1 -1
  152. package/dist/client/assets/{icon-button-Du_O8eku.js → icon-button-DuuXKRCk.js} +1 -1
  153. package/dist/client/assets/{index-Dw3D39xs.js → index-5O453B2L.js} +1 -1
  154. package/dist/client/assets/index-BMri_gPt.js +1 -0
  155. package/dist/client/assets/{index-BnbMIYQC.js → index-Bpjyo8cb.js} +1 -1
  156. package/dist/client/assets/{index-CkwxAoM4.js → index-BvwkkTca.js} +8 -8
  157. package/dist/client/assets/{index-CqllmV-p.js → index-Bw7ZdG0V.js} +1 -1
  158. package/dist/client/assets/{index-BliYmmPu.js → index-CH_rHFJ7.js} +1 -1
  159. package/dist/client/assets/{index-DVxNOEMj.js → index-CjCEGRSu.js} +1 -1
  160. package/dist/client/assets/{index-CcDpskhn.js → index-CtJ5bSic.js} +1 -1
  161. package/dist/client/assets/{index-BWEksKOa.js → index-D2_QRuAQ.js} +1 -1
  162. package/dist/client/assets/{index-CdhgpKbn.js → index-DPyR1fyZ.js} +1 -1
  163. package/dist/client/assets/{index-BeWb3VLq.js → index-DY9jv8u5.js} +37 -37
  164. package/dist/client/assets/{index-BflgjdLH.js → index-fElQwNzQ.js} +1 -1
  165. package/dist/client/assets/{index-BEaGR-Ng.js → index-hWaEVFzi.js} +1 -1
  166. package/dist/client/assets/{index-redirect-BpERt5XK.js → index-redirect-BF2Ze6CX.js} +1 -1
  167. package/dist/client/assets/{index-BXwVgYyP.js → index-u06bTyUt.js} +1 -1
  168. package/dist/client/assets/{index-CEnumkKh.js → index-vOiCoekF.js} +1 -1
  169. package/dist/client/assets/{infiniteQueryObserver-BOCgDRcQ.js → infiniteQueryObserver-Glyohd4p.js} +1 -1
  170. package/dist/client/assets/{infra-billing-443Q4BKf.js → infra-billing-Bd2bFoZ5.js} +1 -1
  171. package/dist/client/assets/{input-D9vH1igB.js → input-Ca18CK1P.js} +1 -1
  172. package/dist/client/assets/{input-D1nDj3Gx.js → input-F0XP3M77.js} +3 -3
  173. package/dist/client/assets/{integration-icon-VoZokpOe.js → integration-icon-BZ0SYBCb.js} +1 -1
  174. package/dist/client/assets/{jira-icon-BOD4UX3O.js → jira-icon-66RPgyoE.js} +1 -1
  175. package/dist/client/assets/{label-TKhfC6jr.js → label-CUbZuKc3.js} +1 -1
  176. package/dist/client/assets/{layout-OvvfNrHJ.js → layout-Cedqx0JP.js} +1 -1
  177. package/dist/client/assets/{legacy-agents-deep-Bj2cFPCz.js → legacy-agents-deep-D41zNkt6.js} +1 -1
  178. package/dist/client/assets/legacy-main-redirect-B7bd3WDG.js +1 -0
  179. package/dist/client/assets/library-D71H_oBI.js +1 -0
  180. package/dist/client/assets/{login-d1G00P7v.js → login-BEUSAD5h.js} +1 -1
  181. package/dist/client/assets/{markdown-D_Bab0vD.js → markdown-CQTrkEJG.js} +3 -3
  182. package/dist/client/assets/{mcp-app-renderer-C5DYTOzS.js → mcp-app-renderer-CfeFa2D0.js} +1 -1
  183. package/dist/client/assets/{mcp-oauth-Bv0ymH6e.js → mcp-oauth-DqI-dLnK.js} +1 -1
  184. package/dist/client/assets/{mcp-oauth-gJmjFND6.js → mcp-oauth-dZFQnVjg.js} +1 -1
  185. package/dist/client/assets/{members-CGCmgk2j.js → members-D8letp2p.js} +1 -1
  186. package/dist/client/assets/{memory-DjHNNPOW.js → memory-C9mu7Zkb.js} +1 -1
  187. package/dist/client/assets/{mini-report-page-BSYlfSmZ.js → mini-report-page-JqpGP2GL.js} +1 -1
  188. package/dist/client/assets/{mock-board-BCQJ9AHq.js → mock-board-BGHy2qG4.js} +3 -3
  189. package/dist/client/assets/{monaco-editor-CVRVgXSh.js → monaco-editor-nJc5wgpu.js} +1 -1
  190. package/dist/client/assets/{monitoring-mogv5pNr.js → monitoring-BtZh6NEX.js} +1 -1
  191. package/dist/client/assets/{monitoring-stats-row-BEpenrU2.js → monitoring-stats-row-BAFX8tUf.js} +1 -1
  192. package/dist/client/assets/{multi-select-ZwwArowo.js → multi-select-DpaHzZAz.js} +1 -1
  193. package/dist/client/assets/{mustache-B20fDMb8.js → mustache-CewpKCP1.js} +2 -2
  194. package/dist/client/assets/{named-rule-uses-Bxr3PCeC.js → named-rule-uses-939Puzgt.js} +1 -1
  195. package/dist/client/assets/{named-rule-view-pF5yBmDb.js → named-rule-view-CML2JnRp.js} +1 -1
  196. package/dist/client/assets/{new-project-dialog-DfI138Mw.js → new-project-dialog-BDUYA1Q9.js} +1 -1
  197. package/dist/client/assets/{oauth-callback-C0l4AVA-.js → oauth-callback-ClogQ-NW.js} +1 -1
  198. package/dist/client/assets/{oauth-callback-ai-provider-DlpJWGZf.js → oauth-callback-ai-provider-aAWOChDT.js} +1 -1
  199. package/dist/client/assets/{onboarding-DMkG4-4M.js → onboarding-DkM2lBLt.js} +1 -1
  200. package/dist/client/assets/{openai-conversation-BcQvnIOU.js → openai-conversation-CnNyoZHy.js} +1 -1
  201. package/dist/client/assets/{optimistic-project-sidebar-views-CBzXyVUz.js → optimistic-project-sidebar-views-Dd9HCPLE.js} +1 -1
  202. package/dist/client/assets/{order-monitor-day-raWLiT1v.js → order-monitor-day-D7yGjq7b.js} +1 -1
  203. package/dist/client/assets/{organization-choice-CSBUJWem.js → organization-choice-CVq2K-mi.js} +1 -1
  204. package/dist/client/assets/{orgs-DYr5Iir2.js → orgs-riRdPSVS.js} +1 -1
  205. package/dist/client/assets/{page-seo-form-C0_Mzxj0.js → page-seo-form-DHiOVvvv.js} +1 -1
  206. package/dist/client/assets/{pair-v8_ULhan.js → pair-BiwOJOFx.js} +1 -1
  207. package/dist/client/assets/{parse-sections-CigeyiXV.js → parse-sections-Ce8e3CyM.js} +1 -1
  208. package/dist/client/assets/{plan-BYiUi2-G.js → plan-Cpl6bs6l.js} +1 -1
  209. package/dist/client/assets/{plan-ladder-CtR99jrd.js → plan-ladder-DJwAssQD.js} +1 -1
  210. package/dist/client/assets/{popover-s88DXvPL.js → popover-B1ABR0kS.js} +1 -1
  211. package/dist/client/assets/{post-calendar-DbUDJn5r.js → post-calendar-CtSEncUE.js} +1 -1
  212. package/dist/client/assets/{post-editor-CdhtoksR.js → post-editor-Cxxxfb0r.js} +2 -2
  213. package/dist/client/assets/{preview-content-BNZ95rhM.js → preview-content-ULOD_UZt.js} +1 -1
  214. package/dist/client/assets/{preview-dialog-BZcvH5f1.js → preview-dialog-CZYisvNu.js} +1 -1
  215. package/dist/client/assets/preview-link-C762yHOt.js +1 -0
  216. package/dist/client/assets/{preview-panel-CjWzxG-O.js → preview-panel-ItJi6Jc0.js} +1 -1
  217. package/dist/client/assets/preview-tab-B6Q-8P-_.js +551 -0
  218. package/dist/client/assets/{product-picker-dialog-CecFCJox.js → product-picker-dialog-BHrHoQQK.js} +1 -1
  219. package/dist/client/assets/{profile-Bo384oXV.js → profile-B6Cd5Dxw.js} +1 -1
  220. package/dist/client/assets/{project-app-view-C-JC6Lnp.js → project-app-view-B1-HxYgX.js} +1 -1
  221. package/dist/client/assets/{project-apps-BQ30Q_BX.js → project-apps-Dler5z99.js} +1 -1
  222. package/dist/client/assets/{project-feed--d7Txdh1.js → project-feed-BwWFdPBj.js} +1 -1
  223. package/dist/client/assets/{project-icon-Ds8VtVRG.js → project-icon-BtGD--7Z.js} +1 -1
  224. package/dist/client/assets/project-reports-DigBj5UN.js +1 -0
  225. package/dist/client/assets/project-tasks-ckZ9YIhp.js +1 -0
  226. package/dist/client/assets/{projects-BN_UNvg1.js → projects-BbyUgZdk.js} +1 -1
  227. package/dist/client/assets/{projects-empty-state-CmS_yrG7.js → projects-empty-state-cl5VGT1T.js} +1 -1
  228. package/dist/client/assets/{prompts-g_Bby1s0.js → prompts-C7IgVGhQ.js} +1 -1
  229. package/dist/client/assets/record-editor-DulCdbwX.js +1 -0
  230. package/dist/client/assets/{redirect-editor-CBEbRvVY.js → redirect-editor-DGmg8IhI.js} +1 -1
  231. package/dist/client/assets/releases-api-CS8wgmr5.js +1 -0
  232. package/dist/client/assets/reports-ChrL-50F.js +1 -0
  233. package/dist/client/assets/{reports-Bgmc-lqT.js → reports-J6WeamZr.js} +1 -1
  234. package/dist/client/assets/{reports-onboarding-D6-A2sL7.js → reports-onboarding-BskSIDus.js} +1 -1
  235. package/dist/client/assets/{reports-tab-B_Sk2TLl.js → reports-tab-a3KJftGt.js} +2 -2
  236. package/dist/client/assets/repositories-BS-pBlSH.js +1 -0
  237. package/dist/client/assets/{repositories-C2vwcNjc.js → repositories-BZocQhoR.js} +1 -1
  238. package/dist/client/assets/{repository-binding-Cf_thK-b.js → repository-binding-DEE5HjOP.js} +1 -1
  239. package/dist/client/assets/{repository-import-picker-BOku3VrR.js → repository-import-picker-WAot3Ghn.js} +1 -1
  240. package/dist/client/assets/{repository-picker-CeCsQGv8.js → repository-picker-DKd6y_Vd.js} +1 -1
  241. package/dist/client/assets/{require-capability-DC_q9Xad.js → require-capability-BdR5kRbu.js} +1 -1
  242. package/dist/client/assets/{required-auth-layout-DhxdstQv.js → required-auth-layout-CXS5DXAp.js} +1 -1
  243. package/dist/client/assets/{reset-password-BCS7WVZ6.js → reset-password-Br9V0wHS.js} +1 -1
  244. package/dist/client/assets/{resizable-BySAwPSW.js → resizable-CkWJ6g0G.js} +1 -1
  245. package/dist/client/assets/{resolve-tab-icon-B7CsMGsC.js → resolve-tab-icon-BXRYZg2i.js} +1 -1
  246. package/dist/client/assets/{review-settings-DtZi6zHg.js → review-settings-CfpCP4zo.js} +1 -1
  247. package/dist/client/assets/{roles-CGYNn4dv.js → roles-D-ySNiDm.js} +1 -1
  248. package/dist/client/assets/{route-ChLLCXC9.js → route-Bor9ph6H.js} +1 -1
  249. package/dist/client/assets/{route-ChD1cXkH.js → route-DIJ9is23.js} +1 -1
  250. package/dist/client/assets/route-DTfdE-p1.js +1 -0
  251. package/dist/client/assets/{runnable-block-editor-Bod17qTV.js → runnable-block-editor-D1duQp0J.js} +6 -6
  252. package/dist/client/assets/{sandbox-lifecycle-context-CCjKxqdS.js → sandbox-lifecycle-context-DJrMSxNE.js} +1 -1
  253. package/dist/client/assets/{schema-b5uziS6S.js → schema-BXxpoJF8.js} +1 -1
  254. package/dist/client/assets/{schema-ClGCzPdy.js → schema-BiVd-UM7.js} +1 -1
  255. package/dist/client/assets/{scroll-area-BVZXqx5M.js → scroll-area-DdvxCYsk.js} +1 -1
  256. package/dist/client/assets/{search-input-BL6XGlmm.js → search-input-UGzUEySU.js} +1 -1
  257. package/dist/client/assets/{search-toggle-IRNGzCzn.js → search-toggle-09QkRcdu.js} +1 -1
  258. package/dist/client/assets/{secret-ciphertext-CKG2rzpX.js → secret-ciphertext-D7Z8GkTt.js} +1 -1
  259. package/dist/client/assets/{secret-picker-NNIqKwTx.js → secret-picker-jW2RoOXq.js} +1 -1
  260. package/dist/client/assets/{secrets-BLs8g0Qc.js → secrets--oDOIL-g.js} +1 -1
  261. package/dist/client/assets/{sections-Dw8sSpTv.js → sections-Cktygxsr.js} +1 -1
  262. package/dist/client/assets/{sections-editor-IbsR8YsO.js → sections-editor-Ykrd9ksj.js} +2 -2
  263. package/dist/client/assets/{select-H4FJk0rp.js → select-C48ly-p-.js} +1 -1
  264. package/dist/client/assets/{select-model-VSltfcKe.js → select-model-qC-ddNWu.js} +1 -1
  265. package/dist/client/assets/{seo-editor-DJxK0wxd.js → seo-editor-vkCR941s.js} +1 -1
  266. package/dist/client/assets/{separator-l8ktDBQ-.js → separator-CfwhkXab.js} +1 -1
  267. package/dist/client/assets/settings-tab-BR68FSDQ.js +1 -0
  268. package/dist/client/assets/{sheet-DdrzSnyB.js → sheet-C78dW_OW.js} +1 -1
  269. package/dist/client/assets/{shell-layout-Dpds4_um.js → shell-layout-7jtYUd9L.js} +1 -1
  270. package/dist/client/assets/site-draft-actions-DyZ1f4ik.js +12 -0
  271. package/dist/client/assets/site-draft-view-BRWWuiN5.js +2 -0
  272. package/dist/client/assets/site-editor-JG7QILYD.js +1 -0
  273. package/dist/client/assets/{site-editor-toast-C48kJZ8y.js → site-editor-toast-C_UZBEd9.js} +1 -1
  274. package/dist/client/assets/{skills-F7XSMMWV.js → skills-CHltBKqG.js} +1 -1
  275. package/dist/client/assets/{slider-tSRa1HDF.js → slider-DueO9EFe.js} +1 -1
  276. package/dist/client/assets/{sortable.esm-CE2eXOQU.js → sortable.esm-D411R8sQ.js} +1 -1
  277. package/dist/client/assets/{sso-B_KsCvoW.js → sso-C7rH2Jsc.js} +1 -1
  278. package/dist/client/assets/{suggestion-Bu3BweEe.js → suggestion-_sJX1Xs_.js} +1 -1
  279. package/dist/client/assets/{switch-BI2l0q9a.js → switch-Wb17Bg4i.js} +1 -1
  280. package/dist/client/assets/{symbol-CW0bfPL3.js → symbol-CN-EQDYU.js} +1 -1
  281. package/dist/client/assets/{synced-repos-BXQtYjtL.js → synced-repos-BRIUeky9.js} +1 -1
  282. package/dist/client/assets/{tab-icon-glyph-B_hAV_wB.js → tab-icon-glyph-BeHT1AU_.js} +1 -1
  283. package/dist/client/assets/{table-BI-3H0Nx.js → table-ChqbkXkJ.js} +1 -1
  284. package/dist/client/assets/{tabs-Cw5epDK7.js → tabs-D-bShRzz.js} +1 -1
  285. package/dist/client/assets/{task-assignee-avatar-B4jYRjC8.js → task-assignee-avatar-Db7T5j33.js} +1 -1
  286. package/dist/client/assets/{task-board-ByNQwZsl.js → task-board-NNGstnYy.js} +1 -1
  287. package/dist/client/assets/{task-route-B8oSJFnj.js → task-route-BYz8Txhc.js} +1 -1
  288. package/dist/client/assets/{task-status-GAY2L2Vz.js → task-status-BtnjgBne.js} +1 -1
  289. package/dist/client/assets/{taskboard-analytics-MtxZahkF.js → taskboard-analytics-BiCEJijC.js} +1 -1
  290. package/dist/client/assets/tasks-CtzEjcDR.js +1 -0
  291. package/dist/client/assets/{tasks-CaRFrr2H.js → tasks-DscpmhWw.js} +1 -1
  292. package/dist/client/assets/{textarea-7I-DLD6x.js → textarea-DXNX9E30.js} +1 -1
  293. package/dist/client/assets/{thread-analytics-BhyMnytl.js → thread-analytics-BxM1u9ID.js} +1 -1
  294. package/dist/client/assets/{thread-intent-CoB1rbzj.js → thread-intent-BYXYhdV9.js} +1 -1
  295. package/dist/client/assets/{thread-route-BPSSuk8V.js → thread-route--lOZYDN5.js} +1 -1
  296. package/dist/client/assets/{thread-route-Bjcqwe4C.js → thread-route-EPwO0Tp5.js} +1 -1
  297. package/dist/client/assets/{thread-sheet-body-DyDxpawL.js → thread-sheet-body-Doh4mgo7.js} +1 -1
  298. package/dist/client/assets/{time-range-picker-DJ-TaM2M.js → time-range-picker-bYUcsgps.js} +1 -1
  299. package/dist/client/assets/{toggle-group-BngkTNsG.js → toggle-group-C__89QW8.js} +1 -1
  300. package/dist/client/assets/{tool-namespace-DePiqr-m.js → tool-namespace-CjWGrg1d.js} +1 -1
  301. package/dist/client/assets/{toolbar-icon-button-DKjsnGdZ.js → toolbar-icon-button-Bn0QMDhj.js} +1 -1
  302. package/dist/client/assets/{tooltip-4vv5k-uR.js → tooltip-CjIqGzku.js} +1 -1
  303. package/dist/client/assets/{tooltipContext-B3bWUtmi.js → tooltipContext-BlJpYj2n.js} +1 -1
  304. package/dist/client/assets/{track-C0wfSYRO.js → track-DiwbUXrF.js} +1 -1
  305. package/dist/client/assets/{types-CNU-uWw-.js → types-2FdJQAcI.js} +1 -1
  306. package/dist/client/assets/{url-slug-DU3tFMUC.js → url-slug-SgUmhnUm.js} +1 -1
  307. package/dist/client/assets/{usage-stats-CKpL0uWf.js → usage-stats-mjbSmunu.js} +1 -1
  308. package/dist/client/assets/{use-ai-providers-Ct47MIru.js → use-ai-providers-Ui8zDguo.js} +1 -1
  309. package/dist/client/assets/{use-apply-named-rule-R20A_NaL.js → use-apply-named-rule-DqZvErCE.js} +1 -1
  310. package/dist/client/assets/{use-automations-Ho0ayZT_.js → use-automations-C1_nM6XA.js} +1 -1
  311. package/dist/client/assets/{use-autosave-DzNsVsl3.js → use-autosave-DUE5eTHe.js} +1 -1
  312. package/dist/client/assets/{use-chat-layout-state-CWI-mwQI.js → use-chat-layout-state-Civkwlwx.js} +1 -1
  313. package/dist/client/assets/{use-clock-tick-DE4s8Okz.js → use-clock-tick-BglfF91b.js} +1 -1
  314. package/dist/client/assets/{use-connect-companion-Dmdscsai.js → use-connect-companion-DXE20Cit.js} +1 -1
  315. package/dist/client/assets/{use-connection-HenJjVMr.js → use-connection-DjG9Ar0-.js} +1 -1
  316. package/dist/client/assets/{use-content-sync-C0CqYtRD.js → use-content-sync-UBduiNPN.js} +1 -1
  317. package/dist/client/assets/{use-copy-C4LbXPXl.js → use-copy-D-ZUZJVe.js} +1 -1
  318. package/dist/client/assets/{use-create-virtual-mcp-dBeQ8KM_.js → use-create-virtual-mcp-zb51VTao.js} +1 -1
  319. package/dist/client/assets/{use-date-fns-locale-DBqQ9Xwt.js → use-date-fns-locale-DDB69sAw.js} +1 -1
  320. package/dist/client/assets/{use-debounced-autosave-B_kpX8YN.js → use-debounced-autosave-sMVb1_hn.js} +1 -1
  321. package/dist/client/assets/{use-debounced-value-Br6JzfN-.js → use-debounced-value-0e-te_rl.js} +1 -1
  322. package/dist/client/assets/{use-deco-credits-DhL8Ql0T.js → use-deco-credits-zw0Jw-tt.js} +1 -1
  323. package/dist/client/assets/{use-decopilot-events-CuBncVze.js → use-decopilot-events-BQLXDAAl.js} +1 -1
  324. package/dist/client/assets/{use-delete-connection-DuErB0IF.js → use-delete-connection-CcIoRjhU.js} +1 -1
  325. package/dist/client/assets/{use-deployment-admin-BOXhbvir.js → use-deployment-admin-s7tGTRS4.js} +1 -1
  326. package/dist/client/assets/use-fast-preview-draft-url-B9Iu3h_6.js +1 -0
  327. package/dist/client/assets/{use-file-configs-B_k4AoEo.js → use-file-configs-CDeU2xvZ.js} +1 -1
  328. package/dist/client/assets/{use-inbox-feed-D96kN3Ph.js → use-inbox-feed-CFSuERBJ.js} +1 -1
  329. package/dist/client/assets/{use-infinite-scroll-Ba0Xf9MO.js → use-infinite-scroll-BopUCEp4.js} +1 -1
  330. package/dist/client/assets/{use-join-requests-DNpCy_xv.js → use-join-requests-D2jJesnC.js} +1 -1
  331. package/dist/client/assets/{use-main-panel-tabs-BndsHuRH.js → use-main-panel-tabs--2YvNIZr.js} +1 -1
  332. package/dist/client/assets/{use-mcp-auth-status-BOQ5PtOH.js → use-mcp-auth-status-DEXNa6Oz.js} +1 -1
  333. package/dist/client/assets/{use-mcp-client-2WkK0AxE.js → use-mcp-client-owuI-9F9.js} +1 -1
  334. package/dist/client/assets/{use-mcp-prompts-BY0itm-N.js → use-mcp-prompts-8FxF45h0.js} +1 -1
  335. package/dist/client/assets/{use-mcp-tools-Wkfd46Rr.js → use-mcp-tools-qNpUlzik.js} +1 -1
  336. package/dist/client/assets/{use-members-Cl1_-fx1.js → use-members-VmpszULL.js} +1 -1
  337. package/dist/client/assets/{use-mobile-BAnIvR27.js → use-mobile-CqyBz8Dx.js} +1 -1
  338. package/dist/client/assets/{use-move-blocks-lN8kagdi.js → use-move-blocks-Cnva5RwQ.js} +1 -1
  339. package/dist/client/assets/{use-navigate-to-agent-C2NQ-36B.js → use-navigate-to-agent-DdSspEm5.js} +1 -1
  340. package/dist/client/assets/{use-open-billing-url-Bewtr0D-.js → use-open-billing-url-CO2ZloNb.js} +1 -1
  341. package/dist/client/assets/{use-org-auth-client-vWdVrvgR.js → use-org-auth-client-BQ7kloKy.js} +1 -1
  342. package/dist/client/assets/{use-org-fs-CxjQMzFd.js → use-org-fs-CvYQh_B2.js} +1 -1
  343. package/dist/client/assets/{use-org-repo-syncs-dRJpc7Ti.js → use-org-repo-syncs-BtFmt_qd.js} +1 -1
  344. package/dist/client/assets/{use-org-sso-BnFa9r-G.js → use-org-sso-B9p-4KH7.js} +1 -1
  345. package/dist/client/assets/{use-organization-roles-D9hV-WPT.js → use-organization-roles-Cu4J92yA.js} +1 -1
  346. package/dist/client/assets/{use-organization-settings-CE5BJyh9.js → use-organization-settings-BcSo4teS.js} +1 -1
  347. package/dist/client/assets/{use-panel-navigate-CXkMPISv.js → use-panel-navigate-Co0XZmSD.js} +1 -1
  348. package/dist/client/assets/{use-project-native-view-presence-D4-BL2Rg.js → use-project-native-view-presence-BRsKjCEJ.js} +1 -1
  349. package/dist/client/assets/{use-project-scope-BOj2O9A_.js → use-project-scope-BL3NRFI4.js} +1 -1
  350. package/dist/client/assets/{use-recent-apps-Cj-iBJUa.js → use-recent-apps-RjVee3Pq.js} +1 -1
  351. package/dist/client/assets/{use-releases-2-Z6BMdW.js → use-releases-vjl0fUb-.js} +1 -1
  352. package/dist/client/assets/{use-reports-diagnostic-D--oIp45.js → use-reports-diagnostic-B0L8y4wc.js} +1 -1
  353. package/dist/client/assets/{use-sandbox-events-BVhJrX2Z.js → use-sandbox-events-Bjcn7PU6.js} +1 -1
  354. package/dist/client/assets/{use-secrets-CQ9dfY46.js → use-secrets-D9Bq6nE_.js} +1 -1
  355. package/dist/client/assets/{use-section-preview-base-CrcAXE9z.js → use-section-preview-base-Vjigvtig.js} +1 -1
  356. package/dist/client/assets/{use-session-runtime-CqJF6neP.js → use-session-runtime-C-ErRuug.js} +1 -1
  357. package/dist/client/assets/{use-sidebar-collapsed-NZNztmvG.js → use-sidebar-collapsed-oSws9nsi.js} +1 -1
  358. package/dist/client/assets/{use-tags-BG7cxCCb.js → use-tags-pfCDbF9Z.js} +1 -1
  359. package/dist/client/assets/{use-task-board-analytics-BhvhSxL9.js → use-task-board-analytics-CopE-4zr.js} +1 -1
  360. package/dist/client/assets/{use-task-board-events-CtQgceab.js → use-task-board-events-C280-Zim.js} +1 -1
  361. package/dist/client/assets/{use-task-board-item-prs-Dp099nXL.js → use-task-board-item-prs-x7ZAMu8t.js} +1 -1
  362. package/dist/client/assets/{use-task-metadata-BBoC1uvX.js → use-task-metadata-CDV-25sQ.js} +1 -1
  363. package/dist/client/assets/{use-thread-analytics-g0_FCkSl.js → use-thread-analytics-RcDxA37Q.js} +1 -1
  364. package/dist/client/assets/{use-thread-outputs-C38yfNsJ.js → use-thread-outputs-orGxjs9L.js} +1 -1
  365. package/dist/client/assets/useInfiniteQuery-C3FB4QSd.js +1 -0
  366. package/dist/client/assets/{useQueries-DSs3oNbf.js → useQueries-M-H4-oNf.js} +1 -1
  367. package/dist/client/assets/useSuspenseInfiniteQuery-zAujesU3.js +1 -0
  368. package/dist/client/assets/{users-BAyRTNUi.js → users-Yugcw0oy.js} +1 -1
  369. package/dist/client/assets/{utils-t1gjPfET.js → utils-Cwt2fdOd.js} +1 -1
  370. package/dist/client/assets/{variant-calendar-BYITnHO8.js → variant-calendar-r5D0JiAM.js} +1 -1
  371. package/dist/client/assets/variant-draft-pointer-BeAKcq_c.js +1 -0
  372. package/dist/client/assets/variant-matcher-override-Dcw_0UNB.js +1 -0
  373. package/dist/client/assets/{virtual-mcp-cTWrWR4Y.js → virtual-mcp-D9lu2UG3.js} +1 -1
  374. package/dist/client/assets/{watch-sse-pool-C9NPGTmI.js → watch-sse-pool-BEBGvoea.js} +1 -1
  375. package/dist/client/index.html +1 -1
  376. package/dist/server/server.js +628 -628
  377. package/package.json +1 -1
  378. package/dist/client/assets/agent-analytics-Cb2tda3-.js +0 -1
  379. package/dist/client/assets/agent-app-HX00w6TV.js +0 -1
  380. package/dist/client/assets/agent-calendar-DCHNIRTc.js +0 -1
  381. package/dist/client/assets/agent-deck-BV-5B8og.js +0 -1
  382. package/dist/client/assets/agent-experiments-DetDutY3.js +0 -1
  383. package/dist/client/assets/agent-file-BvfhZ3mT.js +0 -1
  384. package/dist/client/assets/agent-library-DSuyqe6T.js +0 -1
  385. package/dist/client/assets/agent-library-file-B1l2ZLvA.js +0 -1
  386. package/dist/client/assets/agent-releases-rSbadgkl.js +0 -2
  387. package/dist/client/assets/agent-settings-DCjo4ZYC.js +0 -1
  388. package/dist/client/assets/agent-site-editor-code-BVwfCzHc.js +0 -2
  389. package/dist/client/assets/agent-site-editor-content-BU-vFmu-.js +0 -1
  390. package/dist/client/assets/agent-site-editor-preview-Coo-Ni4u.js +0 -1
  391. package/dist/client/assets/agent-view-CftHb5tC.js +0 -1
  392. package/dist/client/assets/api-keys-jGYtI-cW.js +0 -1
  393. package/dist/client/assets/category-editor-jRguVRoH.js +0 -1
  394. package/dist/client/assets/cms-settings-editor-BAGntXvx.js +0 -1
  395. package/dist/client/assets/hosted-publish-api-Cg6A3e6a.js +0 -1
  396. package/dist/client/assets/hosted-publish-feedback-R86hK4rw.js +0 -1
  397. package/dist/client/assets/index-CqX2WR0x.js +0 -1
  398. package/dist/client/assets/legacy-main-redirect-Y-IABTgs.js +0 -1
  399. package/dist/client/assets/library-CEpc5ko6.js +0 -1
  400. package/dist/client/assets/preview-tab-ztwq5J9Z.js +0 -551
  401. package/dist/client/assets/project-reports-BRMk8sbv.js +0 -1
  402. package/dist/client/assets/project-tasks-DPFfk-Co.js +0 -1
  403. package/dist/client/assets/record-editor-CmI7uwKH.js +0 -1
  404. package/dist/client/assets/releases-api-DbKlRR9w.js +0 -1
  405. package/dist/client/assets/reports-BKtNuFy0.js +0 -1
  406. package/dist/client/assets/repositories-CszhODTX.js +0 -1
  407. package/dist/client/assets/route-_su_B2um.js +0 -1
  408. package/dist/client/assets/settings-tab-D08h17sS.js +0 -1
  409. package/dist/client/assets/site-draft-actions-B1VIigls.js +0 -12
  410. package/dist/client/assets/site-draft-view-BvQXujRd.js +0 -2
  411. package/dist/client/assets/site-editor-B8qpeTpl.js +0 -1
  412. package/dist/client/assets/tasks-Zus8qgLK.js +0 -1
  413. package/dist/client/assets/use-fast-preview-draft-url-BPrZ2XMf.js +0 -1
  414. package/dist/client/assets/useInfiniteQuery-CxzyY6DS.js +0 -1
  415. package/dist/client/assets/useSuspenseInfiniteQuery-CWvS_hOW.js +0 -1
  416. package/dist/client/assets/variant-draft-pointer-Cjn_TXkR.js +0 -1
@@ -0,0 +1,551 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/sections-editor-Ykrd9ksj.js","assets/index-DY9jv8u5.js","assets/index-DjdMnw7p.css","assets/chat-context-DaG-xhpe.js","assets/use-panel-navigate-Co0XZmSD.js","assets/thread-route--lOZYDN5.js","assets/use-project-scope-BL3NRFI4.js","assets/repository-binding-DEE5HjOP.js","assets/use-mcp-client-owuI-9F9.js","assets/auth-vu0NBiVX.js","assets/autosend-ClHP6mj3.js","assets/thread-intent-BYXYhdV9.js","assets/delay-CnY5UFtP.js","assets/backoff-CrEUbyZT.js","assets/watch-sse-pool-BEBGvoea.js","assets/task-board-NNGstnYy.js","assets/schema-BXxpoJF8.js","assets/slugify-CEUa2lfQ.js","assets/use-decopilot-events-BQLXDAAl.js","assets/use-ai-providers-Ui8zDguo.js","assets/location-V0VwTJTt.js","assets/use-organization-settings-BcSo4teS.js","assets/runnable-block-editor-D1duQp0J.js","assets/utils-Cwt2fdOd.js","assets/ZoomOut-D-Ww048N.js","assets/Image01-Cwrowq3c.js","assets/agent-icon-CCDPFoN-.js","assets/AlertCircle-CF7oV00-.js","assets/Tool01-C0vFHYhV.js","assets/ArrowUp-C-Wi5Wp-.js","assets/ArrowLeft-BYRX2oWU.js","assets/LinkBroken01-DhWTb9MO.js","assets/ShoppingBag01-B4aQ0-ny.js","assets/Building02-BTo5ALb8.js","assets/CheckCircle-B7DLXg5D.js","assets/ChevronUp-i4o2LTaN.js","assets/ChevronSelectorVertical-ByVW2vd8.js","assets/UserSquare-DXYtKMfd.js","assets/Copy01-Ck9G4OUr.js","assets/CreditCard01-DBL8NXSk.js","assets/DotsVertical-DGS_x5nz.js","assets/Globe04-lKXBAfc3.js","assets/SwitchHorizontal01-BbdJtypW.js","assets/Key01-CEbPGYnm.js","assets/Link01-DXqb71Uu.js","assets/Minus-C9yYSfDR.js","assets/Monitor01-BL3DAm_1.js","assets/Sun-DqiY7Z2B.js","assets/Play-CZ7QKkqf.js","assets/Plus-BRxUqR_F.js","assets/SearchMd-DiO3q0AT.js","assets/Trash01-bhcUMroB.js","assets/Upload01-BwEuXdMa.js","assets/User01-DSs11bSF.js","assets/Users01-CTqd0ZAH.js","assets/XClose-CxYwKo3k.js","assets/sandbox-start-errors-BK_aDCyt.js","assets/pair-BiwOJOFx.js","assets/format-time-Cq80KKvY.js","assets/differenceInSeconds-C3x8sHUj.js","assets/collapsible-CCUbGddy.js","assets/use-copy-D-ZUZJVe.js","assets/usage-stats-mjbSmunu.js","assets/tool-namespace-CjWGrg1d.js","assets/form-Diz2j79C.js","assets/label-CUbZuKc3.js","assets/utils-CVEq3hMx.js","assets/markdown-CQTrkEJG.js","assets/use-mobile-CqyBz8Dx.js","assets/tooltip-CjIqGzku.js","assets/index-DPyR1fyZ.js","assets/use-clock-tick-BglfF91b.js","assets/content-blocks-o63cs2vh.js","assets/mcp-app-renderer-CfeFa2D0.js","assets/types-2FdJQAcI.js","assets/omit-sandbox-map-jj4lCB2U.js","assets/shell-layout-7jtYUd9L.js","assets/avatar-BfW8_V1B.js","assets/command-A6J0_nSj.js","assets/index-CH_rHFJ7.js","assets/integration-icon-BZ0SYBCb.js","assets/project-icon-BtGD--7Z.js","assets/new-project-dialog-BDUYA1Q9.js","assets/repository-import-picker-WAot3Ghn.js","assets/use-navigate-to-agent-DdSspEm5.js","assets/repository-picker-DKd6y_Vd.js","assets/useInfiniteQuery-C3FB4QSd.js","assets/infiniteQueryObserver-Glyohd4p.js","assets/collection-search-DFZiZHgj.js","assets/use-debounced-value-0e-te_rl.js","assets/required-auth-layout-CXS5DXAp.js","assets/use-org-sso-B9p-4KH7.js","assets/shell-layout-CE2Eihra.css","assets/sheet-C78dW_OW.js","assets/use-connection-DjG9Ar0-.js","assets/use-mcp-prompts-8FxF45h0.js","assets/use-thread-outputs-orGxjs9L.js","assets/file-type-icon-Dh-YpP4t.js","assets/secret-ciphertext-D7Z8GkTt.js","assets/alert-CmByshZi.js","assets/parse-sections-Ce8e3CyM.js","assets/switch-Wb17Bg4i.js","assets/textarea-DXNX9E30.js","assets/site-editor-toast-C_UZBEd9.js","assets/use-session-runtime-C-ErRuug.js","assets/experiments-tab-choice-CJxPrnzq.js","assets/sandbox-url-D3mC8qhT.js","assets/use-sandbox-events-Bjcn7PU6.js","assets/sandbox-git-api-CH_-QFpD.js","assets/popover-B1ABR0kS.js","assets/blocks-tab-states-D014yZyw.js","assets/slider-DueO9EFe.js","assets/index-hWaEVFzi.js","assets/index-BdQq_4o_.js","assets/tooltipContext-BlJpYj2n.js","assets/CategoricalChart-DTvqZVLo.js","assets/index-CjCEGRSu.js","assets/ActiveShapeUtils-Bis8M8cE.js","assets/Sector-XuiRQ9ct.js","assets/symbol-CN-EQDYU.js","assets/empty-state-C97rGNTx.js","assets/scroll-area-DdvxCYsk.js","assets/monaco-editor-nJc5wgpu.js","assets/editor-CpWj2GSL.js","assets/calendar-C7UsyFmW.js","assets/select-C48ly-p-.js","assets/editor-classes-5vsxGGPA.js","assets/core.esm-BT3eS5hh.js","assets/sortable.esm-D411R8sQ.js","assets/toggle-group-C__89QW8.js","assets/active-indicator-CCMhAsc_.js","assets/combobox--wUI1bJn.js","assets/alert-dialog-BcRtAren.js","assets/search-input-UGzUEySU.js","assets/tabs-D-bShRzz.js","assets/use-file-configs-CDeU2xvZ.js","assets/asset-utils-DIN0M3zp.js","assets/match-site-slug-config-D3fUJ6vX.js","assets/mustache-CewpKCP1.js","assets/use-section-preview-base-Vjigvtig.js","assets/section-preview-url-7zfngvgW.js","assets/use-members-VmpszULL.js","assets/use-org-auth-client-BQ7kloKy.js","assets/page-seo-form-DHiOVvvv.js","assets/use-apply-named-rule-DqZvErCE.js","assets/use-move-blocks-Cnva5RwQ.js","assets/variant-matcher-override-Dcw_0UNB.js","assets/variant-draft-pointer-BeAKcq_c.js"])))=>i.map(i=>d[i]);
2
+ import{c as ce,j as s,r as S,l as Ht,b as Ce,B as Ie,aF as qt,aW as rt,aG as Te,q as Xs,D as Zs,K as er,s as tr,v as nr,e as ua,h as Pt,I as Tn,w as fa,aX as ma,a2 as _n,aY as pa,aU as ha,au as ys,aw as ws,a5 as ga,P as ks,y as va,t as yn,o as xa,m as ba}from"./index-DY9jv8u5.js";import{u as sr,g as ya,c as Ss,B as wn,P as wa,r as ka,R as Sa,a as Pa,b as rr,S as ja,d as Ea,l as Na,m as Ta,e as Ca,f as kn,N as Ra}from"./runnable-block-editor-D1duQp0J.js";import{b as La,c as Xt,r as ar,l as ir,f as Aa,g as _a,w as Oa}from"./chat-context-DaG-xhpe.js";import{t as Da}from"./ChevronUp-i4o2LTaN.js";import{T as Ba,U as Fa,M as or,V as Ma,W as $a,b as za,X as Ka,Y as Ia,Z as Ua,_ as Va,$ as Ps,a0 as Ha}from"./agent-icon-CCDPFoN-.js";import{a as qa}from"./UserSquare-DXYtKMfd.js";import{s as Wa}from"./Plus-BRxUqR_F.js";import{a as lr,b as cr,P as dr}from"./popover-B1ABR0kS.js";import{a as wt,b as kt,c as ur,d as fr,e as mr,C as pr}from"./command-A6J0_nSj.js";import{c as Ga,a as Ja}from"./repository-binding-DEE5HjOP.js";import{a as On}from"./sandbox-lifecycle-context-DJrMSxNE.js";import{e as Ya}from"./backoff-CrEUbyZT.js";import{r as Qa}from"./thread-intent-BYXYhdV9.js";import{u as hr}from"./use-session-runtime-C-ErRuug.js";import{S as gr,d as Xa,f as Za,i as ei,g as ti,h as ni,j as si,k as ri,u as Dn,l as Bn,m as nt,n as ai,o as ii,q as oi,c as li,b as vr,t as ci,v as Ve,w as di,x as ui,y as fi,z as js,A as mi,B as pi,C as Es,D as hi,E as gi,e as vi}from"./site-editor-toast-C_UZBEd9.js";import{u as xi}from"./use-mobile-CqyBz8Dx.js";import{T as Wt,a as Gt,c as Jt}from"./tooltip-CjIqGzku.js";import{T as st}from"./toolbar-icon-button-Bn0QMDhj.js";import{w as zt,i as bi}from"./variant-matcher-override-Dcw_0UNB.js";import{b as yi,w as Ns}from"./variant-draft-pointer-BeAKcq_c.js";import{u as xr,i as wi,B as ki,S as Si,C as Pi,a as ji,b as Ei,l as Ni,D as Ti}from"./blocks-tab-states-D014yZyw.js";import{i as Ci,a as Ri,v as Li,b as Ai,s as St,n as Fn,c as br,f as Ke,d as yr,h as _i,e as Oi,g as Di,j as Bi,k as Fi,p as Mi,N as $i,l as zi,r as Ki,m as Ts,o as Ii}from"./parse-sections-Ce8e3CyM.js";import{r as Ui,D as Cs,w as Rs,b as Ls,a as Vi}from"./section-preview-url-7zfngvgW.js";import{p as Hi,a as qi,u as Wi,b as As}from"./use-fast-preview-draft-url-B9Iu3h_6.js";import{a as Gi,c as wr}from"./shell-layout-7jtYUd9L.js";import{u as kr,b as Ji}from"./use-sandbox-events-Bjcn7PU6.js";import{u as Cn}from"./useQueries-M-H4-oNf.js";import{i as Yi}from"./LinkBroken01-DhWTb9MO.js";import{u as Sr}from"./blocks-preview-workspace-context-DIzgwExA.js";import{MonacoCodeEditor as Qi}from"./monaco-editor-nJc5wgpu.js";import{d as Xi}from"./utils-Cwt2fdOd.js";import{R as _s,a as Kt,b as Os}from"./resizable-CkWJ6g0G.js";import{u as Zi,a as Sn}from"./experiments-tab-choice-CJxPrnzq.js";import{w as Rn}from"./device-hint-SeLRi17j.js";import{L as eo}from"./label-CUbZuKc3.js";import{a as to,T as Ds}from"./toggle-group-C__89QW8.js";import{h as Pr,w as no,a as Bs}from"./preview-link-C762yHOt.js";import{r as so}from"./virtual-mcp-D9lu2UG3.js";import{d as ro}from"./delay-CnY5UFtP.js";import{E as ao}from"./empty-state-C97rGNTx.js";import{G as Fs}from"./repository-picker-DKd6y_Vd.js";import{R as io}from"./repository-import-picker-WAot3Ghn.js";import{r as oo}from"./preview-source-BsRLGWUP.js";import{C as lo,s as co,L as uo,R as Yt,D as Ms}from"./secret-ciphertext-D7Z8GkTt.js";import{A as fo,a as mo,b as po}from"./alert-CmByshZi.js";import{u as ho}from"./use-task-metadata-CDV-25sQ.js";function go(t){const e=ce.c(10),{waiting:n}=t,r=n?"true":"false";let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("span",{className:"flex size-10 items-center justify-center rounded-xl bg-muted text-muted-foreground sm:size-12",children:s.jsx(Ba,{className:"size-5 sm:size-6"})}),e[0]=i):i=e[0];let u;e[1]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx("span",{className:"h-px w-full border-t border-dashed border-muted-foreground/40"}),e[1]=u):u=e[1];let a;e[2]!==n?(a=n&&s.jsx("span",{"data-testid":"connection-dot",className:"absolute top-0 size-2 animate-[connection-shuttle_1.8s_var(--ease-in-out-cubic)_infinite_alternate] rounded-full bg-foreground"}),e[2]=n,e[3]=a):a=e[3];let o;e[4]!==a?(o=s.jsxs("span",{className:"relative flex h-2 w-16 items-center sm:w-20",children:[u,a]}),e[4]=a,e[5]=o):o=e[5];let l;e[6]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("span",{className:"flex size-10 items-center justify-center rounded-xl bg-muted text-muted-foreground sm:size-12",children:s.jsx(Fa,{className:"size-5 sm:size-6"})}),e[6]=l):l=e[6];let d;return e[7]!==r||e[8]!==o?(d=s.jsxs("div",{"aria-hidden":"true","data-testid":"connection-wire","data-waiting":r,className:"flex items-center gap-2",children:[i,o,l]}),e[7]=r,e[8]=o,e[9]=d):d=e[9],d}function vo(t){const e=ce.c(25),{index:n,numbered:r,step:i,heading:u}=t,a=S.useId();let o;e[0]!==n||e[1]!==r?(o=r&&s.jsx("span",{"aria-hidden":"true",className:"flex size-6 shrink-0 items-center justify-center rounded-full bg-muted text-xs font-medium tabular-nums text-foreground",children:n}),e[0]=n,e[1]=r,e[2]=o):o=e[2];let l;e[3]!==u||e[4]!==a||e[5]!==i.title?(l=s.jsx(u,{id:a,className:"text-sm font-medium text-foreground",children:i.title}),e[3]=u,e[4]=a,e[5]=i.title,e[6]=l):l=e[6];let d;e[7]!==o||e[8]!==l?(d=s.jsxs("div",{className:"flex items-center gap-3",children:[o,l]}),e[7]=o,e[8]=l,e[9]=d):d=e[9];const p=r&&"sm:pl-9";let m;e[10]!==p?(m=Ht("flex min-w-0 flex-col gap-3",p),e[10]=p,e[11]=m):m=e[11];let f;e[12]!==i.body?(f=i.body&&s.jsx("p",{className:"text-sm text-muted-foreground",children:i.body}),e[12]=i.body,e[13]=f):f=e[13];let x;e[14]!==i.command?(x=i.command&&s.jsx(lo,{command:i.command}),e[14]=i.command,e[15]=x):x=e[15];let b;e[16]!==i.after||e[17]!==m||e[18]!==f||e[19]!==x?(b=s.jsxs("div",{className:m,children:[f,x,i.after]}),e[16]=i.after,e[17]=m,e[18]=f,e[19]=x,e[20]=b):b=e[20];let j;return e[21]!==a||e[22]!==d||e[23]!==b?(j=s.jsxs("li",{"aria-labelledby":a,className:"surface flex flex-col gap-3 p-4 sm:p-5",children:[d,b]}),e[21]=a,e[22]=d,e[23]=b,e[24]=j):j=e[24],j}const xo=[];function Qt(t){const e=ce.c(20),{title:n,lead:r,waiting:i,alerts:u,steps:a,footer:o,headingLevel:l}=t,d=a===void 0?xo:a,p=l===void 0?1:l,m=p===1?"h1":"h2",f=i&&d.length===0?"status":void 0;let x;e[0]!==i?(x=s.jsx(go,{waiting:i}),e[0]=i,e[1]=x):x=e[1];let b;e[2]!==m||e[3]!==n?(b=s.jsx(m,{tabIndex:-1,className:"text-balance text-lg font-medium text-foreground outline-none sm:text-xl",children:n}),e[2]=m,e[3]=n,e[4]=b):b=e[4];let j;e[5]!==r?(j=r&&s.jsx("p",{className:"text-pretty text-sm text-muted-foreground",children:r}),e[5]=r,e[6]=j):j=e[6];let g;e[7]!==f||e[8]!==x||e[9]!==b||e[10]!==j?(g=s.jsxs("header",{role:f,className:"flex flex-col items-center gap-3 text-center",children:[x,b,j]}),e[7]=f,e[8]=x,e[9]=b,e[10]=j,e[11]=g):g=e[11];let k;e[12]!==p||e[13]!==d?(k=d.length>0&&s.jsx("ol",{className:"flex flex-col gap-3",children:d.map((y,v)=>s.jsx(vo,{index:v+1,numbered:d.length>1,step:y,heading:p===1?"h2":"h3"},y.title))}),e[12]=p,e[13]=d,e[14]=k):k=e[14];let E;return e[15]!==u||e[16]!==o||e[17]!==g||e[18]!==k?(E=s.jsx("div",{className:"h-full w-full overflow-y-auto",children:s.jsxs("div",{className:"mx-auto flex min-h-full w-full max-w-xl flex-col justify-center gap-6 px-4 py-8 sm:py-12",children:[g,u,k,o]})}),e[15]=u,e[16]=o,e[17]=g,e[18]=k,e[19]=E):E=e[19],E}function bo(t){const e=ce.c(55),{wait:n,hosts:r,invalidLink:i}=t,u=i===void 0?!1:i,a=Ce();let o;e[0]!==u||e[1]!==a?(o=u&&s.jsx(fo,{variant:"warning",children:s.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[s.jsx(mo,{className:"line-clamp-none text-foreground",children:a("decoServe.link.invalidTitle")}),s.jsx(po,{children:a("decoServe.link.invalidBody")})]})}),e[0]=u,e[1]=a,e[2]=o):o=e[2];const l=o;if(n.kind==="problem"){let O;e[3]!==a||e[4]!==n.host||e[5]!==n.problem?(O=co(a,n.problem,n.host),e[3]=a,e[4]=n.host,e[5]=n.problem,e[6]=O):O=e[6];const{title:R,body:_}=O;let A;e[7]!==_?(A=s.jsx(Yt,{text:_}),e[7]=_,e[8]=A):A=e[8];let B;e[9]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx(Ms,{className:"border-t border-border pt-4",links:["troubleshooting","serve"]}),e[9]=B):B=e[9];let L;return e[10]!==l||e[11]!==A||e[12]!==R?(L=s.jsx(Qt,{headingLevel:2,waiting:!1,title:R,lead:A,alerts:l,footer:B}),e[10]=l,e[11]=A,e[12]=R,e[13]=L):L=e[13],L}const d=n.kind==="looking",p=d&&!n.paused;let m;e[14]!==a?(m=a("decoServe.waiting.title"),e[14]=a,e[15]=m):m=e[15];let f;e[16]!==a?(f=a("decoServe.waiting.lead"),e[16]=a,e[17]=f):f=e[17];let x;e[18]!==l||e[19]!==n.kind?(x=(l||n.kind==="denied")&&s.jsxs(s.Fragment,{children:[l,n.kind==="denied"&&s.jsx(uo,{})]}),e[18]=l,e[19]=n.kind,e[20]=x):x=e[20];let b;e[21]!==a?(b=a("decoServe.guide.step1.title"),e[21]=a,e[22]=b):b=e[22];let j;e[23]!==a?(j=a("decoServe.guide.step1.body"),e[23]=a,e[24]=j):j=e[24];let g;e[25]!==j?(g=s.jsx(Yt,{text:j}),e[25]=j,e[26]=g):g=e[26];let k;e[27]!==b||e[28]!==g?(k={title:b,body:g,command:gr},e[27]=b,e[28]=g,e[29]=k):k=e[29];let E;e[30]!==a?(E=a("decoServe.waiting.step2.title"),e[30]=a,e[31]=E):E=e[31];let y;e[32]!==a?(y=a("decoServe.waiting.step2.body"),e[32]=a,e[33]=y):y=e[33];let v;e[34]!==r||e[35]!==d||e[36]!==a||e[37]!==n.kind||e[38]!==n.onStart||e[39]!==n.paused?(v=n.kind==="needs-gesture"?s.jsx(Ie,{variant:"outline",className:"self-start",onClick:n.onStart,children:a("decoServe.guide.step2.start")}):d&&s.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:n.paused?a("decoServe.guide.step2.paused"):a("decoServe.guide.step2.looking",{hosts:r})}),e[34]=r,e[35]=d,e[36]=a,e[37]=n.kind,e[38]=n.onStart,e[39]=n.paused,e[40]=v):v=e[40];let w;e[41]!==E||e[42]!==y||e[43]!==v?(w={title:E,body:y,after:v},e[41]=E,e[42]=y,e[43]=v,e[44]=w):w=e[44];let T;e[45]!==k||e[46]!==w?(T=[k,w],e[45]=k,e[46]=w,e[47]=T):T=e[47];let P;e[48]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx(Ms,{className:"border-t border-border pt-4",links:["siteEditor","serve","troubleshooting"]}),e[48]=P):P=e[48];let N;return e[49]!==T||e[50]!==p||e[51]!==m||e[52]!==f||e[53]!==x?(N=s.jsx(Qt,{headingLevel:2,waiting:p,title:m,lead:f,alerts:x,steps:T,footer:P}),e[49]=T,e[50]=p,e[51]=m,e[52]=f,e[53]=x,e[54]=N):N=e[54],N}function yo(t,e){switch(t.kind){case"needs-permission":return{kind:"denied"};case"problem":return{kind:"problem",problem:t.problem,host:e};default:return{kind:"looking"}}}const wo=15e3,ko=3e3;function So(t){const{candidates:e,probe:n,onFound:r,onChange:i,doc:u=document,setTimer:a=(v,w)=>setTimeout(v,w),clearTimer:o=v=>clearTimeout(v),timeoutMs:l=ko}=t;let d={status:"searching",firstRoundDone:!1,problem:null},p=!1,m=!1,f=0,x=null,b=null;const j=()=>u.visibilityState==="hidden",g=v=>{d={...d,...v},i(d)},k=async v=>{b=new AbortController;const w=b,T=a(()=>w.abort(),l);try{return await n(v,w.signal),!0}catch(P){if(p)return!1;const N=Za(P);return N.reason!=="not-answering"?g({problem:{...N,endpoint:v}}):d.problem?.endpoint===v&&g({problem:null}),!1}finally{o(T),b=null}},E=async()=>{if(x=null,!(p||m)){if(e.length===0){g({status:"stopped",firstRoundDone:!0});return}if(j()){g({status:"paused"});return}m=!0,d.status!=="searching"&&g({status:"searching"});for(const v of e){if(p)break;if(await k(v)){if(m=!1,p)return;p=!0,u.removeEventListener("visibilitychange",y),g({status:"found",firstRoundDone:!0}),r(v);return}}if(m=!1,!p){if(f+=1,d.firstRoundDone||g({firstRoundDone:!0}),j()){g({status:"paused"});return}x=a(()=>{E()},Xa(f,wo))}}};function y(){if(!p){if(j()){x!==null&&(o(x),x=null),m||g({status:"paused"});return}x!==null&&o(x),f=0,E()}}return u.addEventListener("visibilitychange",y),i(d),E(),()=>{p=!0,x!==null&&o(x),b?.abort(),u.removeEventListener("visibilitychange",y)}}function Po(t,e){return ti(ni({endpoint:t,fetch:n=>fetch(n,{signal:e})}))}const jo=["loopback-network","local-network-access"];async function Eo(){if(ei(window.location.origin))return null;for(const t of jo)try{return await navigator.permissions.query({name:t})}catch{}return null}let jr=null,$s=!1;const Pn=new Set;function No(t){if(Pn.add(t),!$s){$s=!0;const e=n=>{jr=n;for(const r of Pn)r()};Eo().then(n=>{if(!n)return e("unsupported");e(n.state),n.addEventListener("change",()=>e(n.state))})}return()=>Pn.delete(t)}const To={status:"stopped",firstRoundDone:!1,problem:null},jn=new Map;function Co(t){const e=jn.get(t);if(e)return e;let n={status:"searching",firstRoundDone:!1,problem:null};const r=new Set;let i=null;const u={onFound:()=>{},getSnapshot:()=>n,subscribe:a=>(r.add(a),i??=So({candidates:t.split(" "),probe:Po,onFound:o=>u.onFound(o),onChange:o=>{n=o;for(const l of r)l()}}),()=>{r.delete(a),!(r.size>0)&&(i?.(),i=null,jn.delete(t))})};return jn.set(t,u),u}function Er(){return S.useSyncExternalStore(No,Ks,Ks)}const Ro=()=>()=>{},zs=()=>To,Ks=()=>jr;function md(t){const e=ce.c(9),{candidates:n,onFound:r}=t,[i,u]=S.useState(!1),a=Er(),l=(a==="granted"||a==="unsupported"||a==="prompt"&&i)&&n.length>0;let d;e[0]!==l||e[1]!==n||e[2]!==r?(d=l?Co(n.join(" ")):null,d&&(d.onFound=r),e[0]=l,e[1]=n,e[2]=r,e[3]=d):d=e[3];const p=S.useSyncExternalStore(d?.subscribe??Ro,d?.getSnapshot??zs,d?.getSnapshot??zs),m=a==="prompt"&&!i;let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=()=>u(!0),e[4]=f):f=e[4];let x;return e[5]!==a||e[6]!==p||e[7]!==m?(x={state:p,access:a,needsGesture:m,start:f},e[5]=a,e[6]=p,e[7]=m,e[8]=x):x=e[8],x}const En={mode:"none",iframeBase:null,showBlockingOverlay:!1,showWakingPill:!1};function Lo(t){const{previewState:e,progressStatus:n,fastPreviewActive:r=!1,fastPreviewReady:i=!1,codingSession:u=!1,hostedDraft:a=!1}=t,o=u?null:t.previewServerUrl;return t.deciding?{...En,showDecidingLoader:!0}:t.localPreviewUrl?{mode:"sandbox",iframeBase:t.localPreviewUrl,showBlockingOverlay:!1,showWakingPill:!1}:e.kind==="suspended"||e.kind==="errored"?En:a&&t.hostedPointerPending&&!i?{...En,showDecidingLoader:!0}:r&&i&&o?{mode:"production",iframeBase:o,showBlockingOverlay:!1,showWakingPill:!1}:r&&a&&o?{mode:"production",iframeBase:o,showBlockingOverlay:!1,showWakingPill:!1}:!r&&e.kind==="iframe"&&n!=="doing"?{mode:"sandbox",iframeBase:e.previewUrl,showBlockingOverlay:!1,showWakingPill:!1}:o?{mode:"production",iframeBase:o,showBlockingOverlay:!1,showWakingPill:!0}:{mode:"none",iframeBase:null,showBlockingOverlay:!0,showWakingPill:!1}}const Ao=1e4,_o=1e3,Oo=3e4;function Do({iframeRef:t,src:e,active:n}){const r=S.useRef(0),i=S.useRef(null),u=S.useRef(null),a=S.useRef(e),o=S.useRef(n);a.current=e,o.current=n;const l=()=>{i.current&&clearTimeout(i.current),u.current&&clearTimeout(u.current),i.current=null,u.current=null},d=()=>{i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{i.current=null,p()},Ao)},p=()=>{if(!o.current||!a.current)return;u.current&&clearTimeout(u.current);const x=Ya(Oo,_o,r.current,2,.5);r.current+=1,u.current=setTimeout(()=>{u.current=null;const b=t.current,j=a.current;!b||!j||!o.current||(b.src=j,d())},x)},m=()=>{r.current=0,l()},f=()=>{i.current&&(clearTimeout(i.current),i.current=null),p()};return S.useEffect(()=>{if(l(),r.current=0,!(!n||!e))return d(),l},[e,n]),{handleLoad:m,handleError:f}}const Bo=1500,Fo=500;function Mo({iframe:t,reload:e,waitMs:n=Bo,confirmMs:r=Fo}){let i;const u=()=>{clearTimeout(a),i=setTimeout(e,r)};t.addEventListener("load",u,{once:!0});const a=setTimeout(()=>{t.removeEventListener("load",u),e()},n);return()=>{clearTimeout(a),clearTimeout(i),t.removeEventListener("load",u)}}const $o=qt({tag:Te(),id:Te(),classes:Te(),text:Te(),html:Te(),manifestKey:Te().nullable(),componentName:Te().nullable(),parents:Te(),url:Te(),path:Te(),viewport:qt({width:rt(),height:rt()}),position:qt({x:rt(),y:rt()})}),zo=`(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 Ko(t,e){const n=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 n;const a=(f,x)=>{const b=t[r[f]??0];return!b||!b.length?1:b.indexOf(e[x]??"")>=0?2:0},o=[],l=[];for(let f=0;f<=i;f++)o.push(new Array(u+1).fill(0)),l.push(new Array(u+1).fill(2));for(let f=1;f<=i;f++){const x=o[f-1]??[],b=o[f]??[],j=l[f]??[];for(let g=1;g<=u;g++){let k=x[g]??0,E=2;const y=b[g-1]??0;y>k&&(k=y,E=0);const v=a(f-1,g-1),w=(x[g-1]??0)+v;v>0&&w>k&&(k=w,E=1),b[g]=k,j[g]=E}}let d=0,p=i,m=u;for(;p>0&&m>0;){const f=l[p]?.[m]??2;f===1?(n[r[p-1]??0]=m-1,d++,p--,m--):f===0?m--:p--}if(d===0&&u===i)for(let f=0;f<i;f++)n[r[f]??0]=f;return n}const Io=qt({sectionIndex:rt(),manifestKey:Te(),clickSeq:rt()}),Is=`(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 = ${Ko.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
+
426
+ // A skipped view transition rejects its promises with "AbortError:
427
+ // Transition was skipped"; nobody else waits on them, so they are settled
428
+ // here rather than left as uncaught errors in the page's console.
429
+ var settleTransition = function(vt) {
430
+ if (!vt) return;
431
+ var ignore = function() {};
432
+ if (vt.ready) vt.ready.catch(ignore);
433
+ if (vt.updateCallbackDone) vt.updateCallbackDone.catch(ignore);
434
+ if (vt.finished) vt.finished.catch(ignore);
435
+ };
436
+
437
+ // A site that opts into cross-document view transitions
438
+ // (@view-transition { navigation: auto }) gets one on every reload a save
439
+ // makes. When the next save navigates the frame before that transition
440
+ // starts, the browser skips it and rejects the outgoing page's ready
441
+ // promise, which only a pageswap listener can reach. Kept after deactivate:
442
+ // settling changes nothing else, and the frame may still navigate.
443
+ if (!window.__cmsEditorPageSwap) {
444
+ window.__cmsEditorPageSwap = true;
445
+ window.addEventListener("pageswap", function(e) {
446
+ settleTransition(e.viewTransition);
447
+ });
448
+ }
449
+
450
+ // A quick second save skips the running transition. Only finished says
451
+ // when the swap is over, so the chain waits on it; the rest is settled.
452
+ var runSwapTransition = function(swap) {
453
+ if (typeof document.startViewTransition !== "function") {
454
+ swap();
455
+ return Promise.resolve();
456
+ }
457
+ var vt = document.startViewTransition(swap);
458
+ settleTransition(vt);
459
+ return vt.finished;
460
+ };
461
+ var renderInPlace = function(src, body) {
462
+ if (renderCtrl) renderCtrl.abort();
463
+ var ctrl = new AbortController();
464
+ renderCtrl = ctrl;
465
+ renderPending = true;
466
+ highlight.style.display = "none";
467
+ badge.style.display = "none";
468
+ window.parent.postMessage({ type: "cms-editor::render-start" }, "*");
469
+ renderQueue = renderQueue.then(function() {
470
+ return fetch(src, {
471
+ method: "POST",
472
+ body: body,
473
+ signal: ctrl.signal,
474
+ headers: { accept: "text/html", "content-type": "application/json" }
475
+ }).then(function(res) {
476
+ if (!res.ok) throw new Error("render " + res.status);
477
+ return res.text();
478
+ }).then(function(html) {
479
+ var swap = function() {
480
+ document.documentElement.innerHTML = html.replace("</head>", TRANSITION_TAG);
481
+ document.body.appendChild(highlight);
482
+ document.body.appendChild(badge);
483
+ // Old section is gone; hide the overlay until the next hover repositions it.
484
+ highlight.style.display = "none";
485
+ badge.style.display = "none";
486
+ lastSection = null;
487
+ };
488
+ var headHtml = html.slice(html.indexOf("<head>"), html.indexOf("</head>") + 7);
489
+ var doc = new DOMParser().parseFromString(headHtml, "text/html");
490
+ var sheets = Array.prototype.map.call(
491
+ doc.head.querySelectorAll("link[rel=\\"stylesheet\\"]"),
492
+ function(el) { return el.href ? fetch(el.href).catch(function() {}) : null; }
493
+ );
494
+ return Promise.all(sheets).then(function() {
495
+ return runSwapTransition(swap);
496
+ });
497
+ }).then(function() {
498
+ var t = document.getElementById("deco-disable-transitions");
499
+ if (t) t.remove();
500
+ if (ctrl === renderCtrl) renderPending = false;
501
+ window.parent.postMessage({ type: "cms-editor::render-end" }, "*");
502
+ }).catch(function(err) {
503
+ if (ctrl === renderCtrl) renderPending = false;
504
+ if (err && err.name === "AbortError") return;
505
+ window.parent.postMessage({ type: "cms-editor::render-error" }, "*");
506
+ });
507
+ });
508
+ };
509
+
510
+ window.addEventListener("message", function(e) {
511
+ // Only Studio's own postMessage (source === this frame's parent) may drive the bridge — forged senders can't trigger the render fetch/swap.
512
+ if (e.source !== window.parent) return;
513
+ if (e.data && e.data.type === "cms-editor::render" && typeof e.data.src === "string") {
514
+ renderInPlace(e.data.src, e.data.body);
515
+ return;
516
+ }
517
+ if (e.data && e.data.type === "cms-editor::set-labels" && Array.isArray(e.data.labels)) {
518
+ sectionLabels = e.data.labels;
519
+ if (Array.isArray(e.data.kinds)) sectionKinds = e.data.kinds;
520
+ if (Array.isArray(e.data.keys)) sectionCandidates = e.data.keys;
521
+ if (lastSection) {
522
+ lastLabel = labelFor(lastSection);
523
+ lastKind = kindFor(lastSection);
524
+ applyColor(lastKind);
525
+ if (highlight.style.display !== "none") positionHighlight(lastSection);
526
+ }
527
+ return;
528
+ }
529
+ // Parent-driven clear: the cross-origin iframe can't self-detect a frame exit.
530
+ if (e.data && e.data.type === "cms-editor::clear-hover") {
531
+ highlight.style.display = "none";
532
+ badge.style.display = "none";
533
+ lastSection = null;
534
+ return;
535
+ }
536
+ if (e.data && e.data.type === "cms-editor::deactivate") {
537
+ highlight.remove();
538
+ badge.remove();
539
+ document.removeEventListener("mousemove", moveHandler, true);
540
+ document.removeEventListener("mouseout", outHandler, true);
541
+ document.removeEventListener("click", clickHandler, true);
542
+ // Or the page stays unnavigable after leaving Blocks mode.
543
+ document.removeEventListener("click", navBlocker, true);
544
+ document.removeEventListener("submit", submitBlocker, true);
545
+ window.removeEventListener("scroll", reposition, { capture: true });
546
+ window.removeEventListener("resize", reposition);
547
+ window.__cmsEditorActive = false;
548
+ }
549
+ });
550
+ })();`;function Ln(t,e,n=!1){let r=t,i=typeof r?.__resolveType=="string"?r.__resolveType:"";for(let u=0;i&&u<5;u++){const a=e[i];if(a&&typeof a=="object"&&"__resolveType"in a){const o=a.__resolveType;if(typeof o=="string"&&o&&o!==i){r=a,i=o;continue}}break}if(!i)return[];if(i.includes("flags/multivariate")||n&&Ci(i,n)){const u=Array.isArray(r.variants)?r.variants:[];if(u.length===0||u.every(l=>{const d=l?.rule;return Ri(d?.__resolveType,n)}))return null;const o=[];for(const l of u){const d=Li(l,n);if(d&&typeof d=="object")for(const p of Ln(d,e,n)??[])o.includes(p)||o.push(p)}return o}if(Ai(i)){const u=r.section&&typeof r.section=="object"?Ln(r.section,e,n):[];return u===null?null:u.length?[i,...u]:[i]}return[i]}function tt(t){return t.replace(/[`*_]/g,"\\$&")}function Uo(t,e){const n=[`The user selected an element on the live preview and asked: **"${tt(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&&n.push(`**Section resolveType:** \`${tt(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="${tt(t.classes)}"`:""}>`;n.push(`**Clicked element:** \`${r}\``),t.parents&&n.push(`**DOM breadcrumb:** ${tt(t.parents)} > ${t.tag}`),t.text&&n.push(`**Text content:** "${tt(t.text)}"`),t.componentName&&n.push(`**Component name:** ${tt(t.componentName)}`);const i=t.html.replace(/```/g,"`` `");return n.push("","**HTML snippet:**","```html",i,"```"),n.push("","Please read the source file, locate the element, and apply the requested change."),n.join(`
551
+ `)}function Vo(t,e,n=320,r=44,i=12){const{x:u,y:a}=t,{width:o,height:l}=e,d=Math.max(i,Math.min(u-n/2,o-n-i)),m=a/l>.68?Math.max(i,a-r-18):Math.min(a+18,l-r-i);return{leftPct:d/o*100,topPct:m/l*100}}function Ho(t){const e=ce.c(45),{element:n,onDismiss:r}=t,[i,u]=S.useState(""),a=S.useRef(null),{sendMessage:o}=La(),{openSidePanel:l}=Gi(),d=Ce();let p;e[0]!==n||e[1]!==i||e[2]!==r||e[3]!==l||e[4]!==o?(p=()=>{if(!i.trim())return;const $=Uo(n,i);l(),o({parts:[{type:"text",text:$}]}),r()},e[0]=n,e[1]=i,e[2]=r,e[3]=l,e[4]=o,e[5]=p):p=e[5];const m=p;let f;e[6]!==n.position||e[7]!==n.viewport?(f=Vo(n.position,n.viewport),e[6]=n.position,e[7]=n.viewport,e[8]=f):f=e[8];const x=f,b=`${x.leftPct}%`,j=`${x.topPct}%`;let g;e[9]!==b||e[10]!==j?(g={left:b,top:j,width:"320px"},e[9]=b,e[10]=j,e[11]=g):g=e[11];let k;e[12]!==m?(k=$=>{$.preventDefault(),m()},e[12]=m,e[13]=k):k=e[13];let E;e[14]===Symbol.for("react.memo_cache_sentinel")?(E=$=>u($.target.value),e[14]=E):E=e[14];let y;e[15]!==r?(y=$=>{$.key==="Escape"&&r()},e[15]=r,e[16]=y):y=e[16];let v;e[17]!==d?(v=d("sandbox.visualEditorPrompt.inputPlaceholder"),e[17]=d,e[18]=v):v=e[18];let w;e[19]!==i||e[20]!==y||e[21]!==v?(w=s.jsx("input",{ref:a,autoFocus:!0,type:"text",value:i,onChange:E,onKeyDown:y,placeholder:v,className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground"}),e[19]=i,e[20]=y,e[21]=v,e[22]=w):w=e[22];let T;e[23]!==i?(T=i.trim(),e[23]=i,e[24]=T):T=e[24];const P=!T;let N;e[25]!==d?(N=d("sandbox.visualEditorPrompt.sendButton"),e[25]=d,e[26]=N):N=e[26];let O;e[27]!==d?(O=d("sandbox.visualEditorPrompt.sendButton"),e[27]=d,e[28]=O):O=e[28];let R;e[29]!==O?(R=s.jsx("title",{children:O}),e[29]=O,e[30]=R):R=e[30];let _;e[31]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e[31]=_):_=e[31];let A;e[32]!==R?(A=s.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[R,_]}),e[32]=R,e[33]=A):A=e[33];let B;e[34]!==P||e[35]!==N||e[36]!==A?(B=s.jsx("button",{type:"submit",disabled:P,className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-lg bg-foreground text-background transition-opacity disabled:opacity-30",title:N,children:A}),e[34]=P,e[35]=N,e[36]=A,e[37]=B):B=e[37];let L;e[38]!==w||e[39]!==B||e[40]!==k?(L=s.jsxs("form",{className:"pointer-events-auto flex w-full items-center gap-1.5 rounded-xl glass px-3 py-1.5",onSubmit:k,children:[w,B]}),e[38]=w,e[39]=B,e[40]=k,e[41]=L):L=e[41];let U;return e[42]!==L||e[43]!==g?(U=s.jsx("div",{className:"absolute z-30 pointer-events-none",style:g,children:L}),e[42]=L,e[43]=g,e[44]=U):U=e[44],U}const Us="site-links",qo=/details?page|\bpdp\b/i,Wo=/listingpage|\bplp\b/i;function Go(t,e,n){const r=new Set;for(const o of n)qo.test(o)&&r.add("product"),Wo.test(o)&&r.add("category");const i=St(Fn(t)),u=i[i.length-1],a=i[i.length-2];return u?.type==="text"&&u.text==="/p"&&a?.type==="param"&&a.name===e&&r.add("product"),e==="*"&&i.some(o=>o.type==="param"&&o.name==="*")&&r.add("category"),r}const Jo=["rosa","preto","pink","black"];function It(t,e){const n=e.trim();return n?t(n):Jo.flatMap(r=>t(r))}function Yo(t,e){const n=e.trim(),r=[];/^\d+$/.test(n)&&r.push({resolveType:t,props:{ids:[n]}});const u=n.includes("-")&&!/\s/.test(n)?n.replace(/-+/g," "):n;return r.push({resolveType:t,props:{query:u,count:10}}),r}const Nr=new Set(["vtex","shopify","shopify-mcp","magento","wake","linx","linx-impulse","nuvemshop","vnda","wap","salesforce"]);function Mn(t){return t.split("/")[0]??""}function Qo(t){const e=new Set;for(const n of t){const r=Mn(n);Nr.has(r)&&e.add(r)}return e}function Xo(t,e){const n=Mn(t);return!Nr.has(n)||e.size===0?!0:e.has(n)}const Zo=[{kind:"product",test:t=>t==="vtex/loaders/intelligentSearch/productList.ts",clientFilter:!1,buildRequests:(t,e)=>It(n=>Yo(t,n),e),optionsFromPayload:Ut},{kind:"product",test:t=>/magento\/.*products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>It(n=>[{resolveType:t,props:{props:{search:n,pageSize:10,currentPage:1}}}],e),optionsFromPayload:Ut},{kind:"product",test:t=>/algolia\/.*products?\/(list|suggestions)(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>It(n=>[{resolveType:t,props:{term:n,hitsPerPage:10}}],e),optionsFromPayload:Ut},{kind:"product",test:t=>/products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>It(n=>[{resolveType:t,props:{query:n,term:n,count:10,hitsPerPage:10}}],e),optionsFromPayload:Ut},{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:il}];function el(t,e,n=new Set){const r=[...e],i=o=>{const l=[];for(const d of Zo){if(d.kind!==o)continue;const p=r.find(m=>d.test(m)&&Xo(m,n));p&&l.push({cand:d,resolveType:p})}return l.find(d=>n.has(Mn(d.resolveType)))??l[0]},u=(o,l,d)=>({kind:o.kind,id:`${o.kind}:${l}`,resolveType:l,clientFilter:o.clientFilter,isFallback:d,buildRequests:p=>o.buildRequests(l,p),optionsFromPayload:o.optionsFromPayload}),a=[];for(const o of["product","category"]){if(!t.has(o))continue;const l=i(o);l&&a.push(u(l.cand,l.resolveType,!1))}return t.size>0&&a.push(tl(t.has("category")?"category":"product")),a}function tl(t){return{kind:t,id:Us,resolveType:Us,clientFilter:!0,isFallback:!0,homepageLinks:!0,optionsFromPayload:(e,n)=>ul(e,n)}}function He(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function nl(t,e,n){const r=new Set,i=new Set,u=a=>{if(Array.isArray(a)){for(const d of a)u(d);return}const o=He(a);if(!o)return;const l=o.__resolveType;if(typeof l=="string"){if(n(l))r.add(l);else if(l in e&&!i.has(l)){i.add(l);const d=He(e[l])?.__resolveType;typeof d=="string"&&n(d)&&r.add(l),u(e[l])}}for(const d of Object.values(o))u(d)};return u(t),r}function Tr(t){const e=new Set,n=[];for(const r of t)for(const i of r)e.has(i.value)||(e.add(i.value),n.push(i));return n}function Cr(t){try{return decodeURIComponent(t)}catch{return t}}function sl(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function rl(t){const e=[];let n="^";for(const r of t)r.type==="text"?n+=sl(r.text):(e.push(r.name),n+=r.name==="*"?"(.+)":"([^/]+)");return{pattern:new RegExp(`${n}$`),order:e}}function Rr(t,e,n){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=St(Fn(e)),{pattern:u,order:a}=rl(i),o=a.indexOf(n);if(o===-1)return null;const l=r.match(u);if(!l)return null;const d=l[o+1]?.replace(/^\/+|\/+$/g,"");return d?Cr(d):null}function Ut(t,e){const n=He(t),r=Array.isArray(t)?t:Array.isArray(n?.products)?n.products:Array.isArray(n?.list)?n.list:[],i=[],u=new Set;for(const a of r){const o=He(a);if(!o)continue;const l=Rr(o.url,e.template,e.paramName);if(!l||u.has(l))continue;u.add(l);const d=He(o.isVariantOf),p=typeof d?.name=="string"&&d.name||typeof o.name=="string"&&o.name||l,m=Array.isArray(o.image)?He(o.image[0]):null,f=typeof m?.url=="string"?m.url:void 0;i.push({value:l,label:p,image:f})}return i}function al(t){if(typeof t!="string"||!t)return null;let e;try{e=new URL(t,"https://placeholder.invalid").pathname}catch{return null}const n=e.replace(/^\/+|\/+$/g,"");return n?Cr(n):null}function il(t){const e=[],n=new Set,r=(i,u)=>{const a=He(i);if(!a)return;const o=typeof a.name=="string"&&a.name?a.name:"",l=o?[...u,o]:u,d=al(a.url);if(d&&!n.has(d)&&(n.add(d),e.push({value:d,label:l.join(" › ")||d})),Array.isArray(a.children))for(const p of a.children)r(p,l)};if(Array.isArray(t))for(const i of t)r(i,[]);return e}const ol=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 ll(t){return(t.split("/").filter(Boolean).pop()??t).replace(/[-_]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,n=>n.toUpperCase())}function cl(t){if(typeof t!="string"||!t)return[];const e=[],n=/<a\b[^>]*?\bhref="([^"]+)"[^>]*>([\s\S]*?)<\/a>/gi;let r,i=0;for(;(r=n.exec(t))!==null&&i++<5e3;){const u=r[1]??"",a=(r[2]??"").replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim();e.push({href:u,text:a})}return e}function dl(t){if(typeof t!="string"||!t)return[];const e=[],n=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,a=0;for(;(u=r.exec(t))!==null&&a++<3e3;){const o=(u[1]??"").replace(/\\\//g,"/");if(!o||n.has(o))continue;n.add(o);const l=t.slice(u.index,u.index+900).match(i)?.[1]?.replace(/\\\//g,"/");e.push({url:o,name:u[2]??"",image:l||void 0})}return e}function ul(t,e){const n=[],r=new Set,i=(u,a,o,l)=>{if(n.length>=200)return;const d=Rr(u,e.template,e.paramName);!d||r.has(d)||e.paramName==="*"&&/(^|\/)p$/.test(d)||o==="category"&&ol.has(d.split("/")[0]??"")||(r.add(d),n.push({value:d,label:a&&a.length<=80?a:ll(d),kind:o,image:l}))};for(const{url:u,name:a,image:o}of dl(t))i(u,a,"product",o);for(const{href:u,text:a}of cl(t))u.startsWith("/")&&!u.startsWith("//")&&i(u,a,"category");return n}function xt(t,e,n=50){const r=e.trim().toLowerCase();return(r?t.filter(u=>u.label.toLowerCase().includes(r)||u.value.toLowerCase().includes(r)):t).slice(0,n)}const Lr=1e4;function fl(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 ml(t,{resolveType:e,props:n}){const r=await fetch(si(t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({__resolveType:e,...n}),signal:AbortSignal.timeout(Lr)});if(!r.ok)throw new Error(`Failed to fetch options: ${r.status}`);return r.json()}async function Vs(t,e){const n=await fetch(ri(t,e),{signal:AbortSignal.timeout(Lr)});if(!n.ok)throw new Error(`Failed to fetch page: ${n.status}`);return n.text()}async function pl(t,e,n){const r=e.optionsFromPayload(await Vs(t,"/"),n),i=r.find(a=>a.kind==="category");if(!i)return r;const u=Ke(n.template,{[n.paramName]:i.value});if(u==="/")return r;try{const a=e.optionsFromPayload(await Vs(t,u),n).filter(o=>o.kind==="product");return Tr([r,a])}catch{return r}}function hl(t,e,n){return er.sandboxInvoke(`${t.orgSlug}/${t.virtualMcpId}/${t.branch}`,`path-param-${e.id}:${e.clientFilter?"":n}`)}async function gl(t,e,n,r){if(e.homepageLinks)return pl(t,e,r);const i=e.buildRequests?.(n)??[];if(i.length===0)return[];const u=await Promise.allSettled(i.map(o=>ml(t,o))),a=u.filter(o=>o.status==="fulfilled").map(o=>o.value);if(a.length===0){const o=u.find(l=>l.status==="rejected");throw o?o.reason:new Error("Failed to fetch options")}return Tr(a.map(o=>e.optionsFromPayload(o,r)))}function An(t,e,n,r,i){return{queryKey:hl(t,e,n),queryFn:()=>gl(t,e,n,r),enabled:i,staleTime:6e4,retry:1}}function bt(t){const e=ce.c(16),{heading:n,iconKind:r,options:i,template:u,paramName:a,keyPrefix:o,onSelect:l}=t;if(i.length===0)return null;let d;if(e[0]!==r||e[1]!==o||e[2]!==l||e[3]!==i||e[4]!==a||e[5]!==u){let m;e[7]!==r||e[8]!==o||e[9]!==l||e[10]!==a||e[11]!==u?(m=f=>s.jsxs(kt,{value:`${o}:${f.value}`,className:"gap-3 py-2",onSelect:()=>l(f.value),children:[r==="product"&&s.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?s.jsx("img",{src:f.image,alt:"",referrerPolicy:"no-referrer",className:"h-full w-full object-cover"}):s.jsx(or,{size:14,className:"text-muted-foreground"})}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"block truncate text-sm",children:f.label}),s.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:Ke(u,{[a]:f.value})})]})]},`${o}:${f.value}`),e[7]=r,e[8]=o,e[9]=l,e[10]=a,e[11]=u,e[12]=m):m=e[12],d=i.map(m),e[0]=r,e[1]=o,e[2]=l,e[3]=i,e[4]=a,e[5]=u,e[6]=d}else d=e[6];let p;return e[13]!==n||e[14]!==d?(p=s.jsx(wt,{heading:n,children:d}),e[13]=n,e[14]=d,e[15]=p):p=e[15],p}function Hs(t){const e=ce.c(2),{text:n}=t;let r;return e[0]!==n?(r=s.jsx("div",{className:"px-2 py-2 text-xs text-muted-foreground",children:n}),e[0]=n,e[1]=r):r=e[1],r}function vl(t){const e=ce.c(52),{sources:n,template:r,paramName:i,value:u,sandboxRef:a,onCommit:o}=t,l=Ce(),[d,p]=S.useState(!1),[m,f]=S.useState(""),[x,b]=S.useState(""),j=S.useRef(null),g=i==="*"?l("sandbox.preview.catchAllParamLabel"):`:${i}`,k=fl(l),y=[...new Set(n.map(Q=>k[Q.kind].noun))].join(" or ");let v;e[0]!==l||e[1]!==y?(v=l("sandbox.pathParamPickerChip.searchPlaceholder",{options:y}),e[0]=l,e[1]=y,e[2]=v):v=e[2];const w=v,T={template:r,paramName:i};let P;e[3]!==m?(P=(Q,se)=>({source:Q,query:se,options:Q.clientFilter?xt(se.data??[],m):se.data??[]}),e[3]=m,e[4]=P):P=e[4];const N=P,O=n.filter(jl),R=n.filter(Pl),_=Cn({queries:O.map(Q=>An(a,Q,x,T,d))});let A;e[5]!==_||e[6]!==N?(A=(Q,se)=>N(Q,_[se]),e[5]=_,e[6]=N,e[7]=A):A=e[7];const B=O.map(A),L=B.length===0||B.every(Sl),U=Cn({queries:R.map(Q=>An(a,Q,x,T,d&&L))});let $;e[8]!==U||e[9]!==N?($=(Q,se)=>N(Q,U[se]),e[8]=U,e[9]=N,e[10]=$):$=e[10];const G=R.map($),V=L?G:B,W=V.length===1&&V[0]?.source.homepageLinks?V[0]:null,J=W&&!W.query.isLoading&&!W.query.isError?W?.query.data??[]:[],ae=xt(J.filter(kl),m),C=xt(J.filter(wl),m),q=ae.length>0&&C.length>0,K=Q=>{p(Q),j.current&&clearTimeout(j.current),f(Q?u:""),b(Q?u:"")};let X;e[11]===Symbol.for("react.memo_cache_sentinel")?(X=Q=>{f(Q),j.current&&clearTimeout(j.current),j.current=setTimeout(()=>{b(Q)},300)},e[11]=X):X=e[11];const M=X,Y=Q=>{o(Q),K(!1)},Z=br(m),I=Ke(r,{[i]:Z}),ie=Zs,ne=Xs,ee="flex h-[85svh] flex-col gap-0 overflow-hidden p-0 sm:h-[520px] sm:max-w-[560px]",le=yl;let pe;e[12]!==g||e[13]!==l?(pe=l("sandbox.pathParamPickerChip.pickValueTitle",{paramLabel:g}),e[12]=g,e[13]=l,e[14]=pe):pe=e[14];let de;e[15]!==pe?(de=s.jsx(tr,{className:"sr-only",children:s.jsx(nr,{children:pe})}),e[15]=pe,e[16]=de):de=e[16];let be;e[17]===Symbol.for("react.memo_cache_sentinel")?(be=s.jsx(or,{size:16,className:"shrink-0 text-foreground"}),e[17]=be):be=e[17];let fe;e[18]!==l?(fe=l("sandbox.pathParamPickerChip.pickValueHeading"),e[18]=l,e[19]=fe):fe=e[19];let je;e[20]!==g?(je=s.jsx("span",{className:"rounded-sm bg-special/15 px-1 py-0.5 font-mono text-xs text-special",children:g}),e[20]=g,e[21]=je):je=e[21];let ye;e[22]!==fe||e[23]!==je?(ye=s.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-3 border-b border-border px-4",children:[be,s.jsxs("span",{className:"text-sm font-medium text-foreground",children:[fe," ",je]})]}),e[22]=fe,e[23]=je,e[24]=ye):ye=e[24];const we=fr,De=!1,at="min-h-0 flex-1";let ue;e[25]!==w||e[26]!==m?(ue=s.jsx(mr,{autoFocus:!0,placeholder:w,value:m,onValueChange:M}),e[25]=w,e[26]=m,e[27]=ue):ue=e[27];const Ae=ur,Be="flex max-h-none min-h-0 flex-1 flex-col overflow-hidden";let Fe;e[28]!==l?(Fe=l("sandbox.pathParamPickerChip.noResults"),e[28]=l,e[29]=Fe):Fe=e[29];let _e;e[30]!==Fe?(_e=s.jsx(pr,{children:Fe}),e[30]=Fe,e[31]=_e):_e=e[31];const it=Z&&s.jsx(wt,{className:"shrink-0",children:s.jsxs(kt,{value:`__raw__:${Z}`,className:"gap-3 py-2",onSelect:()=>Y(Z),children:[s.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-md border border-dashed border-border bg-muted",children:s.jsx(Yi,{size:14,className:"text-muted-foreground"})}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"block truncate text-sm",children:l("sandbox.pathParamPickerChip.useRawValue",{rawTerm:Z,paramLabel:g})}),s.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:I})]})]})}),qe=q?s.jsxs("div",{className:"flex min-h-0 flex-1",children:[s.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto border-r border-border",children:s.jsx(bt,{heading:k.category.heading,iconKind:"category",options:ae,template:r,paramName:i,keyPrefix:`${W?.source.id}:cat`,onSelect:Y})}),s.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:s.jsx(bt,{heading:k.product.heading,iconKind:"product",options:C,template:r,paramName:i,keyPrefix:`${W?.source.id}:prod`,onSelect:Y})})]}):s.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:V.map(Q=>{const{source:se,query:ve,options:$e}=Q,{noun:ot}=k[se.kind];if(ve.isLoading)return s.jsx(Hs,{text:l("sandbox.pathParamPickerChip.loading",{noun:ot})},se.id);if(ve.isError)return s.jsx(Hs,{text:l("sandbox.pathParamPickerChip.couldNotLoad")},se.id);if(se.homepageLinks){const We=ve.data??[];return s.jsxs(S.Fragment,{children:[s.jsx(bt,{heading:k.category.heading,iconKind:"category",options:xt(We.filter(bl),m),template:r,paramName:i,keyPrefix:`${se.id}:cat`,onSelect:Y}),s.jsx(bt,{heading:k.product.heading,iconKind:"product",options:xt(We.filter(xl),m),template:r,paramName:i,keyPrefix:`${se.id}:prod`,onSelect:Y})]},se.id)}return s.jsx(bt,{heading:V.length>1?k[se.kind].heading:void 0,iconKind:se.kind,options:$e,template:r,paramName:i,keyPrefix:se.id,onSelect:Y},se.id)})});let oe;e[32]!==Ae||e[33]!==_e||e[34]!==it||e[35]!==qe?(oe=s.jsxs(Ae,{className:Be,children:[_e,it,qe]}),e[32]=Ae,e[33]=_e,e[34]=it,e[35]=qe,e[36]=oe):oe=e[36];let Ee;e[37]!==we||e[38]!==ue||e[39]!==oe?(Ee=s.jsxs(we,{shouldFilter:De,className:at,children:[ue,oe]}),e[37]=we,e[38]=ue,e[39]=oe,e[40]=Ee):Ee=e[40];let Re;e[41]!==ne||e[42]!==de||e[43]!==ye||e[44]!==Ee||e[45]!==le?(Re=s.jsxs(ne,{className:ee,onClick:le,children:[de,ye,Ee]}),e[41]=ne,e[42]=de,e[43]=ye,e[44]=Ee,e[45]=le,e[46]=Re):Re=e[46];let Me;return e[47]!==ie||e[48]!==K||e[49]!==d||e[50]!==Re?(Me=s.jsx(ie,{open:d,onOpenChange:K,children:Re}),e[47]=ie,e[48]=K,e[49]=d,e[50]=Re,e[51]=Me):Me=e[51],s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button",title:l("sandbox.pathParamPickerChip.buttonTitle",{paramLabel:g}),className:"max-w-64 shrink-0 cursor-pointer truncate rounded-lg bg-special/15 px-1 py-0.5 text-xs text-special hover:bg-special/25",onClick:Q=>{Q.stopPropagation(),K(!0)},children:u||g}),Me]})}function xl(t){return t.kind==="product"}function bl(t){return t.kind!=="product"}function yl(t){return t.stopPropagation()}function wl(t){return t.kind==="product"}function kl(t){return t.kind!=="product"}function Sl(t){return!t.query.isLoading&&(t.query.isError||t.options.length===0)}function Pl(t){return t.isFallback}function jl(t){return!t.isFallback}function El(t){const e=ce.c(8),{sources:n,template:r,paramName:i,sandboxRef:u,onFill:a}=t;let o,l;if(e[0]!==i||e[1]!==u||e[2]!==n||e[3]!==r){const x={template:r,paramName:i},b=n.filter(Nl);l=Cn,o=b.map(j=>An(u,j,"",x,!0)),e[0]=i,e[1]=u,e[2]=n,e[3]=r,e[4]=o,e[5]=l}else o=e[4],l=e[5];let d;e[6]!==o?(d={queries:o},e[6]=o,e[7]=d):d=e[7];const p=l(d),[m,f]=S.useState(!1);if(!m)for(const x of p){if(x.isLoading)break;const b=x.data?.[0];if(b){f(!0),queueMicrotask(()=>a(b.value));break}}return null}function Nl(t){return!t.isFallback}function Tl(t){const e=ce.c(31),{name:n,value:r,onCommit:i}=t,u=Ce(),[a,o]=S.useState(r),[l,d]=S.useState(!1),p=S.useRef(!1);let m;e[0]!==n||e[1]!==u?(m=n==="*"?u("sandbox.preview.catchAllParamLabel"):`:${n}`,e[0]=n,e[1]=u,e[2]=m):m=e[2];const f=m,x=a||f;let b;e[3]!==x?(b=s.jsx("span",{"aria-hidden":!0,className:"invisible whitespace-pre px-1 py-0.5 text-xs",children:x}),e[3]=x,e[4]=b):b=e[4];let j;e[5]!==f||e[6]!==u?(j=u("sandbox.preview.valueForParam",{label:f}),e[5]=f,e[6]=u,e[7]=j):j=e[7];let g,k;e[8]===Symbol.for("react.memo_cache_sentinel")?(g=N=>o(N.target.value),k=()=>d(!0),e[8]=g,e[9]=k):(g=e[8],k=e[9]);let E;e[10]!==r?(E=N=>{N.key==="Enter"&&N.currentTarget.blur(),N.key==="Escape"&&(p.current=!0,o(r),N.currentTarget.blur())},e[10]=r,e[11]=E):E=e[11];let y;e[12]!==a||e[13]!==i||e[14]!==r?(y=()=>{if(d(!1),p.current){p.current=!1;return}const N=br(a);o(N),N!==r&&i(N)},e[12]=a,e[13]=i,e[14]=r,e[15]=y):y=e[15];let v;e[16]!==a||e[17]!==f||e[18]!==j||e[19]!==E||e[20]!==y?(v=s.jsx("input",{type:"text",value:a,placeholder:f,title:j,spellCheck:!1,className:"absolute inset-0 rounded-sm bg-special/15 px-1 text-xs text-special outline-none placeholder:text-special/60 focus:bg-special/25",onClick:Cl,onChange:g,onFocus:k,onKeyDown:E,onBlur:y}),e[16]=a,e[17]=f,e[18]=j,e[19]=E,e[20]=y,e[21]=v):v=e[21];let w;e[22]!==b||e[23]!==v?(w=s.jsxs("span",{className:"relative inline-flex max-w-64 shrink-0 items-center overflow-hidden",children:[b,v]}),e[22]=b,e[23]=v,e[24]=w):w=e[24];let T;e[25]!==l||e[26]!==u?(T=l&&s.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-2xs text-muted-foreground",children:[s.jsx(Ma,{size:10}),u("sandbox.preview.enterToGo")]}),e[25]=l,e[26]=u,e[27]=T):T=e[27];let P;return e[28]!==T||e[29]!==w?(P=s.jsxs(s.Fragment,{children:[w,T]}),e[28]=T,e[29]=w,e[30]=P):P=e[30],P}function Cl(t){return t.stopPropagation()}function Rl(t){if(t.activeGlobalSectionName)return t.activeGlobalSectionName;const e=t.iframeBase;if(!e)return t.noServerLabel;try{const n=new URL(e),r=t.resolvedPath==="/"?"":t.resolvedPath;return`${n.host}${r}`}catch{return e}}function Ll(t){return t.previewSurfaceActive&&(t.daemonReady||t.production||!!t.servePreviewUrl)}function Al(t){return t.showPreviewToolbar&&t.contentEditingEnabled}class Ar extends Error{constructor(){super("The site's schema isn't loaded yet"),this.name="PageSchemaNotReadyError"}}async function _l(t,e){if(t)return t;const n=await e?.().catch(()=>null);if(!n)throw new Ar;return n}async function Ol(t,e,n){return n?Ss(t,e,await _l(n.meta,n.loadMeta)):Ss(t,e)}function Dl(t){const e=ce.c(5);let n;e[0]!==t?(n=t??{orgSlug:"",virtualMcpId:"",branch:""},e[0]=t,e[1]=n):n=e[1];const r=sr(n);let i;return e[2]!==t||e[3]!==r?(i={mutationFn:async u=>{const{name:a,path:o,template:l,schema:d}=u;if(!t?.virtualMcpId||!t.branch)throw new Error("Sandbox not ready");const p=ya(a),m=l?{...l,name:a,path:o}:await Ol(a,o,d);return await r.mutateAsync({blockKey:p,data:m}),{key:p,name:a,path:o}}},e[2]=t,e[3]=r,e[4]=i):i=e[4],ua(i)}function Bl(t){const e=ce.c(89),{open:n,onOpenChange:r,isPending:i,error:u,templates:a,onSubmit:o}=t,l=i===void 0?!1:i,d=Ce();let p;e[0]!==d?(p=d("sectionsEditor.createPageModal.defaultPageName"),e[0]=d,e[1]=p):p=e[1];const[m,f]=S.useState(p);let x;e[2]!==d?(x=d("sectionsEditor.createPageModal.defaultPagePath"),e[2]=d,e[3]=x):x=e[3];const[b,j]=S.useState(x),[g,k]=S.useState(wn),[E,y]=S.useState(null),[v,w]=S.useState(n);n!==v&&(w(n),n&&(f(d("sectionsEditor.createPageModal.defaultPageName")),j(d("sectionsEditor.createPageModal.defaultPagePath")),k(wn),y(null)));const T=!!a?.length;let P;e[4]!==l||e[5]!==r?(P=fe=>{!fe&&!l&&(y(null),r(!1))},e[4]=l,e[5]=r,e[6]=P):P=e[6];const N=P;let O;e[7]!==l||e[8]!==m||e[9]!==o||e[10]!==b||e[11]!==T||e[12]!==g?(O=async fe=>{fe.preventDefault();const je=m.trim(),ye=b.trim();if(!je||!ye||l)return;const we=yr(ye);if(we){y(we);return}y(null),await o({name:je,path:ye,templateKey:T&&g!==wn?g:null})},e[7]=l,e[8]=m,e[9]=o,e[10]=b,e[11]=T,e[12]=g,e[13]=O):O=e[13];const R=O,_=E??u;let A;e[14]!==d?(A=d("sectionsEditor.createPageModal.title"),e[14]=d,e[15]=A):A=e[15];let B;e[16]!==A?(B=s.jsx(tr,{children:s.jsx(nr,{children:A})}),e[16]=A,e[17]=B):B=e[17];let L;e[18]!==d?(L=d("sectionsEditor.createPageModal.nameLabel"),e[18]=d,e[19]=L):L=e[19];let U;e[20]!==L?(U=s.jsx("label",{htmlFor:"new-page-name",className:"text-xs font-medium text-muted-foreground",children:L}),e[20]=L,e[21]=U):U=e[21];let $;e[22]===Symbol.for("react.memo_cache_sentinel")?($=fe=>f(fe.target.value),e[22]=$):$=e[22];let G;e[23]!==d?(G=d("sectionsEditor.createPageModal.namePlaceholder"),e[23]=d,e[24]=G):G=e[24];let V;e[25]!==l||e[26]!==m||e[27]!==G?(V=s.jsx(Tn,{id:"new-page-name",value:m,onChange:$,placeholder:G,autoFocus:!0,disabled:l}),e[25]=l,e[26]=m,e[27]=G,e[28]=V):V=e[28];let W;e[29]!==V||e[30]!==U?(W=s.jsxs("div",{className:"space-y-1.5",children:[U,V]}),e[29]=V,e[30]=U,e[31]=W):W=e[31];let H;e[32]!==d?(H=d("sectionsEditor.createPageModal.pathLabel"),e[32]=d,e[33]=H):H=e[33];let J;e[34]!==H?(J=s.jsx("label",{htmlFor:"new-page-path",className:"text-xs font-medium text-muted-foreground",children:H}),e[34]=H,e[35]=J):J=e[35];let ae;e[36]===Symbol.for("react.memo_cache_sentinel")?(ae=fe=>j(fe.target.value),e[36]=ae):ae=e[36];let C;e[37]!==d?(C=d("sectionsEditor.createPageModal.pathPlaceholder"),e[37]=d,e[38]=C):C=e[38];let q;e[39]!==l||e[40]!==b||e[41]!==C?(q=s.jsx(Tn,{id:"new-page-path",value:b,onChange:ae,placeholder:C,disabled:l}),e[39]=l,e[40]=b,e[41]=C,e[42]=q):q=e[42];let K;e[43]!==J||e[44]!==q?(K=s.jsxs("div",{className:"space-y-1.5",children:[J,q]}),e[43]=J,e[44]=q,e[45]=K):K=e[45];let X;e[46]!==l||e[47]!==T||e[48]!==d||e[49]!==g||e[50]!==a?(X=T&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{htmlFor:"new-page-template",className:"text-xs font-medium text-muted-foreground",children:d("sectionsEditor.createPageModal.templateLabel")}),s.jsx(wa,{id:"new-page-template",value:g,onChange:k,templates:a??[],disabled:l})]}),e[46]=l,e[47]=T,e[48]=d,e[49]=g,e[50]=a,e[51]=X):X=e[51];let M;e[52]!==_?(M=_&&s.jsx("p",{className:"text-xs text-destructive",children:_}),e[52]=_,e[53]=M):M=e[53];let Y;e[54]!==W||e[55]!==K||e[56]!==X||e[57]!==M?(Y=s.jsxs("div",{className:"space-y-4 py-4",children:[W,K,X,M]}),e[54]=W,e[55]=K,e[56]=X,e[57]=M,e[58]=Y):Y=e[58];let Z;e[59]!==r?(Z=()=>r(!1),e[59]=r,e[60]=Z):Z=e[60];let I;e[61]!==d?(I=d("sectionsEditor.createPageModal.cancelButton"),e[61]=d,e[62]=I):I=e[62];let ie;e[63]!==l||e[64]!==Z||e[65]!==I?(ie=s.jsx(Ie,{type:"button",variant:"outline",onClick:Z,disabled:l,children:I}),e[63]=l,e[64]=Z,e[65]=I,e[66]=ie):ie=e[66];let ne;e[67]!==l||e[68]!==m||e[69]!==b?(ne=!m.trim()||!b.trim()||l,e[67]=l,e[68]=m,e[69]=b,e[70]=ne):ne=e[70];let ee;e[71]!==l||e[72]!==d?(ee=l?s.jsxs(s.Fragment,{children:[s.jsx(Pt,{className:"size-3.5"}),d("sectionsEditor.createPageModal.creatingButton")]}):d("sectionsEditor.createPageModal.createButton"),e[71]=l,e[72]=d,e[73]=ee):ee=e[73];let le;e[74]!==ne||e[75]!==ee?(le=s.jsx(Ie,{type:"submit",disabled:ne,children:ee}),e[74]=ne,e[75]=ee,e[76]=le):le=e[76];let pe;e[77]!==ie||e[78]!==le?(pe=s.jsxs(fa,{children:[ie,le]}),e[77]=ie,e[78]=le,e[79]=pe):pe=e[79];let de;e[80]!==R||e[81]!==Y||e[82]!==pe||e[83]!==B?(de=s.jsx(Xs,{className:"sm:max-w-md",children:s.jsxs("form",{onSubmit:R,children:[B,Y,pe]})}),e[80]=R,e[81]=Y,e[82]=pe,e[83]=B,e[84]=de):de=e[84];let be;return e[85]!==N||e[86]!==n||e[87]!==de?(be=s.jsx(Zs,{open:n,onOpenChange:N,children:de}),e[85]=N,e[86]=n,e[87]=de,e[88]=be):be=e[88],be}function Fl(t){const e=ce.c(29),{orgSlug:n,virtualMcpId:r,branch:i,previewUrl:u,meta:a,decofile:o,blockKey:l}=t,d=Ce();let p;e[0]!==i||e[1]!==n||e[2]!==r?(p={orgSlug:n,virtualMcpId:r,branch:i},e[0]=i,e[1]=n,e[2]=r,e[3]=p):p=e[3];const m=sr(p);let f;e[4]!==m?(f=Pa((w,T)=>m.mutate({blockKey:w,data:T})),e[4]=m,e[5]=f):f=e[5];const x=f;let b;e[6]!==l||e[7]!==o?(b=ka(o,l),e[6]=l,e[7]=o,e[8]=b):b=e[8];const{resolveType:j,props:g,title:k}=b;if(!j){let w;e[9]!==d?(w=d("sandbox.preview.loaderNoLongerExists"),e[9]=d,e[10]=w):w=e[10];let T;return e[11]!==w?(T=s.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center text-sm text-muted-foreground",children:w}),e[11]=w,e[12]=T):T=e[12],T}const E=`loader:${l}`;let y;e[13]!==l||e[14]!==j||e[15]!==k?(y={mode:"saved",blockKey:l,resolveType:j,title:k},e[13]=l,e[14]=j,e[15]=k,e[16]=y):y=e[16];let v;return e[17]!==i||e[18]!==o||e[19]!==a||e[20]!==n||e[21]!==u||e[22]!==g||e[23]!==m.isPending||e[24]!==x||e[25]!==E||e[26]!==y||e[27]!==r?(v=s.jsx(Sa,{orgSlug:n,virtualMcpId:r,branch:i,previewUrl:u,meta:a,decofile:o,kind:"loaders",target:y,initialValue:g,isCreating:m.isPending,onCreate:Ml,onSaveReferencedBlock:x,showRun:!1},E),e[17]=i,e[18]=o,e[19]=a,e[20]=n,e[21]=u,e[22]=g,e[23]=m.isPending,e[24]=x,e[25]=E,e[26]=y,e[27]=r,e[28]=v):v=e[28],v}async function Ml(){}function $l(t){if(t instanceof Error&&"status"in t&&typeof t.status=="number")return t.status}function qs(t){return{status:t.status,hasData:t.data!==void 0,errorStatus:$l(t.error)}}function zl(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 Kl(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=zl(t.lifecyclePhase);if(e==="terminal-error")return{kind:"error",source:"sandbox"};if(e==="booting")return{kind:"loading"};const n=t.decofile.status==="error"&&!t.decofile.hasData||t.meta.status==="error"&&!t.meta.hasData;return n&&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"}:n?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 Il=S.lazy(()=>ma(()=>import("./sections-editor-Ykrd9ksj.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,139,140,141,142,143,144,145,146,147])).then(t=>({default:t.SectionsEditor})));function Ws(t){const e=ce.c(60),{virtualMcpId:n,externalSelection:r,onViewJsonFile:i}=t,u=r===void 0?null:r,{org:a}=_n(),{currentBranch:o,taskId:l}=Xt(),d=kr(),p=On(),m=Sr(),f=d.lifecycle.phase==="running",x=p.previewUrl;let b;e[0]!==o||e[1]!==a||e[2]!==x||e[3]!==l||e[4]!==n?(b=o?{orgSlug:a.slug,virtualMcpId:n,branch:o,threadId:l??null,previewUrl:x}:null,e[0]=o,e[1]=a,e[2]=x,e[3]=l,e[4]=n,e[5]=b):b=e[5];const j=b,g=Dn(n,o);let k;e[6]!==f?(k={fetchEnabled:f},e[6]=f,e[7]=k):k=e[7];const E=Bn(j,k);let y;e[8]!==f?(y={fetchEnabled:f},e[8]=f,e[9]=y):y=e[9];const v=xr(j,y),w=Kl({lifecyclePhase:d.lifecycle.phase,decofile:qs(E),meta:qs(v),hasEditableContent:_i(E.data,v.data),fastPreviewActive:hr(n).runtime==="cms"||nt(g)}),T=rr()===void 0,P=Ul;if(wi(g)){let C;return e[10]===Symbol.for("react.memo_cache_sentinel")?(C=P(s.jsx(Si,{})),e[10]=C):C=e[10],C}if(g.kind==="pending"&&g.retrying){let C;return e[11]!==g?(C=P(s.jsx(Pi,{backend:g})),e[11]=g,e[12]=C):C=e[12],C}if(w.kind==="loading"||T){let C;return e[13]===Symbol.for("react.memo_cache_sentinel")?(C=P(s.jsx(pa,{})),e[13]=C):C=e[13],C}if(E.data&&ai(v.data)){const C=m.state.target,q=C?.kind==="page"||C?.kind==="section"?C.key:null,K=q??"",X=o??"";let M;return e[14]!==E.data||e[15]!==q||e[16]!==a.slug||e[17]!==K||e[18]!==X||e[19]!==n?(M=P(s.jsx(ja,{orgSlug:a.slug,virtualMcpId:n,branch:X,decofile:E.data,initialKey:q,compact:!0},K)),e[14]=E.data,e[15]=q,e[16]=a.slug,e[17]=K,e[18]=X,e[19]=n,e[20]=M):M=e[20],M}if(w.kind==="empty"){let C;return e[21]===Symbol.for("react.memo_cache_sentinel")?(C=P(s.jsx(ji,{})),e[21]=C):C=e[21],C}if(w.kind==="error"){let C;e[22]!==E||e[23]!==p||e[24]!==v||e[25]!==w.source?(C=()=>{if(w.source==="sandbox"){p.retry();return}Promise.all([E.refetch(),v.refetch()])},e[22]=E,e[23]=p,e[24]=v,e[25]=w.source,e[26]=C):C=e[26];const q=C;let K;return e[27]!==q||e[28]!==w.source?(K=P(s.jsx(ki,{source:w.source,onRetry:q})),e[27]=q,e[28]=w.source,e[29]=K):K=e[29],K}let N;e[30]===Symbol.for("react.memo_cache_sentinel")?(N=C=>P(s.jsx("div",{className:"h-full min-h-0",children:C})),e[30]=N):N=e[30];const O=N,R=m.state.target;if(R?.kind==="loader"&&E.data&&v.data){const C=o??"",q=x??null;let K;return e[31]!==E.data||e[32]!==v.data||e[33]!==a.slug||e[34]!==C||e[35]!==q||e[36]!==R.key||e[37]!==n?(K=O(s.jsx(Fl,{orgSlug:a.slug,virtualMcpId:n,branch:C,previewUrl:q,meta:v.data,decofile:E.data,blockKey:R.key})),e[31]=E.data,e[32]=v.data,e[33]=a.slug,e[34]=C,e[35]=q,e[36]=R.key,e[37]=n,e[38]=K):K=e[38],K}let _;e[39]!==o||e[40]!==a.slug||e[41]!==R||e[42]!==n?(_=R||!o?null:ar(ir(a.slug,n,o)),e[39]=o,e[40]=a.slug,e[41]=R,e[42]=n,e[43]=_):_=e[43];const A=_;let B="/",L=null,U=null;R?.kind==="page"?(B=R.path,L=R.key):R?.kind==="section"?U=R.key:A&&(B=A.path,L=A.pageKey);const $=L?`page:${L}`:U?`section:${U}`:`path:${B}`;let G;e[44]===Symbol.for("react.memo_cache_sentinel")?(G=s.jsx("div",{className:"h-full flex items-center justify-center",children:s.jsx(Pt,{className:"size-5 text-muted-foreground"})}),e[44]=G):G=e[44];const V=o??"",W=x??void 0,H=U?null:u,J=!!L&&m.state.editSeoPageKey===L;let ae;return e[45]!==U||e[46]!==L||e[47]!==B||e[48]!==$||e[49]!==i||e[50]!==a.slug||e[51]!==H||e[52]!==J||e[53]!==V||e[54]!==W||e[55]!==n||e[56]!==m.consumeEditSeo||e[57]!==m.setFocusedBlock||e[58]!==m.setVariantOverride?(ae=O(s.jsx(S.Suspense,{fallback:G,children:s.jsx(Il,{orgSlug:a.slug,virtualMcpId:n,branch:V,previewReady:!0,previewUrl:W,currentPath:B,activePageBlockKey:L,activeGlobalBlockKey:U,externalSelection:H,initialEditSeo:J,onExitSeo:m.consumeEditSeo,onVariantPreviewOverride:m.setVariantOverride,onFocusedBlockChange:m.setFocusedBlock,onViewJsonFile:i},$)})),e[45]=U,e[46]=L,e[47]=B,e[48]=$,e[49]=i,e[50]=a.slug,e[51]=H,e[52]=J,e[53]=V,e[54]=W,e[55]=n,e[56]=m.consumeEditSeo,e[57]=m.setFocusedBlock,e[58]=m.setVariantOverride,e[59]=ae):ae=e[59],ae}function Ul(t){return s.jsx("div",{"data-testid":"blocks-panel",className:"h-full min-h-0 overflow-hidden",children:t})}function Gs(t){const e=ce.c(39),{virtualMcpId:n,pageKey:r,onClose:i,ref:u}=t,a=Ce(),o=rr(),l=o===!0,d=ii(n);let p;e[0]!==d||e[1]!==r?(p=oi(d,Xi(r)),e[0]=d,e[1]=r,e[2]=p):p=e[2];const m=p,{org:f}=_n(),{currentBranch:x,taskId:b}=Xt(),g=On().previewUrl;let k;e[3]!==x||e[4]!==f.slug||e[5]!==g||e[6]!==b||e[7]!==n?(k=x?{orgSlug:f.slug,virtualMcpId:n,branch:x,threadId:b??null,previewUrl:g}:null,e[3]=x,e[4]=f.slug,e[5]=g,e[6]=b,e[7]=n,e[8]=k):k=e[8];const y=Bn(k),v=x??"";let w;e[9]!==f.slug||e[10]!==v||e[11]!==n?(w={orgSlug:f.slug,virtualMcpId:n,branch:v},e[9]=f.slug,e[10]=v,e[11]=n,e[12]=w):w=e[12];const{save:T,flush:P}=Ea(w),N=y.data?.[r],O=y.data===void 0&&y.isLoading||o===void 0,R=y.data!==void 0&&N===void 0,_=!x||R||O;let A;e[13]!==N?(A=N===void 0?"":JSON.stringify(N,null,2),e[13]=N,e[14]=A):A=e[14];const B=A;let L;e[15]!==r||e[16]!==_||e[17]!==T?(L=H=>{if(_)return;let J;try{J=JSON.parse(H)}catch{return}J===null||typeof J!="object"||Array.isArray(J)||T(r,J)},e[15]=r,e[16]=_,e[17]=T,e[18]=L):L=e[18];const U=L;let $;e[19]!==P?($=()=>({flush:P}),e[19]=P,e[20]=$):$=e[20],S.useImperativeHandle(u,$);let G;e[21]!==m||e[22]!==l||e[23]!==i||e[24]!==a?(G=l?s.jsx("div",{className:"flex shrink-0 items-center border-b px-3 py-2.5",children:s.jsx("span",{title:m,className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:m})}):s.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b px-3 py-2.5",children:[s.jsx("div",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:a("sectionsEditor.pageJsonDialog.titleShort")}),s.jsx(Ie,{variant:"ghost",size:"icon-sm",onClick:i,"aria-label":a("sectionsEditor.pageJsonDialog.close"),className:"shrink-0",children:s.jsx(ha,{size:14})})]}),e[21]=m,e[22]=l,e[23]=i,e[24]=a,e[25]=G):G=e[25];let V;e[26]!==y.data||e[27]!==P||e[28]!==B||e[29]!==O||e[30]!==R||e[31]!==r||e[32]!==_||e[33]!==U||e[34]!==a?(V=O?s.jsx("div",{className:"flex flex-1 items-center justify-center",children:s.jsx(Pt,{className:"size-5 text-muted-foreground"})}):R?s.jsxs("div",{className:"p-4 text-xs font-mono text-foreground/60",children:["// ",a("sectionsEditor.pageJsonDialog.pageNotFound")]}):s.jsx("div",{className:"min-h-0 flex-1",children:s.jsx(Qi,{code:B,language:"json",readOnly:_,height:"100%",onChange:H=>U(H??""),onSave:H=>{U(H),P()}},`${r}:${y.data===void 0?"loading":"ready"}`)}),e[26]=y.data,e[27]=P,e[28]=B,e[29]=O,e[30]=R,e[31]=r,e[32]=_,e[33]=U,e[34]=a,e[35]=V):V=e[35];let W;return e[36]!==G||e[37]!==V?(W=s.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-background",children:[G,V]}),e[36]=G,e[37]=V,e[38]=W):W=e[38],W}function _r(t){return t.contentEditingEnabled&&!t.isMobile}function Vl(t,e){return t!=="visual"?"visual":e?"blocks":"preview"}function Hl(t,e){return t==="blocks"?"preview":e?"blocks":t}function ql(t){return _r({contentEditingEnabled:wr(t.cmsMode),isMobile:t.isMobile})?"blocks":"preview"}function Wl(t){return t.editingMode==="blocks"&&!t.blocksEditingEnabled||t.editingMode==="visual"&&!t.sandboxDisplay?"preview":t.editingMode}function Gl(t){const e=Hi(t),{display:n}=t;let r=null;if(n.mode==="production"&&n.iframeBase)try{r=new URL(t.path,n.iframeBase).href}catch{r=null}const i=qi(r,e);return{value:e,frame:i?Rn(i,t.device):null,newTab:i}}function Jl(t){const e=ce.c(90),{tests:n,options:r,onChange:i,available:u}=t,a=Ce();let o;e[0]!==r?(o=Pr(r),e[0]=r,e[1]=o):o=e[1];const l=o;let d;e[2]!==r.tests?(d=r.tests??{},e[2]=r.tests,e[3]=d):d=e[3];const p=d;let m;e[4]!==i||e[5]!==r?(m=I=>{const ie=I?Ni(I):null,{at:ne,...ee}=r;i(ie?{...ee,at:ie}:ee)},e[4]=i,e[5]=r,e[6]=m):m=e[6];const f=m;let x;e[7]!==p||e[8]!==i||e[9]!==r?(x=(I,ie)=>{const ne={...p};ie==="on"?ne[I]=!0:ie==="off"?ne[I]=!1:delete ne[I];const{tests:ee,...le}=r;i(Object.keys(ne).length>0?{...le,tests:ne}:le)},e[7]=p,e[8]=i,e[9]=r,e[10]=x):x=e[10];const b=x;let j;e[11]!==a?(j=a("sandbox.previewAs.label"),e[11]=a,e[12]=j):j=e[12];let g;e[13]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx($a,{size:16}),e[13]=g):g=e[13];let k;e[14]!==l||e[15]!==j?(k=s.jsx(Wt,{asChild:!0,children:s.jsx(lr,{asChild:!0,children:s.jsx(st,{"aria-label":j,active:l,"data-testid":"preview-as-trigger",children:g})})}),e[14]=l,e[15]=j,e[16]=k):k=e[16];let E;e[17]!==a?(E=a("sandbox.previewAs.label"),e[17]=a,e[18]=E):E=e[18];let y;e[19]!==E?(y=s.jsx(Gt,{children:E}),e[19]=E,e[20]=y):y=e[20];let v;e[21]!==k||e[22]!==y?(v=s.jsxs(Jt,{children:[k,y]}),e[21]=k,e[22]=y,e[23]=v):v=e[23];let w;e[24]!==a?(w=a("sandbox.previewAs.label"),e[24]=a,e[25]=w):w=e[25];let T;e[26]!==w?(T=s.jsx("h3",{className:"text-sm font-medium",children:w}),e[26]=w,e[27]=T):T=e[27];let P;e[28]!==u||e[29]!==a?(P=a(u?"sandbox.previewAs.intro":"sandbox.previewAs.unavailable"),e[28]=u,e[29]=a,e[30]=P):P=e[30];let N;e[31]!==P?(N=s.jsx("p",{className:"text-xs text-muted-foreground",children:P}),e[31]=P,e[32]=N):N=e[32];let O;e[33]!==T||e[34]!==N?(O=s.jsxs("div",{className:"flex flex-col gap-1",children:[T,N]}),e[33]=T,e[34]=N,e[35]=O):O=e[35];let R;e[36]!==a?(R=a("sandbox.previewAs.momentLabel"),e[36]=a,e[37]=R):R=e[37];let _;e[38]!==R?(_=s.jsx(eo,{htmlFor:"preview-as-moment",children:R}),e[38]=R,e[39]=_):_=e[39];let A;e[40]!==r.at?(A=Ei(r.at),e[40]=r.at,e[41]=A):A=e[41];let B;e[42]!==f?(B=I=>f(I.target.value),e[42]=f,e[43]=B):B=e[43];let L;e[44]!==A||e[45]!==B?(L=s.jsx(Tn,{id:"preview-as-moment",type:"datetime-local",className:Ti,value:A,onChange:B}),e[44]=A,e[45]=B,e[46]=L):L=e[46];const U=r.at===void 0;let $;e[47]!==f?($=()=>f(""),e[47]=f,e[48]=$):$=e[48];let G;e[49]!==a?(G=a("sandbox.previewAs.now"),e[49]=a,e[50]=G):G=e[50];let V;e[51]!==U||e[52]!==$||e[53]!==G?(V=s.jsx(Ie,{type:"button",variant:"ghost",size:"sm",disabled:U,onClick:$,children:G}),e[51]=U,e[52]=$,e[53]=G,e[54]=V):V=e[54];let W;e[55]!==L||e[56]!==V?(W=s.jsxs("div",{className:"flex items-center gap-2",children:[L,V]}),e[55]=L,e[56]=V,e[57]=W):W=e[57];let H;e[58]!==a?(H=a("sandbox.previewAs.momentHint"),e[58]=a,e[59]=H):H=e[59];let J;e[60]!==H?(J=s.jsx("p",{className:"text-xs text-muted-foreground",children:H}),e[60]=H,e[61]=J):J=e[61];let ae;e[62]!==_||e[63]!==W||e[64]!==J?(ae=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[_,W,J]}),e[62]=_,e[63]=W,e[64]=J,e[65]=ae):ae=e[65];let C;e[66]!==a?(C=a("sandbox.previewAs.testsLabel"),e[66]=a,e[67]=C):C=e[67];let q;e[68]!==C?(q=s.jsx("span",{className:"text-sm font-medium",children:C}),e[68]=C,e[69]=q):q=e[69];let K;e[70]!==p||e[71]!==b||e[72]!==a||e[73]!==n?(K=n.length===0?s.jsx("p",{className:"text-xs text-muted-foreground",children:a("sandbox.previewAs.noTests")}):s.jsxs(s.Fragment,{children:[s.jsx("ul",{className:"flex flex-col gap-1.5",children:n.map(I=>s.jsxs("li",{className:"flex items-center justify-between gap-2","data-testid":"preview-as-test",children:[s.jsx("span",{className:"min-w-0 truncate text-sm",children:I}),s.jsxs(to,{type:"single",variant:"outline",size:"sm",value:p[I]===void 0?"":p[I]?"on":"off",onValueChange:ie=>b(I,ie),"aria-label":I,children:[s.jsx(Ds,{value:"off",children:a("sandbox.previewAs.off")}),s.jsx(Ds,{value:"on",children:a("sandbox.previewAs.on")})]})]},I))}),s.jsx("p",{className:"text-xs text-muted-foreground",children:a("sandbox.previewAs.testsHint")})]}),e[70]=p,e[71]=b,e[72]=a,e[73]=n,e[74]=K):K=e[74];let X;e[75]!==q||e[76]!==K?(X=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[q,K]}),e[75]=q,e[76]=K,e[77]=X):X=e[77];let M;e[78]!==l||e[79]!==i||e[80]!==a?(M=l&&s.jsx(Ie,{type:"button",variant:"outline",size:"sm",onClick:()=>i({}),children:a("sandbox.previewAs.reset")}),e[78]=l,e[79]=i,e[80]=a,e[81]=M):M=e[81];let Y;e[82]!==O||e[83]!==ae||e[84]!==X||e[85]!==M?(Y=s.jsxs(cr,{className:"flex w-80 flex-col gap-4 p-4",align:"center",sideOffset:8,"data-testid":"preview-as",children:[O,ae,X,M]}),e[82]=O,e[83]=ae,e[84]=X,e[85]=M,e[86]=Y):Y=e[86];let Z;return e[87]!==v||e[88]!==Y?(Z=s.jsxs(dr,{children:[v,Y]}),e[87]=v,e[88]=Y,e[89]=Z):Z=e[89],Z}const Yl=15e3;function Ql(t,e,n){return n?t.src===e||t.loading?t:{src:e,loading:!0}:t.src===e&&!t.loading?t:{src:e,loading:!1}}function Js(t){return t.loading?{...t,loading:!1}:t}const Xl=500,Zl={mobile:{width:412,height:823},tablet:{width:1024,height:1366},desktop:{width:1280,height:800}},Ys=1,Vt=["desktop","mobile","tablet"],ec=["preview","visual","blocks"],Qs={mobile:"sandbox.preview.deviceMobile",tablet:"sandbox.preview.deviceTablet",desktop:"sandbox.preview.deviceDesktop"};function tc(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 yt(t){if(!t)return null;try{return new URL(t,window.location.href).origin}catch{return null}}function Nn(t,e){try{return new URL(t,e).href}catch{return null}}function nc(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 n={path:e.resolvedPath,url:e.draftPreviewUrl};return{pin:n,effective:n.url}}return{pin:t,effective:t?.url??null}}function sc(t,e){return!t||t.nav!==e.nav?!1:t.content!==e.content}function rc(t,e,n){const r=t.toLowerCase(),i=e.toLowerCase(),u=i.split("/").filter(Boolean),a=l=>{if(l===n)return 100;const d=l.indexOf(n);if(d===-1)return 0;let p=40;return d===0?p+=30:/[\s/-]/.test(l[d-1]??"")&&(p+=20),p+=Math.round(n.length/l.length*20),p};let o=Math.max(a(r),a(i));return u.at(-1)===n?o=Math.max(o,95):u.includes(n)&&(o=Math.max(o,90)),o}function ac(t,e){try{t.contentWindow?.location.reload()}catch{e&&(t.src=e)}}function ic({virtualMcpId:t}){const e=Ce(),n=xi(),{currentBranch:r,taskId:i,virtualMcpId:u}=Xt(),a=!!Aa(),o=Sr(),l=Ga(u===t?t:null),d=hr(t),p=so(l?.metadata?.ui?.layout??null),m=wr(p),f=_r({contentEditingEnabled:m,isMobile:n}),[x]=S.useState(()=>ql({cmsMode:p,isMobile:n})),[b,j]=ys(ws.previewEditingMode(t),c=>c&&ec.includes(c)?c:null),g=b??x,[k,E]=ys(ws.previewDeviceSize(t),c=>c&&Vt.includes(c)?c:"desktop"),[y,v]=S.useState(null),[w,T]=S.useState(null),P=S.useRef(null),N=S.useRef(null),[O,R]=S.useState(!1),_=S.useRef(null),A=()=>{_.current?.flush(),R(!1)},B=()=>R(c=>(c&&_.current?.flush(),!c)),[L,U]=S.useState({width:0,height:0}),[$,G]=S.useState(!1),[V,W]=S.useState({}),[H,J]=S.useState(""),ae=S.useRef(null),[C,q]=S.useState(!1),[K,X]=S.useState(),[M,Y]=S.useState(null),[Z,I]=S.useState(null),[ie,ne]=S.useState(null),[ee,le]=S.useState(()=>o.state.target?.kind==="page"?o.state.target.path:"/"),[pe,de]=S.useState(()=>o.state.target?.kind==="page"?o.state.target.key:null),[be,fe]=S.useState({}),[je,ye]=S.useState(!1),we=S.useRef(null),De=()=>{ye(!0),we.current&&clearTimeout(we.current),we.current=setTimeout(()=>ye(!1),15e3)},at=()=>{we.current&&(clearTimeout(we.current),we.current=null),ye(!1)},{org:ue}=_n(),Ae=kr(),Be=On(),Fe=Be.vmEntry,_e=Ae.lifecycle.phase,{url:it,undecided:qe}=li(t),oe=Dn(t,r),{connection:Ee}=vr(t),Re=Zi(t),Me=ci({hasServeConnection:!!Ee,runtime:d.runtime}),Q=qe||Me==="github"&&(Re==="loading"||Re==="error"),se=!nt(oe)&&!Q&&!(Me==="github"&&oe.kind==="pending"),ve=Ve(oe)??it,$e=ve??Be.previewUrl,ot=!!ve||_e==="running",We=l?.id===t?Qa(l.metadata):null,lt=!ve&&!qe&&l?.id===t&&d.runtime==="cms",Or=d.projectDefault==="cms",ct=se?Ui({sandboxUrl:$e,previewServerUrl:We,fastPreviewActive:lt}):null,$n=t&&r?{orgSlug:ue.slug,virtualMcpId:t,branch:r,threadId:i??null,previewUrl:$e}:null,zn=Bn($n,{fetchEnabled:ot}),Zt=xr($n,{fetchEnabled:ot}),re=zn.data,xe=Zt.data,Ge=re?Oi(re,xe).sort((c,h)=>c.name.localeCompare(h.name)):[],Kn=t&&r?{orgSlug:ue.slug,virtualMcpId:t,branch:r}:null,In=Dl(Kn),en=re&&xe?Di(re,xe):[],Un=se&&re&&xe?Na(xe,re,"loaders"):[],Vn=H?(()=>{const c=H.toLowerCase();return Ge.map(h=>({page:h,score:rc(h.name,h.path,c)})).filter(({score:h})=>h>0).sort((h,D)=>D.score-h.score||h.page.path.length-D.page.path.length).map(({page:h})=>h)})():Ge,Hn=en.filter(c=>{if(!H)return!0;const h=H.toLowerCase();return c.name.toLowerCase().includes(h)||c.key.toLowerCase().includes(h)||c.resolveType.toLowerCase().includes(h)}),qn=f?Un:[],Wn=qn.filter(c=>{if(!H)return!0;const h=H.toLowerCase();return c.title.toLowerCase().includes(h)||c.key.toLowerCase().includes(h)||c.resolveType.toLowerCase().includes(h)}),jt=Z?Un.find(c=>c.key===Z)??null:null,Le=Fn,tn=M||Z?null:Bi(Ge,ee,pe),te=tn?.key??null,Je=o.state.target?.kind==="section"?o.state.target.key:o.state.focusedBlockKey??te,Et=tn?.path??null,Ye=(te?be[te]:void 0)??{},ke=Ke(ee,Ye),nn={};if(se&&ot&&$e&&xe&&re){const c=Ta(xe,"loaders"),h=te?re[te]:void 0,D=nl(h,re,me=>c.has(me)),z=Qo(D);for(const me of St(ee)){if(me.type!=="param")continue;const Oe=Go(ee,me.name,D),Pe=el(Oe,c,z);Pe.length>0&&(nn[me.name]=Pe)}}const Nt=t&&r?{orgSlug:ue.slug,virtualMcpId:t,branch:r,threadId:i??null}:null,Gn=re&&te?Fi(re,te,0):[],Jn=nt(oe),Yn=re?Mi(Gn,re,Jn):[],sn=Yn.map(c=>c.isSavedBlock?c.label:""),rn=Yn.map(c=>c.isSavedBlock?"global":c.isMultivariate?"variant":"normal"),an=Gn.map(c=>Ln(c,re??{},Jn)),Tt=S.useRef(null),Ne=S.useRef(null),Dr=Ae.status.state==="paused",on=Ae.phase,Qn=Ca({claimPhase:on,lifecycle:Ae.lifecycle}),Ue=Be.previewState,Br=Be.userStopped,Fr=di(ue.slug,t??""),{url:ze}=Wi(lt&&t&&r?{orgSlug:ue.slug,virtualMcpId:t,branch:r,previewServerUrl:We??null,path:ke}:null),Mr=Or&&d.runtime==="sandbox",Se=ui(oe,Me,Re),Xn=fi(Se&&lt&&oe.kind==="protocol"&&t&&r?{orgSlug:ue.slug,virtualMcpId:t,branch:r}:null),Zn=Se?Xn.pointer:null,F=Lo({previewState:Ue,progressStatus:Qn.status,previewServerUrl:We,fastPreviewActive:lt,fastPreviewReady:!!ze,codingSession:Mr,localPreviewUrl:ve,hostedDraft:Se,hostedPointerPending:Se&&(oe.kind==="pending"||Xn.pending),deciding:Q}),es=F.showWakingPill||Se&&F.mode==="production"&&!Zn,dt=F.mode!=="none",$r=F.mode==="production"&&F.iframeBase?yt(F.iframeBase):null,Qe=F.mode==="production"?$r:yt($e),zr=l?.id===t&&l.metadata?.fastPreviewInPlace===!0,ut=se?ve?F.mode==="sandbox"&&f&&g==="blocks":F.mode==="production"&&lt&&zr&&f&&g==="blocks":!1,ts=S.useRef(null),{pin:Kr,effective:Ir}=nc(ts.current,{inPlaceRenderActive:ut,draftPreviewUrl:ze,resolvedPath:ke});ts.current=Kr;const ns=o.state.variantOverride??[],Ct=se?ns:[],ft=se?[]:ns,ln=nt(oe)&&$i.some(c=>zi(xe,c)==="available"),Xe=ln?V:{},ss=Pr(Xe),Ur=ln&&re?Object.keys(Ki(re).experiments):[],Rt=Se?Gl({display:F,path:ke,pointer:Zn,device:k,forcedVariants:ft,previewOptions:Xe}):null,Ze=t?js(ue.slug,t):null,rs=JSON.stringify([ft,Xe]);S.useEffect(()=>{if(!Se||!Ze)return;const[c,h]=JSON.parse(rs);As(Ze,{forcedVariants:c,previewOptions:h})},[Se,Ze,rs]),S.useEffect(()=>{if(!(!Se||!Ze))return()=>As(Ze,null)},[Se,Ze]);const cn=Ee&&Ve(oe)?yi(Ee.endpoint,ft,ss):null,Vr=Ee&&Ve(oe)?cn?no(cn,Xe):Cs:null,et=tc(F.mode==="sandbox"?zt(Rn(Rs(ie??Nn(ke,F.iframeBase)??F.iframeBase,Vr),k),Ct):F.mode==="production"&&Rt?.frame?Rt.frame:F.mode==="production"?zt(Rn(Bs(Ns(Rs(ie??Ir??Nn(ke,F.iframeBase)??F.iframeBase,es?Cs:null),ft),Xe),k),Ct):null),as=ze??(F.iframeBase?Nn(ke,F.iframeBase):null),is=F.mode==="production"&&Rt?Rt.newTab:F.mode==="production"?as?zt(Bs(Ns(as,ft),Xe),Ct):null:et??F.iframeBase,Hr=()=>{const c=is;c&&window.open(c,"_blank","noopener")},mt=t&&r?ir(ue.slug,t,r):null,pt=c=>{mt&&Oa(mt,c)},he=o.state.target;S.useEffect(()=>{if(!(!he||!ct||!xe))if(he.kind==="page"){const c=be[he.key]??{};Ne.current=Ke(he.path,c),Y(null),I(null),ne(null),de(he.key),le(he.path),pt({path:he.path,pageKey:he.key,params:c})}else if(he.kind==="loader")Ne.current=null,Y(null),I(he.key),ne(null);else{const c=en.find(h=>h.key===he.key);if(c){Ne.current=null;const h=Ts(xe);I(null),Y(c),ne(Ls(ct,h,c.key))}}},[he,ct,xe,be]),S.useEffect(()=>{!te||Et===null||he?.kind==="page"&&he.key===te&&he.path===Et||o.selectTarget({kind:"page",key:te,path:Et})},[te,Et,he]);const[os,qr]=S.useState(null);if(Ue.kind==="iframe"&&os!==Ue.previewUrl){const c=os!==null;qr(Ue.previewUrl);const h=mt?ar(mt):null;if(h){if(Ne.current=Ke(h.path,h.params),le(h.path),de(h.pageKey),ne(null),Y(null),I(null),h.pageKey&&Object.keys(h.params).length>0){const D=h.pageKey;fe(z=>({...z,[D]:h.params}))}}else c&&(Ne.current=null,le("/"),ne(null),de(null),Y(null),I(null))}Tt.current=et;const Wr=F.mode==="production"&&!!ze&&!ve,[ls,dn]=S.useState({src:et??void 0,loading:!1}),Lt=Ql(ls,et??void 0,Wr);Lt!==ls&&dn(Lt);const ht=Lt.src,cs=Lt.loading,ds=Do({iframeRef:P,src:F.mode==="sandbox"?et:null,active:F.mode==="sandbox"}),us=S.useRef(null);S.useEffect(()=>{const c=cs?setTimeout(()=>dn(Js),Yl):null,h=()=>{c&&clearTimeout(c)};if(!ze||!ht||us.current===ze)return h;us.current=ze;const D=P.current;return D&&D.getAttribute("src")!==ht&&(De(),D.src=ht),h},[ze,ht,cs]);const fs=()=>{const c=P.current?.contentWindow,h=Qe;if(!c||!h||!re||!te)return;const D=re[te];if(!D||typeof D!="object")return;const z=Vi({previewBaseUrl:h,pageBlock:D,decofile:re,path:ke,pathTemplate:ee});if(!z)return;const me=zt(z.src,bi(Ct,te));c.postMessage({type:"cms-editor::render",src:me,body:z.body},h)},un=S.useRef(null);S.useEffect(()=>{if(!ut||M||Z||!te||!re){un.current=null;return}const c={nav:JSON.stringify({page:te,path:ke,pathTemplate:ee}),content:JSON.stringify(re)},h=sc(un.current,c);un.current=c,h&&fs()},[re,ut,M,Z,te,ke,ee]);const fn=S.useRef(null);S.useEffect(()=>{if(!ut||M||Z||!te||!re){fn.current=null;return}const c=JSON.stringify(o.state.variantOverride??null),h=fn.current;fn.current={page:te,sig:c},!(!h||h.page!==te||h.sig===c)&&fs()},[o.state.variantOverride,ut,M,Z,te]);const Gr=!!t&&!!r&&!Ae.notFound&&!Br&&!Dr&&(on?.kind==="ready"||_e!=="idle"),ge=Wl({editingMode:g,sandboxDisplay:F.mode==="sandbox",blocksEditingEnabled:f});S.useEffect(()=>{const c=Qe;if(!c)return;const h=D=>{if(D.origin===c)if(D.data?.type==="visual-editor::element-clicked"){const z=$o.safeParse(D.data.payload);z.success&&v(z.data)}else if(D.data?.type==="cms-editor::section-clicked"){const z=Io.safeParse(D.data.payload);z.success&&T({index:z.data.sectionIndex,seq:z.data.clickSeq})}else D.data?.type==="cms-editor::render-start"?De():D.data?.type==="cms-editor::render-end"?(at(),P.current?.contentWindow?.postMessage({type:"cms-editor::set-labels",labels:sn,kinds:rn,keys:an},c)):D.data?.type==="cms-editor::render-error"&&at()};return window.addEventListener("message",h),()=>window.removeEventListener("message",h)},[Qe,sn,rn,an]);const ms=()=>{const c=P.current?.contentWindow,h=yt($e);!c||!h||c.postMessage({type:"visual-editor::activate",script:zo},h)},Jr=()=>{const c=P.current?.contentWindow,h=yt($e);!c||!h||c.postMessage({type:"visual-editor::deactivate"},h)},mn=()=>{const c=P.current?.contentWindow,h=Qe;!c||!h||(c.postMessage(F.mode==="production"||ve?{type:"editor::inject",args:{script:Is}}:{type:"visual-editor::activate",script:Is},h),c.postMessage({type:"cms-editor::set-labels",labels:sn,kinds:rn,keys:an},h))},Yr=()=>{const c=P.current?.contentWindow,h=Qe;!c||!h||c.postMessage({type:"cms-editor::deactivate"},h)},Qr=()=>{const c=P.current?.contentWindow,h=Qe;!c||!h||(c.postMessage({type:"cms-editor::clear-hover"},h),c.postMessage({type:"visual-editor::clear-hover"},h))},At=c=>{if(c==="blocks"&&!f)return;const h=g;!n&&c!==h&&(c==="blocks"?N.current?.resize("30%"):N.current?.collapse()),j(c),v(null),T(null),c!=="blocks"&&I(null),h==="visual"&&Jr(),c==="visual"&&ms(),h==="blocks"&&c!=="blocks"&&Yr(),c==="blocks"&&mn()},Xr=()=>{At(Vl(g,f))},Zr=()=>{At(Hl(g,f))},pn=()=>{const c=P.current;if(!c)return;De();const h=document.activeElement,D=c.tabIndex;c.tabIndex=-1,c.style.pointerEvents="none",c.blur(),ac(c,Tt.current);let z;const me=()=>{clearTimeout(z),c.tabIndex=D,c.style.pointerEvents="";const Oe=document.activeElement;(!Oe||Oe===document.body||Oe===c)&&h?.focus(),c.removeEventListener("load",me)};c.addEventListener("load",me),z=setTimeout(me,3e3)};Ji(pn);const _t=js(ue.slug,t??""),Ot=Se&&dt&&!!t,ps=S.useRef(null);S.useEffect(()=>{if(Ot)return mi(_t)},[Ot,_t]);const{reload:gt}=pi(ue.slug,t??""),hs=S.useRef(gt.seq);S.useEffect(()=>{if(hs.current!==gt.seq&&(hs.current=gt.seq,!!Ot&&ps.current===Tt.current)){if(gt.navigates){Es(_t);return}pn()}},[gt.seq]);const ea=hi(Kn),vt=gi(Ve(oe)?ea:""),gs=S.useRef(vt);S.useEffect(()=>{const c=gs.current;if(gs.current=vt,!c||!vt||c===vt)return;const h=P.current;if(h)return Mo({iframe:h,reload:pn})},[vt]);const ta=()=>{const c=Vt.indexOf(k);E(Vt[(c+1)%Vt.length])},hn=(c,h)=>{if(!te)return;const D=te,z={...Ye,[c]:h};Ne.current=Ke(ee,z),fe(me=>({...me,[D]:z})),pt({path:ee,pageKey:D,params:z})},na=Rl({iframeBase:F.iframeBase,resolvedPath:ke,activeGlobalSectionName:M?.name??null,noServerLabel:e("sandbox.preview.noServerRunning")}),gn=c=>{const h=be[c.key]??{},D=Ke(c.path,h);(M||Le(D)!==Le(ke))&&De(),Ne.current=D,Y(null),I(null),ne(null),T(null),de(c.key),le(c.path),pt({path:c.path,pageKey:c.key,params:h}),o.selectTarget({kind:"page",key:c.key,path:c.path})};_a(mt,c=>{(M||Le(c)!==Le(ke))&&De(),Ne.current=c,Y(null),I(null),ne(null),T(null),de(null),le(c),pt({path:c,pageKey:null,params:{}})});const sa=c=>{if(nt(oe)){const z=re?Ii(re,c.key,xe):null;z?gn(z):yn.info(e("sandbox.preview.blockOnNoPage"));return}if(!ct||!xe){yn.error(e("sandbox.preview.previewMetadataNotReady"));return}De(),Ne.current=null;const h=Ts(xe),D=Ls(ct,h,c.key);Y(c),I(null),ne(D),T(null),o.selectTarget({kind:"section",key:c.key})},ra=c=>{f&&(Y(null),I(c.key),ne(null),At("blocks"),o.selectTarget({kind:"loader",key:c.key}))},aa=async({name:c,path:h,templateKey:D})=>{if(!t||!r)return;const z=yr(h);if(z){X(z);return}const me=h.trim().startsWith("/")?h.trim():`/${h.trim()}`;if(Ge.some(Pe=>Le(Pe.path)===Le(me))){X(e("sandbox.preview.pageAlreadyExists",{path:me}));return}let Oe;if(D&&(Oe=re?.[D],!Oe)){X(e("sandbox.preview.templateNoLongerExists"));return}X(void 0);try{const Pe=await In.mutateAsync({name:c,path:me,template:Oe,schema:nt(oe)?{meta:xe,loadMeta:async()=>(await Zt.refetch()).data}:void 0});q(!1),yn.success(e("sandbox.preview.pageCreated",{name:c})),await ro(Xl),gn({key:Pe.key,name:Pe.name,path:Pe.path}),At("blocks")}catch(Pe){X(Pe instanceof Ar?e("sandbox.preview.pageSchemaNotReady"):Pe instanceof Error?Pe.message:e("sandbox.preview.failedToCreatePage"))}},Dt=Ll({previewSurfaceActive:dt,daemonReady:Gr,production:F.mode==="production",servePreviewUrl:Ve(oe)}),ia=Al({showPreviewToolbar:Dt,contentEditingEnabled:m}),Bt=()=>{G(!1),J("")},vn=M?.name??jt?.title??tn?.name,xn=zn.isPending||Zt.isPending,bn=xn?yt(F.iframeBase):vn,Ft=M?`section:${M.key}`:Z?`loader:${Z}`:te?`page:${te}`:void 0,oa=Dt?ia?s.jsxs(dr,{open:$,onOpenChange:c=>{G(c),c||J("")},children:[s.jsx(lr,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":e("sandbox.preview.choosePage"),"data-testid":"preview-page-picker",title:xn?bn??void 0:M||jt?vn:[vn,ee].filter(Boolean).join(" · "),className:"group/page-picker flex h-7 w-fit min-w-[320px] items-stretch overflow-hidden whitespace-nowrap rounded-[var(--studio-button-radius,calc(var(--radius)*1.333))] border border-border/60 bg-background text-left text-xs text-muted-foreground transition-colors hover:border-border focus-ring",children:s.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:[M&&s.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded bg-global-section/14 px-1.5 py-0.5 text-2xs font-medium text-global-section-fg dark:text-global-section-fg-dark",children:[s.jsx(za,{size:11}),e("sandbox.preview.globalBadge")]}),jt&&s.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded bg-muted px-1.5 py-0.5 text-2xs font-medium text-muted-foreground",children:[s.jsx(Ka,{size:11}),e("sandbox.preview.loaderBadge")]}),bn&&s.jsx("span",{className:"min-w-0 flex-1 truncate font-medium text-foreground",children:bn}),!xn&&!M&&!jt&&s.jsx("span",{"data-testid":"preview-page-path",className:"ml-auto min-w-0 truncate text-right font-mono text-muted-foreground",children:ee}),s.jsx(Da,{size:12,className:Ht("shrink-0 transition-transform",$&&"rotate-180")})]})})}),s.jsxs(cr,{className:"w-112 max-w-[calc(100vw-2rem)] p-0",align:"center",sideOffset:8,children:[s.jsxs(fr,{shouldFilter:!1,defaultValue:Ft,children:[s.jsx(mr,{value:H,onValueChange:c=>{J(c),ae.current?.scrollTo({top:0})},placeholder:e("sandbox.preview.searchPagesAndComponents")}),s.jsxs(ur,{ref:ae,className:"max-h-80",children:[s.jsx(pr,{children:Ge.length===0&&en.length===0&&qn.length===0?e("sandbox.preview.noPagesFound"):e("sandbox.preview.noSearchResults")}),Vn.length>0&&s.jsx(wt,{children:Vn.map(c=>s.jsxs(kt,{value:`page:${c.key}`,"aria-current":Ft===`page:${c.key}`||void 0,title:`${c.name} · ${c.path}`,onSelect:()=>{Bt(),gn(c)},className:"gap-3 px-3 py-2.5 aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",children:[s.jsx("span",{className:"min-w-0 flex-1 truncate text-sm",children:c.name}),s.jsx("span",{className:"min-w-0 max-w-1/2 truncate text-right font-mono text-xs text-muted-foreground",children:c.path})]},c.key))}),Hn.length>0&&s.jsx(wt,{heading:e("sandbox.preview.globalComponents"),children:Hn.map(c=>s.jsx(kt,{value:`section:${c.key}`,"aria-current":Ft===`section:${c.key}`||void 0,className:"aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",onSelect:()=>{Bt(),sa(c)},children:s.jsx("span",{className:"truncate",children:c.name})},c.key))}),Wn.length>0&&s.jsx(wt,{heading:e("sandbox.preview.globalLoaders"),children:Wn.map(c=>s.jsx(kt,{value:`loader:${c.key}`,"aria-current":Ft===`loader:${c.key}`||void 0,className:"aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",onSelect:()=>{Bt(),ra(c)},children:s.jsx("span",{className:"truncate",children:c.title})},c.key))})]})]}),!M&&!Z&&St(ee).some(c=>c.type!=="text")&&s.jsx("div",{className:"flex flex-wrap items-center gap-1 border-t px-3 py-3 text-xs text-muted-foreground",children:St(ee).map((c,h)=>{if(c.type==="text")return s.jsx("span",{children:c.text},`text-${h}`);const D=nn[c.name];return D&&Nt?s.jsx(vl,{sources:D,template:ee,paramName:c.name,value:Ye[c.name]??"",sandboxRef:Nt,onCommit:z=>hn(c.name,z)},`${te}:${c.name}`):s.jsx(Tl,{name:c.name,value:Ye[c.name]??"",onCommit:z=>hn(c.name,z)},`${te}:${c.name}`)})}),s.jsx("div",{className:"border-t p-1.5",children:s.jsxs(Ie,{variant:"ghost",className:"w-full justify-start",onClick:()=>{Bt(),X(void 0),q(!0)},children:[s.jsx(Wa,{size:16}),e("sandbox.preview.createNewPage")]})})]})]}):s.jsx("span",{className:"min-w-0 truncate text-xs text-muted-foreground",children:na}):null,vs=Dt||m?s.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[s.jsxs(Jt,{children:[s.jsx(Wt,{asChild:!0,children:s.jsx(st,{onClick:ta,"aria-label":e(Qs[k]),children:k==="mobile"?s.jsx(Ia,{size:16}):k==="tablet"?s.jsx(Ua,{size:16}):s.jsx(Va,{size:16})})}),s.jsx(Gt,{children:e(Qs[k])})]}),oa,s.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[ln&&s.jsx(Jl,{tests:Ur,options:V,onChange:W,available:!!cn||!es||!ss}),s.jsx(st,{onClick:Hr,disabled:Se&&!is,"aria-label":e("sandbox.preview.openInNewTab"),children:s.jsx(ga,{size:16})})]})]}):null,la=(se||a)&&F.mode==="sandbox",Mt=Zl[k],$t=k==="desktop"&&(L.width===0||L.width>=Mt.width+2*Ys),xs=$t?1:Math.min(L.width>0?L.width/(Mt.width+2*Ys):1,1),ca=$t?{width:"100%",height:"100%"}:{width:`${Mt.width}px`,height:L.height>0?`${L.height/xs}px`:`${Mt.height}px`,transform:`scale(${xs})`,transformOrigin:"top center"},bs=s.jsxs(s.Fragment,{children:[la&&(Dt||m)&&s.jsx(st,{onClick:Xr,"aria-pressed":ge==="visual","aria-label":e("sandbox.preview.visualEditor"),active:ge==="visual",children:s.jsx(Ps,{size:16})}),f&&s.jsxs(Jt,{children:[s.jsx(Wt,{asChild:!0,children:s.jsx(st,{onClick:Zr,"aria-pressed":ge==="blocks","aria-label":e("sandbox.preview.blocksEditor"),active:ge==="blocks",children:s.jsx(qa,{size:16})})}),s.jsx(Gt,{children:e("sandbox.preview.blocksEditor")})]}),Je&&s.jsxs(Jt,{children:[s.jsx(Wt,{asChild:!0,children:s.jsx(st,{onClick:B,"aria-pressed":O,"aria-label":e("sectionsEditor.sectionsEditor.viewJson"),active:O,children:s.jsx(Ha,{size:16})})}),s.jsx(Gt,{children:e("sectionsEditor.sectionsEditor.viewJson")})]})]}),da=!!Z&&ge==="blocks";return s.jsxs("div",{className:"flex flex-col w-full h-full",children:[Nt&&Object.entries(nn).map(([c,h])=>(Ye[c]??"")===""?s.jsx(El,{sources:h,template:ee,paramName:c,sandboxRef:Nt,onFill:D=>hn(c,D)},`${te}:${c}`):null),s.jsxs(s.Fragment,{children:[s.jsx(ks.Toolbar.Center.Portal,{fallback:s.jsx("div",{className:"flex min-w-0 items-center justify-center border-b p-2",children:vs}),children:vs}),s.jsx(ks.Toolbar.Right.Portal,{fallback:bs,children:bs})]}),s.jsx("div",{className:"flex-1 overflow-hidden relative",children:da?s.jsxs("div",{className:"relative h-full min-h-0 overflow-hidden",children:[s.jsx(Ws,{virtualMcpId:t,externalSelection:w,onViewJsonFile:B}),O&&Je&&s.jsx("div",{className:"absolute inset-0 z-10",children:s.jsx(Gs,{ref:_,virtualMcpId:t,pageKey:Je,onClose:A})})]}):s.jsxs(_s,{orientation:"horizontal",disabled:ge!=="blocks",className:"relative isolate",children:[s.jsx(Kt,{ref:N,id:"preview-blocks-editor",defaultSize:ge==="blocks"?"30%":"0%",minSize:"20%",collapsible:!0,collapsedSize:"0%",className:"min-w-0 overflow-hidden",children:ge==="blocks"&&s.jsx(Ws,{virtualMcpId:t,externalSelection:w,onViewJsonFile:B})}),ge==="blocks"&&s.jsx(Os,{withHandle:!0}),s.jsx(Kt,{id:"preview-canvas",defaultSize:ge==="blocks"?"70%":"100%",minSize:"35%",className:"min-w-0 overflow-hidden relative z-0",children:s.jsxs(_s,{orientation:"horizontal",disabled:!(O&&Je),children:[s.jsx(Kt,{id:"preview-canvas-inner",minSize:"30%",className:"min-w-0 overflow-hidden",children:s.jsxs("div",{ref:c=>{if(!c)return;const h=()=>U(z=>z.width===c.clientWidth&&z.height===c.clientHeight?z:{width:c.clientWidth,height:c.clientHeight});h();const D=new ResizeObserver(h);return D.observe(c),()=>D.disconnect()},className:Ht("h-full relative overflow-clip flex justify-center",dt&&!$t&&"bg-muted/30"),children:[(je||Fr)&&dt&&s.jsx("div",{className:"absolute inset-x-0 top-0 z-40 h-1 overflow-hidden",children:s.jsx("div",{className:"absolute inset-y-0 left-0 rounded-r-full bg-brand shadow-[0_0_6px] shadow-brand/60 animate-preview-ramp"})}),F.showDecidingLoader&&s.jsx("div",{"data-testid":"preview-deciding",className:"absolute inset-0 z-30 flex items-center justify-center",children:s.jsx(Pt,{className:"size-5 text-muted-foreground"})}),F.showBlockingOverlay&&s.jsx("div",{className:"absolute inset-0 z-30",children:s.jsx(kn,{kind:"starting",progress:Qn,claimPhase:on})}),!ve&&!Q&&Ue.kind==="suspended"&&s.jsx("div",{className:"absolute inset-0 z-30",children:s.jsx(kn,{kind:"suspended",onResume:Be.resume})}),!ve&&!Q&&Ue.kind==="errored"&&s.jsx("div",{className:"absolute inset-0 z-30",children:s.jsx(kn,{kind:"errored",error:Ue.error,onRetry:Be.retry,connectionsHref:`/${ue.slug}/settings/connections`})}),F.showWakingPill&&s.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 bg-muted px-4 py-3 shadow-soft pointer-events-none select-none",children:[s.jsx(Pt,{className:"size-4.5 mt-0.5 shrink-0 text-muted-foreground"}),s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("span",{className:"text-sm font-medium text-foreground",children:e("sandbox.preview.startingPreview")}),s.jsx("span",{className:"text-xs text-muted-foreground",children:e("sandbox.preview.startingPreviewHint")})]})]}),ge==="visual"&&!y&&s.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-special/40 bg-special/90 px-3 py-1 text-xs font-medium text-special-foreground shadow-soft backdrop-blur-sm pointer-events-none select-none",children:[s.jsx(Ps,{size:12}),e("sandbox.preview.clickElementToAsk")]}),ge==="visual"&&y&&s.jsx(Ho,{element:y,onDismiss:()=>v(null)}),dt&&et&&s.jsx("div",{className:Ht("shrink-0",!$t&&"bg-background shadow-edge"),style:ca,onMouseLeave:Qr,children:s.jsx("iframe",{ref:P,src:ht,className:"w-full h-full border-0",title:e("sandbox.preview.devServerPreviewTitle"),onError:ds.handleError,onLoad:()=>{if(dn(Js),ds.handleLoad(),at(),ps.current=Tt.current,Ot&&Es(_t),F.mode!=="sandbox"||ve){(F.mode==="production"&&!F.showWakingPill||ve)&&ge==="blocks"&&mn();return}if(va("vm_preview_loaded",{view_mode:ge,vm_id:Fe?.sandboxHandle??null}),!M)try{const c=P.current?.contentWindow?.location?.pathname;if(!c)return;const h=Ne.current;if(h!==null&&(Ne.current=null,Le(c)!==Le(h))||Le(c)===Le(ke))return;le(c),pt({path:c,pageKey:pe,params:Ye})}catch{}ge==="visual"&&ms(),ge==="blocks"&&mn()}},F.iframeBase)})]})}),O&&Je&&s.jsxs(s.Fragment,{children:[s.jsx(Os,{withHandle:!0}),s.jsx(Kt,{id:"preview-json-editor",defaultSize:"43%",minSize:"20%",className:"min-w-0 overflow-hidden",children:s.jsx(Gs,{ref:_,virtualMcpId:t,pageKey:Je,onClose:A})})]})]})})]})}),s.jsx(Bl,{open:C,onOpenChange:q,isPending:In.isPending,error:K,templates:Ge,onSubmit:aa})]})}const oc=async(t,e)=>{try{return await fetch(t,{method:"HEAD",mode:"no-cors",cache:"no-store",credentials:"omit",signal:e}),!0}catch{return!1}},lc=1e4,cc=1e4,dc=5e3,uc=2;function fc(t,e){return t&&e===0?cc:Math.min(1e3*2**Math.max(0,e-1),dc)}function mc(t,e,n){return e?!0:t===!0&&n<uc}function pc(t,e){const n=ce.c(11),r=oc,i=xa();let u;n[0]!==t?(u=er.localAppReachable(t??""),n[0]=t,n[1]=u):u=n[1];const a=u;let o;n[2]!==r||n[3]!==i||n[4]!==a||n[5]!==t?(o=async m=>{const{signal:f}=m,x=new AbortController,b=()=>x.abort();f.addEventListener("abort",b);const j=setTimeout(b,lc),g=await r(t,x.signal).catch(gc);clearTimeout(j),f.removeEventListener("abort",b);const k=i.getQueryData(a),E=g?0:(k?.failures??0)+1;return{up:mc(k?.up??null,g,E),failures:E}},n[2]=r,n[3]=i,n[4]=a,n[5]=t,n[6]=o):o=n[6];const l=!!t;let d;n[7]!==a||n[8]!==o||n[9]!==l?(d={queryKey:a,queryFn:o,enabled:l,retry:!1,staleTime:0,gcTime:0,refetchInterval:hc},n[7]=a,n[8]=o,n[9]=l,n[10]=d):d=n[10];const{data:p}=ba(d);return t?p?.up??null:null}function hc(t){return t.state.data?fc(t.state.data.up,t.state.data.failures):!1}function gc(){return!1}function vc(t){const{backend:e}=t;if(e.kind==="protocol"&&e.source==="local")return{kind:"connected"};if(e.kind==="unavailable"&&e.source==="local"){const n=e.problem;return!n||n.reason==="not-answering"?t.access==="denied"?{kind:"needs-permission"}:{kind:"not-running"}:{kind:"problem",problem:n}}return{kind:"connecting"}}function pd(t){const e=ce.c(48),{virtualMcpId:n}=t,r=Ce(),i=Ja(n),{connection:u}=vr(n),{activeTask:a,taskId:o,currentBranch:l}=Xt(),d=ho(o),[p,m]=S.useState(!1),f=Dn(n,l);let x;e[0]!==f||e[1]!==u?(x=u?Ve(f):null,e[0]=f,e[1]=u,e[2]=x):x=e[2];const b=x,j=pc(b),g=Er();if(oo({threadId:o,sandboxBranch:a?.branch??l,agentHasRepo:Sn(i?.metadata),threadHasRepo:Sn(d)||Sn(a?.metadata)})==="none"&&!u){let y;e[3]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("div",{className:"flex size-14 items-center justify-center rounded-full bg-muted",children:s.jsx(Fs,{className:"size-7 text-foreground"})}),e[3]=y):y=e[3];let v;e[4]!==r?(v=r("mainPanelTabs.previewTab.noSourceToPreview"),e[4]=r,e[5]=v):v=e[5];let w;e[6]!==r?(w=r("mainPanelTabs.previewTab.connectGithubDescription"),e[6]=r,e[7]=w):w=e[7];let T,P;e[8]===Symbol.for("react.memo_cache_sentinel")?(T=()=>m(!0),P=s.jsx(Fs,{className:"size-4"}),e[8]=T,e[9]=P):(T=e[8],P=e[9]);let N;e[10]!==r?(N=r("mainPanelTabs.previewTab.connectGithub"),e[10]=r,e[11]=N):N=e[11];let O;e[12]!==N?(O=s.jsxs(Ie,{onClick:T,children:[P,N]}),e[12]=N,e[13]=O):O=e[13];let R;e[14]!==v||e[15]!==w||e[16]!==O?(R=s.jsx(ao,{className:"h-full",image:y,title:v,description:w,actions:O}),e[14]=v,e[15]=w,e[16]=O,e[17]=R):R=e[17];let _;e[18]!==p?(_=s.jsx(io,{open:p,onOpenChange:m,mode:"agent"}),e[18]=p,e[19]=_):_=e[19];let A;return e[20]!==_||e[21]!==R?(A=s.jsxs(s.Fragment,{children:[R,_]}),e[20]=_,e[21]=R,e[22]=A):A=e[22],A}if(u&&i&&!Ve(f)){let y;e[23]!==g||e[24]!==f?(y=vc({backend:f,access:g}),e[23]=g,e[24]=f,e[25]=y):y=e[25];let v;e[26]!==u.endpoint?(v=vi(u.endpoint),e[26]=u.endpoint,e[27]=v):v=e[27];let w;return e[28]!==y||e[29]!==v?(w=s.jsx(bc,{status:y,host:v}),e[28]=y,e[29]=v,e[30]=w):w=e[30],w}if(b&&j!==!0){let y;e[31]!==r?(y=r("mainPanelTabs.previewTab.localAppWaiting.title"),e[31]=r,e[32]=y):y=e[32];let v;e[33]!==b||e[34]!==r?(v=r("mainPanelTabs.previewTab.localAppWaiting.body",{host:xc(b)}),e[33]=b,e[34]=r,e[35]=v):v=e[35];let w;e[36]!==v?(w=s.jsx(Yt,{text:v}),e[36]=v,e[37]=w):w=e[37];let T;e[38]!==r?(T=r("mainPanelTabs.previewTab.localAppWaiting.hint"),e[38]=r,e[39]=T):T=e[39];let P;e[40]!==T?(P=s.jsx("p",{role:"status",className:"text-center text-sm text-muted-foreground",children:T}),e[40]=T,e[41]=P):P=e[41];let N;return e[42]!==y||e[43]!==w||e[44]!==P?(N=s.jsx(Qt,{headingLevel:2,waiting:!0,title:y,lead:w,footer:P}),e[42]=y,e[43]=w,e[44]=P,e[45]=N):N=e[45],N}let E;return e[46]!==n?(E=s.jsx(Ra,{children:s.jsx(ic,{virtualMcpId:n})}),e[46]=n,e[47]=E):E=e[47],E}function xc(t){try{return new URL(t).host}catch{return t}}function bc(t){const e=ce.c(20),{status:n,host:r}=t,i=Ce();if(n.kind==="connected"){let o;e[0]!==i?(o=i("mainPanelTabs.previewTab.localhostNoPreview.title"),e[0]=i,e[1]=o):o=e[1];let l;e[2]!==i?(l=i("mainPanelTabs.previewTab.localhostNoPreview.body"),e[2]=i,e[3]=l):l=e[3];let d;e[4]!==l?(d=s.jsx(Yt,{text:l}),e[4]=l,e[5]=d):d=e[5];let p;e[6]!==i?(p=i("mainPanelTabs.previewTab.localhostNoPreview.step.title"),e[6]=i,e[7]=p):p=e[7];let m;e[8]!==p?(m=[{title:p,command:`${gr} --preview localhost:3000`}],e[8]=p,e[9]=m):m=e[9];let f;return e[10]!==o||e[11]!==d||e[12]!==m?(f=s.jsx(Qt,{headingLevel:2,waiting:!1,title:o,lead:d,steps:m}),e[10]=o,e[11]=d,e[12]=m,e[13]=f):f=e[13],f}let u;e[14]!==r||e[15]!==n?(u=yo(n,r),e[14]=r,e[15]=n,e[16]=u):u=e[16];let a;return e[17]!==r||e[18]!==u?(a=s.jsx(bo,{wait:u,hosts:r}),e[17]=r,e[18]=u,e[19]=a):a=e[19],a}export{bo as L,pd as P,Qt as S,md as u};