decocms 4.398.0 → 4.398.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (351) hide show
  1. package/dist/client/assets/{AlertCircle-BQBmepo1.js → AlertCircle-98wzPKVW.js} +1 -1
  2. package/dist/client/assets/{AreaChart-Bnl86Bmb.js → AreaChart-DcLXgcu7.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-DHPtMbTg.js → ArrowLeft-BzMccwRu.js} +1 -1
  4. package/dist/client/assets/{ArrowRight-m94XgZ3O.js → ArrowRight-lHe1U48z.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-DBDp30x0.js → ArrowUp-BmtqMqby.js} +1 -1
  6. package/dist/client/assets/{CartesianChart-W8IwLG3F.js → CartesianChart-B7-atApO.js} +1 -1
  7. package/dist/client/assets/{Check-Bcnv-H55.js → Check-BzQDWJjM.js} +1 -1
  8. package/dist/client/assets/{CheckCircle-CySwUqst.js → CheckCircle-HC56_LGd.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-wyCoS3df.js → ChevronUp-zrMm2jhU.js} +1 -1
  10. package/dist/client/assets/{Copy01-CMEvgxoC.js → Copy01-CODH5Oqa.js} +1 -1
  11. package/dist/client/assets/{CreditCard01-Bi7YfG5v.js → CreditCard01-B8bIMJLX.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-B97QY-fA.js → DotsVertical-kHMk4ug_.js} +1 -1
  13. package/dist/client/assets/{Download01-DokiLBvz.js → Download01-gLJ_F3hc.js} +1 -1
  14. package/dist/client/assets/{ErrorBarContext-CyEUeczg.js → ErrorBarContext-BBVKmyFc.js} +1 -1
  15. package/dist/client/assets/{Eye-DlNsmazk.js → Eye-DLCz-6qH.js} +1 -1
  16. package/dist/client/assets/{Globe04-CcTw2hMd.js → Globe04-BpUt_ty9.js} +1 -1
  17. package/dist/client/assets/{Image01-CGox3JEN.js → Image01-BpDKkqa8.js} +1 -1
  18. package/dist/client/assets/{Key01-MH27mIao.js → Key01-zdcblxxb.js} +1 -1
  19. package/dist/client/assets/{LayoutLeft-CpKRfpdN.js → LayoutLeft-B_xCpWrI.js} +1 -1
  20. package/dist/client/assets/{Line-BldjxoIZ.js → Line-P3ej5KXF.js} +1 -1
  21. package/dist/client/assets/{Link01-BcMSFUIJ.js → Link01-CL40WKQj.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-3Lsw2Z8I.js → LinkExternal01-DCf_4tEb.js} +1 -1
  23. package/dist/client/assets/{Monitor01-FNWg7-7u.js → Monitor01-C3eP4jhE.js} +1 -1
  24. package/dist/client/assets/{Package-ColnpoOk.js → Package-D8ukbq-a.js} +1 -1
  25. package/dist/client/assets/{Palette-Bb9IRvVj.js → Palette-DtA5rf3b.js} +1 -1
  26. package/dist/client/assets/{Plus-t4kIBGIE.js → Plus-B8Z2drir.js} +1 -1
  27. package/dist/client/assets/{SearchLg-DrU6iSmg.js → SearchLg-C_6dfKKh.js} +1 -1
  28. package/dist/client/assets/{SearchMd-Y5wxql57.js → SearchMd-3G73My4C.js} +1 -1
  29. package/dist/client/assets/{Sector-DfoxRE0A.js → Sector-Dr3tzQLe.js} +1 -1
  30. package/dist/client/assets/{Share07-DxxTtQWb.js → Share07-DtOs_WWI.js} +1 -1
  31. package/dist/client/assets/{Stars01-Dwmyh59Q.js → Stars01-bSsamSaB.js} +1 -1
  32. package/dist/client/assets/{Sun-mSxdzNTE.js → Sun-9j0Po2AP.js} +1 -1
  33. package/dist/client/assets/{Tool01-CaOf6Mu4.js → Tool01-DzYcs8vG.js} +1 -1
  34. package/dist/client/assets/{Trash01-DHtEq5nA.js → Trash01-Lp4e1hVO.js} +1 -1
  35. package/dist/client/assets/{Upload01--yrzZIir.js → Upload01-D1rXIspQ.js} +1 -1
  36. package/dist/client/assets/{User01-Dn00_JAZ.js → User01-D1oM1BHv.js} +1 -1
  37. package/dist/client/assets/{UserSquare-BfH7tTry.js → UserSquare-CmhJWMRI.js} +1 -1
  38. package/dist/client/assets/{Users01-BBUvRTwh.js → Users01-B-_tKxiA.js} +1 -1
  39. package/dist/client/assets/{X-xX_XXXXt.js → X-O0g-zSXl.js} +1 -1
  40. package/dist/client/assets/{XCircle-Bdqr7Csd.js → XCircle-D5gCbNRx.js} +1 -1
  41. package/dist/client/assets/{XClose-Cx8dSxYY.js → XClose-BVb5UCwC.js} +1 -1
  42. package/dist/client/assets/{Zap-Da5qzBL9.js → Zap-BlYosmzp.js} +1 -1
  43. package/dist/client/assets/{ZoomOut-C8BTMnO9.js → ZoomOut-BpJbUkSE.js} +1 -1
  44. package/dist/client/assets/{access-gate-wTt0hkiV.js → access-gate-BRVtYWTn.js} +1 -1
  45. package/dist/client/assets/{add-connection-dialog-C8n1sIiv.js → add-connection-dialog-BVHCfBCW.js} +1 -1
  46. package/dist/client/assets/{agent-analytics-BigiGcC3.js → agent-analytics-BApueoM9.js} +1 -1
  47. package/dist/client/assets/agent-app--WPkabyd.js +1 -0
  48. package/dist/client/assets/{agent-assets-C0cz7g53.js → agent-assets-Bm2oOJqy.js} +1 -1
  49. package/dist/client/assets/{agent-automation-NB5zps7C.js → agent-automation-BhOxRtSv.js} +1 -1
  50. package/dist/client/assets/{agent-automations-Dr2TOtVh.js → agent-automations-CCpNNCjK.js} +1 -1
  51. package/dist/client/assets/{agent-connect-sources-BP-ePYzm.js → agent-connect-sources-CTvrkv3i.js} +1 -1
  52. package/dist/client/assets/agent-deck-B_ROCg90.js +1 -0
  53. package/dist/client/assets/{agent-e2e-7pGygJe1.js → agent-e2e-DrpVDqBY.js} +1 -1
  54. package/dist/client/assets/{agent-experiments-NFpgU_vW.js → agent-experiments-BKZ46FeV.js} +1 -1
  55. package/dist/client/assets/agent-file-DP1nsS28.js +1 -0
  56. package/dist/client/assets/{agent-git-Dp2pjcq7.js → agent-git-nk_-yOb4.js} +1 -1
  57. package/dist/client/assets/{agent-hosting-swMJFfI8.js → agent-hosting-CLsE6dnK.js} +1 -1
  58. package/dist/client/assets/{agent-icon-b_XHjZEZ.js → agent-icon-Dz2LbXuC.js} +1 -1
  59. package/dist/client/assets/agent-library-file-DgRRgy-A.js +1 -0
  60. package/dist/client/assets/{agent-monitor-DXml8cXU.js → agent-monitor-CiZfI6SJ.js} +1 -1
  61. package/dist/client/assets/{agent-overview-B-8Q_kMe.js → agent-overview-0QPtfT14.js} +1 -1
  62. package/dist/client/assets/agent-settings-CcrItTbK.js +1 -0
  63. package/dist/client/assets/{agent-site-editor-C69PUReM.js → agent-site-editor-TizqnJhD.js} +1 -1
  64. package/dist/client/assets/agent-site-editor-code-DQga0ybf.js +2 -0
  65. package/dist/client/assets/{agent-site-editor-content-B9j94FVC.js → agent-site-editor-content-CDqcaHey.js} +3 -3
  66. package/dist/client/assets/{agent-site-editor-preview-CKfhefDr.js → agent-site-editor-preview-CoG6BsSN.js} +3 -3
  67. package/dist/client/assets/agent-view-dnqfoYCh.js +1 -0
  68. package/dist/client/assets/{agent-view-guard-DH71qayK.js → agent-view-guard-BhJ52yO2.js} +1 -1
  69. package/dist/client/assets/{agents-list-DqxafIkw.js → agents-list-CTr3UCsA.js} +1 -1
  70. package/dist/client/assets/{ai-providers-DjYgCZLG.js → ai-providers-BcvcgJNN.js} +1 -1
  71. package/dist/client/assets/{alert-DJICfxE6.js → alert-BRhcTM_7.js} +1 -1
  72. package/dist/client/assets/{alert-dialog-DehGSRTj.js → alert-dialog-C3LshfDK.js} +1 -1
  73. package/dist/client/assets/{analytics-sections-DAtGnCwB.js → analytics-sections-4kXlIaik.js} +1 -1
  74. package/dist/client/assets/{api-keys-BRbJWypK.js → api-keys-B-9d463a.js} +1 -1
  75. package/dist/client/assets/api-keys-HStbfsUF.js +1 -0
  76. package/dist/client/assets/app-editor-CKcMSoy_.js +1 -0
  77. package/dist/client/assets/{asset-utils-Dc_dFFTI.js → asset-utils-iBbDDnCM.js} +1 -1
  78. package/dist/client/assets/{auth-CxmhwEgd.js → auth-DkozDQfT.js} +1 -1
  79. package/dist/client/assets/{auth-catchall-CJK5Vd3r.js → auth-catchall-CaoohWWQ.js} +1 -1
  80. package/dist/client/assets/{auth-entry-XnuRce_W.js → auth-entry-sTOujlrO.js} +1 -1
  81. package/dist/client/assets/{auth-split-layout-CNTa1r8B.js → auth-split-layout-C3PsoZUS.js} +1 -1
  82. package/dist/client/assets/{authenticate-and-persist-oauth-D88bk5XQ.js → authenticate-and-persist-oauth-C6gFvq2v.js} +1 -1
  83. package/dist/client/assets/{automation-list-row-CQBHFIqU.js → automation-list-row-ChU0Sito.js} +1 -1
  84. package/dist/client/assets/{automation-runs-BNk_SzYI.js → automation-runs-CL5c_LWy.js} +1 -1
  85. package/dist/client/assets/{automations-CzHIfHdu.js → automations-BIOGw5Qo.js} +1 -1
  86. package/dist/client/assets/{autosend-CR9k38nC.js → autosend-DNj6HoOh.js} +1 -1
  87. package/dist/client/assets/{avatar-BOPY-KDj.js → avatar-DhNZu9aS.js} +1 -1
  88. package/dist/client/assets/{badge-CN6KFcHa.js → badge-BkjHhNmD.js} +1 -1
  89. package/dist/client/assets/{block-document-9qy4_FT6.js → block-document-CQCTTozx.js} +1 -1
  90. package/dist/client/assets/{blocks-preview-workspace-context-uDXO7VHT.js → blocks-preview-workspace-context-DmV6FtS0.js} +1 -1
  91. package/dist/client/assets/{breadcrumb-BxovhK-E.js → breadcrumb-rDzNfg9x.js} +1 -1
  92. package/dist/client/assets/{buckets-B83w_wIY.js → buckets-lQmD1FAW.js} +1 -1
  93. package/dist/client/assets/{build-improve-prompt-doc-Z251-hmh.js → build-improve-prompt-doc-DkODbHCn.js} +1 -1
  94. package/dist/client/assets/{calendar-Dd9w8Cda.js → calendar-CeXsatfK.js} +1 -1
  95. package/dist/client/assets/{capability-load-error-DVSWQq85.js → capability-load-error-DEFOhVqR.js} +1 -1
  96. package/dist/client/assets/{category-editor-Bvuph8Uc.js → category-editor-rQLavGw6.js} +1 -1
  97. package/dist/client/assets/{chart-D837siBd.js → chart-BdDhEkJW.js} +1 -1
  98. package/dist/client/assets/{chat-context-mOTo9_NI.js → chat-context-Dx19VUrB.js} +1 -1
  99. package/dist/client/assets/{chat-draft-D14VCCNF.js → chat-draft-CC0Ic13U.js} +1 -1
  100. package/dist/client/assets/{checkbox-I2peiheL.js → checkbox-BA7heRMu.js} +1 -1
  101. package/dist/client/assets/{choose-editor-BF24n3Ts.js → choose-editor-Np-ReOob.js} +1 -1
  102. package/dist/client/assets/{claim-phase-copy-nu5hupgI.js → claim-phase-copy-COCflyZr.js} +1 -1
  103. package/dist/client/assets/{cli-auth-success-BDtPEboS.js → cli-auth-success-BGmtWa6Z.js} +1 -1
  104. package/dist/client/assets/{client-icons-D_GjDPGl.js → client-icons-GXedD3uv.js} +1 -1
  105. package/dist/client/assets/{collapsible-gVegBMwF.js → collapsible-CZOJ1j6g.js} +1 -1
  106. package/dist/client/assets/{collection-detail-RDK_8DsU.js → collection-detail-qr33JcsZ.js} +1 -1
  107. package/dist/client/assets/{collection-display-button-BFbabvmp.js → collection-display-button-u4S1LAtI.js} +1 -1
  108. package/dist/client/assets/{collection-search-4vCvX0QD.js → collection-search-B-x1t4C0.js} +1 -1
  109. package/dist/client/assets/{collection-table-wrapper-DxjlDy-5.js → collection-table-wrapper-DBE42Jux.js} +1 -1
  110. package/dist/client/assets/{collection-tabs-DS-Im1ic.js → collection-tabs-0f-3wp-x.js} +1 -1
  111. package/dist/client/assets/{combobox-DrUSoNBs.js → combobox-BFwJe_OK.js} +1 -1
  112. package/dist/client/assets/{command-gKTxqgCX.js → command-B8kD2k68.js} +1 -1
  113. package/dist/client/assets/{companion-mcps-section-CP9gqcaw.js → companion-mcps-section-DDU2J30A.js} +1 -1
  114. package/dist/client/assets/{connect-DRelsvjB.js → connect-DoctJyXv.js} +1 -1
  115. package/dist/client/assets/{connect-layout-Cqhyb7PV.js → connect-layout-Bl9Gwxmt.js} +1 -1
  116. package/dist/client/assets/{connection-C15f5bNS.js → connection-CmGfLu0Q.js} +1 -1
  117. package/dist/client/assets/{connection-card-BMeKUGng.js → connection-card-BVRdv6UQ.js} +1 -1
  118. package/dist/client/assets/{connection-detail-CcO19QVa.js → connection-detail-DOYadB4_.js} +1 -1
  119. package/dist/client/assets/{connection-form-helpers-CmIBkFb3.js → connection-form-helpers-tM_VoG8F.js} +1 -1
  120. package/dist/client/assets/{connections-kJZ9DqVg.js → connections-DHYFDdZP.js} +1 -1
  121. package/dist/client/assets/{context-waQx2W4V.js → context-9zKFm2v9.js} +1 -1
  122. package/dist/client/assets/{create-organization-dialog-DoTSwQvQ.js → create-organization-dialog-BtOGY33C.js} +1 -1
  123. package/dist/client/assets/{decofile-api-DwohDDOu.js → decofile-api-B_E7EbfM.js} +1 -1
  124. package/dist/client/assets/{decopilot-bLAHPQ8D.js → decopilot-DqJHkJDR.js} +1 -1
  125. package/dist/client/assets/{dialog-Dcra4McE.js → dialog-jP8njNI6.js} +1 -1
  126. package/dist/client/assets/{discover-srrXvfjV.js → discover-BPYHS5UU.js} +1 -1
  127. package/dist/client/assets/{domain-settings-CcyamET0.js → domain-settings-BwuEYXEQ.js} +1 -1
  128. package/dist/client/assets/{download-app-dialog-Bt9MR0m_.js → download-app-dialog-mLTiBfmY.js} +1 -1
  129. package/dist/client/assets/{drawer-0y_cyI4K.js → drawer-s4SH2mc3.js} +1 -1
  130. package/dist/client/assets/{editor-BCdzptBY.js → editor-B53xAYN4.js} +1 -1
  131. package/dist/client/assets/{empty-state-BimfTH5j.js → empty-state-CzZHrBSz.js} +1 -1
  132. package/dist/client/assets/{empty-state-BV17J4rU.js → empty-state-D0NCdca7.js} +1 -1
  133. package/dist/client/assets/{extract-connection-data-ByvXZO_i.js → extract-connection-data-CrLtw8ci.js} +1 -1
  134. package/dist/client/assets/{feature-gate-CGTKfO9Z.js → feature-gate-BNDpNIIw.js} +1 -1
  135. package/dist/client/assets/{feature-paywall-Bl0cYtHt.js → feature-paywall-Cva507rq.js} +1 -1
  136. package/dist/client/assets/{file-explorer-76PPVdlw.js → file-explorer-CSd2xyTo.js} +1 -1
  137. package/dist/client/assets/{file-preview-cVqXpH_G.js → file-preview-JRBAUOKb.js} +1 -1
  138. package/dist/client/assets/{file-share-button-BuMvzP63.js → file-share-button-DtUyAqLk.js} +1 -1
  139. package/dist/client/assets/{file-type-icon-DYMR5_m7.js → file-type-icon-BOWlnPUV.js} +1 -1
  140. package/dist/client/assets/{folder-icon-DQB6n2kf.js → folder-icon-C2pAAR00.js} +1 -1
  141. package/dist/client/assets/{form-Bn_VlbjB.js → form-DaPOdR17.js} +1 -1
  142. package/dist/client/assets/{gateway-client-DSN8PosO.js → gateway-client-CGk-7MR6.js} +1 -1
  143. package/dist/client/assets/{general-B-jviDo6.js → general-D4ZIpqC2.js} +1 -1
  144. package/dist/client/assets/{github-icon-8fpS8l__.js → github-icon-ByY-0mGh.js} +1 -1
  145. package/dist/client/assets/{home-CL83ye26.js → home-BLmIPmqc.js} +1 -1
  146. package/dist/client/assets/{hooks-V57yclqv.js → hooks-CXbyAtVG.js} +1 -1
  147. package/dist/client/assets/{icon-button-B2Jd-vIw.js → icon-button-Cq1k6ZVS.js} +1 -1
  148. package/dist/client/assets/{index-B9RXO-FB.js → index-4Z84UU8G.js} +1 -1
  149. package/dist/client/assets/{index-DRFd03i9.js → index-Bdlkb4iQ.js} +1 -1
  150. package/dist/client/assets/{index-Do9AlR8P.js → index-ByaCvMUk.js} +1 -1
  151. package/dist/client/assets/{index-gECsHnHY.js → index-CGsDcnec.js} +1 -1
  152. package/dist/client/assets/{index-CFZrnnmD.js → index-CIpplZnk.js} +2 -2
  153. package/dist/client/assets/{index-Cv3P6Wq4.js → index-CMcP18Ct.js} +1 -1
  154. package/dist/client/assets/{index-DdGk5PPa.js → index-CV72CUvH.js} +1 -1
  155. package/dist/client/assets/{index-Cw3ZmUL2.js → index-D7oOQp3m.js} +1 -1
  156. package/dist/client/assets/{index-D-R5D9vw.js → index-D_DNWqlh.js} +1 -1
  157. package/dist/client/assets/{index-CsvWb_z5.js → index-RHxL1eAg.js} +1 -1
  158. package/dist/client/assets/{index-DtZHgx57.js → index-Yo2ppgZR.js} +1 -1
  159. package/dist/client/assets/{index-C_YKA6uy.js → index-bPpaMV2E.js} +1 -1
  160. package/dist/client/assets/{index-Dq-IpwkC.js → index-ieQLTghw.js} +1 -1
  161. package/dist/client/assets/{index-redirect-CTTvBSR1.js → index-redirect-DRkwr1qK.js} +1 -1
  162. package/dist/client/assets/{index-BRVGbtHX.js → index-upFcZaJ9.js} +1 -1
  163. package/dist/client/assets/{infiniteQueryObserver-Gux7qMEO.js → infiniteQueryObserver-Bqu02ZY5.js} +1 -1
  164. package/dist/client/assets/{infra-billing-Cvvw03Dm.js → infra-billing-CQKKzPZR.js} +1 -1
  165. package/dist/client/assets/{input-DmvvEyNC.js → input-BNnugwQe.js} +1 -1
  166. package/dist/client/assets/{input-B_-SnRO5.js → input-BPtPkDjr.js} +1 -1
  167. package/dist/client/assets/{input-Bwe8NZ5T.js → input-C6oonHwB.js} +1 -1
  168. package/dist/client/assets/{integration-icon-C9XaIOHe.js → integration-icon-FGill8kv.js} +1 -1
  169. package/dist/client/assets/{label-DSLU6fFz.js → label-tAOICfGy.js} +1 -1
  170. package/dist/client/assets/{last-preview-page-Bq7holaY.js → last-preview-page-WUGh86cS.js} +1 -1
  171. package/dist/client/assets/{layout-BKGCgfkN.js → layout-P6Po01E5.js} +1 -1
  172. package/dist/client/assets/{legacy-agents-deep-T9NXwWHP.js → legacy-agents-deep-SOljgH4P.js} +1 -1
  173. package/dist/client/assets/{legacy-main-redirect-CdjJmBj-.js → legacy-main-redirect-6SMZr0lc.js} +1 -1
  174. package/dist/client/assets/{library-CDWN3mYj.js → library-BLOWLPoq.js} +1 -1
  175. package/dist/client/assets/{login-Cx2qLFTf.js → login-BbJtzWX8.js} +1 -1
  176. package/dist/client/assets/{markdown-oeL4d_tN.js → markdown-DOW-6sXC.js} +1 -1
  177. package/dist/client/assets/{mcp-app-renderer-CmLIkf6i.js → mcp-app-renderer-Dp4aDRFa.js} +1 -1
  178. package/dist/client/assets/{mcp-oauth-D1pDEEn0.js → mcp-oauth-BGxWwoSJ.js} +1 -1
  179. package/dist/client/assets/{members-DDvZMbmX.js → members-BPBMhZ2e.js} +1 -1
  180. package/dist/client/assets/{message-templates-D-nRIsWk.js → message-templates-BKToR_KO.js} +1 -1
  181. package/dist/client/assets/{mini-report-page-nehi6gd3.js → mini-report-page-BgGrdgVe.js} +1 -1
  182. package/dist/client/assets/{mock-board-BcrW0eEv.js → mock-board-HS6ZyMs7.js} +3 -3
  183. package/dist/client/assets/{monaco-editor-rG_ojQtN.js → monaco-editor-Bn7ZAIFi.js} +1 -1
  184. package/dist/client/assets/{monitoring-stats-row-u_eyyh8S.js → monitoring-stats-row-uSPm4TGm.js} +1 -1
  185. package/dist/client/assets/{multi-select-C1vxoOWR.js → multi-select-ikM4zDSm.js} +1 -1
  186. package/dist/client/assets/{mustache-_05g5fSZ.js → mustache-UXrEN3oi.js} +1 -1
  187. package/dist/client/assets/{oauth-callback-BParqGue.js → oauth-callback-BuIFkkpz.js} +1 -1
  188. package/dist/client/assets/{oauth-callback-ai-provider-CFCc4vuY.js → oauth-callback-ai-provider-CuOqLEOL.js} +1 -1
  189. package/dist/client/assets/{onboarding-CefimiY5.js → onboarding-BsLWsSNO.js} +1 -1
  190. package/dist/client/assets/{optimistic-project-sidebar-views-Ds7dxAP-.js → optimistic-project-sidebar-views-DpQrux5Y.js} +1 -1
  191. package/dist/client/assets/{org-file-open-context-DI6t8wtB.js → org-file-open-context-YAA5_1V8.js} +1 -1
  192. package/dist/client/assets/{organization-choice-DqCYRx3X.js → organization-choice-QwjuxmVy.js} +1 -1
  193. package/dist/client/assets/{orgs-B9XC3G_x.js → orgs-CnltLAQY.js} +1 -1
  194. package/dist/client/assets/{page-seo-form-Bxx9SwNT.js → page-seo-form-Bs8WgrD5.js} +1 -1
  195. package/dist/client/assets/{pair-CVurrPq-.js → pair-QAcIbRc1.js} +1 -1
  196. package/dist/client/assets/{plan-ladder-BfylXdSz.js → plan-ladder-FCxbXDbY.js} +1 -1
  197. package/dist/client/assets/{popover-Baq0imIs.js → popover-fTX4Xa7z.js} +1 -1
  198. package/dist/client/assets/{post-calendar-Deyu5RSY.js → post-calendar-CCy3Rkj-.js} +1 -1
  199. package/dist/client/assets/{post-editor-B77-jPfP.js → post-editor-KBvky45B.js} +1 -1
  200. package/dist/client/assets/{preview-content-Cb2RYCeo.js → preview-content-D4jGV5tt.js} +1 -1
  201. package/dist/client/assets/{preview-dialog-AWoznOua.js → preview-dialog-CfNH0Lbe.js} +1 -1
  202. package/dist/client/assets/{profile-Bno_MC0t.js → profile-BctUXNiF.js} +1 -1
  203. package/dist/client/assets/{project-app-view-BoEEmEk4.js → project-app-view-B15pKaAL.js} +1 -1
  204. package/dist/client/assets/{project-feed-DT9rU3wJ.js → project-feed-YdABu1Sg.js} +1 -1
  205. package/dist/client/assets/{project-icon-CzEj0avy.js → project-icon-CK24j_02.js} +1 -1
  206. package/dist/client/assets/project-reports-Cmyeztbb.js +1 -0
  207. package/dist/client/assets/project-tasks-CK_xwSxn.js +1 -0
  208. package/dist/client/assets/{prompts-BU3lT5yK.js → prompts-BxzWfQAU.js} +1 -1
  209. package/dist/client/assets/record-editor-B-cJMYFm.js +1 -0
  210. package/dist/client/assets/{redirect-editor-BrsiQdWf.js → redirect-editor-C9LkCwmC.js} +1 -1
  211. package/dist/client/assets/{reports-BWa8EEwC.js → reports-23kvwh32.js} +1 -1
  212. package/dist/client/assets/reports-CTNHSnDH.js +1 -0
  213. package/dist/client/assets/{reports-onboarding-soeZpVO2.js → reports-onboarding-B1LUM_Oo.js} +1 -1
  214. package/dist/client/assets/{reports-tab-DvvKKs9h.js → reports-tab-BQIBSteI.js} +2 -2
  215. package/dist/client/assets/{repositories-DxBiP88Q.js → repositories-CIaQ1-tt.js} +1 -1
  216. package/dist/client/assets/{repository-import-picker-DmgbIRex.js → repository-import-picker-BsAgV8Se.js} +1 -1
  217. package/dist/client/assets/{repository-picker-BdbJB8MH.js → repository-picker-CqBWAelp.js} +1 -1
  218. package/dist/client/assets/{require-capability-CUtBt1bi.js → require-capability-Shivm_GS.js} +1 -1
  219. package/dist/client/assets/{required-auth-layout-BlnGUT2q.js → required-auth-layout-DZJ0ncSQ.js} +1 -1
  220. package/dist/client/assets/{reset-password-OMiTHFai.js → reset-password-S2Hx9vgp.js} +1 -1
  221. package/dist/client/assets/{resizable-Dr5PNlfE.js → resizable-DSp-mBJp.js} +1 -1
  222. package/dist/client/assets/{review-settings-84byzwHU.js → review-settings-CoiR_Ztj.js} +1 -1
  223. package/dist/client/assets/{rich-text-link-control-CFnLXxfY.js → rich-text-link-control-BAlsv86z.js} +1 -1
  224. package/dist/client/assets/{roles-AcbVFhCZ.js → roles-DArCtTLg.js} +1 -1
  225. package/dist/client/assets/{route-BA_J22E-.js → route-26Mt5mzA.js} +1 -1
  226. package/dist/client/assets/{route-73J6vHiy.js → route-DgmVTZMj.js} +1 -1
  227. package/dist/client/assets/{route-BHnu0h_N.js → route-Dy8UtoAO.js} +1 -1
  228. package/dist/client/assets/{route-page-header-CByDrdCZ.js → route-page-header-DRUN9y5J.js} +1 -1
  229. package/dist/client/assets/{runnable-block-editor-C-z6sg8d.js → runnable-block-editor-BZ6oB296.js} +1 -1
  230. package/dist/client/assets/{sandbox-lifecycle-context-244BQJ78.js → sandbox-lifecycle-context-CZACEFk2.js} +1 -1
  231. package/dist/client/assets/{schema-Du8_zRy7.js → schema-CPd5aeYI.js} +1 -1
  232. package/dist/client/assets/{scroll-area-DWMWIudU.js → scroll-area-BmpdCi7H.js} +1 -1
  233. package/dist/client/assets/{search-input-C7zzo1gV.js → search-input-D64mWW5B.js} +1 -1
  234. package/dist/client/assets/{search-toggle-CArb_7uo.js → search-toggle-Czd1UahM.js} +1 -1
  235. package/dist/client/assets/{secret-picker-CQN9d587.js → secret-picker-BbxILR0N.js} +1 -1
  236. package/dist/client/assets/{secrets-D1CraqxC.js → secrets-CWGHj3-4.js} +1 -1
  237. package/dist/client/assets/{sections-editor-Wq74SyFR.js → sections-editor-DGlNHFIn.js} +1 -1
  238. package/dist/client/assets/{select-BOM-aKhP.js → select-Bo6x_o6t.js} +1 -1
  239. package/dist/client/assets/{select-model-DpXoMCZH.js → select-model-rH9zU1R6.js} +1 -1
  240. package/dist/client/assets/{seo-editor-D1cw49ws.js → seo-editor-DCpmtymR.js} +1 -1
  241. package/dist/client/assets/{separator-DW6Prz-B.js → separator-D5qdiNs3.js} +1 -1
  242. package/dist/client/assets/{settings-tab-BlphdJug.js → settings-tab-PxnX0_3G.js} +1 -1
  243. package/dist/client/assets/{sheet-Dq13NqY6.js → sheet-BGZWKAH-.js} +1 -1
  244. package/dist/client/assets/{shell-layout-DMJ3Gw_b.js → shell-layout-BgCM8XJt.js} +1 -1
  245. package/dist/client/assets/{sidebar-n3X--4aE.js → sidebar-CGrYLwXg.js} +1 -1
  246. package/dist/client/assets/{skill-preview-ht8NWRpt.js → skill-preview-8oicUgJt.js} +1 -1
  247. package/dist/client/assets/{skills-2dbI_ehN.js → skills-wyI-absD.js} +1 -1
  248. package/dist/client/assets/{sso-D4ClPuk5.js → sso-HywbSvna.js} +1 -1
  249. package/dist/client/assets/{suggestion-B2gCPjEY.js → suggestion-DRraTYTY.js} +1 -1
  250. package/dist/client/assets/{switch-BpU_dXOg.js → switch-Cfah00lh.js} +1 -1
  251. package/dist/client/assets/{synced-repos-B4WffdFD.js → synced-repos-CGTEq57k.js} +1 -1
  252. package/dist/client/assets/{table-BK5Bj0BA.js → table-DAZIzNQ8.js} +1 -1
  253. package/dist/client/assets/{tabs-DtulKHna.js → tabs-v7aq9W_R.js} +1 -1
  254. package/dist/client/assets/{task-board-BlCSl7H6.js → task-board-CGkhJUE0.js} +1 -1
  255. package/dist/client/assets/{task-route-Buk2mgML.js → task-route-CaklBMYm.js} +1 -1
  256. package/dist/client/assets/{task-status-BvbYEbq9.js → task-status-CN1U2UFr.js} +1 -1
  257. package/dist/client/assets/{taskboard-analytics-C4h2ZM5g.js → taskboard-analytics-ChfWJlvV.js} +1 -1
  258. package/dist/client/assets/{tasks-ClVRdGRp.js → tasks-CF4j9ZQy.js} +1 -1
  259. package/dist/client/assets/tasks-iRvr4R5a.js +1 -0
  260. package/dist/client/assets/{textarea-CDG_4h5K.js → textarea-AoHG-xc8.js} +1 -1
  261. package/dist/client/assets/{thread-analytics-CrrAYz-K.js → thread-analytics-bBQJ6D7W.js} +1 -1
  262. package/dist/client/assets/{thread-button-Bt2nv3eP.js → thread-button-DC2FqVVD.js} +1 -1
  263. package/dist/client/assets/{thread-intent-DfUdqfo1.js → thread-intent-glwqnDtC.js} +1 -1
  264. package/dist/client/assets/{thread-route-CIar6WIg.js → thread-route-CxXnvrpW.js} +1 -1
  265. package/dist/client/assets/{thread-route-BcHRblub.js → thread-route-D3TxABEC.js} +1 -1
  266. package/dist/client/assets/{thread-sheet-body-BeD4yJxi.js → thread-sheet-body-DrfgB9cA.js} +1 -1
  267. package/dist/client/assets/{toggle-group-CNL0xUW4.js → toggle-group-DOgcFL4v.js} +1 -1
  268. package/dist/client/assets/{toolbar-icon-button-bv_fQ-aj.js → toolbar-icon-button-y4PM5-9w.js} +1 -1
  269. package/dist/client/assets/{tooltip-CPnP6Sjs.js → tooltip-CXi7o6QP.js} +1 -1
  270. package/dist/client/assets/{track-B9PuaPFx.js → track-DmW-NZr9.js} +1 -1
  271. package/dist/client/assets/{types-d1eRFziw.js → types-BtZlYpRe.js} +1 -1
  272. package/dist/client/assets/{usage-stats-DJsI8Eqk.js → usage-stats-xKmxu4iy.js} +1 -1
  273. package/dist/client/assets/{use-ai-providers-BV_DvH7o.js → use-ai-providers-BCh0GxqC.js} +1 -1
  274. package/dist/client/assets/{use-automations-BHsMhlO9.js → use-automations-D87B_EUH.js} +1 -1
  275. package/dist/client/assets/{use-autosave-DgwX0mMm.js → use-autosave-frEJXTDA.js} +1 -1
  276. package/dist/client/assets/{use-connect-companion-BzIs5X88.js → use-connect-companion-CTqRarXO.js} +1 -1
  277. package/dist/client/assets/{use-connection-Bi6HLcH4.js → use-connection-CXcRnxjN.js} +1 -1
  278. package/dist/client/assets/{use-copy-CDhoRgm3.js → use-copy-gkafpnsk.js} +1 -1
  279. package/dist/client/assets/{use-create-virtual-mcp-DIHuJhyr.js → use-create-virtual-mcp-DIg3RbKx.js} +1 -1
  280. package/dist/client/assets/{use-date-fns-locale-Cy0bIV3c.js → use-date-fns-locale-DrMzy_FK.js} +1 -1
  281. package/dist/client/assets/{use-debounced-autosave-D8Sorx0q.js → use-debounced-autosave-D_-x43mA.js} +1 -1
  282. package/dist/client/assets/{use-debounced-value-Bi1oqAau.js → use-debounced-value-B4B0DOlQ.js} +1 -1
  283. package/dist/client/assets/{use-deco-credits-CRBFL3xa.js → use-deco-credits-Dh1J6eMk.js} +1 -1
  284. package/dist/client/assets/{use-decopilot-events-CVfzaSiv.js → use-decopilot-events-AZfnvS0v.js} +1 -1
  285. package/dist/client/assets/{use-delete-connection-CX0v-UqP.js → use-delete-connection-BSWf3M-7.js} +1 -1
  286. package/dist/client/assets/{use-deployment-admin-C2loCmMs.js → use-deployment-admin-Bz8D_07n.js} +1 -1
  287. package/dist/client/assets/{use-entitlements-qq0onzk3.js → use-entitlements-DmXuSjaB.js} +1 -1
  288. package/dist/client/assets/{use-fast-preview-draft-url-DUGuDJ0B.js → use-fast-preview-draft-url-12Zomm_h.js} +1 -1
  289. package/dist/client/assets/{use-file-configs-DI6Asnep.js → use-file-configs-DDF4ME58.js} +1 -1
  290. package/dist/client/assets/{use-in-settings-2EIzhXwd.js → use-in-settings-7nb91Hdl.js} +1 -1
  291. package/dist/client/assets/{use-infinite-scroll-BwJMlu6L.js → use-infinite-scroll-ufEM3hT-.js} +1 -1
  292. package/dist/client/assets/{use-join-requests-752eIkzS.js → use-join-requests-Dk4ggQU5.js} +1 -1
  293. package/dist/client/assets/{use-main-panel-tabs-DIxFD1x0.js → use-main-panel-tabs-CPdeW3w6.js} +1 -1
  294. package/dist/client/assets/{use-mcp-auth-status-Cyg7VElH.js → use-mcp-auth-status-Dqxl918q.js} +1 -1
  295. package/dist/client/assets/{use-mcp-client-4SfStdvU.js → use-mcp-client-Beusq7Tu.js} +1 -1
  296. package/dist/client/assets/{use-mcp-prompts-DNTC-VnG.js → use-mcp-prompts-fJ5FqsHx.js} +1 -1
  297. package/dist/client/assets/{use-mcp-tools-CmJbGXa2.js → use-mcp-tools-CtkSsDJL.js} +1 -1
  298. package/dist/client/assets/{use-members-ChLgHSO3.js → use-members-6xmqE_DE.js} +1 -1
  299. package/dist/client/assets/{use-mobile-DARHzVZh.js → use-mobile-Cib4VYxP.js} +1 -1
  300. package/dist/client/assets/{use-navigate-to-agent-a1v5JNRv.js → use-navigate-to-agent-DL9BnEdc.js} +1 -1
  301. package/dist/client/assets/{use-open-billing-url-CSkUOZcG.js → use-open-billing-url-NPMAfiIz.js} +1 -1
  302. package/dist/client/assets/{use-org-auth-client-BcltMH40.js → use-org-auth-client-BhRawBZC.js} +1 -1
  303. package/dist/client/assets/{use-org-fs-PfmH2IwE.js → use-org-fs-BCGhVQu5.js} +1 -1
  304. package/dist/client/assets/{use-org-repo-syncs-BGgD9fX9.js → use-org-repo-syncs-CORE3eQH.js} +1 -1
  305. package/dist/client/assets/{use-org-sso-BcU16muD.js → use-org-sso-CeH0e9fd.js} +1 -1
  306. package/dist/client/assets/{use-organization-roles-RhvAN6UI.js → use-organization-roles-BAYGR7ct.js} +1 -1
  307. package/dist/client/assets/{use-organization-settings-BLvm6CUv.js → use-organization-settings-0Zwi3Fi0.js} +1 -1
  308. package/dist/client/assets/{use-panel-navigate-Ba3IZxfG.js → use-panel-navigate-CWuMssp-.js} +1 -1
  309. package/dist/client/assets/{use-project-native-view-presence-CsPNZgcc.js → use-project-native-view-presence-DxprB2h6.js} +1 -1
  310. package/dist/client/assets/{use-project-scope-BspeH_sq.js → use-project-scope-CJsyC3na.js} +1 -1
  311. package/dist/client/assets/{use-releases-CVzN8uNR.js → use-releases-DCcyngLk.js} +1 -1
  312. package/dist/client/assets/{use-reports-diagnostic-CrvplLbm.js → use-reports-diagnostic-WgUi0pqp.js} +1 -1
  313. package/dist/client/assets/{use-route-default-main-DSqzyOuP.js → use-route-default-main-BcsKyhK4.js} +1 -1
  314. package/dist/client/assets/{use-secrets-DgrFX5xg.js → use-secrets-Cp7IdDQp.js} +1 -1
  315. package/dist/client/assets/{use-section-preview-base-B-Hn9i9b.js → use-section-preview-base-fadywuhv.js} +1 -1
  316. package/dist/client/assets/{use-session-runtime-BVLmSBh6.js → use-session-runtime-Dr7e2ZQv.js} +1 -1
  317. package/dist/client/assets/{use-tags-BOv9arBp.js → use-tags-BnDGg-BG.js} +1 -1
  318. package/dist/client/assets/{use-task-board-analytics-DPM83CD7.js → use-task-board-analytics-AN_DQWMB.js} +1 -1
  319. package/dist/client/assets/{use-task-metadata-CJ-QxfGm.js → use-task-metadata-uBP-gX-8.js} +1 -1
  320. package/dist/client/assets/{use-thread-analytics-C0CiMqbi.js → use-thread-analytics-DWIa8VRe.js} +1 -1
  321. package/dist/client/assets/{use-thread-outputs-CTmmbNmM.js → use-thread-outputs-CdqDCmBJ.js} +1 -1
  322. package/dist/client/assets/{use-virtual-mcp-B1-yfeBH.js → use-virtual-mcp-BFBtWaJR.js} +1 -1
  323. package/dist/client/assets/useInfiniteQuery-CMmW9U3V.js +1 -0
  324. package/dist/client/assets/{useQueries-CrqtqlHM.js → useQueries-BjqYP0q_.js} +1 -1
  325. package/dist/client/assets/useSuspenseInfiniteQuery-B6GLqmw0.js +1 -0
  326. package/dist/client/assets/{users-mYCEW-vA.js → users-ovx8MoDb.js} +1 -1
  327. package/dist/client/assets/{utils-D2y8J057.js → utils-CwK0CgrK.js} +1 -1
  328. package/dist/client/assets/{variant-calendar-7H3LNEKh.js → variant-calendar-D7pBaGln.js} +1 -1
  329. package/dist/client/assets/{variant-matcher-override-4dV3T02L.js → variant-matcher-override-Bpf_q63q.js} +1 -1
  330. package/dist/client/assets/{view-mode-toggle-BQub2iHi.js → view-mode-toggle-KOhMNfN3.js} +1 -1
  331. package/dist/client/assets/{virtual-mcp-7pXCbTsW.js → virtual-mcp-Bw3gaPfR.js} +1 -1
  332. package/dist/client/index.html +1 -1
  333. package/dist/server/cli.js +49 -49
  334. package/dist/server/server.js +136 -136
  335. package/package.json +1 -1
  336. package/dist/client/assets/agent-app-BynIiQPm.js +0 -1
  337. package/dist/client/assets/agent-deck-B4AuEIZ3.js +0 -1
  338. package/dist/client/assets/agent-file-CtFUY5q3.js +0 -1
  339. package/dist/client/assets/agent-library-file-Cs2o3xUR.js +0 -1
  340. package/dist/client/assets/agent-settings-D_j9iMnB.js +0 -1
  341. package/dist/client/assets/agent-site-editor-code-DSXPZTZD.js +0 -2
  342. package/dist/client/assets/agent-view-cJkl5h-x.js +0 -1
  343. package/dist/client/assets/api-keys-CRlcHMxs.js +0 -1
  344. package/dist/client/assets/app-editor-BYU_FtWh.js +0 -1
  345. package/dist/client/assets/project-reports-DYAJh_Wl.js +0 -1
  346. package/dist/client/assets/project-tasks-CE9Re7Tj.js +0 -1
  347. package/dist/client/assets/record-editor-BZi1czEu.js +0 -1
  348. package/dist/client/assets/reports-ARrC7tI6.js +0 -1
  349. package/dist/client/assets/tasks-IK2ZoIhQ.js +0 -1
  350. package/dist/client/assets/useInfiniteQuery-CpVWUzdl.js +0 -1
  351. package/dist/client/assets/useSuspenseInfiniteQuery-CXyd6z14.js +0 -1
@@ -1,9 +1,9 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/app-editor-BYU_FtWh.js","assets/index-CFZrnnmD.js","assets/index-Cg8hYLBl.css","assets/chat-context-mOTo9_NI.js","assets/use-panel-navigate-Ba3IZxfG.js","assets/thread-route-CIar6WIg.js","assets/use-project-scope-BspeH_sq.js","assets/use-virtual-mcp-B1-yfeBH.js","assets/use-mcp-client-4SfStdvU.js","assets/auth-CxmhwEgd.js","assets/github-repo-BknN0SVI.js","assets/autosend-CR9k38nC.js","assets/thread-intent-DfUdqfo1.js","assets/slugify-CEUa2lfQ.js","assets/hooks-V57yclqv.js","assets/backoff-8mStPHYB.js","assets/task-board-BlCSl7H6.js","assets/schema-Du8_zRy7.js","assets/use-is-desktop-app-BNujXJc_.js","assets/use-entitlements-qq0onzk3.js","assets/use-ai-providers-BV_DvH7o.js","assets/location-oTTXFrSF.js","assets/use-decopilot-events-CVfzaSiv.js","assets/use-organization-settings-BLvm6CUv.js","assets/scroll-area-DWMWIudU.js","assets/select-BOM-aKhP.js","assets/index-Cv3P6Wq4.js","assets/Check-Bcnv-H55.js","assets/ChevronUp-wyCoS3df.js","assets/use-section-preview-base-B-Hn9i9b.js","assets/UserSquare-BfH7tTry.js","assets/Share07-DxxTtQWb.js","assets/agent-icon-b_XHjZEZ.js","assets/AlertCircle-BQBmepo1.js","assets/Tool01-CaOf6Mu4.js","assets/ArrowUp-DBDp30x0.js","assets/ArrowLeft-DHPtMbTg.js","assets/ArrowRight-m94XgZ3O.js","assets/XCircle-Bdqr7Csd.js","assets/ZoomOut-C8BTMnO9.js","assets/Globe04-CcTw2hMd.js","assets/CheckCircle-CySwUqst.js","assets/Copy01-CMEvgxoC.js","assets/CreditCard01-Bi7YfG5v.js","assets/DotsVertical-B97QY-fA.js","assets/Download01-DokiLBvz.js","assets/Eye-DlNsmazk.js","assets/XClose-Cx8dSxYY.js","assets/Image01-CGox3JEN.js","assets/Key01-MH27mIao.js","assets/LayoutLeft-CpKRfpdN.js","assets/Link01-BcMSFUIJ.js","assets/LinkExternal01-3Lsw2Z8I.js","assets/Monitor01-FNWg7-7u.js","assets/Sun-mSxdzNTE.js","assets/Package-ColnpoOk.js","assets/Palette-Bb9IRvVj.js","assets/Plus-t4kIBGIE.js","assets/SearchLg-DrU6iSmg.js","assets/SearchMd-Y5wxql57.js","assets/Stars01-Dwmyh59Q.js","assets/Trash01-DHtEq5nA.js","assets/Upload01--yrzZIir.js","assets/User01-Dn00_JAZ.js","assets/Users01-BBUvRTwh.js","assets/X-xX_XXXXt.js","assets/Zap-Da5qzBL9.js","assets/dialog-Dcra4McE.js","assets/input-B_-SnRO5.js","assets/claim-phase-copy-nu5hupgI.js","assets/section-preview-url-Csj0_ZDg.js","assets/use-session-runtime-BVLmSBh6.js","assets/runnable-block-editor-C-z6sg8d.js","assets/sandbox-start-errors-BK_aDCyt.js","assets/pair-CVurrPq-.js","assets/format-time-BtXRrtv4.js","assets/differenceInSeconds-C3x8sHUj.js","assets/collapsible-gVegBMwF.js","assets/use-copy-CDhoRgm3.js","assets/usage-stats-DJsI8Eqk.js","assets/markdown-oeL4d_tN.js","assets/org-file-open-context-DI6t8wtB.js","assets/use-mobile-DARHzVZh.js","assets/tooltip-CPnP6Sjs.js","assets/shell-layout-DMJ3Gw_b.js","assets/avatar-BOPY-KDj.js","assets/download-app-dialog-Bt9MR0m_.js","assets/command-gKTxqgCX.js","assets/index-Cw3ZmUL2.js","assets/integration-icon-C9XaIOHe.js","assets/project-icon-CzEj0avy.js","assets/required-auth-layout-BlnGUT2q.js","assets/use-org-sso-BcU16muD.js","assets/shell-layout-CE2Eihra.css","assets/content-blocks-o63cs2vh.js","assets/mcp-app-renderer-CmLIkf6i.js","assets/types-d1eRFziw.js","assets/omit-sandbox-map-jj4lCB2U.js","assets/gateway-client-DSN8PosO.js","assets/tool-namespace-DmnQIdtF.js","assets/utils-CVEq3hMx.js","assets/sheet-Dq13NqY6.js","assets/use-connection-Bi6HLcH4.js","assets/use-navigate-to-agent-a1v5JNRv.js","assets/use-mcp-prompts-DNTC-VnG.js","assets/index-B9RXO-FB.js","assets/form-Bn_VlbjB.js","assets/label-DSLU6fFz.js","assets/use-thread-outputs-CTmmbNmM.js","assets/file-type-icon-DYMR5_m7.js","assets/popover-Baq0imIs.js","assets/utils-D2y8J057.js","assets/monaco-editor-rG_ojQtN.js","assets/editor-BCdzptBY.js","assets/calendar-Dd9w8Cda.js","assets/textarea-CDG_4h5K.js","assets/rich-text-link-control-CFnLXxfY.js","assets/switch-BpU_dXOg.js","assets/combobox-DrUSoNBs.js","assets/alert-dialog-DehGSRTj.js","assets/sandbox-url-D3mC8qhT.js","assets/search-input-C7zzo1gV.js","assets/tabs-DtulKHna.js","assets/use-debounced-value-Bi1oqAau.js","assets/use-file-configs-DI6Asnep.js","assets/asset-utils-Dc_dFFTI.js","assets/useInfiniteQuery-CpVWUzdl.js","assets/infiniteQueryObserver-Gux7qMEO.js","assets/match-site-slug-config-D3fUJ6vX.js","assets/toggle-group-CNL0xUW4.js","assets/decofile-api-DwohDDOu.js","assets/sandbox-git-api-B1R0585s.js","assets/agent-view-guard-DH71qayK.js","assets/use-main-panel-tabs-DIxFD1x0.js","assets/use-route-default-main-DSqzyOuP.js","assets/use-mcp-tools-CmJbGXa2.js","assets/index-DtZHgx57.js","assets/drawer-0y_cyI4K.js","assets/collection-search-4vCvX0QD.js","assets/input-Bwe8NZ5T.js","assets/chat-draft-D14VCCNF.js","assets/use-deco-credits-CRBFL3xa.js","assets/use-open-billing-url-CSkUOZcG.js","assets/decopilot-bLAHPQ8D.js","assets/checkbox-I2peiheL.js","assets/ai-providers-logos-DD3qZ33J.js","assets/index-Dq-IpwkC.js","assets/input-DmvvEyNC.js","assets/suggestion-B2gCPjEY.js","assets/use-org-fs-PfmH2IwE.js","assets/question-004-sINsf4GQ.js","assets/use-members-ChLgHSO3.js","assets/use-org-auth-client-BcltMH40.js","assets/feature-paywall-Bl0cYtHt.js","assets/plan-ladder-BfylXdSz.js","assets/add-connection-dialog-C8n1sIiv.js","assets/extract-connection-data-ByvXZO_i.js","assets/metadata-D72DunRR.js","assets/connection-C15f5bNS.js","assets/connection-card-BMeKUGng.js","assets/connection-slug-CITJ0kGN.js","assets/connection-form-helpers-CmIBkFb3.js","assets/authenticate-and-persist-oauth-D88bk5XQ.js","assets/mcp-oauth-D1pDEEn0.js","assets/collection-tabs-DS-Im1ic.js","assets/badge-CN6KFcHa.js","assets/use-infinite-scroll-BwJMlu6L.js","assets/useSuspenseInfiniteQuery-CXyd6z14.js","assets/sandbox-lifecycle-context-244BQJ78.js","assets/use-task-metadata-CJ-QxfGm.js","assets/use-project-native-view-presence-CsPNZgcc.js","assets/site-slug-uya6Wp4-.js","assets/virtual-mcp-7pXCbTsW.js","assets/feature-gate-CGTKfO9Z.js","assets/mustache-_05g5fSZ.js","assets/empty-state-BimfTH5j.js","assets/empty-state-BV17J4rU.js","assets/github-icon-8fpS8l__.js","assets/repository-import-picker-DmgbIRex.js","assets/repository-picker-BdbJB8MH.js","assets/post-editor-B77-jPfP.js","assets/multi-select-C1vxoOWR.js","assets/block-document-9qy4_FT6.js","assets/index-DdGk5PPa.js","assets/use-fast-preview-draft-url-DUGuDJ0B.js","assets/use-autosave-DgwX0mMm.js","assets/record-editor-BZi1czEu.js","assets/context-waQx2W4V.js","assets/index-BRVGbtHX.js","assets/get-initials-D-f_fDFw.js","assets/category-editor-Bvuph8Uc.js","assets/sections-editor-Wq74SyFR.js","assets/page-seo-form-Bxx9SwNT.js","assets/variant-matcher-override-4dV3T02L.js","assets/seo-editor-D1cw49ws.js","assets/variant-calendar-7H3LNEKh.js","assets/view-mode-toggle-BQub2iHi.js","assets/post-calendar-Deyu5RSY.js","assets/alert-DJICfxE6.js","assets/redirect-editor-BrsiQdWf.js"])))=>i.map(i=>d[i]);
2
- import{c as ae,b as we,j as n,m as hs,K as Bt,l as xe,r as $,h as rt,B as Be,o as Co,e as Po,t as me,a6 as js,aB as wt,aK as vt,F as Ft,aC as Rs,H as Kt,I as zt,av as To,_ as Bo,$ as Eo,G as We,am as Et,aL as cs,aM as _o,a0 as Do,u as jn,aI as qe}from"./index-CFZrnnmD.js";import{A as Ao}from"./agent-view-guard-DH71qayK.js";import{F as $o}from"./feature-gate-CGTKfO9Z.js";import{u as _t,b as kn}from"./chat-context-mOTo9_NI.js";import{i as Yt}from"./AlertCircle-BQBmepo1.js";import{L as Lo,B as Sn,M as Nn,N as wn,O as tt,P as Cn,Q as ks,R as Oo,S as Pn,T as Io,G as Tn,U as Ro,V as Fo,W as Ct,X as Ko,Y as zo,n as Mo,Z as Vo,_ as Bn,$ as Go,a0 as Uo,y as En}from"./agent-icon-b_XHjZEZ.js";import{c as Fs}from"./UserSquare-BfH7tTry.js";import{i as _n}from"./ZoomOut-C8BTMnO9.js";import{i as Mt,a as Ks}from"./Share07-DxxTtQWb.js";import{c as Dn,i as Ho}from"./XClose-Cx8dSxYY.js";import{s as Ss}from"./Plus-t4kIBGIE.js";import{i as An}from"./SearchLg-DrU6iSmg.js";import{t as $n}from"./Users01-BBUvRTwh.js";import{f as qo,e as Jo,b as Wo,A as Yo,a as Qo,d as Xo,c as Zo,g as ea}from"./alert-dialog-DehGSRTj.js";import{S as Qt}from"./scroll-area-DWMWIudU.js";import{T as Ye,a as Qe,c as Xe}from"./tooltip-CPnP6Sjs.js";import{B as ot}from"./badge-CN6KFcHa.js";import{S as ds,n as ta,c as sa,g as Ln,B as us,P as na,h as On,o as oa,i as gs,u as Xt,l as aa,q as la,R as ia,s as In,r as ra,t as ca,d as Rn,v as da,w as ua,x as Fn,y as ma,M as fa,j as pa,z as ha,p as ga,A as xa,C as ba,e as ya,f as va,D as zs,E as Kn,k as ja,F as ka}from"./runnable-block-editor-C-z6sg8d.js";import{r as Ns,S as Sa,l as ws,i as Na,m as wa,o as Ca,n as It,v as Pa,R as zn,G as Cs,g as Ta,q as Ba,e as Ms,t as Ea,d as _a,w as Da,x as Vs,h as Aa,y as $a,z as La}from"./claim-phase-copy-nu5hupgI.js";import{u as Mn,P as Oa}from"./mustache-_05g5fSZ.js";import{t as ht}from"./ChevronUp-wyCoS3df.js";import{i as Vn}from"./Zap-Da5qzBL9.js";import{C as Ia,a as Ra,b as Fa}from"./collapsible-gVegBMwF.js";import{c as Ka,d as za}from"./sandbox-lifecycle-context-244BQJ78.js";import{u as Gn}from"./use-session-runtime-BVLmSBh6.js";import{c as gt,d as ct,e as xt,b as dt,D as ut,h as Vt,a as Ma}from"./dialog-Dcra4McE.js";import{I as Ze}from"./input-B_-SnRO5.js";import{C as Zt}from"./checkbox-I2peiheL.js";import{L as ze}from"./label-DSLU6fFz.js";import{c as Va,b as Ga,a as Ua,d as Ha,S as qa}from"./select-BOM-aKhP.js";import{b as Ja,a as Wa,p as Ya,s as Qa,t as Gs}from"./decofile-api-DwohDDOu.js";import{o as Xa}from"./sandbox-git-api-B1R0585s.js";import{a as Us}from"./utils-D2y8J057.js";import{i as Za}from"./CheckCircle-CySwUqst.js";import{s as Ps}from"./Trash01-DHtEq5nA.js";import{i as ms}from"./Upload01--yrzZIir.js";import{E as el}from"./empty-state-BimfTH5j.js";import{T as Rt}from"./textarea-CDG_4h5K.js";import{u as tl}from"./use-ai-providers-BV_DvH7o.js";import{M as Un}from"./monaco-editor-rG_ojQtN.js";import{i as Ts}from"./X-xX_XXXXt.js";import{c as sl,b as nl}from"./XCircle-Bdqr7Csd.js";import{d as Hn,a as ol}from"./use-virtual-mcp-B1-yfeBH.js";import"./rich-text-link-control-CFnLXxfY.js";import{a as al}from"./Copy01-CMEvgxoC.js";import{b as ll}from"./Tool01-CaOf6Mu4.js";import{b as Hs}from"./use-project-scope-BspeH_sq.js";import{E as il}from"./empty-state-BV17J4rU.js";import{G as qs}from"./github-icon-8fpS8l__.js";import{R as rl}from"./repository-import-picker-DmgbIRex.js";import{b as cl}from"./thread-route-CIar6WIg.js";function dl(t){const e=ae.c(18),{title:s,description:o,children:a}=t,l=we();let i;e[0]!==a?(i=n.jsx("div",{"aria-hidden":"true",inert:!0,className:"pointer-events-none h-full select-none overflow-hidden",children:a}),e[0]=a,e[1]=i):i=e[1];let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(Lo,{}),e[2]=c):c=e[2];let r;e[3]!==l?(r=l("common.soon"),e[3]=l,e[4]=r):r=e[4];let d;e[5]!==r?(d=n.jsxs(ot,{variant:"secondary",children:[c,r]}),e[5]=r,e[6]=d):d=e[6];let p;e[7]!==s?(p=n.jsx("p",{className:"text-base font-semibold text-foreground",children:s}),e[7]=s,e[8]=p):p=e[8];let m;e[9]!==o?(m=o&&n.jsx("p",{className:"text-sm text-muted-foreground",children:o}),e[9]=o,e[10]=m):m=e[10];let h;e[11]!==d||e[12]!==p||e[13]!==m?(h=n.jsx("div",{className:"absolute inset-0 z-20 flex items-center justify-center bg-background/60 p-6 backdrop-blur-sm",children:n.jsxs("div",{className:"flex max-w-sm flex-col items-center gap-3 rounded-2xl border bg-card px-8 py-6 text-center shadow-lg",children:[d,p,m]})}),e[11]=d,e[12]=p,e[13]=m,e[14]=h):h=e[14];let u;return e[15]!==i||e[16]!==h?(u=n.jsxs("div",{className:"relative h-full min-h-0",children:[i,h]}),e[15]=i,e[16]=h,e[17]=u):u=e[17],u}function ul(t,e){if(!t||!e?.length)return t;const s=Object.fromEntries(Object.entries(t.properties??{}).filter(([o])=>!e.includes(o)));return Object.keys(s).length>0?{...t,properties:s}:t}function ml(t,e,s){return typeof t!="string"?null:ul(Ns(t,e),s)}function qn(t,e,s){if(!e||typeof t!="string")return!1;const o=ml(t,e,s);return!!o&&Object.keys(o.properties??{}).length>0}function jt(t){const e=ae.c(6),{hasItems:s,emptyLabel:o,emptyHint:a}=t;let l;e[0]!==a||e[1]!==o||e[2]!==s?(l=s?"No results match your search.":n.jsxs(n.Fragment,{children:[n.jsx("div",{children:o}),n.jsx("div",{className:"mt-1 text-muted-foreground/80",children:a})]}),e[0]=a,e[1]=o,e[2]=s,e[3]=l):l=e[3];let i;return e[4]!==l?(i=n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:l}),e[4]=l,e[5]=i):i=e[5],i}function es(t,e){return`${t}-${e}`}function Jn(t,e){return`site/apps/${t}/${e}.ts`}function Wn(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 fl(t){const e=t.match(/^([^-]+)-(.+)$/);return e?{vendor:e[1],app:e[2]}:null}function pl(t){return t==="local"?"Custom":"Installed"}function Yn(t,e,s){const o=new Set([es(t,e),e].map(l=>l.toLowerCase())),a=Jn(t,e);for(const[l,i]of Object.entries(s)){if(l.includes("/")||!i||typeof i!="object"||Array.isArray(i))continue;const c=i;if(o.has(l.toLowerCase())||c.__resolveType===a)return l}return null}function hl(t,e){const s=t.vendor.alias,o=t.name,a=Yn(s,o,e);return{id:es(s,o),app:o,vendor:s,title:t.title||t.name,description:t.description,category:t.category??"Other",logo:t.logo||void 0,resolveType:Jn(s,o),blockKey:a,installed:a!==null}}function gl(t,e,s){if(t===Sa)return null;const o=Wn(t);if(!o)return null;const{vendor:a,app:l}=o,i=Yn(a,l,s),c=ws(t,e);return{id:es(a,l),app:l,vendor:a,title:c.title??l,description:c.description??"",category:"Others",logo:c.logo??c.icon,resolveType:t,blockKey:i,installed:i!==null}}function xl(t,e,s){const o=e.__resolveType;if(typeof o!="string"||Na(t,e)||!wa(o))return null;const a=Wn(o)??fl(t);if(!a)return null;const l=ws(o,s),{vendor:i,app:c}=a;return{id:es(i,c),app:c,vendor:i,title:l.title??Ca(t,e,s),description:l.description??"",category:pl(i),logo:l.logo??l.icon,resolveType:o,blockKey:t,installed:!0}}function bl(t,e,s){const o=new Map;for(const l of t){const i=hl(l,s);o.set(i.id,i)}const a=e.manifest?.blocks?.apps??{};for(const l of Object.keys(a)){const i=gl(l,e,s);!i||o.has(i.id)||o.set(i.id,i)}for(const[l,i]of Object.entries(s)){if(l.includes("/")||!i||typeof i!="object"||Array.isArray(i))continue;const c=xl(l,i,e);!c||o.has(c.id)||o.set(c.id,c)}return[...o.values()].sort(yl)}function yl(t,e){return t.installed!==e.installed?t.installed?-1:1:t.title.localeCompare(e.title)}async function vl(){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 jl(t,e,s){const o=ae.c(12),a=s?.enabled??!0;let l;o[0]===Symbol.for("react.memo_cache_sentinel")?(l=Bt.decoApps(),o[0]=l):l=o[0];let i;o[1]!==a?(i={queryKey:l,queryFn:vl,staleTime:3e5,retry:1,enabled:a},o[1]=a,o[2]=i):i=o[2];const c=hs(i);let r;o[3]!==e||o[4]!==t||o[5]!==c.data?(r=t&&e?bl(c.data??[],t,e):[],o[3]=e,o[4]=t,o[5]=c.data,o[6]=r):r=o[6];const d=r,p=c.isLoading&&!c.isError;let m;return o[7]!==d||o[8]!==c.isError||o[9]!==c.refetch||o[10]!==p?(m={catalog:d,isLoading:p,isError:c.isError,refetch:c.refetch},o[7]=d,o[8]=c.isError,o[9]=c.refetch,o[10]=p,o[11]=m):m=o[11],m}const kl=["sections","apps","loaders","actions"];function Sl(t){const e=ae.c(59),{active:s,counts:o,showBlog:a,onSelect:l}=t,i=we();let c;e[0]!==i?(c=i("sandbox.collectionsSidebar.content"),e[0]=i,e[1]=c):c=e[1];let r;e[2]!==c?(r=n.jsx("div",{className:"px-3 h-12 flex items-center border-b shrink-0",children:n.jsx("span",{className:"text-sm font-medium",children:c})}),e[2]=c,e[3]=r):r=e[3];let d;e[4]!==i?(d=i("sandbox.collectionsSidebar.pages"),e[4]=i,e[5]=d):d=e[5];const p=s==="pages";let m;e[6]!==o.pages||e[7]!==l||e[8]!==d||e[9]!==p?(m=n.jsx(Fe,{id:"pages",icon:Sn,label:d,count:o.pages,active:p,onSelect:l}),e[6]=o.pages,e[7]=l,e[8]=d,e[9]=p,e[10]=m):m=e[10];let h;e[11]!==i?(h=i("sandbox.collectionsSidebar.redirects"),e[11]=i,e[12]=h):h=e[12];const u=s==="redirects";let f;e[13]!==o.redirects||e[14]!==l||e[15]!==h||e[16]!==u?(f=n.jsx(Fe,{id:"redirects",icon:Nn,label:h,count:o.redirects,active:u,onSelect:l}),e[13]=o.redirects,e[14]=l,e[15]=h,e[16]=u,e[17]=f):f=e[17];let x;e[18]!==i?(x=i("sandbox.collectionsSidebar.site"),e[18]=i,e[19]=x):x=e[19];const g=s==="site";let y;e[20]!==l||e[21]!==g||e[22]!==x?(y=n.jsx(Fe,{id:"site",icon:Oo,label:x,active:g,onSelect:l}),e[20]=l,e[21]=g,e[22]=x,e[23]=y):y=e[23];let v;e[24]!==i?(v=i("sandbox.collectionsSidebar.seo"),e[24]=i,e[25]=v):v=e[25];const j=s==="seo";let N;e[26]!==l||e[27]!==v||e[28]!==j?(N=n.jsx(Fe,{id:"seo",icon:Pn,label:v,active:j,onSelect:l}),e[26]=l,e[27]=v,e[28]=j,e[29]=N):N=e[29];let w;e[30]!==i?(w=i("sandbox.collectionsSidebar.calendar"),e[30]=i,e[31]=w):w=e[31];const E=s==="calendar";let B;e[32]!==l||e[33]!==w||e[34]!==E?(B=n.jsx(Fe,{id:"calendar",icon:Io,label:w,active:E,onSelect:l}),e[32]=l,e[33]=w,e[34]=E,e[35]=B):B=e[35];let k;e[36]!==s||e[37]!==o||e[38]!==l?(k=n.jsx(Nl,{active:s,counts:o,onSelect:l}),e[36]=s,e[37]=o,e[38]=l,e[39]=k):k=e[39];let D;e[40]!==s||e[41]!==o.authors||e[42]!==o.categories||e[43]!==o.posts||e[44]!==l||e[45]!==a||e[46]!==i?(D=a&&n.jsxs(n.Fragment,{children:[n.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:[n.jsx(wn,{size:13,className:"shrink-0"}),i("sandbox.collectionsSidebar.blog")]}),n.jsx(Fe,{id:"context",icon:tt,label:i("sandbox.collectionsSidebar.context"),active:s==="context",onSelect:l}),n.jsx(Fe,{id:"posts",icon:_n,label:i("sandbox.collectionsSidebar.posts"),count:o.posts,active:s==="posts",onSelect:l}),n.jsx(Fe,{id:"authors",icon:$n,label:i("sandbox.collectionsSidebar.authors"),count:o.authors,active:s==="authors",onSelect:l}),n.jsx(Fe,{id:"categories",icon:Cn,label:i("sandbox.collectionsSidebar.categories"),count:o.categories,active:s==="categories",onSelect:l}),n.jsx(Fe,{id:"post-schedule",icon:ks,label:i("sandbox.collectionsSidebar.postSchedule"),active:s==="post-schedule",onSelect:l})]}),e[40]=s,e[41]=o.authors,e[42]=o.categories,e[43]=o.posts,e[44]=l,e[45]=a,e[46]=i,e[47]=D):D=e[47];let O;e[48]!==y||e[49]!==N||e[50]!==B||e[51]!==k||e[52]!==D||e[53]!==m||e[54]!==f?(O=n.jsxs("nav",{className:"flex flex-col p-1.5 gap-0.5",children:[m,f,y,N,B,k,D]}),e[48]=y,e[49]=N,e[50]=B,e[51]=k,e[52]=D,e[53]=m,e[54]=f,e[55]=O):O=e[55];let L;return e[56]!==r||e[57]!==O?(L=n.jsxs("div",{className:"w-[208px] shrink-0 border-r flex flex-col",children:[r,O]}),e[56]=r,e[57]=O,e[58]=L):L=e[58],L}function Nl(t){const e=ae.c(52),{active:s,counts:o,onSelect:a}=t,l=we();let i;e[0]!==s?(i=kl.includes(s),e[0]=s,e[1]=i):i=e[1];const c=i,[r,d]=$.useState(!1),p=r||c;let m,h;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=xe("flex w-full items-center gap-2 classic:rounded-md compact: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"),h=n.jsx(Ro,{size:16,className:"shrink-0"}),e[2]=m,e[3]=h):(m=e[2],h=e[3]);let u;e[4]!==l?(u=l("sandbox.collectionsSidebar.advanced"),e[4]=l,e[5]=u):u=e[5];let f;e[6]!==u?(f=n.jsx("span",{className:"flex-1 truncate",children:u}),e[6]=u,e[7]=f):f=e[7];const x=p&&"rotate-180";let g;e[8]!==x?(g=xe("shrink-0 text-muted-foreground/70 transition-transform",x),e[8]=x,e[9]=g):g=e[9];let y;e[10]!==g?(y=n.jsx(ht,{size:16,className:g}),e[10]=g,e[11]=y):y=e[11];let v;e[12]!==f||e[13]!==y?(v=n.jsxs(Ia,{className:m,children:[h,f,y]}),e[12]=f,e[13]=y,e[14]=v):v=e[14];let j;e[15]!==l?(j=l("sandbox.collectionsSidebar.sections"),e[15]=l,e[16]=j):j=e[16];const N=s==="sections";let w;e[17]!==o.sections||e[18]!==a||e[19]!==j||e[20]!==N?(w=n.jsx(Fe,{id:"sections",icon:Mt,label:j,count:o.sections,active:N,onSelect:a,indent:!0}),e[17]=o.sections,e[18]=a,e[19]=j,e[20]=N,e[21]=w):w=e[21];let E;e[22]!==l?(E=l("sandbox.collectionsSidebar.apps"),e[22]=l,e[23]=E):E=e[23];const B=s==="apps";let k;e[24]!==o.apps||e[25]!==a||e[26]!==E||e[27]!==B?(k=n.jsx(Fe,{id:"apps",icon:Dn,label:E,count:o.apps,active:B,onSelect:a,indent:!0}),e[24]=o.apps,e[25]=a,e[26]=E,e[27]=B,e[28]=k):k=e[28];let D;e[29]!==l?(D=l("sandbox.collectionsSidebar.loaders"),e[29]=l,e[30]=D):D=e[30];const O=s==="loaders";let L;e[31]!==o.loaders||e[32]!==a||e[33]!==D||e[34]!==O?(L=n.jsx(Fe,{id:"loaders",icon:Tn,label:D,count:o.loaders,active:O,onSelect:a,indent:!0}),e[31]=o.loaders,e[32]=a,e[33]=D,e[34]=O,e[35]=L):L=e[35];let K;e[36]!==l?(K=l("sandbox.collectionsSidebar.actions"),e[36]=l,e[37]=K):K=e[37];const F=s==="actions";let _;e[38]!==o.actions||e[39]!==a||e[40]!==K||e[41]!==F?(_=n.jsx(Fe,{id:"actions",icon:Vn,label:K,count:o.actions,active:F,onSelect:a,indent:!0}),e[38]=o.actions,e[39]=a,e[40]=K,e[41]=F,e[42]=_):_=e[42];let A;e[43]!==w||e[44]!==k||e[45]!==L||e[46]!==_?(A=n.jsxs(Ra,{className:"flex flex-col gap-0.5 pt-0.5",children:[w,k,L,_]}),e[43]=w,e[44]=k,e[45]=L,e[46]=_,e[47]=A):A=e[47];let I;return e[48]!==p||e[49]!==A||e[50]!==v?(I=n.jsxs(Fa,{open:p,onOpenChange:d,children:[v,A]}),e[48]=p,e[49]=A,e[50]=v,e[51]=I):I=e[51],I}function Fe(t){const e=ae.c(19),{id:s,icon:o,label:a,count:l,active:i,onSelect:c,indent:r}=t;let d;e[0]!==s||e[1]!==c?(d=()=>c(s),e[0]=s,e[1]=c,e[2]=d):d=e[2];const p=r&&"pl-6",m=i?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground";let h;e[3]!==p||e[4]!==m?(h=xe("flex w-full items-center gap-2 classic:rounded-md compact:rounded-lg px-2.5 py-1.5 text-left text-sm transition-colors cursor-pointer",p,m),e[3]=p,e[4]=m,e[5]=h):h=e[5];let u;e[6]!==o?(u=n.jsx(o,{size:16,className:"shrink-0"}),e[6]=o,e[7]=u):u=e[7];let f;e[8]!==a?(f=n.jsx("span",{className:"flex-1 truncate",children:a}),e[8]=a,e[9]=f):f=e[9];let x;e[10]!==i||e[11]!==l?(x=l!==void 0&&n.jsx("span",{className:xe("shrink-0 text-xs tabular-nums",i?"text-accent-foreground/70":"text-muted-foreground/70"),children:l}),e[10]=i,e[11]=l,e[12]=x):x=e[12];let g;return e[13]!==d||e[14]!==h||e[15]!==u||e[16]!==f||e[17]!==x?(g=n.jsxs("button",{type:"button",onClick:d,className:h,children:[u,f,x]}),e[13]=d,e[14]=h,e[15]=u,e[16]=f,e[17]=x,e[18]=g):g=e[18],g}function wl(t){const e=ae.c(12),{state:s,claimPhase:o,lifecycle:a,onStart:l,connectionsHref:i}=t;switch(s.kind){case"starting":{let c;e[0]!==o||e[1]!==a?(c=ta({claimPhase:o,lifecycle:a}),e[0]=o,e[1]=a,e[2]=c):c=e[2];let r;return e[3]!==o||e[4]!==c?(r=n.jsx(ds,{kind:"starting",progress:c,claimPhase:o}),e[3]=o,e[4]=c,e[5]=r):r=e[5],r}case"suspended":{let c;return e[6]!==l?(c=n.jsx(ds,{kind:"suspended",onResume:l}),e[6]=l,e[7]=c):c=e[7],c}case"errored":{let c;return e[8]!==i||e[9]!==l||e[10]!==s.error?(c=n.jsx(ds,{kind:"errored",error:s.error,onRetry:l,connectionsHref:i}),e[8]=i,e[9]=l,e[10]=s.error,e[11]=c):c=e[11],c}}}const Cl=new Set(["clone-failed","install-failed","start-failed","crashed"]);function Pl(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&&!Cl.has(t.lifecyclePhase);return{kind:"ready",devServerReady:e,sandboxWarming:s}}function Js(t,e){const s=e.replace(/\s*\(copy(?:\s+\d+)?\)\s*$/,"").trim(),o=`${s} (copy)`;if(!t.has(o))return o;for(let a=2;a<1e3;a++){const l=`${s} (copy ${a})`;if(!t.has(l))return l}return`${s} (copy ${Date.now()})`}function Tl(t,e){const s=It,o=e.replace(/-copy(?:-\d+)?$/,""),a=`${o}-copy`;if(!t.has(s(a)))return a;for(let l=2;l<1e3;l++){const i=`${o}-copy-${l}`;if(!t.has(s(i)))return i}return`${o}-copy-${Date.now()}`}function Bl(t,e){const s=e.replace(/_copy(?:_\d+)?$/,""),o=`${s}_copy`;if(!Object.hasOwn(t,o))return o;for(let a=2;a<1e3;a++){const l=`${s}_copy_${a}`;if(!Object.hasOwn(t,l))return l}return`${s}_copy_${Date.now()}`}function El(t){const e=Ln(t.newName),s={...t.source,name:t.newName,path:t.newPath};return{key:e,data:s}}function _l(t,e){return sa(t,e)}const Dl=1e3;function Al(t,e){for(let s=0;s<Dl;s++){const o=Ln(e);if(!Object.hasOwn(t,o))return o}throw new Error("Could not generate a unique page block key")}const $l={create:"sandbox.pageFormDialog.titleCreate",duplicate:"sandbox.pageFormDialog.titleDuplicate",rename:"sandbox.pageFormDialog.titleRename"},Ll={create:"sandbox.pageFormDialog.submitCreate",duplicate:"sandbox.pageFormDialog.submitDuplicate",rename:"sandbox.pageFormDialog.submitSave"},Ol={create:"sandbox.pageFormDialog.pendingCreate",duplicate:"sandbox.pageFormDialog.pendingDuplicate",rename:"sandbox.pageFormDialog.pendingSave"};function Il(t){const e=ae.c(88),{open:s,mode:o,initialName:a,initialPath:l,isPending:i,error:c,templates:r,validate:d,onSubmit:p,onOpenChange:m}=t,h=i===void 0?!1:i,u=we(),[f,x]=$.useState(a),[g,y]=$.useState(l),[v,j]=$.useState(us),[N,w]=$.useState(null),[E,B]=$.useState(s);s!==E&&(B(s),s&&(x(a),y(l),j(us),w(null)));const k=o==="create"&&!!r?.length;let D;e[0]!==h||e[1]!==m?(D=pe=>{!pe&&!h&&(w(null),m(!1))},e[0]=h,e[1]=m,e[2]=D):D=e[2];const O=D;let L;e[3]!==h||e[4]!==f||e[5]!==p||e[6]!==g||e[7]!==k||e[8]!==v||e[9]!==d?(L=async pe=>{pe.preventDefault();const ke=f.trim(),he=g.trim();if(!ke||!he||h)return;const je=Pa(he);if(je){w(je);return}const Se=d?.({name:ke,path:he});if(Se){w(Se);return}w(null),await p({name:ke,path:he,templateKey:k&&v!==us?v:null})},e[3]=h,e[4]=f,e[5]=p,e[6]=g,e[7]=k,e[8]=v,e[9]=d,e[10]=L):L=e[10];const K=L,F=N??c,_=$l[o];let A;e[11]!==u||e[12]!==_?(A=u(_),e[11]=u,e[12]=_,e[13]=A):A=e[13];let I;e[14]!==A?(I=n.jsx(gt,{children:n.jsx(ct,{children:A})}),e[14]=A,e[15]=I):I=e[15];let R;e[16]!==h||e[17]!==k||e[18]!==u||e[19]!==v||e[20]!==r?(R=k&&n.jsxs("div",{className:"space-y-1.5",children:[n.jsx("label",{htmlFor:"page-form-template",className:"text-xs font-medium text-muted-foreground",children:u("sandbox.pageFormDialog.labelTemplate")}),n.jsx(na,{id:"page-form-template",value:v,onChange:j,templates:r??[],disabled:h})]}),e[16]=h,e[17]=k,e[18]=u,e[19]=v,e[20]=r,e[21]=R):R=e[21];let V;e[22]!==u?(V=u("sandbox.pageFormDialog.labelName"),e[22]=u,e[23]=V):V=e[23];let z;e[24]!==V?(z=n.jsx("label",{htmlFor:"page-form-name",className:"text-xs font-medium text-muted-foreground",children:V}),e[24]=V,e[25]=z):z=e[25];let W;e[26]===Symbol.for("react.memo_cache_sentinel")?(W=pe=>x(pe.target.value),e[26]=W):W=e[26];let P;e[27]!==u?(P=u("sandbox.pageFormDialog.placeholderName"),e[27]=u,e[28]=P):P=e[28];let U;e[29]!==h||e[30]!==f||e[31]!==P?(U=n.jsx(Ze,{id:"page-form-name",value:f,onChange:W,placeholder:P,autoFocus:!0,disabled:h}),e[29]=h,e[30]=f,e[31]=P,e[32]=U):U=e[32];let Y;e[33]!==U||e[34]!==z?(Y=n.jsxs("div",{className:"space-y-1.5",children:[z,U]}),e[33]=U,e[34]=z,e[35]=Y):Y=e[35];let q;e[36]!==u?(q=u("sandbox.pageFormDialog.labelPath"),e[36]=u,e[37]=q):q=e[37];let X;e[38]!==q?(X=n.jsx("label",{htmlFor:"page-form-path",className:"text-xs font-medium text-muted-foreground",children:q}),e[38]=q,e[39]=X):X=e[39];let ce;e[40]===Symbol.for("react.memo_cache_sentinel")?(ce=pe=>y(pe.target.value),e[40]=ce):ce=e[40];let ne;e[41]!==u?(ne=u("sandbox.pageFormDialog.placeholderPath"),e[41]=u,e[42]=ne):ne=e[42];let de;e[43]!==h||e[44]!==g||e[45]!==ne?(de=n.jsx(Ze,{id:"page-form-path",value:g,onChange:ce,placeholder:ne,disabled:h}),e[43]=h,e[44]=g,e[45]=ne,e[46]=de):de=e[46];let te;e[47]!==X||e[48]!==de?(te=n.jsxs("div",{className:"space-y-1.5",children:[X,de]}),e[47]=X,e[48]=de,e[49]=te):te=e[49];let re;e[50]!==F?(re=F&&n.jsx("p",{className:"text-xs text-destructive",children:F}),e[50]=F,e[51]=re):re=e[51];let le;e[52]!==Y||e[53]!==te||e[54]!==re||e[55]!==R?(le=n.jsxs("div",{className:"space-y-4 py-4",children:[R,Y,te,re]}),e[52]=Y,e[53]=te,e[54]=re,e[55]=R,e[56]=le):le=e[56];let C;e[57]!==m?(C=()=>m(!1),e[57]=m,e[58]=C):C=e[58];let J;e[59]!==u?(J=u("sandbox.pageFormDialog.buttonCancel"),e[59]=u,e[60]=J):J=e[60];let Z;e[61]!==h||e[62]!==C||e[63]!==J?(Z=n.jsx(Be,{type:"button",variant:"outline",onClick:C,disabled:h,children:J}),e[61]=h,e[62]=C,e[63]=J,e[64]=Z):Z=e[64];let oe;e[65]!==h||e[66]!==f||e[67]!==g?(oe=!f.trim()||!g.trim()||h,e[65]=h,e[66]=f,e[67]=g,e[68]=oe):oe=e[68];let S;e[69]!==h||e[70]!==o||e[71]!==u?(S=h?n.jsxs(n.Fragment,{children:[n.jsx(rt,{className:"size-3.5"}),u(Ol[o])]}):u(Ll[o]),e[69]=h,e[70]=o,e[71]=u,e[72]=S):S=e[72];let se;e[73]!==oe||e[74]!==S?(se=n.jsx(Be,{type:"submit",disabled:oe,children:S}),e[73]=oe,e[74]=S,e[75]=se):se=e[75];let H;e[76]!==Z||e[77]!==se?(H=n.jsxs(xt,{children:[Z,se]}),e[76]=Z,e[77]=se,e[78]=H):H=e[78];let ie;e[79]!==K||e[80]!==le||e[81]!==H||e[82]!==I?(ie=n.jsx(dt,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:K,children:[I,le,H]})}),e[79]=K,e[80]=le,e[81]=H,e[82]=I,e[83]=ie):ie=e[83];let ye;return e[84]!==O||e[85]!==s||e[86]!==ie?(ye=n.jsx(ut,{open:s,onOpenChange:O,children:ie}),e[84]=O,e[85]=s,e[86]=ie,e[87]=ye):ye=e[87],ye}const Rl=[{value:"temporary",labelKey:"sandbox.redirectEditor.typeTemporary"},{value:"permanent",labelKey:"sandbox.redirectEditor.typePermanent"}],Ws={from:"",to:"",type:"temporary",discardQueryParameters:!1};function Fl(t){const e=ae.c(111),{open:s,isPending:o,error:a,onSubmit:l,onOpenChange:i}=t,c=o===void 0?!1:o,r=we(),[d,p]=$.useState(Ws),[m,h]=$.useState(null),[u,f]=$.useState(s);s!==u&&(f(s),s&&(p(Ws),h(null)));let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=ge=>p($e=>({...$e,...ge})),e[0]=x):x=e[0];const g=x;let y;e[1]!==c||e[2]!==i?(y=ge=>{!ge&&!c&&(h(null),i(!1))},e[1]=c,e[2]=i,e[3]=y):y=e[3];const v=y;let j;e[4]!==c||e[5]!==l||e[6]!==d||e[7]!==r?(j=async ge=>{ge.preventDefault();const $e=d.from.trim(),Le=d.to.trim();if(!$e||!Le||c){h(r("sandbox.redirectFormDialog.errorRequired"));return}h(null),await l({...d,from:$e,to:Le})},e[4]=c,e[5]=l,e[6]=d,e[7]=r,e[8]=j):j=e[8];const N=j,w=m??a;let E;e[9]!==c||e[10]!==d.from||e[11]!==d.to?(E=!!d.from.trim()&&!!d.to.trim()&&!c,e[9]=c,e[10]=d.from,e[11]=d.to,e[12]=E):E=e[12];const B=E;let k;e[13]!==r?(k=r("sandbox.redirectFormDialog.title"),e[13]=r,e[14]=k):k=e[14];let D;e[15]!==k?(D=n.jsx(gt,{children:n.jsx(ct,{children:k})}),e[15]=k,e[16]=D):D=e[16];let O;e[17]!==r?(O=r("sandbox.redirectEditor.fromLabel"),e[17]=r,e[18]=O):O=e[18];let L;e[19]!==O?(L=n.jsx(ze,{htmlFor:"redirect-form-from",children:O}),e[19]=O,e[20]=L):L=e[20];const K=d.from;let F;e[21]===Symbol.for("react.memo_cache_sentinel")?(F=ge=>g({from:ge.target.value}),e[21]=F):F=e[21];let _;e[22]!==r?(_=r("sandbox.redirectEditor.fromPlaceholder"),e[22]=r,e[23]=_):_=e[23];let A;e[24]!==c||e[25]!==d.from||e[26]!==_?(A=n.jsx(Ze,{id:"redirect-form-from",value:K,onChange:F,placeholder:_,autoFocus:!0,disabled:c}),e[24]=c,e[25]=d.from,e[26]=_,e[27]=A):A=e[27];let I;e[28]!==A||e[29]!==L?(I=n.jsxs("div",{className:"space-y-1.5",children:[L,A]}),e[28]=A,e[29]=L,e[30]=I):I=e[30];let R;e[31]!==r?(R=r("sandbox.redirectEditor.toLabel"),e[31]=r,e[32]=R):R=e[32];let V;e[33]!==R?(V=n.jsx(ze,{htmlFor:"redirect-form-to",children:R}),e[33]=R,e[34]=V):V=e[34];const z=d.to;let W;e[35]===Symbol.for("react.memo_cache_sentinel")?(W=ge=>g({to:ge.target.value}),e[35]=W):W=e[35];let P;e[36]!==r?(P=r("sandbox.redirectEditor.toPlaceholder"),e[36]=r,e[37]=P):P=e[37];let U;e[38]!==c||e[39]!==d.to||e[40]!==P?(U=n.jsx(Ze,{id:"redirect-form-to",value:z,onChange:W,placeholder:P,disabled:c}),e[38]=c,e[39]=d.to,e[40]=P,e[41]=U):U=e[41];let Y;e[42]!==V||e[43]!==U?(Y=n.jsxs("div",{className:"space-y-1.5",children:[V,U]}),e[42]=V,e[43]=U,e[44]=Y):Y=e[44];let q;e[45]!==r?(q=r("sandbox.redirectEditor.typeLabel"),e[45]=r,e[46]=q):q=e[46];let X;e[47]!==q?(X=n.jsx(ze,{htmlFor:"redirect-form-type",children:q}),e[47]=q,e[48]=X):X=e[48];const ce=d.type;let ne;e[49]===Symbol.for("react.memo_cache_sentinel")?(ne=ge=>g({type:ge}),e[49]=ne):ne=e[49];let de;e[50]!==r?(de=r("sandbox.redirectEditor.typePlaceholder"),e[50]=r,e[51]=de):de=e[51];let te;e[52]!==de?(te=n.jsx(Ga,{id:"redirect-form-type",className:"w-full",children:n.jsx(Ua,{placeholder:de})}),e[52]=de,e[53]=te):te=e[53];let re;e[54]!==r?(re=Rl.map(ge=>n.jsx(Va,{value:ge.value,children:r(ge.labelKey,{status:zn[ge.value]})},ge.value)),e[54]=r,e[55]=re):re=e[55];let le;e[56]!==re?(le=n.jsx(Ha,{children:re}),e[56]=re,e[57]=le):le=e[57];let C;e[58]!==c||e[59]!==d.type||e[60]!==te||e[61]!==le?(C=n.jsxs(qa,{value:ce,onValueChange:ne,disabled:c,children:[te,le]}),e[58]=c,e[59]=d.type,e[60]=te,e[61]=le,e[62]=C):C=e[62];let J;e[63]!==X||e[64]!==C?(J=n.jsxs("div",{className:"space-y-1.5",children:[X,C]}),e[63]=X,e[64]=C,e[65]=J):J=e[65];let Z;e[66]===Symbol.for("react.memo_cache_sentinel")?(Z=ge=>g({discardQueryParameters:ge===!0}),e[66]=Z):Z=e[66];let oe;e[67]!==c||e[68]!==d.discardQueryParameters?(oe=n.jsx(Zt,{checked:d.discardQueryParameters,disabled:c,onCheckedChange:Z}),e[67]=c,e[68]=d.discardQueryParameters,e[69]=oe):oe=e[69];let S;e[70]!==r?(S=r("sandbox.redirectEditor.discardQueryParameters"),e[70]=r,e[71]=S):S=e[71];let se;e[72]!==S?(se=n.jsx("span",{className:"text-sm",children:S}),e[72]=S,e[73]=se):se=e[73];let H;e[74]!==oe||e[75]!==se?(H=n.jsxs("label",{className:"flex cursor-pointer items-center gap-2.5",children:[oe,se]}),e[74]=oe,e[75]=se,e[76]=H):H=e[76];let ie;e[77]!==w?(ie=w&&n.jsx("p",{className:"text-xs text-destructive",children:w}),e[77]=w,e[78]=ie):ie=e[78];let ye;e[79]!==I||e[80]!==Y||e[81]!==J||e[82]!==H||e[83]!==ie?(ye=n.jsxs("div",{className:"space-y-4 py-4",children:[I,Y,J,H,ie]}),e[79]=I,e[80]=Y,e[81]=J,e[82]=H,e[83]=ie,e[84]=ye):ye=e[84];let pe;e[85]!==i?(pe=()=>i(!1),e[85]=i,e[86]=pe):pe=e[86];let ke;e[87]!==r?(ke=r("sandbox.redirectFormDialog.cancel"),e[87]=r,e[88]=ke):ke=e[88];let he;e[89]!==c||e[90]!==pe||e[91]!==ke?(he=n.jsx(Be,{type:"button",variant:"outline",onClick:pe,disabled:c,children:ke}),e[89]=c,e[90]=pe,e[91]=ke,e[92]=he):he=e[92];const je=!B;let Se;e[93]!==c||e[94]!==r?(Se=c?n.jsxs(n.Fragment,{children:[n.jsx(rt,{className:"size-3.5"}),r("sandbox.redirectFormDialog.pending")]}):r("sandbox.redirectFormDialog.submit"),e[93]=c,e[94]=r,e[95]=Se):Se=e[95];let Ae;e[96]!==je||e[97]!==Se?(Ae=n.jsx(Be,{type:"submit",disabled:je,children:Se}),e[96]=je,e[97]=Se,e[98]=Ae):Ae=e[98];let Ce;e[99]!==he||e[100]!==Ae?(Ce=n.jsxs(xt,{children:[he,Ae]}),e[99]=he,e[100]=Ae,e[101]=Ce):Ce=e[101];let Pe;e[102]!==N||e[103]!==ye||e[104]!==Ce||e[105]!==D?(Pe=n.jsx(dt,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:N,children:[D,ye,Ce]})}),e[102]=N,e[103]=ye,e[104]=Ce,e[105]=D,e[106]=Pe):Pe=e[106];let De;return e[107]!==v||e[108]!==s||e[109]!==Pe?(De=n.jsx(ut,{open:s,onOpenChange:v,children:Pe}),e[107]=v,e[108]=s,e[109]=Pe,e[110]=De):De=e[110],De}function Kl(t){const e=ae.c(70),{open:s,blockKey:o,initialName:a,isPending:l,onSubmit:i,onOpenChange:c}=t,r=l===void 0?!1:l,d=we(),[p,m]=$.useState(a),[h,u]=$.useState(s);s!==h&&(u(s),s&&m(a));let f;e[0]!==r||e[1]!==c?(f=ce=>{!ce&&!r&&c(!1)},e[0]=r,e[1]=c,e[2]=f):f=e[2];const x=f;let g;e[3]!==r||e[4]!==p||e[5]!==i?(g=async ce=>{ce.preventDefault();const ne=p.trim();!ne||r||await i(ne)},e[3]=r,e[4]=p,e[5]=i,e[6]=g):g=e[6];const y=g;let v;e[7]!==d?(v=d("sandbox.sectionRenameDialog.title"),e[7]=d,e[8]=v):v=e[8];let j;e[9]!==v?(j=n.jsx(ct,{children:v}),e[9]=v,e[10]=j):j=e[10];let N;e[11]!==d?(N=d("sandbox.sectionRenameDialog.description"),e[11]=d,e[12]=N):N=e[12];let w;e[13]!==N?(w=n.jsx(Vt,{children:N}),e[13]=N,e[14]=w):w=e[14];let E;e[15]!==j||e[16]!==w?(E=n.jsxs(gt,{children:[j,w]}),e[15]=j,e[16]=w,e[17]=E):E=e[17];let B;e[18]!==d?(B=d("sandbox.sectionRenameDialog.nameLabel"),e[18]=d,e[19]=B):B=e[19];let k;e[20]!==B?(k=n.jsx("label",{htmlFor:"section-rename-name",className:"text-xs font-medium text-muted-foreground",children:B}),e[20]=B,e[21]=k):k=e[21];let D;e[22]===Symbol.for("react.memo_cache_sentinel")?(D=ce=>m(ce.target.value),e[22]=D):D=e[22];let O;e[23]!==r||e[24]!==p?(O=n.jsx(Ze,{id:"section-rename-name",value:p,onChange:D,autoFocus:!0,disabled:r}),e[23]=r,e[24]=p,e[25]=O):O=e[25];let L;e[26]!==k||e[27]!==O?(L=n.jsxs("div",{className:"space-y-1.5",children:[k,O]}),e[26]=k,e[27]=O,e[28]=L):L=e[28];let K;e[29]!==d?(K=d("sandbox.sectionRenameDialog.keyLabel"),e[29]=d,e[30]=K):K=e[30];let F;e[31]!==K?(F=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:K}),e[31]=K,e[32]=F):F=e[32];let _;e[33]!==o?(_=n.jsx(Ze,{value:o,readOnly:!0,disabled:!0,className:"font-mono"}),e[33]=o,e[34]=_):_=e[34];let A;e[35]!==F||e[36]!==_?(A=n.jsxs("div",{className:"space-y-1.5",children:[F,_]}),e[35]=F,e[36]=_,e[37]=A):A=e[37];let I;e[38]!==L||e[39]!==A?(I=n.jsxs("div",{className:"space-y-4 py-4",children:[L,A]}),e[38]=L,e[39]=A,e[40]=I):I=e[40];let R;e[41]!==c?(R=()=>c(!1),e[41]=c,e[42]=R):R=e[42];let V;e[43]!==d?(V=d("sandbox.sectionRenameDialog.cancel"),e[43]=d,e[44]=V):V=e[44];let z;e[45]!==r||e[46]!==R||e[47]!==V?(z=n.jsx(Be,{type:"button",variant:"outline",onClick:R,disabled:r,children:V}),e[45]=r,e[46]=R,e[47]=V,e[48]=z):z=e[48];let W;e[49]!==r||e[50]!==p?(W=!p.trim()||r,e[49]=r,e[50]=p,e[51]=W):W=e[51];let P;e[52]!==r||e[53]!==d?(P=r?n.jsxs(n.Fragment,{children:[n.jsx(rt,{className:"size-3.5"}),d("sandbox.sectionRenameDialog.saving")]}):d("sandbox.sectionRenameDialog.save"),e[52]=r,e[53]=d,e[54]=P):P=e[54];let U;e[55]!==W||e[56]!==P?(U=n.jsx(Be,{type:"submit",disabled:W,children:P}),e[55]=W,e[56]=P,e[57]=U):U=e[57];let Y;e[58]!==z||e[59]!==U?(Y=n.jsxs(xt,{children:[z,U]}),e[58]=z,e[59]=U,e[60]=Y):Y=e[60];let q;e[61]!==y||e[62]!==I||e[63]!==Y||e[64]!==E?(q=n.jsx(dt,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:y,children:[E,I,Y]})}),e[61]=y,e[62]=I,e[63]=Y,e[64]=E,e[65]=q):q=e[65];let X;return e[66]!==x||e[67]!==s||e[68]!==q?(X=n.jsx(ut,{open:s,onOpenChange:x,children:q}),e[66]=x,e[67]=s,e[68]=q,e[69]=X):X=e[69],X}function zl(t){const e=ae.c(7),{type:s}=t,o=zn[s];let a;e[0]!==o?(a=n.jsx(Ye,{asChild:!0,children:n.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:o})}),e[0]=o,e[1]=a):a=e[1];const l=s==="permanent"?"Permanent":"Temporary";let i;e[2]!==l?(i=n.jsx(Qe,{side:"left",children:l}),e[2]=l,e[3]=i):i=e[3];let c;return e[4]!==a||e[5]!==i?(c=n.jsxs(Xe,{children:[a,i]}),e[4]=a,e[5]=i,e[6]=c):c=e[6],c}const Ml=60,fs={post:"blog/loaders/Blogpost.ts",author:"blog/loaders/Author.ts",category:"blog/loaders/Category.ts"},Bs=["posts","authors","categories"],Pt={posts:"post",authors:"author",categories:"category"};function lt(t){return Bs.includes(t)}const ts={posts:"post",authors:"author",categories:"category"},Qn={posts:fs.post,authors:fs.author,categories:fs.category},Vl=Object.fromEntries(Object.entries(Qn).map(([t,e])=>[e,t]));function Gl(t){return typeof t=="string"?Vl[t]??null:null}function Re(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function ee(t){return typeof t=="string"?t:""}function Ul(t,e){switch(t){case"posts":return{label:ee(e.title)||"Untitled post",subtitle:ee(e.slug)};case"authors":return{label:ee(e.name)||"Unnamed author",subtitle:ee(e.email)};case"categories":return{label:ee(e.name)||"Unnamed category",subtitle:ee(e.slug)};default:{const s=t;throw new Error(`Unhandled blog kind: ${String(s)}`)}}}function Xn(t){const e={posts:[],authors:[],categories:[]};for(const[s,o]of Object.entries(t)){const a=Re(o);if(!a)continue;const l=Gl(a.__resolveType);if(!l)continue;const i=Re(a[ts[l]])??{},{label:c,subtitle:r}=Ul(l,i);e[l].push({key:s,kind:l,label:c,subtitle:r})}for(const s of Bs)e[s].sort((o,a)=>o.label.localeCompare(a.label));return e}function Hl(t,e){return Xn(t)[e]}function Ge(t,e){return Hl(t,e).map(s=>({key:s.key,payload:mt(Re(t[s.key])??void 0,e)}))}const Ys=Object.freeze({});function mt(t,e){return t?Re(t[ts[e]])??Ys:Ys}function it(t,e,s){return{name:t,__resolveType:Qn[e],[ts[e]]:s}}function ud({records:t,selected:e,valueField:s,toRef:o}){const a=Array.isArray(e)?e:[],l=h=>typeof h=="string"?h:ee(Re(h)?.[s]),i=h=>typeof h=="string"?h:ee(Re(h)?.name),c=h=>{const u=l(h),f=u?t.find(({payload:g})=>ee(g[s])===u):void 0;if(f)return f;const x=i(h);return x?t.find(({payload:g})=>ee(g.name)===x):void 0},r=t.map(({key:h,payload:u})=>({value:h,label:ee(u.name)||ee(u[s])||h})),d=new Map,p=[];return a.forEach((h,u)=>{const f=c(h);if(f){p.includes(f.key)||p.push(f.key);return}const x=`unresolved:${u}`;d.set(x,h),p.push(x),r.push({value:x,label:i(h)||l(h)||"Unknown"})}),{options:r,selectedValues:p,refsForValues:h=>h.map(u=>{const f=t.find(x=>x.key===u);return f?o(f.payload):d.get(u)}).filter(u=>u!==void 0)}}function et(t){return Array.isArray(t)?t:[]}function nt(t){if(typeof t=="string")return t;const e=Re(t);return e?ee(e.slug):""}function Zn(t){if(typeof t=="string")return t;const e=Re(t);return e?ee(e.email):""}function Es(t){const e=[];return ee(t.title).trim()||e.push("Title"),ee(t.slug).trim()||e.push("Slug"),et(t.categories).map(nt).filter(Boolean).length===0&&e.push("Category"),ee(t.excerpt).trim()||e.push("Excerpt"),ee(t.image).trim()||e.push("Cover image"),e}const _s=["draft","generating","awaiting_review","scheduled","published","archived"],eo=8;function Dt(t){switch(ee(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 ql(t,e){return e!=="published"&&e!=="scheduled"||Dt(t)===e?!1:Es(t).length>0}function Jl(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate()+1,eo).toISOString()}function Gt(t,e,s){if(e!=="scheduled")return{...t,status:e,scheduledDatetime:""};const o=ee(t.scheduledDatetime);return{...t,status:"scheduled",scheduledDatetime:Number.isNaN(new Date(o).getTime())?Jl(s):o}}function to(t){return Ge(t,"posts").map(({key:e,payload:s})=>({key:e,title:ee(s.title)||"Untitled post",slug:ee(s.slug),date:ee(s.date),scheduledDatetime:ee(s.scheduledDatetime),categorySlugs:et(s.categories).map(nt).filter(Boolean),authorEmails:et(s.authors).map(Zn).filter(Boolean),missing:Es(s),status:Dt(s),form:"live"}))}const so="blog-manager/posts/";function no(t){return t.startsWith(so)}function Tt(t){return t.split("/").pop()??t}function Ut(t){return`${so}${t}`}function Wl(t){return`collections/blog/posts/${t}`}function xs(){return bt(12)}function Yl(t){const e=Re(t.planning)??{},s=Re(e.format);return{ideaKey:ee(e.ideaKey)||void 0,pillarKey:ee(e.pillarKey)||void 0,pillarTitle:ee(e.pillarTitle)||void 0,format:s?{name:ee(s.name),value:ee(s.value)}:void 0,brief:ee(e.brief)||void 0}}function oo(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,[ts.posts]:e}}function md(t,e){return no(t)?ft(t,e):it(t,"posts",e)}function Ql(t){const e=[];for(const[s,o]of Object.entries(t)){if(!no(s))continue;const a=Re(o);a&&e.push({key:s,payload:mt(a,"posts")})}return e}function Xl(t){return[...Ql(t).map(({key:s,payload:o})=>({key:s,title:ee(o.title)||"Untitled post",slug:ee(o.slug),date:ee(o.date),scheduledDatetime:ee(o.scheduledDatetime),categorySlugs:et(o.categories).map(nt).filter(Boolean),authorEmails:et(o.authors).map(Zn).filter(Boolean),missing:Es(o),status:Dt(o),form:"planning"})),...to(t)]}function Zl(t,e,s){const o=Gt(t.payload,e,s),a=Tt(t.key),l=e==="scheduled"||e==="published"?"live":"planning",i=l==="live"?Wl(a):Ut(a),c=l==="live"?it(i,"posts",o):ft(i,o);return{writes:{[i]:c},deletes:i===t.key?[]:[t.key]}}function fd(t,e,s){const o=et(t.categories);if(!o.some(c=>nt(c)===e))return t;const a=o.map(c=>{const r=nt(c);return r===e||r===s.slug?{name:s.name,slug:s.slug}:c}),l=new Set,i=a.filter(c=>{const r=nt(c);return r?l.has(r)?!1:(l.add(r),!0):!0});return{...t,categories:i}}function ei(t,e){const s=et(t.categories);return s.some(o=>nt(o)===e)?{...t,categories:s.filter(o=>nt(o)!==e)}:t}function ti(t){const e=ee(t.status),s=e==="idea"||e==="in_review"?{status:Dt(t)}:{};return{...t,...s,dateModified:new Date().toISOString()}}function bt(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 ps(t,e){const s=`collections/blog/${e}/${bt(12)}`;if(!Object.hasOwn(t,s))return s;throw new Error("Could not generate a unique blog block key")}function ao(t){switch(t){case"posts":return{title:"Untitled post",excerpt:"",slug:`untitled-${bt(8)}`,date:new Date().toISOString().slice(0,10),image:"",alt:"",authors:[],categories:[],sections:[]};case"authors":return{name:"New author",type:"Person",email:"",jobTitle:"",company:"",avatar:""};case"categories":return{name:"New category",slug:`category-${bt(8)}`,description:"",sections:[]};default:{const e=t;throw new Error(`Unhandled blog kind: ${String(e)}`)}}}const si={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"}},Qs="Box";function ni(t){return t.startsWith("site/")?"site":"app"}function oi(t){return t.startsWith("http://")||t.startsWith("https://")||t.startsWith("data:")||t.startsWith("/")}function kt(...t){for(const e of t)if(e!==void 0)return e}function Xs(t){if(t&&!(t.includes("/")||/\.(tsx?|jsx?)$/.test(t)))return t}function ai(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 lo(t){const e=new Set,s=[],o=t.manifest?.blocks??{};for(const a of Object.values(o))for(const l of Object.keys(a)){if(!ii(l)||e.has(l))continue;e.add(l);const i=ws(l,t),c=ss(l),r=si[c],d=ni(l),p=Xs(i.title),m=Xs(i.description),h=(d==="site"?kt(p,r?.title):kt(r?.title,p))??ai(c),u=d==="site"?kt(m,r?.description):kt(r?.description,m),f=d==="site"?i.icon:void 0,x=f&&oi(f)?f:void 0,g=x!==void 0?r?.iconName??Qs:kt(f,r?.iconName)??Qs;s.push({resolveType:l,title:h,description:u,iconName:g,iconUrl:x,source:d})}return s.sort((a,l)=>a.title.localeCompare(l.title))}function ss(t){return(t.split("/").pop()??t).replace(/\.(tsx?|jsx?)$/,"")}const li=["blog/sections/blocks/","site/sections/Blog/Post/"];function ii(t){return li.some(e=>t.startsWith(e))}const Ds="blog-manager-brand";function Ke(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 o=Re(s);o&&e.push({name:ee(o.name),value:ee(o.value)})}return e}function Me(t){return t.filter(e=>e.name.trim()||e.value.trim())}const ri=6e4,ci=4e3;function di(t){const e=[],s=new Set,o=(a,l)=>{if(typeof a=="string"){if(!a.includes(" ")||a.length<4||/^(https?:)?\/\//.test(a)||/^data:/.test(a))return;const i=`${l}: ${a.trim()}`;if(s.has(i))return;s.add(i),e.push(i);return}if(Array.isArray(a)){for(const i of a)o(i,l);return}if(a&&typeof a=="object")for(const[i,c]of Object.entries(a))i!=="__resolveType"&&o(c,i)};return o(t,"block"),e.join(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/app-editor-CKcMSoy_.js","assets/index-CIpplZnk.js","assets/index-Cg8hYLBl.css","assets/chat-context-Dx19VUrB.js","assets/use-panel-navigate-CWuMssp-.js","assets/thread-route-CxXnvrpW.js","assets/use-project-scope-CJsyC3na.js","assets/use-virtual-mcp-BFBtWaJR.js","assets/use-mcp-client-Beusq7Tu.js","assets/auth-DkozDQfT.js","assets/github-repo-BknN0SVI.js","assets/autosend-DNj6HoOh.js","assets/thread-intent-glwqnDtC.js","assets/slugify-CEUa2lfQ.js","assets/hooks-CXbyAtVG.js","assets/backoff-8mStPHYB.js","assets/task-board-CGkhJUE0.js","assets/schema-CPd5aeYI.js","assets/use-is-desktop-app-BNujXJc_.js","assets/use-entitlements-DmXuSjaB.js","assets/use-ai-providers-BCh0GxqC.js","assets/location-oTTXFrSF.js","assets/use-decopilot-events-AZfnvS0v.js","assets/use-organization-settings-0Zwi3Fi0.js","assets/scroll-area-BmpdCi7H.js","assets/select-Bo6x_o6t.js","assets/index-CMcP18Ct.js","assets/Check-BzQDWJjM.js","assets/ChevronUp-zrMm2jhU.js","assets/use-section-preview-base-fadywuhv.js","assets/UserSquare-CmhJWMRI.js","assets/Share07-DtOs_WWI.js","assets/agent-icon-Dz2LbXuC.js","assets/AlertCircle-98wzPKVW.js","assets/Tool01-DzYcs8vG.js","assets/ArrowUp-BmtqMqby.js","assets/ArrowLeft-BzMccwRu.js","assets/ArrowRight-lHe1U48z.js","assets/XCircle-D5gCbNRx.js","assets/ZoomOut-BpJbUkSE.js","assets/Globe04-BpUt_ty9.js","assets/CheckCircle-HC56_LGd.js","assets/Copy01-CODH5Oqa.js","assets/CreditCard01-B8bIMJLX.js","assets/DotsVertical-kHMk4ug_.js","assets/Download01-gLJ_F3hc.js","assets/Eye-DLCz-6qH.js","assets/XClose-BVb5UCwC.js","assets/Image01-BpDKkqa8.js","assets/Key01-zdcblxxb.js","assets/LayoutLeft-B_xCpWrI.js","assets/Link01-CL40WKQj.js","assets/LinkExternal01-DCf_4tEb.js","assets/Monitor01-C3eP4jhE.js","assets/Sun-9j0Po2AP.js","assets/Package-D8ukbq-a.js","assets/Palette-DtA5rf3b.js","assets/Plus-B8Z2drir.js","assets/SearchLg-C_6dfKKh.js","assets/SearchMd-3G73My4C.js","assets/Stars01-bSsamSaB.js","assets/Trash01-Lp4e1hVO.js","assets/Upload01-D1rXIspQ.js","assets/User01-D1oM1BHv.js","assets/Users01-B-_tKxiA.js","assets/X-O0g-zSXl.js","assets/Zap-BlYosmzp.js","assets/dialog-jP8njNI6.js","assets/input-BPtPkDjr.js","assets/claim-phase-copy-COCflyZr.js","assets/section-preview-url-Csj0_ZDg.js","assets/use-session-runtime-Dr7e2ZQv.js","assets/runnable-block-editor-BZ6oB296.js","assets/sandbox-start-errors-BK_aDCyt.js","assets/pair-QAcIbRc1.js","assets/format-time-BtXRrtv4.js","assets/differenceInSeconds-C3x8sHUj.js","assets/collapsible-CZOJ1j6g.js","assets/use-copy-gkafpnsk.js","assets/usage-stats-xKmxu4iy.js","assets/markdown-DOW-6sXC.js","assets/org-file-open-context-YAA5_1V8.js","assets/use-mobile-Cib4VYxP.js","assets/tooltip-CXi7o6QP.js","assets/shell-layout-BgCM8XJt.js","assets/avatar-DhNZu9aS.js","assets/download-app-dialog-mLTiBfmY.js","assets/command-B8kD2k68.js","assets/index-D7oOQp3m.js","assets/integration-icon-FGill8kv.js","assets/project-icon-CK24j_02.js","assets/required-auth-layout-DZJ0ncSQ.js","assets/use-org-sso-CeH0e9fd.js","assets/shell-layout-CE2Eihra.css","assets/content-blocks-o63cs2vh.js","assets/mcp-app-renderer-Dp4aDRFa.js","assets/types-BtZlYpRe.js","assets/omit-sandbox-map-jj4lCB2U.js","assets/gateway-client-CGk-7MR6.js","assets/tool-namespace-DmnQIdtF.js","assets/utils-CVEq3hMx.js","assets/sheet-BGZWKAH-.js","assets/use-connection-CXcRnxjN.js","assets/use-navigate-to-agent-DL9BnEdc.js","assets/use-mcp-prompts-fJ5FqsHx.js","assets/index-4Z84UU8G.js","assets/form-DaPOdR17.js","assets/label-tAOICfGy.js","assets/use-thread-outputs-CdqDCmBJ.js","assets/file-type-icon-BOWlnPUV.js","assets/popover-fTX4Xa7z.js","assets/utils-CwK0CgrK.js","assets/monaco-editor-Bn7ZAIFi.js","assets/editor-B53xAYN4.js","assets/calendar-CeXsatfK.js","assets/textarea-AoHG-xc8.js","assets/rich-text-link-control-BAlsv86z.js","assets/switch-Cfah00lh.js","assets/combobox-BFwJe_OK.js","assets/alert-dialog-C3LshfDK.js","assets/sandbox-url-D3mC8qhT.js","assets/search-input-D64mWW5B.js","assets/tabs-v7aq9W_R.js","assets/use-debounced-value-B4B0DOlQ.js","assets/use-file-configs-DDF4ME58.js","assets/asset-utils-iBbDDnCM.js","assets/useInfiniteQuery-CMmW9U3V.js","assets/infiniteQueryObserver-Bqu02ZY5.js","assets/match-site-slug-config-D3fUJ6vX.js","assets/toggle-group-DOgcFL4v.js","assets/decofile-api-B_E7EbfM.js","assets/sandbox-git-api-B1R0585s.js","assets/agent-view-guard-BhJ52yO2.js","assets/use-main-panel-tabs-CPdeW3w6.js","assets/use-route-default-main-BcsKyhK4.js","assets/use-mcp-tools-CtkSsDJL.js","assets/index-Yo2ppgZR.js","assets/drawer-s4SH2mc3.js","assets/collection-search-B-x1t4C0.js","assets/input-C6oonHwB.js","assets/chat-draft-CC0Ic13U.js","assets/use-deco-credits-Dh1J6eMk.js","assets/use-open-billing-url-NPMAfiIz.js","assets/decopilot-DqJHkJDR.js","assets/checkbox-BA7heRMu.js","assets/ai-providers-logos-DD3qZ33J.js","assets/index-ieQLTghw.js","assets/input-BNnugwQe.js","assets/suggestion-DRraTYTY.js","assets/use-org-fs-BCGhVQu5.js","assets/question-004-sINsf4GQ.js","assets/use-members-6xmqE_DE.js","assets/use-org-auth-client-BhRawBZC.js","assets/feature-paywall-Cva507rq.js","assets/plan-ladder-FCxbXDbY.js","assets/add-connection-dialog-BVHCfBCW.js","assets/extract-connection-data-CrLtw8ci.js","assets/metadata-D72DunRR.js","assets/connection-CmGfLu0Q.js","assets/connection-card-BVRdv6UQ.js","assets/connection-slug-CITJ0kGN.js","assets/connection-form-helpers-tM_VoG8F.js","assets/authenticate-and-persist-oauth-C6gFvq2v.js","assets/mcp-oauth-BGxWwoSJ.js","assets/collection-tabs-0f-3wp-x.js","assets/badge-BkjHhNmD.js","assets/use-infinite-scroll-ufEM3hT-.js","assets/useSuspenseInfiniteQuery-B6GLqmw0.js","assets/sandbox-lifecycle-context-CZACEFk2.js","assets/use-task-metadata-uBP-gX-8.js","assets/use-project-native-view-presence-DxprB2h6.js","assets/site-slug-uya6Wp4-.js","assets/virtual-mcp-Bw3gaPfR.js","assets/feature-gate-BNDpNIIw.js","assets/mustache-UXrEN3oi.js","assets/empty-state-CzZHrBSz.js","assets/empty-state-D0NCdca7.js","assets/github-icon-ByY-0mGh.js","assets/repository-import-picker-BsAgV8Se.js","assets/repository-picker-CqBWAelp.js","assets/post-editor-KBvky45B.js","assets/multi-select-ikM4zDSm.js","assets/block-document-CQCTTozx.js","assets/index-CV72CUvH.js","assets/use-fast-preview-draft-url-12Zomm_h.js","assets/use-autosave-frEJXTDA.js","assets/record-editor-B-cJMYFm.js","assets/context-9zKFm2v9.js","assets/index-upFcZaJ9.js","assets/get-initials-D-f_fDFw.js","assets/category-editor-rQLavGw6.js","assets/sections-editor-DGlNHFIn.js","assets/page-seo-form-Bs8WgrD5.js","assets/variant-matcher-override-Bpf_q63q.js","assets/seo-editor-DCpmtymR.js","assets/variant-calendar-D7pBaGln.js","assets/view-mode-toggle-KOhMNfN3.js","assets/post-calendar-CCy3Rkj-.js","assets/alert-BRhcTM_7.js","assets/redirect-editor-C9LkCwmC.js"])))=>i.map(i=>d[i]);
2
+ import{c as ae,b as we,j as n,m as hs,K as Bt,l as xe,r as $,h as rt,B as Be,o as Co,e as Po,t as me,a6 as js,aB as wt,aK as vt,F as Ft,aC as Rs,H as Kt,I as zt,av as To,_ as Bo,$ as Eo,G as We,am as Et,aL as cs,aM as _o,a0 as Do,u as jn,aI as qe}from"./index-CIpplZnk.js";import{A as Ao}from"./agent-view-guard-BhJ52yO2.js";import{F as $o}from"./feature-gate-BNDpNIIw.js";import{u as _t,b as kn}from"./chat-context-Dx19VUrB.js";import{i as Yt}from"./AlertCircle-98wzPKVW.js";import{L as Lo,B as Sn,M as Nn,N as wn,O as tt,P as Cn,Q as ks,R as Oo,S as Pn,T as Io,G as Tn,U as Ro,V as Fo,W as Ct,X as Ko,Y as zo,n as Mo,Z as Vo,_ as Bn,$ as Go,a0 as Uo,y as En}from"./agent-icon-Dz2LbXuC.js";import{c as Fs}from"./UserSquare-CmhJWMRI.js";import{i as _n}from"./ZoomOut-BpJbUkSE.js";import{i as Mt,a as Ks}from"./Share07-DtOs_WWI.js";import{c as Dn,i as Ho}from"./XClose-BVb5UCwC.js";import{s as Ss}from"./Plus-B8Z2drir.js";import{i as An}from"./SearchLg-C_6dfKKh.js";import{t as $n}from"./Users01-B-_tKxiA.js";import{f as qo,e as Jo,b as Wo,A as Yo,a as Qo,d as Xo,c as Zo,g as ea}from"./alert-dialog-C3LshfDK.js";import{S as Qt}from"./scroll-area-BmpdCi7H.js";import{T as Ye,a as Qe,c as Xe}from"./tooltip-CXi7o6QP.js";import{B as ot}from"./badge-BkjHhNmD.js";import{S as ds,n as ta,c as sa,g as Ln,B as us,P as na,h as On,o as oa,i as gs,u as Xt,l as aa,q as la,R as ia,s as In,r as ra,t as ca,d as Rn,v as da,w as ua,x as Fn,y as ma,M as fa,j as pa,z as ha,p as ga,A as xa,C as ba,e as ya,f as va,D as zs,E as Kn,k as ja,F as ka}from"./runnable-block-editor-BZ6oB296.js";import{r as Ns,S as Sa,l as ws,i as Na,m as wa,o as Ca,n as It,v as Pa,R as zn,G as Cs,g as Ta,q as Ba,e as Ms,t as Ea,d as _a,w as Da,x as Vs,h as Aa,y as $a,z as La}from"./claim-phase-copy-COCflyZr.js";import{u as Mn,P as Oa}from"./mustache-UXrEN3oi.js";import{t as ht}from"./ChevronUp-zrMm2jhU.js";import{i as Vn}from"./Zap-BlYosmzp.js";import{C as Ia,a as Ra,b as Fa}from"./collapsible-CZOJ1j6g.js";import{c as Ka,d as za}from"./sandbox-lifecycle-context-CZACEFk2.js";import{u as Gn}from"./use-session-runtime-Dr7e2ZQv.js";import{c as gt,d as ct,e as xt,b as dt,D as ut,h as Vt,a as Ma}from"./dialog-jP8njNI6.js";import{I as Ze}from"./input-BPtPkDjr.js";import{C as Zt}from"./checkbox-BA7heRMu.js";import{L as ze}from"./label-tAOICfGy.js";import{c as Va,b as Ga,a as Ua,d as Ha,S as qa}from"./select-Bo6x_o6t.js";import{b as Ja,a as Wa,p as Ya,s as Qa,t as Gs}from"./decofile-api-B_E7EbfM.js";import{o as Xa}from"./sandbox-git-api-B1R0585s.js";import{a as Us}from"./utils-CwK0CgrK.js";import{i as Za}from"./CheckCircle-HC56_LGd.js";import{s as Ps}from"./Trash01-Lp4e1hVO.js";import{i as ms}from"./Upload01-D1rXIspQ.js";import{E as el}from"./empty-state-CzZHrBSz.js";import{T as Rt}from"./textarea-AoHG-xc8.js";import{u as tl}from"./use-ai-providers-BCh0GxqC.js";import{M as Un}from"./monaco-editor-Bn7ZAIFi.js";import{i as Ts}from"./X-O0g-zSXl.js";import{c as sl,b as nl}from"./XCircle-D5gCbNRx.js";import{d as Hn,a as ol}from"./use-virtual-mcp-BFBtWaJR.js";import"./rich-text-link-control-BAlsv86z.js";import{a as al}from"./Copy01-CODH5Oqa.js";import{b as ll}from"./Tool01-DzYcs8vG.js";import{b as Hs}from"./use-project-scope-CJsyC3na.js";import{E as il}from"./empty-state-D0NCdca7.js";import{G as qs}from"./github-icon-ByY-0mGh.js";import{R as rl}from"./repository-import-picker-BsAgV8Se.js";import{b as cl}from"./thread-route-CxXnvrpW.js";function dl(t){const e=ae.c(18),{title:s,description:o,children:a}=t,l=we();let i;e[0]!==a?(i=n.jsx("div",{"aria-hidden":"true",inert:!0,className:"pointer-events-none h-full select-none overflow-hidden",children:a}),e[0]=a,e[1]=i):i=e[1];let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(Lo,{}),e[2]=c):c=e[2];let r;e[3]!==l?(r=l("common.soon"),e[3]=l,e[4]=r):r=e[4];let d;e[5]!==r?(d=n.jsxs(ot,{variant:"secondary",children:[c,r]}),e[5]=r,e[6]=d):d=e[6];let p;e[7]!==s?(p=n.jsx("p",{className:"text-base font-semibold text-foreground",children:s}),e[7]=s,e[8]=p):p=e[8];let m;e[9]!==o?(m=o&&n.jsx("p",{className:"text-sm text-muted-foreground",children:o}),e[9]=o,e[10]=m):m=e[10];let h;e[11]!==d||e[12]!==p||e[13]!==m?(h=n.jsx("div",{className:"absolute inset-0 z-20 flex items-center justify-center bg-background/60 p-6 backdrop-blur-sm",children:n.jsxs("div",{className:"flex max-w-sm flex-col items-center gap-3 rounded-2xl border bg-card px-8 py-6 text-center shadow-lg",children:[d,p,m]})}),e[11]=d,e[12]=p,e[13]=m,e[14]=h):h=e[14];let u;return e[15]!==i||e[16]!==h?(u=n.jsxs("div",{className:"relative h-full min-h-0",children:[i,h]}),e[15]=i,e[16]=h,e[17]=u):u=e[17],u}function ul(t,e){if(!t||!e?.length)return t;const s=Object.fromEntries(Object.entries(t.properties??{}).filter(([o])=>!e.includes(o)));return Object.keys(s).length>0?{...t,properties:s}:t}function ml(t,e,s){return typeof t!="string"?null:ul(Ns(t,e),s)}function qn(t,e,s){if(!e||typeof t!="string")return!1;const o=ml(t,e,s);return!!o&&Object.keys(o.properties??{}).length>0}function jt(t){const e=ae.c(6),{hasItems:s,emptyLabel:o,emptyHint:a}=t;let l;e[0]!==a||e[1]!==o||e[2]!==s?(l=s?"No results match your search.":n.jsxs(n.Fragment,{children:[n.jsx("div",{children:o}),n.jsx("div",{className:"mt-1 text-muted-foreground/80",children:a})]}),e[0]=a,e[1]=o,e[2]=s,e[3]=l):l=e[3];let i;return e[4]!==l?(i=n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:l}),e[4]=l,e[5]=i):i=e[5],i}function es(t,e){return`${t}-${e}`}function Jn(t,e){return`site/apps/${t}/${e}.ts`}function Wn(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 fl(t){const e=t.match(/^([^-]+)-(.+)$/);return e?{vendor:e[1],app:e[2]}:null}function pl(t){return t==="local"?"Custom":"Installed"}function Yn(t,e,s){const o=new Set([es(t,e),e].map(l=>l.toLowerCase())),a=Jn(t,e);for(const[l,i]of Object.entries(s)){if(l.includes("/")||!i||typeof i!="object"||Array.isArray(i))continue;const c=i;if(o.has(l.toLowerCase())||c.__resolveType===a)return l}return null}function hl(t,e){const s=t.vendor.alias,o=t.name,a=Yn(s,o,e);return{id:es(s,o),app:o,vendor:s,title:t.title||t.name,description:t.description,category:t.category??"Other",logo:t.logo||void 0,resolveType:Jn(s,o),blockKey:a,installed:a!==null}}function gl(t,e,s){if(t===Sa)return null;const o=Wn(t);if(!o)return null;const{vendor:a,app:l}=o,i=Yn(a,l,s),c=ws(t,e);return{id:es(a,l),app:l,vendor:a,title:c.title??l,description:c.description??"",category:"Others",logo:c.logo??c.icon,resolveType:t,blockKey:i,installed:i!==null}}function xl(t,e,s){const o=e.__resolveType;if(typeof o!="string"||Na(t,e)||!wa(o))return null;const a=Wn(o)??fl(t);if(!a)return null;const l=ws(o,s),{vendor:i,app:c}=a;return{id:es(i,c),app:c,vendor:i,title:l.title??Ca(t,e,s),description:l.description??"",category:pl(i),logo:l.logo??l.icon,resolveType:o,blockKey:t,installed:!0}}function bl(t,e,s){const o=new Map;for(const l of t){const i=hl(l,s);o.set(i.id,i)}const a=e.manifest?.blocks?.apps??{};for(const l of Object.keys(a)){const i=gl(l,e,s);!i||o.has(i.id)||o.set(i.id,i)}for(const[l,i]of Object.entries(s)){if(l.includes("/")||!i||typeof i!="object"||Array.isArray(i))continue;const c=xl(l,i,e);!c||o.has(c.id)||o.set(c.id,c)}return[...o.values()].sort(yl)}function yl(t,e){return t.installed!==e.installed?t.installed?-1:1:t.title.localeCompare(e.title)}async function vl(){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 jl(t,e,s){const o=ae.c(12),a=s?.enabled??!0;let l;o[0]===Symbol.for("react.memo_cache_sentinel")?(l=Bt.decoApps(),o[0]=l):l=o[0];let i;o[1]!==a?(i={queryKey:l,queryFn:vl,staleTime:3e5,retry:1,enabled:a},o[1]=a,o[2]=i):i=o[2];const c=hs(i);let r;o[3]!==e||o[4]!==t||o[5]!==c.data?(r=t&&e?bl(c.data??[],t,e):[],o[3]=e,o[4]=t,o[5]=c.data,o[6]=r):r=o[6];const d=r,p=c.isLoading&&!c.isError;let m;return o[7]!==d||o[8]!==c.isError||o[9]!==c.refetch||o[10]!==p?(m={catalog:d,isLoading:p,isError:c.isError,refetch:c.refetch},o[7]=d,o[8]=c.isError,o[9]=c.refetch,o[10]=p,o[11]=m):m=o[11],m}const kl=["sections","apps","loaders","actions"];function Sl(t){const e=ae.c(59),{active:s,counts:o,showBlog:a,onSelect:l}=t,i=we();let c;e[0]!==i?(c=i("sandbox.collectionsSidebar.content"),e[0]=i,e[1]=c):c=e[1];let r;e[2]!==c?(r=n.jsx("div",{className:"px-3 h-12 flex items-center border-b shrink-0",children:n.jsx("span",{className:"text-sm font-medium",children:c})}),e[2]=c,e[3]=r):r=e[3];let d;e[4]!==i?(d=i("sandbox.collectionsSidebar.pages"),e[4]=i,e[5]=d):d=e[5];const p=s==="pages";let m;e[6]!==o.pages||e[7]!==l||e[8]!==d||e[9]!==p?(m=n.jsx(Fe,{id:"pages",icon:Sn,label:d,count:o.pages,active:p,onSelect:l}),e[6]=o.pages,e[7]=l,e[8]=d,e[9]=p,e[10]=m):m=e[10];let h;e[11]!==i?(h=i("sandbox.collectionsSidebar.redirects"),e[11]=i,e[12]=h):h=e[12];const u=s==="redirects";let f;e[13]!==o.redirects||e[14]!==l||e[15]!==h||e[16]!==u?(f=n.jsx(Fe,{id:"redirects",icon:Nn,label:h,count:o.redirects,active:u,onSelect:l}),e[13]=o.redirects,e[14]=l,e[15]=h,e[16]=u,e[17]=f):f=e[17];let x;e[18]!==i?(x=i("sandbox.collectionsSidebar.site"),e[18]=i,e[19]=x):x=e[19];const g=s==="site";let y;e[20]!==l||e[21]!==g||e[22]!==x?(y=n.jsx(Fe,{id:"site",icon:Oo,label:x,active:g,onSelect:l}),e[20]=l,e[21]=g,e[22]=x,e[23]=y):y=e[23];let v;e[24]!==i?(v=i("sandbox.collectionsSidebar.seo"),e[24]=i,e[25]=v):v=e[25];const j=s==="seo";let N;e[26]!==l||e[27]!==v||e[28]!==j?(N=n.jsx(Fe,{id:"seo",icon:Pn,label:v,active:j,onSelect:l}),e[26]=l,e[27]=v,e[28]=j,e[29]=N):N=e[29];let w;e[30]!==i?(w=i("sandbox.collectionsSidebar.calendar"),e[30]=i,e[31]=w):w=e[31];const E=s==="calendar";let B;e[32]!==l||e[33]!==w||e[34]!==E?(B=n.jsx(Fe,{id:"calendar",icon:Io,label:w,active:E,onSelect:l}),e[32]=l,e[33]=w,e[34]=E,e[35]=B):B=e[35];let k;e[36]!==s||e[37]!==o||e[38]!==l?(k=n.jsx(Nl,{active:s,counts:o,onSelect:l}),e[36]=s,e[37]=o,e[38]=l,e[39]=k):k=e[39];let D;e[40]!==s||e[41]!==o.authors||e[42]!==o.categories||e[43]!==o.posts||e[44]!==l||e[45]!==a||e[46]!==i?(D=a&&n.jsxs(n.Fragment,{children:[n.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:[n.jsx(wn,{size:13,className:"shrink-0"}),i("sandbox.collectionsSidebar.blog")]}),n.jsx(Fe,{id:"context",icon:tt,label:i("sandbox.collectionsSidebar.context"),active:s==="context",onSelect:l}),n.jsx(Fe,{id:"posts",icon:_n,label:i("sandbox.collectionsSidebar.posts"),count:o.posts,active:s==="posts",onSelect:l}),n.jsx(Fe,{id:"authors",icon:$n,label:i("sandbox.collectionsSidebar.authors"),count:o.authors,active:s==="authors",onSelect:l}),n.jsx(Fe,{id:"categories",icon:Cn,label:i("sandbox.collectionsSidebar.categories"),count:o.categories,active:s==="categories",onSelect:l}),n.jsx(Fe,{id:"post-schedule",icon:ks,label:i("sandbox.collectionsSidebar.postSchedule"),active:s==="post-schedule",onSelect:l})]}),e[40]=s,e[41]=o.authors,e[42]=o.categories,e[43]=o.posts,e[44]=l,e[45]=a,e[46]=i,e[47]=D):D=e[47];let O;e[48]!==y||e[49]!==N||e[50]!==B||e[51]!==k||e[52]!==D||e[53]!==m||e[54]!==f?(O=n.jsxs("nav",{className:"flex flex-col p-1.5 gap-0.5",children:[m,f,y,N,B,k,D]}),e[48]=y,e[49]=N,e[50]=B,e[51]=k,e[52]=D,e[53]=m,e[54]=f,e[55]=O):O=e[55];let L;return e[56]!==r||e[57]!==O?(L=n.jsxs("div",{className:"w-[208px] shrink-0 border-r flex flex-col",children:[r,O]}),e[56]=r,e[57]=O,e[58]=L):L=e[58],L}function Nl(t){const e=ae.c(52),{active:s,counts:o,onSelect:a}=t,l=we();let i;e[0]!==s?(i=kl.includes(s),e[0]=s,e[1]=i):i=e[1];const c=i,[r,d]=$.useState(!1),p=r||c;let m,h;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=xe("flex w-full items-center gap-2 classic:rounded-md compact: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"),h=n.jsx(Ro,{size:16,className:"shrink-0"}),e[2]=m,e[3]=h):(m=e[2],h=e[3]);let u;e[4]!==l?(u=l("sandbox.collectionsSidebar.advanced"),e[4]=l,e[5]=u):u=e[5];let f;e[6]!==u?(f=n.jsx("span",{className:"flex-1 truncate",children:u}),e[6]=u,e[7]=f):f=e[7];const x=p&&"rotate-180";let g;e[8]!==x?(g=xe("shrink-0 text-muted-foreground/70 transition-transform",x),e[8]=x,e[9]=g):g=e[9];let y;e[10]!==g?(y=n.jsx(ht,{size:16,className:g}),e[10]=g,e[11]=y):y=e[11];let v;e[12]!==f||e[13]!==y?(v=n.jsxs(Ia,{className:m,children:[h,f,y]}),e[12]=f,e[13]=y,e[14]=v):v=e[14];let j;e[15]!==l?(j=l("sandbox.collectionsSidebar.sections"),e[15]=l,e[16]=j):j=e[16];const N=s==="sections";let w;e[17]!==o.sections||e[18]!==a||e[19]!==j||e[20]!==N?(w=n.jsx(Fe,{id:"sections",icon:Mt,label:j,count:o.sections,active:N,onSelect:a,indent:!0}),e[17]=o.sections,e[18]=a,e[19]=j,e[20]=N,e[21]=w):w=e[21];let E;e[22]!==l?(E=l("sandbox.collectionsSidebar.apps"),e[22]=l,e[23]=E):E=e[23];const B=s==="apps";let k;e[24]!==o.apps||e[25]!==a||e[26]!==E||e[27]!==B?(k=n.jsx(Fe,{id:"apps",icon:Dn,label:E,count:o.apps,active:B,onSelect:a,indent:!0}),e[24]=o.apps,e[25]=a,e[26]=E,e[27]=B,e[28]=k):k=e[28];let D;e[29]!==l?(D=l("sandbox.collectionsSidebar.loaders"),e[29]=l,e[30]=D):D=e[30];const O=s==="loaders";let L;e[31]!==o.loaders||e[32]!==a||e[33]!==D||e[34]!==O?(L=n.jsx(Fe,{id:"loaders",icon:Tn,label:D,count:o.loaders,active:O,onSelect:a,indent:!0}),e[31]=o.loaders,e[32]=a,e[33]=D,e[34]=O,e[35]=L):L=e[35];let K;e[36]!==l?(K=l("sandbox.collectionsSidebar.actions"),e[36]=l,e[37]=K):K=e[37];const F=s==="actions";let _;e[38]!==o.actions||e[39]!==a||e[40]!==K||e[41]!==F?(_=n.jsx(Fe,{id:"actions",icon:Vn,label:K,count:o.actions,active:F,onSelect:a,indent:!0}),e[38]=o.actions,e[39]=a,e[40]=K,e[41]=F,e[42]=_):_=e[42];let A;e[43]!==w||e[44]!==k||e[45]!==L||e[46]!==_?(A=n.jsxs(Ra,{className:"flex flex-col gap-0.5 pt-0.5",children:[w,k,L,_]}),e[43]=w,e[44]=k,e[45]=L,e[46]=_,e[47]=A):A=e[47];let I;return e[48]!==p||e[49]!==A||e[50]!==v?(I=n.jsxs(Fa,{open:p,onOpenChange:d,children:[v,A]}),e[48]=p,e[49]=A,e[50]=v,e[51]=I):I=e[51],I}function Fe(t){const e=ae.c(19),{id:s,icon:o,label:a,count:l,active:i,onSelect:c,indent:r}=t;let d;e[0]!==s||e[1]!==c?(d=()=>c(s),e[0]=s,e[1]=c,e[2]=d):d=e[2];const p=r&&"pl-6",m=i?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground";let h;e[3]!==p||e[4]!==m?(h=xe("flex w-full items-center gap-2 classic:rounded-md compact:rounded-lg px-2.5 py-1.5 text-left text-sm transition-colors cursor-pointer",p,m),e[3]=p,e[4]=m,e[5]=h):h=e[5];let u;e[6]!==o?(u=n.jsx(o,{size:16,className:"shrink-0"}),e[6]=o,e[7]=u):u=e[7];let f;e[8]!==a?(f=n.jsx("span",{className:"flex-1 truncate",children:a}),e[8]=a,e[9]=f):f=e[9];let x;e[10]!==i||e[11]!==l?(x=l!==void 0&&n.jsx("span",{className:xe("shrink-0 text-xs tabular-nums",i?"text-accent-foreground/70":"text-muted-foreground/70"),children:l}),e[10]=i,e[11]=l,e[12]=x):x=e[12];let g;return e[13]!==d||e[14]!==h||e[15]!==u||e[16]!==f||e[17]!==x?(g=n.jsxs("button",{type:"button",onClick:d,className:h,children:[u,f,x]}),e[13]=d,e[14]=h,e[15]=u,e[16]=f,e[17]=x,e[18]=g):g=e[18],g}function wl(t){const e=ae.c(12),{state:s,claimPhase:o,lifecycle:a,onStart:l,connectionsHref:i}=t;switch(s.kind){case"starting":{let c;e[0]!==o||e[1]!==a?(c=ta({claimPhase:o,lifecycle:a}),e[0]=o,e[1]=a,e[2]=c):c=e[2];let r;return e[3]!==o||e[4]!==c?(r=n.jsx(ds,{kind:"starting",progress:c,claimPhase:o}),e[3]=o,e[4]=c,e[5]=r):r=e[5],r}case"suspended":{let c;return e[6]!==l?(c=n.jsx(ds,{kind:"suspended",onResume:l}),e[6]=l,e[7]=c):c=e[7],c}case"errored":{let c;return e[8]!==i||e[9]!==l||e[10]!==s.error?(c=n.jsx(ds,{kind:"errored",error:s.error,onRetry:l,connectionsHref:i}),e[8]=i,e[9]=l,e[10]=s.error,e[11]=c):c=e[11],c}}}const Cl=new Set(["clone-failed","install-failed","start-failed","crashed"]);function Pl(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&&!Cl.has(t.lifecyclePhase);return{kind:"ready",devServerReady:e,sandboxWarming:s}}function Js(t,e){const s=e.replace(/\s*\(copy(?:\s+\d+)?\)\s*$/,"").trim(),o=`${s} (copy)`;if(!t.has(o))return o;for(let a=2;a<1e3;a++){const l=`${s} (copy ${a})`;if(!t.has(l))return l}return`${s} (copy ${Date.now()})`}function Tl(t,e){const s=It,o=e.replace(/-copy(?:-\d+)?$/,""),a=`${o}-copy`;if(!t.has(s(a)))return a;for(let l=2;l<1e3;l++){const i=`${o}-copy-${l}`;if(!t.has(s(i)))return i}return`${o}-copy-${Date.now()}`}function Bl(t,e){const s=e.replace(/_copy(?:_\d+)?$/,""),o=`${s}_copy`;if(!Object.hasOwn(t,o))return o;for(let a=2;a<1e3;a++){const l=`${s}_copy_${a}`;if(!Object.hasOwn(t,l))return l}return`${s}_copy_${Date.now()}`}function El(t){const e=Ln(t.newName),s={...t.source,name:t.newName,path:t.newPath};return{key:e,data:s}}function _l(t,e){return sa(t,e)}const Dl=1e3;function Al(t,e){for(let s=0;s<Dl;s++){const o=Ln(e);if(!Object.hasOwn(t,o))return o}throw new Error("Could not generate a unique page block key")}const $l={create:"sandbox.pageFormDialog.titleCreate",duplicate:"sandbox.pageFormDialog.titleDuplicate",rename:"sandbox.pageFormDialog.titleRename"},Ll={create:"sandbox.pageFormDialog.submitCreate",duplicate:"sandbox.pageFormDialog.submitDuplicate",rename:"sandbox.pageFormDialog.submitSave"},Ol={create:"sandbox.pageFormDialog.pendingCreate",duplicate:"sandbox.pageFormDialog.pendingDuplicate",rename:"sandbox.pageFormDialog.pendingSave"};function Il(t){const e=ae.c(88),{open:s,mode:o,initialName:a,initialPath:l,isPending:i,error:c,templates:r,validate:d,onSubmit:p,onOpenChange:m}=t,h=i===void 0?!1:i,u=we(),[f,x]=$.useState(a),[g,y]=$.useState(l),[v,j]=$.useState(us),[N,w]=$.useState(null),[E,B]=$.useState(s);s!==E&&(B(s),s&&(x(a),y(l),j(us),w(null)));const k=o==="create"&&!!r?.length;let D;e[0]!==h||e[1]!==m?(D=pe=>{!pe&&!h&&(w(null),m(!1))},e[0]=h,e[1]=m,e[2]=D):D=e[2];const O=D;let L;e[3]!==h||e[4]!==f||e[5]!==p||e[6]!==g||e[7]!==k||e[8]!==v||e[9]!==d?(L=async pe=>{pe.preventDefault();const ke=f.trim(),he=g.trim();if(!ke||!he||h)return;const je=Pa(he);if(je){w(je);return}const Se=d?.({name:ke,path:he});if(Se){w(Se);return}w(null),await p({name:ke,path:he,templateKey:k&&v!==us?v:null})},e[3]=h,e[4]=f,e[5]=p,e[6]=g,e[7]=k,e[8]=v,e[9]=d,e[10]=L):L=e[10];const K=L,F=N??c,_=$l[o];let A;e[11]!==u||e[12]!==_?(A=u(_),e[11]=u,e[12]=_,e[13]=A):A=e[13];let I;e[14]!==A?(I=n.jsx(gt,{children:n.jsx(ct,{children:A})}),e[14]=A,e[15]=I):I=e[15];let R;e[16]!==h||e[17]!==k||e[18]!==u||e[19]!==v||e[20]!==r?(R=k&&n.jsxs("div",{className:"space-y-1.5",children:[n.jsx("label",{htmlFor:"page-form-template",className:"text-xs font-medium text-muted-foreground",children:u("sandbox.pageFormDialog.labelTemplate")}),n.jsx(na,{id:"page-form-template",value:v,onChange:j,templates:r??[],disabled:h})]}),e[16]=h,e[17]=k,e[18]=u,e[19]=v,e[20]=r,e[21]=R):R=e[21];let V;e[22]!==u?(V=u("sandbox.pageFormDialog.labelName"),e[22]=u,e[23]=V):V=e[23];let z;e[24]!==V?(z=n.jsx("label",{htmlFor:"page-form-name",className:"text-xs font-medium text-muted-foreground",children:V}),e[24]=V,e[25]=z):z=e[25];let W;e[26]===Symbol.for("react.memo_cache_sentinel")?(W=pe=>x(pe.target.value),e[26]=W):W=e[26];let P;e[27]!==u?(P=u("sandbox.pageFormDialog.placeholderName"),e[27]=u,e[28]=P):P=e[28];let U;e[29]!==h||e[30]!==f||e[31]!==P?(U=n.jsx(Ze,{id:"page-form-name",value:f,onChange:W,placeholder:P,autoFocus:!0,disabled:h}),e[29]=h,e[30]=f,e[31]=P,e[32]=U):U=e[32];let Y;e[33]!==U||e[34]!==z?(Y=n.jsxs("div",{className:"space-y-1.5",children:[z,U]}),e[33]=U,e[34]=z,e[35]=Y):Y=e[35];let q;e[36]!==u?(q=u("sandbox.pageFormDialog.labelPath"),e[36]=u,e[37]=q):q=e[37];let X;e[38]!==q?(X=n.jsx("label",{htmlFor:"page-form-path",className:"text-xs font-medium text-muted-foreground",children:q}),e[38]=q,e[39]=X):X=e[39];let ce;e[40]===Symbol.for("react.memo_cache_sentinel")?(ce=pe=>y(pe.target.value),e[40]=ce):ce=e[40];let ne;e[41]!==u?(ne=u("sandbox.pageFormDialog.placeholderPath"),e[41]=u,e[42]=ne):ne=e[42];let de;e[43]!==h||e[44]!==g||e[45]!==ne?(de=n.jsx(Ze,{id:"page-form-path",value:g,onChange:ce,placeholder:ne,disabled:h}),e[43]=h,e[44]=g,e[45]=ne,e[46]=de):de=e[46];let te;e[47]!==X||e[48]!==de?(te=n.jsxs("div",{className:"space-y-1.5",children:[X,de]}),e[47]=X,e[48]=de,e[49]=te):te=e[49];let re;e[50]!==F?(re=F&&n.jsx("p",{className:"text-xs text-destructive",children:F}),e[50]=F,e[51]=re):re=e[51];let le;e[52]!==Y||e[53]!==te||e[54]!==re||e[55]!==R?(le=n.jsxs("div",{className:"space-y-4 py-4",children:[R,Y,te,re]}),e[52]=Y,e[53]=te,e[54]=re,e[55]=R,e[56]=le):le=e[56];let C;e[57]!==m?(C=()=>m(!1),e[57]=m,e[58]=C):C=e[58];let J;e[59]!==u?(J=u("sandbox.pageFormDialog.buttonCancel"),e[59]=u,e[60]=J):J=e[60];let Z;e[61]!==h||e[62]!==C||e[63]!==J?(Z=n.jsx(Be,{type:"button",variant:"outline",onClick:C,disabled:h,children:J}),e[61]=h,e[62]=C,e[63]=J,e[64]=Z):Z=e[64];let oe;e[65]!==h||e[66]!==f||e[67]!==g?(oe=!f.trim()||!g.trim()||h,e[65]=h,e[66]=f,e[67]=g,e[68]=oe):oe=e[68];let S;e[69]!==h||e[70]!==o||e[71]!==u?(S=h?n.jsxs(n.Fragment,{children:[n.jsx(rt,{className:"size-3.5"}),u(Ol[o])]}):u(Ll[o]),e[69]=h,e[70]=o,e[71]=u,e[72]=S):S=e[72];let se;e[73]!==oe||e[74]!==S?(se=n.jsx(Be,{type:"submit",disabled:oe,children:S}),e[73]=oe,e[74]=S,e[75]=se):se=e[75];let H;e[76]!==Z||e[77]!==se?(H=n.jsxs(xt,{children:[Z,se]}),e[76]=Z,e[77]=se,e[78]=H):H=e[78];let ie;e[79]!==K||e[80]!==le||e[81]!==H||e[82]!==I?(ie=n.jsx(dt,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:K,children:[I,le,H]})}),e[79]=K,e[80]=le,e[81]=H,e[82]=I,e[83]=ie):ie=e[83];let ye;return e[84]!==O||e[85]!==s||e[86]!==ie?(ye=n.jsx(ut,{open:s,onOpenChange:O,children:ie}),e[84]=O,e[85]=s,e[86]=ie,e[87]=ye):ye=e[87],ye}const Rl=[{value:"temporary",labelKey:"sandbox.redirectEditor.typeTemporary"},{value:"permanent",labelKey:"sandbox.redirectEditor.typePermanent"}],Ws={from:"",to:"",type:"temporary",discardQueryParameters:!1};function Fl(t){const e=ae.c(111),{open:s,isPending:o,error:a,onSubmit:l,onOpenChange:i}=t,c=o===void 0?!1:o,r=we(),[d,p]=$.useState(Ws),[m,h]=$.useState(null),[u,f]=$.useState(s);s!==u&&(f(s),s&&(p(Ws),h(null)));let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=ge=>p($e=>({...$e,...ge})),e[0]=x):x=e[0];const g=x;let y;e[1]!==c||e[2]!==i?(y=ge=>{!ge&&!c&&(h(null),i(!1))},e[1]=c,e[2]=i,e[3]=y):y=e[3];const v=y;let j;e[4]!==c||e[5]!==l||e[6]!==d||e[7]!==r?(j=async ge=>{ge.preventDefault();const $e=d.from.trim(),Le=d.to.trim();if(!$e||!Le||c){h(r("sandbox.redirectFormDialog.errorRequired"));return}h(null),await l({...d,from:$e,to:Le})},e[4]=c,e[5]=l,e[6]=d,e[7]=r,e[8]=j):j=e[8];const N=j,w=m??a;let E;e[9]!==c||e[10]!==d.from||e[11]!==d.to?(E=!!d.from.trim()&&!!d.to.trim()&&!c,e[9]=c,e[10]=d.from,e[11]=d.to,e[12]=E):E=e[12];const B=E;let k;e[13]!==r?(k=r("sandbox.redirectFormDialog.title"),e[13]=r,e[14]=k):k=e[14];let D;e[15]!==k?(D=n.jsx(gt,{children:n.jsx(ct,{children:k})}),e[15]=k,e[16]=D):D=e[16];let O;e[17]!==r?(O=r("sandbox.redirectEditor.fromLabel"),e[17]=r,e[18]=O):O=e[18];let L;e[19]!==O?(L=n.jsx(ze,{htmlFor:"redirect-form-from",children:O}),e[19]=O,e[20]=L):L=e[20];const K=d.from;let F;e[21]===Symbol.for("react.memo_cache_sentinel")?(F=ge=>g({from:ge.target.value}),e[21]=F):F=e[21];let _;e[22]!==r?(_=r("sandbox.redirectEditor.fromPlaceholder"),e[22]=r,e[23]=_):_=e[23];let A;e[24]!==c||e[25]!==d.from||e[26]!==_?(A=n.jsx(Ze,{id:"redirect-form-from",value:K,onChange:F,placeholder:_,autoFocus:!0,disabled:c}),e[24]=c,e[25]=d.from,e[26]=_,e[27]=A):A=e[27];let I;e[28]!==A||e[29]!==L?(I=n.jsxs("div",{className:"space-y-1.5",children:[L,A]}),e[28]=A,e[29]=L,e[30]=I):I=e[30];let R;e[31]!==r?(R=r("sandbox.redirectEditor.toLabel"),e[31]=r,e[32]=R):R=e[32];let V;e[33]!==R?(V=n.jsx(ze,{htmlFor:"redirect-form-to",children:R}),e[33]=R,e[34]=V):V=e[34];const z=d.to;let W;e[35]===Symbol.for("react.memo_cache_sentinel")?(W=ge=>g({to:ge.target.value}),e[35]=W):W=e[35];let P;e[36]!==r?(P=r("sandbox.redirectEditor.toPlaceholder"),e[36]=r,e[37]=P):P=e[37];let U;e[38]!==c||e[39]!==d.to||e[40]!==P?(U=n.jsx(Ze,{id:"redirect-form-to",value:z,onChange:W,placeholder:P,disabled:c}),e[38]=c,e[39]=d.to,e[40]=P,e[41]=U):U=e[41];let Y;e[42]!==V||e[43]!==U?(Y=n.jsxs("div",{className:"space-y-1.5",children:[V,U]}),e[42]=V,e[43]=U,e[44]=Y):Y=e[44];let q;e[45]!==r?(q=r("sandbox.redirectEditor.typeLabel"),e[45]=r,e[46]=q):q=e[46];let X;e[47]!==q?(X=n.jsx(ze,{htmlFor:"redirect-form-type",children:q}),e[47]=q,e[48]=X):X=e[48];const ce=d.type;let ne;e[49]===Symbol.for("react.memo_cache_sentinel")?(ne=ge=>g({type:ge}),e[49]=ne):ne=e[49];let de;e[50]!==r?(de=r("sandbox.redirectEditor.typePlaceholder"),e[50]=r,e[51]=de):de=e[51];let te;e[52]!==de?(te=n.jsx(Ga,{id:"redirect-form-type",className:"w-full",children:n.jsx(Ua,{placeholder:de})}),e[52]=de,e[53]=te):te=e[53];let re;e[54]!==r?(re=Rl.map(ge=>n.jsx(Va,{value:ge.value,children:r(ge.labelKey,{status:zn[ge.value]})},ge.value)),e[54]=r,e[55]=re):re=e[55];let le;e[56]!==re?(le=n.jsx(Ha,{children:re}),e[56]=re,e[57]=le):le=e[57];let C;e[58]!==c||e[59]!==d.type||e[60]!==te||e[61]!==le?(C=n.jsxs(qa,{value:ce,onValueChange:ne,disabled:c,children:[te,le]}),e[58]=c,e[59]=d.type,e[60]=te,e[61]=le,e[62]=C):C=e[62];let J;e[63]!==X||e[64]!==C?(J=n.jsxs("div",{className:"space-y-1.5",children:[X,C]}),e[63]=X,e[64]=C,e[65]=J):J=e[65];let Z;e[66]===Symbol.for("react.memo_cache_sentinel")?(Z=ge=>g({discardQueryParameters:ge===!0}),e[66]=Z):Z=e[66];let oe;e[67]!==c||e[68]!==d.discardQueryParameters?(oe=n.jsx(Zt,{checked:d.discardQueryParameters,disabled:c,onCheckedChange:Z}),e[67]=c,e[68]=d.discardQueryParameters,e[69]=oe):oe=e[69];let S;e[70]!==r?(S=r("sandbox.redirectEditor.discardQueryParameters"),e[70]=r,e[71]=S):S=e[71];let se;e[72]!==S?(se=n.jsx("span",{className:"text-sm",children:S}),e[72]=S,e[73]=se):se=e[73];let H;e[74]!==oe||e[75]!==se?(H=n.jsxs("label",{className:"flex cursor-pointer items-center gap-2.5",children:[oe,se]}),e[74]=oe,e[75]=se,e[76]=H):H=e[76];let ie;e[77]!==w?(ie=w&&n.jsx("p",{className:"text-xs text-destructive",children:w}),e[77]=w,e[78]=ie):ie=e[78];let ye;e[79]!==I||e[80]!==Y||e[81]!==J||e[82]!==H||e[83]!==ie?(ye=n.jsxs("div",{className:"space-y-4 py-4",children:[I,Y,J,H,ie]}),e[79]=I,e[80]=Y,e[81]=J,e[82]=H,e[83]=ie,e[84]=ye):ye=e[84];let pe;e[85]!==i?(pe=()=>i(!1),e[85]=i,e[86]=pe):pe=e[86];let ke;e[87]!==r?(ke=r("sandbox.redirectFormDialog.cancel"),e[87]=r,e[88]=ke):ke=e[88];let he;e[89]!==c||e[90]!==pe||e[91]!==ke?(he=n.jsx(Be,{type:"button",variant:"outline",onClick:pe,disabled:c,children:ke}),e[89]=c,e[90]=pe,e[91]=ke,e[92]=he):he=e[92];const je=!B;let Se;e[93]!==c||e[94]!==r?(Se=c?n.jsxs(n.Fragment,{children:[n.jsx(rt,{className:"size-3.5"}),r("sandbox.redirectFormDialog.pending")]}):r("sandbox.redirectFormDialog.submit"),e[93]=c,e[94]=r,e[95]=Se):Se=e[95];let Ae;e[96]!==je||e[97]!==Se?(Ae=n.jsx(Be,{type:"submit",disabled:je,children:Se}),e[96]=je,e[97]=Se,e[98]=Ae):Ae=e[98];let Ce;e[99]!==he||e[100]!==Ae?(Ce=n.jsxs(xt,{children:[he,Ae]}),e[99]=he,e[100]=Ae,e[101]=Ce):Ce=e[101];let Pe;e[102]!==N||e[103]!==ye||e[104]!==Ce||e[105]!==D?(Pe=n.jsx(dt,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:N,children:[D,ye,Ce]})}),e[102]=N,e[103]=ye,e[104]=Ce,e[105]=D,e[106]=Pe):Pe=e[106];let De;return e[107]!==v||e[108]!==s||e[109]!==Pe?(De=n.jsx(ut,{open:s,onOpenChange:v,children:Pe}),e[107]=v,e[108]=s,e[109]=Pe,e[110]=De):De=e[110],De}function Kl(t){const e=ae.c(70),{open:s,blockKey:o,initialName:a,isPending:l,onSubmit:i,onOpenChange:c}=t,r=l===void 0?!1:l,d=we(),[p,m]=$.useState(a),[h,u]=$.useState(s);s!==h&&(u(s),s&&m(a));let f;e[0]!==r||e[1]!==c?(f=ce=>{!ce&&!r&&c(!1)},e[0]=r,e[1]=c,e[2]=f):f=e[2];const x=f;let g;e[3]!==r||e[4]!==p||e[5]!==i?(g=async ce=>{ce.preventDefault();const ne=p.trim();!ne||r||await i(ne)},e[3]=r,e[4]=p,e[5]=i,e[6]=g):g=e[6];const y=g;let v;e[7]!==d?(v=d("sandbox.sectionRenameDialog.title"),e[7]=d,e[8]=v):v=e[8];let j;e[9]!==v?(j=n.jsx(ct,{children:v}),e[9]=v,e[10]=j):j=e[10];let N;e[11]!==d?(N=d("sandbox.sectionRenameDialog.description"),e[11]=d,e[12]=N):N=e[12];let w;e[13]!==N?(w=n.jsx(Vt,{children:N}),e[13]=N,e[14]=w):w=e[14];let E;e[15]!==j||e[16]!==w?(E=n.jsxs(gt,{children:[j,w]}),e[15]=j,e[16]=w,e[17]=E):E=e[17];let B;e[18]!==d?(B=d("sandbox.sectionRenameDialog.nameLabel"),e[18]=d,e[19]=B):B=e[19];let k;e[20]!==B?(k=n.jsx("label",{htmlFor:"section-rename-name",className:"text-xs font-medium text-muted-foreground",children:B}),e[20]=B,e[21]=k):k=e[21];let D;e[22]===Symbol.for("react.memo_cache_sentinel")?(D=ce=>m(ce.target.value),e[22]=D):D=e[22];let O;e[23]!==r||e[24]!==p?(O=n.jsx(Ze,{id:"section-rename-name",value:p,onChange:D,autoFocus:!0,disabled:r}),e[23]=r,e[24]=p,e[25]=O):O=e[25];let L;e[26]!==k||e[27]!==O?(L=n.jsxs("div",{className:"space-y-1.5",children:[k,O]}),e[26]=k,e[27]=O,e[28]=L):L=e[28];let K;e[29]!==d?(K=d("sandbox.sectionRenameDialog.keyLabel"),e[29]=d,e[30]=K):K=e[30];let F;e[31]!==K?(F=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:K}),e[31]=K,e[32]=F):F=e[32];let _;e[33]!==o?(_=n.jsx(Ze,{value:o,readOnly:!0,disabled:!0,className:"font-mono"}),e[33]=o,e[34]=_):_=e[34];let A;e[35]!==F||e[36]!==_?(A=n.jsxs("div",{className:"space-y-1.5",children:[F,_]}),e[35]=F,e[36]=_,e[37]=A):A=e[37];let I;e[38]!==L||e[39]!==A?(I=n.jsxs("div",{className:"space-y-4 py-4",children:[L,A]}),e[38]=L,e[39]=A,e[40]=I):I=e[40];let R;e[41]!==c?(R=()=>c(!1),e[41]=c,e[42]=R):R=e[42];let V;e[43]!==d?(V=d("sandbox.sectionRenameDialog.cancel"),e[43]=d,e[44]=V):V=e[44];let z;e[45]!==r||e[46]!==R||e[47]!==V?(z=n.jsx(Be,{type:"button",variant:"outline",onClick:R,disabled:r,children:V}),e[45]=r,e[46]=R,e[47]=V,e[48]=z):z=e[48];let W;e[49]!==r||e[50]!==p?(W=!p.trim()||r,e[49]=r,e[50]=p,e[51]=W):W=e[51];let P;e[52]!==r||e[53]!==d?(P=r?n.jsxs(n.Fragment,{children:[n.jsx(rt,{className:"size-3.5"}),d("sandbox.sectionRenameDialog.saving")]}):d("sandbox.sectionRenameDialog.save"),e[52]=r,e[53]=d,e[54]=P):P=e[54];let U;e[55]!==W||e[56]!==P?(U=n.jsx(Be,{type:"submit",disabled:W,children:P}),e[55]=W,e[56]=P,e[57]=U):U=e[57];let Y;e[58]!==z||e[59]!==U?(Y=n.jsxs(xt,{children:[z,U]}),e[58]=z,e[59]=U,e[60]=Y):Y=e[60];let q;e[61]!==y||e[62]!==I||e[63]!==Y||e[64]!==E?(q=n.jsx(dt,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:y,children:[E,I,Y]})}),e[61]=y,e[62]=I,e[63]=Y,e[64]=E,e[65]=q):q=e[65];let X;return e[66]!==x||e[67]!==s||e[68]!==q?(X=n.jsx(ut,{open:s,onOpenChange:x,children:q}),e[66]=x,e[67]=s,e[68]=q,e[69]=X):X=e[69],X}function zl(t){const e=ae.c(7),{type:s}=t,o=zn[s];let a;e[0]!==o?(a=n.jsx(Ye,{asChild:!0,children:n.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:o})}),e[0]=o,e[1]=a):a=e[1];const l=s==="permanent"?"Permanent":"Temporary";let i;e[2]!==l?(i=n.jsx(Qe,{side:"left",children:l}),e[2]=l,e[3]=i):i=e[3];let c;return e[4]!==a||e[5]!==i?(c=n.jsxs(Xe,{children:[a,i]}),e[4]=a,e[5]=i,e[6]=c):c=e[6],c}const Ml=60,fs={post:"blog/loaders/Blogpost.ts",author:"blog/loaders/Author.ts",category:"blog/loaders/Category.ts"},Bs=["posts","authors","categories"],Pt={posts:"post",authors:"author",categories:"category"};function lt(t){return Bs.includes(t)}const ts={posts:"post",authors:"author",categories:"category"},Qn={posts:fs.post,authors:fs.author,categories:fs.category},Vl=Object.fromEntries(Object.entries(Qn).map(([t,e])=>[e,t]));function Gl(t){return typeof t=="string"?Vl[t]??null:null}function Re(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function ee(t){return typeof t=="string"?t:""}function Ul(t,e){switch(t){case"posts":return{label:ee(e.title)||"Untitled post",subtitle:ee(e.slug)};case"authors":return{label:ee(e.name)||"Unnamed author",subtitle:ee(e.email)};case"categories":return{label:ee(e.name)||"Unnamed category",subtitle:ee(e.slug)};default:{const s=t;throw new Error(`Unhandled blog kind: ${String(s)}`)}}}function Xn(t){const e={posts:[],authors:[],categories:[]};for(const[s,o]of Object.entries(t)){const a=Re(o);if(!a)continue;const l=Gl(a.__resolveType);if(!l)continue;const i=Re(a[ts[l]])??{},{label:c,subtitle:r}=Ul(l,i);e[l].push({key:s,kind:l,label:c,subtitle:r})}for(const s of Bs)e[s].sort((o,a)=>o.label.localeCompare(a.label));return e}function Hl(t,e){return Xn(t)[e]}function Ge(t,e){return Hl(t,e).map(s=>({key:s.key,payload:mt(Re(t[s.key])??void 0,e)}))}const Ys=Object.freeze({});function mt(t,e){return t?Re(t[ts[e]])??Ys:Ys}function it(t,e,s){return{name:t,__resolveType:Qn[e],[ts[e]]:s}}function ud({records:t,selected:e,valueField:s,toRef:o}){const a=Array.isArray(e)?e:[],l=h=>typeof h=="string"?h:ee(Re(h)?.[s]),i=h=>typeof h=="string"?h:ee(Re(h)?.name),c=h=>{const u=l(h),f=u?t.find(({payload:g})=>ee(g[s])===u):void 0;if(f)return f;const x=i(h);return x?t.find(({payload:g})=>ee(g.name)===x):void 0},r=t.map(({key:h,payload:u})=>({value:h,label:ee(u.name)||ee(u[s])||h})),d=new Map,p=[];return a.forEach((h,u)=>{const f=c(h);if(f){p.includes(f.key)||p.push(f.key);return}const x=`unresolved:${u}`;d.set(x,h),p.push(x),r.push({value:x,label:i(h)||l(h)||"Unknown"})}),{options:r,selectedValues:p,refsForValues:h=>h.map(u=>{const f=t.find(x=>x.key===u);return f?o(f.payload):d.get(u)}).filter(u=>u!==void 0)}}function et(t){return Array.isArray(t)?t:[]}function nt(t){if(typeof t=="string")return t;const e=Re(t);return e?ee(e.slug):""}function Zn(t){if(typeof t=="string")return t;const e=Re(t);return e?ee(e.email):""}function Es(t){const e=[];return ee(t.title).trim()||e.push("Title"),ee(t.slug).trim()||e.push("Slug"),et(t.categories).map(nt).filter(Boolean).length===0&&e.push("Category"),ee(t.excerpt).trim()||e.push("Excerpt"),ee(t.image).trim()||e.push("Cover image"),e}const _s=["draft","generating","awaiting_review","scheduled","published","archived"],eo=8;function Dt(t){switch(ee(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 ql(t,e){return e!=="published"&&e!=="scheduled"||Dt(t)===e?!1:Es(t).length>0}function Jl(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate()+1,eo).toISOString()}function Gt(t,e,s){if(e!=="scheduled")return{...t,status:e,scheduledDatetime:""};const o=ee(t.scheduledDatetime);return{...t,status:"scheduled",scheduledDatetime:Number.isNaN(new Date(o).getTime())?Jl(s):o}}function to(t){return Ge(t,"posts").map(({key:e,payload:s})=>({key:e,title:ee(s.title)||"Untitled post",slug:ee(s.slug),date:ee(s.date),scheduledDatetime:ee(s.scheduledDatetime),categorySlugs:et(s.categories).map(nt).filter(Boolean),authorEmails:et(s.authors).map(Zn).filter(Boolean),missing:Es(s),status:Dt(s),form:"live"}))}const so="blog-manager/posts/";function no(t){return t.startsWith(so)}function Tt(t){return t.split("/").pop()??t}function Ut(t){return`${so}${t}`}function Wl(t){return`collections/blog/posts/${t}`}function xs(){return bt(12)}function Yl(t){const e=Re(t.planning)??{},s=Re(e.format);return{ideaKey:ee(e.ideaKey)||void 0,pillarKey:ee(e.pillarKey)||void 0,pillarTitle:ee(e.pillarTitle)||void 0,format:s?{name:ee(s.name),value:ee(s.value)}:void 0,brief:ee(e.brief)||void 0}}function oo(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,[ts.posts]:e}}function md(t,e){return no(t)?ft(t,e):it(t,"posts",e)}function Ql(t){const e=[];for(const[s,o]of Object.entries(t)){if(!no(s))continue;const a=Re(o);a&&e.push({key:s,payload:mt(a,"posts")})}return e}function Xl(t){return[...Ql(t).map(({key:s,payload:o})=>({key:s,title:ee(o.title)||"Untitled post",slug:ee(o.slug),date:ee(o.date),scheduledDatetime:ee(o.scheduledDatetime),categorySlugs:et(o.categories).map(nt).filter(Boolean),authorEmails:et(o.authors).map(Zn).filter(Boolean),missing:Es(o),status:Dt(o),form:"planning"})),...to(t)]}function Zl(t,e,s){const o=Gt(t.payload,e,s),a=Tt(t.key),l=e==="scheduled"||e==="published"?"live":"planning",i=l==="live"?Wl(a):Ut(a),c=l==="live"?it(i,"posts",o):ft(i,o);return{writes:{[i]:c},deletes:i===t.key?[]:[t.key]}}function fd(t,e,s){const o=et(t.categories);if(!o.some(c=>nt(c)===e))return t;const a=o.map(c=>{const r=nt(c);return r===e||r===s.slug?{name:s.name,slug:s.slug}:c}),l=new Set,i=a.filter(c=>{const r=nt(c);return r?l.has(r)?!1:(l.add(r),!0):!0});return{...t,categories:i}}function ei(t,e){const s=et(t.categories);return s.some(o=>nt(o)===e)?{...t,categories:s.filter(o=>nt(o)!==e)}:t}function ti(t){const e=ee(t.status),s=e==="idea"||e==="in_review"?{status:Dt(t)}:{};return{...t,...s,dateModified:new Date().toISOString()}}function bt(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 ps(t,e){const s=`collections/blog/${e}/${bt(12)}`;if(!Object.hasOwn(t,s))return s;throw new Error("Could not generate a unique blog block key")}function ao(t){switch(t){case"posts":return{title:"Untitled post",excerpt:"",slug:`untitled-${bt(8)}`,date:new Date().toISOString().slice(0,10),image:"",alt:"",authors:[],categories:[],sections:[]};case"authors":return{name:"New author",type:"Person",email:"",jobTitle:"",company:"",avatar:""};case"categories":return{name:"New category",slug:`category-${bt(8)}`,description:"",sections:[]};default:{const e=t;throw new Error(`Unhandled blog kind: ${String(e)}`)}}}const si={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"}},Qs="Box";function ni(t){return t.startsWith("site/")?"site":"app"}function oi(t){return t.startsWith("http://")||t.startsWith("https://")||t.startsWith("data:")||t.startsWith("/")}function kt(...t){for(const e of t)if(e!==void 0)return e}function Xs(t){if(t&&!(t.includes("/")||/\.(tsx?|jsx?)$/.test(t)))return t}function ai(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 lo(t){const e=new Set,s=[],o=t.manifest?.blocks??{};for(const a of Object.values(o))for(const l of Object.keys(a)){if(!ii(l)||e.has(l))continue;e.add(l);const i=ws(l,t),c=ss(l),r=si[c],d=ni(l),p=Xs(i.title),m=Xs(i.description),h=(d==="site"?kt(p,r?.title):kt(r?.title,p))??ai(c),u=d==="site"?kt(m,r?.description):kt(r?.description,m),f=d==="site"?i.icon:void 0,x=f&&oi(f)?f:void 0,g=x!==void 0?r?.iconName??Qs:kt(f,r?.iconName)??Qs;s.push({resolveType:l,title:h,description:u,iconName:g,iconUrl:x,source:d})}return s.sort((a,l)=>a.title.localeCompare(l.title))}function ss(t){return(t.split("/").pop()??t).replace(/\.(tsx?|jsx?)$/,"")}const li=["blog/sections/blocks/","site/sections/Blog/Post/"];function ii(t){return li.some(e=>t.startsWith(e))}const Ds="blog-manager-brand";function Ke(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 o=Re(s);o&&e.push({name:ee(o.name),value:ee(o.value)})}return e}function Me(t){return t.filter(e=>e.name.trim()||e.value.trim())}const ri=6e4,ci=4e3;function di(t){const e=[],s=new Set,o=(a,l)=>{if(typeof a=="string"){if(!a.includes(" ")||a.length<4||/^(https?:)?\/\//.test(a)||/^data:/.test(a))return;const i=`${l}: ${a.trim()}`;if(s.has(i))return;s.add(i),e.push(i);return}if(Array.isArray(a)){for(const i of a)o(i,l);return}if(a&&typeof a=="object")for(const[i,c]of Object.entries(a))i!=="__resolveType"&&o(c,i)};return o(t,"block"),e.join(`
3
3
  `)}function pd(t,e){const s=new Map,o=d=>{const p=s.get(d);if(p!==void 0)return p;const m=di(t[d]).slice(0,ci);return s.set(d,m),m},a=(d,p)=>o(p).length-o(d).length,l=[...Ge(t,"posts").map(d=>d.key).sort(a),...Ge(t,"categories").map(d=>d.key),...[...e].sort(a)],i=[],c=new Set;let r=ri;for(const d of l){if(i.length>=Ml)break;if(c.has(d)||!t[d])continue;c.add(d);const p=o(d);if(p.length>r)break;i.push({key:d,content:p}),r-=p.length}return i}const io="blog-manager/themes/";function ui(){return`${io}${crypto.randomUUID()}`}function mi(t,e){return{name:t,title:e.title,body:e.body,pillarKey:e.pillarKey??"",createdAt:e.createdAt}}function ro(t){const e=[];for(const[s,o]of Object.entries(t)){if(!s.startsWith(io))continue;const a=Re(o);a&&e.push({key:s,title:ee(a.title),body:ee(a.body),pillarKey:ee(a.pillarKey)||void 0,createdAt:ee(a.createdAt)})}return e.sort((s,o)=>o.createdAt.localeCompare(s.createdAt)||s.title.localeCompare(o.title))}const co="blog-manager/pillars/";function hd(){return`${co}${crypto.randomUUID()}`}function uo(t){const e=[];for(const[s,o]of Object.entries(t)){if(!s.startsWith(co))continue;const a=Re(o);a&&e.push({key:s,title:ee(a.title),body:ee(a.body),createdAt:ee(a.createdAt),formats:et(a.formats).map(l=>ee(l)).filter(Boolean)})}return e.sort((s,o)=>o.createdAt.localeCompare(s.createdAt)||s.title.localeCompare(o.title))}const mo="blog-manager-formats",fi=40;function gd(t){return Ge(t,"posts").slice(0,fi).map(({key:e,payload:s})=>({key:e,title:ee(s.title),sections:et(s.sections).map(o=>ee(Re(o)?.__resolveType)).filter(Boolean).map(ss)}))}function pi(t){const e=new Map;for(const s of lo(t)){const o=ss(s.resolveType);e.has(o)||e.set(o,{name:o,title:s.title,description:s.description})}return[...e.values()]}function hi(t){const e=new Set;for(const s of t.matchAll(/(?:^|[\s([{>])@([A-Za-z][\w-]*)/g))s[1]&&e.add(s[1]);return[...e]}function xd(t,e){const s=new Set(e);return hi(t).filter(o=>!s.has(o))}const gi=["Heading","Paragraph","BlockImage","List","Cta"];function bd(t){const e=new Set(t);return gi.filter(s=>e.has(s))}function Zs(t){return t.normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").toLowerCase().replace(/\s+/g," ").trim()}function xi(t,e){const s=new Set(t.map(Zs)),o=[];for(const a of e){const l=Zs(a.title);!l||s.has(l)||(s.add(l),o.push(a))}return o}const bi=["companyName","language","description","tone","targetAudience"];function yi(t){const e=Re(t)??{},s=[];for(const o of bi)ee(e[o]).trim()||s.push(o);return Me(Ke(e.dos)).length===0&&s.push("dos"),Me(Ke(e.avoid)).length===0&&s.push("avoid"),s}function fo(t){const e={};for(const s of lo(t)){const o=ss(s.resolveType);o in e||(e[o]=s.resolveType)}return e}function vi(t,e){const s=[];for(const o of t){const a=e[o.type];if(a)switch(o.type){case"Heading":s.push({__resolveType:a,text:ee(o.text),level:o.level??"2"});break;case"Paragraph":s.push({__resolveType:a,html:ee(o.html)});break;case"List":s.push({__resolveType:a,items:(o.items??[]).join(`
4
4
  `),style:o.style??"unordered"});break;case"Quote":s.push({__resolveType:a,quote:ee(o.quote)});break;case"Callout":s.push({__resolveType:a,title:ee(o.title),body:ee(o.body),variant:o.variant??"info"});break;case"Cta":s.push({__resolveType:a,text:ee(o.text),href:ee(o.href)});break;case"Divider":s.push({__resolveType:a});break}}return s}function po(t){return t.normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,80)}function ho(t,e){const s=po(t)||`post-${bt(6)}`,o=new Set(e);if(!o.has(s))return s;for(let a=2;a<100;a++){const l=`${s}-${a}`;if(!o.has(l))return l}return`${s}-${bt(4)}`}function ji({draft:t,resolveTypes:e,categories:s,authors:o,planning:a,takenSlugs:l,now:i}){const c=new Set(t.categorySlugs),r=new Set(t.authorEmails),d={title:t.title,slug:ho(t.title,l),date:i.toISOString().slice(0,10),excerpt:t.excerpt,image:"",alt:"",authors:o.filter(p=>r.has(p.email)),categories:s.filter(p=>c.has(p.slug)),seo:{title:t.seo.title,description:t.seo.description,image:""},sections:vi(t.sections,e),planning:a??{}};return Gt(d,"awaiting_review",i)}const yd=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],vd=["January","February","March","April","May","June","July","August","September","October","November","December"],go=1440*60*1e3;function pt(t){const e=new Date(t);return e.setHours(0,0,0,0),e}function jd(t){return new Date(t.getFullYear(),t.getMonth(),1)}function kd(t,e){return new Date(t.getFullYear(),t.getMonth()+e,1)}function Ht(t,e){const s=new Date(t);return s.setDate(s.getDate()+e),s}function bs(t,e){return Math.round((pt(t).getTime()-pt(e).getTime())/go)}function ki(t){const e=(t.getTime()-pt(t).getTime())/go;return Math.min(Math.max(e,0),1)}function en(t,e){return bs(t,e)+ki(t)}function Sd(t){const e=Ht(t,-t.getDay()),s=[];for(let o=0;o<6;o++){const a=[];for(let l=0;l<7;l++)a.push(Ht(e,o*7+l));s.push(a)}for(;s.length>0&&s[s.length-1].every(o=>o.getMonth()!==t.getMonth());)s.pop();return s}function Nd(t,e){const s=pt(t[0]),o=Ht(s,7),a=s.getTime(),l=o.getTime(),i=[];for(const d of e){const p=pt(d.start),m=pt(d.end);if(m.getTime()<s.getTime()||p.getTime()>=o.getTime())continue;const h=p.getTime()<s.getTime()?s:p,u=m.getTime()>=o.getTime()?Ht(o,-1):m,f=bs(h,s),x=bs(u,h)+1;if(x<=0)continue;const g=Math.max(d.start.getTime(),a),y=Math.min(d.end.getTime(),l),v=en(new Date(g),s),j=Math.max(en(new Date(y),s)-v,0);j<=0||i.push({variant:d,startCol:f,span:x,leftUnits:v,widthUnits:j})}i.sort((d,p)=>d.startCol-p.startCol||p.span-d.span||d.variant.blockKey.localeCompare(p.variant.blockKey));const c=[],r=[];for(const d of i){let p=c.findIndex(m=>m<=d.startCol);p===-1&&(p=c.length,c.push(0)),c[p]=d.startCol+d.span,r.push({...d,lane:p})}return r}function qt(t){const e=String(t.getMonth()+1).padStart(2,"0"),s=String(t.getDate()).padStart(2,"0");return`${t.getFullYear()}-${e}-${s}`}const xo=/^(\d{4})-(\d{2})-(\d{2})$/;function Jt(t){const e=t.trim();if(!e)return null;const s=xo.exec(e);if(s){const a=Number(s[1]),l=Number(s[2])-1,i=Number(s[3]),c=new Date(a,l,i);return c.getMonth()===l&&c.getDate()===i?c:null}const o=new Date(e);return Number.isNaN(o.getTime())?null:pt(o)}function Si(t){const e=new Date(t.getFullYear(),t.getMonth(),t.getDate(),eo);return{...ao("posts"),status:"scheduled",scheduledDatetime:e.toISOString(),date:qt(t)}}function Ni(t){if(typeof t!="string")return null;const e=t.trim();if(!e)return null;if(xo.test(e))return Jt(e);const s=new Date(e);return Number.isNaN(s.getTime())?null:s}function wi(t,e){const s=Ni(t.scheduledDatetime);if(!s)return null;const o=new Date(e.getFullYear(),e.getMonth(),e.getDate(),s.getHours(),s.getMinutes(),s.getSeconds(),s.getMilliseconds()),a={...t,scheduledDatetime:o.toISOString()};return(typeof t.date=="string"?t.date:"")===qt(s)&&(a.date=qt(o)),a}function Ci(t){return Jt(t.scheduledDatetime)??Jt(t.date)}function wd(t){const e=new Map,s=[];for(const a of t){const l={post:a,scheduled:Jt(a.scheduledDatetime)!==null},i=Ci(a);if(!i){s.push(l);continue}const c=qt(i),r=e.get(c);r?r.push(l):e.set(c,[l])}const o=(a,l)=>Number(l.scheduled)-Number(a.scheduled)||a.post.title.localeCompare(l.post.title);for(const a of e.values())a.sort(o);return s.sort(o),{byDay:e,undated:s}}const Pi="0.161.0",Ti="0.162.0",tn="7.53.0",Bi="@decocms/apps-blog";function sn(t){const e=/^v?(\d+)\.(\d+)\.(\d+)$/.exec(t.trim());return e?[Number(e[1]),Number(e[2]),Number(e[3])]:null}function nn(t,e){const s=sn(t),o=sn(e);if(!s||!o)return 0;for(let a=0;a<3;a++){const l=s[a]-o[a];if(l!==0)return l}return 0}const bo=/deco-cx\/apps@v?(\d+\.\d+\.\d+)/;function Ei(t){const e=t?.imports;if(!e||typeof e!="object")return null;for(const s of Object.values(e)){if(typeof s!="string")continue;const o=bo.exec(s)?.[1];if(o)return o}return null}function _i(t){const e=t?.schema?.definitions;if(!e||typeof e!="object")return null;for(const s of Object.values(e)){const o=s?.title;if(typeof o!="string")continue;const a=bo.exec(o)?.[1];if(a)return a}return null}function Di(t){return ys(t?.schema?.definitions,"scheduledDatetime")}function ys(t,e){if(!t||typeof t!="object")return!1;if(Array.isArray(t))return t.some(o=>ys(o,e));const s=t.properties;return s&&typeof s=="object"&&e in s?!0:Object.values(t).some(o=>ys(o,e))}function Ai(t){const e=t;for(const s of[e?.dependencies,e?.devDependencies]){if(!s||typeof s!="object")continue;const o=s[Bi];if(typeof o=="string")return o}return null}function $i(t){const e=/^[\^~]?v?(\d+\.\d+\.\d+)$/.exec(t.trim());return e?e[1]:null}function Li(t){const e=t?.packageManager,s=typeof e=="string"?e.split("@")[0]?.trim():null;return s==="pnpm"||s==="yarn"||s==="bun"?s:"npm"}function yo(t){return t==="deno"?[Pi,Ti]:[tn,tn]}function on(t,e){const[s,o]=yo(t);return!e||nn(e,s)<0?{kind:"outdated",packageManager:t,version:e}:nn(e,o)<0?{kind:"publish-only",packageManager:t,version:e}:{kind:"full",version:e}}function Oi(t){const e=_i(t.meta);if(t.denoJson.kind==="data"||e){const o=t.denoJson.kind==="data"?Ei(t.denoJson.data):null;return on("deno",o??e)}if(t.packageJson.kind==="data"){const o=Ai(t.packageJson.data);return o===null?{kind:"unsupported-runtime"}:on(Li(t.packageJson.data),$i(o))}return Di(t.meta)?{kind:"full",version:null}:t.denoJson.kind==="unavailable"||t.packageJson.kind==="unavailable"?{kind:"unknown"}:{kind:"unsupported-runtime"}}function Ii(t){return t==="deno"?"deno task update":`npx npm-check-updates -u "@decocms/*" && ${t} install`}function Ri(t){return t.kind==="publish-only"||t.kind==="full"}function Cd(t){return t.kind==="full"}function vo(t,e){if(t.kind==="full"||e!=="scheduled"&&e!=="published"||e==="published"&&Ri(t))return null;if(t.kind==="unknown")return{reason:"unknown"};if(t.kind==="unsupported-runtime")return{reason:"no-app"};const[s,o]=yo(t.packageManager);return{reason:"outdated",required:e==="scheduled"?o:s,version:t.version,command:Ii(t.packageManager)}}const an={kind:"unavailable"};function Fi(t){const e=ae.c(26),s=On(t.virtualMcpId),o=_t()?.taskId??null;let a;e[0]!==s||e[1]!==t||e[2]!==o?(a=y=>({queryFn:()=>oa({...t,threadId:o},gs(s,y)),staleTime:3e5}),e[0]=s,e[1]=t,e[2]=o,e[3]=a):a=e[3];const l=a;let i;e[4]!==t.branch||e[5]!==t.orgSlug||e[6]!==t.virtualMcpId?(i=Bt.denoJson(t.orgSlug,t.virtualMcpId,t.branch),e[4]=t.branch,e[5]=t.orgSlug,e[6]=t.virtualMcpId,e[7]=i):i=e[7];let c;e[8]!==l?(c=l("deno.json"),e[8]=l,e[9]=c):c=e[9];let r;e[10]!==i||e[11]!==c?(r={queryKey:i,...c},e[10]=i,e[11]=c,e[12]=r):r=e[12];const{data:d}=hs(r);let p;e[13]!==t.branch||e[14]!==t.orgSlug||e[15]!==t.virtualMcpId?(p=Bt.packageJson(t.orgSlug,t.virtualMcpId,t.branch),e[13]=t.branch,e[14]=t.orgSlug,e[15]=t.virtualMcpId,e[16]=p):p=e[16];let m;e[17]!==l?(m=l("package.json"),e[17]=l,e[18]=m):m=e[18];let h;e[19]!==p||e[20]!==m?(h={queryKey:p,...m},e[19]=p,e[20]=m,e[21]=h):h=e[21];const{data:u}=hs(h),f=d??an,x=u??an;let g;return e[22]!==t.meta||e[23]!==f||e[24]!==x?(g=Oi({denoJson:f,packageJson:x,meta:t.meta}),e[22]=t.meta,e[23]=f,e[24]=x,e[25]=g):g=e[25],g}function Ki(t){const e=ae.c(37),{orgSlug:s,virtualMcpId:o,branch:a}=t,l=Co(),i=_t()?.taskId??null,c=On(o),r=Gn(o).runtime==="cms";let d;e[0]!==a||e[1]!==s||e[2]!==o?(d=Bt.decofile(`${s}/${o}/${a}`),e[0]=a,e[1]=s,e[2]=o,e[3]=d):d=e[3];const p=d;let m;e[4]!==a||e[5]!==s||e[6]!==o?(m=Wa(s,o,a),e[4]=a,e[5]=s,e[6]=o,e[7]=m):m=e[7];let h;e[8]!==a||e[9]!==s||e[10]!==o?(h=Ja(s,o,a),e[8]=a,e[9]=s,e[10]=o,e[11]=h):h=e[11];let u;e[12]!==a||e[13]!==r||e[14]!==s||e[15]!==c||e[16]!==l||e[17]!==i||e[18]!==o?(u=async N=>{const{writes:w,deletes:E}=N;if(r){const k=await Ya({orgSlug:s,virtualMcpId:o,branch:a},{set:w,delete:E});return Qa(l,{orgSlug:s,virtualMcpId:o,branch:a},k),await l.invalidateQueries({queryKey:Xa({orgSlug:s,virtualMcpId:o,branch:a,threadId:i})}),k}const B=`/api/${s}/sandbox/${encodeURIComponent(o)}/${encodeURIComponent(a)}`;for(const[k,D]of Object.entries(w)){const O=await fetch(`${B}/write`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:gs(c,Us(k)),content:JSON.stringify(D,null,2)})});if(!O.ok)return Gs(O,"Write")}for(const k of E){const D=await fetch(`${B}/unlink`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:gs(c,Us(k))})});if(!D.ok)return Gs(D,"Delete")}return{ok:!0}},e[12]=a,e[13]=r,e[14]=s,e[15]=c,e[16]=l,e[17]=i,e[18]=o,e[19]=u):u=e[19];let f;e[20]!==a||e[21]!==s||e[22]!==l||e[23]!==o?(f=()=>{l.invalidateQueries({queryKey:Bt.liveMeta(s,o,a)})},e[20]=a,e[21]=s,e[22]=l,e[23]=o,e[24]=f):f=e[24];let x;e[25]!==m||e[26]!==h||e[27]!==u||e[28]!==f?(x={mutationKey:m,scope:h,mutationFn:u,onSuccess:f},e[25]=m,e[26]=h,e[27]=u,e[28]=f,e[29]=x):x=e[29];const g=Po(x);let y;e[30]!==g||e[31]!==l||e[32]!==p?(y=async N=>{const w=[...Object.keys(N.writes),...N.deletes],E=l.getQueryData(p),B=new Map;for(const k of w)E&&k in E&&B.set(k,E[k]);l.setQueryData(p,k=>zi(k,N)),l.cancelQueries({queryKey:p});try{return await g.mutateAsync(N)}catch(k){const D=k;throw l.setQueryData(p,O=>{if(!O)return O;const L={...O};for(const K of w)B.has(K)?L[K]=B.get(K):delete L[K];return L}),D}},e[30]=g,e[31]=l,e[32]=p,e[33]=y):y=e[33];const v=y;let j;return e[34]!==v||e[35]!==g.isPending?(j={move:v,isPending:g.isPending},e[34]=v,e[35]=g.isPending,e[36]=j):j=e[36],j}function zi(t,{writes:e,deletes:s}){const o={...t??{},...e};for(const a of s)a in e||delete o[a];return o}const Wt={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 jo(t,e){switch(e.reason){case"unknown":return t("sandbox.postBoard.moveUnknownApp");case"no-app":return t("sandbox.postBoard.moveNoBlogApp");case"outdated":return t("sandbox.postBoard.moveUnsupported",{required:e.required,command:e.command})}}function Mi({orgSlug:t,virtualMcpId:e,branch:s,decofile:o,support:a,onMoved:l}){const i=we(),c=Ki({orgSlug:t,virtualMcpId:e,branch:s}),[r,d]=$.useState(new Set),p=f=>mt(o[f],"posts"),m=(f,x,g=p(f))=>{if(x==="generating")return{kind:"not-a-target"};if(r.has(Tt(f)))return{kind:"in-flight"};const y=vo(a,x);return y?{kind:"unsupported",...y}:ql(g,x)?{kind:"incomplete"}:null},h=f=>{switch(f.kind){case"unsupported":return jo(i,f);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(f)}};return{apply:async(f,x,g)=>{const y=g??p(f);if(Dt(y)===x)return null;const v=m(f,x,y);if(v)return v.kind!=="in-flight"&&me.error(h(v)),null;const j=Tt(f);d(E=>new Set(E).add(j));const N=Zl({key:f,payload:y},x,new Date),w=Object.keys(N.writes)[0]??f;w!==f&&l?.(f,w);try{return await c.move(N),w}catch(E){return w!==f&&l?.(w,f),me.error(E instanceof Error?E.message:i("sandbox.postBoard.moveFailed")),null}finally{d(E=>{const B=new Set(E);return B.delete(j),B})}},refuse:m,reasonText:h,isMoving:f=>r.has(Tt(f))}}function Vi(t){const e=ae.c(14),{value:s,onChange:o,placeholder:a,className:l,onFocus:i,onBlur:c,onKeyDown:r,spellCheck:d,inputRef:p}=t,m=d===void 0?!0:d;let h;e[0]!==o?(h=x=>o(x.target.value),e[0]=o,e[1]=h):h=e[1];let u;e[2]!==l?(u=xe("w-full resize-none border-0 bg-transparent p-0 outline-none [field-sizing:content] placeholder:text-muted-foreground/50 focus:ring-0",l),e[2]=l,e[3]=u):u=e[3];let f;return e[4]!==p||e[5]!==c||e[6]!==i||e[7]!==r||e[8]!==a||e[9]!==m||e[10]!==h||e[11]!==u||e[12]!==s?(f=n.jsx("textarea",{ref:p,value:s,onChange:h,onInput:Gi,onFocus:i,onBlur:c,onKeyDown:r,placeholder:a,spellCheck:m,rows:1,className:u}),e[4]=p,e[5]=c,e[6]=i,e[7]=r,e[8]=a,e[9]=m,e[10]=h,e[11]=u,e[12]=s,e[13]=f):f=e[13],f}function Gi(t){const e=t.currentTarget;e.style.height="auto",e.style.height=`${e.scrollHeight}px`}function be(t){return typeof t=="string"?t:""}function Pd(t){const e=ae.c(11);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let a;e[3]!==s?(a=xe(s,"pr-9"),e[3]=s,e[4]=a):a=e[4];let l;e[5]!==o||e[6]!==a?(l=n.jsx(Vi,{...o,className:a}),e[5]=o,e[6]=a,e[7]=l):l=e[7];let i;e[8]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(Fo,{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]=i):i=e[8];let c;return e[9]!==l?(c=n.jsxs("div",{className:"group/editable relative -mx-2 rounded-md px-2 transition-colors hover:bg-muted/50 focus-within:bg-muted/50",children:[l,i]}),e[9]=l,e[10]=c):c=e[10],c}function Td(t){const e=ae.c(5),{label:s,onClick:o,disabled:a}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(Ss,{size:13}),e[0]=l):l=e[0];let i;return e[1]!==a||e[2]!==s||e[3]!==o?(i=n.jsxs("button",{type:"button",onClick:o,disabled:a,className:"flex items-center gap-1.5 classic:rounded-md compact: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:[l,s]}),e[1]=a,e[2]=s,e[3]=o,e[4]=i):i=e[4],i}function Bd(t){const e=ae.c(4),{label:s,onClick:o}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Ps,{size:13}),e[0]=a):a=e[0];let l;return e[1]!==s||e[2]!==o?(l=n.jsx("button",{type:"button","aria-label":s,onClick:o,className:"flex h-6 w-6 shrink-0 items-center justify-center classic:rounded text-muted-foreground/60 opacity-0 transition-opacity hover:text-destructive group-hover/item:opacity-100 cursor-pointer compact:rounded-lg",children:a}),e[1]=s,e[2]=o,e[3]=l):l=e[3],l}function Ed(t){const e=ae.c(2),{children:s}=t;let o;return e[0]!==s?(o=n.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]=o):o=e[1],o}function _d(t){const e=ae.c(8),{active:s,label:o,onClick:a,children:l}=t,i=s?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground";let c;e[0]!==i?(c=xe("flex h-7 min-w-7 items-center justify-center classic:rounded px-1.5 text-sm transition-colors cursor-pointer compact:rounded-lg",i),e[0]=i,e[1]=c):c=e[1];let r;return e[2]!==s||e[3]!==l||e[4]!==o||e[5]!==a||e[6]!==c?(r=n.jsx("button",{type:"button","aria-label":o,"aria-pressed":s,onMouseDown:Ui,onClick:a,className:c,children:l}),e[2]=s,e[3]=l,e[4]=o,e[5]=a,e[6]=c,e[7]=r):r=e[7],r}function Ui(t){return t.preventDefault()}function Dd(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 Nt(t){const e=ae.c(14),{options:s,value:o,emptyLabel:a,onChange:l}=t;let i;e[0]!==a||e[1]!==l||e[2]!==o?(i=a&&n.jsx(ln,{active:!o,onClick:()=>l(""),children:a}),e[0]=a,e[1]=l,e[2]=o,e[3]=i):i=e[3];let c;if(e[4]!==l||e[5]!==s||e[6]!==o){let d;e[8]!==l||e[9]!==o?(d=p=>n.jsx(ln,{active:p===o,onClick:()=>l(p),children:p},p),e[8]=l,e[9]=o,e[10]=d):d=e[10],c=s.filter(Boolean).map(d),e[4]=l,e[5]=s,e[6]=o,e[7]=c}else c=e[7];let r;return e[11]!==i||e[12]!==c?(r=n.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[i,c]}),e[11]=i,e[12]=c,e[13]=r):r=e[13],r}function ln(t){const e=ae.c(7),{active:s,onClick:o,children:a}=t,l=s?"border-primary bg-primary text-primary-foreground":"bg-card hover:bg-muted";let i;e[0]!==l?(i=xe("cursor-pointer rounded-md border px-2.5 py-1 text-xs font-medium transition-colors",l),e[0]=l,e[1]=i):i=e[1];let c;return e[2]!==s||e[3]!==a||e[4]!==o||e[5]!==i?(c=n.jsx("button",{type:"button","aria-pressed":s,onClick:o,className:i,children:a}),e[2]=s,e[3]=a,e[4]=o,e[5]=i,e[6]=c):c=e[6],c}function Ad(t,e=[]){return typeof t=="string"?t:JSON.stringify(t??e)}const rn=[{id:"idea",label:"sandbox.generatePost.stepIdea"},{id:"format",label:"sandbox.generatePost.stepFormat"},{id:"extra",label:"sandbox.generatePost.stepExtra"}],Hi={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 qi({open:t,onOpenChange:e,decofile:s,hasAi:o,seed:a,onGenerate:l}){const i=we(),c=js(),[r,d]=$.useState(a?"format":"idea"),[p,m]=$.useState(a?.key??""),[h,u]=$.useState(a?.title??""),[f,x]=$.useState(a?.body??""),[g,y]=$.useState([]),[v,j]=$.useState(""),[N,w]=$.useState(""),[E,B]=$.useState(""),[k,D]=$.useState(""),[O,L]=$.useState(""),[K,F]=$.useState(!1),_=s[Ds],A=yi(_),I={companyName:be(_?.companyName),description:be(_?.description),language:be(_?.language),tone:be(_?.tone),targetAudience:be(_?.targetAudience),values:Me(Ke(_?.values)),dos:Me(Ke(_?.dos)),avoid:Me(Ke(_?.avoid))},R=ro(s),V=R.find(C=>C.key===p),z=uo(s).find(C=>C.key===V?.pillarKey),W=s[mo],P=Me(Ke(W?.formats)),U=Ge(s,"categories").map(({payload:C})=>({name:be(C.name),slug:be(C.slug)})).filter(C=>C.slug),Y=Ge(s,"authors").map(({payload:C})=>({name:be(C.name),email:be(C.email)})).filter(C=>C.email),q=()=>{d(a?"format":"idea"),m(a?.key??""),u(a?.title??""),x(a?.body??""),y([]),j(""),w(""),B(""),D(""),L("")},X=C=>{e(C),C||q()},ce=async()=>{F(!0);try{const C=await c.call("BLOG_THEME_SUGGEST",{brand:I,existingTitles:[],formats:P.map(J=>J.name).filter(Boolean),guidance:z?`Every idea must be one angle inside the pillar "${z.title}": ${z.body}`:void 0,count:4});y(C.themes)}catch(C){me.error(C instanceof Error?C.message:i("sandbox.generatePost.suggestFailed"))}finally{F(!1)}},ne=a?rn.filter(C=>C.id!=="idea"):rn,de=ne.findIndex(C=>C.id===r),te=r==="idea"?h.trim().length>0:r==="format"?v.trim().length>0&&N.trim().length>0:!0,re=r==="extra",le=()=>{l({idea:{key:p||void 0,title:h.trim(),body:f.trim()},pillar:z?{key:z.key,title:z.title,body:z.body}:void 0,format:{name:v.trim(),value:N.trim()},category:U.find(C=>C.slug===E),author:Y.find(C=>C.email===k),extraInstructions:O.trim()||void 0}),X(!1)};return n.jsx(ut,{open:t,onOpenChange:X,children:n.jsxs(dt,{className:"flex max-h-[85vh] flex-col sm:max-w-2xl",children:[n.jsxs(gt,{children:[n.jsx(ct,{children:i("sandbox.generatePost.title")}),n.jsx(Vt,{children:i("sandbox.generatePost.subtitle")})]}),A.length>0?n.jsx("p",{className:"text-sm text-muted-foreground",children:i("sandbox.generatePost.blockedBrand",{fields:A.map(C=>i(Hi[C])).join(", ")})}):n.jsxs(n.Fragment,{children:[n.jsx("ol",{className:"flex shrink-0 items-center gap-1.5 text-xs",children:ne.map((C,J)=>n.jsx("li",{className:xe("rounded-md px-2 py-1",J===de?"bg-primary text-primary-foreground":J<de?"text-foreground":"text-muted-foreground"),children:i(C.label)},C.id))}),n.jsxs("div",{className:"min-h-0 flex-1 space-y-4 overflow-y-auto py-1",children:[r==="idea"&&n.jsxs(n.Fragment,{children:[n.jsx("p",{className:"text-xs text-muted-foreground",children:z?i("sandbox.generatePost.ideaHintInPillar",{pillar:z.title}):i("sandbox.generatePost.ideaHint")}),R.length>0&&n.jsx(Nt,{options:R.map(C=>C.title).filter(Boolean),value:V?.title??"",emptyLabel:i("sandbox.generatePost.writeAnIdea"),onChange:C=>{const J=R.find(Z=>Z.title===C);m(J?.key??""),u(J?.title??""),x(J?.body??"")}}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ze,{htmlFor:"generate-idea-title",children:i("sandbox.generatePost.ideaTitleLabel")}),n.jsx(Ze,{id:"generate-idea-title",value:h,onChange:C=>{m(""),u(C.target.value)},placeholder:i("sandbox.generatePost.ideaTitlePlaceholder")})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ze,{htmlFor:"generate-idea-body",children:i("sandbox.generatePost.ideaBodyLabel")}),n.jsx(Rt,{id:"generate-idea-body",value:f,onChange:C=>x(C.target.value),placeholder:i("sandbox.generatePost.ideaBodyPlaceholder"),rows:3})]}),n.jsx(Ji,{label:i("sandbox.generatePost.suggestIdeas"),hint:i("sandbox.generatePost.suggestIdeasHint"),disabled:!o||K,busy:K,onSuggest:ce}),n.jsx(Wi,{suggestions:g,onPick:C=>{u(C.title),x(C.body)}})]}),r==="format"&&n.jsxs(n.Fragment,{children:[n.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.generatePost.formatHint")}),n.jsx(Nt,{options:P.map(C=>C.name),value:v,onChange:C=>{j(C),w(P.find(J=>J.name===C)?.value??"")}}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ze,{htmlFor:"generate-format-name",children:i("sandbox.generatePost.formatNameLabel")}),n.jsx(Ze,{id:"generate-format-name",value:v,onChange:C=>j(C.target.value),placeholder:i("sandbox.generatePost.formatNamePlaceholder")})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ze,{htmlFor:"generate-format-value",children:i("sandbox.generatePost.formatValueLabel")}),n.jsx(Rt,{id:"generate-format-value",value:N,onChange:C=>w(C.target.value),placeholder:i("sandbox.generatePost.formatValuePlaceholder"),rows:4})]})]}),r==="extra"&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(ze,{htmlFor:"generate-category",children:i("sandbox.generatePost.categoryLabel")}),n.jsx(Nt,{options:U.map(C=>C.name),value:U.find(C=>C.slug===E)?.name??"",emptyLabel:i("sandbox.generatePost.inferIt"),onChange:C=>B(U.find(J=>J.name===C)?.slug??"")})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ze,{htmlFor:"generate-author",children:i("sandbox.generatePost.authorLabel")}),n.jsx(Nt,{options:Y.map(C=>C.name),value:Y.find(C=>C.email===k)?.name??"",emptyLabel:i("sandbox.generatePost.inferIt"),onChange:C=>D(Y.find(J=>J.name===C)?.email??"")})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ze,{htmlFor:"generate-extra",children:i("sandbox.generatePost.extraLabel")}),n.jsx(Rt,{id:"generate-extra",value:O,onChange:C=>L(C.target.value),placeholder:i("sandbox.generatePost.extraPlaceholder"),rows:3})]}),n.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.generatePost.inferHint")})]})]}),n.jsxs(xt,{className:"shrink-0 sm:justify-between",children:[n.jsx(Be,{type:"button",variant:"outline",disabled:de===0,onClick:()=>d(ne[de-1].id),children:i("sandbox.generatePost.back")}),re?n.jsxs(Be,{type:"button",disabled:!o,onClick:le,children:[n.jsx(tt,{size:14}),i("sandbox.generatePost.generate")]}):n.jsx(Be,{type:"button",disabled:!te,onClick:()=>d(ne[de+1].id),children:i("sandbox.generatePost.next")})]})]})]})})}function Ji(t){const e=ae.c(12),{label:s,hint:o,disabled:a,busy:l,onSuggest:i}=t;let c;e[0]!==o?(c=n.jsx("p",{className:"text-xs text-muted-foreground",children:o}),e[0]=o,e[1]=c):c=e[1];let r;e[2]!==l?(r=l?n.jsx(Ct,{size:14,className:"animate-spin"}):n.jsx(tt,{size:14}),e[2]=l,e[3]=r):r=e[3];let d;e[4]!==a||e[5]!==s||e[6]!==i||e[7]!==r?(d=n.jsxs(Be,{type:"button",variant:"outline",size:"sm",disabled:a,onClick:i,children:[r,s]}),e[4]=a,e[5]=s,e[6]=i,e[7]=r,e[8]=d):d=e[8];let p;return e[9]!==c||e[10]!==d?(p=n.jsxs("div",{className:"flex items-center justify-between gap-3 border-t pt-3",children:[c,d]}),e[9]=c,e[10]=d,e[11]=p):p=e[11],p}function Wi(t){const e=ae.c(7),{suggestions:s,onPick:o}=t;if(s.length===0)return null;let a;if(e[0]!==o||e[1]!==s){let i;e[3]!==o?(i=c=>n.jsx("li",{children:n.jsxs("button",{type:"button",onClick:()=>o(c),className:"w-full cursor-pointer rounded-lg border bg-card p-2.5 text-left transition-colors hover:border-primary/40",children:[n.jsx("p",{className:"text-sm font-medium",children:c.title}),n.jsx("p",{className:"line-clamp-2 text-xs text-muted-foreground",children:c.body})]})},c.title),e[3]=o,e[4]=i):i=e[4],a=s.map(i),e[0]=o,e[1]=s,e[2]=a}else a=e[2];let l;return e[5]!==a?(l=n.jsx("ul",{className:"space-y-1.5",children:a}),e[5]=a,e[6]=l):l=e[6],l}const Yi=["Heading","Paragraph","List","Quote","Callout","Cta","Divider"];function Qi(t){return Yi.includes(t)}function Xi({orgSlug:t,virtualMcpId:e,branch:s,decofile:o,meta:a,onStarted:l}){const i=we(),c=js(),r=Xt({orgSlug:t,virtualMcpId:e,branch:s});return async d=>{const p=Ut(xs()),m={ideaKey:d.idea.key,pillarKey:d.pillar?.key,pillarTitle:d.pillar?.title,format:d.format,brief:d.idea.body},h=Gt(oo({title:d.idea.title,planning:m,now:new Date}),"generating",new Date);await r.mutateAsync({blockKey:p,data:ft(p,h)}),l?.(p);const u=o[Ds],f=d.category?[d.category]:Ge(o,"categories").map(({payload:g})=>({name:be(g.name),slug:be(g.slug)})).filter(g=>g.slug),x=d.author?[d.author]:Ge(o,"authors").map(({payload:g})=>({name:be(g.name),email:be(g.email)})).filter(g=>g.email);try{const g=await c.call("BLOG_POST_DRAFT",{brand:{companyName:be(u?.companyName),description:be(u?.description),language:be(u?.language),tone:be(u?.tone),targetAudience:be(u?.targetAudience),values:Me(Ke(u?.values)),dos:Me(Ke(u?.dos)),avoid:Me(Ke(u?.avoid))},pillar:d.pillar?{title:d.pillar.title,body:d.pillar.body}:void 0,theme:{title:d.idea.title,body:d.idea.body},format:d.format,sections:pi(a).filter(v=>Qi(v.name)).map(v=>({type:v.name,purpose:v.description})),categories:f,authors:x,extraInstructions:d.extraInstructions?.trim()||void 0}),y=ji({draft:g,resolveTypes:fo(a),categories:f,authors:x,planning:m,takenSlugs:to(o).map(v=>v.slug),now:new Date});await r.mutateAsync({blockKey:p,data:ft(p,y)}),me.success(i("sandbox.generatePost.done",{title:g.title}))}catch(g){await r.mutateAsync({blockKey:p,data:ft(p,Gt(h,"draft",new Date))}),me.error(g instanceof Error?g.message:i("sandbox.generatePost.failed"))}}}const Zi=/<(h[1-6]|p|ul|ol|div|img|br|blockquote|section|article|figure)\b|<\/[a-z]/i;function ko(t){return Zi.test(t)}function er(t){const e=t.trim();return e?ko(e)?rr(e):dr(e):{title:"",sections:[]}}function As(t){return t.replace(/&nbsp;/gi," ").replace(/&lt;/gi,"<").replace(/&gt;/gi,">").replace(/&quot;/gi,'"').replace(/&#0?39;|&apos;/gi,"'").replace(/&amp;/gi,"&")}function St(t){let e=t,s;do s=e,e=e.replace(/<[^>]+>/g,"");while(e!==s);return As(e).replace(/\s+/g," ").trim()}function tr(t){let e=t,s;do s=e,e=e.replace(/<!--[\s\S]*?-->/g,"");while(e!==s);return e}function sr(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 So(t){let e=t,s;do s=e,e=sr(tr(e));while(e!==s);return e}const nr=/^(a|b|strong|i|em|u|s|code|br|span|sub|sup)$/;function vs(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 or(t){return t.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}const ar=/^<\/?([a-z][a-z0-9]*)\b([^>]*)>/i;function lr(t,e,s){const o=e.toLowerCase();if(!nr.test(o))return"";if(t.startsWith("</"))return`</${o}>`;if(o!=="a")return`<${o}>`;const a=As(s.match(/href\s*=\s*"([^"]*)"/i)?.[1]??"");return vs(a)&&a?`<a href="${or(a)}">`:"<a>"}function No(t){const e=So(t);let s="",o=0;for(;o<e.length;){const a=e.indexOf("<",o);if(a===-1){s+=e.slice(o);break}s+=e.slice(o,a);const l=ar.exec(e.slice(a));if(!l){s+="&lt;",o=a+1;continue}s+=lr(l[0],l[1]??"",l[2]??""),o=a+l[0].length}return s}function $t(t,e){const s=t.match(new RegExp(`${e}\\s*=\\s*"([^"]*)"`,"i"));return s?.[1]?As(s[1]):""}const ir=/<(h[1-6]|p|ul|ol|blockquote|figure)\b[^>]*>([\s\S]*?)<\/\1\s*>|<hr\b[^>]*\/?>|<img\b[^>]*>/gi;function rr(t){const e=So(t);let s="";const o=[];for(const a of e.matchAll(ir)){const l=a[1]?.toLowerCase(),i=a[2]??"",c=a[0];if(!l){if(/^<img/i.test(c)){const r=$t(c,"src");r&&vs(r)&&o.push({kind:"image",url:r,alt:$t(c,"alt"),caption:""})}else o.push({kind:"divider"});continue}if(/^h[1-6]$/.test(l)){const r=St(i);if(!r)continue;if(l==="h1"&&!s){s=r;continue}o.push({kind:"heading",text:r,level:l.slice(1)})}else if(l==="p"){const r=No(i.trim());St(r)&&o.push({kind:"paragraph",html:r})}else if(l==="ul"||l==="ol"){const r=[...i.matchAll(/<li\b[^>]*>([\s\S]*?)<\/li\s*>/gi)].map(d=>St(d[1]??"")).filter(Boolean);r.length&&o.push({kind:"list",items:r,ordered:l==="ol"})}else if(l==="blockquote"){const r=St(i);r&&o.push({kind:"quote",text:r})}else if(l==="figure"){const r=i.match(/<img\b[^>]*>/i)?.[0],d=r?$t(r,"src"):"",p=St(i.match(/<figcaption\b[^>]*>([\s\S]*?)<\/figcaption\s*>/i)?.[1]??"");d&&vs(d)&&o.push({kind:"image",url:d,alt:r?$t(r,"alt"):"",caption:p})}}return{title:s,sections:o}}function cr(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 dr(t){const e=t.replace(/\r\n?/g,`
5
5
  `).split(`
6
6
  `);let s="";const o=[];let a=[],l=null,i=[];const c=()=>{a.length&&(o.push({kind:"paragraph",html:No(cr(a.join(" ")))}),a=[])},r=()=>{l&&(o.push({kind:"list",items:l.items,ordered:l.ordered}),l=null)},d=()=>{i.length&&(o.push({kind:"quote",text:i.join(" ")}),i=[])},p=()=>{c(),r(),d()};for(const m of e){const h=m.trimEnd(),u=h.match(/^(#{1,6})\s+(.*)$/),f=h.match(/^!\[([^\]]*)\]\(([^)\s]+)\)\s*$/),x=h.match(/^\s*(?:[-*+]|\d+\.)\s+(.*)$/),g=/^\s*\d+\./.test(h),y=h.match(/^>\s?(.*)$/);if(!h.trim())p();else if(u){p();const v=u[2]?.trim()??"",j=String(u[1]?.length??1);j==="1"&&!s?s=v:v&&o.push({kind:"heading",text:v,level:j})}else/^(-{3,}|\*{3,}|_{3,})$/.test(h.trim())?(p(),o.push({kind:"divider"})):f?(p(),o.push({kind:"image",url:f[2]??"",alt:f[1]??"",caption:""})):x?(c(),d(),l||(l={items:[],ordered:g}),l.items.push(x[1]?.trim()??"")):y?(c(),r(),i.push(y[1]?.trim()??"")):(r(),d(),a.push(h.trim()))}return p(),{title:s,sections:o}}const ur={heading:"Heading",paragraph:"Paragraph",list:"List",quote:"Quote",divider:"Divider",image:"BlockImage"};function mr(t,e){const s=[];for(const o of t){const a=e[ur[o.kind]];if(a)switch(o.kind){case"heading":s.push({__resolveType:a,text:o.text,level:o.level});break;case"paragraph":s.push({__resolveType:a,html:o.html});break;case"list":s.push({__resolveType:a,items:o.items.join(`
7
7
  `),style:o.ordered?"ordered":"unordered"});break;case"quote":s.push({__resolveType:a,quote:o.text});break;case"divider":s.push({__resolveType:a});break;case"image":s.push({__resolveType:a,url:o.url,alt:o.alt,caption:o.caption,size:"normal"});break}}return s}function fr({title:t,blocks:e,takenSlugs:s,now:o}){const a=t.trim();return{title:a,slug:a?ho(a,s):po(""),date:o.toISOString().slice(0,10),excerpt:"",image:"",alt:"",authors:[],categories:[],sections:e,status:"in_review"}}const cn="__all__",dn={"date-desc":"sandbox.postToolbar.sortNewestFirst","date-asc":"sandbox.postToolbar.sortOldestFirst",az:"sandbox.postToolbar.sortTitleAZ",za:"sandbox.postToolbar.sortTitleZA"},pr={"date-desc":"sandbox.postToolbar.sortNewest","date-asc":"sandbox.postToolbar.sortOldest",az:"sandbox.postToolbar.sortAZ",za:"sandbox.postToolbar.sortZA"},un="status:";function mn(t){if(!t.startsWith(un))return null;const e=t.slice(un.length);return _s.includes(e)?e:null}const fn=$.forwardRef(function(e,s){const o=ae.c(20);let a,l,i,c,r;o[0]!==e?({icon:a,active:l,value:r,className:i,...c}=e,o[0]=e,o[1]=a,o[2]=l,o[3]=i,o[4]=c,o[5]=r):(a=o[1],l=o[2],i=o[3],c=o[4],r=o[5]);const d=l?"text-foreground":"text-muted-foreground";let p;o[6]!==i||o[7]!==d?(p=xe("h-7 gap-1 px-1.5 text-xs",d,i),o[6]=i,o[7]=d,o[8]=p):p=o[8];let m;o[9]!==a?(m=n.jsx(a,{size:14,className:"shrink-0"}),o[9]=a,o[10]=m):m=o[10];let h;o[11]!==r?(h=r&&n.jsx("span",{className:"min-w-0 flex-1 truncate",children:r}),o[11]=r,o[12]=h):h=o[12];let u;o[13]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(ht,{size:12,className:"shrink-0 opacity-60"}),o[13]=u):u=o[13];let f;return o[14]!==c||o[15]!==s||o[16]!==p||o[17]!==m||o[18]!==h?(f=n.jsxs(Be,{ref:s,type:"button",variant:"ghost",size:"sm",className:p,...c,children:[m,h,u]}),o[14]=c,o[15]=s,o[16]=p,o[17]=m,o[18]=h,o[19]=f):f=o[19],f});function $s(t){const e=ae.c(2),{count:s}=t;let o;return e[0]!==s?(o=n.jsx("span",{className:"ml-auto pl-3 text-xs text-muted-foreground tabular-nums",children:s}),e[0]=s,e[1]=o):o=e[1],o}function hr(t){const e=ae.c(100),{categories:s,authors:o,statusCounts:a,categoryFilter:l,authorFilter:i,statusFilter:c,sort:r,onCategoryFilterChange:d,onAuthorFilterChange:p,onStatusFilterChange:m,onSortChange:h}=t,u=we();let f;if(e[0]!==s||e[1]!==l){let H;e[3]!==l?(H=ie=>ie.slug===l,e[3]=l,e[4]=H):H=e[4],f=s.find(H),e[0]=s,e[1]=l,e[2]=f}else f=e[2];const x=f;let g;if(e[5]!==i||e[6]!==o){let H;e[8]!==i?(H=ie=>ie.email===i,e[8]=i,e[9]=H):H=e[9],g=o.find(H),e[5]=i,e[6]=o,e[7]=g}else g=e[7];const y=g,v=!!(l||i||c);let j;e[10]!==y?.name||e[11]!==x?.name||e[12]!==c||e[13]!==u?(j=x?.name??y?.name??u(c?Wt[c]:"sandbox.postToolbar.filterLabel"),e[10]=y?.name,e[11]=x?.name,e[12]=c,e[13]=u,e[14]=j):j=e[14];const N=j,w=l?`cat:${l}`:i?`author:${i}`:c?`status:${c}`:cn;let E;e[15]!==p||e[16]!==d||e[17]!==m?(E=()=>{d(null),p(null),m(null)},e[15]=p,e[16]=d,e[17]=m,e[18]=E):E=e[18];const B=E;let k;e[19]!==B||e[20]!==p||e[21]!==d||e[22]!==m?(k=H=>{H.startsWith("cat:")?(p(null),m(null),d(H.slice(4))):H.startsWith("author:")?(d(null),m(null),p(H.slice(7))):mn(H)?(d(null),p(null),m(mn(H))):B()},e[19]=B,e[20]=p,e[21]=d,e[22]=m,e[23]=k):k=e[23];const D=k;let O;e[24]!==N||e[25]!==v?(O=n.jsx(Ft,{asChild:!0,children:n.jsx(fn,{icon:Ko,active:v,value:N,className:"min-w-0 shrink"})}),e[24]=N,e[25]=v,e[26]=O):O=e[26];let L;e[27]!==u?(L=u("sandbox.postToolbar.filterBy"),e[27]=u,e[28]=L):L=e[28];let K;e[29]!==L?(K=n.jsx(vt,{children:L}),e[29]=L,e[30]=K):K=e[30];let F;e[31]!==u?(F=u("sandbox.postToolbar.allPosts"),e[31]=u,e[32]=F):F=e[32];let _;e[33]!==F?(_=n.jsx(wt,{value:cn,children:F}),e[33]=F,e[34]=_):_=e[34];let A;e[35]!==u?(A=u("sandbox.postToolbar.statusLabel"),e[35]=u,e[36]=A):A=e[36];let I;e[37]!==A?(I=n.jsx(vt,{className:"text-muted-foreground/70",children:A}),e[37]=A,e[38]=I):I=e[38];let R;e[39]!==a||e[40]!==u?(R=_s.map(H=>n.jsxs(wt,{value:`status:${H}`,children:[n.jsx("span",{className:"min-w-0 flex-1 truncate",children:u(Wt[H])}),n.jsx($s,{count:a[H]??0})]},`status:${H}`)),e[39]=a,e[40]=u,e[41]=R):R=e[41];let V;e[42]!==s.length||e[43]!==u?(V=s.length>0&&n.jsx(vt,{className:"text-muted-foreground/70",children:u("sandbox.postToolbar.categoryLabel")}),e[42]=s.length,e[43]=u,e[44]=V):V=e[44];let z;e[45]!==s?(z=s.map(xr),e[45]=s,e[46]=z):z=e[46];let W;e[47]!==o.length||e[48]!==u?(W=o.length>0&&n.jsx(vt,{className:"text-muted-foreground/70",children:u("sandbox.postToolbar.authorLabel")}),e[47]=o.length,e[48]=u,e[49]=W):W=e[49];let P;e[50]!==o?(P=o.map(gr),e[50]=o,e[51]=P):P=e[51];let U;e[52]!==w||e[53]!==D||e[54]!==_||e[55]!==I||e[56]!==R||e[57]!==V||e[58]!==z||e[59]!==W||e[60]!==P?(U=n.jsxs(Rs,{value:w,onValueChange:D,children:[_,I,R,V,z,W,P]}),e[52]=w,e[53]=D,e[54]=_,e[55]=I,e[56]=R,e[57]=V,e[58]=z,e[59]=W,e[60]=P,e[61]=U):U=e[61];let Y;e[62]!==U||e[63]!==K?(Y=n.jsxs(Kt,{align:"start",className:"max-h-96 w-60 overflow-y-auto",children:[K,U]}),e[62]=U,e[63]=K,e[64]=Y):Y=e[64];let q;e[65]!==Y||e[66]!==O?(q=n.jsxs(zt,{children:[O,Y]}),e[65]=Y,e[66]=O,e[67]=q):q=e[67];let X;e[68]!==B||e[69]!==v||e[70]!==u?(X=v&&n.jsx(br,{label:u("sandbox.postToolbar.clearFilter"),onClick:B}),e[68]=B,e[69]=v,e[70]=u,e[71]=X):X=e[71];const ce=pr[r];let ne;e[72]!==u||e[73]!==ce?(ne=u(ce),e[72]=u,e[73]=ce,e[74]=ne):ne=e[74];let de;e[75]!==ne?(de=n.jsx(Ft,{asChild:!0,children:n.jsx(fn,{icon:zo,active:!0,value:ne})}),e[75]=ne,e[76]=de):de=e[76];let te;e[77]!==u?(te=u("sandbox.postToolbar.sortBy"),e[77]=u,e[78]=te):te=e[78];let re;e[79]!==te?(re=n.jsx(vt,{children:te}),e[79]=te,e[80]=re):re=e[80];let le;e[81]!==h?(le=H=>h(H),e[81]=h,e[82]=le):le=e[82];let C;e[83]===Symbol.for("react.memo_cache_sentinel")?(C=Object.keys(dn),e[83]=C):C=e[83];let J;e[84]!==u?(J=C.map(H=>n.jsx(wt,{value:H,children:u(dn[H])},H)),e[84]=u,e[85]=J):J=e[85];let Z;e[86]!==r||e[87]!==le||e[88]!==J?(Z=n.jsx(Rs,{value:r,onValueChange:le,children:J}),e[86]=r,e[87]=le,e[88]=J,e[89]=Z):Z=e[89];let oe;e[90]!==re||e[91]!==Z?(oe=n.jsxs(Kt,{align:"end",className:"w-44",children:[re,Z]}),e[90]=re,e[91]=Z,e[92]=oe):oe=e[92];let S;e[93]!==de||e[94]!==oe?(S=n.jsx("div",{className:"ml-auto shrink-0",children:n.jsxs(zt,{children:[de,oe]})}),e[93]=de,e[94]=oe,e[95]=S):S=e[95];let se;return e[96]!==q||e[97]!==X||e[98]!==S?(se=n.jsxs("div",{className:"flex min-w-0 items-center gap-1 overflow-hidden border-b px-2 py-1.5",children:[q,X,S]}),e[96]=q,e[97]=X,e[98]=S,e[99]=se):se=e[99],se}function gr(t){return n.jsxs(wt,{value:`author:${t.email}`,children:[n.jsx("span",{className:"min-w-0 flex-1 truncate",children:t.name}),n.jsx($s,{count:t.count})]},`author:${t.email}`)}function xr(t){return n.jsxs(wt,{value:`cat:${t.slug}`,children:[n.jsx("span",{className:"min-w-0 flex-1 truncate",children:t.name}),n.jsx($s,{count:t.count})]},`cat:${t.slug}`)}function br(t){const e=ae.c(4),{label:s,onClick:o}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Ts,{size:12}),e[0]=a):a=e[0];let l;return e[1]!==s||e[2]!==o?(l=n.jsx("button",{type:"button","aria-label":s,onClick:o,className:"flex h-6 w-6 shrink-0 items-center justify-center classic:rounded text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer compact:rounded-lg",children:a}),e[1]=s,e[2]=o,e[3]=l):l=e[3],l}function yr(t){const e=ae.c(18),{checked:s,disabled:o,onToggle:a}=t,l=we();let i;e[0]!==a?(i=()=>a(),e[0]=a,e[1]=i):i=e[1];let c;e[2]!==s||e[3]!==l?(c=l(s?"sandbox.postToolbar.deselectAllPosts":"sandbox.postToolbar.selectAllPosts"),e[2]=s,e[3]=l,e[4]=c):c=e[4];let r;e[5]!==s||e[6]!==o||e[7]!==i||e[8]!==c?(r=n.jsx(Ye,{asChild:!0,children:n.jsx("span",{className:"flex shrink-0 items-center px-1.5",onClick:vr,children:n.jsx(Zt,{checked:s,disabled:o,onCheckedChange:i,"aria-label":c})})}),e[5]=s,e[6]=o,e[7]=i,e[8]=c,e[9]=r):r=e[9];let d;e[10]!==s||e[11]!==l?(d=l(s?"sandbox.postToolbar.deselectAll":"sandbox.postToolbar.selectAll"),e[10]=s,e[11]=l,e[12]=d):d=e[12];let p;e[13]!==d?(p=n.jsx(Qe,{side:"bottom",children:d}),e[13]=d,e[14]=p):p=e[14];let m;return e[15]!==r||e[16]!==p?(m=n.jsxs(Xe,{children:[r,p]}),e[15]=r,e[16]=p,e[17]=m):m=e[17],m}function vr(t){return t.stopPropagation()}function jr(t){const e=ae.c(42),{count:s,allSelected:o,onToggleSelectAll:a,onArchive:l,onExit:i}=t,c=we();let r;e[0]!==o||e[1]!==a?(r=n.jsx(yr,{checked:o,onToggle:a}),e[0]=o,e[1]=a,e[2]=r):r=e[2];let d;e[3]!==s||e[4]!==c?(d=c("sandbox.postToolbar.itemsSelected",{count:s}),e[3]=s,e[4]=c,e[5]=d):d=e[5];let p;e[6]!==d?(p=n.jsx("span",{className:"text-xs font-medium tabular-nums",children:d}),e[6]=d,e[7]=p):p=e[7];const m=s===0;let h;e[8]!==c?(h=c("sandbox.postToolbar.archiveSelectedPosts"),e[8]=c,e[9]=h):h=e[9];let u;e[10]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(To,{size:14}),e[10]=u):u=e[10];let f;e[11]!==l||e[12]!==m||e[13]!==h?(f=n.jsx(Ye,{asChild:!0,children:n.jsx(Be,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",disabled:m,onClick:l,"aria-label":h,children:u})}),e[11]=l,e[12]=m,e[13]=h,e[14]=f):f=e[14];let x;e[15]!==c?(x=c("sandbox.postToolbar.archiveSelected"),e[15]=c,e[16]=x):x=e[16];let g;e[17]!==x?(g=n.jsx(Qe,{side:"bottom",children:x}),e[17]=x,e[18]=g):g=e[18];let y;e[19]!==f||e[20]!==g?(y=n.jsxs(Xe,{children:[f,g]}),e[19]=f,e[20]=g,e[21]=y):y=e[21];let v;e[22]!==c?(v=c("sandbox.postToolbar.exitSelection"),e[22]=c,e[23]=v):v=e[23];let j;e[24]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(Ts,{size:14}),e[24]=j):j=e[24];let N;e[25]!==i||e[26]!==v?(N=n.jsx(Ye,{asChild:!0,children:n.jsx(Be,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:i,"aria-label":v,children:j})}),e[25]=i,e[26]=v,e[27]=N):N=e[27];let w;e[28]!==c?(w=c("sandbox.postToolbar.exitSelection"),e[28]=c,e[29]=w):w=e[29];let E;e[30]!==w?(E=n.jsx(Qe,{side:"bottom",children:w}),e[30]=w,e[31]=E):E=e[31];let B;e[32]!==N||e[33]!==E?(B=n.jsxs(Xe,{children:[N,E]}),e[32]=N,e[33]=E,e[34]=B):B=e[34];let k;e[35]!==y||e[36]!==B?(k=n.jsxs("div",{className:"ml-auto flex items-center gap-0.5",children:[y,B]}),e[35]=y,e[36]=B,e[37]=k):k=e[37];let D;return e[38]!==r||e[39]!==k||e[40]!==p?(D=n.jsxs("div",{className:"flex items-center gap-0.5 border-b bg-accent/40 px-2 py-1.5",children:[r,p,k]}),e[38]=r,e[39]=k,e[40]=p,e[41]=D):D=e[41],D}const kr={draft:"outline",generating:"secondary",awaiting_review:"warning",scheduled:"secondary",published:"success",archived:"outline"},pn="ideas",hn=t=>t.scheduledDatetime||t.date||"",Sr=(t,e)=>hn(e).localeCompare(hn(t)),Nr=t=>t==="scheduled"||t==="published",wo="application/x-post-key";function wr({orgSlug:t,virtualMcpId:e,branch:s,decofile:o,view:a,selectedKey:l,onViewChange:i,onOpen:c,onClose:r,move:d,support:p,meta:m,renderDetail:h}){const u=we(),f=js(),x=Xt({orgSlug:t,virtualMcpId:e,branch:s}),g=Mn({orgSlug:t,virtualMcpId:e,branch:s}),y=tl().length>0,[v,j]=$.useState(null),[N,w]=$.useState(!1),[E,B]=$.useState(!1),[k,D]=$.useState(""),[O,L]=$.useState(3),[K,F]=$.useState(""),[_,A]=$.useState(!1),[I,R]=$.useState(!1),[V,z]=$.useState(),[W,P]=$.useState(!1),[U,Y]=$.useState(""),q=$.useRef(null),[X,ce]=Bo(Eo.blogBoardCollapsedLanes(),[]),ne=T=>ce(Q=>Q.includes(T)?Q.filter(Te=>Te!==T):[...Q,T]),de=Xi({orgSlug:t,virtualMcpId:e,branch:s,decofile:o,meta:m,onStarted:c}),te=Xl(o),re=ro(o),le=uo(o),C=T=>le.find(Q=>Q.key===T)?.title,J=T=>mt(o[T],"posts"),Z=l&&te.some(T=>T.key===l)?l:te[0]?.key??null,oe=async T=>{await d.apply(T.key,"archived")&&me.success(u("sandbox.postBoard.archived"))},[S,se]=$.useState(null),[H,ie]=$.useState(null),[ye,pe]=$.useState(null),[ke,he]=$.useState("date-desc"),[je,Se]=$.useState(new Set),Ae=te.reduce((T,Q)=>(T[Q.status]=(T[Q.status]??0)+1,T),{}),Ce=T=>{const Q=new Map;for(const Te of te)for(const Ve of T(Te))Q.set(Ve,(Q.get(Ve)??0)+1);return Q},Pe=Ce(T=>T.categorySlugs),De=Ce(T=>T.authorEmails),ge=Ge(o,"categories").map(({payload:T})=>({slug:be(T.slug),name:be(T.name)||be(T.slug),count:Pe.get(be(T.slug))??0})),$e=Ge(o,"authors").map(({payload:T})=>({email:be(T.email),name:be(T.name)||be(T.email),count:De.get(be(T.email))??0})),Le=te.filter(T=>!S||T.categorySlugs.includes(S)).filter(T=>!H||T.authorEmails.includes(H)).filter(T=>!ye||T.status===ye).sort((T,Q)=>{if(ke==="az")return T.title.localeCompare(Q.title);if(ke==="za")return Q.title.localeCompare(T.title);const Te=(T.scheduledDatetime||T.date).localeCompare(Q.scheduledDatetime||Q.date);return ke==="date-asc"?Te:-Te}),M=je.size>0,ve=T=>Se(Q=>{const Te=new Set(Q);return Te.delete(T)||Te.add(T),Te}),Ne=()=>Se(T=>Le.every(Q=>T.has(Q.key))?new Set:new Set(Le.map(Q=>Q.key))),Oe=async()=>{let T=0;for(const Q of je)await d.apply(Q,"archived")&&(T+=1);Se(new Set),T>0&&me.success(u("sandbox.postBoard.archived"))},ns=T=>{z({key:T.key,title:T.title,body:T.body}),R(!0)},os=T=>{g.mutate({blockKey:T.key})},as=(T,Q)=>{j(null),d.apply(Q,T)},At=()=>{const T=Ut(xs()),Q=oo({title:"",now:new Date});x.mutate({blockKey:T,data:ft(T,Q)}),c(T)},ls=()=>{const T=er(U),Q=mr(T.sections,fo(m));if(Q.length===0&&!T.title.trim()){me.error(u("sandbox.postBoard.importEmpty"));return}const Te=Ut(xs()),Ve=fr({title:T.title,blocks:Q,takenSlugs:te.map(Je=>Je.slug).filter(Boolean),now:new Date});x.mutate({blockKey:Te,data:ft(Te,Ve)}),P(!1),Y(""),me.success(u("sandbox.postBoard.imported")),c(Te)},is=async()=>{w(!0);const T=le.find(Q=>Q.key===K);try{const Q=o[Ds]??{},Te=o[mo],Ve=Ke(Te?.formats).map(Ue=>Ue.name).filter(Boolean),Je=await f.call("BLOG_THEME_SUGGEST",{brand:{companyName:be(Q.companyName),description:be(Q.description),language:be(Q.language),tone:be(Q.tone),targetAudience:be(Q.targetAudience),values:Me(Ke(Q.values)),dos:Me(Ke(Q.dos)),avoid:Me(Ke(Q.avoid))},existingTitles:re.map(Ue=>Ue.title).filter(Boolean),formats:Ve,guidance:[T&&`Every idea must be one angle inside the pillar "${T.title}": ${T.body}`,k.trim()].filter(Boolean).join(`
8
8
 
9
- `)||void 0,count:O}),Ee=xi(re.map(Ue=>Ue.title),Je.themes);if(Ee.length===0){me.info(u("sandbox.postBoard.ideasFailed"));return}let yt=0;for(const Ue of Ee){const at=ui();try{await x.mutateAsync({blockKey:at,data:mi(at,{title:Ue.title,body:Ue.body,pillarKey:T?.key,createdAt:new Date().toISOString()})}),yt++}catch(rs){console.warn("[posts] could not save a generated idea",rs)}}if(yt===0){me.error(u("sandbox.postBoard.ideasFailed"));return}me.success(u("sandbox.postBoard.ideasAdded",{count:String(yt)}))}catch(Q){me.error(Q instanceof Error?Q.message:u("sandbox.postBoard.ideasFailed"))}finally{w(!1)}};return n.jsxs("div",{className:"relative flex h-full min-w-0 flex-col",children:[n.jsxs("div",{className:"flex shrink-0 flex-wrap items-center justify-between gap-3 border-b px-6 py-3",children:[n.jsx("div",{className:"flex items-center gap-3",children:n.jsxs("div",{className:"flex items-center gap-0.5 rounded-lg border p-0.5",children:[n.jsx(gn,{active:a==="board",onClick:()=>i("board"),icon:n.jsx(Mo,{size:14}),label:u("sandbox.postBoard.viewBoard")}),n.jsx(gn,{active:a==="list",onClick:()=>i("list"),icon:n.jsx(Ho,{size:14}),label:u("sandbox.postBoard.viewList")})]})}),n.jsxs("div",{className:"flex items-center gap-2",children:[N&&n.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground","aria-live":"polite",role:"status",children:[n.jsx(Ct,{size:12,className:"animate-spin"}),u("sandbox.postBoard.generatingLabel")]}),n.jsxs(ut,{open:E,onOpenChange:B,children:[n.jsx(Ma,{asChild:!0,children:n.jsxs(Be,{type:"button",variant:"outline",size:"sm",disabled:!0,children:[n.jsx(tt,{size:14}),u("sandbox.postBoard.generateIdeas"),n.jsx(ot,{variant:"secondary",children:u("common.soon")})]})}),n.jsxs(dt,{className:"sm:max-w-lg",children:[n.jsxs(gt,{children:[n.jsx(ct,{children:u("sandbox.postBoard.generateIdeas")}),n.jsx(Vt,{children:u("sandbox.postBoard.ideaGuidanceLabel")})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsx(Rt,{id:"idea-guidance",value:k,rows:6,autoFocus:!0,onChange:T=>D(T.target.value),placeholder:u("sandbox.postBoard.ideaGuidancePlaceholder"),className:"resize-none text-sm"}),le.length>0&&n.jsxs("div",{className:"space-y-1.5",children:[n.jsx(ze,{className:"text-xs",children:u("sandbox.postBoard.ideaPillarLabel")}),n.jsx(Nt,{options:le.map(T=>T.title),value:le.find(T=>T.key===K)?.title??"",emptyLabel:u("sandbox.postBoard.ideaNoPillar"),onChange:T=>F(le.find(Q=>Q.title===T)?.key??"")})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(ze,{htmlFor:"idea-count",className:"text-xs",children:u("sandbox.postBoard.ideaCount")}),n.jsx(Ze,{id:"idea-count",type:"number",min:1,max:8,value:O,onChange:T=>L(Math.max(1,Math.min(8,Number(T.target.value)||1))),className:"h-9 w-16"}),n.jsx("span",{className:"ml-auto text-xs text-muted-foreground",children:u("sandbox.postBoard.usesCredits")})]})]}),n.jsx(xt,{children:n.jsxs(Be,{type:"button",onClick:()=>{B(!1),is()},children:[n.jsx(tt,{size:14}),u("sandbox.postBoard.generateIdeas")]})})]})]}),n.jsxs(zt,{children:[n.jsx(Ft,{asChild:!0,children:n.jsxs(Be,{type:"button",size:"sm",children:[n.jsx(Ss,{size:14}),u("sandbox.postBoard.newPost"),n.jsx(ht,{size:14})]})}),n.jsxs(Kt,{align:"end",className:"w-56",children:[n.jsxs(We,{disabled:!0,onClick:()=>{z(void 0),R(!0)},children:[n.jsx(tt,{size:14}),n.jsxs("div",{className:"flex flex-col",children:[n.jsxs("span",{className:"flex items-center gap-1.5",children:[u("sandbox.postBoard.newPostGenerate"),n.jsx(ot,{variant:"secondary",children:u("common.soon")})]}),n.jsx("span",{className:"text-xs text-muted-foreground",children:u("sandbox.postBoard.newPostGenerateHint")})]})]}),n.jsxs(We,{onClick:At,children:[n.jsx(Vo,{size:14}),n.jsxs("div",{className:"flex flex-col",children:[n.jsx("span",{children:u("sandbox.postBoard.newPostWrite")}),n.jsx("span",{className:"text-xs text-muted-foreground",children:u("sandbox.postBoard.newPostWriteHint")})]})]}),n.jsxs(We,{onClick:()=>P(!0),children:[n.jsx(ms,{size:14}),n.jsxs("div",{className:"flex flex-col",children:[n.jsx("span",{children:u("sandbox.postBoard.importContent")}),n.jsx("span",{className:"text-xs text-muted-foreground",children:u("sandbox.postBoard.importContentHint")})]})]})]})]}),n.jsx(qi,{open:I,onOpenChange:R,decofile:o,hasAi:y,seed:V,onGenerate:T=>{de(T)}},V?.title??"scratch"),n.jsx(ut,{open:W,onOpenChange:P,children:n.jsxs(dt,{className:"max-h-[85vh] sm:max-w-2xl",children:[n.jsxs(gt,{children:[n.jsx(ct,{children:u("sandbox.postBoard.importTitle")}),n.jsx(Vt,{children:u("sandbox.postBoard.importDescription")})]}),n.jsxs("div",{className:"space-y-3",children:[n.jsx("div",{className:"h-72 overflow-hidden rounded-[var(--studio-control-radius,var(--radius-xl))] border bg-[var(--studio-input-background)]",children:n.jsx(Un,{code:U,language:ko(U)?"html":"markdown",height:"100%",autoFocus:!0,onChange:T=>Y(T??"")})}),n.jsx("input",{ref:q,type:"file",accept:".html,.htm,.md,.markdown,.txt",className:"hidden",onChange:async T=>{const Q=T.target.files?.[0];Q&&Y(await Q.text()),T.target.value=""}}),n.jsxs(Be,{type:"button",variant:"outline",size:"sm",onClick:()=>q.current?.click(),children:[n.jsx(ms,{size:14}),u("sandbox.postBoard.importUpload")]})]}),n.jsx(xt,{children:n.jsxs(Be,{type:"button",disabled:!U.trim(),onClick:ls,children:[n.jsx(ms,{size:14}),u("sandbox.postBoard.importRun")]})})]})})]})]}),te.length===0&&re.length===0?n.jsx(el,{className:"flex-1",icon:n.jsx(tt,{size:22}),title:u("sandbox.postBoard.emptyTitle"),description:u("sandbox.postBoard.emptyDescription"),buttonProps:{children:u("sandbox.postBoard.newPost"),onClick:At}}):a==="board"?n.jsxs("div",{className:"flex min-h-0 flex-1 gap-3 overflow-x-auto p-4",children:[n.jsx(Br,{ideas:re,collapsed:X.includes(pn),pillarTitleOf:C,onToggleCollapsed:()=>ne(pn),onGenerate:ns,onDelete:os}),n.jsx("div",{"aria-hidden":!0,className:"my-1 w-px shrink-0 self-stretch bg-border"}),_s.map(T=>{const Q=te.filter(Ee=>Ee.status===T);Nr(T)&&Q.sort(Sr);const Te=u(Wt[T]),Ve=X.includes(T),Je=vo(p,T);return n.jsx("div",{onDragOver:Ee=>{Ee.preventDefault(),j(T)},onDragLeave:()=>j(Ee=>Ee===T?null:Ee),onDrop:Ee=>{Ee.preventDefault(),as(T,Ee.dataTransfer.getData(wo))},title:Je?jo(u,Je):void 0,className:xe("flex shrink-0 flex-col rounded-xl border bg-muted/30 transition-colors",Ve?"w-11":"w-72",Je&&"opacity-50",v===T&&"border-primary bg-primary/5"),children:Ve?n.jsxs("button",{type:"button",onClick:()=>ne(T),"aria-label":u("sandbox.postBoard.expandLane",{lane:Te}),"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:[n.jsx(Et,{size:14,className:"shrink-0"}),n.jsx("span",{className:"text-xs tabular-nums",children:Q.length}),n.jsx("span",{className:"[writing-mode:vertical-rl] text-sm font-medium",children:Te})]}):n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center justify-between gap-2 px-3 py-2.5 text-sm font-medium",children:[n.jsxs("button",{type:"button",onClick:()=>ne(T),"aria-label":u("sandbox.postBoard.collapseLane",{lane:Te}),"aria-expanded":!0,className:"flex min-w-0 cursor-pointer items-center gap-1.5 text-left hover:text-muted-foreground",children:[n.jsx(ht,{size:14,className:"shrink-0"}),n.jsx("span",{className:"truncate",children:Te})]}),n.jsx("span",{className:"text-xs tabular-nums text-muted-foreground",children:Q.length})]}),n.jsx("div",{className:"min-h-0 flex-1 space-y-2 overflow-y-auto px-2 pb-2",children:Q.length===0?n.jsx("p",{className:"px-1 py-6 text-center text-xs text-muted-foreground",children:u("sandbox.postBoard.laneEmpty")}):Q.map(Ee=>n.jsx(Tr,{post:Ee,payload:J(Ee.key),moving:d.isMoving(Ee.key),onOpen:()=>c(Ee.key),onArchive:Ee.status==="archived"?void 0:()=>{oe(Ee)}},Ee.key))})]})},T)})]}):n.jsxs("div",{className:"flex min-h-0 flex-1",children:[n.jsxs("div",{className:"flex w-80 shrink-0 flex-col border-r",children:[M?n.jsx(jr,{count:je.size,allSelected:Le.length>0&&Le.every(T=>je.has(T.key)),onToggleSelectAll:Ne,onArchive:()=>{Oe()},onExit:()=>Se(new Set)}):n.jsx(hr,{categories:ge,authors:$e,statusCounts:Ae,categoryFilter:S,authorFilter:H,statusFilter:ye,sort:ke,onCategoryFilterChange:se,onAuthorFilterChange:ie,onStatusFilterChange:pe,onSortChange:he}),n.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:n.jsx(Cr,{posts:Le,selectedKey:Z,selectionActive:M,selectedKeys:je,onToggleSelect:ve,onOpen:c,isMoving:d.isMoving,onArchive:T=>{oe(T)}})})]}),n.jsx("div",{className:"min-w-0 flex-1 overflow-hidden",children:Z&&h?n.jsx($.Suspense,{fallback:n.jsx("div",{className:"flex h-full items-center justify-center",children:n.jsx(Ct,{size:20,className:"animate-spin text-muted-foreground"})}),children:h(Z)}):n.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center text-sm text-muted-foreground",children:u("sandbox.postBoard.selectPrompt")})})]}),a==="board"&&l&&_&&h&&n.jsx("div",{className:"absolute inset-0 z-30 flex flex-col bg-background",children:h(l,{expanded:!0,onToggleExpand:()=>A(!1),onClose:()=>{A(!1),r?.()}})}),n.jsx(ut,{open:a==="board"&&!!l&&!_,onOpenChange:T=>{T||(A(!1),r?.())},children:n.jsxs(dt,{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:[n.jsx(ct,{className:"sr-only",children:u("sandbox.collectionsSidebar.posts")}),l&&h?n.jsx($.Suspense,{fallback:n.jsx("div",{className:"flex h-full items-center justify-center",children:n.jsx(Ct,{size:20,className:"animate-spin text-muted-foreground"})}),children:h(l,{expanded:!1,onToggleExpand:()=>A(!0),onClose:()=>r?.()})}):null]})})]})}function gn(t){const e=ae.c(7),{active:s,onClick:o,icon:a,label:l}=t,i=s?"bg-accent text-accent-foreground":"text-muted-foreground hover:text-foreground";let c;e[0]!==i?(c=xe("inline-flex cursor-pointer items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",i),e[0]=i,e[1]=c):c=e[1];let r;return e[2]!==a||e[3]!==l||e[4]!==o||e[5]!==c?(r=n.jsxs("button",{type:"button",onClick:o,className:c,children:[a,l]}),e[2]=a,e[3]=l,e[4]=o,e[5]=c,e[6]=r):r=e[6],r}function Cr(t){const e=ae.c(19),{posts:s,selectedKey:o,selectionActive:a,selectedKeys:l,onToggleSelect:i,onOpen:c,isMoving:r,onArchive:d}=t;let p;if(e[0]!==r||e[1]!==d||e[2]!==c||e[3]!==i||e[4]!==s||e[5]!==o||e[6]!==l||e[7]!==a){let h;e[9]!==r||e[10]!==d||e[11]!==c||e[12]!==i||e[13]!==o||e[14]!==l||e[15]!==a?(h=u=>n.jsx(Pr,{post:u,selected:u.key===o,selectionActive:a,checked:l.has(u.key),onToggleSelect:()=>i(u.key),moving:r(u.key),onOpen:()=>c(u.key),onArchive:u.status==="archived"?void 0:()=>d(u)},u.key),e[9]=r,e[10]=d,e[11]=c,e[12]=i,e[13]=o,e[14]=l,e[15]=a,e[16]=h):h=e[16],p=s.map(h),e[0]=r,e[1]=d,e[2]=c,e[3]=i,e[4]=s,e[5]=o,e[6]=l,e[7]=a,e[8]=p}else p=e[8];let m;return e[17]!==p?(m=n.jsx("ul",{className:"divide-y",children:p}),e[17]=p,e[18]=m):m=e[18],m}function Pr(t){const e=ae.c(56),{post:s,selected:o,selectionActive:a,checked:l,onToggleSelect:i,moving:c,onOpen:r,onArchive:d}=t,p=we(),m=s.status==="awaiting_review"&&s.missing.length>0,h=s.status==="scheduled"||s.status==="published",u=a||l?"opacity-100":"opacity-0 focus-within:opacity-100 group-hover/row:opacity-100";let f;e[0]!==u?(f=xe("absolute left-3 top-3 z-10 transition-opacity",u),e[0]=u,e[1]=f):f=e[1];let x;e[2]!==i?(x=()=>i(),e[2]=i,e[3]=x):x=e[3];let g;e[4]!==s.title||e[5]!==p?(g=s.title||p("sandbox.postBoard.untitled"),e[4]=s.title,e[5]=p,e[6]=g):g=e[6];let y;e[7]!==l||e[8]!==x||e[9]!==g?(y=n.jsx(Zt,{checked:l,onCheckedChange:x,"aria-label":g}),e[7]=l,e[8]=x,e[9]=g,e[10]=y):y=e[10];let v;e[11]!==f||e[12]!==y?(v=n.jsx("span",{className:f,children:y}),e[11]=f,e[12]=y,e[13]=v):v=e[13];let j;e[14]!==c||e[15]!==d||e[16]!==a?(j=d&&!a&&n.jsx(Ls,{onArchive:d,disabled:c,className:"top-2.5"}),e[14]=c,e[15]=d,e[16]=a,e[17]=j):j=e[17];let N;e[18]!==r||e[19]!==i||e[20]!==a?(N=()=>a?i():r(),e[18]=r,e[19]=i,e[20]=a,e[21]=N):N=e[21];const w=o?"bg-accent text-accent-foreground":"bg-card hover:bg-muted/50";let E;e[22]!==w?(E=xe("flex w-full cursor-pointer flex-col gap-1.5 py-2.5 pl-10 pr-3 text-left text-sm transition-colors",w),e[22]=w,e[23]=E):E=e[23];let B;e[24]!==s.title||e[25]!==p?(B=s.title||p("sandbox.postBoard.untitled"),e[24]=s.title,e[25]=p,e[26]=B):B=e[26];let k;e[27]!==B?(k=n.jsx("span",{className:"min-w-0 truncate pr-6 font-medium",children:B}),e[27]=B,e[28]=k):k=e[28];const D=kr[s.status],O=Wt[s.status];let L;e[29]!==p||e[30]!==O?(L=p(O),e[29]=p,e[30]=O,e[31]=L):L=e[31];let K;e[32]!==D||e[33]!==L?(K=n.jsx(ot,{variant:D,className:"shrink-0",children:L}),e[32]=D,e[33]=L,e[34]=K):K=e[34];let F;e[35]!==m||e[36]!==s.missing?(F=m&&n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-warning",children:[n.jsx(Yt,{size:12}),s.missing.length]}),e[35]=m,e[36]=s.missing,e[37]=F):F=e[37];let _;e[38]!==h||e[39]!==s.date||e[40]!==s.scheduledDatetime?(_=h&&n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs tabular-nums text-muted-foreground",children:[n.jsx(ks,{size:12}),(s.scheduledDatetime||s.date||"").slice(0,10)]}),e[38]=h,e[39]=s.date,e[40]=s.scheduledDatetime,e[41]=_):_=e[41];let A;e[42]!==K||e[43]!==F||e[44]!==_?(A=n.jsxs("div",{className:"flex items-center gap-2",children:[K,F,_]}),e[42]=K,e[43]=F,e[44]=_,e[45]=A):A=e[45];let I;e[46]!==o||e[47]!==E||e[48]!==k||e[49]!==A||e[50]!==N?(I=n.jsxs("button",{type:"button",onClick:N,"aria-current":o,className:E,children:[k,A]}),e[46]=o,e[47]=E,e[48]=k,e[49]=A,e[50]=N,e[51]=I):I=e[51];let R;return e[52]!==I||e[53]!==v||e[54]!==j?(R=n.jsxs("li",{className:"group/row relative",children:[v,j,I]}),e[52]=I,e[53]=v,e[54]=j,e[55]=R):R=e[55],R}function Tr(t){const e=ae.c(46),{post:s,payload:o,moving:a,onOpen:l,onArchive:i}=t,c=we(),r=s.status!=="generating"&&!a;let d;e[0]!==o?(d=Yl(o),e[0]=o,e[1]=d):d=e[1];const p=d,m=!r&&"opacity-80";let h;e[2]!==m?(h=xe("group/card relative rounded-lg border bg-card shadow-sm transition-colors hover:border-primary/40",m),e[2]=m,e[3]=h):h=e[3];let u;e[4]!==a||e[5]!==i?(u=i&&n.jsx(Ls,{onArchive:i,disabled:a,className:"top-2"}),e[4]=a,e[5]=i,e[6]=u):u=e[6];let f;e[7]!==s.key?(f=O=>O.dataTransfer.setData(wo,s.key),e[7]=s.key,e[8]=f):f=e[8];const x=r?"cursor-grab active:cursor-grabbing":"cursor-pointer";let g;e[9]!==x?(g=xe("block w-full p-3 text-left",x),e[9]=x,e[10]=g):g=e[10];let y;e[11]!==s.title||e[12]!==c?(y=s.title||c("sandbox.postBoard.untitled"),e[11]=s.title,e[12]=c,e[13]=y):y=e[13];let v;e[14]!==y?(v=n.jsx("p",{className:"line-clamp-2 pr-6 text-sm font-medium",children:y}),e[14]=y,e[15]=v):v=e[15];let j;e[16]!==p||e[17]!==s.status?(j=s.status==="draft"&&n.jsxs(n.Fragment,{children:[p.pillarTitle&&n.jsx(ot,{variant:"secondary",className:"max-w-full truncate",children:p.pillarTitle}),p.format?.name&&n.jsx(ot,{variant:"outline",className:"max-w-full truncate",children:p.format.name})]}),e[16]=p,e[17]=s.status,e[18]=j):j=e[18];let N;e[19]!==s.status||e[20]!==c?(N=s.status==="generating"&&n.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground",children:[n.jsx(Ct,{size:12,className:"animate-spin"}),c("sandbox.postBoard.generatingLabel")]}),e[19]=s.status,e[20]=c,e[21]=N):N=e[21];let w;e[22]!==s.missing||e[23]!==s.status||e[24]!==c?(w=s.status==="awaiting_review"&&(s.missing.length>0?n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-warning",children:[n.jsx(Yt,{size:12}),c("sandbox.postBoard.nIssues",{count:String(s.missing.length)})]}):n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-success",children:[n.jsx(Za,{size:12}),c("sandbox.postBoard.readyToSchedule")]})),e[22]=s.missing,e[23]=s.status,e[24]=c,e[25]=w):w=e[25];let E;e[26]!==s.date||e[27]!==s.scheduledDatetime||e[28]!==s.status?(E=(s.status==="scheduled"||s.status==="published")&&n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground",children:[n.jsx(ks,{size:12}),(s.scheduledDatetime||s.date||"").slice(0,10)]}),e[26]=s.date,e[27]=s.scheduledDatetime,e[28]=s.status,e[29]=E):E=e[29];let B;e[30]!==j||e[31]!==N||e[32]!==w||e[33]!==E?(B=n.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5",children:[j,N,w,E]}),e[30]=j,e[31]=N,e[32]=w,e[33]=E,e[34]=B):B=e[34];let k;e[35]!==r||e[36]!==l||e[37]!==B||e[38]!==f||e[39]!==g||e[40]!==v?(k=n.jsxs("button",{type:"button",draggable:r,onDragStart:f,onClick:l,className:g,children:[v,B]}),e[35]=r,e[36]=l,e[37]=B,e[38]=f,e[39]=g,e[40]=v,e[41]=k):k=e[41];let D;return e[42]!==k||e[43]!==h||e[44]!==u?(D=n.jsxs("div",{className:h,children:[u,k]}),e[42]=k,e[43]=h,e[44]=u,e[45]=D):D=e[45],D}function Br(t){const e=ae.c(40),{ideas:s,collapsed:o,pillarTitleOf:a,onToggleCollapsed:l,onGenerate:i,onDelete:c}=t,r=we();let d,p,m,h,u,f,x;if(e[0]!==o||e[1]!==s.length||e[2]!==l||e[3]!==r){x=Symbol.for("react.early_return_sentinel");e:{if(d=r("sandbox.postBoard.ideasTray"),o){let k;e[11]===Symbol.for("react.memo_cache_sentinel")?(k=n.jsx(Et,{size:14,className:"shrink-0"}),e[11]=k):k=e[11];let D;e[12]!==s.length?(D=n.jsx("span",{className:"text-xs tabular-nums",children:s.length}),e[12]=s.length,e[13]=D):D=e[13],x=n.jsxs("button",{type:"button",onClick:l,"aria-label":r("sandbox.postBoard.expandLane",{lane:d}),"aria-expanded":!1,className:"flex w-11 shrink-0 cursor-pointer flex-col items-center gap-2 py-2.5 text-muted-foreground hover:text-foreground",children:[k,D,n.jsx("span",{className:"[writing-mode:vertical-rl] text-sm font-medium",children:d})]});break e}f="flex w-72 shrink-0 flex-col",u="flex items-center justify-between gap-2 px-3 py-2.5 text-sm font-medium",p="button",m=l,h=r("sandbox.postBoard.collapseLane",{lane:d})}e[0]=o,e[1]=s.length,e[2]=l,e[3]=r,e[4]=d,e[5]=p,e[6]=m,e[7]=h,e[8]=u,e[9]=f,e[10]=x}else d=e[4],p=e[5],m=e[6],h=e[7],u=e[8],f=e[9],x=e[10];if(x!==Symbol.for("react.early_return_sentinel"))return x;let g;e[14]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(ht,{size:14,className:"shrink-0"}),e[14]=g):g=e[14];let y;e[15]!==d?(y=n.jsx("span",{className:"truncate",children:d}),e[15]=d,e[16]=y):y=e[16];let v;e[17]!==p||e[18]!==m||e[19]!==h||e[20]!==y?(v=n.jsxs("button",{type:p,onClick:m,"aria-label":h,"aria-expanded":!0,className:"flex min-w-0 cursor-pointer items-center gap-1.5 text-left hover:text-muted-foreground",children:[g,y]}),e[17]=p,e[18]=m,e[19]=h,e[20]=y,e[21]=v):v=e[21];let j;e[22]!==s.length?(j=n.jsx("span",{className:"text-xs tabular-nums text-muted-foreground",children:s.length}),e[22]=s.length,e[23]=j):j=e[23];let N;e[24]!==j||e[25]!==u||e[26]!==v?(N=n.jsxs("div",{className:u,children:[v,j]}),e[24]=j,e[25]=u,e[26]=v,e[27]=N):N=e[27];let w;e[28]!==s||e[29]!==c||e[30]!==i||e[31]!==a||e[32]!==r?(w=s.length===0?n.jsx("p",{className:"px-1 py-6 text-center text-xs text-muted-foreground",children:r("sandbox.postBoard.ideasEmpty")}):s.map(k=>{const D=a(k.pillarKey);return n.jsxs("div",{className:"group/card relative rounded-lg border border-dashed bg-card shadow-sm transition-colors hover:border-primary/40",children:[n.jsx(Ls,{label:r("sandbox.postBoard.deleteIdea"),onArchive:()=>c(k),className:"top-2"}),n.jsxs("div",{className:"p-3",children:[n.jsx("p",{className:"line-clamp-2 pr-6 text-sm font-medium",children:k.title||r("sandbox.postBoard.untitledIdea")}),k.body&&n.jsx("p",{className:"mt-1 line-clamp-2 text-xs text-muted-foreground",children:k.body}),D&&n.jsx(ot,{variant:"secondary",className:"mt-2 max-w-full truncate",children:D})]}),n.jsx("div",{className:"border-t px-3 py-2",children:n.jsxs(Be,{type:"button",variant:"ghost",size:"sm",disabled:!0,className:"h-7 w-full justify-start px-1.5 text-xs",onClick:()=>i(k),children:[n.jsx(tt,{size:13}),r("sandbox.postBoard.writeFromIdea"),n.jsx(ot,{variant:"secondary",className:"ml-auto",children:r("common.soon")})]})})]},k.key)}),e[28]=s,e[29]=c,e[30]=i,e[31]=a,e[32]=r,e[33]=w):w=e[33];let E;e[34]!==w?(E=n.jsx("div",{className:"min-h-0 flex-1 space-y-2 overflow-y-auto pb-2 pr-1",children:w}),e[34]=w,e[35]=E):E=e[35];let B;return e[36]!==N||e[37]!==E||e[38]!==f?(B=n.jsxs("div",{className:f,children:[N,E]}),e[36]=N,e[37]=E,e[38]=f,e[39]=B):B=e[39],B}function Ls(t){const e=ae.c(13),{label:s,onArchive:o,disabled:a,className:l}=t,i=we();let c;e[0]!==s||e[1]!==i?(c=s??i("sandbox.postBoard.delete"),e[0]=s,e[1]=i,e[2]=c):c=e[2];const r=c;let d;e[3]!==o?(d=u=>{u.stopPropagation(),o()},e[3]=o,e[4]=d):d=e[4];let p;e[5]!==l?(p=xe("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",l),e[5]=l,e[6]=p):p=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(Ps,{size:13}),e[7]=m):m=e[7];let h;return e[8]!==a||e[9]!==d||e[10]!==p||e[11]!==r?(h=n.jsx("button",{type:"button",disabled:a,"aria-label":r,title:r,onClick:d,className:p,children:m}),e[8]=a,e[9]=d,e[10]=p,e[11]=r,e[12]=h):h=e[12],h}function He(t){const e=ae.c(50),{icon:s,logoUrl:o,title:a,subtitle:l,active:i,accent:c,variantCount:r,trailing:d,selectable:p,selectionActive:m,selected:h,invalid:u,invalidReason:f,onToggleSelect:x,onClick:g,menu:y}=t,v=we(),j=c==="global";let N;e[0]!==s||e[1]!==i||e[2]!==j||e[3]!==o?(N=o?n.jsx("img",{src:o,alt:"",className:"size-8 shrink-0 rounded-lg object-cover bg-muted"}):n.jsx("span",{className:xe("flex size-8 shrink-0 items-center justify-center rounded-lg",j?"bg-global-section/15":"bg-muted"),children:n.jsx(s,{size:16,className:xe("shrink-0",!j&&(i?"text-accent-foreground":"text-muted-foreground")),style:j?{color:Cs}:void 0})}),e[0]=s,e[1]=i,e[2]=j,e[3]=o,e[4]=N):N=e[4];const w=N,E=i?j?"bg-global-section/15 text-global-section-fg dark:text-global-section-fg-dark":"bg-accent text-accent-foreground":j?"hover:bg-global-section/10":"hover:bg-muted";let B;e[5]!==E?(B=xe("group relative flex min-w-0 items-center rounded-md transition-colors",E),e[5]=E,e[6]=B):B=e[6];let k;e[7]!==x||e[8]!==p||e[9]!==h||e[10]!==m||e[11]!==v||e[12]!==a?(k=p&&n.jsx("span",{className:xe("flex shrink-0 items-center pl-2.5 transition-opacity",h||m?"opacity-100":"opacity-0 group-hover:opacity-100 focus-within:opacity-100"),onClick:Er,children:n.jsx(Zt,{checked:h,onCheckedChange:()=>x?.(),"aria-label":v("sandbox.itemRow.selectItem",{title:a})})}),e[7]=x,e[8]=p,e[9]=h,e[10]=m,e[11]=v,e[12]=a,e[13]=k):k=e[13];const D=u&&!i&&"text-destructive";let O;e[14]!==D?(O=xe("block truncate text-sm font-medium",D),e[14]=D,e[15]=O):O=e[15];let L;e[16]!==O||e[17]!==a?(L=n.jsx("span",{className:O,children:a}),e[16]=O,e[17]=a,e[18]=L):L=e[18];const K=i?"text-accent-foreground/70":"text-muted-foreground";let F;e[19]!==K?(F=xe("block truncate text-xs",K),e[19]=K,e[20]=F):F=e[20];let _;e[21]!==l||e[22]!==F?(_=n.jsx("span",{className:F,children:l}),e[21]=l,e[22]=F,e[23]=_):_=e[23];let A;e[24]!==_||e[25]!==L?(A=n.jsxs("span",{className:"min-w-0 flex-1",children:[L,_]}),e[24]=_,e[25]=L,e[26]=A):A=e[26];let I;e[27]!==i||e[28]!==v||e[29]!==r?(I=r!==void 0&&r>1&&n.jsxs(Xe,{children:[n.jsx(Ye,{asChild:!0,children:n.jsxs("span",{className:xe("flex shrink-0 items-center gap-1 text-xs font-medium",i?"text-accent-foreground/70":"text-muted-foreground"),children:[n.jsx(Bn,{size:14}),r]})}),n.jsx(Qe,{side:"bottom",children:v("sandbox.itemRow.variantCount",{count:r})})]}),e[27]=i,e[28]=v,e[29]=r,e[30]=I):I=e[30];let R;e[31]!==i||e[32]!==u||e[33]!==f?(R=u&&n.jsxs(Xe,{children:[n.jsx(Ye,{asChild:!0,children:n.jsx("span",{className:xe("flex shrink-0 items-center",i?"text-accent-foreground":"text-destructive"),children:n.jsx(Yt,{size:14})})}),f&&n.jsx(Qe,{side:"bottom",children:f})]}),e[31]=i,e[32]=u,e[33]=f,e[34]=R):R=e[34];let V;e[35]!==g||e[36]!==w||e[37]!==A||e[38]!==I||e[39]!==R||e[40]!==d?(V=n.jsxs("button",{type:"button",onClick:g,className:"flex min-w-0 flex-1 items-center gap-2.5 classic:rounded-md compact:rounded-lg px-2.5 py-2 text-left cursor-pointer",children:[w,A,I,R,d]}),e[35]=g,e[36]=w,e[37]=A,e[38]=I,e[39]=R,e[40]=d,e[41]=V):V=e[41];let z;e[42]!==i||e[43]!==y?(z=y&&n.jsx("div",{className:xe("pr-1 opacity-0 transition-opacity group-hover:opacity-100",i&&"opacity-100"),children:y}),e[42]=i,e[43]=y,e[44]=z):z=e[44];let W;return e[45]!==V||e[46]!==z||e[47]!==B||e[48]!==k?(W=n.jsxs("div",{className:B,children:[k,V,z]}),e[45]=V,e[46]=z,e[47]=B,e[48]=k,e[49]=W):W=e[49],W}function Er(t){return t.stopPropagation()}function st(t){const e=ae.c(10),{icon:s,title:o,description:a}=t;let l;e[0]!==s?(l=s&&n.jsx(s,{size:24,className:"text-muted-foreground/60"}),e[0]=s,e[1]=l):l=e[1];let i;e[2]!==o?(i=n.jsx("div",{children:o}),e[2]=o,e[3]=i):i=e[3];let c;e[4]!==a?(c=a&&n.jsx("div",{className:"text-xs text-muted-foreground/80 max-w-sm",children:a}),e[4]=a,e[5]=c):c=e[5];let r;return e[6]!==l||e[7]!==i||e[8]!==c?(r=n.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:[l,i,c]}),e[6]=l,e[7]=i,e[8]=c,e[9]=r):r=e[9],r}const _r={loaders:Tn,actions:Vn},Dr={loaders:"Loaders",actions:"Actions"},Ar={analytics:nl,blog:wn,commerce:sl,site:Go,website:Mt};function $r(t,e){return e===0?Ar[t.toLowerCase()]??Ks:Ks}function Lt(t,e){return e===0?ca(t):t}function Lr(t){const e=ae.c(98),{orgSlug:s,virtualMcpId:o,branch:a,previewUrl:l,meta:i,decofile:c,kind:r}=t,d=we();let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=[],e[0]=p):p=e[0];const[m,h]=$.useState(p),[u,f]=$.useState(null),[x,g]=$.useState(""),[y,v]=$.useState(Vr),[j,N]=$.useState(r);j!==r&&(N(r),h([]),f(null),g(""),v(new Set));let w;e[1]===Symbol.for("react.memo_cache_sentinel")?(w=q=>{v(X=>{const ce=new Set(X);return ce.has(q)?ce.delete(q):ce.add(q),ce})},e[1]=w):w=e[1];const E=w;let B;e[2]!==a||e[3]!==s||e[4]!==o?(B={orgSlug:s,virtualMcpId:o,branch:a},e[2]=a,e[3]=s,e[4]=o,e[5]=B):B=e[5];const k=Xt(B);let D;e[6]!==k?(D=Rn((q,X)=>k.mutate({blockKey:q,data:X})),e[6]=k,e[7]=D):D=e[7];const O=D;let L;e[8]!==r?(L=da(r),e[8]=r,e[9]=L):L=e[9];const K=L,F=_r[r];let _,A,I,R,V,z,W;if(e[10]!==F||e[11]!==a||e[12]!==c||e[13]!==r||e[14]!==i||e[15]!==y||e[16]!==s||e[17]!==m||e[18]!==l||e[19]!==k||e[20]!==O||e[21]!==x||e[22]!==u||e[23]!==K||e[24]!==d||e[25]!==o){I=Symbol.for("react.early_return_sentinel");e:{const q=[...aa(i,c,r).map(Mr),...la(i,r).map(zr)],X=x.trim().toLowerCase(),ce=X.length>0,ne=ce?q.filter(M=>M.title.toLowerCase().includes(X)||M.resolveType.toLowerCase().includes(X)):[],de=new Map,te=[],re=new Map;if(!ce){for(const M of q){const ve=M.folderPath;if(!(ve.length<m.length)&&m.every((Ne,Oe)=>ve[Oe]===Ne))if(ve.length===m.length)if(M.savedKey!==void 0){const Ne=re.get(M.resolveType);Ne?Ne.push(M):re.set(M.resolveType,[M])}else te.push(M);else{const Ne=ve[m.length],Oe=de.get(Ne)??{count:0,savedCount:0};M.savedKey!==void 0?Oe.savedCount=Oe.savedCount+1:Oe.count=Oe.count+1,de.set(Ne,Oe)}}te.sort(Kr);for(const M of re.values())M.sort(Fr)}const le=[...re.entries()].filter(M=>{const[ve]=M;return!te.some(Ne=>Ne.resolveType===ve)}).flatMap(Rr).sort(Ir);let C;e[33]!==m?(C=(M,ve)=>Lt(M.name,m.length).localeCompare(Lt(ve.name,m.length)),e[33]=m,e[34]=C):C=e[34];const J=[...de.entries()].map(Or).sort(C);let Z;e[35]===Symbol.for("react.memo_cache_sentinel")?(Z=M=>{f(M.savedKey!==void 0?{mode:"saved",key:M.savedKey}:{mode:"available",resolveType:M.resolveType,title:M.title})},e[35]=Z):Z=e[35];const oe=Z;let S;e[36]!==k||e[37]!==K||e[38]!==d?(S=async(M,ve)=>{await k.mutateAsync({blockKey:M,data:ve}),me.success(d("sandbox.runnableBlocksBrowser.savedBlockToast",{singular:K,blockId:M})),f({mode:"saved",key:M})},e[36]=k,e[37]=K,e[38]=d,e[39]=S):S=e[39];const se=S;let H;e[40]!==c||e[41]!==u?(H=Gr(u,c),e[40]=c,e[41]=u,e[42]=H):H=e[42];const ie=H;if(ie){const M=`${ie.mode}:${ie.mode==="saved"?ie.blockKey:ie.resolveType}`;let ve;e[43]===Symbol.for("react.memo_cache_sentinel")?(ve=()=>f(null),e[43]=ve):ve=e[43];let Ne;e[44]!==a||e[45]!==c||e[46]!==se||e[47]!==r||e[48]!==i||e[49]!==s||e[50]!==l||e[51]!==k.isPending||e[52]!==O||e[53]!==M||e[54]!==ie.editorTarget||e[55]!==ie.initialValue||e[56]!==o?(Ne=n.jsx(ia,{orgSlug:s,virtualMcpId:o,branch:a,previewUrl:l,meta:i,decofile:c,kind:r,target:ie.editorTarget,initialValue:ie.initialValue,isCreating:k.isPending,onCreate:se,onSaveReferencedBlock:O,onBack:ve},M),e[44]=a,e[45]=c,e[46]=se,e[47]=r,e[48]=i,e[49]=s,e[50]=l,e[51]=k.isPending,e[52]=O,e[53]=M,e[54]=ie.editorTarget,e[55]=ie.initialValue,e[56]=o,e[57]=Ne):Ne=e[57],I=Ne;break e}W="flex h-full w-full min-w-0 flex-col";let ye;e[58]!==d?(ye=d("sandbox.runnableBlocksBrowser.folderBreadcrumb"),e[58]=d,e[59]=ye):ye=e[59];let pe;e[60]===Symbol.for("react.memo_cache_sentinel")?(pe=()=>h([]),e[60]=pe):pe=e[60];const ke=m.length===0?"font-medium text-foreground":"text-muted-foreground";let he;e[61]!==ke?(he=xe("min-w-0 truncate classic:rounded-md compact:rounded-lg px-1 py-0.5 transition-colors hover:bg-accent hover:text-accent-foreground",ke),e[61]=ke,e[62]=he):he=e[62];const je=Dr[r];let Se;e[63]!==he||e[64]!==je?(Se=n.jsx("button",{type:"button",onClick:pe,className:he,children:je}),e[63]=he,e[64]=je,e[65]=Se):Se=e[65];let Ae;e[66]!==m?(Ae=m.map((M,ve)=>{const Ne=ve===m.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[n.jsx(Et,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>h(m.slice(0,ve+1)),className:xe("min-w-0 truncate classic:rounded-md compact:rounded-lg px-1 py-0.5 transition-colors hover:bg-accent hover:text-accent-foreground",Ne?"font-medium text-foreground":"text-muted-foreground"),children:Lt(M,ve)})]},`${M}-${ve}`)}),e[66]=m,e[67]=Ae):Ae=e[67];let Ce;e[68]!==ye||e[69]!==Se||e[70]!==Ae?(Ce=n.jsxs("nav",{"aria-label":ye,className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:[Se,Ae]}),e[68]=ye,e[69]=Se,e[70]=Ae,e[71]=Ce):Ce=e[71];let Pe;e[72]===Symbol.for("react.memo_cache_sentinel")?(Pe=n.jsx(An,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),e[72]=Pe):Pe=e[72];let De;e[73]===Symbol.for("react.memo_cache_sentinel")?(De=M=>g(M.target.value),e[73]=De):De=e[73];let ge;e[74]!==r||e[75]!==d?(ge=d("sandbox.runnableBlocksBrowser.searchPlaceholder",{kind:r}),e[74]=r,e[75]=d,e[76]=ge):ge=e[76];let $e;e[77]!==r||e[78]!==d?($e=d("sandbox.runnableBlocksBrowser.searchAriaLabel",{kind:r}),e[77]=r,e[78]=d,e[79]=$e):$e=e[79];let Le;e[80]!==x||e[81]!==ge||e[82]!==$e?(Le=n.jsxs("div",{className:"flex w-56 shrink-0 items-center gap-2",children:[Pe,n.jsx("input",{type:"text",value:x,onChange:De,placeholder:ge,"aria-label":$e,className:"w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),e[80]=x,e[81]=ge,e[82]=$e,e[83]=Le):Le=e[83],e[84]!==Ce||e[85]!==Le?(A=n.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-2 border-b px-4",children:[Ce,Le]}),e[84]=Ce,e[85]=Le,e[86]=A):A=e[86],_=Qt,z="min-h-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",R="mx-auto w-full max-w-4xl px-6 py-5",V=ce?ne.length===0?n.jsx(st,{title:d("sandbox.runnableBlocksBrowser.noSearchResults",{kind:r,query:x.trim()}),description:d("sandbox.runnableBlocksBrowser.noSearchResultsDescription")}):n.jsx("div",{className:"flex flex-col gap-1",children:ne.map(M=>n.jsx(He,{icon:F,accent:M.savedKey!==void 0?"global":void 0,title:M.title,subtitle:M.resolveType,active:!1,onClick:()=>oe(M)},M.savedKey??M.resolveType))}):J.length===0&&te.length===0&&le.length===0?n.jsx(st,{title:d("sandbox.runnableBlocksBrowser.emptyFolderTitle",{kind:r}),description:m.length===0?d("sandbox.runnableBlocksBrowser.emptyFolderNoManifest"):d("sandbox.runnableBlocksBrowser.emptyFolder")}):n.jsxs(n.Fragment,{children:[J.length>0&&n.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(180px,1fr))] gap-2",children:J.map(M=>{const ve=$r(M.name,m.length);return n.jsxs("button",{type:"button",onClick:()=>h([...m,M.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:[n.jsx(ve,{size:18,className:"shrink-0 text-muted-foreground"}),n.jsxs("span",{className:"min-w-0 flex-1",children:[n.jsx("span",{className:"block truncate text-sm font-medium",children:Lt(M.name,m.length)}),n.jsxs("span",{className:"block truncate text-xs text-muted-foreground",children:[M.count," ",M.count===1?K:r,M.savedCount>0&&n.jsxs(n.Fragment,{children:[" ","·"," ",d("sandbox.runnableBlocksBrowser.savedCountLabel",{count:M.savedCount})]})]})]})]},M.name)})}),(te.length>0||le.length>0)&&n.jsxs("div",{className:xe("flex flex-col gap-1",J.length>0&&"mt-4"),children:[te.map(M=>{const ve=re.get(M.resolveType)??[],Ne=y.has(M.resolveType);return n.jsxs("div",{className:"flex flex-col",children:[n.jsx(He,{icon:F,title:M.title,subtitle:M.resolveType,active:!1,onClick:()=>oe(M)}),ve.length>0&&n.jsxs(n.Fragment,{children:[n.jsxs("button",{type:"button",onClick:()=>E(M.resolveType),"aria-expanded":Ne,className:"flex items-center gap-1 self-start classic:rounded-md compact:rounded-lg px-2.5 py-1 text-xs font-medium transition-colors hover:bg-global-section/10 cursor-pointer ml-11",style:{color:Cs},children:[Ne?n.jsx(ht,{size:12,className:"shrink-0"}):n.jsx(Et,{size:12,className:"shrink-0"}),d(Ne?"sandbox.runnableBlocksBrowser.hideSaved":"sandbox.runnableBlocksBrowser.seeSaved")," ","(",ve.length,")"]}),Ne&&n.jsx("div",{className:"ml-11 flex flex-col gap-1 pb-1",children:ve.map(Oe=>n.jsx(He,{icon:F,accent:"global",title:Oe.title,subtitle:Oe.resolveType,active:!1,onClick:()=>oe(Oe)},Oe.savedKey))})]})]},M.resolveType)}),le.map(M=>n.jsx(He,{icon:F,accent:"global",title:M.title,subtitle:M.resolveType,active:!1,onClick:()=>oe(M)},M.savedKey))]})]})}e[10]=F,e[11]=a,e[12]=c,e[13]=r,e[14]=i,e[15]=y,e[16]=s,e[17]=m,e[18]=l,e[19]=k,e[20]=O,e[21]=x,e[22]=u,e[23]=K,e[24]=d,e[25]=o,e[26]=_,e[27]=A,e[28]=I,e[29]=R,e[30]=V,e[31]=z,e[32]=W}else _=e[26],A=e[27],I=e[28],R=e[29],V=e[30],z=e[31],W=e[32];if(I!==Symbol.for("react.early_return_sentinel"))return I;let P;e[87]!==R||e[88]!==V?(P=n.jsx("div",{className:R,children:V}),e[87]=R,e[88]=V,e[89]=P):P=e[89];let U;e[90]!==_||e[91]!==P||e[92]!==z?(U=n.jsx(_,{className:z,children:P}),e[90]=_,e[91]=P,e[92]=z,e[93]=U):U=e[93];let Y;return e[94]!==A||e[95]!==U||e[96]!==W?(Y=n.jsxs("div",{className:W,children:[A,U]}),e[94]=A,e[95]=U,e[96]=W,e[97]=Y):Y=e[97],Y}function Or(t){const[e,s]=t;return{name:e,...s}}function Ir(t,e){return t.title.localeCompare(e.title)}function Rr(t){const[,e]=t;return e}function Fr(t,e){return t.title.localeCompare(e.title)}function Kr(t,e){return t.title.localeCompare(e.title)}function zr(t){return{resolveType:t.resolveType,title:t.title,folderPath:In(t.resolveType)}}function Mr(t){return{resolveType:t.resolveType,title:t.title,folderPath:In(t.resolveType),savedKey:t.key}}function Vr(){return new Set}function Gr(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:o,title:a}=ra(e,t.key);return{mode:"saved",blockKey:t.key,resolveType:s,editorTarget:{mode:"saved",blockKey:t.key,resolveType:s,title:a},initialValue:o}}function Ur(t){const e=ae.c(106),{orgSlug:s,virtualMcpId:o,branch:a,previewUrl:l,meta:i,decofile:c,resolveType:r,title:d,defaultBlockId:p,isCreating:m,onCreate:h,onSaveReferencedBlock:u}=t,f=we(),x=_t(),g=x?.virtualMcpId,v=Hn(g===o?o:null)?.metadata?.siteSlug??null;let j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j={},e[0]=j):j=e[0];const[N,w]=$.useState(j);let E;e[1]===Symbol.for("react.memo_cache_sentinel")?(E=[],e[1]=E):E=e[1];const[B,k]=$.useState(E),[D,O]=$.useState(0),[L,K]=$.useState(!1);let F;e[2]!==i||e[3]!==r?(F=Ns(r,i),e[2]=i,e[3]=r,e[4]=F):F=e[4];const _=F;let A,I,R,V,z,W,P,U;if(e[5]!==v||e[6]!==a||e[7]!==c||e[8]!==B||e[9]!==N||e[10]!==m||e[11]!==h||e[12]!==s||e[13]!==l||e[14]!==r||e[15]!==f||e[16]!==x?.taskId||e[17]!==d||e[18]!==o){const te=r.split("/").pop()?.replace(/\.tsx?$/,"")??r,re=x?.taskId??null,le=l??void 0;let C;e[27]!==v||e[28]!==a||e[29]!==s||e[30]!==le||e[31]!==re||e[32]!==o?(C={orgSlug:s,virtualMcpId:o,branch:a,threadId:re,previewUrl:le,siteSlug:v},e[27]=v,e[28]=a,e[29]=s,e[30]=le,e[31]=re,e[32]=o,e[33]=C):C=e[33],I=C;let J,Z,oe,S;if(e[34]!==c||e[35]!==B||e[36]!==N||e[37]!==h||e[38]!==f||e[39]!==d){const Se=[d,...B],Ae=Pe=>{k(B.slice(0,Pe)),O(Hr)};let Ce;e[48]!==c||e[49]!==N||e[50]!==h?(Ce=async Pe=>{const De=ma(Pe,c);if(De){me.error(De);return}await h(Pe,N),K(!1)},e[48]=c,e[49]=N,e[50]=h,e[51]=Ce):Ce=e[51],A=Ce,U="flex h-full w-full min-w-0",P="flex min-w-0 flex-1 flex-col",z="shrink-0 border-b px-3 py-2.5",S="flex min-w-0 items-center gap-2 overflow-hidden",e[52]!==f?(J=f("sandbox.availableSectionEditor.editingBreadcrumb"),e[52]=f,e[53]=J):J=e[53],Z="flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",oe=Se.map((Pe,De)=>{const ge=De===Se.length-1,$e=ua(Pe);return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[De>0&&n.jsx(Et,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>Ae(De),title:$e,className:xe("min-w-0 truncate classic:rounded-md compact:rounded-lg px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",ge?"font-medium text-foreground":"text-muted-foreground"),children:$e})]},`${$e}-${De}`)}),e[34]=c,e[35]=B,e[36]=N,e[37]=h,e[38]=f,e[39]=d,e[40]=A,e[41]=J,e[42]=Z,e[43]=oe,e[44]=S,e[45]=z,e[46]=P,e[47]=U}else A=e[40],J=e[41],Z=e[42],oe=e[43],S=e[44],z=e[45],P=e[46],U=e[47];let se;e[54]!==J||e[55]!==Z||e[56]!==oe?(se=n.jsx("nav",{"aria-label":J,className:Z,children:oe}),e[54]=J,e[55]=Z,e[56]=oe,e[57]=se):se=e[57];let H;e[58]===Symbol.for("react.memo_cache_sentinel")?(H=()=>K(!0),e[58]=H):H=e[58];let ie;e[59]!==f?(ie=f("sandbox.availableSectionEditor.saveAsGlobalSection"),e[59]=f,e[60]=ie):ie=e[60];let ye;e[61]===Symbol.for("react.memo_cache_sentinel")?(ye=n.jsx(Uo,{size:14}),e[61]=ye):ye=e[61];let pe;e[62]!==m||e[63]!==ie?(pe=n.jsx(Ye,{asChild:!0,children:n.jsx(Be,{size:"icon",className:"size-8 shrink-0",disabled:m,onClick:H,"aria-label":ie,children:ye})}),e[62]=m,e[63]=ie,e[64]=pe):pe=e[64];let ke;e[65]!==f?(ke=f("sandbox.availableSectionEditor.saveAsGlobalSection"),e[65]=f,e[66]=ke):ke=e[66];let he;e[67]!==ke?(he=n.jsx(Qe,{side:"bottom",children:ke}),e[67]=ke,e[68]=he):he=e[68];let je;e[69]!==pe||e[70]!==he?(je=n.jsxs(Xe,{children:[pe,he]}),e[69]=pe,e[70]=he,e[71]=je):je=e[71],e[72]!==S||e[73]!==se||e[74]!==je?(W=n.jsxs("div",{className:S,children:[se,je]}),e[72]=S,e[73]=se,e[74]=je,e[75]=W):W=e[75],R="mt-1.5 py-1 pl-1 text-sm leading-snug text-muted-foreground",V=f("sandbox.availableSectionEditor.localEditsHint",{typeLabel:te}),e[5]=v,e[6]=a,e[7]=c,e[8]=B,e[9]=N,e[10]=m,e[11]=h,e[12]=s,e[13]=l,e[14]=r,e[15]=f,e[16]=x?.taskId,e[17]=d,e[18]=o,e[19]=A,e[20]=I,e[21]=R,e[22]=V,e[23]=z,e[24]=W,e[25]=P,e[26]=U}else A=e[19],I=e[20],R=e[21],V=e[22],z=e[23],W=e[24],P=e[25],U=e[26];let Y;e[76]!==R||e[77]!==V?(Y=n.jsx("p",{className:R,children:V}),e[76]=R,e[77]=V,e[78]=Y):Y=e[78];let q;e[79]!==Y||e[80]!==z||e[81]!==W?(q=n.jsxs("div",{className:z,children:[W,Y]}),e[79]=Y,e[80]=z,e[81]=W,e[82]=q):q=e[82];let X;e[83]!==c||e[84]!==B||e[85]!==D||e[86]!==N||e[87]!==i||e[88]!==u||e[89]!==I||e[90]!==_||e[91]!==f?(X=n.jsx(Qt,{className:"min-h-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsx("div",{className:"mx-auto max-w-2xl",children:_?n.jsx(Fn,{schema:_,value:N,onChange:te=>w(te),basePath:"",breadcrumbPath:B,onBreadcrumbChange:k,meta:i,decofile:c,onSaveReferencedBlock:u,sandbox:I},D):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:f("sandbox.availableSectionEditor.noEditableFields")})})})}),e[83]=c,e[84]=B,e[85]=D,e[86]=N,e[87]=i,e[88]=u,e[89]=I,e[90]=_,e[91]=f,e[92]=X):X=e[92];let ce;e[93]!==q||e[94]!==X||e[95]!==P?(ce=n.jsxs("div",{className:P,children:[q,X]}),e[93]=q,e[94]=X,e[95]=P,e[96]=ce):ce=e[96];let ne;e[97]!==p||e[98]!==A||e[99]!==m||e[100]!==L?(ne=n.jsx(fa,{open:L,onOpenChange:K,defaultBlockId:p,isPending:m,onSubmit:A}),e[97]=p,e[98]=A,e[99]=m,e[100]=L,e[101]=ne):ne=e[101];let de;return e[102]!==ce||e[103]!==ne||e[104]!==U?(de=n.jsxs("div",{className:U,children:[ce,ne]}),e[102]=ce,e[103]=ne,e[104]=U,e[105]=de):de=e[105],de}function Hr(t){return t+1}function qr(t,e){const s={__resolveType:t},o=ga([s],e)[0];return o?xa(s,o,e):null}function Jr({orgSlug:t,virtualMcpId:e,branch:s,previewUrl:o,meta:a,decofile:l,blockKey:i,onSaveReferencedBlock:c}){const r=we(),d=_t(),p=d?.virtualMcpId,h=Hn(p===e?e:null)?.metadata?.siteSlug??null,[u]=$.useState(()=>qr(i,l)),[f,x]=$.useState(u?.data??{}),[g,y]=$.useState([]),[v,j]=$.useState(0),[N,w]=$.useState(!1),[E,B]=$.useState(null),k=E!==null,{save:D,flush:O}=pa({orgSlug:t,virtualMcpId:e,branch:s}),L=u?.resolveType?Ns(u.resolveType,a):null,K=l[i],F=K?Ta(i,K):i,_=d?.taskId??null,A={orgSlug:t,virtualMcpId:e,branch:s,threadId:_,previewUrl:o??void 0,siteSlug:h},I=P=>{x(P),D(i,P)},R=()=>{k?(B(null),w(!1),j(P=>P+1)):B(JSON.stringify(f,null,2))},V=P=>{const U=P??"";try{const Y=JSON.parse(U);if(Y&&typeof Y=="object"&&!Array.isArray(Y)){w(!1),I(Y);return}w(!0)}catch{w(!0)}},z=[F,...g],W=P=>{y(g.slice(0,P)),j(U=>U+1)};return n.jsx("div",{className:"flex h-full w-full min-w-0",children:n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[n.jsx(ha,{crumbs:z,onSelect:W}),n.jsxs("div",{className:"shrink-0 border-b px-3 py-2.5",children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[n.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:Cs},"aria-hidden":!0}),n.jsx("div",{className:"flex-1"}),n.jsxs(Xe,{children:[n.jsx(Ye,{asChild:!0,children:n.jsx(Be,{variant:k?"default":"ghost",size:"icon",className:"size-8 shrink-0",onClick:R,"aria-label":r(k?"sandbox.savedSectionEditor.closeJsonEditor":"sandbox.savedSectionEditor.editAsJson"),"aria-pressed":k,children:k?n.jsx(Ts,{size:14}):n.jsx(En,{size:14})})}),n.jsx(Qe,{side:"bottom",children:r(k?"sandbox.savedSectionEditor.closeJsonEditor":"sandbox.savedSectionEditor.editAsJson")})]})]}),n.jsx("p",{className:"mt-1.5 py-1 pl-1 text-sm leading-snug text-muted-foreground",children:r("sandbox.savedSectionEditor.globalSectionDescription")})]}),n.jsxs("div",{className:"relative min-h-0 flex-1",children:[n.jsx(Qt,{className:"h-full [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsx("div",{className:"mx-auto max-w-2xl",children:L?n.jsx(Fn,{schema:L,value:f,onChange:P=>I(P),basePath:"",breadcrumbPath:g,onBreadcrumbChange:y,meta:a,decofile:l,onSaveReferencedBlock:c,sandbox:A},v):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:r("sandbox.savedSectionEditor.noEditableFields")})})})}),E!==null&&n.jsxs("div",{className:"absolute inset-0 flex flex-col bg-background",children:[N&&n.jsx("div",{className:"shrink-0 border-b bg-destructive/10 px-3 py-1.5 text-xs text-destructive",children:r("sandbox.savedSectionEditor.invalidJsonError")}),n.jsx("div",{className:"min-h-0 flex-1",children:n.jsx(Un,{language:"json",height:"100%",code:E,onChange:V,onSave:P=>{V(P),O()}})})]})]})]})})}function Wr(t){const e=ae.c(36),{selection:s,orgSlug:o,virtualMcpId:a,branch:l,previewUrl:i,meta:c,decofile:r,isCreating:d,onCreateAvailable:p,onSaveReferencedBlock:m}=t,h=we();if(!s){let x;e[0]!==h?(x=h("sandbox.sectionsRightPane.selectSectionTitle"),e[0]=h,e[1]=x):x=e[1];let g;e[2]!==h?(g=h("sandbox.sectionsRightPane.selectSectionDescription"),e[2]=h,e[3]=g):g=e[3];let y;return e[4]!==x||e[5]!==g?(y=n.jsx(st,{title:x,description:g}),e[4]=x,e[5]=g,e[6]=y):y=e[6],y}if(s.collection==="available-section"){const x=`available:${s.resolveType}`,g=s.resolveType,y=s.title;let v;e[7]!==s.title?(v=ba(s.title),e[7]=s.title,e[8]=v):v=e[8];let j;e[9]!==p||e[10]!==s.resolveType?(j=(w,E)=>p(s.resolveType,w,E),e[9]=p,e[10]=s.resolveType,e[11]=j):j=e[11];let N;return e[12]!==l||e[13]!==r||e[14]!==d||e[15]!==c||e[16]!==m||e[17]!==o||e[18]!==i||e[19]!==s.resolveType||e[20]!==s.title||e[21]!==x||e[22]!==v||e[23]!==j||e[24]!==a?(N=n.jsx(Ur,{orgSlug:o,virtualMcpId:a,branch:l,previewUrl:i,meta:c,decofile:r,resolveType:g,title:y,defaultBlockId:v,isCreating:d,onCreate:j,onSaveReferencedBlock:m},x),e[12]=l,e[13]=r,e[14]=d,e[15]=c,e[16]=m,e[17]=o,e[18]=i,e[19]=s.resolveType,e[20]=s.title,e[21]=x,e[22]=v,e[23]=j,e[24]=a,e[25]=N):N=e[25],N}const u=`saved:${s.key}`;let f;return e[26]!==l||e[27]!==r||e[28]!==c||e[29]!==m||e[30]!==o||e[31]!==i||e[32]!==s.key||e[33]!==u||e[34]!==a?(f=n.jsx(Jr,{orgSlug:o,virtualMcpId:a,branch:l,previewUrl:i,meta:c,decofile:r,blockKey:s.key,onSaveReferencedBlock:m},u),e[26]=l,e[27]=r,e[28]=c,e[29]=m,e[30]=o,e[31]=i,e[32]=s.key,e[33]=u,e[34]=a,e[35]=f):f=e[35],f}function Ot(t){const e=ae.c(34),{onDuplicate:s,onRename:o,onAddVariant:a,onEditSeo:l,onViewJson:i,onDelete:c}=t,r=we();let d;e[0]!==r?(d=r("sandbox.itemActions.moreActions"),e[0]=r,e[1]=d):d=e[1];let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx(_o,{size:14}),e[2]=p):p=e[2];let m;e[3]!==d?(m=n.jsx(Ft,{asChild:!0,children:n.jsx("button",{type:"button","aria-label":d,className:"flex h-7 w-7 items-center justify-center classic:rounded-md compact:rounded-lg text-muted-foreground hover:bg-background hover:text-foreground cursor-pointer",onClick:Yr,children:p})}),e[3]=d,e[4]=m):m=e[4];let h;e[5]!==o||e[6]!==r?(h=o&&n.jsxs(We,{onClick:o,children:[n.jsx(ll,{size:14}),r("sandbox.itemActions.rename")]}),e[5]=o,e[6]=r,e[7]=h):h=e[7];let u;e[8]!==s||e[9]!==r?(u=s&&n.jsxs(We,{onClick:s,children:[n.jsx(al,{size:14}),r("sandbox.itemActions.duplicate")]}),e[8]=s,e[9]=r,e[10]=u):u=e[10];let f;e[11]!==a||e[12]!==r?(f=a&&n.jsxs(n.Fragment,{children:[n.jsx(cs,{}),n.jsxs(We,{onClick:a,className:"cursor-pointer text-success focus:text-success",children:[n.jsx(Bn,{size:14}),r("sandbox.itemActions.addVariant")]})]}),e[11]=a,e[12]=r,e[13]=f):f=e[13];let x;e[14]!==l||e[15]!==i||e[16]!==r?(x=(l||i)&&n.jsxs(n.Fragment,{children:[n.jsx(cs,{}),l&&n.jsxs(We,{onClick:l,children:[n.jsx(Pn,{size:14}),r("sandbox.itemActions.editSeo")]}),i&&n.jsxs(We,{onClick:i,children:[n.jsx(En,{size:14}),r("sandbox.itemActions.viewJson")]})]}),e[14]=l,e[15]=i,e[16]=r,e[17]=x):x=e[17];let g;e[18]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(cs,{}),e[18]=g):g=e[18];let y;e[19]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(Ps,{size:14}),e[19]=y):y=e[19];let v;e[20]!==r?(v=r("sandbox.itemActions.delete"),e[20]=r,e[21]=v):v=e[21];let j;e[22]!==c||e[23]!==v?(j=n.jsxs(We,{onClick:c,className:"text-destructive focus:text-destructive",children:[y,v]}),e[22]=c,e[23]=v,e[24]=j):j=e[24];let N;e[25]!==j||e[26]!==h||e[27]!==u||e[28]!==f||e[29]!==x?(N=n.jsxs(Kt,{align:"end",className:"w-44",children:[h,u,f,x,g,j]}),e[25]=j,e[26]=h,e[27]=u,e[28]=f,e[29]=x,e[30]=N):N=e[30];let w;return e[31]!==N||e[32]!==m?(w=n.jsxs(zt,{children:[m,N]}),e[31]=N,e[32]=m,e[33]=w):w=e[33],w}function Yr(t){return t.stopPropagation()}function Qr(t){return t.split("/").pop()?.replace(/\.tsx?$/,"")||t||"Section"}function Xr(t){const e=new Map;for(const s of t){const o=Qr(s.resolveType),a=e.get(o);a?a.push(s):e.set(o,[s])}return[...e.entries()].map(([s,o])=>({label:s,sections:o})).sort((s,o)=>s.label.localeCompare(o.label))}function xn(t){const e=ae.c(8),{icon:s,label:o,className:a}=t;let l;e[0]!==a?(l=xe("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]=l):l=e[1];let i;e[2]!==s?(i=n.jsx(s,{size:13,className:"shrink-0"}),e[2]=s,e[3]=i):i=e[3];let c;return e[4]!==o||e[5]!==l||e[6]!==i?(c=n.jsxs("div",{className:l,children:[i,o]}),e[4]=o,e[5]=l,e[6]=i,e[7]=c):c=e[7],c}const bn=$.lazy(()=>qe(()=>import("./app-editor-BYU_FtWh.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,167,168,169,170,171,172,173,174,175,176,177,178,179])).then(t=>({default:t.AppEditor}))),Zr=$.lazy(()=>qe(()=>import("./post-editor-B77-jPfP.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,23,33,32,34,35,36,37,38,39,40,41,27,28,30,42,43,44,45,46,31,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,68,107,181,165,144,87,88,67,110,122,117,115,72,71,69,73,74,75,76,77,78,79,80,81,82,83,26,84,85,86,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,108,109,111,24,25,112,113,114,116,118,119,120,121,123,124,125,126,127,128,129,130,131,182,148,70,183,184,185,132,133,134,135,136,137,138,139,140,141,142,143,145,146,147,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,166,167,168,169,170,171,172,173,174,175,176,177,178,179])).then(t=>({default:t.PostEditor}))),ec=$.lazy(()=>qe(()=>import("./record-editor-BZi1czEu.js"),__vite__mapDeps([186,1,2,68,107,25,26,27,28,115,72,71,12,13,3,4,5,6,7,8,9,10,11,14,15,16,17,18,19,20,21,22,23,69,32,33,34,35,36,37,38,39,40,41,30,42,43,44,45,46,31,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,73,74,75,76,77,78,79,80,67,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,108,109,110,111,24,112,113,114,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,185,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,167,168,169,170,171,172,173,174,175,176,177,178,179])).then(t=>({default:t.RecordEditor}))),tc=$.lazy(()=>qe(()=>import("./context-waQx2W4V.js"),__vite__mapDeps([187,1,2,28,32,33,34,35,36,37,38,39,40,41,27,30,42,43,44,45,46,31,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,68,107,115,110,20,188,105,98,67,106,100,81,82,4,5,6,7,8,9,10,83,26,148,183,116,80,85,87,88,189,152,149,72,71,12,13,3,11,14,15,16,17,18,19,21,22,23,69,73,74,75,76,77,78,79,84,86,89,90,91,92,93,94,95,96,97,99,101,102,103,104,108,109,111,24,25,112,113,114,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,174,185,186,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,150,151,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,175,176,177,178,179,190,182,70,184])).then(t=>({default:t.BlogContext}))),sc=$.lazy(()=>qe(()=>import("./category-editor-Bvuph8Uc.js"),__vite__mapDeps([190,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,37,39,52,32,33,34,35,36,38,40,41,27,28,30,42,43,44,45,46,31,47,48,49,50,51,53,54,55,56,57,58,59,60,61,62,63,64,65,66,119,68,107,182,116,87,88,67,110,72,71,69,73,74,75,76,77,78,79,80,81,82,83,26,84,85,86,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,108,109,111,24,25,112,113,114,115,117,118,120,121,122,123,124,125,126,127,128,129,130,131,148,70,183,184,185,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179])).then(t=>({default:t.CategoryEditor}))),nc=$.lazy(()=>qe(()=>import("./sections-editor-Wq74SyFR.js"),__vite__mapDeps([191,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,72,71,69,32,33,34,35,36,37,38,39,40,41,27,28,30,42,43,44,45,46,31,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,73,74,75,76,77,78,79,80,67,81,82,83,26,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,68,108,109,110,111,24,25,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,174,192,29,70,193])).then(t=>({default:t.SectionsEditor}))),oc=$.lazy(()=>qe(()=>import("./seo-editor-D1cw49ws.js"),__vite__mapDeps([194,1,2,32,33,34,35,36,37,38,39,40,41,27,28,30,42,43,44,45,46,31,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,24,25,26,72,71,12,13,3,4,5,6,7,8,9,10,11,14,15,16,17,18,19,20,21,22,23,69,73,74,75,76,77,78,79,80,67,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,68,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,192])).then(t=>({default:t.SeoEditor}))),ac=$.lazy(()=>qe(()=>import("./variant-calendar-7H3LNEKh.js"),__vite__mapDeps([195,1,2,32,33,34,35,36,37,38,39,40,41,27,28,30,42,43,44,45,46,31,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,107,24,25,26,117,83,196,132,133,134,102,8,9,135,7,96,100,6,10,136,3,4,5,11,12,13,14,15,16,17,18,19,20,21,22,23,98,67,137,138,82,104,105,106,68,81,139,84,85,86,87,88,89,90,91,92,93,140,71,79,78,80,75,76,122,141,129,99,142,143,144,145,110,146,147,148,149,150,151,152,153,154,155,156,157,158,159,126,127,160,115,161,162,163,164,165,166,167,74,77,94,95,97,101,103,108,109,168,120,73,169,170,128,124,171,172,173,119,72,69,111,112,113,114,116,118,121,123,125,130,131,174,175,176,177,178,179])).then(t=>({default:t.VariantCalendar}))),lc=$.lazy(()=>qe(()=>import("./post-calendar-Deyu5RSY.js"),__vite__mapDeps([197,1,2,33,32,34,35,36,37,38,39,40,41,27,28,30,42,43,44,45,46,31,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,198,24,25,26,132,133,134,102,8,9,135,7,96,100,6,10,136,3,4,5,11,12,13,14,15,16,17,18,19,20,21,22,23,98,83,67,137,138,82,104,105,106,107,68,81,139,84,85,86,87,88,89,90,91,92,93,140,71,79,78,80,75,76,122,141,129,99,142,143,144,145,110,146,147,148,149,150,151,152,153,154,155,156,157,158,159,126,127,160,115,161,162,163,164,165,166,167,74,77,94,95,97,101,103,108,109,168,120,73,169,170,128,124,171,172,173,119,72,69,111,112,113,114,116,117,118,121,123,125,130,131,174,175,176,177,178,179])).then(t=>({default:t.PostCalendar}))),ic=$.lazy(()=>qe(()=>import("./redirect-editor-BrsiQdWf.js"),__vite__mapDeps([199,1,2,144,27,68,107,25,26,28,72,71,12,13,3,4,5,6,7,8,9,10,11,14,15,16,17,18,19,20,21,22,23,69,32,33,34,35,36,37,38,39,40,41,30,42,43,44,45,46,31,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,73,74,75,76,77,78,79,80,67,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,108,109,110,111,24,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,185])).then(t=>({default:t.RedirectEditor})));function rc(t){const e=ae.c(20),{deepLinkPage:s}=t,{currentBranch:o,virtualMcpId:a}=kn(),{org:l}=Do(),i=Ka(),c=za(),{runtime:r,previewServerUrl:d}=Gn(a),p=r==="cms";let m;e[0]!==p||e[1]!==c.previewState||e[2]!==i.lifecycle.phase?(m=Pl({fastPreviewActive:p,previewState:c.previewState,lifecyclePhase:i.lifecycle.phase}),e[0]=p,e[1]=c.previewState,e[2]=i.lifecycle.phase,e[3]=m):m=e[3];const h=m;if(h.kind==="sandbox-card"){const x=`/${l.slug}/settings/connections`;let g;return e[4]!==h.state||e[5]!==c.start||e[6]!==x||e[7]!==i.lifecycle||e[8]!==i.phase?(g=n.jsx(wl,{state:h.state,claimPhase:i.phase,lifecycle:i.lifecycle,onStart:c.start,connectionsHref:x}),e[4]=h.state,e[5]=c.start,e[6]=x,e[7]=i.lifecycle,e[8]=i.phase,e[9]=g):g=e[9],g}if(!a||!o){let x;return e[10]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(st,{title:"Waiting for sandbox context…"}),e[10]=x):x=e[10],x}const u=p?d:c.previewUrl;let f;return e[11]!==o||e[12]!==s||e[13]!==h.devServerReady||e[14]!==h.sandboxWarming||e[15]!==c.previewUrl||e[16]!==l.slug||e[17]!==u||e[18]!==a?(f=n.jsx(dc,{orgSlug:l.slug,virtualMcpId:a,branch:o,previewUrl:c.previewUrl,sitePreviewUrl:u,deepLinkPage:s,devServerReady:h.devServerReady,sandboxWarming:h.sandboxWarming}),e[11]=o,e[12]=s,e[13]=h.devServerReady,e[14]=h.sandboxWarming,e[15]=c.previewUrl,e[16]=l.slug,e[17]=u,e[18]=a,e[19]=f):f=e[19],f}const yn=2e3,cc=15;function vn(t,e,s,o){return typeof e!="string"||s&&(qn(e,s,o)||t.state.dataUpdateCount>=cc)?!1:yn}function dc({orgSlug:t,virtualMcpId:e,branch:s,previewUrl:o,sitePreviewUrl:a,deepLinkPage:l,devServerReady:i,sandboxWarming:c}){const r=we(),d=_t()?.taskId??null,p={orgSlug:t,virtualMcpId:e,branch:s,threadId:d,previewUrl:o},{data:m,isLoading:h}=ya(p,{fetchEnabled:i}),u=jn({strict:!1}),[f,x]=$.useState(()=>u.contentCollection&&lt(u.contentCollection)&&u.contentCollection||"pages"),[g,y]=$.useState(()=>u.contentItem&&lt(f)?{collection:f,key:u.contentItem}:null),[v,j]=$.useState(null),N=!!(l?.pageId||l?.path||l?.pathTemplate),[w,E]=$.useState(!1);if(N&&!w&&g===null&&m){E(!0);const b=Ba(Ms(m),l??{});b&&(x("pages"),y({collection:"pages",key:b.key,path:b.path}))}const[B,k]=$.useState(""),[D,O]=$.useState("board"),L=b=>{y(b),j(null)},[K,F]=$.useState(f);K!==f&&(F(f),k(""));const{data:_,isLoading:A,isFetching:I}=va(p,{fetchEnabled:i,refetchInterval:b=>{const G=b.state.data;if(f==="apps"&&g&&g.collection==="apps"){const ue=m?.[g.key];return vn(b,typeof ue?.__resolveType=="string"?ue.__resolveType:void 0,G)}if(f==="site"&&m){const ue=G?Vs(m,G):null,fe=m.site,_e=ue?.resolveType??(typeof fe?.__resolveType=="string"?fe.__resolveType:void 0);return vn(b,_e,G,["seo"])}return!1}}),R=(b,G)=>!qn(b,_,G)&&(A||I),{catalog:V,isLoading:z}=jl(_??void 0,m??void 0,{enabled:f==="apps"}),W=Fi({orgSlug:t,virtualMcpId:e,branch:s,meta:_}),P=Xt(p),U=Mn(p),Y=Mi({orgSlug:t,virtualMcpId:e,branch:s,decofile:m??{},support:W,onMoved:(b,G)=>y(ue=>ue?.collection==="posts"&&ue.key===b?{collection:"posts",key:G}:ue)}),[q,X]=$.useState(null),[ce,ne]=$.useState(),[de,te]=$.useState(!1),[re,le]=$.useState(),[C,J]=$.useState(null),[Z,oe]=$.useState(null),[S,se]=$.useState(null),H=!m||!_;if(h||A||H&&c)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(rt,{className:"size-5 text-muted-foreground"})});if(H)return n.jsx(st,{title:"Could not load site data."});const ie=Ms(m).sort((b,G)=>b.name.localeCompare(G.name)),ye=Ea(m).sort((b,G)=>b.from.localeCompare(G.from)),pe=_a(m,_),ke=f==="sections"?Da(_):[],he=Vs(m,_),je=Xn(m),Se=Bs.some(b=>je[b].length>0),Ae=lt(f)?je[f]:[],Ce=zs(_,"loaders"),Pe=zs(_,"actions");if(!Aa(m,_)&&!Se&&Ce===0&&Pe===0)return n.jsx(st,{icon:Yt,title:"No editable content",description:"This project doesn't expose any Deco pages, sections, apps, loaders, or actions."});const De={pages:ie.length,sections:pe.length,apps:V.length,loaders:Ce,actions:Pe,redirects:ye.length,posts:je.posts.length,authors:je.authors.length,categories:je.categories.length},ge=new Set(ie.map(b=>It(b.path))),$e=new Set(ie.map(b=>b.name)),Le=new Set(pe.map(b=>b.name)),M=async b=>{const G=m[b.key];if(!G)return;const ue=Kn(m,b.key),fe=ja(m,b.key,Math.max(0,ue-1)),_e=ka(G.sections,fe);if(_e)try{await P.mutateAsync({blockKey:b.key,data:{...G,sections:_e}}),me.success(`Variant added to "${b.name}"`),y({collection:"pages",key:b.key,path:b.path})}catch(Ie){me.error(Ie instanceof Error?Ie.message:"Could not add variant")}},ve=()=>{ne(void 0),X({mode:"create",sourceKey:null,initialName:"My new page",initialPath:"/example"})},Ne=b=>{ne(void 0),X({mode:"duplicate",sourceKey:b.key,initialName:Js($e,b.name),initialPath:Tl(ge,b.path)})},Oe=b=>{ne(void 0),X({mode:"rename",sourceKey:b.key,initialName:b.name,initialPath:b.path})},ns=async b=>{if(!q)return;const{mode:G,sourceKey:ue}=q;try{if(G==="create"){let fe;if(b.templateKey){const Ie=m[b.templateKey];if(!Ie)throw new Error("Selected template no longer exists.");fe={...Ie,name:b.name,path:b.path}}else fe=_l(b.name,b.path);const _e=Al(m,b.name);await P.mutateAsync({blockKey:_e,data:fe}),me.success(`Created "${b.name}"`),y({collection:"pages",key:_e,path:b.path})}else if(G==="duplicate"&&ue){const fe=m[ue];if(!fe)throw new Error("Source page not found");const{key:_e,data:Ie}=El({source:fe,pages:ie,newName:b.name,newPath:b.path});await P.mutateAsync({blockKey:_e,data:Ie}),me.success(`Duplicated as "${b.name}"`),y({collection:"pages",key:_e,path:b.path})}else if(G==="rename"&&ue){const fe=m[ue];if(!fe)throw new Error("Page not found");const _e={...fe,name:b.name,path:b.path};await P.mutateAsync({blockKey:ue,data:_e}),me.success("Page updated"),g?.collection==="pages"&&g.key===ue&&y({collection:"pages",key:ue,path:b.path})}X(null)}catch(fe){ne(fe instanceof Error?fe.message:"Save failed")}},os=({path:b})=>{if(!q)return null;const G=It(b);return(q.mode==="rename"?It(q.initialPath):null)!==G&&ge.has(G)?`A page with path "${b}" already exists.`:null},as=async(b,G,ue)=>{await P.mutateAsync({blockKey:G,data:{...ue,name:G,__resolveType:b}}),me.success(r("sandbox.contentBrowser.createdSection",{name:G})),y({collection:"sections",key:G})},At=Rn((b,G)=>P.mutate({blockKey:b,data:G})),ls=async b=>{const G=m[b.key];if(!G){me.error(r("sandbox.contentBrowser.sectionNotFound"));return}const ue=Bl(m,b.key),fe=Js(Le,b.name),_e={...G,name:fe};try{await P.mutateAsync({blockKey:ue,data:_e}),me.success(r("sandbox.contentBrowser.duplicatedSection",{name:b.name})),y({collection:"sections",key:ue})}catch(Ie){me.error(Ie instanceof Error?Ie.message:r("sandbox.contentBrowser.duplicateFailed"))}},is=async b=>{if(!C)return;const G=m[C];if(!G){me.error(r("sandbox.contentBrowser.sectionNotFound"));return}try{await P.mutateAsync({blockKey:C,data:{...G,name:b}}),me.success(r("sandbox.contentBrowser.sectionRenamed")),J(null)}catch(ue){me.error(ue instanceof Error?ue.message:r("sandbox.contentBrowser.renameFailed"))}},T=()=>{le(void 0),te(!0)},Q=async b=>{const G=$a(m,b.from),ue=La(b);try{await P.mutateAsync({blockKey:G,data:ue}),me.success("Created redirect"),te(!1),y({collection:"redirects",key:G})}catch(fe){le(fe instanceof Error?fe.message:"Could not create redirect")}},Te=async b=>{const G=ps(m,b),ue=it(G,b,ao(b));try{await P.mutateAsync({blockKey:G,data:ue}),me.success(`Created ${Pt[b]}`),y({collection:b,key:G})}catch(fe){me.error(fe instanceof Error?fe.message:"Could not create")}},Ve=async b=>{const G=ps(m,"posts"),ue=it(G,"posts",Si(b));try{await P.mutateAsync({blockKey:G,data:ue}),me.success(r("sandbox.postCalendar.createdScheduledPost")),x("posts"),F("posts"),y({collection:"posts",key:G}),j(null)}catch(fe){me.error(fe instanceof Error?fe.message:r("sandbox.postCalendar.couldNotCreate"))}},Je=async(b,G)=>{const ue=m[b],fe=ue?wi(mt(ue,"posts"),G):null;if(!fe){me.error(r("sandbox.postCalendar.onlyScheduledCanMove"));return}try{await P.mutateAsync({blockKey:b,data:it(b,"posts",fe)})}catch(_e){me.error(_e instanceof Error?_e.message:r("sandbox.postCalendar.couldNotReschedule"))}},Ee=async b=>{const G=m[b.key];if(!G){me.error("Record not found.");return}const ue=ps(m,b.kind),fe=b.kind==="posts"?"title":"name",_e={...structuredClone(mt(G,b.kind)),[fe]:`${b.label} (copy)`};try{await P.mutateAsync({blockKey:ue,data:it(ue,b.kind,_e)}),me.success(`Duplicated "${b.label}"`),y({collection:b.kind,key:ue})}catch(Ie){me.error(Ie instanceof Error?Ie.message:"Duplicate failed")}},yt=()=>{x("posts"),F("posts"),y(null),j(null),k("")},Ue=async()=>{if(Z)try{const{kind:b,key:G,label:ue}=Z;if(b==="blog"){if(Z.blogKind==="categories"){const fe=mt(m[G],"categories").slug,_e=typeof fe=="string"?fe:"";if(_e)for(const{key:Ie,payload:Os}of Ge(m,"posts")){const Is=ei(Os,_e);Is!==Os&&await P.mutateAsync({blockKey:Ie,data:it(Ie,"posts",ti(Is))})}}await U.mutateAsync({blockKey:G})}else await U.mutateAsync({blockKey:G});me.success(`Deleted "${ue}"`),g&&g.collection!=="available-section"&&g.key===G&&y(null),oe(null)}catch(b){me.error(b instanceof Error?b.message:"Delete failed")}},at=U.isPending||P.isPending,rs=Z?.kind==="blog"?Pt[Z.blogKind]:Z?.kind??"item";return n.jsxs("div",{className:"flex h-full w-full",children:[n.jsx(Sl,{active:f,counts:De,showBlog:Se,onSelect:b=>{x(b),y(null),j(null)}}),f!=="seo"&&f!=="site"&&f!=="context"&&f!=="calendar"&&f!=="post-schedule"&&f!=="posts"&&f!=="loaders"&&f!=="actions"&&n.jsx(uc,{activeCollection:f,pages:ie,redirects:ye,sections:pe,availableSections:ke,appCatalog:V,appCatalogLoading:z,blogEntries:Ae,decofile:m,searchQuery:B,onSearchChange:k,selection:g,onSelect:L,onCreate:()=>{f==="pages"?ve():f==="redirects"?T():lt(f)&&Te(f)},onDuplicatePage:Ne,onRenamePage:Oe,onAddPageVariant:M,onDeletePage:b=>oe({kind:"page",key:b.key,label:b.name}),onEditPageSeo:b=>{const G={collection:"pages",key:b.key,path:b.path};y(G),j(b.key)},onViewPageJson:b=>se(b.key),onDuplicateSection:ls,onRenameSection:b=>J(b.key),onDeleteSection:b=>oe({kind:"section",key:b.key,label:b.name}),onDeleteRedirect:b=>oe({kind:"redirect",key:b.key,label:b.from||b.key}),onDuplicateBlog:Ee,onDeleteBlog:b=>oe({kind:"blog",blogKind:b.kind,key:b.key,label:b.label})}),n.jsx("div",{className:"flex-1 min-w-0",children:f==="loaders"||f==="actions"?n.jsx(Lr,{orgSlug:t,virtualMcpId:e,branch:s,previewUrl:o,meta:_,decofile:m,kind:f}):n.jsx($.Suspense,{fallback:n.jsx("div",{className:"h-full flex items-center justify-center",children:n.jsx(rt,{className:"size-5 text-muted-foreground"})}),children:f==="calendar"?n.jsx(ac,{decofile:m}):f==="post-schedule"?n.jsx(lc,{decofile:m,support:W,isCreating:P.isPending,onCreate:b=>{Ve(b)},onReschedule:(b,G)=>{Je(b,G)},onSelect:b=>{x("posts"),F("posts"),y({collection:"posts",key:b}),j(null)}}):f==="site"?he?n.jsx(bn,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:he.key,block:m[he.key],decofile:m,meta:_,title:"Site",excludeFields:["seo"],schemaPending:R(he.resolveType,["seo"]),previewBaseUrl:o},`site:${he.key}`):n.jsx(st,{title:"Site settings not found",description:"This project doesn't have a site app block (site/apps/site.ts)."}):f==="context"?n.jsx(dl,{title:r("sandbox.blogContext.soonTitle"),description:r("sandbox.blogContext.soonDescription"),children:n.jsx(tc,{orgSlug:t,virtualMcpId:e,branch:s,decofile:m,meta:_,onOpenPost:b=>{x("posts"),F("posts"),y({collection:"posts",key:b}),j(null)},onManageCategoryPosts:()=>{x("posts"),F("posts"),y(null),j(null)}})}):f==="seo"?n.jsx(oc,{orgSlug:t,virtualMcpId:e,branch:s,decofile:m,meta:_,target:{kind:"site"},previewBaseUrl:a}):f==="sections"?n.jsx(Wr,{selection:g?.collection==="sections"||g?.collection==="available-section"?g:null,orgSlug:t,virtualMcpId:e,branch:s,previewUrl:o,meta:_,decofile:m,isCreating:P.isPending,onCreateAvailable:as,onSaveReferencedBlock:At}):f==="posts"?n.jsx(wr,{orgSlug:t,virtualMcpId:e,branch:s,decofile:m,view:D,selectedKey:g?.collection==="posts"?g.key:null,onViewChange:b=>{O(b),y(null)},onClose:()=>y(null),onOpen:b=>{y({collection:"posts",key:b}),j(null)},move:Y,support:W,meta:_,renderDetail:(b,G)=>n.jsx(Zr,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:b,block:m[b],decofile:m,meta:_,previewBaseUrl:a,move:Y,onClose:G?.onClose,expanded:G?.expanded,onToggleExpand:G?.onToggleExpand},`post:${Tt(b)}`)}):g&&g.collection!=="available-section"?g.collection==="apps"?n.jsx(bn,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:g.key,block:m[g.key],decofile:m,meta:_,previewBaseUrl:o,schemaPending:R(typeof m[g.key]?.__resolveType=="string"?String(m[g.key].__resolveType):void 0)},`app:${g.key}`):g.collection==="categories"?n.jsx(sc,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:g.key,block:m[g.key],decofile:m,meta:_,onManagePosts:()=>yt(),onOpenPost:b=>{x("posts"),F("posts"),y({collection:"posts",key:b}),j(null)},previewBaseUrl:a},`category:${g.key}`):g.collection==="authors"?n.jsx(ec,{orgSlug:t,virtualMcpId:e,branch:s,kind:"authors",blockKey:g.key,block:m[g.key]},`authors:${g.key}`):g.collection==="redirects"?n.jsx(ic,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:g.key,block:m[g.key]},`redirect:${g.key}`):n.jsx(nc,{orgSlug:t,virtualMcpId:e,branch:s,previewReady:!0,previewUrl:o??void 0,currentPath:g.collection==="pages"?g.path:"/",activePageBlockKey:g.collection==="pages"?g.key:null,activeGlobalBlockKey:g.collection==="sections"?g.key:null,initialEditSeo:g.collection==="pages"&&v===g.key,onExitSeo:()=>j(null),onSelectRoot:()=>{y(null),j(null)}},g.collection==="pages"?`page:${g.key}`:`section:${g.key}`):n.jsx(st,{title:`Select ${lt(f)?`a ${Pt[f]}`:f==="pages"?"a page":f==="apps"?"an app":f==="redirects"?"a redirect":"a section"} to edit`,description:f==="apps"?"Browse all apps and select an installed one to edit its settings.":'Pick an item from the list, or click "+" to create one.'})})}),q&&n.jsx(Il,{open:!!q,mode:q.mode,initialName:q.initialName,initialPath:q.initialPath,isPending:P.isPending,error:ce,templates:ie,validate:os,onSubmit:ns,onOpenChange:b=>{b||(X(null),ne(void 0))}}),n.jsx(Fl,{open:de,isPending:P.isPending,error:re,onSubmit:Q,onOpenChange:b=>{b||(te(!1),le(void 0))}}),C&&n.jsx(Kl,{open:!!C,blockKey:C,initialName:pe.find(b=>b.key===C)?.name??C,isPending:P.isPending,onSubmit:is,onOpenChange:b=>{b||J(null)}}),S&&n.jsx(Oa,{open:!!S,onOpenChange:b=>{b||se(null)},pageKey:S,decofile:m,onSave:b=>P.mutateAsync({blockKey:S,data:b})}),n.jsx(qo,{open:!!Z,onOpenChange:b=>{!b&&!at&&oe(null)},children:n.jsxs(Jo,{children:[n.jsxs(Wo,{children:[n.jsx(Yo,{children:`Delete ${rs}?`}),n.jsx(Qo,{children:Z?.kind==="section"?`"${Z.label}" will be removed. Pages that still reference it will lose this section.`:Z?`"${Z.label}" will be removed permanently. This can't be undone.`:null})]}),n.jsxs(Xo,{children:[n.jsx(Zo,{disabled:at,children:"Cancel"}),n.jsx(ea,{onClick:b=>{b.preventDefault(),Ue()},disabled:at,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:at?n.jsxs(n.Fragment,{children:[n.jsx(rt,{className:"size-3.5"}),"Deleting…"]}):"Delete"})]})]})})]})}function uc(t){const e=ae.c(57),{activeCollection:s,pages:o,redirects:a,sections:l,availableSections:i,appCatalog:c,appCatalogLoading:r,blogEntries:d,decofile:p,searchQuery:m,onSearchChange:h,selection:u,onSelect:f,onCreate:x,onDuplicatePage:g,onRenamePage:y,onAddPageVariant:v,onDeletePage:j,onEditPageSeo:N,onViewPageJson:w,onDuplicateSection:E,onRenameSection:B,onDeleteSection:k,onDeleteRedirect:D,onDuplicateBlog:O,onDeleteBlog:L}=t;let K,F,_,A,I,R;if(e[0]!==s||e[1]!==c||e[2]!==r||e[3]!==i||e[4]!==d||e[5]!==p||e[6]!==v||e[7]!==x||e[8]!==L||e[9]!==j||e[10]!==D||e[11]!==k||e[12]!==O||e[13]!==g||e[14]!==E||e[15]!==N||e[16]!==y||e[17]!==B||e[18]!==h||e[19]!==f||e[20]!==w||e[21]!==o||e[22]!==a||e[23]!==m||e[24]!==l||e[25]!==u){const P=m.toLowerCase(),U=o.filter(S=>!P||S.name.toLowerCase().includes(P)||S.path.toLowerCase().includes(P)),Y=a.filter(S=>!P||S.from.toLowerCase().includes(P)||S.to.toLowerCase().includes(P)),q=l.filter(S=>!P||S.name.toLowerCase().includes(P)||S.key.toLowerCase().includes(P)||S.resolveType.toLowerCase().includes(P)),X=i.filter(S=>!P||S.title.toLowerCase().includes(P)||S.resolveType.toLowerCase().includes(P)||(S.description?.toLowerCase().includes(P)??!1)),ce=Xr(q),ne=c.filter(S=>!P||S.title.toLowerCase().includes(P)||S.app.toLowerCase().includes(P)||S.vendor.toLowerCase().includes(P)||S.category.toLowerCase().includes(P)),de=d.filter(S=>!P||S.label.toLowerCase().includes(P)||S.subtitle.toLowerCase().includes(P)),te=`Search ${s}…`,re=lt(s)?`Create new ${Pt[s]}`:s==="redirects"?"Create new redirect":"Create new page",le=s!=="apps"&&s!=="sections";I="shrink-0 border-r flex flex-col min-h-0 w-[300px]";let C;e[32]===Symbol.for("react.memo_cache_sentinel")?(C=n.jsx(An,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),e[32]=C):C=e[32];let J;e[33]!==h?(J=S=>h(S.target.value),e[33]=h,e[34]=J):J=e[34];let Z;e[35]!==te||e[36]!==m||e[37]!==J?(Z=n.jsxs("div",{className:"flex flex-1 items-center gap-2 pl-1",children:[C,n.jsx("input",{type:"text",value:m,onChange:J,placeholder:te,"aria-label":te,className:"w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),e[35]=te,e[36]=m,e[37]=J,e[38]=Z):Z=e[38];let oe;e[39]!==re||e[40]!==x||e[41]!==le?(oe=le&&n.jsxs(Xe,{children:[n.jsx(Ye,{asChild:!0,children:n.jsx(Be,{variant:"ghost",size:"icon",onClick:x,"aria-label":re,children:n.jsx(Ss,{size:14})})}),n.jsx(Qe,{side:"bottom",children:re})]}),e[39]=re,e[40]=x,e[41]=le,e[42]=oe):oe=e[42],e[43]!==Z||e[44]!==oe?(R=n.jsxs("div",{className:"px-2 h-12 flex items-center gap-1 border-b shrink-0",children:[Z,oe]}),e[43]=Z,e[44]=oe,e[45]=R):R=e[45],K=Qt,A="flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",F="flex flex-col gap-1 p-1.5",_=s==="pages"?U.length===0?n.jsx(jt,{hasItems:o.length>0,emptyLabel:"No pages yet.",emptyHint:'Click "+" to create your first page.'}):U.map(S=>{const se=u?.collection==="pages"&&u.key===S.key,H=Kn(p,S.key);return n.jsx(He,{icon:Sn,title:S.name,subtitle:S.path,active:se,variantCount:H,onClick:()=>f({collection:"pages",key:S.key,path:S.path}),menu:n.jsx(Ot,{onDuplicate:()=>g(S),onRename:()=>y(S),onAddVariant:()=>v(S),onEditSeo:()=>N(S),onViewJson:()=>w(S),onDelete:()=>j(S)})},S.key)}):s==="sections"?q.length===0&&X.length===0?n.jsx(jt,{hasItems:l.length>0||i.length>0,emptyLabel:"No sections yet.",emptyHint:"Save a section from a page, or start the preview dev server."}):n.jsxs(n.Fragment,{children:[ce.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(xn,{icon:Mt,label:"Saved sections"}),ce.map(S=>n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx("div",{className:"px-2.5 pt-1 pb-0.5 text-[11px] font-medium uppercase tracking-wide text-muted-foreground/60",children:S.label}),S.sections.map(se=>{const H=u?.collection==="sections"&&u.key===se.key;return n.jsx(He,{icon:Mt,accent:"global",title:se.name,subtitle:S.label,active:H,onClick:()=>f({collection:"sections",key:se.key}),menu:n.jsx(Ot,{onDuplicate:()=>E(se),onRename:()=>B(se),onDelete:()=>k(se)})},se.key)})]},S.label))]}),X.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(xn,{icon:Fs,label:"Available sections",className:xe(ce.length>0&&"mt-3")}),X.map(S=>{const se=u?.collection==="available-section"&&u.resolveType===S.resolveType,H=S.resolveType.split("/").pop()?.replace(/\.tsx?$/,"");return n.jsx(He,{icon:Fs,title:S.title,subtitle:H??S.resolveType,active:se,onClick:()=>f({collection:"available-section",resolveType:S.resolveType,title:S.title})},S.resolveType)})]})]}):s==="apps"?r?n.jsx("div",{className:"flex items-center justify-center py-8",children:n.jsx(rt,{className:"size-4.5 text-muted-foreground"})}):ne.length===0?n.jsx(jt,{hasItems:c.length>0,emptyLabel:"No apps found.",emptyHint:"Try a different search term."}):ne.map(S=>{const se=u?.collection==="apps"&&S.blockKey!==null&&u.key===S.blockKey;return n.jsx(He,{icon:Dn,logoUrl:S.logo,title:S.title,subtitle:S.category,active:se,trailing:S.installed?n.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(!S.installed||!S.blockKey){me.message(`${S.title} is not installed on this site.`);return}f({collection:"apps",key:S.blockKey})}},S.id)}):s==="redirects"?Y.length===0?n.jsx(jt,{hasItems:a.length>0,emptyLabel:"No redirects yet.",emptyHint:'Click "+" to create your first redirect.'}):Y.map(S=>n.jsx(He,{icon:Nn,title:S.from||"(no source)",subtitle:`→ ${S.to||"(no target)"}`,active:u?.collection==="redirects"&&u.key===S.key,trailing:n.jsx(zl,{type:S.type}),onClick:()=>f({collection:"redirects",key:S.key}),menu:n.jsx(Ot,{onDelete:()=>D(S)})},S.key)):de.length===0?n.jsx(jt,{hasItems:d.length>0,emptyLabel:`No ${s} yet.`,emptyHint:`Click "+" to create your first ${lt(s)?Pt[s]:"item"}.`}):de.map(S=>{const se=u?.collection===S.kind&&u.key===S.key;return n.jsx(He,{icon:S.kind==="posts"?_n:S.kind==="authors"?$n:Cn,title:S.label,subtitle:S.subtitle,active:se,onClick:()=>f({collection:S.kind,key:S.key}),menu:n.jsx(Ot,{onDuplicate:()=>O(S),onDelete:()=>L(S)})},S.key)}),e[0]=s,e[1]=c,e[2]=r,e[3]=i,e[4]=d,e[5]=p,e[6]=v,e[7]=x,e[8]=L,e[9]=j,e[10]=D,e[11]=k,e[12]=O,e[13]=g,e[14]=E,e[15]=N,e[16]=y,e[17]=B,e[18]=h,e[19]=f,e[20]=w,e[21]=o,e[22]=a,e[23]=m,e[24]=l,e[25]=u,e[26]=K,e[27]=F,e[28]=_,e[29]=A,e[30]=I,e[31]=R}else K=e[26],F=e[27],_=e[28],A=e[29],I=e[30],R=e[31];let V;e[46]!==F||e[47]!==_?(V=n.jsx("div",{className:F,children:_}),e[46]=F,e[47]=_,e[48]=V):V=e[48];let z;e[49]!==K||e[50]!==A||e[51]!==V?(z=n.jsx(K,{className:A,children:V}),e[49]=K,e[50]=A,e[51]=V,e[52]=z):z=e[52];let W;return e[53]!==I||e[54]!==R||e[55]!==z?(W=n.jsxs("div",{className:I,children:[R,z]}),e[53]=I,e[54]=R,e[55]=z,e[56]=W):W=e[56],W}function mc(t){const e=ae.c(25),{virtualMcpId:s}=t,o=we(),[a,l]=$.useState(!1),i=ol(s),{activeTask:c}=kn();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},e[0]=r):r=e[0];const d=jn(r);if(!(Hs(i?.metadata)||Hs(c?.metadata))){let h;e[1]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx("div",{className:"flex size-14 items-center justify-center rounded-full bg-muted",children:n.jsx(qs,{className:"size-7 text-foreground"})}),e[1]=h):h=e[1];let u;e[2]!==o?(u=o("mainPanelTabs.contentTab.noContentToEdit"),e[2]=o,e[3]=u):u=e[3];let f;e[4]!==o?(f=o("mainPanelTabs.contentTab.connectGithubDescription"),e[4]=o,e[5]=f):f=e[5];let x,g;e[6]===Symbol.for("react.memo_cache_sentinel")?(x=()=>l(!0),g=n.jsx(qs,{className:"size-4"}),e[6]=x,e[7]=g):(x=e[6],g=e[7]);let y;e[8]!==o?(y=o("mainPanelTabs.previewTab.connectGithub"),e[8]=o,e[9]=y):y=e[9];let v;e[10]!==y?(v=n.jsxs(Be,{onClick:x,children:[g,y]}),e[10]=y,e[11]=v):v=e[11];let j;e[12]!==u||e[13]!==f||e[14]!==v?(j=n.jsx(il,{className:"h-full",image:h,title:u,description:f,actions:v}),e[12]=u,e[13]=f,e[14]=v,e[15]=j):j=e[15];let N;e[16]!==a?(N=n.jsx(rl,{open:a,onOpenChange:l,mode:"agent"}),e[16]=a,e[17]=N):N=e[17];let w;return e[18]!==N||e[19]!==j?(w=n.jsxs(n.Fragment,{children:[j,N]}),e[18]=N,e[19]=j,e[20]=w):w=e[20],w}let m;return e[21]!==d.contentPageId||e[22]!==d.contentPath||e[23]!==d.contentPathTemplate?(m=n.jsx(rc,{deepLinkPage:{pageId:d.contentPageId,path:d.contentPath,pathTemplate:d.contentPathTemplate}}),e[21]=d.contentPageId,e[22]=d.contentPath,e[23]=d.contentPathTemplate,e[24]=m):m=e[24],m}function fc(){const t=ae.c(2),e=cl();let s;return t[0]!==e?(s=n.jsx(Ao,{tabId:"content",children:n.jsx($o,{feature:"cms",children:n.jsx(mc,{virtualMcpId:e})})}),t[0]=e,t[1]=s):s=t[1],s}const $d=Object.freeze(Object.defineProperty({__proto__:null,default:fc},Symbol.toStringTag,{value:"Module"}));export{vo as $,Td as A,Ds as B,bd as C,gd as D,Pd as E,Ed as F,Xn as G,uo as H,Vi as I,Zs as J,xi as K,hd as L,ps as M,ao as N,fd as O,_s as P,vd as Q,Bd as R,jd as S,_d as T,Sd as U,pt as V,Nd as W,kd as X,yd as Y,wd as Z,qt as _,md as a,$d as a0,ss as b,ti as c,Cd as d,ud as e,Ge as f,mt as g,Wt as h,Dd as i,ii as j,Ad as k,to as l,Es as m,Bl as n,lo as o,Dt as p,it as q,ml as r,be as s,mo as t,Fi as u,Ke as v,pi as w,pd as x,xd as y,Me as z};
9
+ `)||void 0,count:O}),Ee=xi(re.map(Ue=>Ue.title),Je.themes);if(Ee.length===0){me.info(u("sandbox.postBoard.ideasFailed"));return}let yt=0;for(const Ue of Ee){const at=ui();try{await x.mutateAsync({blockKey:at,data:mi(at,{title:Ue.title,body:Ue.body,pillarKey:T?.key,createdAt:new Date().toISOString()})}),yt++}catch(rs){console.warn("[posts] could not save a generated idea",rs)}}if(yt===0){me.error(u("sandbox.postBoard.ideasFailed"));return}me.success(u("sandbox.postBoard.ideasAdded",{count:String(yt)}))}catch(Q){me.error(Q instanceof Error?Q.message:u("sandbox.postBoard.ideasFailed"))}finally{w(!1)}};return n.jsxs("div",{className:"relative flex h-full min-w-0 flex-col",children:[n.jsxs("div",{className:"flex shrink-0 flex-wrap items-center justify-between gap-3 border-b px-6 py-3",children:[n.jsx("div",{className:"flex items-center gap-3",children:n.jsxs("div",{className:"flex items-center gap-0.5 rounded-lg border p-0.5",children:[n.jsx(gn,{active:a==="board",onClick:()=>i("board"),icon:n.jsx(Mo,{size:14}),label:u("sandbox.postBoard.viewBoard")}),n.jsx(gn,{active:a==="list",onClick:()=>i("list"),icon:n.jsx(Ho,{size:14}),label:u("sandbox.postBoard.viewList")})]})}),n.jsxs("div",{className:"flex items-center gap-2",children:[N&&n.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground","aria-live":"polite",role:"status",children:[n.jsx(Ct,{size:12,className:"animate-spin"}),u("sandbox.postBoard.generatingLabel")]}),n.jsxs(ut,{open:E,onOpenChange:B,children:[n.jsx(Ma,{asChild:!0,children:n.jsxs(Be,{type:"button",variant:"outline",size:"sm",disabled:!0,children:[n.jsx(tt,{size:14}),u("sandbox.postBoard.generateIdeas"),n.jsx(ot,{variant:"secondary",children:u("common.soon")})]})}),n.jsxs(dt,{className:"sm:max-w-lg",children:[n.jsxs(gt,{children:[n.jsx(ct,{children:u("sandbox.postBoard.generateIdeas")}),n.jsx(Vt,{children:u("sandbox.postBoard.ideaGuidanceLabel")})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsx(Rt,{id:"idea-guidance",value:k,rows:6,autoFocus:!0,onChange:T=>D(T.target.value),placeholder:u("sandbox.postBoard.ideaGuidancePlaceholder"),className:"resize-none text-sm"}),le.length>0&&n.jsxs("div",{className:"space-y-1.5",children:[n.jsx(ze,{className:"text-xs",children:u("sandbox.postBoard.ideaPillarLabel")}),n.jsx(Nt,{options:le.map(T=>T.title),value:le.find(T=>T.key===K)?.title??"",emptyLabel:u("sandbox.postBoard.ideaNoPillar"),onChange:T=>F(le.find(Q=>Q.title===T)?.key??"")})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(ze,{htmlFor:"idea-count",className:"text-xs",children:u("sandbox.postBoard.ideaCount")}),n.jsx(Ze,{id:"idea-count",type:"number",min:1,max:8,value:O,onChange:T=>L(Math.max(1,Math.min(8,Number(T.target.value)||1))),className:"h-9 w-16"}),n.jsx("span",{className:"ml-auto text-xs text-muted-foreground",children:u("sandbox.postBoard.usesCredits")})]})]}),n.jsx(xt,{children:n.jsxs(Be,{type:"button",onClick:()=>{B(!1),is()},children:[n.jsx(tt,{size:14}),u("sandbox.postBoard.generateIdeas")]})})]})]}),n.jsxs(zt,{children:[n.jsx(Ft,{asChild:!0,children:n.jsxs(Be,{type:"button",size:"sm",children:[n.jsx(Ss,{size:14}),u("sandbox.postBoard.newPost"),n.jsx(ht,{size:14})]})}),n.jsxs(Kt,{align:"end",className:"w-56",children:[n.jsxs(We,{disabled:!0,onClick:()=>{z(void 0),R(!0)},children:[n.jsx(tt,{size:14}),n.jsxs("div",{className:"flex flex-col",children:[n.jsxs("span",{className:"flex items-center gap-1.5",children:[u("sandbox.postBoard.newPostGenerate"),n.jsx(ot,{variant:"secondary",children:u("common.soon")})]}),n.jsx("span",{className:"text-xs text-muted-foreground",children:u("sandbox.postBoard.newPostGenerateHint")})]})]}),n.jsxs(We,{onClick:At,children:[n.jsx(Vo,{size:14}),n.jsxs("div",{className:"flex flex-col",children:[n.jsx("span",{children:u("sandbox.postBoard.newPostWrite")}),n.jsx("span",{className:"text-xs text-muted-foreground",children:u("sandbox.postBoard.newPostWriteHint")})]})]}),n.jsxs(We,{onClick:()=>P(!0),children:[n.jsx(ms,{size:14}),n.jsxs("div",{className:"flex flex-col",children:[n.jsx("span",{children:u("sandbox.postBoard.importContent")}),n.jsx("span",{className:"text-xs text-muted-foreground",children:u("sandbox.postBoard.importContentHint")})]})]})]})]}),n.jsx(qi,{open:I,onOpenChange:R,decofile:o,hasAi:y,seed:V,onGenerate:T=>{de(T)}},V?.title??"scratch"),n.jsx(ut,{open:W,onOpenChange:P,children:n.jsxs(dt,{className:"max-h-[85vh] sm:max-w-2xl",children:[n.jsxs(gt,{children:[n.jsx(ct,{children:u("sandbox.postBoard.importTitle")}),n.jsx(Vt,{children:u("sandbox.postBoard.importDescription")})]}),n.jsxs("div",{className:"space-y-3",children:[n.jsx("div",{className:"h-72 overflow-hidden rounded-[var(--studio-control-radius,var(--radius-xl))] border bg-[var(--studio-input-background)]",children:n.jsx(Un,{code:U,language:ko(U)?"html":"markdown",height:"100%",autoFocus:!0,onChange:T=>Y(T??"")})}),n.jsx("input",{ref:q,type:"file",accept:".html,.htm,.md,.markdown,.txt",className:"hidden",onChange:async T=>{const Q=T.target.files?.[0];Q&&Y(await Q.text()),T.target.value=""}}),n.jsxs(Be,{type:"button",variant:"outline",size:"sm",onClick:()=>q.current?.click(),children:[n.jsx(ms,{size:14}),u("sandbox.postBoard.importUpload")]})]}),n.jsx(xt,{children:n.jsxs(Be,{type:"button",disabled:!U.trim(),onClick:ls,children:[n.jsx(ms,{size:14}),u("sandbox.postBoard.importRun")]})})]})})]})]}),te.length===0&&re.length===0?n.jsx(el,{className:"flex-1",icon:n.jsx(tt,{size:22}),title:u("sandbox.postBoard.emptyTitle"),description:u("sandbox.postBoard.emptyDescription"),buttonProps:{children:u("sandbox.postBoard.newPost"),onClick:At}}):a==="board"?n.jsxs("div",{className:"flex min-h-0 flex-1 gap-3 overflow-x-auto p-4",children:[n.jsx(Br,{ideas:re,collapsed:X.includes(pn),pillarTitleOf:C,onToggleCollapsed:()=>ne(pn),onGenerate:ns,onDelete:os}),n.jsx("div",{"aria-hidden":!0,className:"my-1 w-px shrink-0 self-stretch bg-border"}),_s.map(T=>{const Q=te.filter(Ee=>Ee.status===T);Nr(T)&&Q.sort(Sr);const Te=u(Wt[T]),Ve=X.includes(T),Je=vo(p,T);return n.jsx("div",{onDragOver:Ee=>{Ee.preventDefault(),j(T)},onDragLeave:()=>j(Ee=>Ee===T?null:Ee),onDrop:Ee=>{Ee.preventDefault(),as(T,Ee.dataTransfer.getData(wo))},title:Je?jo(u,Je):void 0,className:xe("flex shrink-0 flex-col rounded-xl border bg-muted/30 transition-colors",Ve?"w-11":"w-72",Je&&"opacity-50",v===T&&"border-primary bg-primary/5"),children:Ve?n.jsxs("button",{type:"button",onClick:()=>ne(T),"aria-label":u("sandbox.postBoard.expandLane",{lane:Te}),"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:[n.jsx(Et,{size:14,className:"shrink-0"}),n.jsx("span",{className:"text-xs tabular-nums",children:Q.length}),n.jsx("span",{className:"[writing-mode:vertical-rl] text-sm font-medium",children:Te})]}):n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center justify-between gap-2 px-3 py-2.5 text-sm font-medium",children:[n.jsxs("button",{type:"button",onClick:()=>ne(T),"aria-label":u("sandbox.postBoard.collapseLane",{lane:Te}),"aria-expanded":!0,className:"flex min-w-0 cursor-pointer items-center gap-1.5 text-left hover:text-muted-foreground",children:[n.jsx(ht,{size:14,className:"shrink-0"}),n.jsx("span",{className:"truncate",children:Te})]}),n.jsx("span",{className:"text-xs tabular-nums text-muted-foreground",children:Q.length})]}),n.jsx("div",{className:"min-h-0 flex-1 space-y-2 overflow-y-auto px-2 pb-2",children:Q.length===0?n.jsx("p",{className:"px-1 py-6 text-center text-xs text-muted-foreground",children:u("sandbox.postBoard.laneEmpty")}):Q.map(Ee=>n.jsx(Tr,{post:Ee,payload:J(Ee.key),moving:d.isMoving(Ee.key),onOpen:()=>c(Ee.key),onArchive:Ee.status==="archived"?void 0:()=>{oe(Ee)}},Ee.key))})]})},T)})]}):n.jsxs("div",{className:"flex min-h-0 flex-1",children:[n.jsxs("div",{className:"flex w-80 shrink-0 flex-col border-r",children:[M?n.jsx(jr,{count:je.size,allSelected:Le.length>0&&Le.every(T=>je.has(T.key)),onToggleSelectAll:Ne,onArchive:()=>{Oe()},onExit:()=>Se(new Set)}):n.jsx(hr,{categories:ge,authors:$e,statusCounts:Ae,categoryFilter:S,authorFilter:H,statusFilter:ye,sort:ke,onCategoryFilterChange:se,onAuthorFilterChange:ie,onStatusFilterChange:pe,onSortChange:he}),n.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:n.jsx(Cr,{posts:Le,selectedKey:Z,selectionActive:M,selectedKeys:je,onToggleSelect:ve,onOpen:c,isMoving:d.isMoving,onArchive:T=>{oe(T)}})})]}),n.jsx("div",{className:"min-w-0 flex-1 overflow-hidden",children:Z&&h?n.jsx($.Suspense,{fallback:n.jsx("div",{className:"flex h-full items-center justify-center",children:n.jsx(Ct,{size:20,className:"animate-spin text-muted-foreground"})}),children:h(Z)}):n.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center text-sm text-muted-foreground",children:u("sandbox.postBoard.selectPrompt")})})]}),a==="board"&&l&&_&&h&&n.jsx("div",{className:"absolute inset-0 z-30 flex flex-col bg-background",children:h(l,{expanded:!0,onToggleExpand:()=>A(!1),onClose:()=>{A(!1),r?.()}})}),n.jsx(ut,{open:a==="board"&&!!l&&!_,onOpenChange:T=>{T||(A(!1),r?.())},children:n.jsxs(dt,{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:[n.jsx(ct,{className:"sr-only",children:u("sandbox.collectionsSidebar.posts")}),l&&h?n.jsx($.Suspense,{fallback:n.jsx("div",{className:"flex h-full items-center justify-center",children:n.jsx(Ct,{size:20,className:"animate-spin text-muted-foreground"})}),children:h(l,{expanded:!1,onToggleExpand:()=>A(!0),onClose:()=>r?.()})}):null]})})]})}function gn(t){const e=ae.c(7),{active:s,onClick:o,icon:a,label:l}=t,i=s?"bg-accent text-accent-foreground":"text-muted-foreground hover:text-foreground";let c;e[0]!==i?(c=xe("inline-flex cursor-pointer items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",i),e[0]=i,e[1]=c):c=e[1];let r;return e[2]!==a||e[3]!==l||e[4]!==o||e[5]!==c?(r=n.jsxs("button",{type:"button",onClick:o,className:c,children:[a,l]}),e[2]=a,e[3]=l,e[4]=o,e[5]=c,e[6]=r):r=e[6],r}function Cr(t){const e=ae.c(19),{posts:s,selectedKey:o,selectionActive:a,selectedKeys:l,onToggleSelect:i,onOpen:c,isMoving:r,onArchive:d}=t;let p;if(e[0]!==r||e[1]!==d||e[2]!==c||e[3]!==i||e[4]!==s||e[5]!==o||e[6]!==l||e[7]!==a){let h;e[9]!==r||e[10]!==d||e[11]!==c||e[12]!==i||e[13]!==o||e[14]!==l||e[15]!==a?(h=u=>n.jsx(Pr,{post:u,selected:u.key===o,selectionActive:a,checked:l.has(u.key),onToggleSelect:()=>i(u.key),moving:r(u.key),onOpen:()=>c(u.key),onArchive:u.status==="archived"?void 0:()=>d(u)},u.key),e[9]=r,e[10]=d,e[11]=c,e[12]=i,e[13]=o,e[14]=l,e[15]=a,e[16]=h):h=e[16],p=s.map(h),e[0]=r,e[1]=d,e[2]=c,e[3]=i,e[4]=s,e[5]=o,e[6]=l,e[7]=a,e[8]=p}else p=e[8];let m;return e[17]!==p?(m=n.jsx("ul",{className:"divide-y",children:p}),e[17]=p,e[18]=m):m=e[18],m}function Pr(t){const e=ae.c(56),{post:s,selected:o,selectionActive:a,checked:l,onToggleSelect:i,moving:c,onOpen:r,onArchive:d}=t,p=we(),m=s.status==="awaiting_review"&&s.missing.length>0,h=s.status==="scheduled"||s.status==="published",u=a||l?"opacity-100":"opacity-0 focus-within:opacity-100 group-hover/row:opacity-100";let f;e[0]!==u?(f=xe("absolute left-3 top-3 z-10 transition-opacity",u),e[0]=u,e[1]=f):f=e[1];let x;e[2]!==i?(x=()=>i(),e[2]=i,e[3]=x):x=e[3];let g;e[4]!==s.title||e[5]!==p?(g=s.title||p("sandbox.postBoard.untitled"),e[4]=s.title,e[5]=p,e[6]=g):g=e[6];let y;e[7]!==l||e[8]!==x||e[9]!==g?(y=n.jsx(Zt,{checked:l,onCheckedChange:x,"aria-label":g}),e[7]=l,e[8]=x,e[9]=g,e[10]=y):y=e[10];let v;e[11]!==f||e[12]!==y?(v=n.jsx("span",{className:f,children:y}),e[11]=f,e[12]=y,e[13]=v):v=e[13];let j;e[14]!==c||e[15]!==d||e[16]!==a?(j=d&&!a&&n.jsx(Ls,{onArchive:d,disabled:c,className:"top-2.5"}),e[14]=c,e[15]=d,e[16]=a,e[17]=j):j=e[17];let N;e[18]!==r||e[19]!==i||e[20]!==a?(N=()=>a?i():r(),e[18]=r,e[19]=i,e[20]=a,e[21]=N):N=e[21];const w=o?"bg-accent text-accent-foreground":"bg-card hover:bg-muted/50";let E;e[22]!==w?(E=xe("flex w-full cursor-pointer flex-col gap-1.5 py-2.5 pl-10 pr-3 text-left text-sm transition-colors",w),e[22]=w,e[23]=E):E=e[23];let B;e[24]!==s.title||e[25]!==p?(B=s.title||p("sandbox.postBoard.untitled"),e[24]=s.title,e[25]=p,e[26]=B):B=e[26];let k;e[27]!==B?(k=n.jsx("span",{className:"min-w-0 truncate pr-6 font-medium",children:B}),e[27]=B,e[28]=k):k=e[28];const D=kr[s.status],O=Wt[s.status];let L;e[29]!==p||e[30]!==O?(L=p(O),e[29]=p,e[30]=O,e[31]=L):L=e[31];let K;e[32]!==D||e[33]!==L?(K=n.jsx(ot,{variant:D,className:"shrink-0",children:L}),e[32]=D,e[33]=L,e[34]=K):K=e[34];let F;e[35]!==m||e[36]!==s.missing?(F=m&&n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-warning",children:[n.jsx(Yt,{size:12}),s.missing.length]}),e[35]=m,e[36]=s.missing,e[37]=F):F=e[37];let _;e[38]!==h||e[39]!==s.date||e[40]!==s.scheduledDatetime?(_=h&&n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs tabular-nums text-muted-foreground",children:[n.jsx(ks,{size:12}),(s.scheduledDatetime||s.date||"").slice(0,10)]}),e[38]=h,e[39]=s.date,e[40]=s.scheduledDatetime,e[41]=_):_=e[41];let A;e[42]!==K||e[43]!==F||e[44]!==_?(A=n.jsxs("div",{className:"flex items-center gap-2",children:[K,F,_]}),e[42]=K,e[43]=F,e[44]=_,e[45]=A):A=e[45];let I;e[46]!==o||e[47]!==E||e[48]!==k||e[49]!==A||e[50]!==N?(I=n.jsxs("button",{type:"button",onClick:N,"aria-current":o,className:E,children:[k,A]}),e[46]=o,e[47]=E,e[48]=k,e[49]=A,e[50]=N,e[51]=I):I=e[51];let R;return e[52]!==I||e[53]!==v||e[54]!==j?(R=n.jsxs("li",{className:"group/row relative",children:[v,j,I]}),e[52]=I,e[53]=v,e[54]=j,e[55]=R):R=e[55],R}function Tr(t){const e=ae.c(46),{post:s,payload:o,moving:a,onOpen:l,onArchive:i}=t,c=we(),r=s.status!=="generating"&&!a;let d;e[0]!==o?(d=Yl(o),e[0]=o,e[1]=d):d=e[1];const p=d,m=!r&&"opacity-80";let h;e[2]!==m?(h=xe("group/card relative rounded-lg border bg-card shadow-sm transition-colors hover:border-primary/40",m),e[2]=m,e[3]=h):h=e[3];let u;e[4]!==a||e[5]!==i?(u=i&&n.jsx(Ls,{onArchive:i,disabled:a,className:"top-2"}),e[4]=a,e[5]=i,e[6]=u):u=e[6];let f;e[7]!==s.key?(f=O=>O.dataTransfer.setData(wo,s.key),e[7]=s.key,e[8]=f):f=e[8];const x=r?"cursor-grab active:cursor-grabbing":"cursor-pointer";let g;e[9]!==x?(g=xe("block w-full p-3 text-left",x),e[9]=x,e[10]=g):g=e[10];let y;e[11]!==s.title||e[12]!==c?(y=s.title||c("sandbox.postBoard.untitled"),e[11]=s.title,e[12]=c,e[13]=y):y=e[13];let v;e[14]!==y?(v=n.jsx("p",{className:"line-clamp-2 pr-6 text-sm font-medium",children:y}),e[14]=y,e[15]=v):v=e[15];let j;e[16]!==p||e[17]!==s.status?(j=s.status==="draft"&&n.jsxs(n.Fragment,{children:[p.pillarTitle&&n.jsx(ot,{variant:"secondary",className:"max-w-full truncate",children:p.pillarTitle}),p.format?.name&&n.jsx(ot,{variant:"outline",className:"max-w-full truncate",children:p.format.name})]}),e[16]=p,e[17]=s.status,e[18]=j):j=e[18];let N;e[19]!==s.status||e[20]!==c?(N=s.status==="generating"&&n.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground",children:[n.jsx(Ct,{size:12,className:"animate-spin"}),c("sandbox.postBoard.generatingLabel")]}),e[19]=s.status,e[20]=c,e[21]=N):N=e[21];let w;e[22]!==s.missing||e[23]!==s.status||e[24]!==c?(w=s.status==="awaiting_review"&&(s.missing.length>0?n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-warning",children:[n.jsx(Yt,{size:12}),c("sandbox.postBoard.nIssues",{count:String(s.missing.length)})]}):n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-success",children:[n.jsx(Za,{size:12}),c("sandbox.postBoard.readyToSchedule")]})),e[22]=s.missing,e[23]=s.status,e[24]=c,e[25]=w):w=e[25];let E;e[26]!==s.date||e[27]!==s.scheduledDatetime||e[28]!==s.status?(E=(s.status==="scheduled"||s.status==="published")&&n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground",children:[n.jsx(ks,{size:12}),(s.scheduledDatetime||s.date||"").slice(0,10)]}),e[26]=s.date,e[27]=s.scheduledDatetime,e[28]=s.status,e[29]=E):E=e[29];let B;e[30]!==j||e[31]!==N||e[32]!==w||e[33]!==E?(B=n.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5",children:[j,N,w,E]}),e[30]=j,e[31]=N,e[32]=w,e[33]=E,e[34]=B):B=e[34];let k;e[35]!==r||e[36]!==l||e[37]!==B||e[38]!==f||e[39]!==g||e[40]!==v?(k=n.jsxs("button",{type:"button",draggable:r,onDragStart:f,onClick:l,className:g,children:[v,B]}),e[35]=r,e[36]=l,e[37]=B,e[38]=f,e[39]=g,e[40]=v,e[41]=k):k=e[41];let D;return e[42]!==k||e[43]!==h||e[44]!==u?(D=n.jsxs("div",{className:h,children:[u,k]}),e[42]=k,e[43]=h,e[44]=u,e[45]=D):D=e[45],D}function Br(t){const e=ae.c(40),{ideas:s,collapsed:o,pillarTitleOf:a,onToggleCollapsed:l,onGenerate:i,onDelete:c}=t,r=we();let d,p,m,h,u,f,x;if(e[0]!==o||e[1]!==s.length||e[2]!==l||e[3]!==r){x=Symbol.for("react.early_return_sentinel");e:{if(d=r("sandbox.postBoard.ideasTray"),o){let k;e[11]===Symbol.for("react.memo_cache_sentinel")?(k=n.jsx(Et,{size:14,className:"shrink-0"}),e[11]=k):k=e[11];let D;e[12]!==s.length?(D=n.jsx("span",{className:"text-xs tabular-nums",children:s.length}),e[12]=s.length,e[13]=D):D=e[13],x=n.jsxs("button",{type:"button",onClick:l,"aria-label":r("sandbox.postBoard.expandLane",{lane:d}),"aria-expanded":!1,className:"flex w-11 shrink-0 cursor-pointer flex-col items-center gap-2 py-2.5 text-muted-foreground hover:text-foreground",children:[k,D,n.jsx("span",{className:"[writing-mode:vertical-rl] text-sm font-medium",children:d})]});break e}f="flex w-72 shrink-0 flex-col",u="flex items-center justify-between gap-2 px-3 py-2.5 text-sm font-medium",p="button",m=l,h=r("sandbox.postBoard.collapseLane",{lane:d})}e[0]=o,e[1]=s.length,e[2]=l,e[3]=r,e[4]=d,e[5]=p,e[6]=m,e[7]=h,e[8]=u,e[9]=f,e[10]=x}else d=e[4],p=e[5],m=e[6],h=e[7],u=e[8],f=e[9],x=e[10];if(x!==Symbol.for("react.early_return_sentinel"))return x;let g;e[14]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(ht,{size:14,className:"shrink-0"}),e[14]=g):g=e[14];let y;e[15]!==d?(y=n.jsx("span",{className:"truncate",children:d}),e[15]=d,e[16]=y):y=e[16];let v;e[17]!==p||e[18]!==m||e[19]!==h||e[20]!==y?(v=n.jsxs("button",{type:p,onClick:m,"aria-label":h,"aria-expanded":!0,className:"flex min-w-0 cursor-pointer items-center gap-1.5 text-left hover:text-muted-foreground",children:[g,y]}),e[17]=p,e[18]=m,e[19]=h,e[20]=y,e[21]=v):v=e[21];let j;e[22]!==s.length?(j=n.jsx("span",{className:"text-xs tabular-nums text-muted-foreground",children:s.length}),e[22]=s.length,e[23]=j):j=e[23];let N;e[24]!==j||e[25]!==u||e[26]!==v?(N=n.jsxs("div",{className:u,children:[v,j]}),e[24]=j,e[25]=u,e[26]=v,e[27]=N):N=e[27];let w;e[28]!==s||e[29]!==c||e[30]!==i||e[31]!==a||e[32]!==r?(w=s.length===0?n.jsx("p",{className:"px-1 py-6 text-center text-xs text-muted-foreground",children:r("sandbox.postBoard.ideasEmpty")}):s.map(k=>{const D=a(k.pillarKey);return n.jsxs("div",{className:"group/card relative rounded-lg border border-dashed bg-card shadow-sm transition-colors hover:border-primary/40",children:[n.jsx(Ls,{label:r("sandbox.postBoard.deleteIdea"),onArchive:()=>c(k),className:"top-2"}),n.jsxs("div",{className:"p-3",children:[n.jsx("p",{className:"line-clamp-2 pr-6 text-sm font-medium",children:k.title||r("sandbox.postBoard.untitledIdea")}),k.body&&n.jsx("p",{className:"mt-1 line-clamp-2 text-xs text-muted-foreground",children:k.body}),D&&n.jsx(ot,{variant:"secondary",className:"mt-2 max-w-full truncate",children:D})]}),n.jsx("div",{className:"border-t px-3 py-2",children:n.jsxs(Be,{type:"button",variant:"ghost",size:"sm",disabled:!0,className:"h-7 w-full justify-start px-1.5 text-xs",onClick:()=>i(k),children:[n.jsx(tt,{size:13}),r("sandbox.postBoard.writeFromIdea"),n.jsx(ot,{variant:"secondary",className:"ml-auto",children:r("common.soon")})]})})]},k.key)}),e[28]=s,e[29]=c,e[30]=i,e[31]=a,e[32]=r,e[33]=w):w=e[33];let E;e[34]!==w?(E=n.jsx("div",{className:"min-h-0 flex-1 space-y-2 overflow-y-auto pb-2 pr-1",children:w}),e[34]=w,e[35]=E):E=e[35];let B;return e[36]!==N||e[37]!==E||e[38]!==f?(B=n.jsxs("div",{className:f,children:[N,E]}),e[36]=N,e[37]=E,e[38]=f,e[39]=B):B=e[39],B}function Ls(t){const e=ae.c(13),{label:s,onArchive:o,disabled:a,className:l}=t,i=we();let c;e[0]!==s||e[1]!==i?(c=s??i("sandbox.postBoard.delete"),e[0]=s,e[1]=i,e[2]=c):c=e[2];const r=c;let d;e[3]!==o?(d=u=>{u.stopPropagation(),o()},e[3]=o,e[4]=d):d=e[4];let p;e[5]!==l?(p=xe("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",l),e[5]=l,e[6]=p):p=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(Ps,{size:13}),e[7]=m):m=e[7];let h;return e[8]!==a||e[9]!==d||e[10]!==p||e[11]!==r?(h=n.jsx("button",{type:"button",disabled:a,"aria-label":r,title:r,onClick:d,className:p,children:m}),e[8]=a,e[9]=d,e[10]=p,e[11]=r,e[12]=h):h=e[12],h}function He(t){const e=ae.c(50),{icon:s,logoUrl:o,title:a,subtitle:l,active:i,accent:c,variantCount:r,trailing:d,selectable:p,selectionActive:m,selected:h,invalid:u,invalidReason:f,onToggleSelect:x,onClick:g,menu:y}=t,v=we(),j=c==="global";let N;e[0]!==s||e[1]!==i||e[2]!==j||e[3]!==o?(N=o?n.jsx("img",{src:o,alt:"",className:"size-8 shrink-0 rounded-lg object-cover bg-muted"}):n.jsx("span",{className:xe("flex size-8 shrink-0 items-center justify-center rounded-lg",j?"bg-global-section/15":"bg-muted"),children:n.jsx(s,{size:16,className:xe("shrink-0",!j&&(i?"text-accent-foreground":"text-muted-foreground")),style:j?{color:Cs}:void 0})}),e[0]=s,e[1]=i,e[2]=j,e[3]=o,e[4]=N):N=e[4];const w=N,E=i?j?"bg-global-section/15 text-global-section-fg dark:text-global-section-fg-dark":"bg-accent text-accent-foreground":j?"hover:bg-global-section/10":"hover:bg-muted";let B;e[5]!==E?(B=xe("group relative flex min-w-0 items-center rounded-md transition-colors",E),e[5]=E,e[6]=B):B=e[6];let k;e[7]!==x||e[8]!==p||e[9]!==h||e[10]!==m||e[11]!==v||e[12]!==a?(k=p&&n.jsx("span",{className:xe("flex shrink-0 items-center pl-2.5 transition-opacity",h||m?"opacity-100":"opacity-0 group-hover:opacity-100 focus-within:opacity-100"),onClick:Er,children:n.jsx(Zt,{checked:h,onCheckedChange:()=>x?.(),"aria-label":v("sandbox.itemRow.selectItem",{title:a})})}),e[7]=x,e[8]=p,e[9]=h,e[10]=m,e[11]=v,e[12]=a,e[13]=k):k=e[13];const D=u&&!i&&"text-destructive";let O;e[14]!==D?(O=xe("block truncate text-sm font-medium",D),e[14]=D,e[15]=O):O=e[15];let L;e[16]!==O||e[17]!==a?(L=n.jsx("span",{className:O,children:a}),e[16]=O,e[17]=a,e[18]=L):L=e[18];const K=i?"text-accent-foreground/70":"text-muted-foreground";let F;e[19]!==K?(F=xe("block truncate text-xs",K),e[19]=K,e[20]=F):F=e[20];let _;e[21]!==l||e[22]!==F?(_=n.jsx("span",{className:F,children:l}),e[21]=l,e[22]=F,e[23]=_):_=e[23];let A;e[24]!==_||e[25]!==L?(A=n.jsxs("span",{className:"min-w-0 flex-1",children:[L,_]}),e[24]=_,e[25]=L,e[26]=A):A=e[26];let I;e[27]!==i||e[28]!==v||e[29]!==r?(I=r!==void 0&&r>1&&n.jsxs(Xe,{children:[n.jsx(Ye,{asChild:!0,children:n.jsxs("span",{className:xe("flex shrink-0 items-center gap-1 text-xs font-medium",i?"text-accent-foreground/70":"text-muted-foreground"),children:[n.jsx(Bn,{size:14}),r]})}),n.jsx(Qe,{side:"bottom",children:v("sandbox.itemRow.variantCount",{count:r})})]}),e[27]=i,e[28]=v,e[29]=r,e[30]=I):I=e[30];let R;e[31]!==i||e[32]!==u||e[33]!==f?(R=u&&n.jsxs(Xe,{children:[n.jsx(Ye,{asChild:!0,children:n.jsx("span",{className:xe("flex shrink-0 items-center",i?"text-accent-foreground":"text-destructive"),children:n.jsx(Yt,{size:14})})}),f&&n.jsx(Qe,{side:"bottom",children:f})]}),e[31]=i,e[32]=u,e[33]=f,e[34]=R):R=e[34];let V;e[35]!==g||e[36]!==w||e[37]!==A||e[38]!==I||e[39]!==R||e[40]!==d?(V=n.jsxs("button",{type:"button",onClick:g,className:"flex min-w-0 flex-1 items-center gap-2.5 classic:rounded-md compact:rounded-lg px-2.5 py-2 text-left cursor-pointer",children:[w,A,I,R,d]}),e[35]=g,e[36]=w,e[37]=A,e[38]=I,e[39]=R,e[40]=d,e[41]=V):V=e[41];let z;e[42]!==i||e[43]!==y?(z=y&&n.jsx("div",{className:xe("pr-1 opacity-0 transition-opacity group-hover:opacity-100",i&&"opacity-100"),children:y}),e[42]=i,e[43]=y,e[44]=z):z=e[44];let W;return e[45]!==V||e[46]!==z||e[47]!==B||e[48]!==k?(W=n.jsxs("div",{className:B,children:[k,V,z]}),e[45]=V,e[46]=z,e[47]=B,e[48]=k,e[49]=W):W=e[49],W}function Er(t){return t.stopPropagation()}function st(t){const e=ae.c(10),{icon:s,title:o,description:a}=t;let l;e[0]!==s?(l=s&&n.jsx(s,{size:24,className:"text-muted-foreground/60"}),e[0]=s,e[1]=l):l=e[1];let i;e[2]!==o?(i=n.jsx("div",{children:o}),e[2]=o,e[3]=i):i=e[3];let c;e[4]!==a?(c=a&&n.jsx("div",{className:"text-xs text-muted-foreground/80 max-w-sm",children:a}),e[4]=a,e[5]=c):c=e[5];let r;return e[6]!==l||e[7]!==i||e[8]!==c?(r=n.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:[l,i,c]}),e[6]=l,e[7]=i,e[8]=c,e[9]=r):r=e[9],r}const _r={loaders:Tn,actions:Vn},Dr={loaders:"Loaders",actions:"Actions"},Ar={analytics:nl,blog:wn,commerce:sl,site:Go,website:Mt};function $r(t,e){return e===0?Ar[t.toLowerCase()]??Ks:Ks}function Lt(t,e){return e===0?ca(t):t}function Lr(t){const e=ae.c(98),{orgSlug:s,virtualMcpId:o,branch:a,previewUrl:l,meta:i,decofile:c,kind:r}=t,d=we();let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=[],e[0]=p):p=e[0];const[m,h]=$.useState(p),[u,f]=$.useState(null),[x,g]=$.useState(""),[y,v]=$.useState(Vr),[j,N]=$.useState(r);j!==r&&(N(r),h([]),f(null),g(""),v(new Set));let w;e[1]===Symbol.for("react.memo_cache_sentinel")?(w=q=>{v(X=>{const ce=new Set(X);return ce.has(q)?ce.delete(q):ce.add(q),ce})},e[1]=w):w=e[1];const E=w;let B;e[2]!==a||e[3]!==s||e[4]!==o?(B={orgSlug:s,virtualMcpId:o,branch:a},e[2]=a,e[3]=s,e[4]=o,e[5]=B):B=e[5];const k=Xt(B);let D;e[6]!==k?(D=Rn((q,X)=>k.mutate({blockKey:q,data:X})),e[6]=k,e[7]=D):D=e[7];const O=D;let L;e[8]!==r?(L=da(r),e[8]=r,e[9]=L):L=e[9];const K=L,F=_r[r];let _,A,I,R,V,z,W;if(e[10]!==F||e[11]!==a||e[12]!==c||e[13]!==r||e[14]!==i||e[15]!==y||e[16]!==s||e[17]!==m||e[18]!==l||e[19]!==k||e[20]!==O||e[21]!==x||e[22]!==u||e[23]!==K||e[24]!==d||e[25]!==o){I=Symbol.for("react.early_return_sentinel");e:{const q=[...aa(i,c,r).map(Mr),...la(i,r).map(zr)],X=x.trim().toLowerCase(),ce=X.length>0,ne=ce?q.filter(M=>M.title.toLowerCase().includes(X)||M.resolveType.toLowerCase().includes(X)):[],de=new Map,te=[],re=new Map;if(!ce){for(const M of q){const ve=M.folderPath;if(!(ve.length<m.length)&&m.every((Ne,Oe)=>ve[Oe]===Ne))if(ve.length===m.length)if(M.savedKey!==void 0){const Ne=re.get(M.resolveType);Ne?Ne.push(M):re.set(M.resolveType,[M])}else te.push(M);else{const Ne=ve[m.length],Oe=de.get(Ne)??{count:0,savedCount:0};M.savedKey!==void 0?Oe.savedCount=Oe.savedCount+1:Oe.count=Oe.count+1,de.set(Ne,Oe)}}te.sort(Kr);for(const M of re.values())M.sort(Fr)}const le=[...re.entries()].filter(M=>{const[ve]=M;return!te.some(Ne=>Ne.resolveType===ve)}).flatMap(Rr).sort(Ir);let C;e[33]!==m?(C=(M,ve)=>Lt(M.name,m.length).localeCompare(Lt(ve.name,m.length)),e[33]=m,e[34]=C):C=e[34];const J=[...de.entries()].map(Or).sort(C);let Z;e[35]===Symbol.for("react.memo_cache_sentinel")?(Z=M=>{f(M.savedKey!==void 0?{mode:"saved",key:M.savedKey}:{mode:"available",resolveType:M.resolveType,title:M.title})},e[35]=Z):Z=e[35];const oe=Z;let S;e[36]!==k||e[37]!==K||e[38]!==d?(S=async(M,ve)=>{await k.mutateAsync({blockKey:M,data:ve}),me.success(d("sandbox.runnableBlocksBrowser.savedBlockToast",{singular:K,blockId:M})),f({mode:"saved",key:M})},e[36]=k,e[37]=K,e[38]=d,e[39]=S):S=e[39];const se=S;let H;e[40]!==c||e[41]!==u?(H=Gr(u,c),e[40]=c,e[41]=u,e[42]=H):H=e[42];const ie=H;if(ie){const M=`${ie.mode}:${ie.mode==="saved"?ie.blockKey:ie.resolveType}`;let ve;e[43]===Symbol.for("react.memo_cache_sentinel")?(ve=()=>f(null),e[43]=ve):ve=e[43];let Ne;e[44]!==a||e[45]!==c||e[46]!==se||e[47]!==r||e[48]!==i||e[49]!==s||e[50]!==l||e[51]!==k.isPending||e[52]!==O||e[53]!==M||e[54]!==ie.editorTarget||e[55]!==ie.initialValue||e[56]!==o?(Ne=n.jsx(ia,{orgSlug:s,virtualMcpId:o,branch:a,previewUrl:l,meta:i,decofile:c,kind:r,target:ie.editorTarget,initialValue:ie.initialValue,isCreating:k.isPending,onCreate:se,onSaveReferencedBlock:O,onBack:ve},M),e[44]=a,e[45]=c,e[46]=se,e[47]=r,e[48]=i,e[49]=s,e[50]=l,e[51]=k.isPending,e[52]=O,e[53]=M,e[54]=ie.editorTarget,e[55]=ie.initialValue,e[56]=o,e[57]=Ne):Ne=e[57],I=Ne;break e}W="flex h-full w-full min-w-0 flex-col";let ye;e[58]!==d?(ye=d("sandbox.runnableBlocksBrowser.folderBreadcrumb"),e[58]=d,e[59]=ye):ye=e[59];let pe;e[60]===Symbol.for("react.memo_cache_sentinel")?(pe=()=>h([]),e[60]=pe):pe=e[60];const ke=m.length===0?"font-medium text-foreground":"text-muted-foreground";let he;e[61]!==ke?(he=xe("min-w-0 truncate classic:rounded-md compact:rounded-lg px-1 py-0.5 transition-colors hover:bg-accent hover:text-accent-foreground",ke),e[61]=ke,e[62]=he):he=e[62];const je=Dr[r];let Se;e[63]!==he||e[64]!==je?(Se=n.jsx("button",{type:"button",onClick:pe,className:he,children:je}),e[63]=he,e[64]=je,e[65]=Se):Se=e[65];let Ae;e[66]!==m?(Ae=m.map((M,ve)=>{const Ne=ve===m.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[n.jsx(Et,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>h(m.slice(0,ve+1)),className:xe("min-w-0 truncate classic:rounded-md compact:rounded-lg px-1 py-0.5 transition-colors hover:bg-accent hover:text-accent-foreground",Ne?"font-medium text-foreground":"text-muted-foreground"),children:Lt(M,ve)})]},`${M}-${ve}`)}),e[66]=m,e[67]=Ae):Ae=e[67];let Ce;e[68]!==ye||e[69]!==Se||e[70]!==Ae?(Ce=n.jsxs("nav",{"aria-label":ye,className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:[Se,Ae]}),e[68]=ye,e[69]=Se,e[70]=Ae,e[71]=Ce):Ce=e[71];let Pe;e[72]===Symbol.for("react.memo_cache_sentinel")?(Pe=n.jsx(An,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),e[72]=Pe):Pe=e[72];let De;e[73]===Symbol.for("react.memo_cache_sentinel")?(De=M=>g(M.target.value),e[73]=De):De=e[73];let ge;e[74]!==r||e[75]!==d?(ge=d("sandbox.runnableBlocksBrowser.searchPlaceholder",{kind:r}),e[74]=r,e[75]=d,e[76]=ge):ge=e[76];let $e;e[77]!==r||e[78]!==d?($e=d("sandbox.runnableBlocksBrowser.searchAriaLabel",{kind:r}),e[77]=r,e[78]=d,e[79]=$e):$e=e[79];let Le;e[80]!==x||e[81]!==ge||e[82]!==$e?(Le=n.jsxs("div",{className:"flex w-56 shrink-0 items-center gap-2",children:[Pe,n.jsx("input",{type:"text",value:x,onChange:De,placeholder:ge,"aria-label":$e,className:"w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),e[80]=x,e[81]=ge,e[82]=$e,e[83]=Le):Le=e[83],e[84]!==Ce||e[85]!==Le?(A=n.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-2 border-b px-4",children:[Ce,Le]}),e[84]=Ce,e[85]=Le,e[86]=A):A=e[86],_=Qt,z="min-h-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",R="mx-auto w-full max-w-4xl px-6 py-5",V=ce?ne.length===0?n.jsx(st,{title:d("sandbox.runnableBlocksBrowser.noSearchResults",{kind:r,query:x.trim()}),description:d("sandbox.runnableBlocksBrowser.noSearchResultsDescription")}):n.jsx("div",{className:"flex flex-col gap-1",children:ne.map(M=>n.jsx(He,{icon:F,accent:M.savedKey!==void 0?"global":void 0,title:M.title,subtitle:M.resolveType,active:!1,onClick:()=>oe(M)},M.savedKey??M.resolveType))}):J.length===0&&te.length===0&&le.length===0?n.jsx(st,{title:d("sandbox.runnableBlocksBrowser.emptyFolderTitle",{kind:r}),description:m.length===0?d("sandbox.runnableBlocksBrowser.emptyFolderNoManifest"):d("sandbox.runnableBlocksBrowser.emptyFolder")}):n.jsxs(n.Fragment,{children:[J.length>0&&n.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(180px,1fr))] gap-2",children:J.map(M=>{const ve=$r(M.name,m.length);return n.jsxs("button",{type:"button",onClick:()=>h([...m,M.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:[n.jsx(ve,{size:18,className:"shrink-0 text-muted-foreground"}),n.jsxs("span",{className:"min-w-0 flex-1",children:[n.jsx("span",{className:"block truncate text-sm font-medium",children:Lt(M.name,m.length)}),n.jsxs("span",{className:"block truncate text-xs text-muted-foreground",children:[M.count," ",M.count===1?K:r,M.savedCount>0&&n.jsxs(n.Fragment,{children:[" ","·"," ",d("sandbox.runnableBlocksBrowser.savedCountLabel",{count:M.savedCount})]})]})]})]},M.name)})}),(te.length>0||le.length>0)&&n.jsxs("div",{className:xe("flex flex-col gap-1",J.length>0&&"mt-4"),children:[te.map(M=>{const ve=re.get(M.resolveType)??[],Ne=y.has(M.resolveType);return n.jsxs("div",{className:"flex flex-col",children:[n.jsx(He,{icon:F,title:M.title,subtitle:M.resolveType,active:!1,onClick:()=>oe(M)}),ve.length>0&&n.jsxs(n.Fragment,{children:[n.jsxs("button",{type:"button",onClick:()=>E(M.resolveType),"aria-expanded":Ne,className:"flex items-center gap-1 self-start classic:rounded-md compact:rounded-lg px-2.5 py-1 text-xs font-medium transition-colors hover:bg-global-section/10 cursor-pointer ml-11",style:{color:Cs},children:[Ne?n.jsx(ht,{size:12,className:"shrink-0"}):n.jsx(Et,{size:12,className:"shrink-0"}),d(Ne?"sandbox.runnableBlocksBrowser.hideSaved":"sandbox.runnableBlocksBrowser.seeSaved")," ","(",ve.length,")"]}),Ne&&n.jsx("div",{className:"ml-11 flex flex-col gap-1 pb-1",children:ve.map(Oe=>n.jsx(He,{icon:F,accent:"global",title:Oe.title,subtitle:Oe.resolveType,active:!1,onClick:()=>oe(Oe)},Oe.savedKey))})]})]},M.resolveType)}),le.map(M=>n.jsx(He,{icon:F,accent:"global",title:M.title,subtitle:M.resolveType,active:!1,onClick:()=>oe(M)},M.savedKey))]})]})}e[10]=F,e[11]=a,e[12]=c,e[13]=r,e[14]=i,e[15]=y,e[16]=s,e[17]=m,e[18]=l,e[19]=k,e[20]=O,e[21]=x,e[22]=u,e[23]=K,e[24]=d,e[25]=o,e[26]=_,e[27]=A,e[28]=I,e[29]=R,e[30]=V,e[31]=z,e[32]=W}else _=e[26],A=e[27],I=e[28],R=e[29],V=e[30],z=e[31],W=e[32];if(I!==Symbol.for("react.early_return_sentinel"))return I;let P;e[87]!==R||e[88]!==V?(P=n.jsx("div",{className:R,children:V}),e[87]=R,e[88]=V,e[89]=P):P=e[89];let U;e[90]!==_||e[91]!==P||e[92]!==z?(U=n.jsx(_,{className:z,children:P}),e[90]=_,e[91]=P,e[92]=z,e[93]=U):U=e[93];let Y;return e[94]!==A||e[95]!==U||e[96]!==W?(Y=n.jsxs("div",{className:W,children:[A,U]}),e[94]=A,e[95]=U,e[96]=W,e[97]=Y):Y=e[97],Y}function Or(t){const[e,s]=t;return{name:e,...s}}function Ir(t,e){return t.title.localeCompare(e.title)}function Rr(t){const[,e]=t;return e}function Fr(t,e){return t.title.localeCompare(e.title)}function Kr(t,e){return t.title.localeCompare(e.title)}function zr(t){return{resolveType:t.resolveType,title:t.title,folderPath:In(t.resolveType)}}function Mr(t){return{resolveType:t.resolveType,title:t.title,folderPath:In(t.resolveType),savedKey:t.key}}function Vr(){return new Set}function Gr(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:o,title:a}=ra(e,t.key);return{mode:"saved",blockKey:t.key,resolveType:s,editorTarget:{mode:"saved",blockKey:t.key,resolveType:s,title:a},initialValue:o}}function Ur(t){const e=ae.c(106),{orgSlug:s,virtualMcpId:o,branch:a,previewUrl:l,meta:i,decofile:c,resolveType:r,title:d,defaultBlockId:p,isCreating:m,onCreate:h,onSaveReferencedBlock:u}=t,f=we(),x=_t(),g=x?.virtualMcpId,v=Hn(g===o?o:null)?.metadata?.siteSlug??null;let j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j={},e[0]=j):j=e[0];const[N,w]=$.useState(j);let E;e[1]===Symbol.for("react.memo_cache_sentinel")?(E=[],e[1]=E):E=e[1];const[B,k]=$.useState(E),[D,O]=$.useState(0),[L,K]=$.useState(!1);let F;e[2]!==i||e[3]!==r?(F=Ns(r,i),e[2]=i,e[3]=r,e[4]=F):F=e[4];const _=F;let A,I,R,V,z,W,P,U;if(e[5]!==v||e[6]!==a||e[7]!==c||e[8]!==B||e[9]!==N||e[10]!==m||e[11]!==h||e[12]!==s||e[13]!==l||e[14]!==r||e[15]!==f||e[16]!==x?.taskId||e[17]!==d||e[18]!==o){const te=r.split("/").pop()?.replace(/\.tsx?$/,"")??r,re=x?.taskId??null,le=l??void 0;let C;e[27]!==v||e[28]!==a||e[29]!==s||e[30]!==le||e[31]!==re||e[32]!==o?(C={orgSlug:s,virtualMcpId:o,branch:a,threadId:re,previewUrl:le,siteSlug:v},e[27]=v,e[28]=a,e[29]=s,e[30]=le,e[31]=re,e[32]=o,e[33]=C):C=e[33],I=C;let J,Z,oe,S;if(e[34]!==c||e[35]!==B||e[36]!==N||e[37]!==h||e[38]!==f||e[39]!==d){const Se=[d,...B],Ae=Pe=>{k(B.slice(0,Pe)),O(Hr)};let Ce;e[48]!==c||e[49]!==N||e[50]!==h?(Ce=async Pe=>{const De=ma(Pe,c);if(De){me.error(De);return}await h(Pe,N),K(!1)},e[48]=c,e[49]=N,e[50]=h,e[51]=Ce):Ce=e[51],A=Ce,U="flex h-full w-full min-w-0",P="flex min-w-0 flex-1 flex-col",z="shrink-0 border-b px-3 py-2.5",S="flex min-w-0 items-center gap-2 overflow-hidden",e[52]!==f?(J=f("sandbox.availableSectionEditor.editingBreadcrumb"),e[52]=f,e[53]=J):J=e[53],Z="flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",oe=Se.map((Pe,De)=>{const ge=De===Se.length-1,$e=ua(Pe);return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[De>0&&n.jsx(Et,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>Ae(De),title:$e,className:xe("min-w-0 truncate classic:rounded-md compact:rounded-lg px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",ge?"font-medium text-foreground":"text-muted-foreground"),children:$e})]},`${$e}-${De}`)}),e[34]=c,e[35]=B,e[36]=N,e[37]=h,e[38]=f,e[39]=d,e[40]=A,e[41]=J,e[42]=Z,e[43]=oe,e[44]=S,e[45]=z,e[46]=P,e[47]=U}else A=e[40],J=e[41],Z=e[42],oe=e[43],S=e[44],z=e[45],P=e[46],U=e[47];let se;e[54]!==J||e[55]!==Z||e[56]!==oe?(se=n.jsx("nav",{"aria-label":J,className:Z,children:oe}),e[54]=J,e[55]=Z,e[56]=oe,e[57]=se):se=e[57];let H;e[58]===Symbol.for("react.memo_cache_sentinel")?(H=()=>K(!0),e[58]=H):H=e[58];let ie;e[59]!==f?(ie=f("sandbox.availableSectionEditor.saveAsGlobalSection"),e[59]=f,e[60]=ie):ie=e[60];let ye;e[61]===Symbol.for("react.memo_cache_sentinel")?(ye=n.jsx(Uo,{size:14}),e[61]=ye):ye=e[61];let pe;e[62]!==m||e[63]!==ie?(pe=n.jsx(Ye,{asChild:!0,children:n.jsx(Be,{size:"icon",className:"size-8 shrink-0",disabled:m,onClick:H,"aria-label":ie,children:ye})}),e[62]=m,e[63]=ie,e[64]=pe):pe=e[64];let ke;e[65]!==f?(ke=f("sandbox.availableSectionEditor.saveAsGlobalSection"),e[65]=f,e[66]=ke):ke=e[66];let he;e[67]!==ke?(he=n.jsx(Qe,{side:"bottom",children:ke}),e[67]=ke,e[68]=he):he=e[68];let je;e[69]!==pe||e[70]!==he?(je=n.jsxs(Xe,{children:[pe,he]}),e[69]=pe,e[70]=he,e[71]=je):je=e[71],e[72]!==S||e[73]!==se||e[74]!==je?(W=n.jsxs("div",{className:S,children:[se,je]}),e[72]=S,e[73]=se,e[74]=je,e[75]=W):W=e[75],R="mt-1.5 py-1 pl-1 text-sm leading-snug text-muted-foreground",V=f("sandbox.availableSectionEditor.localEditsHint",{typeLabel:te}),e[5]=v,e[6]=a,e[7]=c,e[8]=B,e[9]=N,e[10]=m,e[11]=h,e[12]=s,e[13]=l,e[14]=r,e[15]=f,e[16]=x?.taskId,e[17]=d,e[18]=o,e[19]=A,e[20]=I,e[21]=R,e[22]=V,e[23]=z,e[24]=W,e[25]=P,e[26]=U}else A=e[19],I=e[20],R=e[21],V=e[22],z=e[23],W=e[24],P=e[25],U=e[26];let Y;e[76]!==R||e[77]!==V?(Y=n.jsx("p",{className:R,children:V}),e[76]=R,e[77]=V,e[78]=Y):Y=e[78];let q;e[79]!==Y||e[80]!==z||e[81]!==W?(q=n.jsxs("div",{className:z,children:[W,Y]}),e[79]=Y,e[80]=z,e[81]=W,e[82]=q):q=e[82];let X;e[83]!==c||e[84]!==B||e[85]!==D||e[86]!==N||e[87]!==i||e[88]!==u||e[89]!==I||e[90]!==_||e[91]!==f?(X=n.jsx(Qt,{className:"min-h-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsx("div",{className:"mx-auto max-w-2xl",children:_?n.jsx(Fn,{schema:_,value:N,onChange:te=>w(te),basePath:"",breadcrumbPath:B,onBreadcrumbChange:k,meta:i,decofile:c,onSaveReferencedBlock:u,sandbox:I},D):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:f("sandbox.availableSectionEditor.noEditableFields")})})})}),e[83]=c,e[84]=B,e[85]=D,e[86]=N,e[87]=i,e[88]=u,e[89]=I,e[90]=_,e[91]=f,e[92]=X):X=e[92];let ce;e[93]!==q||e[94]!==X||e[95]!==P?(ce=n.jsxs("div",{className:P,children:[q,X]}),e[93]=q,e[94]=X,e[95]=P,e[96]=ce):ce=e[96];let ne;e[97]!==p||e[98]!==A||e[99]!==m||e[100]!==L?(ne=n.jsx(fa,{open:L,onOpenChange:K,defaultBlockId:p,isPending:m,onSubmit:A}),e[97]=p,e[98]=A,e[99]=m,e[100]=L,e[101]=ne):ne=e[101];let de;return e[102]!==ce||e[103]!==ne||e[104]!==U?(de=n.jsxs("div",{className:U,children:[ce,ne]}),e[102]=ce,e[103]=ne,e[104]=U,e[105]=de):de=e[105],de}function Hr(t){return t+1}function qr(t,e){const s={__resolveType:t},o=ga([s],e)[0];return o?xa(s,o,e):null}function Jr({orgSlug:t,virtualMcpId:e,branch:s,previewUrl:o,meta:a,decofile:l,blockKey:i,onSaveReferencedBlock:c}){const r=we(),d=_t(),p=d?.virtualMcpId,h=Hn(p===e?e:null)?.metadata?.siteSlug??null,[u]=$.useState(()=>qr(i,l)),[f,x]=$.useState(u?.data??{}),[g,y]=$.useState([]),[v,j]=$.useState(0),[N,w]=$.useState(!1),[E,B]=$.useState(null),k=E!==null,{save:D,flush:O}=pa({orgSlug:t,virtualMcpId:e,branch:s}),L=u?.resolveType?Ns(u.resolveType,a):null,K=l[i],F=K?Ta(i,K):i,_=d?.taskId??null,A={orgSlug:t,virtualMcpId:e,branch:s,threadId:_,previewUrl:o??void 0,siteSlug:h},I=P=>{x(P),D(i,P)},R=()=>{k?(B(null),w(!1),j(P=>P+1)):B(JSON.stringify(f,null,2))},V=P=>{const U=P??"";try{const Y=JSON.parse(U);if(Y&&typeof Y=="object"&&!Array.isArray(Y)){w(!1),I(Y);return}w(!0)}catch{w(!0)}},z=[F,...g],W=P=>{y(g.slice(0,P)),j(U=>U+1)};return n.jsx("div",{className:"flex h-full w-full min-w-0",children:n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[n.jsx(ha,{crumbs:z,onSelect:W}),n.jsxs("div",{className:"shrink-0 border-b px-3 py-2.5",children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[n.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:Cs},"aria-hidden":!0}),n.jsx("div",{className:"flex-1"}),n.jsxs(Xe,{children:[n.jsx(Ye,{asChild:!0,children:n.jsx(Be,{variant:k?"default":"ghost",size:"icon",className:"size-8 shrink-0",onClick:R,"aria-label":r(k?"sandbox.savedSectionEditor.closeJsonEditor":"sandbox.savedSectionEditor.editAsJson"),"aria-pressed":k,children:k?n.jsx(Ts,{size:14}):n.jsx(En,{size:14})})}),n.jsx(Qe,{side:"bottom",children:r(k?"sandbox.savedSectionEditor.closeJsonEditor":"sandbox.savedSectionEditor.editAsJson")})]})]}),n.jsx("p",{className:"mt-1.5 py-1 pl-1 text-sm leading-snug text-muted-foreground",children:r("sandbox.savedSectionEditor.globalSectionDescription")})]}),n.jsxs("div",{className:"relative min-h-0 flex-1",children:[n.jsx(Qt,{className:"h-full [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsx("div",{className:"mx-auto max-w-2xl",children:L?n.jsx(Fn,{schema:L,value:f,onChange:P=>I(P),basePath:"",breadcrumbPath:g,onBreadcrumbChange:y,meta:a,decofile:l,onSaveReferencedBlock:c,sandbox:A},v):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:r("sandbox.savedSectionEditor.noEditableFields")})})})}),E!==null&&n.jsxs("div",{className:"absolute inset-0 flex flex-col bg-background",children:[N&&n.jsx("div",{className:"shrink-0 border-b bg-destructive/10 px-3 py-1.5 text-xs text-destructive",children:r("sandbox.savedSectionEditor.invalidJsonError")}),n.jsx("div",{className:"min-h-0 flex-1",children:n.jsx(Un,{language:"json",height:"100%",code:E,onChange:V,onSave:P=>{V(P),O()}})})]})]})]})})}function Wr(t){const e=ae.c(36),{selection:s,orgSlug:o,virtualMcpId:a,branch:l,previewUrl:i,meta:c,decofile:r,isCreating:d,onCreateAvailable:p,onSaveReferencedBlock:m}=t,h=we();if(!s){let x;e[0]!==h?(x=h("sandbox.sectionsRightPane.selectSectionTitle"),e[0]=h,e[1]=x):x=e[1];let g;e[2]!==h?(g=h("sandbox.sectionsRightPane.selectSectionDescription"),e[2]=h,e[3]=g):g=e[3];let y;return e[4]!==x||e[5]!==g?(y=n.jsx(st,{title:x,description:g}),e[4]=x,e[5]=g,e[6]=y):y=e[6],y}if(s.collection==="available-section"){const x=`available:${s.resolveType}`,g=s.resolveType,y=s.title;let v;e[7]!==s.title?(v=ba(s.title),e[7]=s.title,e[8]=v):v=e[8];let j;e[9]!==p||e[10]!==s.resolveType?(j=(w,E)=>p(s.resolveType,w,E),e[9]=p,e[10]=s.resolveType,e[11]=j):j=e[11];let N;return e[12]!==l||e[13]!==r||e[14]!==d||e[15]!==c||e[16]!==m||e[17]!==o||e[18]!==i||e[19]!==s.resolveType||e[20]!==s.title||e[21]!==x||e[22]!==v||e[23]!==j||e[24]!==a?(N=n.jsx(Ur,{orgSlug:o,virtualMcpId:a,branch:l,previewUrl:i,meta:c,decofile:r,resolveType:g,title:y,defaultBlockId:v,isCreating:d,onCreate:j,onSaveReferencedBlock:m},x),e[12]=l,e[13]=r,e[14]=d,e[15]=c,e[16]=m,e[17]=o,e[18]=i,e[19]=s.resolveType,e[20]=s.title,e[21]=x,e[22]=v,e[23]=j,e[24]=a,e[25]=N):N=e[25],N}const u=`saved:${s.key}`;let f;return e[26]!==l||e[27]!==r||e[28]!==c||e[29]!==m||e[30]!==o||e[31]!==i||e[32]!==s.key||e[33]!==u||e[34]!==a?(f=n.jsx(Jr,{orgSlug:o,virtualMcpId:a,branch:l,previewUrl:i,meta:c,decofile:r,blockKey:s.key,onSaveReferencedBlock:m},u),e[26]=l,e[27]=r,e[28]=c,e[29]=m,e[30]=o,e[31]=i,e[32]=s.key,e[33]=u,e[34]=a,e[35]=f):f=e[35],f}function Ot(t){const e=ae.c(34),{onDuplicate:s,onRename:o,onAddVariant:a,onEditSeo:l,onViewJson:i,onDelete:c}=t,r=we();let d;e[0]!==r?(d=r("sandbox.itemActions.moreActions"),e[0]=r,e[1]=d):d=e[1];let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx(_o,{size:14}),e[2]=p):p=e[2];let m;e[3]!==d?(m=n.jsx(Ft,{asChild:!0,children:n.jsx("button",{type:"button","aria-label":d,className:"flex h-7 w-7 items-center justify-center classic:rounded-md compact:rounded-lg text-muted-foreground hover:bg-background hover:text-foreground cursor-pointer",onClick:Yr,children:p})}),e[3]=d,e[4]=m):m=e[4];let h;e[5]!==o||e[6]!==r?(h=o&&n.jsxs(We,{onClick:o,children:[n.jsx(ll,{size:14}),r("sandbox.itemActions.rename")]}),e[5]=o,e[6]=r,e[7]=h):h=e[7];let u;e[8]!==s||e[9]!==r?(u=s&&n.jsxs(We,{onClick:s,children:[n.jsx(al,{size:14}),r("sandbox.itemActions.duplicate")]}),e[8]=s,e[9]=r,e[10]=u):u=e[10];let f;e[11]!==a||e[12]!==r?(f=a&&n.jsxs(n.Fragment,{children:[n.jsx(cs,{}),n.jsxs(We,{onClick:a,className:"cursor-pointer text-success focus:text-success",children:[n.jsx(Bn,{size:14}),r("sandbox.itemActions.addVariant")]})]}),e[11]=a,e[12]=r,e[13]=f):f=e[13];let x;e[14]!==l||e[15]!==i||e[16]!==r?(x=(l||i)&&n.jsxs(n.Fragment,{children:[n.jsx(cs,{}),l&&n.jsxs(We,{onClick:l,children:[n.jsx(Pn,{size:14}),r("sandbox.itemActions.editSeo")]}),i&&n.jsxs(We,{onClick:i,children:[n.jsx(En,{size:14}),r("sandbox.itemActions.viewJson")]})]}),e[14]=l,e[15]=i,e[16]=r,e[17]=x):x=e[17];let g;e[18]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(cs,{}),e[18]=g):g=e[18];let y;e[19]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(Ps,{size:14}),e[19]=y):y=e[19];let v;e[20]!==r?(v=r("sandbox.itemActions.delete"),e[20]=r,e[21]=v):v=e[21];let j;e[22]!==c||e[23]!==v?(j=n.jsxs(We,{onClick:c,className:"text-destructive focus:text-destructive",children:[y,v]}),e[22]=c,e[23]=v,e[24]=j):j=e[24];let N;e[25]!==j||e[26]!==h||e[27]!==u||e[28]!==f||e[29]!==x?(N=n.jsxs(Kt,{align:"end",className:"w-44",children:[h,u,f,x,g,j]}),e[25]=j,e[26]=h,e[27]=u,e[28]=f,e[29]=x,e[30]=N):N=e[30];let w;return e[31]!==N||e[32]!==m?(w=n.jsxs(zt,{children:[m,N]}),e[31]=N,e[32]=m,e[33]=w):w=e[33],w}function Yr(t){return t.stopPropagation()}function Qr(t){return t.split("/").pop()?.replace(/\.tsx?$/,"")||t||"Section"}function Xr(t){const e=new Map;for(const s of t){const o=Qr(s.resolveType),a=e.get(o);a?a.push(s):e.set(o,[s])}return[...e.entries()].map(([s,o])=>({label:s,sections:o})).sort((s,o)=>s.label.localeCompare(o.label))}function xn(t){const e=ae.c(8),{icon:s,label:o,className:a}=t;let l;e[0]!==a?(l=xe("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]=l):l=e[1];let i;e[2]!==s?(i=n.jsx(s,{size:13,className:"shrink-0"}),e[2]=s,e[3]=i):i=e[3];let c;return e[4]!==o||e[5]!==l||e[6]!==i?(c=n.jsxs("div",{className:l,children:[i,o]}),e[4]=o,e[5]=l,e[6]=i,e[7]=c):c=e[7],c}const bn=$.lazy(()=>qe(()=>import("./app-editor-CKcMSoy_.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,167,168,169,170,171,172,173,174,175,176,177,178,179])).then(t=>({default:t.AppEditor}))),Zr=$.lazy(()=>qe(()=>import("./post-editor-KBvky45B.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,23,33,32,34,35,36,37,38,39,40,41,27,28,30,42,43,44,45,46,31,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,68,107,181,165,144,87,88,67,110,122,117,115,72,71,69,73,74,75,76,77,78,79,80,81,82,83,26,84,85,86,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,108,109,111,24,25,112,113,114,116,118,119,120,121,123,124,125,126,127,128,129,130,131,182,148,70,183,184,185,132,133,134,135,136,137,138,139,140,141,142,143,145,146,147,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,166,167,168,169,170,171,172,173,174,175,176,177,178,179])).then(t=>({default:t.PostEditor}))),ec=$.lazy(()=>qe(()=>import("./record-editor-B-cJMYFm.js"),__vite__mapDeps([186,1,2,68,107,25,26,27,28,115,72,71,12,13,3,4,5,6,7,8,9,10,11,14,15,16,17,18,19,20,21,22,23,69,32,33,34,35,36,37,38,39,40,41,30,42,43,44,45,46,31,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,73,74,75,76,77,78,79,80,67,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,108,109,110,111,24,112,113,114,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,185,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,167,168,169,170,171,172,173,174,175,176,177,178,179])).then(t=>({default:t.RecordEditor}))),tc=$.lazy(()=>qe(()=>import("./context-9zKFm2v9.js"),__vite__mapDeps([187,1,2,28,32,33,34,35,36,37,38,39,40,41,27,30,42,43,44,45,46,31,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,68,107,115,110,20,188,105,98,67,106,100,81,82,4,5,6,7,8,9,10,83,26,148,183,116,80,85,87,88,189,152,149,72,71,12,13,3,11,14,15,16,17,18,19,21,22,23,69,73,74,75,76,77,78,79,84,86,89,90,91,92,93,94,95,96,97,99,101,102,103,104,108,109,111,24,25,112,113,114,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,174,185,186,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,150,151,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,175,176,177,178,179,190,182,70,184])).then(t=>({default:t.BlogContext}))),sc=$.lazy(()=>qe(()=>import("./category-editor-rQLavGw6.js"),__vite__mapDeps([190,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,37,39,52,32,33,34,35,36,38,40,41,27,28,30,42,43,44,45,46,31,47,48,49,50,51,53,54,55,56,57,58,59,60,61,62,63,64,65,66,119,68,107,182,116,87,88,67,110,72,71,69,73,74,75,76,77,78,79,80,81,82,83,26,84,85,86,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,108,109,111,24,25,112,113,114,115,117,118,120,121,122,123,124,125,126,127,128,129,130,131,148,70,183,184,185,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179])).then(t=>({default:t.CategoryEditor}))),nc=$.lazy(()=>qe(()=>import("./sections-editor-DGlNHFIn.js"),__vite__mapDeps([191,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,72,71,69,32,33,34,35,36,37,38,39,40,41,27,28,30,42,43,44,45,46,31,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,73,74,75,76,77,78,79,80,67,81,82,83,26,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,68,108,109,110,111,24,25,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,174,192,29,70,193])).then(t=>({default:t.SectionsEditor}))),oc=$.lazy(()=>qe(()=>import("./seo-editor-DCpmtymR.js"),__vite__mapDeps([194,1,2,32,33,34,35,36,37,38,39,40,41,27,28,30,42,43,44,45,46,31,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,24,25,26,72,71,12,13,3,4,5,6,7,8,9,10,11,14,15,16,17,18,19,20,21,22,23,69,73,74,75,76,77,78,79,80,67,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,68,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,192])).then(t=>({default:t.SeoEditor}))),ac=$.lazy(()=>qe(()=>import("./variant-calendar-D7pBaGln.js"),__vite__mapDeps([195,1,2,32,33,34,35,36,37,38,39,40,41,27,28,30,42,43,44,45,46,31,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,107,24,25,26,117,83,196,132,133,134,102,8,9,135,7,96,100,6,10,136,3,4,5,11,12,13,14,15,16,17,18,19,20,21,22,23,98,67,137,138,82,104,105,106,68,81,139,84,85,86,87,88,89,90,91,92,93,140,71,79,78,80,75,76,122,141,129,99,142,143,144,145,110,146,147,148,149,150,151,152,153,154,155,156,157,158,159,126,127,160,115,161,162,163,164,165,166,167,74,77,94,95,97,101,103,108,109,168,120,73,169,170,128,124,171,172,173,119,72,69,111,112,113,114,116,118,121,123,125,130,131,174,175,176,177,178,179])).then(t=>({default:t.VariantCalendar}))),lc=$.lazy(()=>qe(()=>import("./post-calendar-CCy3Rkj-.js"),__vite__mapDeps([197,1,2,33,32,34,35,36,37,38,39,40,41,27,28,30,42,43,44,45,46,31,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,198,24,25,26,132,133,134,102,8,9,135,7,96,100,6,10,136,3,4,5,11,12,13,14,15,16,17,18,19,20,21,22,23,98,83,67,137,138,82,104,105,106,107,68,81,139,84,85,86,87,88,89,90,91,92,93,140,71,79,78,80,75,76,122,141,129,99,142,143,144,145,110,146,147,148,149,150,151,152,153,154,155,156,157,158,159,126,127,160,115,161,162,163,164,165,166,167,74,77,94,95,97,101,103,108,109,168,120,73,169,170,128,124,171,172,173,119,72,69,111,112,113,114,116,117,118,121,123,125,130,131,174,175,176,177,178,179])).then(t=>({default:t.PostCalendar}))),ic=$.lazy(()=>qe(()=>import("./redirect-editor-C9LkCwmC.js"),__vite__mapDeps([199,1,2,144,27,68,107,25,26,28,72,71,12,13,3,4,5,6,7,8,9,10,11,14,15,16,17,18,19,20,21,22,23,69,32,33,34,35,36,37,38,39,40,41,30,42,43,44,45,46,31,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,73,74,75,76,77,78,79,80,67,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,108,109,110,111,24,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,185])).then(t=>({default:t.RedirectEditor})));function rc(t){const e=ae.c(20),{deepLinkPage:s}=t,{currentBranch:o,virtualMcpId:a}=kn(),{org:l}=Do(),i=Ka(),c=za(),{runtime:r,previewServerUrl:d}=Gn(a),p=r==="cms";let m;e[0]!==p||e[1]!==c.previewState||e[2]!==i.lifecycle.phase?(m=Pl({fastPreviewActive:p,previewState:c.previewState,lifecyclePhase:i.lifecycle.phase}),e[0]=p,e[1]=c.previewState,e[2]=i.lifecycle.phase,e[3]=m):m=e[3];const h=m;if(h.kind==="sandbox-card"){const x=`/${l.slug}/settings/connections`;let g;return e[4]!==h.state||e[5]!==c.start||e[6]!==x||e[7]!==i.lifecycle||e[8]!==i.phase?(g=n.jsx(wl,{state:h.state,claimPhase:i.phase,lifecycle:i.lifecycle,onStart:c.start,connectionsHref:x}),e[4]=h.state,e[5]=c.start,e[6]=x,e[7]=i.lifecycle,e[8]=i.phase,e[9]=g):g=e[9],g}if(!a||!o){let x;return e[10]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(st,{title:"Waiting for sandbox context…"}),e[10]=x):x=e[10],x}const u=p?d:c.previewUrl;let f;return e[11]!==o||e[12]!==s||e[13]!==h.devServerReady||e[14]!==h.sandboxWarming||e[15]!==c.previewUrl||e[16]!==l.slug||e[17]!==u||e[18]!==a?(f=n.jsx(dc,{orgSlug:l.slug,virtualMcpId:a,branch:o,previewUrl:c.previewUrl,sitePreviewUrl:u,deepLinkPage:s,devServerReady:h.devServerReady,sandboxWarming:h.sandboxWarming}),e[11]=o,e[12]=s,e[13]=h.devServerReady,e[14]=h.sandboxWarming,e[15]=c.previewUrl,e[16]=l.slug,e[17]=u,e[18]=a,e[19]=f):f=e[19],f}const yn=2e3,cc=15;function vn(t,e,s,o){return typeof e!="string"||s&&(qn(e,s,o)||t.state.dataUpdateCount>=cc)?!1:yn}function dc({orgSlug:t,virtualMcpId:e,branch:s,previewUrl:o,sitePreviewUrl:a,deepLinkPage:l,devServerReady:i,sandboxWarming:c}){const r=we(),d=_t()?.taskId??null,p={orgSlug:t,virtualMcpId:e,branch:s,threadId:d,previewUrl:o},{data:m,isLoading:h}=ya(p,{fetchEnabled:i}),u=jn({strict:!1}),[f,x]=$.useState(()=>u.contentCollection&&lt(u.contentCollection)&&u.contentCollection||"pages"),[g,y]=$.useState(()=>u.contentItem&&lt(f)?{collection:f,key:u.contentItem}:null),[v,j]=$.useState(null),N=!!(l?.pageId||l?.path||l?.pathTemplate),[w,E]=$.useState(!1);if(N&&!w&&g===null&&m){E(!0);const b=Ba(Ms(m),l??{});b&&(x("pages"),y({collection:"pages",key:b.key,path:b.path}))}const[B,k]=$.useState(""),[D,O]=$.useState("board"),L=b=>{y(b),j(null)},[K,F]=$.useState(f);K!==f&&(F(f),k(""));const{data:_,isLoading:A,isFetching:I}=va(p,{fetchEnabled:i,refetchInterval:b=>{const G=b.state.data;if(f==="apps"&&g&&g.collection==="apps"){const ue=m?.[g.key];return vn(b,typeof ue?.__resolveType=="string"?ue.__resolveType:void 0,G)}if(f==="site"&&m){const ue=G?Vs(m,G):null,fe=m.site,_e=ue?.resolveType??(typeof fe?.__resolveType=="string"?fe.__resolveType:void 0);return vn(b,_e,G,["seo"])}return!1}}),R=(b,G)=>!qn(b,_,G)&&(A||I),{catalog:V,isLoading:z}=jl(_??void 0,m??void 0,{enabled:f==="apps"}),W=Fi({orgSlug:t,virtualMcpId:e,branch:s,meta:_}),P=Xt(p),U=Mn(p),Y=Mi({orgSlug:t,virtualMcpId:e,branch:s,decofile:m??{},support:W,onMoved:(b,G)=>y(ue=>ue?.collection==="posts"&&ue.key===b?{collection:"posts",key:G}:ue)}),[q,X]=$.useState(null),[ce,ne]=$.useState(),[de,te]=$.useState(!1),[re,le]=$.useState(),[C,J]=$.useState(null),[Z,oe]=$.useState(null),[S,se]=$.useState(null),H=!m||!_;if(h||A||H&&c)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(rt,{className:"size-5 text-muted-foreground"})});if(H)return n.jsx(st,{title:"Could not load site data."});const ie=Ms(m).sort((b,G)=>b.name.localeCompare(G.name)),ye=Ea(m).sort((b,G)=>b.from.localeCompare(G.from)),pe=_a(m,_),ke=f==="sections"?Da(_):[],he=Vs(m,_),je=Xn(m),Se=Bs.some(b=>je[b].length>0),Ae=lt(f)?je[f]:[],Ce=zs(_,"loaders"),Pe=zs(_,"actions");if(!Aa(m,_)&&!Se&&Ce===0&&Pe===0)return n.jsx(st,{icon:Yt,title:"No editable content",description:"This project doesn't expose any Deco pages, sections, apps, loaders, or actions."});const De={pages:ie.length,sections:pe.length,apps:V.length,loaders:Ce,actions:Pe,redirects:ye.length,posts:je.posts.length,authors:je.authors.length,categories:je.categories.length},ge=new Set(ie.map(b=>It(b.path))),$e=new Set(ie.map(b=>b.name)),Le=new Set(pe.map(b=>b.name)),M=async b=>{const G=m[b.key];if(!G)return;const ue=Kn(m,b.key),fe=ja(m,b.key,Math.max(0,ue-1)),_e=ka(G.sections,fe);if(_e)try{await P.mutateAsync({blockKey:b.key,data:{...G,sections:_e}}),me.success(`Variant added to "${b.name}"`),y({collection:"pages",key:b.key,path:b.path})}catch(Ie){me.error(Ie instanceof Error?Ie.message:"Could not add variant")}},ve=()=>{ne(void 0),X({mode:"create",sourceKey:null,initialName:"My new page",initialPath:"/example"})},Ne=b=>{ne(void 0),X({mode:"duplicate",sourceKey:b.key,initialName:Js($e,b.name),initialPath:Tl(ge,b.path)})},Oe=b=>{ne(void 0),X({mode:"rename",sourceKey:b.key,initialName:b.name,initialPath:b.path})},ns=async b=>{if(!q)return;const{mode:G,sourceKey:ue}=q;try{if(G==="create"){let fe;if(b.templateKey){const Ie=m[b.templateKey];if(!Ie)throw new Error("Selected template no longer exists.");fe={...Ie,name:b.name,path:b.path}}else fe=_l(b.name,b.path);const _e=Al(m,b.name);await P.mutateAsync({blockKey:_e,data:fe}),me.success(`Created "${b.name}"`),y({collection:"pages",key:_e,path:b.path})}else if(G==="duplicate"&&ue){const fe=m[ue];if(!fe)throw new Error("Source page not found");const{key:_e,data:Ie}=El({source:fe,pages:ie,newName:b.name,newPath:b.path});await P.mutateAsync({blockKey:_e,data:Ie}),me.success(`Duplicated as "${b.name}"`),y({collection:"pages",key:_e,path:b.path})}else if(G==="rename"&&ue){const fe=m[ue];if(!fe)throw new Error("Page not found");const _e={...fe,name:b.name,path:b.path};await P.mutateAsync({blockKey:ue,data:_e}),me.success("Page updated"),g?.collection==="pages"&&g.key===ue&&y({collection:"pages",key:ue,path:b.path})}X(null)}catch(fe){ne(fe instanceof Error?fe.message:"Save failed")}},os=({path:b})=>{if(!q)return null;const G=It(b);return(q.mode==="rename"?It(q.initialPath):null)!==G&&ge.has(G)?`A page with path "${b}" already exists.`:null},as=async(b,G,ue)=>{await P.mutateAsync({blockKey:G,data:{...ue,name:G,__resolveType:b}}),me.success(r("sandbox.contentBrowser.createdSection",{name:G})),y({collection:"sections",key:G})},At=Rn((b,G)=>P.mutate({blockKey:b,data:G})),ls=async b=>{const G=m[b.key];if(!G){me.error(r("sandbox.contentBrowser.sectionNotFound"));return}const ue=Bl(m,b.key),fe=Js(Le,b.name),_e={...G,name:fe};try{await P.mutateAsync({blockKey:ue,data:_e}),me.success(r("sandbox.contentBrowser.duplicatedSection",{name:b.name})),y({collection:"sections",key:ue})}catch(Ie){me.error(Ie instanceof Error?Ie.message:r("sandbox.contentBrowser.duplicateFailed"))}},is=async b=>{if(!C)return;const G=m[C];if(!G){me.error(r("sandbox.contentBrowser.sectionNotFound"));return}try{await P.mutateAsync({blockKey:C,data:{...G,name:b}}),me.success(r("sandbox.contentBrowser.sectionRenamed")),J(null)}catch(ue){me.error(ue instanceof Error?ue.message:r("sandbox.contentBrowser.renameFailed"))}},T=()=>{le(void 0),te(!0)},Q=async b=>{const G=$a(m,b.from),ue=La(b);try{await P.mutateAsync({blockKey:G,data:ue}),me.success("Created redirect"),te(!1),y({collection:"redirects",key:G})}catch(fe){le(fe instanceof Error?fe.message:"Could not create redirect")}},Te=async b=>{const G=ps(m,b),ue=it(G,b,ao(b));try{await P.mutateAsync({blockKey:G,data:ue}),me.success(`Created ${Pt[b]}`),y({collection:b,key:G})}catch(fe){me.error(fe instanceof Error?fe.message:"Could not create")}},Ve=async b=>{const G=ps(m,"posts"),ue=it(G,"posts",Si(b));try{await P.mutateAsync({blockKey:G,data:ue}),me.success(r("sandbox.postCalendar.createdScheduledPost")),x("posts"),F("posts"),y({collection:"posts",key:G}),j(null)}catch(fe){me.error(fe instanceof Error?fe.message:r("sandbox.postCalendar.couldNotCreate"))}},Je=async(b,G)=>{const ue=m[b],fe=ue?wi(mt(ue,"posts"),G):null;if(!fe){me.error(r("sandbox.postCalendar.onlyScheduledCanMove"));return}try{await P.mutateAsync({blockKey:b,data:it(b,"posts",fe)})}catch(_e){me.error(_e instanceof Error?_e.message:r("sandbox.postCalendar.couldNotReschedule"))}},Ee=async b=>{const G=m[b.key];if(!G){me.error("Record not found.");return}const ue=ps(m,b.kind),fe=b.kind==="posts"?"title":"name",_e={...structuredClone(mt(G,b.kind)),[fe]:`${b.label} (copy)`};try{await P.mutateAsync({blockKey:ue,data:it(ue,b.kind,_e)}),me.success(`Duplicated "${b.label}"`),y({collection:b.kind,key:ue})}catch(Ie){me.error(Ie instanceof Error?Ie.message:"Duplicate failed")}},yt=()=>{x("posts"),F("posts"),y(null),j(null),k("")},Ue=async()=>{if(Z)try{const{kind:b,key:G,label:ue}=Z;if(b==="blog"){if(Z.blogKind==="categories"){const fe=mt(m[G],"categories").slug,_e=typeof fe=="string"?fe:"";if(_e)for(const{key:Ie,payload:Os}of Ge(m,"posts")){const Is=ei(Os,_e);Is!==Os&&await P.mutateAsync({blockKey:Ie,data:it(Ie,"posts",ti(Is))})}}await U.mutateAsync({blockKey:G})}else await U.mutateAsync({blockKey:G});me.success(`Deleted "${ue}"`),g&&g.collection!=="available-section"&&g.key===G&&y(null),oe(null)}catch(b){me.error(b instanceof Error?b.message:"Delete failed")}},at=U.isPending||P.isPending,rs=Z?.kind==="blog"?Pt[Z.blogKind]:Z?.kind??"item";return n.jsxs("div",{className:"flex h-full w-full",children:[n.jsx(Sl,{active:f,counts:De,showBlog:Se,onSelect:b=>{x(b),y(null),j(null)}}),f!=="seo"&&f!=="site"&&f!=="context"&&f!=="calendar"&&f!=="post-schedule"&&f!=="posts"&&f!=="loaders"&&f!=="actions"&&n.jsx(uc,{activeCollection:f,pages:ie,redirects:ye,sections:pe,availableSections:ke,appCatalog:V,appCatalogLoading:z,blogEntries:Ae,decofile:m,searchQuery:B,onSearchChange:k,selection:g,onSelect:L,onCreate:()=>{f==="pages"?ve():f==="redirects"?T():lt(f)&&Te(f)},onDuplicatePage:Ne,onRenamePage:Oe,onAddPageVariant:M,onDeletePage:b=>oe({kind:"page",key:b.key,label:b.name}),onEditPageSeo:b=>{const G={collection:"pages",key:b.key,path:b.path};y(G),j(b.key)},onViewPageJson:b=>se(b.key),onDuplicateSection:ls,onRenameSection:b=>J(b.key),onDeleteSection:b=>oe({kind:"section",key:b.key,label:b.name}),onDeleteRedirect:b=>oe({kind:"redirect",key:b.key,label:b.from||b.key}),onDuplicateBlog:Ee,onDeleteBlog:b=>oe({kind:"blog",blogKind:b.kind,key:b.key,label:b.label})}),n.jsx("div",{className:"flex-1 min-w-0",children:f==="loaders"||f==="actions"?n.jsx(Lr,{orgSlug:t,virtualMcpId:e,branch:s,previewUrl:o,meta:_,decofile:m,kind:f}):n.jsx($.Suspense,{fallback:n.jsx("div",{className:"h-full flex items-center justify-center",children:n.jsx(rt,{className:"size-5 text-muted-foreground"})}),children:f==="calendar"?n.jsx(ac,{decofile:m}):f==="post-schedule"?n.jsx(lc,{decofile:m,support:W,isCreating:P.isPending,onCreate:b=>{Ve(b)},onReschedule:(b,G)=>{Je(b,G)},onSelect:b=>{x("posts"),F("posts"),y({collection:"posts",key:b}),j(null)}}):f==="site"?he?n.jsx(bn,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:he.key,block:m[he.key],decofile:m,meta:_,title:"Site",excludeFields:["seo"],schemaPending:R(he.resolveType,["seo"]),previewBaseUrl:o},`site:${he.key}`):n.jsx(st,{title:"Site settings not found",description:"This project doesn't have a site app block (site/apps/site.ts)."}):f==="context"?n.jsx(dl,{title:r("sandbox.blogContext.soonTitle"),description:r("sandbox.blogContext.soonDescription"),children:n.jsx(tc,{orgSlug:t,virtualMcpId:e,branch:s,decofile:m,meta:_,onOpenPost:b=>{x("posts"),F("posts"),y({collection:"posts",key:b}),j(null)},onManageCategoryPosts:()=>{x("posts"),F("posts"),y(null),j(null)}})}):f==="seo"?n.jsx(oc,{orgSlug:t,virtualMcpId:e,branch:s,decofile:m,meta:_,target:{kind:"site"},previewBaseUrl:a}):f==="sections"?n.jsx(Wr,{selection:g?.collection==="sections"||g?.collection==="available-section"?g:null,orgSlug:t,virtualMcpId:e,branch:s,previewUrl:o,meta:_,decofile:m,isCreating:P.isPending,onCreateAvailable:as,onSaveReferencedBlock:At}):f==="posts"?n.jsx(wr,{orgSlug:t,virtualMcpId:e,branch:s,decofile:m,view:D,selectedKey:g?.collection==="posts"?g.key:null,onViewChange:b=>{O(b),y(null)},onClose:()=>y(null),onOpen:b=>{y({collection:"posts",key:b}),j(null)},move:Y,support:W,meta:_,renderDetail:(b,G)=>n.jsx(Zr,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:b,block:m[b],decofile:m,meta:_,previewBaseUrl:a,move:Y,onClose:G?.onClose,expanded:G?.expanded,onToggleExpand:G?.onToggleExpand},`post:${Tt(b)}`)}):g&&g.collection!=="available-section"?g.collection==="apps"?n.jsx(bn,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:g.key,block:m[g.key],decofile:m,meta:_,previewBaseUrl:o,schemaPending:R(typeof m[g.key]?.__resolveType=="string"?String(m[g.key].__resolveType):void 0)},`app:${g.key}`):g.collection==="categories"?n.jsx(sc,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:g.key,block:m[g.key],decofile:m,meta:_,onManagePosts:()=>yt(),onOpenPost:b=>{x("posts"),F("posts"),y({collection:"posts",key:b}),j(null)},previewBaseUrl:a},`category:${g.key}`):g.collection==="authors"?n.jsx(ec,{orgSlug:t,virtualMcpId:e,branch:s,kind:"authors",blockKey:g.key,block:m[g.key]},`authors:${g.key}`):g.collection==="redirects"?n.jsx(ic,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:g.key,block:m[g.key]},`redirect:${g.key}`):n.jsx(nc,{orgSlug:t,virtualMcpId:e,branch:s,previewReady:!0,previewUrl:o??void 0,currentPath:g.collection==="pages"?g.path:"/",activePageBlockKey:g.collection==="pages"?g.key:null,activeGlobalBlockKey:g.collection==="sections"?g.key:null,initialEditSeo:g.collection==="pages"&&v===g.key,onExitSeo:()=>j(null),onSelectRoot:()=>{y(null),j(null)}},g.collection==="pages"?`page:${g.key}`:`section:${g.key}`):n.jsx(st,{title:`Select ${lt(f)?`a ${Pt[f]}`:f==="pages"?"a page":f==="apps"?"an app":f==="redirects"?"a redirect":"a section"} to edit`,description:f==="apps"?"Browse all apps and select an installed one to edit its settings.":'Pick an item from the list, or click "+" to create one.'})})}),q&&n.jsx(Il,{open:!!q,mode:q.mode,initialName:q.initialName,initialPath:q.initialPath,isPending:P.isPending,error:ce,templates:ie,validate:os,onSubmit:ns,onOpenChange:b=>{b||(X(null),ne(void 0))}}),n.jsx(Fl,{open:de,isPending:P.isPending,error:re,onSubmit:Q,onOpenChange:b=>{b||(te(!1),le(void 0))}}),C&&n.jsx(Kl,{open:!!C,blockKey:C,initialName:pe.find(b=>b.key===C)?.name??C,isPending:P.isPending,onSubmit:is,onOpenChange:b=>{b||J(null)}}),S&&n.jsx(Oa,{open:!!S,onOpenChange:b=>{b||se(null)},pageKey:S,decofile:m,onSave:b=>P.mutateAsync({blockKey:S,data:b})}),n.jsx(qo,{open:!!Z,onOpenChange:b=>{!b&&!at&&oe(null)},children:n.jsxs(Jo,{children:[n.jsxs(Wo,{children:[n.jsx(Yo,{children:`Delete ${rs}?`}),n.jsx(Qo,{children:Z?.kind==="section"?`"${Z.label}" will be removed. Pages that still reference it will lose this section.`:Z?`"${Z.label}" will be removed permanently. This can't be undone.`:null})]}),n.jsxs(Xo,{children:[n.jsx(Zo,{disabled:at,children:"Cancel"}),n.jsx(ea,{onClick:b=>{b.preventDefault(),Ue()},disabled:at,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:at?n.jsxs(n.Fragment,{children:[n.jsx(rt,{className:"size-3.5"}),"Deleting…"]}):"Delete"})]})]})})]})}function uc(t){const e=ae.c(57),{activeCollection:s,pages:o,redirects:a,sections:l,availableSections:i,appCatalog:c,appCatalogLoading:r,blogEntries:d,decofile:p,searchQuery:m,onSearchChange:h,selection:u,onSelect:f,onCreate:x,onDuplicatePage:g,onRenamePage:y,onAddPageVariant:v,onDeletePage:j,onEditPageSeo:N,onViewPageJson:w,onDuplicateSection:E,onRenameSection:B,onDeleteSection:k,onDeleteRedirect:D,onDuplicateBlog:O,onDeleteBlog:L}=t;let K,F,_,A,I,R;if(e[0]!==s||e[1]!==c||e[2]!==r||e[3]!==i||e[4]!==d||e[5]!==p||e[6]!==v||e[7]!==x||e[8]!==L||e[9]!==j||e[10]!==D||e[11]!==k||e[12]!==O||e[13]!==g||e[14]!==E||e[15]!==N||e[16]!==y||e[17]!==B||e[18]!==h||e[19]!==f||e[20]!==w||e[21]!==o||e[22]!==a||e[23]!==m||e[24]!==l||e[25]!==u){const P=m.toLowerCase(),U=o.filter(S=>!P||S.name.toLowerCase().includes(P)||S.path.toLowerCase().includes(P)),Y=a.filter(S=>!P||S.from.toLowerCase().includes(P)||S.to.toLowerCase().includes(P)),q=l.filter(S=>!P||S.name.toLowerCase().includes(P)||S.key.toLowerCase().includes(P)||S.resolveType.toLowerCase().includes(P)),X=i.filter(S=>!P||S.title.toLowerCase().includes(P)||S.resolveType.toLowerCase().includes(P)||(S.description?.toLowerCase().includes(P)??!1)),ce=Xr(q),ne=c.filter(S=>!P||S.title.toLowerCase().includes(P)||S.app.toLowerCase().includes(P)||S.vendor.toLowerCase().includes(P)||S.category.toLowerCase().includes(P)),de=d.filter(S=>!P||S.label.toLowerCase().includes(P)||S.subtitle.toLowerCase().includes(P)),te=`Search ${s}…`,re=lt(s)?`Create new ${Pt[s]}`:s==="redirects"?"Create new redirect":"Create new page",le=s!=="apps"&&s!=="sections";I="shrink-0 border-r flex flex-col min-h-0 w-[300px]";let C;e[32]===Symbol.for("react.memo_cache_sentinel")?(C=n.jsx(An,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),e[32]=C):C=e[32];let J;e[33]!==h?(J=S=>h(S.target.value),e[33]=h,e[34]=J):J=e[34];let Z;e[35]!==te||e[36]!==m||e[37]!==J?(Z=n.jsxs("div",{className:"flex flex-1 items-center gap-2 pl-1",children:[C,n.jsx("input",{type:"text",value:m,onChange:J,placeholder:te,"aria-label":te,className:"w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),e[35]=te,e[36]=m,e[37]=J,e[38]=Z):Z=e[38];let oe;e[39]!==re||e[40]!==x||e[41]!==le?(oe=le&&n.jsxs(Xe,{children:[n.jsx(Ye,{asChild:!0,children:n.jsx(Be,{variant:"ghost",size:"icon",onClick:x,"aria-label":re,children:n.jsx(Ss,{size:14})})}),n.jsx(Qe,{side:"bottom",children:re})]}),e[39]=re,e[40]=x,e[41]=le,e[42]=oe):oe=e[42],e[43]!==Z||e[44]!==oe?(R=n.jsxs("div",{className:"px-2 h-12 flex items-center gap-1 border-b shrink-0",children:[Z,oe]}),e[43]=Z,e[44]=oe,e[45]=R):R=e[45],K=Qt,A="flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",F="flex flex-col gap-1 p-1.5",_=s==="pages"?U.length===0?n.jsx(jt,{hasItems:o.length>0,emptyLabel:"No pages yet.",emptyHint:'Click "+" to create your first page.'}):U.map(S=>{const se=u?.collection==="pages"&&u.key===S.key,H=Kn(p,S.key);return n.jsx(He,{icon:Sn,title:S.name,subtitle:S.path,active:se,variantCount:H,onClick:()=>f({collection:"pages",key:S.key,path:S.path}),menu:n.jsx(Ot,{onDuplicate:()=>g(S),onRename:()=>y(S),onAddVariant:()=>v(S),onEditSeo:()=>N(S),onViewJson:()=>w(S),onDelete:()=>j(S)})},S.key)}):s==="sections"?q.length===0&&X.length===0?n.jsx(jt,{hasItems:l.length>0||i.length>0,emptyLabel:"No sections yet.",emptyHint:"Save a section from a page, or start the preview dev server."}):n.jsxs(n.Fragment,{children:[ce.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(xn,{icon:Mt,label:"Saved sections"}),ce.map(S=>n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx("div",{className:"px-2.5 pt-1 pb-0.5 text-[11px] font-medium uppercase tracking-wide text-muted-foreground/60",children:S.label}),S.sections.map(se=>{const H=u?.collection==="sections"&&u.key===se.key;return n.jsx(He,{icon:Mt,accent:"global",title:se.name,subtitle:S.label,active:H,onClick:()=>f({collection:"sections",key:se.key}),menu:n.jsx(Ot,{onDuplicate:()=>E(se),onRename:()=>B(se),onDelete:()=>k(se)})},se.key)})]},S.label))]}),X.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(xn,{icon:Fs,label:"Available sections",className:xe(ce.length>0&&"mt-3")}),X.map(S=>{const se=u?.collection==="available-section"&&u.resolveType===S.resolveType,H=S.resolveType.split("/").pop()?.replace(/\.tsx?$/,"");return n.jsx(He,{icon:Fs,title:S.title,subtitle:H??S.resolveType,active:se,onClick:()=>f({collection:"available-section",resolveType:S.resolveType,title:S.title})},S.resolveType)})]})]}):s==="apps"?r?n.jsx("div",{className:"flex items-center justify-center py-8",children:n.jsx(rt,{className:"size-4.5 text-muted-foreground"})}):ne.length===0?n.jsx(jt,{hasItems:c.length>0,emptyLabel:"No apps found.",emptyHint:"Try a different search term."}):ne.map(S=>{const se=u?.collection==="apps"&&S.blockKey!==null&&u.key===S.blockKey;return n.jsx(He,{icon:Dn,logoUrl:S.logo,title:S.title,subtitle:S.category,active:se,trailing:S.installed?n.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(!S.installed||!S.blockKey){me.message(`${S.title} is not installed on this site.`);return}f({collection:"apps",key:S.blockKey})}},S.id)}):s==="redirects"?Y.length===0?n.jsx(jt,{hasItems:a.length>0,emptyLabel:"No redirects yet.",emptyHint:'Click "+" to create your first redirect.'}):Y.map(S=>n.jsx(He,{icon:Nn,title:S.from||"(no source)",subtitle:`→ ${S.to||"(no target)"}`,active:u?.collection==="redirects"&&u.key===S.key,trailing:n.jsx(zl,{type:S.type}),onClick:()=>f({collection:"redirects",key:S.key}),menu:n.jsx(Ot,{onDelete:()=>D(S)})},S.key)):de.length===0?n.jsx(jt,{hasItems:d.length>0,emptyLabel:`No ${s} yet.`,emptyHint:`Click "+" to create your first ${lt(s)?Pt[s]:"item"}.`}):de.map(S=>{const se=u?.collection===S.kind&&u.key===S.key;return n.jsx(He,{icon:S.kind==="posts"?_n:S.kind==="authors"?$n:Cn,title:S.label,subtitle:S.subtitle,active:se,onClick:()=>f({collection:S.kind,key:S.key}),menu:n.jsx(Ot,{onDuplicate:()=>O(S),onDelete:()=>L(S)})},S.key)}),e[0]=s,e[1]=c,e[2]=r,e[3]=i,e[4]=d,e[5]=p,e[6]=v,e[7]=x,e[8]=L,e[9]=j,e[10]=D,e[11]=k,e[12]=O,e[13]=g,e[14]=E,e[15]=N,e[16]=y,e[17]=B,e[18]=h,e[19]=f,e[20]=w,e[21]=o,e[22]=a,e[23]=m,e[24]=l,e[25]=u,e[26]=K,e[27]=F,e[28]=_,e[29]=A,e[30]=I,e[31]=R}else K=e[26],F=e[27],_=e[28],A=e[29],I=e[30],R=e[31];let V;e[46]!==F||e[47]!==_?(V=n.jsx("div",{className:F,children:_}),e[46]=F,e[47]=_,e[48]=V):V=e[48];let z;e[49]!==K||e[50]!==A||e[51]!==V?(z=n.jsx(K,{className:A,children:V}),e[49]=K,e[50]=A,e[51]=V,e[52]=z):z=e[52];let W;return e[53]!==I||e[54]!==R||e[55]!==z?(W=n.jsxs("div",{className:I,children:[R,z]}),e[53]=I,e[54]=R,e[55]=z,e[56]=W):W=e[56],W}function mc(t){const e=ae.c(25),{virtualMcpId:s}=t,o=we(),[a,l]=$.useState(!1),i=ol(s),{activeTask:c}=kn();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},e[0]=r):r=e[0];const d=jn(r);if(!(Hs(i?.metadata)||Hs(c?.metadata))){let h;e[1]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx("div",{className:"flex size-14 items-center justify-center rounded-full bg-muted",children:n.jsx(qs,{className:"size-7 text-foreground"})}),e[1]=h):h=e[1];let u;e[2]!==o?(u=o("mainPanelTabs.contentTab.noContentToEdit"),e[2]=o,e[3]=u):u=e[3];let f;e[4]!==o?(f=o("mainPanelTabs.contentTab.connectGithubDescription"),e[4]=o,e[5]=f):f=e[5];let x,g;e[6]===Symbol.for("react.memo_cache_sentinel")?(x=()=>l(!0),g=n.jsx(qs,{className:"size-4"}),e[6]=x,e[7]=g):(x=e[6],g=e[7]);let y;e[8]!==o?(y=o("mainPanelTabs.previewTab.connectGithub"),e[8]=o,e[9]=y):y=e[9];let v;e[10]!==y?(v=n.jsxs(Be,{onClick:x,children:[g,y]}),e[10]=y,e[11]=v):v=e[11];let j;e[12]!==u||e[13]!==f||e[14]!==v?(j=n.jsx(il,{className:"h-full",image:h,title:u,description:f,actions:v}),e[12]=u,e[13]=f,e[14]=v,e[15]=j):j=e[15];let N;e[16]!==a?(N=n.jsx(rl,{open:a,onOpenChange:l,mode:"agent"}),e[16]=a,e[17]=N):N=e[17];let w;return e[18]!==N||e[19]!==j?(w=n.jsxs(n.Fragment,{children:[j,N]}),e[18]=N,e[19]=j,e[20]=w):w=e[20],w}let m;return e[21]!==d.contentPageId||e[22]!==d.contentPath||e[23]!==d.contentPathTemplate?(m=n.jsx(rc,{deepLinkPage:{pageId:d.contentPageId,path:d.contentPath,pathTemplate:d.contentPathTemplate}}),e[21]=d.contentPageId,e[22]=d.contentPath,e[23]=d.contentPathTemplate,e[24]=m):m=e[24],m}function fc(){const t=ae.c(2),e=cl();let s;return t[0]!==e?(s=n.jsx(Ao,{tabId:"content",children:n.jsx($o,{feature:"cms",children:n.jsx(mc,{virtualMcpId:e})})}),t[0]=e,t[1]=s):s=t[1],s}const $d=Object.freeze(Object.defineProperty({__proto__:null,default:fc},Symbol.toStringTag,{value:"Module"}));export{vo as $,Td as A,Ds as B,bd as C,gd as D,Pd as E,Ed as F,Xn as G,uo as H,Vi as I,Zs as J,xi as K,hd as L,ps as M,ao as N,fd as O,_s as P,vd as Q,Bd as R,jd as S,_d as T,Sd as U,pt as V,Nd as W,kd as X,yd as Y,wd as Z,qt as _,md as a,$d as a0,ss as b,ti as c,Cd as d,ud as e,Ge as f,mt as g,Wt as h,Dd as i,ii as j,Ad as k,to as l,Es as m,Bl as n,lo as o,Dt as p,it as q,ml as r,be as s,mo as t,Fi as u,Ke as v,pi as w,pd as x,xd as y,Me as z};