decocms 4.540.0 → 4.541.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (414) hide show
  1. package/dist/client/assets/{ActiveShapeUtils-BOoUrrHB.js → ActiveShapeUtils-HI4PJ-HL.js} +1 -1
  2. package/dist/client/assets/{AlertCircle-DaqrzQLf.js → AlertCircle-Pu-QR8hS.js} +1 -1
  3. package/dist/client/assets/{AreaChart-DrVON7jD.js → AreaChart-DJ3vI97z.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-Lry57YLT.js → ArrowLeft-CiCYDVFq.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-DzUcbY_U.js → ArrowUp-bMBjrwqG.js} +1 -1
  6. package/dist/client/assets/{BarChart-Dvj8oTIy.js → BarChart-DW5fB9sQ.js} +1 -1
  7. package/dist/client/assets/{Building02-Czpjl0U5.js → Building02-BejNykWR.js} +1 -1
  8. package/dist/client/assets/{CartesianChart-CR7unfY_.js → CartesianChart-BfqGbR2p.js} +1 -1
  9. package/dist/client/assets/{CategoricalChart-DJYWdZLM.js → CategoricalChart-1g-OhB34.js} +1 -1
  10. package/dist/client/assets/{CheckCircle-BNPESArO.js → CheckCircle-CiBrtkwP.js} +1 -1
  11. package/dist/client/assets/{ChevronSelectorVertical-DZn3JZt3.js → ChevronSelectorVertical-Bb_Zani-.js} +1 -1
  12. package/dist/client/assets/{ChevronUp-DYWuPRic.js → ChevronUp-D3pnxmNi.js} +1 -1
  13. package/dist/client/assets/{Copy01-E_QbCxA-.js → Copy01-BEOZtg79.js} +1 -1
  14. package/dist/client/assets/{CreditCard01-i2HOt1aB.js → CreditCard01-C2H6wRye.js} +1 -1
  15. package/dist/client/assets/{DotsVertical-CbdEruUk.js → DotsVertical-DddKhPwC.js} +1 -1
  16. package/dist/client/assets/{ErrorBarContext-XbGnhJFR.js → ErrorBarContext-CUSRsGW6.js} +1 -1
  17. package/dist/client/assets/{Globe04-QDIAkI_1.js → Globe04-CR7aWwIq.js} +1 -1
  18. package/dist/client/assets/{Image01-DoQzA6mU.js → Image01-D9f6XNAl.js} +1 -1
  19. package/dist/client/assets/{Key01-yX9At---.js → Key01-BGQzZTLx.js} +1 -1
  20. package/dist/client/assets/{Link01-DdjCKN6E.js → Link01-_AjEk0aG.js} +1 -1
  21. package/dist/client/assets/{LinkBroken01-BFQs5QxW.js → LinkBroken01-BeLPonYT.js} +1 -1
  22. package/dist/client/assets/{Minus-BvbXf1Sp.js → Minus-DRtjDVr0.js} +1 -1
  23. package/dist/client/assets/{Monitor01-CGq_FB6g.js → Monitor01-CMcPb3p-.js} +1 -1
  24. package/dist/client/assets/{Play-ChXZcgWf.js → Play-Bon9Nn-R.js} +1 -1
  25. package/dist/client/assets/{Plus-AFrvUoUc.js → Plus-DZ8OV5bq.js} +1 -1
  26. package/dist/client/assets/{ReferenceLine-C4qdhryZ.js → ReferenceLine-CduNCTtx.js} +1 -1
  27. package/dist/client/assets/{SearchMd-DSPN9QxV.js → SearchMd-Coxjt-Zl.js} +1 -1
  28. package/dist/client/assets/{Sector-BmhXcpO4.js → Sector-CNB3zVjr.js} +1 -1
  29. package/dist/client/assets/{ShoppingBag01-DB7ytToi.js → ShoppingBag01-CeVNpa4z.js} +1 -1
  30. package/dist/client/assets/{Sun-DoDvwdQj.js → Sun-E-EbUc0n.js} +1 -1
  31. package/dist/client/assets/{SwitchHorizontal01-DoMMYhWx.js → SwitchHorizontal01-B8-pBEhT.js} +1 -1
  32. package/dist/client/assets/{Tool01-BdswuHJy.js → Tool01-CkZTily1.js} +1 -1
  33. package/dist/client/assets/{Trash01-B0glQHgK.js → Trash01-C8OxhBl3.js} +1 -1
  34. package/dist/client/assets/{Upload01-BY0gIDxJ.js → Upload01-Bt37Plwz.js} +1 -1
  35. package/dist/client/assets/{UserSquare-BhJx3glH.js → UserSquare-D7fSnIn3.js} +1 -1
  36. package/dist/client/assets/{Users01-CfcMu04c.js → Users01-DVEy527M.js} +1 -1
  37. package/dist/client/assets/{XClose-wH9pi_Oq.js → XClose-Bvl4KGPV.js} +1 -1
  38. package/dist/client/assets/{ZoomOut-DIZKZikC.js → ZoomOut-9x8WuC5l.js} +1 -1
  39. package/dist/client/assets/{access-gate-BHfZueQy.js → access-gate-DaxHYIBB.js} +1 -1
  40. package/dist/client/assets/{add-connection-dialog-CHVJhgT5.js → add-connection-dialog-CjJZP05X.js} +1 -1
  41. package/dist/client/assets/agent-analytics-BEKl1X8N.js +2 -0
  42. package/dist/client/assets/agent-app-8j-E-hT5.js +1 -0
  43. package/dist/client/assets/{agent-assets-BAIPSzOm.js → agent-assets-DQ6hVD8p.js} +1 -1
  44. package/dist/client/assets/{agent-automation-BGJ3-TK8.js → agent-automation-CI0Nub-n.js} +1 -1
  45. package/dist/client/assets/agent-automations-DzkmpBZa.js +1 -0
  46. package/dist/client/assets/agent-calendar-BC2tVvZL.js +1 -0
  47. package/dist/client/assets/{agent-connect-sources-CZvvMsHK.js → agent-connect-sources-Dh7wTbNs.js} +1 -1
  48. package/dist/client/assets/agent-deck-07no_3NQ.js +1 -0
  49. package/dist/client/assets/agent-e2e-Ds3Fe2AE.js +1 -0
  50. package/dist/client/assets/agent-experiments-DofmmJcd.js +1 -0
  51. package/dist/client/assets/agent-file-6W_Gnaal.js +1 -0
  52. package/dist/client/assets/agent-hosting-vZ66b5t2.js +1 -0
  53. package/dist/client/assets/{agent-icon-DO8s6ea2.js → agent-icon-Co7E9kYl.js} +1 -1
  54. package/dist/client/assets/agent-library-R2xLquH1.js +1 -0
  55. package/dist/client/assets/agent-library-file-BXlKOL8M.js +1 -0
  56. package/dist/client/assets/agent-monitor-BoyNxcz1.js +1 -0
  57. package/dist/client/assets/{agent-overview-CuUdmXFu.js → agent-overview-CSwJW27z.js} +1 -1
  58. package/dist/client/assets/{agent-releases-DM76bls9.js → agent-releases-CEzBKX-V.js} +1 -1
  59. package/dist/client/assets/agent-settings-BGDVCihC.js +1 -0
  60. package/dist/client/assets/{agent-site-editor-DPCxxALX.js → agent-site-editor-Du4tKYJz.js} +1 -1
  61. package/dist/client/assets/agent-site-editor-code-FDZ6QYUh.js +2 -0
  62. package/dist/client/assets/agent-site-editor-content-kP1qC2rB.js +1 -0
  63. package/dist/client/assets/agent-site-editor-preview-DmkFZKpC.js +1 -0
  64. package/dist/client/assets/agent-view-CH596Gq0.js +1 -0
  65. package/dist/client/assets/{agent-view-guard-nkOg3_TY.js → agent-view-guard-B04R8Znt.js} +1 -1
  66. package/dist/client/assets/{agents-list-C4mVj2oB.js → agents-list-CBfEPAhK.js} +1 -1
  67. package/dist/client/assets/{ai-providers-CVhG8V9K.js → ai-providers-aETP-f64.js} +1 -1
  68. package/dist/client/assets/{alert-Bbd8MBbC.js → alert-BF8n9shl.js} +1 -1
  69. package/dist/client/assets/{analytics-sections-jwRj3TLN.js → analytics-sections-SZXfO52-.js} +1 -1
  70. package/dist/client/assets/api-keys-9pHr3QlX.js +1 -0
  71. package/dist/client/assets/{api-keys-DoLrBZtK.js → api-keys-CiBjRrwV.js} +1 -1
  72. package/dist/client/assets/app-editor-BVC0eWvP.js +1 -0
  73. package/dist/client/assets/{asset-utils-CxWNRiZo.js → asset-utils-7zQmpZtP.js} +1 -1
  74. package/dist/client/assets/{auth-Bh5UNoqX.js → auth-Dt9DGFhA.js} +1 -1
  75. package/dist/client/assets/{auth-catchall-4NHJLfMJ.js → auth-catchall-APuNzDqf.js} +1 -1
  76. package/dist/client/assets/{auth-entry-DeWSrwTW.js → auth-entry-Dt8D4c49.js} +1 -1
  77. package/dist/client/assets/{auth-split-layout-CxSdEcxZ.js → auth-split-layout-DKGBUJmn.js} +1 -1
  78. package/dist/client/assets/{authenticate-and-persist-oauth-BvbYgtDL.js → authenticate-and-persist-oauth-CzFtziag.js} +1 -1
  79. package/dist/client/assets/{automation-list-row-B5PKQhfb.js → automation-list-row-BvcdSOir.js} +1 -1
  80. package/dist/client/assets/{automation-runs-CJ5PzJ6P.js → automation-runs-rp2R5GSb.js} +1 -1
  81. package/dist/client/assets/{automations-DoU-6EfQ.js → automations-C2DGayAE.js} +1 -1
  82. package/dist/client/assets/{autosend-BE8sRUrR.js → autosend-BYljpA5c.js} +1 -1
  83. package/dist/client/assets/{badge-B1tWhSy_.js → badge-CMgWUKiX.js} +1 -1
  84. package/dist/client/assets/{block-document-O9OVzBXq.js → block-document-ClAOKgf4.js} +1 -1
  85. package/dist/client/assets/{blocks-preview-workspace-context-v-05bFgy.js → blocks-preview-workspace-context-DQj4RBd8.js} +1 -1
  86. package/dist/client/assets/{blocks-tab-states-mp1yavun.js → blocks-tab-states-CQydf1x6.js} +1 -1
  87. package/dist/client/assets/{blog-schema-BXpJta6q.js → blog-schema-BOqVZaeF.js} +1 -1
  88. package/dist/client/assets/{buckets-BQuUHxtl.js → buckets-qwGMsdZj.js} +1 -1
  89. package/dist/client/assets/{build-improve-prompt-doc-CwbtrjfW.js → build-improve-prompt-doc-B2MxMIfa.js} +2 -2
  90. package/dist/client/assets/{calendar-5n1bBWkl.js → calendar-gk2fXc2c.js} +1 -1
  91. package/dist/client/assets/{capability-load-error-CygKHjaW.js → capability-load-error-D2UF4Aw2.js} +1 -1
  92. package/dist/client/assets/{category-editor-DvqQcGRC.js → category-editor-BaE2uAd6.js} +1 -1
  93. package/dist/client/assets/{cdn-tab-B_cU16DV.js → cdn-tab-BJ_vvsuv.js} +1 -1
  94. package/dist/client/assets/{chart-C0_FGEkR.js → chart-orNTiDQv.js} +1 -1
  95. package/dist/client/assets/{chat-context-DJQNHpnm.js → chat-context-Cbn1d2gD.js} +5 -5
  96. package/dist/client/assets/{chat-draft-DQWviosv.js → chat-draft-Dz-8ZkTL.js} +1 -1
  97. package/dist/client/assets/{checkbox-yhLjvc2y.js → checkbox-CA6aWe75.js} +1 -1
  98. package/dist/client/assets/{choose-editor-5ZAnwYWB.js → choose-editor-C2L8nFMF.js} +1 -1
  99. package/dist/client/assets/{cli-auth-success-BYQ3YAvN.js → cli-auth-success-BwZvMY9K.js} +1 -1
  100. package/dist/client/assets/{client-icons-CaxEYfpC.js → client-icons-BokFUC05.js} +1 -1
  101. package/dist/client/assets/{cms-settings-editor-BE9x_nrP.js → cms-settings-editor-DTAdiNDN.js} +1 -1
  102. package/dist/client/assets/{collapsible-Dp7IveTF.js → collapsible-DMa5aTxw.js} +1 -1
  103. package/dist/client/assets/{collection-detail-DavIgOzF.js → collection-detail-tC_GRfYF.js} +1 -1
  104. package/dist/client/assets/{collection-display-button-EzgYxMRf.js → collection-display-button-CO0G5HBN.js} +1 -1
  105. package/dist/client/assets/{collection-search-DKNF_aHL.js → collection-search-BtpA2Lei.js} +1 -1
  106. package/dist/client/assets/{collection-table-wrapper-DIqf0s_I.js → collection-table-wrapper-zNmZhsyo.js} +1 -1
  107. package/dist/client/assets/{collection-tabs-CymIaett.js → collection-tabs-CSXR7UYb.js} +1 -1
  108. package/dist/client/assets/{column-rules-DGrrvn-G.js → column-rules-C63NCpq3.js} +2 -2
  109. package/dist/client/assets/{combobox-dysI95ld.js → combobox-BwKhFDqj.js} +1 -1
  110. package/dist/client/assets/{command-D_wtag_V.js → command-lP5P8rqX.js} +1 -1
  111. package/dist/client/assets/{companion-mcps-section-BdCI0EqY.js → companion-mcps-section-CvFB8u3v.js} +1 -1
  112. package/dist/client/assets/{config-CQQ9U3og.js → config-B8-1YX-t.js} +1 -1
  113. package/dist/client/assets/{connect-CyugcJi1.js → connect-D2iiXOSY.js} +1 -1
  114. package/dist/client/assets/{connect-layout-BmSP5LrN.js → connect-layout-HGVTLejY.js} +1 -1
  115. package/dist/client/assets/{connect-source-dialog-dDRy6oN_.js → connect-source-dialog-DXGOBfjT.js} +1 -1
  116. package/dist/client/assets/{connection-SI3MUziU.js → connection-Cn9FrEsZ.js} +1 -1
  117. package/dist/client/assets/{connection-card-wiFNcVPz.js → connection-card-DlWLwRKA.js} +1 -1
  118. package/dist/client/assets/{connection-detail-CyxsqxAY.js → connection-detail-C98bDTVH.js} +1 -1
  119. package/dist/client/assets/{connection-form-helpers-DEYmvQ4D.js → connection-form-helpers-DdDJu97E.js} +1 -1
  120. package/dist/client/assets/{connections-fiTD4f_p.js → connections-C6M8AgjO.js} +1 -1
  121. package/dist/client/assets/{content-tab-CIEK1ThE.js → content-tab-B-LNJbd9.js} +9 -9
  122. package/dist/client/assets/{context-CPDgXD5A.js → context-CPd4zSV0.js} +1 -1
  123. package/dist/client/assets/{context-menu-CPo-TDeb.js → context-menu-gvTbM_VP.js} +1 -1
  124. package/dist/client/assets/context-shell-BdVWw-gN.js +36 -0
  125. package/dist/client/assets/{core.esm-CeU7AJNb.js → core.esm-M1IJOkIH.js} +1 -1
  126. package/dist/client/assets/{create-organization-dialog-BJ-ipj89.js → create-organization-dialog-DNvzT5i-.js} +1 -1
  127. package/dist/client/assets/{daily-pulse-DboJ8j0E.js → daily-pulse-DOHhxMy1.js} +1 -1
  128. package/dist/client/assets/{discover-DS7s-L_U.js → discover-COhVLrYW.js} +1 -1
  129. package/dist/client/assets/{domain-settings-DT7fh3GW.js → domain-settings-DRphZ3mS.js} +1 -1
  130. package/dist/client/assets/{drawer-CEKMK2Xy.js → drawer-Bsnw19SA.js} +1 -1
  131. package/dist/client/assets/{editor-119-kR49.js → editor-Z7h3tdjo.js} +1 -1
  132. package/dist/client/assets/{editor-classes-2SvDzxJS.js → editor-classes-CIysMLqw.js} +1 -1
  133. package/dist/client/assets/{empty-state-DcLpc4zT.js → empty-state-CEJi6IVu.js} +1 -1
  134. package/dist/client/assets/{empty-state-C_4QOOCa.js → empty-state-EpAwETL4.js} +1 -1
  135. package/dist/client/assets/{experiments-tab-bGN5Wr6b.js → experiments-tab-BKBmpbQS.js} +1 -1
  136. package/dist/client/assets/{experiments-tab-choice-DkauT2Jo.js → experiments-tab-choice-EKyQNqty.js} +1 -1
  137. package/dist/client/assets/{extract-connection-data-BbZfot_J.js → extract-connection-data-CGOVIYLF.js} +1 -1
  138. package/dist/client/assets/{feature-gate-bdKRsBFR.js → feature-gate-DXCleAqA.js} +1 -1
  139. package/dist/client/assets/{feature-paywall-DAahPvB8.js → feature-paywall-4QJAn2z5.js} +1 -1
  140. package/dist/client/assets/{file-explorer-Dsn4i28O.js → file-explorer-Bd3gIXGV.js} +1 -1
  141. package/dist/client/assets/{file-preview-COMqp33v.js → file-preview-CCmllyvi.js} +1 -1
  142. package/dist/client/assets/{file-share-button-DcVhpMbp.js → file-share-button-DbPRyXAD.js} +1 -1
  143. package/dist/client/assets/{file-type-icon-lZJfDHey.js → file-type-icon-CiMMiUYO.js} +1 -1
  144. package/dist/client/assets/folder-icon-rxpoDvAE.js +1 -0
  145. package/dist/client/assets/{form-CqcvGBPS.js → form-Bk9ymCIS.js} +1 -1
  146. package/dist/client/assets/{general-CXJLTfCs.js → general-Cr_ASK52.js} +1 -1
  147. package/dist/client/assets/{github-icon-CwEeHUg2.js → github-icon-EmEurWMX.js} +1 -1
  148. package/dist/client/assets/{held-block-view-BxrII4AU.js → held-block-view-BDu8bj-6.js} +3 -3
  149. package/dist/client/assets/{home-B9PCBrp1.js → home-DGMtvNuq.js} +1 -1
  150. package/dist/client/assets/{hosted-publish-feedback-IJbFHaab.js → hosted-publish-feedback-C3S_f767.js} +1 -1
  151. package/dist/client/assets/{icon-button-DpHJ-JqO.js → icon-button-CcHZO8e6.js} +1 -1
  152. package/dist/client/assets/{index-Bk0jj91j.js → index-BGKyyvyC.js} +1 -1
  153. package/dist/client/assets/{index-CWrjSpv6.js → index-BaOc9Ezz.js} +1 -1
  154. package/dist/client/assets/{index-C4tvJe6k.js → index-Bd1JsEWx.js} +1 -1
  155. package/dist/client/assets/index-Bek871Hp.js +4 -0
  156. package/dist/client/assets/{index-zIshg7PY.js → index-CRt26OMk.js} +1 -1
  157. package/dist/client/assets/{index-Bq8jsQ_w.js → index-CcyUawfW.js} +1 -1
  158. package/dist/client/assets/{index-CtkdQjRq.js → index-DGAfs5q1.js} +1 -1
  159. package/dist/client/assets/{index-Dx7zyr0h.js → index-DMJwbqhe.js} +1 -1
  160. package/dist/client/assets/{index-C2zeCcsu.js → index-DMN6-ViK.js} +1 -1
  161. package/dist/client/assets/{index-TO8lHy3e.js → index-D_GgrLpt.js} +1 -1
  162. package/dist/client/assets/{index-j-fjuwfK.js → index-DvPTtoj9.js} +1 -1
  163. package/dist/client/assets/{index-Br9i6zHp.js → index-KpWMq2p9.js} +1 -1
  164. package/dist/client/assets/{index-DQN-rago.js → index-KxuowPl9.js} +1 -1
  165. package/dist/client/assets/{index-DQge_BLv.js → index-LISCRMKT.js} +33 -33
  166. package/dist/client/assets/{index-D3KLhYWS.js → index-Rjs_bdr_.js} +1 -1
  167. package/dist/client/assets/{index-redirect-BuE1MOHc.js → index-redirect-C_c-8-0u.js} +1 -1
  168. package/dist/client/assets/{infiniteQueryObserver-CJSP-r-Q.js → infiniteQueryObserver-DGdbL4U6.js} +1 -1
  169. package/dist/client/assets/{infra-billing-CWnShztW.js → infra-billing-CkpqPi0H.js} +1 -1
  170. package/dist/client/assets/{input-xMjBQS9S.js → input-BhbajINs.js} +1 -1
  171. package/dist/client/assets/{input-DEv-xbR8.js → input-Cgw3HqQu.js} +3 -3
  172. package/dist/client/assets/{integration-icon-C5QUXJ-_.js → integration-icon-msZhQ6E3.js} +1 -1
  173. package/dist/client/assets/{jira-icon-BJbq7OPn.js → jira-icon-C8kN-yG2.js} +1 -1
  174. package/dist/client/assets/{label-nAynIzRB.js → label-BfYbFBpZ.js} +1 -1
  175. package/dist/client/assets/{layout-DNjRf8xk.js → layout-DFaNAdKK.js} +1 -1
  176. package/dist/client/assets/{legacy-agents-deep-jMmzKh7Y.js → legacy-agents-deep-BQflSkhZ.js} +1 -1
  177. package/dist/client/assets/{legacy-main-redirect-BunqrDCq.js → legacy-main-redirect-DaGWGhtf.js} +1 -1
  178. package/dist/client/assets/library-CdfdY0qf.js +1 -0
  179. package/dist/client/assets/library-tab-4UasD5Mp.js +162 -0
  180. package/dist/client/assets/{login-D83UHWcO.js → login-DtccMmUF.js} +1 -1
  181. package/dist/client/assets/{markdown-SDFpVgvK.js → markdown-CGLGjJUn.js} +1 -1
  182. package/dist/client/assets/{mcp-app-renderer-taIEo_0M.js → mcp-app-renderer-BmH0oH65.js} +1 -1
  183. package/dist/client/assets/{mcp-oauth-CscDp9_t.js → mcp-oauth-CDHHl2AY.js} +1 -1
  184. package/dist/client/assets/{mcp-oauth-zNBrv-Zt.js → mcp-oauth-D5bTwzBt.js} +1 -1
  185. package/dist/client/assets/{members-D0TZ8Ccr.js → members-CqaIW0DL.js} +1 -1
  186. package/dist/client/assets/{memory-Ba-1Kju3.js → memory-DoZ_Hb59.js} +1 -1
  187. package/dist/client/assets/{mini-report-page-2l-Lz3u4.js → mini-report-page-CWBsLXpy.js} +1 -1
  188. package/dist/client/assets/{mock-board-1XU__Ik1.js → mock-board-piOcYIBD.js} +3 -3
  189. package/dist/client/assets/{monaco-editor-DhfBMl22.js → monaco-editor-B_hB8uvI.js} +1 -1
  190. package/dist/client/assets/{monitoring-O6AqfPp3.js → monitoring-3dbLT4OM.js} +1 -1
  191. package/dist/client/assets/{monitoring-stats-row-C9AbRSlG.js → monitoring-stats-row-va93h-kh.js} +1 -1
  192. package/dist/client/assets/{multi-select-D_bxEawf.js → multi-select-DqoGBuJR.js} +1 -1
  193. package/dist/client/assets/{mustache-PKt0frjT.js → mustache-YJnhKKzZ.js} +1 -1
  194. package/dist/client/assets/{named-rule-uses-Bo4fIeGa.js → named-rule-uses-B5UiiWoJ.js} +1 -1
  195. package/dist/client/assets/{new-project-dialog-D-A0zxil.js → new-project-dialog-BrtI6GgZ.js} +1 -1
  196. package/dist/client/assets/{oauth-callback-DubxtStZ.js → oauth-callback-DvCUGRkg.js} +1 -1
  197. package/dist/client/assets/{oauth-callback-ai-provider-BC8tw2Bc.js → oauth-callback-ai-provider-IxBLpV6t.js} +1 -1
  198. package/dist/client/assets/{onboarding-Ca-dU_v5.js → onboarding-CqirqsHd.js} +1 -1
  199. package/dist/client/assets/{openai-conversation-Cl6vICtm.js → openai-conversation-DGR8tfoH.js} +1 -1
  200. package/dist/client/assets/{optimistic-project-sidebar-views-CFDUE-TH.js → optimistic-project-sidebar-views-CPWt9LH6.js} +1 -1
  201. package/dist/client/assets/{order-monitor-day-Bh13wI0p.js → order-monitor-day-or-R9J0S.js} +1 -1
  202. package/dist/client/assets/{organization-choice-DPSWyAa2.js → organization-choice-CeZ3suN4.js} +1 -1
  203. package/dist/client/assets/{orgs-ZkiwjsKf.js → orgs-iTHfKpGx.js} +1 -1
  204. package/dist/client/assets/{page-seo-form-DH-Hxxys.js → page-seo-form-CdFLhDD2.js} +1 -1
  205. package/dist/client/assets/{pair-DtO9iW-3.js → pair-B_hske_9.js} +1 -1
  206. package/dist/client/assets/{parse-sections-oAWkQEej.js → parse-sections-rTJ9Vxva.js} +1 -1
  207. package/dist/client/assets/{plan-CqqG8SUj.js → plan-CKUD-2iO.js} +1 -1
  208. package/dist/client/assets/{plan-ladder-B3EmMB3m.js → plan-ladder-ROI7a8rc.js} +1 -1
  209. package/dist/client/assets/{plan-usage-card-BzLwo22w.js → plan-usage-card-DmpNxqNF.js} +1 -1
  210. package/dist/client/assets/{popover-B6YbIo3T.js → popover-D6dCz_8d.js} +1 -1
  211. package/dist/client/assets/{post-calendar-Dcvp_FEa.js → post-calendar-DkrNCJu_.js} +1 -1
  212. package/dist/client/assets/{post-editor-q2dn18ot.js → post-editor-C9guOY0S.js} +1 -1
  213. package/dist/client/assets/{preview-content-BM5uf6de.js → preview-content-DFI0aQf4.js} +1 -1
  214. package/dist/client/assets/{preview-dialog-B1rrd0Eo.js → preview-dialog-D2HjzZ1B.js} +1 -1
  215. package/dist/client/assets/{preview-panel-CWMMAoWj.js → preview-panel-0VJe1FDB.js} +1 -1
  216. package/dist/client/assets/{preview-tab-BRwd0IoI.js → preview-tab-CpG9tuu6.js} +3 -3
  217. package/dist/client/assets/{product-picker-dialog-Cb31reHz.js → product-picker-dialog-CFjl9WR-.js} +1 -1
  218. package/dist/client/assets/{profile-txXmLWoZ.js → profile-CY0p7UGQ.js} +1 -1
  219. package/dist/client/assets/{project-app-view-C24UQEFV.js → project-app-view-Cf1gd22p.js} +1 -1
  220. package/dist/client/assets/{project-apps-B12W1GDC.js → project-apps-X2VfH52k.js} +1 -1
  221. package/dist/client/assets/{project-feed-C7C18nCo.js → project-feed-Cqb3oD2R.js} +1 -1
  222. package/dist/client/assets/{project-icon-B0SToVzq.js → project-icon-As9MoCET.js} +1 -1
  223. package/dist/client/assets/project-reports-BVlytfOe.js +1 -0
  224. package/dist/client/assets/project-tasks-BGW3O_F5.js +1 -0
  225. package/dist/client/assets/{projects-empty-state-CJ2OD6jD.js → projects-empty-state-B4wHwi2Z.js} +1 -1
  226. package/dist/client/assets/{projects-SPBUjj_X.js → projects-oKJE7kAY.js} +1 -1
  227. package/dist/client/assets/{prompts-4SFi9ARi.js → prompts-f4GajLV5.js} +1 -1
  228. package/dist/client/assets/record-editor-BOGjSPiY.js +1 -0
  229. package/dist/client/assets/{redirect-editor-CX3gDt5E.js → redirect-editor-DxMUngFX.js} +1 -1
  230. package/dist/client/assets/{releases-api-C1aD3cIf.js → releases-api-kH_Ed6eO.js} +1 -1
  231. package/dist/client/assets/{reports-CFlThgzK.js → reports-D2UCpDap.js} +1 -1
  232. package/dist/client/assets/reports-N81wb4Wq.js +1 -0
  233. package/dist/client/assets/{reports-onboarding-BLkz9Y0k.js → reports-onboarding-CljQnv9P.js} +1 -1
  234. package/dist/client/assets/{reports-tab-CxnmtYqI.js → reports-tab-CSx5fOj6.js} +2 -2
  235. package/dist/client/assets/repositories-DL-11--e.js +1 -0
  236. package/dist/client/assets/{repositories-COfIEqOO.js → repositories-DzOMkV9O.js} +1 -1
  237. package/dist/client/assets/{repository-binding-BSdKE2Qo.js → repository-binding-N72ZtnJ7.js} +1 -1
  238. package/dist/client/assets/{repository-import-picker-DL_KXsuZ.js → repository-import-picker-CNVRTxph.js} +1 -1
  239. package/dist/client/assets/{repository-picker-DR1imeoJ.js → repository-picker-CW0SaV-m.js} +1 -1
  240. package/dist/client/assets/{require-capability-UZtVjAt7.js → require-capability-C2GXhzLq.js} +1 -1
  241. package/dist/client/assets/{required-auth-layout-BfYIPzIZ.js → required-auth-layout-BwkU_8aI.js} +1 -1
  242. package/dist/client/assets/{reset-password-Ct6Pe3k_.js → reset-password-gBMO6F0r.js} +1 -1
  243. package/dist/client/assets/{resizable-STcRbiPL.js → resizable-WR3fdR8J.js} +1 -1
  244. package/dist/client/assets/{resolve-tab-icon-BUDvDo3Q.js → resolve-tab-icon-DS-pAijm.js} +1 -1
  245. package/dist/client/assets/{review-settings-BZAPURVM.js → review-settings-DcaJvbTX.js} +1 -1
  246. package/dist/client/assets/{roles-BTI_G4my.js → roles-Brhhqsw3.js} +1 -1
  247. package/dist/client/assets/route-BmSXOav-.js +1 -0
  248. package/dist/client/assets/route-C51vZk3q.js +1 -0
  249. package/dist/client/assets/{route-DC0as__j.js → route-D_u0Bw_R.js} +1 -1
  250. package/dist/client/assets/{sandbox-lifecycle-context-DObzOH6l.js → sandbox-lifecycle-context-BBDd5Vd6.js} +1 -1
  251. package/dist/client/assets/{schema-CiJGpkKp.js → schema-C2dfCTpF.js} +1 -1
  252. package/dist/client/assets/{schema-2IXYlLNg.js → schema-cjQbFYEA.js} +1 -1
  253. package/dist/client/assets/{scroll-area-BCbl3S10.js → scroll-area-DYvdRQ3X.js} +1 -1
  254. package/dist/client/assets/{search-input-BvepfDCp.js → search-input-DfJJHgak.js} +1 -1
  255. package/dist/client/assets/{search-toggle-DNanFl3b.js → search-toggle-K39LDgc3.js} +1 -1
  256. package/dist/client/assets/{secret-picker-BFw_Vm2O.js → secret-picker-COEpc_Br.js} +1 -1
  257. package/dist/client/assets/{secrets-DhC5ps_G.js → secrets-DpnxLirI.js} +1 -1
  258. package/dist/client/assets/{section-array-field-C4Dn6tRH.js → section-array-field-cPwKvhUj.js} +1 -1
  259. package/dist/client/assets/sections-DQYOsFQr.js +1 -0
  260. package/dist/client/assets/{sections-editor-HzO8sny6.js → sections-editor-p5iYgj5l.js} +1 -1
  261. package/dist/client/assets/{select-CrEvL5z9.js → select-Ce8n-RXJ.js} +1 -1
  262. package/dist/client/assets/{select-model-CAsc6jpO.js → select-model-DrlCeL1J.js} +1 -1
  263. package/dist/client/assets/{seo-editor-CyB5kB-I.js → seo-editor-BtHI4gWU.js} +1 -1
  264. package/dist/client/assets/{separator-Dt_7ryb4.js → separator-CMPRlDqA.js} +1 -1
  265. package/dist/client/assets/settings-tab-qkoZ5Hhk.js +1 -0
  266. package/dist/client/assets/{sheet-Dwf0d2yk.js → sheet-C1Iz_daC.js} +1 -1
  267. package/dist/client/assets/{shell-layout-CTdQsY_z.js → shell-layout-DUwEP5qi.js} +1 -1
  268. package/dist/client/assets/{site-draft-actions-IMB26mGs.js → site-draft-actions-Cwq-m4rQ.js} +1 -1
  269. package/dist/client/assets/{site-draft-view-f8qPUNeN.js → site-draft-view-BGk8W1nm.js} +2 -2
  270. package/dist/client/assets/site-editor-DBH3tuRQ.js +1 -0
  271. package/dist/client/assets/{site-editor-toast-C3--n_in.js → site-editor-toast-BZwEeugO.js} +1 -1
  272. package/dist/client/assets/skill-md-ChfVs4uF.js +2 -0
  273. package/dist/client/assets/skills-CmU0q2d6.js +1 -0
  274. package/dist/client/assets/{slider-CNTpN8Re.js → slider-BRlhk1I_.js} +1 -1
  275. package/dist/client/assets/{sortable.esm-c1-MiY5V.js → sortable.esm-DfWQuMf-.js} +1 -1
  276. package/dist/client/assets/{sso-Bs5GeUJD.js → sso-Bl0_X14P.js} +1 -1
  277. package/dist/client/assets/{suggestion-uJQK-wZ9.js → suggestion-C79o6bsf.js} +1 -1
  278. package/dist/client/assets/{switch-yYhcctGB.js → switch-B5fLkk4G.js} +1 -1
  279. package/dist/client/assets/{symbol-C4rfRhzp.js → symbol-AaQxOm0Y.js} +1 -1
  280. package/dist/client/assets/{synced-repos-CiMRfJrJ.js → synced-repos-Bes2Akem.js} +1 -1
  281. package/dist/client/assets/{tab-icon-glyph-BI27Qjvn.js → tab-icon-glyph-X9RKDulT.js} +1 -1
  282. package/dist/client/assets/{table-CiyeDv2d.js → table-CR0vxly9.js} +1 -1
  283. package/dist/client/assets/{tabs-CkNdZlhM.js → tabs-BeQ3GpBj.js} +1 -1
  284. package/dist/client/assets/{task-assignee-avatar-CMrJBads.js → task-assignee-avatar-BxtkZ6j_.js} +1 -1
  285. package/dist/client/assets/{task-board-DCXqqZ12.js → task-board-DfACAZyY.js} +1 -1
  286. package/dist/client/assets/{task-route-Dd71UgL5.js → task-route-CEMyrZwM.js} +1 -1
  287. package/dist/client/assets/{task-status-CQ3ao3yh.js → task-status-CwtxChqi.js} +1 -1
  288. package/dist/client/assets/{taskboard-analytics-CbI6X7pJ.js → taskboard-analytics-nTEghmrx.js} +1 -1
  289. package/dist/client/assets/{tasks-mM2pq91X.js → tasks-5giK8VZS.js} +1 -1
  290. package/dist/client/assets/tasks-sE4UNYKk.js +1 -0
  291. package/dist/client/assets/{textarea-DgBaFzwD.js → textarea-1B6eWYpg.js} +1 -1
  292. package/dist/client/assets/{thread-analytics-B0aq1uDf.js → thread-analytics-DRVZv6bu.js} +1 -1
  293. package/dist/client/assets/{thread-intent-BXZYb_rR.js → thread-intent-ptqgtSKo.js} +1 -1
  294. package/dist/client/assets/{thread-route-8AzPmWR1.js → thread-route-BnB8pcK6.js} +1 -1
  295. package/dist/client/assets/{thread-route-BhHeUYXo.js → thread-route-CCN9I68_.js} +1 -1
  296. package/dist/client/assets/{thread-sheet-body-C9NrvW34.js → thread-sheet-body-Opalk3rB.js} +1 -1
  297. package/dist/client/assets/{time-range-picker-DqbJ77RY.js → time-range-picker-D-3pTVaL.js} +1 -1
  298. package/dist/client/assets/{toggle-group-zfRo99MM.js → toggle-group-DhjHoFhg.js} +1 -1
  299. package/dist/client/assets/{tool-namespace-CrCuqBA7.js → tool-namespace-EPn7Kyb1.js} +1 -1
  300. package/dist/client/assets/{toolbar-icon-button-B0tBxUCb.js → toolbar-icon-button-DOtu5VNi.js} +1 -1
  301. package/dist/client/assets/{tooltip--hQ071uj.js → tooltip-DiW2ytsS.js} +1 -1
  302. package/dist/client/assets/{tooltipContext-CzjEugcr.js → tooltipContext-Boh-kskS.js} +1 -1
  303. package/dist/client/assets/{track-DS8BOtu9.js → track-DDsr4-8X.js} +1 -1
  304. package/dist/client/assets/{types-vHdCIVHy.js → types-CAqly_33.js} +1 -1
  305. package/dist/client/assets/{url-slug-oBnMGRk3.js → url-slug-BimzZyel.js} +1 -1
  306. package/dist/client/assets/{usage-stats-Bfpi0erw.js → usage-stats-DyqnqVDM.js} +1 -1
  307. package/dist/client/assets/{use-ai-providers-C9yoEjqD.js → use-ai-providers-DGRaKYBP.js} +1 -1
  308. package/dist/client/assets/{use-apply-named-rule-Bv8beIr1.js → use-apply-named-rule-TltIMgYp.js} +1 -1
  309. package/dist/client/assets/{use-automations-3u659Mzy.js → use-automations-DcNzV0FS.js} +1 -1
  310. package/dist/client/assets/{use-autosave-NqlgHsXe.js → use-autosave-DQJxV1eg.js} +1 -1
  311. package/dist/client/assets/{use-chat-layout-state-DtHD302s.js → use-chat-layout-state-lg3L3DSm.js} +1 -1
  312. package/dist/client/assets/{use-clock-tick-DsgVgaMj.js → use-clock-tick-BXkjZk4h.js} +1 -1
  313. package/dist/client/assets/{use-cms-publish-actions-DD2X-WS9.js → use-cms-publish-actions-Cg-2YJOJ.js} +1 -1
  314. package/dist/client/assets/{use-connect-companion-5d_OtePL.js → use-connect-companion-FMSyv7iG.js} +1 -1
  315. package/dist/client/assets/{use-connection-DjcoL2xp.js → use-connection-DZPkoV0a.js} +1 -1
  316. package/dist/client/assets/{use-copy-BmESZuBQ.js → use-copy-Bb3ge3Jw.js} +1 -1
  317. package/dist/client/assets/{use-create-virtual-mcp-DUFp5SfV.js → use-create-virtual-mcp-CFxxMtOW.js} +1 -1
  318. package/dist/client/assets/{use-date-fns-locale-1xKLCmLQ.js → use-date-fns-locale-DTg1snyT.js} +1 -1
  319. package/dist/client/assets/{use-debounced-autosave-DtGVwjBB.js → use-debounced-autosave-DKsafE_B.js} +1 -1
  320. package/dist/client/assets/{use-debounced-value-BC9-VsXG.js → use-debounced-value-DBl2u8Ax.js} +1 -1
  321. package/dist/client/assets/{use-deco-credits-MxrjnOZJ.js → use-deco-credits-CHyZsaQg.js} +1 -1
  322. package/dist/client/assets/{use-decopilot-events-DQJQGAJY.js → use-decopilot-events-ChnGZu8F.js} +1 -1
  323. package/dist/client/assets/{use-delete-connection-CH4NYX_K.js → use-delete-connection-Txpqn3lI.js} +1 -1
  324. package/dist/client/assets/{use-deployment-admin-D9U88a6V.js → use-deployment-admin-Do6VU3ed.js} +1 -1
  325. package/dist/client/assets/{use-entitlements-DfzzXZIV.js → use-entitlements-9vbVfq68.js} +1 -1
  326. package/dist/client/assets/{use-fast-preview-draft-url-C3Zsdb8u.js → use-fast-preview-draft-url-CXQ7cT85.js} +1 -1
  327. package/dist/client/assets/{use-file-configs-BQsdB00T.js → use-file-configs-Dn7YLM4Z.js} +1 -1
  328. package/dist/client/assets/{use-inbox-feed-B8XaHBzd.js → use-inbox-feed-BZyJNQXN.js} +1 -1
  329. package/dist/client/assets/{use-infinite-scroll-CrNt3X1z.js → use-infinite-scroll-CB0WyAlc.js} +1 -1
  330. package/dist/client/assets/use-join-requests-CW_FogGu.js +1 -0
  331. package/dist/client/assets/{use-main-panel-tabs-DI48iHOF.js → use-main-panel-tabs-BtH_KnVM.js} +1 -1
  332. package/dist/client/assets/{use-mcp-auth-status-B6pAOnY6.js → use-mcp-auth-status-CKDFCOAa.js} +1 -1
  333. package/dist/client/assets/{use-mcp-client-DVzTP9Z-.js → use-mcp-client-0e8NRgfT.js} +1 -1
  334. package/dist/client/assets/{use-mcp-prompts-B9D-ZvCI.js → use-mcp-prompts-B2c7TGKV.js} +1 -1
  335. package/dist/client/assets/{use-mcp-tools-D-mu7r_B.js → use-mcp-tools-BWk4AICK.js} +1 -1
  336. package/dist/client/assets/{use-mobile-C_KOoyX9.js → use-mobile-BJBInbLU.js} +1 -1
  337. package/dist/client/assets/{use-move-blocks-mCIJarBI.js → use-move-blocks-sjThA1Ew.js} +1 -1
  338. package/dist/client/assets/{use-navigate-to-agent-CakeCNXj.js → use-navigate-to-agent-CpRnIp1k.js} +1 -1
  339. package/dist/client/assets/{use-org-fs-CGLMPARk.js → use-org-fs-B8r-1D4b.js} +1 -1
  340. package/dist/client/assets/{use-org-repo-syncs-CJLLkjNn.js → use-org-repo-syncs-Dq0Qf-et.js} +1 -1
  341. package/dist/client/assets/{use-org-sso-AxQjuMiC.js → use-org-sso-DVHlBcmx.js} +1 -1
  342. package/dist/client/assets/{use-organization-roles-CQzQZypU.js → use-organization-roles-DYmDerrq.js} +1 -1
  343. package/dist/client/assets/{use-organization-settings-BgGp5lk4.js → use-organization-settings-CK8r9oqu.js} +1 -1
  344. package/dist/client/assets/{use-panel-navigate-DJWYue4p.js → use-panel-navigate-CnrhnUVG.js} +1 -1
  345. package/dist/client/assets/{use-project-native-view-presence-Dvt6yQe3.js → use-project-native-view-presence-DnAEbSTa.js} +1 -1
  346. package/dist/client/assets/use-project-scope-LiKIXaiK.js +1 -0
  347. package/dist/client/assets/{use-recent-apps-C-1xZr4-.js → use-recent-apps-Dbpw5TB5.js} +1 -1
  348. package/dist/client/assets/{use-releases-BrCAkIVY.js → use-releases-ClTQL_RZ.js} +1 -1
  349. package/dist/client/assets/{use-reports-diagnostic-jm0YW2SP.js → use-reports-diagnostic-DVwMPgD_.js} +1 -1
  350. package/dist/client/assets/{use-sandbox-events-1Xx-AI1q.js → use-sandbox-events-BAik2LAS.js} +1 -1
  351. package/dist/client/assets/{use-secrets-CLn_8twS.js → use-secrets-ZlehcjzW.js} +1 -1
  352. package/dist/client/assets/{use-section-preview-base-DA9S2k6x.js → use-section-preview-base-CLumQxEU.js} +1 -1
  353. package/dist/client/assets/{use-session-runtime-D49ajMP-.js → use-session-runtime-PX0UU1rX.js} +1 -1
  354. package/dist/client/assets/{use-sidebar-collapsed-DM0SNXB-.js → use-sidebar-collapsed-ByUss2bb.js} +1 -1
  355. package/dist/client/assets/{use-tags-BEzZVqIn.js → use-tags-CeuMPNMY.js} +1 -1
  356. package/dist/client/assets/{use-task-board-analytics-DlrBSCm4.js → use-task-board-analytics-DzVWF5Q4.js} +1 -1
  357. package/dist/client/assets/{use-task-board-events-BtbvSjEH.js → use-task-board-events-Cuq4HTGo.js} +1 -1
  358. package/dist/client/assets/{use-task-board-item-prs-sxDYgHpw.js → use-task-board-item-prs-BZA4s0mM.js} +1 -1
  359. package/dist/client/assets/{use-task-metadata-B2VBxxWt.js → use-task-metadata-De52Dfmg.js} +1 -1
  360. package/dist/client/assets/use-thread-analytics-HQsRrHEt.js +1 -0
  361. package/dist/client/assets/{use-thread-outputs-CUfkYNKn.js → use-thread-outputs-BT4PyLKe.js} +1 -1
  362. package/dist/client/assets/useInfiniteQuery-ChletbBT.js +1 -0
  363. package/dist/client/assets/{useQueries-Bzc1vZ08.js → useQueries-nk-gppMK.js} +1 -1
  364. package/dist/client/assets/useSuspenseInfiniteQuery-BJjYTjXx.js +1 -0
  365. package/dist/client/assets/{users-D47TLrj5.js → users-CLgvJMnS.js} +1 -1
  366. package/dist/client/assets/{utils-CeKg1A9t.js → utils-BDRBqTP5.js} +1 -1
  367. package/dist/client/assets/{variant-calendar-D8EXCNqj.js → variant-calendar-DOQE-pkF.js} +1 -1
  368. package/dist/client/assets/{variant-matcher-override-D08bT7BW.js → variant-matcher-override-D6IszGLS.js} +1 -1
  369. package/dist/client/assets/{view-header-CiREHDQJ.js → view-header-Ce7a2voT.js} +1 -1
  370. package/dist/client/assets/{virtual-mcp-DonQ6N9_.js → virtual-mcp-C5JzNRIg.js} +1 -1
  371. package/dist/client/assets/{watch-sse-pool-CDjDlASu.js → watch-sse-pool-CBQ2__fw.js} +1 -1
  372. package/dist/client/index.html +1 -1
  373. package/dist/server/server.js +1 -1
  374. package/package.json +1 -1
  375. package/dist/client/assets/agent-analytics-BXAn2N0r.js +0 -2
  376. package/dist/client/assets/agent-app-XDaH2UxV.js +0 -1
  377. package/dist/client/assets/agent-automations-DSp3SJST.js +0 -1
  378. package/dist/client/assets/agent-calendar-BxXog5Q5.js +0 -1
  379. package/dist/client/assets/agent-deck-BYR4XQci.js +0 -1
  380. package/dist/client/assets/agent-e2e-DRxuNo8-.js +0 -1
  381. package/dist/client/assets/agent-experiments-DRjAZYzR.js +0 -1
  382. package/dist/client/assets/agent-file-pPOOGtfl.js +0 -1
  383. package/dist/client/assets/agent-hosting-BX8P_5or.js +0 -1
  384. package/dist/client/assets/agent-library-Bc3kQ_R6.js +0 -1
  385. package/dist/client/assets/agent-library-file-DrHSAEDA.js +0 -1
  386. package/dist/client/assets/agent-monitor-BTQ_6U0v.js +0 -1
  387. package/dist/client/assets/agent-settings-D8raNlY9.js +0 -1
  388. package/dist/client/assets/agent-site-editor-code-C6cvE1TU.js +0 -2
  389. package/dist/client/assets/agent-site-editor-content-BkfY5JF6.js +0 -1
  390. package/dist/client/assets/agent-site-editor-preview-BeN6Ies6.js +0 -1
  391. package/dist/client/assets/agent-view-C7IRhw_c.js +0 -1
  392. package/dist/client/assets/api-keys-Bdi2Hfk1.js +0 -1
  393. package/dist/client/assets/app-editor-DeYY_4hY.js +0 -1
  394. package/dist/client/assets/context-shell-CXn_oe8e.js +0 -197
  395. package/dist/client/assets/folder-icon-CyiATNbj.js +0 -2
  396. package/dist/client/assets/index-j4Z-ANHV.js +0 -4
  397. package/dist/client/assets/library-BbBalmjj.js +0 -1
  398. package/dist/client/assets/project-reports-D8rFprGS.js +0 -1
  399. package/dist/client/assets/project-tasks-C6Z1LFGn.js +0 -1
  400. package/dist/client/assets/record-editor-C3JQQloA.js +0 -1
  401. package/dist/client/assets/reports-B2tDJQsh.js +0 -1
  402. package/dist/client/assets/repositories-BOmD-XhQ.js +0 -1
  403. package/dist/client/assets/route-BYYP1Ckt.js +0 -1
  404. package/dist/client/assets/route-BxWnXxr1.js +0 -1
  405. package/dist/client/assets/sections-BoMQy-an.js +0 -1
  406. package/dist/client/assets/settings-tab-B7Vt0fWI.js +0 -1
  407. package/dist/client/assets/site-editor-DrkKMtaV.js +0 -1
  408. package/dist/client/assets/skills-BvtJnyjI.js +0 -1
  409. package/dist/client/assets/tasks-C1NS2CIB.js +0 -1
  410. package/dist/client/assets/use-join-requests-pOQBFZZg.js +0 -1
  411. package/dist/client/assets/use-project-scope-DmeYK8Bq.js +0 -1
  412. package/dist/client/assets/use-thread-analytics-CF6S8hFd.js +0 -1
  413. package/dist/client/assets/useInfiniteQuery-DW7gjDqh.js +0 -1
  414. package/dist/client/assets/useSuspenseInfiniteQuery-CKl2j5ZP.js +0 -1
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/sections-editor-HzO8sny6.js","assets/index-DQge_BLv.js","assets/index-By_-wb1N.css","assets/chat-context-DJQNHpnm.js","assets/use-panel-navigate-DJWYue4p.js","assets/thread-route-BhHeUYXo.js","assets/use-project-scope-DmeYK8Bq.js","assets/repository-binding-BSdKE2Qo.js","assets/use-mcp-client-DVzTP9Z-.js","assets/auth-Bh5UNoqX.js","assets/autosend-BE8sRUrR.js","assets/thread-intent-BXZYb_rR.js","assets/delay-CnY5UFtP.js","assets/backoff-CrEUbyZT.js","assets/watch-sse-pool-CDjDlASu.js","assets/task-board-DCXqqZ12.js","assets/schema-CiJGpkKp.js","assets/slugify-CEUa2lfQ.js","assets/use-entitlements-DfzzXZIV.js","assets/use-ai-providers-C9yoEjqD.js","assets/location-V0VwTJTt.js","assets/use-decopilot-events-DQJQGAJY.js","assets/use-organization-settings-BgGp5lk4.js","assets/held-block-view-BxrII4AU.js","assets/utils-CeKg1A9t.js","assets/ZoomOut-DIZKZikC.js","assets/Image01-DoQzA6mU.js","assets/agent-icon-DO8s6ea2.js","assets/AlertCircle-DaqrzQLf.js","assets/Tool01-BdswuHJy.js","assets/ArrowUp-DzUcbY_U.js","assets/ArrowLeft-Lry57YLT.js","assets/LinkBroken01-BFQs5QxW.js","assets/ShoppingBag01-DB7ytToi.js","assets/Building02-Czpjl0U5.js","assets/CheckCircle-BNPESArO.js","assets/ChevronUp-DYWuPRic.js","assets/ChevronSelectorVertical-DZn3JZt3.js","assets/UserSquare-BhJx3glH.js","assets/Copy01-E_QbCxA-.js","assets/CreditCard01-i2HOt1aB.js","assets/DotsVertical-CbdEruUk.js","assets/Globe04-QDIAkI_1.js","assets/SwitchHorizontal01-DoMMYhWx.js","assets/Key01-yX9At---.js","assets/Link01-DdjCKN6E.js","assets/Minus-BvbXf1Sp.js","assets/Monitor01-CGq_FB6g.js","assets/Sun-DoDvwdQj.js","assets/Play-ChXZcgWf.js","assets/Plus-AFrvUoUc.js","assets/SearchMd-DSPN9QxV.js","assets/Trash01-B0glQHgK.js","assets/Upload01-BY0gIDxJ.js","assets/Users01-CfcMu04c.js","assets/XClose-wH9pi_Oq.js","assets/sandbox-start-errors-BK_aDCyt.js","assets/pair-DtO9iW-3.js","assets/collapsible-Dp7IveTF.js","assets/use-copy-BmESZuBQ.js","assets/usage-stats-Bfpi0erw.js","assets/tool-namespace-CrCuqBA7.js","assets/form-CqcvGBPS.js","assets/label-nAynIzRB.js","assets/utils-CVEq3hMx.js","assets/markdown-SDFpVgvK.js","assets/use-mobile-C_KOoyX9.js","assets/tooltip--hQ071uj.js","assets/index-Br9i6zHp.js","assets/use-clock-tick-DsgVgaMj.js","assets/content-blocks-o63cs2vh.js","assets/mcp-app-renderer-taIEo_0M.js","assets/types-vHdCIVHy.js","assets/omit-sandbox-map-jj4lCB2U.js","assets/shell-layout-CTdQsY_z.js","assets/use-deployment-admin-D9U88a6V.js","assets/admin-fetch-BhTJlAsX.js","assets/command-D_wtag_V.js","assets/index-CWrjSpv6.js","assets/integration-icon-C5QUXJ-_.js","assets/project-icon-B0SToVzq.js","assets/new-project-dialog-D-A0zxil.js","assets/repository-import-picker-DL_KXsuZ.js","assets/use-navigate-to-agent-CakeCNXj.js","assets/repository-picker-DR1imeoJ.js","assets/github-icon-CwEeHUg2.js","assets/useInfiniteQuery-DW7gjDqh.js","assets/infiniteQueryObserver-CJSP-r-Q.js","assets/collection-search-DKNF_aHL.js","assets/use-debounced-value-BC9-VsXG.js","assets/required-auth-layout-BfYIPzIZ.js","assets/use-org-sso-AxQjuMiC.js","assets/shell-layout-CE2Eihra.css","assets/sheet-Dwf0d2yk.js","assets/use-connection-DjcoL2xp.js","assets/use-mcp-prompts-B9D-ZvCI.js","assets/use-thread-outputs-CUfkYNKn.js","assets/file-type-icon-lZJfDHey.js","assets/section-array-field-C4Dn6tRH.js","assets/alert-Bbd8MBbC.js","assets/parse-sections-oAWkQEej.js","assets/blocks-tab-states-mp1yavun.js","assets/slider-CNTpN8Re.js","assets/index-C4tvJe6k.js","assets/index-BdQq_4o_.js","assets/tooltipContext-CzjEugcr.js","assets/CategoricalChart-DJYWdZLM.js","assets/index-Dx7zyr0h.js","assets/ActiveShapeUtils-BOoUrrHB.js","assets/Sector-BmhXcpO4.js","assets/symbol-C4rfRhzp.js","assets/site-editor-toast-C3--n_in.js","assets/use-session-runtime-D49ajMP-.js","assets/experiments-tab-choice-DkauT2Jo.js","assets/sandbox-url-D3mC8qhT.js","assets/use-sandbox-events-1Xx-AI1q.js","assets/sandbox-git-api-DcqI6XE4.js","assets/empty-state-DcLpc4zT.js","assets/switch-yYhcctGB.js","assets/textarea-DgBaFzwD.js","assets/popover-B6YbIo3T.js","assets/scroll-area-BCbl3S10.js","assets/monaco-editor-DhfBMl22.js","assets/editor-119-kR49.js","assets/calendar-5n1bBWkl.js","assets/select-CrEvL5z9.js","assets/editor-classes-2SvDzxJS.js","assets/core.esm-CeU7AJNb.js","assets/sortable.esm-c1-MiY5V.js","assets/toggle-group-zfRo99MM.js","assets/active-indicator-CCMhAsc_.js","assets/combobox-dysI95ld.js","assets/search-input-BvepfDCp.js","assets/tabs-CkNdZlhM.js","assets/use-file-configs-BQsdB00T.js","assets/asset-utils-CxWNRiZo.js","assets/match-site-slug-config-D3fUJ6vX.js","assets/mustache-PKt0frjT.js","assets/use-section-preview-base-DA9S2k6x.js","assets/section-preview-url-7zfngvgW.js","assets/page-seo-form-DH-Hxxys.js","assets/use-apply-named-rule-Bv8beIr1.js","assets/use-move-blocks-mCIJarBI.js","assets/variant-matcher-override-D08bT7BW.js","assets/variant-draft-pointer-BeAKcq_c.js"])))=>i.map(i=>d[i]);
2
- import{c as ce,j as n,r as C,l as De,b as Pe,B as Me,aK as Xt,b9 as ot,aL as Ae,ba as Sa,bb as Pa,bc as ja,bd as Ea,v as rr,D as ar,K as or,w as ir,x as lr,e as Na,h as Tt,I as Rs,y as Ca,be as Ta,a4 as zs,b2 as La,b7 as Ra,ax as As,az as _s,a7 as cr,P as Os,C as Aa,t as Zt,b8 as _a,q as Oa,m as Da}from"./index-DQge_BLv.js";import{u as dr,g as Ba,c as Nn,B as Ss,P as $a,r as Ma,R as Fa,a as za,H as Ka,b as ur,S as Ia,d as Ua,l as Ha,m as Va,e as qa,f as Ps,N as Wa}from"./held-block-view-BxrII4AU.js";import{b as Ga,c as Lt,r as fr,l as pr,f as Ja,g as Ya,w as Qa}from"./chat-context-DJQNHpnm.js";import{t as Xa}from"./ChevronUp-DYWuPRic.js";import{S as Za,T as eo,M as mr,U as to,V as so,b as no,W as ro,X as hr,Y as ao,Z as gr,_ as Cn,$ as oo}from"./agent-icon-DO8s6ea2.js";import{a as io,n as lo}from"./UserSquare-BhJx3glH.js";import{s as vr}from"./Plus-AFrvUoUc.js";import{a as xr,b as br,P as yr}from"./popover-B6YbIo3T.js";import{a as Et,b as Nt,c as wr,d as kr,e as Sr,C as Pr}from"./command-D_wtag_V.js";import{c as co,d as uo,a as fo}from"./repository-binding-BSdKE2Qo.js";import{a as Rt}from"./sandbox-lifecycle-context-DObzOH6l.js";import{e as po}from"./backoff-CrEUbyZT.js";import{r as mo}from"./thread-intent-BXZYb_rR.js";import{u as jr}from"./use-session-runtime-D49ajMP-.js";import{S as Er,d as ho,f as go,i as vo,g as xo,h as bo,j as yo,k as wo,u as ss,l as Ks,m as at,n as ko,o as So,q as Po,c as Nr,b as Cr,t as jo,v as He,w as Eo,x as No,y as Co,z as Tn,A as To,B as Lo,C as Ln,D as Ro,E as Ao,e as _o}from"./site-editor-toast-C3--n_in.js";import{u as Tr}from"./use-mobile-C_KOoyX9.js";import{T as lt,a as ct,c as dt}from"./tooltip--hQ071uj.js";import{T as We}from"./toolbar-icon-button-B0tBxUCb.js";import{w as Wt,i as Oo}from"./variant-matcher-override-D08bT7BW.js";import{b as Do,w as Rn}from"./variant-draft-pointer-BeAKcq_c.js";import{u as Lr,i as Bo,B as $o,S as Mo,C as Fo,a as zo,c as Ko,b as Io,d as Uo,l as Ho,D as Vo}from"./blocks-tab-states-mp1yavun.js";import{s as Ct,n as Is,a as Rr,f as Ve,v as Ar,h as qo,e as Wo,b as Go,c as Jo,g as Yo,p as Qo,N as Xo,d as Zo,r as ei,i as An,j as ti}from"./parse-sections-oAWkQEej.js";import{r as si,D as _n,w as On,b as Dn,a as ni}from"./section-preview-url-7zfngvgW.js";import{p as ri,a as ai,u as oi,b as Bn}from"./use-fast-preview-draft-url-C3Zsdb8u.js";import{a as ii,b as _r}from"./shell-layout-CTdQsY_z.js";import{u as Us,b as li}from"./use-sandbox-events-1Xx-AI1q.js";import{u as Ds}from"./useQueries-Bzc1vZ08.js";import{i as ci}from"./LinkBroken01-BFQs5QxW.js";import{u as Or}from"./blocks-preview-workspace-context-v-05bFgy.js";import{MonacoCodeEditor as di}from"./monaco-editor-DhfBMl22.js";import{d as ui}from"./utils-CeKg1A9t.js";import{R as $n,a as Gt,b as Mn}from"./resizable-STcRbiPL.js";import{u as fi,a as js}from"./experiments-tab-choice-DkauT2Jo.js";import{w as Bs}from"./device-hint-SeLRi17j.js";import{L as pi}from"./label-nAynIzRB.js";import{a as mi,T as Fn}from"./toggle-group-zfRo99MM.js";import{h as Dr,w as hi,a as zn}from"./preview-link-C762yHOt.js";import{r as gi,R as vi}from"./virtual-mcp-DonQ6N9_.js";import{d as xi}from"./delay-CnY5UFtP.js";import{s as Br}from"./XClose-wH9pi_Oq.js";import{o as bi}from"./omit-sandbox-map-jj4lCB2U.js";import{a as Es,b as yi,w as wi,n as Kn}from"./app-preview-url-9Od4s8Sz.js";import{a as ki}from"./use-organization-settings-BgGp5lk4.js";import{E as Si}from"./empty-state-DcLpc4zT.js";import{G as In}from"./github-icon-CwEeHUg2.js";import{R as Pi}from"./repository-import-picker-DL_KXsuZ.js";import{r as ji}from"./preview-source-BsRLGWUP.js";import{C as Ei,s as Ni,L as Ci,R as es,D as Un}from"./section-array-field-C4Dn6tRH.js";import{A as Ti,a as Li,b as Ri}from"./alert-Bbd8MBbC.js";import{u as Ai}from"./use-task-metadata-B2VBxxWt.js";function _i(t){const e=ce.c(10),{waiting:s}=t,r=s?"true":"false";let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx("span",{className:"flex size-10 items-center justify-center rounded-xl bg-muted text-muted-foreground sm:size-12",children:n.jsx(Za,{className:"size-5 sm:size-6"})}),e[0]=a):a=e[0];let d;e[1]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx("span",{className:"h-px w-full border-t border-dashed border-muted-foreground/40"}),e[1]=d):d=e[1];let o;e[2]!==s?(o=s&&n.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]=s,e[3]=o):o=e[3];let i;e[4]!==o?(i=n.jsxs("span",{className:"relative flex h-2 w-16 items-center sm:w-20",children:[d,o]}),e[4]=o,e[5]=i):i=e[5];let c;e[6]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx("span",{className:"flex size-10 items-center justify-center rounded-xl bg-muted text-muted-foreground sm:size-12",children:n.jsx(eo,{className:"size-5 sm:size-6"})}),e[6]=c):c=e[6];let l;return e[7]!==r||e[8]!==i?(l=n.jsxs("div",{"aria-hidden":"true","data-testid":"connection-wire","data-waiting":r,className:"flex items-center gap-2",children:[a,i,c]}),e[7]=r,e[8]=i,e[9]=l):l=e[9],l}function Oi(t){const e=ce.c(25),{index:s,numbered:r,step:a,heading:d}=t,o=C.useId();let i;e[0]!==s||e[1]!==r?(i=r&&n.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:s}),e[0]=s,e[1]=r,e[2]=i):i=e[2];let c;e[3]!==d||e[4]!==o||e[5]!==a.title?(c=n.jsx(d,{id:o,className:"text-sm font-medium text-foreground",children:a.title}),e[3]=d,e[4]=o,e[5]=a.title,e[6]=c):c=e[6];let l;e[7]!==i||e[8]!==c?(l=n.jsxs("div",{className:"flex items-center gap-3",children:[i,c]}),e[7]=i,e[8]=c,e[9]=l):l=e[9];const m=r&&"sm:pl-9";let p;e[10]!==m?(p=De("flex min-w-0 flex-col gap-3",m),e[10]=m,e[11]=p):p=e[11];let f;e[12]!==a.body?(f=a.body&&n.jsx("p",{className:"text-sm text-muted-foreground",children:a.body}),e[12]=a.body,e[13]=f):f=e[13];let x;e[14]!==a.command?(x=a.command&&n.jsx(Ei,{command:a.command}),e[14]=a.command,e[15]=x):x=e[15];let h;e[16]!==a.after||e[17]!==p||e[18]!==f||e[19]!==x?(h=n.jsxs("div",{className:p,children:[f,x,a.after]}),e[16]=a.after,e[17]=p,e[18]=f,e[19]=x,e[20]=h):h=e[20];let j;return e[21]!==o||e[22]!==l||e[23]!==h?(j=n.jsxs("li",{"aria-labelledby":o,className:"surface flex flex-col gap-3 p-4 sm:p-5",children:[l,h]}),e[21]=o,e[22]=l,e[23]=h,e[24]=j):j=e[24],j}const Di=[];function ts(t){const e=ce.c(20),{title:s,lead:r,waiting:a,alerts:d,steps:o,footer:i,headingLevel:c}=t,l=o===void 0?Di:o,m=c===void 0?1:c,p=m===1?"h1":"h2",f=a&&l.length===0?"status":void 0;let x;e[0]!==a?(x=n.jsx(_i,{waiting:a}),e[0]=a,e[1]=x):x=e[1];let h;e[2]!==p||e[3]!==s?(h=n.jsx(p,{tabIndex:-1,className:"text-balance text-lg font-medium text-foreground outline-none sm:text-xl",children:s}),e[2]=p,e[3]=s,e[4]=h):h=e[4];let j;e[5]!==r?(j=r&&n.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]!==h||e[10]!==j?(g=n.jsxs("header",{role:f,className:"flex flex-col items-center gap-3 text-center",children:[x,h,j]}),e[7]=f,e[8]=x,e[9]=h,e[10]=j,e[11]=g):g=e[11];let b;e[12]!==m||e[13]!==l?(b=l.length>0&&n.jsx("ol",{className:"flex flex-col gap-3",children:l.map((y,v)=>n.jsx(Oi,{index:v+1,numbered:l.length>1,step:y,heading:m===1?"h2":"h3"},y.title))}),e[12]=m,e[13]=l,e[14]=b):b=e[14];let N;return e[15]!==d||e[16]!==i||e[17]!==g||e[18]!==b?(N=n.jsx("div",{className:"h-full w-full overflow-y-auto",children:n.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,d,b,i]})}),e[15]=d,e[16]=i,e[17]=g,e[18]=b,e[19]=N):N=e[19],N}function Bi(t){const e=ce.c(55),{wait:s,hosts:r,invalidLink:a}=t,d=a===void 0?!1:a,o=Pe();let i;e[0]!==d||e[1]!==o?(i=d&&n.jsx(Ti,{variant:"warning",children:n.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[n.jsx(Li,{className:"line-clamp-none text-foreground",children:o("decoServe.link.invalidTitle")}),n.jsx(Ri,{children:o("decoServe.link.invalidBody")})]})}),e[0]=d,e[1]=o,e[2]=i):i=e[2];const c=i;if(s.kind==="problem"){let R;e[3]!==o||e[4]!==s.host||e[5]!==s.problem?(R=Ni(o,s.problem,s.host),e[3]=o,e[4]=s.host,e[5]=s.problem,e[6]=R):R=e[6];const{title:O,body:T}=R;let L;e[7]!==T?(L=n.jsx(es,{text:T}),e[7]=T,e[8]=L):L=e[8];let D;e[9]===Symbol.for("react.memo_cache_sentinel")?(D=n.jsx(Un,{className:"border-t border-border pt-4",links:["troubleshooting","serve"]}),e[9]=D):D=e[9];let A;return e[10]!==c||e[11]!==L||e[12]!==O?(A=n.jsx(ts,{headingLevel:2,waiting:!1,title:O,lead:L,alerts:c,footer:D}),e[10]=c,e[11]=L,e[12]=O,e[13]=A):A=e[13],A}const l=s.kind==="looking",m=l&&!s.paused;let p;e[14]!==o?(p=o("decoServe.waiting.title"),e[14]=o,e[15]=p):p=e[15];let f;e[16]!==o?(f=o("decoServe.waiting.lead"),e[16]=o,e[17]=f):f=e[17];let x;e[18]!==c||e[19]!==s.kind?(x=(c||s.kind==="denied")&&n.jsxs(n.Fragment,{children:[c,s.kind==="denied"&&n.jsx(Ci,{})]}),e[18]=c,e[19]=s.kind,e[20]=x):x=e[20];let h;e[21]!==o?(h=o("decoServe.guide.step1.title"),e[21]=o,e[22]=h):h=e[22];let j;e[23]!==o?(j=o("decoServe.guide.step1.body"),e[23]=o,e[24]=j):j=e[24];let g;e[25]!==j?(g=n.jsx(es,{text:j}),e[25]=j,e[26]=g):g=e[26];let b;e[27]!==h||e[28]!==g?(b={title:h,body:g,command:Er},e[27]=h,e[28]=g,e[29]=b):b=e[29];let N;e[30]!==o?(N=o("decoServe.waiting.step2.title"),e[30]=o,e[31]=N):N=e[31];let y;e[32]!==o?(y=o("decoServe.waiting.step2.body"),e[32]=o,e[33]=y):y=e[33];let v;e[34]!==r||e[35]!==l||e[36]!==o||e[37]!==s.kind||e[38]!==s.onStart||e[39]!==s.paused?(v=s.kind==="needs-gesture"?n.jsx(Me,{variant:"outline",className:"self-start",onClick:s.onStart,children:o("decoServe.guide.step2.start")}):l&&n.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:s.paused?o("decoServe.guide.step2.paused"):o("decoServe.guide.step2.looking",{hosts:r})}),e[34]=r,e[35]=l,e[36]=o,e[37]=s.kind,e[38]=s.onStart,e[39]=s.paused,e[40]=v):v=e[40];let P;e[41]!==N||e[42]!==y||e[43]!==v?(P={title:N,body:y,after:v},e[41]=N,e[42]=y,e[43]=v,e[44]=P):P=e[44];let E;e[45]!==b||e[46]!==P?(E=[b,P],e[45]=b,e[46]=P,e[47]=E):E=e[47];let k;e[48]===Symbol.for("react.memo_cache_sentinel")?(k=n.jsx(Un,{className:"border-t border-border pt-4",links:["siteEditor","serve","troubleshooting"]}),e[48]=k):k=e[48];let S;return e[49]!==E||e[50]!==m||e[51]!==p||e[52]!==f||e[53]!==x?(S=n.jsx(ts,{headingLevel:2,waiting:m,title:p,lead:f,alerts:x,steps:E,footer:k}),e[49]=E,e[50]=m,e[51]=p,e[52]=f,e[53]=x,e[54]=S):S=e[54],S}function $i(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 Mi=15e3,Fi=3e3;function zi(t){const{candidates:e,probe:s,onFound:r,onChange:a,doc:d=document,setTimer:o=(v,P)=>setTimeout(v,P),clearTimer:i=v=>clearTimeout(v),timeoutMs:c=Fi}=t;let l={status:"searching",firstRoundDone:!1,problem:null},m=!1,p=!1,f=0,x=null,h=null;const j=()=>d.visibilityState==="hidden",g=v=>{l={...l,...v},a(l)},b=async v=>{h=new AbortController;const P=h,E=o(()=>P.abort(),c);try{return await s(v,P.signal),!0}catch(k){if(m)return!1;const S=go(k);return S.reason!=="not-answering"?g({problem:{...S,endpoint:v}}):l.problem?.endpoint===v&&g({problem:null}),!1}finally{i(E),h=null}},N=async()=>{if(x=null,!(m||p)){if(e.length===0){g({status:"stopped",firstRoundDone:!0});return}if(j()){g({status:"paused"});return}p=!0,l.status!=="searching"&&g({status:"searching"});for(const v of e){if(m)break;if(await b(v)){if(p=!1,m)return;m=!0,d.removeEventListener("visibilitychange",y),g({status:"found",firstRoundDone:!0}),r(v);return}}if(p=!1,!m){if(f+=1,l.firstRoundDone||g({firstRoundDone:!0}),j()){g({status:"paused"});return}x=o(()=>{N()},ho(f,Mi))}}};function y(){if(!m){if(j()){x!==null&&(i(x),x=null),p||g({status:"paused"});return}x!==null&&i(x),f=0,N()}}return d.addEventListener("visibilitychange",y),a(l),N(),()=>{m=!0,x!==null&&i(x),h?.abort(),d.removeEventListener("visibilitychange",y)}}function Ki(t,e){return xo(bo({endpoint:t,fetch:s=>fetch(s,{signal:e})}))}const Ii=["loopback-network","local-network-access"];async function Ui(){if(vo(window.location.origin))return null;for(const t of Ii)try{return await navigator.permissions.query({name:t})}catch{}return null}let $r=null,Hn=!1;const Ns=new Set;function Hi(t){if(Ns.add(t),!Hn){Hn=!0;const e=s=>{$r=s;for(const r of Ns)r()};Ui().then(s=>{if(!s)return e("unsupported");e(s.state),s.addEventListener("change",()=>e(s.state))})}return()=>Ns.delete(t)}const Vi={status:"stopped",firstRoundDone:!1,problem:null},Cs=new Map;function qi(t){const e=Cs.get(t);if(e)return e;let s={status:"searching",firstRoundDone:!1,problem:null};const r=new Set;let a=null;const d={onFound:()=>{},getSnapshot:()=>s,subscribe:o=>(r.add(o),a??=zi({candidates:t.split(" "),probe:Ki,onFound:i=>d.onFound(i),onChange:i=>{s=i;for(const c of r)c()}}),()=>{r.delete(o),!(r.size>0)&&(a?.(),a=null,Cs.delete(t))})};return Cs.set(t,d),d}function Mr(){return C.useSyncExternalStore(Hi,qn,qn)}const Wi=()=>()=>{},Vn=()=>Vi,qn=()=>$r;function zd(t){const e=ce.c(9),{candidates:s,onFound:r}=t,[a,d]=C.useState(!1),o=Mr(),c=(o==="granted"||o==="unsupported"||o==="prompt"&&a)&&s.length>0;let l;e[0]!==c||e[1]!==s||e[2]!==r?(l=c?qi(s.join(" ")):null,l&&(l.onFound=r),e[0]=c,e[1]=s,e[2]=r,e[3]=l):l=e[3];const m=C.useSyncExternalStore(l?.subscribe??Wi,l?.getSnapshot??Vn,l?.getSnapshot??Vn),p=o==="prompt"&&!a;let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=()=>d(!0),e[4]=f):f=e[4];let x;return e[5]!==o||e[6]!==m||e[7]!==p?(x={state:m,access:o,needsGesture:p,start:f},e[5]=o,e[6]=m,e[7]=p,e[8]=x):x=e[8],x}const Ts={mode:"none",iframeBase:null,showBlockingOverlay:!1,showWakingPill:!1};function Gi(t){const{previewState:e,progressStatus:s,fastPreviewActive:r=!1,fastPreviewReady:a=!1,codingSession:d=!1,hostedDraft:o=!1}=t,i=d?null:t.previewServerUrl;return t.deciding?{...Ts,showDecidingLoader:!0}:t.localPreviewUrl?{mode:"sandbox",iframeBase:t.localPreviewUrl,showBlockingOverlay:!1,showWakingPill:!1}:e.kind==="suspended"||e.kind==="errored"?Ts:o&&t.hostedPointerPending&&!a?{...Ts,showDecidingLoader:!0}:r&&a&&i?{mode:"production",iframeBase:i,showBlockingOverlay:!1,showWakingPill:!1}:r&&o&&i?{mode:"production",iframeBase:i,showBlockingOverlay:!1,showWakingPill:!1}:!r&&e.kind==="iframe"&&s!=="doing"?{mode:"sandbox",iframeBase:e.previewUrl,showBlockingOverlay:!1,showWakingPill:!1}:i?{mode:"production",iframeBase:i,showBlockingOverlay:!1,showWakingPill:!0}:{mode:"none",iframeBase:null,showBlockingOverlay:!0,showWakingPill:!1}}const Ji=1e4,Yi=1e3,Qi=3e4;function Xi({iframeRef:t,src:e,active:s}){const r=C.useRef(0),a=C.useRef(null),d=C.useRef(null),o=C.useRef(e),i=C.useRef(s);o.current=e,i.current=s;const c=()=>{a.current&&clearTimeout(a.current),d.current&&clearTimeout(d.current),a.current=null,d.current=null},l=()=>{a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{a.current=null,m()},Ji)},m=()=>{if(!i.current||!o.current)return;d.current&&clearTimeout(d.current);const x=po(Qi,Yi,r.current,2,.5);r.current+=1,d.current=setTimeout(()=>{d.current=null;const h=t.current,j=o.current;!h||!j||!i.current||(h.src=j,l())},x)},p=()=>{r.current=0,c()},f=()=>{a.current&&(clearTimeout(a.current),a.current=null),m()};return C.useEffect(()=>{if(c(),r.current=0,!(!s||!e))return l(),c},[e,s]),{handleLoad:p,handleError:f}}const Zi=1500,el=500;function tl({iframe:t,reload:e,waitMs:s=Zi,confirmMs:r=el}){let a;const d=()=>{clearTimeout(o),a=setTimeout(e,r)};t.addEventListener("load",d,{once:!0});const o=setTimeout(()=>{t.removeEventListener("load",d),e()},s);return()=>{clearTimeout(o),clearTimeout(a),t.removeEventListener("load",d)}}const sl=Xt({tag:Ae(),id:Ae(),classes:Ae(),text:Ae(),html:Ae(),manifestKey:Ae().nullable(),componentName:Ae().nullable(),parents:Ae(),url:Ae(),path:Ae(),viewport:Xt({width:ot(),height:ot()}),position:Xt({x:ot(),y:ot()})}),nl=`(function() {
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/sections-editor-p5iYgj5l.js","assets/index-LISCRMKT.js","assets/index-By_-wb1N.css","assets/chat-context-Cbn1d2gD.js","assets/use-panel-navigate-CnrhnUVG.js","assets/thread-route-CCN9I68_.js","assets/use-project-scope-LiKIXaiK.js","assets/repository-binding-N72ZtnJ7.js","assets/use-mcp-client-0e8NRgfT.js","assets/auth-Dt9DGFhA.js","assets/autosend-BYljpA5c.js","assets/thread-intent-ptqgtSKo.js","assets/delay-CnY5UFtP.js","assets/backoff-CrEUbyZT.js","assets/watch-sse-pool-CBQ2__fw.js","assets/task-board-DfACAZyY.js","assets/schema-C2dfCTpF.js","assets/slugify-CEUa2lfQ.js","assets/use-entitlements-9vbVfq68.js","assets/use-ai-providers-DGRaKYBP.js","assets/location-V0VwTJTt.js","assets/use-decopilot-events-ChnGZu8F.js","assets/use-organization-settings-CK8r9oqu.js","assets/held-block-view-BDu8bj-6.js","assets/utils-BDRBqTP5.js","assets/ZoomOut-9x8WuC5l.js","assets/Image01-D9f6XNAl.js","assets/agent-icon-Co7E9kYl.js","assets/AlertCircle-Pu-QR8hS.js","assets/Tool01-CkZTily1.js","assets/ArrowUp-bMBjrwqG.js","assets/ArrowLeft-CiCYDVFq.js","assets/LinkBroken01-BeLPonYT.js","assets/ShoppingBag01-CeVNpa4z.js","assets/Building02-BejNykWR.js","assets/CheckCircle-CiBrtkwP.js","assets/ChevronUp-D3pnxmNi.js","assets/ChevronSelectorVertical-Bb_Zani-.js","assets/UserSquare-D7fSnIn3.js","assets/Copy01-BEOZtg79.js","assets/CreditCard01-C2H6wRye.js","assets/DotsVertical-DddKhPwC.js","assets/Globe04-CR7aWwIq.js","assets/SwitchHorizontal01-B8-pBEhT.js","assets/Key01-BGQzZTLx.js","assets/Link01-_AjEk0aG.js","assets/Minus-DRtjDVr0.js","assets/Monitor01-CMcPb3p-.js","assets/Sun-E-EbUc0n.js","assets/Play-Bon9Nn-R.js","assets/Plus-DZ8OV5bq.js","assets/SearchMd-Coxjt-Zl.js","assets/Trash01-C8OxhBl3.js","assets/Upload01-Bt37Plwz.js","assets/Users01-DVEy527M.js","assets/XClose-Bvl4KGPV.js","assets/sandbox-start-errors-BK_aDCyt.js","assets/pair-B_hske_9.js","assets/collapsible-DMa5aTxw.js","assets/use-copy-Bb3ge3Jw.js","assets/usage-stats-DyqnqVDM.js","assets/tool-namespace-EPn7Kyb1.js","assets/form-Bk9ymCIS.js","assets/label-BfYbFBpZ.js","assets/utils-CVEq3hMx.js","assets/markdown-CGLGjJUn.js","assets/use-mobile-BJBInbLU.js","assets/tooltip-DiW2ytsS.js","assets/index-KpWMq2p9.js","assets/use-clock-tick-BXkjZk4h.js","assets/content-blocks-o63cs2vh.js","assets/mcp-app-renderer-BmH0oH65.js","assets/types-CAqly_33.js","assets/omit-sandbox-map-jj4lCB2U.js","assets/shell-layout-DUwEP5qi.js","assets/use-deployment-admin-Do6VU3ed.js","assets/admin-fetch-BhTJlAsX.js","assets/command-lP5P8rqX.js","assets/index-BaOc9Ezz.js","assets/integration-icon-msZhQ6E3.js","assets/project-icon-As9MoCET.js","assets/new-project-dialog-BrtI6GgZ.js","assets/repository-import-picker-CNVRTxph.js","assets/use-navigate-to-agent-CpRnIp1k.js","assets/repository-picker-CW0SaV-m.js","assets/github-icon-EmEurWMX.js","assets/useInfiniteQuery-ChletbBT.js","assets/infiniteQueryObserver-DGdbL4U6.js","assets/collection-search-BtpA2Lei.js","assets/use-debounced-value-DBl2u8Ax.js","assets/required-auth-layout-BwkU_8aI.js","assets/use-org-sso-DVHlBcmx.js","assets/shell-layout-CE2Eihra.css","assets/sheet-C1Iz_daC.js","assets/use-connection-DZPkoV0a.js","assets/use-mcp-prompts-B2c7TGKV.js","assets/use-thread-outputs-BT4PyLKe.js","assets/file-type-icon-CiMMiUYO.js","assets/section-array-field-cPwKvhUj.js","assets/alert-BF8n9shl.js","assets/parse-sections-rTJ9Vxva.js","assets/blocks-tab-states-CQydf1x6.js","assets/slider-BRlhk1I_.js","assets/index-Bd1JsEWx.js","assets/index-BdQq_4o_.js","assets/tooltipContext-Boh-kskS.js","assets/CategoricalChart-1g-OhB34.js","assets/index-DMJwbqhe.js","assets/ActiveShapeUtils-HI4PJ-HL.js","assets/Sector-CNB3zVjr.js","assets/symbol-AaQxOm0Y.js","assets/site-editor-toast-BZwEeugO.js","assets/use-session-runtime-PX0UU1rX.js","assets/experiments-tab-choice-EKyQNqty.js","assets/sandbox-url-D3mC8qhT.js","assets/use-sandbox-events-BAik2LAS.js","assets/sandbox-git-api-DcqI6XE4.js","assets/empty-state-CEJi6IVu.js","assets/switch-B5fLkk4G.js","assets/textarea-1B6eWYpg.js","assets/popover-D6dCz_8d.js","assets/scroll-area-DYvdRQ3X.js","assets/monaco-editor-B_hB8uvI.js","assets/editor-Z7h3tdjo.js","assets/calendar-gk2fXc2c.js","assets/select-Ce8n-RXJ.js","assets/editor-classes-CIysMLqw.js","assets/core.esm-M1IJOkIH.js","assets/sortable.esm-DfWQuMf-.js","assets/toggle-group-DhjHoFhg.js","assets/active-indicator-CCMhAsc_.js","assets/combobox-BwKhFDqj.js","assets/search-input-DfJJHgak.js","assets/tabs-BeQ3GpBj.js","assets/use-file-configs-Dn7YLM4Z.js","assets/asset-utils-7zQmpZtP.js","assets/match-site-slug-config-D3fUJ6vX.js","assets/mustache-YJnhKKzZ.js","assets/use-section-preview-base-CLumQxEU.js","assets/section-preview-url-7zfngvgW.js","assets/page-seo-form-CdFLhDD2.js","assets/use-apply-named-rule-TltIMgYp.js","assets/use-move-blocks-sjThA1Ew.js","assets/variant-matcher-override-D6IszGLS.js","assets/variant-draft-pointer-BeAKcq_c.js"])))=>i.map(i=>d[i]);
2
+ import{c as ce,j as n,r as C,l as De,b as Pe,B as Me,aK as Xt,b9 as ot,aL as Ae,ba as Sa,bb as Pa,bc as ja,bd as Ea,v as rr,D as ar,K as or,w as ir,x as lr,e as Na,h as Tt,I as Rs,y as Ca,be as Ta,a4 as zs,b2 as La,b7 as Ra,aw as As,ay as _s,a7 as cr,P as Os,C as Aa,t as Zt,b8 as _a,q as Oa,m as Da}from"./index-LISCRMKT.js";import{u as dr,g as Ba,c as Nn,B as Ss,P as $a,r as Ma,R as Fa,a as za,H as Ka,b as ur,S as Ia,d as Ua,l as Ha,m as Va,e as qa,f as Ps,N as Wa}from"./held-block-view-BDu8bj-6.js";import{b as Ga,c as Lt,r as fr,l as pr,f as Ja,g as Ya,w as Qa}from"./chat-context-Cbn1d2gD.js";import{t as Xa}from"./ChevronUp-D3pnxmNi.js";import{S as Za,T as eo,M as mr,U as to,V as so,b as no,W as ro,X as hr,Y as ao,Z as gr,_ as Cn,$ as oo}from"./agent-icon-Co7E9kYl.js";import{a as io,n as lo}from"./UserSquare-D7fSnIn3.js";import{s as vr}from"./Plus-DZ8OV5bq.js";import{a as xr,b as br,P as yr}from"./popover-D6dCz_8d.js";import{a as Et,b as Nt,c as wr,d as kr,e as Sr,C as Pr}from"./command-lP5P8rqX.js";import{c as co,d as uo,a as fo}from"./repository-binding-N72ZtnJ7.js";import{a as Rt}from"./sandbox-lifecycle-context-BBDd5Vd6.js";import{e as po}from"./backoff-CrEUbyZT.js";import{r as mo}from"./thread-intent-ptqgtSKo.js";import{u as jr}from"./use-session-runtime-PX0UU1rX.js";import{S as Er,d as ho,f as go,i as vo,g as xo,h as bo,j as yo,k as wo,u as ss,l as Ks,m as at,n as ko,o as So,q as Po,c as Nr,b as Cr,t as jo,v as He,w as Eo,x as No,y as Co,z as Tn,A as To,B as Lo,C as Ln,D as Ro,E as Ao,e as _o}from"./site-editor-toast-BZwEeugO.js";import{u as Tr}from"./use-mobile-BJBInbLU.js";import{T as lt,a as ct,c as dt}from"./tooltip-DiW2ytsS.js";import{T as We}from"./toolbar-icon-button-DOtu5VNi.js";import{w as Wt,i as Oo}from"./variant-matcher-override-D6IszGLS.js";import{b as Do,w as Rn}from"./variant-draft-pointer-BeAKcq_c.js";import{u as Lr,i as Bo,B as $o,S as Mo,C as Fo,a as zo,c as Ko,b as Io,d as Uo,l as Ho,D as Vo}from"./blocks-tab-states-CQydf1x6.js";import{s as Ct,n as Is,a as Rr,f as Ve,v as Ar,h as qo,e as Wo,b as Go,c as Jo,g as Yo,p as Qo,N as Xo,d as Zo,r as ei,i as An,j as ti}from"./parse-sections-rTJ9Vxva.js";import{r as si,D as _n,w as On,b as Dn,a as ni}from"./section-preview-url-7zfngvgW.js";import{p as ri,a as ai,u as oi,b as Bn}from"./use-fast-preview-draft-url-CXQ7cT85.js";import{a as ii,b as _r}from"./shell-layout-DUwEP5qi.js";import{u as Us,b as li}from"./use-sandbox-events-BAik2LAS.js";import{u as Ds}from"./useQueries-nk-gppMK.js";import{i as ci}from"./LinkBroken01-BeLPonYT.js";import{u as Or}from"./blocks-preview-workspace-context-DQj4RBd8.js";import{MonacoCodeEditor as di}from"./monaco-editor-B_hB8uvI.js";import{d as ui}from"./utils-BDRBqTP5.js";import{R as $n,a as Gt,b as Mn}from"./resizable-WR3fdR8J.js";import{u as fi,a as js}from"./experiments-tab-choice-EKyQNqty.js";import{w as Bs}from"./device-hint-SeLRi17j.js";import{L as pi}from"./label-BfYbFBpZ.js";import{a as mi,T as Fn}from"./toggle-group-DhjHoFhg.js";import{h as Dr,w as hi,a as zn}from"./preview-link-C762yHOt.js";import{r as gi,R as vi}from"./virtual-mcp-C5JzNRIg.js";import{d as xi}from"./delay-CnY5UFtP.js";import{s as Br}from"./XClose-Bvl4KGPV.js";import{o as bi}from"./omit-sandbox-map-jj4lCB2U.js";import{a as Es,b as yi,w as wi,n as Kn}from"./app-preview-url-9Od4s8Sz.js";import{a as ki}from"./use-organization-settings-CK8r9oqu.js";import{E as Si}from"./empty-state-CEJi6IVu.js";import{G as In}from"./github-icon-EmEurWMX.js";import{R as Pi}from"./repository-import-picker-CNVRTxph.js";import{r as ji}from"./preview-source-BsRLGWUP.js";import{C as Ei,s as Ni,L as Ci,R as es,D as Un}from"./section-array-field-cPwKvhUj.js";import{A as Ti,a as Li,b as Ri}from"./alert-BF8n9shl.js";import{u as Ai}from"./use-task-metadata-De52Dfmg.js";function _i(t){const e=ce.c(10),{waiting:s}=t,r=s?"true":"false";let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx("span",{className:"flex size-10 items-center justify-center rounded-xl bg-muted text-muted-foreground sm:size-12",children:n.jsx(Za,{className:"size-5 sm:size-6"})}),e[0]=a):a=e[0];let d;e[1]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx("span",{className:"h-px w-full border-t border-dashed border-muted-foreground/40"}),e[1]=d):d=e[1];let o;e[2]!==s?(o=s&&n.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]=s,e[3]=o):o=e[3];let i;e[4]!==o?(i=n.jsxs("span",{className:"relative flex h-2 w-16 items-center sm:w-20",children:[d,o]}),e[4]=o,e[5]=i):i=e[5];let c;e[6]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx("span",{className:"flex size-10 items-center justify-center rounded-xl bg-muted text-muted-foreground sm:size-12",children:n.jsx(eo,{className:"size-5 sm:size-6"})}),e[6]=c):c=e[6];let l;return e[7]!==r||e[8]!==i?(l=n.jsxs("div",{"aria-hidden":"true","data-testid":"connection-wire","data-waiting":r,className:"flex items-center gap-2",children:[a,i,c]}),e[7]=r,e[8]=i,e[9]=l):l=e[9],l}function Oi(t){const e=ce.c(25),{index:s,numbered:r,step:a,heading:d}=t,o=C.useId();let i;e[0]!==s||e[1]!==r?(i=r&&n.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:s}),e[0]=s,e[1]=r,e[2]=i):i=e[2];let c;e[3]!==d||e[4]!==o||e[5]!==a.title?(c=n.jsx(d,{id:o,className:"text-sm font-medium text-foreground",children:a.title}),e[3]=d,e[4]=o,e[5]=a.title,e[6]=c):c=e[6];let l;e[7]!==i||e[8]!==c?(l=n.jsxs("div",{className:"flex items-center gap-3",children:[i,c]}),e[7]=i,e[8]=c,e[9]=l):l=e[9];const m=r&&"sm:pl-9";let p;e[10]!==m?(p=De("flex min-w-0 flex-col gap-3",m),e[10]=m,e[11]=p):p=e[11];let f;e[12]!==a.body?(f=a.body&&n.jsx("p",{className:"text-sm text-muted-foreground",children:a.body}),e[12]=a.body,e[13]=f):f=e[13];let x;e[14]!==a.command?(x=a.command&&n.jsx(Ei,{command:a.command}),e[14]=a.command,e[15]=x):x=e[15];let h;e[16]!==a.after||e[17]!==p||e[18]!==f||e[19]!==x?(h=n.jsxs("div",{className:p,children:[f,x,a.after]}),e[16]=a.after,e[17]=p,e[18]=f,e[19]=x,e[20]=h):h=e[20];let j;return e[21]!==o||e[22]!==l||e[23]!==h?(j=n.jsxs("li",{"aria-labelledby":o,className:"surface flex flex-col gap-3 p-4 sm:p-5",children:[l,h]}),e[21]=o,e[22]=l,e[23]=h,e[24]=j):j=e[24],j}const Di=[];function ts(t){const e=ce.c(20),{title:s,lead:r,waiting:a,alerts:d,steps:o,footer:i,headingLevel:c}=t,l=o===void 0?Di:o,m=c===void 0?1:c,p=m===1?"h1":"h2",f=a&&l.length===0?"status":void 0;let x;e[0]!==a?(x=n.jsx(_i,{waiting:a}),e[0]=a,e[1]=x):x=e[1];let h;e[2]!==p||e[3]!==s?(h=n.jsx(p,{tabIndex:-1,className:"text-balance text-lg font-medium text-foreground outline-none sm:text-xl",children:s}),e[2]=p,e[3]=s,e[4]=h):h=e[4];let j;e[5]!==r?(j=r&&n.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]!==h||e[10]!==j?(g=n.jsxs("header",{role:f,className:"flex flex-col items-center gap-3 text-center",children:[x,h,j]}),e[7]=f,e[8]=x,e[9]=h,e[10]=j,e[11]=g):g=e[11];let b;e[12]!==m||e[13]!==l?(b=l.length>0&&n.jsx("ol",{className:"flex flex-col gap-3",children:l.map((y,v)=>n.jsx(Oi,{index:v+1,numbered:l.length>1,step:y,heading:m===1?"h2":"h3"},y.title))}),e[12]=m,e[13]=l,e[14]=b):b=e[14];let N;return e[15]!==d||e[16]!==i||e[17]!==g||e[18]!==b?(N=n.jsx("div",{className:"h-full w-full overflow-y-auto",children:n.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,d,b,i]})}),e[15]=d,e[16]=i,e[17]=g,e[18]=b,e[19]=N):N=e[19],N}function Bi(t){const e=ce.c(55),{wait:s,hosts:r,invalidLink:a}=t,d=a===void 0?!1:a,o=Pe();let i;e[0]!==d||e[1]!==o?(i=d&&n.jsx(Ti,{variant:"warning",children:n.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[n.jsx(Li,{className:"line-clamp-none text-foreground",children:o("decoServe.link.invalidTitle")}),n.jsx(Ri,{children:o("decoServe.link.invalidBody")})]})}),e[0]=d,e[1]=o,e[2]=i):i=e[2];const c=i;if(s.kind==="problem"){let R;e[3]!==o||e[4]!==s.host||e[5]!==s.problem?(R=Ni(o,s.problem,s.host),e[3]=o,e[4]=s.host,e[5]=s.problem,e[6]=R):R=e[6];const{title:O,body:T}=R;let L;e[7]!==T?(L=n.jsx(es,{text:T}),e[7]=T,e[8]=L):L=e[8];let D;e[9]===Symbol.for("react.memo_cache_sentinel")?(D=n.jsx(Un,{className:"border-t border-border pt-4",links:["troubleshooting","serve"]}),e[9]=D):D=e[9];let A;return e[10]!==c||e[11]!==L||e[12]!==O?(A=n.jsx(ts,{headingLevel:2,waiting:!1,title:O,lead:L,alerts:c,footer:D}),e[10]=c,e[11]=L,e[12]=O,e[13]=A):A=e[13],A}const l=s.kind==="looking",m=l&&!s.paused;let p;e[14]!==o?(p=o("decoServe.waiting.title"),e[14]=o,e[15]=p):p=e[15];let f;e[16]!==o?(f=o("decoServe.waiting.lead"),e[16]=o,e[17]=f):f=e[17];let x;e[18]!==c||e[19]!==s.kind?(x=(c||s.kind==="denied")&&n.jsxs(n.Fragment,{children:[c,s.kind==="denied"&&n.jsx(Ci,{})]}),e[18]=c,e[19]=s.kind,e[20]=x):x=e[20];let h;e[21]!==o?(h=o("decoServe.guide.step1.title"),e[21]=o,e[22]=h):h=e[22];let j;e[23]!==o?(j=o("decoServe.guide.step1.body"),e[23]=o,e[24]=j):j=e[24];let g;e[25]!==j?(g=n.jsx(es,{text:j}),e[25]=j,e[26]=g):g=e[26];let b;e[27]!==h||e[28]!==g?(b={title:h,body:g,command:Er},e[27]=h,e[28]=g,e[29]=b):b=e[29];let N;e[30]!==o?(N=o("decoServe.waiting.step2.title"),e[30]=o,e[31]=N):N=e[31];let y;e[32]!==o?(y=o("decoServe.waiting.step2.body"),e[32]=o,e[33]=y):y=e[33];let v;e[34]!==r||e[35]!==l||e[36]!==o||e[37]!==s.kind||e[38]!==s.onStart||e[39]!==s.paused?(v=s.kind==="needs-gesture"?n.jsx(Me,{variant:"outline",className:"self-start",onClick:s.onStart,children:o("decoServe.guide.step2.start")}):l&&n.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:s.paused?o("decoServe.guide.step2.paused"):o("decoServe.guide.step2.looking",{hosts:r})}),e[34]=r,e[35]=l,e[36]=o,e[37]=s.kind,e[38]=s.onStart,e[39]=s.paused,e[40]=v):v=e[40];let P;e[41]!==N||e[42]!==y||e[43]!==v?(P={title:N,body:y,after:v},e[41]=N,e[42]=y,e[43]=v,e[44]=P):P=e[44];let E;e[45]!==b||e[46]!==P?(E=[b,P],e[45]=b,e[46]=P,e[47]=E):E=e[47];let k;e[48]===Symbol.for("react.memo_cache_sentinel")?(k=n.jsx(Un,{className:"border-t border-border pt-4",links:["siteEditor","serve","troubleshooting"]}),e[48]=k):k=e[48];let S;return e[49]!==E||e[50]!==m||e[51]!==p||e[52]!==f||e[53]!==x?(S=n.jsx(ts,{headingLevel:2,waiting:m,title:p,lead:f,alerts:x,steps:E,footer:k}),e[49]=E,e[50]=m,e[51]=p,e[52]=f,e[53]=x,e[54]=S):S=e[54],S}function $i(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 Mi=15e3,Fi=3e3;function zi(t){const{candidates:e,probe:s,onFound:r,onChange:a,doc:d=document,setTimer:o=(v,P)=>setTimeout(v,P),clearTimer:i=v=>clearTimeout(v),timeoutMs:c=Fi}=t;let l={status:"searching",firstRoundDone:!1,problem:null},m=!1,p=!1,f=0,x=null,h=null;const j=()=>d.visibilityState==="hidden",g=v=>{l={...l,...v},a(l)},b=async v=>{h=new AbortController;const P=h,E=o(()=>P.abort(),c);try{return await s(v,P.signal),!0}catch(k){if(m)return!1;const S=go(k);return S.reason!=="not-answering"?g({problem:{...S,endpoint:v}}):l.problem?.endpoint===v&&g({problem:null}),!1}finally{i(E),h=null}},N=async()=>{if(x=null,!(m||p)){if(e.length===0){g({status:"stopped",firstRoundDone:!0});return}if(j()){g({status:"paused"});return}p=!0,l.status!=="searching"&&g({status:"searching"});for(const v of e){if(m)break;if(await b(v)){if(p=!1,m)return;m=!0,d.removeEventListener("visibilitychange",y),g({status:"found",firstRoundDone:!0}),r(v);return}}if(p=!1,!m){if(f+=1,l.firstRoundDone||g({firstRoundDone:!0}),j()){g({status:"paused"});return}x=o(()=>{N()},ho(f,Mi))}}};function y(){if(!m){if(j()){x!==null&&(i(x),x=null),p||g({status:"paused"});return}x!==null&&i(x),f=0,N()}}return d.addEventListener("visibilitychange",y),a(l),N(),()=>{m=!0,x!==null&&i(x),h?.abort(),d.removeEventListener("visibilitychange",y)}}function Ki(t,e){return xo(bo({endpoint:t,fetch:s=>fetch(s,{signal:e})}))}const Ii=["loopback-network","local-network-access"];async function Ui(){if(vo(window.location.origin))return null;for(const t of Ii)try{return await navigator.permissions.query({name:t})}catch{}return null}let $r=null,Hn=!1;const Ns=new Set;function Hi(t){if(Ns.add(t),!Hn){Hn=!0;const e=s=>{$r=s;for(const r of Ns)r()};Ui().then(s=>{if(!s)return e("unsupported");e(s.state),s.addEventListener("change",()=>e(s.state))})}return()=>Ns.delete(t)}const Vi={status:"stopped",firstRoundDone:!1,problem:null},Cs=new Map;function qi(t){const e=Cs.get(t);if(e)return e;let s={status:"searching",firstRoundDone:!1,problem:null};const r=new Set;let a=null;const d={onFound:()=>{},getSnapshot:()=>s,subscribe:o=>(r.add(o),a??=zi({candidates:t.split(" "),probe:Ki,onFound:i=>d.onFound(i),onChange:i=>{s=i;for(const c of r)c()}}),()=>{r.delete(o),!(r.size>0)&&(a?.(),a=null,Cs.delete(t))})};return Cs.set(t,d),d}function Mr(){return C.useSyncExternalStore(Hi,qn,qn)}const Wi=()=>()=>{},Vn=()=>Vi,qn=()=>$r;function zd(t){const e=ce.c(9),{candidates:s,onFound:r}=t,[a,d]=C.useState(!1),o=Mr(),c=(o==="granted"||o==="unsupported"||o==="prompt"&&a)&&s.length>0;let l;e[0]!==c||e[1]!==s||e[2]!==r?(l=c?qi(s.join(" ")):null,l&&(l.onFound=r),e[0]=c,e[1]=s,e[2]=r,e[3]=l):l=e[3];const m=C.useSyncExternalStore(l?.subscribe??Wi,l?.getSnapshot??Vn,l?.getSnapshot??Vn),p=o==="prompt"&&!a;let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=()=>d(!0),e[4]=f):f=e[4];let x;return e[5]!==o||e[6]!==m||e[7]!==p?(x={state:m,access:o,needsGesture:p,start:f},e[5]=o,e[6]=m,e[7]=p,e[8]=x):x=e[8],x}const Ts={mode:"none",iframeBase:null,showBlockingOverlay:!1,showWakingPill:!1};function Gi(t){const{previewState:e,progressStatus:s,fastPreviewActive:r=!1,fastPreviewReady:a=!1,codingSession:d=!1,hostedDraft:o=!1}=t,i=d?null:t.previewServerUrl;return t.deciding?{...Ts,showDecidingLoader:!0}:t.localPreviewUrl?{mode:"sandbox",iframeBase:t.localPreviewUrl,showBlockingOverlay:!1,showWakingPill:!1}:e.kind==="suspended"||e.kind==="errored"?Ts:o&&t.hostedPointerPending&&!a?{...Ts,showDecidingLoader:!0}:r&&a&&i?{mode:"production",iframeBase:i,showBlockingOverlay:!1,showWakingPill:!1}:r&&o&&i?{mode:"production",iframeBase:i,showBlockingOverlay:!1,showWakingPill:!1}:!r&&e.kind==="iframe"&&s!=="doing"?{mode:"sandbox",iframeBase:e.previewUrl,showBlockingOverlay:!1,showWakingPill:!1}:i?{mode:"production",iframeBase:i,showBlockingOverlay:!1,showWakingPill:!0}:{mode:"none",iframeBase:null,showBlockingOverlay:!0,showWakingPill:!1}}const Ji=1e4,Yi=1e3,Qi=3e4;function Xi({iframeRef:t,src:e,active:s}){const r=C.useRef(0),a=C.useRef(null),d=C.useRef(null),o=C.useRef(e),i=C.useRef(s);o.current=e,i.current=s;const c=()=>{a.current&&clearTimeout(a.current),d.current&&clearTimeout(d.current),a.current=null,d.current=null},l=()=>{a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{a.current=null,m()},Ji)},m=()=>{if(!i.current||!o.current)return;d.current&&clearTimeout(d.current);const x=po(Qi,Yi,r.current,2,.5);r.current+=1,d.current=setTimeout(()=>{d.current=null;const h=t.current,j=o.current;!h||!j||!i.current||(h.src=j,l())},x)},p=()=>{r.current=0,c()},f=()=>{a.current&&(clearTimeout(a.current),a.current=null),m()};return C.useEffect(()=>{if(c(),r.current=0,!(!s||!e))return l(),c},[e,s]),{handleLoad:p,handleError:f}}const Zi=1500,el=500;function tl({iframe:t,reload:e,waitMs:s=Zi,confirmMs:r=el}){let a;const d=()=>{clearTimeout(o),a=setTimeout(e,r)};t.addEventListener("load",d,{once:!0});const o=setTimeout(()=>{t.removeEventListener("load",d),e()},s);return()=>{clearTimeout(o),clearTimeout(a),t.removeEventListener("load",d)}}const sl=Xt({tag:Ae(),id:Ae(),classes:Ae(),text:Ae(),html:Ae(),manifestKey:Ae().nullable(),componentName:Ae().nullable(),parents:Ae(),url:Ae(),path:Ae(),viewport:Xt({width:ot(),height:ot()}),position:Xt({x:ot(),y:ot()})}),nl=`(function() {
3
3
  if (window.__visualEditorActive) return;
4
4
  window.__visualEditorActive = true;
5
5
 
@@ -548,4 +548,4 @@ import{c as ce,j as n,r as C,l as De,b as Pe,B as Me,aK as Xt,b9 as ot,aL as Ae,
548
548
  }
549
549
  });
550
550
  })();`;function $s(t,e,s=!1){let r=t,a=typeof r?.__resolveType=="string"?r.__resolveType:"";for(let d=0;a&&d<5;d++){const o=e[a];if(o&&typeof o=="object"&&"__resolveType"in o){const i=o.__resolveType;if(typeof i=="string"&&i&&i!==a){r=o,a=i;continue}}break}if(!a)return[];if(a.includes("flags/multivariate")||s&&Sa(a,s)){const d=Array.isArray(r.variants)?r.variants:[];if(d.length===0||d.every(c=>{const l=c?.rule;return Pa(l?.__resolveType,s)}))return null;const i=[];for(const c of d){const l=ja(c,s);if(l&&typeof l=="object")for(const m of $s(l,e,s)??[])i.includes(m)||i.push(m)}return i}if(Ea(a)){const d=r.section&&typeof r.section=="object"?$s(r.section,e,s):[];return d===null?null:d.length?[a,...d]:[a]}return[a]}function rt(t){return t.replace(/[`*_]/g,"\\$&")}function ol(t,e){const s=[`The user selected an element on the live preview and asked: **"${rt(e.trim())}"**`,"","For text content changes, locate the correct source file and apply the change.","For code and CSS changes, understand which component the user is referring to and apply changes to the correct component.",""];t.manifestKey&&s.push(`**Section resolveType:** \`${rt(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="${rt(t.classes)}"`:""}>`;s.push(`**Clicked element:** \`${r}\``),t.parents&&s.push(`**DOM breadcrumb:** ${rt(t.parents)} > ${t.tag}`),t.text&&s.push(`**Text content:** "${rt(t.text)}"`),t.componentName&&s.push(`**Component name:** ${rt(t.componentName)}`);const a=t.html.replace(/```/g,"`` `");return s.push("","**HTML snippet:**","```html",a,"```"),s.push("","Please read the source file, locate the element, and apply the requested change."),s.join(`
551
- `)}function il(t,e,s=320,r=44,a=12){const{x:d,y:o}=t,{width:i,height:c}=e,l=Math.max(a,Math.min(d-s/2,i-s-a)),p=o/c>.68?Math.max(a,o-r-18):Math.min(o+18,c-r-a);return{leftPct:l/i*100,topPct:p/c*100}}function ll(t){const e=ce.c(45),{element:s,onDismiss:r}=t,[a,d]=C.useState(""),o=C.useRef(null),{sendMessage:i}=Ga(),{openSidePanel:c}=ii(),l=Pe();let m;e[0]!==s||e[1]!==a||e[2]!==r||e[3]!==c||e[4]!==i?(m=()=>{if(!a.trim())return;const H=ol(s,a);c(),i({parts:[{type:"text",text:H}]}),r()},e[0]=s,e[1]=a,e[2]=r,e[3]=c,e[4]=i,e[5]=m):m=e[5];const p=m;let f;e[6]!==s.position||e[7]!==s.viewport?(f=il(s.position,s.viewport),e[6]=s.position,e[7]=s.viewport,e[8]=f):f=e[8];const x=f,h=`${x.leftPct}%`,j=`${x.topPct}%`;let g;e[9]!==h||e[10]!==j?(g={left:h,top:j,width:"320px"},e[9]=h,e[10]=j,e[11]=g):g=e[11];let b;e[12]!==p?(b=H=>{H.preventDefault(),p()},e[12]=p,e[13]=b):b=e[13];let N;e[14]===Symbol.for("react.memo_cache_sentinel")?(N=H=>d(H.target.value),e[14]=N):N=e[14];let y;e[15]!==r?(y=H=>{H.key==="Escape"&&r()},e[15]=r,e[16]=y):y=e[16];let v;e[17]!==l?(v=l("sandbox.visualEditorPrompt.inputPlaceholder"),e[17]=l,e[18]=v):v=e[18];let P;e[19]!==a||e[20]!==y||e[21]!==v?(P=n.jsx("input",{ref:o,autoFocus:!0,type:"text",value:a,onChange:N,onKeyDown:y,placeholder:v,className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground"}),e[19]=a,e[20]=y,e[21]=v,e[22]=P):P=e[22];let E;e[23]!==a?(E=a.trim(),e[23]=a,e[24]=E):E=e[24];const k=!E;let S;e[25]!==l?(S=l("sandbox.visualEditorPrompt.sendButton"),e[25]=l,e[26]=S):S=e[26];let R;e[27]!==l?(R=l("sandbox.visualEditorPrompt.sendButton"),e[27]=l,e[28]=R):R=e[28];let O;e[29]!==R?(O=n.jsx("title",{children:R}),e[29]=R,e[30]=O):O=e[30];let T;e[31]===Symbol.for("react.memo_cache_sentinel")?(T=n.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e[31]=T):T=e[31];let L;e[32]!==O?(L=n.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[O,T]}),e[32]=O,e[33]=L):L=e[33];let D;e[34]!==k||e[35]!==S||e[36]!==L?(D=n.jsx("button",{type:"submit",disabled:k,className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-lg bg-foreground text-background transition-opacity disabled:opacity-30",title:S,children:L}),e[34]=k,e[35]=S,e[36]=L,e[37]=D):D=e[37];let A;e[38]!==P||e[39]!==D||e[40]!==b?(A=n.jsxs("form",{className:"pointer-events-auto flex w-full items-center gap-1.5 rounded-xl glass px-3 py-1.5",onSubmit:b,children:[P,D]}),e[38]=P,e[39]=D,e[40]=b,e[41]=A):A=e[41];let M;return e[42]!==A||e[43]!==g?(M=n.jsx("div",{className:"absolute z-30 pointer-events-none",style:g,children:A}),e[42]=A,e[43]=g,e[44]=M):M=e[44],M}const Gn="site-links",cl=/details?page|\bpdp\b/i,dl=/listingpage|\bplp\b/i;function ul(t,e,s){const r=new Set;for(const i of s)cl.test(i)&&r.add("product"),dl.test(i)&&r.add("category");const a=Ct(Is(t)),d=a[a.length-1],o=a[a.length-2];return d?.type==="text"&&d.text==="/p"&&o?.type==="param"&&o.name===e&&r.add("product"),e==="*"&&a.some(i=>i.type==="param"&&i.name==="*")&&r.add("category"),r}const fl=["rosa","preto","pink","black"];function Jt(t,e){const s=e.trim();return s?t(s):fl.flatMap(r=>t(r))}function pl(t,e){const s=e.trim(),r=[];/^\d+$/.test(s)&&r.push({resolveType:t,props:{ids:[s]}});const d=s.includes("-")&&!/\s/.test(s)?s.replace(/-+/g," "):s;return r.push({resolveType:t,props:{query:d,count:10}}),r}const Fr=new Set(["vtex","shopify","shopify-mcp","magento","wake","linx","linx-impulse","nuvemshop","vnda","wap","salesforce"]);function Hs(t){return t.split("/")[0]??""}function ml(t){const e=new Set;for(const s of t){const r=Hs(s);Fr.has(r)&&e.add(r)}return e}function hl(t,e){const s=Hs(t);return!Fr.has(s)||e.size===0?!0:e.has(s)}const gl=[{kind:"product",test:t=>t==="vtex/loaders/intelligentSearch/productList.ts",clientFilter:!1,buildRequests:(t,e)=>Jt(s=>pl(t,s),e),optionsFromPayload:Yt},{kind:"product",test:t=>/magento\/.*products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>Jt(s=>[{resolveType:t,props:{props:{search:s,pageSize:10,currentPage:1}}}],e),optionsFromPayload:Yt},{kind:"product",test:t=>/algolia\/.*products?\/(list|suggestions)(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>Jt(s=>[{resolveType:t,props:{term:s,hitsPerPage:10}}],e),optionsFromPayload:Yt},{kind:"product",test:t=>/products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>Jt(s=>[{resolveType:t,props:{query:s,term:s,count:10,hitsPerPage:10}}],e),optionsFromPayload:Yt},{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:Sl}];function vl(t,e,s=new Set){const r=[...e],a=i=>{const c=[];for(const l of gl){if(l.kind!==i)continue;const m=r.find(p=>l.test(p)&&hl(p,s));m&&c.push({cand:l,resolveType:m})}return c.find(l=>s.has(Hs(l.resolveType)))??c[0]},d=(i,c,l)=>({kind:i.kind,id:`${i.kind}:${c}`,resolveType:c,clientFilter:i.clientFilter,isFallback:l,buildRequests:m=>i.buildRequests(c,m),optionsFromPayload:i.optionsFromPayload}),o=[];for(const i of["product","category"]){if(!t.has(i))continue;const c=a(i);c&&o.push(d(c.cand,c.resolveType,!1))}return t.size>0&&o.push(xl(t.has("category")?"category":"product")),o}function xl(t){return{kind:t,id:Gn,resolveType:Gn,clientFilter:!0,isFallback:!0,homepageLinks:!0,optionsFromPayload:(e,s)=>Cl(e,s)}}function Ge(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function bl(t,e,s){const r=new Set,a=new Set,d=o=>{if(Array.isArray(o)){for(const l of o)d(l);return}const i=Ge(o);if(!i)return;const c=i.__resolveType;if(typeof c=="string"){if(s(c))r.add(c);else if(c in e&&!a.has(c)){a.add(c);const l=Ge(e[c])?.__resolveType;typeof l=="string"&&s(l)&&r.add(c),d(e[c])}}for(const l of Object.values(i))d(l)};return d(t),r}function zr(t){const e=new Set,s=[];for(const r of t)for(const a of r)e.has(a.value)||(e.add(a.value),s.push(a));return s}function Kr(t){try{return decodeURIComponent(t)}catch{return t}}function yl(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function wl(t){const e=[];let s="^";for(const r of t)r.type==="text"?s+=yl(r.text):(e.push(r.name),s+=r.name==="*"?"(.+)":"([^/]+)");return{pattern:new RegExp(`${s}$`),order:e}}function Ir(t,e,s){if(typeof t!="string"||!t)return null;let r;try{r=new URL(t,"https://placeholder.invalid").pathname}catch{return null}r=r.replace(/\/+$/,"");const a=Ct(Is(e)),{pattern:d,order:o}=wl(a),i=o.indexOf(s);if(i===-1)return null;const c=r.match(d);if(!c)return null;const l=c[i+1]?.replace(/^\/+|\/+$/g,"");return l?Kr(l):null}function Yt(t,e){const s=Ge(t),r=Array.isArray(t)?t:Array.isArray(s?.products)?s.products:Array.isArray(s?.list)?s.list:[],a=[],d=new Set;for(const o of r){const i=Ge(o);if(!i)continue;const c=Ir(i.url,e.template,e.paramName);if(!c||d.has(c))continue;d.add(c);const l=Ge(i.isVariantOf),m=typeof l?.name=="string"&&l.name||typeof i.name=="string"&&i.name||c,p=Array.isArray(i.image)?Ge(i.image[0]):null,f=typeof p?.url=="string"?p.url:void 0;a.push({value:c,label:m,image:f})}return a}function kl(t){if(typeof t!="string"||!t)return null;let e;try{e=new URL(t,"https://placeholder.invalid").pathname}catch{return null}const s=e.replace(/^\/+|\/+$/g,"");return s?Kr(s):null}function Sl(t){const e=[],s=new Set,r=(a,d)=>{const o=Ge(a);if(!o)return;const i=typeof o.name=="string"&&o.name?o.name:"",c=i?[...d,i]:d,l=kl(o.url);if(l&&!s.has(l)&&(s.add(l),e.push({value:l,label:c.join(" › ")||l})),Array.isArray(o.children))for(const m of o.children)r(m,c)};if(Array.isArray(t))for(const a of t)r(a,[]);return e}const Pl=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 jl(t){return(t.split("/").filter(Boolean).pop()??t).replace(/[-_]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,s=>s.toUpperCase())}function El(t){if(typeof t!="string"||!t)return[];const e=[],s=/<a\b[^>]*?\bhref="([^"]+)"[^>]*>([\s\S]*?)<\/a>/gi;let r,a=0;for(;(r=s.exec(t))!==null&&a++<5e3;){const d=r[1]??"",o=(r[2]??"").replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim();e.push({href:d,text:o})}return e}function Nl(t){if(typeof t!="string"||!t)return[];const e=[],s=new Set,r=/"@type":"Product"[\s\S]{0,600}?(?:"url"|\burl):"([^"]+)"[\s\S]{0,300}?(?:"name"|\bname):"([^"]+)"/g,a=/(?:"image"|\bimage):\s*\[\s*\{[\s\S]{0,400}?(?:"url"|\burl):"([^"]+)"/;let d,o=0;for(;(d=r.exec(t))!==null&&o++<3e3;){const i=(d[1]??"").replace(/\\\//g,"/");if(!i||s.has(i))continue;s.add(i);const c=t.slice(d.index,d.index+900).match(a)?.[1]?.replace(/\\\//g,"/");e.push({url:i,name:d[2]??"",image:c||void 0})}return e}function Cl(t,e){const s=[],r=new Set,a=(d,o,i,c)=>{if(s.length>=200)return;const l=Ir(d,e.template,e.paramName);!l||r.has(l)||e.paramName==="*"&&/(^|\/)p$/.test(l)||i==="category"&&Pl.has(l.split("/")[0]??"")||(r.add(l),s.push({value:l,label:o&&o.length<=80?o:jl(l),kind:i,image:c}))};for(const{url:d,name:o,image:i}of Nl(t))a(d,o,"product",i);for(const{href:d,text:o}of El(t))d.startsWith("/")&&!d.startsWith("//")&&a(d,o,"category");return s}function St(t,e,s=50){const r=e.trim().toLowerCase();return(r?t.filter(d=>d.label.toLowerCase().includes(r)||d.value.toLowerCase().includes(r)):t).slice(0,s)}const Ur=1e4;function Tl(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 Ll(t,{resolveType:e,props:s}){const r=await fetch(yo(t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({__resolveType:e,...s}),signal:AbortSignal.timeout(Ur)});if(!r.ok)throw new Error(`Failed to fetch options: ${r.status}`);return r.json()}async function Jn(t,e){const s=await fetch(wo(t,e),{signal:AbortSignal.timeout(Ur)});if(!s.ok)throw new Error(`Failed to fetch page: ${s.status}`);return s.text()}async function Rl(t,e,s){const r=e.optionsFromPayload(await Jn(t,"/"),s),a=r.find(o=>o.kind==="category");if(!a)return r;const d=Ve(s.template,{[s.paramName]:a.value});if(d==="/")return r;try{const o=e.optionsFromPayload(await Jn(t,d),s).filter(i=>i.kind==="product");return zr([r,o])}catch{return r}}function Al(t,e,s){return or.sandboxInvoke(`${t.orgSlug}/${t.virtualMcpId}/${t.branch}`,`path-param-${e.id}:${e.clientFilter?"":s}`)}async function _l(t,e,s,r){if(e.homepageLinks)return Rl(t,e,r);const a=e.buildRequests?.(s)??[];if(a.length===0)return[];const d=await Promise.allSettled(a.map(i=>Ll(t,i))),o=d.filter(i=>i.status==="fulfilled").map(i=>i.value);if(o.length===0){const i=d.find(c=>c.status==="rejected");throw i?i.reason:new Error("Failed to fetch options")}return zr(o.map(i=>e.optionsFromPayload(i,r)))}function Ms(t,e,s,r,a){return{queryKey:Al(t,e,s),queryFn:()=>_l(t,e,s,r),enabled:a,staleTime:6e4,retry:1}}function Pt(t){const e=ce.c(16),{heading:s,iconKind:r,options:a,template:d,paramName:o,keyPrefix:i,onSelect:c}=t;if(a.length===0)return null;let l;if(e[0]!==r||e[1]!==i||e[2]!==c||e[3]!==a||e[4]!==o||e[5]!==d){let p;e[7]!==r||e[8]!==i||e[9]!==c||e[10]!==o||e[11]!==d?(p=f=>n.jsxs(Nt,{value:`${i}:${f.value}`,className:"gap-3 py-2",onSelect:()=>c(f.value),children:[r==="product"&&n.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center overflow-hidden rounded-md border border-border bg-muted",children:f.image?n.jsx("img",{src:f.image,alt:"",referrerPolicy:"no-referrer",className:"h-full w-full object-cover"}):n.jsx(mr,{size:14,className:"text-muted-foreground"})}),n.jsxs("span",{className:"min-w-0 flex-1",children:[n.jsx("span",{className:"block truncate text-sm",children:f.label}),n.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:Ve(d,{[o]:f.value})})]})]},`${i}:${f.value}`),e[7]=r,e[8]=i,e[9]=c,e[10]=o,e[11]=d,e[12]=p):p=e[12],l=a.map(p),e[0]=r,e[1]=i,e[2]=c,e[3]=a,e[4]=o,e[5]=d,e[6]=l}else l=e[6];let m;return e[13]!==s||e[14]!==l?(m=n.jsx(Et,{heading:s,children:l}),e[13]=s,e[14]=l,e[15]=m):m=e[15],m}function Yn(t){const e=ce.c(2),{text:s}=t;let r;return e[0]!==s?(r=n.jsx("div",{className:"px-2 py-2 text-xs text-muted-foreground",children:s}),e[0]=s,e[1]=r):r=e[1],r}function Ol(t){const e=ce.c(52),{sources:s,template:r,paramName:a,value:d,sandboxRef:o,onCommit:i}=t,c=Pe(),[l,m]=C.useState(!1),[p,f]=C.useState(""),[x,h]=C.useState(""),j=C.useRef(null),g=a==="*"?c("sandbox.preview.catchAllParamLabel"):`:${a}`,b=Tl(c),y=[...new Set(s.map(ne=>b[ne.kind].noun))].join(" or ");let v;e[0]!==c||e[1]!==y?(v=c("sandbox.pathParamPickerChip.searchPlaceholder",{options:y}),e[0]=c,e[1]=y,e[2]=v):v=e[2];const P=v,E={template:r,paramName:a};let k;e[3]!==p?(k=(ne,oe)=>({source:ne,query:oe,options:ne.clientFilter?St(oe.data??[],p):oe.data??[]}),e[3]=p,e[4]=k):k=e[4];const S=k,R=s.filter(Il),O=s.filter(Kl),T=Ds({queries:R.map(ne=>Ms(o,ne,x,E,l))});let L;e[5]!==T||e[6]!==S?(L=(ne,oe)=>S(ne,T[oe]),e[5]=T,e[6]=S,e[7]=L):L=e[7];const D=R.map(L),A=D.length===0||D.every(zl),M=Ds({queries:O.map(ne=>Ms(o,ne,x,E,l&&A))});let H;e[8]!==M||e[9]!==S?(H=(ne,oe)=>S(ne,M[oe]),e[8]=M,e[9]=S,e[10]=H):H=e[10];const X=O.map(H),V=A?X:D,J=V.length===1&&V[0]?.source.homepageLinks?V[0]:null,G=J&&!J.query.isLoading&&!J.query.isError?J?.query.data??[]:[],Y=St(G.filter(Fl),p),_=St(G.filter(Ml),p),$=Y.length>0&&_.length>0,F=ne=>{m(ne),j.current&&clearTimeout(j.current),f(ne?d:""),h(ne?d:"")};let I;e[11]===Symbol.for("react.memo_cache_sentinel")?(I=ne=>{f(ne),j.current&&clearTimeout(j.current),j.current=setTimeout(()=>{h(ne)},300)},e[11]=I):I=e[11];const B=I,z=ne=>{i(ne),F(!1)},W=Rr(p),K=Ve(r,{[a]:W}),te=ar,se=rr,ee="flex h-[85svh] flex-col gap-0 overflow-hidden p-0 sm:h-[520px] sm:max-w-[560px]",ae=$l;let pe;e[12]!==g||e[13]!==c?(pe=c("sandbox.pathParamPickerChip.pickValueTitle",{paramLabel:g}),e[12]=g,e[13]=c,e[14]=pe):pe=e[14];let de;e[15]!==pe?(de=n.jsx(ir,{className:"sr-only",children:n.jsx(lr,{children:pe})}),e[15]=pe,e[16]=de):de=e[16];let ve;e[17]===Symbol.for("react.memo_cache_sentinel")?(ve=n.jsx(mr,{size:16,className:"shrink-0 text-foreground"}),e[17]=ve):ve=e[17];let ue;e[18]!==c?(ue=c("sandbox.pathParamPickerChip.pickValueHeading"),e[18]=c,e[19]=ue):ue=e[19];let xe;e[20]!==g?(xe=n.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]=xe):xe=e[21];let me;e[22]!==ue||e[23]!==xe?(me=n.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-3 border-b border-border px-4",children:[ve,n.jsxs("span",{className:"text-sm font-medium text-foreground",children:[ue," ",xe]})]}),e[22]=ue,e[23]=xe,e[24]=me):me=e[24];const ge=kr,je=!1,fe="min-h-0 flex-1";let ie;e[25]!==P||e[26]!==p?(ie=n.jsx(Sr,{autoFocus:!0,placeholder:P,value:p,onValueChange:B}),e[25]=P,e[26]=p,e[27]=ie):ie=e[27];const Ne=wr,Fe="flex max-h-none min-h-0 flex-1 flex-col overflow-hidden";let ze;e[28]!==c?(ze=c("sandbox.pathParamPickerChip.noResults"),e[28]=c,e[29]=ze):ze=e[29];let Be;e[30]!==ze?(Be=n.jsx(Pr,{children:ze}),e[30]=ze,e[31]=Be):Be=e[31];const ut=W&&n.jsx(Et,{className:"shrink-0",children:n.jsxs(Nt,{value:`__raw__:${W}`,className:"gap-3 py-2",onSelect:()=>z(W),children:[n.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-md border border-dashed border-border bg-muted",children:n.jsx(ci,{size:14,className:"text-muted-foreground"})}),n.jsxs("span",{className:"min-w-0 flex-1",children:[n.jsx("span",{className:"block truncate text-sm",children:c("sandbox.pathParamPickerChip.useRawValue",{rawTerm:W,paramLabel:g})}),n.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:K})]})]})}),Je=$?n.jsxs("div",{className:"flex min-h-0 flex-1",children:[n.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto border-r border-border",children:n.jsx(Pt,{heading:b.category.heading,iconKind:"category",options:Y,template:r,paramName:a,keyPrefix:`${J?.source.id}:cat`,onSelect:z})}),n.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:n.jsx(Pt,{heading:b.product.heading,iconKind:"product",options:_,template:r,paramName:a,keyPrefix:`${J?.source.id}:prod`,onSelect:z})})]}):n.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:V.map(ne=>{const{source:oe,query:ke,options:Ie}=ne,{noun:ft}=b[oe.kind];if(ke.isLoading)return n.jsx(Yn,{text:c("sandbox.pathParamPickerChip.loading",{noun:ft})},oe.id);if(ke.isError)return n.jsx(Yn,{text:c("sandbox.pathParamPickerChip.couldNotLoad")},oe.id);if(oe.homepageLinks){const Ye=ke.data??[];return n.jsxs(C.Fragment,{children:[n.jsx(Pt,{heading:b.category.heading,iconKind:"category",options:St(Ye.filter(Bl),p),template:r,paramName:a,keyPrefix:`${oe.id}:cat`,onSelect:z}),n.jsx(Pt,{heading:b.product.heading,iconKind:"product",options:St(Ye.filter(Dl),p),template:r,paramName:a,keyPrefix:`${oe.id}:prod`,onSelect:z})]},oe.id)}return n.jsx(Pt,{heading:V.length>1?b[oe.kind].heading:void 0,iconKind:oe.kind,options:Ie,template:r,paramName:a,keyPrefix:oe.id,onSelect:z},oe.id)})});let he;e[32]!==Ne||e[33]!==Be||e[34]!==ut||e[35]!==Je?(he=n.jsxs(Ne,{className:Fe,children:[Be,ut,Je]}),e[32]=Ne,e[33]=Be,e[34]=ut,e[35]=Je,e[36]=he):he=e[36];let Le;e[37]!==ge||e[38]!==ie||e[39]!==he?(Le=n.jsxs(ge,{shouldFilter:je,className:fe,children:[ie,he]}),e[37]=ge,e[38]=ie,e[39]=he,e[40]=Le):Le=e[40];let _e;e[41]!==se||e[42]!==de||e[43]!==me||e[44]!==Le||e[45]!==ae?(_e=n.jsxs(se,{className:ee,onClick:ae,children:[de,me,Le]}),e[41]=se,e[42]=de,e[43]=me,e[44]=Le,e[45]=ae,e[46]=_e):_e=e[46];let Ke;return e[47]!==te||e[48]!==F||e[49]!==l||e[50]!==_e?(Ke=n.jsx(te,{open:l,onOpenChange:F,children:_e}),e[47]=te,e[48]=F,e[49]=l,e[50]=_e,e[51]=Ke):Ke=e[51],n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",title:c("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:ne=>{ne.stopPropagation(),F(!0)},children:d||g}),Ke]})}function Dl(t){return t.kind==="product"}function Bl(t){return t.kind!=="product"}function $l(t){return t.stopPropagation()}function Ml(t){return t.kind==="product"}function Fl(t){return t.kind!=="product"}function zl(t){return!t.query.isLoading&&(t.query.isError||t.options.length===0)}function Kl(t){return t.isFallback}function Il(t){return!t.isFallback}function Ul(t){const e=ce.c(8),{sources:s,template:r,paramName:a,sandboxRef:d,onFill:o}=t;let i,c;if(e[0]!==a||e[1]!==d||e[2]!==s||e[3]!==r){const x={template:r,paramName:a},h=s.filter(Hl);c=Ds,i=h.map(j=>Ms(d,j,"",x,!0)),e[0]=a,e[1]=d,e[2]=s,e[3]=r,e[4]=i,e[5]=c}else i=e[4],c=e[5];let l;e[6]!==i?(l={queries:i},e[6]=i,e[7]=l):l=e[7];const m=c(l),[p,f]=C.useState(!1);if(!p)for(const x of m){if(x.isLoading)break;const h=x.data?.[0];if(h){f(!0),queueMicrotask(()=>o(h.value));break}}return null}function Hl(t){return!t.isFallback}function Vl(t){const e=ce.c(31),{name:s,value:r,onCommit:a}=t,d=Pe(),[o,i]=C.useState(r),[c,l]=C.useState(!1),m=C.useRef(!1);let p;e[0]!==s||e[1]!==d?(p=s==="*"?d("sandbox.preview.catchAllParamLabel"):`:${s}`,e[0]=s,e[1]=d,e[2]=p):p=e[2];const f=p,x=o||f;let h;e[3]!==x?(h=n.jsx("span",{"aria-hidden":!0,className:"invisible whitespace-pre px-1 py-0.5 text-xs",children:x}),e[3]=x,e[4]=h):h=e[4];let j;e[5]!==f||e[6]!==d?(j=d("sandbox.preview.valueForParam",{label:f}),e[5]=f,e[6]=d,e[7]=j):j=e[7];let g,b;e[8]===Symbol.for("react.memo_cache_sentinel")?(g=S=>i(S.target.value),b=()=>l(!0),e[8]=g,e[9]=b):(g=e[8],b=e[9]);let N;e[10]!==r?(N=S=>{S.key==="Enter"&&S.currentTarget.blur(),S.key==="Escape"&&(m.current=!0,i(r),S.currentTarget.blur())},e[10]=r,e[11]=N):N=e[11];let y;e[12]!==o||e[13]!==a||e[14]!==r?(y=()=>{if(l(!1),m.current){m.current=!1;return}const S=Rr(o);i(S),S!==r&&a(S)},e[12]=o,e[13]=a,e[14]=r,e[15]=y):y=e[15];let v;e[16]!==o||e[17]!==f||e[18]!==j||e[19]!==N||e[20]!==y?(v=n.jsx("input",{type:"text",value:o,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:ql,onChange:g,onFocus:b,onKeyDown:N,onBlur:y}),e[16]=o,e[17]=f,e[18]=j,e[19]=N,e[20]=y,e[21]=v):v=e[21];let P;e[22]!==h||e[23]!==v?(P=n.jsxs("span",{className:"relative inline-flex max-w-64 shrink-0 items-center overflow-hidden",children:[h,v]}),e[22]=h,e[23]=v,e[24]=P):P=e[24];let E;e[25]!==c||e[26]!==d?(E=c&&n.jsxs("span",{className:"pointer-events-none ml-1.5 flex shrink-0 items-center gap-1 whitespace-nowrap rounded-sm border border-border bg-muted px-1 py-0.5 text-2xs text-muted-foreground",children:[n.jsx(to,{size:10}),d("sandbox.preview.enterToGo")]}),e[25]=c,e[26]=d,e[27]=E):E=e[27];let k;return e[28]!==E||e[29]!==P?(k=n.jsxs(n.Fragment,{children:[P,E]}),e[28]=E,e[29]=P,e[30]=k):k=e[30],k}function ql(t){return t.stopPropagation()}function Wl(t){if(t.activeGlobalSectionName)return t.activeGlobalSectionName;const e=t.iframeBase;if(!e)return t.noServerLabel;try{const s=new URL(e),r=t.resolvedPath==="/"?"":t.resolvedPath;return`${s.host}${r}`}catch{return e}}function Gl(t){return t.previewSurfaceActive&&(t.daemonReady||t.production||!!t.servePreviewUrl)}function Jl(t){return t.showPreviewToolbar&&t.contentEditingEnabled}class Hr extends Error{constructor(){super("The site's schema isn't loaded yet"),this.name="PageSchemaNotReadyError"}}async function Yl(t,e){if(t)return t;const s=await e?.().catch(()=>null);if(!s)throw new Hr;return s}async function Ql(t,e,s){return s?Nn(t,e,await Yl(s.meta,s.loadMeta)):Nn(t,e)}function Xl(t){const e=ce.c(5);let s;e[0]!==t?(s=t??{orgSlug:"",virtualMcpId:"",branch:""},e[0]=t,e[1]=s):s=e[1];const r=dr(s);let a;return e[2]!==t||e[3]!==r?(a={mutationFn:async d=>{const{name:o,path:i,template:c,schema:l}=d;if(!t?.virtualMcpId||!t.branch)throw new Error("Sandbox not ready");const m=Ba(o),p=c?{...c,name:o,path:i}:await Ql(o,i,l);return await r.mutateAsync({blockKey:m,data:p}),{key:m,name:o,path:i}}},e[2]=t,e[3]=r,e[4]=a):a=e[4],Na(a)}function Zl(t){const e=ce.c(89),{open:s,onOpenChange:r,isPending:a,error:d,templates:o,onSubmit:i}=t,c=a===void 0?!1:a,l=Pe();let m;e[0]!==l?(m=l("sectionsEditor.createPageModal.defaultPageName"),e[0]=l,e[1]=m):m=e[1];const[p,f]=C.useState(m);let x;e[2]!==l?(x=l("sectionsEditor.createPageModal.defaultPagePath"),e[2]=l,e[3]=x):x=e[3];const[h,j]=C.useState(x),[g,b]=C.useState(Ss),[N,y]=C.useState(null),[v,P]=C.useState(s);s!==v&&(P(s),s&&(f(l("sectionsEditor.createPageModal.defaultPageName")),j(l("sectionsEditor.createPageModal.defaultPagePath")),b(Ss),y(null)));const E=!!o?.length;let k;e[4]!==c||e[5]!==r?(k=ue=>{!ue&&!c&&(y(null),r(!1))},e[4]=c,e[5]=r,e[6]=k):k=e[6];const S=k;let R;e[7]!==c||e[8]!==p||e[9]!==i||e[10]!==h||e[11]!==E||e[12]!==g?(R=async ue=>{ue.preventDefault();const xe=p.trim(),me=h.trim();if(!xe||!me||c)return;const ge=Ar(me);if(ge){y(ge);return}y(null),await i({name:xe,path:me,templateKey:E&&g!==Ss?g:null})},e[7]=c,e[8]=p,e[9]=i,e[10]=h,e[11]=E,e[12]=g,e[13]=R):R=e[13];const O=R,T=N??d;let L;e[14]!==l?(L=l("sectionsEditor.createPageModal.title"),e[14]=l,e[15]=L):L=e[15];let D;e[16]!==L?(D=n.jsx(ir,{children:n.jsx(lr,{children:L})}),e[16]=L,e[17]=D):D=e[17];let A;e[18]!==l?(A=l("sectionsEditor.createPageModal.nameLabel"),e[18]=l,e[19]=A):A=e[19];let M;e[20]!==A?(M=n.jsx("label",{htmlFor:"new-page-name",className:"text-xs font-medium text-muted-foreground",children:A}),e[20]=A,e[21]=M):M=e[21];let H;e[22]===Symbol.for("react.memo_cache_sentinel")?(H=ue=>f(ue.target.value),e[22]=H):H=e[22];let X;e[23]!==l?(X=l("sectionsEditor.createPageModal.namePlaceholder"),e[23]=l,e[24]=X):X=e[24];let V;e[25]!==c||e[26]!==p||e[27]!==X?(V=n.jsx(Rs,{id:"new-page-name",value:p,onChange:H,placeholder:X,autoFocus:!0,disabled:c}),e[25]=c,e[26]=p,e[27]=X,e[28]=V):V=e[28];let J;e[29]!==V||e[30]!==M?(J=n.jsxs("div",{className:"space-y-1.5",children:[M,V]}),e[29]=V,e[30]=M,e[31]=J):J=e[31];let q;e[32]!==l?(q=l("sectionsEditor.createPageModal.pathLabel"),e[32]=l,e[33]=q):q=e[33];let G;e[34]!==q?(G=n.jsx("label",{htmlFor:"new-page-path",className:"text-xs font-medium text-muted-foreground",children:q}),e[34]=q,e[35]=G):G=e[35];let Y;e[36]===Symbol.for("react.memo_cache_sentinel")?(Y=ue=>j(ue.target.value),e[36]=Y):Y=e[36];let _;e[37]!==l?(_=l("sectionsEditor.createPageModal.pathPlaceholder"),e[37]=l,e[38]=_):_=e[38];let $;e[39]!==c||e[40]!==h||e[41]!==_?($=n.jsx(Rs,{id:"new-page-path",value:h,onChange:Y,placeholder:_,disabled:c}),e[39]=c,e[40]=h,e[41]=_,e[42]=$):$=e[42];let F;e[43]!==G||e[44]!==$?(F=n.jsxs("div",{className:"space-y-1.5",children:[G,$]}),e[43]=G,e[44]=$,e[45]=F):F=e[45];let I;e[46]!==c||e[47]!==E||e[48]!==l||e[49]!==g||e[50]!==o?(I=E&&n.jsxs("div",{className:"space-y-1.5",children:[n.jsx("label",{htmlFor:"new-page-template",className:"text-xs font-medium text-muted-foreground",children:l("sectionsEditor.createPageModal.templateLabel")}),n.jsx($a,{id:"new-page-template",value:g,onChange:b,templates:o??[],disabled:c})]}),e[46]=c,e[47]=E,e[48]=l,e[49]=g,e[50]=o,e[51]=I):I=e[51];let B;e[52]!==T?(B=T&&n.jsx("p",{className:"text-xs text-destructive",children:T}),e[52]=T,e[53]=B):B=e[53];let z;e[54]!==J||e[55]!==F||e[56]!==I||e[57]!==B?(z=n.jsxs("div",{className:"space-y-4 py-4",children:[J,F,I,B]}),e[54]=J,e[55]=F,e[56]=I,e[57]=B,e[58]=z):z=e[58];let W;e[59]!==r?(W=()=>r(!1),e[59]=r,e[60]=W):W=e[60];let K;e[61]!==l?(K=l("sectionsEditor.createPageModal.cancelButton"),e[61]=l,e[62]=K):K=e[62];let te;e[63]!==c||e[64]!==W||e[65]!==K?(te=n.jsx(Me,{type:"button",variant:"outline",onClick:W,disabled:c,children:K}),e[63]=c,e[64]=W,e[65]=K,e[66]=te):te=e[66];let se;e[67]!==c||e[68]!==p||e[69]!==h?(se=!p.trim()||!h.trim()||c,e[67]=c,e[68]=p,e[69]=h,e[70]=se):se=e[70];let ee;e[71]!==c||e[72]!==l?(ee=c?n.jsxs(n.Fragment,{children:[n.jsx(Tt,{className:"size-3.5"}),l("sectionsEditor.createPageModal.creatingButton")]}):l("sectionsEditor.createPageModal.createButton"),e[71]=c,e[72]=l,e[73]=ee):ee=e[73];let ae;e[74]!==se||e[75]!==ee?(ae=n.jsx(Me,{type:"submit",disabled:se,children:ee}),e[74]=se,e[75]=ee,e[76]=ae):ae=e[76];let pe;e[77]!==te||e[78]!==ae?(pe=n.jsxs(Ca,{children:[te,ae]}),e[77]=te,e[78]=ae,e[79]=pe):pe=e[79];let de;e[80]!==O||e[81]!==z||e[82]!==pe||e[83]!==D?(de=n.jsx(rr,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:O,children:[D,z,pe]})}),e[80]=O,e[81]=z,e[82]=pe,e[83]=D,e[84]=de):de=e[84];let ve;return e[85]!==S||e[86]!==s||e[87]!==de?(ve=n.jsx(ar,{open:s,onOpenChange:S,children:de}),e[85]=S,e[86]=s,e[87]=de,e[88]=ve):ve=e[88],ve}function ec(t){const e=ce.c(36),{orgSlug:s,virtualMcpId:r,branch:a,previewUrl:d,meta:o,decofile:i,blockKey:c}=t,l=Pe();let m;e[0]!==a||e[1]!==s||e[2]!==r?(m={orgSlug:s,virtualMcpId:r,branch:a},e[0]=a,e[1]=s,e[2]=r,e[3]=m):m=e[3];const p=dr(m);let f;e[4]!==p?(f=za((k,S)=>p.mutate({blockKey:k,data:S})),e[4]=p,e[5]=f):f=e[5];const x=f;let h;e[6]!==c||e[7]!==i?(h=Ma(i,c),e[6]=c,e[7]=i,e[8]=h):h=e[8];const{resolveType:j,props:g,title:b}=h;if(!j){let k;e[9]!==l?(k=l("sandbox.preview.loaderNoLongerExists"),e[9]=l,e[10]=k):k=e[10];let S;return e[11]!==k?(S=n.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center text-sm text-muted-foreground",children:k}),e[11]=k,e[12]=S):S=e[12],S}const N=`loader:${c}`,y=`loader:${c}`;let v;e[13]!==c||e[14]!==j||e[15]!==b?(v={mode:"saved",blockKey:c,resolveType:j,title:b},e[13]=c,e[14]=j,e[15]=b,e[16]=v):v=e[16];let P;e[17]!==a||e[18]!==i||e[19]!==o||e[20]!==s||e[21]!==d||e[22]!==g||e[23]!==p.isPending||e[24]!==x||e[25]!==y||e[26]!==v||e[27]!==r?(P=n.jsx(Fa,{orgSlug:s,virtualMcpId:r,branch:a,previewUrl:d,meta:o,decofile:i,kind:"loaders",target:v,initialValue:g,isCreating:p.isPending,onCreate:tc,onSaveReferencedBlock:x,showRun:!1},y),e[17]=a,e[18]=i,e[19]=o,e[20]=s,e[21]=d,e[22]=g,e[23]=p.isPending,e[24]=x,e[25]=y,e[26]=v,e[27]=r,e[28]=P):P=e[28];let E;return e[29]!==c||e[30]!==a||e[31]!==s||e[32]!==N||e[33]!==P||e[34]!==r?(E=n.jsx(Ka,{orgSlug:s,virtualMcpId:r,branch:a,blockKey:c,present:void 0,children:P},N),e[29]=c,e[30]=a,e[31]=s,e[32]=N,e[33]=P,e[34]=r,e[35]=E):E=e[35],E}async function tc(){}function sc(t){if(t instanceof Error&&"status"in t&&typeof t.status=="number")return t.status}function Qn(t){return{status:t.status,hasData:t.data!==void 0,errorStatus:sc(t.error)}}function nc(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 rc(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=nc(t.lifecyclePhase);if(e==="terminal-error")return{kind:"error",source:"sandbox"};if(e==="booting")return{kind:"loading"};const s=t.decofile.status==="error"&&!t.decofile.hasData||t.meta.status==="error"&&!t.meta.hasData;return s&&t.lifecyclePhase==="checking-out"?{kind:"loading"}:[t.decofile,t.meta].some(a=>a.status==="error"&&!a.hasData&&a.errorStatus===404)?{kind:"empty",reason:"framework-missing"}:s?t.lifecyclePhase==="running"||t.lifecyclePhase==="crashed"?{kind:"error",source:"data"}:{kind:"loading"}:!t.decofile.hasData||!t.meta.hasData?{kind:"loading"}:t.hasEditableContent?{kind:"content"}:{kind:"empty",reason:"no-content"}}const ac=C.lazy(()=>Ta(()=>import("./sections-editor-HzO8sny6.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])).then(t=>({default:t.SectionsEditor})));function Xn(t){const e=ce.c(60),{virtualMcpId:s,externalSelection:r,onViewJsonFile:a}=t,d=r===void 0?null:r,{org:o}=zs(),{currentBranch:i,taskId:c}=Lt(),l=Us(),m=Rt(),p=Or(),f=l.lifecycle.phase==="running",x=m.previewUrl;let h;e[0]!==i||e[1]!==o||e[2]!==x||e[3]!==c||e[4]!==s?(h=i?{orgSlug:o.slug,virtualMcpId:s,branch:i,threadId:c??null,previewUrl:x}:null,e[0]=i,e[1]=o,e[2]=x,e[3]=c,e[4]=s,e[5]=h):h=e[5];const j=h,g=ss(s,i);let b;e[6]!==f?(b={fetchEnabled:f},e[6]=f,e[7]=b):b=e[7];const N=Ks(j,b);let y;e[8]!==f?(y={fetchEnabled:f},e[8]=f,e[9]=y):y=e[9];const v=Lr(j,y),P=rc({lifecyclePhase:l.lifecycle.phase,decofile:Qn(N),meta:Qn(v),hasEditableContent:qo(N.data,v.data),fastPreviewActive:jr(s).runtime==="cms"||at(g)}),E=ur()===void 0,k=oc;if(Bo(g)){let _;return e[10]===Symbol.for("react.memo_cache_sentinel")?(_=k(n.jsx(Mo,{})),e[10]=_):_=e[10],_}if(g.kind==="pending"&&g.retrying){let _;return e[11]!==g?(_=k(n.jsx(Fo,{backend:g})),e[11]=g,e[12]=_):_=e[12],_}if(P.kind==="loading"||E){let _;return e[13]===Symbol.for("react.memo_cache_sentinel")?(_=k(n.jsx(La,{})),e[13]=_):_=e[13],_}if(N.data&&ko(v.data)){const _=p.state.target,$=_?.kind==="page"||_?.kind==="section"?_.key:null,F=$??"",I=i??"";let B;return e[14]!==N.data||e[15]!==$||e[16]!==o.slug||e[17]!==F||e[18]!==I||e[19]!==s?(B=k(n.jsx(Ia,{orgSlug:o.slug,virtualMcpId:s,branch:I,decofile:N.data,initialKey:$,compact:!0},F)),e[14]=N.data,e[15]=$,e[16]=o.slug,e[17]=F,e[18]=I,e[19]=s,e[20]=B):B=e[20],B}if(P.kind==="empty"){let _;return e[21]===Symbol.for("react.memo_cache_sentinel")?(_=k(n.jsx(zo,{})),e[21]=_):_=e[21],_}if(P.kind==="error"){let _;e[22]!==N||e[23]!==m||e[24]!==v||e[25]!==P.source?(_=()=>{if(P.source==="sandbox"){m.retry();return}Promise.all([N.refetch(),v.refetch()])},e[22]=N,e[23]=m,e[24]=v,e[25]=P.source,e[26]=_):_=e[26];const $=_;let F;return e[27]!==$||e[28]!==P.source?(F=k(n.jsx($o,{source:P.source,onRetry:$})),e[27]=$,e[28]=P.source,e[29]=F):F=e[29],F}let S;e[30]===Symbol.for("react.memo_cache_sentinel")?(S=_=>k(n.jsx("div",{className:"h-full min-h-0",children:_})),e[30]=S):S=e[30];const R=S,O=p.state.target;if(O?.kind==="loader"&&N.data&&v.data){const _=i??"",$=x??null;let F;return e[31]!==N.data||e[32]!==v.data||e[33]!==o.slug||e[34]!==_||e[35]!==$||e[36]!==O.key||e[37]!==s?(F=R(n.jsx(ec,{orgSlug:o.slug,virtualMcpId:s,branch:_,previewUrl:$,meta:v.data,decofile:N.data,blockKey:O.key})),e[31]=N.data,e[32]=v.data,e[33]=o.slug,e[34]=_,e[35]=$,e[36]=O.key,e[37]=s,e[38]=F):F=e[38],F}let T;e[39]!==i||e[40]!==o.slug||e[41]!==O||e[42]!==s?(T=O||!i?null:fr(pr(o.slug,s,i)),e[39]=i,e[40]=o.slug,e[41]=O,e[42]=s,e[43]=T):T=e[43];const L=T;let D="/",A=null,M=null;O?.kind==="page"?(D=O.path,A=O.key):O?.kind==="section"?M=O.key:L&&(D=L.path,A=L.pageKey);const H=A?`page:${A}`:M?`section:${M}`:`path:${D}`;let X;e[44]===Symbol.for("react.memo_cache_sentinel")?(X=n.jsx("div",{className:"h-full flex items-center justify-center",children:n.jsx(Tt,{className:"size-5 text-muted-foreground"})}),e[44]=X):X=e[44];const V=i??"",J=x??void 0,q=M?null:d,G=!!A&&p.state.editSeoPageKey===A;let Y;return e[45]!==M||e[46]!==A||e[47]!==D||e[48]!==H||e[49]!==a||e[50]!==o.slug||e[51]!==q||e[52]!==G||e[53]!==V||e[54]!==J||e[55]!==s||e[56]!==p.consumeEditSeo||e[57]!==p.setFocusedBlock||e[58]!==p.setVariantOverride?(Y=R(n.jsx(C.Suspense,{fallback:X,children:n.jsx(ac,{orgSlug:o.slug,virtualMcpId:s,branch:V,previewReady:!0,previewUrl:J,currentPath:D,activePageBlockKey:A,activeGlobalBlockKey:M,externalSelection:q,initialEditSeo:G,onExitSeo:p.consumeEditSeo,onVariantPreviewOverride:p.setVariantOverride,onFocusedBlockChange:p.setFocusedBlock,onViewJsonFile:a},H)})),e[45]=M,e[46]=A,e[47]=D,e[48]=H,e[49]=a,e[50]=o.slug,e[51]=q,e[52]=G,e[53]=V,e[54]=J,e[55]=s,e[56]=p.consumeEditSeo,e[57]=p.setFocusedBlock,e[58]=p.setVariantOverride,e[59]=Y):Y=e[59],Y}function oc(t){return n.jsx("div",{"data-testid":"blocks-panel",className:"h-full min-h-0 overflow-hidden",children:t})}function Zn(t){const e=ce.c(51),{virtualMcpId:s,pageKey:r,onClose:a,ref:d}=t,o=Pe(),i=ur(),c=i===!0,l=So(s);let m;e[0]!==l||e[1]!==r?(m=Po(l,ui(r)),e[0]=l,e[1]=r,e[2]=m):m=e[2];const p=m,{org:f}=zs(),{currentBranch:x,taskId:h}=Lt(),g=Rt().previewUrl;let b;e[3]!==x||e[4]!==f.slug||e[5]!==g||e[6]!==h||e[7]!==s?(b=x?{orgSlug:f.slug,virtualMcpId:s,branch:x,threadId:h??null,previewUrl:g}:null,e[3]=x,e[4]=f.slug,e[5]=g,e[6]=h,e[7]=s,e[8]=b):b=e[8];const y=Ks(b),v=x??"";let P;e[9]!==f.slug||e[10]!==v||e[11]!==s?(P={orgSlug:f.slug,virtualMcpId:s,branch:v},e[9]=f.slug,e[10]=v,e[11]=s,e[12]=P):P=e[12];let E;e[13]===Symbol.for("react.memo_cache_sentinel")?(E={holdsCopy:!0},e[13]=E):E=e[13];const{save:k,flush:S,hold:R}=Ua(P,E),O=x??"";let T;e[14]!==f.slug||e[15]!==O||e[16]!==s?(T=Ko({orgSlug:f.slug,virtualMcpId:s,branch:O}),e[14]=f.slug,e[15]=O,e[16]=s,e[17]=T):T=e[17];const L=Io(T);let D;e[18]!==r||e[19]!==L?(D=L(r),e[18]=r,e[19]=L,e[20]=D):D=e[20];const A=D;let M;e[21]!==A||e[22]!==r?(M={pageKey:r,copyEpoch:A},e[21]=A,e[22]=r,e[23]=M):M=e[23];const[H,X]=C.useState(M);(H.pageKey!==r||H.copyEpoch!==A)&&(X({pageKey:r,copyEpoch:A}),R(r));const V=y.data?.[r],J=y.data===void 0&&y.isLoading||i===void 0,q=y.data!==void 0&&V===void 0,G=!x||q||J;let Y;e[24]!==V?(Y=V===void 0?"":JSON.stringify(V,null,2),e[24]=V,e[25]=Y):Y=e[25];const _=Y;let $;e[26]!==r||e[27]!==G||e[28]!==k?($=K=>{if(G)return;let te;try{te=JSON.parse(K)}catch{return}te===null||typeof te!="object"||Array.isArray(te)||k(r,te)},e[26]=r,e[27]=G,e[28]=k,e[29]=$):$=e[29];const F=$;let I;e[30]!==S?(I=()=>({flush:S}),e[30]=S,e[31]=I):I=e[31],C.useImperativeHandle(d,I);let B;e[32]!==p||e[33]!==c||e[34]!==a||e[35]!==o?(B=c?n.jsx("div",{className:"flex shrink-0 items-center border-b px-3 py-2.5",children:n.jsx("span",{title:p,className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:p})}):n.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b px-3 py-2.5",children:[n.jsx("div",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:o("sectionsEditor.pageJsonDialog.titleShort")}),n.jsx(Me,{variant:"ghost",size:"icon-sm",onClick:a,"aria-label":o("sectionsEditor.pageJsonDialog.close"),className:"shrink-0",children:n.jsx(Ra,{size:14})})]}),e[32]=p,e[33]=c,e[34]=a,e[35]=o,e[36]=B):B=e[36];let z;e[37]!==A||e[38]!==y.data||e[39]!==S||e[40]!==_||e[41]!==J||e[42]!==q||e[43]!==r||e[44]!==G||e[45]!==F||e[46]!==o?(z=J?n.jsx("div",{className:"flex flex-1 items-center justify-center",children:n.jsx(Tt,{className:"size-5 text-muted-foreground"})}):q?n.jsxs("div",{className:"p-4 text-xs font-mono text-foreground/60",children:["// ",o("sectionsEditor.pageJsonDialog.pageNotFound")]}):n.jsx("div",{className:"min-h-0 flex-1",children:n.jsx(di,{code:_,language:"json",readOnly:G,height:"100%",onChange:K=>F(K??""),onSave:K=>{F(K),S()}},`${r}:${y.data===void 0?"loading":"ready"}:${A}`)}),e[37]=A,e[38]=y.data,e[39]=S,e[40]=_,e[41]=J,e[42]=q,e[43]=r,e[44]=G,e[45]=F,e[46]=o,e[47]=z):z=e[47];let W;return e[48]!==B||e[49]!==z?(W=n.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-background",children:[B,z]}),e[48]=B,e[49]=z,e[50]=W):W=e[50],W}function Vr(t){return t.contentEditingEnabled&&!t.isMobile}function ic(t,e){return t!=="visual"?"visual":e?"blocks":"preview"}function lc(t,e){return t==="blocks"?"preview":e?"blocks":t}function cc(t){return Vr({contentEditingEnabled:_r(t.cmsMode),isMobile:t.isMobile})?"blocks":"preview"}function dc(t){return t.editingMode==="blocks"&&!t.blocksEditingEnabled||t.editingMode==="visual"&&!t.sandboxDisplay?"preview":t.editingMode}function uc(t){const e=ri(t),{display:s}=t;let r=null;if(s.mode==="production"&&s.iframeBase)try{r=new URL(t.path,s.iframeBase).href}catch{r=null}const a=ai(r,e);return{value:e,frame:a?Bs(a,t.device):null,newTab:a}}function fc(t){const e=ce.c(90),{tests:s,options:r,onChange:a,available:d}=t,o=Pe();let i;e[0]!==r?(i=Dr(r),e[0]=r,e[1]=i):i=e[1];const c=i;let l;e[2]!==r.tests?(l=r.tests??{},e[2]=r.tests,e[3]=l):l=e[3];const m=l;let p;e[4]!==a||e[5]!==r?(p=K=>{const te=K?Ho(K):null,{at:se,...ee}=r;a(te?{...ee,at:te}:ee)},e[4]=a,e[5]=r,e[6]=p):p=e[6];const f=p;let x;e[7]!==m||e[8]!==a||e[9]!==r?(x=(K,te)=>{const se={...m};te==="on"?se[K]=!0:te==="off"?se[K]=!1:delete se[K];const{tests:ee,...ae}=r;a(Object.keys(se).length>0?{...ae,tests:se}:ae)},e[7]=m,e[8]=a,e[9]=r,e[10]=x):x=e[10];const h=x;let j;e[11]!==o?(j=o("sandbox.previewAs.label"),e[11]=o,e[12]=j):j=e[12];let g;e[13]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(so,{size:16}),e[13]=g):g=e[13];let b;e[14]!==c||e[15]!==j?(b=n.jsx(lt,{asChild:!0,children:n.jsx(xr,{asChild:!0,children:n.jsx(We,{"aria-label":j,active:c,"data-testid":"preview-as-trigger",children:g})})}),e[14]=c,e[15]=j,e[16]=b):b=e[16];let N;e[17]!==o?(N=o("sandbox.previewAs.label"),e[17]=o,e[18]=N):N=e[18];let y;e[19]!==N?(y=n.jsx(ct,{children:N}),e[19]=N,e[20]=y):y=e[20];let v;e[21]!==b||e[22]!==y?(v=n.jsxs(dt,{children:[b,y]}),e[21]=b,e[22]=y,e[23]=v):v=e[23];let P;e[24]!==o?(P=o("sandbox.previewAs.label"),e[24]=o,e[25]=P):P=e[25];let E;e[26]!==P?(E=n.jsx("h3",{className:"text-sm font-medium",children:P}),e[26]=P,e[27]=E):E=e[27];let k;e[28]!==d||e[29]!==o?(k=o(d?"sandbox.previewAs.intro":"sandbox.previewAs.unavailable"),e[28]=d,e[29]=o,e[30]=k):k=e[30];let S;e[31]!==k?(S=n.jsx("p",{className:"text-xs text-muted-foreground",children:k}),e[31]=k,e[32]=S):S=e[32];let R;e[33]!==E||e[34]!==S?(R=n.jsxs("div",{className:"flex flex-col gap-1",children:[E,S]}),e[33]=E,e[34]=S,e[35]=R):R=e[35];let O;e[36]!==o?(O=o("sandbox.previewAs.momentLabel"),e[36]=o,e[37]=O):O=e[37];let T;e[38]!==O?(T=n.jsx(pi,{htmlFor:"preview-as-moment",children:O}),e[38]=O,e[39]=T):T=e[39];let L;e[40]!==r.at?(L=Uo(r.at),e[40]=r.at,e[41]=L):L=e[41];let D;e[42]!==f?(D=K=>f(K.target.value),e[42]=f,e[43]=D):D=e[43];let A;e[44]!==L||e[45]!==D?(A=n.jsx(Rs,{id:"preview-as-moment",type:"datetime-local",className:Vo,value:L,onChange:D}),e[44]=L,e[45]=D,e[46]=A):A=e[46];const M=r.at===void 0;let H;e[47]!==f?(H=()=>f(""),e[47]=f,e[48]=H):H=e[48];let X;e[49]!==o?(X=o("sandbox.previewAs.now"),e[49]=o,e[50]=X):X=e[50];let V;e[51]!==M||e[52]!==H||e[53]!==X?(V=n.jsx(Me,{type:"button",variant:"ghost",size:"sm",disabled:M,onClick:H,children:X}),e[51]=M,e[52]=H,e[53]=X,e[54]=V):V=e[54];let J;e[55]!==A||e[56]!==V?(J=n.jsxs("div",{className:"flex items-center gap-2",children:[A,V]}),e[55]=A,e[56]=V,e[57]=J):J=e[57];let q;e[58]!==o?(q=o("sandbox.previewAs.momentHint"),e[58]=o,e[59]=q):q=e[59];let G;e[60]!==q?(G=n.jsx("p",{className:"text-xs text-muted-foreground",children:q}),e[60]=q,e[61]=G):G=e[61];let Y;e[62]!==T||e[63]!==J||e[64]!==G?(Y=n.jsxs("div",{className:"flex flex-col gap-1.5",children:[T,J,G]}),e[62]=T,e[63]=J,e[64]=G,e[65]=Y):Y=e[65];let _;e[66]!==o?(_=o("sandbox.previewAs.testsLabel"),e[66]=o,e[67]=_):_=e[67];let $;e[68]!==_?($=n.jsx("span",{className:"text-sm font-medium",children:_}),e[68]=_,e[69]=$):$=e[69];let F;e[70]!==m||e[71]!==h||e[72]!==o||e[73]!==s?(F=s.length===0?n.jsx("p",{className:"text-xs text-muted-foreground",children:o("sandbox.previewAs.noTests")}):n.jsxs(n.Fragment,{children:[n.jsx("ul",{className:"flex flex-col gap-1.5",children:s.map(K=>n.jsxs("li",{className:"flex items-center justify-between gap-2","data-testid":"preview-as-test",children:[n.jsx("span",{className:"min-w-0 truncate text-sm",children:K}),n.jsxs(mi,{type:"single",variant:"outline",size:"sm",value:m[K]===void 0?"":m[K]?"on":"off",onValueChange:te=>h(K,te),"aria-label":K,children:[n.jsx(Fn,{value:"off",children:o("sandbox.previewAs.off")}),n.jsx(Fn,{value:"on",children:o("sandbox.previewAs.on")})]})]},K))}),n.jsx("p",{className:"text-xs text-muted-foreground",children:o("sandbox.previewAs.testsHint")})]}),e[70]=m,e[71]=h,e[72]=o,e[73]=s,e[74]=F):F=e[74];let I;e[75]!==$||e[76]!==F?(I=n.jsxs("div",{className:"flex flex-col gap-1.5",children:[$,F]}),e[75]=$,e[76]=F,e[77]=I):I=e[77];let B;e[78]!==c||e[79]!==a||e[80]!==o?(B=c&&n.jsx(Me,{type:"button",variant:"outline",size:"sm",onClick:()=>a({}),children:o("sandbox.previewAs.reset")}),e[78]=c,e[79]=a,e[80]=o,e[81]=B):B=e[81];let z;e[82]!==R||e[83]!==Y||e[84]!==I||e[85]!==B?(z=n.jsxs(br,{className:"flex w-80 flex-col gap-4 p-4",align:"center",sideOffset:8,"data-testid":"preview-as",children:[R,Y,I,B]}),e[82]=R,e[83]=Y,e[84]=I,e[85]=B,e[86]=z):z=e[86];let W;return e[87]!==v||e[88]!==z?(W=n.jsxs(yr,{children:[v,z]}),e[87]=v,e[88]=z,e[89]=W):W=e[89],W}const pc=15e3;function mc(t,e,s){return s?t.src===e||t.loading?t:{src:e,loading:!0}:t.src===e&&!t.loading?t:{src:e,loading:!1}}function er(t){return t.loading?{...t,loading:!1}:t}const hc=500,gc={mobile:{width:412,height:823},tablet:{width:1024,height:1366},desktop:{width:1280,height:800}},tr=1,Qt=["desktop","mobile","tablet"],vc=["preview","visual","blocks"],sr={mobile:"sandbox.preview.deviceMobile",tablet:"sandbox.preview.deviceTablet",desktop:"sandbox.preview.deviceDesktop"};function xc(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 jt(t){if(!t)return null;try{return new URL(t,window.location.href).origin}catch{return null}}function Ls(t,e){try{return new URL(t,e).href}catch{return null}}function bc(t,e){if(!e.inPlaceRenderActive)return{pin:e.draftPreviewUrl?{path:e.resolvedPath,url:e.draftPreviewUrl}:null,effective:e.draftPreviewUrl};if(e.draftPreviewUrl!==null&&t?.path!==e.resolvedPath){const s={path:e.resolvedPath,url:e.draftPreviewUrl};return{pin:s,effective:s.url}}return{pin:t,effective:t?.url??null}}function yc(t,e){return!t||t.nav!==e.nav?!1:t.content!==e.content}function wc(t,e,s){const r=t.toLowerCase(),a=e.toLowerCase(),d=a.split("/").filter(Boolean),o=c=>{if(c===s)return 100;const l=c.indexOf(s);if(l===-1)return 0;let m=40;return l===0?m+=30:/[\s/-]/.test(c[l-1]??"")&&(m+=20),m+=Math.round(s.length/c.length*20),m};let i=Math.max(o(r),o(a));return d.at(-1)===s?i=Math.max(i,95):d.includes(s)&&(i=Math.max(i,90)),i}function kc(t,e){try{t.contentWindow?.location.reload()}catch{e&&(t.src=e)}}function Sc({virtualMcpId:t}){const e=Pe(),s=Tr(),{currentBranch:r,taskId:a,virtualMcpId:d}=Lt(),o=!!Ja(),i=Or(),c=co(d===t?t:null),l=jr(t),m=gi(c?.metadata?.ui?.layout??null),p=_r(m),f=Vr({contentEditingEnabled:p,isMobile:s}),[x]=C.useState(()=>cc({cmsMode:m,isMobile:s})),[h,j]=As(_s.previewEditingMode(t),u=>u&&vc.includes(u)?u:null),g=h??x,[b,N]=As(_s.previewDeviceSize(t),u=>u&&Qt.includes(u)?u:"desktop"),[y,v]=C.useState(null),[P,E]=C.useState(null),k=C.useRef(null),S=C.useRef(null),[R,O]=C.useState(!1),T=C.useRef(null),L=()=>{T.current?.flush(),O(!1)},D=()=>O(u=>(u&&T.current?.flush(),!u)),[A,M]=C.useState({width:0,height:0}),[H,X]=C.useState(!1),[V,J]=C.useState({}),[q,G]=C.useState(""),Y=C.useRef(null),[_,$]=C.useState(!1),[F,I]=C.useState(),[B,z]=C.useState(null),[W,K]=C.useState(null),[te,se]=C.useState(null),[ee,ae]=C.useState(()=>i.state.target?.kind==="page"?i.state.target.path:"/"),[pe,de]=C.useState(()=>i.state.target?.kind==="page"?i.state.target.key:null),[ve,ue]=C.useState({}),[xe,me]=C.useState(!1),ge=C.useRef(null),je=()=>{me(!0),ge.current&&clearTimeout(ge.current),ge.current=setTimeout(()=>me(!1),15e3)},fe=()=>{ge.current&&(clearTimeout(ge.current),ge.current=null),me(!1)},{org:ie}=zs(),Ne=Us(),Fe=Rt(),ze=Fe.vmEntry,Be=Ne.lifecycle.phase,{url:ut,undecided:Je}=Nr(t),he=ss(t,r),{connection:Le}=Cr(t),_e=fi(t),Ke=jo({hasServeConnection:!!Le,runtime:l.runtime}),ne=Je||Ke==="github"&&(_e==="loading"||_e==="error"),oe=!at(he)&&!ne&&!(Ke==="github"&&he.kind==="pending"),ke=He(he)??ut,Ie=ke??Fe.previewUrl,ft=!!ke||Be==="running",Ye=c?.id===t?mo(c.metadata):null,pt=!ke&&!Je&&c?.id===t&&l.runtime==="cms",qr=l.projectDefault==="cms",mt=oe?si({sandboxUrl:Ie,previewServerUrl:Ye,fastPreviewActive:pt}):null,Vs=t&&r?{orgSlug:ie.slug,virtualMcpId:t,branch:r,threadId:a??null,previewUrl:Ie}:null,qs=Ks(Vs,{fetchEnabled:ft}),ns=Lr(Vs,{fetchEnabled:ft}),le=qs.data,Se=ns.data,Qe=le?Wo(le,Se).sort((u,w)=>u.name.localeCompare(w.name)):[],Ws=t&&r?{orgSlug:ie.slug,virtualMcpId:t,branch:r}:null,Gs=Xl(Ws),rs=le&&Se?Go(le,Se):[],Js=oe&&le&&Se?Ha(Se,le,"loaders"):[],Ys=q?(()=>{const u=q.toLowerCase();return Qe.map(w=>({page:w,score:wc(w.name,w.path,u)})).filter(({score:w})=>w>0).sort((w,U)=>U.score-w.score||w.page.path.length-U.page.path.length).map(({page:w})=>w)})():Qe,Qs=rs.filter(u=>{if(!q)return!0;const w=q.toLowerCase();return u.name.toLowerCase().includes(w)||u.key.toLowerCase().includes(w)||u.resolveType.toLowerCase().includes(w)}),Xs=f?Js:[],Zs=Xs.filter(u=>{if(!q)return!0;const w=q.toLowerCase();return u.title.toLowerCase().includes(w)||u.key.toLowerCase().includes(w)||u.resolveType.toLowerCase().includes(w)}),At=W?Js.find(u=>u.key===W)??null:null,Oe=Is,as=B||W?null:Jo(Qe,ee,pe),re=as?.key??null,Xe=i.state.target?.kind==="section"?i.state.target.key:i.state.focusedBlockKey??re,_t=as?.path??null,Ze=(re?ve[re]:void 0)??{},Ee=Ve(ee,Ze),os={};if(oe&&ft&&Ie&&Se&&le){const u=Va(Se,"loaders"),w=re?le[re]:void 0,U=bl(w,le,be=>u.has(be)),Z=ml(U);for(const be of Ct(ee)){if(be.type!=="param")continue;const $e=ul(ee,be.name,U),Te=vl($e,u,Z);Te.length>0&&(os[be.name]=Te)}}const Ot=t&&r?{orgSlug:ie.slug,virtualMcpId:t,branch:r,threadId:a??null}:null,en=le&&re?Yo(le,re,0):[],tn=at(he),sn=le?Qo(en,le,tn):[],is=sn.map(u=>u.isSavedBlock?u.label:""),ls=sn.map(u=>u.isSavedBlock?"global":u.isMultivariate?"variant":"normal"),cs=en.map(u=>$s(u,le??{},tn)),Dt=C.useRef(null),Re=C.useRef(null),Wr=Ne.status.state==="paused",ds=Ne.phase,nn=qa({claimPhase:ds,lifecycle:Ne.lifecycle}),qe=Fe.previewState,Gr=Fe.userStopped,Jr=Eo(ie.slug,t??""),{url:Ue}=oi(pt&&t&&r?{orgSlug:ie.slug,virtualMcpId:t,branch:r,previewServerUrl:Ye??null,path:Ee}:null),Yr=qr&&l.runtime==="sandbox",Ce=No(he,Ke,_e),rn=Co(Ce&&pt&&he.kind==="protocol"&&t&&r?{orgSlug:ie.slug,virtualMcpId:t,branch:r}:null),an=Ce?rn.pointer:null,Q=Gi({previewState:qe,progressStatus:nn.status,previewServerUrl:Ye,fastPreviewActive:pt,fastPreviewReady:!!Ue,codingSession:Yr,localPreviewUrl:ke,hostedDraft:Ce,hostedPointerPending:Ce&&(he.kind==="pending"||rn.pending),deciding:ne}),on=Q.showWakingPill||Ce&&Q.mode==="production"&&!an,ht=Q.mode!=="none",Qr=Q.mode==="production"&&Q.iframeBase?jt(Q.iframeBase):null,et=Q.mode==="production"?Qr:jt(Ie),Xr=c?.id===t&&c.metadata?.fastPreviewInPlace===!0,gt=oe?ke?Q.mode==="sandbox"&&f&&g==="blocks":Q.mode==="production"&&pt&&Xr&&f&&g==="blocks":!1,ln=C.useRef(null),{pin:Zr,effective:ea}=bc(ln.current,{inPlaceRenderActive:gt,draftPreviewUrl:Ue,resolvedPath:Ee});ln.current=Zr;const cn=i.state.variantOverride??[],Bt=oe?cn:[],vt=oe?[]:cn,us=at(he)&&Xo.some(u=>Zo(Se,u)==="available"),tt=us?V:{},dn=Dr(tt),ta=us&&le?Object.keys(ei(le).experiments):[],$t=Ce?uc({display:Q,path:Ee,pointer:an,device:b,forcedVariants:vt,previewOptions:tt}):null,st=t?Tn(ie.slug,t):null,un=JSON.stringify([vt,tt]);C.useEffect(()=>{if(!Ce||!st)return;const[u,w]=JSON.parse(un);Bn(st,{forcedVariants:u,previewOptions:w})},[Ce,st,un]),C.useEffect(()=>{if(!(!Ce||!st))return()=>Bn(st,null)},[Ce,st]);const fs=Le&&He(he)?Do(Le.endpoint,vt,dn):null,sa=Le&&He(he)?fs?hi(fs,tt):_n:null,nt=xc(Q.mode==="sandbox"?Wt(Bs(On(te??Ls(Ee,Q.iframeBase)??Q.iframeBase,sa),b),Bt):Q.mode==="production"&&$t?.frame?$t.frame:Q.mode==="production"?Wt(Bs(zn(Rn(On(te??ea??Ls(Ee,Q.iframeBase)??Q.iframeBase,on?_n:null),vt),tt),b),Bt):null),fn=Ue??(Q.iframeBase?Ls(Ee,Q.iframeBase):null),pn=Q.mode==="production"&&$t?$t.newTab:Q.mode==="production"?fn?Wt(zn(Rn(fn,vt),tt),Bt):null:nt??Q.iframeBase,na=()=>{const u=pn;u&&window.open(u,"_blank","noopener")},xt=t&&r?pr(ie.slug,t,r):null,bt=u=>{xt&&Qa(xt,u)},ye=i.state.target;C.useEffect(()=>{if(!(!ye||!mt||!Se))if(ye.kind==="page"){const u=ve[ye.key]??{};Re.current=Ve(ye.path,u),z(null),K(null),se(null),de(ye.key),ae(ye.path),bt({path:ye.path,pageKey:ye.key,params:u})}else if(ye.kind==="loader")Re.current=null,z(null),K(ye.key),se(null);else{const u=rs.find(w=>w.key===ye.key);if(u){Re.current=null;const w=An(Se);K(null),z(u),se(Dn(mt,w,u.key))}}},[ye,mt,Se,ve]),C.useEffect(()=>{!re||_t===null||ye?.kind==="page"&&ye.key===re&&ye.path===_t||i.selectTarget({kind:"page",key:re,path:_t})},[re,_t,ye]);const[mn,ra]=C.useState(null);if(qe.kind==="iframe"&&mn!==qe.previewUrl){const u=mn!==null;ra(qe.previewUrl);const w=xt?fr(xt):null;if(w){if(Re.current=Ve(w.path,w.params),ae(w.path),de(w.pageKey),se(null),z(null),K(null),w.pageKey&&Object.keys(w.params).length>0){const U=w.pageKey;ue(Z=>({...Z,[U]:w.params}))}}else u&&(Re.current=null,ae("/"),se(null),de(null),z(null),K(null))}Dt.current=nt;const aa=Q.mode==="production"&&!!Ue&&!ke,[hn,ps]=C.useState({src:nt??void 0,loading:!1}),Mt=mc(hn,nt??void 0,aa);Mt!==hn&&ps(Mt);const yt=Mt.src,gn=Mt.loading,vn=Xi({iframeRef:k,src:Q.mode==="sandbox"?nt:null,active:Q.mode==="sandbox"}),xn=C.useRef(null);C.useEffect(()=>{const u=gn?setTimeout(()=>ps(er),pc):null,w=()=>{u&&clearTimeout(u)};if(!Ue||!yt||xn.current===Ue)return w;xn.current=Ue;const U=k.current;return U&&U.getAttribute("src")!==yt&&(je(),U.src=yt),w},[Ue,yt,gn]);const bn=()=>{const u=k.current?.contentWindow,w=et;if(!u||!w||!le||!re)return;const U=le[re];if(!U||typeof U!="object")return;const Z=ni({previewBaseUrl:w,pageBlock:U,decofile:le,path:Ee,pathTemplate:ee});if(!Z)return;const be=Wt(Z.src,Oo(Bt,re));u.postMessage({type:"cms-editor::render",src:be,body:Z.body},w)},ms=C.useRef(null);C.useEffect(()=>{if(!gt||B||W||!re||!le){ms.current=null;return}const u={nav:JSON.stringify({page:re,path:Ee,pathTemplate:ee}),content:JSON.stringify(le)},w=yc(ms.current,u);ms.current=u,w&&bn()},[le,gt,B,W,re,Ee,ee]);const hs=C.useRef(null);C.useEffect(()=>{if(!gt||B||W||!re||!le){hs.current=null;return}const u=JSON.stringify(i.state.variantOverride??null),w=hs.current;hs.current={page:re,sig:u},!(!w||w.page!==re||w.sig===u)&&bn()},[i.state.variantOverride,gt,B,W,re]);const oa=!!t&&!!r&&!Ne.notFound&&!Gr&&!Wr&&(ds?.kind==="ready"||Be!=="idle"),we=dc({editingMode:g,sandboxDisplay:Q.mode==="sandbox",blocksEditingEnabled:f});C.useEffect(()=>{const u=et;if(!u)return;const w=U=>{if(U.origin===u)if(U.data?.type==="visual-editor::element-clicked"){const Z=sl.safeParse(U.data.payload);Z.success&&v(Z.data)}else if(U.data?.type==="cms-editor::section-clicked"){const Z=al.safeParse(U.data.payload);Z.success&&E({index:Z.data.sectionIndex,seq:Z.data.clickSeq})}else U.data?.type==="cms-editor::render-start"?je():U.data?.type==="cms-editor::render-end"?(fe(),k.current?.contentWindow?.postMessage({type:"cms-editor::set-labels",labels:is,kinds:ls,keys:cs},u)):U.data?.type==="cms-editor::render-error"&&fe()};return window.addEventListener("message",w),()=>window.removeEventListener("message",w)},[et,is,ls,cs]);const yn=()=>{const u=k.current?.contentWindow,w=jt(Ie);!u||!w||u.postMessage({type:"visual-editor::activate",script:nl},w)},ia=()=>{const u=k.current?.contentWindow,w=jt(Ie);!u||!w||u.postMessage({type:"visual-editor::deactivate"},w)},gs=()=>{const u=k.current?.contentWindow,w=et;!u||!w||(u.postMessage(Q.mode==="production"||ke?{type:"editor::inject",args:{script:Wn}}:{type:"visual-editor::activate",script:Wn},w),u.postMessage({type:"cms-editor::set-labels",labels:is,kinds:ls,keys:cs},w))},la=()=>{const u=k.current?.contentWindow,w=et;!u||!w||u.postMessage({type:"cms-editor::deactivate"},w)},ca=()=>{const u=k.current?.contentWindow,w=et;!u||!w||(u.postMessage({type:"cms-editor::clear-hover"},w),u.postMessage({type:"visual-editor::clear-hover"},w))},Ft=u=>{if(u==="blocks"&&!f)return;const w=g;!s&&u!==w&&(u==="blocks"?S.current?.resize("30%"):S.current?.collapse()),j(u),v(null),E(null),u!=="blocks"&&K(null),w==="visual"&&ia(),u==="visual"&&yn(),w==="blocks"&&u!=="blocks"&&la(),u==="blocks"&&gs()},da=()=>{Ft(ic(g,f))},ua=()=>{Ft(lc(g,f))},vs=()=>{const u=k.current;if(!u)return;je();const w=document.activeElement,U=u.tabIndex;u.tabIndex=-1,u.style.pointerEvents="none",u.blur(),kc(u,Dt.current);let Z;const be=()=>{clearTimeout(Z),u.tabIndex=U,u.style.pointerEvents="";const $e=document.activeElement;(!$e||$e===document.body||$e===u)&&w?.focus(),u.removeEventListener("load",be)};u.addEventListener("load",be),Z=setTimeout(be,3e3)};li(vs);const zt=Tn(ie.slug,t??""),Kt=Ce&&ht&&!!t,wn=C.useRef(null);C.useEffect(()=>{if(Kt)return To(zt)},[Kt,zt]);const{reload:wt}=Lo(ie.slug,t??""),kn=C.useRef(wt.seq);C.useEffect(()=>{if(kn.current!==wt.seq&&(kn.current=wt.seq,!!Kt&&wn.current===Dt.current)){if(wt.navigates){Ln(zt);return}vs()}},[wt.seq]);const fa=Ro(Ws),kt=Ao(He(he)?fa:""),Sn=C.useRef(kt);C.useEffect(()=>{const u=Sn.current;if(Sn.current=kt,!u||!kt||u===kt)return;const w=k.current;if(w)return tl({iframe:w,reload:vs})},[kt]);const pa=()=>{const u=Qt.indexOf(b);N(Qt[(u+1)%Qt.length])},xs=(u,w)=>{if(!re)return;const U=re,Z={...Ze,[u]:w};Re.current=Ve(ee,Z),ue(be=>({...be,[U]:Z})),bt({path:ee,pageKey:U,params:Z})},ma=Wl({iframeBase:Q.iframeBase,resolvedPath:Ee,activeGlobalSectionName:B?.name??null,noServerLabel:e("sandbox.preview.noServerRunning")}),bs=u=>{const w=ve[u.key]??{},U=Ve(u.path,w);(B||Oe(U)!==Oe(Ee))&&je(),Re.current=U,z(null),K(null),se(null),E(null),de(u.key),ae(u.path),bt({path:u.path,pageKey:u.key,params:w}),i.selectTarget({kind:"page",key:u.key,path:u.path})};Ya(xt,u=>{(B||Oe(u)!==Oe(Ee))&&je(),Re.current=u,z(null),K(null),se(null),E(null),de(null),ae(u),bt({path:u,pageKey:null,params:{}})});const ha=u=>{if(at(he)){const Z=le?ti(le,u.key,Se):null;Z?bs(Z):Zt.info(e("sandbox.preview.blockOnNoPage"));return}if(!mt||!Se){Zt.error(e("sandbox.preview.previewMetadataNotReady"));return}je(),Re.current=null;const w=An(Se),U=Dn(mt,w,u.key);z(u),K(null),se(U),E(null),i.selectTarget({kind:"section",key:u.key})},ga=u=>{f&&(z(null),K(u.key),se(null),Ft("blocks"),i.selectTarget({kind:"loader",key:u.key}))},va=async({name:u,path:w,templateKey:U})=>{if(!t||!r)return;const Z=Ar(w);if(Z){I(Z);return}const be=w.trim().startsWith("/")?w.trim():`/${w.trim()}`;if(Qe.some(Te=>Oe(Te.path)===Oe(be))){I(e("sandbox.preview.pageAlreadyExists",{path:be}));return}let $e;if(U&&($e=le?.[U],!$e)){I(e("sandbox.preview.templateNoLongerExists"));return}I(void 0);try{const Te=await Gs.mutateAsync({name:u,path:be,template:$e,schema:at(he)?{meta:Se,loadMeta:async()=>(await ns.refetch()).data}:void 0});$(!1),Zt.success(e("sandbox.preview.pageCreated",{name:u})),await xi(hc),bs({key:Te.key,name:Te.name,path:Te.path}),Ft("blocks")}catch(Te){I(Te instanceof Hr?e("sandbox.preview.pageSchemaNotReady"):Te instanceof Error?Te.message:e("sandbox.preview.failedToCreatePage"))}},It=Gl({previewSurfaceActive:ht,daemonReady:oa,production:Q.mode==="production",servePreviewUrl:He(he)}),xa=Jl({showPreviewToolbar:It,contentEditingEnabled:p}),Ut=()=>{X(!1),G("")},ys=B?.name??At?.title??as?.name,ws=qs.isPending||ns.isPending,ks=ws?jt(Q.iframeBase):ys,Ht=B?`section:${B.key}`:W?`loader:${W}`:re?`page:${re}`:void 0,ba=It?xa?n.jsxs(yr,{open:H,onOpenChange:u=>{X(u),u||G("")},children:[n.jsx(xr,{asChild:!0,children:n.jsx("button",{type:"button","aria-label":e("sandbox.preview.choosePage"),"data-testid":"preview-page-picker",title:ws?ks??void 0:B||At?ys:[ys,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:n.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-1.5 px-2 transition-colors group-hover/page-picker:bg-accent/50 group-data-[state=open]/page-picker:bg-accent/50",children:[B&&n.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:[n.jsx(no,{size:11}),e("sandbox.preview.globalBadge")]}),At&&n.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:[n.jsx(ro,{size:11}),e("sandbox.preview.loaderBadge")]}),ks&&n.jsx("span",{className:"min-w-0 flex-1 truncate font-medium text-foreground",children:ks}),!ws&&!B&&!At&&n.jsx("span",{"data-testid":"preview-page-path",className:"ml-auto min-w-0 truncate text-right font-mono text-muted-foreground",children:ee}),n.jsx(Xa,{size:12,className:De("shrink-0 transition-transform",H&&"rotate-180")})]})})}),n.jsxs(br,{className:"w-112 max-w-[calc(100vw-2rem)] p-0",align:"center",sideOffset:8,children:[n.jsxs(kr,{shouldFilter:!1,defaultValue:Ht,children:[n.jsx(Sr,{value:q,onValueChange:u=>{G(u),Y.current?.scrollTo({top:0})},placeholder:e("sandbox.preview.searchPagesAndComponents")}),n.jsxs(wr,{ref:Y,className:"max-h-80",children:[n.jsx(Pr,{children:Qe.length===0&&rs.length===0&&Xs.length===0?e("sandbox.preview.noPagesFound"):e("sandbox.preview.noSearchResults")}),Ys.length>0&&n.jsx(Et,{children:Ys.map(u=>n.jsxs(Nt,{value:`page:${u.key}`,"aria-current":Ht===`page:${u.key}`||void 0,title:`${u.name} · ${u.path}`,onSelect:()=>{Ut(),bs(u)},className:"gap-3 px-3 py-2.5 aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",children:[n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm",children:u.name}),n.jsx("span",{className:"min-w-0 max-w-1/2 truncate text-right font-mono text-xs text-muted-foreground",children:u.path})]},u.key))}),Qs.length>0&&n.jsx(Et,{heading:e("sandbox.preview.globalComponents"),children:Qs.map(u=>n.jsx(Nt,{value:`section:${u.key}`,"aria-current":Ht===`section:${u.key}`||void 0,className:"aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",onSelect:()=>{Ut(),ha(u)},children:n.jsx("span",{className:"truncate",children:u.name})},u.key))}),Zs.length>0&&n.jsx(Et,{heading:e("sandbox.preview.globalLoaders"),children:Zs.map(u=>n.jsx(Nt,{value:`loader:${u.key}`,"aria-current":Ht===`loader:${u.key}`||void 0,className:"aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",onSelect:()=>{Ut(),ga(u)},children:n.jsx("span",{className:"truncate",children:u.title})},u.key))})]})]}),!B&&!W&&Ct(ee).some(u=>u.type!=="text")&&n.jsx("div",{className:"flex flex-wrap items-center gap-1 border-t px-3 py-3 text-xs text-muted-foreground",children:Ct(ee).map((u,w)=>{if(u.type==="text")return n.jsx("span",{children:u.text},`text-${w}`);const U=os[u.name];return U&&Ot?n.jsx(Ol,{sources:U,template:ee,paramName:u.name,value:Ze[u.name]??"",sandboxRef:Ot,onCommit:Z=>xs(u.name,Z)},`${re}:${u.name}`):n.jsx(Vl,{name:u.name,value:Ze[u.name]??"",onCommit:Z=>xs(u.name,Z)},`${re}:${u.name}`)})}),n.jsx("div",{className:"border-t p-1.5",children:n.jsxs(Me,{variant:"ghost",className:"w-full justify-start",onClick:()=>{Ut(),I(void 0),$(!0)},children:[n.jsx(vr,{size:16}),e("sandbox.preview.createNewPage")]})})]})]}):n.jsx("span",{className:"min-w-0 truncate text-xs text-muted-foreground",children:ma}):null,Pn=It||p?n.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[n.jsxs(dt,{children:[n.jsx(lt,{asChild:!0,children:n.jsx(We,{onClick:pa,"aria-label":e(sr[b]),children:b==="mobile"?n.jsx(hr,{size:16}):b==="tablet"?n.jsx(ao,{size:16}):n.jsx(gr,{size:16})})}),n.jsx(ct,{children:e(sr[b])})]}),ba,n.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[us&&n.jsx(fc,{tests:ta,options:V,onChange:J,available:!!fs||!on||!dn}),n.jsx(We,{onClick:na,disabled:Ce&&!pn,"aria-label":e("sandbox.preview.openInNewTab"),children:n.jsx(cr,{size:16})})]})]}):null,ya=(oe||o)&&Q.mode==="sandbox",Vt=gc[b],qt=b==="desktop"&&(A.width===0||A.width>=Vt.width+2*tr),jn=qt?1:Math.min(A.width>0?A.width/(Vt.width+2*tr):1,1),wa=qt?{width:"100%",height:"100%"}:{width:`${Vt.width}px`,height:A.height>0?`${A.height/jn}px`:`${Vt.height}px`,transform:`scale(${jn})`,transformOrigin:"top center"},En=n.jsxs(n.Fragment,{children:[ya&&(It||p)&&n.jsx(We,{onClick:da,"aria-pressed":we==="visual","aria-label":e("sandbox.preview.visualEditor"),active:we==="visual",children:n.jsx(Cn,{size:16})}),f&&n.jsxs(dt,{children:[n.jsx(lt,{asChild:!0,children:n.jsx(We,{onClick:ua,"aria-pressed":we==="blocks","aria-label":e("sandbox.preview.blocksEditor"),active:we==="blocks",children:n.jsx(io,{size:16})})}),n.jsx(ct,{children:e("sandbox.preview.blocksEditor")})]}),Xe&&n.jsxs(dt,{children:[n.jsx(lt,{asChild:!0,children:n.jsx(We,{onClick:D,"aria-pressed":R,"aria-label":e("sectionsEditor.sectionsEditor.viewJson"),active:R,children:n.jsx(oo,{size:16})})}),n.jsx(ct,{children:e("sectionsEditor.sectionsEditor.viewJson")})]})]}),ka=!!W&&we==="blocks";return n.jsxs("div",{className:"flex flex-col w-full h-full",children:[Ot&&Object.entries(os).map(([u,w])=>(Ze[u]??"")===""?n.jsx(Ul,{sources:w,template:ee,paramName:u,sandboxRef:Ot,onFill:U=>xs(u,U)},`${re}:${u}`):null),n.jsxs(n.Fragment,{children:[n.jsx(Os.Toolbar.Center.Portal,{fallback:n.jsx("div",{className:"flex min-w-0 items-center justify-center border-b p-2",children:Pn}),children:Pn}),n.jsx(Os.Toolbar.Right.Portal,{fallback:En,children:En})]}),n.jsx("div",{className:"flex-1 overflow-hidden relative",children:ka?n.jsxs("div",{className:"relative h-full min-h-0 overflow-hidden",children:[n.jsx(Xn,{virtualMcpId:t,externalSelection:P,onViewJsonFile:D}),R&&Xe&&n.jsx("div",{className:"absolute inset-0 z-10",children:n.jsx(Zn,{ref:T,virtualMcpId:t,pageKey:Xe,onClose:L})})]}):n.jsxs($n,{orientation:"horizontal",disabled:we!=="blocks",className:"relative isolate",children:[n.jsx(Gt,{ref:S,id:"preview-blocks-editor",defaultSize:we==="blocks"?"30%":"0%",minSize:"20%",collapsible:!0,collapsedSize:"0%",className:"min-w-0 overflow-hidden",children:we==="blocks"&&n.jsx(Xn,{virtualMcpId:t,externalSelection:P,onViewJsonFile:D})}),we==="blocks"&&n.jsx(Mn,{withHandle:!0}),n.jsx(Gt,{id:"preview-canvas",defaultSize:we==="blocks"?"70%":"100%",minSize:"35%",className:"min-w-0 overflow-hidden relative z-0",children:n.jsxs($n,{orientation:"horizontal",disabled:!(R&&Xe),children:[n.jsx(Gt,{id:"preview-canvas-inner",minSize:"30%",className:"min-w-0 overflow-hidden",children:n.jsxs("div",{ref:u=>{if(!u)return;const w=()=>M(Z=>Z.width===u.clientWidth&&Z.height===u.clientHeight?Z:{width:u.clientWidth,height:u.clientHeight});w();const U=new ResizeObserver(w);return U.observe(u),()=>U.disconnect()},className:De("h-full relative overflow-clip flex justify-center",ht&&!qt&&"bg-muted/30"),children:[(xe||Jr)&&ht&&n.jsx("div",{className:"absolute inset-x-0 top-0 z-40 h-1 overflow-hidden",children:n.jsx("div",{className:"absolute inset-y-0 left-0 rounded-r-full bg-brand shadow-[0_0_6px] shadow-brand/60 animate-preview-ramp"})}),Q.showDecidingLoader&&n.jsx("div",{"data-testid":"preview-deciding",className:"absolute inset-0 z-30 flex items-center justify-center",children:n.jsx(Tt,{className:"size-5 text-muted-foreground"})}),Q.showBlockingOverlay&&n.jsx("div",{className:"absolute inset-0 z-30",children:n.jsx(Ps,{kind:"starting",progress:nn,claimPhase:ds})}),!ke&&!ne&&qe.kind==="suspended"&&n.jsx("div",{className:"absolute inset-0 z-30",children:n.jsx(Ps,{kind:"suspended",onResume:Fe.resume})}),!ke&&!ne&&qe.kind==="errored"&&n.jsx("div",{className:"absolute inset-0 z-30",children:n.jsx(Ps,{kind:"errored",error:qe.error,onRetry:Fe.retry,connectionsHref:`/${ie.slug}/settings/connections`})}),Q.showWakingPill&&n.jsxs("div",{className:"absolute top-4 left-1/2 z-20 flex max-w-md -translate-x-1/2 items-start gap-3 rounded-xl bg-muted px-4 py-3 shadow-soft pointer-events-none select-none",children:[n.jsx(Tt,{className:"size-4.5 mt-0.5 shrink-0 text-muted-foreground"}),n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsx("span",{className:"text-sm font-medium text-foreground",children:e("sandbox.preview.startingPreview")}),n.jsx("span",{className:"text-xs text-muted-foreground",children:e("sandbox.preview.startingPreviewHint")})]})]}),we==="visual"&&!y&&n.jsxs("div",{className:"absolute top-2 left-1/2 -translate-x-1/2 z-20 flex items-center gap-1.5 rounded-full border border-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:[n.jsx(Cn,{size:12}),e("sandbox.preview.clickElementToAsk")]}),we==="visual"&&y&&n.jsx(ll,{element:y,onDismiss:()=>v(null)}),ht&&nt&&n.jsx("div",{className:De("shrink-0",!qt&&"bg-background shadow-edge"),style:wa,onMouseLeave:ca,children:n.jsx("iframe",{ref:k,src:yt,className:"w-full h-full border-0",title:e("sandbox.preview.devServerPreviewTitle"),onError:vn.handleError,onLoad:()=>{if(ps(er),vn.handleLoad(),fe(),wn.current=Dt.current,Kt&&Ln(zt),Q.mode!=="sandbox"||ke){(Q.mode==="production"&&!Q.showWakingPill||ke)&&we==="blocks"&&gs();return}if(Aa("vm_preview_loaded",{view_mode:we,vm_id:ze?.sandboxHandle??null}),!B)try{const u=k.current?.contentWindow?.location?.pathname;if(!u)return;const w=Re.current;if(w!==null&&(Re.current=null,Oe(u)!==Oe(w))||Oe(u)===Oe(Ee))return;ae(u),bt({path:u,pageKey:pe,params:Ze})}catch{}we==="visual"&&yn(),we==="blocks"&&gs()}},Q.iframeBase)})]})}),R&&Xe&&n.jsxs(n.Fragment,{children:[n.jsx(Mn,{withHandle:!0}),n.jsx(Gt,{id:"preview-json-editor",defaultSize:"43%",minSize:"20%",className:"min-w-0 overflow-hidden",children:n.jsx(Zn,{ref:T,virtualMcpId:t,pageKey:Xe,onClose:L})})]})]})})]})}),n.jsx(Zl,{open:_,onOpenChange:$,isPending:Gs.isPending,error:F,templates:Qe,onSubmit:va})]})}const Fs={app:null,split:!1};function Pc(t){const e=ce.c(24),{project:s,maxApps:r,children:a}=t,d=Pe();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={silent:!0},e[0]=o):o=e[0];const i=uo(o),c=Rt();let l;e[1]!==s.metadata.runtime?(l=s.metadata.runtime??{},e[1]=s.metadata.runtime,e[2]=l):l=e[2];const m=l;let p;e[3]!==m.apps?(p=m.apps??[],e[3]=m.apps,e[4]=p):p=e[4];const f=p;let x;e[5]!==i.update||e[6]!==c||e[7]!==s.id||e[8]!==s.metadata||e[9]!==m||e[10]!==d?(x=y=>i.update.mutate({id:s.id,data:{metadata:{...bi(s.metadata),runtime:{...m,apps:y.length?y:null}}}},{onSuccess:()=>c.start(),onError:()=>Zt.error(d("sandbox.appTabs.saveError"))}),e[5]=i.update,e[6]=c,e[7]=s.id,e[8]=s.metadata,e[9]=m,e[10]=d,e[11]=x):x=e[11];const h=x,j=m.path??null;let g,b;e[12]!==f||e[13]!==h?(g=y=>h([...f,{path:y}]),b=y=>h(f.filter(v=>v.path!==y)),e[12]=f,e[13]=h,e[14]=g,e[15]=b):(g=e[14],b=e[15]);let N;return e[16]!==f||e[17]!==a||e[18]!==r||e[19]!==s.id||e[20]!==j||e[21]!==g||e[22]!==b?(N=n.jsx(jc,{virtualMcpId:s.id,mainPath:j,apps:f,maxApps:r,onAddApp:g,onRemoveApp:b,children:a}),e[16]=f,e[17]=a,e[18]=r,e[19]=s.id,e[20]=j,e[21]=g,e[22]=b,e[23]=N):N=e[23],N}function jc(t){const e=ce.c(102),{virtualMcpId:s,mainPath:r,apps:a,maxApps:d,onAddApp:o,onRemoveApp:i,children:c}=t,l=Pe(),m=Tr(),{currentBranch:p}=Lt(),f=Rt(),x=Us().lifecycle.phase,h=ss(s,p),{url:j}=Nr(s);let g;e[0]!==h||e[1]!==j?(g=He(h)??j,e[0]=h,e[1]=j,e[2]=g):g=e[2];const b=g,N=b??f.previewUrl,y=!!b||x==="running",v=!y&&f.status==="errored";let P;e[3]!==f.vmEntry?.startedWith?.apps?(P=f.vmEntry?.startedWith?.apps??[],e[3]=f.vmEntry?.startedWith?.apps,e[4]=P):P=e[4];const E=P;let k;e[5]!==s?(k=_s.previewAppLayout(s),e[5]=s,e[6]=k):k=e[6];const[S,R]=As(k,Ec);let O;e[7]!==a||e[8]!==S?(O=a.some(fe=>fe.path===S.app)?S.app:null,e[7]=a,e[8]=S,e[9]=O):O=e[9];const T=O,L=T!==null&&S.split&&!m,D=T===null||L,A=T??a[0]?.path??null,[M,H]=C.useState(null),[X,V]=C.useState(!1);let J;e[10]===Symbol.for("react.memo_cache_sentinel")?(J=()=>{H(null),V(!1)},e[10]=J):J=e[10];const q=J;let G;e[11]!==a||e[12]!==M||e[13]!==m||e[14]!==r||e[15]!==o||e[16]!==R?(G=()=>{if(M===null)return;const fe=Kn(M);if(!fe){q();return}if(fe===Kn(r??"")||a.some(ie=>ie.path===fe)){V(!0);return}o(fe),R({app:fe,split:!m}),q()},e[11]=a,e[12]=M,e[13]=m,e[14]=r,e[15]=o,e[16]=R,e[17]=G):G=e[17];const Y=G;let _;e[18]!==r||e[19]!==l?(_=r?Es(r):l("sandbox.appTabs.root"),e[18]=r,e[19]=l,e[20]=_):_=e[20];const $=_;let F;e[21]!==L||e[22]!==l?(F=l(L?"sandbox.appTabs.single":"sandbox.appTabs.split"),e[21]=L,e[22]=l,e[23]=F):F=e[23];const I=F;let B;e[24]!==l?(B=l("sandbox.appTabs.label"),e[24]=l,e[25]=B):B=e[25];let z;e[26]!==l?(z=l("sandbox.appTabs.main"),e[26]=l,e[27]=z):z=e[27];let W;e[28]!==l?(W=l("sandbox.appTabs.mainHint"),e[28]=l,e[29]=W):W=e[29];let K;e[30]!==R?(K=()=>R(Fs),e[30]=R,e[31]=K):K=e[31];let te;e[32]!==v||e[33]!==$||e[34]!==y||e[35]!==D||e[36]!==z||e[37]!==W||e[38]!==K?(te=n.jsx(nr,{label:$,badge:z,hint:W,ready:y,failed:v,onScreen:D,onSelect:K}),e[32]=v,e[33]=$,e[34]=y,e[35]=D,e[36]=z,e[37]=W,e[38]=K,e[39]=te):te=e[39];let se;if(e[40]!==a||e[41]!==T||e[42]!==v||e[43]!==$||e[44]!==i||e[45]!==y||e[46]!==R||e[47]!==L||e[48]!==l){let fe;e[50]!==T||e[51]!==v||e[52]!==$||e[53]!==i||e[54]!==y||e[55]!==R||e[56]!==L||e[57]!==l?(fe=ie=>{const Ne=Es(ie.path);return n.jsx(nr,{label:Ne,hint:l("sandbox.appTabs.extraHint",{app:$}),ready:y,failed:v,onScreen:ie.path===T,onSelect:()=>R({app:ie.path,split:L}),onRemove:()=>i(ie.path),removeLabel:l("sandbox.appTabs.remove",{app:Ne})},ie.path)},e[50]=T,e[51]=v,e[52]=$,e[53]=i,e[54]=y,e[55]=R,e[56]=L,e[57]=l,e[58]=fe):fe=e[58],se=a.map(fe),e[40]=a,e[41]=T,e[42]=v,e[43]=$,e[44]=i,e[45]=y,e[46]=R,e[47]=L,e[48]=l,e[49]=se}else se=e[49];let ee;e[59]!==te||e[60]!==se||e[61]!==B?(ee=n.jsxs("div",{role:"tablist","aria-label":B,className:"flex min-w-0 items-center gap-1 overflow-x-auto",children:[te,se]}),e[59]=te,e[60]=se,e[61]=B,e[62]=ee):ee=e[62];let ae;e[63]!==a.length||e[64]!==Y||e[65]!==M||e[66]!==X||e[67]!==d||e[68]!==l?(ae=M!==null?n.jsx("form",{className:"w-40 shrink-0",onSubmit:fe=>{fe.preventDefault(),Y()},children:n.jsx("input",{autoFocus:!0,value:M,placeholder:"apps/checkout","aria-label":l("sandbox.appTabs.pathLabel"),"aria-invalid":X,onChange:fe=>{H(fe.target.value),V(!1)},onBlur:q,onKeyDown:fe=>{fe.key==="Escape"&&q()},className:De("h-7 w-full rounded-md border bg-background px-2 font-mono text-xs outline-none",X?"border-destructive":"border-border")})}):a.length<d&&n.jsx(it,{label:l("sandbox.appTabs.add"),onClick:()=>H(""),children:n.jsx(vr,{})}),e[63]=a.length,e[64]=Y,e[65]=M,e[66]=X,e[67]=d,e[68]=l,e[69]=ae):ae=e[69];let pe;e[70]!==m||e[71]!==R||e[72]!==L||e[73]!==I||e[74]!==A?(pe=!m&&A&&n.jsx(it,{label:I,active:L,onClick:()=>R(L?Fs:{app:A,split:!0}),children:n.jsx(lo,{})}),e[70]=m,e[71]=R,e[72]=L,e[73]=I,e[74]=A,e[75]=pe):pe=e[75];let de;e[76]!==ee||e[77]!==ae||e[78]!==pe?(de=n.jsxs(n.Fragment,{children:[ee,ae,pe]}),e[76]=ee,e[77]=ae,e[78]=pe,e[79]=de):de=e[79];const ve=de;let ue;e[80]!==ve?(ue=n.jsx(Os.Topbar.Left.Portal,{fallback:n.jsx("div",{className:"flex h-10 shrink-0 items-center gap-1 border-b border-border px-2",children:ve}),children:n.jsx("div",{className:"ml-1 flex min-w-0 items-center gap-1 border-l border-border/60 pl-2",children:ve})}),e[80]=ve,e[81]=ue):ue=e[81];let xe;e[82]!==c||e[83]!==D?(xe=D&&n.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:c}),e[82]=c,e[83]=D,e[84]=xe):xe=e[84];let me;e[85]!==T||e[86]!==v||e[87]!==f.start||e[88]!==b||e[89]!==$||e[90]!==N||e[91]!==y||e[92]!==R||e[93]!==L||e[94]!==E?(me=T!==null&&n.jsx(Nc,{name:Es(T),mainName:$,appUrl:N?yi(N,T):null,ready:y,failed:v,notStarted:!b&&!E.includes(T),onStart:f.start,className:De(L&&"border-l border-border"),onClose:L?()=>R({app:T,split:!1}):void 0},T),e[85]=T,e[86]=v,e[87]=f.start,e[88]=b,e[89]=$,e[90]=N,e[91]=y,e[92]=R,e[93]=L,e[94]=E,e[95]=me):me=e[95];let ge;e[96]!==xe||e[97]!==me?(ge=n.jsxs("div",{className:"flex min-h-0 flex-1",children:[xe,me]}),e[96]=xe,e[97]=me,e[98]=ge):ge=e[98];let je;return e[99]!==ue||e[100]!==ge?(je=n.jsxs("div",{className:"flex h-full w-full min-h-0 flex-col",children:[ue,ge]}),e[99]=ue,e[100]=ge,e[101]=je):je=e[101],je}function Ec(t){return t??Fs}function nr(t){const e=ce.c(28),{label:s,badge:r,hint:a,ready:d,failed:o,onScreen:i,onSelect:c,onRemove:l,removeLabel:m}=t,p=i?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/60 hover:text-foreground";let f;e[0]!==p?(f=De("group/app-tab flex h-7 shrink-0 items-center rounded-md text-xs transition-colors",p),e[0]=p,e[1]=f):f=e[1];const x=d?"bg-success":o?"bg-destructive":"animate-pulse bg-warning";let h;e[2]!==x?(h=De("size-1.5 rounded-full",x),e[2]=x,e[3]=h):h=e[3];let j;e[4]!==h?(j=n.jsx("span",{"aria-hidden":!0,className:h}),e[4]=h,e[5]=j):j=e[5];let g;e[6]!==s?(g=n.jsx("span",{className:"max-w-40 truncate",children:s}),e[6]=s,e[7]=g):g=e[7];let b;e[8]!==r?(b=r&&n.jsx("span",{className:"text-[10px] text-muted-foreground",children:r}),e[8]=r,e[9]=b):b=e[9];let N;e[10]!==i||e[11]!==c||e[12]!==j||e[13]!==g||e[14]!==b?(N=n.jsx(lt,{asChild:!0,children:n.jsxs("button",{type:"button",role:"tab","aria-selected":i,onClick:c,className:"flex h-full items-center gap-1.5 rounded-md px-2.5 focus-ring",children:[j,g,b]})}),e[10]=i,e[11]=c,e[12]=j,e[13]=g,e[14]=b,e[15]=N):N=e[15];let y;e[16]!==a?(y=n.jsx(ct,{className:"max-w-64",children:a}),e[16]=a,e[17]=y):y=e[17];let v;e[18]!==N||e[19]!==y?(v=n.jsxs(dt,{children:[N,y]}),e[18]=N,e[19]=y,e[20]=v):v=e[20];let P;e[21]!==l||e[22]!==m?(P=l&&n.jsx("button",{type:"button","aria-label":m,onClick:l,className:"-ml-1 mr-1 flex size-5 items-center justify-center rounded opacity-0 hover:bg-sidebar-accent focus-ring focus-visible:opacity-100 group-hover/app-tab:opacity-100",children:n.jsx(Br,{className:"size-3"})}),e[21]=l,e[22]=m,e[23]=P):P=e[23];let E;return e[24]!==v||e[25]!==P||e[26]!==f?(E=n.jsxs("div",{className:f,children:[v,P]}),e[24]=v,e[25]=P,e[26]=f,e[27]=E):E=e[27],E}function Nc(t){const e=ce.c(71),{name:s,mainName:r,appUrl:a,ready:d,failed:o,notStarted:i,onStart:c,className:l,onClose:m}=t,p=Pe(),[f,x]=C.useState("/"),[h,j]=C.useState("desktop"),[g,b]=C.useState(0),N=C.useRef(null);let y;e[0]!==a||e[1]!==f?(y=a?wi(a,f):null,e[0]=a,e[1]=f,e[2]=y):y=e[2];const v=y;let P;e[3]!==l?(P=De("flex min-h-0 min-w-0 flex-1 flex-col",l),e[3]=l,e[4]=P):P=e[4];let E;e[5]===Symbol.for("react.memo_cache_sentinel")?(E=W=>{W.preventDefault(),x(N.current?.value||"/")},e[5]=E):E=e[5];let k;e[6]!==s||e[7]!==p?(k=p("sandbox.appPane.path",{app:s}),e[6]=s,e[7]=p,e[8]=k):k=e[8];let S;e[9]!==f||e[10]!==k?(S=n.jsx("form",{className:"min-w-0 flex-1",onSubmit:E,children:n.jsx("input",{ref:N,defaultValue:f,"aria-label":k,className:"h-7 w-full rounded-md border border-border/60 bg-background px-2 font-mono text-xs text-muted-foreground outline-none hover:border-border focus:border-border focus:text-foreground"})}),e[9]=f,e[10]=k,e[11]=S):S=e[11];let R;e[12]!==h||e[13]!==p?(R=p(h==="desktop"?"sandbox.preview.deviceMobile":"sandbox.preview.deviceDesktop"),e[12]=h,e[13]=p,e[14]=R):R=e[14];let O;e[15]===Symbol.for("react.memo_cache_sentinel")?(O=()=>j(Tc),e[15]=O):O=e[15];let T;e[16]!==h?(T=h==="desktop"?n.jsx(gr,{}):n.jsx(hr,{}),e[16]=h,e[17]=T):T=e[17];let L;e[18]!==R||e[19]!==T?(L=n.jsx(it,{label:R,onClick:O,children:T}),e[18]=R,e[19]=T,e[20]=L):L=e[20];let D;e[21]!==s||e[22]!==p?(D=p("sandbox.appPane.reload",{app:s}),e[21]=s,e[22]=p,e[23]=D):D=e[23];const A=!v||!d;let M,H;e[24]===Symbol.for("react.memo_cache_sentinel")?(M=()=>b(Cc),H=n.jsx(_a,{}),e[24]=M,e[25]=H):(M=e[24],H=e[25]);let X;e[26]!==D||e[27]!==A?(X=n.jsx(it,{label:D,disabled:A,onClick:M,children:H}),e[26]=D,e[27]=A,e[28]=X):X=e[28];let V;e[29]!==s||e[30]!==p?(V=p("sandbox.appPane.openInNewTab",{app:s}),e[29]=s,e[30]=p,e[31]=V):V=e[31];const J=!v||!d;let q;e[32]!==v?(q=()=>v&&window.open(v,"_blank","noopener"),e[32]=v,e[33]=q):q=e[33];let G;e[34]===Symbol.for("react.memo_cache_sentinel")?(G=n.jsx(cr,{}),e[34]=G):G=e[34];let Y;e[35]!==V||e[36]!==J||e[37]!==q?(Y=n.jsx(it,{label:V,disabled:J,onClick:q,children:G}),e[35]=V,e[36]=J,e[37]=q,e[38]=Y):Y=e[38];let _;e[39]!==s||e[40]!==m||e[41]!==p?(_=m&&n.jsx(it,{label:p("sandbox.appPane.close",{app:s}),onClick:m,children:n.jsx(Br,{})}),e[39]=s,e[40]=m,e[41]=p,e[42]=_):_=e[42];let $;e[43]!==X||e[44]!==Y||e[45]!==_||e[46]!==S||e[47]!==L?($=n.jsxs("div",{className:"flex h-10 shrink-0 items-center gap-1 border-b border-border px-2",children:[S,L,X,Y,_]}),e[43]=X,e[44]=Y,e[45]=_,e[46]=S,e[47]=L,e[48]=$):$=e[48];let F;e[49]!==r||e[50]!==p?(F=p("sandbox.appPane.previewOnly",{app:r}),e[49]=r,e[50]=p,e[51]=F):F=e[51];let I;e[52]!==F?(I=n.jsx("p",{className:"shrink-0 truncate border-b border-border bg-muted/40 px-3 py-1.5 text-xs text-muted-foreground",children:F}),e[52]=F,e[53]=I):I=e[53];let B;e[54]!==h||e[55]!==o||e[56]!==r||e[57]!==s||e[58]!==i||e[59]!==c||e[60]!==d||e[61]!==g||e[62]!==v||e[63]!==p?(B=n.jsx("div",{className:"flex min-h-0 flex-1 justify-center overflow-auto bg-muted/40",children:d&&i?n.jsxs("div",{className:"flex flex-col items-center gap-3 self-center px-6 text-center",children:[n.jsx("p",{className:"text-sm text-muted-foreground",children:p("sandbox.appPane.notStarted",{app:s})}),n.jsx(Me,{size:"sm",variant:"outline",onClick:c,children:p("sandbox.appPane.start",{app:s})})]}):!d||!v?n.jsx("p",{className:"self-center px-6 text-center text-sm text-muted-foreground",children:d?p("sandbox.appPane.noUrl"):o?p("sandbox.appPane.failed",{app:r}):p("sandbox.appPane.waiting")}):n.jsx("iframe",{src:v,title:s,className:De("h-full bg-background",h==="mobile"?"w-[412px] max-w-full border-x border-border":"w-full")},`${v}#${g}`)}),e[54]=h,e[55]=o,e[56]=r,e[57]=s,e[58]=i,e[59]=c,e[60]=d,e[61]=g,e[62]=v,e[63]=p,e[64]=B):B=e[64];let z;return e[65]!==s||e[66]!==P||e[67]!==$||e[68]!==I||e[69]!==B?(z=n.jsxs("section",{"aria-label":s,className:P,children:[$,I,B]}),e[65]=s,e[66]=P,e[67]=$,e[68]=I,e[69]=B,e[70]=z):z=e[70],z}function Cc(t){return t+1}function Tc(t){return t==="desktop"?"mobile":"desktop"}function it(t){const e=ce.c(11),{label:s,children:r,active:a,disabled:d,onClick:o}=t;let i;e[0]!==a||e[1]!==r||e[2]!==d||e[3]!==s||e[4]!==o?(i=n.jsx(lt,{asChild:!0,children:n.jsx(We,{"aria-label":s,"aria-pressed":a,active:a,disabled:d,onClick:o,children:r})}),e[0]=a,e[1]=r,e[2]=d,e[3]=s,e[4]=o,e[5]=i):i=e[5];let c;e[6]!==s?(c=n.jsx(ct,{children:s}),e[6]=s,e[7]=c):c=e[7];let l;return e[8]!==i||e[9]!==c?(l=n.jsxs(dt,{children:[i,c]}),e[8]=i,e[9]=c,e[10]=l):l=e[10],l}const Lc=async(t,e)=>{try{return await fetch(t,{method:"HEAD",mode:"no-cors",cache:"no-store",credentials:"omit",signal:e}),!0}catch{return!1}},Rc=1e4,Ac=1e4,_c=5e3,Oc=2;function Dc(t,e){return t&&e===0?Ac:Math.min(1e3*2**Math.max(0,e-1),_c)}function Bc(t,e,s){return e?!0:t===!0&&s<Oc}function $c(t,e){const s=ce.c(11),r=Lc,a=Oa();let d;s[0]!==t?(d=or.localAppReachable(t??""),s[0]=t,s[1]=d):d=s[1];const o=d;let i;s[2]!==r||s[3]!==a||s[4]!==o||s[5]!==t?(i=async p=>{const{signal:f}=p,x=new AbortController,h=()=>x.abort();f.addEventListener("abort",h);const j=setTimeout(h,Rc),g=await r(t,x.signal).catch(Fc);clearTimeout(j),f.removeEventListener("abort",h);const b=a.getQueryData(o),N=g?0:(b?.failures??0)+1;return{up:Bc(b?.up??null,g,N),failures:N}},s[2]=r,s[3]=a,s[4]=o,s[5]=t,s[6]=i):i=s[6];const c=!!t;let l;s[7]!==o||s[8]!==i||s[9]!==c?(l={queryKey:o,queryFn:i,enabled:c,retry:!1,staleTime:0,gcTime:0,refetchInterval:Mc},s[7]=o,s[8]=i,s[9]=c,s[10]=l):l=s[10];const{data:m}=Da(l);return t?m?.up??null:null}function Mc(t){return t.state.data?Dc(t.state.data.up,t.state.data.failures):!1}function Fc(){return!1}function zc(t){const{backend:e}=t;if(e.kind==="protocol"&&e.source==="local")return{kind:"connected"};if(e.kind==="unavailable"&&e.source==="local"){const s=e.problem;return!s||s.reason==="not-answering"?t.access==="denied"?{kind:"needs-permission"}:{kind:"not-running"}:{kind:"problem",problem:s}}return{kind:"connecting"}}function Kd(t){const e=ce.c(53),{virtualMcpId:s}=t,r=Pe(),a=fo(s),{connection:d}=Cr(s),{activeTask:o,taskId:i,currentBranch:c}=Lt(),l=Ai(i),[m,p]=C.useState(!1),f=ss(s,c);let x;e[0]!==f||e[1]!==d?(x=d?He(f):null,e[0]=f,e[1]=d,e[2]=x):x=e[2];const h=x,j=$c(h),g=Mr(),b=ki("multi_app_preview");if(ji({threadId:i,sandboxBranch:o?.branch??c,agentHasRepo:js(a?.metadata),threadHasRepo:js(l)||js(o?.metadata)})==="none"&&!d){let E;e[3]===Symbol.for("react.memo_cache_sentinel")?(E=n.jsx("div",{className:"flex size-14 items-center justify-center rounded-full bg-muted",children:n.jsx(In,{className:"size-7 text-foreground"})}),e[3]=E):E=e[3];let k;e[4]!==r?(k=r("mainPanelTabs.previewTab.noSourceToPreview"),e[4]=r,e[5]=k):k=e[5];let S;e[6]!==r?(S=r("mainPanelTabs.previewTab.connectGithubDescription"),e[6]=r,e[7]=S):S=e[7];let R,O;e[8]===Symbol.for("react.memo_cache_sentinel")?(R=()=>p(!0),O=n.jsx(In,{className:"size-4"}),e[8]=R,e[9]=O):(R=e[8],O=e[9]);let T;e[10]!==r?(T=r("mainPanelTabs.previewTab.connectGithub"),e[10]=r,e[11]=T):T=e[11];let L;e[12]!==T?(L=n.jsxs(Me,{onClick:R,children:[O,T]}),e[12]=T,e[13]=L):L=e[13];let D;e[14]!==k||e[15]!==S||e[16]!==L?(D=n.jsx(Si,{className:"h-full",image:E,title:k,description:S,actions:L}),e[14]=k,e[15]=S,e[16]=L,e[17]=D):D=e[17];let A;e[18]!==m?(A=n.jsx(Pi,{open:m,onOpenChange:p,mode:"agent"}),e[18]=m,e[19]=A):A=e[19];let M;return e[20]!==A||e[21]!==D?(M=n.jsxs(n.Fragment,{children:[D,A]}),e[20]=A,e[21]=D,e[22]=M):M=e[22],M}if(d&&a&&!He(f)){let E;e[23]!==g||e[24]!==f?(E=zc({backend:f,access:g}),e[23]=g,e[24]=f,e[25]=E):E=e[25];let k;e[26]!==d.endpoint?(k=_o(d.endpoint),e[26]=d.endpoint,e[27]=k):k=e[27];let S;return e[28]!==E||e[29]!==k?(S=n.jsx(Ic,{status:E,host:k}),e[28]=E,e[29]=k,e[30]=S):S=e[30],S}if(h&&j!==!0){let E;e[31]!==r?(E=r("mainPanelTabs.previewTab.localAppWaiting.title"),e[31]=r,e[32]=E):E=e[32];let k;e[33]!==h||e[34]!==r?(k=r("mainPanelTabs.previewTab.localAppWaiting.body",{host:Kc(h)}),e[33]=h,e[34]=r,e[35]=k):k=e[35];let S;e[36]!==k?(S=n.jsx(es,{text:k}),e[36]=k,e[37]=S):S=e[37];let R;e[38]!==r?(R=r("mainPanelTabs.previewTab.localAppWaiting.hint"),e[38]=r,e[39]=R):R=e[39];let O;e[40]!==R?(O=n.jsx("p",{role:"status",className:"text-center text-sm text-muted-foreground",children:R}),e[40]=R,e[41]=O):O=e[41];let T;return e[42]!==E||e[43]!==S||e[44]!==O?(T=n.jsx(ts,{headingLevel:2,waiting:!0,title:E,lead:S,footer:O}),e[42]=E,e[43]=S,e[44]=O,e[45]=T):T=e[45],T}let y;e[46]!==s?(y=n.jsx(Sc,{virtualMcpId:s}),e[46]=s,e[47]=y):y=e[47];const v=y;let P;return e[48]!==a||e[49]!==b||e[50]!==v||e[51]!==d?(P=n.jsx(Wa,{children:b&&a&&!d?n.jsx(Pc,{project:a,maxApps:vi,children:v}):v}),e[48]=a,e[49]=b,e[50]=v,e[51]=d,e[52]=P):P=e[52],P}function Kc(t){try{return new URL(t).host}catch{return t}}function Ic(t){const e=ce.c(20),{status:s,host:r}=t,a=Pe();if(s.kind==="connected"){let i;e[0]!==a?(i=a("mainPanelTabs.previewTab.localhostNoPreview.title"),e[0]=a,e[1]=i):i=e[1];let c;e[2]!==a?(c=a("mainPanelTabs.previewTab.localhostNoPreview.body"),e[2]=a,e[3]=c):c=e[3];let l;e[4]!==c?(l=n.jsx(es,{text:c}),e[4]=c,e[5]=l):l=e[5];let m;e[6]!==a?(m=a("mainPanelTabs.previewTab.localhostNoPreview.step.title"),e[6]=a,e[7]=m):m=e[7];let p;e[8]!==m?(p=[{title:m,command:`${Er} --preview localhost:3000`}],e[8]=m,e[9]=p):p=e[9];let f;return e[10]!==i||e[11]!==l||e[12]!==p?(f=n.jsx(ts,{headingLevel:2,waiting:!1,title:i,lead:l,steps:p}),e[10]=i,e[11]=l,e[12]=p,e[13]=f):f=e[13],f}let d;e[14]!==r||e[15]!==s?(d=$i(s,r),e[14]=r,e[15]=s,e[16]=d):d=e[16];let o;return e[17]!==r||e[18]!==d?(o=n.jsx(Bi,{wait:d,hosts:r}),e[17]=r,e[18]=d,e[19]=o):o=e[19],o}export{Bi as L,Kd as P,ts as S,zd as u};
551
+ `)}function il(t,e,s=320,r=44,a=12){const{x:d,y:o}=t,{width:i,height:c}=e,l=Math.max(a,Math.min(d-s/2,i-s-a)),p=o/c>.68?Math.max(a,o-r-18):Math.min(o+18,c-r-a);return{leftPct:l/i*100,topPct:p/c*100}}function ll(t){const e=ce.c(45),{element:s,onDismiss:r}=t,[a,d]=C.useState(""),o=C.useRef(null),{sendMessage:i}=Ga(),{openSidePanel:c}=ii(),l=Pe();let m;e[0]!==s||e[1]!==a||e[2]!==r||e[3]!==c||e[4]!==i?(m=()=>{if(!a.trim())return;const H=ol(s,a);c(),i({parts:[{type:"text",text:H}]}),r()},e[0]=s,e[1]=a,e[2]=r,e[3]=c,e[4]=i,e[5]=m):m=e[5];const p=m;let f;e[6]!==s.position||e[7]!==s.viewport?(f=il(s.position,s.viewport),e[6]=s.position,e[7]=s.viewport,e[8]=f):f=e[8];const x=f,h=`${x.leftPct}%`,j=`${x.topPct}%`;let g;e[9]!==h||e[10]!==j?(g={left:h,top:j,width:"320px"},e[9]=h,e[10]=j,e[11]=g):g=e[11];let b;e[12]!==p?(b=H=>{H.preventDefault(),p()},e[12]=p,e[13]=b):b=e[13];let N;e[14]===Symbol.for("react.memo_cache_sentinel")?(N=H=>d(H.target.value),e[14]=N):N=e[14];let y;e[15]!==r?(y=H=>{H.key==="Escape"&&r()},e[15]=r,e[16]=y):y=e[16];let v;e[17]!==l?(v=l("sandbox.visualEditorPrompt.inputPlaceholder"),e[17]=l,e[18]=v):v=e[18];let P;e[19]!==a||e[20]!==y||e[21]!==v?(P=n.jsx("input",{ref:o,autoFocus:!0,type:"text",value:a,onChange:N,onKeyDown:y,placeholder:v,className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground"}),e[19]=a,e[20]=y,e[21]=v,e[22]=P):P=e[22];let E;e[23]!==a?(E=a.trim(),e[23]=a,e[24]=E):E=e[24];const k=!E;let S;e[25]!==l?(S=l("sandbox.visualEditorPrompt.sendButton"),e[25]=l,e[26]=S):S=e[26];let R;e[27]!==l?(R=l("sandbox.visualEditorPrompt.sendButton"),e[27]=l,e[28]=R):R=e[28];let O;e[29]!==R?(O=n.jsx("title",{children:R}),e[29]=R,e[30]=O):O=e[30];let T;e[31]===Symbol.for("react.memo_cache_sentinel")?(T=n.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e[31]=T):T=e[31];let L;e[32]!==O?(L=n.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[O,T]}),e[32]=O,e[33]=L):L=e[33];let D;e[34]!==k||e[35]!==S||e[36]!==L?(D=n.jsx("button",{type:"submit",disabled:k,className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-lg bg-foreground text-background transition-opacity disabled:opacity-30",title:S,children:L}),e[34]=k,e[35]=S,e[36]=L,e[37]=D):D=e[37];let A;e[38]!==P||e[39]!==D||e[40]!==b?(A=n.jsxs("form",{className:"pointer-events-auto flex w-full items-center gap-1.5 rounded-xl glass px-3 py-1.5",onSubmit:b,children:[P,D]}),e[38]=P,e[39]=D,e[40]=b,e[41]=A):A=e[41];let M;return e[42]!==A||e[43]!==g?(M=n.jsx("div",{className:"absolute z-30 pointer-events-none",style:g,children:A}),e[42]=A,e[43]=g,e[44]=M):M=e[44],M}const Gn="site-links",cl=/details?page|\bpdp\b/i,dl=/listingpage|\bplp\b/i;function ul(t,e,s){const r=new Set;for(const i of s)cl.test(i)&&r.add("product"),dl.test(i)&&r.add("category");const a=Ct(Is(t)),d=a[a.length-1],o=a[a.length-2];return d?.type==="text"&&d.text==="/p"&&o?.type==="param"&&o.name===e&&r.add("product"),e==="*"&&a.some(i=>i.type==="param"&&i.name==="*")&&r.add("category"),r}const fl=["rosa","preto","pink","black"];function Jt(t,e){const s=e.trim();return s?t(s):fl.flatMap(r=>t(r))}function pl(t,e){const s=e.trim(),r=[];/^\d+$/.test(s)&&r.push({resolveType:t,props:{ids:[s]}});const d=s.includes("-")&&!/\s/.test(s)?s.replace(/-+/g," "):s;return r.push({resolveType:t,props:{query:d,count:10}}),r}const Fr=new Set(["vtex","shopify","shopify-mcp","magento","wake","linx","linx-impulse","nuvemshop","vnda","wap","salesforce"]);function Hs(t){return t.split("/")[0]??""}function ml(t){const e=new Set;for(const s of t){const r=Hs(s);Fr.has(r)&&e.add(r)}return e}function hl(t,e){const s=Hs(t);return!Fr.has(s)||e.size===0?!0:e.has(s)}const gl=[{kind:"product",test:t=>t==="vtex/loaders/intelligentSearch/productList.ts",clientFilter:!1,buildRequests:(t,e)=>Jt(s=>pl(t,s),e),optionsFromPayload:Yt},{kind:"product",test:t=>/magento\/.*products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>Jt(s=>[{resolveType:t,props:{props:{search:s,pageSize:10,currentPage:1}}}],e),optionsFromPayload:Yt},{kind:"product",test:t=>/algolia\/.*products?\/(list|suggestions)(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>Jt(s=>[{resolveType:t,props:{term:s,hitsPerPage:10}}],e),optionsFromPayload:Yt},{kind:"product",test:t=>/products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>Jt(s=>[{resolveType:t,props:{query:s,term:s,count:10,hitsPerPage:10}}],e),optionsFromPayload:Yt},{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:Sl}];function vl(t,e,s=new Set){const r=[...e],a=i=>{const c=[];for(const l of gl){if(l.kind!==i)continue;const m=r.find(p=>l.test(p)&&hl(p,s));m&&c.push({cand:l,resolveType:m})}return c.find(l=>s.has(Hs(l.resolveType)))??c[0]},d=(i,c,l)=>({kind:i.kind,id:`${i.kind}:${c}`,resolveType:c,clientFilter:i.clientFilter,isFallback:l,buildRequests:m=>i.buildRequests(c,m),optionsFromPayload:i.optionsFromPayload}),o=[];for(const i of["product","category"]){if(!t.has(i))continue;const c=a(i);c&&o.push(d(c.cand,c.resolveType,!1))}return t.size>0&&o.push(xl(t.has("category")?"category":"product")),o}function xl(t){return{kind:t,id:Gn,resolveType:Gn,clientFilter:!0,isFallback:!0,homepageLinks:!0,optionsFromPayload:(e,s)=>Cl(e,s)}}function Ge(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function bl(t,e,s){const r=new Set,a=new Set,d=o=>{if(Array.isArray(o)){for(const l of o)d(l);return}const i=Ge(o);if(!i)return;const c=i.__resolveType;if(typeof c=="string"){if(s(c))r.add(c);else if(c in e&&!a.has(c)){a.add(c);const l=Ge(e[c])?.__resolveType;typeof l=="string"&&s(l)&&r.add(c),d(e[c])}}for(const l of Object.values(i))d(l)};return d(t),r}function zr(t){const e=new Set,s=[];for(const r of t)for(const a of r)e.has(a.value)||(e.add(a.value),s.push(a));return s}function Kr(t){try{return decodeURIComponent(t)}catch{return t}}function yl(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function wl(t){const e=[];let s="^";for(const r of t)r.type==="text"?s+=yl(r.text):(e.push(r.name),s+=r.name==="*"?"(.+)":"([^/]+)");return{pattern:new RegExp(`${s}$`),order:e}}function Ir(t,e,s){if(typeof t!="string"||!t)return null;let r;try{r=new URL(t,"https://placeholder.invalid").pathname}catch{return null}r=r.replace(/\/+$/,"");const a=Ct(Is(e)),{pattern:d,order:o}=wl(a),i=o.indexOf(s);if(i===-1)return null;const c=r.match(d);if(!c)return null;const l=c[i+1]?.replace(/^\/+|\/+$/g,"");return l?Kr(l):null}function Yt(t,e){const s=Ge(t),r=Array.isArray(t)?t:Array.isArray(s?.products)?s.products:Array.isArray(s?.list)?s.list:[],a=[],d=new Set;for(const o of r){const i=Ge(o);if(!i)continue;const c=Ir(i.url,e.template,e.paramName);if(!c||d.has(c))continue;d.add(c);const l=Ge(i.isVariantOf),m=typeof l?.name=="string"&&l.name||typeof i.name=="string"&&i.name||c,p=Array.isArray(i.image)?Ge(i.image[0]):null,f=typeof p?.url=="string"?p.url:void 0;a.push({value:c,label:m,image:f})}return a}function kl(t){if(typeof t!="string"||!t)return null;let e;try{e=new URL(t,"https://placeholder.invalid").pathname}catch{return null}const s=e.replace(/^\/+|\/+$/g,"");return s?Kr(s):null}function Sl(t){const e=[],s=new Set,r=(a,d)=>{const o=Ge(a);if(!o)return;const i=typeof o.name=="string"&&o.name?o.name:"",c=i?[...d,i]:d,l=kl(o.url);if(l&&!s.has(l)&&(s.add(l),e.push({value:l,label:c.join(" › ")||l})),Array.isArray(o.children))for(const m of o.children)r(m,c)};if(Array.isArray(t))for(const a of t)r(a,[]);return e}const Pl=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 jl(t){return(t.split("/").filter(Boolean).pop()??t).replace(/[-_]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,s=>s.toUpperCase())}function El(t){if(typeof t!="string"||!t)return[];const e=[],s=/<a\b[^>]*?\bhref="([^"]+)"[^>]*>([\s\S]*?)<\/a>/gi;let r,a=0;for(;(r=s.exec(t))!==null&&a++<5e3;){const d=r[1]??"",o=(r[2]??"").replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim();e.push({href:d,text:o})}return e}function Nl(t){if(typeof t!="string"||!t)return[];const e=[],s=new Set,r=/"@type":"Product"[\s\S]{0,600}?(?:"url"|\burl):"([^"]+)"[\s\S]{0,300}?(?:"name"|\bname):"([^"]+)"/g,a=/(?:"image"|\bimage):\s*\[\s*\{[\s\S]{0,400}?(?:"url"|\burl):"([^"]+)"/;let d,o=0;for(;(d=r.exec(t))!==null&&o++<3e3;){const i=(d[1]??"").replace(/\\\//g,"/");if(!i||s.has(i))continue;s.add(i);const c=t.slice(d.index,d.index+900).match(a)?.[1]?.replace(/\\\//g,"/");e.push({url:i,name:d[2]??"",image:c||void 0})}return e}function Cl(t,e){const s=[],r=new Set,a=(d,o,i,c)=>{if(s.length>=200)return;const l=Ir(d,e.template,e.paramName);!l||r.has(l)||e.paramName==="*"&&/(^|\/)p$/.test(l)||i==="category"&&Pl.has(l.split("/")[0]??"")||(r.add(l),s.push({value:l,label:o&&o.length<=80?o:jl(l),kind:i,image:c}))};for(const{url:d,name:o,image:i}of Nl(t))a(d,o,"product",i);for(const{href:d,text:o}of El(t))d.startsWith("/")&&!d.startsWith("//")&&a(d,o,"category");return s}function St(t,e,s=50){const r=e.trim().toLowerCase();return(r?t.filter(d=>d.label.toLowerCase().includes(r)||d.value.toLowerCase().includes(r)):t).slice(0,s)}const Ur=1e4;function Tl(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 Ll(t,{resolveType:e,props:s}){const r=await fetch(yo(t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({__resolveType:e,...s}),signal:AbortSignal.timeout(Ur)});if(!r.ok)throw new Error(`Failed to fetch options: ${r.status}`);return r.json()}async function Jn(t,e){const s=await fetch(wo(t,e),{signal:AbortSignal.timeout(Ur)});if(!s.ok)throw new Error(`Failed to fetch page: ${s.status}`);return s.text()}async function Rl(t,e,s){const r=e.optionsFromPayload(await Jn(t,"/"),s),a=r.find(o=>o.kind==="category");if(!a)return r;const d=Ve(s.template,{[s.paramName]:a.value});if(d==="/")return r;try{const o=e.optionsFromPayload(await Jn(t,d),s).filter(i=>i.kind==="product");return zr([r,o])}catch{return r}}function Al(t,e,s){return or.sandboxInvoke(`${t.orgSlug}/${t.virtualMcpId}/${t.branch}`,`path-param-${e.id}:${e.clientFilter?"":s}`)}async function _l(t,e,s,r){if(e.homepageLinks)return Rl(t,e,r);const a=e.buildRequests?.(s)??[];if(a.length===0)return[];const d=await Promise.allSettled(a.map(i=>Ll(t,i))),o=d.filter(i=>i.status==="fulfilled").map(i=>i.value);if(o.length===0){const i=d.find(c=>c.status==="rejected");throw i?i.reason:new Error("Failed to fetch options")}return zr(o.map(i=>e.optionsFromPayload(i,r)))}function Ms(t,e,s,r,a){return{queryKey:Al(t,e,s),queryFn:()=>_l(t,e,s,r),enabled:a,staleTime:6e4,retry:1}}function Pt(t){const e=ce.c(16),{heading:s,iconKind:r,options:a,template:d,paramName:o,keyPrefix:i,onSelect:c}=t;if(a.length===0)return null;let l;if(e[0]!==r||e[1]!==i||e[2]!==c||e[3]!==a||e[4]!==o||e[5]!==d){let p;e[7]!==r||e[8]!==i||e[9]!==c||e[10]!==o||e[11]!==d?(p=f=>n.jsxs(Nt,{value:`${i}:${f.value}`,className:"gap-3 py-2",onSelect:()=>c(f.value),children:[r==="product"&&n.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center overflow-hidden rounded-md border border-border bg-muted",children:f.image?n.jsx("img",{src:f.image,alt:"",referrerPolicy:"no-referrer",className:"h-full w-full object-cover"}):n.jsx(mr,{size:14,className:"text-muted-foreground"})}),n.jsxs("span",{className:"min-w-0 flex-1",children:[n.jsx("span",{className:"block truncate text-sm",children:f.label}),n.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:Ve(d,{[o]:f.value})})]})]},`${i}:${f.value}`),e[7]=r,e[8]=i,e[9]=c,e[10]=o,e[11]=d,e[12]=p):p=e[12],l=a.map(p),e[0]=r,e[1]=i,e[2]=c,e[3]=a,e[4]=o,e[5]=d,e[6]=l}else l=e[6];let m;return e[13]!==s||e[14]!==l?(m=n.jsx(Et,{heading:s,children:l}),e[13]=s,e[14]=l,e[15]=m):m=e[15],m}function Yn(t){const e=ce.c(2),{text:s}=t;let r;return e[0]!==s?(r=n.jsx("div",{className:"px-2 py-2 text-xs text-muted-foreground",children:s}),e[0]=s,e[1]=r):r=e[1],r}function Ol(t){const e=ce.c(52),{sources:s,template:r,paramName:a,value:d,sandboxRef:o,onCommit:i}=t,c=Pe(),[l,m]=C.useState(!1),[p,f]=C.useState(""),[x,h]=C.useState(""),j=C.useRef(null),g=a==="*"?c("sandbox.preview.catchAllParamLabel"):`:${a}`,b=Tl(c),y=[...new Set(s.map(ne=>b[ne.kind].noun))].join(" or ");let v;e[0]!==c||e[1]!==y?(v=c("sandbox.pathParamPickerChip.searchPlaceholder",{options:y}),e[0]=c,e[1]=y,e[2]=v):v=e[2];const P=v,E={template:r,paramName:a};let k;e[3]!==p?(k=(ne,oe)=>({source:ne,query:oe,options:ne.clientFilter?St(oe.data??[],p):oe.data??[]}),e[3]=p,e[4]=k):k=e[4];const S=k,R=s.filter(Il),O=s.filter(Kl),T=Ds({queries:R.map(ne=>Ms(o,ne,x,E,l))});let L;e[5]!==T||e[6]!==S?(L=(ne,oe)=>S(ne,T[oe]),e[5]=T,e[6]=S,e[7]=L):L=e[7];const D=R.map(L),A=D.length===0||D.every(zl),M=Ds({queries:O.map(ne=>Ms(o,ne,x,E,l&&A))});let H;e[8]!==M||e[9]!==S?(H=(ne,oe)=>S(ne,M[oe]),e[8]=M,e[9]=S,e[10]=H):H=e[10];const X=O.map(H),V=A?X:D,J=V.length===1&&V[0]?.source.homepageLinks?V[0]:null,G=J&&!J.query.isLoading&&!J.query.isError?J?.query.data??[]:[],Y=St(G.filter(Fl),p),_=St(G.filter(Ml),p),$=Y.length>0&&_.length>0,F=ne=>{m(ne),j.current&&clearTimeout(j.current),f(ne?d:""),h(ne?d:"")};let I;e[11]===Symbol.for("react.memo_cache_sentinel")?(I=ne=>{f(ne),j.current&&clearTimeout(j.current),j.current=setTimeout(()=>{h(ne)},300)},e[11]=I):I=e[11];const B=I,z=ne=>{i(ne),F(!1)},W=Rr(p),K=Ve(r,{[a]:W}),te=ar,se=rr,ee="flex h-[85svh] flex-col gap-0 overflow-hidden p-0 sm:h-[520px] sm:max-w-[560px]",ae=$l;let pe;e[12]!==g||e[13]!==c?(pe=c("sandbox.pathParamPickerChip.pickValueTitle",{paramLabel:g}),e[12]=g,e[13]=c,e[14]=pe):pe=e[14];let de;e[15]!==pe?(de=n.jsx(ir,{className:"sr-only",children:n.jsx(lr,{children:pe})}),e[15]=pe,e[16]=de):de=e[16];let ve;e[17]===Symbol.for("react.memo_cache_sentinel")?(ve=n.jsx(mr,{size:16,className:"shrink-0 text-foreground"}),e[17]=ve):ve=e[17];let ue;e[18]!==c?(ue=c("sandbox.pathParamPickerChip.pickValueHeading"),e[18]=c,e[19]=ue):ue=e[19];let xe;e[20]!==g?(xe=n.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]=xe):xe=e[21];let me;e[22]!==ue||e[23]!==xe?(me=n.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-3 border-b border-border px-4",children:[ve,n.jsxs("span",{className:"text-sm font-medium text-foreground",children:[ue," ",xe]})]}),e[22]=ue,e[23]=xe,e[24]=me):me=e[24];const ge=kr,je=!1,fe="min-h-0 flex-1";let ie;e[25]!==P||e[26]!==p?(ie=n.jsx(Sr,{autoFocus:!0,placeholder:P,value:p,onValueChange:B}),e[25]=P,e[26]=p,e[27]=ie):ie=e[27];const Ne=wr,Fe="flex max-h-none min-h-0 flex-1 flex-col overflow-hidden";let ze;e[28]!==c?(ze=c("sandbox.pathParamPickerChip.noResults"),e[28]=c,e[29]=ze):ze=e[29];let Be;e[30]!==ze?(Be=n.jsx(Pr,{children:ze}),e[30]=ze,e[31]=Be):Be=e[31];const ut=W&&n.jsx(Et,{className:"shrink-0",children:n.jsxs(Nt,{value:`__raw__:${W}`,className:"gap-3 py-2",onSelect:()=>z(W),children:[n.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-md border border-dashed border-border bg-muted",children:n.jsx(ci,{size:14,className:"text-muted-foreground"})}),n.jsxs("span",{className:"min-w-0 flex-1",children:[n.jsx("span",{className:"block truncate text-sm",children:c("sandbox.pathParamPickerChip.useRawValue",{rawTerm:W,paramLabel:g})}),n.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:K})]})]})}),Je=$?n.jsxs("div",{className:"flex min-h-0 flex-1",children:[n.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto border-r border-border",children:n.jsx(Pt,{heading:b.category.heading,iconKind:"category",options:Y,template:r,paramName:a,keyPrefix:`${J?.source.id}:cat`,onSelect:z})}),n.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:n.jsx(Pt,{heading:b.product.heading,iconKind:"product",options:_,template:r,paramName:a,keyPrefix:`${J?.source.id}:prod`,onSelect:z})})]}):n.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:V.map(ne=>{const{source:oe,query:ke,options:Ie}=ne,{noun:ft}=b[oe.kind];if(ke.isLoading)return n.jsx(Yn,{text:c("sandbox.pathParamPickerChip.loading",{noun:ft})},oe.id);if(ke.isError)return n.jsx(Yn,{text:c("sandbox.pathParamPickerChip.couldNotLoad")},oe.id);if(oe.homepageLinks){const Ye=ke.data??[];return n.jsxs(C.Fragment,{children:[n.jsx(Pt,{heading:b.category.heading,iconKind:"category",options:St(Ye.filter(Bl),p),template:r,paramName:a,keyPrefix:`${oe.id}:cat`,onSelect:z}),n.jsx(Pt,{heading:b.product.heading,iconKind:"product",options:St(Ye.filter(Dl),p),template:r,paramName:a,keyPrefix:`${oe.id}:prod`,onSelect:z})]},oe.id)}return n.jsx(Pt,{heading:V.length>1?b[oe.kind].heading:void 0,iconKind:oe.kind,options:Ie,template:r,paramName:a,keyPrefix:oe.id,onSelect:z},oe.id)})});let he;e[32]!==Ne||e[33]!==Be||e[34]!==ut||e[35]!==Je?(he=n.jsxs(Ne,{className:Fe,children:[Be,ut,Je]}),e[32]=Ne,e[33]=Be,e[34]=ut,e[35]=Je,e[36]=he):he=e[36];let Le;e[37]!==ge||e[38]!==ie||e[39]!==he?(Le=n.jsxs(ge,{shouldFilter:je,className:fe,children:[ie,he]}),e[37]=ge,e[38]=ie,e[39]=he,e[40]=Le):Le=e[40];let _e;e[41]!==se||e[42]!==de||e[43]!==me||e[44]!==Le||e[45]!==ae?(_e=n.jsxs(se,{className:ee,onClick:ae,children:[de,me,Le]}),e[41]=se,e[42]=de,e[43]=me,e[44]=Le,e[45]=ae,e[46]=_e):_e=e[46];let Ke;return e[47]!==te||e[48]!==F||e[49]!==l||e[50]!==_e?(Ke=n.jsx(te,{open:l,onOpenChange:F,children:_e}),e[47]=te,e[48]=F,e[49]=l,e[50]=_e,e[51]=Ke):Ke=e[51],n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",title:c("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:ne=>{ne.stopPropagation(),F(!0)},children:d||g}),Ke]})}function Dl(t){return t.kind==="product"}function Bl(t){return t.kind!=="product"}function $l(t){return t.stopPropagation()}function Ml(t){return t.kind==="product"}function Fl(t){return t.kind!=="product"}function zl(t){return!t.query.isLoading&&(t.query.isError||t.options.length===0)}function Kl(t){return t.isFallback}function Il(t){return!t.isFallback}function Ul(t){const e=ce.c(8),{sources:s,template:r,paramName:a,sandboxRef:d,onFill:o}=t;let i,c;if(e[0]!==a||e[1]!==d||e[2]!==s||e[3]!==r){const x={template:r,paramName:a},h=s.filter(Hl);c=Ds,i=h.map(j=>Ms(d,j,"",x,!0)),e[0]=a,e[1]=d,e[2]=s,e[3]=r,e[4]=i,e[5]=c}else i=e[4],c=e[5];let l;e[6]!==i?(l={queries:i},e[6]=i,e[7]=l):l=e[7];const m=c(l),[p,f]=C.useState(!1);if(!p)for(const x of m){if(x.isLoading)break;const h=x.data?.[0];if(h){f(!0),queueMicrotask(()=>o(h.value));break}}return null}function Hl(t){return!t.isFallback}function Vl(t){const e=ce.c(31),{name:s,value:r,onCommit:a}=t,d=Pe(),[o,i]=C.useState(r),[c,l]=C.useState(!1),m=C.useRef(!1);let p;e[0]!==s||e[1]!==d?(p=s==="*"?d("sandbox.preview.catchAllParamLabel"):`:${s}`,e[0]=s,e[1]=d,e[2]=p):p=e[2];const f=p,x=o||f;let h;e[3]!==x?(h=n.jsx("span",{"aria-hidden":!0,className:"invisible whitespace-pre px-1 py-0.5 text-xs",children:x}),e[3]=x,e[4]=h):h=e[4];let j;e[5]!==f||e[6]!==d?(j=d("sandbox.preview.valueForParam",{label:f}),e[5]=f,e[6]=d,e[7]=j):j=e[7];let g,b;e[8]===Symbol.for("react.memo_cache_sentinel")?(g=S=>i(S.target.value),b=()=>l(!0),e[8]=g,e[9]=b):(g=e[8],b=e[9]);let N;e[10]!==r?(N=S=>{S.key==="Enter"&&S.currentTarget.blur(),S.key==="Escape"&&(m.current=!0,i(r),S.currentTarget.blur())},e[10]=r,e[11]=N):N=e[11];let y;e[12]!==o||e[13]!==a||e[14]!==r?(y=()=>{if(l(!1),m.current){m.current=!1;return}const S=Rr(o);i(S),S!==r&&a(S)},e[12]=o,e[13]=a,e[14]=r,e[15]=y):y=e[15];let v;e[16]!==o||e[17]!==f||e[18]!==j||e[19]!==N||e[20]!==y?(v=n.jsx("input",{type:"text",value:o,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:ql,onChange:g,onFocus:b,onKeyDown:N,onBlur:y}),e[16]=o,e[17]=f,e[18]=j,e[19]=N,e[20]=y,e[21]=v):v=e[21];let P;e[22]!==h||e[23]!==v?(P=n.jsxs("span",{className:"relative inline-flex max-w-64 shrink-0 items-center overflow-hidden",children:[h,v]}),e[22]=h,e[23]=v,e[24]=P):P=e[24];let E;e[25]!==c||e[26]!==d?(E=c&&n.jsxs("span",{className:"pointer-events-none ml-1.5 flex shrink-0 items-center gap-1 whitespace-nowrap rounded-sm border border-border bg-muted px-1 py-0.5 text-2xs text-muted-foreground",children:[n.jsx(to,{size:10}),d("sandbox.preview.enterToGo")]}),e[25]=c,e[26]=d,e[27]=E):E=e[27];let k;return e[28]!==E||e[29]!==P?(k=n.jsxs(n.Fragment,{children:[P,E]}),e[28]=E,e[29]=P,e[30]=k):k=e[30],k}function ql(t){return t.stopPropagation()}function Wl(t){if(t.activeGlobalSectionName)return t.activeGlobalSectionName;const e=t.iframeBase;if(!e)return t.noServerLabel;try{const s=new URL(e),r=t.resolvedPath==="/"?"":t.resolvedPath;return`${s.host}${r}`}catch{return e}}function Gl(t){return t.previewSurfaceActive&&(t.daemonReady||t.production||!!t.servePreviewUrl)}function Jl(t){return t.showPreviewToolbar&&t.contentEditingEnabled}class Hr extends Error{constructor(){super("The site's schema isn't loaded yet"),this.name="PageSchemaNotReadyError"}}async function Yl(t,e){if(t)return t;const s=await e?.().catch(()=>null);if(!s)throw new Hr;return s}async function Ql(t,e,s){return s?Nn(t,e,await Yl(s.meta,s.loadMeta)):Nn(t,e)}function Xl(t){const e=ce.c(5);let s;e[0]!==t?(s=t??{orgSlug:"",virtualMcpId:"",branch:""},e[0]=t,e[1]=s):s=e[1];const r=dr(s);let a;return e[2]!==t||e[3]!==r?(a={mutationFn:async d=>{const{name:o,path:i,template:c,schema:l}=d;if(!t?.virtualMcpId||!t.branch)throw new Error("Sandbox not ready");const m=Ba(o),p=c?{...c,name:o,path:i}:await Ql(o,i,l);return await r.mutateAsync({blockKey:m,data:p}),{key:m,name:o,path:i}}},e[2]=t,e[3]=r,e[4]=a):a=e[4],Na(a)}function Zl(t){const e=ce.c(89),{open:s,onOpenChange:r,isPending:a,error:d,templates:o,onSubmit:i}=t,c=a===void 0?!1:a,l=Pe();let m;e[0]!==l?(m=l("sectionsEditor.createPageModal.defaultPageName"),e[0]=l,e[1]=m):m=e[1];const[p,f]=C.useState(m);let x;e[2]!==l?(x=l("sectionsEditor.createPageModal.defaultPagePath"),e[2]=l,e[3]=x):x=e[3];const[h,j]=C.useState(x),[g,b]=C.useState(Ss),[N,y]=C.useState(null),[v,P]=C.useState(s);s!==v&&(P(s),s&&(f(l("sectionsEditor.createPageModal.defaultPageName")),j(l("sectionsEditor.createPageModal.defaultPagePath")),b(Ss),y(null)));const E=!!o?.length;let k;e[4]!==c||e[5]!==r?(k=ue=>{!ue&&!c&&(y(null),r(!1))},e[4]=c,e[5]=r,e[6]=k):k=e[6];const S=k;let R;e[7]!==c||e[8]!==p||e[9]!==i||e[10]!==h||e[11]!==E||e[12]!==g?(R=async ue=>{ue.preventDefault();const xe=p.trim(),me=h.trim();if(!xe||!me||c)return;const ge=Ar(me);if(ge){y(ge);return}y(null),await i({name:xe,path:me,templateKey:E&&g!==Ss?g:null})},e[7]=c,e[8]=p,e[9]=i,e[10]=h,e[11]=E,e[12]=g,e[13]=R):R=e[13];const O=R,T=N??d;let L;e[14]!==l?(L=l("sectionsEditor.createPageModal.title"),e[14]=l,e[15]=L):L=e[15];let D;e[16]!==L?(D=n.jsx(ir,{children:n.jsx(lr,{children:L})}),e[16]=L,e[17]=D):D=e[17];let A;e[18]!==l?(A=l("sectionsEditor.createPageModal.nameLabel"),e[18]=l,e[19]=A):A=e[19];let M;e[20]!==A?(M=n.jsx("label",{htmlFor:"new-page-name",className:"text-xs font-medium text-muted-foreground",children:A}),e[20]=A,e[21]=M):M=e[21];let H;e[22]===Symbol.for("react.memo_cache_sentinel")?(H=ue=>f(ue.target.value),e[22]=H):H=e[22];let X;e[23]!==l?(X=l("sectionsEditor.createPageModal.namePlaceholder"),e[23]=l,e[24]=X):X=e[24];let V;e[25]!==c||e[26]!==p||e[27]!==X?(V=n.jsx(Rs,{id:"new-page-name",value:p,onChange:H,placeholder:X,autoFocus:!0,disabled:c}),e[25]=c,e[26]=p,e[27]=X,e[28]=V):V=e[28];let J;e[29]!==V||e[30]!==M?(J=n.jsxs("div",{className:"space-y-1.5",children:[M,V]}),e[29]=V,e[30]=M,e[31]=J):J=e[31];let q;e[32]!==l?(q=l("sectionsEditor.createPageModal.pathLabel"),e[32]=l,e[33]=q):q=e[33];let G;e[34]!==q?(G=n.jsx("label",{htmlFor:"new-page-path",className:"text-xs font-medium text-muted-foreground",children:q}),e[34]=q,e[35]=G):G=e[35];let Y;e[36]===Symbol.for("react.memo_cache_sentinel")?(Y=ue=>j(ue.target.value),e[36]=Y):Y=e[36];let _;e[37]!==l?(_=l("sectionsEditor.createPageModal.pathPlaceholder"),e[37]=l,e[38]=_):_=e[38];let $;e[39]!==c||e[40]!==h||e[41]!==_?($=n.jsx(Rs,{id:"new-page-path",value:h,onChange:Y,placeholder:_,disabled:c}),e[39]=c,e[40]=h,e[41]=_,e[42]=$):$=e[42];let F;e[43]!==G||e[44]!==$?(F=n.jsxs("div",{className:"space-y-1.5",children:[G,$]}),e[43]=G,e[44]=$,e[45]=F):F=e[45];let I;e[46]!==c||e[47]!==E||e[48]!==l||e[49]!==g||e[50]!==o?(I=E&&n.jsxs("div",{className:"space-y-1.5",children:[n.jsx("label",{htmlFor:"new-page-template",className:"text-xs font-medium text-muted-foreground",children:l("sectionsEditor.createPageModal.templateLabel")}),n.jsx($a,{id:"new-page-template",value:g,onChange:b,templates:o??[],disabled:c})]}),e[46]=c,e[47]=E,e[48]=l,e[49]=g,e[50]=o,e[51]=I):I=e[51];let B;e[52]!==T?(B=T&&n.jsx("p",{className:"text-xs text-destructive",children:T}),e[52]=T,e[53]=B):B=e[53];let z;e[54]!==J||e[55]!==F||e[56]!==I||e[57]!==B?(z=n.jsxs("div",{className:"space-y-4 py-4",children:[J,F,I,B]}),e[54]=J,e[55]=F,e[56]=I,e[57]=B,e[58]=z):z=e[58];let W;e[59]!==r?(W=()=>r(!1),e[59]=r,e[60]=W):W=e[60];let K;e[61]!==l?(K=l("sectionsEditor.createPageModal.cancelButton"),e[61]=l,e[62]=K):K=e[62];let te;e[63]!==c||e[64]!==W||e[65]!==K?(te=n.jsx(Me,{type:"button",variant:"outline",onClick:W,disabled:c,children:K}),e[63]=c,e[64]=W,e[65]=K,e[66]=te):te=e[66];let se;e[67]!==c||e[68]!==p||e[69]!==h?(se=!p.trim()||!h.trim()||c,e[67]=c,e[68]=p,e[69]=h,e[70]=se):se=e[70];let ee;e[71]!==c||e[72]!==l?(ee=c?n.jsxs(n.Fragment,{children:[n.jsx(Tt,{className:"size-3.5"}),l("sectionsEditor.createPageModal.creatingButton")]}):l("sectionsEditor.createPageModal.createButton"),e[71]=c,e[72]=l,e[73]=ee):ee=e[73];let ae;e[74]!==se||e[75]!==ee?(ae=n.jsx(Me,{type:"submit",disabled:se,children:ee}),e[74]=se,e[75]=ee,e[76]=ae):ae=e[76];let pe;e[77]!==te||e[78]!==ae?(pe=n.jsxs(Ca,{children:[te,ae]}),e[77]=te,e[78]=ae,e[79]=pe):pe=e[79];let de;e[80]!==O||e[81]!==z||e[82]!==pe||e[83]!==D?(de=n.jsx(rr,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:O,children:[D,z,pe]})}),e[80]=O,e[81]=z,e[82]=pe,e[83]=D,e[84]=de):de=e[84];let ve;return e[85]!==S||e[86]!==s||e[87]!==de?(ve=n.jsx(ar,{open:s,onOpenChange:S,children:de}),e[85]=S,e[86]=s,e[87]=de,e[88]=ve):ve=e[88],ve}function ec(t){const e=ce.c(36),{orgSlug:s,virtualMcpId:r,branch:a,previewUrl:d,meta:o,decofile:i,blockKey:c}=t,l=Pe();let m;e[0]!==a||e[1]!==s||e[2]!==r?(m={orgSlug:s,virtualMcpId:r,branch:a},e[0]=a,e[1]=s,e[2]=r,e[3]=m):m=e[3];const p=dr(m);let f;e[4]!==p?(f=za((k,S)=>p.mutate({blockKey:k,data:S})),e[4]=p,e[5]=f):f=e[5];const x=f;let h;e[6]!==c||e[7]!==i?(h=Ma(i,c),e[6]=c,e[7]=i,e[8]=h):h=e[8];const{resolveType:j,props:g,title:b}=h;if(!j){let k;e[9]!==l?(k=l("sandbox.preview.loaderNoLongerExists"),e[9]=l,e[10]=k):k=e[10];let S;return e[11]!==k?(S=n.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center text-sm text-muted-foreground",children:k}),e[11]=k,e[12]=S):S=e[12],S}const N=`loader:${c}`,y=`loader:${c}`;let v;e[13]!==c||e[14]!==j||e[15]!==b?(v={mode:"saved",blockKey:c,resolveType:j,title:b},e[13]=c,e[14]=j,e[15]=b,e[16]=v):v=e[16];let P;e[17]!==a||e[18]!==i||e[19]!==o||e[20]!==s||e[21]!==d||e[22]!==g||e[23]!==p.isPending||e[24]!==x||e[25]!==y||e[26]!==v||e[27]!==r?(P=n.jsx(Fa,{orgSlug:s,virtualMcpId:r,branch:a,previewUrl:d,meta:o,decofile:i,kind:"loaders",target:v,initialValue:g,isCreating:p.isPending,onCreate:tc,onSaveReferencedBlock:x,showRun:!1},y),e[17]=a,e[18]=i,e[19]=o,e[20]=s,e[21]=d,e[22]=g,e[23]=p.isPending,e[24]=x,e[25]=y,e[26]=v,e[27]=r,e[28]=P):P=e[28];let E;return e[29]!==c||e[30]!==a||e[31]!==s||e[32]!==N||e[33]!==P||e[34]!==r?(E=n.jsx(Ka,{orgSlug:s,virtualMcpId:r,branch:a,blockKey:c,present:void 0,children:P},N),e[29]=c,e[30]=a,e[31]=s,e[32]=N,e[33]=P,e[34]=r,e[35]=E):E=e[35],E}async function tc(){}function sc(t){if(t instanceof Error&&"status"in t&&typeof t.status=="number")return t.status}function Qn(t){return{status:t.status,hasData:t.data!==void 0,errorStatus:sc(t.error)}}function nc(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 rc(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=nc(t.lifecyclePhase);if(e==="terminal-error")return{kind:"error",source:"sandbox"};if(e==="booting")return{kind:"loading"};const s=t.decofile.status==="error"&&!t.decofile.hasData||t.meta.status==="error"&&!t.meta.hasData;return s&&t.lifecyclePhase==="checking-out"?{kind:"loading"}:[t.decofile,t.meta].some(a=>a.status==="error"&&!a.hasData&&a.errorStatus===404)?{kind:"empty",reason:"framework-missing"}:s?t.lifecyclePhase==="running"||t.lifecyclePhase==="crashed"?{kind:"error",source:"data"}:{kind:"loading"}:!t.decofile.hasData||!t.meta.hasData?{kind:"loading"}:t.hasEditableContent?{kind:"content"}:{kind:"empty",reason:"no-content"}}const ac=C.lazy(()=>Ta(()=>import("./sections-editor-p5iYgj5l.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])).then(t=>({default:t.SectionsEditor})));function Xn(t){const e=ce.c(60),{virtualMcpId:s,externalSelection:r,onViewJsonFile:a}=t,d=r===void 0?null:r,{org:o}=zs(),{currentBranch:i,taskId:c}=Lt(),l=Us(),m=Rt(),p=Or(),f=l.lifecycle.phase==="running",x=m.previewUrl;let h;e[0]!==i||e[1]!==o||e[2]!==x||e[3]!==c||e[4]!==s?(h=i?{orgSlug:o.slug,virtualMcpId:s,branch:i,threadId:c??null,previewUrl:x}:null,e[0]=i,e[1]=o,e[2]=x,e[3]=c,e[4]=s,e[5]=h):h=e[5];const j=h,g=ss(s,i);let b;e[6]!==f?(b={fetchEnabled:f},e[6]=f,e[7]=b):b=e[7];const N=Ks(j,b);let y;e[8]!==f?(y={fetchEnabled:f},e[8]=f,e[9]=y):y=e[9];const v=Lr(j,y),P=rc({lifecyclePhase:l.lifecycle.phase,decofile:Qn(N),meta:Qn(v),hasEditableContent:qo(N.data,v.data),fastPreviewActive:jr(s).runtime==="cms"||at(g)}),E=ur()===void 0,k=oc;if(Bo(g)){let _;return e[10]===Symbol.for("react.memo_cache_sentinel")?(_=k(n.jsx(Mo,{})),e[10]=_):_=e[10],_}if(g.kind==="pending"&&g.retrying){let _;return e[11]!==g?(_=k(n.jsx(Fo,{backend:g})),e[11]=g,e[12]=_):_=e[12],_}if(P.kind==="loading"||E){let _;return e[13]===Symbol.for("react.memo_cache_sentinel")?(_=k(n.jsx(La,{})),e[13]=_):_=e[13],_}if(N.data&&ko(v.data)){const _=p.state.target,$=_?.kind==="page"||_?.kind==="section"?_.key:null,F=$??"",I=i??"";let B;return e[14]!==N.data||e[15]!==$||e[16]!==o.slug||e[17]!==F||e[18]!==I||e[19]!==s?(B=k(n.jsx(Ia,{orgSlug:o.slug,virtualMcpId:s,branch:I,decofile:N.data,initialKey:$,compact:!0},F)),e[14]=N.data,e[15]=$,e[16]=o.slug,e[17]=F,e[18]=I,e[19]=s,e[20]=B):B=e[20],B}if(P.kind==="empty"){let _;return e[21]===Symbol.for("react.memo_cache_sentinel")?(_=k(n.jsx(zo,{})),e[21]=_):_=e[21],_}if(P.kind==="error"){let _;e[22]!==N||e[23]!==m||e[24]!==v||e[25]!==P.source?(_=()=>{if(P.source==="sandbox"){m.retry();return}Promise.all([N.refetch(),v.refetch()])},e[22]=N,e[23]=m,e[24]=v,e[25]=P.source,e[26]=_):_=e[26];const $=_;let F;return e[27]!==$||e[28]!==P.source?(F=k(n.jsx($o,{source:P.source,onRetry:$})),e[27]=$,e[28]=P.source,e[29]=F):F=e[29],F}let S;e[30]===Symbol.for("react.memo_cache_sentinel")?(S=_=>k(n.jsx("div",{className:"h-full min-h-0",children:_})),e[30]=S):S=e[30];const R=S,O=p.state.target;if(O?.kind==="loader"&&N.data&&v.data){const _=i??"",$=x??null;let F;return e[31]!==N.data||e[32]!==v.data||e[33]!==o.slug||e[34]!==_||e[35]!==$||e[36]!==O.key||e[37]!==s?(F=R(n.jsx(ec,{orgSlug:o.slug,virtualMcpId:s,branch:_,previewUrl:$,meta:v.data,decofile:N.data,blockKey:O.key})),e[31]=N.data,e[32]=v.data,e[33]=o.slug,e[34]=_,e[35]=$,e[36]=O.key,e[37]=s,e[38]=F):F=e[38],F}let T;e[39]!==i||e[40]!==o.slug||e[41]!==O||e[42]!==s?(T=O||!i?null:fr(pr(o.slug,s,i)),e[39]=i,e[40]=o.slug,e[41]=O,e[42]=s,e[43]=T):T=e[43];const L=T;let D="/",A=null,M=null;O?.kind==="page"?(D=O.path,A=O.key):O?.kind==="section"?M=O.key:L&&(D=L.path,A=L.pageKey);const H=A?`page:${A}`:M?`section:${M}`:`path:${D}`;let X;e[44]===Symbol.for("react.memo_cache_sentinel")?(X=n.jsx("div",{className:"h-full flex items-center justify-center",children:n.jsx(Tt,{className:"size-5 text-muted-foreground"})}),e[44]=X):X=e[44];const V=i??"",J=x??void 0,q=M?null:d,G=!!A&&p.state.editSeoPageKey===A;let Y;return e[45]!==M||e[46]!==A||e[47]!==D||e[48]!==H||e[49]!==a||e[50]!==o.slug||e[51]!==q||e[52]!==G||e[53]!==V||e[54]!==J||e[55]!==s||e[56]!==p.consumeEditSeo||e[57]!==p.setFocusedBlock||e[58]!==p.setVariantOverride?(Y=R(n.jsx(C.Suspense,{fallback:X,children:n.jsx(ac,{orgSlug:o.slug,virtualMcpId:s,branch:V,previewReady:!0,previewUrl:J,currentPath:D,activePageBlockKey:A,activeGlobalBlockKey:M,externalSelection:q,initialEditSeo:G,onExitSeo:p.consumeEditSeo,onVariantPreviewOverride:p.setVariantOverride,onFocusedBlockChange:p.setFocusedBlock,onViewJsonFile:a},H)})),e[45]=M,e[46]=A,e[47]=D,e[48]=H,e[49]=a,e[50]=o.slug,e[51]=q,e[52]=G,e[53]=V,e[54]=J,e[55]=s,e[56]=p.consumeEditSeo,e[57]=p.setFocusedBlock,e[58]=p.setVariantOverride,e[59]=Y):Y=e[59],Y}function oc(t){return n.jsx("div",{"data-testid":"blocks-panel",className:"h-full min-h-0 overflow-hidden",children:t})}function Zn(t){const e=ce.c(51),{virtualMcpId:s,pageKey:r,onClose:a,ref:d}=t,o=Pe(),i=ur(),c=i===!0,l=So(s);let m;e[0]!==l||e[1]!==r?(m=Po(l,ui(r)),e[0]=l,e[1]=r,e[2]=m):m=e[2];const p=m,{org:f}=zs(),{currentBranch:x,taskId:h}=Lt(),g=Rt().previewUrl;let b;e[3]!==x||e[4]!==f.slug||e[5]!==g||e[6]!==h||e[7]!==s?(b=x?{orgSlug:f.slug,virtualMcpId:s,branch:x,threadId:h??null,previewUrl:g}:null,e[3]=x,e[4]=f.slug,e[5]=g,e[6]=h,e[7]=s,e[8]=b):b=e[8];const y=Ks(b),v=x??"";let P;e[9]!==f.slug||e[10]!==v||e[11]!==s?(P={orgSlug:f.slug,virtualMcpId:s,branch:v},e[9]=f.slug,e[10]=v,e[11]=s,e[12]=P):P=e[12];let E;e[13]===Symbol.for("react.memo_cache_sentinel")?(E={holdsCopy:!0},e[13]=E):E=e[13];const{save:k,flush:S,hold:R}=Ua(P,E),O=x??"";let T;e[14]!==f.slug||e[15]!==O||e[16]!==s?(T=Ko({orgSlug:f.slug,virtualMcpId:s,branch:O}),e[14]=f.slug,e[15]=O,e[16]=s,e[17]=T):T=e[17];const L=Io(T);let D;e[18]!==r||e[19]!==L?(D=L(r),e[18]=r,e[19]=L,e[20]=D):D=e[20];const A=D;let M;e[21]!==A||e[22]!==r?(M={pageKey:r,copyEpoch:A},e[21]=A,e[22]=r,e[23]=M):M=e[23];const[H,X]=C.useState(M);(H.pageKey!==r||H.copyEpoch!==A)&&(X({pageKey:r,copyEpoch:A}),R(r));const V=y.data?.[r],J=y.data===void 0&&y.isLoading||i===void 0,q=y.data!==void 0&&V===void 0,G=!x||q||J;let Y;e[24]!==V?(Y=V===void 0?"":JSON.stringify(V,null,2),e[24]=V,e[25]=Y):Y=e[25];const _=Y;let $;e[26]!==r||e[27]!==G||e[28]!==k?($=K=>{if(G)return;let te;try{te=JSON.parse(K)}catch{return}te===null||typeof te!="object"||Array.isArray(te)||k(r,te)},e[26]=r,e[27]=G,e[28]=k,e[29]=$):$=e[29];const F=$;let I;e[30]!==S?(I=()=>({flush:S}),e[30]=S,e[31]=I):I=e[31],C.useImperativeHandle(d,I);let B;e[32]!==p||e[33]!==c||e[34]!==a||e[35]!==o?(B=c?n.jsx("div",{className:"flex shrink-0 items-center border-b px-3 py-2.5",children:n.jsx("span",{title:p,className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:p})}):n.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b px-3 py-2.5",children:[n.jsx("div",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:o("sectionsEditor.pageJsonDialog.titleShort")}),n.jsx(Me,{variant:"ghost",size:"icon-sm",onClick:a,"aria-label":o("sectionsEditor.pageJsonDialog.close"),className:"shrink-0",children:n.jsx(Ra,{size:14})})]}),e[32]=p,e[33]=c,e[34]=a,e[35]=o,e[36]=B):B=e[36];let z;e[37]!==A||e[38]!==y.data||e[39]!==S||e[40]!==_||e[41]!==J||e[42]!==q||e[43]!==r||e[44]!==G||e[45]!==F||e[46]!==o?(z=J?n.jsx("div",{className:"flex flex-1 items-center justify-center",children:n.jsx(Tt,{className:"size-5 text-muted-foreground"})}):q?n.jsxs("div",{className:"p-4 text-xs font-mono text-foreground/60",children:["// ",o("sectionsEditor.pageJsonDialog.pageNotFound")]}):n.jsx("div",{className:"min-h-0 flex-1",children:n.jsx(di,{code:_,language:"json",readOnly:G,height:"100%",onChange:K=>F(K??""),onSave:K=>{F(K),S()}},`${r}:${y.data===void 0?"loading":"ready"}:${A}`)}),e[37]=A,e[38]=y.data,e[39]=S,e[40]=_,e[41]=J,e[42]=q,e[43]=r,e[44]=G,e[45]=F,e[46]=o,e[47]=z):z=e[47];let W;return e[48]!==B||e[49]!==z?(W=n.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-background",children:[B,z]}),e[48]=B,e[49]=z,e[50]=W):W=e[50],W}function Vr(t){return t.contentEditingEnabled&&!t.isMobile}function ic(t,e){return t!=="visual"?"visual":e?"blocks":"preview"}function lc(t,e){return t==="blocks"?"preview":e?"blocks":t}function cc(t){return Vr({contentEditingEnabled:_r(t.cmsMode),isMobile:t.isMobile})?"blocks":"preview"}function dc(t){return t.editingMode==="blocks"&&!t.blocksEditingEnabled||t.editingMode==="visual"&&!t.sandboxDisplay?"preview":t.editingMode}function uc(t){const e=ri(t),{display:s}=t;let r=null;if(s.mode==="production"&&s.iframeBase)try{r=new URL(t.path,s.iframeBase).href}catch{r=null}const a=ai(r,e);return{value:e,frame:a?Bs(a,t.device):null,newTab:a}}function fc(t){const e=ce.c(90),{tests:s,options:r,onChange:a,available:d}=t,o=Pe();let i;e[0]!==r?(i=Dr(r),e[0]=r,e[1]=i):i=e[1];const c=i;let l;e[2]!==r.tests?(l=r.tests??{},e[2]=r.tests,e[3]=l):l=e[3];const m=l;let p;e[4]!==a||e[5]!==r?(p=K=>{const te=K?Ho(K):null,{at:se,...ee}=r;a(te?{...ee,at:te}:ee)},e[4]=a,e[5]=r,e[6]=p):p=e[6];const f=p;let x;e[7]!==m||e[8]!==a||e[9]!==r?(x=(K,te)=>{const se={...m};te==="on"?se[K]=!0:te==="off"?se[K]=!1:delete se[K];const{tests:ee,...ae}=r;a(Object.keys(se).length>0?{...ae,tests:se}:ae)},e[7]=m,e[8]=a,e[9]=r,e[10]=x):x=e[10];const h=x;let j;e[11]!==o?(j=o("sandbox.previewAs.label"),e[11]=o,e[12]=j):j=e[12];let g;e[13]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(so,{size:16}),e[13]=g):g=e[13];let b;e[14]!==c||e[15]!==j?(b=n.jsx(lt,{asChild:!0,children:n.jsx(xr,{asChild:!0,children:n.jsx(We,{"aria-label":j,active:c,"data-testid":"preview-as-trigger",children:g})})}),e[14]=c,e[15]=j,e[16]=b):b=e[16];let N;e[17]!==o?(N=o("sandbox.previewAs.label"),e[17]=o,e[18]=N):N=e[18];let y;e[19]!==N?(y=n.jsx(ct,{children:N}),e[19]=N,e[20]=y):y=e[20];let v;e[21]!==b||e[22]!==y?(v=n.jsxs(dt,{children:[b,y]}),e[21]=b,e[22]=y,e[23]=v):v=e[23];let P;e[24]!==o?(P=o("sandbox.previewAs.label"),e[24]=o,e[25]=P):P=e[25];let E;e[26]!==P?(E=n.jsx("h3",{className:"text-sm font-medium",children:P}),e[26]=P,e[27]=E):E=e[27];let k;e[28]!==d||e[29]!==o?(k=o(d?"sandbox.previewAs.intro":"sandbox.previewAs.unavailable"),e[28]=d,e[29]=o,e[30]=k):k=e[30];let S;e[31]!==k?(S=n.jsx("p",{className:"text-xs text-muted-foreground",children:k}),e[31]=k,e[32]=S):S=e[32];let R;e[33]!==E||e[34]!==S?(R=n.jsxs("div",{className:"flex flex-col gap-1",children:[E,S]}),e[33]=E,e[34]=S,e[35]=R):R=e[35];let O;e[36]!==o?(O=o("sandbox.previewAs.momentLabel"),e[36]=o,e[37]=O):O=e[37];let T;e[38]!==O?(T=n.jsx(pi,{htmlFor:"preview-as-moment",children:O}),e[38]=O,e[39]=T):T=e[39];let L;e[40]!==r.at?(L=Uo(r.at),e[40]=r.at,e[41]=L):L=e[41];let D;e[42]!==f?(D=K=>f(K.target.value),e[42]=f,e[43]=D):D=e[43];let A;e[44]!==L||e[45]!==D?(A=n.jsx(Rs,{id:"preview-as-moment",type:"datetime-local",className:Vo,value:L,onChange:D}),e[44]=L,e[45]=D,e[46]=A):A=e[46];const M=r.at===void 0;let H;e[47]!==f?(H=()=>f(""),e[47]=f,e[48]=H):H=e[48];let X;e[49]!==o?(X=o("sandbox.previewAs.now"),e[49]=o,e[50]=X):X=e[50];let V;e[51]!==M||e[52]!==H||e[53]!==X?(V=n.jsx(Me,{type:"button",variant:"ghost",size:"sm",disabled:M,onClick:H,children:X}),e[51]=M,e[52]=H,e[53]=X,e[54]=V):V=e[54];let J;e[55]!==A||e[56]!==V?(J=n.jsxs("div",{className:"flex items-center gap-2",children:[A,V]}),e[55]=A,e[56]=V,e[57]=J):J=e[57];let q;e[58]!==o?(q=o("sandbox.previewAs.momentHint"),e[58]=o,e[59]=q):q=e[59];let G;e[60]!==q?(G=n.jsx("p",{className:"text-xs text-muted-foreground",children:q}),e[60]=q,e[61]=G):G=e[61];let Y;e[62]!==T||e[63]!==J||e[64]!==G?(Y=n.jsxs("div",{className:"flex flex-col gap-1.5",children:[T,J,G]}),e[62]=T,e[63]=J,e[64]=G,e[65]=Y):Y=e[65];let _;e[66]!==o?(_=o("sandbox.previewAs.testsLabel"),e[66]=o,e[67]=_):_=e[67];let $;e[68]!==_?($=n.jsx("span",{className:"text-sm font-medium",children:_}),e[68]=_,e[69]=$):$=e[69];let F;e[70]!==m||e[71]!==h||e[72]!==o||e[73]!==s?(F=s.length===0?n.jsx("p",{className:"text-xs text-muted-foreground",children:o("sandbox.previewAs.noTests")}):n.jsxs(n.Fragment,{children:[n.jsx("ul",{className:"flex flex-col gap-1.5",children:s.map(K=>n.jsxs("li",{className:"flex items-center justify-between gap-2","data-testid":"preview-as-test",children:[n.jsx("span",{className:"min-w-0 truncate text-sm",children:K}),n.jsxs(mi,{type:"single",variant:"outline",size:"sm",value:m[K]===void 0?"":m[K]?"on":"off",onValueChange:te=>h(K,te),"aria-label":K,children:[n.jsx(Fn,{value:"off",children:o("sandbox.previewAs.off")}),n.jsx(Fn,{value:"on",children:o("sandbox.previewAs.on")})]})]},K))}),n.jsx("p",{className:"text-xs text-muted-foreground",children:o("sandbox.previewAs.testsHint")})]}),e[70]=m,e[71]=h,e[72]=o,e[73]=s,e[74]=F):F=e[74];let I;e[75]!==$||e[76]!==F?(I=n.jsxs("div",{className:"flex flex-col gap-1.5",children:[$,F]}),e[75]=$,e[76]=F,e[77]=I):I=e[77];let B;e[78]!==c||e[79]!==a||e[80]!==o?(B=c&&n.jsx(Me,{type:"button",variant:"outline",size:"sm",onClick:()=>a({}),children:o("sandbox.previewAs.reset")}),e[78]=c,e[79]=a,e[80]=o,e[81]=B):B=e[81];let z;e[82]!==R||e[83]!==Y||e[84]!==I||e[85]!==B?(z=n.jsxs(br,{className:"flex w-80 flex-col gap-4 p-4",align:"center",sideOffset:8,"data-testid":"preview-as",children:[R,Y,I,B]}),e[82]=R,e[83]=Y,e[84]=I,e[85]=B,e[86]=z):z=e[86];let W;return e[87]!==v||e[88]!==z?(W=n.jsxs(yr,{children:[v,z]}),e[87]=v,e[88]=z,e[89]=W):W=e[89],W}const pc=15e3;function mc(t,e,s){return s?t.src===e||t.loading?t:{src:e,loading:!0}:t.src===e&&!t.loading?t:{src:e,loading:!1}}function er(t){return t.loading?{...t,loading:!1}:t}const hc=500,gc={mobile:{width:412,height:823},tablet:{width:1024,height:1366},desktop:{width:1280,height:800}},tr=1,Qt=["desktop","mobile","tablet"],vc=["preview","visual","blocks"],sr={mobile:"sandbox.preview.deviceMobile",tablet:"sandbox.preview.deviceTablet",desktop:"sandbox.preview.deviceDesktop"};function xc(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 jt(t){if(!t)return null;try{return new URL(t,window.location.href).origin}catch{return null}}function Ls(t,e){try{return new URL(t,e).href}catch{return null}}function bc(t,e){if(!e.inPlaceRenderActive)return{pin:e.draftPreviewUrl?{path:e.resolvedPath,url:e.draftPreviewUrl}:null,effective:e.draftPreviewUrl};if(e.draftPreviewUrl!==null&&t?.path!==e.resolvedPath){const s={path:e.resolvedPath,url:e.draftPreviewUrl};return{pin:s,effective:s.url}}return{pin:t,effective:t?.url??null}}function yc(t,e){return!t||t.nav!==e.nav?!1:t.content!==e.content}function wc(t,e,s){const r=t.toLowerCase(),a=e.toLowerCase(),d=a.split("/").filter(Boolean),o=c=>{if(c===s)return 100;const l=c.indexOf(s);if(l===-1)return 0;let m=40;return l===0?m+=30:/[\s/-]/.test(c[l-1]??"")&&(m+=20),m+=Math.round(s.length/c.length*20),m};let i=Math.max(o(r),o(a));return d.at(-1)===s?i=Math.max(i,95):d.includes(s)&&(i=Math.max(i,90)),i}function kc(t,e){try{t.contentWindow?.location.reload()}catch{e&&(t.src=e)}}function Sc({virtualMcpId:t}){const e=Pe(),s=Tr(),{currentBranch:r,taskId:a,virtualMcpId:d}=Lt(),o=!!Ja(),i=Or(),c=co(d===t?t:null),l=jr(t),m=gi(c?.metadata?.ui?.layout??null),p=_r(m),f=Vr({contentEditingEnabled:p,isMobile:s}),[x]=C.useState(()=>cc({cmsMode:m,isMobile:s})),[h,j]=As(_s.previewEditingMode(t),u=>u&&vc.includes(u)?u:null),g=h??x,[b,N]=As(_s.previewDeviceSize(t),u=>u&&Qt.includes(u)?u:"desktop"),[y,v]=C.useState(null),[P,E]=C.useState(null),k=C.useRef(null),S=C.useRef(null),[R,O]=C.useState(!1),T=C.useRef(null),L=()=>{T.current?.flush(),O(!1)},D=()=>O(u=>(u&&T.current?.flush(),!u)),[A,M]=C.useState({width:0,height:0}),[H,X]=C.useState(!1),[V,J]=C.useState({}),[q,G]=C.useState(""),Y=C.useRef(null),[_,$]=C.useState(!1),[F,I]=C.useState(),[B,z]=C.useState(null),[W,K]=C.useState(null),[te,se]=C.useState(null),[ee,ae]=C.useState(()=>i.state.target?.kind==="page"?i.state.target.path:"/"),[pe,de]=C.useState(()=>i.state.target?.kind==="page"?i.state.target.key:null),[ve,ue]=C.useState({}),[xe,me]=C.useState(!1),ge=C.useRef(null),je=()=>{me(!0),ge.current&&clearTimeout(ge.current),ge.current=setTimeout(()=>me(!1),15e3)},fe=()=>{ge.current&&(clearTimeout(ge.current),ge.current=null),me(!1)},{org:ie}=zs(),Ne=Us(),Fe=Rt(),ze=Fe.vmEntry,Be=Ne.lifecycle.phase,{url:ut,undecided:Je}=Nr(t),he=ss(t,r),{connection:Le}=Cr(t),_e=fi(t),Ke=jo({hasServeConnection:!!Le,runtime:l.runtime}),ne=Je||Ke==="github"&&(_e==="loading"||_e==="error"),oe=!at(he)&&!ne&&!(Ke==="github"&&he.kind==="pending"),ke=He(he)??ut,Ie=ke??Fe.previewUrl,ft=!!ke||Be==="running",Ye=c?.id===t?mo(c.metadata):null,pt=!ke&&!Je&&c?.id===t&&l.runtime==="cms",qr=l.projectDefault==="cms",mt=oe?si({sandboxUrl:Ie,previewServerUrl:Ye,fastPreviewActive:pt}):null,Vs=t&&r?{orgSlug:ie.slug,virtualMcpId:t,branch:r,threadId:a??null,previewUrl:Ie}:null,qs=Ks(Vs,{fetchEnabled:ft}),ns=Lr(Vs,{fetchEnabled:ft}),le=qs.data,Se=ns.data,Qe=le?Wo(le,Se).sort((u,w)=>u.name.localeCompare(w.name)):[],Ws=t&&r?{orgSlug:ie.slug,virtualMcpId:t,branch:r}:null,Gs=Xl(Ws),rs=le&&Se?Go(le,Se):[],Js=oe&&le&&Se?Ha(Se,le,"loaders"):[],Ys=q?(()=>{const u=q.toLowerCase();return Qe.map(w=>({page:w,score:wc(w.name,w.path,u)})).filter(({score:w})=>w>0).sort((w,U)=>U.score-w.score||w.page.path.length-U.page.path.length).map(({page:w})=>w)})():Qe,Qs=rs.filter(u=>{if(!q)return!0;const w=q.toLowerCase();return u.name.toLowerCase().includes(w)||u.key.toLowerCase().includes(w)||u.resolveType.toLowerCase().includes(w)}),Xs=f?Js:[],Zs=Xs.filter(u=>{if(!q)return!0;const w=q.toLowerCase();return u.title.toLowerCase().includes(w)||u.key.toLowerCase().includes(w)||u.resolveType.toLowerCase().includes(w)}),At=W?Js.find(u=>u.key===W)??null:null,Oe=Is,as=B||W?null:Jo(Qe,ee,pe),re=as?.key??null,Xe=i.state.target?.kind==="section"?i.state.target.key:i.state.focusedBlockKey??re,_t=as?.path??null,Ze=(re?ve[re]:void 0)??{},Ee=Ve(ee,Ze),os={};if(oe&&ft&&Ie&&Se&&le){const u=Va(Se,"loaders"),w=re?le[re]:void 0,U=bl(w,le,be=>u.has(be)),Z=ml(U);for(const be of Ct(ee)){if(be.type!=="param")continue;const $e=ul(ee,be.name,U),Te=vl($e,u,Z);Te.length>0&&(os[be.name]=Te)}}const Ot=t&&r?{orgSlug:ie.slug,virtualMcpId:t,branch:r,threadId:a??null}:null,en=le&&re?Yo(le,re,0):[],tn=at(he),sn=le?Qo(en,le,tn):[],is=sn.map(u=>u.isSavedBlock?u.label:""),ls=sn.map(u=>u.isSavedBlock?"global":u.isMultivariate?"variant":"normal"),cs=en.map(u=>$s(u,le??{},tn)),Dt=C.useRef(null),Re=C.useRef(null),Wr=Ne.status.state==="paused",ds=Ne.phase,nn=qa({claimPhase:ds,lifecycle:Ne.lifecycle}),qe=Fe.previewState,Gr=Fe.userStopped,Jr=Eo(ie.slug,t??""),{url:Ue}=oi(pt&&t&&r?{orgSlug:ie.slug,virtualMcpId:t,branch:r,previewServerUrl:Ye??null,path:Ee}:null),Yr=qr&&l.runtime==="sandbox",Ce=No(he,Ke,_e),rn=Co(Ce&&pt&&he.kind==="protocol"&&t&&r?{orgSlug:ie.slug,virtualMcpId:t,branch:r}:null),an=Ce?rn.pointer:null,Q=Gi({previewState:qe,progressStatus:nn.status,previewServerUrl:Ye,fastPreviewActive:pt,fastPreviewReady:!!Ue,codingSession:Yr,localPreviewUrl:ke,hostedDraft:Ce,hostedPointerPending:Ce&&(he.kind==="pending"||rn.pending),deciding:ne}),on=Q.showWakingPill||Ce&&Q.mode==="production"&&!an,ht=Q.mode!=="none",Qr=Q.mode==="production"&&Q.iframeBase?jt(Q.iframeBase):null,et=Q.mode==="production"?Qr:jt(Ie),Xr=c?.id===t&&c.metadata?.fastPreviewInPlace===!0,gt=oe?ke?Q.mode==="sandbox"&&f&&g==="blocks":Q.mode==="production"&&pt&&Xr&&f&&g==="blocks":!1,ln=C.useRef(null),{pin:Zr,effective:ea}=bc(ln.current,{inPlaceRenderActive:gt,draftPreviewUrl:Ue,resolvedPath:Ee});ln.current=Zr;const cn=i.state.variantOverride??[],Bt=oe?cn:[],vt=oe?[]:cn,us=at(he)&&Xo.some(u=>Zo(Se,u)==="available"),tt=us?V:{},dn=Dr(tt),ta=us&&le?Object.keys(ei(le).experiments):[],$t=Ce?uc({display:Q,path:Ee,pointer:an,device:b,forcedVariants:vt,previewOptions:tt}):null,st=t?Tn(ie.slug,t):null,un=JSON.stringify([vt,tt]);C.useEffect(()=>{if(!Ce||!st)return;const[u,w]=JSON.parse(un);Bn(st,{forcedVariants:u,previewOptions:w})},[Ce,st,un]),C.useEffect(()=>{if(!(!Ce||!st))return()=>Bn(st,null)},[Ce,st]);const fs=Le&&He(he)?Do(Le.endpoint,vt,dn):null,sa=Le&&He(he)?fs?hi(fs,tt):_n:null,nt=xc(Q.mode==="sandbox"?Wt(Bs(On(te??Ls(Ee,Q.iframeBase)??Q.iframeBase,sa),b),Bt):Q.mode==="production"&&$t?.frame?$t.frame:Q.mode==="production"?Wt(Bs(zn(Rn(On(te??ea??Ls(Ee,Q.iframeBase)??Q.iframeBase,on?_n:null),vt),tt),b),Bt):null),fn=Ue??(Q.iframeBase?Ls(Ee,Q.iframeBase):null),pn=Q.mode==="production"&&$t?$t.newTab:Q.mode==="production"?fn?Wt(zn(Rn(fn,vt),tt),Bt):null:nt??Q.iframeBase,na=()=>{const u=pn;u&&window.open(u,"_blank","noopener")},xt=t&&r?pr(ie.slug,t,r):null,bt=u=>{xt&&Qa(xt,u)},ye=i.state.target;C.useEffect(()=>{if(!(!ye||!mt||!Se))if(ye.kind==="page"){const u=ve[ye.key]??{};Re.current=Ve(ye.path,u),z(null),K(null),se(null),de(ye.key),ae(ye.path),bt({path:ye.path,pageKey:ye.key,params:u})}else if(ye.kind==="loader")Re.current=null,z(null),K(ye.key),se(null);else{const u=rs.find(w=>w.key===ye.key);if(u){Re.current=null;const w=An(Se);K(null),z(u),se(Dn(mt,w,u.key))}}},[ye,mt,Se,ve]),C.useEffect(()=>{!re||_t===null||ye?.kind==="page"&&ye.key===re&&ye.path===_t||i.selectTarget({kind:"page",key:re,path:_t})},[re,_t,ye]);const[mn,ra]=C.useState(null);if(qe.kind==="iframe"&&mn!==qe.previewUrl){const u=mn!==null;ra(qe.previewUrl);const w=xt?fr(xt):null;if(w){if(Re.current=Ve(w.path,w.params),ae(w.path),de(w.pageKey),se(null),z(null),K(null),w.pageKey&&Object.keys(w.params).length>0){const U=w.pageKey;ue(Z=>({...Z,[U]:w.params}))}}else u&&(Re.current=null,ae("/"),se(null),de(null),z(null),K(null))}Dt.current=nt;const aa=Q.mode==="production"&&!!Ue&&!ke,[hn,ps]=C.useState({src:nt??void 0,loading:!1}),Mt=mc(hn,nt??void 0,aa);Mt!==hn&&ps(Mt);const yt=Mt.src,gn=Mt.loading,vn=Xi({iframeRef:k,src:Q.mode==="sandbox"?nt:null,active:Q.mode==="sandbox"}),xn=C.useRef(null);C.useEffect(()=>{const u=gn?setTimeout(()=>ps(er),pc):null,w=()=>{u&&clearTimeout(u)};if(!Ue||!yt||xn.current===Ue)return w;xn.current=Ue;const U=k.current;return U&&U.getAttribute("src")!==yt&&(je(),U.src=yt),w},[Ue,yt,gn]);const bn=()=>{const u=k.current?.contentWindow,w=et;if(!u||!w||!le||!re)return;const U=le[re];if(!U||typeof U!="object")return;const Z=ni({previewBaseUrl:w,pageBlock:U,decofile:le,path:Ee,pathTemplate:ee});if(!Z)return;const be=Wt(Z.src,Oo(Bt,re));u.postMessage({type:"cms-editor::render",src:be,body:Z.body},w)},ms=C.useRef(null);C.useEffect(()=>{if(!gt||B||W||!re||!le){ms.current=null;return}const u={nav:JSON.stringify({page:re,path:Ee,pathTemplate:ee}),content:JSON.stringify(le)},w=yc(ms.current,u);ms.current=u,w&&bn()},[le,gt,B,W,re,Ee,ee]);const hs=C.useRef(null);C.useEffect(()=>{if(!gt||B||W||!re||!le){hs.current=null;return}const u=JSON.stringify(i.state.variantOverride??null),w=hs.current;hs.current={page:re,sig:u},!(!w||w.page!==re||w.sig===u)&&bn()},[i.state.variantOverride,gt,B,W,re]);const oa=!!t&&!!r&&!Ne.notFound&&!Gr&&!Wr&&(ds?.kind==="ready"||Be!=="idle"),we=dc({editingMode:g,sandboxDisplay:Q.mode==="sandbox",blocksEditingEnabled:f});C.useEffect(()=>{const u=et;if(!u)return;const w=U=>{if(U.origin===u)if(U.data?.type==="visual-editor::element-clicked"){const Z=sl.safeParse(U.data.payload);Z.success&&v(Z.data)}else if(U.data?.type==="cms-editor::section-clicked"){const Z=al.safeParse(U.data.payload);Z.success&&E({index:Z.data.sectionIndex,seq:Z.data.clickSeq})}else U.data?.type==="cms-editor::render-start"?je():U.data?.type==="cms-editor::render-end"?(fe(),k.current?.contentWindow?.postMessage({type:"cms-editor::set-labels",labels:is,kinds:ls,keys:cs},u)):U.data?.type==="cms-editor::render-error"&&fe()};return window.addEventListener("message",w),()=>window.removeEventListener("message",w)},[et,is,ls,cs]);const yn=()=>{const u=k.current?.contentWindow,w=jt(Ie);!u||!w||u.postMessage({type:"visual-editor::activate",script:nl},w)},ia=()=>{const u=k.current?.contentWindow,w=jt(Ie);!u||!w||u.postMessage({type:"visual-editor::deactivate"},w)},gs=()=>{const u=k.current?.contentWindow,w=et;!u||!w||(u.postMessage(Q.mode==="production"||ke?{type:"editor::inject",args:{script:Wn}}:{type:"visual-editor::activate",script:Wn},w),u.postMessage({type:"cms-editor::set-labels",labels:is,kinds:ls,keys:cs},w))},la=()=>{const u=k.current?.contentWindow,w=et;!u||!w||u.postMessage({type:"cms-editor::deactivate"},w)},ca=()=>{const u=k.current?.contentWindow,w=et;!u||!w||(u.postMessage({type:"cms-editor::clear-hover"},w),u.postMessage({type:"visual-editor::clear-hover"},w))},Ft=u=>{if(u==="blocks"&&!f)return;const w=g;!s&&u!==w&&(u==="blocks"?S.current?.resize("30%"):S.current?.collapse()),j(u),v(null),E(null),u!=="blocks"&&K(null),w==="visual"&&ia(),u==="visual"&&yn(),w==="blocks"&&u!=="blocks"&&la(),u==="blocks"&&gs()},da=()=>{Ft(ic(g,f))},ua=()=>{Ft(lc(g,f))},vs=()=>{const u=k.current;if(!u)return;je();const w=document.activeElement,U=u.tabIndex;u.tabIndex=-1,u.style.pointerEvents="none",u.blur(),kc(u,Dt.current);let Z;const be=()=>{clearTimeout(Z),u.tabIndex=U,u.style.pointerEvents="";const $e=document.activeElement;(!$e||$e===document.body||$e===u)&&w?.focus(),u.removeEventListener("load",be)};u.addEventListener("load",be),Z=setTimeout(be,3e3)};li(vs);const zt=Tn(ie.slug,t??""),Kt=Ce&&ht&&!!t,wn=C.useRef(null);C.useEffect(()=>{if(Kt)return To(zt)},[Kt,zt]);const{reload:wt}=Lo(ie.slug,t??""),kn=C.useRef(wt.seq);C.useEffect(()=>{if(kn.current!==wt.seq&&(kn.current=wt.seq,!!Kt&&wn.current===Dt.current)){if(wt.navigates){Ln(zt);return}vs()}},[wt.seq]);const fa=Ro(Ws),kt=Ao(He(he)?fa:""),Sn=C.useRef(kt);C.useEffect(()=>{const u=Sn.current;if(Sn.current=kt,!u||!kt||u===kt)return;const w=k.current;if(w)return tl({iframe:w,reload:vs})},[kt]);const pa=()=>{const u=Qt.indexOf(b);N(Qt[(u+1)%Qt.length])},xs=(u,w)=>{if(!re)return;const U=re,Z={...Ze,[u]:w};Re.current=Ve(ee,Z),ue(be=>({...be,[U]:Z})),bt({path:ee,pageKey:U,params:Z})},ma=Wl({iframeBase:Q.iframeBase,resolvedPath:Ee,activeGlobalSectionName:B?.name??null,noServerLabel:e("sandbox.preview.noServerRunning")}),bs=u=>{const w=ve[u.key]??{},U=Ve(u.path,w);(B||Oe(U)!==Oe(Ee))&&je(),Re.current=U,z(null),K(null),se(null),E(null),de(u.key),ae(u.path),bt({path:u.path,pageKey:u.key,params:w}),i.selectTarget({kind:"page",key:u.key,path:u.path})};Ya(xt,u=>{(B||Oe(u)!==Oe(Ee))&&je(),Re.current=u,z(null),K(null),se(null),E(null),de(null),ae(u),bt({path:u,pageKey:null,params:{}})});const ha=u=>{if(at(he)){const Z=le?ti(le,u.key,Se):null;Z?bs(Z):Zt.info(e("sandbox.preview.blockOnNoPage"));return}if(!mt||!Se){Zt.error(e("sandbox.preview.previewMetadataNotReady"));return}je(),Re.current=null;const w=An(Se),U=Dn(mt,w,u.key);z(u),K(null),se(U),E(null),i.selectTarget({kind:"section",key:u.key})},ga=u=>{f&&(z(null),K(u.key),se(null),Ft("blocks"),i.selectTarget({kind:"loader",key:u.key}))},va=async({name:u,path:w,templateKey:U})=>{if(!t||!r)return;const Z=Ar(w);if(Z){I(Z);return}const be=w.trim().startsWith("/")?w.trim():`/${w.trim()}`;if(Qe.some(Te=>Oe(Te.path)===Oe(be))){I(e("sandbox.preview.pageAlreadyExists",{path:be}));return}let $e;if(U&&($e=le?.[U],!$e)){I(e("sandbox.preview.templateNoLongerExists"));return}I(void 0);try{const Te=await Gs.mutateAsync({name:u,path:be,template:$e,schema:at(he)?{meta:Se,loadMeta:async()=>(await ns.refetch()).data}:void 0});$(!1),Zt.success(e("sandbox.preview.pageCreated",{name:u})),await xi(hc),bs({key:Te.key,name:Te.name,path:Te.path}),Ft("blocks")}catch(Te){I(Te instanceof Hr?e("sandbox.preview.pageSchemaNotReady"):Te instanceof Error?Te.message:e("sandbox.preview.failedToCreatePage"))}},It=Gl({previewSurfaceActive:ht,daemonReady:oa,production:Q.mode==="production",servePreviewUrl:He(he)}),xa=Jl({showPreviewToolbar:It,contentEditingEnabled:p}),Ut=()=>{X(!1),G("")},ys=B?.name??At?.title??as?.name,ws=qs.isPending||ns.isPending,ks=ws?jt(Q.iframeBase):ys,Ht=B?`section:${B.key}`:W?`loader:${W}`:re?`page:${re}`:void 0,ba=It?xa?n.jsxs(yr,{open:H,onOpenChange:u=>{X(u),u||G("")},children:[n.jsx(xr,{asChild:!0,children:n.jsx("button",{type:"button","aria-label":e("sandbox.preview.choosePage"),"data-testid":"preview-page-picker",title:ws?ks??void 0:B||At?ys:[ys,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:n.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-1.5 px-2 transition-colors group-hover/page-picker:bg-accent/50 group-data-[state=open]/page-picker:bg-accent/50",children:[B&&n.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:[n.jsx(no,{size:11}),e("sandbox.preview.globalBadge")]}),At&&n.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:[n.jsx(ro,{size:11}),e("sandbox.preview.loaderBadge")]}),ks&&n.jsx("span",{className:"min-w-0 flex-1 truncate font-medium text-foreground",children:ks}),!ws&&!B&&!At&&n.jsx("span",{"data-testid":"preview-page-path",className:"ml-auto min-w-0 truncate text-right font-mono text-muted-foreground",children:ee}),n.jsx(Xa,{size:12,className:De("shrink-0 transition-transform",H&&"rotate-180")})]})})}),n.jsxs(br,{className:"w-112 max-w-[calc(100vw-2rem)] p-0",align:"center",sideOffset:8,children:[n.jsxs(kr,{shouldFilter:!1,defaultValue:Ht,children:[n.jsx(Sr,{value:q,onValueChange:u=>{G(u),Y.current?.scrollTo({top:0})},placeholder:e("sandbox.preview.searchPagesAndComponents")}),n.jsxs(wr,{ref:Y,className:"max-h-80",children:[n.jsx(Pr,{children:Qe.length===0&&rs.length===0&&Xs.length===0?e("sandbox.preview.noPagesFound"):e("sandbox.preview.noSearchResults")}),Ys.length>0&&n.jsx(Et,{children:Ys.map(u=>n.jsxs(Nt,{value:`page:${u.key}`,"aria-current":Ht===`page:${u.key}`||void 0,title:`${u.name} · ${u.path}`,onSelect:()=>{Ut(),bs(u)},className:"gap-3 px-3 py-2.5 aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",children:[n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm",children:u.name}),n.jsx("span",{className:"min-w-0 max-w-1/2 truncate text-right font-mono text-xs text-muted-foreground",children:u.path})]},u.key))}),Qs.length>0&&n.jsx(Et,{heading:e("sandbox.preview.globalComponents"),children:Qs.map(u=>n.jsx(Nt,{value:`section:${u.key}`,"aria-current":Ht===`section:${u.key}`||void 0,className:"aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",onSelect:()=>{Ut(),ha(u)},children:n.jsx("span",{className:"truncate",children:u.name})},u.key))}),Zs.length>0&&n.jsx(Et,{heading:e("sandbox.preview.globalLoaders"),children:Zs.map(u=>n.jsx(Nt,{value:`loader:${u.key}`,"aria-current":Ht===`loader:${u.key}`||void 0,className:"aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",onSelect:()=>{Ut(),ga(u)},children:n.jsx("span",{className:"truncate",children:u.title})},u.key))})]})]}),!B&&!W&&Ct(ee).some(u=>u.type!=="text")&&n.jsx("div",{className:"flex flex-wrap items-center gap-1 border-t px-3 py-3 text-xs text-muted-foreground",children:Ct(ee).map((u,w)=>{if(u.type==="text")return n.jsx("span",{children:u.text},`text-${w}`);const U=os[u.name];return U&&Ot?n.jsx(Ol,{sources:U,template:ee,paramName:u.name,value:Ze[u.name]??"",sandboxRef:Ot,onCommit:Z=>xs(u.name,Z)},`${re}:${u.name}`):n.jsx(Vl,{name:u.name,value:Ze[u.name]??"",onCommit:Z=>xs(u.name,Z)},`${re}:${u.name}`)})}),n.jsx("div",{className:"border-t p-1.5",children:n.jsxs(Me,{variant:"ghost",className:"w-full justify-start",onClick:()=>{Ut(),I(void 0),$(!0)},children:[n.jsx(vr,{size:16}),e("sandbox.preview.createNewPage")]})})]})]}):n.jsx("span",{className:"min-w-0 truncate text-xs text-muted-foreground",children:ma}):null,Pn=It||p?n.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[n.jsxs(dt,{children:[n.jsx(lt,{asChild:!0,children:n.jsx(We,{onClick:pa,"aria-label":e(sr[b]),children:b==="mobile"?n.jsx(hr,{size:16}):b==="tablet"?n.jsx(ao,{size:16}):n.jsx(gr,{size:16})})}),n.jsx(ct,{children:e(sr[b])})]}),ba,n.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[us&&n.jsx(fc,{tests:ta,options:V,onChange:J,available:!!fs||!on||!dn}),n.jsx(We,{onClick:na,disabled:Ce&&!pn,"aria-label":e("sandbox.preview.openInNewTab"),children:n.jsx(cr,{size:16})})]})]}):null,ya=(oe||o)&&Q.mode==="sandbox",Vt=gc[b],qt=b==="desktop"&&(A.width===0||A.width>=Vt.width+2*tr),jn=qt?1:Math.min(A.width>0?A.width/(Vt.width+2*tr):1,1),wa=qt?{width:"100%",height:"100%"}:{width:`${Vt.width}px`,height:A.height>0?`${A.height/jn}px`:`${Vt.height}px`,transform:`scale(${jn})`,transformOrigin:"top center"},En=n.jsxs(n.Fragment,{children:[ya&&(It||p)&&n.jsx(We,{onClick:da,"aria-pressed":we==="visual","aria-label":e("sandbox.preview.visualEditor"),active:we==="visual",children:n.jsx(Cn,{size:16})}),f&&n.jsxs(dt,{children:[n.jsx(lt,{asChild:!0,children:n.jsx(We,{onClick:ua,"aria-pressed":we==="blocks","aria-label":e("sandbox.preview.blocksEditor"),active:we==="blocks",children:n.jsx(io,{size:16})})}),n.jsx(ct,{children:e("sandbox.preview.blocksEditor")})]}),Xe&&n.jsxs(dt,{children:[n.jsx(lt,{asChild:!0,children:n.jsx(We,{onClick:D,"aria-pressed":R,"aria-label":e("sectionsEditor.sectionsEditor.viewJson"),active:R,children:n.jsx(oo,{size:16})})}),n.jsx(ct,{children:e("sectionsEditor.sectionsEditor.viewJson")})]})]}),ka=!!W&&we==="blocks";return n.jsxs("div",{className:"flex flex-col w-full h-full",children:[Ot&&Object.entries(os).map(([u,w])=>(Ze[u]??"")===""?n.jsx(Ul,{sources:w,template:ee,paramName:u,sandboxRef:Ot,onFill:U=>xs(u,U)},`${re}:${u}`):null),n.jsxs(n.Fragment,{children:[n.jsx(Os.Toolbar.Center.Portal,{fallback:n.jsx("div",{className:"flex min-w-0 items-center justify-center border-b p-2",children:Pn}),children:Pn}),n.jsx(Os.Toolbar.Right.Portal,{fallback:En,children:En})]}),n.jsx("div",{className:"flex-1 overflow-hidden relative",children:ka?n.jsxs("div",{className:"relative h-full min-h-0 overflow-hidden",children:[n.jsx(Xn,{virtualMcpId:t,externalSelection:P,onViewJsonFile:D}),R&&Xe&&n.jsx("div",{className:"absolute inset-0 z-10",children:n.jsx(Zn,{ref:T,virtualMcpId:t,pageKey:Xe,onClose:L})})]}):n.jsxs($n,{orientation:"horizontal",disabled:we!=="blocks",className:"relative isolate",children:[n.jsx(Gt,{ref:S,id:"preview-blocks-editor",defaultSize:we==="blocks"?"30%":"0%",minSize:"20%",collapsible:!0,collapsedSize:"0%",className:"min-w-0 overflow-hidden",children:we==="blocks"&&n.jsx(Xn,{virtualMcpId:t,externalSelection:P,onViewJsonFile:D})}),we==="blocks"&&n.jsx(Mn,{withHandle:!0}),n.jsx(Gt,{id:"preview-canvas",defaultSize:we==="blocks"?"70%":"100%",minSize:"35%",className:"min-w-0 overflow-hidden relative z-0",children:n.jsxs($n,{orientation:"horizontal",disabled:!(R&&Xe),children:[n.jsx(Gt,{id:"preview-canvas-inner",minSize:"30%",className:"min-w-0 overflow-hidden",children:n.jsxs("div",{ref:u=>{if(!u)return;const w=()=>M(Z=>Z.width===u.clientWidth&&Z.height===u.clientHeight?Z:{width:u.clientWidth,height:u.clientHeight});w();const U=new ResizeObserver(w);return U.observe(u),()=>U.disconnect()},className:De("h-full relative overflow-clip flex justify-center",ht&&!qt&&"bg-muted/30"),children:[(xe||Jr)&&ht&&n.jsx("div",{className:"absolute inset-x-0 top-0 z-40 h-1 overflow-hidden",children:n.jsx("div",{className:"absolute inset-y-0 left-0 rounded-r-full bg-brand shadow-[0_0_6px] shadow-brand/60 animate-preview-ramp"})}),Q.showDecidingLoader&&n.jsx("div",{"data-testid":"preview-deciding",className:"absolute inset-0 z-30 flex items-center justify-center",children:n.jsx(Tt,{className:"size-5 text-muted-foreground"})}),Q.showBlockingOverlay&&n.jsx("div",{className:"absolute inset-0 z-30",children:n.jsx(Ps,{kind:"starting",progress:nn,claimPhase:ds})}),!ke&&!ne&&qe.kind==="suspended"&&n.jsx("div",{className:"absolute inset-0 z-30",children:n.jsx(Ps,{kind:"suspended",onResume:Fe.resume})}),!ke&&!ne&&qe.kind==="errored"&&n.jsx("div",{className:"absolute inset-0 z-30",children:n.jsx(Ps,{kind:"errored",error:qe.error,onRetry:Fe.retry,connectionsHref:`/${ie.slug}/settings/connections`})}),Q.showWakingPill&&n.jsxs("div",{className:"absolute top-4 left-1/2 z-20 flex max-w-md -translate-x-1/2 items-start gap-3 rounded-xl bg-muted px-4 py-3 shadow-soft pointer-events-none select-none",children:[n.jsx(Tt,{className:"size-4.5 mt-0.5 shrink-0 text-muted-foreground"}),n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsx("span",{className:"text-sm font-medium text-foreground",children:e("sandbox.preview.startingPreview")}),n.jsx("span",{className:"text-xs text-muted-foreground",children:e("sandbox.preview.startingPreviewHint")})]})]}),we==="visual"&&!y&&n.jsxs("div",{className:"absolute top-2 left-1/2 -translate-x-1/2 z-20 flex items-center gap-1.5 rounded-full border border-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:[n.jsx(Cn,{size:12}),e("sandbox.preview.clickElementToAsk")]}),we==="visual"&&y&&n.jsx(ll,{element:y,onDismiss:()=>v(null)}),ht&&nt&&n.jsx("div",{className:De("shrink-0",!qt&&"bg-background shadow-edge"),style:wa,onMouseLeave:ca,children:n.jsx("iframe",{ref:k,src:yt,className:"w-full h-full border-0",title:e("sandbox.preview.devServerPreviewTitle"),onError:vn.handleError,onLoad:()=>{if(ps(er),vn.handleLoad(),fe(),wn.current=Dt.current,Kt&&Ln(zt),Q.mode!=="sandbox"||ke){(Q.mode==="production"&&!Q.showWakingPill||ke)&&we==="blocks"&&gs();return}if(Aa("vm_preview_loaded",{view_mode:we,vm_id:ze?.sandboxHandle??null}),!B)try{const u=k.current?.contentWindow?.location?.pathname;if(!u)return;const w=Re.current;if(w!==null&&(Re.current=null,Oe(u)!==Oe(w))||Oe(u)===Oe(Ee))return;ae(u),bt({path:u,pageKey:pe,params:Ze})}catch{}we==="visual"&&yn(),we==="blocks"&&gs()}},Q.iframeBase)})]})}),R&&Xe&&n.jsxs(n.Fragment,{children:[n.jsx(Mn,{withHandle:!0}),n.jsx(Gt,{id:"preview-json-editor",defaultSize:"43%",minSize:"20%",className:"min-w-0 overflow-hidden",children:n.jsx(Zn,{ref:T,virtualMcpId:t,pageKey:Xe,onClose:L})})]})]})})]})}),n.jsx(Zl,{open:_,onOpenChange:$,isPending:Gs.isPending,error:F,templates:Qe,onSubmit:va})]})}const Fs={app:null,split:!1};function Pc(t){const e=ce.c(24),{project:s,maxApps:r,children:a}=t,d=Pe();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={silent:!0},e[0]=o):o=e[0];const i=uo(o),c=Rt();let l;e[1]!==s.metadata.runtime?(l=s.metadata.runtime??{},e[1]=s.metadata.runtime,e[2]=l):l=e[2];const m=l;let p;e[3]!==m.apps?(p=m.apps??[],e[3]=m.apps,e[4]=p):p=e[4];const f=p;let x;e[5]!==i.update||e[6]!==c||e[7]!==s.id||e[8]!==s.metadata||e[9]!==m||e[10]!==d?(x=y=>i.update.mutate({id:s.id,data:{metadata:{...bi(s.metadata),runtime:{...m,apps:y.length?y:null}}}},{onSuccess:()=>c.start(),onError:()=>Zt.error(d("sandbox.appTabs.saveError"))}),e[5]=i.update,e[6]=c,e[7]=s.id,e[8]=s.metadata,e[9]=m,e[10]=d,e[11]=x):x=e[11];const h=x,j=m.path??null;let g,b;e[12]!==f||e[13]!==h?(g=y=>h([...f,{path:y}]),b=y=>h(f.filter(v=>v.path!==y)),e[12]=f,e[13]=h,e[14]=g,e[15]=b):(g=e[14],b=e[15]);let N;return e[16]!==f||e[17]!==a||e[18]!==r||e[19]!==s.id||e[20]!==j||e[21]!==g||e[22]!==b?(N=n.jsx(jc,{virtualMcpId:s.id,mainPath:j,apps:f,maxApps:r,onAddApp:g,onRemoveApp:b,children:a}),e[16]=f,e[17]=a,e[18]=r,e[19]=s.id,e[20]=j,e[21]=g,e[22]=b,e[23]=N):N=e[23],N}function jc(t){const e=ce.c(102),{virtualMcpId:s,mainPath:r,apps:a,maxApps:d,onAddApp:o,onRemoveApp:i,children:c}=t,l=Pe(),m=Tr(),{currentBranch:p}=Lt(),f=Rt(),x=Us().lifecycle.phase,h=ss(s,p),{url:j}=Nr(s);let g;e[0]!==h||e[1]!==j?(g=He(h)??j,e[0]=h,e[1]=j,e[2]=g):g=e[2];const b=g,N=b??f.previewUrl,y=!!b||x==="running",v=!y&&f.status==="errored";let P;e[3]!==f.vmEntry?.startedWith?.apps?(P=f.vmEntry?.startedWith?.apps??[],e[3]=f.vmEntry?.startedWith?.apps,e[4]=P):P=e[4];const E=P;let k;e[5]!==s?(k=_s.previewAppLayout(s),e[5]=s,e[6]=k):k=e[6];const[S,R]=As(k,Ec);let O;e[7]!==a||e[8]!==S?(O=a.some(fe=>fe.path===S.app)?S.app:null,e[7]=a,e[8]=S,e[9]=O):O=e[9];const T=O,L=T!==null&&S.split&&!m,D=T===null||L,A=T??a[0]?.path??null,[M,H]=C.useState(null),[X,V]=C.useState(!1);let J;e[10]===Symbol.for("react.memo_cache_sentinel")?(J=()=>{H(null),V(!1)},e[10]=J):J=e[10];const q=J;let G;e[11]!==a||e[12]!==M||e[13]!==m||e[14]!==r||e[15]!==o||e[16]!==R?(G=()=>{if(M===null)return;const fe=Kn(M);if(!fe){q();return}if(fe===Kn(r??"")||a.some(ie=>ie.path===fe)){V(!0);return}o(fe),R({app:fe,split:!m}),q()},e[11]=a,e[12]=M,e[13]=m,e[14]=r,e[15]=o,e[16]=R,e[17]=G):G=e[17];const Y=G;let _;e[18]!==r||e[19]!==l?(_=r?Es(r):l("sandbox.appTabs.root"),e[18]=r,e[19]=l,e[20]=_):_=e[20];const $=_;let F;e[21]!==L||e[22]!==l?(F=l(L?"sandbox.appTabs.single":"sandbox.appTabs.split"),e[21]=L,e[22]=l,e[23]=F):F=e[23];const I=F;let B;e[24]!==l?(B=l("sandbox.appTabs.label"),e[24]=l,e[25]=B):B=e[25];let z;e[26]!==l?(z=l("sandbox.appTabs.main"),e[26]=l,e[27]=z):z=e[27];let W;e[28]!==l?(W=l("sandbox.appTabs.mainHint"),e[28]=l,e[29]=W):W=e[29];let K;e[30]!==R?(K=()=>R(Fs),e[30]=R,e[31]=K):K=e[31];let te;e[32]!==v||e[33]!==$||e[34]!==y||e[35]!==D||e[36]!==z||e[37]!==W||e[38]!==K?(te=n.jsx(nr,{label:$,badge:z,hint:W,ready:y,failed:v,onScreen:D,onSelect:K}),e[32]=v,e[33]=$,e[34]=y,e[35]=D,e[36]=z,e[37]=W,e[38]=K,e[39]=te):te=e[39];let se;if(e[40]!==a||e[41]!==T||e[42]!==v||e[43]!==$||e[44]!==i||e[45]!==y||e[46]!==R||e[47]!==L||e[48]!==l){let fe;e[50]!==T||e[51]!==v||e[52]!==$||e[53]!==i||e[54]!==y||e[55]!==R||e[56]!==L||e[57]!==l?(fe=ie=>{const Ne=Es(ie.path);return n.jsx(nr,{label:Ne,hint:l("sandbox.appTabs.extraHint",{app:$}),ready:y,failed:v,onScreen:ie.path===T,onSelect:()=>R({app:ie.path,split:L}),onRemove:()=>i(ie.path),removeLabel:l("sandbox.appTabs.remove",{app:Ne})},ie.path)},e[50]=T,e[51]=v,e[52]=$,e[53]=i,e[54]=y,e[55]=R,e[56]=L,e[57]=l,e[58]=fe):fe=e[58],se=a.map(fe),e[40]=a,e[41]=T,e[42]=v,e[43]=$,e[44]=i,e[45]=y,e[46]=R,e[47]=L,e[48]=l,e[49]=se}else se=e[49];let ee;e[59]!==te||e[60]!==se||e[61]!==B?(ee=n.jsxs("div",{role:"tablist","aria-label":B,className:"flex min-w-0 items-center gap-1 overflow-x-auto",children:[te,se]}),e[59]=te,e[60]=se,e[61]=B,e[62]=ee):ee=e[62];let ae;e[63]!==a.length||e[64]!==Y||e[65]!==M||e[66]!==X||e[67]!==d||e[68]!==l?(ae=M!==null?n.jsx("form",{className:"w-40 shrink-0",onSubmit:fe=>{fe.preventDefault(),Y()},children:n.jsx("input",{autoFocus:!0,value:M,placeholder:"apps/checkout","aria-label":l("sandbox.appTabs.pathLabel"),"aria-invalid":X,onChange:fe=>{H(fe.target.value),V(!1)},onBlur:q,onKeyDown:fe=>{fe.key==="Escape"&&q()},className:De("h-7 w-full rounded-md border bg-background px-2 font-mono text-xs outline-none",X?"border-destructive":"border-border")})}):a.length<d&&n.jsx(it,{label:l("sandbox.appTabs.add"),onClick:()=>H(""),children:n.jsx(vr,{})}),e[63]=a.length,e[64]=Y,e[65]=M,e[66]=X,e[67]=d,e[68]=l,e[69]=ae):ae=e[69];let pe;e[70]!==m||e[71]!==R||e[72]!==L||e[73]!==I||e[74]!==A?(pe=!m&&A&&n.jsx(it,{label:I,active:L,onClick:()=>R(L?Fs:{app:A,split:!0}),children:n.jsx(lo,{})}),e[70]=m,e[71]=R,e[72]=L,e[73]=I,e[74]=A,e[75]=pe):pe=e[75];let de;e[76]!==ee||e[77]!==ae||e[78]!==pe?(de=n.jsxs(n.Fragment,{children:[ee,ae,pe]}),e[76]=ee,e[77]=ae,e[78]=pe,e[79]=de):de=e[79];const ve=de;let ue;e[80]!==ve?(ue=n.jsx(Os.Topbar.Left.Portal,{fallback:n.jsx("div",{className:"flex h-10 shrink-0 items-center gap-1 border-b border-border px-2",children:ve}),children:n.jsx("div",{className:"ml-1 flex min-w-0 items-center gap-1 border-l border-border/60 pl-2",children:ve})}),e[80]=ve,e[81]=ue):ue=e[81];let xe;e[82]!==c||e[83]!==D?(xe=D&&n.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:c}),e[82]=c,e[83]=D,e[84]=xe):xe=e[84];let me;e[85]!==T||e[86]!==v||e[87]!==f.start||e[88]!==b||e[89]!==$||e[90]!==N||e[91]!==y||e[92]!==R||e[93]!==L||e[94]!==E?(me=T!==null&&n.jsx(Nc,{name:Es(T),mainName:$,appUrl:N?yi(N,T):null,ready:y,failed:v,notStarted:!b&&!E.includes(T),onStart:f.start,className:De(L&&"border-l border-border"),onClose:L?()=>R({app:T,split:!1}):void 0},T),e[85]=T,e[86]=v,e[87]=f.start,e[88]=b,e[89]=$,e[90]=N,e[91]=y,e[92]=R,e[93]=L,e[94]=E,e[95]=me):me=e[95];let ge;e[96]!==xe||e[97]!==me?(ge=n.jsxs("div",{className:"flex min-h-0 flex-1",children:[xe,me]}),e[96]=xe,e[97]=me,e[98]=ge):ge=e[98];let je;return e[99]!==ue||e[100]!==ge?(je=n.jsxs("div",{className:"flex h-full w-full min-h-0 flex-col",children:[ue,ge]}),e[99]=ue,e[100]=ge,e[101]=je):je=e[101],je}function Ec(t){return t??Fs}function nr(t){const e=ce.c(28),{label:s,badge:r,hint:a,ready:d,failed:o,onScreen:i,onSelect:c,onRemove:l,removeLabel:m}=t,p=i?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/60 hover:text-foreground";let f;e[0]!==p?(f=De("group/app-tab flex h-7 shrink-0 items-center rounded-md text-xs transition-colors",p),e[0]=p,e[1]=f):f=e[1];const x=d?"bg-success":o?"bg-destructive":"animate-pulse bg-warning";let h;e[2]!==x?(h=De("size-1.5 rounded-full",x),e[2]=x,e[3]=h):h=e[3];let j;e[4]!==h?(j=n.jsx("span",{"aria-hidden":!0,className:h}),e[4]=h,e[5]=j):j=e[5];let g;e[6]!==s?(g=n.jsx("span",{className:"max-w-40 truncate",children:s}),e[6]=s,e[7]=g):g=e[7];let b;e[8]!==r?(b=r&&n.jsx("span",{className:"text-[10px] text-muted-foreground",children:r}),e[8]=r,e[9]=b):b=e[9];let N;e[10]!==i||e[11]!==c||e[12]!==j||e[13]!==g||e[14]!==b?(N=n.jsx(lt,{asChild:!0,children:n.jsxs("button",{type:"button",role:"tab","aria-selected":i,onClick:c,className:"flex h-full items-center gap-1.5 rounded-md px-2.5 focus-ring",children:[j,g,b]})}),e[10]=i,e[11]=c,e[12]=j,e[13]=g,e[14]=b,e[15]=N):N=e[15];let y;e[16]!==a?(y=n.jsx(ct,{className:"max-w-64",children:a}),e[16]=a,e[17]=y):y=e[17];let v;e[18]!==N||e[19]!==y?(v=n.jsxs(dt,{children:[N,y]}),e[18]=N,e[19]=y,e[20]=v):v=e[20];let P;e[21]!==l||e[22]!==m?(P=l&&n.jsx("button",{type:"button","aria-label":m,onClick:l,className:"-ml-1 mr-1 flex size-5 items-center justify-center rounded opacity-0 hover:bg-sidebar-accent focus-ring focus-visible:opacity-100 group-hover/app-tab:opacity-100",children:n.jsx(Br,{className:"size-3"})}),e[21]=l,e[22]=m,e[23]=P):P=e[23];let E;return e[24]!==v||e[25]!==P||e[26]!==f?(E=n.jsxs("div",{className:f,children:[v,P]}),e[24]=v,e[25]=P,e[26]=f,e[27]=E):E=e[27],E}function Nc(t){const e=ce.c(71),{name:s,mainName:r,appUrl:a,ready:d,failed:o,notStarted:i,onStart:c,className:l,onClose:m}=t,p=Pe(),[f,x]=C.useState("/"),[h,j]=C.useState("desktop"),[g,b]=C.useState(0),N=C.useRef(null);let y;e[0]!==a||e[1]!==f?(y=a?wi(a,f):null,e[0]=a,e[1]=f,e[2]=y):y=e[2];const v=y;let P;e[3]!==l?(P=De("flex min-h-0 min-w-0 flex-1 flex-col",l),e[3]=l,e[4]=P):P=e[4];let E;e[5]===Symbol.for("react.memo_cache_sentinel")?(E=W=>{W.preventDefault(),x(N.current?.value||"/")},e[5]=E):E=e[5];let k;e[6]!==s||e[7]!==p?(k=p("sandbox.appPane.path",{app:s}),e[6]=s,e[7]=p,e[8]=k):k=e[8];let S;e[9]!==f||e[10]!==k?(S=n.jsx("form",{className:"min-w-0 flex-1",onSubmit:E,children:n.jsx("input",{ref:N,defaultValue:f,"aria-label":k,className:"h-7 w-full rounded-md border border-border/60 bg-background px-2 font-mono text-xs text-muted-foreground outline-none hover:border-border focus:border-border focus:text-foreground"})}),e[9]=f,e[10]=k,e[11]=S):S=e[11];let R;e[12]!==h||e[13]!==p?(R=p(h==="desktop"?"sandbox.preview.deviceMobile":"sandbox.preview.deviceDesktop"),e[12]=h,e[13]=p,e[14]=R):R=e[14];let O;e[15]===Symbol.for("react.memo_cache_sentinel")?(O=()=>j(Tc),e[15]=O):O=e[15];let T;e[16]!==h?(T=h==="desktop"?n.jsx(gr,{}):n.jsx(hr,{}),e[16]=h,e[17]=T):T=e[17];let L;e[18]!==R||e[19]!==T?(L=n.jsx(it,{label:R,onClick:O,children:T}),e[18]=R,e[19]=T,e[20]=L):L=e[20];let D;e[21]!==s||e[22]!==p?(D=p("sandbox.appPane.reload",{app:s}),e[21]=s,e[22]=p,e[23]=D):D=e[23];const A=!v||!d;let M,H;e[24]===Symbol.for("react.memo_cache_sentinel")?(M=()=>b(Cc),H=n.jsx(_a,{}),e[24]=M,e[25]=H):(M=e[24],H=e[25]);let X;e[26]!==D||e[27]!==A?(X=n.jsx(it,{label:D,disabled:A,onClick:M,children:H}),e[26]=D,e[27]=A,e[28]=X):X=e[28];let V;e[29]!==s||e[30]!==p?(V=p("sandbox.appPane.openInNewTab",{app:s}),e[29]=s,e[30]=p,e[31]=V):V=e[31];const J=!v||!d;let q;e[32]!==v?(q=()=>v&&window.open(v,"_blank","noopener"),e[32]=v,e[33]=q):q=e[33];let G;e[34]===Symbol.for("react.memo_cache_sentinel")?(G=n.jsx(cr,{}),e[34]=G):G=e[34];let Y;e[35]!==V||e[36]!==J||e[37]!==q?(Y=n.jsx(it,{label:V,disabled:J,onClick:q,children:G}),e[35]=V,e[36]=J,e[37]=q,e[38]=Y):Y=e[38];let _;e[39]!==s||e[40]!==m||e[41]!==p?(_=m&&n.jsx(it,{label:p("sandbox.appPane.close",{app:s}),onClick:m,children:n.jsx(Br,{})}),e[39]=s,e[40]=m,e[41]=p,e[42]=_):_=e[42];let $;e[43]!==X||e[44]!==Y||e[45]!==_||e[46]!==S||e[47]!==L?($=n.jsxs("div",{className:"flex h-10 shrink-0 items-center gap-1 border-b border-border px-2",children:[S,L,X,Y,_]}),e[43]=X,e[44]=Y,e[45]=_,e[46]=S,e[47]=L,e[48]=$):$=e[48];let F;e[49]!==r||e[50]!==p?(F=p("sandbox.appPane.previewOnly",{app:r}),e[49]=r,e[50]=p,e[51]=F):F=e[51];let I;e[52]!==F?(I=n.jsx("p",{className:"shrink-0 truncate border-b border-border bg-muted/40 px-3 py-1.5 text-xs text-muted-foreground",children:F}),e[52]=F,e[53]=I):I=e[53];let B;e[54]!==h||e[55]!==o||e[56]!==r||e[57]!==s||e[58]!==i||e[59]!==c||e[60]!==d||e[61]!==g||e[62]!==v||e[63]!==p?(B=n.jsx("div",{className:"flex min-h-0 flex-1 justify-center overflow-auto bg-muted/40",children:d&&i?n.jsxs("div",{className:"flex flex-col items-center gap-3 self-center px-6 text-center",children:[n.jsx("p",{className:"text-sm text-muted-foreground",children:p("sandbox.appPane.notStarted",{app:s})}),n.jsx(Me,{size:"sm",variant:"outline",onClick:c,children:p("sandbox.appPane.start",{app:s})})]}):!d||!v?n.jsx("p",{className:"self-center px-6 text-center text-sm text-muted-foreground",children:d?p("sandbox.appPane.noUrl"):o?p("sandbox.appPane.failed",{app:r}):p("sandbox.appPane.waiting")}):n.jsx("iframe",{src:v,title:s,className:De("h-full bg-background",h==="mobile"?"w-[412px] max-w-full border-x border-border":"w-full")},`${v}#${g}`)}),e[54]=h,e[55]=o,e[56]=r,e[57]=s,e[58]=i,e[59]=c,e[60]=d,e[61]=g,e[62]=v,e[63]=p,e[64]=B):B=e[64];let z;return e[65]!==s||e[66]!==P||e[67]!==$||e[68]!==I||e[69]!==B?(z=n.jsxs("section",{"aria-label":s,className:P,children:[$,I,B]}),e[65]=s,e[66]=P,e[67]=$,e[68]=I,e[69]=B,e[70]=z):z=e[70],z}function Cc(t){return t+1}function Tc(t){return t==="desktop"?"mobile":"desktop"}function it(t){const e=ce.c(11),{label:s,children:r,active:a,disabled:d,onClick:o}=t;let i;e[0]!==a||e[1]!==r||e[2]!==d||e[3]!==s||e[4]!==o?(i=n.jsx(lt,{asChild:!0,children:n.jsx(We,{"aria-label":s,"aria-pressed":a,active:a,disabled:d,onClick:o,children:r})}),e[0]=a,e[1]=r,e[2]=d,e[3]=s,e[4]=o,e[5]=i):i=e[5];let c;e[6]!==s?(c=n.jsx(ct,{children:s}),e[6]=s,e[7]=c):c=e[7];let l;return e[8]!==i||e[9]!==c?(l=n.jsxs(dt,{children:[i,c]}),e[8]=i,e[9]=c,e[10]=l):l=e[10],l}const Lc=async(t,e)=>{try{return await fetch(t,{method:"HEAD",mode:"no-cors",cache:"no-store",credentials:"omit",signal:e}),!0}catch{return!1}},Rc=1e4,Ac=1e4,_c=5e3,Oc=2;function Dc(t,e){return t&&e===0?Ac:Math.min(1e3*2**Math.max(0,e-1),_c)}function Bc(t,e,s){return e?!0:t===!0&&s<Oc}function $c(t,e){const s=ce.c(11),r=Lc,a=Oa();let d;s[0]!==t?(d=or.localAppReachable(t??""),s[0]=t,s[1]=d):d=s[1];const o=d;let i;s[2]!==r||s[3]!==a||s[4]!==o||s[5]!==t?(i=async p=>{const{signal:f}=p,x=new AbortController,h=()=>x.abort();f.addEventListener("abort",h);const j=setTimeout(h,Rc),g=await r(t,x.signal).catch(Fc);clearTimeout(j),f.removeEventListener("abort",h);const b=a.getQueryData(o),N=g?0:(b?.failures??0)+1;return{up:Bc(b?.up??null,g,N),failures:N}},s[2]=r,s[3]=a,s[4]=o,s[5]=t,s[6]=i):i=s[6];const c=!!t;let l;s[7]!==o||s[8]!==i||s[9]!==c?(l={queryKey:o,queryFn:i,enabled:c,retry:!1,staleTime:0,gcTime:0,refetchInterval:Mc},s[7]=o,s[8]=i,s[9]=c,s[10]=l):l=s[10];const{data:m}=Da(l);return t?m?.up??null:null}function Mc(t){return t.state.data?Dc(t.state.data.up,t.state.data.failures):!1}function Fc(){return!1}function zc(t){const{backend:e}=t;if(e.kind==="protocol"&&e.source==="local")return{kind:"connected"};if(e.kind==="unavailable"&&e.source==="local"){const s=e.problem;return!s||s.reason==="not-answering"?t.access==="denied"?{kind:"needs-permission"}:{kind:"not-running"}:{kind:"problem",problem:s}}return{kind:"connecting"}}function Kd(t){const e=ce.c(53),{virtualMcpId:s}=t,r=Pe(),a=fo(s),{connection:d}=Cr(s),{activeTask:o,taskId:i,currentBranch:c}=Lt(),l=Ai(i),[m,p]=C.useState(!1),f=ss(s,c);let x;e[0]!==f||e[1]!==d?(x=d?He(f):null,e[0]=f,e[1]=d,e[2]=x):x=e[2];const h=x,j=$c(h),g=Mr(),b=ki("multi_app_preview");if(ji({threadId:i,sandboxBranch:o?.branch??c,agentHasRepo:js(a?.metadata),threadHasRepo:js(l)||js(o?.metadata)})==="none"&&!d){let E;e[3]===Symbol.for("react.memo_cache_sentinel")?(E=n.jsx("div",{className:"flex size-14 items-center justify-center rounded-full bg-muted",children:n.jsx(In,{className:"size-7 text-foreground"})}),e[3]=E):E=e[3];let k;e[4]!==r?(k=r("mainPanelTabs.previewTab.noSourceToPreview"),e[4]=r,e[5]=k):k=e[5];let S;e[6]!==r?(S=r("mainPanelTabs.previewTab.connectGithubDescription"),e[6]=r,e[7]=S):S=e[7];let R,O;e[8]===Symbol.for("react.memo_cache_sentinel")?(R=()=>p(!0),O=n.jsx(In,{className:"size-4"}),e[8]=R,e[9]=O):(R=e[8],O=e[9]);let T;e[10]!==r?(T=r("mainPanelTabs.previewTab.connectGithub"),e[10]=r,e[11]=T):T=e[11];let L;e[12]!==T?(L=n.jsxs(Me,{onClick:R,children:[O,T]}),e[12]=T,e[13]=L):L=e[13];let D;e[14]!==k||e[15]!==S||e[16]!==L?(D=n.jsx(Si,{className:"h-full",image:E,title:k,description:S,actions:L}),e[14]=k,e[15]=S,e[16]=L,e[17]=D):D=e[17];let A;e[18]!==m?(A=n.jsx(Pi,{open:m,onOpenChange:p,mode:"agent"}),e[18]=m,e[19]=A):A=e[19];let M;return e[20]!==A||e[21]!==D?(M=n.jsxs(n.Fragment,{children:[D,A]}),e[20]=A,e[21]=D,e[22]=M):M=e[22],M}if(d&&a&&!He(f)){let E;e[23]!==g||e[24]!==f?(E=zc({backend:f,access:g}),e[23]=g,e[24]=f,e[25]=E):E=e[25];let k;e[26]!==d.endpoint?(k=_o(d.endpoint),e[26]=d.endpoint,e[27]=k):k=e[27];let S;return e[28]!==E||e[29]!==k?(S=n.jsx(Ic,{status:E,host:k}),e[28]=E,e[29]=k,e[30]=S):S=e[30],S}if(h&&j!==!0){let E;e[31]!==r?(E=r("mainPanelTabs.previewTab.localAppWaiting.title"),e[31]=r,e[32]=E):E=e[32];let k;e[33]!==h||e[34]!==r?(k=r("mainPanelTabs.previewTab.localAppWaiting.body",{host:Kc(h)}),e[33]=h,e[34]=r,e[35]=k):k=e[35];let S;e[36]!==k?(S=n.jsx(es,{text:k}),e[36]=k,e[37]=S):S=e[37];let R;e[38]!==r?(R=r("mainPanelTabs.previewTab.localAppWaiting.hint"),e[38]=r,e[39]=R):R=e[39];let O;e[40]!==R?(O=n.jsx("p",{role:"status",className:"text-center text-sm text-muted-foreground",children:R}),e[40]=R,e[41]=O):O=e[41];let T;return e[42]!==E||e[43]!==S||e[44]!==O?(T=n.jsx(ts,{headingLevel:2,waiting:!0,title:E,lead:S,footer:O}),e[42]=E,e[43]=S,e[44]=O,e[45]=T):T=e[45],T}let y;e[46]!==s?(y=n.jsx(Sc,{virtualMcpId:s}),e[46]=s,e[47]=y):y=e[47];const v=y;let P;return e[48]!==a||e[49]!==b||e[50]!==v||e[51]!==d?(P=n.jsx(Wa,{children:b&&a&&!d?n.jsx(Pc,{project:a,maxApps:vi,children:v}):v}),e[48]=a,e[49]=b,e[50]=v,e[51]=d,e[52]=P):P=e[52],P}function Kc(t){try{return new URL(t).host}catch{return t}}function Ic(t){const e=ce.c(20),{status:s,host:r}=t,a=Pe();if(s.kind==="connected"){let i;e[0]!==a?(i=a("mainPanelTabs.previewTab.localhostNoPreview.title"),e[0]=a,e[1]=i):i=e[1];let c;e[2]!==a?(c=a("mainPanelTabs.previewTab.localhostNoPreview.body"),e[2]=a,e[3]=c):c=e[3];let l;e[4]!==c?(l=n.jsx(es,{text:c}),e[4]=c,e[5]=l):l=e[5];let m;e[6]!==a?(m=a("mainPanelTabs.previewTab.localhostNoPreview.step.title"),e[6]=a,e[7]=m):m=e[7];let p;e[8]!==m?(p=[{title:m,command:`${Er} --preview localhost:3000`}],e[8]=m,e[9]=p):p=e[9];let f;return e[10]!==i||e[11]!==l||e[12]!==p?(f=n.jsx(ts,{headingLevel:2,waiting:!1,title:i,lead:l,steps:p}),e[10]=i,e[11]=l,e[12]=p,e[13]=f):f=e[13],f}let d;e[14]!==r||e[15]!==s?(d=$i(s,r),e[14]=r,e[15]=s,e[16]=d):d=e[16];let o;return e[17]!==r||e[18]!==d?(o=n.jsx(Bi,{wait:d,hosts:r}),e[17]=r,e[18]=d,e[19]=o):o=e[19],o}export{Bi as L,Kd as P,ts as S,zd as u};