decocms 4.503.2 → 4.503.4

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 (378) hide show
  1. package/dist/client/assets/{ActiveShapeUtils-CBLSJqBl.js → ActiveShapeUtils-B5q2Fpj9.js} +1 -1
  2. package/dist/client/assets/{AlertCircle-BFUZ4yx0.js → AlertCircle-DNYRiSZ5.js} +1 -1
  3. package/dist/client/assets/{AreaChart-DKrmhkRJ.js → AreaChart-BTuXJM5s.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-CK2OAC0l.js → ArrowLeft-BPRTZJKi.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-U6_gobY2.js → ArrowUp-ZHJFpRuE.js} +1 -1
  6. package/dist/client/assets/{BarChart-DBqZyJQX.js → BarChart-Bezom8e_.js} +1 -1
  7. package/dist/client/assets/{Building02-Ddm6hNyu.js → Building02-BpZfnUaY.js} +1 -1
  8. package/dist/client/assets/{CategoricalChart-DYWjGYq1.js → CategoricalChart-Uo4Rj6g_.js} +1 -1
  9. package/dist/client/assets/{CheckCircle-BWW06ZXQ.js → CheckCircle-DOJo5D8E.js} +1 -1
  10. package/dist/client/assets/{ChevronSelectorVertical-DKcwgXpF.js → ChevronSelectorVertical-BjGO6IDu.js} +1 -1
  11. package/dist/client/assets/{ChevronUp-CTrNq9Nk.js → ChevronUp-85QiHbB8.js} +1 -1
  12. package/dist/client/assets/{Copy01-TJP2zB12.js → Copy01-DHwdjF9k.js} +1 -1
  13. package/dist/client/assets/{CreditCard01-Bm6_xB5H.js → CreditCard01-BMScCkLO.js} +1 -1
  14. package/dist/client/assets/{DotsVertical-DKl8j3BE.js → DotsVertical-XGcmOLtN.js} +1 -1
  15. package/dist/client/assets/{ErrorBarContext-CR5xIaDQ.js → ErrorBarContext-1_vc7VhI.js} +1 -1
  16. package/dist/client/assets/{Globe04-ClrCqE7c.js → Globe04-BJ3qfVTm.js} +1 -1
  17. package/dist/client/assets/{Image01-Cf_YxPro.js → Image01-DA50Hqzp.js} +1 -1
  18. package/dist/client/assets/{Key01-55Z6tHcr.js → Key01-GJDDXAJz.js} +1 -1
  19. package/dist/client/assets/{Link01-DNXOSsg9.js → Link01-DITYAShx.js} +1 -1
  20. package/dist/client/assets/{LinkBroken01-Vuoqu_ZW.js → LinkBroken01-DqJqD91d.js} +1 -1
  21. package/dist/client/assets/{Monitor01-C-mB2rao.js → Monitor01-CDHoaa0R.js} +1 -1
  22. package/dist/client/assets/{Play-CUFyJJIt.js → Play-YAp6V4vH.js} +1 -1
  23. package/dist/client/assets/{Plus-D-GSl2MA.js → Plus-CPrlnOw7.js} +1 -1
  24. package/dist/client/assets/{SearchMd-CkV8MM4H.js → SearchMd-vuCQLB6T.js} +1 -1
  25. package/dist/client/assets/{Sector-CNZsIxmG.js → Sector-Ch82gOyF.js} +1 -1
  26. package/dist/client/assets/{ShoppingBag01-dI1cRqeE.js → ShoppingBag01-C5bgz2eY.js} +1 -1
  27. package/dist/client/assets/{Sun-BPl8u-yx.js → Sun-BVt8ND9g.js} +1 -1
  28. package/dist/client/assets/{SwitchHorizontal01-KDjTaTLX.js → SwitchHorizontal01-BmNVXOBy.js} +1 -1
  29. package/dist/client/assets/{Tool01-CvAlZ6_R.js → Tool01-D30btgv0.js} +1 -1
  30. package/dist/client/assets/{Trash01-BzUZQR5Y.js → Trash01-CuDfbX9_.js} +1 -1
  31. package/dist/client/assets/{Upload01-CdgDB-zC.js → Upload01-Bbz_T9k9.js} +1 -1
  32. package/dist/client/assets/{User01-CinpYulR.js → User01-DkehSUca.js} +1 -1
  33. package/dist/client/assets/{UserSquare-0R6kuy9W.js → UserSquare-CkJD4oxT.js} +1 -1
  34. package/dist/client/assets/{Users01-DFSTtPtZ.js → Users01-Bx_TIoWb.js} +1 -1
  35. package/dist/client/assets/{XAxis-CMCcO3jI.js → XAxis-BuYm-sWK.js} +1 -1
  36. package/dist/client/assets/{XClose-CXxsMd9c.js → XClose-jBQRwEAI.js} +1 -1
  37. package/dist/client/assets/{ZoomOut-C1rwTYBB.js → ZoomOut-CpX8NTBd.js} +1 -1
  38. package/dist/client/assets/{access-gate-BSx5LbNZ.js → access-gate-tig-XyXk.js} +1 -1
  39. package/dist/client/assets/{add-connection-dialog-CNB1XZS8.js → add-connection-dialog-bxfInPMj.js} +1 -1
  40. package/dist/client/assets/{agent-analytics-BKsJAgnt.js → agent-analytics-B-N286Uf.js} +1 -1
  41. package/dist/client/assets/agent-app-6dfYkztJ.js +1 -0
  42. package/dist/client/assets/{agent-assets-CvHLRtfR.js → agent-assets-Cgi1ormd.js} +1 -1
  43. package/dist/client/assets/{agent-automation-DG660AlN.js → agent-automation-Bc_Pzkf9.js} +1 -1
  44. package/dist/client/assets/{agent-automations-DkNZsDdV.js → agent-automations-ZrkdxSWn.js} +1 -1
  45. package/dist/client/assets/{agent-connect-sources-DFGjLsvu.js → agent-connect-sources-DqHqfSqs.js} +1 -1
  46. package/dist/client/assets/agent-deck-B3gVo2Qj.js +1 -0
  47. package/dist/client/assets/{agent-e2e-CTTKhY1C.js → agent-e2e-BDGDGL0J.js} +1 -1
  48. package/dist/client/assets/{agent-experiments-B23reQrT.js → agent-experiments-CSJXs5ck.js} +1 -1
  49. package/dist/client/assets/{agent-file-CFgK4Fqg.js → agent-file-B4y2baGc.js} +1 -1
  50. package/dist/client/assets/{agent-hosting-BL7RyxMT.js → agent-hosting-HBYg130L.js} +1 -1
  51. package/dist/client/assets/{agent-icon-Bmu0Xuy8.js → agent-icon-C1V6kO6k.js} +1 -1
  52. package/dist/client/assets/agent-library-CrxCYORH.js +1 -0
  53. package/dist/client/assets/agent-library-file-DAsbJq5U.js +1 -0
  54. package/dist/client/assets/{agent-monitor-Dxt5K5x_.js → agent-monitor-C2b2Y_Y1.js} +1 -1
  55. package/dist/client/assets/{agent-overview-CAzScYJD.js → agent-overview-CsnhRf0H.js} +1 -1
  56. package/dist/client/assets/{agent-releases-RSbZ96r7.js → agent-releases-DRgXlmeB.js} +1 -1
  57. package/dist/client/assets/agent-settings-BZ88TB1O.js +1 -0
  58. package/dist/client/assets/{agent-site-editor-DFWKub_t.js → agent-site-editor-DsdBJNL9.js} +1 -1
  59. package/dist/client/assets/agent-site-editor-code-Df5lx3om.js +2 -0
  60. package/dist/client/assets/agent-site-editor-content-BOiOZFoZ.js +1 -0
  61. package/dist/client/assets/agent-site-editor-preview-DO0UOaFC.js +1 -0
  62. package/dist/client/assets/agent-view-BgXKt_Jw.js +1 -0
  63. package/dist/client/assets/{agent-view-guard-BwubZYi8.js → agent-view-guard-Km-JyuT6.js} +1 -1
  64. package/dist/client/assets/{agents-list-L7YgNFph.js → agents-list-BanY1y62.js} +1 -1
  65. package/dist/client/assets/{ai-providers-DEeLkiCM.js → ai-providers-BQ1fiNa3.js} +1 -1
  66. package/dist/client/assets/{alert-CnRQ3m-7.js → alert-CwC4mTxQ.js} +1 -1
  67. package/dist/client/assets/{alert-dialog-BaBKldUA.js → alert-dialog-DmhXDwQf.js} +1 -1
  68. package/dist/client/assets/{analytics-sections-BIEC86HP.js → analytics-sections-BVE76D5N.js} +1 -1
  69. package/dist/client/assets/api-keys-Br0s22Rf.js +1 -0
  70. package/dist/client/assets/{api-keys-CmpJo1Rr.js → api-keys-MPhXPzmG.js} +1 -1
  71. package/dist/client/assets/{app-editor-BqvAOKlk.js → app-editor-Hif319cO.js} +1 -1
  72. package/dist/client/assets/{asset-utils--N2gsOKr.js → asset-utils-CU6xrAQD.js} +1 -1
  73. package/dist/client/assets/{auth-BeK8rRbB.js → auth-BfGJq755.js} +1 -1
  74. package/dist/client/assets/{auth-catchall-fFMHk_ps.js → auth-catchall-DHUJeHRe.js} +1 -1
  75. package/dist/client/assets/{auth-entry-C1_Znn_c.js → auth-entry-D7U4AjUc.js} +1 -1
  76. package/dist/client/assets/{auth-split-layout-CocPnGfp.js → auth-split-layout-BwhoO-JF.js} +1 -1
  77. package/dist/client/assets/{authenticate-and-persist-oauth-DJwJCiC8.js → authenticate-and-persist-oauth-Brcij0L8.js} +1 -1
  78. package/dist/client/assets/{automation-list-row-3WI1rtPZ.js → automation-list-row-DhqnXrm1.js} +1 -1
  79. package/dist/client/assets/{automation-runs-dkpbdf4I.js → automation-runs-CFyZ7Iod.js} +1 -1
  80. package/dist/client/assets/{automations-CaP79ol1.js → automations-CPaO2SBr.js} +1 -1
  81. package/dist/client/assets/{autosend-B-VPnrp2.js → autosend-BOeZuHqU.js} +1 -1
  82. package/dist/client/assets/{avatar-yCbsNNbw.js → avatar-GhiWKw1r.js} +1 -1
  83. package/dist/client/assets/{badge-Zdi_g359.js → badge-ZAtAF3u1.js} +1 -1
  84. package/dist/client/assets/{block-document-D4x1DRNW.js → block-document-BFsYEKLL.js} +1 -1
  85. package/dist/client/assets/{blocks-preview-workspace-context-CMtVQxL8.js → blocks-preview-workspace-context-x6dOFQvJ.js} +1 -1
  86. package/dist/client/assets/{blocks-tab-states-B7_Q2Byx.js → blocks-tab-states-iEAVPlIx.js} +3 -3
  87. package/dist/client/assets/{blog-schema-D0r94Mwa.js → blog-schema-ctDuKA_t.js} +1 -1
  88. package/dist/client/assets/{board-analytics-DjFw48Ii.js → board-analytics-DvMyzeTp.js} +1 -1
  89. package/dist/client/assets/{buckets-DmovZm0n.js → buckets-CgmF5YK1.js} +1 -1
  90. package/dist/client/assets/{build-improve-prompt-doc-Cd4DLFMv.js → build-improve-prompt-doc-C3V-cifS.js} +1 -1
  91. package/dist/client/assets/{calendar-aMW3a7Qx.js → calendar-DCNv43ZU.js} +1 -1
  92. package/dist/client/assets/{capability-load-error-xmV40q_-.js → capability-load-error-BwwdyiCX.js} +1 -1
  93. package/dist/client/assets/{category-editor-BYf-_N2d.js → category-editor-C1SS3xs8.js} +1 -1
  94. package/dist/client/assets/{chart-D1eqwoYD.js → chart-C2XR0VWr.js} +1 -1
  95. package/dist/client/assets/{chat-context-C4pDshj1.js → chat-context-B8EIbmvQ.js} +1 -1
  96. package/dist/client/assets/{chat-draft-D5dlb_sl.js → chat-draft-qnxtVEVH.js} +1 -1
  97. package/dist/client/assets/{checkbox-C2l5tKo2.js → checkbox-C7CPIIbh.js} +1 -1
  98. package/dist/client/assets/{choose-editor-C_NzKjq2.js → choose-editor-C5zdSB58.js} +1 -1
  99. package/dist/client/assets/{cli-auth-success-DSx-mAhh.js → cli-auth-success-DTXn6lOO.js} +1 -1
  100. package/dist/client/assets/{client-icons-BasHQFnS.js → client-icons-TMNg5z-u.js} +1 -1
  101. package/dist/client/assets/cms-settings-editor-CK28ljtG.js +1 -0
  102. package/dist/client/assets/{collapsible-CDZFoOK-.js → collapsible-CVaRDj_D.js} +1 -1
  103. package/dist/client/assets/{collection-detail-DkNCk0OQ.js → collection-detail-BR9DK1c7.js} +1 -1
  104. package/dist/client/assets/{collection-display-button--eCg5c5n.js → collection-display-button-ehG7rKuY.js} +1 -1
  105. package/dist/client/assets/{collection-search-sopr7ssV.js → collection-search-DOoRymFZ.js} +1 -1
  106. package/dist/client/assets/{collection-table-wrapper-Cy3Cbckv.js → collection-table-wrapper-zN3HZXSF.js} +1 -1
  107. package/dist/client/assets/{collection-tabs-DU5QTifc.js → collection-tabs-DLtCCrSF.js} +1 -1
  108. package/dist/client/assets/{column-rules-Z54WqqNc.js → column-rules-Du1x2YcT.js} +1 -1
  109. package/dist/client/assets/{combobox-C2hXpc1p.js → combobox-DlHUORRR.js} +1 -1
  110. package/dist/client/assets/{command-BSGZ-TwS.js → command-_UmLRidn.js} +1 -1
  111. package/dist/client/assets/{companion-mcps-section-d9HGklIc.js → companion-mcps-section-joijt_6l.js} +1 -1
  112. package/dist/client/assets/{config-CddNRjRY.js → config-Cx-JIPqO.js} +1 -1
  113. package/dist/client/assets/{connect-BGfL3A9r.js → connect-DoSLTcjV.js} +1 -1
  114. package/dist/client/assets/{connect-layout-DoM7vuFX.js → connect-layout-Bm_59z-Y.js} +1 -1
  115. package/dist/client/assets/{connection-B0eFNfCu.js → connection-DL3AzTOs.js} +1 -1
  116. package/dist/client/assets/{connection-card-BzTYJa6s.js → connection-card-Dvq8DJhG.js} +1 -1
  117. package/dist/client/assets/{connection-detail-Cwz-qT82.js → connection-detail-DqoTA2Jx.js} +1 -1
  118. package/dist/client/assets/{connection-form-helpers-ChgreO5F.js → connection-form-helpers-D9j_N0x7.js} +1 -1
  119. package/dist/client/assets/{connections-CnirV_66.js → connections-CcmlL0dN.js} +1 -1
  120. package/dist/client/assets/{content-tab-BIEsoSfa.js → content-tab-63E-NyaC.js} +3 -3
  121. package/dist/client/assets/{context-DEuw9CjH.js → context-DQMyTLF9.js} +1 -1
  122. package/dist/client/assets/{context-menu-CHrxflOD.js → context-menu-BxD8Qoq9.js} +1 -1
  123. package/dist/client/assets/{core.esm-CWXW2IWJ.js → core.esm-5rgifJ6w.js} +1 -1
  124. package/dist/client/assets/{create-organization-dialog-Bci4qKSS.js → create-organization-dialog-DKnw552E.js} +1 -1
  125. package/dist/client/assets/{daily-pulse-CRZ8lDnm.js → daily-pulse-BLN6tqFf.js} +1 -1
  126. package/dist/client/assets/{discover-C3iLTVFB.js → discover-C69w99TN.js} +1 -1
  127. package/dist/client/assets/{domain-settings-DdY9W_8b.js → domain-settings-z0KMryJJ.js} +1 -1
  128. package/dist/client/assets/{drawer-BpEasqMM.js → drawer-Cwq-E8vz.js} +1 -1
  129. package/dist/client/assets/{editor-DQK8Gbky.js → editor-YT1hAWJG.js} +1 -1
  130. package/dist/client/assets/{editor-classes-wKHzvXkJ.js → editor-classes-BOlaxHer.js} +1 -1
  131. package/dist/client/assets/{empty-state-Ck0Y0zH4.js → empty-state-COxR0UdU.js} +1 -1
  132. package/dist/client/assets/{empty-state-GUv-DLNf.js → empty-state-bIFMElEe.js} +1 -1
  133. package/dist/client/assets/{extract-connection-data-CyaR6DQN.js → extract-connection-data-BOqucuID.js} +1 -1
  134. package/dist/client/assets/{feature-gate-Cd3TCuYG.js → feature-gate-zfN6jjr4.js} +1 -1
  135. package/dist/client/assets/{feature-paywall-HnwykYzM.js → feature-paywall-DOf-RXxD.js} +1 -1
  136. package/dist/client/assets/{file-explorer-B8GvovSI.js → file-explorer-CflV7iiA.js} +1 -1
  137. package/dist/client/assets/{file-preview-KNDU2UhF.js → file-preview-BPog6jkH.js} +1 -1
  138. package/dist/client/assets/file-share-button-DwxdVjUj.js +3 -0
  139. package/dist/client/assets/{file-type-icon-C2WSm6EM.js → file-type-icon-fTBob-KS.js} +1 -1
  140. package/dist/client/assets/flat-project-D1WKpn7D.js +1 -0
  141. package/dist/client/assets/{folder-icon-DOSAeTvE.js → folder-icon-hdUwkBM6.js} +1 -1
  142. package/dist/client/assets/{form-Dz-wry37.js → form-mnUTUUgy.js} +1 -1
  143. package/dist/client/assets/{general-lahSHdvs.js → general-CgQXqxtP.js} +1 -1
  144. package/dist/client/assets/{home-CfslMwmV.js → home-CV9BF9nv.js} +1 -1
  145. package/dist/client/assets/{hosted-publish-feedback-D7K1BgAP.js → hosted-publish-feedback-B7Lxlu-b.js} +1 -1
  146. package/dist/client/assets/{icon-button-BbQESQAz.js → icon-button-Bt7uHWxC.js} +1 -1
  147. package/dist/client/assets/{index-CVeMcxNw.js → index-0NedKVmw.js} +1 -1
  148. package/dist/client/assets/{index-COyZFAVd.js → index-9SoDq1r6.js} +1 -1
  149. package/dist/client/assets/{index-DSuQX-Dj.js → index-B0o9NkGp.js} +1 -1
  150. package/dist/client/assets/{index-qp2WMoaq.js → index-B7MMDJJ7.js} +1 -1
  151. package/dist/client/assets/{index-Fqg3dcpq.js → index-Bo2QXn8j.js} +1 -1
  152. package/dist/client/assets/{index-mPiuZtAa.js → index-Bt_WPZSk.js} +1 -1
  153. package/dist/client/assets/{index-BoB02eW2.js → index-Bu9BjZrq.js} +2 -2
  154. package/dist/client/assets/{index-Cdsu1Nw_.js → index-BwRxHLj2.js} +1 -1
  155. package/dist/client/assets/{index-CAsLc9Zw.js → index-C2F2YRTL.js} +1 -1
  156. package/dist/client/assets/{index-DuSo48nd.js → index-CVgtqYMj.js} +1 -1
  157. package/dist/client/assets/{index-BFWcpEys.js → index-C_vMO742.js} +1 -1
  158. package/dist/client/assets/{index-BhuMySoe.js → index-CaAWsuiJ.js} +1 -1
  159. package/dist/client/assets/{index-DhnL-yRw.js → index-CdyBZ-dj.js} +1 -1
  160. package/dist/client/assets/{index-CD1O2KuY.js → index-DIb14xIW.js} +3 -3
  161. package/dist/client/assets/{index-BX4Ek3Q9.js → index-DYj9xST9.js} +1 -1
  162. package/dist/client/assets/{index-redirect-LGC8XAQa.js → index-redirect-BUSEAkWr.js} +1 -1
  163. package/dist/client/assets/{infiniteQueryObserver-BuOPvaCd.js → infiniteQueryObserver-Cgqjyb2j.js} +1 -1
  164. package/dist/client/assets/{infra-billing-C7a9CxBG.js → infra-billing-Dmuw8KU-.js} +1 -1
  165. package/dist/client/assets/{input-Dx6Yl3YV.js → input-CEeDInNj.js} +3 -3
  166. package/dist/client/assets/{input-CC2XqVda.js → input-GO29c19t.js} +1 -1
  167. package/dist/client/assets/{integration-icon-YHEiRLgT.js → integration-icon-D0zNx-RJ.js} +1 -1
  168. package/dist/client/assets/{jira-icon-i9apovX2.js → jira-icon-DvLH7QI5.js} +1 -1
  169. package/dist/client/assets/{label-CsyEQPG4.js → label-BqTE8eVe.js} +1 -1
  170. package/dist/client/assets/{layout-BT112QdT.js → layout-DpqY7e7r.js} +1 -1
  171. package/dist/client/assets/{legacy-agents-deep-HgU3c2Dz.js → legacy-agents-deep-XW7PcOvc.js} +1 -1
  172. package/dist/client/assets/{legacy-main-redirect-jScx_XSf.js → legacy-main-redirect-BlcRg6jU.js} +1 -1
  173. package/dist/client/assets/library-BCn7yrRw.js +1 -0
  174. package/dist/client/assets/{library-tab-9158ORpA.js → library-tab-DX4N_54U.js} +1 -1
  175. package/dist/client/assets/{login-OE28YT2s.js → login-D_5_-2-7.js} +1 -1
  176. package/dist/client/assets/{markdown-TXCHEe-4.js → markdown-Wx3jaxrX.js} +1 -1
  177. package/dist/client/assets/{mcp-app-renderer-BAlCN3Lv.js → mcp-app-renderer-CIdjohnw.js} +1 -1
  178. package/dist/client/assets/{mcp-oauth-CuU6LL15.js → mcp-oauth-BqOO-7HR.js} +1 -1
  179. package/dist/client/assets/{mcp-oauth-BFqNJ-iQ.js → mcp-oauth-CP7f2bqu.js} +1 -1
  180. package/dist/client/assets/{members-CbEEa2ua.js → members-CWfNsRhJ.js} +1 -1
  181. package/dist/client/assets/{memory-malk94i-.js → memory-CBEItIQh.js} +1 -1
  182. package/dist/client/assets/{mini-report-page-Dhes7qGv.js → mini-report-page-BUjMh7u3.js} +1 -1
  183. package/dist/client/assets/{mock-board-B4GBU96k.js → mock-board-Ci5UecWv.js} +1 -1
  184. package/dist/client/assets/{monaco-editor-DIn5LVAo.js → monaco-editor-uL7EgDLV.js} +1 -1
  185. package/dist/client/assets/{monitoring-stats-row-CsXWM1-N.js → monitoring-stats-row-CTBvl4CT.js} +1 -1
  186. package/dist/client/assets/{multi-select-jv5l4gKB.js → multi-select-Dsayixmw.js} +1 -1
  187. package/dist/client/assets/{mustache-C3mAjW3w.js → mustache-CdAmmkEb.js} +1 -1
  188. package/dist/client/assets/{new-project-dialog-DCPZVRuS.js → new-project-dialog-C2CawYle.js} +1 -1
  189. package/dist/client/assets/{oauth-callback-C7bM7rgT.js → oauth-callback-Cr6Mkw-S.js} +1 -1
  190. package/dist/client/assets/{oauth-callback-ai-provider-maa6Zm5e.js → oauth-callback-ai-provider-3XAXL_LG.js} +1 -1
  191. package/dist/client/assets/{onboarding-ds1UbiQ9.js → onboarding-Cr8prmNS.js} +1 -1
  192. package/dist/client/assets/{openai-conversation-BSvbWT0F.js → openai-conversation-CqdQkpbG.js} +1 -1
  193. package/dist/client/assets/{optimistic-project-sidebar-views-2rlAyeqj.js → optimistic-project-sidebar-views-CqtTgCjK.js} +1 -1
  194. package/dist/client/assets/{order-monitor-day-CZG8_Uqo.js → order-monitor-day-xXzJoCon.js} +1 -1
  195. package/dist/client/assets/{organization-choice-CGGV7pYx.js → organization-choice-ysHevYPz.js} +1 -1
  196. package/dist/client/assets/{orgs-DSh5ncFV.js → orgs-DdXSSyy_.js} +1 -1
  197. package/dist/client/assets/{page-seo-form-BPMiXtW-.js → page-seo-form--GeHG2Y7.js} +1 -1
  198. package/dist/client/assets/{pair-C9IKm4JE.js → pair-BRzx8V28.js} +1 -1
  199. package/dist/client/assets/{plan-ladder-DbkDT52b.js → plan-ladder-DEcsqAHq.js} +1 -1
  200. package/dist/client/assets/{popover-CzNTcDJM.js → popover-DBhjt7xF.js} +1 -1
  201. package/dist/client/assets/{post-calendar-DGIFZvru.js → post-calendar-BBgMihhC.js} +1 -1
  202. package/dist/client/assets/{post-editor-BINaZa6q.js → post-editor-D6Q9G6HD.js} +1 -1
  203. package/dist/client/assets/{preview-content-BjX4Mivy.js → preview-content-B8gytc3A.js} +1 -1
  204. package/dist/client/assets/{preview-dialog-C8Boj2eR.js → preview-dialog-Du8s313b.js} +1 -1
  205. package/dist/client/assets/{preview-panel-BTtWNKn9.js → preview-panel-lv7hIcbh.js} +1 -1
  206. package/dist/client/assets/{preview-tab-BYhuHpLV.js → preview-tab-OUmlHA2w.js} +3 -3
  207. package/dist/client/assets/{product-picker-dialog-qxyRXjlS.js → product-picker-dialog-Vi9M9XbY.js} +1 -1
  208. package/dist/client/assets/{profile-Cgb34CQu.js → profile-rjLUYrke.js} +1 -1
  209. package/dist/client/assets/{project-app-view-B5MD1o9B.js → project-app-view-ChI-tWmY.js} +1 -1
  210. package/dist/client/assets/{project-feed-DnDlefHV.js → project-feed-DSYFIf9h.js} +1 -1
  211. package/dist/client/assets/{project-icon-CP0m7tWm.js → project-icon-DEfb1G5F.js} +1 -1
  212. package/dist/client/assets/project-reports-CSI1uE8Z.js +1 -0
  213. package/dist/client/assets/project-tasks-DxRsaOWu.js +1 -0
  214. package/dist/client/assets/{projects-DmCmaniu.js → projects-CtrF1Zf3.js} +1 -1
  215. package/dist/client/assets/{projects-empty-state-fIhR2Z5I.js → projects-empty-state-Cebygjnd.js} +1 -1
  216. package/dist/client/assets/{prompts-CW5UUH65.js → prompts-BVXX6Xql.js} +1 -1
  217. package/dist/client/assets/record-editor-CCo2C6Wx.js +1 -0
  218. package/dist/client/assets/{redirect-editor-CxJl2CVJ.js → redirect-editor-DIAc_1Im.js} +1 -1
  219. package/dist/client/assets/{reports-BXGEiRjn.js → reports-Du7byUHW.js} +1 -1
  220. package/dist/client/assets/reports-MoZoLp_a.js +1 -0
  221. package/dist/client/assets/{reports-onboarding-DNEAbZJV.js → reports-onboarding-Ds-Ispiz.js} +1 -1
  222. package/dist/client/assets/{reports-tab-CwK-fp7x.js → reports-tab-ChePuZZ4.js} +2 -2
  223. package/dist/client/assets/{repositories-ClghJilC.js → repositories-BTxz09bM.js} +1 -1
  224. package/dist/client/assets/{repository-binding-BYnKmLVI.js → repository-binding-DTzReh06.js} +1 -1
  225. package/dist/client/assets/{repository-import-picker-De4qAOck.js → repository-import-picker-CUpsn0UU.js} +1 -1
  226. package/dist/client/assets/{repository-picker-B7BUYgB7.js → repository-picker-liId9_zf.js} +1 -1
  227. package/dist/client/assets/{require-capability-hn1SreP5.js → require-capability-CfedINkj.js} +1 -1
  228. package/dist/client/assets/{required-auth-layout-Mqzz7XgH.js → required-auth-layout-CZd2SYeJ.js} +1 -1
  229. package/dist/client/assets/{reset-password-BOpvbCSW.js → reset-password-qlKVFcE6.js} +1 -1
  230. package/dist/client/assets/{resizable-DpCFVPH5.js → resizable-D31F4eAS.js} +1 -1
  231. package/dist/client/assets/{resolve-tab-icon-8PRTNpAS.js → resolve-tab-icon-DvCi-XX9.js} +1 -1
  232. package/dist/client/assets/{review-settings-Bw0A1sn1.js → review-settings-ZCONB0R7.js} +1 -1
  233. package/dist/client/assets/{roles-BMCtr4MB.js → roles-C28vWKZO.js} +1 -1
  234. package/dist/client/assets/{route-DnP6JRb8.js → route-BNyTQhdC.js} +1 -1
  235. package/dist/client/assets/{route-DLSqOpoM.js → route-Jtrcqjic.js} +1 -1
  236. package/dist/client/assets/route-dcUraDhg.js +1 -0
  237. package/dist/client/assets/{sandbox-lifecycle-context-Dg7K5ioC.js → sandbox-lifecycle-context-BSXgRctA.js} +1 -1
  238. package/dist/client/assets/{schema-D-qEbXZ-.js → schema-Bn8rqd_f.js} +1 -1
  239. package/dist/client/assets/{schema-zU96PUAb.js → schema-D1LjZYZ_.js} +1 -1
  240. package/dist/client/assets/{scroll-area-D_ro8hTm.js → scroll-area-Cvpjc0l0.js} +1 -1
  241. package/dist/client/assets/{search-input-qNQGHbDh.js → search-input-CvytUoQu.js} +1 -1
  242. package/dist/client/assets/{search-toggle-Dfh8XGYH.js → search-toggle-DWczizY_.js} +1 -1
  243. package/dist/client/assets/{secret-ciphertext-DkD2R7dc.js → secret-ciphertext-BOjfqnbQ.js} +1 -1
  244. package/dist/client/assets/{secret-picker-CmVVvqgZ.js → secret-picker-DR8k8utG.js} +1 -1
  245. package/dist/client/assets/{secrets-BDW-A1kb.js → secrets-B26-rytL.js} +1 -1
  246. package/dist/client/assets/{sections-editor-BKmXdadO.js → sections-editor-DIXfWh89.js} +1 -1
  247. package/dist/client/assets/{select-C4iThYr6.js → select-B9xwWJY1.js} +1 -1
  248. package/dist/client/assets/{select-model-BND792Uy.js → select-model-BISIL0Kz.js} +1 -1
  249. package/dist/client/assets/{seo-editor-ClpJZQda.js → seo-editor-BlwDgWbu.js} +1 -1
  250. package/dist/client/assets/{separator-DYHY_XVB.js → separator-fhIOQ41X.js} +1 -1
  251. package/dist/client/assets/{settings-tab-A8T1BHYG.js → settings-tab-msJQpCfG.js} +1 -1
  252. package/dist/client/assets/{sheet-BXRHJIP3.js → sheet-Rjoe19XZ.js} +1 -1
  253. package/dist/client/assets/{shell-layout-BhM3Q_22.js → shell-layout-fqXaSGsn.js} +1 -1
  254. package/dist/client/assets/site-editor-DZgKAtXf.js +1 -0
  255. package/dist/client/assets/{site-editor-toast-DPPGE5LH.js → site-editor-toast-CKw1dZ19.js} +1 -1
  256. package/dist/client/assets/{skills-Kw1j3-7B.js → skills-C7DkipJu.js} +1 -1
  257. package/dist/client/assets/{slider-CpU4rmfX.js → slider-CHDMj7-G.js} +1 -1
  258. package/dist/client/assets/{sortable.esm-CBSg5QWi.js → sortable.esm-Dys0-jaI.js} +1 -1
  259. package/dist/client/assets/{sso-GSEhvAQ2.js → sso-cg0TfFU1.js} +1 -1
  260. package/dist/client/assets/{suggestion-BPVDnpZj.js → suggestion-DpmKDRpP.js} +1 -1
  261. package/dist/client/assets/{switch-63WSXheM.js → switch-Dyv9YUWT.js} +1 -1
  262. package/dist/client/assets/{symbol-rviHpBrN.js → symbol-BK6V8ZzP.js} +1 -1
  263. package/dist/client/assets/{synced-repos-D3YnOlYC.js → synced-repos-DpQU86pc.js} +1 -1
  264. package/dist/client/assets/{tab-icon-glyph-Dqe-yN6V.js → tab-icon-glyph-KVUtF-xE.js} +1 -1
  265. package/dist/client/assets/{table-CLaOCONQ.js → table-9i0Xw8tZ.js} +1 -1
  266. package/dist/client/assets/{tabs-BQUPeDjf.js → tabs-h2gBBRzw.js} +1 -1
  267. package/dist/client/assets/{task-board-DxxiAR5A.js → task-board-AWLuhkrp.js} +1 -1
  268. package/dist/client/assets/{task-route-Ce6MTE8h.js → task-route-BfCPNuEb.js} +1 -1
  269. package/dist/client/assets/{task-status-CMbp-PaL.js → task-status-C0Jba3Xb.js} +1 -1
  270. package/dist/client/assets/taskboard-analytics-DOVTfSds.js +1 -0
  271. package/dist/client/assets/{tasks-BarD4hla.js → tasks-B3wC6JY6.js} +1 -1
  272. package/dist/client/assets/tasks-DhO2f9o0.js +1 -0
  273. package/dist/client/assets/{textarea-CxYAsAPe.js → textarea-7aD59y1C.js} +1 -1
  274. package/dist/client/assets/{thread-analytics-Cjx1orRq.js → thread-analytics-B5RrlZAS.js} +1 -1
  275. package/dist/client/assets/{thread-intent-DikZOwd-.js → thread-intent-YA4iB4rg.js} +1 -1
  276. package/dist/client/assets/{thread-route-CRU_aqN9.js → thread-route-B90y2Ttt.js} +1 -1
  277. package/dist/client/assets/{thread-route-ChugAIRh.js → thread-route-BgOTv3tU.js} +1 -1
  278. package/dist/client/assets/{thread-sheet-body-DfFj6DBB.js → thread-sheet-body-DBmCCiJG.js} +1 -1
  279. package/dist/client/assets/{time-range-picker-Bf6M5ihN.js → time-range-picker-CWWLy_3R.js} +1 -1
  280. package/dist/client/assets/{toggle-group-DbSldXZX.js → toggle-group-DRNkGgUT.js} +1 -1
  281. package/dist/client/assets/{tool-namespace-pIFYrei5.js → tool-namespace-C83WlsNL.js} +1 -1
  282. package/dist/client/assets/{toolbar-icon-button-B24Twz-b.js → toolbar-icon-button-Bt6CBlAy.js} +1 -1
  283. package/dist/client/assets/{tooltip-Bs0EJaD7.js → tooltip-Djfj4yvo.js} +1 -1
  284. package/dist/client/assets/{tooltipContext-fXkDpiI8.js → tooltipContext-B0xkDjO4.js} +1 -1
  285. package/dist/client/assets/{track-BzGhLw1A.js → track-aEjANf-j.js} +1 -1
  286. package/dist/client/assets/{types-IpdOmnYx.js → types-DSQN8Y9X.js} +1 -1
  287. package/dist/client/assets/{url-slug-CMCbwnaP.js → url-slug-DNuO5vGK.js} +1 -1
  288. package/dist/client/assets/{usage-stats-DuvxTL2m.js → usage-stats-BXR_QJg-.js} +1 -1
  289. package/dist/client/assets/{use-ai-providers-Becg3IYt.js → use-ai-providers-CS760siL.js} +1 -1
  290. package/dist/client/assets/{use-app-takeover-DFb1RzQs.js → use-app-takeover-BiROkfIG.js} +1 -1
  291. package/dist/client/assets/{use-automations-Cp9pysoO.js → use-automations-C8HNZgvV.js} +1 -1
  292. package/dist/client/assets/{use-autosave-C5CskRdQ.js → use-autosave-DiQgKPVz.js} +1 -1
  293. package/dist/client/assets/{use-chat-navigation-BJSvg7rH.js → use-chat-navigation-CkUks0CI.js} +1 -1
  294. package/dist/client/assets/{use-clock-tick-B1PaG9d4.js → use-clock-tick-D9Y3YKA4.js} +1 -1
  295. package/dist/client/assets/{use-connect-companion-ClLk9Ret.js → use-connect-companion-Dh2GSI2w.js} +1 -1
  296. package/dist/client/assets/{use-connection-CLmhN_H7.js → use-connection-CYm-Vxmx.js} +1 -1
  297. package/dist/client/assets/{use-copy-T3xwaExj.js → use-copy-C0ICuN7j.js} +1 -1
  298. package/dist/client/assets/{use-create-virtual-mcp-CVTk_yNo.js → use-create-virtual-mcp-iJVLGT10.js} +1 -1
  299. package/dist/client/assets/{use-date-fns-locale-CYDYn543.js → use-date-fns-locale-BEXRTRYo.js} +1 -1
  300. package/dist/client/assets/{use-debounced-autosave-8fEcHiWI.js → use-debounced-autosave-Z24y5bHD.js} +1 -1
  301. package/dist/client/assets/{use-debounced-value-d254MtLc.js → use-debounced-value-Tstd89O2.js} +1 -1
  302. package/dist/client/assets/{use-deco-credits-BJdkVUlJ.js → use-deco-credits-a2fVSYw4.js} +1 -1
  303. package/dist/client/assets/{use-decopilot-events-D42PqykU.js → use-decopilot-events-B59p52EB.js} +1 -1
  304. package/dist/client/assets/{use-delete-connection-Bp41mUbu.js → use-delete-connection-CjcSXnbW.js} +1 -1
  305. package/dist/client/assets/{use-deployment-admin-Cz36UM7j.js → use-deployment-admin-gB6Ubqa0.js} +1 -1
  306. package/dist/client/assets/{use-ensure-project-folder-DV9pI0pa.js → use-ensure-project-folder-DakHhVfG.js} +1 -1
  307. package/dist/client/assets/{use-fast-preview-draft-url-Dbj9pvCB.js → use-fast-preview-draft-url-BElMJQru.js} +1 -1
  308. package/dist/client/assets/{use-file-configs-D_kGDRPd.js → use-file-configs-CMXUzCw9.js} +1 -1
  309. package/dist/client/assets/{use-infinite-scroll-C47I-wuH.js → use-infinite-scroll-Bkeb3Emc.js} +1 -1
  310. package/dist/client/assets/{use-join-requests-Cy3hlZv5.js → use-join-requests-Bt9kCP2g.js} +1 -1
  311. package/dist/client/assets/{use-main-panel-tabs-DjhEbRyd.js → use-main-panel-tabs-DiN00eBp.js} +1 -1
  312. package/dist/client/assets/{use-mcp-auth-status-5SUSMsp-.js → use-mcp-auth-status-C8SSMyOQ.js} +1 -1
  313. package/dist/client/assets/{use-mcp-client-CEKqqblF.js → use-mcp-client-DXWvBBzU.js} +1 -1
  314. package/dist/client/assets/{use-mcp-prompts-CwF-bqUg.js → use-mcp-prompts-D5_raFI0.js} +1 -1
  315. package/dist/client/assets/{use-mcp-tools-_07-mu_D.js → use-mcp-tools-BA7tqEjQ.js} +1 -1
  316. package/dist/client/assets/{use-members-CFcpHrvE.js → use-members-CBJHrFbr.js} +1 -1
  317. package/dist/client/assets/{use-mobile-CYsZ0F3X.js → use-mobile-DVlrjJnR.js} +1 -1
  318. package/dist/client/assets/{use-navigate-to-agent-DNsHLJD8.js → use-navigate-to-agent-zweZgwVY.js} +1 -1
  319. package/dist/client/assets/{use-open-billing-url-C1m0KS6b.js → use-open-billing-url-CZCPBR61.js} +1 -1
  320. package/dist/client/assets/{use-org-auth-client-9ZqTxhaU.js → use-org-auth-client-QUHxqp7u.js} +1 -1
  321. package/dist/client/assets/{use-org-fs-Wo4_O8nn.js → use-org-fs-ZG2jF1ev.js} +1 -1
  322. package/dist/client/assets/{use-org-repo-syncs-HjlHy8Rb.js → use-org-repo-syncs-BkNHAu91.js} +1 -1
  323. package/dist/client/assets/{use-org-sso-BSkklN8h.js → use-org-sso-BY7vua13.js} +1 -1
  324. package/dist/client/assets/{use-organization-roles-Dga2ANZJ.js → use-organization-roles-BX0bRQ46.js} +1 -1
  325. package/dist/client/assets/{use-organization-settings-DHSMN_14.js → use-organization-settings-DrbkHsVi.js} +1 -1
  326. package/dist/client/assets/{use-panel-navigate-62gIHptt.js → use-panel-navigate-CgLeC7oT.js} +1 -1
  327. package/dist/client/assets/{use-project-native-view-presence-D12oGF6A.js → use-project-native-view-presence-FuvDcd3j.js} +1 -1
  328. package/dist/client/assets/{use-project-scope-Dk4Q60O6.js → use-project-scope-Mbz61u0U.js} +1 -1
  329. package/dist/client/assets/{use-recent-apps-CCwo686W.js → use-recent-apps-ByE0IPMO.js} +1 -1
  330. package/dist/client/assets/{use-releases-wK1mECcA.js → use-releases-Cn9YGFYD.js} +1 -1
  331. package/dist/client/assets/{use-reports-diagnostic-CfPcDRof.js → use-reports-diagnostic-CNH6bT_s.js} +1 -1
  332. package/dist/client/assets/{use-secrets-Cmhjz2bf.js → use-secrets-BdA07xp7.js} +1 -1
  333. package/dist/client/assets/{use-section-preview-base-DJFgOhQZ.js → use-section-preview-base-BGUJwyF6.js} +1 -1
  334. package/dist/client/assets/{use-tags-D0LqZNOI.js → use-tags-RK2ALcRH.js} +1 -1
  335. package/dist/client/assets/{use-task-board-analytics-BpQqtB1w.js → use-task-board-analytics-Lm2x_Ld6.js} +1 -1
  336. package/dist/client/assets/{use-task-board-events-BrTJpTlj.js → use-task-board-events-CwaYpBZ3.js} +1 -1
  337. package/dist/client/assets/{use-task-board-item-prs-BHRZFWqk.js → use-task-board-item-prs-DuoDCPJm.js} +1 -1
  338. package/dist/client/assets/{use-task-board-items-CZjiF2uB.js → use-task-board-items-C9iR5m8M.js} +1 -1
  339. package/dist/client/assets/{use-task-metadata-Bef5UioD.js → use-task-metadata-BOySMSW9.js} +1 -1
  340. package/dist/client/assets/{use-thread-analytics-CiJumHRj.js → use-thread-analytics-B-6hcr7K.js} +1 -1
  341. package/dist/client/assets/{use-thread-outputs-BVEM1vsy.js → use-thread-outputs-Bnh-FZdC.js} +1 -1
  342. package/dist/client/assets/useInfiniteQuery-9rJQjSuN.js +1 -0
  343. package/dist/client/assets/{useQueries-D52x651p.js → useQueries-BWCAInNJ.js} +1 -1
  344. package/dist/client/assets/useSuspenseInfiniteQuery-xLkb2FEg.js +1 -0
  345. package/dist/client/assets/{users-DfEzbgjc.js → users-BSQM-sro.js} +1 -1
  346. package/dist/client/assets/{utils-DVs-Bhj-.js → utils-aJ0jY1W-.js} +1 -1
  347. package/dist/client/assets/{variant-calendar-B4damr_G.js → variant-calendar-CHK_OU2h.js} +1 -1
  348. package/dist/client/assets/{variant-draft-pointer-BnxZeLy_.js → variant-draft-pointer-1dv3zT6b.js} +1 -1
  349. package/dist/client/assets/{view-mode-toggle-DKlegHXH.js → view-mode-toggle-C14-toNe.js} +1 -1
  350. package/dist/client/assets/{virtual-mcp-UT0zZzHO.js → virtual-mcp-QuhvrKMt.js} +1 -1
  351. package/dist/client/assets/{watch-sse-pool-BdkzrgTO.js → watch-sse-pool-CWMRkqIp.js} +1 -1
  352. package/dist/client/index.html +1 -1
  353. package/dist/server/server.js +1 -1
  354. package/package.json +2 -2
  355. package/dist/client/assets/agent-app-DBSthuoA.js +0 -1
  356. package/dist/client/assets/agent-deck-DW69LMk-.js +0 -1
  357. package/dist/client/assets/agent-library-D9aAC92j.js +0 -1
  358. package/dist/client/assets/agent-library-file-Dlq-Vts6.js +0 -1
  359. package/dist/client/assets/agent-settings-5EOlZJW6.js +0 -1
  360. package/dist/client/assets/agent-site-editor-code-I8N3vaXE.js +0 -2
  361. package/dist/client/assets/agent-site-editor-content-uhd8Bnc-.js +0 -1
  362. package/dist/client/assets/agent-site-editor-preview-CV5DbDBm.js +0 -1
  363. package/dist/client/assets/agent-view-QNUTYcIi.js +0 -1
  364. package/dist/client/assets/api-keys-BgtInlXe.js +0 -1
  365. package/dist/client/assets/cms-settings-editor-BB3l1bfM.js +0 -1
  366. package/dist/client/assets/file-share-button-BX7_JCXp.js +0 -3
  367. package/dist/client/assets/flat-project-XWFiDywx.js +0 -1
  368. package/dist/client/assets/library-CWV47kSp.js +0 -1
  369. package/dist/client/assets/project-reports-8XAuspn6.js +0 -1
  370. package/dist/client/assets/project-tasks-CGbl7DTy.js +0 -1
  371. package/dist/client/assets/record-editor--8X4AXV_.js +0 -1
  372. package/dist/client/assets/reports-eZ_It7qc.js +0 -1
  373. package/dist/client/assets/route-yiouOCXy.js +0 -1
  374. package/dist/client/assets/site-editor-LulM9jUZ.js +0 -1
  375. package/dist/client/assets/taskboard-analytics-_ZvfL2sj.js +0 -1
  376. package/dist/client/assets/tasks-DcunZstc.js +0 -1
  377. package/dist/client/assets/useInfiniteQuery-S3a_-GqY.js +0 -1
  378. package/dist/client/assets/useSuspenseInfiniteQuery-DiRI5XkI.js +0 -1
@@ -1,8 +1,8 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/app-editor-BqvAOKlk.js","assets/index-BoB02eW2.js","assets/index-m9hX09uY.css","assets/chat-context-C4pDshj1.js","assets/use-panel-navigate-62gIHptt.js","assets/thread-route-CRU_aqN9.js","assets/use-project-scope-Dk4Q60O6.js","assets/repository-binding-BYnKmLVI.js","assets/use-mcp-client-CEKqqblF.js","assets/auth-BeK8rRbB.js","assets/autosend-B-VPnrp2.js","assets/thread-intent-DikZOwd-.js","assets/delay-CnY5UFtP.js","assets/backoff-CrEUbyZT.js","assets/watch-sse-pool-BdkzrgTO.js","assets/task-board-DxxiAR5A.js","assets/schema-zU96PUAb.js","assets/slugify-CEUa2lfQ.js","assets/use-decopilot-events-D42PqykU.js","assets/use-ai-providers-Becg3IYt.js","assets/use-chat-navigation-BJSvg7rH.js","assets/location-BjlyegC2.js","assets/use-organization-settings-DHSMN_14.js","assets/scroll-area-D_ro8hTm.js","assets/index-BdQq_4o_.js","assets/use-section-preview-base-DJFgOhQZ.js","assets/UserSquare-0R6kuy9W.js","assets/agent-icon-Bmu0Xuy8.js","assets/AlertCircle-BFUZ4yx0.js","assets/Tool01-CvAlZ6_R.js","assets/ArrowUp-U6_gobY2.js","assets/ArrowLeft-CK2OAC0l.js","assets/LinkBroken01-Vuoqu_ZW.js","assets/ShoppingBag01-dI1cRqeE.js","assets/ZoomOut-C1rwTYBB.js","assets/Building02-Ddm6hNyu.js","assets/CheckCircle-BWW06ZXQ.js","assets/ChevronUp-CTrNq9Nk.js","assets/ChevronSelectorVertical-DKcwgXpF.js","assets/Copy01-TJP2zB12.js","assets/CreditCard01-Bm6_xB5H.js","assets/DotsVertical-DKl8j3BE.js","assets/Image01-Cf_YxPro.js","assets/Globe04-ClrCqE7c.js","assets/SwitchHorizontal01-KDjTaTLX.js","assets/Key01-55Z6tHcr.js","assets/Link01-DNXOSsg9.js","assets/Monitor01-C-mB2rao.js","assets/Sun-BPl8u-yx.js","assets/Play-CUFyJJIt.js","assets/Plus-D-GSl2MA.js","assets/SearchMd-CkV8MM4H.js","assets/Trash01-BzUZQR5Y.js","assets/Upload01-CdgDB-zC.js","assets/User01-CinpYulR.js","assets/Users01-DFSTtPtZ.js","assets/XClose-CXxsMd9c.js","assets/blocks-tab-states-B7_Q2Byx.js","assets/site-editor-toast-DPPGE5LH.js","assets/input-Dx6Yl3YV.js","assets/usage-stats-DuvxTL2m.js","assets/tool-namespace-pIFYrei5.js","assets/form-Dz-wry37.js","assets/label-CsyEQPG4.js","assets/utils-CVEq3hMx.js","assets/markdown-TXCHEe-4.js","assets/use-copy-T3xwaExj.js","assets/use-mobile-CYsZ0F3X.js","assets/tooltip-Bs0EJaD7.js","assets/index-DSuQX-Dj.js","assets/format-time-CAj8AQXM.js","assets/differenceInSeconds-C3x8sHUj.js","assets/icon-button-BbQESQAz.js","assets/file-type-icon-C2WSm6EM.js","assets/shell-layout-BhM3Q_22.js","assets/avatar-yCbsNNbw.js","assets/use-clock-tick-B1PaG9d4.js","assets/command-BSGZ-TwS.js","assets/index-BhuMySoe.js","assets/integration-icon-YHEiRLgT.js","assets/project-icon-CP0m7tWm.js","assets/new-project-dialog-DCPZVRuS.js","assets/repository-import-picker-De4qAOck.js","assets/use-navigate-to-agent-DNsHLJD8.js","assets/repository-picker-B7BUYgB7.js","assets/useInfiniteQuery-S3a_-GqY.js","assets/infiniteQueryObserver-BuOPvaCd.js","assets/collection-search-sopr7ssV.js","assets/use-debounced-value-d254MtLc.js","assets/required-auth-layout-Mqzz7XgH.js","assets/use-org-sso-BSkklN8h.js","assets/shell-layout-CE2Eihra.css","assets/chat-draft-D5dlb_sl.js","assets/select-C4iThYr6.js","assets/tabs-BQUPeDjf.js","assets/use-deco-credits-BJdkVUlJ.js","assets/toggle-group-DbSldXZX.js","assets/use-open-billing-url-C1m0KS6b.js","assets/index-DuSo48nd.js","assets/checkbox-C2l5tKo2.js","assets/ai-providers-logos-DD3qZ33J.js","assets/popover-CzNTcDJM.js","assets/drawer-BpEasqMM.js","assets/input-CC2XqVda.js","assets/suggestion-BPVDnpZj.js","assets/use-project-native-view-presence-D12oGF6A.js","assets/use-file-configs-D_kGDRPd.js","assets/site-slug-DebpOoQq.js","assets/use-mcp-prompts-CwF-bqUg.js","assets/use-org-fs-Wo4_O8nn.js","assets/question-004-sINsf4GQ.js","assets/use-members-CFcpHrvE.js","assets/use-org-auth-client-9ZqTxhaU.js","assets/feature-paywall-HnwykYzM.js","assets/plan-ladder-DbkDT52b.js","assets/add-connection-dialog-CNB1XZS8.js","assets/extract-connection-data-CyaR6DQN.js","assets/metadata-D72DunRR.js","assets/connection-B0eFNfCu.js","assets/url-slug-CMCbwnaP.js","assets/connection-card-BzTYJa6s.js","assets/connection-slug-CITJ0kGN.js","assets/textarea-CxYAsAPe.js","assets/use-connection-CLmhN_H7.js","assets/schema-D-qEbXZ-.js","assets/connection-form-helpers-ChgreO5F.js","assets/authenticate-and-persist-oauth-DJwJCiC8.js","assets/mcp-oauth-BFqNJ-iQ.js","assets/mcp-oauth-CuU6LL15.js","assets/collection-tabs-DU5QTifc.js","assets/badge-Zdi_g359.js","assets/use-infinite-scroll-C47I-wuH.js","assets/useSuspenseInfiniteQuery-DiRI5XkI.js","assets/use-task-board-events-BrTJpTlj.js","assets/input-Bwd_JSM8.css","assets/sandbox-url-D3mC8qhT.js","assets/utils-DVs-Bhj-.js","assets/index-Cdsu1Nw_.js","assets/pair-C9IKm4JE.js","assets/collapsible-CDZFoOK-.js","assets/content-blocks-o63cs2vh.js","assets/mcp-app-renderer-BAlCN3Lv.js","assets/types-IpdOmnYx.js","assets/omit-sandbox-map-jj4lCB2U.js","assets/sheet-BXRHJIP3.js","assets/use-thread-outputs-BVEM1vsy.js","assets/sandbox-git-api-CRxdlhrN.js","assets/sandbox-start-errors-BK_aDCyt.js","assets/secret-ciphertext-DkD2R7dc.js","assets/alert-CnRQ3m-7.js","assets/switch-63WSXheM.js","assets/monaco-editor-DIn5LVAo.js","assets/editor-DQK8Gbky.js","assets/calendar-aMW3a7Qx.js","assets/editor-classes-wKHzvXkJ.js","assets/core.esm-CWXW2IWJ.js","assets/sortable.esm-CBSg5QWi.js","assets/view-mode-toggle-DKlegHXH.js","assets/combobox-C2hXpc1p.js","assets/alert-dialog-BaBKldUA.js","assets/search-input-qNQGHbDh.js","assets/asset-utils--N2gsOKr.js","assets/empty-state-GUv-DLNf.js","assets/section-preview-url-7zfngvgW.js","assets/mustache-C3mAjW3w.js","assets/sandbox-lifecycle-context-Dg7K5ioC.js","assets/empty-state-Ck0Y0zH4.js","assets/cms-settings-editor-BB3l1bfM.js","assets/post-editor-BINaZa6q.js","assets/multi-select-jv5l4gKB.js","assets/block-document-D4x1DRNW.js","assets/product-picker-dialog-qxyRXjlS.js","assets/index-BFWcpEys.js","assets/blog-schema-D0r94Mwa.js","assets/use-fast-preview-draft-url-Dbj9pvCB.js","assets/use-autosave-C5CskRdQ.js","assets/record-editor--8X4AXV_.js","assets/context-DEuw9CjH.js","assets/index-qp2WMoaq.js","assets/get-initials-D-f_fDFw.js","assets/category-editor-BYf-_N2d.js","assets/sections-editor-BKmXdadO.js","assets/page-seo-form-BPMiXtW-.js","assets/variant-draft-pointer-BnxZeLy_.js","assets/seo-editor-ClpJZQda.js","assets/variant-calendar-B4damr_G.js","assets/post-calendar-DGIFZvru.js","assets/redirect-editor-CxJl2CVJ.js"])))=>i.map(i=>d[i]);
2
- import{c as re,j as o,m as Ya,K as jn,b as Ce,l as ve,r as F,h as dt,s as ds,v as Ht,I as pt,B as Oe,w as us,q as qt,D as Wt,aM as An,o as Qa,e as Ja,t as pe,a9 as Xa,aS as ns,a$ as Zt,T as Os,aT as Wn,V as Ls,X as $s,aX as En,aN as Za,U as Xe,au as Rs,aw as mn,ap as ei,a2 as ti,u as Oo,aZ as Ge}from"./index-BoB02eW2.js";import{a as Lo}from"./use-organization-settings-DHSMN_14.js";import{u as Ys,c as $o}from"./chat-context-C4pDshj1.js";import{i as is}from"./AlertCircle-BFUZ4yx0.js";import{_ as Ro,B as Yn,$ as Fo,a0 as Dn,a1 as Io,a2 as si,b as Fs,V as Ko,a3 as ni,a4 as oi,a5 as ai,a6 as ii,a7 as Sn,n as ri,a8 as Mo,a9 as li,aa as ci,ab as di,h as Qn,ac as ui,L as zo}from"./agent-icon-Bmu0Xuy8.js";import{a as Vo,s as Is,i as Bn,d as fi,e as Jn}from"./UserSquare-0R6kuy9W.js";import{b as Uo,i as Go}from"./ZoomOut-C1rwTYBB.js";import{c as Ho,i as mi}from"./SwitchHorizontal01-KDjTaTLX.js";import{s as On}from"./Plus-D-GSl2MA.js";import{t as qo}from"./Users01-DFSTtPtZ.js";import{f as pi,e as gi,b as hi,A as xi,a as bi,d as yi,c as vi,g as ji}from"./alert-dialog-BaBKldUA.js";import{S as Qs}from"./scroll-area-D_ro8hTm.js";import{T as qe,a as We,c as Ye}from"./tooltip-Bs0EJaD7.js";import{M as Si,c as ki,u as Ln,w as wi,X as Ci,Y as Ni,Z as _i,N as Xn,_ as Zn,$ as Pi,a0 as Ti,j as Ai,K as Wo,P as Ei,J as Di,L as Bi,b as Oi}from"./site-editor-toast-DPPGE5LH.js";import{n as pn,k as Li,c as $i,g as Yo,B as gn,P as Ri,o as Fi,q as Qo,s as Ii,t as Ki,v as Mi,L as zi,u as Js,l as Vi,w as Ui,R as Gi,x as Jo,r as Hi,y as qi,a as Xo,z as Wi,A as Yi,D as Zo,E as Qi,M as Ji,j as Xi,F as Zi,p as er,G as tr,H as sr,i as nr,d as or,b as ar,f as ir,C as rr,S as lr,I as eo,N as cr}from"./blocks-tab-states-B7_Q2Byx.js";import{x as $n,y as dr,z as Rn,i as ur,A as fr,B as mr,n as Es,v as pr,E as gr,F as hr,e as xr,G as br,H as Fn,g as yr,I as vr,q as to,J as so,K as jr,r as Sr,M as kr,o as wr,O as ea,u as Cr,P as Nr,Q as _r,T as Pr}from"./secret-ciphertext-DkD2R7dc.js";import{u as Tr,P as Ar}from"./mustache-C3mAjW3w.js";import{n as ta}from"./ShoppingBag01-dI1cRqeE.js";import{t as rs}from"./ChevronUp-CTrNq9Nk.js";import{C as Er,a as Dr,b as Br}from"./collapsible-CDZFoOK-.js";import{u as Or}from"./index-Cdsu1Nw_.js";import{b as Lr}from"./sandbox-lifecycle-context-Dg7K5ioC.js";import{a as sa}from"./input-Dx6Yl3YV.js";import{C as Xs}from"./checkbox-C2l5tKo2.js";import{L as ct}from"./label-CsyEQPG4.js";import{c as $r,b as Rr,a as Fr,d as Ir,S as Kr}from"./select-C4iThYr6.js";import{s as Mr}from"./thread-intent-DikZOwd-.js";import{t as zr}from"./sandbox-git-api-CRxdlhrN.js";import{b as no}from"./sandbox-url-D3mC8qhT.js";import{a as oo}from"./utils-DVs-Bhj-.js";import{i as Vr}from"./CheckCircle-BWW06ZXQ.js";import{a as In}from"./Copy01-TJP2zB12.js";import{s as Kn}from"./Trash01-BzUZQR5Y.js";import{i as hn}from"./Upload01-CdgDB-zC.js";import{B as Mn}from"./badge-Zdi_g359.js";import{E as Ur}from"./empty-state-Ck0Y0zH4.js";import{u as Gr}from"./use-ai-providers-Becg3IYt.js";import{T as ao}from"./textarea-CxYAsAPe.js";import{u as Hr}from"./use-file-configs-D_kGDRPd.js";import{MonacoCodeEditor as na}from"./monaco-editor-DIn5LVAo.js";import{c as oa,a as qr}from"./repository-binding-BYnKmLVI.js";import"./core.esm-CWXW2IWJ.js";import"./sortable.esm-CBSg5QWi.js";import{b as Wr}from"./Tool01-CvAlZ6_R.js";import{a as io}from"./use-project-native-view-presence-D12oGF6A.js";import{E as Yr}from"./empty-state-GUv-DLNf.js";import{G as ro}from"./repository-picker-B7BUYgB7.js";import{R as Qr}from"./repository-import-picker-De4qAOck.js";function aa(){return Lo("blog_ai_enabled")}function Jr(t,e){if(!t||!e?.length)return t;const s=Object.fromEntries(Object.entries(t.properties??{}).filter(([n])=>!e.includes(n)));return Object.keys(s).length>0?{...t,properties:s}:t}function Xr(t,e,s){return typeof t!="string"?null:Jr($n(t,e),s)}function ia(t,e,s){if(!e||typeof t!="string")return!1;const n=Xr(t,e,s);return!!n&&Object.keys(n.properties??{}).length>0}const lo="CMS",kn="cms-settings";function Zr(t){const e=t?.manifest?.blocks??{};return Object.values(e).some(s=>!!s&&Object.hasOwn(s,kn))}function Af(t){const e=Object.hasOwn(t,lo)?t[lo]:void 0;if(e==null)return{kind:"absent",block:{__resolveType:kn}};const s=typeof e=="object"&&!Array.isArray(e)?e.__resolveType:void 0;return s!==kn?{kind:"conflict",resolveType:typeof s=="string"?s:""}:{kind:"saved",block:e}}function es(t){const e=re.c(6),{hasItems:s,emptyLabel:n,emptyHint:a}=t;let i;e[0]!==a||e[1]!==n||e[2]!==s?(i=s?"No results match your search.":o.jsxs(o.Fragment,{children:[o.jsx("div",{children:n}),o.jsx("div",{className:"mt-1 text-muted-foreground/80",children:a})]}),e[0]=a,e[1]=n,e[2]=s,e[3]=i):i=e[3];let l;return e[4]!==i?(l=o.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:i}),e[4]=i,e[5]=l):l=e[5],l}function Zs(t,e){return`${t}-${e}`}function ra(t,e){return`site/apps/${t}/${e}.ts`}function la(t){const e=t.match(/^site\/apps\/([^/]+)\/([^/.]+)\.tsx?$/);if(e)return{vendor:e[1],app:e[2]};const s=t.match(/^([^/]+)\/apps\/([^/.]+)\.tsx?$/);return s?{vendor:s[1],app:s[2]}:null}function el(t){const e=t.match(/^([^-]+)-(.+)$/);return e?{vendor:e[1],app:e[2]}:null}function tl(t){return t==="local"?"Custom":"Installed"}function ca(t,e,s){const n=new Set([Zs(t,e),e].map(i=>i.toLowerCase())),a=ra(t,e);for(const[i,l]of Object.entries(s)){if(i.includes("/")||!l||typeof l!="object"||Array.isArray(l))continue;const r=l;if(n.has(i.toLowerCase())||r.__resolveType===a)return i}return null}function sl(t,e){const s=t.vendor.alias,n=t.name,a=ca(s,n,e);return{id:Zs(s,n),app:n,vendor:s,title:t.title||t.name,description:t.description,category:t.category??"Other",logo:t.logo||void 0,resolveType:ra(s,n),blockKey:a,installed:a!==null}}function nl(t,e,s){if(t===dr)return null;const n=la(t);if(!n)return null;const{vendor:a,app:i}=n,l=ca(a,i,s),r=Rn(t,e);return{id:Zs(a,i),app:i,vendor:a,title:r.title??i,description:r.description??"",category:"Others",logo:r.logo??r.icon,resolveType:t,blockKey:l,installed:l!==null}}function ol(t,e,s){const n=e.__resolveType;if(typeof n!="string"||ur(t,e)||!fr(n))return null;const a=la(n)??el(t);if(!a)return null;const i=Rn(n,s),{vendor:l,app:r}=a;return{id:Zs(l,r),app:r,vendor:l,title:i.title??mr(t,e,s),description:i.description??"",category:tl(l),logo:i.logo??i.icon,resolveType:n,blockKey:t,installed:!0}}function al(t,e,s){const n=new Map;for(const i of t){const l=sl(i,s);n.set(l.id,l)}const a=e.manifest?.blocks?.apps??{};for(const i of Object.keys(a)){const l=nl(i,e,s);!l||n.has(l.id)||n.set(l.id,l)}for(const[i,l]of Object.entries(s)){if(i.includes("/")||!l||typeof l!="object"||Array.isArray(l))continue;const r=ol(i,l,e);!r||n.has(r.id)||n.set(r.id,r)}return[...n.values()].sort(il)}function il(t,e){return t.installed!==e.installed?t.installed?-1:1:t.title.localeCompare(e.title)}async function rl(){const t=await fetch("/api/deco-apps");if(!t.ok)throw new Error(`Failed to fetch deco apps: ${t.status}`);return(await t.json()).apps??[]}function ll(t,e,s){const n=re.c(12),a=s?.enabled??!0;let i;n[0]===Symbol.for("react.memo_cache_sentinel")?(i=jn.decoApps(),n[0]=i):i=n[0];let l;n[1]!==a?(l={queryKey:i,queryFn:rl,staleTime:3e5,retry:1,enabled:a},n[1]=a,n[2]=l):l=n[2];const r=Ya(l);let c;n[3]!==e||n[4]!==t||n[5]!==r.data?(c=t&&e?al(r.data??[],t,e):[],n[3]=e,n[4]=t,n[5]=r.data,n[6]=c):c=n[6];const d=c,f=r.isLoading&&!r.isError;let g;return n[7]!==d||n[8]!==r.isError||n[9]!==r.refetch||n[10]!==f?(g={catalog:d,isLoading:f,isError:r.isError,refetch:r.refetch},n[7]=d,n[8]=r.isError,n[9]=r.refetch,n[10]=f,n[11]=g):g=n[11],g}const cl=["sections","apps","loaders","actions"],dl=[];function ul(t){const e=re.c(68),{active:s,counts:n,hidden:a,showBlog:i,showContext:l,onSelect:r}=t,c=a===void 0?dl:a,d=Ce();let f;e[0]!==c?(f=$=>!c.includes($),e[0]=c,e[1]=f):f=e[1];const g=f;let p;e[2]!==d?(p=d("sandbox.collectionsSidebar.content"),e[2]=d,e[3]=p):p=e[3];let u;e[4]!==p?(u=o.jsx("div",{className:"px-3 h-12 flex items-center border-b shrink-0",children:o.jsx("span",{className:"text-sm font-medium",children:p})}),e[4]=p,e[5]=u):u=e[5];let m;e[6]!==d?(m=d("sandbox.collectionsSidebar.pages"),e[6]=d,e[7]=m):m=e[7];const x=s==="pages";let S;e[8]!==n.pages||e[9]!==r||e[10]!==m||e[11]!==x?(S=o.jsx(Fe,{id:"pages",icon:Vo,label:m,count:n.pages,active:x,onSelect:r}),e[8]=n.pages,e[9]=r,e[10]=m,e[11]=x,e[12]=S):S=e[12];let N;e[13]!==d?(N=d("sandbox.collectionsSidebar.redirects"),e[13]=d,e[14]=N):N=e[14];const j=s==="redirects";let b;e[15]!==n.redirects||e[16]!==r||e[17]!==N||e[18]!==j?(b=o.jsx(Fe,{id:"redirects",icon:Ro,label:N,count:n.redirects,active:j,onSelect:r}),e[15]=n.redirects,e[16]=r,e[17]=N,e[18]=j,e[19]=b):b=e[19];let h;e[20]!==s||e[21]!==r||e[22]!==g||e[23]!==d?(h=g("site")&&o.jsx(Fe,{id:"site",icon:Yn,label:d("sandbox.collectionsSidebar.site"),active:s==="site",onSelect:r}),e[20]=s,e[21]=r,e[22]=g,e[23]=d,e[24]=h):h=e[24];let k;e[25]!==d?(k=d("sandbox.collectionsSidebar.seo"),e[25]=d,e[26]=k):k=e[26];const A=s==="seo";let _;e[27]!==r||e[28]!==k||e[29]!==A?(_=o.jsx(Fe,{id:"seo",icon:Io,label:k,active:A,onSelect:r}),e[27]=r,e[28]=k,e[29]=A,e[30]=_):_=e[30];let v;e[31]!==s||e[32]!==r||e[33]!==g||e[34]!==d?(v=g("settings")&&o.jsx(Fe,{id:"settings",icon:Yn,label:d("sandbox.collectionsSidebar.settings"),active:s==="settings",onSelect:r}),e[31]=s,e[32]=r,e[33]=g,e[34]=d,e[35]=v):v=e[35];let E;e[36]!==d?(E=d("sandbox.collectionsSidebar.calendar"),e[36]=d,e[37]=E):E=e[37];const L=s==="calendar";let T;e[38]!==r||e[39]!==E||e[40]!==L?(T=o.jsx(Fe,{id:"calendar",icon:si,label:E,active:L,onSelect:r}),e[38]=r,e[39]=E,e[40]=L,e[41]=T):T=e[41];let D;e[42]!==s||e[43]!==n||e[44]!==r||e[45]!==g?(D=o.jsx(fl,{active:s,counts:n,shown:g,onSelect:r}),e[42]=s,e[43]=n,e[44]=r,e[45]=g,e[46]=D):D=e[46];let P;e[47]!==s||e[48]!==n.authors||e[49]!==n.categories||e[50]!==n.posts||e[51]!==r||e[52]!==i||e[53]!==l||e[54]!==d?(P=i&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"mt-3 flex items-center gap-1.5 px-2.5 pb-1 pt-1 text-xs font-medium text-muted-foreground/70",children:[o.jsx(ta,{size:13,className:"shrink-0"}),d("sandbox.collectionsSidebar.blog")]}),l&&o.jsx(Fe,{id:"context",icon:Is,label:d("sandbox.collectionsSidebar.context"),active:s==="context",onSelect:r}),o.jsx(Fe,{id:"posts",icon:Uo,label:d("sandbox.collectionsSidebar.posts"),count:n.posts,active:s==="posts",onSelect:r}),o.jsx(Fe,{id:"authors",icon:qo,label:d("sandbox.collectionsSidebar.authors"),count:n.authors,active:s==="authors",onSelect:r}),o.jsx(Fe,{id:"categories",icon:Fo,label:d("sandbox.collectionsSidebar.categories"),count:n.categories,active:s==="categories",onSelect:r}),o.jsx(Fe,{id:"post-schedule",icon:Dn,label:d("sandbox.collectionsSidebar.postSchedule"),active:s==="post-schedule",onSelect:r})]}),e[47]=s,e[48]=n.authors,e[49]=n.categories,e[50]=n.posts,e[51]=r,e[52]=i,e[53]=l,e[54]=d,e[55]=P):P=e[55];let B;e[56]!==b||e[57]!==h||e[58]!==_||e[59]!==v||e[60]!==T||e[61]!==D||e[62]!==P||e[63]!==S?(B=o.jsxs("nav",{className:"flex flex-col p-1.5 gap-0.5",children:[S,b,h,_,v,T,D,P]}),e[56]=b,e[57]=h,e[58]=_,e[59]=v,e[60]=T,e[61]=D,e[62]=P,e[63]=S,e[64]=B):B=e[64];let C;return e[65]!==B||e[66]!==u?(C=o.jsxs("div",{className:"w-[208px] shrink-0 border-r flex flex-col",children:[u,B]}),e[65]=B,e[66]=u,e[67]=C):C=e[67],C}function fl(t){const e=re.c(50),{active:s,counts:n,shown:a,onSelect:i}=t,l=Ce();let r;e[0]!==s?(r=cl.includes(s),e[0]=s,e[1]=r):r=e[1];const c=r,[d,f]=F.useState(!1),g=d||c;let p,u;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=ve("flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-left text-sm transition-colors cursor-pointer","text-muted-foreground hover:bg-muted hover:text-foreground"),u=o.jsx(ni,{size:16,className:"shrink-0"}),e[2]=p,e[3]=u):(p=e[2],u=e[3]);let m;e[4]!==l?(m=l("sandbox.collectionsSidebar.advanced"),e[4]=l,e[5]=m):m=e[5];let x;e[6]!==m?(x=o.jsx("span",{className:"flex-1 truncate",children:m}),e[6]=m,e[7]=x):x=e[7];const S=g&&"rotate-180";let N;e[8]!==S?(N=ve("shrink-0 text-muted-foreground/70 transition-transform",S),e[8]=S,e[9]=N):N=e[9];let j;e[10]!==N?(j=o.jsx(rs,{size:16,className:N}),e[10]=N,e[11]=j):j=e[11];let b;e[12]!==x||e[13]!==j?(b=o.jsxs(Er,{className:p,children:[u,x,j]}),e[12]=x,e[13]=j,e[14]=b):b=e[14];let h;e[15]!==l?(h=l("sandbox.collectionsSidebar.sections"),e[15]=l,e[16]=h):h=e[16];const k=s==="sections";let A;e[17]!==n.sections||e[18]!==i||e[19]!==h||e[20]!==k?(A=o.jsx(Fe,{id:"sections",icon:Fs,label:h,count:n.sections,active:k,onSelect:i,indent:!0}),e[17]=n.sections,e[18]=i,e[19]=h,e[20]=k,e[21]=A):A=e[21];let _;e[22]!==s||e[23]!==n.apps||e[24]!==i||e[25]!==a||e[26]!==l?(_=a("apps")&&o.jsx(Fe,{id:"apps",icon:Ho,label:l("sandbox.collectionsSidebar.apps"),count:n.apps,active:s==="apps",onSelect:i,indent:!0}),e[22]=s,e[23]=n.apps,e[24]=i,e[25]=a,e[26]=l,e[27]=_):_=e[27];let v;e[28]!==l?(v=l("sandbox.collectionsSidebar.loaders"),e[28]=l,e[29]=v):v=e[29];const E=s==="loaders";let L;e[30]!==n.loaders||e[31]!==i||e[32]!==v||e[33]!==E?(L=o.jsx(Fe,{id:"loaders",icon:Ko,label:v,count:n.loaders,active:E,onSelect:i,indent:!0}),e[30]=n.loaders,e[31]=i,e[32]=v,e[33]=E,e[34]=L):L=e[34];let T;e[35]!==s||e[36]!==n.actions||e[37]!==i||e[38]!==a||e[39]!==l?(T=a("actions")&&o.jsx(Fe,{id:"actions",icon:Go,label:l("sandbox.collectionsSidebar.actions"),count:n.actions,active:s==="actions",onSelect:i,indent:!0}),e[35]=s,e[36]=n.actions,e[37]=i,e[38]=a,e[39]=l,e[40]=T):T=e[40];let D;e[41]!==A||e[42]!==_||e[43]!==L||e[44]!==T?(D=o.jsxs(Dr,{className:"flex flex-col gap-0.5 pt-0.5",children:[A,_,L,T]}),e[41]=A,e[42]=_,e[43]=L,e[44]=T,e[45]=D):D=e[45];let P;return e[46]!==g||e[47]!==D||e[48]!==b?(P=o.jsxs(Br,{open:g,onOpenChange:f,children:[b,D]}),e[46]=g,e[47]=D,e[48]=b,e[49]=P):P=e[49],P}function Fe(t){const e=re.c(19),{id:s,icon:n,label:a,count:i,active:l,onSelect:r,indent:c}=t;let d;e[0]!==s||e[1]!==r?(d=()=>r(s),e[0]=s,e[1]=r,e[2]=d):d=e[2];const f=c&&"pl-6",g=l?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground";let p;e[3]!==f||e[4]!==g?(p=ve("flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-left text-sm transition-colors cursor-pointer",f,g),e[3]=f,e[4]=g,e[5]=p):p=e[5];let u;e[6]!==n?(u=o.jsx(n,{size:16,className:"shrink-0"}),e[6]=n,e[7]=u):u=e[7];let m;e[8]!==a?(m=o.jsx("span",{className:"flex-1 truncate",children:a}),e[8]=a,e[9]=m):m=e[9];let x;e[10]!==l||e[11]!==i?(x=i!==void 0&&o.jsx("span",{className:ve("shrink-0 text-xs tabular-nums",l?"text-accent-foreground/70":"text-muted-foreground/70"),children:i}),e[10]=l,e[11]=i,e[12]=x):x=e[12];let S;return e[13]!==d||e[14]!==p||e[15]!==u||e[16]!==m||e[17]!==x?(S=o.jsxs("button",{type:"button",onClick:d,className:p,children:[u,m,x]}),e[13]=d,e[14]=p,e[15]=u,e[16]=m,e[17]=x,e[18]=S):S=e[18],S}function ml(t){const e=re.c(12),{state:s,claimPhase:n,lifecycle:a,onStart:i,connectionsHref:l}=t;switch(s.kind){case"starting":{let r;e[0]!==n||e[1]!==a?(r=Li({claimPhase:n,lifecycle:a}),e[0]=n,e[1]=a,e[2]=r):r=e[2];let c;return e[3]!==n||e[4]!==r?(c=o.jsx(pn,{kind:"starting",progress:r,claimPhase:n}),e[3]=n,e[4]=r,e[5]=c):c=e[5],c}case"suspended":{let r;return e[6]!==i?(r=o.jsx(pn,{kind:"suspended",onResume:i}),e[6]=i,e[7]=r):r=e[7],r}case"errored":{let r;return e[8]!==l||e[9]!==i||e[10]!==s.error?(r=o.jsx(pn,{kind:"errored",error:s.error,onRetry:i,connectionsHref:l}),e[8]=l,e[9]=i,e[10]=s.error,e[11]=r):r=e[11],r}}}const pl=new Set(["clone-failed","install-failed","start-failed","crashed"]);function gl(t){if(t.fastPreviewActive)return{kind:"ready",devServerReady:!1,sandboxWarming:!1};if(t.previewState.kind!=="iframe")return{kind:"sandbox-card",state:t.previewState};const e=t.lifecyclePhase==="running",s=!e&&!pl.has(t.lifecyclePhase);return{kind:"ready",devServerReady:e,sandboxWarming:s}}function co(t,e){const s=e.replace(/\s*\(copy(?:\s+\d+)?\)\s*$/,"").trim(),n=`${s} (copy)`;if(!t.has(n))return n;for(let a=2;a<1e3;a++){const i=`${s} (copy ${a})`;if(!t.has(i))return i}return`${s} (copy ${Date.now()})`}function hl(t,e){const s=Es,n=e.replace(/-copy(?:-\d+)?$/,""),a=`${n}-copy`;if(!t.has(s(a)))return a;for(let i=2;i<1e3;i++){const l=`${n}-copy-${i}`;if(!t.has(s(l)))return l}return`${n}-copy-${Date.now()}`}function xl(t,e){const s=e.replace(/_copy(?:_\d+)?$/,""),n=`${s}_copy`;if(!Object.hasOwn(t,n))return n;for(let a=2;a<1e3;a++){const i=`${s}_copy_${a}`;if(!Object.hasOwn(t,i))return i}return`${s}_copy_${Date.now()}`}function bl(t){const e=Yo(t.newName),s={...t.source,name:t.newName,path:t.newPath};return{key:e,data:s}}function yl(t,e){return $i(t,e)}const vl=1e3;function jl(t,e){for(let s=0;s<vl;s++){const n=Yo(e);if(!Object.hasOwn(t,n))return n}throw new Error("Could not generate a unique page block key")}const Sl={create:"sandbox.pageFormDialog.titleCreate",duplicate:"sandbox.pageFormDialog.titleDuplicate",rename:"sandbox.pageFormDialog.titleRename"},kl={create:"sandbox.pageFormDialog.submitCreate",duplicate:"sandbox.pageFormDialog.submitDuplicate",rename:"sandbox.pageFormDialog.submitSave"},wl={create:"sandbox.pageFormDialog.pendingCreate",duplicate:"sandbox.pageFormDialog.pendingDuplicate",rename:"sandbox.pageFormDialog.pendingSave"};function Cl(t){const e=re.c(88),{open:s,mode:n,initialName:a,initialPath:i,isPending:l,error:r,templates:c,validate:d,onSubmit:f,onOpenChange:g}=t,p=l===void 0?!1:l,u=Ce(),[m,x]=F.useState(a),[S,N]=F.useState(i),[j,b]=F.useState(gn),[h,k]=F.useState(null),[A,_]=F.useState(s);s!==A&&(_(s),s&&(x(a),N(i),b(gn),k(null)));const v=n==="create"&&!!c?.length;let E;e[0]!==p||e[1]!==g?(E=ge=>{!ge&&!p&&(k(null),g(!1))},e[0]=p,e[1]=g,e[2]=E):E=e[2];const L=E;let T;e[3]!==p||e[4]!==m||e[5]!==f||e[6]!==S||e[7]!==v||e[8]!==j||e[9]!==d?(T=async ge=>{ge.preventDefault();const he=m.trim(),ye=S.trim();if(!he||!ye||p)return;const _e=pr(ye);if(_e){k(_e);return}const Pe=d?.({name:he,path:ye});if(Pe){k(Pe);return}k(null),await f({name:he,path:ye,templateKey:v&&j!==gn?j:null})},e[3]=p,e[4]=m,e[5]=f,e[6]=S,e[7]=v,e[8]=j,e[9]=d,e[10]=T):T=e[10];const D=T,P=h??r,B=Sl[n];let C;e[11]!==u||e[12]!==B?(C=u(B),e[11]=u,e[12]=B,e[13]=C):C=e[13];let $;e[14]!==C?($=o.jsx(ds,{children:o.jsx(Ht,{children:C})}),e[14]=C,e[15]=$):$=e[15];let V;e[16]!==p||e[17]!==v||e[18]!==u||e[19]!==j||e[20]!==c?(V=v&&o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("label",{htmlFor:"page-form-template",className:"text-xs font-medium text-muted-foreground",children:u("sandbox.pageFormDialog.labelTemplate")}),o.jsx(Ri,{id:"page-form-template",value:j,onChange:b,templates:c??[],disabled:p})]}),e[16]=p,e[17]=v,e[18]=u,e[19]=j,e[20]=c,e[21]=V):V=e[21];let I;e[22]!==u?(I=u("sandbox.pageFormDialog.labelName"),e[22]=u,e[23]=I):I=e[23];let W;e[24]!==I?(W=o.jsx("label",{htmlFor:"page-form-name",className:"text-xs font-medium text-muted-foreground",children:I}),e[24]=I,e[25]=W):W=e[25];let q;e[26]===Symbol.for("react.memo_cache_sentinel")?(q=ge=>x(ge.target.value),e[26]=q):q=e[26];let z;e[27]!==u?(z=u("sandbox.pageFormDialog.placeholderName"),e[27]=u,e[28]=z):z=e[28];let O;e[29]!==p||e[30]!==m||e[31]!==z?(O=o.jsx(pt,{id:"page-form-name",value:m,onChange:q,placeholder:z,autoFocus:!0,disabled:p}),e[29]=p,e[30]=m,e[31]=z,e[32]=O):O=e[32];let Y;e[33]!==O||e[34]!==W?(Y=o.jsxs("div",{className:"space-y-1.5",children:[W,O]}),e[33]=O,e[34]=W,e[35]=Y):Y=e[35];let U;e[36]!==u?(U=u("sandbox.pageFormDialog.labelPath"),e[36]=u,e[37]=U):U=e[37];let Q;e[38]!==U?(Q=o.jsx("label",{htmlFor:"page-form-path",className:"text-xs font-medium text-muted-foreground",children:U}),e[38]=U,e[39]=Q):Q=e[39];let oe;e[40]===Symbol.for("react.memo_cache_sentinel")?(oe=ge=>N(ge.target.value),e[40]=oe):oe=e[40];let ee;e[41]!==u?(ee=u("sandbox.pageFormDialog.placeholderPath"),e[41]=u,e[42]=ee):ee=e[42];let ie;e[43]!==p||e[44]!==S||e[45]!==ee?(ie=o.jsx(pt,{id:"page-form-path",value:S,onChange:oe,placeholder:ee,disabled:p}),e[43]=p,e[44]=S,e[45]=ee,e[46]=ie):ie=e[46];let ae;e[47]!==Q||e[48]!==ie?(ae=o.jsxs("div",{className:"space-y-1.5",children:[Q,ie]}),e[47]=Q,e[48]=ie,e[49]=ae):ae=e[49];let le;e[50]!==P?(le=P&&o.jsx("p",{className:"text-xs text-destructive",children:P}),e[50]=P,e[51]=le):le=e[51];let ce;e[52]!==Y||e[53]!==ae||e[54]!==le||e[55]!==V?(ce=o.jsxs("div",{className:"space-y-4 py-4",children:[V,Y,ae,le]}),e[52]=Y,e[53]=ae,e[54]=le,e[55]=V,e[56]=ce):ce=e[56];let fe;e[57]!==g?(fe=()=>g(!1),e[57]=g,e[58]=fe):fe=e[58];let te;e[59]!==u?(te=u("sandbox.pageFormDialog.buttonCancel"),e[59]=u,e[60]=te):te=e[60];let de;e[61]!==p||e[62]!==fe||e[63]!==te?(de=o.jsx(Oe,{type:"button",variant:"outline",onClick:fe,disabled:p,children:te}),e[61]=p,e[62]=fe,e[63]=te,e[64]=de):de=e[64];let X;e[65]!==p||e[66]!==m||e[67]!==S?(X=!m.trim()||!S.trim()||p,e[65]=p,e[66]=m,e[67]=S,e[68]=X):X=e[68];let ne;e[69]!==p||e[70]!==n||e[71]!==u?(ne=p?o.jsxs(o.Fragment,{children:[o.jsx(dt,{className:"size-3.5"}),u(wl[n])]}):u(kl[n]),e[69]=p,e[70]=n,e[71]=u,e[72]=ne):ne=e[72];let J;e[73]!==X||e[74]!==ne?(J=o.jsx(Oe,{type:"submit",disabled:X,children:ne}),e[73]=X,e[74]=ne,e[75]=J):J=e[75];let w;e[76]!==de||e[77]!==J?(w=o.jsxs(us,{children:[de,J]}),e[76]=de,e[77]=J,e[78]=w):w=e[78];let M;e[79]!==D||e[80]!==ce||e[81]!==w||e[82]!==$?(M=o.jsx(qt,{className:"sm:max-w-md",children:o.jsxs("form",{onSubmit:D,children:[$,ce,w]})}),e[79]=D,e[80]=ce,e[81]=w,e[82]=$,e[83]=M):M=e[83];let me;return e[84]!==L||e[85]!==s||e[86]!==M?(me=o.jsx(Wt,{open:s,onOpenChange:L,children:M}),e[84]=L,e[85]=s,e[86]=M,e[87]=me):me=e[87],me}const Nl=[{value:"temporary",labelKey:"sandbox.redirectEditor.typeTemporary"},{value:"permanent",labelKey:"sandbox.redirectEditor.typePermanent"}],uo={from:"",to:"",type:"temporary",discardQueryParameters:!1};function _l(t){const e=re.c(111),{open:s,isPending:n,error:a,onSubmit:i,onOpenChange:l}=t,r=n===void 0?!1:n,c=Ce(),[d,f]=F.useState(uo),[g,p]=F.useState(null),[u,m]=F.useState(s);s!==u&&(m(s),s&&(f(uo),p(null)));let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=xe=>f(Ae=>({...Ae,...xe})),e[0]=x):x=e[0];const S=x;let N;e[1]!==r||e[2]!==l?(N=xe=>{!xe&&!r&&(p(null),l(!1))},e[1]=r,e[2]=l,e[3]=N):N=e[3];const j=N;let b;e[4]!==r||e[5]!==i||e[6]!==d||e[7]!==c?(b=async xe=>{xe.preventDefault();const Ae=d.from.trim(),Re=d.to.trim();if(!Ae||!Re||r){p(c("sandbox.redirectFormDialog.errorRequired"));return}p(null),await i({...d,from:Ae,to:Re})},e[4]=r,e[5]=i,e[6]=d,e[7]=c,e[8]=b):b=e[8];const h=b,k=g??a;let A;e[9]!==r||e[10]!==d.from||e[11]!==d.to?(A=!!d.from.trim()&&!!d.to.trim()&&!r,e[9]=r,e[10]=d.from,e[11]=d.to,e[12]=A):A=e[12];const _=A;let v;e[13]!==c?(v=c("sandbox.redirectFormDialog.title"),e[13]=c,e[14]=v):v=e[14];let E;e[15]!==v?(E=o.jsx(ds,{children:o.jsx(Ht,{children:v})}),e[15]=v,e[16]=E):E=e[16];let L;e[17]!==c?(L=c("sandbox.redirectEditor.fromLabel"),e[17]=c,e[18]=L):L=e[18];let T;e[19]!==L?(T=o.jsx(ct,{htmlFor:"redirect-form-from",children:L}),e[19]=L,e[20]=T):T=e[20];const D=d.from;let P;e[21]===Symbol.for("react.memo_cache_sentinel")?(P=xe=>S({from:xe.target.value}),e[21]=P):P=e[21];let B;e[22]!==c?(B=c("sandbox.redirectEditor.fromPlaceholder"),e[22]=c,e[23]=B):B=e[23];let C;e[24]!==r||e[25]!==d.from||e[26]!==B?(C=o.jsx(pt,{id:"redirect-form-from",value:D,onChange:P,placeholder:B,autoFocus:!0,disabled:r}),e[24]=r,e[25]=d.from,e[26]=B,e[27]=C):C=e[27];let $;e[28]!==C||e[29]!==T?($=o.jsxs("div",{className:"space-y-1.5",children:[T,C]}),e[28]=C,e[29]=T,e[30]=$):$=e[30];let V;e[31]!==c?(V=c("sandbox.redirectEditor.toLabel"),e[31]=c,e[32]=V):V=e[32];let I;e[33]!==V?(I=o.jsx(ct,{htmlFor:"redirect-form-to",children:V}),e[33]=V,e[34]=I):I=e[34];const W=d.to;let q;e[35]===Symbol.for("react.memo_cache_sentinel")?(q=xe=>S({to:xe.target.value}),e[35]=q):q=e[35];let z;e[36]!==c?(z=c("sandbox.redirectEditor.toPlaceholder"),e[36]=c,e[37]=z):z=e[37];let O;e[38]!==r||e[39]!==d.to||e[40]!==z?(O=o.jsx(pt,{id:"redirect-form-to",value:W,onChange:q,placeholder:z,disabled:r}),e[38]=r,e[39]=d.to,e[40]=z,e[41]=O):O=e[41];let Y;e[42]!==I||e[43]!==O?(Y=o.jsxs("div",{className:"space-y-1.5",children:[I,O]}),e[42]=I,e[43]=O,e[44]=Y):Y=e[44];let U;e[45]!==c?(U=c("sandbox.redirectEditor.typeLabel"),e[45]=c,e[46]=U):U=e[46];let Q;e[47]!==U?(Q=o.jsx(ct,{htmlFor:"redirect-form-type",children:U}),e[47]=U,e[48]=Q):Q=e[48];const oe=d.type;let ee;e[49]===Symbol.for("react.memo_cache_sentinel")?(ee=xe=>S({type:xe}),e[49]=ee):ee=e[49];let ie;e[50]!==c?(ie=c("sandbox.redirectEditor.typePlaceholder"),e[50]=c,e[51]=ie):ie=e[51];let ae;e[52]!==ie?(ae=o.jsx(Rr,{id:"redirect-form-type",className:"w-full",children:o.jsx(Fr,{placeholder:ie})}),e[52]=ie,e[53]=ae):ae=e[53];let le;e[54]!==c?(le=Nl.map(xe=>o.jsx($r,{value:xe.value,children:c(xe.labelKey,{status:gr[xe.value]})},xe.value)),e[54]=c,e[55]=le):le=e[55];let ce;e[56]!==le?(ce=o.jsx(Ir,{children:le}),e[56]=le,e[57]=ce):ce=e[57];let fe;e[58]!==r||e[59]!==d.type||e[60]!==ae||e[61]!==ce?(fe=o.jsxs(Kr,{value:oe,onValueChange:ee,disabled:r,children:[ae,ce]}),e[58]=r,e[59]=d.type,e[60]=ae,e[61]=ce,e[62]=fe):fe=e[62];let te;e[63]!==Q||e[64]!==fe?(te=o.jsxs("div",{className:"space-y-1.5",children:[Q,fe]}),e[63]=Q,e[64]=fe,e[65]=te):te=e[65];let de;e[66]===Symbol.for("react.memo_cache_sentinel")?(de=xe=>S({discardQueryParameters:xe===!0}),e[66]=de):de=e[66];let X;e[67]!==r||e[68]!==d.discardQueryParameters?(X=o.jsx(Xs,{checked:d.discardQueryParameters,disabled:r,onCheckedChange:de}),e[67]=r,e[68]=d.discardQueryParameters,e[69]=X):X=e[69];let ne;e[70]!==c?(ne=c("sandbox.redirectEditor.discardQueryParameters"),e[70]=c,e[71]=ne):ne=e[71];let J;e[72]!==ne?(J=o.jsx("span",{className:"text-sm",children:ne}),e[72]=ne,e[73]=J):J=e[73];let w;e[74]!==X||e[75]!==J?(w=o.jsxs("label",{className:"flex cursor-pointer items-center gap-2.5",children:[X,J]}),e[74]=X,e[75]=J,e[76]=w):w=e[76];let M;e[77]!==k?(M=k&&o.jsx("p",{className:"text-xs text-destructive",children:k}),e[77]=k,e[78]=M):M=e[78];let me;e[79]!==$||e[80]!==Y||e[81]!==te||e[82]!==w||e[83]!==M?(me=o.jsxs("div",{className:"space-y-4 py-4",children:[$,Y,te,w,M]}),e[79]=$,e[80]=Y,e[81]=te,e[82]=w,e[83]=M,e[84]=me):me=e[84];let ge;e[85]!==l?(ge=()=>l(!1),e[85]=l,e[86]=ge):ge=e[86];let he;e[87]!==c?(he=c("sandbox.redirectFormDialog.cancel"),e[87]=c,e[88]=he):he=e[88];let ye;e[89]!==r||e[90]!==ge||e[91]!==he?(ye=o.jsx(Oe,{type:"button",variant:"outline",onClick:ge,disabled:r,children:he}),e[89]=r,e[90]=ge,e[91]=he,e[92]=ye):ye=e[92];const _e=!_;let Pe;e[93]!==r||e[94]!==c?(Pe=r?o.jsxs(o.Fragment,{children:[o.jsx(dt,{className:"size-3.5"}),c("sandbox.redirectFormDialog.pending")]}):c("sandbox.redirectFormDialog.submit"),e[93]=r,e[94]=c,e[95]=Pe):Pe=e[95];let Te;e[96]!==_e||e[97]!==Pe?(Te=o.jsx(Oe,{type:"submit",disabled:_e,children:Pe}),e[96]=_e,e[97]=Pe,e[98]=Te):Te=e[98];let we;e[99]!==ye||e[100]!==Te?(we=o.jsxs(us,{children:[ye,Te]}),e[99]=ye,e[100]=Te,e[101]=we):we=e[101];let Ee;e[102]!==h||e[103]!==me||e[104]!==we||e[105]!==E?(Ee=o.jsx(qt,{className:"sm:max-w-md",children:o.jsxs("form",{onSubmit:h,children:[E,me,we]})}),e[102]=h,e[103]=me,e[104]=we,e[105]=E,e[106]=Ee):Ee=e[106];let De;return e[107]!==j||e[108]!==s||e[109]!==Ee?(De=o.jsx(Wt,{open:s,onOpenChange:j,children:Ee}),e[107]=j,e[108]=s,e[109]=Ee,e[110]=De):De=e[110],De}function Pl(t){const e=re.c(70),{open:s,blockKey:n,initialName:a,isPending:i,onSubmit:l,onOpenChange:r}=t,c=i===void 0?!1:i,d=Ce(),[f,g]=F.useState(a),[p,u]=F.useState(s);s!==p&&(u(s),s&&g(a));let m;e[0]!==c||e[1]!==r?(m=oe=>{!oe&&!c&&r(!1)},e[0]=c,e[1]=r,e[2]=m):m=e[2];const x=m;let S;e[3]!==c||e[4]!==f||e[5]!==l?(S=async oe=>{oe.preventDefault();const ee=f.trim();!ee||c||await l(ee)},e[3]=c,e[4]=f,e[5]=l,e[6]=S):S=e[6];const N=S;let j;e[7]!==d?(j=d("sandbox.sectionRenameDialog.title"),e[7]=d,e[8]=j):j=e[8];let b;e[9]!==j?(b=o.jsx(Ht,{children:j}),e[9]=j,e[10]=b):b=e[10];let h;e[11]!==d?(h=d("sandbox.sectionRenameDialog.description"),e[11]=d,e[12]=h):h=e[12];let k;e[13]!==h?(k=o.jsx(An,{children:h}),e[13]=h,e[14]=k):k=e[14];let A;e[15]!==b||e[16]!==k?(A=o.jsxs(ds,{children:[b,k]}),e[15]=b,e[16]=k,e[17]=A):A=e[17];let _;e[18]!==d?(_=d("sandbox.sectionRenameDialog.nameLabel"),e[18]=d,e[19]=_):_=e[19];let v;e[20]!==_?(v=o.jsx("label",{htmlFor:"section-rename-name",className:"text-xs font-medium text-muted-foreground",children:_}),e[20]=_,e[21]=v):v=e[21];let E;e[22]===Symbol.for("react.memo_cache_sentinel")?(E=oe=>g(oe.target.value),e[22]=E):E=e[22];let L;e[23]!==c||e[24]!==f?(L=o.jsx(pt,{id:"section-rename-name",value:f,onChange:E,autoFocus:!0,disabled:c}),e[23]=c,e[24]=f,e[25]=L):L=e[25];let T;e[26]!==v||e[27]!==L?(T=o.jsxs("div",{className:"space-y-1.5",children:[v,L]}),e[26]=v,e[27]=L,e[28]=T):T=e[28];let D;e[29]!==d?(D=d("sandbox.sectionRenameDialog.keyLabel"),e[29]=d,e[30]=D):D=e[30];let P;e[31]!==D?(P=o.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:D}),e[31]=D,e[32]=P):P=e[32];let B;e[33]!==n?(B=o.jsx(pt,{value:n,readOnly:!0,disabled:!0,className:"font-mono"}),e[33]=n,e[34]=B):B=e[34];let C;e[35]!==P||e[36]!==B?(C=o.jsxs("div",{className:"space-y-1.5",children:[P,B]}),e[35]=P,e[36]=B,e[37]=C):C=e[37];let $;e[38]!==T||e[39]!==C?($=o.jsxs("div",{className:"space-y-4 py-4",children:[T,C]}),e[38]=T,e[39]=C,e[40]=$):$=e[40];let V;e[41]!==r?(V=()=>r(!1),e[41]=r,e[42]=V):V=e[42];let I;e[43]!==d?(I=d("sandbox.sectionRenameDialog.cancel"),e[43]=d,e[44]=I):I=e[44];let W;e[45]!==c||e[46]!==V||e[47]!==I?(W=o.jsx(Oe,{type:"button",variant:"outline",onClick:V,disabled:c,children:I}),e[45]=c,e[46]=V,e[47]=I,e[48]=W):W=e[48];let q;e[49]!==c||e[50]!==f?(q=!f.trim()||c,e[49]=c,e[50]=f,e[51]=q):q=e[51];let z;e[52]!==c||e[53]!==d?(z=c?o.jsxs(o.Fragment,{children:[o.jsx(dt,{className:"size-3.5"}),d("sandbox.sectionRenameDialog.saving")]}):d("sandbox.sectionRenameDialog.save"),e[52]=c,e[53]=d,e[54]=z):z=e[54];let O;e[55]!==q||e[56]!==z?(O=o.jsx(Oe,{type:"submit",disabled:q,children:z}),e[55]=q,e[56]=z,e[57]=O):O=e[57];let Y;e[58]!==W||e[59]!==O?(Y=o.jsxs(us,{children:[W,O]}),e[58]=W,e[59]=O,e[60]=Y):Y=e[60];let U;e[61]!==N||e[62]!==$||e[63]!==Y||e[64]!==A?(U=o.jsx(qt,{className:"sm:max-w-md",children:o.jsxs("form",{onSubmit:N,children:[A,$,Y]})}),e[61]=N,e[62]=$,e[63]=Y,e[64]=A,e[65]=U):U=e[65];let Q;return e[66]!==x||e[67]!==s||e[68]!==U?(Q=o.jsx(Wt,{open:s,onOpenChange:x,children:U}),e[66]=x,e[67]=s,e[68]=U,e[69]=Q):Q=e[69],Q}function Tl(t){const e=re.c(9),{redirect:s}=t,n=s.type;let a;e[0]!==s?(a=hr(s),e[0]=s,e[1]=a):a=e[1];let i;e[2]!==a?(i=o.jsx(qe,{asChild:!0,children:o.jsx("span",{className:"shrink-0 rounded-full bg-muted px-1.5 py-0.5 text-[10px] font-medium tabular-nums text-muted-foreground",children:a})}),e[2]=a,e[3]=i):i=e[3];const l=n==="permanent"?"Permanent":"Temporary";let r;e[4]!==l?(r=o.jsx(We,{side:"left",children:l}),e[4]=l,e[5]=r):r=e[5];let c;return e[6]!==i||e[7]!==r?(c=o.jsxs(Ye,{children:[i,r]}),e[6]=i,e[7]=r,e[8]=c):c=e[8],c}const Al=["draft","active","paused","finished"],El=["launch","seasonal","trend","seo_gap","inventory","partnership","reputation"],Dl=["awareness","education","conversion","retention","repositioning"],Bl=["category","collection"],Ol=3,fo=12,Ll=60,$l=25,Rl=8e3,Fl=2e3,Il="vtex/loaders/intelligentSearch/productList.ts";function Ze(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function xn(t){return typeof t=="string"||typeof t=="number"?String(t):""}function bn(t){const e=Ze(t);return!!e&&typeof e.__resolveType=="string"&&"productId"in e}function Ef(t){if(typeof t=="string")return t?[t]:[];if(Array.isArray(t))return t.every(n=>typeof n=="string")?t:t.map(n=>xn(Ze(n)?.productId));const e=Ze(t),s=Ze(e?.props);return s&&Array.isArray(s.ids)?s.ids.map(xn):e&&"productId"in e?[xn(e.productId)]:[]}function Kl(t){const e=Ze(t)??{};return typeof e.__resolveType=="string"?e.__resolveType:Il}function Ml(t,e){if(typeof t=="string")return e[0]??"";if(Array.isArray(t)){if(t.length>0&&t.every(l=>typeof l=="string"))return e;const i=t.find(bn);if(i)return e.map((l,r)=>{const c=Ze(t[r]);return{...bn(c)?c:{__resolveType:i.__resolveType},productId:l}})}const s=Ze(t);if(bn(s)&&!Ze(s.props)?.ids)return{...s,productId:e[0]??""};const n=Ze(s?.props)??{},a=Kl(t);return{...s??{},__resolveType:a,props:{...n,ids:e,simulationBehavior:n.simulationBehavior??"default"}}}const zl=["title","titleTemplate","description","descriptionTemplate"];function da(t){return typeof t=="string"?t.trim():""}function mo(t){if(!Ii(t))return"";const e=Qo(t);if(!e)return"";const s=[];for(const n of zl){const a=da(e[n]);a&&s.push(`${n}: ${a}`)}return s.join(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/app-editor-Hif319cO.js","assets/index-Bu9BjZrq.js","assets/index-m9hX09uY.css","assets/chat-context-B8EIbmvQ.js","assets/use-panel-navigate-CgLeC7oT.js","assets/thread-route-B90y2Ttt.js","assets/use-project-scope-Mbz61u0U.js","assets/repository-binding-DTzReh06.js","assets/use-mcp-client-DXWvBBzU.js","assets/auth-BfGJq755.js","assets/autosend-BOeZuHqU.js","assets/thread-intent-YA4iB4rg.js","assets/delay-CnY5UFtP.js","assets/backoff-CrEUbyZT.js","assets/watch-sse-pool-CWMRkqIp.js","assets/task-board-AWLuhkrp.js","assets/schema-D1LjZYZ_.js","assets/slugify-CEUa2lfQ.js","assets/use-decopilot-events-B59p52EB.js","assets/use-ai-providers-CS760siL.js","assets/use-chat-navigation-CkUks0CI.js","assets/location-BjlyegC2.js","assets/use-organization-settings-DrbkHsVi.js","assets/scroll-area-Cvpjc0l0.js","assets/index-BdQq_4o_.js","assets/use-section-preview-base-BGUJwyF6.js","assets/UserSquare-CkJD4oxT.js","assets/agent-icon-C1V6kO6k.js","assets/AlertCircle-DNYRiSZ5.js","assets/Tool01-D30btgv0.js","assets/ArrowUp-ZHJFpRuE.js","assets/ArrowLeft-BPRTZJKi.js","assets/LinkBroken01-DqJqD91d.js","assets/ShoppingBag01-C5bgz2eY.js","assets/ZoomOut-CpX8NTBd.js","assets/Building02-BpZfnUaY.js","assets/CheckCircle-DOJo5D8E.js","assets/ChevronUp-85QiHbB8.js","assets/ChevronSelectorVertical-BjGO6IDu.js","assets/Copy01-DHwdjF9k.js","assets/CreditCard01-BMScCkLO.js","assets/DotsVertical-XGcmOLtN.js","assets/Image01-DA50Hqzp.js","assets/Globe04-BJ3qfVTm.js","assets/SwitchHorizontal01-BmNVXOBy.js","assets/Key01-GJDDXAJz.js","assets/Link01-DITYAShx.js","assets/Monitor01-CDHoaa0R.js","assets/Sun-BVt8ND9g.js","assets/Play-YAp6V4vH.js","assets/Plus-CPrlnOw7.js","assets/SearchMd-vuCQLB6T.js","assets/Trash01-CuDfbX9_.js","assets/Upload01-Bbz_T9k9.js","assets/User01-DkehSUca.js","assets/Users01-Bx_TIoWb.js","assets/XClose-jBQRwEAI.js","assets/blocks-tab-states-iEAVPlIx.js","assets/site-editor-toast-CKw1dZ19.js","assets/input-CEeDInNj.js","assets/usage-stats-BXR_QJg-.js","assets/tool-namespace-C83WlsNL.js","assets/form-mnUTUUgy.js","assets/label-BqTE8eVe.js","assets/utils-CVEq3hMx.js","assets/markdown-Wx3jaxrX.js","assets/use-copy-C0ICuN7j.js","assets/use-mobile-DVlrjJnR.js","assets/tooltip-Djfj4yvo.js","assets/index-B0o9NkGp.js","assets/format-time-CAj8AQXM.js","assets/differenceInSeconds-C3x8sHUj.js","assets/icon-button-Bt7uHWxC.js","assets/file-type-icon-fTBob-KS.js","assets/shell-layout-fqXaSGsn.js","assets/avatar-GhiWKw1r.js","assets/use-clock-tick-D9Y3YKA4.js","assets/command-_UmLRidn.js","assets/index-CaAWsuiJ.js","assets/integration-icon-D0zNx-RJ.js","assets/project-icon-DEfb1G5F.js","assets/new-project-dialog-C2CawYle.js","assets/repository-import-picker-CUpsn0UU.js","assets/use-navigate-to-agent-zweZgwVY.js","assets/repository-picker-liId9_zf.js","assets/useInfiniteQuery-9rJQjSuN.js","assets/infiniteQueryObserver-Cgqjyb2j.js","assets/collection-search-DOoRymFZ.js","assets/use-debounced-value-Tstd89O2.js","assets/required-auth-layout-CZd2SYeJ.js","assets/use-org-sso-BY7vua13.js","assets/shell-layout-CE2Eihra.css","assets/chat-draft-qnxtVEVH.js","assets/select-B9xwWJY1.js","assets/tabs-h2gBBRzw.js","assets/use-deco-credits-a2fVSYw4.js","assets/toggle-group-DRNkGgUT.js","assets/use-open-billing-url-CZCPBR61.js","assets/index-CVgtqYMj.js","assets/checkbox-C7CPIIbh.js","assets/ai-providers-logos-DD3qZ33J.js","assets/popover-DBhjt7xF.js","assets/drawer-Cwq-E8vz.js","assets/input-GO29c19t.js","assets/suggestion-DpmKDRpP.js","assets/use-project-native-view-presence-FuvDcd3j.js","assets/use-file-configs-CMXUzCw9.js","assets/site-slug-DebpOoQq.js","assets/use-mcp-prompts-D5_raFI0.js","assets/use-org-fs-ZG2jF1ev.js","assets/question-004-sINsf4GQ.js","assets/use-members-CBJHrFbr.js","assets/use-org-auth-client-QUHxqp7u.js","assets/feature-paywall-DOf-RXxD.js","assets/plan-ladder-DEcsqAHq.js","assets/add-connection-dialog-bxfInPMj.js","assets/extract-connection-data-BOqucuID.js","assets/metadata-D72DunRR.js","assets/connection-DL3AzTOs.js","assets/url-slug-DNuO5vGK.js","assets/connection-card-Dvq8DJhG.js","assets/connection-slug-CITJ0kGN.js","assets/textarea-7aD59y1C.js","assets/use-connection-CYm-Vxmx.js","assets/schema-Bn8rqd_f.js","assets/connection-form-helpers-D9j_N0x7.js","assets/authenticate-and-persist-oauth-Brcij0L8.js","assets/mcp-oauth-CP7f2bqu.js","assets/mcp-oauth-BqOO-7HR.js","assets/collection-tabs-DLtCCrSF.js","assets/badge-ZAtAF3u1.js","assets/use-infinite-scroll-Bkeb3Emc.js","assets/useSuspenseInfiniteQuery-xLkb2FEg.js","assets/use-task-board-events-CwaYpBZ3.js","assets/input-Bwd_JSM8.css","assets/sandbox-url-D3mC8qhT.js","assets/utils-aJ0jY1W-.js","assets/index-BwRxHLj2.js","assets/pair-BRzx8V28.js","assets/collapsible-CVaRDj_D.js","assets/content-blocks-o63cs2vh.js","assets/mcp-app-renderer-CIdjohnw.js","assets/types-DSQN8Y9X.js","assets/omit-sandbox-map-jj4lCB2U.js","assets/sheet-Rjoe19XZ.js","assets/use-thread-outputs-Bnh-FZdC.js","assets/sandbox-git-api-CRxdlhrN.js","assets/sandbox-start-errors-BK_aDCyt.js","assets/secret-ciphertext-BOjfqnbQ.js","assets/alert-CwC4mTxQ.js","assets/switch-Dyv9YUWT.js","assets/monaco-editor-uL7EgDLV.js","assets/editor-YT1hAWJG.js","assets/calendar-DCNv43ZU.js","assets/editor-classes-BOlaxHer.js","assets/core.esm-5rgifJ6w.js","assets/sortable.esm-Dys0-jaI.js","assets/view-mode-toggle-C14-toNe.js","assets/combobox-DlHUORRR.js","assets/alert-dialog-DmhXDwQf.js","assets/search-input-CvytUoQu.js","assets/asset-utils-CU6xrAQD.js","assets/empty-state-bIFMElEe.js","assets/section-preview-url-7zfngvgW.js","assets/mustache-CdAmmkEb.js","assets/sandbox-lifecycle-context-BSXgRctA.js","assets/empty-state-COxR0UdU.js","assets/cms-settings-editor-CK28ljtG.js","assets/post-editor-D6Q9G6HD.js","assets/multi-select-Dsayixmw.js","assets/block-document-BFsYEKLL.js","assets/product-picker-dialog-Vi9M9XbY.js","assets/index-C_vMO742.js","assets/blog-schema-ctDuKA_t.js","assets/use-fast-preview-draft-url-BElMJQru.js","assets/use-autosave-DiQgKPVz.js","assets/record-editor-CCo2C6Wx.js","assets/context-DQMyTLF9.js","assets/index-B7MMDJJ7.js","assets/get-initials-D-f_fDFw.js","assets/category-editor-C1SS3xs8.js","assets/sections-editor-DIXfWh89.js","assets/page-seo-form--GeHG2Y7.js","assets/variant-draft-pointer-1dv3zT6b.js","assets/seo-editor-BlwDgWbu.js","assets/variant-calendar-CHK_OU2h.js","assets/post-calendar-BBgMihhC.js","assets/redirect-editor-DIAc_1Im.js"])))=>i.map(i=>d[i]);
2
+ import{c as re,j as o,m as Ya,K as jn,b as Ce,l as ve,r as F,h as dt,s as ds,v as Ht,I as pt,B as Oe,w as us,q as qt,D as Wt,aM as An,o as Qa,e as Ja,t as pe,a9 as Xa,aS as ns,a$ as Zt,T as Os,aT as Wn,V as Ls,X as $s,aX as En,aN as Za,U as Xe,au as Rs,aw as mn,ap as ei,a2 as ti,u as Oo,aZ as Ge}from"./index-Bu9BjZrq.js";import{a as Lo}from"./use-organization-settings-DrbkHsVi.js";import{u as Ys,c as $o}from"./chat-context-B8EIbmvQ.js";import{i as is}from"./AlertCircle-DNYRiSZ5.js";import{_ as Ro,B as Yn,$ as Fo,a0 as Dn,a1 as Io,a2 as si,b as Fs,V as Ko,a3 as ni,a4 as oi,a5 as ai,a6 as ii,a7 as Sn,n as ri,a8 as Mo,a9 as li,aa as ci,ab as di,h as Qn,ac as ui,L as zo}from"./agent-icon-C1V6kO6k.js";import{a as Vo,s as Is,i as Bn,d as fi,e as Jn}from"./UserSquare-CkJD4oxT.js";import{b as Uo,i as Go}from"./ZoomOut-CpX8NTBd.js";import{c as Ho,i as mi}from"./SwitchHorizontal01-BmNVXOBy.js";import{s as On}from"./Plus-CPrlnOw7.js";import{t as qo}from"./Users01-Bx_TIoWb.js";import{f as pi,e as gi,b as hi,A as xi,a as bi,d as yi,c as vi,g as ji}from"./alert-dialog-DmhXDwQf.js";import{S as Qs}from"./scroll-area-Cvpjc0l0.js";import{T as qe,a as We,c as Ye}from"./tooltip-Djfj4yvo.js";import{M as Si,c as ki,u as Ln,w as wi,X as Ci,Y as Ni,Z as _i,N as Xn,_ as Zn,$ as Pi,a0 as Ti,j as Ai,K as Wo,P as Ei,J as Di,L as Bi,b as Oi}from"./site-editor-toast-CKw1dZ19.js";import{n as pn,k as Li,c as $i,g as Yo,B as gn,P as Ri,o as Fi,q as Qo,s as Ii,t as Ki,v as Mi,L as zi,u as Js,l as Vi,w as Ui,R as Gi,x as Jo,r as Hi,y as qi,a as Xo,z as Wi,A as Yi,D as Zo,E as Qi,M as Ji,j as Xi,F as Zi,p as er,G as tr,H as sr,i as nr,d as or,b as ar,f as ir,C as rr,S as lr,I as eo,N as cr}from"./blocks-tab-states-iEAVPlIx.js";import{x as $n,y as dr,z as Rn,i as ur,A as fr,B as mr,n as Es,v as pr,E as gr,F as hr,e as xr,G as br,H as Fn,g as yr,I as vr,q as to,J as so,K as jr,r as Sr,M as kr,o as wr,O as ea,u as Cr,P as Nr,Q as _r,T as Pr}from"./secret-ciphertext-BOjfqnbQ.js";import{u as Tr,P as Ar}from"./mustache-CdAmmkEb.js";import{n as ta}from"./ShoppingBag01-C5bgz2eY.js";import{t as rs}from"./ChevronUp-85QiHbB8.js";import{C as Er,a as Dr,b as Br}from"./collapsible-CVaRDj_D.js";import{u as Or}from"./index-BwRxHLj2.js";import{b as Lr}from"./sandbox-lifecycle-context-BSXgRctA.js";import{a as sa}from"./input-CEeDInNj.js";import{C as Xs}from"./checkbox-C7CPIIbh.js";import{L as ct}from"./label-BqTE8eVe.js";import{c as $r,b as Rr,a as Fr,d as Ir,S as Kr}from"./select-B9xwWJY1.js";import{s as Mr}from"./thread-intent-YA4iB4rg.js";import{t as zr}from"./sandbox-git-api-CRxdlhrN.js";import{b as no}from"./sandbox-url-D3mC8qhT.js";import{a as oo}from"./utils-aJ0jY1W-.js";import{i as Vr}from"./CheckCircle-DOJo5D8E.js";import{a as In}from"./Copy01-DHwdjF9k.js";import{s as Kn}from"./Trash01-CuDfbX9_.js";import{i as hn}from"./Upload01-Bbz_T9k9.js";import{B as Mn}from"./badge-ZAtAF3u1.js";import{E as Ur}from"./empty-state-COxR0UdU.js";import{u as Gr}from"./use-ai-providers-CS760siL.js";import{T as ao}from"./textarea-7aD59y1C.js";import{u as Hr}from"./use-file-configs-CMXUzCw9.js";import{MonacoCodeEditor as na}from"./monaco-editor-uL7EgDLV.js";import{c as oa,a as qr}from"./repository-binding-DTzReh06.js";import"./core.esm-5rgifJ6w.js";import"./sortable.esm-Dys0-jaI.js";import{b as Wr}from"./Tool01-D30btgv0.js";import{a as io}from"./use-project-native-view-presence-FuvDcd3j.js";import{E as Yr}from"./empty-state-bIFMElEe.js";import{G as ro}from"./repository-picker-liId9_zf.js";import{R as Qr}from"./repository-import-picker-CUpsn0UU.js";function aa(){return Lo("blog_ai_enabled")}function Jr(t,e){if(!t||!e?.length)return t;const s=Object.fromEntries(Object.entries(t.properties??{}).filter(([n])=>!e.includes(n)));return Object.keys(s).length>0?{...t,properties:s}:t}function Xr(t,e,s){return typeof t!="string"?null:Jr($n(t,e),s)}function ia(t,e,s){if(!e||typeof t!="string")return!1;const n=Xr(t,e,s);return!!n&&Object.keys(n.properties??{}).length>0}const lo="CMS",kn="cms-settings";function Zr(t){const e=t?.manifest?.blocks??{};return Object.values(e).some(s=>!!s&&Object.hasOwn(s,kn))}function Af(t){const e=Object.hasOwn(t,lo)?t[lo]:void 0;if(e==null)return{kind:"absent",block:{__resolveType:kn}};const s=typeof e=="object"&&!Array.isArray(e)?e.__resolveType:void 0;return s!==kn?{kind:"conflict",resolveType:typeof s=="string"?s:""}:{kind:"saved",block:e}}function es(t){const e=re.c(6),{hasItems:s,emptyLabel:n,emptyHint:a}=t;let i;e[0]!==a||e[1]!==n||e[2]!==s?(i=s?"No results match your search.":o.jsxs(o.Fragment,{children:[o.jsx("div",{children:n}),o.jsx("div",{className:"mt-1 text-muted-foreground/80",children:a})]}),e[0]=a,e[1]=n,e[2]=s,e[3]=i):i=e[3];let l;return e[4]!==i?(l=o.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:i}),e[4]=i,e[5]=l):l=e[5],l}function Zs(t,e){return`${t}-${e}`}function ra(t,e){return`site/apps/${t}/${e}.ts`}function la(t){const e=t.match(/^site\/apps\/([^/]+)\/([^/.]+)\.tsx?$/);if(e)return{vendor:e[1],app:e[2]};const s=t.match(/^([^/]+)\/apps\/([^/.]+)\.tsx?$/);return s?{vendor:s[1],app:s[2]}:null}function el(t){const e=t.match(/^([^-]+)-(.+)$/);return e?{vendor:e[1],app:e[2]}:null}function tl(t){return t==="local"?"Custom":"Installed"}function ca(t,e,s){const n=new Set([Zs(t,e),e].map(i=>i.toLowerCase())),a=ra(t,e);for(const[i,l]of Object.entries(s)){if(i.includes("/")||!l||typeof l!="object"||Array.isArray(l))continue;const r=l;if(n.has(i.toLowerCase())||r.__resolveType===a)return i}return null}function sl(t,e){const s=t.vendor.alias,n=t.name,a=ca(s,n,e);return{id:Zs(s,n),app:n,vendor:s,title:t.title||t.name,description:t.description,category:t.category??"Other",logo:t.logo||void 0,resolveType:ra(s,n),blockKey:a,installed:a!==null}}function nl(t,e,s){if(t===dr)return null;const n=la(t);if(!n)return null;const{vendor:a,app:i}=n,l=ca(a,i,s),r=Rn(t,e);return{id:Zs(a,i),app:i,vendor:a,title:r.title??i,description:r.description??"",category:"Others",logo:r.logo??r.icon,resolveType:t,blockKey:l,installed:l!==null}}function ol(t,e,s){const n=e.__resolveType;if(typeof n!="string"||ur(t,e)||!fr(n))return null;const a=la(n)??el(t);if(!a)return null;const i=Rn(n,s),{vendor:l,app:r}=a;return{id:Zs(l,r),app:r,vendor:l,title:i.title??mr(t,e,s),description:i.description??"",category:tl(l),logo:i.logo??i.icon,resolveType:n,blockKey:t,installed:!0}}function al(t,e,s){const n=new Map;for(const i of t){const l=sl(i,s);n.set(l.id,l)}const a=e.manifest?.blocks?.apps??{};for(const i of Object.keys(a)){const l=nl(i,e,s);!l||n.has(l.id)||n.set(l.id,l)}for(const[i,l]of Object.entries(s)){if(i.includes("/")||!l||typeof l!="object"||Array.isArray(l))continue;const r=ol(i,l,e);!r||n.has(r.id)||n.set(r.id,r)}return[...n.values()].sort(il)}function il(t,e){return t.installed!==e.installed?t.installed?-1:1:t.title.localeCompare(e.title)}async function rl(){const t=await fetch("/api/deco-apps");if(!t.ok)throw new Error(`Failed to fetch deco apps: ${t.status}`);return(await t.json()).apps??[]}function ll(t,e,s){const n=re.c(12),a=s?.enabled??!0;let i;n[0]===Symbol.for("react.memo_cache_sentinel")?(i=jn.decoApps(),n[0]=i):i=n[0];let l;n[1]!==a?(l={queryKey:i,queryFn:rl,staleTime:3e5,retry:1,enabled:a},n[1]=a,n[2]=l):l=n[2];const r=Ya(l);let c;n[3]!==e||n[4]!==t||n[5]!==r.data?(c=t&&e?al(r.data??[],t,e):[],n[3]=e,n[4]=t,n[5]=r.data,n[6]=c):c=n[6];const d=c,f=r.isLoading&&!r.isError;let g;return n[7]!==d||n[8]!==r.isError||n[9]!==r.refetch||n[10]!==f?(g={catalog:d,isLoading:f,isError:r.isError,refetch:r.refetch},n[7]=d,n[8]=r.isError,n[9]=r.refetch,n[10]=f,n[11]=g):g=n[11],g}const cl=["sections","apps","loaders","actions"],dl=[];function ul(t){const e=re.c(68),{active:s,counts:n,hidden:a,showBlog:i,showContext:l,onSelect:r}=t,c=a===void 0?dl:a,d=Ce();let f;e[0]!==c?(f=$=>!c.includes($),e[0]=c,e[1]=f):f=e[1];const g=f;let p;e[2]!==d?(p=d("sandbox.collectionsSidebar.content"),e[2]=d,e[3]=p):p=e[3];let u;e[4]!==p?(u=o.jsx("div",{className:"px-3 h-12 flex items-center border-b shrink-0",children:o.jsx("span",{className:"text-sm font-medium",children:p})}),e[4]=p,e[5]=u):u=e[5];let m;e[6]!==d?(m=d("sandbox.collectionsSidebar.pages"),e[6]=d,e[7]=m):m=e[7];const x=s==="pages";let S;e[8]!==n.pages||e[9]!==r||e[10]!==m||e[11]!==x?(S=o.jsx(Fe,{id:"pages",icon:Vo,label:m,count:n.pages,active:x,onSelect:r}),e[8]=n.pages,e[9]=r,e[10]=m,e[11]=x,e[12]=S):S=e[12];let N;e[13]!==d?(N=d("sandbox.collectionsSidebar.redirects"),e[13]=d,e[14]=N):N=e[14];const j=s==="redirects";let b;e[15]!==n.redirects||e[16]!==r||e[17]!==N||e[18]!==j?(b=o.jsx(Fe,{id:"redirects",icon:Ro,label:N,count:n.redirects,active:j,onSelect:r}),e[15]=n.redirects,e[16]=r,e[17]=N,e[18]=j,e[19]=b):b=e[19];let h;e[20]!==s||e[21]!==r||e[22]!==g||e[23]!==d?(h=g("site")&&o.jsx(Fe,{id:"site",icon:Yn,label:d("sandbox.collectionsSidebar.site"),active:s==="site",onSelect:r}),e[20]=s,e[21]=r,e[22]=g,e[23]=d,e[24]=h):h=e[24];let k;e[25]!==d?(k=d("sandbox.collectionsSidebar.seo"),e[25]=d,e[26]=k):k=e[26];const A=s==="seo";let _;e[27]!==r||e[28]!==k||e[29]!==A?(_=o.jsx(Fe,{id:"seo",icon:Io,label:k,active:A,onSelect:r}),e[27]=r,e[28]=k,e[29]=A,e[30]=_):_=e[30];let v;e[31]!==s||e[32]!==r||e[33]!==g||e[34]!==d?(v=g("settings")&&o.jsx(Fe,{id:"settings",icon:Yn,label:d("sandbox.collectionsSidebar.settings"),active:s==="settings",onSelect:r}),e[31]=s,e[32]=r,e[33]=g,e[34]=d,e[35]=v):v=e[35];let E;e[36]!==d?(E=d("sandbox.collectionsSidebar.calendar"),e[36]=d,e[37]=E):E=e[37];const L=s==="calendar";let T;e[38]!==r||e[39]!==E||e[40]!==L?(T=o.jsx(Fe,{id:"calendar",icon:si,label:E,active:L,onSelect:r}),e[38]=r,e[39]=E,e[40]=L,e[41]=T):T=e[41];let D;e[42]!==s||e[43]!==n||e[44]!==r||e[45]!==g?(D=o.jsx(fl,{active:s,counts:n,shown:g,onSelect:r}),e[42]=s,e[43]=n,e[44]=r,e[45]=g,e[46]=D):D=e[46];let P;e[47]!==s||e[48]!==n.authors||e[49]!==n.categories||e[50]!==n.posts||e[51]!==r||e[52]!==i||e[53]!==l||e[54]!==d?(P=i&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"mt-3 flex items-center gap-1.5 px-2.5 pb-1 pt-1 text-xs font-medium text-muted-foreground/70",children:[o.jsx(ta,{size:13,className:"shrink-0"}),d("sandbox.collectionsSidebar.blog")]}),l&&o.jsx(Fe,{id:"context",icon:Is,label:d("sandbox.collectionsSidebar.context"),active:s==="context",onSelect:r}),o.jsx(Fe,{id:"posts",icon:Uo,label:d("sandbox.collectionsSidebar.posts"),count:n.posts,active:s==="posts",onSelect:r}),o.jsx(Fe,{id:"authors",icon:qo,label:d("sandbox.collectionsSidebar.authors"),count:n.authors,active:s==="authors",onSelect:r}),o.jsx(Fe,{id:"categories",icon:Fo,label:d("sandbox.collectionsSidebar.categories"),count:n.categories,active:s==="categories",onSelect:r}),o.jsx(Fe,{id:"post-schedule",icon:Dn,label:d("sandbox.collectionsSidebar.postSchedule"),active:s==="post-schedule",onSelect:r})]}),e[47]=s,e[48]=n.authors,e[49]=n.categories,e[50]=n.posts,e[51]=r,e[52]=i,e[53]=l,e[54]=d,e[55]=P):P=e[55];let B;e[56]!==b||e[57]!==h||e[58]!==_||e[59]!==v||e[60]!==T||e[61]!==D||e[62]!==P||e[63]!==S?(B=o.jsxs("nav",{className:"flex flex-col p-1.5 gap-0.5",children:[S,b,h,_,v,T,D,P]}),e[56]=b,e[57]=h,e[58]=_,e[59]=v,e[60]=T,e[61]=D,e[62]=P,e[63]=S,e[64]=B):B=e[64];let C;return e[65]!==B||e[66]!==u?(C=o.jsxs("div",{className:"w-[208px] shrink-0 border-r flex flex-col",children:[u,B]}),e[65]=B,e[66]=u,e[67]=C):C=e[67],C}function fl(t){const e=re.c(50),{active:s,counts:n,shown:a,onSelect:i}=t,l=Ce();let r;e[0]!==s?(r=cl.includes(s),e[0]=s,e[1]=r):r=e[1];const c=r,[d,f]=F.useState(!1),g=d||c;let p,u;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=ve("flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-left text-sm transition-colors cursor-pointer","text-muted-foreground hover:bg-muted hover:text-foreground"),u=o.jsx(ni,{size:16,className:"shrink-0"}),e[2]=p,e[3]=u):(p=e[2],u=e[3]);let m;e[4]!==l?(m=l("sandbox.collectionsSidebar.advanced"),e[4]=l,e[5]=m):m=e[5];let x;e[6]!==m?(x=o.jsx("span",{className:"flex-1 truncate",children:m}),e[6]=m,e[7]=x):x=e[7];const S=g&&"rotate-180";let N;e[8]!==S?(N=ve("shrink-0 text-muted-foreground/70 transition-transform",S),e[8]=S,e[9]=N):N=e[9];let j;e[10]!==N?(j=o.jsx(rs,{size:16,className:N}),e[10]=N,e[11]=j):j=e[11];let b;e[12]!==x||e[13]!==j?(b=o.jsxs(Er,{className:p,children:[u,x,j]}),e[12]=x,e[13]=j,e[14]=b):b=e[14];let h;e[15]!==l?(h=l("sandbox.collectionsSidebar.sections"),e[15]=l,e[16]=h):h=e[16];const k=s==="sections";let A;e[17]!==n.sections||e[18]!==i||e[19]!==h||e[20]!==k?(A=o.jsx(Fe,{id:"sections",icon:Fs,label:h,count:n.sections,active:k,onSelect:i,indent:!0}),e[17]=n.sections,e[18]=i,e[19]=h,e[20]=k,e[21]=A):A=e[21];let _;e[22]!==s||e[23]!==n.apps||e[24]!==i||e[25]!==a||e[26]!==l?(_=a("apps")&&o.jsx(Fe,{id:"apps",icon:Ho,label:l("sandbox.collectionsSidebar.apps"),count:n.apps,active:s==="apps",onSelect:i,indent:!0}),e[22]=s,e[23]=n.apps,e[24]=i,e[25]=a,e[26]=l,e[27]=_):_=e[27];let v;e[28]!==l?(v=l("sandbox.collectionsSidebar.loaders"),e[28]=l,e[29]=v):v=e[29];const E=s==="loaders";let L;e[30]!==n.loaders||e[31]!==i||e[32]!==v||e[33]!==E?(L=o.jsx(Fe,{id:"loaders",icon:Ko,label:v,count:n.loaders,active:E,onSelect:i,indent:!0}),e[30]=n.loaders,e[31]=i,e[32]=v,e[33]=E,e[34]=L):L=e[34];let T;e[35]!==s||e[36]!==n.actions||e[37]!==i||e[38]!==a||e[39]!==l?(T=a("actions")&&o.jsx(Fe,{id:"actions",icon:Go,label:l("sandbox.collectionsSidebar.actions"),count:n.actions,active:s==="actions",onSelect:i,indent:!0}),e[35]=s,e[36]=n.actions,e[37]=i,e[38]=a,e[39]=l,e[40]=T):T=e[40];let D;e[41]!==A||e[42]!==_||e[43]!==L||e[44]!==T?(D=o.jsxs(Dr,{className:"flex flex-col gap-0.5 pt-0.5",children:[A,_,L,T]}),e[41]=A,e[42]=_,e[43]=L,e[44]=T,e[45]=D):D=e[45];let P;return e[46]!==g||e[47]!==D||e[48]!==b?(P=o.jsxs(Br,{open:g,onOpenChange:f,children:[b,D]}),e[46]=g,e[47]=D,e[48]=b,e[49]=P):P=e[49],P}function Fe(t){const e=re.c(19),{id:s,icon:n,label:a,count:i,active:l,onSelect:r,indent:c}=t;let d;e[0]!==s||e[1]!==r?(d=()=>r(s),e[0]=s,e[1]=r,e[2]=d):d=e[2];const f=c&&"pl-6",g=l?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground";let p;e[3]!==f||e[4]!==g?(p=ve("flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-left text-sm transition-colors cursor-pointer",f,g),e[3]=f,e[4]=g,e[5]=p):p=e[5];let u;e[6]!==n?(u=o.jsx(n,{size:16,className:"shrink-0"}),e[6]=n,e[7]=u):u=e[7];let m;e[8]!==a?(m=o.jsx("span",{className:"flex-1 truncate",children:a}),e[8]=a,e[9]=m):m=e[9];let x;e[10]!==l||e[11]!==i?(x=i!==void 0&&o.jsx("span",{className:ve("shrink-0 text-xs tabular-nums",l?"text-accent-foreground/70":"text-muted-foreground/70"),children:i}),e[10]=l,e[11]=i,e[12]=x):x=e[12];let S;return e[13]!==d||e[14]!==p||e[15]!==u||e[16]!==m||e[17]!==x?(S=o.jsxs("button",{type:"button",onClick:d,className:p,children:[u,m,x]}),e[13]=d,e[14]=p,e[15]=u,e[16]=m,e[17]=x,e[18]=S):S=e[18],S}function ml(t){const e=re.c(12),{state:s,claimPhase:n,lifecycle:a,onStart:i,connectionsHref:l}=t;switch(s.kind){case"starting":{let r;e[0]!==n||e[1]!==a?(r=Li({claimPhase:n,lifecycle:a}),e[0]=n,e[1]=a,e[2]=r):r=e[2];let c;return e[3]!==n||e[4]!==r?(c=o.jsx(pn,{kind:"starting",progress:r,claimPhase:n}),e[3]=n,e[4]=r,e[5]=c):c=e[5],c}case"suspended":{let r;return e[6]!==i?(r=o.jsx(pn,{kind:"suspended",onResume:i}),e[6]=i,e[7]=r):r=e[7],r}case"errored":{let r;return e[8]!==l||e[9]!==i||e[10]!==s.error?(r=o.jsx(pn,{kind:"errored",error:s.error,onRetry:i,connectionsHref:l}),e[8]=l,e[9]=i,e[10]=s.error,e[11]=r):r=e[11],r}}}const pl=new Set(["clone-failed","install-failed","start-failed","crashed"]);function gl(t){if(t.fastPreviewActive)return{kind:"ready",devServerReady:!1,sandboxWarming:!1};if(t.previewState.kind!=="iframe")return{kind:"sandbox-card",state:t.previewState};const e=t.lifecyclePhase==="running",s=!e&&!pl.has(t.lifecyclePhase);return{kind:"ready",devServerReady:e,sandboxWarming:s}}function co(t,e){const s=e.replace(/\s*\(copy(?:\s+\d+)?\)\s*$/,"").trim(),n=`${s} (copy)`;if(!t.has(n))return n;for(let a=2;a<1e3;a++){const i=`${s} (copy ${a})`;if(!t.has(i))return i}return`${s} (copy ${Date.now()})`}function hl(t,e){const s=Es,n=e.replace(/-copy(?:-\d+)?$/,""),a=`${n}-copy`;if(!t.has(s(a)))return a;for(let i=2;i<1e3;i++){const l=`${n}-copy-${i}`;if(!t.has(s(l)))return l}return`${n}-copy-${Date.now()}`}function xl(t,e){const s=e.replace(/_copy(?:_\d+)?$/,""),n=`${s}_copy`;if(!Object.hasOwn(t,n))return n;for(let a=2;a<1e3;a++){const i=`${s}_copy_${a}`;if(!Object.hasOwn(t,i))return i}return`${s}_copy_${Date.now()}`}function bl(t){const e=Yo(t.newName),s={...t.source,name:t.newName,path:t.newPath};return{key:e,data:s}}function yl(t,e){return $i(t,e)}const vl=1e3;function jl(t,e){for(let s=0;s<vl;s++){const n=Yo(e);if(!Object.hasOwn(t,n))return n}throw new Error("Could not generate a unique page block key")}const Sl={create:"sandbox.pageFormDialog.titleCreate",duplicate:"sandbox.pageFormDialog.titleDuplicate",rename:"sandbox.pageFormDialog.titleRename"},kl={create:"sandbox.pageFormDialog.submitCreate",duplicate:"sandbox.pageFormDialog.submitDuplicate",rename:"sandbox.pageFormDialog.submitSave"},wl={create:"sandbox.pageFormDialog.pendingCreate",duplicate:"sandbox.pageFormDialog.pendingDuplicate",rename:"sandbox.pageFormDialog.pendingSave"};function Cl(t){const e=re.c(88),{open:s,mode:n,initialName:a,initialPath:i,isPending:l,error:r,templates:c,validate:d,onSubmit:f,onOpenChange:g}=t,p=l===void 0?!1:l,u=Ce(),[m,x]=F.useState(a),[S,N]=F.useState(i),[j,b]=F.useState(gn),[h,k]=F.useState(null),[A,_]=F.useState(s);s!==A&&(_(s),s&&(x(a),N(i),b(gn),k(null)));const v=n==="create"&&!!c?.length;let E;e[0]!==p||e[1]!==g?(E=ge=>{!ge&&!p&&(k(null),g(!1))},e[0]=p,e[1]=g,e[2]=E):E=e[2];const L=E;let T;e[3]!==p||e[4]!==m||e[5]!==f||e[6]!==S||e[7]!==v||e[8]!==j||e[9]!==d?(T=async ge=>{ge.preventDefault();const he=m.trim(),ye=S.trim();if(!he||!ye||p)return;const _e=pr(ye);if(_e){k(_e);return}const Pe=d?.({name:he,path:ye});if(Pe){k(Pe);return}k(null),await f({name:he,path:ye,templateKey:v&&j!==gn?j:null})},e[3]=p,e[4]=m,e[5]=f,e[6]=S,e[7]=v,e[8]=j,e[9]=d,e[10]=T):T=e[10];const D=T,P=h??r,B=Sl[n];let C;e[11]!==u||e[12]!==B?(C=u(B),e[11]=u,e[12]=B,e[13]=C):C=e[13];let $;e[14]!==C?($=o.jsx(ds,{children:o.jsx(Ht,{children:C})}),e[14]=C,e[15]=$):$=e[15];let V;e[16]!==p||e[17]!==v||e[18]!==u||e[19]!==j||e[20]!==c?(V=v&&o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("label",{htmlFor:"page-form-template",className:"text-xs font-medium text-muted-foreground",children:u("sandbox.pageFormDialog.labelTemplate")}),o.jsx(Ri,{id:"page-form-template",value:j,onChange:b,templates:c??[],disabled:p})]}),e[16]=p,e[17]=v,e[18]=u,e[19]=j,e[20]=c,e[21]=V):V=e[21];let I;e[22]!==u?(I=u("sandbox.pageFormDialog.labelName"),e[22]=u,e[23]=I):I=e[23];let W;e[24]!==I?(W=o.jsx("label",{htmlFor:"page-form-name",className:"text-xs font-medium text-muted-foreground",children:I}),e[24]=I,e[25]=W):W=e[25];let q;e[26]===Symbol.for("react.memo_cache_sentinel")?(q=ge=>x(ge.target.value),e[26]=q):q=e[26];let z;e[27]!==u?(z=u("sandbox.pageFormDialog.placeholderName"),e[27]=u,e[28]=z):z=e[28];let O;e[29]!==p||e[30]!==m||e[31]!==z?(O=o.jsx(pt,{id:"page-form-name",value:m,onChange:q,placeholder:z,autoFocus:!0,disabled:p}),e[29]=p,e[30]=m,e[31]=z,e[32]=O):O=e[32];let Y;e[33]!==O||e[34]!==W?(Y=o.jsxs("div",{className:"space-y-1.5",children:[W,O]}),e[33]=O,e[34]=W,e[35]=Y):Y=e[35];let U;e[36]!==u?(U=u("sandbox.pageFormDialog.labelPath"),e[36]=u,e[37]=U):U=e[37];let Q;e[38]!==U?(Q=o.jsx("label",{htmlFor:"page-form-path",className:"text-xs font-medium text-muted-foreground",children:U}),e[38]=U,e[39]=Q):Q=e[39];let oe;e[40]===Symbol.for("react.memo_cache_sentinel")?(oe=ge=>N(ge.target.value),e[40]=oe):oe=e[40];let ee;e[41]!==u?(ee=u("sandbox.pageFormDialog.placeholderPath"),e[41]=u,e[42]=ee):ee=e[42];let ie;e[43]!==p||e[44]!==S||e[45]!==ee?(ie=o.jsx(pt,{id:"page-form-path",value:S,onChange:oe,placeholder:ee,disabled:p}),e[43]=p,e[44]=S,e[45]=ee,e[46]=ie):ie=e[46];let ae;e[47]!==Q||e[48]!==ie?(ae=o.jsxs("div",{className:"space-y-1.5",children:[Q,ie]}),e[47]=Q,e[48]=ie,e[49]=ae):ae=e[49];let le;e[50]!==P?(le=P&&o.jsx("p",{className:"text-xs text-destructive",children:P}),e[50]=P,e[51]=le):le=e[51];let ce;e[52]!==Y||e[53]!==ae||e[54]!==le||e[55]!==V?(ce=o.jsxs("div",{className:"space-y-4 py-4",children:[V,Y,ae,le]}),e[52]=Y,e[53]=ae,e[54]=le,e[55]=V,e[56]=ce):ce=e[56];let fe;e[57]!==g?(fe=()=>g(!1),e[57]=g,e[58]=fe):fe=e[58];let te;e[59]!==u?(te=u("sandbox.pageFormDialog.buttonCancel"),e[59]=u,e[60]=te):te=e[60];let de;e[61]!==p||e[62]!==fe||e[63]!==te?(de=o.jsx(Oe,{type:"button",variant:"outline",onClick:fe,disabled:p,children:te}),e[61]=p,e[62]=fe,e[63]=te,e[64]=de):de=e[64];let X;e[65]!==p||e[66]!==m||e[67]!==S?(X=!m.trim()||!S.trim()||p,e[65]=p,e[66]=m,e[67]=S,e[68]=X):X=e[68];let ne;e[69]!==p||e[70]!==n||e[71]!==u?(ne=p?o.jsxs(o.Fragment,{children:[o.jsx(dt,{className:"size-3.5"}),u(wl[n])]}):u(kl[n]),e[69]=p,e[70]=n,e[71]=u,e[72]=ne):ne=e[72];let J;e[73]!==X||e[74]!==ne?(J=o.jsx(Oe,{type:"submit",disabled:X,children:ne}),e[73]=X,e[74]=ne,e[75]=J):J=e[75];let w;e[76]!==de||e[77]!==J?(w=o.jsxs(us,{children:[de,J]}),e[76]=de,e[77]=J,e[78]=w):w=e[78];let M;e[79]!==D||e[80]!==ce||e[81]!==w||e[82]!==$?(M=o.jsx(qt,{className:"sm:max-w-md",children:o.jsxs("form",{onSubmit:D,children:[$,ce,w]})}),e[79]=D,e[80]=ce,e[81]=w,e[82]=$,e[83]=M):M=e[83];let me;return e[84]!==L||e[85]!==s||e[86]!==M?(me=o.jsx(Wt,{open:s,onOpenChange:L,children:M}),e[84]=L,e[85]=s,e[86]=M,e[87]=me):me=e[87],me}const Nl=[{value:"temporary",labelKey:"sandbox.redirectEditor.typeTemporary"},{value:"permanent",labelKey:"sandbox.redirectEditor.typePermanent"}],uo={from:"",to:"",type:"temporary",discardQueryParameters:!1};function _l(t){const e=re.c(111),{open:s,isPending:n,error:a,onSubmit:i,onOpenChange:l}=t,r=n===void 0?!1:n,c=Ce(),[d,f]=F.useState(uo),[g,p]=F.useState(null),[u,m]=F.useState(s);s!==u&&(m(s),s&&(f(uo),p(null)));let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=xe=>f(Ae=>({...Ae,...xe})),e[0]=x):x=e[0];const S=x;let N;e[1]!==r||e[2]!==l?(N=xe=>{!xe&&!r&&(p(null),l(!1))},e[1]=r,e[2]=l,e[3]=N):N=e[3];const j=N;let b;e[4]!==r||e[5]!==i||e[6]!==d||e[7]!==c?(b=async xe=>{xe.preventDefault();const Ae=d.from.trim(),Re=d.to.trim();if(!Ae||!Re||r){p(c("sandbox.redirectFormDialog.errorRequired"));return}p(null),await i({...d,from:Ae,to:Re})},e[4]=r,e[5]=i,e[6]=d,e[7]=c,e[8]=b):b=e[8];const h=b,k=g??a;let A;e[9]!==r||e[10]!==d.from||e[11]!==d.to?(A=!!d.from.trim()&&!!d.to.trim()&&!r,e[9]=r,e[10]=d.from,e[11]=d.to,e[12]=A):A=e[12];const _=A;let v;e[13]!==c?(v=c("sandbox.redirectFormDialog.title"),e[13]=c,e[14]=v):v=e[14];let E;e[15]!==v?(E=o.jsx(ds,{children:o.jsx(Ht,{children:v})}),e[15]=v,e[16]=E):E=e[16];let L;e[17]!==c?(L=c("sandbox.redirectEditor.fromLabel"),e[17]=c,e[18]=L):L=e[18];let T;e[19]!==L?(T=o.jsx(ct,{htmlFor:"redirect-form-from",children:L}),e[19]=L,e[20]=T):T=e[20];const D=d.from;let P;e[21]===Symbol.for("react.memo_cache_sentinel")?(P=xe=>S({from:xe.target.value}),e[21]=P):P=e[21];let B;e[22]!==c?(B=c("sandbox.redirectEditor.fromPlaceholder"),e[22]=c,e[23]=B):B=e[23];let C;e[24]!==r||e[25]!==d.from||e[26]!==B?(C=o.jsx(pt,{id:"redirect-form-from",value:D,onChange:P,placeholder:B,autoFocus:!0,disabled:r}),e[24]=r,e[25]=d.from,e[26]=B,e[27]=C):C=e[27];let $;e[28]!==C||e[29]!==T?($=o.jsxs("div",{className:"space-y-1.5",children:[T,C]}),e[28]=C,e[29]=T,e[30]=$):$=e[30];let V;e[31]!==c?(V=c("sandbox.redirectEditor.toLabel"),e[31]=c,e[32]=V):V=e[32];let I;e[33]!==V?(I=o.jsx(ct,{htmlFor:"redirect-form-to",children:V}),e[33]=V,e[34]=I):I=e[34];const W=d.to;let q;e[35]===Symbol.for("react.memo_cache_sentinel")?(q=xe=>S({to:xe.target.value}),e[35]=q):q=e[35];let z;e[36]!==c?(z=c("sandbox.redirectEditor.toPlaceholder"),e[36]=c,e[37]=z):z=e[37];let O;e[38]!==r||e[39]!==d.to||e[40]!==z?(O=o.jsx(pt,{id:"redirect-form-to",value:W,onChange:q,placeholder:z,disabled:r}),e[38]=r,e[39]=d.to,e[40]=z,e[41]=O):O=e[41];let Y;e[42]!==I||e[43]!==O?(Y=o.jsxs("div",{className:"space-y-1.5",children:[I,O]}),e[42]=I,e[43]=O,e[44]=Y):Y=e[44];let U;e[45]!==c?(U=c("sandbox.redirectEditor.typeLabel"),e[45]=c,e[46]=U):U=e[46];let Q;e[47]!==U?(Q=o.jsx(ct,{htmlFor:"redirect-form-type",children:U}),e[47]=U,e[48]=Q):Q=e[48];const oe=d.type;let ee;e[49]===Symbol.for("react.memo_cache_sentinel")?(ee=xe=>S({type:xe}),e[49]=ee):ee=e[49];let ie;e[50]!==c?(ie=c("sandbox.redirectEditor.typePlaceholder"),e[50]=c,e[51]=ie):ie=e[51];let ae;e[52]!==ie?(ae=o.jsx(Rr,{id:"redirect-form-type",className:"w-full",children:o.jsx(Fr,{placeholder:ie})}),e[52]=ie,e[53]=ae):ae=e[53];let le;e[54]!==c?(le=Nl.map(xe=>o.jsx($r,{value:xe.value,children:c(xe.labelKey,{status:gr[xe.value]})},xe.value)),e[54]=c,e[55]=le):le=e[55];let ce;e[56]!==le?(ce=o.jsx(Ir,{children:le}),e[56]=le,e[57]=ce):ce=e[57];let fe;e[58]!==r||e[59]!==d.type||e[60]!==ae||e[61]!==ce?(fe=o.jsxs(Kr,{value:oe,onValueChange:ee,disabled:r,children:[ae,ce]}),e[58]=r,e[59]=d.type,e[60]=ae,e[61]=ce,e[62]=fe):fe=e[62];let te;e[63]!==Q||e[64]!==fe?(te=o.jsxs("div",{className:"space-y-1.5",children:[Q,fe]}),e[63]=Q,e[64]=fe,e[65]=te):te=e[65];let de;e[66]===Symbol.for("react.memo_cache_sentinel")?(de=xe=>S({discardQueryParameters:xe===!0}),e[66]=de):de=e[66];let X;e[67]!==r||e[68]!==d.discardQueryParameters?(X=o.jsx(Xs,{checked:d.discardQueryParameters,disabled:r,onCheckedChange:de}),e[67]=r,e[68]=d.discardQueryParameters,e[69]=X):X=e[69];let ne;e[70]!==c?(ne=c("sandbox.redirectEditor.discardQueryParameters"),e[70]=c,e[71]=ne):ne=e[71];let J;e[72]!==ne?(J=o.jsx("span",{className:"text-sm",children:ne}),e[72]=ne,e[73]=J):J=e[73];let w;e[74]!==X||e[75]!==J?(w=o.jsxs("label",{className:"flex cursor-pointer items-center gap-2.5",children:[X,J]}),e[74]=X,e[75]=J,e[76]=w):w=e[76];let M;e[77]!==k?(M=k&&o.jsx("p",{className:"text-xs text-destructive",children:k}),e[77]=k,e[78]=M):M=e[78];let me;e[79]!==$||e[80]!==Y||e[81]!==te||e[82]!==w||e[83]!==M?(me=o.jsxs("div",{className:"space-y-4 py-4",children:[$,Y,te,w,M]}),e[79]=$,e[80]=Y,e[81]=te,e[82]=w,e[83]=M,e[84]=me):me=e[84];let ge;e[85]!==l?(ge=()=>l(!1),e[85]=l,e[86]=ge):ge=e[86];let he;e[87]!==c?(he=c("sandbox.redirectFormDialog.cancel"),e[87]=c,e[88]=he):he=e[88];let ye;e[89]!==r||e[90]!==ge||e[91]!==he?(ye=o.jsx(Oe,{type:"button",variant:"outline",onClick:ge,disabled:r,children:he}),e[89]=r,e[90]=ge,e[91]=he,e[92]=ye):ye=e[92];const _e=!_;let Pe;e[93]!==r||e[94]!==c?(Pe=r?o.jsxs(o.Fragment,{children:[o.jsx(dt,{className:"size-3.5"}),c("sandbox.redirectFormDialog.pending")]}):c("sandbox.redirectFormDialog.submit"),e[93]=r,e[94]=c,e[95]=Pe):Pe=e[95];let Te;e[96]!==_e||e[97]!==Pe?(Te=o.jsx(Oe,{type:"submit",disabled:_e,children:Pe}),e[96]=_e,e[97]=Pe,e[98]=Te):Te=e[98];let we;e[99]!==ye||e[100]!==Te?(we=o.jsxs(us,{children:[ye,Te]}),e[99]=ye,e[100]=Te,e[101]=we):we=e[101];let Ee;e[102]!==h||e[103]!==me||e[104]!==we||e[105]!==E?(Ee=o.jsx(qt,{className:"sm:max-w-md",children:o.jsxs("form",{onSubmit:h,children:[E,me,we]})}),e[102]=h,e[103]=me,e[104]=we,e[105]=E,e[106]=Ee):Ee=e[106];let De;return e[107]!==j||e[108]!==s||e[109]!==Ee?(De=o.jsx(Wt,{open:s,onOpenChange:j,children:Ee}),e[107]=j,e[108]=s,e[109]=Ee,e[110]=De):De=e[110],De}function Pl(t){const e=re.c(70),{open:s,blockKey:n,initialName:a,isPending:i,onSubmit:l,onOpenChange:r}=t,c=i===void 0?!1:i,d=Ce(),[f,g]=F.useState(a),[p,u]=F.useState(s);s!==p&&(u(s),s&&g(a));let m;e[0]!==c||e[1]!==r?(m=oe=>{!oe&&!c&&r(!1)},e[0]=c,e[1]=r,e[2]=m):m=e[2];const x=m;let S;e[3]!==c||e[4]!==f||e[5]!==l?(S=async oe=>{oe.preventDefault();const ee=f.trim();!ee||c||await l(ee)},e[3]=c,e[4]=f,e[5]=l,e[6]=S):S=e[6];const N=S;let j;e[7]!==d?(j=d("sandbox.sectionRenameDialog.title"),e[7]=d,e[8]=j):j=e[8];let b;e[9]!==j?(b=o.jsx(Ht,{children:j}),e[9]=j,e[10]=b):b=e[10];let h;e[11]!==d?(h=d("sandbox.sectionRenameDialog.description"),e[11]=d,e[12]=h):h=e[12];let k;e[13]!==h?(k=o.jsx(An,{children:h}),e[13]=h,e[14]=k):k=e[14];let A;e[15]!==b||e[16]!==k?(A=o.jsxs(ds,{children:[b,k]}),e[15]=b,e[16]=k,e[17]=A):A=e[17];let _;e[18]!==d?(_=d("sandbox.sectionRenameDialog.nameLabel"),e[18]=d,e[19]=_):_=e[19];let v;e[20]!==_?(v=o.jsx("label",{htmlFor:"section-rename-name",className:"text-xs font-medium text-muted-foreground",children:_}),e[20]=_,e[21]=v):v=e[21];let E;e[22]===Symbol.for("react.memo_cache_sentinel")?(E=oe=>g(oe.target.value),e[22]=E):E=e[22];let L;e[23]!==c||e[24]!==f?(L=o.jsx(pt,{id:"section-rename-name",value:f,onChange:E,autoFocus:!0,disabled:c}),e[23]=c,e[24]=f,e[25]=L):L=e[25];let T;e[26]!==v||e[27]!==L?(T=o.jsxs("div",{className:"space-y-1.5",children:[v,L]}),e[26]=v,e[27]=L,e[28]=T):T=e[28];let D;e[29]!==d?(D=d("sandbox.sectionRenameDialog.keyLabel"),e[29]=d,e[30]=D):D=e[30];let P;e[31]!==D?(P=o.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:D}),e[31]=D,e[32]=P):P=e[32];let B;e[33]!==n?(B=o.jsx(pt,{value:n,readOnly:!0,disabled:!0,className:"font-mono"}),e[33]=n,e[34]=B):B=e[34];let C;e[35]!==P||e[36]!==B?(C=o.jsxs("div",{className:"space-y-1.5",children:[P,B]}),e[35]=P,e[36]=B,e[37]=C):C=e[37];let $;e[38]!==T||e[39]!==C?($=o.jsxs("div",{className:"space-y-4 py-4",children:[T,C]}),e[38]=T,e[39]=C,e[40]=$):$=e[40];let V;e[41]!==r?(V=()=>r(!1),e[41]=r,e[42]=V):V=e[42];let I;e[43]!==d?(I=d("sandbox.sectionRenameDialog.cancel"),e[43]=d,e[44]=I):I=e[44];let W;e[45]!==c||e[46]!==V||e[47]!==I?(W=o.jsx(Oe,{type:"button",variant:"outline",onClick:V,disabled:c,children:I}),e[45]=c,e[46]=V,e[47]=I,e[48]=W):W=e[48];let q;e[49]!==c||e[50]!==f?(q=!f.trim()||c,e[49]=c,e[50]=f,e[51]=q):q=e[51];let z;e[52]!==c||e[53]!==d?(z=c?o.jsxs(o.Fragment,{children:[o.jsx(dt,{className:"size-3.5"}),d("sandbox.sectionRenameDialog.saving")]}):d("sandbox.sectionRenameDialog.save"),e[52]=c,e[53]=d,e[54]=z):z=e[54];let O;e[55]!==q||e[56]!==z?(O=o.jsx(Oe,{type:"submit",disabled:q,children:z}),e[55]=q,e[56]=z,e[57]=O):O=e[57];let Y;e[58]!==W||e[59]!==O?(Y=o.jsxs(us,{children:[W,O]}),e[58]=W,e[59]=O,e[60]=Y):Y=e[60];let U;e[61]!==N||e[62]!==$||e[63]!==Y||e[64]!==A?(U=o.jsx(qt,{className:"sm:max-w-md",children:o.jsxs("form",{onSubmit:N,children:[A,$,Y]})}),e[61]=N,e[62]=$,e[63]=Y,e[64]=A,e[65]=U):U=e[65];let Q;return e[66]!==x||e[67]!==s||e[68]!==U?(Q=o.jsx(Wt,{open:s,onOpenChange:x,children:U}),e[66]=x,e[67]=s,e[68]=U,e[69]=Q):Q=e[69],Q}function Tl(t){const e=re.c(9),{redirect:s}=t,n=s.type;let a;e[0]!==s?(a=hr(s),e[0]=s,e[1]=a):a=e[1];let i;e[2]!==a?(i=o.jsx(qe,{asChild:!0,children:o.jsx("span",{className:"shrink-0 rounded-full bg-muted px-1.5 py-0.5 text-[10px] font-medium tabular-nums text-muted-foreground",children:a})}),e[2]=a,e[3]=i):i=e[3];const l=n==="permanent"?"Permanent":"Temporary";let r;e[4]!==l?(r=o.jsx(We,{side:"left",children:l}),e[4]=l,e[5]=r):r=e[5];let c;return e[6]!==i||e[7]!==r?(c=o.jsxs(Ye,{children:[i,r]}),e[6]=i,e[7]=r,e[8]=c):c=e[8],c}const Al=["draft","active","paused","finished"],El=["launch","seasonal","trend","seo_gap","inventory","partnership","reputation"],Dl=["awareness","education","conversion","retention","repositioning"],Bl=["category","collection"],Ol=3,fo=12,Ll=60,$l=25,Rl=8e3,Fl=2e3,Il="vtex/loaders/intelligentSearch/productList.ts";function Ze(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function xn(t){return typeof t=="string"||typeof t=="number"?String(t):""}function bn(t){const e=Ze(t);return!!e&&typeof e.__resolveType=="string"&&"productId"in e}function Ef(t){if(typeof t=="string")return t?[t]:[];if(Array.isArray(t))return t.every(n=>typeof n=="string")?t:t.map(n=>xn(Ze(n)?.productId));const e=Ze(t),s=Ze(e?.props);return s&&Array.isArray(s.ids)?s.ids.map(xn):e&&"productId"in e?[xn(e.productId)]:[]}function Kl(t){const e=Ze(t)??{};return typeof e.__resolveType=="string"?e.__resolveType:Il}function Ml(t,e){if(typeof t=="string")return e[0]??"";if(Array.isArray(t)){if(t.length>0&&t.every(l=>typeof l=="string"))return e;const i=t.find(bn);if(i)return e.map((l,r)=>{const c=Ze(t[r]);return{...bn(c)?c:{__resolveType:i.__resolveType},productId:l}})}const s=Ze(t);if(bn(s)&&!Ze(s.props)?.ids)return{...s,productId:e[0]??""};const n=Ze(s?.props)??{},a=Kl(t);return{...s??{},__resolveType:a,props:{...n,ids:e,simulationBehavior:n.simulationBehavior??"default"}}}const zl=["title","titleTemplate","description","descriptionTemplate"];function da(t){return typeof t=="string"?t.trim():""}function mo(t){if(!Ii(t))return"";const e=Qo(t);if(!e)return"";const s=[];for(const n of zl){const a=da(e[n]);a&&s.push(`${n}: ${a}`)}return s.join(`
3
3
  `).slice(0,Fl)}function ua(t,e){const s=t[e.key],n=s&&typeof s=="object"?Qo(s.seo):null,a=da(n?.__resolveType);if(a){const i=Ki(a);if(i==="pdp"||i==="plp")return"commerce"}return xr(e.path).length>0?"commerce":e.path==="/"?"home":"institutional"}function Vl(t,e){const s=[],n=new Set;let a=Rl;const i=(d,f)=>{!f||n.has(f)||s.length>=$l||f.length>a||(n.add(f),s.push({key:d,content:f}),a-=f.length)},l=Fi(t);l&&i("site",mo(l.seoData));const r={home:[],institutional:[],commerce:[]};for(const d of e)r[ua(t,d)].push(d);const c=[...r.home,...r.institutional,...r.commerce.slice(0,2)];for(const d of c){const f=t[d.key];!f||typeof f!="object"||i(d.path,mo(f.seo))}return s}const yn={post:"blog/loaders/Blogpost.ts",author:"blog/loaders/Author.ts",category:"blog/loaders/Category.ts"},zn=["posts","authors","categories"],os={posts:"post",authors:"author",categories:"category"};function lt(t){return zn.includes(t)}const en={posts:"post",authors:"author",categories:"category"},fa={posts:yn.post,authors:yn.author,categories:yn.category},Ul=Object.fromEntries(Object.entries(fa).map(([t,e])=>[e,t]));function Gl(t){return typeof t=="string"?Ul[t]??null:null}function je(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function R(t){return typeof t=="string"?t:""}function Hl(t,e){switch(t){case"posts":return{label:R(e.title)||"Untitled post",subtitle:R(e.slug),missing:tn(e)};case"authors":return{label:R(e.name)||"Unnamed author",subtitle:R(e.email),missing:[]};case"categories":return{label:R(e.name)||"Unnamed category",subtitle:R(e.slug),slug:R(e.slug),parentSlug:R(e.parentSlug),missing:ac(e)};default:{const s=t;throw new Error(`Unhandled blog kind: ${String(s)}`)}}}function ma(t){const e={posts:[],authors:[],categories:[]},s=[];for(const[n,a]of Object.entries(t)){const i=je(a);if(!i)continue;const l=Gl(i.__resolveType);if(!l)continue;const r=je(i[en[l]])??{},c={key:n,kind:l,...Hl(l,r)};e[l].push(c),s.push({entry:c,key:Vs(R(r[l==="posts"?"title":"name"]))})}ql(s);for(const n of zn)e[n].sort((a,i)=>a.label.localeCompare(i.label));return e}function ql(t){const e=new Map;for(const{entry:s,key:n}of t){if(!n)continue;const a=`${s.kind}:${n}`;e.set(a,(e.get(a)??0)+1)}for(const{entry:s,key:n}of t)n&&(e.get(`${s.kind}:${n}`)??0)>1&&(s.duplicateName=!0)}function Wl(t,e){return ma(t)[e]}function Ue(t,e){return Wl(t,e).map(s=>({key:s.key,payload:ut(je(t[s.key])??void 0,e)}))}const wn=Object.freeze({});function ut(t,e){return t?je(t[en[e]])??wn:wn}function Gt(t,e,s){return{name:t,__resolveType:fa[e],[en[e]]:s}}function Df({records:t,selected:e,valueField:s,toRef:n}){const a=Array.isArray(e)?e:[],i=p=>typeof p=="string"?p:R(je(p)?.[s]),l=p=>typeof p=="string"?p:R(je(p)?.name),r=p=>{const u=i(p),m=u?t.find(({payload:S})=>R(S[s])===u):void 0;if(m)return m;const x=l(p);return x?t.find(({payload:S})=>R(S.name)===x):void 0},c=t.map(({key:p,payload:u})=>({value:p,label:R(u.name)||R(u[s])||p})),d=new Map,f=[];return a.forEach((p,u)=>{const m=r(p);if(m){f.includes(m.key)||f.push(m.key);return}const x=`unresolved:${u}`;d.set(x,p),f.push(x),c.push({value:x,label:l(p)||i(p)||"Unknown"})}),{options:c,selectedValues:f,refsForValues:p=>p.map(u=>{const m=t.find(x=>x.key===u);return m?n(m.payload):d.get(u)}).filter(u=>u!==void 0)}}function Yl(t){return Ue(t,"authors").map(({payload:e})=>({...e,name:R(e.name),email:R(e.email)})).filter(e=>e.email)}function Me(t){return Array.isArray(t)?t:[]}function et(t){if(typeof t=="string")return t;const e=je(t);return e?R(e.slug):""}function pa(t){if(typeof t=="string")return t;const e=je(t);return e?R(e.email):""}const Ql={title:"sandbox.blogField.title",slug:"sandbox.blogField.slug",category:"sandbox.blogField.category",excerpt:"sandbox.blogField.excerpt",image:"sandbox.blogField.image",name:"sandbox.blogField.name"};function Jl(t,e){return t.map(s=>e(Ql[s])).join(", ")}function tn(t){const e=[];return R(t.title).trim()||e.push("title"),R(t.slug).trim()||e.push("slug"),Me(t.categories).map(et).filter(Boolean).length===0&&e.push("category"),R(t.excerpt).trim()||e.push("excerpt"),R(t.image).trim()||e.push("image"),e}const Vn=["draft","generating","awaiting_review","scheduled","published","archived"],ga=8;function Qt(t){switch(R(t.status)){case"draft":case"idea":return"draft";case"generating":return"generating";case"awaiting_review":case"in_review":return"awaiting_review";case"scheduled":return"scheduled";case"published":return"published";case"archived":return"archived";case"":return"published";default:return"awaiting_review"}}function Bf(t){return Qt(t)==="archived"}function Xl(t,e){return e!=="published"&&e!=="scheduled"||Qt(t)===e?!1:tn(t).length>0}function Zl(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate()+1,ga).toISOString()}function Ks(t,e,s){if(e!=="scheduled")return{...t,status:e,scheduledDatetime:""};const n=R(t.scheduledDatetime);return{...t,status:"scheduled",scheduledDatetime:Number.isNaN(new Date(n).getTime())?Zl(s):n}}function ha(t,e=Da(t)){return Ue(t,"posts").map(({key:s,payload:n})=>({key:s,duplicateTitle:e.has(s),title:R(n.title)||"Untitled post",slug:R(n.slug),date:R(n.date),scheduledDatetime:R(n.scheduledDatetime),categorySlugs:Me(n.categories).map(et).filter(Boolean),authorEmails:Me(n.authors).map(pa).filter(Boolean),missing:tn(n),status:Qt(n),form:"live"}))}const xa="blog-manager/posts/";function ba(t){return t.startsWith(xa)}function as(t){return t.split("/").pop()??t}function Ms(t){return`${xa}${t}`}function ec(t){return`collections/blog/posts/${t}`}function Cn(){return Yt(12)}function tc(t){const e=je(t.planning)??{},s=je(e.format);return{campaignKey:R(e.campaignKey)||void 0,format:s?{name:R(s.name),value:R(s.value)}:void 0,brief:R(e.brief)||void 0}}function ya(t){return{title:t.title,slug:"",excerpt:"",date:t.now.toISOString().slice(0,10),image:"",alt:"",authors:[],categories:[],sections:[],status:"draft",planning:t.planning??{}}}function ft(t,e){return{name:t,[en.posts]:e}}function sc(t,e){return ba(t)?ft(t,e):Gt(t,"posts",e)}function va(t){const e=[];for(const[s,n]of Object.entries(t)){if(!ba(s))continue;const a=je(n);a&&e.push({key:s,payload:ut(a,"posts")})}return e}function ja(t){return[...va(t),...Ue(t,"posts")]}function nc(t){const e=Da(t);return[...va(t).map(({key:n,payload:a})=>({key:n,duplicateTitle:e.has(n),title:R(a.title)||"Untitled post",slug:R(a.slug),date:R(a.date),scheduledDatetime:R(a.scheduledDatetime),categorySlugs:Me(a.categories).map(et).filter(Boolean),authorEmails:Me(a.authors).map(pa).filter(Boolean),missing:tn(a),status:Qt(a),form:"planning"})),...ha(t,e)]}function oc(t,e,s){const n=Ks(t.payload,e,s),a=as(t.key),i=e==="scheduled"||e==="published"?"live":"planning",l=i==="live"?ec(a):Ms(a),r=i==="live"?Gt(l,"posts",n):ft(l,n);return{writes:{[l]:r},deletes:l===t.key?[]:[t.key]}}function Of(t,e,s){const n=Me(t.categories);if(!n.some(c=>et(c)===e))return t;let a=!1;const i=n.map(c=>{const d=et(c);if(d!==e&&d!==s.slug)return c;const f=je(c);return f&&R(f.slug)===s.slug&&R(f.name)===s.name?c:(a=!0,{name:s.name,slug:s.slug})});if(!a){const c=n.map(et).filter(Boolean);if(new Set(c).size===c.length)return t}const l=new Set,r=i.filter(c=>{const d=et(c);return d?l.has(d)?!1:(l.add(d),!0):!0});return{...t,categories:r}}function ac(t){const e=[];return R(t.name).trim()||e.push("name"),R(t.slug).trim()||e.push("slug"),e}function ic(t,e){const s=Me(t.categories);return s.some(n=>et(n)===e)?{...t,categories:s.filter(n=>et(n)!==e)}:t}function Lf(t,e,s){return R(t.parentSlug)!==e?t:{...t,parentSlug:s}}function rc(t){const e=R(t.status),s=e==="idea"||e==="in_review"?{status:Qt(t)}:{};return{...t,...s,dateModified:new Date().toISOString()}}function Yt(t){const e=new Uint8Array(Math.ceil(t/2));return crypto.getRandomValues(e),Array.from(e,s=>s.toString(16).padStart(2,"0")).join("").slice(0,t)}function vn(t,e){const s=`collections/blog/${e}/${Yt(12)}`;if(!Object.hasOwn(t,s))return s;throw new Error("Could not generate a unique blog block key")}function Sa(t){switch(t){case"posts":return{title:"Untitled post",excerpt:"",slug:`untitled-${Yt(8)}`,date:new Date().toISOString().slice(0,10),image:"",alt:"",authors:[],categories:[],sections:[]};case"authors":return{name:"New author",type:"Person",email:"",jobTitle:"",company:"",url:"",avatar:""};case"categories":return{name:"New category",slug:`category-${Yt(8)}`,description:"",sections:[]};default:{const e=t;throw new Error(`Unhandled blog kind: ${String(e)}`)}}}const lc={Paragraph:{title:"Paragraph",description:"Rich text content",iconName:"Pilcrow01"},Heading:{title:"Heading",description:"Section title (H1–H6)",iconName:"HeadingSquare"},Quote:{title:"Quote",description:"Pull quote",iconName:"MessageTextSquare02"},Code:{title:"Code",description:"Code block with syntax highlighting",iconName:"Code02"},List:{title:"List",description:"Bulleted or numbered list",iconName:"List"},BlockImage:{title:"Image",description:"Image with optional caption",iconName:"Image01"},Video:{title:"Video",description:"Embedded video",iconName:"PlayCircle"},Divider:{title:"Divider",description:"Horizontal divider",iconName:"Divider"},Cta:{title:"Call to action",description:"Button linking to a URL",iconName:"CursorClick01"},Callout:{title:"Callout",description:"Highlighted note, tip or warning",iconName:"Lightbulb02"},Stat:{title:"Stat",description:"Single key metric",iconName:"BarChartSquareUp"},StatGroup:{title:"Stat group",description:"Row of metrics",iconName:"BarChartSquare02"},CardGroup:{title:"Card group",description:"Grid of cards",iconName:"LayoutGrid01"},Checklist:{title:"Checklist",description:"List of check items",iconName:"CheckSquare"},Steps:{title:"Steps",description:"Step-by-step guide",iconName:"LayersThree01"},Comparison:{title:"Comparison",description:"Side-by-side comparison",iconName:"Columns03"},Table:{title:"Table",description:"Rows and columns of structured data",iconName:"Table"},ProductCard:{title:"Product card",description:"Single product",iconName:"Tag01"},ProductShelf:{title:"Product shelf",description:"Row of products",iconName:"ShoppingBag01"}},po="Box";function ka(t){return t.startsWith("site/")?"site":"app"}function cc(t){return t.startsWith("http://")||t.startsWith("https://")||t.startsWith("data:")||t.startsWith("/")}function ts(...t){for(const e of t)if(e!==void 0)return e}function go(t){if(t&&!(t.includes("/")||/\.(tsx?|jsx?)$/.test(t)))return t}function dc(t){const e=t.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").trim();return e?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():t}function uc(t,e){const s=Rn(t,e),n=sn(t),a=lc[n],i=ka(t),l=go(s.title),r=go(s.description),c=(i==="site"?ts(l,a?.title):ts(a?.title,l))??dc(n),d=i==="site"?ts(r,a?.description):ts(a?.description,r),f=i==="site"?s.icon:void 0,g=f&&cc(f)?f:void 0,p=g!==void 0?a?.iconName??po:ts(f,a?.iconName)??po;return{resolveType:t,title:c,description:d,iconName:p,iconUrl:g,source:i}}function wa(t,{hideDefaults:e=!1}={}){const s=new Set,n=[],a=t.manifest?.blocks??{};for(const i of Object.values(a))for(const l of Object.keys(i))!mc(l)||s.has(l)||e&&ka(l)==="app"||(s.add(l),n.push(uc(l,t)));return n.sort((i,l)=>i.title.localeCompare(l.title))}function sn(t){return(t.split("/").pop()??t).replace(/\.(tsx?|jsx?)$/,"")}const fc=["blog/sections/blocks/","site/sections/Blog/Post/"];function mc(t){return fc.some(e=>t.startsWith(e))}const pc="blog-manager-brand",gc="blog-manager-context",Ca=["companyName","description","language","storeUrl","targetAudience","values","competitors","keywords","commercialPolicies","specialDates"],Na=["tone","dos","avoid","categories","vocabulary","voiceExamples"];function $f(t){return je(t)??wn}function zs(t,e){const s={};for(const n of e)n in t&&(s[n]=t[n]);return s}function Rf(t,e,s){const n=zs(t,Ca);if(je(s))return n;const a=je(e)??{};return{...zs(a,Na),...n}}function hc(t,e){const s=je(t)??{},n=je(e),a=zs(s,Ca),i=n??zs(s,Na);return{brand:a,context:i,merged:{...a,...i}}}function _a(t){return hc(t[pc],t[gc])}function xc(t){return{companyName:R(t.companyName),description:R(t.description),language:R(t.language),storeUrl:Mr(R(t.storeUrl))??"",tone:R(t.tone),targetAudience:R(t.targetAudience),values:Ke(Ie(t.values)),competitors:Ke(Ie(t.competitors)),specialDates:Ke(Ie(t.specialDates)),dos:Ke(Ie(t.dos)),avoid:Ke(Ie(t.avoid)),keywords:cs(ls(t.keywords)),commercialPolicies:Ke(Ie(t.commercialPolicies)),vocabulary:Ke(Ie(t.vocabulary)),voiceExamples:_n(Nn(t.voiceExamples))}}function Nn(t){if(!Array.isArray(t))return[];const e=[];for(const s of t){if(typeof s=="string"){s.trim()&&e.push({text:s,sounds:!0});continue}const n=je(s);if(!n)continue;const a=R(n.text)||R(n.value);e.push({text:a,sounds:n.sounds!==!1})}return e}function _n(t){return t.filter(e=>e.text.trim())}function Ff(t,e,s){const n=[];for(const a of s.textFields){const i=R(e[a]).trim();i&&(s.mode==="empty"&&R(t[a]).trim()||(t[a]=i,n.push(a)))}for(const a of s.ruleFields){const i=Ke(Ie(e[a]));i.length!==0&&(s.mode==="empty"&&Ke(Ie(t[a])).length>0||(t[a]=i,n.push(a)))}for(const a of s.termFields??[]){const i=cs(ls(e[a]));i.length!==0&&(s.mode==="empty"&&cs(ls(t[a])).length>0||(t[a]=i,n.push(a)))}for(const a of s.exampleFields??[]){const i=_n(Nn(e[a]));i.length!==0&&(s.mode==="empty"&&_n(Nn(t[a])).length>0||(t[a]=i,n.push(a)))}return n}function ls(t){if(!Array.isArray(t))return[];const e=[];for(const s of t){if(typeof s=="string"){e.push(s);continue}const n=je(s);n&&e.push(R(n.name)||R(n.value))}return e}function cs(t){return t.filter(e=>e.trim())}function Ie(t){if(!Array.isArray(t))return[];const e=[];for(const s of t){if(typeof s=="string"){s.trim()&&e.push({name:s,value:""});continue}const n=je(s);n&&e.push({name:R(n.name),value:R(n.value)})}return e}function Ke(t){return t.filter(e=>e.name.trim()||e.value.trim())}const bc=6e4,yc=4e3;function vc(t){const e=[],s=new Set,n=(a,i)=>{if(typeof a=="string"){if(!a.includes(" ")||a.length<4||/^(https?:)?\/\//.test(a)||/^data:/.test(a))return;const l=`${i}: ${a.trim()}`;if(s.has(l))return;s.add(l),e.push(l);return}if(Array.isArray(a)){for(const l of a)n(l,i);return}if(a&&typeof a=="object")for(const[l,r]of Object.entries(a))l!=="__resolveType"&&n(r,l)};return n(t,"block"),e.join(`
4
4
  `)}function If(t,e){const s=new Map,n=p=>{const u=s.get(p);if(u!==void 0)return u;const m=vc(t[p]).slice(0,yc);return s.set(p,m),m},a=(p,u)=>n(u).length-n(p).length,i=Vl(t,e),l=i.reduce((p,u)=>p+u.content.length,0),r={home:[],institutional:[],commerce:[]};for(const p of e)r[ua(t,p)].push(p.key);const c=[...Ue(t,"posts").map(p=>p.key).sort(a),...Ue(t,"categories").map(p=>p.key),...r.home,...r.institutional.sort(a),...r.commerce.sort(a)],d=[],f=new Set;let g=Math.max(0,bc-l);for(const p of c){if(d.length>=Ll)break;if(f.has(p)||!t[p])continue;f.add(p);const u=n(p);if(u.length>g)break;d.push({key:p,content:u}),g-=u.length}return{blocks:d,seo:i}}const Pa="blog-manager/campaigns/";function Kf(){return`${Pa}${crypto.randomUUID()}`}function Ds(t,e,s){return t.find(n=>n===e)??s}function ho(t){return R(t)||null}function jc(t){const e=[];for(const s of Me(t)){const n=je(s);n&&e.push({kind:Ds(Bl,n.kind,"category"),id:R(n.id),name:R(n.name),url:R(n.url),description:R(n.description)})}return e}function Sc(t){const e=Me(t.images).map(n=>R(n));return(e.length>0?e:[R(t.image)].filter(Boolean)).slice(0,Ol)}function kc(t){const e=[];for(const s of Me(t)){const n=je(s);n&&e.push({id:R(n.id),name:R(n.name),url:R(n.url),images:Sc(n),category:R(n.category),description:R(n.description)})}return e}function Mf(t,e){return{name:t,campaignName:e.name,seedKey:e.seedKey,status:e.status,period:{start:e.period.start??"",end:e.period.end??""},trigger:{type:e.trigger.type,note:e.trigger.note},intent:{objective:e.intent.objective,targets:e.intent.targets,products:e.intent.products,keywords:e.intent.keywords},guardrails:{avoidComplements:e.guardrails.avoidComplements,toneOverrides:e.guardrails.toneOverrides},createdAt:e.createdAt,updatedAt:e.updatedAt}}function wc(t){const e=[];for(const[s,n]of Object.entries(t)){if(!s.startsWith(Pa))continue;const a=je(n);if(!a)continue;const i=je(a.period)??{},l=je(a.trigger)??{},r=je(a.intent)??{},c=je(a.guardrails)??{};e.push({key:s,name:R(a.campaignName),seedKey:R(a.seedKey),status:Ds(Al,a.status,"draft"),period:{start:ho(i.start),end:ho(i.end)},trigger:{type:Ds(El,l.type,"seasonal"),note:R(l.note)},intent:{objective:Ds(Dl,r.objective,"awareness"),targets:jc(r.targets),products:kc(r.products),keywords:cs(ls(r.keywords))},guardrails:{avoidComplements:Ie(c.avoidComplements),toneOverrides:R(c.toneOverrides)},createdAt:R(a.createdAt),updatedAt:R(a.updatedAt)})}return e.sort((s,n)=>n.createdAt.localeCompare(s.createdAt)||s.name.localeCompare(n.name))}function zf(t){const e=t.toISOString();return{name:"",seedKey:"",status:"draft",period:{start:null,end:null},trigger:{type:"seasonal",note:""},intent:{objective:"awareness",targets:[],products:[],keywords:[]},guardrails:{avoidComplements:[],toneOverrides:""},createdAt:e,updatedAt:e}}const Ta="blog-manager/campaign-seeds/";function Vf(){return`${Ta}${crypto.randomUUID()}`}function Uf(t,e){return{name:t,seedName:e.name,keywords:e.keywords,prompt:e.prompt,createdAt:e.createdAt,updatedAt:e.updatedAt}}function Gf(t){const e=[];for(const[s,n]of Object.entries(t)){if(!s.startsWith(Ta))continue;const a=je(n);a&&e.push({key:s,name:R(a.seedName),keywords:cs(ls(a.keywords)),prompt:R(a.prompt),createdAt:R(a.createdAt),updatedAt:R(a.updatedAt)})}return e.sort((s,n)=>n.createdAt.localeCompare(s.createdAt)||s.name.localeCompare(n.name))}function Hf(t){const e=t.toISOString();return{name:"",keywords:[],prompt:"",createdAt:e,updatedAt:e}}const Cc="blog-manager-formats",Nc=40;function qf(t){return Ue(t,"posts").slice(0,Nc).map(({key:e,payload:s})=>({key:e,title:R(s.title),sections:Me(s.sections).map(n=>R(je(n)?.__resolveType)).filter(Boolean).map(sn)}))}function _c(t,e){return wa(t,e).map(s=>({name:sn(s.resolveType),resolveType:s.resolveType,title:s.title,description:s.description}))}function Aa(t,e={}){const s=new Set,n=/\[@[^\]]+\]\(([^)\s]+)\)/g;for(const i of t.matchAll(n))i[1]&&s.add(i[1]);const a=/(?:^|[\s([{>])@([A-Za-z][\w-]*)/g;for(const i of t.replace(n," ").matchAll(a)){const l=i[1];l&&s.add(e[l]??l)}return[...s]}function Wf(t,e,s={}){const n=new Set(e);return Aa(t,s).filter(a=>!n.has(a))}function Yf(t,e){const s=/\[@[^\]]+\]\([^)\s]+\)/g,n=[];let a=0;for(const i of t.matchAll(s)){const l=i.index??0;n.push(xo(t.slice(a,l),e),i[0]),a=l+i[0].length}return n.push(xo(t.slice(a),e)),n.join("")}function xo(t,e){return t.replace(/(^|[\s([{>])@([A-Za-z][\w-]*)/g,(s,n,a)=>{const i=e[a];return i?`${n}[@${a}](${i})`:s})}const Pc=["Heading","Paragraph","BlockImage","List","Cta"];function Qf(t){return Pc.filter(e=>e in t)}function Vs(t){return t.normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").toLowerCase().replace(/\s+/g," ").trim()}function Jf(t,e,s,n){const a=Vs(n);return a?Ea(t,e).some(i=>i.key!==s&&Vs(i.name)===a):!1}function Ea(t,e){return e!=="posts"?Ue(t,e).map(({key:s,payload:n})=>({key:s,name:R(n.name)})):ja(t).map(({key:s,payload:n})=>({key:s,name:R(n.title)}))}function Da(t){const e=new Map;for(const{key:n,name:a}of Ea(t,"posts")){const i=Vs(a);if(!i)continue;const l=e.get(i);l?l.push(n):e.set(i,[n])}const s=new Set;for(const n of e.values())if(n.length>1)for(const a of n)s.add(a);return s}const Tc=["companyName","language","description","tone","targetAudience"];function Ac(t){const e=je(t)??{},s=[];for(const n of Tc)R(e[n]).trim()||s.push(n);return Ke(Ie(e.dos)).length===0&&s.push("dos"),Ke(Ie(e.avoid)).length===0&&s.push("avoid"),s}function Ec(t,e){const s=t.required;if(!Array.isArray(s))return;const n=new Set(e&&typeof e=="object"?Object.keys(e):[]),a=s.filter(i=>typeof i=="string"&&n.has(i));return a.length>0?a:void 0}const Dc=6,Bc=6e3;function Oc(t){const e=t.schema??{},s=e.$defs??e.definitions;return s&&typeof s=="object"?s:{}}function Lc(t,e){for(const s of Object.values(e.manifest?.blocks??{})){const n=s[t];if(n)return n}}function Bs(t,e,s){if(Array.isArray(t))return t.map(i=>Bs(i,e,s));if(!t||typeof t!="object")return t;const n=t;if(typeof n.$ref=="string"){if(s>=Dc)return{};const i=n.$ref.split("/").pop()??"",l=e[i];return l===void 0?{}:Bs(l,e,s+1)}const a={};for(const[i,l]of Object.entries(n))a[i]=Bs(l,e,s);return a}function $c(t,e){const s=Oc(e),n=Bs(Lc(t,e),s,0);if(!n||typeof n!="object")return{};const a=n,i=a.allOf,l=Array.isArray(i)&&i.length===1?i[0]:a;if(!l||typeof l!="object")return{};const{$schema:r,...c}=l,d=bo(c);return JSON.stringify(d).length>Bc?bo(c,!0):d}function bo(t,e=!1){const s={...t},n=s.properties;if(n&&typeof n=="object"){const a=Object.fromEntries(Object.entries(n).filter(([i])=>!i.startsWith("__")).map(([i,l])=>[i,e?Ba(l):l]));s.properties=a,s.required=Ec(s,a),s.required||delete s.required}return s}function Ba(t){if(!t||typeof t!="object")return t;const e=t,s={};for(const n of["type","description","format","options","enum"])n in e&&(s[n]=e[n]);return Array.isArray(e.anyOf)&&(s.anyOf=e.anyOf.map(Ba)),s}function Rc(t){if(t==null)return null;if(Array.isArray(t))return"array";const e=typeof t;return e==="number"||e==="boolean"||e==="string"||e==="object"?e:null}function Fc(t,e){const s=t.properties;if(!e||!s||typeof s!="object")return t;const n=s;let a=!1;const i={};for(const[l,r]of Object.entries(n)){const c=r&&typeof r=="object"?{...r}:r,d=c?.type,f=Rc(e[l]);c&&typeof c=="object"&&f&&typeof d=="string"&&d!==f&&(delete c.type,delete c.enum,a=!0),i[l]=c}return a?{...t,properties:i}:t}const Ic={Paragraph:{html:"<p>A dúvida entre 9000 ou 12000 BTUs é a mais comum na hora de escolher.</p>"},Heading:{text:"Antes de escolher: o resumo",level:"h2"},Quote:{quote:"Levei só a mala de bordo e não senti falta de nada.",attribution:"Ana, leitora"},List:{items:`<strong>Tecnologia Inverter:</strong> temperatura mais estável;
5
5
  <strong>Gaveta HortiNatura:</strong> frescor por duas vezes mais tempo;`,style:"unordered"},BlockImage:{url:"https://cdn.exemplo.com/2026/10/mochila.webp",alt:"Mochila escolar azul apoiada em uma cadeira de sala de aula",size:"full"},Video:{url:"https://www.youtube.com/watch?v=dQw4w9WgXcQ",caption:"Como medir a capacidade da mala"},Divider:{},Cta:{text:"Ver toda a linha Escolar",href:"/escolar"},Callout:{title:"VOCÊ SABIA?",body:"Pediatras recomendam que a mochila carregada não passe de 10% do peso da criança.",variant:"tip"},Code:{code:"const total = itens.length;",language:"ts"},Stat:{value:"30%",label:"menos desperdício",description:"Comparado ao modelo anterior da mesma linha."},StatGroup:{stats:'[{"value":"30%","label":"menos desperdício"},{"value":"2x","label":"mais frescor"}]'},CardGroup:{cards:'[{"title":"Pré-escola","body":"Pouco material, mochila pequena."},{"title":"Fundamental","body":"Cadernos e livros pesam; considere rodinhas."}]'},Checklist:{title:"Antes de comprar, confira",items:'["Capacidade em litros","Alças acolchoadas","Compartimento para notebook"]'},Steps:{title:"Como medir",steps:'[{"title":"Meça a altura","description":"Da base ao topo, sem as alças."},{"title":"Some a profundidade"}]'},Comparison:{left:'{"title":"Com rodinhas","items":["Poupa a coluna","Mais pesada vazia"]}',right:'{"title":"De costas","items":["Mais leve","Exige ajuste das alças"]}'},Table:{headers:'["Modelo","Capacidade","Preço"]',rows:'[["Bordo","38L","R$ 399"],["Média","68L","R$ 599"]]'}},Kc=600;function Mc(t,e){for(const{payload:s}of Ue(e,"posts"))for(const n of Me(s.sections)){const a=je(n);if(!a||a.__resolveType!==t)continue;const{__resolveType:i,...l}=a;if(Object.keys(l).length!==0&&!(JSON.stringify(l).length>Kc))return l}}function zc(t,e,s,n){const a=_c(e,n),i=Un(e,n),l=new Set(Aa(t.value,i)),r=a.filter(g=>l.has(g.resolveType)),c=r.length>0?r:a,d=new Set,f=[];for(const g of c){if(d.has(g.name)||i[g.name]!==g.resolveType)continue;d.add(g.name);const p=Mc(g.resolveType,s)??Ic[g.name];f.push({name:g.name,title:g.title,description:g.description??"",schema:Fc($c(g.resolveType,e),p),example:p})}return f}function Un(t,e){const s={};for(const n of wa(t,e)){const a=sn(n.resolveType);a in s||(s[a]=n.resolveType)}return s}function Vc(t,e,s={}){const n=[];for(const a of t){const i=e[a.type];if(!i)continue;const l=Hc(a.props,a.productIds??[],s[a.type]);n.push({__resolveType:i,...l})}return n}const Uc=["product","products"];function Gc(t){const e=je(t);return e?Uc.find(s=>s in e)??null:null}function Hc(t,e,s){const n=e.filter(Boolean),a=Gc(s);if(n.length===0||!a)return t;const i=s[a];return{...t,[a]:Ml(i,n)}}const Gn=80;function Oa(t){return t.normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,Gn)}function Xf(t){return t.normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+/,"").slice(0,Gn)}function yo(t,e){const s=Gn-e.length-1;return`${t.slice(0,s).replace(/-+$/,"")}-${e}`}function La(t,e,s){const n=Oa(t)||`${s}-${Yt(6)}`,a=new Set(e);if(!a.has(n))return n;for(let i=2;i<100;i++){const l=yo(n,String(i));if(!a.has(l))return l}return yo(n,Yt(4))}function $a(t,e){return La(t,e,"post")}function qc(t,e){return La(t,e,"category")}function Wc({draft:t,resolveTypes:e,productShapes:s,categories:n,authors:a,planning:i,takenSlugs:l,now:r}){const c=new Set(t.categorySlugs),d=new Set(t.authorEmails),f={title:t.title,slug:$a(t.title,l),date:r.toISOString().slice(0,10),excerpt:t.excerpt,image:t.cover.url,alt:t.cover.alt,authors:a.filter(g=>d.has(g.email)),categories:n.filter(g=>c.has(g.slug)),seo:{title:t.seo.title,description:t.seo.description,image:t.cover.url},sections:Vc(t.sections,e,s),planning:i??{}};return Ks(f,"awaiting_review",r)}const Zf=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],em=["January","February","March","April","May","June","July","August","September","October","November","December"],Ra=1440*60*1e3;function mt(t){const e=new Date(t);return e.setHours(0,0,0,0),e}function tm(t){return new Date(t.getFullYear(),t.getMonth(),1)}function sm(t,e){return new Date(t.getFullYear(),t.getMonth()+e,1)}function Us(t,e){const s=new Date(t);return s.setDate(s.getDate()+e),s}function Pn(t,e){return Math.round((mt(t).getTime()-mt(e).getTime())/Ra)}function Yc(t){const e=(t.getTime()-mt(t).getTime())/Ra;return Math.min(Math.max(e,0),1)}function vo(t,e){return Pn(t,e)+Yc(t)}function nm(t){const e=Us(t,-t.getDay()),s=[];for(let n=0;n<6;n++){const a=[];for(let i=0;i<7;i++)a.push(Us(e,n*7+i));s.push(a)}for(;s.length>0&&s[s.length-1].every(n=>n.getMonth()!==t.getMonth());)s.pop();return s}function om(t,e){const s=mt(t[0]),n=Us(s,7),a=s.getTime(),i=n.getTime(),l=[];for(const d of e){const f=mt(d.start),g=mt(d.end);if(g.getTime()<s.getTime()||f.getTime()>=n.getTime())continue;const p=f.getTime()<s.getTime()?s:f,u=g.getTime()>=n.getTime()?Us(n,-1):g,m=Pn(p,s),x=Pn(u,p)+1;if(x<=0)continue;const S=Math.max(d.start.getTime(),a),N=Math.min(d.end.getTime(),i),j=vo(new Date(S),s),b=Math.max(vo(new Date(N),s)-j,0);b<=0||l.push({variant:d,startCol:m,span:x,leftUnits:j,widthUnits:b})}l.sort((d,f)=>d.startCol-f.startCol||f.span-d.span||d.variant.blockKey.localeCompare(f.variant.blockKey));const r=[],c=[];for(const d of l){let f=r.findIndex(g=>g<=d.startCol);f===-1&&(f=r.length,r.push(0)),r[f]=d.startCol+d.span,c.push({...d,lane:f})}return c}function Gs(t){const e=String(t.getMonth()+1).padStart(2,"0"),s=String(t.getDate()).padStart(2,"0");return`${t.getFullYear()}-${e}-${s}`}const Fa=/^(\d{4})-(\d{2})-(\d{2})$/;function Hs(t){const e=t.trim();if(!e)return null;const s=Fa.exec(e);if(s){const a=Number(s[1]),i=Number(s[2])-1,l=Number(s[3]),r=new Date(a,i,l);return r.getMonth()===i&&r.getDate()===l?r:null}const n=new Date(e);return Number.isNaN(n.getTime())?null:mt(n)}function Qc(t){const e=new Date(t.getFullYear(),t.getMonth(),t.getDate(),ga);return{...Sa("posts"),status:"scheduled",scheduledDatetime:e.toISOString(),date:Gs(t)}}function Jc(t){if(typeof t!="string")return null;const e=t.trim();if(!e)return null;if(Fa.test(e))return Hs(e);const s=new Date(e);return Number.isNaN(s.getTime())?null:s}function Xc(t,e){const s=Jc(t.scheduledDatetime);if(!s)return null;const n=new Date(e.getFullYear(),e.getMonth(),e.getDate(),s.getHours(),s.getMinutes(),s.getSeconds(),s.getMilliseconds()),a={...t,scheduledDatetime:n.toISOString()};return(typeof t.date=="string"?t.date:"")===Gs(s)&&(a.date=Gs(n)),a}function Zc(t){return Hs(t.scheduledDatetime)??Hs(t.date)}function am(t){const e=new Map,s=[];for(const a of t){const i={post:a,scheduled:Hs(a.scheduledDatetime)!==null},l=Zc(a);if(!l){s.push(i);continue}const r=Gs(l),c=e.get(r);c?c.push(i):e.set(r,[i])}const n=(a,i)=>Number(i.scheduled)-Number(a.scheduled)||a.post.title.localeCompare(i.post.title);for(const a of e.values())a.sort(n);return s.sort(n),{byDay:e,undated:s}}function ed(t){const e=re.c(50),{orgSlug:s,virtualMcpId:n,branch:a}=t,i=Qa(),l=Ys()?.taskId??null,r=Si(n),c=sa(n).runtime==="cms",{url:d}=ki(n),f=Ln(n,a),g=f.kind==="protocol"?f:null;let p;e[0]!==a||e[1]!==s||e[2]!==n?(p={orgSlug:s,virtualMcpId:n,branch:a},e[0]=a,e[1]=s,e[2]=n,e[3]=p):p=e[3];const u=wi(p);let m;e[4]!==u?(m=jn.decofile(u),e[4]=u,e[5]=m):m=e[5];const x=m;let S;e[6]!==a||e[7]!==c||e[8]!==d||e[9]!==s||e[10]!==r||e[11]!==i||e[12]!==l||e[13]!==n?(S=async(T,D)=>{if(d)return{ok:!0};if(c){const B=await Ni({orgSlug:s,virtualMcpId:n,branch:a},{set:T,delete:D});return _i(i,{orgSlug:s,virtualMcpId:n,branch:a},B),await i.invalidateQueries({queryKey:zr({orgSlug:s,virtualMcpId:n,branch:a,threadId:l})}),B}const P={orgSlug:s,virtualMcpId:n,branch:a,threadId:l};for(const[B,C]of Object.entries(T)){const $=await fetch(no(P,"write"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:Xn(r,oo(B)),content:JSON.stringify(C,null,2)})});if(!$.ok)return Zn($,"Write")}for(const B of D){const C=await fetch(no(P,"unlink"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:Xn(r,oo(B))})});if(!C.ok)return Zn(C,"Delete")}return{ok:!0}},e[6]=a,e[7]=c,e[8]=d,e[9]=s,e[10]=r,e[11]=i,e[12]=l,e[13]=n,e[14]=S):S=e[14];const N=S;let j;e[15]!==a||e[16]!==s||e[17]!==n?(j=Pi(s,n,a),e[15]=a,e[16]=s,e[17]=n,e[18]=j):j=e[18];let b;e[19]!==a||e[20]!==s||e[21]!==n?(b=Ci(s,n,a),e[19]=a,e[20]=s,e[21]=n,e[22]=b):b=e[22];let h;e[23]!==f||e[24]!==a||e[25]!==u||e[26]!==N||e[27]!==s||e[28]!==g||e[29]!==i||e[30]!==n?(h=async T=>{const{writes:D,deletes:P}=T,B=br(D);return g?Ti(i,g,{orgSlug:s,virtualMcpId:n,branch:a},u,{set:B,delete:P.filter(C=>!(C in B))}):Ai({queryClient:i,orgSlug:s,virtualMcpId:n,branch:a,backend:f,cacheKey:u},{kind:"edit",write:()=>N(B,P)})},e[23]=f,e[24]=a,e[25]=u,e[26]=N,e[27]=s,e[28]=g,e[29]=i,e[30]=n,e[31]=h):h=e[31];let k;e[32]!==a||e[33]!==s||e[34]!==i||e[35]!==n?(k=()=>{i.invalidateQueries({queryKey:jn.liveMeta(s,n,a)})},e[32]=a,e[33]=s,e[34]=i,e[35]=n,e[36]=k):k=e[36];let A;e[37]!==j||e[38]!==b||e[39]!==h||e[40]!==k?(A={mutationKey:j,scope:b,mutationFn:h,onSuccess:k},e[37]=j,e[38]=b,e[39]=h,e[40]=k,e[41]=A):A=e[41];const _=Ja(A);let v;e[42]!==_||e[43]!==i||e[44]!==x?(v=async T=>{const D=[...Object.keys(T.writes),...T.deletes],P=i.getQueryData(x),B=new Map;for(const C of D)P&&C in P&&B.set(C,P[C]);i.setQueryData(x,C=>td(C,T)),i.cancelQueries({queryKey:x});try{return await _.mutateAsync(T)}catch(C){const $=C;throw i.setQueryData(x,V=>{if(!V)return V;const I={...V};for(const W of D)B.has(W)?I[W]=B.get(W):delete I[W];return I}),$}},e[42]=_,e[43]=i,e[44]=x,e[45]=v):v=e[45];const E=v;let L;return e[46]!==E||e[47]!==_.isError||e[48]!==_.isPending?(L={move:E,isPending:_.isPending,isError:_.isError},e[46]=E,e[47]=_.isError,e[48]=_.isPending,e[49]=L):L=e[49],L}function td(t,{writes:e,deletes:s}){const n={...t??{},...e};for(const a of s)a in e||delete n[a];return n}const qs={draft:"sandbox.postBoard.laneDraft",generating:"sandbox.postBoard.laneGenerating",awaiting_review:"sandbox.postBoard.laneAwaitingReview",scheduled:"sandbox.postBoard.laneScheduled",published:"sandbox.postBoard.lanePublished",archived:"sandbox.postBoard.laneArchived"};function sd({orgSlug:t,virtualMcpId:e,branch:s,decofile:n,onMoved:a}){const i=Ce(),l=ed({orgSlug:t,virtualMcpId:e,branch:s}),[r,c]=F.useState(new Set),d=u=>ut(n[u],"posts"),f=(u,m,x=d(u))=>m==="generating"?{kind:"not-a-target"}:r.has(as(u))?{kind:"in-flight"}:Xl(x,m)?{kind:"incomplete"}:null,g=u=>{switch(u.kind){case"incomplete":return i("sandbox.postBoard.moveBlocked");case"in-flight":return i("sandbox.postBoard.moveInFlight");case"not-a-target":return i("sandbox.postBoard.moveNotATarget");default:return String(u)}};return{apply:async(u,m,x)=>{const S=x??d(u);if(Qt(S)===m)return null;const N=f(u,m,S);if(N)return N.kind!=="in-flight"&&pe.error(g(N)),null;const j=as(u);c(k=>new Set(k).add(j));const b=oc({key:u,payload:S},m,new Date),h=Object.keys(b.writes)[0]??u;h!==u&&a?.(u,h);try{return await l.move(b),h}catch(k){return h!==u&&a?.(h,u),pe.error(k instanceof Error?k.message:i("sandbox.postBoard.moveFailed")),null}finally{c(k=>{const A=new Set(k);return A.delete(j),A})}},refuse:f,reasonText:g,isMoving:u=>r.has(as(u))}}function Ia(){return Lo("hide_default_blog_blocks")}function nd(t){const e=re.c(15),{value:s,onChange:n,placeholder:a,className:i,onFocus:l,onBlur:r,onKeyDown:c,spellCheck:d,readOnly:f,inputRef:g}=t,p=d===void 0?!0:d;let u;e[0]!==n?(u=S=>n(S.target.value),e[0]=n,e[1]=u):u=e[1];let m;e[2]!==i?(m=ve("w-full resize-none border-0 bg-transparent p-0 outline-none [field-sizing:content] placeholder:text-muted-foreground/50 focus:ring-0",i),e[2]=i,e[3]=m):m=e[3];let x;return e[4]!==g||e[5]!==r||e[6]!==l||e[7]!==c||e[8]!==a||e[9]!==f||e[10]!==p||e[11]!==u||e[12]!==m||e[13]!==s?(x=o.jsx("textarea",{ref:g,value:s,onChange:u,onInput:od,onFocus:l,onBlur:r,onKeyDown:c,placeholder:a,spellCheck:p,readOnly:f,rows:1,className:m}),e[4]=g,e[5]=r,e[6]=l,e[7]=c,e[8]=a,e[9]=f,e[10]=p,e[11]=u,e[12]=m,e[13]=s,e[14]=x):x=e[14],x}function od(t){const e=t.currentTarget;e.style.height="auto",e.style.height=`${e.scrollHeight}px`}function Ve(t){return typeof t=="string"?t:""}function im(t){const e=re.c(11);let s,n;e[0]!==t?({className:s,...n}=t,e[0]=t,e[1]=s,e[2]=n):(s=e[1],n=e[2]);let a;e[3]!==s?(a=ve(s,"pr-9"),e[3]=s,e[4]=a):a=e[4];let i;e[5]!==n||e[6]!==a?(i=o.jsx(nd,{...n,className:a}),e[5]=n,e[6]=a,e[7]=i):i=e[7];let l;e[8]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx(oi,{size:18,"aria-hidden":!0,className:"pointer-events-none absolute right-2 top-3 text-muted-foreground/40 transition-opacity group-hover/editable:text-muted-foreground group-focus-within/editable:text-muted-foreground"}),e[8]=l):l=e[8];let r;return e[9]!==i?(r=o.jsxs("div",{className:"group/editable relative -mx-2 rounded-md px-2 transition-colors hover:bg-muted/50 focus-within:bg-muted/50",children:[i,l]}),e[9]=i,e[10]=r):r=e[10],r}function rm(t){const e=re.c(5),{label:s,onClick:n,disabled:a}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx(On,{size:13}),e[0]=i):i=e[0];let l;return e[1]!==a||e[2]!==s||e[3]!==n?(l=o.jsxs("button",{type:"button",onClick:n,disabled:a,className:"flex items-center gap-1.5 rounded-lg border border-dashed px-2.5 py-1.5 text-xs text-muted-foreground transition-colors hover:border-foreground/30 hover:text-foreground disabled:opacity-40 disabled:hover:border-dashed disabled:hover:text-muted-foreground cursor-pointer",children:[i,s]}),e[1]=a,e[2]=s,e[3]=n,e[4]=l):l=e[4],l}function lm(t){const e=re.c(4),{label:s,onClick:n}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx(Kn,{size:13}),e[0]=a):a=e[0];let i;return e[1]!==s||e[2]!==n?(i=o.jsx("button",{type:"button","aria-label":s,onClick:n,className:"flex h-6 w-6 shrink-0 items-center justify-center text-muted-foreground/60 opacity-0 transition-opacity hover:text-destructive group-hover/item:opacity-100 cursor-pointer rounded-lg",children:a}),e[1]=s,e[2]=n,e[3]=i):i=e[3],i}function cm(t){const e=re.c(2),{children:s}=t;let n;return e[0]!==s?(n=o.jsx("div",{className:"absolute -top-9 left-0 z-10 flex items-center gap-0.5 rounded-md border bg-popover p-0.5 shadow-md",children:s}),e[0]=s,e[1]=n):n=e[1],n}function dm(t){if(Array.isArray(t))return t;if(typeof t!="string"||t.trim()==="")return[];try{const e=JSON.parse(t);return Array.isArray(e)?e:[]}catch{return[]}}function jo(t){const e=re.c(14),{options:s,value:n,emptyLabel:a,onChange:i}=t;let l;e[0]!==a||e[1]!==i||e[2]!==n?(l=a&&o.jsx(So,{active:!n,onClick:()=>i(""),children:a}),e[0]=a,e[1]=i,e[2]=n,e[3]=l):l=e[3];let r;if(e[4]!==i||e[5]!==s||e[6]!==n){let d;e[8]!==i||e[9]!==n?(d=f=>o.jsx(So,{active:f===n,onClick:()=>i(f),children:f},f),e[8]=i,e[9]=n,e[10]=d):d=e[10],r=s.filter(Boolean).map(d),e[4]=i,e[5]=s,e[6]=n,e[7]=r}else r=e[7];let c;return e[11]!==l||e[12]!==r?(c=o.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[l,r]}),e[11]=l,e[12]=r,e[13]=c):c=e[13],c}function So(t){const e=re.c(7),{active:s,onClick:n,children:a}=t,i=s?"border-primary bg-primary text-primary-foreground":"bg-card hover:bg-muted";let l;e[0]!==i?(l=ve("cursor-pointer rounded-md border px-2.5 py-1 text-xs font-medium transition-colors",i),e[0]=i,e[1]=l):l=e[1];let r;return e[2]!==s||e[3]!==a||e[4]!==n||e[5]!==l?(r=o.jsx("button",{type:"button","aria-pressed":s,onClick:n,className:l,children:a}),e[2]=s,e[3]=a,e[4]=n,e[5]=l,e[6]=r):r=e[6],r}function um(t,e=[]){return typeof t=="string"?t:JSON.stringify(t??e)}const _s=[{id:"campaign",label:"sandbox.generatePost.stepCampaign"},{id:"format",label:"sandbox.generatePost.stepFormat"},{id:"extra",label:"sandbox.generatePost.stepExtra"}],ad=[1,2,3],id={companyName:"sandbox.blogBrand.companyNameLabel",language:"sandbox.blogBrand.languageLabel",description:"sandbox.blogBrand.descriptionLabel",tone:"sandbox.blogBrand.toneLabel",targetAudience:"sandbox.blogBrand.audienceLabel",dos:"sandbox.blogBrand.tabDos",avoid:"sandbox.blogBrand.tabGuardrails"};function rd({open:t,onOpenChange:e,decofile:s,hasAi:n,onGenerate:a}){const i=Ce(),l=Hr(),[r,c]=F.useState("campaign"),[d,f]=F.useState(""),[g,p]=F.useState(""),[u,m]=F.useState(""),[x,S]=F.useState(""),[N,j]=F.useState(1),{merged:b}=_a(s),h=Ac(b),k=wc(s).filter(C=>C.status!=="finished"),A=k.find(C=>C.key===d),_=s[Cc],v=Ke(Ie(_?.formats)),E=()=>{c("campaign"),f(""),p(""),m(""),S(""),j(1)},L=C=>{e(C),C||E()},T=_s.findIndex(C=>C.id===r),D=r==="campaign"?!!A:r==="format"?g.trim().length>0&&u.trim().length>0:!0,P=r==="extra",B=()=>{A&&(a({campaign:A,format:{name:g.trim(),value:u.trim()},extraInstructions:x.trim()||void 0,count:N,fileConfigId:Mi(l.data?.configs??[],null,typeof window<"u"?window.localStorage.getItem(zi):null)??void 0}),L(!1))};return o.jsx(Wt,{open:t,onOpenChange:L,children:o.jsxs(qt,{className:"flex max-h-[85vh] flex-col sm:max-w-2xl",children:[o.jsxs(ds,{children:[o.jsx(Ht,{children:i("sandbox.generatePost.title")}),o.jsx(An,{children:i("sandbox.generatePost.subtitle")})]}),h.length>0?o.jsx("p",{className:"text-sm text-muted-foreground",children:i("sandbox.generatePost.blockedBrand",{fields:h.map(C=>i(id[C])).join(", ")})}):o.jsxs(o.Fragment,{children:[o.jsx("ol",{className:"flex shrink-0 items-center gap-1.5 text-xs",children:_s.map((C,$)=>o.jsx("li",{className:ve("rounded-md px-2 py-1",$===T?"bg-primary text-primary-foreground":$<T?"text-foreground":"text-muted-foreground"),children:i(C.label)},C.id))}),o.jsxs("div",{className:"min-h-0 flex-1 space-y-4 overflow-y-auto py-1",children:[r==="campaign"&&o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.generatePost.campaignHint")}),k.length===0?o.jsx("p",{className:"rounded-lg border border-dashed px-3 py-6 text-center text-sm text-muted-foreground",children:i("sandbox.generatePost.noCampaigns")}):o.jsx(ld,{campaigns:k,chosen:d,onChoose:f})]}),r==="format"&&o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.generatePost.formatHint")}),o.jsx(jo,{options:v.map(C=>C.name),value:g,onChange:C=>{p(C),m(v.find($=>$.name===C)?.value??"")}}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(ct,{htmlFor:"generate-format-name",children:i("sandbox.generatePost.formatNameLabel")}),o.jsx(pt,{id:"generate-format-name",value:g,onChange:C=>p(C.target.value),placeholder:i("sandbox.generatePost.formatNamePlaceholder")})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(ct,{htmlFor:"generate-format-value",children:i("sandbox.generatePost.formatValueLabel")}),o.jsx(ao,{id:"generate-format-value",value:u,onChange:C=>m(C.target.value),placeholder:i("sandbox.generatePost.formatValuePlaceholder"),rows:4})]}),o.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.generatePost.formatBlocksHint")})]}),r==="extra"&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(ct,{htmlFor:"generate-extra",children:i("sandbox.generatePost.extraLabel")}),o.jsx(ao,{id:"generate-extra",value:x,onChange:C=>S(C.target.value),placeholder:i("sandbox.generatePost.extraPlaceholder"),rows:4})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(ct,{children:i("sandbox.generatePost.countLabel")}),o.jsx(jo,{options:ad.map(String),value:String(N),onChange:C=>j(Number(C)||1)}),o.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.generatePost.countHint")})]}),o.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.generatePost.coverHint")})]})]}),o.jsxs(us,{className:"shrink-0 sm:justify-between",children:[o.jsx(Oe,{type:"button",variant:"outline",disabled:T===0,onClick:()=>c(_s[T-1].id),children:i("sandbox.generatePost.back")}),P?o.jsxs(Oe,{type:"button",disabled:!n,onClick:B,children:[o.jsx(Is,{size:14}),i("sandbox.generatePost.generate",{count:String(N)})]}):o.jsx(Oe,{type:"button",disabled:!D,onClick:()=>c(_s[T+1].id),children:i("sandbox.generatePost.next")})]})]})]})})}function ld(t){const e=re.c(11),{campaigns:s,chosen:n,onChoose:a}=t,i=Ce();let l;if(e[0]!==s||e[1]!==n||e[2]!==a||e[3]!==i){let c;e[5]!==n||e[6]!==a||e[7]!==i?(c=d=>o.jsx("li",{children:o.jsxs("button",{type:"button",onClick:()=>a(d.key),className:ve("w-full cursor-pointer rounded-lg border bg-card p-2.5 text-left transition-colors hover:border-primary/40",n===d.key&&"border-primary"),children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("p",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:d.name||i("sandbox.campaigns.untitled")}),o.jsx(Mn,{variant:"outline",className:"shrink-0 text-[10px]",children:d.intent.products.length>0?i("sandbox.generatePost.campaignProducts",{count:String(d.intent.products.length)}):i("sandbox.generatePost.campaignNoProducts")})]}),d.trigger.note&&o.jsx("p",{className:"line-clamp-2 text-xs text-muted-foreground",children:d.trigger.note})]})},d.key),e[5]=n,e[6]=a,e[7]=i,e[8]=c):c=e[8],l=s.map(c),e[0]=s,e[1]=n,e[2]=a,e[3]=i,e[4]=l}else l=e[4];let r;return e[9]!==l?(r=o.jsx("ul",{className:"space-y-1.5",children:l}),e[9]=l,e[10]=r):r=e[10],r}function cd(t){const e=[];for(let s=0;e.length<fo;s+=1){const n=e.length;for(const a of t){const i=a.images?.[s];if(i&&(e.push(i),e.length>=fo))return e}if(e.length===n)break}return e}const dd={"no-store-data":"sandbox.generatePost.gapNoStoreData","sections-dropped":"sandbox.generatePost.gapSectionsDropped","no-bucket":"sandbox.generatePost.gapNoBucket","no-image-model":"sandbox.generatePost.gapNoImageModel","images-failed":"sandbox.generatePost.gapImagesFailed","drafts-failed":"sandbox.generatePost.gapDraftsFailed"};function ud({orgSlug:t,virtualMcpId:e,branch:s,decofile:n,meta:a,onStarted:i}){const l=Ce(),r=Xa(),c=Ia(),d=Js({orgSlug:t,virtualMcpId:e,branch:s});return async f=>{const g={campaignKey:f.campaign.key,format:f.format,brief:f.campaign.trigger.note},p=Ks(ya({title:f.campaign.name,planning:g,now:new Date}),"generating",new Date),u=Array.from({length:f.count},()=>Ms(Cn())),{merged:m}=_a(n),x=xc(m),S=Ue(n,"categories").map(({payload:v})=>({name:Ve(v.name),slug:Ve(v.slug)})).filter(v=>v.slug),N=Yl(n),j=zc(f.format,a,n,{hideDefaults:c}),b=Object.fromEntries(j.map(v=>[v.name,v.example])),h=async(v,E=u.length)=>{for(const L of u.slice(v,E))try{await d.mutateAsync({blockKey:L,data:ft(L,Ks(p,"draft",new Date))})}catch(T){console.warn("[generatePost] could not reset a card",T)}},k=async(v,E)=>{if(!E.fileConfigId||v.length===0)return new Map;try{const L=await r.call("BLOG_POST_ILLUSTRATE",{requests:v.map((T,D)=>({id:String(D),prompt:T.cover.prompt,alt:T.cover.alt})),productImages:cd(E.campaign.intent.products),companyName:x.companyName??"",fileConfigId:E.fileConfigId});return new Map(L.images.map(T=>[T.id,T.url]))}catch(L){return console.warn("[generatePost] illustrating failed",L),new Map}};let A=0;try{for(const v of u)await d.mutateAsync({blockKey:v,data:ft(v,p)}),A+=1}catch(v){await h(0,A),pe.error(v instanceof Error?v.message:l("sandbox.generatePost.failed"));return}i?.(u);let _=0;try{const v=await r.call("BLOG_SITE_GROUND",{virtualMcpId:e,purpose:"post",focus:`${f.campaign.name}: ${f.campaign.trigger.note}`,language:x.language}).catch(P=>{console.warn("[generatePost] grounding failed",P)}),E=await r.call("BLOG_POST_DRAFT",{virtualMcpId:e,grounding:v?{report:v.report,outcome:v.outcome}:void 0,brand:{companyName:x.companyName,description:x.description,language:x.language,storeUrl:x.storeUrl,targetAudience:x.targetAudience,tone:x.tone,dos:x.dos,avoid:x.avoid,vocabulary:x.vocabulary,voiceExamples:x.voiceExamples},campaign:{name:f.campaign.name,period:f.campaign.period,trigger:f.campaign.trigger,intent:{objective:f.campaign.intent.objective,targets:f.campaign.intent.targets,products:f.campaign.intent.products,keywords:f.campaign.intent.keywords},guardrails:f.campaign.guardrails},format:f.format,blocks:j,categories:S,authors:N.map(({name:P,email:B})=>({name:P,email:B})),extraInstructions:f.extraInstructions?.trim()||void 0,count:f.count}),L=await k(E.posts,f),T=Un(a,{hideDefaults:c}),D=ha(n).map(P=>P.slug);for(const[P,B]of E.posts.entries()){const C=u[P];if(!C)break;const $=Wc({draft:{...B,cover:{...B.cover,url:L.get(String(P))??""}},resolveTypes:T,productShapes:b,categories:S,authors:N,planning:g,takenSlugs:D,now:new Date});D.push(Ve($.slug)),await d.mutateAsync({blockKey:C,data:ft(C,$)}),_=P+1}await h(_),E.posts.length>0&&pe.success(l("sandbox.generatePost.done",{count:String(E.posts.length)}));for(const P of E.gaps)pe.warning(l(dd[P.code],{count:P.count??0}))}catch(v){await h(_),pe.error(v instanceof Error?v.message:l("sandbox.generatePost.failed"))}}}const fd=/<(h[1-6]|p|ul|ol|div|img|br|blockquote|section|article|figure)\b|<\/[a-z]/i;function Ka(t){return fd.test(t)}function md(t){const e=t.trim();return e?Ka(e)?jd(e):kd(e):{title:"",sections:[]}}function Hn(t){return t.replace(/&nbsp;/gi," ").replace(/&lt;/gi,"<").replace(/&gt;/gi,">").replace(/&quot;/gi,'"').replace(/&#0?39;|&apos;/gi,"'").replace(/&amp;/gi,"&")}function ss(t){let e=t,s;do s=e,e=e.replace(/<[^>]+>/g,"");while(e!==s);return Hn(e).replace(/\s+/g," ").trim()}function pd(t){let e=t,s;do s=e,e=e.replace(/<!--[\s\S]*?-->/g,"");while(e!==s);return e}function gd(t){let e=t,s;do s=e,e=e.replace(/<(script|style)\b[\s\S]*?<\/\1\s*>/gi,"");while(e!==s);return e}function Ma(t){let e=t,s;do s=e,e=gd(pd(e));while(e!==s);return e}const hd=/^(a|b|strong|i|em|u|s|code|br|span|sub|sup)$/;function Ws(t){let e="";for(const s of t)s.charCodeAt(0)>31&&(e+=s);return e=e.trim(),!/^[a-z][a-z0-9+.-]*:/i.test(e)||/^(https?|mailto|tel):/i.test(e)}function xd(t){return t.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}const bd=/^<\/?([a-z][a-z0-9]*)\b([^>]*)>/i;function yd(t,e,s){const n=e.toLowerCase();if(!hd.test(n))return"";if(t.startsWith("</"))return`</${n}>`;if(n!=="a")return`<${n}>`;const a=Hn(s.match(/href\s*=\s*"([^"]*)"/i)?.[1]??"");return Ws(a)&&a?`<a href="${xd(a)}">`:"<a>"}function za(t){const e=Ma(t);let s="",n=0;for(;n<e.length;){const a=e.indexOf("<",n);if(a===-1){s+=e.slice(n);break}s+=e.slice(n,a);const i=bd.exec(e.slice(a));if(!i){s+="&lt;",n=a+1;continue}s+=yd(i[0],i[1]??"",i[2]??""),n=a+i[0].length}return s}function Ps(t,e){const s=t.match(new RegExp(`${e}\\s*=\\s*"([^"]*)"`,"i"));return s?.[1]?Hn(s[1]):""}const vd=/<(h[1-6]|p|ul|ol|blockquote|figure)\b[^>]*>([\s\S]*?)<\/\1\s*>|<hr\b[^>]*\/?>|<img\b[^>]*>/gi;function jd(t){const e=Ma(t);let s="";const n=[];for(const a of e.matchAll(vd)){const i=a[1]?.toLowerCase(),l=a[2]??"",r=a[0];if(!i){if(/^<img/i.test(r)){const c=Ps(r,"src");c&&Ws(c)&&n.push({kind:"image",url:c,alt:Ps(r,"alt"),caption:""})}else n.push({kind:"divider"});continue}if(/^h[1-6]$/.test(i)){const c=ss(l);if(!c)continue;if(i==="h1"&&!s){s=c;continue}n.push({kind:"heading",text:c,level:i.slice(1)})}else if(i==="p"){const c=za(l.trim());ss(c)&&n.push({kind:"paragraph",html:c})}else if(i==="ul"||i==="ol"){const c=[...l.matchAll(/<li\b[^>]*>([\s\S]*?)<\/li\s*>/gi)].map(d=>ss(d[1]??"")).filter(Boolean);c.length&&n.push({kind:"list",items:c,ordered:i==="ol"})}else if(i==="blockquote"){const c=ss(l);c&&n.push({kind:"quote",text:c})}else if(i==="figure"){const c=l.match(/<img\b[^>]*>/i)?.[0],d=c?Ps(c,"src"):"",f=ss(l.match(/<figcaption\b[^>]*>([\s\S]*?)<\/figcaption\s*>/i)?.[1]??"");d&&Ws(d)&&n.push({kind:"image",url:d,alt:c?Ps(c,"alt"):"",caption:f})}}return{title:s,sections:n}}function Sd(t){return t.replace(/\[([^\]]+)\]\(([^)\s]+)\)/g,'<a href="$2">$1</a>').replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>").replace(/(^|[^*])\*([^*]+)\*/g,"$1<em>$2</em>").replace(/`([^`]+)`/g,"<code>$1</code>")}function kd(t){const e=t.replace(/\r\n?/g,`
6
6
  `).split(`
7
7
  `);let s="";const n=[];let a=[],i=null,l=[];const r=()=>{a.length&&(n.push({kind:"paragraph",html:za(Sd(a.join(" ")))}),a=[])},c=()=>{i&&(n.push({kind:"list",items:i.items,ordered:i.ordered}),i=null)},d=()=>{l.length&&(n.push({kind:"quote",text:l.join(" ")}),l=[])},f=()=>{r(),c(),d()};for(const g of e){const p=g.trimEnd(),u=p.match(/^(#{1,6})\s+(.*)$/),m=p.match(/^!\[([^\]]*)\]\(([^)\s]+)\)\s*$/),x=p.match(/^\s*(?:[-*+]|\d+\.)\s+(.*)$/),S=/^\s*\d+\./.test(p),N=p.match(/^>\s?(.*)$/);if(!p.trim())f();else if(u){f();const j=u[2]?.trim()??"",b=String(u[1]?.length??1);b==="1"&&!s?s=j:j&&n.push({kind:"heading",text:j,level:b})}else if(/^(-{3,}|\*{3,}|_{3,})$/.test(p.trim()))f(),n.push({kind:"divider"});else if(m){f();const j=m[2]??"";Ws(j)&&n.push({kind:"image",url:j,alt:m[1]??"",caption:""})}else x?(r(),d(),i||(i={items:[],ordered:S}),i.items.push(x[1]?.trim()??"")):N?(r(),c(),l.push(N[1]?.trim()??"")):(c(),d(),a.push(p.trim()))}return f(),{title:s,sections:n}}const wd={heading:"Heading",paragraph:"Paragraph",list:"List",quote:"Quote",divider:"Divider",image:"BlockImage"};function Cd(t,e){const s=[];for(const n of t){const a=e[wd[n.kind]];if(a)switch(n.kind){case"heading":s.push({__resolveType:a,text:n.text,level:n.level});break;case"paragraph":s.push({__resolveType:a,html:n.html});break;case"list":s.push({__resolveType:a,items:n.items.join(`
8
- `),style:n.ordered?"ordered":"unordered"});break;case"quote":s.push({__resolveType:a,quote:n.text});break;case"divider":s.push({__resolveType:a});break;case"image":s.push({__resolveType:a,url:n.url,alt:n.alt,caption:n.caption,size:"normal"});break}}return s}function Nd({title:t,blocks:e,takenSlugs:s,now:n}){const a=t.trim();return{title:a,slug:a?$a(a,s):Oa(""),date:n.toISOString().slice(0,10),excerpt:"",image:"",alt:"",authors:[],categories:[],sections:e,status:"in_review"}}const ko="__all__",wo={"date-desc":"sandbox.postToolbar.sortNewestFirst","date-asc":"sandbox.postToolbar.sortOldestFirst",az:"sandbox.postToolbar.sortTitleAZ",za:"sandbox.postToolbar.sortTitleZA"},_d={"date-desc":"sandbox.postToolbar.sortNewest","date-asc":"sandbox.postToolbar.sortOldest",az:"sandbox.postToolbar.sortAZ",za:"sandbox.postToolbar.sortZA"},Co="status:";function No(t){if(!t.startsWith(Co))return null;const e=t.slice(Co.length);return Vn.includes(e)?e:null}const _o=F.forwardRef(function(e,s){const n=re.c(20);let a,i,l,r,c;n[0]!==e?({icon:a,active:i,value:c,className:l,...r}=e,n[0]=e,n[1]=a,n[2]=i,n[3]=l,n[4]=r,n[5]=c):(a=n[1],i=n[2],l=n[3],r=n[4],c=n[5]);const d=i?"text-foreground":"text-muted-foreground";let f;n[6]!==l||n[7]!==d?(f=ve("h-7 gap-1 px-1.5 text-xs",d,l),n[6]=l,n[7]=d,n[8]=f):f=n[8];let g;n[9]!==a?(g=o.jsx(a,{size:14,className:"shrink-0"}),n[9]=a,n[10]=g):g=n[10];let p;n[11]!==c?(p=c&&o.jsx("span",{className:"min-w-0 flex-1 truncate",children:c}),n[11]=c,n[12]=p):p=n[12];let u;n[13]===Symbol.for("react.memo_cache_sentinel")?(u=o.jsx(rs,{size:12,className:"shrink-0 opacity-60"}),n[13]=u):u=n[13];let m;return n[14]!==r||n[15]!==s||n[16]!==f||n[17]!==g||n[18]!==p?(m=o.jsxs(Oe,{ref:s,type:"button",variant:"ghost",size:"sm",className:f,...r,children:[g,p,u]}),n[14]=r,n[15]=s,n[16]=f,n[17]=g,n[18]=p,n[19]=m):m=n[19],m});function qn(t){const e=re.c(2),{count:s}=t;let n;return e[0]!==s?(n=o.jsx("span",{className:"ml-auto pl-3 text-xs text-muted-foreground tabular-nums",children:s}),e[0]=s,e[1]=n):n=e[1],n}function Pd(t){const e=re.c(19),{value:s,onChange:n}=t,a=Ce();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx(Bn,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),e[0]=i):i=e[0];let l;e[1]!==n?(l=p=>n(p.target.value),e[1]=n,e[2]=l):l=e[2];let r;e[3]!==a?(r=a("sandbox.postToolbar.searchPlaceholder"),e[3]=a,e[4]=r):r=e[4];let c;e[5]!==a?(c=a("sandbox.postToolbar.searchAriaLabel"),e[5]=a,e[6]=c):c=e[6];let d;e[7]!==l||e[8]!==r||e[9]!==c||e[10]!==s?(d=o.jsx("input",{type:"text",value:s,onChange:l,placeholder:r,"aria-label":c,className:"min-w-0 flex-1 bg-transparent py-0.5 text-sm outline-none placeholder:text-muted-foreground"}),e[7]=l,e[8]=r,e[9]=c,e[10]=s,e[11]=d):d=e[11];let f;e[12]!==n||e[13]!==a||e[14]!==s?(f=s&&o.jsx(Va,{label:a("sandbox.postToolbar.clearSearch"),onClick:()=>n("")}),e[12]=n,e[13]=a,e[14]=s,e[15]=f):f=e[15];let g;return e[16]!==d||e[17]!==f?(g=o.jsxs("div",{className:"flex items-center gap-2 border-b px-2.5 py-1.5",children:[i,d,f]}),e[16]=d,e[17]=f,e[18]=g):g=e[18],g}function Td(t){const e=re.c(100),{categories:s,authors:n,statusCounts:a,categoryFilter:i,authorFilter:l,statusFilter:r,sort:c,onCategoryFilterChange:d,onAuthorFilterChange:f,onStatusFilterChange:g,onSortChange:p}=t,u=Ce();let m;if(e[0]!==s||e[1]!==i){let w;e[3]!==i?(w=M=>M.slug===i,e[3]=i,e[4]=w):w=e[4],m=s.find(w),e[0]=s,e[1]=i,e[2]=m}else m=e[2];const x=m;let S;if(e[5]!==l||e[6]!==n){let w;e[8]!==l?(w=M=>M.email===l,e[8]=l,e[9]=w):w=e[9],S=n.find(w),e[5]=l,e[6]=n,e[7]=S}else S=e[7];const N=S,j=!!(i||l||r);let b;e[10]!==N?.name||e[11]!==x?.name||e[12]!==r||e[13]!==u?(b=x?.name??N?.name??u(r?qs[r]:"sandbox.postToolbar.filterLabel"),e[10]=N?.name,e[11]=x?.name,e[12]=r,e[13]=u,e[14]=b):b=e[14];const h=b,k=i?`cat:${i}`:l?`author:${l}`:r?`status:${r}`:ko;let A;e[15]!==f||e[16]!==d||e[17]!==g?(A=()=>{d(null),f(null),g(null)},e[15]=f,e[16]=d,e[17]=g,e[18]=A):A=e[18];const _=A;let v;e[19]!==_||e[20]!==f||e[21]!==d||e[22]!==g?(v=w=>{w.startsWith("cat:")?(f(null),g(null),d(w.slice(4))):w.startsWith("author:")?(d(null),g(null),f(w.slice(7))):No(w)?(d(null),f(null),g(No(w))):_()},e[19]=_,e[20]=f,e[21]=d,e[22]=g,e[23]=v):v=e[23];const E=v;let L;e[24]!==h||e[25]!==j?(L=o.jsx(Os,{asChild:!0,children:o.jsx(_o,{icon:ai,active:j,value:h,className:"min-w-0 shrink"})}),e[24]=h,e[25]=j,e[26]=L):L=e[26];let T;e[27]!==u?(T=u("sandbox.postToolbar.filterBy"),e[27]=u,e[28]=T):T=e[28];let D;e[29]!==T?(D=o.jsx(Zt,{children:T}),e[29]=T,e[30]=D):D=e[30];let P;e[31]!==u?(P=u("sandbox.postToolbar.allPosts"),e[31]=u,e[32]=P):P=e[32];let B;e[33]!==P?(B=o.jsx(ns,{value:ko,children:P}),e[33]=P,e[34]=B):B=e[34];let C;e[35]!==u?(C=u("sandbox.postToolbar.statusLabel"),e[35]=u,e[36]=C):C=e[36];let $;e[37]!==C?($=o.jsx(Zt,{className:"text-muted-foreground/70",children:C}),e[37]=C,e[38]=$):$=e[38];let V;e[39]!==a||e[40]!==u?(V=Vn.map(w=>o.jsxs(ns,{value:`status:${w}`,children:[o.jsx("span",{className:"min-w-0 flex-1 truncate",children:u(qs[w])}),o.jsx(qn,{count:a[w]??0})]},`status:${w}`)),e[39]=a,e[40]=u,e[41]=V):V=e[41];let I;e[42]!==s.length||e[43]!==u?(I=s.length>0&&o.jsx(Zt,{className:"text-muted-foreground/70",children:u("sandbox.postToolbar.categoryLabel")}),e[42]=s.length,e[43]=u,e[44]=I):I=e[44];let W;e[45]!==s?(W=s.map(Ed),e[45]=s,e[46]=W):W=e[46];let q;e[47]!==n.length||e[48]!==u?(q=n.length>0&&o.jsx(Zt,{className:"text-muted-foreground/70",children:u("sandbox.postToolbar.authorLabel")}),e[47]=n.length,e[48]=u,e[49]=q):q=e[49];let z;e[50]!==n?(z=n.map(Ad),e[50]=n,e[51]=z):z=e[51];let O;e[52]!==k||e[53]!==E||e[54]!==B||e[55]!==$||e[56]!==V||e[57]!==I||e[58]!==W||e[59]!==q||e[60]!==z?(O=o.jsxs(Wn,{value:k,onValueChange:E,children:[B,$,V,I,W,q,z]}),e[52]=k,e[53]=E,e[54]=B,e[55]=$,e[56]=V,e[57]=I,e[58]=W,e[59]=q,e[60]=z,e[61]=O):O=e[61];let Y;e[62]!==O||e[63]!==D?(Y=o.jsxs(Ls,{align:"start",className:"max-h-96 w-60 overflow-y-auto",children:[D,O]}),e[62]=O,e[63]=D,e[64]=Y):Y=e[64];let U;e[65]!==Y||e[66]!==L?(U=o.jsxs($s,{children:[L,Y]}),e[65]=Y,e[66]=L,e[67]=U):U=e[67];let Q;e[68]!==_||e[69]!==j||e[70]!==u?(Q=j&&o.jsx(Va,{label:u("sandbox.postToolbar.clearFilter"),onClick:_}),e[68]=_,e[69]=j,e[70]=u,e[71]=Q):Q=e[71];const oe=_d[c];let ee;e[72]!==u||e[73]!==oe?(ee=u(oe),e[72]=u,e[73]=oe,e[74]=ee):ee=e[74];let ie;e[75]!==ee?(ie=o.jsx(Os,{asChild:!0,children:o.jsx(_o,{icon:ii,active:!0,value:ee})}),e[75]=ee,e[76]=ie):ie=e[76];let ae;e[77]!==u?(ae=u("sandbox.postToolbar.sortBy"),e[77]=u,e[78]=ae):ae=e[78];let le;e[79]!==ae?(le=o.jsx(Zt,{children:ae}),e[79]=ae,e[80]=le):le=e[80];let ce;e[81]!==p?(ce=w=>p(w),e[81]=p,e[82]=ce):ce=e[82];let fe;e[83]===Symbol.for("react.memo_cache_sentinel")?(fe=Object.keys(wo),e[83]=fe):fe=e[83];let te;e[84]!==u?(te=fe.map(w=>o.jsx(ns,{value:w,children:u(wo[w])},w)),e[84]=u,e[85]=te):te=e[85];let de;e[86]!==c||e[87]!==ce||e[88]!==te?(de=o.jsx(Wn,{value:c,onValueChange:ce,children:te}),e[86]=c,e[87]=ce,e[88]=te,e[89]=de):de=e[89];let X;e[90]!==le||e[91]!==de?(X=o.jsxs(Ls,{align:"end",className:"w-44",children:[le,de]}),e[90]=le,e[91]=de,e[92]=X):X=e[92];let ne;e[93]!==ie||e[94]!==X?(ne=o.jsx("div",{className:"ml-auto shrink-0",children:o.jsxs($s,{children:[ie,X]})}),e[93]=ie,e[94]=X,e[95]=ne):ne=e[95];let J;return e[96]!==U||e[97]!==Q||e[98]!==ne?(J=o.jsxs("div",{className:"flex min-w-0 items-center gap-1 overflow-hidden border-b px-2 py-1.5",children:[U,Q,ne]}),e[96]=U,e[97]=Q,e[98]=ne,e[99]=J):J=e[99],J}function Ad(t){return o.jsxs(ns,{value:`author:${t.email}`,children:[o.jsx("span",{className:"min-w-0 flex-1 truncate",children:t.name}),o.jsx(qn,{count:t.count})]},`author:${t.email}`)}function Ed(t){return o.jsxs(ns,{value:`cat:${t.slug}`,children:[o.jsx("span",{className:"min-w-0 flex-1 truncate",children:t.name}),o.jsx(qn,{count:t.count})]},`cat:${t.slug}`)}function Va(t){const e=re.c(4),{label:s,onClick:n}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx(En,{size:12}),e[0]=a):a=e[0];let i;return e[1]!==s||e[2]!==n?(i=o.jsx("button",{type:"button","aria-label":s,onClick:n,className:"flex h-6 w-6 shrink-0 items-center justify-center text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer rounded-lg",children:a}),e[1]=s,e[2]=n,e[3]=i):i=e[3],i}function Dd(t){const e=re.c(18),{checked:s,disabled:n,onToggle:a}=t,i=Ce();let l;e[0]!==a?(l=()=>a(),e[0]=a,e[1]=l):l=e[1];let r;e[2]!==s||e[3]!==i?(r=i(s?"sandbox.postToolbar.deselectAllPosts":"sandbox.postToolbar.selectAllPosts"),e[2]=s,e[3]=i,e[4]=r):r=e[4];let c;e[5]!==s||e[6]!==n||e[7]!==l||e[8]!==r?(c=o.jsx(qe,{asChild:!0,children:o.jsx("span",{className:"flex shrink-0 items-center px-1.5",onClick:Bd,children:o.jsx(Xs,{checked:s,disabled:n,onCheckedChange:l,"aria-label":r})})}),e[5]=s,e[6]=n,e[7]=l,e[8]=r,e[9]=c):c=e[9];let d;e[10]!==s||e[11]!==i?(d=i(s?"sandbox.postToolbar.deselectAll":"sandbox.postToolbar.selectAll"),e[10]=s,e[11]=i,e[12]=d):d=e[12];let f;e[13]!==d?(f=o.jsx(We,{side:"bottom",children:d}),e[13]=d,e[14]=f):f=e[14];let g;return e[15]!==c||e[16]!==f?(g=o.jsxs(Ye,{children:[c,f]}),e[15]=c,e[16]=f,e[17]=g):g=e[17],g}function Bd(t){return t.stopPropagation()}function Od(t){const e=re.c(42),{count:s,allSelected:n,onToggleSelectAll:a,onArchive:i,onExit:l}=t,r=Ce();let c;e[0]!==n||e[1]!==a?(c=o.jsx(Dd,{checked:n,onToggle:a}),e[0]=n,e[1]=a,e[2]=c):c=e[2];let d;e[3]!==s||e[4]!==r?(d=r("sandbox.postToolbar.itemsSelected",{count:s}),e[3]=s,e[4]=r,e[5]=d):d=e[5];let f;e[6]!==d?(f=o.jsx("span",{className:"text-xs font-medium tabular-nums",children:d}),e[6]=d,e[7]=f):f=e[7];const g=s===0;let p;e[8]!==r?(p=r("sandbox.postToolbar.archiveSelectedPosts"),e[8]=r,e[9]=p):p=e[9];let u;e[10]===Symbol.for("react.memo_cache_sentinel")?(u=o.jsx(Za,{size:14}),e[10]=u):u=e[10];let m;e[11]!==i||e[12]!==g||e[13]!==p?(m=o.jsx(qe,{asChild:!0,children:o.jsx(Oe,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",disabled:g,onClick:i,"aria-label":p,children:u})}),e[11]=i,e[12]=g,e[13]=p,e[14]=m):m=e[14];let x;e[15]!==r?(x=r("sandbox.postToolbar.archiveSelected"),e[15]=r,e[16]=x):x=e[16];let S;e[17]!==x?(S=o.jsx(We,{side:"bottom",children:x}),e[17]=x,e[18]=S):S=e[18];let N;e[19]!==m||e[20]!==S?(N=o.jsxs(Ye,{children:[m,S]}),e[19]=m,e[20]=S,e[21]=N):N=e[21];let j;e[22]!==r?(j=r("sandbox.postToolbar.exitSelection"),e[22]=r,e[23]=j):j=e[23];let b;e[24]===Symbol.for("react.memo_cache_sentinel")?(b=o.jsx(En,{size:14}),e[24]=b):b=e[24];let h;e[25]!==l||e[26]!==j?(h=o.jsx(qe,{asChild:!0,children:o.jsx(Oe,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:l,"aria-label":j,children:b})}),e[25]=l,e[26]=j,e[27]=h):h=e[27];let k;e[28]!==r?(k=r("sandbox.postToolbar.exitSelection"),e[28]=r,e[29]=k):k=e[29];let A;e[30]!==k?(A=o.jsx(We,{side:"bottom",children:k}),e[30]=k,e[31]=A):A=e[31];let _;e[32]!==h||e[33]!==A?(_=o.jsxs(Ye,{children:[h,A]}),e[32]=h,e[33]=A,e[34]=_):_=e[34];let v;e[35]!==N||e[36]!==_?(v=o.jsxs("div",{className:"ml-auto flex items-center gap-0.5",children:[N,_]}),e[35]=N,e[36]=_,e[37]=v):v=e[37];let E;return e[38]!==c||e[39]!==v||e[40]!==f?(E=o.jsxs("div",{className:"flex items-center gap-0.5 border-b bg-accent/40 px-2 py-1.5",children:[c,f,v]}),e[38]=c,e[39]=v,e[40]=f,e[41]=E):E=e[41],E}const Ld={draft:"outline",generating:"secondary",awaiting_review:"warning",scheduled:"secondary",published:"success",archived:"outline"},Tn="generating",$d=[Tn,...Vn.filter(t=>t!==Tn)],Po=t=>t.scheduledDatetime||t.date||"",Rd=(t,e)=>Po(e).localeCompare(Po(t)),Fd=t=>t==="scheduled"||t==="published",Ua="application/x-post-key";function Id(t){const e=re.c(165),{orgSlug:s,virtualMcpId:n,branch:a,decofile:i,view:l,selectedKey:r,onViewChange:c,onOpen:d,onClose:f,move:g,meta:p,renderDetail:u}=t,m=Ce();let x;e[0]!==a||e[1]!==s||e[2]!==n?(x={orgSlug:s,virtualMcpId:n,branch:a},e[0]=a,e[1]=s,e[2]=n,e[3]=x):x=e[3];const S=Js(x),N=Gr().length>0,j=aa(),b=Ia(),[h,k]=F.useState(null),[A,_]=F.useState(!1),[v,E]=F.useState(!1),[L,T]=F.useState(!1),[D,P]=F.useState(""),B=F.useRef(null);let C;e[4]===Symbol.for("react.memo_cache_sentinel")?(C={},e[4]=C):C=e[4];const[$,V]=F.useState(C);let I;e[5]!==$?(I=(K,se)=>$[K]??se,e[5]=$,e[6]=I):I=e[6];const W=I;let q;e[7]===Symbol.for("react.memo_cache_sentinel")?(q=(K,se)=>V(Be=>({...Be,[K]:se})),e[7]=q):q=e[7];const z=q;let O;e[8]!==d?(O=K=>{const se=K[0];se&&d(se)},e[8]=d,e[9]=O):O=e[9];let Y;e[10]!==a||e[11]!==i||e[12]!==p||e[13]!==s||e[14]!==O||e[15]!==n?(Y={orgSlug:s,virtualMcpId:n,branch:a,decofile:i,meta:p,onStarted:O},e[10]=a,e[11]=i,e[12]=p,e[13]=s,e[14]=O,e[15]=n,e[16]=Y):Y=e[16];const U=ud(Y),Q=nc(i);let oe;e[17]!==i?(oe=K=>ut(i[K],"posts"),e[17]=i,e[18]=oe):oe=e[18];const ee=oe,ie=r&&Q.some(K=>K.key===r)?r:Q[0]?.key??null;let ae;e[19]!==g||e[20]!==m?(ae=async K=>{await g.apply(K.key,"archived")&&pe.success(m("sandbox.postBoard.archived"))},e[19]=g,e[20]=m,e[21]=ae):ae=e[21];const le=ae,[ce,fe]=F.useState(null),[te,de]=F.useState(null),[X,ne]=F.useState(null),[J,w]=F.useState("date-desc"),[M,me]=F.useState("");let ge;e[22]===Symbol.for("react.memo_cache_sentinel")?(ge=new Set,e[22]=ge):ge=e[22];const[he,ye]=F.useState(ge),_e=Q.reduce(Ud,{}),Pe=K=>{const se=new Map;for(const Be of Q)for(const rt of K(Be))se.set(rt,(se.get(rt)??0)+1);return se},Te=Pe(Vd),we=Pe(zd),Ee=Ue(i,"categories").map(K=>{const{payload:se}=K;return{slug:Ve(se.slug),name:Ve(se.name)||Ve(se.slug),count:Te.get(Ve(se.slug))??0}}),De=Ue(i,"authors").map(K=>{const{payload:se}=K;return{email:Ve(se.email),name:Ve(se.name)||Ve(se.email),count:we.get(Ve(se.email))??0}}),xe=M.trim().toLowerCase();let Ae;e[23]!==ce?(Ae=K=>!ce||K.categorySlugs.includes(ce),e[23]=ce,e[24]=Ae):Ae=e[24];let Re;e[25]!==te?(Re=K=>!te||K.authorEmails.includes(te),e[25]=te,e[26]=Re):Re=e[26];let G;e[27]!==X?(G=K=>!X||K.status===X,e[27]=X,e[28]=G):G=e[28];let be;e[29]!==J?(be=(K,se)=>{if(J==="az")return K.title.localeCompare(se.title);if(J==="za")return se.title.localeCompare(K.title);const Be=(K.scheduledDatetime||K.date).localeCompare(se.scheduledDatetime||se.date);return J==="date-asc"?Be:-Be},e[29]=J,e[30]=be):be=e[30];const ke=Q.filter(Ae).filter(Re).filter(G).filter(K=>!xe||K.title.toLowerCase().includes(xe)||K.slug.toLowerCase().includes(xe)).sort(be),Le=he.size>0;let gt;e[31]===Symbol.for("react.memo_cache_sentinel")?(gt=K=>ye(se=>{const Be=new Set(se);return Be.delete(K)||Be.add(K),Be}),e[31]=gt):gt=e[31];const an=gt,rn=()=>ye(K=>ke.every(se=>K.has(se.key))?new Set:new Set(ke.map(Md)));let ht;e[32]!==g||e[33]!==he||e[34]!==m?(ht=async()=>{let K=0;for(const se of he)await g.apply(se,"archived")&&(K=K+1);ye(new Set),K>0&&pe.success(m("sandbox.postBoard.archived"))},e[32]=g,e[33]=he,e[34]=m,e[35]=ht):ht=e[35];const ln=ht;let xt;e[36]!==g?(xt=(K,se)=>{k(null),g.apply(se,K)},e[36]=g,e[37]=xt):xt=e[37];const cn=xt;let bt;e[38]!==d||e[39]!==S?(bt=()=>{const K=Ms(Cn()),se=ya({title:"",now:new Date});S.mutate({blockKey:K,data:ft(K,se)}),d(K)},e[38]=d,e[39]=S,e[40]=bt):bt=e[40];const yt=bt,dn=()=>{const K=md(D),se=Cd(K.sections,Un(p,{hideDefaults:b}));if(se.length===0&&!K.title.trim()){pe.error(m("sandbox.postBoard.importEmpty"));return}const Be=Ms(Cn()),rt=Nd({title:K.title,blocks:se,takenSlugs:Q.map(Kd).filter(Boolean),now:new Date});S.mutate({blockKey:Be,data:ft(Be,rt)}),T(!1),P(""),pe.success(m("sandbox.postBoard.imported")),d(Be)},Jt=l==="list";let tt;e[41]!==c?(tt=()=>c("list"),e[41]=c,e[42]=tt):tt=e[42];let vt;e[43]===Symbol.for("react.memo_cache_sentinel")?(vt=o.jsx(mi,{size:14}),e[43]=vt):vt=e[43];let st;e[44]!==m?(st=m("sandbox.postBoard.viewList"),e[44]=m,e[45]=st):st=e[45];let nt;e[46]!==Jt||e[47]!==tt||e[48]!==st?(nt=o.jsx(To,{active:Jt,onClick:tt,icon:vt,label:st}),e[46]=Jt,e[47]=tt,e[48]=st,e[49]=nt):nt=e[49];const Xt=l==="board";let ot;e[50]!==c?(ot=()=>c("board"),e[50]=c,e[51]=ot):ot=e[51];let jt;e[52]===Symbol.for("react.memo_cache_sentinel")?(jt=o.jsx(ri,{size:14}),e[52]=jt):jt=e[52];let ze;e[53]!==m?(ze=m("sandbox.postBoard.viewBoard"),e[53]=m,e[54]=ze):ze=e[54];let at;e[55]!==Xt||e[56]!==ot||e[57]!==ze?(at=o.jsx(To,{active:Xt,onClick:ot,icon:jt,label:ze}),e[55]=Xt,e[56]=ot,e[57]=ze,e[58]=at):at=e[58];let y;e[59]!==nt||e[60]!==at?(y=o.jsx("div",{className:"flex items-center gap-3",children:o.jsxs("div",{className:"flex items-center gap-0.5 rounded-lg border p-0.5",children:[nt,at]})}),e[59]=nt,e[60]=at,e[61]=y):y=e[61];let H;e[62]===Symbol.for("react.memo_cache_sentinel")?(H=o.jsx(On,{size:14}),e[62]=H):H=e[62];let Z;e[63]!==m?(Z=m("sandbox.postBoard.newPost"),e[63]=m,e[64]=Z):Z=e[64];let ue;e[65]===Symbol.for("react.memo_cache_sentinel")?(ue=o.jsx(rs,{size:14}),e[65]=ue):ue=e[65];let Se;e[66]!==Z?(Se=o.jsx(Os,{asChild:!0,children:o.jsxs(Oe,{type:"button",size:"sm",children:[H,Z,ue]})}),e[66]=Z,e[67]=Se):Se=e[67];let Ne;e[68]!==j||e[69]!==m?(Ne=j&&o.jsxs(Xe,{onClick:()=>E(!0),children:[o.jsx(Is,{size:14}),o.jsxs("div",{className:"flex flex-col",children:[o.jsx("span",{children:m("sandbox.postBoard.newPostGenerate")}),o.jsx("span",{className:"text-xs text-muted-foreground",children:m("sandbox.postBoard.newPostGenerateHint")})]})]}),e[68]=j,e[69]=m,e[70]=Ne):Ne=e[70];let Qe;e[71]===Symbol.for("react.memo_cache_sentinel")?(Qe=o.jsx(fi,{size:14}),e[71]=Qe):Qe=e[71];let Je;e[72]!==m?(Je=m("sandbox.postBoard.newPostWrite"),e[72]=m,e[73]=Je):Je=e[73];let St;e[74]!==Je?(St=o.jsx("span",{children:Je}),e[74]=Je,e[75]=St):St=e[75];let kt;e[76]!==m?(kt=m("sandbox.postBoard.newPostWriteHint"),e[76]=m,e[77]=kt):kt=e[77];let wt;e[78]!==kt?(wt=o.jsx("span",{className:"text-xs text-muted-foreground",children:kt}),e[78]=kt,e[79]=wt):wt=e[79];let Ct;e[80]!==St||e[81]!==wt?(Ct=o.jsxs("div",{className:"flex flex-col",children:[St,wt]}),e[80]=St,e[81]=wt,e[82]=Ct):Ct=e[82];let Nt;e[83]!==Ct||e[84]!==yt?(Nt=o.jsxs(Xe,{onClick:yt,children:[Qe,Ct]}),e[83]=Ct,e[84]=yt,e[85]=Nt):Nt=e[85];let fs,ms;e[86]===Symbol.for("react.memo_cache_sentinel")?(fs=()=>T(!0),ms=o.jsx(hn,{size:14}),e[86]=fs,e[87]=ms):(fs=e[86],ms=e[87]);let _t;e[88]!==m?(_t=m("sandbox.postBoard.importContent"),e[88]=m,e[89]=_t):_t=e[89];let Pt;e[90]!==_t?(Pt=o.jsx("span",{children:_t}),e[90]=_t,e[91]=Pt):Pt=e[91];let Tt;e[92]!==m?(Tt=m("sandbox.postBoard.importContentHint"),e[92]=m,e[93]=Tt):Tt=e[93];let At;e[94]!==Tt?(At=o.jsx("span",{className:"text-xs text-muted-foreground",children:Tt}),e[94]=Tt,e[95]=At):At=e[95];let Et;e[96]!==Pt||e[97]!==At?(Et=o.jsxs(Xe,{onClick:fs,children:[ms,o.jsxs("div",{className:"flex flex-col",children:[Pt,At]})]}),e[96]=Pt,e[97]=At,e[98]=Et):Et=e[98];let Dt;e[99]!==Ne||e[100]!==Nt||e[101]!==Et?(Dt=o.jsxs(Ls,{align:"end",className:"w-56",children:[Ne,Nt,Et]}),e[99]=Ne,e[100]=Nt,e[101]=Et,e[102]=Dt):Dt=e[102];let ps;e[103]!==Se||e[104]!==Dt?(ps=o.jsxs($s,{children:[Se,Dt]}),e[103]=Se,e[104]=Dt,e[105]=ps):ps=e[105];let gs;e[106]!==j||e[107]!==i||e[108]!==v||e[109]!==U||e[110]!==N?(gs=j&&o.jsx(rd,{open:v,onOpenChange:E,decofile:i,hasAi:N,onGenerate:K=>{U(K)}}),e[106]=j,e[107]=i,e[108]=v,e[109]=U,e[110]=N,e[111]=gs):gs=e[111];let Bt;e[112]!==m?(Bt=m("sandbox.postBoard.importTitle"),e[112]=m,e[113]=Bt):Bt=e[113];let Ot;e[114]!==Bt?(Ot=o.jsx(Ht,{children:Bt}),e[114]=Bt,e[115]=Ot):Ot=e[115];let Lt;e[116]!==m?(Lt=m("sandbox.postBoard.importDescription"),e[116]=m,e[117]=Lt):Lt=e[117];let $t;e[118]!==Lt?($t=o.jsx(An,{children:Lt}),e[118]=Lt,e[119]=$t):$t=e[119];let hs;e[120]!==Ot||e[121]!==$t?(hs=o.jsxs(ds,{children:[Ot,$t]}),e[120]=Ot,e[121]=$t,e[122]=hs):hs=e[122];const un=Ka(D)?"html":"markdown";let xs;e[123]===Symbol.for("react.memo_cache_sentinel")?(xs=K=>P(K??""),e[123]=xs):xs=e[123];let Rt;e[124]!==D||e[125]!==un?(Rt=o.jsx("div",{className:"h-72 overflow-hidden rounded-[var(--studio-control-radius,var(--radius-xl))] border bg-[var(--studio-input-background)]",children:o.jsx(na,{code:D,language:un,height:"100%",autoFocus:!0,onChange:xs})}),e[124]=D,e[125]=un,e[126]=Rt):Rt=e[126];let bs;e[127]===Symbol.for("react.memo_cache_sentinel")?(bs=o.jsx("input",{ref:B,type:"file",accept:".html,.htm,.md,.markdown,.txt",className:"hidden",onChange:async K=>{const se=K.target.files?.[0];se&&P(await se.text()),K.target.value=""}}),e[127]=bs):bs=e[127];let ys,vs;e[128]===Symbol.for("react.memo_cache_sentinel")?(ys=()=>B.current?.click(),vs=o.jsx(hn,{size:14}),e[128]=ys,e[129]=vs):(ys=e[128],vs=e[129]);let Ft;e[130]!==m?(Ft=m("sandbox.postBoard.importUpload"),e[130]=m,e[131]=Ft):Ft=e[131];let It;e[132]!==Ft?(It=o.jsxs(Oe,{type:"button",variant:"outline",size:"sm",onClick:ys,children:[vs,Ft]}),e[132]=Ft,e[133]=It):It=e[133];let js;e[134]!==Rt||e[135]!==It?(js=o.jsxs("div",{className:"space-y-3",children:[Rt,bs,It]}),e[134]=Rt,e[135]=It,e[136]=js):js=e[136];let Ss;e[137]!==D?(Ss=D.trim(),e[137]=D,e[138]=Ss):Ss=e[138];let ks;e[139]===Symbol.for("react.memo_cache_sentinel")?(ks=o.jsx(hn,{size:14}),e[139]=ks):ks=e[139];let ws;e[140]!==m?(ws=m("sandbox.postBoard.importRun"),e[140]=m,e[141]=ws):ws=e[141];let Cs;e[142]!==A||e[143]!==f||e[144]!==u||e[145]!==r||e[146]!==l?(Cs=l==="board"&&r&&A&&u&&o.jsx("div",{className:"absolute inset-0 z-30 flex flex-col bg-background",children:u(r,{expanded:!0,onToggleExpand:()=>_(!1),onClose:()=>{_(!1),f?.()}})}),e[142]=A,e[143]=f,e[144]=u,e[145]=r,e[146]=l,e[147]=Cs):Cs=e[147];const fn=l==="board"&&!!r&&!A;let Kt;e[148]!==f?(Kt=K=>{K||(_(!1),f?.())},e[148]=f,e[149]=Kt):Kt=e[149];let Mt;e[150]!==m?(Mt=m("sandbox.collectionsSidebar.posts"),e[150]=m,e[151]=Mt):Mt=e[151];let zt;e[152]!==Mt?(zt=o.jsx(Ht,{className:"sr-only",children:Mt}),e[152]=Mt,e[153]=zt):zt=e[153];let Vt;e[154]!==f||e[155]!==u||e[156]!==r?(Vt=r&&u?o.jsx(F.Suspense,{fallback:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Sn,{size:20,className:"animate-spin text-muted-foreground"})}),children:u(r,{expanded:!1,onToggleExpand:()=>_(!0),onClose:()=>f?.()})}):null,e[154]=f,e[155]=u,e[156]=r,e[157]=Vt):Vt=e[157];let Ut;e[158]!==zt||e[159]!==Vt?(Ut=o.jsxs(qt,{closeButtonClassName:"hidden",className:"left-auto right-4 top-4 bottom-4 flex h-auto translate-x-0 translate-y-0 flex-col gap-0 overflow-hidden p-0 sm:max-w-3xl",children:[zt,Vt]}),e[158]=zt,e[159]=Vt,e[160]=Ut):Ut=e[160];let Ns;return e[161]!==fn||e[162]!==Kt||e[163]!==Ut?(Ns=o.jsx(Wt,{open:fn,onOpenChange:Kt,children:Ut}),e[161]=fn,e[162]=Kt,e[163]=Ut,e[164]=Ns):Ns=e[164],o.jsxs("div",{className:"relative flex h-full min-w-0 flex-col",children:[o.jsxs("div",{className:"flex shrink-0 flex-wrap items-center justify-between gap-3 border-b px-6 py-3",children:[y,o.jsxs("div",{className:"flex items-center gap-2",children:[ps,gs,o.jsx(Wt,{open:L,onOpenChange:T,children:o.jsxs(qt,{className:"max-h-[85vh] sm:max-w-2xl",children:[hs,js,o.jsx(us,{children:o.jsxs(Oe,{type:"button",disabled:!Ss,onClick:dn,children:[ks,ws]})})]})})]})]}),Q.length===0?o.jsx(Ur,{className:"flex-1",icon:o.jsx(Is,{size:22}),title:m("sandbox.postBoard.emptyTitle"),description:m("sandbox.postBoard.emptyDescription"),buttonProps:{children:m("sandbox.postBoard.newPost"),onClick:yt}}):l==="board"?o.jsx("div",{className:"flex min-h-0 flex-1 gap-3 overflow-x-auto p-4",children:$d.map(K=>{const se=m(qs[K]),Be=Q.filter($e=>$e.status===K);Fd(K)&&Be.sort(Rd);const rt=W(K,Be.length===0);return o.jsxs(F.Fragment,{children:[o.jsx("div",{onDragOver:$e=>{$e.preventDefault(),k(K)},onDragLeave:()=>k($e=>$e===K?null:$e),onDrop:$e=>{$e.preventDefault(),cn(K,$e.dataTransfer.getData(Ua))},className:ve("flex shrink-0 flex-col rounded-xl border bg-muted/30 transition-colors",rt?"w-11":"w-72",h===K&&"border-primary bg-primary/5"),children:rt?o.jsxs("button",{type:"button",onClick:()=>z(K,!1),"aria-label":m("sandbox.postBoard.expandLane",{lane:se}),"aria-expanded":!1,className:"flex min-h-0 flex-1 cursor-pointer flex-col items-center gap-2 py-2.5 text-muted-foreground hover:text-foreground",children:[o.jsx(Rs,{size:14,className:"shrink-0"}),o.jsx("span",{className:"text-xs tabular-nums",children:Be.length}),o.jsx("span",{className:"[writing-mode:vertical-rl] text-sm font-medium",children:se})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex items-center justify-between gap-2 px-3 py-2.5 text-sm font-medium",children:[o.jsxs("button",{type:"button",onClick:()=>z(K,!0),"aria-label":m("sandbox.postBoard.collapseLane",{lane:se}),"aria-expanded":!0,className:"flex min-w-0 cursor-pointer items-center gap-1.5 text-left hover:text-muted-foreground",children:[o.jsx(rs,{size:14,className:"shrink-0"}),o.jsx("span",{className:"truncate",children:se})]}),o.jsx("span",{className:"text-xs tabular-nums text-muted-foreground",children:Be.length})]}),o.jsx("div",{className:"min-h-0 flex-1 space-y-2 overflow-y-auto px-2 pb-2",children:Be.length===0?o.jsx("p",{className:"px-1 py-6 text-center text-xs text-muted-foreground",children:m("sandbox.postBoard.laneEmpty")}):Be.map($e=>o.jsx(qd,{post:$e,payload:ee($e.key),moving:g.isMoving($e.key),onOpen:()=>d($e.key),onArchive:$e.status==="archived"?void 0:()=>{le($e)}},$e.key))})]})}),K===Tn&&o.jsx("div",{"aria-hidden":!0,className:"my-1 w-px shrink-0 self-stretch bg-border"})]},K)})}):o.jsxs("div",{className:"flex min-h-0 flex-1",children:[o.jsxs("div",{className:"flex w-80 shrink-0 flex-col border-r",children:[o.jsx(Pd,{value:M,onChange:me}),Le?o.jsx(Od,{count:he.size,allSelected:ke.length>0&&ke.every(K=>he.has(K.key)),onToggleSelectAll:rn,onArchive:()=>{ln()},onExit:()=>ye(new Set)}):o.jsx(Td,{categories:Ee,authors:De,statusCounts:_e,categoryFilter:ce,authorFilter:te,statusFilter:X,sort:J,onCategoryFilterChange:fe,onAuthorFilterChange:de,onStatusFilterChange:ne,onSortChange:w}),o.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:o.jsx(Gd,{posts:ke,selectedKey:ie,selectionActive:Le,selectedKeys:he,onToggleSelect:an,onOpen:d,isMoving:g.isMoving,onArchive:K=>{le(K)}})})]}),o.jsx("div",{className:"min-w-0 flex-1 overflow-hidden",children:ie&&u?o.jsx(F.Suspense,{fallback:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Sn,{size:20,className:"animate-spin text-muted-foreground"})}),children:u(ie)}):o.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center text-sm text-muted-foreground",children:m("sandbox.postBoard.selectPrompt")})})]}),Cs,Ns]})}function Kd(t){return t.slug}function Md(t){return t.key}function zd(t){return t.authorEmails}function Vd(t){return t.categorySlugs}function Ud(t,e){return t[e.status]=(t[e.status]??0)+1,t}function To(t){const e=re.c(7),{active:s,onClick:n,icon:a,label:i}=t,l=s?"bg-accent text-accent-foreground":"text-muted-foreground hover:text-foreground";let r;e[0]!==l?(r=ve("inline-flex cursor-pointer items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",l),e[0]=l,e[1]=r):r=e[1];let c;return e[2]!==a||e[3]!==i||e[4]!==n||e[5]!==r?(c=o.jsxs("button",{type:"button",onClick:n,className:r,children:[a,i]}),e[2]=a,e[3]=i,e[4]=n,e[5]=r,e[6]=c):c=e[6],c}function Gd(t){const e=re.c(23),{posts:s,selectedKey:n,selectionActive:a,selectedKeys:i,onToggleSelect:l,onOpen:r,isMoving:c,onArchive:d}=t,f=Ce();if(s.length===0){let u;e[0]!==f?(u=f("sandbox.postList.noMatches"),e[0]=f,e[1]=u):u=e[1];let m;return e[2]!==u?(m=o.jsx("p",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:u}),e[2]=u,e[3]=m):m=e[3],m}let g;if(e[4]!==c||e[5]!==d||e[6]!==r||e[7]!==l||e[8]!==s||e[9]!==n||e[10]!==i||e[11]!==a){let u;e[13]!==c||e[14]!==d||e[15]!==r||e[16]!==l||e[17]!==n||e[18]!==i||e[19]!==a?(u=m=>o.jsx(Hd,{post:m,selected:m.key===n,selectionActive:a,checked:i.has(m.key),onToggleSelect:()=>l(m.key),moving:c(m.key),onOpen:()=>r(m.key),onArchive:m.status==="archived"?void 0:()=>d(m)},m.key),e[13]=c,e[14]=d,e[15]=r,e[16]=l,e[17]=n,e[18]=i,e[19]=a,e[20]=u):u=e[20],g=s.map(u),e[4]=c,e[5]=d,e[6]=r,e[7]=l,e[8]=s,e[9]=n,e[10]=i,e[11]=a,e[12]=g}else g=e[12];let p;return e[21]!==g?(p=o.jsx("ul",{className:"divide-y",children:g}),e[21]=g,e[22]=p):p=e[22],p}function Hd(t){const e=re.c(60),{post:s,selected:n,selectionActive:a,checked:i,onToggleSelect:l,moving:r,onOpen:c,onArchive:d}=t,f=Ce(),g=s.status==="awaiting_review"&&s.missing.length>0,p=s.status==="scheduled"||s.status==="published",u=a||i?"opacity-100":"opacity-0 focus-within:opacity-100 group-hover/row:opacity-100";let m;e[0]!==u?(m=ve("absolute left-3 top-3 z-10 transition-opacity",u),e[0]=u,e[1]=m):m=e[1];let x;e[2]!==l?(x=()=>l(),e[2]=l,e[3]=x):x=e[3];let S;e[4]!==s.title||e[5]!==f?(S=s.title||f("sandbox.postBoard.untitled"),e[4]=s.title,e[5]=f,e[6]=S):S=e[6];let N;e[7]!==i||e[8]!==x||e[9]!==S?(N=o.jsx(Xs,{checked:i,onCheckedChange:x,"aria-label":S}),e[7]=i,e[8]=x,e[9]=S,e[10]=N):N=e[10];let j;e[11]!==m||e[12]!==N?(j=o.jsx("span",{className:m,children:N}),e[11]=m,e[12]=N,e[13]=j):j=e[13];let b;e[14]!==r||e[15]!==d||e[16]!==a?(b=d&&!a&&o.jsx(Ga,{onArchive:d,disabled:r,className:"top-2.5"}),e[14]=r,e[15]=d,e[16]=a,e[17]=b):b=e[17];let h;e[18]!==c||e[19]!==l||e[20]!==a?(h=()=>a?l():c(),e[18]=c,e[19]=l,e[20]=a,e[21]=h):h=e[21];const k=n?"bg-accent text-accent-foreground":"bg-card hover:bg-muted/50";let A;e[22]!==k?(A=ve("flex w-full cursor-pointer flex-col gap-1.5 py-2.5 pl-10 pr-3 text-left text-sm transition-colors",k),e[22]=k,e[23]=A):A=e[23];let _;e[24]!==s.title||e[25]!==f?(_=s.title||f("sandbox.postBoard.untitled"),e[24]=s.title,e[25]=f,e[26]=_):_=e[26];let v;e[27]!==_?(v=o.jsx("span",{className:"min-w-0 truncate pr-6 font-medium",children:_}),e[27]=_,e[28]=v):v=e[28];const E=Ld[s.status],L=qs[s.status];let T;e[29]!==f||e[30]!==L?(T=f(L),e[29]=f,e[30]=L,e[31]=T):T=e[31];let D;e[32]!==E||e[33]!==T?(D=o.jsx(Mn,{variant:E,className:"shrink-0",children:T}),e[32]=E,e[33]=T,e[34]=D):D=e[34];let P;e[35]!==g||e[36]!==s.missing?(P=g&&o.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-warning",children:[o.jsx(is,{size:12}),s.missing.length]}),e[35]=g,e[36]=s.missing,e[37]=P):P=e[37];let B;e[38]!==s.duplicateTitle||e[39]!==f?(B=s.duplicateTitle&&o.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-warning",title:f("sandbox.postBoard.duplicateTitle"),children:[o.jsx(In,{size:12,"aria-hidden":!0}),o.jsx("span",{className:"sr-only",children:f("sandbox.postBoard.duplicateTitle")})]}),e[38]=s.duplicateTitle,e[39]=f,e[40]=B):B=e[40];let C;e[41]!==p||e[42]!==s.date||e[43]!==s.scheduledDatetime?(C=p&&o.jsxs("span",{className:"inline-flex items-center gap-1 text-xs tabular-nums text-muted-foreground",children:[o.jsx(Dn,{size:12}),(s.scheduledDatetime||s.date||"").slice(0,10)]}),e[41]=p,e[42]=s.date,e[43]=s.scheduledDatetime,e[44]=C):C=e[44];let $;e[45]!==D||e[46]!==P||e[47]!==B||e[48]!==C?($=o.jsxs("div",{className:"flex items-center gap-2",children:[D,P,B,C]}),e[45]=D,e[46]=P,e[47]=B,e[48]=C,e[49]=$):$=e[49];let V;e[50]!==n||e[51]!==A||e[52]!==v||e[53]!==$||e[54]!==h?(V=o.jsxs("button",{type:"button",onClick:h,"aria-current":n,className:A,children:[v,$]}),e[50]=n,e[51]=A,e[52]=v,e[53]=$,e[54]=h,e[55]=V):V=e[55];let I;return e[56]!==V||e[57]!==j||e[58]!==b?(I=o.jsxs("li",{className:"group/row relative",children:[j,b,V]}),e[56]=V,e[57]=j,e[58]=b,e[59]=I):I=e[59],I}function qd(t){const e=re.c(50),{post:s,payload:n,moving:a,onOpen:i,onArchive:l}=t,r=Ce(),c=s.status!=="generating"&&!a;let d;e[0]!==n?(d=tc(n),e[0]=n,e[1]=d):d=e[1];const f=d,g=!c&&"opacity-80";let p;e[2]!==g?(p=ve("group/card relative rounded-lg border bg-card shadow-sm transition-colors hover:border-primary/40",g),e[2]=g,e[3]=p):p=e[3];let u;e[4]!==a||e[5]!==l?(u=l&&o.jsx(Ga,{onArchive:l,disabled:a,className:"top-2"}),e[4]=a,e[5]=l,e[6]=u):u=e[6];let m;e[7]!==s.key?(m=T=>T.dataTransfer.setData(Ua,s.key),e[7]=s.key,e[8]=m):m=e[8];const x=c?"cursor-grab active:cursor-grabbing":"cursor-pointer";let S;e[9]!==x?(S=ve("block w-full p-3 text-left",x),e[9]=x,e[10]=S):S=e[10];let N;e[11]!==s.title||e[12]!==r?(N=s.title||r("sandbox.postBoard.untitled"),e[11]=s.title,e[12]=r,e[13]=N):N=e[13];let j;e[14]!==N?(j=o.jsx("p",{className:"line-clamp-2 pr-6 text-sm font-medium",children:N}),e[14]=N,e[15]=j):j=e[15];let b;e[16]!==f||e[17]!==s.status?(b=s.status==="draft"&&f.format?.name&&o.jsx(Mn,{variant:"outline",className:"max-w-full truncate",children:f.format.name}),e[16]=f,e[17]=s.status,e[18]=b):b=e[18];let h;e[19]!==s.status||e[20]!==r?(h=s.status==="generating"&&o.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground",children:[o.jsx(Sn,{size:12,className:"animate-spin"}),r("sandbox.postBoard.generatingLabel")]}),e[19]=s.status,e[20]=r,e[21]=h):h=e[21];let k;e[22]!==s.missing||e[23]!==s.status||e[24]!==r?(k=s.status==="awaiting_review"&&(s.missing.length>0?o.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-warning",children:[o.jsx(is,{size:12}),r("sandbox.postBoard.nIssues",{count:String(s.missing.length)})]}):o.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-success",children:[o.jsx(Vr,{size:12}),r("sandbox.postBoard.readyToSchedule")]})),e[22]=s.missing,e[23]=s.status,e[24]=r,e[25]=k):k=e[25];let A;e[26]!==s.date||e[27]!==s.scheduledDatetime||e[28]!==s.status?(A=(s.status==="scheduled"||s.status==="published")&&o.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground",children:[o.jsx(Dn,{size:12}),(s.scheduledDatetime||s.date||"").slice(0,10)]}),e[26]=s.date,e[27]=s.scheduledDatetime,e[28]=s.status,e[29]=A):A=e[29];let _;e[30]!==s.duplicateTitle||e[31]!==r?(_=s.duplicateTitle&&o.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-warning",children:[o.jsx(In,{size:12,"aria-hidden":!0}),r("sandbox.postBoard.duplicateTitle")]}),e[30]=s.duplicateTitle,e[31]=r,e[32]=_):_=e[32];let v;e[33]!==b||e[34]!==h||e[35]!==k||e[36]!==A||e[37]!==_?(v=o.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5",children:[b,h,k,A,_]}),e[33]=b,e[34]=h,e[35]=k,e[36]=A,e[37]=_,e[38]=v):v=e[38];let E;e[39]!==c||e[40]!==i||e[41]!==v||e[42]!==m||e[43]!==S||e[44]!==j?(E=o.jsxs("button",{type:"button",draggable:c,onDragStart:m,onClick:i,className:S,children:[j,v]}),e[39]=c,e[40]=i,e[41]=v,e[42]=m,e[43]=S,e[44]=j,e[45]=E):E=e[45];let L;return e[46]!==E||e[47]!==p||e[48]!==u?(L=o.jsxs("div",{className:p,children:[u,E]}),e[46]=E,e[47]=p,e[48]=u,e[49]=L):L=e[49],L}function Ga(t){const e=re.c(13),{label:s,onArchive:n,disabled:a,className:i}=t,l=Ce();let r;e[0]!==s||e[1]!==l?(r=s??l("sandbox.postBoard.delete"),e[0]=s,e[1]=l,e[2]=r):r=e[2];const c=r;let d;e[3]!==n?(d=u=>{u.stopPropagation(),n()},e[3]=n,e[4]=d):d=e[4];let f;e[5]!==i?(f=ve("absolute right-2 z-10 flex size-6 cursor-pointer items-center justify-center rounded-md text-muted-foreground opacity-0 transition-opacity hover:bg-muted hover:text-destructive focus-visible:opacity-100 group-hover/card:opacity-100 group-hover/row:opacity-100",i),e[5]=i,e[6]=f):f=e[6];let g;e[7]===Symbol.for("react.memo_cache_sentinel")?(g=o.jsx(Kn,{size:13}),e[7]=g):g=e[7];let p;return e[8]!==a||e[9]!==d||e[10]!==f||e[11]!==c?(p=o.jsx("button",{type:"button",disabled:a,"aria-label":c,title:c,onClick:d,className:f,children:g}),e[8]=a,e[9]=d,e[10]=f,e[11]=c,e[12]=p):p=e[12],p}function He(t){const e=re.c(54),{icon:s,logoUrl:n,title:a,subtitle:i,active:l,accent:r,variantCount:c,trailing:d,selectable:f,selectionActive:g,selected:p,invalid:u,invalidReason:m,warning:x,warningReason:S,onToggleSelect:N,onClick:j,menu:b}=t,h=Ce(),k=r==="global";let A;e[0]!==s||e[1]!==l||e[2]!==k||e[3]!==n?(A=n?o.jsx("img",{src:n,alt:"",className:"size-8 shrink-0 rounded-lg object-cover bg-muted"}):o.jsx("span",{className:ve("flex size-8 shrink-0 items-center justify-center rounded-lg",k?"bg-global-section/15":"bg-muted"),children:o.jsx(s,{size:16,className:ve("shrink-0",!k&&(l?"text-accent-foreground":"text-muted-foreground")),style:k?{color:Fn}:void 0})}),e[0]=s,e[1]=l,e[2]=k,e[3]=n,e[4]=A):A=e[4];const _=A,v=l?k?"bg-global-section/15 text-global-section-fg dark:text-global-section-fg-dark":"bg-accent text-accent-foreground":k?"hover:bg-global-section/10":"hover:bg-muted";let E;e[5]!==v?(E=ve("group relative flex min-w-0 items-center rounded-md transition-colors",v),e[5]=v,e[6]=E):E=e[6];let L;e[7]!==N||e[8]!==f||e[9]!==p||e[10]!==g||e[11]!==h||e[12]!==a?(L=f&&o.jsx("span",{className:ve("flex shrink-0 items-center pl-2.5 transition-opacity",p||g?"opacity-100":"opacity-0 group-hover:opacity-100 focus-within:opacity-100"),onClick:Wd,children:o.jsx(Xs,{checked:p,onCheckedChange:()=>N?.(),"aria-label":h("sandbox.itemRow.selectItem",{title:a})})}),e[7]=N,e[8]=f,e[9]=p,e[10]=g,e[11]=h,e[12]=a,e[13]=L):L=e[13];const T=u&&!l&&"text-destructive";let D;e[14]!==T?(D=ve("block truncate text-sm font-medium",T),e[14]=T,e[15]=D):D=e[15];let P;e[16]!==D||e[17]!==a?(P=o.jsx("span",{className:D,children:a}),e[16]=D,e[17]=a,e[18]=P):P=e[18];const B=l?"text-accent-foreground/70":"text-muted-foreground";let C;e[19]!==B?(C=ve("block truncate text-xs",B),e[19]=B,e[20]=C):C=e[20];let $;e[21]!==i||e[22]!==C?($=o.jsx("span",{className:C,children:i}),e[21]=i,e[22]=C,e[23]=$):$=e[23];let V;e[24]!==$||e[25]!==P?(V=o.jsxs("span",{className:"min-w-0 flex-1",children:[P,$]}),e[24]=$,e[25]=P,e[26]=V):V=e[26];let I;e[27]!==l||e[28]!==h||e[29]!==c?(I=c!==void 0&&c>1&&o.jsxs(Ye,{children:[o.jsx(qe,{asChild:!0,children:o.jsxs("span",{className:ve("flex shrink-0 items-center gap-1 text-xs font-medium",l?"text-accent-foreground/70":"text-muted-foreground"),children:[o.jsx(Mo,{size:14}),c]})}),o.jsx(We,{side:"bottom",children:h("sandbox.itemRow.variantCount",{count:c})})]}),e[27]=l,e[28]=h,e[29]=c,e[30]=I):I=e[30];let W;e[31]!==x||e[32]!==S?(W=x&&o.jsxs(Ye,{children:[o.jsx(qe,{asChild:!0,children:o.jsx("span",{className:"flex shrink-0 items-center text-warning",children:o.jsx(is,{size:14})})}),S&&o.jsx(We,{side:"bottom",children:S})]}),e[31]=x,e[32]=S,e[33]=W):W=e[33];let q;e[34]!==l||e[35]!==u||e[36]!==m?(q=u&&o.jsxs(Ye,{children:[o.jsx(qe,{asChild:!0,children:o.jsx("span",{className:ve("flex shrink-0 items-center",l?"text-accent-foreground":"text-destructive"),children:o.jsx(is,{size:14})})}),m&&o.jsx(We,{side:"bottom",children:m})]}),e[34]=l,e[35]=u,e[36]=m,e[37]=q):q=e[37];let z;e[38]!==j||e[39]!==_||e[40]!==V||e[41]!==I||e[42]!==W||e[43]!==q||e[44]!==d?(z=o.jsxs("button",{type:"button",onClick:j,className:"flex min-w-0 flex-1 items-center gap-2.5 rounded-lg px-2.5 py-2 text-left cursor-pointer",children:[_,V,I,W,q,d]}),e[38]=j,e[39]=_,e[40]=V,e[41]=I,e[42]=W,e[43]=q,e[44]=d,e[45]=z):z=e[45];let O;e[46]!==l||e[47]!==b?(O=b&&o.jsx("div",{className:ve("pr-1 opacity-0 transition-opacity group-hover:opacity-100",l&&"opacity-100"),children:b}),e[46]=l,e[47]=b,e[48]=O):O=e[48];let Y;return e[49]!==z||e[50]!==O||e[51]!==E||e[52]!==L?(Y=o.jsxs("div",{className:E,children:[L,z,O]}),e[49]=z,e[50]=O,e[51]=E,e[52]=L,e[53]=Y):Y=e[53],Y}function Wd(t){return t.stopPropagation()}function it(t){const e=re.c(10),{icon:s,title:n,description:a}=t;let i;e[0]!==s?(i=s&&o.jsx(s,{size:24,className:"text-muted-foreground/60"}),e[0]=s,e[1]=i):i=e[1];let l;e[2]!==n?(l=o.jsx("div",{children:n}),e[2]=n,e[3]=l):l=e[3];let r;e[4]!==a?(r=a&&o.jsx("div",{className:"text-xs text-muted-foreground/80 max-w-sm",children:a}),e[4]=a,e[5]=r):r=e[5];let c;return e[6]!==i||e[7]!==l||e[8]!==r?(c=o.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center gap-2 p-6 text-center text-sm text-muted-foreground",children:[i,l,r]}),e[6]=i,e[7]=l,e[8]=r,e[9]=c):c=e[9],c}const Yd={loaders:Ko,actions:Go},Qd={loaders:"Loaders",actions:"Actions"},Jd={analytics:di,blog:ta,commerce:ci,site:li,website:Fs};function Xd(t,e){return e===0?Jd[t.toLowerCase()]??Qn:Qn}function Ts(t,e){return e===0?qi(t):t}function Zd(t){const e=re.c(98),{orgSlug:s,virtualMcpId:n,branch:a,previewUrl:i,meta:l,decofile:r,kind:c}=t,d=Ce();let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=[],e[0]=f):f=e[0];const[g,p]=F.useState(f),[u,m]=F.useState(null),[x,S]=F.useState(""),[N,j]=F.useState(ru),[b,h]=F.useState(c);b!==c&&(h(c),p([]),m(null),S(""),j(new Set));let k;e[1]===Symbol.for("react.memo_cache_sentinel")?(k=U=>{j(Q=>{const oe=new Set(Q);return oe.has(U)?oe.delete(U):oe.add(U),oe})},e[1]=k):k=e[1];const A=k;let _;e[2]!==a||e[3]!==s||e[4]!==n?(_={orgSlug:s,virtualMcpId:n,branch:a},e[2]=a,e[3]=s,e[4]=n,e[5]=_):_=e[5];const v=Js(_);let E;e[6]!==v?(E=Xo((U,Q)=>v.mutate({blockKey:U,data:Q})),e[6]=v,e[7]=E):E=e[7];const L=E;let T;e[8]!==c?(T=Wi(c),e[8]=c,e[9]=T):T=e[9];const D=T,P=Yd[c];let B,C,$,V,I,W,q;if(e[10]!==P||e[11]!==a||e[12]!==r||e[13]!==c||e[14]!==l||e[15]!==N||e[16]!==s||e[17]!==g||e[18]!==i||e[19]!==v||e[20]!==L||e[21]!==x||e[22]!==u||e[23]!==D||e[24]!==d||e[25]!==n){$=Symbol.for("react.early_return_sentinel");e:{const U=[...Vi(l,r,c).map(iu),...Ui(l,c).map(au)],Q=x.trim().toLowerCase(),oe=Q.length>0,ee=oe?U.filter(G=>G.title.toLowerCase().includes(Q)||G.resolveType.toLowerCase().includes(Q)):[],ie=new Map,ae=[],le=new Map;if(!oe){for(const G of U){const be=G.folderPath;if(!(be.length<g.length)&&g.every((ke,Le)=>be[Le]===ke))if(be.length===g.length)if(G.savedKey!==void 0){const ke=le.get(G.resolveType);ke?ke.push(G):le.set(G.resolveType,[G])}else ae.push(G);else{const ke=be[g.length],Le=ie.get(ke)??{count:0,savedCount:0};G.savedKey!==void 0?Le.savedCount=Le.savedCount+1:Le.count=Le.count+1,ie.set(ke,Le)}}ae.sort(ou);for(const G of le.values())G.sort(nu)}const ce=[...le.entries()].filter(G=>{const[be]=G;return!ae.some(ke=>ke.resolveType===be)}).flatMap(su).sort(tu);let fe;e[33]!==g?(fe=(G,be)=>Ts(G.name,g.length).localeCompare(Ts(be.name,g.length)),e[33]=g,e[34]=fe):fe=e[34];const te=[...ie.entries()].map(eu).sort(fe);let de;e[35]===Symbol.for("react.memo_cache_sentinel")?(de=G=>{m(G.savedKey!==void 0?{mode:"saved",key:G.savedKey}:{mode:"available",resolveType:G.resolveType,title:G.title})},e[35]=de):de=e[35];const X=de;let ne;e[36]!==v||e[37]!==D||e[38]!==d?(ne=async(G,be)=>{await v.mutateAsync({blockKey:G,data:be}),pe.success(d("sandbox.runnableBlocksBrowser.savedBlockToast",{singular:D,blockId:G})),m({mode:"saved",key:G})},e[36]=v,e[37]=D,e[38]=d,e[39]=ne):ne=e[39];const J=ne;let w;e[40]!==r||e[41]!==u?(w=lu(u,r),e[40]=r,e[41]=u,e[42]=w):w=e[42];const M=w;if(M){const G=`${M.mode}:${M.mode==="saved"?M.blockKey:M.resolveType}`;let be;e[43]===Symbol.for("react.memo_cache_sentinel")?(be=()=>m(null),e[43]=be):be=e[43];let ke;e[44]!==a||e[45]!==r||e[46]!==J||e[47]!==c||e[48]!==l||e[49]!==s||e[50]!==i||e[51]!==v.isPending||e[52]!==L||e[53]!==G||e[54]!==M.editorTarget||e[55]!==M.initialValue||e[56]!==n?(ke=o.jsx(Gi,{orgSlug:s,virtualMcpId:n,branch:a,previewUrl:i,meta:l,decofile:r,kind:c,target:M.editorTarget,initialValue:M.initialValue,isCreating:v.isPending,onCreate:J,onSaveReferencedBlock:L,onBack:be},G),e[44]=a,e[45]=r,e[46]=J,e[47]=c,e[48]=l,e[49]=s,e[50]=i,e[51]=v.isPending,e[52]=L,e[53]=G,e[54]=M.editorTarget,e[55]=M.initialValue,e[56]=n,e[57]=ke):ke=e[57],$=ke;break e}q="flex h-full w-full min-w-0 flex-col";let me;e[58]!==d?(me=d("sandbox.runnableBlocksBrowser.folderBreadcrumb"),e[58]=d,e[59]=me):me=e[59];let ge;e[60]===Symbol.for("react.memo_cache_sentinel")?(ge=()=>p([]),e[60]=ge):ge=e[60];const he=g.length===0?"font-medium text-foreground":"text-muted-foreground";let ye;e[61]!==he?(ye=ve("min-w-0 truncate rounded-lg px-1 py-0.5 transition-colors hover:bg-accent hover:text-accent-foreground",he),e[61]=he,e[62]=ye):ye=e[62];const _e=Qd[c];let Pe;e[63]!==ye||e[64]!==_e?(Pe=o.jsx("button",{type:"button",onClick:ge,className:ye,children:_e}),e[63]=ye,e[64]=_e,e[65]=Pe):Pe=e[65];let Te;e[66]!==g?(Te=g.map((G,be)=>{const ke=be===g.length-1;return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[o.jsx(Rs,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>p(g.slice(0,be+1)),className:ve("min-w-0 truncate rounded-lg px-1 py-0.5 transition-colors hover:bg-accent hover:text-accent-foreground",ke?"font-medium text-foreground":"text-muted-foreground"),children:Ts(G,be)})]},`${G}-${be}`)}),e[66]=g,e[67]=Te):Te=e[67];let we;e[68]!==me||e[69]!==Pe||e[70]!==Te?(we=o.jsxs("nav",{"aria-label":me,className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:[Pe,Te]}),e[68]=me,e[69]=Pe,e[70]=Te,e[71]=we):we=e[71];let Ee;e[72]===Symbol.for("react.memo_cache_sentinel")?(Ee=o.jsx(Bn,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),e[72]=Ee):Ee=e[72];let De;e[73]===Symbol.for("react.memo_cache_sentinel")?(De=G=>S(G.target.value),e[73]=De):De=e[73];let xe;e[74]!==c||e[75]!==d?(xe=d("sandbox.runnableBlocksBrowser.searchPlaceholder",{kind:c}),e[74]=c,e[75]=d,e[76]=xe):xe=e[76];let Ae;e[77]!==c||e[78]!==d?(Ae=d("sandbox.runnableBlocksBrowser.searchAriaLabel",{kind:c}),e[77]=c,e[78]=d,e[79]=Ae):Ae=e[79];let Re;e[80]!==x||e[81]!==xe||e[82]!==Ae?(Re=o.jsxs("div",{className:"flex w-56 shrink-0 items-center gap-2",children:[Ee,o.jsx("input",{type:"text",value:x,onChange:De,placeholder:xe,"aria-label":Ae,className:"w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),e[80]=x,e[81]=xe,e[82]=Ae,e[83]=Re):Re=e[83],e[84]!==we||e[85]!==Re?(C=o.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-2 border-b px-4",children:[we,Re]}),e[84]=we,e[85]=Re,e[86]=C):C=e[86],B=Qs,W="min-h-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",V="mx-auto w-full max-w-4xl px-6 py-5",I=oe?ee.length===0?o.jsx(it,{title:d("sandbox.runnableBlocksBrowser.noSearchResults",{kind:c,query:x.trim()}),description:d("sandbox.runnableBlocksBrowser.noSearchResultsDescription")}):o.jsx("div",{className:"flex flex-col gap-1",children:ee.map(G=>o.jsx(He,{icon:P,accent:G.savedKey!==void 0?"global":void 0,title:G.title,subtitle:G.resolveType,active:!1,onClick:()=>X(G)},G.savedKey??G.resolveType))}):te.length===0&&ae.length===0&&ce.length===0?o.jsx(it,{title:d("sandbox.runnableBlocksBrowser.emptyFolderTitle",{kind:c}),description:g.length===0?d("sandbox.runnableBlocksBrowser.emptyFolderNoManifest"):d("sandbox.runnableBlocksBrowser.emptyFolder")}):o.jsxs(o.Fragment,{children:[te.length>0&&o.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(180px,1fr))] gap-2",children:te.map(G=>{const be=Xd(G.name,g.length);return o.jsxs("button",{type:"button",onClick:()=>p([...g,G.name]),className:"flex items-center gap-2.5 rounded-lg border px-3 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer",children:[o.jsx(be,{size:18,className:"shrink-0 text-muted-foreground"}),o.jsxs("span",{className:"min-w-0 flex-1",children:[o.jsx("span",{className:"block truncate text-sm font-medium",children:Ts(G.name,g.length)}),o.jsxs("span",{className:"block truncate text-xs text-muted-foreground",children:[G.count," ",G.count===1?D:c,G.savedCount>0&&o.jsxs(o.Fragment,{children:[" ","·"," ",d("sandbox.runnableBlocksBrowser.savedCountLabel",{count:G.savedCount})]})]})]})]},G.name)})}),(ae.length>0||ce.length>0)&&o.jsxs("div",{className:ve("flex flex-col gap-1",te.length>0&&"mt-4"),children:[ae.map(G=>{const be=le.get(G.resolveType)??[],ke=N.has(G.resolveType);return o.jsxs("div",{className:"flex flex-col",children:[o.jsx(He,{icon:P,title:G.title,subtitle:G.resolveType,active:!1,onClick:()=>X(G)}),be.length>0&&o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",onClick:()=>A(G.resolveType),"aria-expanded":ke,className:"flex items-center gap-1 self-start rounded-lg px-2.5 py-1 text-xs font-medium transition-colors hover:bg-global-section/10 cursor-pointer ml-11",style:{color:Fn},children:[ke?o.jsx(rs,{size:12,className:"shrink-0"}):o.jsx(Rs,{size:12,className:"shrink-0"}),d(ke?"sandbox.runnableBlocksBrowser.hideSaved":"sandbox.runnableBlocksBrowser.seeSaved")," ","(",be.length,")"]}),ke&&o.jsx("div",{className:"ml-11 flex flex-col gap-1 pb-1",children:be.map(Le=>o.jsx(He,{icon:P,accent:"global",title:Le.title,subtitle:Le.resolveType,active:!1,onClick:()=>X(Le)},Le.savedKey))})]})]},G.resolveType)}),ce.map(G=>o.jsx(He,{icon:P,accent:"global",title:G.title,subtitle:G.resolveType,active:!1,onClick:()=>X(G)},G.savedKey))]})]})}e[10]=P,e[11]=a,e[12]=r,e[13]=c,e[14]=l,e[15]=N,e[16]=s,e[17]=g,e[18]=i,e[19]=v,e[20]=L,e[21]=x,e[22]=u,e[23]=D,e[24]=d,e[25]=n,e[26]=B,e[27]=C,e[28]=$,e[29]=V,e[30]=I,e[31]=W,e[32]=q}else B=e[26],C=e[27],$=e[28],V=e[29],I=e[30],W=e[31],q=e[32];if($!==Symbol.for("react.early_return_sentinel"))return $;let z;e[87]!==V||e[88]!==I?(z=o.jsx("div",{className:V,children:I}),e[87]=V,e[88]=I,e[89]=z):z=e[89];let O;e[90]!==B||e[91]!==z||e[92]!==W?(O=o.jsx(B,{className:W,children:z}),e[90]=B,e[91]=z,e[92]=W,e[93]=O):O=e[93];let Y;return e[94]!==C||e[95]!==O||e[96]!==q?(Y=o.jsxs("div",{className:q,children:[C,O]}),e[94]=C,e[95]=O,e[96]=q,e[97]=Y):Y=e[97],Y}function eu(t){const[e,s]=t;return{name:e,...s}}function tu(t,e){return t.title.localeCompare(e.title)}function su(t){const[,e]=t;return e}function nu(t,e){return t.title.localeCompare(e.title)}function ou(t,e){return t.title.localeCompare(e.title)}function au(t){return{resolveType:t.resolveType,title:t.title,folderPath:Jo(t.resolveType)}}function iu(t){return{resolveType:t.resolveType,title:t.title,folderPath:Jo(t.resolveType),savedKey:t.key}}function ru(){return new Set}function lu(t,e){if(!t)return null;if(t.mode==="available")return{mode:"available",resolveType:t.resolveType,editorTarget:{mode:"available",resolveType:t.resolveType,title:t.title},initialValue:{}};const{resolveType:s,props:n,title:a}=Hi(e,t.key);return{mode:"saved",blockKey:t.key,resolveType:s,editorTarget:{mode:"saved",blockKey:t.key,resolveType:s,title:a},initialValue:n}}function cu(t){const e=re.c(106),{orgSlug:s,virtualMcpId:n,branch:a,previewUrl:i,meta:l,decofile:r,resolveType:c,title:d,defaultBlockId:f,isCreating:g,onCreate:p,onSaveReferencedBlock:u}=t,m=Ce(),x=Ys(),S=x?.virtualMcpId,j=oa(S===n?n:null)?.metadata?.siteSlug??null;let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b={},e[0]=b):b=e[0];const[h,k]=F.useState(b);let A;e[1]===Symbol.for("react.memo_cache_sentinel")?(A=[],e[1]=A):A=e[1];const[_,v]=F.useState(A),[E,L]=F.useState(0),[T,D]=F.useState(!1);let P;e[2]!==l||e[3]!==c?(P=$n(c,l),e[2]=l,e[3]=c,e[4]=P):P=e[4];const B=P;let C,$,V,I,W,q,z,O;if(e[5]!==j||e[6]!==a||e[7]!==r||e[8]!==_||e[9]!==h||e[10]!==g||e[11]!==p||e[12]!==s||e[13]!==i||e[14]!==c||e[15]!==m||e[16]!==x?.taskId||e[17]!==d||e[18]!==n){const ae=c.split("/").pop()?.replace(/\.tsx?$/,"")??c,le=x?.taskId??null,ce=i??void 0;let fe;e[27]!==j||e[28]!==a||e[29]!==s||e[30]!==ce||e[31]!==le||e[32]!==n?(fe={orgSlug:s,virtualMcpId:n,branch:a,threadId:le,previewUrl:ce,siteSlug:j},e[27]=j,e[28]=a,e[29]=s,e[30]=ce,e[31]=le,e[32]=n,e[33]=fe):fe=e[33],$=fe;let te,de,X,ne;if(e[34]!==r||e[35]!==_||e[36]!==h||e[37]!==p||e[38]!==m||e[39]!==d){const Pe=[d,..._],Te=Ee=>{v(_.slice(0,Ee)),L(du)};let we;e[48]!==r||e[49]!==h||e[50]!==p?(we=async Ee=>{const De=Qi(Ee,r);if(De){pe.error(De);return}await p(Ee,h),D(!1)},e[48]=r,e[49]=h,e[50]=p,e[51]=we):we=e[51],C=we,O="flex h-full w-full min-w-0",z="flex min-w-0 flex-1 flex-col",W="shrink-0 border-b px-3 py-2.5",ne="flex min-w-0 items-center gap-2 overflow-hidden",e[52]!==m?(te=m("sandbox.availableSectionEditor.editingBreadcrumb"),e[52]=m,e[53]=te):te=e[53],de="flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",X=Pe.map((Ee,De)=>{const xe=De===Pe.length-1,Ae=Yi(Ee);return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[De>0&&o.jsx(Rs,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>Te(De),title:Ae,className:ve("min-w-0 truncate rounded-lg px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",xe?"font-medium text-foreground":"text-muted-foreground"),children:Ae})]},`${Ae}-${De}`)}),e[34]=r,e[35]=_,e[36]=h,e[37]=p,e[38]=m,e[39]=d,e[40]=C,e[41]=te,e[42]=de,e[43]=X,e[44]=ne,e[45]=W,e[46]=z,e[47]=O}else C=e[40],te=e[41],de=e[42],X=e[43],ne=e[44],W=e[45],z=e[46],O=e[47];let J;e[54]!==te||e[55]!==de||e[56]!==X?(J=o.jsx("nav",{"aria-label":te,className:de,children:X}),e[54]=te,e[55]=de,e[56]=X,e[57]=J):J=e[57];let w;e[58]===Symbol.for("react.memo_cache_sentinel")?(w=()=>D(!0),e[58]=w):w=e[58];let M;e[59]!==m?(M=m("sandbox.availableSectionEditor.saveAsGlobalSection"),e[59]=m,e[60]=M):M=e[60];let me;e[61]===Symbol.for("react.memo_cache_sentinel")?(me=o.jsx(ui,{size:14}),e[61]=me):me=e[61];let ge;e[62]!==g||e[63]!==M?(ge=o.jsx(qe,{asChild:!0,children:o.jsx(Oe,{size:"icon",className:"size-8 shrink-0",disabled:g,onClick:w,"aria-label":M,children:me})}),e[62]=g,e[63]=M,e[64]=ge):ge=e[64];let he;e[65]!==m?(he=m("sandbox.availableSectionEditor.saveAsGlobalSection"),e[65]=m,e[66]=he):he=e[66];let ye;e[67]!==he?(ye=o.jsx(We,{side:"bottom",children:he}),e[67]=he,e[68]=ye):ye=e[68];let _e;e[69]!==ge||e[70]!==ye?(_e=o.jsxs(Ye,{children:[ge,ye]}),e[69]=ge,e[70]=ye,e[71]=_e):_e=e[71],e[72]!==ne||e[73]!==J||e[74]!==_e?(q=o.jsxs("div",{className:ne,children:[J,_e]}),e[72]=ne,e[73]=J,e[74]=_e,e[75]=q):q=e[75],V="mt-1.5 py-1 pl-1 text-sm leading-snug text-muted-foreground",I=m("sandbox.availableSectionEditor.localEditsHint",{typeLabel:ae}),e[5]=j,e[6]=a,e[7]=r,e[8]=_,e[9]=h,e[10]=g,e[11]=p,e[12]=s,e[13]=i,e[14]=c,e[15]=m,e[16]=x?.taskId,e[17]=d,e[18]=n,e[19]=C,e[20]=$,e[21]=V,e[22]=I,e[23]=W,e[24]=q,e[25]=z,e[26]=O}else C=e[19],$=e[20],V=e[21],I=e[22],W=e[23],q=e[24],z=e[25],O=e[26];let Y;e[76]!==V||e[77]!==I?(Y=o.jsx("p",{className:V,children:I}),e[76]=V,e[77]=I,e[78]=Y):Y=e[78];let U;e[79]!==Y||e[80]!==W||e[81]!==q?(U=o.jsxs("div",{className:W,children:[q,Y]}),e[79]=Y,e[80]=W,e[81]=q,e[82]=U):U=e[82];let Q;e[83]!==r||e[84]!==_||e[85]!==E||e[86]!==h||e[87]!==l||e[88]!==u||e[89]!==$||e[90]!==B||e[91]!==m?(Q=o.jsx(Qs,{className:"min-h-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:o.jsx("div",{className:"mx-auto max-w-2xl",children:B?o.jsx(Zo,{schema:B,value:h,onChange:ae=>k(ae),basePath:"",breadcrumbPath:_,onBreadcrumbChange:v,meta:l,decofile:r,onSaveReferencedBlock:u,sandbox:$},E):o.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:m("sandbox.availableSectionEditor.noEditableFields")})})})}),e[83]=r,e[84]=_,e[85]=E,e[86]=h,e[87]=l,e[88]=u,e[89]=$,e[90]=B,e[91]=m,e[92]=Q):Q=e[92];let oe;e[93]!==U||e[94]!==Q||e[95]!==z?(oe=o.jsxs("div",{className:z,children:[U,Q]}),e[93]=U,e[94]=Q,e[95]=z,e[96]=oe):oe=e[96];let ee;e[97]!==f||e[98]!==C||e[99]!==g||e[100]!==T?(ee=o.jsx(Ji,{open:T,onOpenChange:D,defaultBlockId:f,isPending:g,onSubmit:C}),e[97]=f,e[98]=C,e[99]=g,e[100]=T,e[101]=ee):ee=e[101];let ie;return e[102]!==oe||e[103]!==ee||e[104]!==O?(ie=o.jsxs("div",{className:O,children:[oe,ee]}),e[102]=oe,e[103]=ee,e[104]=O,e[105]=ie):ie=e[105],ie}function du(t){return t+1}function uu(t,e){const s={__resolveType:t},n=er([s],e)[0];return n?tr(s,n,e):null}function fu({orgSlug:t,virtualMcpId:e,branch:s,previewUrl:n,meta:a,decofile:i,blockKey:l,onSaveReferencedBlock:r}){const c=Ce(),d=Ys(),f=d?.virtualMcpId,p=oa(f===e?e:null)?.metadata?.siteSlug??null,[u]=F.useState(()=>uu(l,i)),[m,x]=F.useState(u?.data??{}),[S,N]=F.useState([]),[j,b]=F.useState(0),[h,k]=F.useState(!1),[A,_]=F.useState(null),v=A!==null,{save:E,flush:L}=Xi({orgSlug:t,virtualMcpId:e,branch:s}),T=u?.resolveType?$n(u.resolveType,a):null,D=i[l],P=D?yr(l,D):l,B=d?.taskId??null,C={orgSlug:t,virtualMcpId:e,branch:s,threadId:B,previewUrl:n??void 0,siteSlug:p},$=z=>{x(z),E(l,z)},V=()=>{v?(_(null),k(!1),b(z=>z+1)):_(JSON.stringify(m,null,2))},I=z=>{const O=z??"";try{const Y=JSON.parse(O);if(Y&&typeof Y=="object"&&!Array.isArray(Y)){k(!1),$(Y);return}k(!0)}catch{k(!0)}},W=[P,...S],q=z=>{N(S.slice(0,z)),b(O=>O+1)};return o.jsx("div",{className:"flex h-full w-full min-w-0",children:o.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[o.jsx(Zi,{crumbs:W,onSelect:q}),o.jsxs("div",{className:"shrink-0 border-b px-3 py-2.5",children:[o.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[o.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:Fn},"aria-hidden":!0}),o.jsx("div",{className:"flex-1"}),o.jsxs(Ye,{children:[o.jsx(qe,{asChild:!0,children:o.jsx(Oe,{variant:v?"default":"ghost",size:"icon",className:"size-8 shrink-0",onClick:V,"aria-label":c(v?"sandbox.savedSectionEditor.closeJsonEditor":"sandbox.savedSectionEditor.editAsJson"),"aria-pressed":v,children:v?o.jsx(En,{size:14}):o.jsx(zo,{size:14})})}),o.jsx(We,{side:"bottom",children:c(v?"sandbox.savedSectionEditor.closeJsonEditor":"sandbox.savedSectionEditor.editAsJson")})]})]}),o.jsx("p",{className:"mt-1.5 py-1 pl-1 text-sm leading-snug text-muted-foreground",children:c("sandbox.savedSectionEditor.globalSectionDescription")})]}),o.jsxs("div",{className:"relative min-h-0 flex-1",children:[o.jsx(Qs,{className:"h-full [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:o.jsx("div",{className:"mx-auto max-w-2xl",children:T?o.jsx(Zo,{schema:T,value:m,onChange:z=>$(z),basePath:"",breadcrumbPath:S,onBreadcrumbChange:N,meta:a,decofile:i,onSaveReferencedBlock:r,sandbox:C},j):o.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:c("sandbox.savedSectionEditor.noEditableFields")})})})}),A!==null&&o.jsxs("div",{className:"absolute inset-0 flex flex-col bg-background",children:[h&&o.jsx("div",{className:"shrink-0 border-b bg-destructive/10 px-3 py-1.5 text-xs text-destructive",children:c("sandbox.savedSectionEditor.invalidJsonError")}),o.jsx("div",{className:"min-h-0 flex-1",children:o.jsx(na,{language:"json",height:"100%",code:A,onChange:I,onSave:z=>{I(z),L()}})})]})]})]})})}function mu(t){const e=re.c(36),{selection:s,orgSlug:n,virtualMcpId:a,branch:i,previewUrl:l,meta:r,decofile:c,isCreating:d,onCreateAvailable:f,onSaveReferencedBlock:g}=t,p=Ce();if(!s){let x;e[0]!==p?(x=p("sandbox.sectionsRightPane.selectSectionTitle"),e[0]=p,e[1]=x):x=e[1];let S;e[2]!==p?(S=p("sandbox.sectionsRightPane.selectSectionDescription"),e[2]=p,e[3]=S):S=e[3];let N;return e[4]!==x||e[5]!==S?(N=o.jsx(it,{title:x,description:S}),e[4]=x,e[5]=S,e[6]=N):N=e[6],N}if(s.collection==="available-section"){const x=`available:${s.resolveType}`,S=s.resolveType,N=s.title;let j;e[7]!==s.title?(j=sr(s.title),e[7]=s.title,e[8]=j):j=e[8];let b;e[9]!==f||e[10]!==s.resolveType?(b=(k,A)=>f(s.resolveType,k,A),e[9]=f,e[10]=s.resolveType,e[11]=b):b=e[11];let h;return e[12]!==i||e[13]!==c||e[14]!==d||e[15]!==r||e[16]!==g||e[17]!==n||e[18]!==l||e[19]!==s.resolveType||e[20]!==s.title||e[21]!==x||e[22]!==j||e[23]!==b||e[24]!==a?(h=o.jsx(cu,{orgSlug:n,virtualMcpId:a,branch:i,previewUrl:l,meta:r,decofile:c,resolveType:S,title:N,defaultBlockId:j,isCreating:d,onCreate:b,onSaveReferencedBlock:g},x),e[12]=i,e[13]=c,e[14]=d,e[15]=r,e[16]=g,e[17]=n,e[18]=l,e[19]=s.resolveType,e[20]=s.title,e[21]=x,e[22]=j,e[23]=b,e[24]=a,e[25]=h):h=e[25],h}const u=`saved:${s.key}`;let m;return e[26]!==i||e[27]!==c||e[28]!==r||e[29]!==g||e[30]!==n||e[31]!==l||e[32]!==s.key||e[33]!==u||e[34]!==a?(m=o.jsx(fu,{orgSlug:n,virtualMcpId:a,branch:i,previewUrl:l,meta:r,decofile:c,blockKey:s.key,onSaveReferencedBlock:g},u),e[26]=i,e[27]=c,e[28]=r,e[29]=g,e[30]=n,e[31]=l,e[32]=s.key,e[33]=u,e[34]=a,e[35]=m):m=e[35],m}function As(t){const e=re.c(34),{onDuplicate:s,onRename:n,onAddVariant:a,onEditSeo:i,onViewJson:l,onDelete:r}=t,c=Ce();let d;e[0]!==c?(d=c("sandbox.itemActions.moreActions"),e[0]=c,e[1]=d):d=e[1];let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=o.jsx(ei,{size:14}),e[2]=f):f=e[2];let g;e[3]!==d?(g=o.jsx(Os,{asChild:!0,children:o.jsx("button",{type:"button","aria-label":d,className:"flex h-7 w-7 items-center justify-center rounded-lg text-muted-foreground hover:bg-background hover:text-foreground cursor-pointer",onClick:pu,children:f})}),e[3]=d,e[4]=g):g=e[4];let p;e[5]!==n||e[6]!==c?(p=n&&o.jsxs(Xe,{onClick:n,children:[o.jsx(Wr,{size:14}),c("sandbox.itemActions.rename")]}),e[5]=n,e[6]=c,e[7]=p):p=e[7];let u;e[8]!==s||e[9]!==c?(u=s&&o.jsxs(Xe,{onClick:s,children:[o.jsx(In,{size:14}),c("sandbox.itemActions.duplicate")]}),e[8]=s,e[9]=c,e[10]=u):u=e[10];let m;e[11]!==a||e[12]!==c?(m=a&&o.jsxs(o.Fragment,{children:[o.jsx(mn,{}),o.jsxs(Xe,{onClick:a,className:"cursor-pointer text-success focus:text-success",children:[o.jsx(Mo,{size:14}),c("sandbox.itemActions.addVariant")]})]}),e[11]=a,e[12]=c,e[13]=m):m=e[13];let x;e[14]!==i||e[15]!==l||e[16]!==c?(x=(i||l)&&o.jsxs(o.Fragment,{children:[o.jsx(mn,{}),i&&o.jsxs(Xe,{onClick:i,children:[o.jsx(Io,{size:14}),c("sandbox.itemActions.editSeo")]}),l&&o.jsxs(Xe,{onClick:l,children:[o.jsx(zo,{size:14}),c("sandbox.itemActions.viewJson")]})]}),e[14]=i,e[15]=l,e[16]=c,e[17]=x):x=e[17];let S;e[18]===Symbol.for("react.memo_cache_sentinel")?(S=o.jsx(mn,{}),e[18]=S):S=e[18];let N;e[19]===Symbol.for("react.memo_cache_sentinel")?(N=o.jsx(Kn,{size:14}),e[19]=N):N=e[19];let j;e[20]!==c?(j=c("sandbox.itemActions.delete"),e[20]=c,e[21]=j):j=e[21];let b;e[22]!==r||e[23]!==j?(b=o.jsxs(Xe,{onClick:r,className:"text-destructive focus:text-destructive",children:[N,j]}),e[22]=r,e[23]=j,e[24]=b):b=e[24];let h;e[25]!==b||e[26]!==p||e[27]!==u||e[28]!==m||e[29]!==x?(h=o.jsxs(Ls,{align:"end",className:"w-44",children:[p,u,m,x,S,b]}),e[25]=b,e[26]=p,e[27]=u,e[28]=m,e[29]=x,e[30]=h):h=e[30];let k;return e[31]!==h||e[32]!==g?(k=o.jsxs($s,{children:[g,h]}),e[31]=h,e[32]=g,e[33]=k):k=e[33],k}function pu(t){return t.stopPropagation()}const Ha=4;function nn(t){const e=new Map;for(const s of t)s.slug&&!e.has(s.slug)&&e.set(s.slug,s);return e}function on(t,e){const s=t.parentSlug;if(!t.slug||!s||s===t.slug)return;const n=e.get(s);return n===t?void 0:n}function qa(t,e){const s=nn(e),n=[],a=new Set;let i=s.get(t);for(;i&&!a.has(i.slug??"")&&(a.add(i.slug??""),n.push(i),!(n.length>=Ha));)i=on(i,s);return n.reverse()}function Wa(t,e){const s=new Map;for(const n of t){const a=on(n,e);if(!a?.slug)continue;const i=s.get(a);i?i.push(n):s.set(a,[n])}for(const n of s.values())n.sort((a,i)=>a.label.localeCompare(i.label));return s}function fm(t,e){const s=nn(e),n=Wa(e,s),a=new Set([t]),i=s.get(t);let l=i?[i]:[];for(;l.length;){const r=[];for(const c of l)for(const d of n.get(c)??[])d.slug&&!a.has(d.slug)&&(a.add(d.slug),r.push(d));l=r}return a.delete(t),a}function mm(t,e){if(!t)return[];const s=nn(e),n=qa(t,e),a=n[0];return!a||on(a,s)?[t]:n.map(i=>i.slug??"")}function gu(t){const e=nn(t),s=Wa(t,e),n=new Set,a=[],i=(r,c)=>{if(!n.has(r)&&(n.add(r),a.push({entry:r,depth:c}),!(c+1>=Ha)))for(const d of s.get(r)??[])i(d,c+1)},l=t.filter(r=>!on(r,e)).sort((r,c)=>r.label.localeCompare(c.label));for(const r of l)i(r,0);for(const r of t)i(r,0);return a}function hu(t){return t.split("/").pop()?.replace(/\.tsx?$/,"")||t||"Section"}function xu(t){const e=new Map;for(const s of t){const n=hu(s.resolveType),a=e.get(n);a?a.push(s):e.set(n,[s])}return[...e.entries()].map(([s,n])=>({label:s,sections:n})).sort((s,n)=>s.label.localeCompare(n.label))}function Ao(t){const e=re.c(8),{icon:s,label:n,className:a}=t;let i;e[0]!==a?(i=ve("flex items-center gap-1.5 px-2.5 pb-1 pt-1 text-xs font-medium text-muted-foreground/70",a),e[0]=a,e[1]=i):i=e[1];let l;e[2]!==s?(l=o.jsx(s,{size:13,className:"shrink-0"}),e[2]=s,e[3]=l):l=e[3];let r;return e[4]!==n||e[5]!==i||e[6]!==l?(r=o.jsxs("div",{className:i,children:[l,n]}),e[4]=n,e[5]=i,e[6]=l,e[7]=r):r=e[7],r}const Eo=F.lazy(()=>Ge(()=>import("./app-editor-BqvAOKlk.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166])).then(t=>({default:t.AppEditor}))),bu=F.lazy(()=>Ge(()=>import("./cms-settings-editor-BB3l1bfM.js"),__vite__mapDeps([167,1,2,28,27,29,30,31,32,33,34,35,36,37,38,26,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,58,59,60,61,62,63,64,65,66,21,67,4,5,6,7,8,9,68,69,70,71,18,11,12,13,14,15,16,17,3,10,19,20,22,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,24,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,0,23,25,57,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166])).then(t=>({default:t.CmsSettingsEditor}))),yu=F.lazy(()=>Ge(()=>import("./post-editor-BINaZa6q.js"),__vite__mapDeps([168,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,28,27,29,30,31,32,33,34,35,36,37,38,26,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,159,63,169,130,99,77,78,101,94,150,122,57,58,59,60,61,62,64,65,66,67,68,69,70,71,72,73,74,75,76,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,24,95,96,97,98,100,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,123,124,125,126,127,128,129,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,23,151,152,153,154,155,156,157,158,160,161,162,170,163,171,172,173,164,174,175,165,166])).then(t=>({default:t.PostEditor}))),vu=F.lazy(()=>Ge(()=>import("./record-editor--8X4AXV_.js"),__vite__mapDeps([176,1,2,63,93,24,69,37,122,57,58,59,60,61,62,64,65,66,39,34,21,67,4,5,6,7,8,9,68,27,28,29,30,31,32,33,35,36,38,26,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,70,71,18,11,12,13,14,15,16,17,3,10,19,20,22,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,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,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,23,151,152,153,154,155,156,157,158,159,160,161,162,173,175,164,165,166])).then(t=>({default:t.RecordEditor}))),ju=F.lazy(()=>Ge(()=>import("./context-DEuw9CjH.js"),__vite__mapDeps([177,1,2,11,8,9,12,13,14,15,16,17,27,28,29,30,31,32,33,34,35,36,37,38,26,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,130,63,150,122,101,19,57,58,59,60,61,62,64,65,66,21,67,4,5,6,7,68,69,70,71,18,3,10,20,22,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,24,94,95,96,97,98,99,100,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,123,124,125,126,127,128,129,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,23,151,152,153,154,155,156,157,158,159,160,161,162,175,178,172,179,164,171,165,166])).then(t=>({default:t.BlogContext}))),Su=F.lazy(()=>Ge(()=>import("./category-editor-BYf-_N2d.js"),__vite__mapDeps([180,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,28,32,34,26,159,63,93,24,69,37,173,27,29,30,31,33,35,36,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,64,65,66,67,68,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,23,151,152,153,154,155,156,157,158,160,161,162,170,163,171,172,174,175,164,165,166])).then(t=>({default:t.CategoryEditor}))),ku=F.lazy(()=>Ge(()=>import("./sections-editor-BKmXdadO.js"),__vite__mapDeps([181,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,57,58,59,60,61,62,63,64,65,66,39,34,67,68,69,27,28,29,30,31,32,33,35,36,37,38,26,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,24,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,23,151,152,153,154,155,156,157,158,159,160,161,162,164,25,163,182,183])).then(t=>({default:t.SectionsEditor}))),wu=F.lazy(()=>Ge(()=>import("./seo-editor-ClpJZQda.js"),__vite__mapDeps([184,1,2,27,28,29,30,31,32,33,34,35,36,37,38,26,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,23,24,57,58,59,60,61,62,63,64,65,66,21,67,4,5,6,7,8,9,68,69,70,71,18,11,12,13,14,15,16,17,3,10,19,20,22,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,182])).then(t=>({default:t.SeoEditor}))),Cu=F.lazy(()=>Ge(()=>import("./variant-calendar-B4damr_G.js"),__vite__mapDeps([185,1,2,27,28,29,30,31,32,33,34,35,36,37,38,26,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,63,23,24,150,68,69,157,22,16,15,3,4,5,6,7,8,9,10,11,12,13,14,17,18,19,20,21,159,58,59,60,61,62,64,65,66,67,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,57,147,148,149,151,152,153,154,155,156,158,160,161,162,164,165,166])).then(t=>({default:t.VariantCalendar}))),Nu=F.lazy(()=>Ge(()=>import("./post-calendar-DGIFZvru.js"),__vite__mapDeps([186,1,2,27,28,29,30,31,32,33,34,35,36,37,38,26,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,23,24,22,16,15,3,4,5,6,7,8,9,10,11,12,13,14,17,18,19,20,21,159,68,69,58,59,60,61,62,63,64,65,66,67,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,57,147,148,149,150,151,152,153,154,155,156,157,158,160,161,162,164,165,166])).then(t=>({default:t.PostCalendar}))),_u=F.lazy(()=>Ge(()=>import("./redirect-editor-CxJl2CVJ.js"),__vite__mapDeps([187,1,2,99,63,93,24,69,37,57,58,59,60,61,62,64,65,66,39,34,21,67,4,5,6,7,8,9,68,27,28,29,30,31,32,33,35,36,38,26,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,70,71,18,11,12,13,14,15,16,17,3,10,19,20,22,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,94,95,96,97,98,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,23,151,152,153,154,155,156,157,158,159,160,161,162,175])).then(t=>({default:t.RedirectEditor})));function Pu(t,e){return t==="context"&&!e?"posts":t}function Tu(t){const e=re.c(30),{deepLinkPage:s}=t,{currentBranch:n,virtualMcpId:a}=$o(),{org:i}=ti(),l=Or(),r=Lr(),{runtime:c,previewServerUrl:d}=sa(a),f=c==="cms",g=Ln(a,n);let p,u;e[0]!==g||e[1]!==f||e[2]!==r.previewState||e[3]!==l.lifecycle.phase?(p=Wo(g),u=gl({fastPreviewActive:f||p,previewState:r.previewState,lifecyclePhase:l.lifecycle.phase}),e[0]=g,e[1]=f,e[2]=r.previewState,e[3]=l.lifecycle.phase,e[4]=p,e[5]=u):(p=e[4],u=e[5]);const m=u;if(m.kind==="sandbox-card"){const j=`/${i.slug}/settings/connections`;let b;return e[6]!==m.state||e[7]!==r.start||e[8]!==j||e[9]!==l.lifecycle||e[10]!==l.phase?(b=o.jsx(ml,{state:m.state,claimPhase:l.phase,lifecycle:l.lifecycle,onStart:r.start,connectionsHref:j}),e[6]=m.state,e[7]=r.start,e[8]=j,e[9]=l.lifecycle,e[10]=l.phase,e[11]=b):b=e[11],b}if(!a||!n){let j;return e[12]===Symbol.for("react.memo_cache_sentinel")?(j=o.jsx(it,{title:"Waiting for sandbox context…"}),e[12]=j):j=e[12],j}if(nr(g)){let j;return e[13]===Symbol.for("react.memo_cache_sentinel")?(j=o.jsx(ir,{}),e[13]=j):j=e[13],j}if(g.kind==="pending"){let j;return e[14]!==g?(j=o.jsx(rr,{backend:g}),e[14]=g,e[15]=j):j=e[15],j}const x=p?null:r.previewUrl;let S;e[16]!==g||e[17]!==f||e[18]!==r.previewUrl||e[19]!==d?(S=g.kind==="protocol"&&g.source==="local"?Ei(g):f?d:r.previewUrl,e[16]=g,e[17]=f,e[18]=r.previewUrl,e[19]=d,e[20]=S):S=e[20];let N;return e[21]!==n||e[22]!==s||e[23]!==m.devServerReady||e[24]!==m.sandboxWarming||e[25]!==i.slug||e[26]!==x||e[27]!==S||e[28]!==a?(N=o.jsx(Eu,{orgSlug:i.slug,virtualMcpId:a,branch:n,previewUrl:x,sitePreviewUrl:S,deepLinkPage:s,devServerReady:m.devServerReady,sandboxWarming:m.sandboxWarming}),e[21]=n,e[22]=s,e[23]=m.devServerReady,e[24]=m.sandboxWarming,e[25]=i.slug,e[26]=x,e[27]=S,e[28]=a,e[29]=N):N=e[29],N}const Do=2e3,Au=15;function Bo(t,e,s,n){return typeof e!="string"||s&&(ia(e,s,n)||t.state.dataUpdateCount>=Au)?!1:Do}function Eu({orgSlug:t,virtualMcpId:e,branch:s,previewUrl:n,sitePreviewUrl:a,deepLinkPage:i,devServerReady:l,sandboxWarming:r}){const c=Ce(),d=Ys()?.taskId??null,f={orgSlug:t,virtualMcpId:e,branch:s,threadId:d,previewUrl:n},g=!Wo(Ln(e,s)),p=or()===void 0,{data:u,isLoading:m}=Di(f,{fetchEnabled:l}),x=Oo({strict:!1}),[S,N]=F.useState(()=>x.contentCollection&&lt(x.contentCollection)&&x.contentCollection||"pages"),j=aa(),b=Pu(S,j),[h,k]=F.useState(()=>x.contentItem&&lt(b)?{collection:b,key:x.contentItem}:null),[A,_]=F.useState(null),{data:v,isLoading:E,isFetching:L}=ar(f,{fetchEnabled:l,refetchInterval:y=>{const H=y.state.data;if(b==="apps"&&h&&h.collection==="apps"){const Z=u?.[h.key];return Bo(y,typeof Z?.__resolveType=="string"?Z.__resolveType:void 0,H)}if(b==="site"&&u){const Z=H?so(u,H):null,ue=u.site,Se=Z?.resolveType??(typeof ue?.__resolveType=="string"?ue.__resolveType:void 0);return Bo(y,Se,H,["seo"])}return!1}}),T=!!(i?.pageId||i?.path||i?.pathTemplate),[D,P]=F.useState(!1);if(T&&!D&&h===null&&u&&!E){P(!0);const y=vr(to(u,v),i??{});y&&(N("pages"),k({collection:"pages",key:y.key,path:y.path}))}const[B,C]=F.useState(""),[$,V]=F.useState("list"),I=y=>{k(y),_(null)},[W,q]=F.useState(b);W!==b&&(q(b),C(""));const z=(y,H)=>!ia(y,v,H)&&(E||L),{catalog:O,isLoading:Y}=ll(v??void 0,u??void 0,{enabled:g&&b==="apps"}),U=Js(f),Q=Tr(f),oe=sd({orgSlug:t,virtualMcpId:e,branch:s,decofile:u??{},onMoved:(y,H)=>k(Z=>Z?.collection==="posts"&&Z.key===y?{collection:"posts",key:H}:Z)}),[ee,ie]=F.useState(null),[ae,le]=F.useState(),[ce,fe]=F.useState(!1),[te,de]=F.useState(),[X,ne]=F.useState(null),[J,w]=F.useState(null),[M,me]=F.useState(null),ge=!u||!v;if(m||E||p||ge&&r)return o.jsx("div",{className:"h-full w-full flex items-center justify-center",children:o.jsx(dt,{className:"size-5 text-muted-foreground"})});if(ge)return o.jsx(it,{title:"Could not load site data."});if(Bi(v))return o.jsx(lr,{orgSlug:t,virtualMcpId:e,branch:s,decofile:u});const he=to(u,v).sort((y,H)=>y.name.localeCompare(H.name)),ye=jr(u).sort((y,H)=>y.from.localeCompare(H.from)),_e=Sr(u,v),Pe=b==="sections"?kr(v):[],Te=so(u,v),we=ma(u),Ee=zn.some(y=>we[y].length>0),De=lt(b)?we[b]:[],xe=eo(v,"loaders"),Ae=eo(v,"actions"),Re=g?["settings"]:["apps",...Te?[]:["site"],...Ae===0?["actions"]:[],...Zr(v)?[]:["settings"]];if(!wr(u,v)&&!Ee&&xe===0&&Ae===0)return o.jsx(it,{icon:is,title:"No editable content",description:"This project doesn't expose any Deco pages, sections, apps, loaders, or actions."});const G={pages:he.length,sections:_e.length,apps:g?O.length:0,loaders:xe,actions:Ae,redirects:ye.length,posts:we.posts.length,authors:we.authors.length,categories:we.categories.length},be=new Set(he.map(y=>Es(y.path))),ke=new Set(he.map(y=>y.name)),Le=new Set(_e.map(y=>y.name)),gt=async y=>{const H=u[y.key];if(!H)return;const Z=ea(u,y.key),ue=Cr(u,y.key,Math.max(0,Z-1)),Se=Nr(H.sections,ue);if(Se)try{await U.mutateAsync({blockKey:y.key,data:{...H,sections:Se}}),pe.success(`Variant added to "${y.name}"`),k({collection:"pages",key:y.key,path:y.path})}catch(Ne){pe.error(Ne instanceof Error?Ne.message:"Could not add variant")}},an=()=>{le(void 0),ie({mode:"create",sourceKey:null,initialName:"My new page",initialPath:"/example"})},rn=y=>{le(void 0),ie({mode:"duplicate",sourceKey:y.key,initialName:co(ke,y.name),initialPath:hl(be,y.path)})},ht=y=>{le(void 0),ie({mode:"rename",sourceKey:y.key,initialName:y.name,initialPath:y.path})},ln=async y=>{if(!ee)return;const{mode:H,sourceKey:Z}=ee;try{if(H==="create"){let ue;if(y.templateKey){const Ne=u[y.templateKey];if(!Ne)throw new Error("Selected template no longer exists.");ue={...Ne,name:y.name,path:y.path}}else ue=yl(y.name,y.path);const Se=jl(u,y.name);await U.mutateAsync({blockKey:Se,data:ue}),pe.success(`Created "${y.name}"`),k({collection:"pages",key:Se,path:y.path})}else if(H==="duplicate"&&Z){const ue=u[Z];if(!ue)throw new Error("Source page not found");const{key:Se,data:Ne}=bl({source:ue,pages:he,newName:y.name,newPath:y.path});await U.mutateAsync({blockKey:Se,data:Ne}),pe.success(`Duplicated as "${y.name}"`),k({collection:"pages",key:Se,path:y.path})}else if(H==="rename"&&Z){const ue=u[Z];if(!ue)throw new Error("Page not found");const Se={...ue,name:y.name,path:y.path};await U.mutateAsync({blockKey:Z,data:Se}),pe.success("Page updated"),h?.collection==="pages"&&h.key===Z&&k({collection:"pages",key:Z,path:y.path})}ie(null)}catch(ue){le(ue instanceof Error?ue.message:"Save failed")}},xt=({path:y})=>{if(!ee)return null;const H=Es(y);return(ee.mode==="rename"?Es(ee.initialPath):null)!==H&&be.has(H)?`A page with path "${y}" already exists.`:null},cn=async(y,H,Z)=>{await U.mutateAsync({blockKey:H,data:{...Z,name:H,__resolveType:y}}),pe.success(c("sandbox.contentBrowser.createdSection",{name:H})),k({collection:"sections",key:H})},bt=Xo((y,H)=>U.mutate({blockKey:y,data:H})),yt=async y=>{const H=u[y.key];if(!H){pe.error(c("sandbox.contentBrowser.sectionNotFound"));return}const Z=xl(u,y.key),ue=co(Le,y.name),Se={...H,name:ue};try{await U.mutateAsync({blockKey:Z,data:Se}),pe.success(c("sandbox.contentBrowser.duplicatedSection",{name:y.name})),k({collection:"sections",key:Z})}catch(Ne){pe.error(Ne instanceof Error?Ne.message:c("sandbox.contentBrowser.duplicateFailed"))}},dn=async y=>{if(!X)return;const H=u[X];if(!H){pe.error(c("sandbox.contentBrowser.sectionNotFound"));return}try{await U.mutateAsync({blockKey:X,data:{...H,name:y}}),pe.success(c("sandbox.contentBrowser.sectionRenamed")),ne(null)}catch(Z){pe.error(Z instanceof Error?Z.message:c("sandbox.contentBrowser.renameFailed"))}},Jt=()=>{de(void 0),fe(!0)},tt=async y=>{const H=_r(u,y.from),Z=Pr(y);try{await U.mutateAsync({blockKey:H,data:Z}),pe.success("Created redirect"),fe(!1),k({collection:"redirects",key:H})}catch(ue){de(ue instanceof Error?ue.message:"Could not create redirect")}},vt=async y=>{const H=vn(u,y),Z=Gt(H,y,Sa(y));try{await U.mutateAsync({blockKey:H,data:Z}),pe.success(`Created ${os[y]}`),k({collection:y,key:H})}catch(ue){pe.error(ue instanceof Error?ue.message:"Could not create")}},st=async y=>{const H=vn(u,"posts"),Z=Gt(H,"posts",Qc(y));try{await U.mutateAsync({blockKey:H,data:Z}),pe.success(c("sandbox.postCalendar.createdScheduledPost")),N("posts"),q("posts"),k({collection:"posts",key:H}),_(null)}catch(ue){pe.error(ue instanceof Error?ue.message:c("sandbox.postCalendar.couldNotCreate"))}},nt=async(y,H)=>{const Z=u[y],ue=Z?Xc(ut(Z,"posts"),H):null;if(!ue){pe.error(c("sandbox.postCalendar.onlyScheduledCanMove"));return}try{await U.mutateAsync({blockKey:y,data:Gt(y,"posts",ue)})}catch(Se){pe.error(Se instanceof Error?Se.message:c("sandbox.postCalendar.couldNotReschedule"))}},Xt=async y=>{const H=u[y.key];if(!H){pe.error("Record not found.");return}const Z=vn(u,y.kind),ue=y.kind==="posts"?"title":"name",Se={...structuredClone(ut(H,y.kind)),[ue]:`${y.label} (copy)`};if(y.kind==="categories"){const Ne=we.categories.map(Qe=>Qe.slug??"").filter(Boolean);Se.slug=qc(String(Se.slug??""),Ne)}try{await U.mutateAsync({blockKey:Z,data:Gt(Z,y.kind,Se)}),pe.success(`Duplicated "${y.label}"`),k({collection:y.kind,key:Z})}catch(Ne){pe.error(Ne instanceof Error?Ne.message:"Duplicate failed")}},ot=()=>{N("posts"),q("posts"),k(null),_(null),C("")},jt=async()=>{if(J)try{const{kind:y,key:H,label:Z}=J;if(y==="blog"){if(J.blogKind==="categories"){const ue=ut(u[H],"categories").slug,Se=typeof ue=="string"?ue:"";if(Se)for(const{key:Ne,payload:Qe}of ja(u)){const Je=ic(Qe,Se);Je!==Qe&&await U.mutateAsync({blockKey:Ne,data:sc(Ne,rc(Je))})}}await Q.mutateAsync({blockKey:H})}else await Q.mutateAsync({blockKey:H});pe.success(`Deleted "${Z}"`),h&&h.collection!=="available-section"&&h.key===H&&k(null),w(null)}catch(y){pe.error(y instanceof Error?y.message:"Delete failed")}},ze=Q.isPending||U.isPending,at=J?.kind==="blog"?os[J.blogKind]:J?.kind??"item";return o.jsxs("div",{className:"flex h-full w-full",children:[o.jsx(ul,{active:b,counts:G,hidden:Re,showBlog:Ee,showContext:j,onSelect:y=>{N(y),k(null),_(null)}}),b!=="seo"&&b!=="site"&&b!=="settings"&&b!=="context"&&b!=="calendar"&&b!=="post-schedule"&&b!=="posts"&&b!=="loaders"&&b!=="actions"&&o.jsx(Du,{activeCollection:b,pages:he,redirects:ye,sections:_e,availableSections:Pe,appCatalog:O,appCatalogLoading:Y,blogEntries:De,decofile:u,searchQuery:B,onSearchChange:C,selection:h,onSelect:I,onCreate:()=>{b==="pages"?an():b==="redirects"?Jt():lt(b)&&vt(b)},onDuplicatePage:rn,onRenamePage:ht,onAddPageVariant:gt,onDeletePage:y=>w({kind:"page",key:y.key,label:y.name}),onEditPageSeo:y=>{const H={collection:"pages",key:y.key,path:y.path};k(H),_(y.key)},onViewPageJson:y=>me(y.key),onDuplicateSection:yt,onRenameSection:y=>ne(y.key),onDeleteSection:y=>w({kind:"section",key:y.key,label:y.name}),onDeleteRedirect:y=>w({kind:"redirect",key:y.key,label:y.from||y.key}),onDuplicateBlog:Xt,onDeleteBlog:y=>w({kind:"blog",blogKind:y.kind,key:y.key,label:y.label})}),o.jsx("div",{className:"flex-1 min-w-0",children:b==="loaders"||b==="actions"?o.jsx(Zd,{orgSlug:t,virtualMcpId:e,branch:s,previewUrl:n,meta:v,decofile:u,kind:b}):o.jsx(F.Suspense,{fallback:o.jsx("div",{className:"h-full flex items-center justify-center",children:o.jsx(dt,{className:"size-5 text-muted-foreground"})}),children:b==="calendar"?o.jsx(Cu,{decofile:u}):b==="post-schedule"?o.jsx(Nu,{decofile:u,isCreating:U.isPending,onCreate:y=>{st(y)},onReschedule:(y,H)=>{nt(y,H)},onSelect:y=>{N("posts"),q("posts"),k({collection:"posts",key:y}),_(null)}}):b==="site"?Te?o.jsx(Eo,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:Te.key,block:u[Te.key],decofile:u,meta:v,title:"Site",excludeFields:["seo"],schemaPending:z(Te.resolveType,["seo"]),previewBaseUrl:n},`site:${Te.key}`):o.jsx(it,{title:"Site settings not found",description:"This project doesn't have a site app block (site/apps/site.ts)."}):b==="settings"?o.jsx(bu,{orgSlug:t,virtualMcpId:e,branch:s,decofile:u,meta:v}):b==="context"?o.jsx(ju,{orgSlug:t,virtualMcpId:e,branch:s,decofile:u,meta:v}):b==="seo"?o.jsx(wu,{orgSlug:t,virtualMcpId:e,branch:s,decofile:u,meta:v,target:{kind:"site"},previewBaseUrl:a}):b==="sections"?o.jsx(mu,{selection:h?.collection==="sections"||h?.collection==="available-section"?h:null,orgSlug:t,virtualMcpId:e,branch:s,previewUrl:n,meta:v,decofile:u,isCreating:U.isPending,onCreateAvailable:cn,onSaveReferencedBlock:bt}):b==="posts"?o.jsx(Id,{orgSlug:t,virtualMcpId:e,branch:s,decofile:u,view:$,selectedKey:h?.collection==="posts"?h.key:null,onViewChange:y=>{V(y),k(null)},onClose:()=>k(null),onOpen:y=>{k({collection:"posts",key:y}),_(null)},move:oe,meta:v,renderDetail:(y,H)=>o.jsx(yu,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:y,block:u[y],decofile:u,meta:v,previewBaseUrl:a,move:oe,onClose:H?.onClose,expanded:H?.expanded,onToggleExpand:H?.onToggleExpand},`post:${as(y)}`)}):h&&h.collection!=="available-section"?h.collection==="apps"?o.jsx(Eo,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:h.key,block:u[h.key],decofile:u,meta:v,previewBaseUrl:n,schemaPending:z(typeof u[h.key]?.__resolveType=="string"?String(u[h.key].__resolveType):void 0)},`app:${h.key}`):h.collection==="categories"?o.jsx(Su,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:h.key,block:u[h.key],decofile:u,meta:v,onManagePosts:()=>ot(),onOpenPost:y=>{N("posts"),q("posts"),k({collection:"posts",key:y}),_(null)},previewBaseUrl:a},`category:${h.key}`):h.collection==="authors"?o.jsx(vu,{orgSlug:t,virtualMcpId:e,branch:s,kind:"authors",blockKey:h.key,block:u[h.key],meta:v,decofile:u},`authors:${h.key}`):h.collection==="redirects"?o.jsx(_u,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:h.key,block:u[h.key]},`redirect:${h.key}`):o.jsx(ku,{orgSlug:t,virtualMcpId:e,branch:s,previewReady:!0,previewUrl:n??void 0,currentPath:h.collection==="pages"?h.path:"/",activePageBlockKey:h.collection==="pages"?h.key:null,activeGlobalBlockKey:h.collection==="sections"?h.key:null,initialEditSeo:h.collection==="pages"&&A===h.key,onExitSeo:()=>_(null),onSelectRoot:()=>{k(null),_(null)}},h.collection==="pages"?`page:${h.key}`:`section:${h.key}`):o.jsx(it,{title:`Select ${lt(b)?`a ${os[b]}`:b==="pages"?"a page":b==="apps"?"an app":b==="redirects"?"a redirect":"a section"} to edit`,description:b==="apps"?"Browse all apps and select an installed one to edit its settings.":'Pick an item from the list, or click "+" to create one.'})})}),ee&&o.jsx(Cl,{open:!!ee,mode:ee.mode,initialName:ee.initialName,initialPath:ee.initialPath,isPending:U.isPending,error:ae,templates:he,validate:xt,onSubmit:ln,onOpenChange:y=>{y||(ie(null),le(void 0))}}),o.jsx(_l,{open:ce,isPending:U.isPending,error:te,onSubmit:tt,onOpenChange:y=>{y||(fe(!1),de(void 0))}}),X&&o.jsx(Pl,{open:!!X,blockKey:X,initialName:_e.find(y=>y.key===X)?.name??X,isPending:U.isPending,onSubmit:dn,onOpenChange:y=>{y||ne(null)}}),M&&o.jsx(Ar,{open:!!M,onOpenChange:y=>{y||me(null)},pageKey:M,decofile:u,onSave:y=>U.mutateAsync({blockKey:M,data:y})}),o.jsx(pi,{open:!!J,onOpenChange:y=>{!y&&!ze&&w(null)},children:o.jsxs(gi,{children:[o.jsxs(hi,{children:[o.jsx(xi,{children:`Delete ${at}?`}),o.jsx(bi,{children:J?.kind==="section"?`"${J.label}" will be removed. Pages that still reference it will lose this section.`:J?`"${J.label}" will be removed permanently. This can't be undone.`:null})]}),o.jsxs(yi,{children:[o.jsx(vi,{disabled:ze,children:"Cancel"}),o.jsx(ji,{onClick:y=>{y.preventDefault(),jt()},disabled:ze,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:ze?o.jsxs(o.Fragment,{children:[o.jsx(dt,{className:"size-3.5"}),"Deleting…"]}):"Delete"})]})]})})]})}function Du(t){const e=re.c(58),{activeCollection:s,pages:n,redirects:a,sections:i,availableSections:l,appCatalog:r,appCatalogLoading:c,blogEntries:d,decofile:f,searchQuery:g,onSearchChange:p,selection:u,onSelect:m,onCreate:x,onDuplicatePage:S,onRenamePage:N,onAddPageVariant:j,onDeletePage:b,onEditPageSeo:h,onViewPageJson:k,onDuplicateSection:A,onRenameSection:_,onDeleteSection:v,onDeleteRedirect:E,onDuplicateBlog:L,onDeleteBlog:T}=t,D=Ce();let P,B,C,$,V,I;if(e[0]!==s||e[1]!==r||e[2]!==c||e[3]!==l||e[4]!==d||e[5]!==f||e[6]!==j||e[7]!==x||e[8]!==T||e[9]!==b||e[10]!==E||e[11]!==v||e[12]!==L||e[13]!==S||e[14]!==A||e[15]!==h||e[16]!==N||e[17]!==_||e[18]!==p||e[19]!==m||e[20]!==k||e[21]!==n||e[22]!==a||e[23]!==g||e[24]!==i||e[25]!==u||e[26]!==D){const O=g.toLowerCase(),Y=n.filter(w=>!O||w.name.toLowerCase().includes(O)||w.path.toLowerCase().includes(O)),U=a.filter(w=>!O||w.from.toLowerCase().includes(O)||w.to.toLowerCase().includes(O)),Q=i.filter(w=>!O||w.name.toLowerCase().includes(O)||w.key.toLowerCase().includes(O)||w.resolveType.toLowerCase().includes(O)),oe=l.filter(w=>!O||w.title.toLowerCase().includes(O)||w.resolveType.toLowerCase().includes(O)||(w.description?.toLowerCase().includes(O)??!1)),ee=xu(Q),ie=r.filter(w=>!O||w.title.toLowerCase().includes(O)||w.app.toLowerCase().includes(O)||w.vendor.toLowerCase().includes(O)||w.category.toLowerCase().includes(O)),ae=d.filter(w=>!O||w.label.toLowerCase().includes(O)||w.subtitle.toLowerCase().includes(O)),le=s==="categories"&&!O?gu(ae):ae.map(Ou),ce=`Search ${s}…`,fe=lt(s)?`Create new ${os[s]}`:s==="redirects"?"Create new redirect":"Create new page",te=s!=="apps"&&s!=="sections";V="shrink-0 border-r flex flex-col min-h-0 w-[300px]";let de;e[33]===Symbol.for("react.memo_cache_sentinel")?(de=o.jsx(Bn,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),e[33]=de):de=e[33];let X;e[34]!==p?(X=w=>p(w.target.value),e[34]=p,e[35]=X):X=e[35];let ne;e[36]!==ce||e[37]!==g||e[38]!==X?(ne=o.jsxs("div",{className:"flex flex-1 items-center gap-2 pl-1",children:[de,o.jsx("input",{type:"text",value:g,onChange:X,placeholder:ce,"aria-label":ce,className:"w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),e[36]=ce,e[37]=g,e[38]=X,e[39]=ne):ne=e[39];let J;e[40]!==fe||e[41]!==x||e[42]!==te?(J=te&&o.jsxs(Ye,{children:[o.jsx(qe,{asChild:!0,children:o.jsx(Oe,{variant:"ghost",size:"icon",onClick:x,"aria-label":fe,children:o.jsx(On,{size:14})})}),o.jsx(We,{side:"bottom",children:fe})]}),e[40]=fe,e[41]=x,e[42]=te,e[43]=J):J=e[43],e[44]!==ne||e[45]!==J?(I=o.jsxs("div",{className:"px-2 h-12 flex items-center gap-1 border-b shrink-0",children:[ne,J]}),e[44]=ne,e[45]=J,e[46]=I):I=e[46],P=Qs,$="flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",B="flex flex-col gap-1 p-1.5",C=s==="pages"?Y.length===0?o.jsx(es,{hasItems:n.length>0,emptyLabel:"No pages yet.",emptyHint:'Click "+" to create your first page.'}):Y.map(w=>{const M=u?.collection==="pages"&&u.key===w.key,me=ea(f,w.key);return o.jsx(He,{icon:Vo,title:w.name,subtitle:w.path,active:M,variantCount:me,onClick:()=>m({collection:"pages",key:w.key,path:w.path}),menu:o.jsx(As,{onDuplicate:()=>S(w),onRename:()=>N(w),onAddVariant:()=>j(w),onEditSeo:()=>h(w),onViewJson:()=>k(w),onDelete:()=>b(w)})},w.key)}):s==="sections"?Q.length===0&&oe.length===0?o.jsx(es,{hasItems:i.length>0||l.length>0,emptyLabel:"No sections yet.",emptyHint:"Save a section from a page, or start the preview dev server."}):o.jsxs(o.Fragment,{children:[ee.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(Ao,{icon:Fs,label:"Saved sections"}),ee.map(w=>o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx("div",{className:"px-2.5 pt-1 pb-0.5 text-[11px] font-medium uppercase tracking-wide text-muted-foreground/60",children:w.label}),w.sections.map(M=>{const me=u?.collection==="sections"&&u.key===M.key;return o.jsx(He,{icon:Fs,accent:"global",title:M.name,subtitle:w.label,active:me,onClick:()=>m({collection:"sections",key:M.key}),menu:o.jsx(As,{onDuplicate:()=>A(M),onRename:()=>_(M),onDelete:()=>v(M)})},M.key)})]},w.label))]}),oe.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(Ao,{icon:Jn,label:"Available sections",className:ve(ee.length>0&&"mt-3")}),oe.map(w=>{const M=u?.collection==="available-section"&&u.resolveType===w.resolveType,me=w.resolveType.split("/").pop()?.replace(/\.tsx?$/,"");return o.jsx(He,{icon:Jn,title:w.title,subtitle:me??w.resolveType,active:M,onClick:()=>m({collection:"available-section",resolveType:w.resolveType,title:w.title})},w.resolveType)})]})]}):s==="apps"?c?o.jsx("div",{className:"flex items-center justify-center py-8",children:o.jsx(dt,{className:"size-4.5 text-muted-foreground"})}):ie.length===0?o.jsx(es,{hasItems:r.length>0,emptyLabel:"No apps found.",emptyHint:"Try a different search term."}):ie.map(w=>{const M=u?.collection==="apps"&&w.blockKey!==null&&u.key===w.blockKey;return o.jsx(He,{icon:Ho,logoUrl:w.logo,title:w.title,subtitle:w.category,active:M,trailing:w.installed?o.jsx("span",{className:"shrink-0 rounded-full bg-success/15 px-1.5 py-0.5 text-[10px] font-medium text-success",children:"Installed"}):void 0,onClick:()=>{if(!w.installed||!w.blockKey){pe.message(`${w.title} is not installed on this site.`);return}m({collection:"apps",key:w.blockKey})}},w.id)}):s==="redirects"?U.length===0?o.jsx(es,{hasItems:a.length>0,emptyLabel:"No redirects yet.",emptyHint:'Click "+" to create your first redirect.'}):U.map(w=>o.jsx(He,{icon:Ro,title:w.from||"(no source)",subtitle:`→ ${w.to||"(no target)"}`,active:u?.collection==="redirects"&&u.key===w.key,trailing:o.jsx(Tl,{redirect:w}),onClick:()=>m({collection:"redirects",key:w.key}),menu:o.jsx(As,{onDelete:()=>E(w)})},w.key)):ae.length===0?o.jsx(es,{hasItems:d.length>0,emptyLabel:`No ${s} yet.`,emptyHint:`Click "+" to create your first ${lt(s)?os[s]:"item"}.`}):le.map(w=>{const{entry:M,depth:me}=w,ge=u?.collection===M.kind&&u.key===M.key;return o.jsx("div",{style:{paddingLeft:me*16},children:o.jsx(He,{icon:M.kind==="posts"?Uo:M.kind==="authors"?qo:Fo,title:M.label,invalid:M.missing.length>0,invalidReason:M.missing.length>0?D("sandbox.itemRow.missingFields",{fields:Jl(M.missing,D)}):void 0,warning:M.duplicateName,warningReason:D("sandbox.itemRow.duplicateName"),subtitle:me>0?qa(M.slug??"",ae).map(Bu).join(" / "):M.subtitle,active:ge,onClick:()=>m({collection:M.kind,key:M.key}),menu:o.jsx(As,{onDuplicate:()=>L(M),onDelete:()=>T(M)})})},M.key)}),e[0]=s,e[1]=r,e[2]=c,e[3]=l,e[4]=d,e[5]=f,e[6]=j,e[7]=x,e[8]=T,e[9]=b,e[10]=E,e[11]=v,e[12]=L,e[13]=S,e[14]=A,e[15]=h,e[16]=N,e[17]=_,e[18]=p,e[19]=m,e[20]=k,e[21]=n,e[22]=a,e[23]=g,e[24]=i,e[25]=u,e[26]=D,e[27]=P,e[28]=B,e[29]=C,e[30]=$,e[31]=V,e[32]=I}else P=e[27],B=e[28],C=e[29],$=e[30],V=e[31],I=e[32];let W;e[47]!==B||e[48]!==C?(W=o.jsx("div",{className:B,children:C}),e[47]=B,e[48]=C,e[49]=W):W=e[49];let q;e[50]!==P||e[51]!==$||e[52]!==W?(q=o.jsx(P,{className:$,children:W}),e[50]=P,e[51]=$,e[52]=W,e[53]=q):q=e[53];let z;return e[54]!==V||e[55]!==I||e[56]!==q?(z=o.jsxs("div",{className:V,children:[I,q]}),e[54]=V,e[55]=I,e[56]=q,e[57]=z):z=e[57],z}function Bu(t){return t.slug}function Ou(t){return{entry:t,depth:0}}function pm(t){const e=re.c(25),{virtualMcpId:s}=t,n=Ce(),[a,i]=F.useState(!1),l=qr(s),{connection:r}=Oi(s),{activeTask:c}=$o();let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d={strict:!1},e[0]=d):d=e[0];const f=Oo(d);if(!(io(l?.metadata)||io(c?.metadata))&&!r){let u;e[1]===Symbol.for("react.memo_cache_sentinel")?(u=o.jsx("div",{className:"flex size-14 items-center justify-center rounded-full bg-muted",children:o.jsx(ro,{className:"size-7 text-foreground"})}),e[1]=u):u=e[1];let m;e[2]!==n?(m=n("mainPanelTabs.contentTab.noContentToEdit"),e[2]=n,e[3]=m):m=e[3];let x;e[4]!==n?(x=n("mainPanelTabs.contentTab.connectGithubDescription"),e[4]=n,e[5]=x):x=e[5];let S,N;e[6]===Symbol.for("react.memo_cache_sentinel")?(S=()=>i(!0),N=o.jsx(ro,{className:"size-4"}),e[6]=S,e[7]=N):(S=e[6],N=e[7]);let j;e[8]!==n?(j=n("mainPanelTabs.previewTab.connectGithub"),e[8]=n,e[9]=j):j=e[9];let b;e[10]!==j?(b=o.jsxs(Oe,{onClick:S,children:[N,j]}),e[10]=j,e[11]=b):b=e[11];let h;e[12]!==m||e[13]!==x||e[14]!==b?(h=o.jsx(Yr,{className:"h-full",image:u,title:m,description:x,actions:b}),e[12]=m,e[13]=x,e[14]=b,e[15]=h):h=e[15];let k;e[16]!==a?(k=o.jsx(Qr,{open:a,onOpenChange:i,mode:"agent"}),e[16]=a,e[17]=k):k=e[17];let A;return e[18]!==k||e[19]!==h?(A=o.jsxs(o.Fragment,{children:[h,k]}),e[18]=k,e[19]=h,e[20]=A):A=e[20],A}let p;return e[21]!==f.contentPageId||e[22]!==f.contentPath||e[23]!==f.contentPathTemplate?(p=o.jsx(cr,{children:o.jsx(Tu,{deepLinkPage:{pageId:f.contentPageId,path:f.contentPath,pathTemplate:f.contentPathTemplate}})}),e[21]=f.contentPageId,e[22]=f.contentPath,e[23]=f.contentPathTemplate,e[24]=p):p=e[24],p}export{Dl as $,rm as A,dm as B,pm as C,Ef as D,it as E,cm as F,Ml as G,uc as H,nd as I,mc as J,um as K,Ia as L,wa as M,fa as N,Gt as O,Vn as P,Gf as Q,lm as R,wc as S,xc as T,Hf as U,Vf as V,en as W,jc as X,kc as Y,Al as Z,El as _,Af as a,jo as a0,Bl as a1,Ie as a2,Ol as a3,Mf as a4,Kf as a5,zf as a6,Uf as a7,$f as a8,pc as a9,Of as aA,Lf as aB,em as aC,tm as aD,nm as aE,mt as aF,om as aG,sm as aH,Zf as aI,am as aJ,Gs as aK,gc as aa,Cc as ab,_c as ac,Un as ad,If as ae,Ca as af,Na as ag,Ke as ah,Wf as ai,Rf as aj,zs as ak,Ff as al,qf as am,ls as an,Nn as ao,Vs as ap,Yf as aq,Qf as ar,ed as as,nc as at,fm as au,gu as av,Ha as aw,ac as ax,qc as ay,ja as az,lo as b,sn as c,sc as d,Ve as e,Bf as f,ut as g,Jf as h,Jl as i,im as j,Df as k,ha as l,tn as m,xl as n,Ue as o,Qt as p,Oa as q,Xr as r,rc as s,$a as t,aa as u,Xf as v,qs as w,ma as x,mm as y,_a as z};
8
+ `),style:n.ordered?"ordered":"unordered"});break;case"quote":s.push({__resolveType:a,quote:n.text});break;case"divider":s.push({__resolveType:a});break;case"image":s.push({__resolveType:a,url:n.url,alt:n.alt,caption:n.caption,size:"normal"});break}}return s}function Nd({title:t,blocks:e,takenSlugs:s,now:n}){const a=t.trim();return{title:a,slug:a?$a(a,s):Oa(""),date:n.toISOString().slice(0,10),excerpt:"",image:"",alt:"",authors:[],categories:[],sections:e,status:"in_review"}}const ko="__all__",wo={"date-desc":"sandbox.postToolbar.sortNewestFirst","date-asc":"sandbox.postToolbar.sortOldestFirst",az:"sandbox.postToolbar.sortTitleAZ",za:"sandbox.postToolbar.sortTitleZA"},_d={"date-desc":"sandbox.postToolbar.sortNewest","date-asc":"sandbox.postToolbar.sortOldest",az:"sandbox.postToolbar.sortAZ",za:"sandbox.postToolbar.sortZA"},Co="status:";function No(t){if(!t.startsWith(Co))return null;const e=t.slice(Co.length);return Vn.includes(e)?e:null}const _o=F.forwardRef(function(e,s){const n=re.c(20);let a,i,l,r,c;n[0]!==e?({icon:a,active:i,value:c,className:l,...r}=e,n[0]=e,n[1]=a,n[2]=i,n[3]=l,n[4]=r,n[5]=c):(a=n[1],i=n[2],l=n[3],r=n[4],c=n[5]);const d=i?"text-foreground":"text-muted-foreground";let f;n[6]!==l||n[7]!==d?(f=ve("h-7 gap-1 px-1.5 text-xs",d,l),n[6]=l,n[7]=d,n[8]=f):f=n[8];let g;n[9]!==a?(g=o.jsx(a,{size:14,className:"shrink-0"}),n[9]=a,n[10]=g):g=n[10];let p;n[11]!==c?(p=c&&o.jsx("span",{className:"min-w-0 flex-1 truncate",children:c}),n[11]=c,n[12]=p):p=n[12];let u;n[13]===Symbol.for("react.memo_cache_sentinel")?(u=o.jsx(rs,{size:12,className:"shrink-0 opacity-60"}),n[13]=u):u=n[13];let m;return n[14]!==r||n[15]!==s||n[16]!==f||n[17]!==g||n[18]!==p?(m=o.jsxs(Oe,{ref:s,type:"button",variant:"ghost",size:"sm",className:f,...r,children:[g,p,u]}),n[14]=r,n[15]=s,n[16]=f,n[17]=g,n[18]=p,n[19]=m):m=n[19],m});function qn(t){const e=re.c(2),{count:s}=t;let n;return e[0]!==s?(n=o.jsx("span",{className:"ml-auto pl-3 text-xs text-muted-foreground tabular-nums",children:s}),e[0]=s,e[1]=n):n=e[1],n}function Pd(t){const e=re.c(19),{value:s,onChange:n}=t,a=Ce();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx(Bn,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),e[0]=i):i=e[0];let l;e[1]!==n?(l=p=>n(p.target.value),e[1]=n,e[2]=l):l=e[2];let r;e[3]!==a?(r=a("sandbox.postToolbar.searchPlaceholder"),e[3]=a,e[4]=r):r=e[4];let c;e[5]!==a?(c=a("sandbox.postToolbar.searchAriaLabel"),e[5]=a,e[6]=c):c=e[6];let d;e[7]!==l||e[8]!==r||e[9]!==c||e[10]!==s?(d=o.jsx("input",{type:"text",value:s,onChange:l,placeholder:r,"aria-label":c,className:"min-w-0 flex-1 bg-transparent py-0.5 text-sm outline-none placeholder:text-muted-foreground"}),e[7]=l,e[8]=r,e[9]=c,e[10]=s,e[11]=d):d=e[11];let f;e[12]!==n||e[13]!==a||e[14]!==s?(f=s&&o.jsx(Va,{label:a("sandbox.postToolbar.clearSearch"),onClick:()=>n("")}),e[12]=n,e[13]=a,e[14]=s,e[15]=f):f=e[15];let g;return e[16]!==d||e[17]!==f?(g=o.jsxs("div",{className:"flex items-center gap-2 border-b px-2.5 py-1.5",children:[i,d,f]}),e[16]=d,e[17]=f,e[18]=g):g=e[18],g}function Td(t){const e=re.c(100),{categories:s,authors:n,statusCounts:a,categoryFilter:i,authorFilter:l,statusFilter:r,sort:c,onCategoryFilterChange:d,onAuthorFilterChange:f,onStatusFilterChange:g,onSortChange:p}=t,u=Ce();let m;if(e[0]!==s||e[1]!==i){let w;e[3]!==i?(w=M=>M.slug===i,e[3]=i,e[4]=w):w=e[4],m=s.find(w),e[0]=s,e[1]=i,e[2]=m}else m=e[2];const x=m;let S;if(e[5]!==l||e[6]!==n){let w;e[8]!==l?(w=M=>M.email===l,e[8]=l,e[9]=w):w=e[9],S=n.find(w),e[5]=l,e[6]=n,e[7]=S}else S=e[7];const N=S,j=!!(i||l||r);let b;e[10]!==N?.name||e[11]!==x?.name||e[12]!==r||e[13]!==u?(b=x?.name??N?.name??u(r?qs[r]:"sandbox.postToolbar.filterLabel"),e[10]=N?.name,e[11]=x?.name,e[12]=r,e[13]=u,e[14]=b):b=e[14];const h=b,k=i?`cat:${i}`:l?`author:${l}`:r?`status:${r}`:ko;let A;e[15]!==f||e[16]!==d||e[17]!==g?(A=()=>{d(null),f(null),g(null)},e[15]=f,e[16]=d,e[17]=g,e[18]=A):A=e[18];const _=A;let v;e[19]!==_||e[20]!==f||e[21]!==d||e[22]!==g?(v=w=>{w.startsWith("cat:")?(f(null),g(null),d(w.slice(4))):w.startsWith("author:")?(d(null),g(null),f(w.slice(7))):No(w)?(d(null),f(null),g(No(w))):_()},e[19]=_,e[20]=f,e[21]=d,e[22]=g,e[23]=v):v=e[23];const E=v;let L;e[24]!==h||e[25]!==j?(L=o.jsx(Os,{asChild:!0,children:o.jsx(_o,{icon:ai,active:j,value:h,className:"min-w-0 shrink"})}),e[24]=h,e[25]=j,e[26]=L):L=e[26];let T;e[27]!==u?(T=u("sandbox.postToolbar.filterBy"),e[27]=u,e[28]=T):T=e[28];let D;e[29]!==T?(D=o.jsx(Zt,{children:T}),e[29]=T,e[30]=D):D=e[30];let P;e[31]!==u?(P=u("sandbox.postToolbar.allPosts"),e[31]=u,e[32]=P):P=e[32];let B;e[33]!==P?(B=o.jsx(ns,{value:ko,children:P}),e[33]=P,e[34]=B):B=e[34];let C;e[35]!==u?(C=u("sandbox.postToolbar.statusLabel"),e[35]=u,e[36]=C):C=e[36];let $;e[37]!==C?($=o.jsx(Zt,{className:"text-muted-foreground/70",children:C}),e[37]=C,e[38]=$):$=e[38];let V;e[39]!==a||e[40]!==u?(V=Vn.map(w=>o.jsxs(ns,{value:`status:${w}`,children:[o.jsx("span",{className:"min-w-0 flex-1 truncate",children:u(qs[w])}),o.jsx(qn,{count:a[w]??0})]},`status:${w}`)),e[39]=a,e[40]=u,e[41]=V):V=e[41];let I;e[42]!==s.length||e[43]!==u?(I=s.length>0&&o.jsx(Zt,{className:"text-muted-foreground/70",children:u("sandbox.postToolbar.categoryLabel")}),e[42]=s.length,e[43]=u,e[44]=I):I=e[44];let W;e[45]!==s?(W=s.map(Ed),e[45]=s,e[46]=W):W=e[46];let q;e[47]!==n.length||e[48]!==u?(q=n.length>0&&o.jsx(Zt,{className:"text-muted-foreground/70",children:u("sandbox.postToolbar.authorLabel")}),e[47]=n.length,e[48]=u,e[49]=q):q=e[49];let z;e[50]!==n?(z=n.map(Ad),e[50]=n,e[51]=z):z=e[51];let O;e[52]!==k||e[53]!==E||e[54]!==B||e[55]!==$||e[56]!==V||e[57]!==I||e[58]!==W||e[59]!==q||e[60]!==z?(O=o.jsxs(Wn,{value:k,onValueChange:E,children:[B,$,V,I,W,q,z]}),e[52]=k,e[53]=E,e[54]=B,e[55]=$,e[56]=V,e[57]=I,e[58]=W,e[59]=q,e[60]=z,e[61]=O):O=e[61];let Y;e[62]!==O||e[63]!==D?(Y=o.jsxs(Ls,{align:"start",className:"max-h-96 w-60 overflow-y-auto",children:[D,O]}),e[62]=O,e[63]=D,e[64]=Y):Y=e[64];let U;e[65]!==Y||e[66]!==L?(U=o.jsxs($s,{children:[L,Y]}),e[65]=Y,e[66]=L,e[67]=U):U=e[67];let Q;e[68]!==_||e[69]!==j||e[70]!==u?(Q=j&&o.jsx(Va,{label:u("sandbox.postToolbar.clearFilter"),onClick:_}),e[68]=_,e[69]=j,e[70]=u,e[71]=Q):Q=e[71];const oe=_d[c];let ee;e[72]!==u||e[73]!==oe?(ee=u(oe),e[72]=u,e[73]=oe,e[74]=ee):ee=e[74];let ie;e[75]!==ee?(ie=o.jsx(Os,{asChild:!0,children:o.jsx(_o,{icon:ii,active:!0,value:ee})}),e[75]=ee,e[76]=ie):ie=e[76];let ae;e[77]!==u?(ae=u("sandbox.postToolbar.sortBy"),e[77]=u,e[78]=ae):ae=e[78];let le;e[79]!==ae?(le=o.jsx(Zt,{children:ae}),e[79]=ae,e[80]=le):le=e[80];let ce;e[81]!==p?(ce=w=>p(w),e[81]=p,e[82]=ce):ce=e[82];let fe;e[83]===Symbol.for("react.memo_cache_sentinel")?(fe=Object.keys(wo),e[83]=fe):fe=e[83];let te;e[84]!==u?(te=fe.map(w=>o.jsx(ns,{value:w,children:u(wo[w])},w)),e[84]=u,e[85]=te):te=e[85];let de;e[86]!==c||e[87]!==ce||e[88]!==te?(de=o.jsx(Wn,{value:c,onValueChange:ce,children:te}),e[86]=c,e[87]=ce,e[88]=te,e[89]=de):de=e[89];let X;e[90]!==le||e[91]!==de?(X=o.jsxs(Ls,{align:"end",className:"w-44",children:[le,de]}),e[90]=le,e[91]=de,e[92]=X):X=e[92];let ne;e[93]!==ie||e[94]!==X?(ne=o.jsx("div",{className:"ml-auto shrink-0",children:o.jsxs($s,{children:[ie,X]})}),e[93]=ie,e[94]=X,e[95]=ne):ne=e[95];let J;return e[96]!==U||e[97]!==Q||e[98]!==ne?(J=o.jsxs("div",{className:"flex min-w-0 items-center gap-1 overflow-hidden border-b px-2 py-1.5",children:[U,Q,ne]}),e[96]=U,e[97]=Q,e[98]=ne,e[99]=J):J=e[99],J}function Ad(t){return o.jsxs(ns,{value:`author:${t.email}`,children:[o.jsx("span",{className:"min-w-0 flex-1 truncate",children:t.name}),o.jsx(qn,{count:t.count})]},`author:${t.email}`)}function Ed(t){return o.jsxs(ns,{value:`cat:${t.slug}`,children:[o.jsx("span",{className:"min-w-0 flex-1 truncate",children:t.name}),o.jsx(qn,{count:t.count})]},`cat:${t.slug}`)}function Va(t){const e=re.c(4),{label:s,onClick:n}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx(En,{size:12}),e[0]=a):a=e[0];let i;return e[1]!==s||e[2]!==n?(i=o.jsx("button",{type:"button","aria-label":s,onClick:n,className:"flex h-6 w-6 shrink-0 items-center justify-center text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer rounded-lg",children:a}),e[1]=s,e[2]=n,e[3]=i):i=e[3],i}function Dd(t){const e=re.c(18),{checked:s,disabled:n,onToggle:a}=t,i=Ce();let l;e[0]!==a?(l=()=>a(),e[0]=a,e[1]=l):l=e[1];let r;e[2]!==s||e[3]!==i?(r=i(s?"sandbox.postToolbar.deselectAllPosts":"sandbox.postToolbar.selectAllPosts"),e[2]=s,e[3]=i,e[4]=r):r=e[4];let c;e[5]!==s||e[6]!==n||e[7]!==l||e[8]!==r?(c=o.jsx(qe,{asChild:!0,children:o.jsx("span",{className:"flex shrink-0 items-center px-1.5",onClick:Bd,children:o.jsx(Xs,{checked:s,disabled:n,onCheckedChange:l,"aria-label":r})})}),e[5]=s,e[6]=n,e[7]=l,e[8]=r,e[9]=c):c=e[9];let d;e[10]!==s||e[11]!==i?(d=i(s?"sandbox.postToolbar.deselectAll":"sandbox.postToolbar.selectAll"),e[10]=s,e[11]=i,e[12]=d):d=e[12];let f;e[13]!==d?(f=o.jsx(We,{side:"bottom",children:d}),e[13]=d,e[14]=f):f=e[14];let g;return e[15]!==c||e[16]!==f?(g=o.jsxs(Ye,{children:[c,f]}),e[15]=c,e[16]=f,e[17]=g):g=e[17],g}function Bd(t){return t.stopPropagation()}function Od(t){const e=re.c(42),{count:s,allSelected:n,onToggleSelectAll:a,onArchive:i,onExit:l}=t,r=Ce();let c;e[0]!==n||e[1]!==a?(c=o.jsx(Dd,{checked:n,onToggle:a}),e[0]=n,e[1]=a,e[2]=c):c=e[2];let d;e[3]!==s||e[4]!==r?(d=r("sandbox.postToolbar.itemsSelected",{count:s}),e[3]=s,e[4]=r,e[5]=d):d=e[5];let f;e[6]!==d?(f=o.jsx("span",{className:"text-xs font-medium tabular-nums",children:d}),e[6]=d,e[7]=f):f=e[7];const g=s===0;let p;e[8]!==r?(p=r("sandbox.postToolbar.archiveSelectedPosts"),e[8]=r,e[9]=p):p=e[9];let u;e[10]===Symbol.for("react.memo_cache_sentinel")?(u=o.jsx(Za,{size:14}),e[10]=u):u=e[10];let m;e[11]!==i||e[12]!==g||e[13]!==p?(m=o.jsx(qe,{asChild:!0,children:o.jsx(Oe,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",disabled:g,onClick:i,"aria-label":p,children:u})}),e[11]=i,e[12]=g,e[13]=p,e[14]=m):m=e[14];let x;e[15]!==r?(x=r("sandbox.postToolbar.archiveSelected"),e[15]=r,e[16]=x):x=e[16];let S;e[17]!==x?(S=o.jsx(We,{side:"bottom",children:x}),e[17]=x,e[18]=S):S=e[18];let N;e[19]!==m||e[20]!==S?(N=o.jsxs(Ye,{children:[m,S]}),e[19]=m,e[20]=S,e[21]=N):N=e[21];let j;e[22]!==r?(j=r("sandbox.postToolbar.exitSelection"),e[22]=r,e[23]=j):j=e[23];let b;e[24]===Symbol.for("react.memo_cache_sentinel")?(b=o.jsx(En,{size:14}),e[24]=b):b=e[24];let h;e[25]!==l||e[26]!==j?(h=o.jsx(qe,{asChild:!0,children:o.jsx(Oe,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:l,"aria-label":j,children:b})}),e[25]=l,e[26]=j,e[27]=h):h=e[27];let k;e[28]!==r?(k=r("sandbox.postToolbar.exitSelection"),e[28]=r,e[29]=k):k=e[29];let A;e[30]!==k?(A=o.jsx(We,{side:"bottom",children:k}),e[30]=k,e[31]=A):A=e[31];let _;e[32]!==h||e[33]!==A?(_=o.jsxs(Ye,{children:[h,A]}),e[32]=h,e[33]=A,e[34]=_):_=e[34];let v;e[35]!==N||e[36]!==_?(v=o.jsxs("div",{className:"ml-auto flex items-center gap-0.5",children:[N,_]}),e[35]=N,e[36]=_,e[37]=v):v=e[37];let E;return e[38]!==c||e[39]!==v||e[40]!==f?(E=o.jsxs("div",{className:"flex items-center gap-0.5 border-b bg-accent/40 px-2 py-1.5",children:[c,f,v]}),e[38]=c,e[39]=v,e[40]=f,e[41]=E):E=e[41],E}const Ld={draft:"outline",generating:"secondary",awaiting_review:"warning",scheduled:"secondary",published:"success",archived:"outline"},Tn="generating",$d=[Tn,...Vn.filter(t=>t!==Tn)],Po=t=>t.scheduledDatetime||t.date||"",Rd=(t,e)=>Po(e).localeCompare(Po(t)),Fd=t=>t==="scheduled"||t==="published",Ua="application/x-post-key";function Id(t){const e=re.c(165),{orgSlug:s,virtualMcpId:n,branch:a,decofile:i,view:l,selectedKey:r,onViewChange:c,onOpen:d,onClose:f,move:g,meta:p,renderDetail:u}=t,m=Ce();let x;e[0]!==a||e[1]!==s||e[2]!==n?(x={orgSlug:s,virtualMcpId:n,branch:a},e[0]=a,e[1]=s,e[2]=n,e[3]=x):x=e[3];const S=Js(x),N=Gr().length>0,j=aa(),b=Ia(),[h,k]=F.useState(null),[A,_]=F.useState(!1),[v,E]=F.useState(!1),[L,T]=F.useState(!1),[D,P]=F.useState(""),B=F.useRef(null);let C;e[4]===Symbol.for("react.memo_cache_sentinel")?(C={},e[4]=C):C=e[4];const[$,V]=F.useState(C);let I;e[5]!==$?(I=(K,se)=>$[K]??se,e[5]=$,e[6]=I):I=e[6];const W=I;let q;e[7]===Symbol.for("react.memo_cache_sentinel")?(q=(K,se)=>V(Be=>({...Be,[K]:se})),e[7]=q):q=e[7];const z=q;let O;e[8]!==d?(O=K=>{const se=K[0];se&&d(se)},e[8]=d,e[9]=O):O=e[9];let Y;e[10]!==a||e[11]!==i||e[12]!==p||e[13]!==s||e[14]!==O||e[15]!==n?(Y={orgSlug:s,virtualMcpId:n,branch:a,decofile:i,meta:p,onStarted:O},e[10]=a,e[11]=i,e[12]=p,e[13]=s,e[14]=O,e[15]=n,e[16]=Y):Y=e[16];const U=ud(Y),Q=nc(i);let oe;e[17]!==i?(oe=K=>ut(i[K],"posts"),e[17]=i,e[18]=oe):oe=e[18];const ee=oe,ie=r&&Q.some(K=>K.key===r)?r:Q[0]?.key??null;let ae;e[19]!==g||e[20]!==m?(ae=async K=>{await g.apply(K.key,"archived")&&pe.success(m("sandbox.postBoard.archived"))},e[19]=g,e[20]=m,e[21]=ae):ae=e[21];const le=ae,[ce,fe]=F.useState(null),[te,de]=F.useState(null),[X,ne]=F.useState(null),[J,w]=F.useState("date-desc"),[M,me]=F.useState("");let ge;e[22]===Symbol.for("react.memo_cache_sentinel")?(ge=new Set,e[22]=ge):ge=e[22];const[he,ye]=F.useState(ge),_e=Q.reduce(Ud,{}),Pe=K=>{const se=new Map;for(const Be of Q)for(const rt of K(Be))se.set(rt,(se.get(rt)??0)+1);return se},Te=Pe(Vd),we=Pe(zd),Ee=Ue(i,"categories").map(K=>{const{payload:se}=K;return{slug:Ve(se.slug),name:Ve(se.name)||Ve(se.slug),count:Te.get(Ve(se.slug))??0}}),De=Ue(i,"authors").map(K=>{const{payload:se}=K;return{email:Ve(se.email),name:Ve(se.name)||Ve(se.email),count:we.get(Ve(se.email))??0}}),xe=M.trim().toLowerCase();let Ae;e[23]!==ce?(Ae=K=>!ce||K.categorySlugs.includes(ce),e[23]=ce,e[24]=Ae):Ae=e[24];let Re;e[25]!==te?(Re=K=>!te||K.authorEmails.includes(te),e[25]=te,e[26]=Re):Re=e[26];let G;e[27]!==X?(G=K=>!X||K.status===X,e[27]=X,e[28]=G):G=e[28];let be;e[29]!==J?(be=(K,se)=>{if(J==="az")return K.title.localeCompare(se.title);if(J==="za")return se.title.localeCompare(K.title);const Be=(K.scheduledDatetime||K.date).localeCompare(se.scheduledDatetime||se.date);return J==="date-asc"?Be:-Be},e[29]=J,e[30]=be):be=e[30];const ke=Q.filter(Ae).filter(Re).filter(G).filter(K=>!xe||K.title.toLowerCase().includes(xe)||K.slug.toLowerCase().includes(xe)).sort(be),Le=he.size>0;let gt;e[31]===Symbol.for("react.memo_cache_sentinel")?(gt=K=>ye(se=>{const Be=new Set(se);return Be.delete(K)||Be.add(K),Be}),e[31]=gt):gt=e[31];const an=gt,rn=()=>ye(K=>ke.every(se=>K.has(se.key))?new Set:new Set(ke.map(Md)));let ht;e[32]!==g||e[33]!==he||e[34]!==m?(ht=async()=>{let K=0;for(const se of he)await g.apply(se,"archived")&&(K=K+1);ye(new Set),K>0&&pe.success(m("sandbox.postBoard.archived"))},e[32]=g,e[33]=he,e[34]=m,e[35]=ht):ht=e[35];const ln=ht;let xt;e[36]!==g?(xt=(K,se)=>{k(null),g.apply(se,K)},e[36]=g,e[37]=xt):xt=e[37];const cn=xt;let bt;e[38]!==d||e[39]!==S?(bt=()=>{const K=Ms(Cn()),se=ya({title:"",now:new Date});S.mutate({blockKey:K,data:ft(K,se)}),d(K)},e[38]=d,e[39]=S,e[40]=bt):bt=e[40];const yt=bt,dn=()=>{const K=md(D),se=Cd(K.sections,Un(p,{hideDefaults:b}));if(se.length===0&&!K.title.trim()){pe.error(m("sandbox.postBoard.importEmpty"));return}const Be=Ms(Cn()),rt=Nd({title:K.title,blocks:se,takenSlugs:Q.map(Kd).filter(Boolean),now:new Date});S.mutate({blockKey:Be,data:ft(Be,rt)}),T(!1),P(""),pe.success(m("sandbox.postBoard.imported")),d(Be)},Jt=l==="list";let tt;e[41]!==c?(tt=()=>c("list"),e[41]=c,e[42]=tt):tt=e[42];let vt;e[43]===Symbol.for("react.memo_cache_sentinel")?(vt=o.jsx(mi,{size:14}),e[43]=vt):vt=e[43];let st;e[44]!==m?(st=m("sandbox.postBoard.viewList"),e[44]=m,e[45]=st):st=e[45];let nt;e[46]!==Jt||e[47]!==tt||e[48]!==st?(nt=o.jsx(To,{active:Jt,onClick:tt,icon:vt,label:st}),e[46]=Jt,e[47]=tt,e[48]=st,e[49]=nt):nt=e[49];const Xt=l==="board";let ot;e[50]!==c?(ot=()=>c("board"),e[50]=c,e[51]=ot):ot=e[51];let jt;e[52]===Symbol.for("react.memo_cache_sentinel")?(jt=o.jsx(ri,{size:14}),e[52]=jt):jt=e[52];let ze;e[53]!==m?(ze=m("sandbox.postBoard.viewBoard"),e[53]=m,e[54]=ze):ze=e[54];let at;e[55]!==Xt||e[56]!==ot||e[57]!==ze?(at=o.jsx(To,{active:Xt,onClick:ot,icon:jt,label:ze}),e[55]=Xt,e[56]=ot,e[57]=ze,e[58]=at):at=e[58];let y;e[59]!==nt||e[60]!==at?(y=o.jsx("div",{className:"flex items-center gap-3",children:o.jsxs("div",{className:"flex items-center gap-0.5 rounded-lg border p-0.5",children:[nt,at]})}),e[59]=nt,e[60]=at,e[61]=y):y=e[61];let H;e[62]===Symbol.for("react.memo_cache_sentinel")?(H=o.jsx(On,{size:14}),e[62]=H):H=e[62];let Z;e[63]!==m?(Z=m("sandbox.postBoard.newPost"),e[63]=m,e[64]=Z):Z=e[64];let ue;e[65]===Symbol.for("react.memo_cache_sentinel")?(ue=o.jsx(rs,{size:14}),e[65]=ue):ue=e[65];let Se;e[66]!==Z?(Se=o.jsx(Os,{asChild:!0,children:o.jsxs(Oe,{type:"button",size:"sm",children:[H,Z,ue]})}),e[66]=Z,e[67]=Se):Se=e[67];let Ne;e[68]!==j||e[69]!==m?(Ne=j&&o.jsxs(Xe,{onClick:()=>E(!0),children:[o.jsx(Is,{size:14}),o.jsxs("div",{className:"flex flex-col",children:[o.jsx("span",{children:m("sandbox.postBoard.newPostGenerate")}),o.jsx("span",{className:"text-xs text-muted-foreground",children:m("sandbox.postBoard.newPostGenerateHint")})]})]}),e[68]=j,e[69]=m,e[70]=Ne):Ne=e[70];let Qe;e[71]===Symbol.for("react.memo_cache_sentinel")?(Qe=o.jsx(fi,{size:14}),e[71]=Qe):Qe=e[71];let Je;e[72]!==m?(Je=m("sandbox.postBoard.newPostWrite"),e[72]=m,e[73]=Je):Je=e[73];let St;e[74]!==Je?(St=o.jsx("span",{children:Je}),e[74]=Je,e[75]=St):St=e[75];let kt;e[76]!==m?(kt=m("sandbox.postBoard.newPostWriteHint"),e[76]=m,e[77]=kt):kt=e[77];let wt;e[78]!==kt?(wt=o.jsx("span",{className:"text-xs text-muted-foreground",children:kt}),e[78]=kt,e[79]=wt):wt=e[79];let Ct;e[80]!==St||e[81]!==wt?(Ct=o.jsxs("div",{className:"flex flex-col",children:[St,wt]}),e[80]=St,e[81]=wt,e[82]=Ct):Ct=e[82];let Nt;e[83]!==Ct||e[84]!==yt?(Nt=o.jsxs(Xe,{onClick:yt,children:[Qe,Ct]}),e[83]=Ct,e[84]=yt,e[85]=Nt):Nt=e[85];let fs,ms;e[86]===Symbol.for("react.memo_cache_sentinel")?(fs=()=>T(!0),ms=o.jsx(hn,{size:14}),e[86]=fs,e[87]=ms):(fs=e[86],ms=e[87]);let _t;e[88]!==m?(_t=m("sandbox.postBoard.importContent"),e[88]=m,e[89]=_t):_t=e[89];let Pt;e[90]!==_t?(Pt=o.jsx("span",{children:_t}),e[90]=_t,e[91]=Pt):Pt=e[91];let Tt;e[92]!==m?(Tt=m("sandbox.postBoard.importContentHint"),e[92]=m,e[93]=Tt):Tt=e[93];let At;e[94]!==Tt?(At=o.jsx("span",{className:"text-xs text-muted-foreground",children:Tt}),e[94]=Tt,e[95]=At):At=e[95];let Et;e[96]!==Pt||e[97]!==At?(Et=o.jsxs(Xe,{onClick:fs,children:[ms,o.jsxs("div",{className:"flex flex-col",children:[Pt,At]})]}),e[96]=Pt,e[97]=At,e[98]=Et):Et=e[98];let Dt;e[99]!==Ne||e[100]!==Nt||e[101]!==Et?(Dt=o.jsxs(Ls,{align:"end",className:"w-56",children:[Ne,Nt,Et]}),e[99]=Ne,e[100]=Nt,e[101]=Et,e[102]=Dt):Dt=e[102];let ps;e[103]!==Se||e[104]!==Dt?(ps=o.jsxs($s,{children:[Se,Dt]}),e[103]=Se,e[104]=Dt,e[105]=ps):ps=e[105];let gs;e[106]!==j||e[107]!==i||e[108]!==v||e[109]!==U||e[110]!==N?(gs=j&&o.jsx(rd,{open:v,onOpenChange:E,decofile:i,hasAi:N,onGenerate:K=>{U(K)}}),e[106]=j,e[107]=i,e[108]=v,e[109]=U,e[110]=N,e[111]=gs):gs=e[111];let Bt;e[112]!==m?(Bt=m("sandbox.postBoard.importTitle"),e[112]=m,e[113]=Bt):Bt=e[113];let Ot;e[114]!==Bt?(Ot=o.jsx(Ht,{children:Bt}),e[114]=Bt,e[115]=Ot):Ot=e[115];let Lt;e[116]!==m?(Lt=m("sandbox.postBoard.importDescription"),e[116]=m,e[117]=Lt):Lt=e[117];let $t;e[118]!==Lt?($t=o.jsx(An,{children:Lt}),e[118]=Lt,e[119]=$t):$t=e[119];let hs;e[120]!==Ot||e[121]!==$t?(hs=o.jsxs(ds,{children:[Ot,$t]}),e[120]=Ot,e[121]=$t,e[122]=hs):hs=e[122];const un=Ka(D)?"html":"markdown";let xs;e[123]===Symbol.for("react.memo_cache_sentinel")?(xs=K=>P(K??""),e[123]=xs):xs=e[123];let Rt;e[124]!==D||e[125]!==un?(Rt=o.jsx("div",{className:"h-72 overflow-hidden rounded-[var(--studio-control-radius,var(--radius-xl))] border bg-[var(--studio-input-background)]",children:o.jsx(na,{code:D,language:un,height:"100%",autoFocus:!0,onChange:xs})}),e[124]=D,e[125]=un,e[126]=Rt):Rt=e[126];let bs;e[127]===Symbol.for("react.memo_cache_sentinel")?(bs=o.jsx("input",{ref:B,type:"file",accept:".html,.htm,.md,.markdown,.txt",className:"hidden",onChange:async K=>{const se=K.target.files?.[0];se&&P(await se.text()),K.target.value=""}}),e[127]=bs):bs=e[127];let ys,vs;e[128]===Symbol.for("react.memo_cache_sentinel")?(ys=()=>B.current?.click(),vs=o.jsx(hn,{size:14}),e[128]=ys,e[129]=vs):(ys=e[128],vs=e[129]);let Ft;e[130]!==m?(Ft=m("sandbox.postBoard.importUpload"),e[130]=m,e[131]=Ft):Ft=e[131];let It;e[132]!==Ft?(It=o.jsxs(Oe,{type:"button",variant:"outline",size:"sm",onClick:ys,children:[vs,Ft]}),e[132]=Ft,e[133]=It):It=e[133];let js;e[134]!==Rt||e[135]!==It?(js=o.jsxs("div",{className:"space-y-3",children:[Rt,bs,It]}),e[134]=Rt,e[135]=It,e[136]=js):js=e[136];let Ss;e[137]!==D?(Ss=D.trim(),e[137]=D,e[138]=Ss):Ss=e[138];let ks;e[139]===Symbol.for("react.memo_cache_sentinel")?(ks=o.jsx(hn,{size:14}),e[139]=ks):ks=e[139];let ws;e[140]!==m?(ws=m("sandbox.postBoard.importRun"),e[140]=m,e[141]=ws):ws=e[141];let Cs;e[142]!==A||e[143]!==f||e[144]!==u||e[145]!==r||e[146]!==l?(Cs=l==="board"&&r&&A&&u&&o.jsx("div",{className:"absolute inset-0 z-30 flex flex-col bg-background",children:u(r,{expanded:!0,onToggleExpand:()=>_(!1),onClose:()=>{_(!1),f?.()}})}),e[142]=A,e[143]=f,e[144]=u,e[145]=r,e[146]=l,e[147]=Cs):Cs=e[147];const fn=l==="board"&&!!r&&!A;let Kt;e[148]!==f?(Kt=K=>{K||(_(!1),f?.())},e[148]=f,e[149]=Kt):Kt=e[149];let Mt;e[150]!==m?(Mt=m("sandbox.collectionsSidebar.posts"),e[150]=m,e[151]=Mt):Mt=e[151];let zt;e[152]!==Mt?(zt=o.jsx(Ht,{className:"sr-only",children:Mt}),e[152]=Mt,e[153]=zt):zt=e[153];let Vt;e[154]!==f||e[155]!==u||e[156]!==r?(Vt=r&&u?o.jsx(F.Suspense,{fallback:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Sn,{size:20,className:"animate-spin text-muted-foreground"})}),children:u(r,{expanded:!1,onToggleExpand:()=>_(!0),onClose:()=>f?.()})}):null,e[154]=f,e[155]=u,e[156]=r,e[157]=Vt):Vt=e[157];let Ut;e[158]!==zt||e[159]!==Vt?(Ut=o.jsxs(qt,{closeButtonClassName:"hidden",className:"left-auto right-4 top-4 bottom-4 flex h-auto translate-x-0 translate-y-0 flex-col gap-0 overflow-hidden p-0 sm:max-w-3xl",children:[zt,Vt]}),e[158]=zt,e[159]=Vt,e[160]=Ut):Ut=e[160];let Ns;return e[161]!==fn||e[162]!==Kt||e[163]!==Ut?(Ns=o.jsx(Wt,{open:fn,onOpenChange:Kt,children:Ut}),e[161]=fn,e[162]=Kt,e[163]=Ut,e[164]=Ns):Ns=e[164],o.jsxs("div",{className:"relative flex h-full min-w-0 flex-col",children:[o.jsxs("div",{className:"flex shrink-0 flex-wrap items-center justify-between gap-3 border-b px-6 py-3",children:[y,o.jsxs("div",{className:"flex items-center gap-2",children:[ps,gs,o.jsx(Wt,{open:L,onOpenChange:T,children:o.jsxs(qt,{className:"max-h-[85vh] sm:max-w-2xl",children:[hs,js,o.jsx(us,{children:o.jsxs(Oe,{type:"button",disabled:!Ss,onClick:dn,children:[ks,ws]})})]})})]})]}),Q.length===0?o.jsx(Ur,{className:"flex-1",icon:o.jsx(Is,{size:22}),title:m("sandbox.postBoard.emptyTitle"),description:m("sandbox.postBoard.emptyDescription"),buttonProps:{children:m("sandbox.postBoard.newPost"),onClick:yt}}):l==="board"?o.jsx("div",{className:"flex min-h-0 flex-1 gap-3 overflow-x-auto p-4",children:$d.map(K=>{const se=m(qs[K]),Be=Q.filter($e=>$e.status===K);Fd(K)&&Be.sort(Rd);const rt=W(K,Be.length===0);return o.jsxs(F.Fragment,{children:[o.jsx("div",{onDragOver:$e=>{$e.preventDefault(),k(K)},onDragLeave:()=>k($e=>$e===K?null:$e),onDrop:$e=>{$e.preventDefault(),cn(K,$e.dataTransfer.getData(Ua))},className:ve("flex shrink-0 flex-col rounded-xl border bg-muted/30 transition-colors",rt?"w-11":"w-72",h===K&&"border-primary bg-primary/5"),children:rt?o.jsxs("button",{type:"button",onClick:()=>z(K,!1),"aria-label":m("sandbox.postBoard.expandLane",{lane:se}),"aria-expanded":!1,className:"flex min-h-0 flex-1 cursor-pointer flex-col items-center gap-2 py-2.5 text-muted-foreground hover:text-foreground",children:[o.jsx(Rs,{size:14,className:"shrink-0"}),o.jsx("span",{className:"text-xs tabular-nums",children:Be.length}),o.jsx("span",{className:"[writing-mode:vertical-rl] text-sm font-medium",children:se})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex items-center justify-between gap-2 px-3 py-2.5 text-sm font-medium",children:[o.jsxs("button",{type:"button",onClick:()=>z(K,!0),"aria-label":m("sandbox.postBoard.collapseLane",{lane:se}),"aria-expanded":!0,className:"flex min-w-0 cursor-pointer items-center gap-1.5 text-left hover:text-muted-foreground",children:[o.jsx(rs,{size:14,className:"shrink-0"}),o.jsx("span",{className:"truncate",children:se})]}),o.jsx("span",{className:"text-xs tabular-nums text-muted-foreground",children:Be.length})]}),o.jsx("div",{className:"min-h-0 flex-1 space-y-2 overflow-y-auto px-2 pb-2",children:Be.length===0?o.jsx("p",{className:"px-1 py-6 text-center text-xs text-muted-foreground",children:m("sandbox.postBoard.laneEmpty")}):Be.map($e=>o.jsx(qd,{post:$e,payload:ee($e.key),moving:g.isMoving($e.key),onOpen:()=>d($e.key),onArchive:$e.status==="archived"?void 0:()=>{le($e)}},$e.key))})]})}),K===Tn&&o.jsx("div",{"aria-hidden":!0,className:"my-1 w-px shrink-0 self-stretch bg-border"})]},K)})}):o.jsxs("div",{className:"flex min-h-0 flex-1",children:[o.jsxs("div",{className:"flex w-80 shrink-0 flex-col border-r",children:[o.jsx(Pd,{value:M,onChange:me}),Le?o.jsx(Od,{count:he.size,allSelected:ke.length>0&&ke.every(K=>he.has(K.key)),onToggleSelectAll:rn,onArchive:()=>{ln()},onExit:()=>ye(new Set)}):o.jsx(Td,{categories:Ee,authors:De,statusCounts:_e,categoryFilter:ce,authorFilter:te,statusFilter:X,sort:J,onCategoryFilterChange:fe,onAuthorFilterChange:de,onStatusFilterChange:ne,onSortChange:w}),o.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:o.jsx(Gd,{posts:ke,selectedKey:ie,selectionActive:Le,selectedKeys:he,onToggleSelect:an,onOpen:d,isMoving:g.isMoving,onArchive:K=>{le(K)}})})]}),o.jsx("div",{className:"min-w-0 flex-1 overflow-hidden",children:ie&&u?o.jsx(F.Suspense,{fallback:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Sn,{size:20,className:"animate-spin text-muted-foreground"})}),children:u(ie)}):o.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center text-sm text-muted-foreground",children:m("sandbox.postBoard.selectPrompt")})})]}),Cs,Ns]})}function Kd(t){return t.slug}function Md(t){return t.key}function zd(t){return t.authorEmails}function Vd(t){return t.categorySlugs}function Ud(t,e){return t[e.status]=(t[e.status]??0)+1,t}function To(t){const e=re.c(7),{active:s,onClick:n,icon:a,label:i}=t,l=s?"bg-accent text-accent-foreground":"text-muted-foreground hover:text-foreground";let r;e[0]!==l?(r=ve("inline-flex cursor-pointer items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",l),e[0]=l,e[1]=r):r=e[1];let c;return e[2]!==a||e[3]!==i||e[4]!==n||e[5]!==r?(c=o.jsxs("button",{type:"button",onClick:n,className:r,children:[a,i]}),e[2]=a,e[3]=i,e[4]=n,e[5]=r,e[6]=c):c=e[6],c}function Gd(t){const e=re.c(23),{posts:s,selectedKey:n,selectionActive:a,selectedKeys:i,onToggleSelect:l,onOpen:r,isMoving:c,onArchive:d}=t,f=Ce();if(s.length===0){let u;e[0]!==f?(u=f("sandbox.postList.noMatches"),e[0]=f,e[1]=u):u=e[1];let m;return e[2]!==u?(m=o.jsx("p",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:u}),e[2]=u,e[3]=m):m=e[3],m}let g;if(e[4]!==c||e[5]!==d||e[6]!==r||e[7]!==l||e[8]!==s||e[9]!==n||e[10]!==i||e[11]!==a){let u;e[13]!==c||e[14]!==d||e[15]!==r||e[16]!==l||e[17]!==n||e[18]!==i||e[19]!==a?(u=m=>o.jsx(Hd,{post:m,selected:m.key===n,selectionActive:a,checked:i.has(m.key),onToggleSelect:()=>l(m.key),moving:c(m.key),onOpen:()=>r(m.key),onArchive:m.status==="archived"?void 0:()=>d(m)},m.key),e[13]=c,e[14]=d,e[15]=r,e[16]=l,e[17]=n,e[18]=i,e[19]=a,e[20]=u):u=e[20],g=s.map(u),e[4]=c,e[5]=d,e[6]=r,e[7]=l,e[8]=s,e[9]=n,e[10]=i,e[11]=a,e[12]=g}else g=e[12];let p;return e[21]!==g?(p=o.jsx("ul",{className:"divide-y",children:g}),e[21]=g,e[22]=p):p=e[22],p}function Hd(t){const e=re.c(60),{post:s,selected:n,selectionActive:a,checked:i,onToggleSelect:l,moving:r,onOpen:c,onArchive:d}=t,f=Ce(),g=s.status==="awaiting_review"&&s.missing.length>0,p=s.status==="scheduled"||s.status==="published",u=a||i?"opacity-100":"opacity-0 focus-within:opacity-100 group-hover/row:opacity-100";let m;e[0]!==u?(m=ve("absolute left-3 top-3 z-10 transition-opacity",u),e[0]=u,e[1]=m):m=e[1];let x;e[2]!==l?(x=()=>l(),e[2]=l,e[3]=x):x=e[3];let S;e[4]!==s.title||e[5]!==f?(S=s.title||f("sandbox.postBoard.untitled"),e[4]=s.title,e[5]=f,e[6]=S):S=e[6];let N;e[7]!==i||e[8]!==x||e[9]!==S?(N=o.jsx(Xs,{checked:i,onCheckedChange:x,"aria-label":S}),e[7]=i,e[8]=x,e[9]=S,e[10]=N):N=e[10];let j;e[11]!==m||e[12]!==N?(j=o.jsx("span",{className:m,children:N}),e[11]=m,e[12]=N,e[13]=j):j=e[13];let b;e[14]!==r||e[15]!==d||e[16]!==a?(b=d&&!a&&o.jsx(Ga,{onArchive:d,disabled:r,className:"top-2.5"}),e[14]=r,e[15]=d,e[16]=a,e[17]=b):b=e[17];let h;e[18]!==c||e[19]!==l||e[20]!==a?(h=()=>a?l():c(),e[18]=c,e[19]=l,e[20]=a,e[21]=h):h=e[21];const k=n?"bg-accent text-accent-foreground":"bg-card hover:bg-muted/50";let A;e[22]!==k?(A=ve("flex w-full cursor-pointer flex-col gap-1.5 py-2.5 pl-10 pr-3 text-left text-sm transition-colors",k),e[22]=k,e[23]=A):A=e[23];let _;e[24]!==s.title||e[25]!==f?(_=s.title||f("sandbox.postBoard.untitled"),e[24]=s.title,e[25]=f,e[26]=_):_=e[26];let v;e[27]!==_?(v=o.jsx("span",{className:"min-w-0 truncate pr-6 font-medium",children:_}),e[27]=_,e[28]=v):v=e[28];const E=Ld[s.status],L=qs[s.status];let T;e[29]!==f||e[30]!==L?(T=f(L),e[29]=f,e[30]=L,e[31]=T):T=e[31];let D;e[32]!==E||e[33]!==T?(D=o.jsx(Mn,{variant:E,className:"shrink-0",children:T}),e[32]=E,e[33]=T,e[34]=D):D=e[34];let P;e[35]!==g||e[36]!==s.missing?(P=g&&o.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-warning",children:[o.jsx(is,{size:12}),s.missing.length]}),e[35]=g,e[36]=s.missing,e[37]=P):P=e[37];let B;e[38]!==s.duplicateTitle||e[39]!==f?(B=s.duplicateTitle&&o.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-warning",title:f("sandbox.postBoard.duplicateTitle"),children:[o.jsx(In,{size:12,"aria-hidden":!0}),o.jsx("span",{className:"sr-only",children:f("sandbox.postBoard.duplicateTitle")})]}),e[38]=s.duplicateTitle,e[39]=f,e[40]=B):B=e[40];let C;e[41]!==p||e[42]!==s.date||e[43]!==s.scheduledDatetime?(C=p&&o.jsxs("span",{className:"inline-flex items-center gap-1 text-xs tabular-nums text-muted-foreground",children:[o.jsx(Dn,{size:12}),(s.scheduledDatetime||s.date||"").slice(0,10)]}),e[41]=p,e[42]=s.date,e[43]=s.scheduledDatetime,e[44]=C):C=e[44];let $;e[45]!==D||e[46]!==P||e[47]!==B||e[48]!==C?($=o.jsxs("div",{className:"flex items-center gap-2",children:[D,P,B,C]}),e[45]=D,e[46]=P,e[47]=B,e[48]=C,e[49]=$):$=e[49];let V;e[50]!==n||e[51]!==A||e[52]!==v||e[53]!==$||e[54]!==h?(V=o.jsxs("button",{type:"button",onClick:h,"aria-current":n,className:A,children:[v,$]}),e[50]=n,e[51]=A,e[52]=v,e[53]=$,e[54]=h,e[55]=V):V=e[55];let I;return e[56]!==V||e[57]!==j||e[58]!==b?(I=o.jsxs("li",{className:"group/row relative",children:[j,b,V]}),e[56]=V,e[57]=j,e[58]=b,e[59]=I):I=e[59],I}function qd(t){const e=re.c(50),{post:s,payload:n,moving:a,onOpen:i,onArchive:l}=t,r=Ce(),c=s.status!=="generating"&&!a;let d;e[0]!==n?(d=tc(n),e[0]=n,e[1]=d):d=e[1];const f=d,g=!c&&"opacity-80";let p;e[2]!==g?(p=ve("group/card relative rounded-lg border bg-card shadow-sm transition-colors hover:border-primary/40",g),e[2]=g,e[3]=p):p=e[3];let u;e[4]!==a||e[5]!==l?(u=l&&o.jsx(Ga,{onArchive:l,disabled:a,className:"top-2"}),e[4]=a,e[5]=l,e[6]=u):u=e[6];let m;e[7]!==s.key?(m=T=>T.dataTransfer.setData(Ua,s.key),e[7]=s.key,e[8]=m):m=e[8];const x=c?"cursor-grab active:cursor-grabbing":"cursor-pointer";let S;e[9]!==x?(S=ve("block w-full p-3 text-left",x),e[9]=x,e[10]=S):S=e[10];let N;e[11]!==s.title||e[12]!==r?(N=s.title||r("sandbox.postBoard.untitled"),e[11]=s.title,e[12]=r,e[13]=N):N=e[13];let j;e[14]!==N?(j=o.jsx("p",{className:"line-clamp-2 pr-6 text-sm font-medium",children:N}),e[14]=N,e[15]=j):j=e[15];let b;e[16]!==f||e[17]!==s.status?(b=s.status==="draft"&&f.format?.name&&o.jsx(Mn,{variant:"outline",className:"max-w-full truncate",children:f.format.name}),e[16]=f,e[17]=s.status,e[18]=b):b=e[18];let h;e[19]!==s.status||e[20]!==r?(h=s.status==="generating"&&o.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground",children:[o.jsx(Sn,{size:12,className:"animate-spin"}),r("sandbox.postBoard.generatingLabel")]}),e[19]=s.status,e[20]=r,e[21]=h):h=e[21];let k;e[22]!==s.missing||e[23]!==s.status||e[24]!==r?(k=s.status==="awaiting_review"&&(s.missing.length>0?o.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-warning",children:[o.jsx(is,{size:12}),r("sandbox.postBoard.nIssues",{count:String(s.missing.length)})]}):o.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-success",children:[o.jsx(Vr,{size:12}),r("sandbox.postBoard.readyToSchedule")]})),e[22]=s.missing,e[23]=s.status,e[24]=r,e[25]=k):k=e[25];let A;e[26]!==s.date||e[27]!==s.scheduledDatetime||e[28]!==s.status?(A=(s.status==="scheduled"||s.status==="published")&&o.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground",children:[o.jsx(Dn,{size:12}),(s.scheduledDatetime||s.date||"").slice(0,10)]}),e[26]=s.date,e[27]=s.scheduledDatetime,e[28]=s.status,e[29]=A):A=e[29];let _;e[30]!==s.duplicateTitle||e[31]!==r?(_=s.duplicateTitle&&o.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-warning",children:[o.jsx(In,{size:12,"aria-hidden":!0}),r("sandbox.postBoard.duplicateTitle")]}),e[30]=s.duplicateTitle,e[31]=r,e[32]=_):_=e[32];let v;e[33]!==b||e[34]!==h||e[35]!==k||e[36]!==A||e[37]!==_?(v=o.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5",children:[b,h,k,A,_]}),e[33]=b,e[34]=h,e[35]=k,e[36]=A,e[37]=_,e[38]=v):v=e[38];let E;e[39]!==c||e[40]!==i||e[41]!==v||e[42]!==m||e[43]!==S||e[44]!==j?(E=o.jsxs("button",{type:"button",draggable:c,onDragStart:m,onClick:i,className:S,children:[j,v]}),e[39]=c,e[40]=i,e[41]=v,e[42]=m,e[43]=S,e[44]=j,e[45]=E):E=e[45];let L;return e[46]!==E||e[47]!==p||e[48]!==u?(L=o.jsxs("div",{className:p,children:[u,E]}),e[46]=E,e[47]=p,e[48]=u,e[49]=L):L=e[49],L}function Ga(t){const e=re.c(13),{label:s,onArchive:n,disabled:a,className:i}=t,l=Ce();let r;e[0]!==s||e[1]!==l?(r=s??l("sandbox.postBoard.delete"),e[0]=s,e[1]=l,e[2]=r):r=e[2];const c=r;let d;e[3]!==n?(d=u=>{u.stopPropagation(),n()},e[3]=n,e[4]=d):d=e[4];let f;e[5]!==i?(f=ve("absolute right-2 z-10 flex size-6 cursor-pointer items-center justify-center rounded-md text-muted-foreground opacity-0 transition-opacity hover:bg-muted hover:text-destructive focus-visible:opacity-100 group-hover/card:opacity-100 group-hover/row:opacity-100",i),e[5]=i,e[6]=f):f=e[6];let g;e[7]===Symbol.for("react.memo_cache_sentinel")?(g=o.jsx(Kn,{size:13}),e[7]=g):g=e[7];let p;return e[8]!==a||e[9]!==d||e[10]!==f||e[11]!==c?(p=o.jsx("button",{type:"button",disabled:a,"aria-label":c,title:c,onClick:d,className:f,children:g}),e[8]=a,e[9]=d,e[10]=f,e[11]=c,e[12]=p):p=e[12],p}function He(t){const e=re.c(54),{icon:s,logoUrl:n,title:a,subtitle:i,active:l,accent:r,variantCount:c,trailing:d,selectable:f,selectionActive:g,selected:p,invalid:u,invalidReason:m,warning:x,warningReason:S,onToggleSelect:N,onClick:j,menu:b}=t,h=Ce(),k=r==="global";let A;e[0]!==s||e[1]!==l||e[2]!==k||e[3]!==n?(A=n?o.jsx("img",{src:n,alt:"",className:"size-8 shrink-0 rounded-lg object-cover bg-muted"}):o.jsx("span",{className:ve("flex size-8 shrink-0 items-center justify-center rounded-lg",k?"bg-global-section/15":"bg-muted"),children:o.jsx(s,{size:16,className:ve("shrink-0",!k&&(l?"text-accent-foreground":"text-muted-foreground")),style:k?{color:Fn}:void 0})}),e[0]=s,e[1]=l,e[2]=k,e[3]=n,e[4]=A):A=e[4];const _=A,v=l?k?"bg-global-section/15 text-global-section-fg dark:text-global-section-fg-dark":"bg-accent text-accent-foreground":k?"hover:bg-global-section/10":"hover:bg-muted";let E;e[5]!==v?(E=ve("group relative flex min-w-0 items-center rounded-md transition-colors",v),e[5]=v,e[6]=E):E=e[6];let L;e[7]!==N||e[8]!==f||e[9]!==p||e[10]!==g||e[11]!==h||e[12]!==a?(L=f&&o.jsx("span",{className:ve("flex shrink-0 items-center pl-2.5 transition-opacity",p||g?"opacity-100":"opacity-0 group-hover:opacity-100 focus-within:opacity-100"),onClick:Wd,children:o.jsx(Xs,{checked:p,onCheckedChange:()=>N?.(),"aria-label":h("sandbox.itemRow.selectItem",{title:a})})}),e[7]=N,e[8]=f,e[9]=p,e[10]=g,e[11]=h,e[12]=a,e[13]=L):L=e[13];const T=u&&!l&&"text-destructive";let D;e[14]!==T?(D=ve("block truncate text-sm font-medium",T),e[14]=T,e[15]=D):D=e[15];let P;e[16]!==D||e[17]!==a?(P=o.jsx("span",{className:D,children:a}),e[16]=D,e[17]=a,e[18]=P):P=e[18];const B=l?"text-accent-foreground/70":"text-muted-foreground";let C;e[19]!==B?(C=ve("block truncate text-xs",B),e[19]=B,e[20]=C):C=e[20];let $;e[21]!==i||e[22]!==C?($=o.jsx("span",{className:C,children:i}),e[21]=i,e[22]=C,e[23]=$):$=e[23];let V;e[24]!==$||e[25]!==P?(V=o.jsxs("span",{className:"min-w-0 flex-1",children:[P,$]}),e[24]=$,e[25]=P,e[26]=V):V=e[26];let I;e[27]!==l||e[28]!==h||e[29]!==c?(I=c!==void 0&&c>1&&o.jsxs(Ye,{children:[o.jsx(qe,{asChild:!0,children:o.jsxs("span",{className:ve("flex shrink-0 items-center gap-1 text-xs font-medium",l?"text-accent-foreground/70":"text-muted-foreground"),children:[o.jsx(Mo,{size:14}),c]})}),o.jsx(We,{side:"bottom",children:h("sandbox.itemRow.variantCount",{count:c})})]}),e[27]=l,e[28]=h,e[29]=c,e[30]=I):I=e[30];let W;e[31]!==x||e[32]!==S?(W=x&&o.jsxs(Ye,{children:[o.jsx(qe,{asChild:!0,children:o.jsx("span",{className:"flex shrink-0 items-center text-warning",children:o.jsx(is,{size:14})})}),S&&o.jsx(We,{side:"bottom",children:S})]}),e[31]=x,e[32]=S,e[33]=W):W=e[33];let q;e[34]!==l||e[35]!==u||e[36]!==m?(q=u&&o.jsxs(Ye,{children:[o.jsx(qe,{asChild:!0,children:o.jsx("span",{className:ve("flex shrink-0 items-center",l?"text-accent-foreground":"text-destructive"),children:o.jsx(is,{size:14})})}),m&&o.jsx(We,{side:"bottom",children:m})]}),e[34]=l,e[35]=u,e[36]=m,e[37]=q):q=e[37];let z;e[38]!==j||e[39]!==_||e[40]!==V||e[41]!==I||e[42]!==W||e[43]!==q||e[44]!==d?(z=o.jsxs("button",{type:"button",onClick:j,className:"flex min-w-0 flex-1 items-center gap-2.5 rounded-lg px-2.5 py-2 text-left cursor-pointer",children:[_,V,I,W,q,d]}),e[38]=j,e[39]=_,e[40]=V,e[41]=I,e[42]=W,e[43]=q,e[44]=d,e[45]=z):z=e[45];let O;e[46]!==l||e[47]!==b?(O=b&&o.jsx("div",{className:ve("pr-1 opacity-0 transition-opacity group-hover:opacity-100",l&&"opacity-100"),children:b}),e[46]=l,e[47]=b,e[48]=O):O=e[48];let Y;return e[49]!==z||e[50]!==O||e[51]!==E||e[52]!==L?(Y=o.jsxs("div",{className:E,children:[L,z,O]}),e[49]=z,e[50]=O,e[51]=E,e[52]=L,e[53]=Y):Y=e[53],Y}function Wd(t){return t.stopPropagation()}function it(t){const e=re.c(10),{icon:s,title:n,description:a}=t;let i;e[0]!==s?(i=s&&o.jsx(s,{size:24,className:"text-muted-foreground/60"}),e[0]=s,e[1]=i):i=e[1];let l;e[2]!==n?(l=o.jsx("div",{children:n}),e[2]=n,e[3]=l):l=e[3];let r;e[4]!==a?(r=a&&o.jsx("div",{className:"text-xs text-muted-foreground/80 max-w-sm",children:a}),e[4]=a,e[5]=r):r=e[5];let c;return e[6]!==i||e[7]!==l||e[8]!==r?(c=o.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center gap-2 p-6 text-center text-sm text-muted-foreground",children:[i,l,r]}),e[6]=i,e[7]=l,e[8]=r,e[9]=c):c=e[9],c}const Yd={loaders:Ko,actions:Go},Qd={loaders:"Loaders",actions:"Actions"},Jd={analytics:di,blog:ta,commerce:ci,site:li,website:Fs};function Xd(t,e){return e===0?Jd[t.toLowerCase()]??Qn:Qn}function Ts(t,e){return e===0?qi(t):t}function Zd(t){const e=re.c(98),{orgSlug:s,virtualMcpId:n,branch:a,previewUrl:i,meta:l,decofile:r,kind:c}=t,d=Ce();let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=[],e[0]=f):f=e[0];const[g,p]=F.useState(f),[u,m]=F.useState(null),[x,S]=F.useState(""),[N,j]=F.useState(ru),[b,h]=F.useState(c);b!==c&&(h(c),p([]),m(null),S(""),j(new Set));let k;e[1]===Symbol.for("react.memo_cache_sentinel")?(k=U=>{j(Q=>{const oe=new Set(Q);return oe.has(U)?oe.delete(U):oe.add(U),oe})},e[1]=k):k=e[1];const A=k;let _;e[2]!==a||e[3]!==s||e[4]!==n?(_={orgSlug:s,virtualMcpId:n,branch:a},e[2]=a,e[3]=s,e[4]=n,e[5]=_):_=e[5];const v=Js(_);let E;e[6]!==v?(E=Xo((U,Q)=>v.mutate({blockKey:U,data:Q})),e[6]=v,e[7]=E):E=e[7];const L=E;let T;e[8]!==c?(T=Wi(c),e[8]=c,e[9]=T):T=e[9];const D=T,P=Yd[c];let B,C,$,V,I,W,q;if(e[10]!==P||e[11]!==a||e[12]!==r||e[13]!==c||e[14]!==l||e[15]!==N||e[16]!==s||e[17]!==g||e[18]!==i||e[19]!==v||e[20]!==L||e[21]!==x||e[22]!==u||e[23]!==D||e[24]!==d||e[25]!==n){$=Symbol.for("react.early_return_sentinel");e:{const U=[...Vi(l,r,c).map(iu),...Ui(l,c).map(au)],Q=x.trim().toLowerCase(),oe=Q.length>0,ee=oe?U.filter(G=>G.title.toLowerCase().includes(Q)||G.resolveType.toLowerCase().includes(Q)):[],ie=new Map,ae=[],le=new Map;if(!oe){for(const G of U){const be=G.folderPath;if(!(be.length<g.length)&&g.every((ke,Le)=>be[Le]===ke))if(be.length===g.length)if(G.savedKey!==void 0){const ke=le.get(G.resolveType);ke?ke.push(G):le.set(G.resolveType,[G])}else ae.push(G);else{const ke=be[g.length],Le=ie.get(ke)??{count:0,savedCount:0};G.savedKey!==void 0?Le.savedCount=Le.savedCount+1:Le.count=Le.count+1,ie.set(ke,Le)}}ae.sort(ou);for(const G of le.values())G.sort(nu)}const ce=[...le.entries()].filter(G=>{const[be]=G;return!ae.some(ke=>ke.resolveType===be)}).flatMap(su).sort(tu);let fe;e[33]!==g?(fe=(G,be)=>Ts(G.name,g.length).localeCompare(Ts(be.name,g.length)),e[33]=g,e[34]=fe):fe=e[34];const te=[...ie.entries()].map(eu).sort(fe);let de;e[35]===Symbol.for("react.memo_cache_sentinel")?(de=G=>{m(G.savedKey!==void 0?{mode:"saved",key:G.savedKey}:{mode:"available",resolveType:G.resolveType,title:G.title})},e[35]=de):de=e[35];const X=de;let ne;e[36]!==v||e[37]!==D||e[38]!==d?(ne=async(G,be)=>{await v.mutateAsync({blockKey:G,data:be}),pe.success(d("sandbox.runnableBlocksBrowser.savedBlockToast",{singular:D,blockId:G})),m({mode:"saved",key:G})},e[36]=v,e[37]=D,e[38]=d,e[39]=ne):ne=e[39];const J=ne;let w;e[40]!==r||e[41]!==u?(w=lu(u,r),e[40]=r,e[41]=u,e[42]=w):w=e[42];const M=w;if(M){const G=`${M.mode}:${M.mode==="saved"?M.blockKey:M.resolveType}`;let be;e[43]===Symbol.for("react.memo_cache_sentinel")?(be=()=>m(null),e[43]=be):be=e[43];let ke;e[44]!==a||e[45]!==r||e[46]!==J||e[47]!==c||e[48]!==l||e[49]!==s||e[50]!==i||e[51]!==v.isPending||e[52]!==L||e[53]!==G||e[54]!==M.editorTarget||e[55]!==M.initialValue||e[56]!==n?(ke=o.jsx(Gi,{orgSlug:s,virtualMcpId:n,branch:a,previewUrl:i,meta:l,decofile:r,kind:c,target:M.editorTarget,initialValue:M.initialValue,isCreating:v.isPending,onCreate:J,onSaveReferencedBlock:L,onBack:be},G),e[44]=a,e[45]=r,e[46]=J,e[47]=c,e[48]=l,e[49]=s,e[50]=i,e[51]=v.isPending,e[52]=L,e[53]=G,e[54]=M.editorTarget,e[55]=M.initialValue,e[56]=n,e[57]=ke):ke=e[57],$=ke;break e}q="flex h-full w-full min-w-0 flex-col";let me;e[58]!==d?(me=d("sandbox.runnableBlocksBrowser.folderBreadcrumb"),e[58]=d,e[59]=me):me=e[59];let ge;e[60]===Symbol.for("react.memo_cache_sentinel")?(ge=()=>p([]),e[60]=ge):ge=e[60];const he=g.length===0?"font-medium text-foreground":"text-muted-foreground";let ye;e[61]!==he?(ye=ve("min-w-0 truncate rounded-lg px-1 py-0.5 transition-colors hover:bg-accent hover:text-accent-foreground",he),e[61]=he,e[62]=ye):ye=e[62];const _e=Qd[c];let Pe;e[63]!==ye||e[64]!==_e?(Pe=o.jsx("button",{type:"button",onClick:ge,className:ye,children:_e}),e[63]=ye,e[64]=_e,e[65]=Pe):Pe=e[65];let Te;e[66]!==g?(Te=g.map((G,be)=>{const ke=be===g.length-1;return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[o.jsx(Rs,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>p(g.slice(0,be+1)),className:ve("min-w-0 truncate rounded-lg px-1 py-0.5 transition-colors hover:bg-accent hover:text-accent-foreground",ke?"font-medium text-foreground":"text-muted-foreground"),children:Ts(G,be)})]},`${G}-${be}`)}),e[66]=g,e[67]=Te):Te=e[67];let we;e[68]!==me||e[69]!==Pe||e[70]!==Te?(we=o.jsxs("nav",{"aria-label":me,className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:[Pe,Te]}),e[68]=me,e[69]=Pe,e[70]=Te,e[71]=we):we=e[71];let Ee;e[72]===Symbol.for("react.memo_cache_sentinel")?(Ee=o.jsx(Bn,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),e[72]=Ee):Ee=e[72];let De;e[73]===Symbol.for("react.memo_cache_sentinel")?(De=G=>S(G.target.value),e[73]=De):De=e[73];let xe;e[74]!==c||e[75]!==d?(xe=d("sandbox.runnableBlocksBrowser.searchPlaceholder",{kind:c}),e[74]=c,e[75]=d,e[76]=xe):xe=e[76];let Ae;e[77]!==c||e[78]!==d?(Ae=d("sandbox.runnableBlocksBrowser.searchAriaLabel",{kind:c}),e[77]=c,e[78]=d,e[79]=Ae):Ae=e[79];let Re;e[80]!==x||e[81]!==xe||e[82]!==Ae?(Re=o.jsxs("div",{className:"flex w-56 shrink-0 items-center gap-2",children:[Ee,o.jsx("input",{type:"text",value:x,onChange:De,placeholder:xe,"aria-label":Ae,className:"w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),e[80]=x,e[81]=xe,e[82]=Ae,e[83]=Re):Re=e[83],e[84]!==we||e[85]!==Re?(C=o.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-2 border-b px-4",children:[we,Re]}),e[84]=we,e[85]=Re,e[86]=C):C=e[86],B=Qs,W="min-h-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",V="mx-auto w-full max-w-4xl px-6 py-5",I=oe?ee.length===0?o.jsx(it,{title:d("sandbox.runnableBlocksBrowser.noSearchResults",{kind:c,query:x.trim()}),description:d("sandbox.runnableBlocksBrowser.noSearchResultsDescription")}):o.jsx("div",{className:"flex flex-col gap-1",children:ee.map(G=>o.jsx(He,{icon:P,accent:G.savedKey!==void 0?"global":void 0,title:G.title,subtitle:G.resolveType,active:!1,onClick:()=>X(G)},G.savedKey??G.resolveType))}):te.length===0&&ae.length===0&&ce.length===0?o.jsx(it,{title:d("sandbox.runnableBlocksBrowser.emptyFolderTitle",{kind:c}),description:g.length===0?d("sandbox.runnableBlocksBrowser.emptyFolderNoManifest"):d("sandbox.runnableBlocksBrowser.emptyFolder")}):o.jsxs(o.Fragment,{children:[te.length>0&&o.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(180px,1fr))] gap-2",children:te.map(G=>{const be=Xd(G.name,g.length);return o.jsxs("button",{type:"button",onClick:()=>p([...g,G.name]),className:"flex items-center gap-2.5 rounded-lg border px-3 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer",children:[o.jsx(be,{size:18,className:"shrink-0 text-muted-foreground"}),o.jsxs("span",{className:"min-w-0 flex-1",children:[o.jsx("span",{className:"block truncate text-sm font-medium",children:Ts(G.name,g.length)}),o.jsxs("span",{className:"block truncate text-xs text-muted-foreground",children:[G.count," ",G.count===1?D:c,G.savedCount>0&&o.jsxs(o.Fragment,{children:[" ","·"," ",d("sandbox.runnableBlocksBrowser.savedCountLabel",{count:G.savedCount})]})]})]})]},G.name)})}),(ae.length>0||ce.length>0)&&o.jsxs("div",{className:ve("flex flex-col gap-1",te.length>0&&"mt-4"),children:[ae.map(G=>{const be=le.get(G.resolveType)??[],ke=N.has(G.resolveType);return o.jsxs("div",{className:"flex flex-col",children:[o.jsx(He,{icon:P,title:G.title,subtitle:G.resolveType,active:!1,onClick:()=>X(G)}),be.length>0&&o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",onClick:()=>A(G.resolveType),"aria-expanded":ke,className:"flex items-center gap-1 self-start rounded-lg px-2.5 py-1 text-xs font-medium transition-colors hover:bg-global-section/10 cursor-pointer ml-11",style:{color:Fn},children:[ke?o.jsx(rs,{size:12,className:"shrink-0"}):o.jsx(Rs,{size:12,className:"shrink-0"}),d(ke?"sandbox.runnableBlocksBrowser.hideSaved":"sandbox.runnableBlocksBrowser.seeSaved")," ","(",be.length,")"]}),ke&&o.jsx("div",{className:"ml-11 flex flex-col gap-1 pb-1",children:be.map(Le=>o.jsx(He,{icon:P,accent:"global",title:Le.title,subtitle:Le.resolveType,active:!1,onClick:()=>X(Le)},Le.savedKey))})]})]},G.resolveType)}),ce.map(G=>o.jsx(He,{icon:P,accent:"global",title:G.title,subtitle:G.resolveType,active:!1,onClick:()=>X(G)},G.savedKey))]})]})}e[10]=P,e[11]=a,e[12]=r,e[13]=c,e[14]=l,e[15]=N,e[16]=s,e[17]=g,e[18]=i,e[19]=v,e[20]=L,e[21]=x,e[22]=u,e[23]=D,e[24]=d,e[25]=n,e[26]=B,e[27]=C,e[28]=$,e[29]=V,e[30]=I,e[31]=W,e[32]=q}else B=e[26],C=e[27],$=e[28],V=e[29],I=e[30],W=e[31],q=e[32];if($!==Symbol.for("react.early_return_sentinel"))return $;let z;e[87]!==V||e[88]!==I?(z=o.jsx("div",{className:V,children:I}),e[87]=V,e[88]=I,e[89]=z):z=e[89];let O;e[90]!==B||e[91]!==z||e[92]!==W?(O=o.jsx(B,{className:W,children:z}),e[90]=B,e[91]=z,e[92]=W,e[93]=O):O=e[93];let Y;return e[94]!==C||e[95]!==O||e[96]!==q?(Y=o.jsxs("div",{className:q,children:[C,O]}),e[94]=C,e[95]=O,e[96]=q,e[97]=Y):Y=e[97],Y}function eu(t){const[e,s]=t;return{name:e,...s}}function tu(t,e){return t.title.localeCompare(e.title)}function su(t){const[,e]=t;return e}function nu(t,e){return t.title.localeCompare(e.title)}function ou(t,e){return t.title.localeCompare(e.title)}function au(t){return{resolveType:t.resolveType,title:t.title,folderPath:Jo(t.resolveType)}}function iu(t){return{resolveType:t.resolveType,title:t.title,folderPath:Jo(t.resolveType),savedKey:t.key}}function ru(){return new Set}function lu(t,e){if(!t)return null;if(t.mode==="available")return{mode:"available",resolveType:t.resolveType,editorTarget:{mode:"available",resolveType:t.resolveType,title:t.title},initialValue:{}};const{resolveType:s,props:n,title:a}=Hi(e,t.key);return{mode:"saved",blockKey:t.key,resolveType:s,editorTarget:{mode:"saved",blockKey:t.key,resolveType:s,title:a},initialValue:n}}function cu(t){const e=re.c(106),{orgSlug:s,virtualMcpId:n,branch:a,previewUrl:i,meta:l,decofile:r,resolveType:c,title:d,defaultBlockId:f,isCreating:g,onCreate:p,onSaveReferencedBlock:u}=t,m=Ce(),x=Ys(),S=x?.virtualMcpId,j=oa(S===n?n:null)?.metadata?.siteSlug??null;let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b={},e[0]=b):b=e[0];const[h,k]=F.useState(b);let A;e[1]===Symbol.for("react.memo_cache_sentinel")?(A=[],e[1]=A):A=e[1];const[_,v]=F.useState(A),[E,L]=F.useState(0),[T,D]=F.useState(!1);let P;e[2]!==l||e[3]!==c?(P=$n(c,l),e[2]=l,e[3]=c,e[4]=P):P=e[4];const B=P;let C,$,V,I,W,q,z,O;if(e[5]!==j||e[6]!==a||e[7]!==r||e[8]!==_||e[9]!==h||e[10]!==g||e[11]!==p||e[12]!==s||e[13]!==i||e[14]!==c||e[15]!==m||e[16]!==x?.taskId||e[17]!==d||e[18]!==n){const ae=c.split("/").pop()?.replace(/\.tsx?$/,"")??c,le=x?.taskId??null,ce=i??void 0;let fe;e[27]!==j||e[28]!==a||e[29]!==s||e[30]!==ce||e[31]!==le||e[32]!==n?(fe={orgSlug:s,virtualMcpId:n,branch:a,threadId:le,previewUrl:ce,siteSlug:j},e[27]=j,e[28]=a,e[29]=s,e[30]=ce,e[31]=le,e[32]=n,e[33]=fe):fe=e[33],$=fe;let te,de,X,ne;if(e[34]!==r||e[35]!==_||e[36]!==h||e[37]!==p||e[38]!==m||e[39]!==d){const Pe=[d,..._],Te=Ee=>{v(_.slice(0,Ee)),L(du)};let we;e[48]!==r||e[49]!==h||e[50]!==p?(we=async Ee=>{const De=Qi(Ee,r);if(De){pe.error(De);return}await p(Ee,h),D(!1)},e[48]=r,e[49]=h,e[50]=p,e[51]=we):we=e[51],C=we,O="flex h-full w-full min-w-0",z="flex min-w-0 flex-1 flex-col",W="shrink-0 border-b px-3 py-2.5",ne="flex min-w-0 items-center gap-2 overflow-hidden",e[52]!==m?(te=m("sandbox.availableSectionEditor.editingBreadcrumb"),e[52]=m,e[53]=te):te=e[53],de="flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",X=Pe.map((Ee,De)=>{const xe=De===Pe.length-1,Ae=Yi(Ee);return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[De>0&&o.jsx(Rs,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>Te(De),title:Ae,className:ve("min-w-0 truncate rounded-lg px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",xe?"font-medium text-foreground":"text-muted-foreground"),children:Ae})]},`${Ae}-${De}`)}),e[34]=r,e[35]=_,e[36]=h,e[37]=p,e[38]=m,e[39]=d,e[40]=C,e[41]=te,e[42]=de,e[43]=X,e[44]=ne,e[45]=W,e[46]=z,e[47]=O}else C=e[40],te=e[41],de=e[42],X=e[43],ne=e[44],W=e[45],z=e[46],O=e[47];let J;e[54]!==te||e[55]!==de||e[56]!==X?(J=o.jsx("nav",{"aria-label":te,className:de,children:X}),e[54]=te,e[55]=de,e[56]=X,e[57]=J):J=e[57];let w;e[58]===Symbol.for("react.memo_cache_sentinel")?(w=()=>D(!0),e[58]=w):w=e[58];let M;e[59]!==m?(M=m("sandbox.availableSectionEditor.saveAsGlobalSection"),e[59]=m,e[60]=M):M=e[60];let me;e[61]===Symbol.for("react.memo_cache_sentinel")?(me=o.jsx(ui,{size:14}),e[61]=me):me=e[61];let ge;e[62]!==g||e[63]!==M?(ge=o.jsx(qe,{asChild:!0,children:o.jsx(Oe,{size:"icon",className:"size-8 shrink-0",disabled:g,onClick:w,"aria-label":M,children:me})}),e[62]=g,e[63]=M,e[64]=ge):ge=e[64];let he;e[65]!==m?(he=m("sandbox.availableSectionEditor.saveAsGlobalSection"),e[65]=m,e[66]=he):he=e[66];let ye;e[67]!==he?(ye=o.jsx(We,{side:"bottom",children:he}),e[67]=he,e[68]=ye):ye=e[68];let _e;e[69]!==ge||e[70]!==ye?(_e=o.jsxs(Ye,{children:[ge,ye]}),e[69]=ge,e[70]=ye,e[71]=_e):_e=e[71],e[72]!==ne||e[73]!==J||e[74]!==_e?(q=o.jsxs("div",{className:ne,children:[J,_e]}),e[72]=ne,e[73]=J,e[74]=_e,e[75]=q):q=e[75],V="mt-1.5 py-1 pl-1 text-sm leading-snug text-muted-foreground",I=m("sandbox.availableSectionEditor.localEditsHint",{typeLabel:ae}),e[5]=j,e[6]=a,e[7]=r,e[8]=_,e[9]=h,e[10]=g,e[11]=p,e[12]=s,e[13]=i,e[14]=c,e[15]=m,e[16]=x?.taskId,e[17]=d,e[18]=n,e[19]=C,e[20]=$,e[21]=V,e[22]=I,e[23]=W,e[24]=q,e[25]=z,e[26]=O}else C=e[19],$=e[20],V=e[21],I=e[22],W=e[23],q=e[24],z=e[25],O=e[26];let Y;e[76]!==V||e[77]!==I?(Y=o.jsx("p",{className:V,children:I}),e[76]=V,e[77]=I,e[78]=Y):Y=e[78];let U;e[79]!==Y||e[80]!==W||e[81]!==q?(U=o.jsxs("div",{className:W,children:[q,Y]}),e[79]=Y,e[80]=W,e[81]=q,e[82]=U):U=e[82];let Q;e[83]!==r||e[84]!==_||e[85]!==E||e[86]!==h||e[87]!==l||e[88]!==u||e[89]!==$||e[90]!==B||e[91]!==m?(Q=o.jsx(Qs,{className:"min-h-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:o.jsx("div",{className:"mx-auto max-w-2xl",children:B?o.jsx(Zo,{schema:B,value:h,onChange:ae=>k(ae),basePath:"",breadcrumbPath:_,onBreadcrumbChange:v,meta:l,decofile:r,onSaveReferencedBlock:u,sandbox:$},E):o.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:m("sandbox.availableSectionEditor.noEditableFields")})})})}),e[83]=r,e[84]=_,e[85]=E,e[86]=h,e[87]=l,e[88]=u,e[89]=$,e[90]=B,e[91]=m,e[92]=Q):Q=e[92];let oe;e[93]!==U||e[94]!==Q||e[95]!==z?(oe=o.jsxs("div",{className:z,children:[U,Q]}),e[93]=U,e[94]=Q,e[95]=z,e[96]=oe):oe=e[96];let ee;e[97]!==f||e[98]!==C||e[99]!==g||e[100]!==T?(ee=o.jsx(Ji,{open:T,onOpenChange:D,defaultBlockId:f,isPending:g,onSubmit:C}),e[97]=f,e[98]=C,e[99]=g,e[100]=T,e[101]=ee):ee=e[101];let ie;return e[102]!==oe||e[103]!==ee||e[104]!==O?(ie=o.jsxs("div",{className:O,children:[oe,ee]}),e[102]=oe,e[103]=ee,e[104]=O,e[105]=ie):ie=e[105],ie}function du(t){return t+1}function uu(t,e){const s={__resolveType:t},n=er([s],e)[0];return n?tr(s,n,e):null}function fu({orgSlug:t,virtualMcpId:e,branch:s,previewUrl:n,meta:a,decofile:i,blockKey:l,onSaveReferencedBlock:r}){const c=Ce(),d=Ys(),f=d?.virtualMcpId,p=oa(f===e?e:null)?.metadata?.siteSlug??null,[u]=F.useState(()=>uu(l,i)),[m,x]=F.useState(u?.data??{}),[S,N]=F.useState([]),[j,b]=F.useState(0),[h,k]=F.useState(!1),[A,_]=F.useState(null),v=A!==null,{save:E,flush:L}=Xi({orgSlug:t,virtualMcpId:e,branch:s}),T=u?.resolveType?$n(u.resolveType,a):null,D=i[l],P=D?yr(l,D):l,B=d?.taskId??null,C={orgSlug:t,virtualMcpId:e,branch:s,threadId:B,previewUrl:n??void 0,siteSlug:p},$=z=>{x(z),E(l,z)},V=()=>{v?(_(null),k(!1),b(z=>z+1)):_(JSON.stringify(m,null,2))},I=z=>{const O=z??"";try{const Y=JSON.parse(O);if(Y&&typeof Y=="object"&&!Array.isArray(Y)){k(!1),$(Y);return}k(!0)}catch{k(!0)}},W=[P,...S],q=z=>{N(S.slice(0,z)),b(O=>O+1)};return o.jsx("div",{className:"flex h-full w-full min-w-0",children:o.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[o.jsx(Zi,{crumbs:W,onSelect:q}),o.jsxs("div",{className:"shrink-0 border-b px-3 py-2.5",children:[o.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[o.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:Fn},"aria-hidden":!0}),o.jsx("div",{className:"flex-1"}),o.jsxs(Ye,{children:[o.jsx(qe,{asChild:!0,children:o.jsx(Oe,{variant:v?"default":"ghost",size:"icon",className:"size-8 shrink-0",onClick:V,"aria-label":c(v?"sandbox.savedSectionEditor.closeJsonEditor":"sandbox.savedSectionEditor.editAsJson"),"aria-pressed":v,children:v?o.jsx(En,{size:14}):o.jsx(zo,{size:14})})}),o.jsx(We,{side:"bottom",children:c(v?"sandbox.savedSectionEditor.closeJsonEditor":"sandbox.savedSectionEditor.editAsJson")})]})]}),o.jsx("p",{className:"mt-1.5 py-1 pl-1 text-sm leading-snug text-muted-foreground",children:c("sandbox.savedSectionEditor.globalSectionDescription")})]}),o.jsxs("div",{className:"relative min-h-0 flex-1",children:[o.jsx(Qs,{className:"h-full [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:o.jsx("div",{className:"mx-auto max-w-2xl",children:T?o.jsx(Zo,{schema:T,value:m,onChange:z=>$(z),basePath:"",breadcrumbPath:S,onBreadcrumbChange:N,meta:a,decofile:i,onSaveReferencedBlock:r,sandbox:C},j):o.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:c("sandbox.savedSectionEditor.noEditableFields")})})})}),A!==null&&o.jsxs("div",{className:"absolute inset-0 flex flex-col bg-background",children:[h&&o.jsx("div",{className:"shrink-0 border-b bg-destructive/10 px-3 py-1.5 text-xs text-destructive",children:c("sandbox.savedSectionEditor.invalidJsonError")}),o.jsx("div",{className:"min-h-0 flex-1",children:o.jsx(na,{language:"json",height:"100%",code:A,onChange:I,onSave:z=>{I(z),L()}})})]})]})]})})}function mu(t){const e=re.c(36),{selection:s,orgSlug:n,virtualMcpId:a,branch:i,previewUrl:l,meta:r,decofile:c,isCreating:d,onCreateAvailable:f,onSaveReferencedBlock:g}=t,p=Ce();if(!s){let x;e[0]!==p?(x=p("sandbox.sectionsRightPane.selectSectionTitle"),e[0]=p,e[1]=x):x=e[1];let S;e[2]!==p?(S=p("sandbox.sectionsRightPane.selectSectionDescription"),e[2]=p,e[3]=S):S=e[3];let N;return e[4]!==x||e[5]!==S?(N=o.jsx(it,{title:x,description:S}),e[4]=x,e[5]=S,e[6]=N):N=e[6],N}if(s.collection==="available-section"){const x=`available:${s.resolveType}`,S=s.resolveType,N=s.title;let j;e[7]!==s.title?(j=sr(s.title),e[7]=s.title,e[8]=j):j=e[8];let b;e[9]!==f||e[10]!==s.resolveType?(b=(k,A)=>f(s.resolveType,k,A),e[9]=f,e[10]=s.resolveType,e[11]=b):b=e[11];let h;return e[12]!==i||e[13]!==c||e[14]!==d||e[15]!==r||e[16]!==g||e[17]!==n||e[18]!==l||e[19]!==s.resolveType||e[20]!==s.title||e[21]!==x||e[22]!==j||e[23]!==b||e[24]!==a?(h=o.jsx(cu,{orgSlug:n,virtualMcpId:a,branch:i,previewUrl:l,meta:r,decofile:c,resolveType:S,title:N,defaultBlockId:j,isCreating:d,onCreate:b,onSaveReferencedBlock:g},x),e[12]=i,e[13]=c,e[14]=d,e[15]=r,e[16]=g,e[17]=n,e[18]=l,e[19]=s.resolveType,e[20]=s.title,e[21]=x,e[22]=j,e[23]=b,e[24]=a,e[25]=h):h=e[25],h}const u=`saved:${s.key}`;let m;return e[26]!==i||e[27]!==c||e[28]!==r||e[29]!==g||e[30]!==n||e[31]!==l||e[32]!==s.key||e[33]!==u||e[34]!==a?(m=o.jsx(fu,{orgSlug:n,virtualMcpId:a,branch:i,previewUrl:l,meta:r,decofile:c,blockKey:s.key,onSaveReferencedBlock:g},u),e[26]=i,e[27]=c,e[28]=r,e[29]=g,e[30]=n,e[31]=l,e[32]=s.key,e[33]=u,e[34]=a,e[35]=m):m=e[35],m}function As(t){const e=re.c(34),{onDuplicate:s,onRename:n,onAddVariant:a,onEditSeo:i,onViewJson:l,onDelete:r}=t,c=Ce();let d;e[0]!==c?(d=c("sandbox.itemActions.moreActions"),e[0]=c,e[1]=d):d=e[1];let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=o.jsx(ei,{size:14}),e[2]=f):f=e[2];let g;e[3]!==d?(g=o.jsx(Os,{asChild:!0,children:o.jsx("button",{type:"button","aria-label":d,className:"flex h-7 w-7 items-center justify-center rounded-lg text-muted-foreground hover:bg-background hover:text-foreground cursor-pointer",onClick:pu,children:f})}),e[3]=d,e[4]=g):g=e[4];let p;e[5]!==n||e[6]!==c?(p=n&&o.jsxs(Xe,{onClick:n,children:[o.jsx(Wr,{size:14}),c("sandbox.itemActions.rename")]}),e[5]=n,e[6]=c,e[7]=p):p=e[7];let u;e[8]!==s||e[9]!==c?(u=s&&o.jsxs(Xe,{onClick:s,children:[o.jsx(In,{size:14}),c("sandbox.itemActions.duplicate")]}),e[8]=s,e[9]=c,e[10]=u):u=e[10];let m;e[11]!==a||e[12]!==c?(m=a&&o.jsxs(o.Fragment,{children:[o.jsx(mn,{}),o.jsxs(Xe,{onClick:a,className:"cursor-pointer text-success focus:text-success",children:[o.jsx(Mo,{size:14}),c("sandbox.itemActions.addVariant")]})]}),e[11]=a,e[12]=c,e[13]=m):m=e[13];let x;e[14]!==i||e[15]!==l||e[16]!==c?(x=(i||l)&&o.jsxs(o.Fragment,{children:[o.jsx(mn,{}),i&&o.jsxs(Xe,{onClick:i,children:[o.jsx(Io,{size:14}),c("sandbox.itemActions.editSeo")]}),l&&o.jsxs(Xe,{onClick:l,children:[o.jsx(zo,{size:14}),c("sandbox.itemActions.viewJson")]})]}),e[14]=i,e[15]=l,e[16]=c,e[17]=x):x=e[17];let S;e[18]===Symbol.for("react.memo_cache_sentinel")?(S=o.jsx(mn,{}),e[18]=S):S=e[18];let N;e[19]===Symbol.for("react.memo_cache_sentinel")?(N=o.jsx(Kn,{size:14}),e[19]=N):N=e[19];let j;e[20]!==c?(j=c("sandbox.itemActions.delete"),e[20]=c,e[21]=j):j=e[21];let b;e[22]!==r||e[23]!==j?(b=o.jsxs(Xe,{onClick:r,className:"text-destructive focus:text-destructive",children:[N,j]}),e[22]=r,e[23]=j,e[24]=b):b=e[24];let h;e[25]!==b||e[26]!==p||e[27]!==u||e[28]!==m||e[29]!==x?(h=o.jsxs(Ls,{align:"end",className:"w-44",children:[p,u,m,x,S,b]}),e[25]=b,e[26]=p,e[27]=u,e[28]=m,e[29]=x,e[30]=h):h=e[30];let k;return e[31]!==h||e[32]!==g?(k=o.jsxs($s,{children:[g,h]}),e[31]=h,e[32]=g,e[33]=k):k=e[33],k}function pu(t){return t.stopPropagation()}const Ha=4;function nn(t){const e=new Map;for(const s of t)s.slug&&!e.has(s.slug)&&e.set(s.slug,s);return e}function on(t,e){const s=t.parentSlug;if(!t.slug||!s||s===t.slug)return;const n=e.get(s);return n===t?void 0:n}function qa(t,e){const s=nn(e),n=[],a=new Set;let i=s.get(t);for(;i&&!a.has(i.slug??"")&&(a.add(i.slug??""),n.push(i),!(n.length>=Ha));)i=on(i,s);return n.reverse()}function Wa(t,e){const s=new Map;for(const n of t){const a=on(n,e);if(!a?.slug)continue;const i=s.get(a);i?i.push(n):s.set(a,[n])}for(const n of s.values())n.sort((a,i)=>a.label.localeCompare(i.label));return s}function fm(t,e){const s=nn(e),n=Wa(e,s),a=new Set([t]),i=s.get(t);let l=i?[i]:[];for(;l.length;){const r=[];for(const c of l)for(const d of n.get(c)??[])d.slug&&!a.has(d.slug)&&(a.add(d.slug),r.push(d));l=r}return a.delete(t),a}function mm(t,e){if(!t)return[];const s=nn(e),n=qa(t,e),a=n[0];return!a||on(a,s)?[t]:n.map(i=>i.slug??"")}function gu(t){const e=nn(t),s=Wa(t,e),n=new Set,a=[],i=(r,c)=>{if(!n.has(r)&&(n.add(r),a.push({entry:r,depth:c}),!(c+1>=Ha)))for(const d of s.get(r)??[])i(d,c+1)},l=t.filter(r=>!on(r,e)).sort((r,c)=>r.label.localeCompare(c.label));for(const r of l)i(r,0);for(const r of t)i(r,0);return a}function hu(t){return t.split("/").pop()?.replace(/\.tsx?$/,"")||t||"Section"}function xu(t){const e=new Map;for(const s of t){const n=hu(s.resolveType),a=e.get(n);a?a.push(s):e.set(n,[s])}return[...e.entries()].map(([s,n])=>({label:s,sections:n})).sort((s,n)=>s.label.localeCompare(n.label))}function Ao(t){const e=re.c(8),{icon:s,label:n,className:a}=t;let i;e[0]!==a?(i=ve("flex items-center gap-1.5 px-2.5 pb-1 pt-1 text-xs font-medium text-muted-foreground/70",a),e[0]=a,e[1]=i):i=e[1];let l;e[2]!==s?(l=o.jsx(s,{size:13,className:"shrink-0"}),e[2]=s,e[3]=l):l=e[3];let r;return e[4]!==n||e[5]!==i||e[6]!==l?(r=o.jsxs("div",{className:i,children:[l,n]}),e[4]=n,e[5]=i,e[6]=l,e[7]=r):r=e[7],r}const Eo=F.lazy(()=>Ge(()=>import("./app-editor-Hif319cO.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166])).then(t=>({default:t.AppEditor}))),bu=F.lazy(()=>Ge(()=>import("./cms-settings-editor-CK28ljtG.js"),__vite__mapDeps([167,1,2,28,27,29,30,31,32,33,34,35,36,37,38,26,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,58,59,60,61,62,63,64,65,66,21,67,4,5,6,7,8,9,68,69,70,71,18,11,12,13,14,15,16,17,3,10,19,20,22,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,24,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,0,23,25,57,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166])).then(t=>({default:t.CmsSettingsEditor}))),yu=F.lazy(()=>Ge(()=>import("./post-editor-D6Q9G6HD.js"),__vite__mapDeps([168,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,28,27,29,30,31,32,33,34,35,36,37,38,26,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,159,63,169,130,99,77,78,101,94,150,122,57,58,59,60,61,62,64,65,66,67,68,69,70,71,72,73,74,75,76,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,24,95,96,97,98,100,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,123,124,125,126,127,128,129,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,23,151,152,153,154,155,156,157,158,160,161,162,170,163,171,172,173,164,174,175,165,166])).then(t=>({default:t.PostEditor}))),vu=F.lazy(()=>Ge(()=>import("./record-editor-CCo2C6Wx.js"),__vite__mapDeps([176,1,2,63,93,24,69,37,122,57,58,59,60,61,62,64,65,66,39,34,21,67,4,5,6,7,8,9,68,27,28,29,30,31,32,33,35,36,38,26,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,70,71,18,11,12,13,14,15,16,17,3,10,19,20,22,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,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,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,23,151,152,153,154,155,156,157,158,159,160,161,162,173,175,164,165,166])).then(t=>({default:t.RecordEditor}))),ju=F.lazy(()=>Ge(()=>import("./context-DQMyTLF9.js"),__vite__mapDeps([177,1,2,11,8,9,12,13,14,15,16,17,27,28,29,30,31,32,33,34,35,36,37,38,26,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,130,63,150,122,101,19,57,58,59,60,61,62,64,65,66,21,67,4,5,6,7,68,69,70,71,18,3,10,20,22,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,24,94,95,96,97,98,99,100,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,123,124,125,126,127,128,129,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,23,151,152,153,154,155,156,157,158,159,160,161,162,175,178,172,179,164,171,165,166])).then(t=>({default:t.BlogContext}))),Su=F.lazy(()=>Ge(()=>import("./category-editor-C1SS3xs8.js"),__vite__mapDeps([180,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,28,32,34,26,159,63,93,24,69,37,173,27,29,30,31,33,35,36,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,64,65,66,67,68,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,23,151,152,153,154,155,156,157,158,160,161,162,170,163,171,172,174,175,164,165,166])).then(t=>({default:t.CategoryEditor}))),ku=F.lazy(()=>Ge(()=>import("./sections-editor-DIXfWh89.js"),__vite__mapDeps([181,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,57,58,59,60,61,62,63,64,65,66,39,34,67,68,69,27,28,29,30,31,32,33,35,36,37,38,26,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,24,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,23,151,152,153,154,155,156,157,158,159,160,161,162,164,25,163,182,183])).then(t=>({default:t.SectionsEditor}))),wu=F.lazy(()=>Ge(()=>import("./seo-editor-BlwDgWbu.js"),__vite__mapDeps([184,1,2,27,28,29,30,31,32,33,34,35,36,37,38,26,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,23,24,57,58,59,60,61,62,63,64,65,66,21,67,4,5,6,7,8,9,68,69,70,71,18,11,12,13,14,15,16,17,3,10,19,20,22,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,182])).then(t=>({default:t.SeoEditor}))),Cu=F.lazy(()=>Ge(()=>import("./variant-calendar-CHK_OU2h.js"),__vite__mapDeps([185,1,2,27,28,29,30,31,32,33,34,35,36,37,38,26,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,63,23,24,150,68,69,157,22,16,15,3,4,5,6,7,8,9,10,11,12,13,14,17,18,19,20,21,159,58,59,60,61,62,64,65,66,67,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,57,147,148,149,151,152,153,154,155,156,158,160,161,162,164,165,166])).then(t=>({default:t.VariantCalendar}))),Nu=F.lazy(()=>Ge(()=>import("./post-calendar-BBgMihhC.js"),__vite__mapDeps([186,1,2,27,28,29,30,31,32,33,34,35,36,37,38,26,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,23,24,22,16,15,3,4,5,6,7,8,9,10,11,12,13,14,17,18,19,20,21,159,68,69,58,59,60,61,62,63,64,65,66,67,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,57,147,148,149,150,151,152,153,154,155,156,157,158,160,161,162,164,165,166])).then(t=>({default:t.PostCalendar}))),_u=F.lazy(()=>Ge(()=>import("./redirect-editor-DIAc_1Im.js"),__vite__mapDeps([187,1,2,99,63,93,24,69,37,57,58,59,60,61,62,64,65,66,39,34,21,67,4,5,6,7,8,9,68,27,28,29,30,31,32,33,35,36,38,26,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,70,71,18,11,12,13,14,15,16,17,3,10,19,20,22,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,94,95,96,97,98,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,23,151,152,153,154,155,156,157,158,159,160,161,162,175])).then(t=>({default:t.RedirectEditor})));function Pu(t,e){return t==="context"&&!e?"posts":t}function Tu(t){const e=re.c(30),{deepLinkPage:s}=t,{currentBranch:n,virtualMcpId:a}=$o(),{org:i}=ti(),l=Or(),r=Lr(),{runtime:c,previewServerUrl:d}=sa(a),f=c==="cms",g=Ln(a,n);let p,u;e[0]!==g||e[1]!==f||e[2]!==r.previewState||e[3]!==l.lifecycle.phase?(p=Wo(g),u=gl({fastPreviewActive:f||p,previewState:r.previewState,lifecyclePhase:l.lifecycle.phase}),e[0]=g,e[1]=f,e[2]=r.previewState,e[3]=l.lifecycle.phase,e[4]=p,e[5]=u):(p=e[4],u=e[5]);const m=u;if(m.kind==="sandbox-card"){const j=`/${i.slug}/settings/connections`;let b;return e[6]!==m.state||e[7]!==r.start||e[8]!==j||e[9]!==l.lifecycle||e[10]!==l.phase?(b=o.jsx(ml,{state:m.state,claimPhase:l.phase,lifecycle:l.lifecycle,onStart:r.start,connectionsHref:j}),e[6]=m.state,e[7]=r.start,e[8]=j,e[9]=l.lifecycle,e[10]=l.phase,e[11]=b):b=e[11],b}if(!a||!n){let j;return e[12]===Symbol.for("react.memo_cache_sentinel")?(j=o.jsx(it,{title:"Waiting for sandbox context…"}),e[12]=j):j=e[12],j}if(nr(g)){let j;return e[13]===Symbol.for("react.memo_cache_sentinel")?(j=o.jsx(ir,{}),e[13]=j):j=e[13],j}if(g.kind==="pending"){let j;return e[14]!==g?(j=o.jsx(rr,{backend:g}),e[14]=g,e[15]=j):j=e[15],j}const x=p?null:r.previewUrl;let S;e[16]!==g||e[17]!==f||e[18]!==r.previewUrl||e[19]!==d?(S=g.kind==="protocol"&&g.source==="local"?Ei(g):f?d:r.previewUrl,e[16]=g,e[17]=f,e[18]=r.previewUrl,e[19]=d,e[20]=S):S=e[20];let N;return e[21]!==n||e[22]!==s||e[23]!==m.devServerReady||e[24]!==m.sandboxWarming||e[25]!==i.slug||e[26]!==x||e[27]!==S||e[28]!==a?(N=o.jsx(Eu,{orgSlug:i.slug,virtualMcpId:a,branch:n,previewUrl:x,sitePreviewUrl:S,deepLinkPage:s,devServerReady:m.devServerReady,sandboxWarming:m.sandboxWarming}),e[21]=n,e[22]=s,e[23]=m.devServerReady,e[24]=m.sandboxWarming,e[25]=i.slug,e[26]=x,e[27]=S,e[28]=a,e[29]=N):N=e[29],N}const Do=2e3,Au=15;function Bo(t,e,s,n){return typeof e!="string"||s&&(ia(e,s,n)||t.state.dataUpdateCount>=Au)?!1:Do}function Eu({orgSlug:t,virtualMcpId:e,branch:s,previewUrl:n,sitePreviewUrl:a,deepLinkPage:i,devServerReady:l,sandboxWarming:r}){const c=Ce(),d=Ys()?.taskId??null,f={orgSlug:t,virtualMcpId:e,branch:s,threadId:d,previewUrl:n},g=!Wo(Ln(e,s)),p=or()===void 0,{data:u,isLoading:m}=Di(f,{fetchEnabled:l}),x=Oo({strict:!1}),[S,N]=F.useState(()=>x.contentCollection&&lt(x.contentCollection)&&x.contentCollection||"pages"),j=aa(),b=Pu(S,j),[h,k]=F.useState(()=>x.contentItem&&lt(b)?{collection:b,key:x.contentItem}:null),[A,_]=F.useState(null),{data:v,isLoading:E,isFetching:L}=ar(f,{fetchEnabled:l,refetchInterval:y=>{const H=y.state.data;if(b==="apps"&&h&&h.collection==="apps"){const Z=u?.[h.key];return Bo(y,typeof Z?.__resolveType=="string"?Z.__resolveType:void 0,H)}if(b==="site"&&u){const Z=H?so(u,H):null,ue=u.site,Se=Z?.resolveType??(typeof ue?.__resolveType=="string"?ue.__resolveType:void 0);return Bo(y,Se,H,["seo"])}return!1}}),T=!!(i?.pageId||i?.path||i?.pathTemplate),[D,P]=F.useState(!1);if(T&&!D&&h===null&&u&&!E){P(!0);const y=vr(to(u,v),i??{});y&&(N("pages"),k({collection:"pages",key:y.key,path:y.path}))}const[B,C]=F.useState(""),[$,V]=F.useState("list"),I=y=>{k(y),_(null)},[W,q]=F.useState(b);W!==b&&(q(b),C(""));const z=(y,H)=>!ia(y,v,H)&&(E||L),{catalog:O,isLoading:Y}=ll(v??void 0,u??void 0,{enabled:g&&b==="apps"}),U=Js(f),Q=Tr(f),oe=sd({orgSlug:t,virtualMcpId:e,branch:s,decofile:u??{},onMoved:(y,H)=>k(Z=>Z?.collection==="posts"&&Z.key===y?{collection:"posts",key:H}:Z)}),[ee,ie]=F.useState(null),[ae,le]=F.useState(),[ce,fe]=F.useState(!1),[te,de]=F.useState(),[X,ne]=F.useState(null),[J,w]=F.useState(null),[M,me]=F.useState(null),ge=!u||!v;if(m||E||p||ge&&r)return o.jsx("div",{className:"h-full w-full flex items-center justify-center",children:o.jsx(dt,{className:"size-5 text-muted-foreground"})});if(ge)return o.jsx(it,{title:"Could not load site data."});if(Bi(v))return o.jsx(lr,{orgSlug:t,virtualMcpId:e,branch:s,decofile:u});const he=to(u,v).sort((y,H)=>y.name.localeCompare(H.name)),ye=jr(u).sort((y,H)=>y.from.localeCompare(H.from)),_e=Sr(u,v),Pe=b==="sections"?kr(v):[],Te=so(u,v),we=ma(u),Ee=zn.some(y=>we[y].length>0),De=lt(b)?we[b]:[],xe=eo(v,"loaders"),Ae=eo(v,"actions"),Re=g?["settings"]:["apps",...Te?[]:["site"],...Ae===0?["actions"]:[],...Zr(v)?[]:["settings"]];if(!wr(u,v)&&!Ee&&xe===0&&Ae===0)return o.jsx(it,{icon:is,title:"No editable content",description:"This project doesn't expose any Deco pages, sections, apps, loaders, or actions."});const G={pages:he.length,sections:_e.length,apps:g?O.length:0,loaders:xe,actions:Ae,redirects:ye.length,posts:we.posts.length,authors:we.authors.length,categories:we.categories.length},be=new Set(he.map(y=>Es(y.path))),ke=new Set(he.map(y=>y.name)),Le=new Set(_e.map(y=>y.name)),gt=async y=>{const H=u[y.key];if(!H)return;const Z=ea(u,y.key),ue=Cr(u,y.key,Math.max(0,Z-1)),Se=Nr(H.sections,ue);if(Se)try{await U.mutateAsync({blockKey:y.key,data:{...H,sections:Se}}),pe.success(`Variant added to "${y.name}"`),k({collection:"pages",key:y.key,path:y.path})}catch(Ne){pe.error(Ne instanceof Error?Ne.message:"Could not add variant")}},an=()=>{le(void 0),ie({mode:"create",sourceKey:null,initialName:"My new page",initialPath:"/example"})},rn=y=>{le(void 0),ie({mode:"duplicate",sourceKey:y.key,initialName:co(ke,y.name),initialPath:hl(be,y.path)})},ht=y=>{le(void 0),ie({mode:"rename",sourceKey:y.key,initialName:y.name,initialPath:y.path})},ln=async y=>{if(!ee)return;const{mode:H,sourceKey:Z}=ee;try{if(H==="create"){let ue;if(y.templateKey){const Ne=u[y.templateKey];if(!Ne)throw new Error("Selected template no longer exists.");ue={...Ne,name:y.name,path:y.path}}else ue=yl(y.name,y.path);const Se=jl(u,y.name);await U.mutateAsync({blockKey:Se,data:ue}),pe.success(`Created "${y.name}"`),k({collection:"pages",key:Se,path:y.path})}else if(H==="duplicate"&&Z){const ue=u[Z];if(!ue)throw new Error("Source page not found");const{key:Se,data:Ne}=bl({source:ue,pages:he,newName:y.name,newPath:y.path});await U.mutateAsync({blockKey:Se,data:Ne}),pe.success(`Duplicated as "${y.name}"`),k({collection:"pages",key:Se,path:y.path})}else if(H==="rename"&&Z){const ue=u[Z];if(!ue)throw new Error("Page not found");const Se={...ue,name:y.name,path:y.path};await U.mutateAsync({blockKey:Z,data:Se}),pe.success("Page updated"),h?.collection==="pages"&&h.key===Z&&k({collection:"pages",key:Z,path:y.path})}ie(null)}catch(ue){le(ue instanceof Error?ue.message:"Save failed")}},xt=({path:y})=>{if(!ee)return null;const H=Es(y);return(ee.mode==="rename"?Es(ee.initialPath):null)!==H&&be.has(H)?`A page with path "${y}" already exists.`:null},cn=async(y,H,Z)=>{await U.mutateAsync({blockKey:H,data:{...Z,name:H,__resolveType:y}}),pe.success(c("sandbox.contentBrowser.createdSection",{name:H})),k({collection:"sections",key:H})},bt=Xo((y,H)=>U.mutate({blockKey:y,data:H})),yt=async y=>{const H=u[y.key];if(!H){pe.error(c("sandbox.contentBrowser.sectionNotFound"));return}const Z=xl(u,y.key),ue=co(Le,y.name),Se={...H,name:ue};try{await U.mutateAsync({blockKey:Z,data:Se}),pe.success(c("sandbox.contentBrowser.duplicatedSection",{name:y.name})),k({collection:"sections",key:Z})}catch(Ne){pe.error(Ne instanceof Error?Ne.message:c("sandbox.contentBrowser.duplicateFailed"))}},dn=async y=>{if(!X)return;const H=u[X];if(!H){pe.error(c("sandbox.contentBrowser.sectionNotFound"));return}try{await U.mutateAsync({blockKey:X,data:{...H,name:y}}),pe.success(c("sandbox.contentBrowser.sectionRenamed")),ne(null)}catch(Z){pe.error(Z instanceof Error?Z.message:c("sandbox.contentBrowser.renameFailed"))}},Jt=()=>{de(void 0),fe(!0)},tt=async y=>{const H=_r(u,y.from),Z=Pr(y);try{await U.mutateAsync({blockKey:H,data:Z}),pe.success("Created redirect"),fe(!1),k({collection:"redirects",key:H})}catch(ue){de(ue instanceof Error?ue.message:"Could not create redirect")}},vt=async y=>{const H=vn(u,y),Z=Gt(H,y,Sa(y));try{await U.mutateAsync({blockKey:H,data:Z}),pe.success(`Created ${os[y]}`),k({collection:y,key:H})}catch(ue){pe.error(ue instanceof Error?ue.message:"Could not create")}},st=async y=>{const H=vn(u,"posts"),Z=Gt(H,"posts",Qc(y));try{await U.mutateAsync({blockKey:H,data:Z}),pe.success(c("sandbox.postCalendar.createdScheduledPost")),N("posts"),q("posts"),k({collection:"posts",key:H}),_(null)}catch(ue){pe.error(ue instanceof Error?ue.message:c("sandbox.postCalendar.couldNotCreate"))}},nt=async(y,H)=>{const Z=u[y],ue=Z?Xc(ut(Z,"posts"),H):null;if(!ue){pe.error(c("sandbox.postCalendar.onlyScheduledCanMove"));return}try{await U.mutateAsync({blockKey:y,data:Gt(y,"posts",ue)})}catch(Se){pe.error(Se instanceof Error?Se.message:c("sandbox.postCalendar.couldNotReschedule"))}},Xt=async y=>{const H=u[y.key];if(!H){pe.error("Record not found.");return}const Z=vn(u,y.kind),ue=y.kind==="posts"?"title":"name",Se={...structuredClone(ut(H,y.kind)),[ue]:`${y.label} (copy)`};if(y.kind==="categories"){const Ne=we.categories.map(Qe=>Qe.slug??"").filter(Boolean);Se.slug=qc(String(Se.slug??""),Ne)}try{await U.mutateAsync({blockKey:Z,data:Gt(Z,y.kind,Se)}),pe.success(`Duplicated "${y.label}"`),k({collection:y.kind,key:Z})}catch(Ne){pe.error(Ne instanceof Error?Ne.message:"Duplicate failed")}},ot=()=>{N("posts"),q("posts"),k(null),_(null),C("")},jt=async()=>{if(J)try{const{kind:y,key:H,label:Z}=J;if(y==="blog"){if(J.blogKind==="categories"){const ue=ut(u[H],"categories").slug,Se=typeof ue=="string"?ue:"";if(Se)for(const{key:Ne,payload:Qe}of ja(u)){const Je=ic(Qe,Se);Je!==Qe&&await U.mutateAsync({blockKey:Ne,data:sc(Ne,rc(Je))})}}await Q.mutateAsync({blockKey:H})}else await Q.mutateAsync({blockKey:H});pe.success(`Deleted "${Z}"`),h&&h.collection!=="available-section"&&h.key===H&&k(null),w(null)}catch(y){pe.error(y instanceof Error?y.message:"Delete failed")}},ze=Q.isPending||U.isPending,at=J?.kind==="blog"?os[J.blogKind]:J?.kind??"item";return o.jsxs("div",{className:"flex h-full w-full",children:[o.jsx(ul,{active:b,counts:G,hidden:Re,showBlog:Ee,showContext:j,onSelect:y=>{N(y),k(null),_(null)}}),b!=="seo"&&b!=="site"&&b!=="settings"&&b!=="context"&&b!=="calendar"&&b!=="post-schedule"&&b!=="posts"&&b!=="loaders"&&b!=="actions"&&o.jsx(Du,{activeCollection:b,pages:he,redirects:ye,sections:_e,availableSections:Pe,appCatalog:O,appCatalogLoading:Y,blogEntries:De,decofile:u,searchQuery:B,onSearchChange:C,selection:h,onSelect:I,onCreate:()=>{b==="pages"?an():b==="redirects"?Jt():lt(b)&&vt(b)},onDuplicatePage:rn,onRenamePage:ht,onAddPageVariant:gt,onDeletePage:y=>w({kind:"page",key:y.key,label:y.name}),onEditPageSeo:y=>{const H={collection:"pages",key:y.key,path:y.path};k(H),_(y.key)},onViewPageJson:y=>me(y.key),onDuplicateSection:yt,onRenameSection:y=>ne(y.key),onDeleteSection:y=>w({kind:"section",key:y.key,label:y.name}),onDeleteRedirect:y=>w({kind:"redirect",key:y.key,label:y.from||y.key}),onDuplicateBlog:Xt,onDeleteBlog:y=>w({kind:"blog",blogKind:y.kind,key:y.key,label:y.label})}),o.jsx("div",{className:"flex-1 min-w-0",children:b==="loaders"||b==="actions"?o.jsx(Zd,{orgSlug:t,virtualMcpId:e,branch:s,previewUrl:n,meta:v,decofile:u,kind:b}):o.jsx(F.Suspense,{fallback:o.jsx("div",{className:"h-full flex items-center justify-center",children:o.jsx(dt,{className:"size-5 text-muted-foreground"})}),children:b==="calendar"?o.jsx(Cu,{decofile:u}):b==="post-schedule"?o.jsx(Nu,{decofile:u,isCreating:U.isPending,onCreate:y=>{st(y)},onReschedule:(y,H)=>{nt(y,H)},onSelect:y=>{N("posts"),q("posts"),k({collection:"posts",key:y}),_(null)}}):b==="site"?Te?o.jsx(Eo,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:Te.key,block:u[Te.key],decofile:u,meta:v,title:"Site",excludeFields:["seo"],schemaPending:z(Te.resolveType,["seo"]),previewBaseUrl:n},`site:${Te.key}`):o.jsx(it,{title:"Site settings not found",description:"This project doesn't have a site app block (site/apps/site.ts)."}):b==="settings"?o.jsx(bu,{orgSlug:t,virtualMcpId:e,branch:s,decofile:u,meta:v}):b==="context"?o.jsx(ju,{orgSlug:t,virtualMcpId:e,branch:s,decofile:u,meta:v}):b==="seo"?o.jsx(wu,{orgSlug:t,virtualMcpId:e,branch:s,decofile:u,meta:v,target:{kind:"site"},previewBaseUrl:a}):b==="sections"?o.jsx(mu,{selection:h?.collection==="sections"||h?.collection==="available-section"?h:null,orgSlug:t,virtualMcpId:e,branch:s,previewUrl:n,meta:v,decofile:u,isCreating:U.isPending,onCreateAvailable:cn,onSaveReferencedBlock:bt}):b==="posts"?o.jsx(Id,{orgSlug:t,virtualMcpId:e,branch:s,decofile:u,view:$,selectedKey:h?.collection==="posts"?h.key:null,onViewChange:y=>{V(y),k(null)},onClose:()=>k(null),onOpen:y=>{k({collection:"posts",key:y}),_(null)},move:oe,meta:v,renderDetail:(y,H)=>o.jsx(yu,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:y,block:u[y],decofile:u,meta:v,previewBaseUrl:a,move:oe,onClose:H?.onClose,expanded:H?.expanded,onToggleExpand:H?.onToggleExpand},`post:${as(y)}`)}):h&&h.collection!=="available-section"?h.collection==="apps"?o.jsx(Eo,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:h.key,block:u[h.key],decofile:u,meta:v,previewBaseUrl:n,schemaPending:z(typeof u[h.key]?.__resolveType=="string"?String(u[h.key].__resolveType):void 0)},`app:${h.key}`):h.collection==="categories"?o.jsx(Su,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:h.key,block:u[h.key],decofile:u,meta:v,onManagePosts:()=>ot(),onOpenPost:y=>{N("posts"),q("posts"),k({collection:"posts",key:y}),_(null)},previewBaseUrl:a},`category:${h.key}`):h.collection==="authors"?o.jsx(vu,{orgSlug:t,virtualMcpId:e,branch:s,kind:"authors",blockKey:h.key,block:u[h.key],meta:v,decofile:u},`authors:${h.key}`):h.collection==="redirects"?o.jsx(_u,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:h.key,block:u[h.key]},`redirect:${h.key}`):o.jsx(ku,{orgSlug:t,virtualMcpId:e,branch:s,previewReady:!0,previewUrl:n??void 0,currentPath:h.collection==="pages"?h.path:"/",activePageBlockKey:h.collection==="pages"?h.key:null,activeGlobalBlockKey:h.collection==="sections"?h.key:null,initialEditSeo:h.collection==="pages"&&A===h.key,onExitSeo:()=>_(null),onSelectRoot:()=>{k(null),_(null)}},h.collection==="pages"?`page:${h.key}`:`section:${h.key}`):o.jsx(it,{title:`Select ${lt(b)?`a ${os[b]}`:b==="pages"?"a page":b==="apps"?"an app":b==="redirects"?"a redirect":"a section"} to edit`,description:b==="apps"?"Browse all apps and select an installed one to edit its settings.":'Pick an item from the list, or click "+" to create one.'})})}),ee&&o.jsx(Cl,{open:!!ee,mode:ee.mode,initialName:ee.initialName,initialPath:ee.initialPath,isPending:U.isPending,error:ae,templates:he,validate:xt,onSubmit:ln,onOpenChange:y=>{y||(ie(null),le(void 0))}}),o.jsx(_l,{open:ce,isPending:U.isPending,error:te,onSubmit:tt,onOpenChange:y=>{y||(fe(!1),de(void 0))}}),X&&o.jsx(Pl,{open:!!X,blockKey:X,initialName:_e.find(y=>y.key===X)?.name??X,isPending:U.isPending,onSubmit:dn,onOpenChange:y=>{y||ne(null)}}),M&&o.jsx(Ar,{open:!!M,onOpenChange:y=>{y||me(null)},pageKey:M,decofile:u,onSave:y=>U.mutateAsync({blockKey:M,data:y})}),o.jsx(pi,{open:!!J,onOpenChange:y=>{!y&&!ze&&w(null)},children:o.jsxs(gi,{children:[o.jsxs(hi,{children:[o.jsx(xi,{children:`Delete ${at}?`}),o.jsx(bi,{children:J?.kind==="section"?`"${J.label}" will be removed. Pages that still reference it will lose this section.`:J?`"${J.label}" will be removed permanently. This can't be undone.`:null})]}),o.jsxs(yi,{children:[o.jsx(vi,{disabled:ze,children:"Cancel"}),o.jsx(ji,{onClick:y=>{y.preventDefault(),jt()},disabled:ze,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:ze?o.jsxs(o.Fragment,{children:[o.jsx(dt,{className:"size-3.5"}),"Deleting…"]}):"Delete"})]})]})})]})}function Du(t){const e=re.c(58),{activeCollection:s,pages:n,redirects:a,sections:i,availableSections:l,appCatalog:r,appCatalogLoading:c,blogEntries:d,decofile:f,searchQuery:g,onSearchChange:p,selection:u,onSelect:m,onCreate:x,onDuplicatePage:S,onRenamePage:N,onAddPageVariant:j,onDeletePage:b,onEditPageSeo:h,onViewPageJson:k,onDuplicateSection:A,onRenameSection:_,onDeleteSection:v,onDeleteRedirect:E,onDuplicateBlog:L,onDeleteBlog:T}=t,D=Ce();let P,B,C,$,V,I;if(e[0]!==s||e[1]!==r||e[2]!==c||e[3]!==l||e[4]!==d||e[5]!==f||e[6]!==j||e[7]!==x||e[8]!==T||e[9]!==b||e[10]!==E||e[11]!==v||e[12]!==L||e[13]!==S||e[14]!==A||e[15]!==h||e[16]!==N||e[17]!==_||e[18]!==p||e[19]!==m||e[20]!==k||e[21]!==n||e[22]!==a||e[23]!==g||e[24]!==i||e[25]!==u||e[26]!==D){const O=g.toLowerCase(),Y=n.filter(w=>!O||w.name.toLowerCase().includes(O)||w.path.toLowerCase().includes(O)),U=a.filter(w=>!O||w.from.toLowerCase().includes(O)||w.to.toLowerCase().includes(O)),Q=i.filter(w=>!O||w.name.toLowerCase().includes(O)||w.key.toLowerCase().includes(O)||w.resolveType.toLowerCase().includes(O)),oe=l.filter(w=>!O||w.title.toLowerCase().includes(O)||w.resolveType.toLowerCase().includes(O)||(w.description?.toLowerCase().includes(O)??!1)),ee=xu(Q),ie=r.filter(w=>!O||w.title.toLowerCase().includes(O)||w.app.toLowerCase().includes(O)||w.vendor.toLowerCase().includes(O)||w.category.toLowerCase().includes(O)),ae=d.filter(w=>!O||w.label.toLowerCase().includes(O)||w.subtitle.toLowerCase().includes(O)),le=s==="categories"&&!O?gu(ae):ae.map(Ou),ce=`Search ${s}…`,fe=lt(s)?`Create new ${os[s]}`:s==="redirects"?"Create new redirect":"Create new page",te=s!=="apps"&&s!=="sections";V="shrink-0 border-r flex flex-col min-h-0 w-[300px]";let de;e[33]===Symbol.for("react.memo_cache_sentinel")?(de=o.jsx(Bn,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),e[33]=de):de=e[33];let X;e[34]!==p?(X=w=>p(w.target.value),e[34]=p,e[35]=X):X=e[35];let ne;e[36]!==ce||e[37]!==g||e[38]!==X?(ne=o.jsxs("div",{className:"flex flex-1 items-center gap-2 pl-1",children:[de,o.jsx("input",{type:"text",value:g,onChange:X,placeholder:ce,"aria-label":ce,className:"w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),e[36]=ce,e[37]=g,e[38]=X,e[39]=ne):ne=e[39];let J;e[40]!==fe||e[41]!==x||e[42]!==te?(J=te&&o.jsxs(Ye,{children:[o.jsx(qe,{asChild:!0,children:o.jsx(Oe,{variant:"ghost",size:"icon",onClick:x,"aria-label":fe,children:o.jsx(On,{size:14})})}),o.jsx(We,{side:"bottom",children:fe})]}),e[40]=fe,e[41]=x,e[42]=te,e[43]=J):J=e[43],e[44]!==ne||e[45]!==J?(I=o.jsxs("div",{className:"px-2 h-12 flex items-center gap-1 border-b shrink-0",children:[ne,J]}),e[44]=ne,e[45]=J,e[46]=I):I=e[46],P=Qs,$="flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",B="flex flex-col gap-1 p-1.5",C=s==="pages"?Y.length===0?o.jsx(es,{hasItems:n.length>0,emptyLabel:"No pages yet.",emptyHint:'Click "+" to create your first page.'}):Y.map(w=>{const M=u?.collection==="pages"&&u.key===w.key,me=ea(f,w.key);return o.jsx(He,{icon:Vo,title:w.name,subtitle:w.path,active:M,variantCount:me,onClick:()=>m({collection:"pages",key:w.key,path:w.path}),menu:o.jsx(As,{onDuplicate:()=>S(w),onRename:()=>N(w),onAddVariant:()=>j(w),onEditSeo:()=>h(w),onViewJson:()=>k(w),onDelete:()=>b(w)})},w.key)}):s==="sections"?Q.length===0&&oe.length===0?o.jsx(es,{hasItems:i.length>0||l.length>0,emptyLabel:"No sections yet.",emptyHint:"Save a section from a page, or start the preview dev server."}):o.jsxs(o.Fragment,{children:[ee.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(Ao,{icon:Fs,label:"Saved sections"}),ee.map(w=>o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx("div",{className:"px-2.5 pt-1 pb-0.5 text-[11px] font-medium uppercase tracking-wide text-muted-foreground/60",children:w.label}),w.sections.map(M=>{const me=u?.collection==="sections"&&u.key===M.key;return o.jsx(He,{icon:Fs,accent:"global",title:M.name,subtitle:w.label,active:me,onClick:()=>m({collection:"sections",key:M.key}),menu:o.jsx(As,{onDuplicate:()=>A(M),onRename:()=>_(M),onDelete:()=>v(M)})},M.key)})]},w.label))]}),oe.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(Ao,{icon:Jn,label:"Available sections",className:ve(ee.length>0&&"mt-3")}),oe.map(w=>{const M=u?.collection==="available-section"&&u.resolveType===w.resolveType,me=w.resolveType.split("/").pop()?.replace(/\.tsx?$/,"");return o.jsx(He,{icon:Jn,title:w.title,subtitle:me??w.resolveType,active:M,onClick:()=>m({collection:"available-section",resolveType:w.resolveType,title:w.title})},w.resolveType)})]})]}):s==="apps"?c?o.jsx("div",{className:"flex items-center justify-center py-8",children:o.jsx(dt,{className:"size-4.5 text-muted-foreground"})}):ie.length===0?o.jsx(es,{hasItems:r.length>0,emptyLabel:"No apps found.",emptyHint:"Try a different search term."}):ie.map(w=>{const M=u?.collection==="apps"&&w.blockKey!==null&&u.key===w.blockKey;return o.jsx(He,{icon:Ho,logoUrl:w.logo,title:w.title,subtitle:w.category,active:M,trailing:w.installed?o.jsx("span",{className:"shrink-0 rounded-full bg-success/15 px-1.5 py-0.5 text-[10px] font-medium text-success",children:"Installed"}):void 0,onClick:()=>{if(!w.installed||!w.blockKey){pe.message(`${w.title} is not installed on this site.`);return}m({collection:"apps",key:w.blockKey})}},w.id)}):s==="redirects"?U.length===0?o.jsx(es,{hasItems:a.length>0,emptyLabel:"No redirects yet.",emptyHint:'Click "+" to create your first redirect.'}):U.map(w=>o.jsx(He,{icon:Ro,title:w.from||"(no source)",subtitle:`→ ${w.to||"(no target)"}`,active:u?.collection==="redirects"&&u.key===w.key,trailing:o.jsx(Tl,{redirect:w}),onClick:()=>m({collection:"redirects",key:w.key}),menu:o.jsx(As,{onDelete:()=>E(w)})},w.key)):ae.length===0?o.jsx(es,{hasItems:d.length>0,emptyLabel:`No ${s} yet.`,emptyHint:`Click "+" to create your first ${lt(s)?os[s]:"item"}.`}):le.map(w=>{const{entry:M,depth:me}=w,ge=u?.collection===M.kind&&u.key===M.key;return o.jsx("div",{style:{paddingLeft:me*16},children:o.jsx(He,{icon:M.kind==="posts"?Uo:M.kind==="authors"?qo:Fo,title:M.label,invalid:M.missing.length>0,invalidReason:M.missing.length>0?D("sandbox.itemRow.missingFields",{fields:Jl(M.missing,D)}):void 0,warning:M.duplicateName,warningReason:D("sandbox.itemRow.duplicateName"),subtitle:me>0?qa(M.slug??"",ae).map(Bu).join(" / "):M.subtitle,active:ge,onClick:()=>m({collection:M.kind,key:M.key}),menu:o.jsx(As,{onDuplicate:()=>L(M),onDelete:()=>T(M)})})},M.key)}),e[0]=s,e[1]=r,e[2]=c,e[3]=l,e[4]=d,e[5]=f,e[6]=j,e[7]=x,e[8]=T,e[9]=b,e[10]=E,e[11]=v,e[12]=L,e[13]=S,e[14]=A,e[15]=h,e[16]=N,e[17]=_,e[18]=p,e[19]=m,e[20]=k,e[21]=n,e[22]=a,e[23]=g,e[24]=i,e[25]=u,e[26]=D,e[27]=P,e[28]=B,e[29]=C,e[30]=$,e[31]=V,e[32]=I}else P=e[27],B=e[28],C=e[29],$=e[30],V=e[31],I=e[32];let W;e[47]!==B||e[48]!==C?(W=o.jsx("div",{className:B,children:C}),e[47]=B,e[48]=C,e[49]=W):W=e[49];let q;e[50]!==P||e[51]!==$||e[52]!==W?(q=o.jsx(P,{className:$,children:W}),e[50]=P,e[51]=$,e[52]=W,e[53]=q):q=e[53];let z;return e[54]!==V||e[55]!==I||e[56]!==q?(z=o.jsxs("div",{className:V,children:[I,q]}),e[54]=V,e[55]=I,e[56]=q,e[57]=z):z=e[57],z}function Bu(t){return t.slug}function Ou(t){return{entry:t,depth:0}}function pm(t){const e=re.c(25),{virtualMcpId:s}=t,n=Ce(),[a,i]=F.useState(!1),l=qr(s),{connection:r}=Oi(s),{activeTask:c}=$o();let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d={strict:!1},e[0]=d):d=e[0];const f=Oo(d);if(!(io(l?.metadata)||io(c?.metadata))&&!r){let u;e[1]===Symbol.for("react.memo_cache_sentinel")?(u=o.jsx("div",{className:"flex size-14 items-center justify-center rounded-full bg-muted",children:o.jsx(ro,{className:"size-7 text-foreground"})}),e[1]=u):u=e[1];let m;e[2]!==n?(m=n("mainPanelTabs.contentTab.noContentToEdit"),e[2]=n,e[3]=m):m=e[3];let x;e[4]!==n?(x=n("mainPanelTabs.contentTab.connectGithubDescription"),e[4]=n,e[5]=x):x=e[5];let S,N;e[6]===Symbol.for("react.memo_cache_sentinel")?(S=()=>i(!0),N=o.jsx(ro,{className:"size-4"}),e[6]=S,e[7]=N):(S=e[6],N=e[7]);let j;e[8]!==n?(j=n("mainPanelTabs.previewTab.connectGithub"),e[8]=n,e[9]=j):j=e[9];let b;e[10]!==j?(b=o.jsxs(Oe,{onClick:S,children:[N,j]}),e[10]=j,e[11]=b):b=e[11];let h;e[12]!==m||e[13]!==x||e[14]!==b?(h=o.jsx(Yr,{className:"h-full",image:u,title:m,description:x,actions:b}),e[12]=m,e[13]=x,e[14]=b,e[15]=h):h=e[15];let k;e[16]!==a?(k=o.jsx(Qr,{open:a,onOpenChange:i,mode:"agent"}),e[16]=a,e[17]=k):k=e[17];let A;return e[18]!==k||e[19]!==h?(A=o.jsxs(o.Fragment,{children:[h,k]}),e[18]=k,e[19]=h,e[20]=A):A=e[20],A}let p;return e[21]!==f.contentPageId||e[22]!==f.contentPath||e[23]!==f.contentPathTemplate?(p=o.jsx(cr,{children:o.jsx(Tu,{deepLinkPage:{pageId:f.contentPageId,path:f.contentPath,pathTemplate:f.contentPathTemplate}})}),e[21]=f.contentPageId,e[22]=f.contentPath,e[23]=f.contentPathTemplate,e[24]=p):p=e[24],p}export{Dl as $,rm as A,dm as B,pm as C,Ef as D,it as E,cm as F,Ml as G,uc as H,nd as I,mc as J,um as K,Ia as L,wa as M,fa as N,Gt as O,Vn as P,Gf as Q,lm as R,wc as S,xc as T,Hf as U,Vf as V,en as W,jc as X,kc as Y,Al as Z,El as _,Af as a,jo as a0,Bl as a1,Ie as a2,Ol as a3,Mf as a4,Kf as a5,zf as a6,Uf as a7,$f as a8,pc as a9,Of as aA,Lf as aB,em as aC,tm as aD,nm as aE,mt as aF,om as aG,sm as aH,Zf as aI,am as aJ,Gs as aK,gc as aa,Cc as ab,_c as ac,Un as ad,If as ae,Ca as af,Na as ag,Ke as ah,Wf as ai,Rf as aj,zs as ak,Ff as al,qf as am,ls as an,Nn as ao,Vs as ap,Yf as aq,Qf as ar,ed as as,nc as at,fm as au,gu as av,Ha as aw,ac as ax,qc as ay,ja as az,lo as b,sn as c,sc as d,Ve as e,Bf as f,ut as g,Jf as h,Jl as i,im as j,Df as k,ha as l,tn as m,xl as n,Ue as o,Qt as p,Oa as q,Xr as r,rc as s,$a as t,aa as u,Xf as v,qs as w,ma as x,mm as y,_a as z};