decocms 4.514.6 → 4.515.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 (466) hide show
  1. package/dist/client/assets/ActiveShapeUtils-CHmxGMIj.js +1 -0
  2. package/dist/client/assets/{AlertCircle-Ctbquk5a.js → AlertCircle-CUAx3A4b.js} +1 -1
  3. package/dist/client/assets/AreaChart-CW0Iiw9b.js +1 -0
  4. package/dist/client/assets/{ArrowLeft-DZ0mAFgb.js → ArrowLeft-BWCsylYe.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-bYg1aEOe.js → ArrowUp-EL0FBv9C.js} +1 -1
  6. package/dist/client/assets/BarChart-7G_lP-bc.js +1 -0
  7. package/dist/client/assets/{Building02-BHIVlbfK.js → Building02-PifDTlhb.js} +1 -1
  8. package/dist/client/assets/CartesianChart-CQlacwEw.js +1 -0
  9. package/dist/client/assets/{CategoricalChart-CRSSpo7X.js → CategoricalChart-QwBn7EzX.js} +2 -2
  10. package/dist/client/assets/{CheckCircle-C2ndOEUO.js → CheckCircle-CMGqXocs.js} +1 -1
  11. package/dist/client/assets/{ChevronSelectorVertical-DaUdbCWk.js → ChevronSelectorVertical-BSRBjpBn.js} +1 -1
  12. package/dist/client/assets/{ChevronUp-C8mqlnDX.js → ChevronUp-x46FJEcD.js} +1 -1
  13. package/dist/client/assets/{Copy01-DC8f0fwU.js → Copy01-OBSYmimV.js} +1 -1
  14. package/dist/client/assets/{CreditCard01-P7j8oDkg.js → CreditCard01-DWsSThAm.js} +1 -1
  15. package/dist/client/assets/{DotsVertical-BvwGTDkC.js → DotsVertical-jkvtcdek.js} +1 -1
  16. package/dist/client/assets/{ErrorBarContext-KwnilJkg.js → ErrorBarContext-MNRbBKZp.js} +1 -1
  17. package/dist/client/assets/{Globe04-D6C-ihBU.js → Globe04-blkS_Kfg.js} +1 -1
  18. package/dist/client/assets/{Image01-D7F4wuKx.js → Image01-BCnLFq1D.js} +1 -1
  19. package/dist/client/assets/{Key01-u4HXXUPa.js → Key01-CG7Kua6O.js} +1 -1
  20. package/dist/client/assets/{Link01-BoUupQbW.js → Link01-8aKNfNRw.js} +1 -1
  21. package/dist/client/assets/{LinkBroken01-BJx0R97x.js → LinkBroken01-DcsqjBuj.js} +1 -1
  22. package/dist/client/assets/{Minus-C1PMcNV0.js → Minus-B38cW2ZC.js} +1 -1
  23. package/dist/client/assets/{Monitor01-D3VwU2ni.js → Monitor01-DQEkUL3d.js} +1 -1
  24. package/dist/client/assets/{Play-DxsFk4r2.js → Play-Ns9aRVTY.js} +1 -1
  25. package/dist/client/assets/{Plus-BDveVGJf.js → Plus-vkM1FxVr.js} +1 -1
  26. package/dist/client/assets/ReferenceLine-CJq91vhq.js +1 -0
  27. package/dist/client/assets/{SearchMd-Cuf45jFP.js → SearchMd-Cp6J-1Iu.js} +1 -1
  28. package/dist/client/assets/Sector-BeXkYaJv.js +28 -0
  29. package/dist/client/assets/{ShoppingBag01-BMRnsG58.js → ShoppingBag01-aJuRSlBz.js} +1 -1
  30. package/dist/client/assets/{Sun-sKGpeIhM.js → Sun-k4hypx5Q.js} +1 -1
  31. package/dist/client/assets/{SwitchHorizontal01-CshMTQzi.js → SwitchHorizontal01-B5WFt7_0.js} +1 -1
  32. package/dist/client/assets/{Tool01-BM29_KWq.js → Tool01-BsK9c3-e.js} +1 -1
  33. package/dist/client/assets/{Trash01-D92WhXf2.js → Trash01-Z1ezoy3S.js} +1 -1
  34. package/dist/client/assets/{Upload01-BSDy4f7m.js → Upload01-B3-nlnKa.js} +1 -1
  35. package/dist/client/assets/{User01-Cn3JqTjv.js → User01-C2Sw39bs.js} +1 -1
  36. package/dist/client/assets/{UserSquare-Drp4z0v0.js → UserSquare-BBEl_BxL.js} +1 -1
  37. package/dist/client/assets/{Users01-Cxbx87gg.js → Users01-DMFeioyM.js} +1 -1
  38. package/dist/client/assets/{XClose-dOW_RI9u.js → XClose-BdwIxxCT.js} +1 -1
  39. package/dist/client/assets/{ZoomOut-BfQx-fBr.js → ZoomOut-DytgoG2i.js} +1 -1
  40. package/dist/client/assets/{access-gate-BjUA5Gw_.js → access-gate-BUnHIPK_.js} +1 -1
  41. package/dist/client/assets/{add-connection-dialog-B0vtW1sl.js → add-connection-dialog-F6QQAEZv.js} +1 -1
  42. package/dist/client/assets/agent-analytics-2BuaXhJ4.js +2 -0
  43. package/dist/client/assets/agent-app-DW_869sy.js +1 -0
  44. package/dist/client/assets/agent-assets-CPVwuId5.js +1 -0
  45. package/dist/client/assets/{agent-automation-Cc45Az0m.js → agent-automation-CKRFKK95.js} +1 -1
  46. package/dist/client/assets/agent-automations-CoXmwt9k.js +1 -0
  47. package/dist/client/assets/agent-calendar-CV9Ef0wP.js +1 -0
  48. package/dist/client/assets/{agent-connect-sources-mK6fw0FS.js → agent-connect-sources-B_bS144d.js} +1 -1
  49. package/dist/client/assets/agent-deck-OUciFfON.js +1 -0
  50. package/dist/client/assets/agent-e2e-DC8ADnZZ.js +1 -0
  51. package/dist/client/assets/agent-experiments-BwjYQ0V4.js +1 -0
  52. package/dist/client/assets/agent-file-CStNgNPQ.js +1 -0
  53. package/dist/client/assets/agent-hosting-Tr8uV5DY.js +1 -0
  54. package/dist/client/assets/{agent-icon-U4gZaLOQ.js → agent-icon--EtIPqub.js} +1 -1
  55. package/dist/client/assets/agent-library-Bf2YaEvb.js +1 -0
  56. package/dist/client/assets/agent-library-file-DAttgEac.js +1 -0
  57. package/dist/client/assets/agent-monitor-DIe6BVqe.js +1 -0
  58. package/dist/client/assets/{agent-overview-NPCMkyDB.js → agent-overview-popLuSBk.js} +1 -1
  59. package/dist/client/assets/agent-releases-CZVpd2dN.js +2 -0
  60. package/dist/client/assets/agent-settings-C6L22aS3.js +1 -0
  61. package/dist/client/assets/agent-site-editor-BML41A1E.js +16 -0
  62. package/dist/client/assets/agent-site-editor-code-Dnn-bhoB.js +2 -0
  63. package/dist/client/assets/agent-site-editor-content-Bt6vrV5b.js +1 -0
  64. package/dist/client/assets/agent-site-editor-preview-q3wCu8-N.js +1 -0
  65. package/dist/client/assets/agent-view-B1o861lr.js +1 -0
  66. package/dist/client/assets/{agent-view-guard-Bk4OTT2f.js → agent-view-guard-BuPewEB-.js} +1 -1
  67. package/dist/client/assets/{agents-list-B_j46cpj.js → agents-list-BxOpJ6GX.js} +1 -1
  68. package/dist/client/assets/{ai-providers-Cb4AWs2D.js → ai-providers-BgJW78yt.js} +2 -2
  69. package/dist/client/assets/alert-BDbwlXZm.js +1 -0
  70. package/dist/client/assets/{alert-dialog-CKDHmJ-l.js → alert-dialog-C-DaggA1.js} +3 -3
  71. package/dist/client/assets/analytics-sections-i9-JccxC.js +1 -0
  72. package/dist/client/assets/{api-keys-Xjw7lgqR.js → api-keys-CsGvnzMj.js} +1 -1
  73. package/dist/client/assets/api-keys-DfU9uedt.js +1 -0
  74. package/dist/client/assets/app-editor-Cq-B0QFL.js +1 -0
  75. package/dist/client/assets/{asset-utils-DrTFUoo_.js → asset-utils-Cb8p2lKk.js} +1 -1
  76. package/dist/client/assets/{auth-hgpoCSIS.js → auth-C_nDagDA.js} +1 -1
  77. package/dist/client/assets/{auth-catchall-CIV9IiTJ.js → auth-catchall-DLKOtnms.js} +1 -1
  78. package/dist/client/assets/{auth-entry-ctrK7teX.js → auth-entry-CGuqEb3C.js} +1 -1
  79. package/dist/client/assets/{auth-split-layout-DkyooQGo.js → auth-split-layout-CA_lMCib.js} +1 -1
  80. package/dist/client/assets/{authenticate-and-persist-oauth-jn1R1qId.js → authenticate-and-persist-oauth-CpcQdSQ-.js} +1 -1
  81. package/dist/client/assets/automation-list-row-B0U8Omed.js +1 -0
  82. package/dist/client/assets/{automation-runs-C367-v6a.js → automation-runs-CHS-S7AU.js} +1 -1
  83. package/dist/client/assets/{automations-8JKgpNEK.js → automations-BMiuIrti.js} +1 -1
  84. package/dist/client/assets/{autosend-BZOm698U.js → autosend-xoWUmECR.js} +1 -1
  85. package/dist/client/assets/{avatar-RpIBVCkY.js → avatar-DHKJiyOX.js} +1 -1
  86. package/dist/client/assets/badge-ux-RK1YK.js +1 -0
  87. package/dist/client/assets/{block-document-baEM6UJG.js → block-document-C53UA67Y.js} +3 -3
  88. package/dist/client/assets/{blocks-preview-workspace-context-Ca46yWEV.js → blocks-preview-workspace-context-CCLLqfhM.js} +1 -1
  89. package/dist/client/assets/blocks-tab-states-Chq5j0oT.js +1 -0
  90. package/dist/client/assets/blog-schema-CUXWCb3x.js +1 -0
  91. package/dist/client/assets/{buckets-p2Fiyc0f.js → buckets-KXy-OHx-.js} +1 -1
  92. package/dist/client/assets/{build-improve-prompt-doc-ClmcYJRa.js → build-improve-prompt-doc-7EW1ZAui.js} +1 -1
  93. package/dist/client/assets/{calendar-DqVFnL9A.js → calendar-qN6CeKGa.js} +1 -1
  94. package/dist/client/assets/campaigns-view-CwEmfYeP.js +1 -0
  95. package/dist/client/assets/{capability-load-error-DdN4o47w.js → capability-load-error-CoMXa4ni.js} +1 -1
  96. package/dist/client/assets/category-editor-C-13e8GC.js +1 -0
  97. package/dist/client/assets/{chart-B5vy2nis.js → chart-86pPxb3F.js} +1 -1
  98. package/dist/client/assets/{chat-context-_d3c57p1.js → chat-context-DXm8btNS.js} +6 -6
  99. package/dist/client/assets/{chat-draft-CKcHhXuF.js → chat-draft-WGnppXw7.js} +1 -1
  100. package/dist/client/assets/{checkbox-CUzk21sc.js → checkbox-vFQy8MvV.js} +1 -1
  101. package/dist/client/assets/{choose-editor-BFcNvSv4.js → choose-editor-Bry8-aop.js} +1 -1
  102. package/dist/client/assets/{cli-auth-success-BolfyrKO.js → cli-auth-success-BM0cUkz3.js} +1 -1
  103. package/dist/client/assets/{client-icons-50FpZDWK.js → client-icons-M2pakr5u.js} +1 -1
  104. package/dist/client/assets/cms-settings-editor-CHoKFct5.js +1 -0
  105. package/dist/client/assets/{collapsible-CeBZpglT.js → collapsible-CnlVGt-G.js} +1 -1
  106. package/dist/client/assets/collection-detail-B_r2Oxl1.js +1 -0
  107. package/dist/client/assets/{collection-display-button-El-xnsaW.js → collection-display-button-ALXFDy_R.js} +1 -1
  108. package/dist/client/assets/{collection-search-gW4FCqmq.js → collection-search--9d0M5sc.js} +1 -1
  109. package/dist/client/assets/{collection-table-wrapper-CB0t7kAl.js → collection-table-wrapper-DyQ4WIpY.js} +1 -1
  110. package/dist/client/assets/{collection-tabs-DIFXv7hR.js → collection-tabs-BfpnVdlQ.js} +1 -1
  111. package/dist/client/assets/{column-rules-o-DlIK_-.js → column-rules-DgVqSNU2.js} +1 -1
  112. package/dist/client/assets/{combobox-DlpsfK7m.js → combobox-BMxhMbUn.js} +1 -1
  113. package/dist/client/assets/{coming-soon-page-ZTZUbFgV.js → coming-soon-page-6F4aAL8E.js} +1 -1
  114. package/dist/client/assets/{command-C7n5qLsN.js → command-BlBQgQPI.js} +1 -1
  115. package/dist/client/assets/{companion-mcps-section-C2rDEgkL.js → companion-mcps-section-B3EkkVtL.js} +1 -1
  116. package/dist/client/assets/{config-BCpfsSBB.js → config-CE3I8pu5.js} +1 -1
  117. package/dist/client/assets/{connect-Du_rXIM1.js → connect-C4NhmEFJ.js} +3 -3
  118. package/dist/client/assets/{connect-layout-DyGwITyt.js → connect-layout-DZGJCEON.js} +1 -1
  119. package/dist/client/assets/{connection-Dik4epzq.js → connection-Bo3v2rj5.js} +1 -1
  120. package/dist/client/assets/{connection-card-DCnmTKpJ.js → connection-card-DMfcnulT.js} +1 -1
  121. package/dist/client/assets/{connection-detail-CaTyUBlA.js → connection-detail-DxSeFIwH.js} +1 -1
  122. package/dist/client/assets/{connection-form-helpers-ta2yIvIb.js → connection-form-helpers-A3QfJozi.js} +1 -1
  123. package/dist/client/assets/{connections-Dy2qa1bG.js → connections-DzbvhEpV.js} +1 -1
  124. package/dist/client/assets/content-tab-CaoAhPSw.js +22 -0
  125. package/dist/client/assets/context-0XuHSild.js +1 -0
  126. package/dist/client/assets/{context-menu-BUZj1ZG7.js → context-menu-BD833dh0.js} +1 -1
  127. package/dist/client/assets/{context-shell-CWF9i3Vt.js → context-shell-D1uT0vY1.js} +3 -3
  128. package/dist/client/assets/{core.esm-DNra8pgf.js → core.esm-DJ5llHMe.js} +1 -1
  129. package/dist/client/assets/{create-organization-dialog-BkJvAp86.js → create-organization-dialog-nhhaUNZK.js} +1 -1
  130. package/dist/client/assets/{daily-pulse-DYjhyf3I.js → daily-pulse-Cry9rVi8.js} +1 -1
  131. package/dist/client/assets/date-utils-CrvIKg-s.js +1 -0
  132. package/dist/client/assets/{discover-nnC5Qnas.js → discover-C4Up8V0-.js} +1 -1
  133. package/dist/client/assets/{domain-settings-CpxFWOzU.js → domain-settings-Bec9kB9d.js} +1 -1
  134. package/dist/client/assets/{drawer-ZlYTI3Z6.js → drawer-0sYDH2mt.js} +1 -1
  135. package/dist/client/assets/{editor-BFHySd1K.js → editor-BctLuJLS.js} +1 -1
  136. package/dist/client/assets/{editor-classes-DPi5BWR5.js → editor-classes-BnPaf--r.js} +1 -1
  137. package/dist/client/assets/{empty-state-Bok1L2hc.js → empty-state-D6RWdvUz.js} +1 -1
  138. package/dist/client/assets/{empty-state-Cu20Qj3-.js → empty-state-DeArX05X.js} +1 -1
  139. package/dist/client/assets/experiments-tab-choice-CMHPX5ZC.js +1 -0
  140. package/dist/client/assets/{extract-connection-data-CNLani4P.js → extract-connection-data-CBAyhzk-.js} +1 -1
  141. package/dist/client/assets/{feature-gate-dfnyrtcC.js → feature-gate-DQ0ZaDj1.js} +1 -1
  142. package/dist/client/assets/{feature-paywall-D-GfxA1X.js → feature-paywall-hsFyGLR_.js} +1 -1
  143. package/dist/client/assets/{file-explorer-DOlx1A5r.js → file-explorer-GrzeifA-.js} +1 -1
  144. package/dist/client/assets/{file-preview-DSIiiWjA.js → file-preview-Bcawxb03.js} +1 -1
  145. package/dist/client/assets/{file-share-button-CB7fcIJI.js → file-share-button-LmGmSS33.js} +2 -2
  146. package/dist/client/assets/{file-type-icon-DPqHd815.js → file-type-icon-DHFVwXjA.js} +1 -1
  147. package/dist/client/assets/{folder-icon-qexQSaYN.js → folder-icon-BwmfzM1C.js} +2 -2
  148. package/dist/client/assets/{form-Dpwt-9St.js → form-D4PspedZ.js} +1 -1
  149. package/dist/client/assets/{general-DJuGMWNv.js → general-CXfgWejD.js} +1 -1
  150. package/dist/client/assets/{home-D9ErGwHG.js → home-DkYJf0RN.js} +1 -1
  151. package/dist/client/assets/hosted-publish-api-CK3ZnEoi.js +1 -0
  152. package/dist/client/assets/hosted-publish-feedback-BG4t8HgW.js +1 -0
  153. package/dist/client/assets/{icon-button-CwrVRVUS.js → icon-button-HZwQKD3a.js} +1 -1
  154. package/dist/client/assets/{index-BpRXpcv4.js → index-B32YFtAw.js} +1 -1
  155. package/dist/client/assets/{index-DK4LlU65.js → index-BCHFFeZZ.js} +1 -1
  156. package/dist/client/assets/{index-DzppA2EQ.js → index-BeV3dEoK.js} +3 -3
  157. package/dist/client/assets/{index-DUXVtfV1.js → index-BjrJaWD9.js} +1 -1
  158. package/dist/client/assets/{index-DPulqOQn.js → index-Bxkd37dZ.js} +1 -1
  159. package/dist/client/assets/{index-2uBqLA9S.js → index-CafY8AgN.js} +6 -6
  160. package/dist/client/assets/{index-DJM5MV7l.js → index-CgVQmSg0.js} +1 -1
  161. package/dist/client/assets/{index-TNsA6rsO.js → index-CvMuyNgv.js} +1 -1
  162. package/dist/client/assets/{index-C9OgV5Vt.js → index-DNa7Epd0.js} +1 -1
  163. package/dist/client/assets/{index-BWUABroT.js → index-D_6gfRTQ.js} +1 -1
  164. package/dist/client/assets/{index-DLuP-oy3.js → index-DgfcOEet.js} +1 -1
  165. package/dist/client/assets/index-EoMx4WDO.css +1 -0
  166. package/dist/client/assets/index-XzZeDzj0.js +4 -0
  167. package/dist/client/assets/{index-Cd_jqW-G.js → index-gqp4B5qj.js} +1 -1
  168. package/dist/client/assets/{index-CaH7O3hJ.js → index-ifZGovK1.js} +54 -54
  169. package/dist/client/assets/{index-CJu3ft8V.js → index-j4NUsiRT.js} +1 -1
  170. package/dist/client/assets/{index-redirect-CLzDU0fe.js → index-redirect-BKvfBlvA.js} +1 -1
  171. package/dist/client/assets/{infiniteQueryObserver-u-Zd7Oxq.js → infiniteQueryObserver-DvmMaiCa.js} +1 -1
  172. package/dist/client/assets/infra-billing-WLIR9CQb.js +1 -0
  173. package/dist/client/assets/{input-DN6U5jAj.js → input-BeDIlaby.js} +1 -1
  174. package/dist/client/assets/{input-D2sd1bar.js → input-DIcILgWd.js} +7 -7
  175. package/dist/client/assets/{integration-icon-DCiBepJw.js → integration-icon-D1aQLe0v.js} +1 -1
  176. package/dist/client/assets/{jira-icon-DoiJbCfx.js → jira-icon-Bs7EGbwb.js} +1 -1
  177. package/dist/client/assets/{label-Cnc4HQwP.js → label-Dhoh3DcI.js} +1 -1
  178. package/dist/client/assets/{layout-BVW5q62A.js → layout-dz9-bhT2.js} +1 -1
  179. package/dist/client/assets/{legacy-agents-deep-DMfsC9-u.js → legacy-agents-deep-DO-8kywe.js} +1 -1
  180. package/dist/client/assets/legacy-main-redirect-BMyuR4az.js +1 -0
  181. package/dist/client/assets/library-BQ9URfiH.js +1 -0
  182. package/dist/client/assets/{login-CN9ueiIT.js → login-DwOQDvQC.js} +1 -1
  183. package/dist/client/assets/{markdown-CA3yd3L6.js → markdown-prFeEkT4.js} +1 -1
  184. package/dist/client/assets/{mcp-app-renderer-Xaw0krD3.js → mcp-app-renderer-fHjuxWIZ.js} +1 -1
  185. package/dist/client/assets/{mcp-oauth-3Gakbc_U.js → mcp-oauth-CNKUkWMd.js} +1 -1
  186. package/dist/client/assets/{mcp-oauth-CxgfM8zh.js → mcp-oauth-CTJ5Iw4i.js} +1 -1
  187. package/dist/client/assets/{members-54kLIghY.js → members-B9Wn7yAF.js} +1 -1
  188. package/dist/client/assets/{memory-CQX6dqQP.js → memory-BDb7_tyh.js} +2 -2
  189. package/dist/client/assets/{mini-report-page-DCq4FNu-.js → mini-report-page-Bsjfan82.js} +1 -1
  190. package/dist/client/assets/{mock-board-CrlDKQvj.js → mock-board-BWfjyR2S.js} +3 -3
  191. package/dist/client/assets/{monaco-editor-C7rmyhBT.js → monaco-editor-Wx_2qGOP.js} +2 -2
  192. package/dist/client/assets/monitoring-BmpcQtwP.js +1 -0
  193. package/dist/client/assets/{monitoring-stats-row-Bhxzz0Gz.js → monitoring-stats-row-THiAXYTp.js} +1 -1
  194. package/dist/client/assets/{multi-select-DtSzZ5RJ.js → multi-select-DOxlfIKk.js} +1 -1
  195. package/dist/client/assets/mustache-BzHjgnm5.js +4 -0
  196. package/dist/client/assets/named-rule-uses-Mu_Msc9v.js +1 -0
  197. package/dist/client/assets/named-rule-view-CN2yeHp5.js +1 -0
  198. package/dist/client/assets/{new-project-dialog-DpHJ0D5s.js → new-project-dialog-DFsG79bb.js} +1 -1
  199. package/dist/client/assets/{oauth-callback-ChXsONZm.js → oauth-callback-BekJkoCF.js} +1 -1
  200. package/dist/client/assets/{oauth-callback-ai-provider-BnJfOlsF.js → oauth-callback-ai-provider-FtcHAH0j.js} +1 -1
  201. package/dist/client/assets/{onboarding-CuSBfoiA.js → onboarding-DNskGrdg.js} +1 -1
  202. package/dist/client/assets/{openai-conversation-B0QRsRtq.js → openai-conversation-_LIGb37e.js} +2 -2
  203. package/dist/client/assets/{optimistic-project-sidebar-views-Cgq6MsN2.js → optimistic-project-sidebar-views-CrYamEqL.js} +1 -1
  204. package/dist/client/assets/order-monitor-day-DLFR-weA.js +1 -0
  205. package/dist/client/assets/{organization-choice-hoXHHizl.js → organization-choice-zGI39_sg.js} +1 -1
  206. package/dist/client/assets/{orgs-CsgsGgsX.js → orgs-BjIQy8J3.js} +1 -1
  207. package/dist/client/assets/page-seo-form-CrgZFHtq.js +1 -0
  208. package/dist/client/assets/{pair-5gOZrfkD.js → pair-Ck7rgrik.js} +7 -7
  209. package/dist/client/assets/parse-sections-YhOUxu7l.js +1 -0
  210. package/dist/client/assets/plan-Iixr6Ywe.js +1 -0
  211. package/dist/client/assets/{plan-ladder-BydnH1hR.js → plan-ladder-BKLU8eo8.js} +1 -1
  212. package/dist/client/assets/{popover-DSRFfUdL.js → popover-DaReiQzV.js} +1 -1
  213. package/dist/client/assets/post-calendar--v0MjZPE.js +1 -0
  214. package/dist/client/assets/post-editor-CRy0VAcT.js +2 -0
  215. package/dist/client/assets/{preview-content-hWNiqB3L.js → preview-content-DJOuEciL.js} +1 -1
  216. package/dist/client/assets/{preview-dialog-HJF1l34b.js → preview-dialog-CnlKftcv.js} +1 -1
  217. package/dist/client/assets/{preview-panel-PigPEt4W.js → preview-panel-C2Athpf5.js} +1 -1
  218. package/dist/client/assets/preview-tab-CzS9kIxI.js +551 -0
  219. package/dist/client/assets/product-picker-dialog-oD9OPZfl.js +1 -0
  220. package/dist/client/assets/{profile-D-LHzn9e.js → profile-DAF3l5cg.js} +1 -1
  221. package/dist/client/assets/{project-app-view-CGbP48WX.js → project-app-view-CZXBsQ0a.js} +1 -1
  222. package/dist/client/assets/project-apps-CG2eY1ZZ.js +1 -0
  223. package/dist/client/assets/{project-feed-uKBIzmIi.js → project-feed-K24c6-Xx.js} +1 -1
  224. package/dist/client/assets/{project-icon-njec1yh1.js → project-icon-ZadU5ZjL.js} +1 -1
  225. package/dist/client/assets/project-reports-Crv9B-vM.js +1 -0
  226. package/dist/client/assets/project-tasks-Cz-57jQh.js +1 -0
  227. package/dist/client/assets/{projects-OJnagyMB.js → projects-BWrIdbSy.js} +1 -1
  228. package/dist/client/assets/{projects-empty-state-C9IhB7We.js → projects-empty-state-BWAilN1f.js} +1 -1
  229. package/dist/client/assets/{prompts-B590L6x_.js → prompts-DKnoRB34.js} +1 -1
  230. package/dist/client/assets/record-editor-d52mwz1n.js +1 -0
  231. package/dist/client/assets/redirect-editor-C-WKtN9s.js +1 -0
  232. package/dist/client/assets/releases-api-q3AffL1J.js +1 -0
  233. package/dist/client/assets/reports-B3miutne.js +1 -0
  234. package/dist/client/assets/{reports-DBL7SnEu.js → reports-Bg1fi6kR.js} +1 -1
  235. package/dist/client/assets/{reports-onboarding-Be9p494r.js → reports-onboarding-acV5ZZpQ.js} +1 -1
  236. package/dist/client/assets/reports-tab-Clf7FxSU.js +2 -0
  237. package/dist/client/assets/{repositories-BEFfDE3p.js → repositories-CxdgYwWQ.js} +1 -1
  238. package/dist/client/assets/repositories-D42Ai47E.js +1 -0
  239. package/dist/client/assets/{repository-binding-BLgLcT4o.js → repository-binding-DtIeSvDY.js} +1 -1
  240. package/dist/client/assets/{repository-import-picker-lphgZTGu.js → repository-import-picker-C2sQ94O1.js} +1 -1
  241. package/dist/client/assets/{repository-picker-Dadd-3sc.js → repository-picker-BXaWFfDW.js} +1 -1
  242. package/dist/client/assets/{require-capability-D4hkdMxt.js → require-capability-DAfCGgHW.js} +1 -1
  243. package/dist/client/assets/{required-auth-layout-e3_y0Tns.js → required-auth-layout-4jyUcmCy.js} +1 -1
  244. package/dist/client/assets/{reset-password-DPAO5WIu.js → reset-password-BGjvzv1z.js} +1 -1
  245. package/dist/client/assets/{resizable-D4wP3vt7.js → resizable-CQyxQjcn.js} +1 -1
  246. package/dist/client/assets/resolve-tab-icon-56O81FJc.js +1 -0
  247. package/dist/client/assets/{review-settings-BJK_0aY-.js → review-settings-CWih3HF4.js} +1 -1
  248. package/dist/client/assets/{roles-CJ569tPn.js → roles-BRkp9ar3.js} +1 -1
  249. package/dist/client/assets/route-4SgoFvu0.js +1 -0
  250. package/dist/client/assets/route-BEESJELS.js +1 -0
  251. package/dist/client/assets/route-D6eBZFy3.js +1 -0
  252. package/dist/client/assets/runnable-block-editor-CqYgijVY.js +20 -0
  253. package/dist/client/assets/{sandbox-git-api-CRxdlhrN.js → sandbox-git-api-CH_-QFpD.js} +1 -1
  254. package/dist/client/assets/{sandbox-lifecycle-context-v9W7lV1M.js → sandbox-lifecycle-context-DdMgF1Lv.js} +1 -1
  255. package/dist/client/assets/schema-Cn4x5iT-.js +1 -0
  256. package/dist/client/assets/{schema-Cx9ZLa-H.js → schema-Dvc5tPTN.js} +1 -1
  257. package/dist/client/assets/{scroll-area-Bnrys5oj.js → scroll-area-9wUBmncr.js} +1 -1
  258. package/dist/client/assets/{search-input-CXQLMhKZ.js → search-input-1DLvCYgl.js} +1 -1
  259. package/dist/client/assets/{search-toggle-DxUZFRWy.js → search-toggle-BnK2KHqJ.js} +1 -1
  260. package/dist/client/assets/{secret-picker-HHgZv9y6.js → secret-picker-B4zI9e3W.js} +1 -1
  261. package/dist/client/assets/{secrets-Cm2ZaKef.js → secrets-C2PS9_a9.js} +1 -1
  262. package/dist/client/assets/{sections-DT5ozPKC.js → sections-DX6pY_bs.js} +1 -1
  263. package/dist/client/assets/sections-editor-DD9uWqQ8.js +4 -0
  264. package/dist/client/assets/{select-CSQbGY9x.js → select-DUEGSJco.js} +1 -1
  265. package/dist/client/assets/{select-model-NUb0C_oX.js → select-model-mFyCcf-O.js} +1 -1
  266. package/dist/client/assets/seo-editor-Bf-sfYSP.js +1 -0
  267. package/dist/client/assets/{separator-CjiQChVR.js → separator-Bk_a4cod.js} +1 -1
  268. package/dist/client/assets/settings-tab-DpQMA4J6.js +1 -0
  269. package/dist/client/assets/{sheet-C-yunzji.js → sheet-Dhe0uPV2.js} +1 -1
  270. package/dist/client/assets/shell-layout-U7D4A6nk.js +1 -0
  271. package/dist/client/assets/site-draft-actions-Dpnw67Ug.js +12 -0
  272. package/dist/client/assets/site-draft-view-Cho80MC6.js +2 -0
  273. package/dist/client/assets/site-editor-34XlqmyW.js +1 -0
  274. package/dist/client/assets/{skills-9HRxIPqn.js → skills-DghKPwKw.js} +1 -1
  275. package/dist/client/assets/slider-CLUaEqdg.js +1 -0
  276. package/dist/client/assets/{sortable.esm-C1zl1f3P.js → sortable.esm-CkqHW6-y.js} +1 -1
  277. package/dist/client/assets/{sso-PqsQn3xP.js → sso-DGFWPeza.js} +1 -1
  278. package/dist/client/assets/{suggestion-Wgq7DDQo.js → suggestion-BNEVVm5c.js} +2 -2
  279. package/dist/client/assets/{switch-DYA2xfHU.js → switch-ByCU93P4.js} +1 -1
  280. package/dist/client/assets/{symbol-B8wQ7lKk.js → symbol-BQLM2_V8.js} +1 -1
  281. package/dist/client/assets/{synced-repos-mXhCt1sQ.js → synced-repos-CjPrTUpI.js} +1 -1
  282. package/dist/client/assets/{tab-icon-glyph-BpaLtZlY.js → tab-icon-glyph-Cz_BoFAU.js} +1 -1
  283. package/dist/client/assets/{table-BQLxO2Sb.js → table-Tw2gCVXe.js} +1 -1
  284. package/dist/client/assets/{tabs-2NCCfhSA.js → tabs-C7f3nqQx.js} +1 -1
  285. package/dist/client/assets/{task-assignee-avatar-FdiZZP36.js → task-assignee-avatar-BiPanmNM.js} +1 -1
  286. package/dist/client/assets/{task-board-DRNr9Dsj.js → task-board-BrTYr-oE.js} +1 -1
  287. package/dist/client/assets/{task-route-BaANwBST.js → task-route-BLP-DBaS.js} +1 -1
  288. package/dist/client/assets/{task-status-VcYcBtq_.js → task-status-CVpsP3bD.js} +1 -1
  289. package/dist/client/assets/{taskboard-analytics-RJkelUr8.js → taskboard-analytics-CQMw4wzL.js} +1 -1
  290. package/dist/client/assets/tasks-C_346UtB.js +1 -0
  291. package/dist/client/assets/{tasks-COZY0QCJ.js → tasks-CtPgnGlW.js} +3 -3
  292. package/dist/client/assets/{textarea-CxhXyMKI.js → textarea-Bbbnnl4r.js} +1 -1
  293. package/dist/client/assets/{thread-analytics-BGQNbVS2.js → thread-analytics-CtQHMk9N.js} +1 -1
  294. package/dist/client/assets/{thread-intent-DKuqiaG7.js → thread-intent-7GmQH5mt.js} +4 -4
  295. package/dist/client/assets/{thread-route-CQ0phZyI.js → thread-route-C7RSGMhP.js} +1 -1
  296. package/dist/client/assets/{thread-route-jNELZX1N.js → thread-route-DpLeB4i0.js} +1 -1
  297. package/dist/client/assets/{thread-sheet-body-Cdv_wHnA.js → thread-sheet-body-dWggSd-b.js} +1 -1
  298. package/dist/client/assets/time-range-picker-BVXe-Owx.js +1 -0
  299. package/dist/client/assets/toggle-group-CXUKmPFr.js +1 -0
  300. package/dist/client/assets/{tool-namespace-DTl3so75.js → tool-namespace-DIE_8J9o.js} +1 -1
  301. package/dist/client/assets/{toolbar-icon-button-BPY5dUh9.js → toolbar-icon-button-DzJeqLa2.js} +1 -1
  302. package/dist/client/assets/{tooltip-B5RmO6BW.js → tooltip-gMeEuHtO.js} +1 -1
  303. package/dist/client/assets/tooltipContext-BQS7kWxi.js +1 -0
  304. package/dist/client/assets/{track-BBpplM-4.js → track-DdeuRUoM.js} +1 -1
  305. package/dist/client/assets/{types-Bt5yyj-z.js → types-CHFSNT7a.js} +6 -6
  306. package/dist/client/assets/{url-slug-B41xLFy_.js → url-slug-D37s8EDd.js} +1 -1
  307. package/dist/client/assets/{usage-stats-BkcKNXzu.js → usage-stats-BecGIkLk.js} +1 -1
  308. package/dist/client/assets/{use-ai-providers-D1TJRnIR.js → use-ai-providers-CAt_9H4n.js} +1 -1
  309. package/dist/client/assets/use-apply-named-rule-B_CXDUdG.js +1 -0
  310. package/dist/client/assets/{use-automations-B9eI7BBQ.js → use-automations-C6LbyvJD.js} +1 -1
  311. package/dist/client/assets/{use-autosave-D3uy94Wi.js → use-autosave-e9CI9oFB.js} +1 -1
  312. package/dist/client/assets/{use-chat-layout-state-BNudmQ0u.js → use-chat-layout-state-24wCHq_-.js} +1 -1
  313. package/dist/client/assets/{use-clock-tick-D3FoyBXt.js → use-clock-tick-DflKMAWl.js} +1 -1
  314. package/dist/client/assets/{use-connect-companion-BLomLbPK.js → use-connect-companion-3OWtftC8.js} +1 -1
  315. package/dist/client/assets/{use-connection-BwU_KLSF.js → use-connection-CBKH8IwL.js} +1 -1
  316. package/dist/client/assets/use-content-sync-D_qyLHCv.js +1 -0
  317. package/dist/client/assets/{use-copy-d7X6hrKI.js → use-copy-Cn8Org7G.js} +1 -1
  318. package/dist/client/assets/use-create-virtual-mcp-jW1iVRi_.js +1 -0
  319. package/dist/client/assets/{use-date-fns-locale-BuGEMgXR.js → use-date-fns-locale-DTRxIyi4.js} +1 -1
  320. package/dist/client/assets/{use-debounced-autosave-KHVF-MyQ.js → use-debounced-autosave-DDaoW-uw.js} +1 -1
  321. package/dist/client/assets/{use-debounced-value-DJkh4QSx.js → use-debounced-value-c5JdkW89.js} +1 -1
  322. package/dist/client/assets/{use-deco-credits-Dx8wT8P5.js → use-deco-credits-D8w-JIDW.js} +1 -1
  323. package/dist/client/assets/{use-decopilot-events-AlKmmETJ.js → use-decopilot-events-Cp8NaBPU.js} +1 -1
  324. package/dist/client/assets/{use-delete-connection-BQjQHz64.js → use-delete-connection-BJIObh7l.js} +1 -1
  325. package/dist/client/assets/{use-deployment-admin-BIA7CHLS.js → use-deployment-admin-D7XKR1Dx.js} +1 -1
  326. package/dist/client/assets/use-fast-preview-draft-url-CSz1rYUo.js +1 -0
  327. package/dist/client/assets/{use-file-configs-tsH4be9V.js → use-file-configs-DW0hmZjE.js} +1 -1
  328. package/dist/client/assets/{use-inbox-feed-bGge9UaE.js → use-inbox-feed-DOpe-XBh.js} +1 -1
  329. package/dist/client/assets/{use-infinite-scroll-BO0n6TVn.js → use-infinite-scroll-Cuyf7850.js} +1 -1
  330. package/dist/client/assets/{use-join-requests-DqhkfI-R.js → use-join-requests-CBahVlKF.js} +1 -1
  331. package/dist/client/assets/use-main-panel-tabs-CVsgtXg7.js +1 -0
  332. package/dist/client/assets/{use-mcp-auth-status-DmZSbEuf.js → use-mcp-auth-status-Cs8ZHHaN.js} +1 -1
  333. package/dist/client/assets/use-mcp-client-D1kFCZ4v.js +10 -0
  334. package/dist/client/assets/{use-mcp-prompts-DHm-ZTib.js → use-mcp-prompts-wKDmQlGB.js} +1 -1
  335. package/dist/client/assets/{use-mcp-tools-DiCKzhUm.js → use-mcp-tools-I-kpM305.js} +1 -1
  336. package/dist/client/assets/{use-members-h3MYd8gX.js → use-members-0ZBHc0S5.js} +1 -1
  337. package/dist/client/assets/{use-mobile-DCpa1RnA.js → use-mobile-CKoO3XSk.js} +1 -1
  338. package/dist/client/assets/use-move-blocks-Dm4etxGk.js +1 -0
  339. package/dist/client/assets/{use-navigate-to-agent-Bt0oZ-ou.js → use-navigate-to-agent-DLX1nkvn.js} +1 -1
  340. package/dist/client/assets/{use-open-billing-url-B2NuYLXS.js → use-open-billing-url-C5lEsbaH.js} +1 -1
  341. package/dist/client/assets/{use-org-auth-client-CL0a2tPL.js → use-org-auth-client-t4l-TKT1.js} +1 -1
  342. package/dist/client/assets/{use-org-fs-D_4Q985K.js → use-org-fs-49a1bhbu.js} +1 -1
  343. package/dist/client/assets/{use-org-repo-syncs-CC0BNhdO.js → use-org-repo-syncs-BunA5GFg.js} +1 -1
  344. package/dist/client/assets/{use-org-sso-LC63-uuA.js → use-org-sso-B_zXOLDA.js} +1 -1
  345. package/dist/client/assets/{use-organization-roles-D1Q7317o.js → use-organization-roles-Bc45ILhm.js} +1 -1
  346. package/dist/client/assets/{use-organization-settings-DhvN44pQ.js → use-organization-settings-laAOR3Cm.js} +1 -1
  347. package/dist/client/assets/use-panel-navigate-Bghh8kV3.js +1 -0
  348. package/dist/client/assets/use-project-native-view-presence-C3Vtd78t.js +1 -0
  349. package/dist/client/assets/{use-project-scope-Cq4vb2Sy.js → use-project-scope-DH5nL_oD.js} +1 -1
  350. package/dist/client/assets/{use-recent-apps-CeIVmzp8.js → use-recent-apps-D6yVH6-8.js} +1 -1
  351. package/dist/client/assets/{use-releases-DQ--CsAF.js → use-releases-G0pirYfu.js} +1 -1
  352. package/dist/client/assets/{use-reports-diagnostic-CWir9L_Y.js → use-reports-diagnostic-BKJYEIJX.js} +1 -1
  353. package/dist/client/assets/{use-secrets-D6tUoaJC.js → use-secrets-DszBqpzD.js} +1 -1
  354. package/dist/client/assets/use-section-preview-base-BASvFHv_.js +1 -0
  355. package/dist/client/assets/{use-sidebar-collapsed-DPHQfMII.js → use-sidebar-collapsed-CuPY8XXm.js} +1 -1
  356. package/dist/client/assets/{use-tags-DE48pnzl.js → use-tags-BsXvHuTC.js} +1 -1
  357. package/dist/client/assets/{use-task-board-analytics-DlTk43Uu.js → use-task-board-analytics-BtNGPBbp.js} +1 -1
  358. package/dist/client/assets/{use-task-board-events-CSRq29Tm.js → use-task-board-events-BARWSwfj.js} +1 -1
  359. package/dist/client/assets/{use-task-board-item-prs-BsxjjcBf.js → use-task-board-item-prs-BhAhDKGd.js} +1 -1
  360. package/dist/client/assets/{use-task-metadata-ToXrxOCT.js → use-task-metadata-Dd-9Qkoq.js} +1 -1
  361. package/dist/client/assets/{use-thread-analytics-Bu_i1v9r.js → use-thread-analytics-B9Rm3t_E.js} +1 -1
  362. package/dist/client/assets/{use-thread-outputs-jyAHyZHI.js → use-thread-outputs-CoFWg3_v.js} +1 -1
  363. package/dist/client/assets/useInfiniteQuery-wCORGPw3.js +1 -0
  364. package/dist/client/assets/{useQueries-CddGJ3VE.js → useQueries-_Urb_S-y.js} +1 -1
  365. package/dist/client/assets/useSuspenseInfiniteQuery-JvpRoEFG.js +1 -0
  366. package/dist/client/assets/{users-2guAvf9G.js → users-BXTFPRVd.js} +1 -1
  367. package/dist/client/assets/{utils-DzhKsxx8.js → utils-CduIoZ0d.js} +2 -2
  368. package/dist/client/assets/variant-calendar-D0iLcmjF.js +1 -0
  369. package/dist/client/assets/variant-draft-pointer-HWAlFj6Z.js +1 -0
  370. package/dist/client/assets/virtual-mcp-Xd6PvE5_.js +1 -0
  371. package/dist/client/assets/{watch-sse-pool-DwBbAQ97.js → watch-sse-pool-BoG6Bqps.js} +1 -1
  372. package/dist/client/index.html +2 -2
  373. package/dist/server/server.js +684 -684
  374. package/package.json +1 -1
  375. package/dist/client/assets/ActiveShapeUtils-DV40gvcg.js +0 -1
  376. package/dist/client/assets/AreaChart-C_4ebEom.js +0 -1
  377. package/dist/client/assets/BarChart-DfTtCBDv.js +0 -1
  378. package/dist/client/assets/CartesianChart-uNdbRuTj.js +0 -1
  379. package/dist/client/assets/ReferenceLine-ILm1GG8J.js +0 -1
  380. package/dist/client/assets/Sector-D2xOkxuc.js +0 -28
  381. package/dist/client/assets/agent-analytics-D74l8HWB.js +0 -2
  382. package/dist/client/assets/agent-app-CEBVAZwO.js +0 -1
  383. package/dist/client/assets/agent-assets-Bwo-LFkg.js +0 -1
  384. package/dist/client/assets/agent-automations-Du82D3qr.js +0 -1
  385. package/dist/client/assets/agent-deck-BZZHzjdZ.js +0 -1
  386. package/dist/client/assets/agent-e2e-D6ovLSkg.js +0 -1
  387. package/dist/client/assets/agent-experiments-Bf1OqB1m.js +0 -1
  388. package/dist/client/assets/agent-file-CzvpBEaK.js +0 -1
  389. package/dist/client/assets/agent-hosting-6te_9jdz.js +0 -1
  390. package/dist/client/assets/agent-library-BOSIxUYz.js +0 -1
  391. package/dist/client/assets/agent-library-file-C0RqJ45T.js +0 -1
  392. package/dist/client/assets/agent-monitor-C3Fta9kk.js +0 -1
  393. package/dist/client/assets/agent-releases-COSsnWfe.js +0 -2
  394. package/dist/client/assets/agent-settings-DDIl5jyz.js +0 -1
  395. package/dist/client/assets/agent-site-editor-DlN_1OE1.js +0 -27
  396. package/dist/client/assets/agent-site-editor-code-ByOIwjcy.js +0 -2
  397. package/dist/client/assets/agent-site-editor-content-DSEuxkJh.js +0 -1
  398. package/dist/client/assets/agent-site-editor-preview-pw2RBbYs.js +0 -1
  399. package/dist/client/assets/agent-view-IbmF6KBh.js +0 -1
  400. package/dist/client/assets/alert-B29bfkXd.js +0 -1
  401. package/dist/client/assets/analytics-sections-wgH0NLyS.js +0 -1
  402. package/dist/client/assets/api-keys-CiMyiLjo.js +0 -1
  403. package/dist/client/assets/app-editor-DgdEdwhZ.js +0 -1
  404. package/dist/client/assets/automation-list-row-qFFhCtZo.js +0 -1
  405. package/dist/client/assets/badge-Cnnepvq1.js +0 -1
  406. package/dist/client/assets/blocks-tab-states-jGeS9iVz.js +0 -20
  407. package/dist/client/assets/blog-schema-CUOOV4a2.js +0 -1
  408. package/dist/client/assets/category-editor-Gr46SDP4.js +0 -1
  409. package/dist/client/assets/cms-settings-editor-CxJ3W3GB.js +0 -1
  410. package/dist/client/assets/collection-detail-BXVqh2XU.js +0 -1
  411. package/dist/client/assets/content-tab-YH7YYY48.js +0 -22
  412. package/dist/client/assets/context-3twD8BEv.js +0 -1
  413. package/dist/client/assets/hosted-publish-feedback-9IsLIhi6.js +0 -1
  414. package/dist/client/assets/index-BRzGXE32.js +0 -4
  415. package/dist/client/assets/index-BqS2UmN9.css +0 -1
  416. package/dist/client/assets/infra-billing-DkMlIjvS.js +0 -1
  417. package/dist/client/assets/legacy-main-redirect-mSx9JMxj.js +0 -1
  418. package/dist/client/assets/library-BNARKbpY.js +0 -1
  419. package/dist/client/assets/monitoring-DX0mWeP-.js +0 -1
  420. package/dist/client/assets/mustache-BxPGtFxk.js +0 -4
  421. package/dist/client/assets/order-monitor-day-BHpHKh9K.js +0 -1
  422. package/dist/client/assets/page-seo-form-PX_1VQkb.js +0 -1
  423. package/dist/client/assets/plan-BnqYpKp5.js +0 -1
  424. package/dist/client/assets/post-calendar-D_8Ms9Cq.js +0 -1
  425. package/dist/client/assets/post-editor-lU8h7ku9.js +0 -2
  426. package/dist/client/assets/preview-tab-B-uX9H3E.js +0 -551
  427. package/dist/client/assets/product-picker-dialog-BUcziHgK.js +0 -1
  428. package/dist/client/assets/project-apps-CajNRGrz.js +0 -1
  429. package/dist/client/assets/project-reports-BwZ6fxIs.js +0 -1
  430. package/dist/client/assets/project-tasks-zYigtiRn.js +0 -1
  431. package/dist/client/assets/record-editor-BxllIkC_.js +0 -1
  432. package/dist/client/assets/redirect-editor-CTLxiYxe.js +0 -1
  433. package/dist/client/assets/reports-CJqSx9sD.js +0 -1
  434. package/dist/client/assets/reports-tab-B0M7UKAQ.js +0 -2
  435. package/dist/client/assets/repositories-DceuH_GA.js +0 -1
  436. package/dist/client/assets/resolve-tab-icon-CE5OwNrK.js +0 -1
  437. package/dist/client/assets/route-Bzf1UEGL.js +0 -1
  438. package/dist/client/assets/route-CG_vDQP9.js +0 -1
  439. package/dist/client/assets/route-Dfqmjwjm.js +0 -1
  440. package/dist/client/assets/schema-BdFq22Hl.js +0 -1
  441. package/dist/client/assets/secret-ciphertext-DZr2qcb4.js +0 -1
  442. package/dist/client/assets/sections-editor-CkId24Js.js +0 -4
  443. package/dist/client/assets/seo-editor-D886xssW.js +0 -1
  444. package/dist/client/assets/settings-tab-BmEKDSFe.js +0 -1
  445. package/dist/client/assets/shell-layout-vQvYndIW.js +0 -1
  446. package/dist/client/assets/site-editor-1ZGqBXbh.js +0 -1
  447. package/dist/client/assets/site-editor-toast-BtFL0E4q.js +0 -1
  448. package/dist/client/assets/slider-DB0IY-tO.js +0 -1
  449. package/dist/client/assets/tasks-CYZeHeAX.js +0 -1
  450. package/dist/client/assets/time-range-picker-DEciYFPf.js +0 -1
  451. package/dist/client/assets/toggle-group-CtdhsZGp.js +0 -1
  452. package/dist/client/assets/tooltipContext-C93Q6WFf.js +0 -1
  453. package/dist/client/assets/use-content-sync-BgOMBs5q.js +0 -1
  454. package/dist/client/assets/use-create-virtual-mcp-OUIvni0u.js +0 -1
  455. package/dist/client/assets/use-fast-preview-draft-url-5oeXM-kY.js +0 -1
  456. package/dist/client/assets/use-main-panel-tabs-BrJK-bL3.js +0 -1
  457. package/dist/client/assets/use-main-schema-v8-CZLsOlEV.js +0 -1
  458. package/dist/client/assets/use-mcp-client-MRThuZpK.js +0 -10
  459. package/dist/client/assets/use-panel-navigate-DoD4Atgz.js +0 -1
  460. package/dist/client/assets/use-project-native-view-presence-DF_1PP5b.js +0 -1
  461. package/dist/client/assets/use-section-preview-base-Ca45yoz9.js +0 -1
  462. package/dist/client/assets/useInfiniteQuery-ZoWXsJcj.js +0 -1
  463. package/dist/client/assets/useSuspenseInfiniteQuery-D2W70ffp.js +0 -1
  464. package/dist/client/assets/variant-calendar-Bdj0O-mA.js +0 -1
  465. package/dist/client/assets/variant-draft-pointer-_apEPqxm.js +0 -1
  466. package/dist/client/assets/virtual-mcp-CMZ8dHEU.js +0 -1
@@ -1 +0,0 @@
1
- import{c as A,a2 as ae,a as pe,an as Pe,K as fe,m as me,b as K,r as B,l as se,j as n,h as ve,B as qe,aL as je,aK as Ie,H as pt,y as he,v as Wt,aM as Yt,s as Zt,q as Qt,D as Xt,aN as Jt,au as xt,t as es,av as ts,d as Me,n as st,aO as ss,f as Se,M as nt,aa as ns,k as gt,e as as,u as Ae,aP as rs,aQ as is,O as bt,aR as ls,N as os,P as De}from"./index-CaH7O3hJ.js";import{i as We}from"./AlertCircle-Ctbquk5a.js";import{F as cs,G as at,A as ye,H as ds,I as us,j as fs,J as ms,K as hs,L as ps,M as vt,N as xs,n as gs,k as bs,m as vs}from"./agent-icon-U4gZaLOQ.js";import{c as ys}from"./use-sidebar-collapsed-DPHQfMII.js";import{T as _e}from"./toolbar-icon-button-BPY5dUh9.js";import{C as W,w as js,S as Ss}from"./index-CJu3ft8V.js";import{s as yt,C as ks,u as Ns,a as jt,V as Ts,b as _s}from"./input-D2sd1bar.js";import{u as Le,b as Ye,c as $e,d as St,e as ws,s as Cs}from"./chat-context-_d3c57p1.js";import{u as Ps,s as kt}from"./use-ai-providers-D1TJRnIR.js";import{b as Nt,a as Is,u as Ms}from"./use-organization-settings-DhvN44pQ.js";import{i as As}from"./CheckCircle-C2ndOEUO.js";import{s as rt}from"./XClose-dOW_RI9u.js";import{a as Ee,b as Ls,c as Tt,g as _t}from"./repository-binding-BLgLcT4o.js";import{I as wt}from"./integration-icon-DCiBepJw.js";import{c as $s}from"./use-decopilot-events-AlKmmETJ.js";import{t as Ze}from"./ChevronUp-C8mqlnDX.js";import{O as Es}from"./pair-5gOZrfkD.js";import{u as Fs,a as Rs}from"./use-thread-outputs-jyAHyZHI.js";import{u as Os}from"./use-deco-credits-Dx8wT8P5.js";import{a as Qe,f as Bs,L as Ds,s as zs,b as Gs}from"./shell-layout-vQvYndIW.js";import{a as Hs}from"./use-main-schema-v8-CZLsOlEV.js";import{g as Ct,u as Vs,n as Ks,a as Us}from"./use-releases-DQ--CsAF.js";import{u as qs,d as Pt,a as Xe,b as Je,c as It,e as Ws}from"./thread-intent-DKuqiaG7.js";import{f as Ys,c as Mt,d as Zs}from"./use-navigate-to-agent-Bt0oZ-ou.js";import{o as Qs,s as Xs,u as Js,S as en}from"./sandbox-lifecycle-context-v9W7lV1M.js";import{E as At}from"./empty-state-Bok1L2hc.js";import{t as tn,m as sn,u as nn}from"./use-chat-layout-state-BNudmQ0u.js";import{C as it}from"./index-DUXVtfV1.js";import{a as Lt,b as $t,P as Et}from"./popover-DSRFfUdL.js";import{T as Fe,a as Re,c as Oe}from"./tooltip-B5RmO6BW.js";import{T as an,a as rn}from"./toggle-group-CtdhsZGp.js";import{u as Ft,a as et,r as ln,b as Rt,c as on,d as cn}from"./thread-route-CQ0phZyI.js";import{c as dn,C as un,a as fn,b as mn,e as hn,d as pn}from"./command-C7n5qLsN.js";import{i as Ot}from"./ZoomOut-BfQx-fBr.js";import{g as xn,S as gn}from"./task-status-VcYcBtq_.js";import{a as bn}from"./format-time-Cq80KKvY.js";import{u as vn}from"./use-clock-tick-D3FoyBXt.js";import{a as Bt,u as yn}from"./use-panel-navigate-DoD4Atgz.js";import{u as Dt}from"./use-main-panel-tabs-BrJK-bL3.js";import{T as we}from"./tab-icon-glyph-BpaLtZlY.js";import{a as jn}from"./UserSquare-Drp4z0v0.js";import{b as Sn,c as zt,S as kn,d as Nn}from"./select-CSQbGY9x.js";import{L as Tn}from"./project-apps-CajNRGrz.js";import{L as tt,a as _n}from"./legacy-main-redirect-mSx9JMxj.js";import{u as wn}from"./use-mobile-DCpa1RnA.js";import{L as Cn}from"./preview-dialog-HJF1l34b.js";import{O as Pn}from"./markdown-CA3yd3L6.js";import{B as lt}from"./blocks-preview-workspace-context-Ca46yWEV.js";import{p as In}from"./virtual-mcp-CMZ8dHEU.js";import"./Tool01-BM29_KWq.js";import"./ArrowUp-bYg1aEOe.js";import"./ArrowLeft-DZ0mAFgb.js";import"./LinkBroken01-BJx0R97x.js";import"./ShoppingBag01-BMRnsG58.js";import"./Building02-BHIVlbfK.js";import"./ChevronSelectorVertical-DaUdbCWk.js";import"./Copy01-DC8f0fwU.js";import"./CreditCard01-P7j8oDkg.js";import"./DotsVertical-BvwGTDkC.js";import"./Image01-D7F4wuKx.js";import"./Globe04-D6C-ihBU.js";import"./SwitchHorizontal01-CshMTQzi.js";import"./Key01-u4HXXUPa.js";import"./Link01-BoUupQbW.js";import"./Minus-C1PMcNV0.js";import"./Monitor01-D3VwU2ni.js";import"./Sun-sKGpeIhM.js";import"./Play-DxsFk4r2.js";import"./Plus-BDveVGJf.js";import"./SearchMd-Cuf45jFP.js";import"./Trash01-D92WhXf2.js";import"./Upload01-BSDy4f7m.js";import"./User01-Cn3JqTjv.js";import"./Users01-Cxbx87gg.js";import"./sheet-C-yunzji.js";import"./sandbox-url-D3mC8qhT.js";import"./backoff-CrEUbyZT.js";import"./tool-namespace-DTl3so75.js";import"./drawer-ZlYTI3Z6.js";import"./collection-search-gW4FCqmq.js";import"./use-mcp-client-MRThuZpK.js";import"./auth-hgpoCSIS.js";import"./use-mcp-prompts-DHm-ZTib.js";import"./usage-stats-BkcKNXzu.js";import"./form-Dpwt-9St.js";import"./label-Cnc4HQwP.js";import"./utils-CVEq3hMx.js";import"./use-copy-d7X6hrKI.js";import"./index-BpRXpcv4.js";import"./checkbox-CUzk21sc.js";import"./ai-providers-logos-DD3qZ33J.js";import"./avatar-RpIBVCkY.js";import"./feature-paywall-D-GfxA1X.js";import"./plan-ladder-BydnH1hR.js";import"./icon-button-CwrVRVUS.js";import"./file-type-icon-DPqHd815.js";import"./location-V0VwTJTt.js";import"./autosend-BZOm698U.js";import"./chat-draft-CKcHhXuF.js";import"./tabs-2NCCfhSA.js";import"./active-indicator-CCMhAsc_.js";import"./use-open-billing-url-B2NuYLXS.js";import"./input-DN6U5jAj.js";import"./suggestion-Wgq7DDQo.js";import"./use-org-fs-D_4Q985K.js";import"./useInfiniteQuery-ZoWXsJcj.js";import"./infiniteQueryObserver-u-Zd7Oxq.js";import"./question-004-sINsf4GQ.js";import"./use-members-h3MYd8gX.js";import"./use-org-auth-client-CL0a2tPL.js";import"./add-connection-dialog-B0vtW1sl.js";import"./extract-connection-data-CNLani4P.js";import"./metadata-D72DunRR.js";import"./connection-Dik4epzq.js";import"./url-slug-B41xLFy_.js";import"./connection-card-DCnmTKpJ.js";import"./connection-slug-CITJ0kGN.js";import"./slugify-CEUa2lfQ.js";import"./textarea-CxhXyMKI.js";import"./use-connection-BwU_KLSF.js";import"./schema-Cx9ZLa-H.js";import"./connection-form-helpers-ta2yIvIb.js";import"./authenticate-and-persist-oauth-jn1R1qId.js";import"./mcp-oauth-3Gakbc_U.js";import"./mcp-oauth-CxgfM8zh.js";import"./collection-tabs-DIFXv7hR.js";import"./badge-Cnnepvq1.js";import"./use-infinite-scroll-BO0n6TVn.js";import"./useSuspenseInfiniteQuery-D2W70ffp.js";import"./use-task-board-events-CSRq29Tm.js";import"./task-board-DRNr9Dsj.js";import"./schema-BdFq22Hl.js";import"./watch-sse-pool-DwBbAQ97.js";import"./collapsible-CeBZpglT.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-Xaw0krD3.js";import"./types-Bt5yyj-z.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./use-project-scope-Cq4vb2Sy.js";import"./project-icon-njec1yh1.js";import"./new-project-dialog-DpHJ0D5s.js";import"./repository-import-picker-lphgZTGu.js";import"./repository-picker-Dadd-3sc.js";import"./use-debounced-value-DJkh4QSx.js";import"./required-auth-layout-e3_y0Tns.js";import"./use-org-sso-LC63-uuA.js";import"./serial-task-queue-CGOeQgpr.js";import"./delay-CnY5UFtP.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./resizable-D4wP3vt7.js";import"./index-C9OgV5Vt.js";import"./index-DK4LlU65.js";import"./differenceInSeconds-C3x8sHUj.js";import"./use-mcp-tools-DiCKzhUm.js";import"./resolve-tab-icon-CE5OwNrK.js";import"./use-task-metadata-ToXrxOCT.js";import"./preview-source-BsRLGWUP.js";import"./use-project-native-view-presence-DF_1PP5b.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./use-file-configs-tsH4be9V.js";import"./site-slug-DebpOoQq.js";import"./index-BdQq_4o_.js";import"./preview-content-hWNiqB3L.js";import"./file-share-button-CB7fcIJI.js";import"./file-preview-DSIiiWjA.js";import"./utils-DzhKsxx8.js";import"./editor-BFHySd1K.js";function Mn({isThreadLocked:t,hasCloudProviderKeys:e,sandboxOnlyChats:s,canRunClaudeCode:r}){return t?null:!e&&!(s&&r)?"provider":s&&!r?"claude-code-provider":null}function An(){const t=A.c(26),e=Ps(),s=Le(),r=Nt(),i=Is("chat_harness_codex"),{org:a}=ae(),{data:o}=pe.useSession(),c=o?.user.id??"",u=Pe(),l=e.some($n);let d;t[0]!==a.id||t[1]!==c?(d=fe.claudeSubscription(a.id,c),t[0]=a.id,t[1]=c,t[2]=d):d=t[2];let m;t[3]!==u?(m=()=>u.call("CLAUDE_SUBSCRIPTION_STATUS",{}),t[3]=u,t[4]=m):m=t[4];const f=r&&!i&&!l;let h;t[5]!==d||t[6]!==m||t[7]!==f?(h={queryKey:d,queryFn:m,enabled:f},t[5]=d,t[6]=m,t[7]=f,t[8]=h):h=t[8];const j=me(h);let y;t[9]!==a.id?(y=fe.githubCopilot(a.id),t[9]=a.id,t[10]=y):y=t[10];let v;t[11]!==u?(v=()=>u.call("GITHUB_COPILOT_STATUS",{}),t[11]=u,t[12]=v):v=t[12];const x=r&&!i&&!l;let g;t[13]!==y||t[14]!==v||t[15]!==x?(g={queryKey:y,queryFn:v,enabled:x},t[13]=y,t[14]=v,t[15]=x,t[16]=g):g=t[16];const b=me(g);let S;t[17]!==a.id||t[18]!==c?(S=fe.codexSubscription(a.id,c),t[17]=a.id,t[18]=c,t[19]=S):S=t[19];let p;t[20]!==u?(p=()=>u.call("CODEX_SUBSCRIPTION_STATUS",{}),t[20]=u,t[21]=p):p=t[21];const k=r&&i;let T;t[22]!==k||t[23]!==S||t[24]!==p?(T={queryKey:S,queryFn:p,enabled:k},t[22]=k,t[23]=S,t[24]=p,t[25]=T):T=t[25];const N=me(T);return r&&i&&!s?.isThreadLocked?e.some(Ln)||N.data?.connected!==!1?null:"codex-provider":Mn({isThreadLocked:s?.isThreadLocked??!1,hasCloudProviderKeys:e.length>0,sandboxOnlyChats:r,canRunClaudeCode:l||j.data?.connected!==!1||b.data?.connected!==!1||!!b.data?.orgShare})}function Ln(t){return yt(t.providerId)}function $n(t){return kt(t.providerId)}function be(t){return t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function ze(t){if(!t)return"—";const e=typeof t=="string"?new Date(t):t;return isNaN(e.getTime())?"—":e.toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"})}function En(t){return t?t.replace(/-\d{8}(?:-[a-z0-9]+)*$/i,"").replace(/-/g," "):"—"}function Fn(t){const e=A.c(4),{items:s}=t;let r;e[0]!==s?(r=s.map(Rn),e[0]=s,e[1]=r):r=e[1];let i;return e[2]!==r?(i=n.jsx("div",{className:"grid grid-cols-2 gap-x-8 gap-y-6",children:r}),e[2]=r,e[3]=i):i=e[3],i}function Rn(t){return n.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[n.jsx("span",{className:"text-xs text-muted-foreground truncate",children:t.label}),n.jsx("span",{className:"text-sm text-foreground tabular-nums truncate",children:t.value})]},t.label)}function On(t){const e=A.c(33),{userTokens:s,assistantTokens:r,otherTokens:i}=t,a=K(),o=s+r+i,c=o>0?s/o*100:0,u=o>0?r/o*100:0,l=o>0?i/o*100:0;let d;e[0]!==c?(d=c>0&&n.jsx("div",{className:"h-full bg-chart-1",style:{width:`${c}%`}}),e[0]=c,e[1]=d):d=e[1];let m;e[2]!==u?(m=u>0&&n.jsx("div",{className:"h-full bg-chart-2",style:{width:`${u}%`}}),e[2]=u,e[3]=m):m=e[3];let f;e[4]!==l?(f=l>0&&n.jsx("div",{className:"h-full bg-muted-foreground/30",style:{width:`${l}%`}}),e[4]=l,e[5]=f):f=e[5];let h;e[6]!==d||e[7]!==m||e[8]!==f?(h=n.jsxs("div",{className:"flex h-2 w-full overflow-hidden rounded-full bg-muted",children:[d,m,f]}),e[6]=d,e[7]=m,e[8]=f,e[9]=h):h=e[9];let j;e[10]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-chart-1 shrink-0"}),e[10]=j):j=e[10];let y;e[11]!==a||e[12]!==c?(y=a("chat.contextPanel.userPercent",{pct:c.toFixed(1)}),e[11]=a,e[12]=c,e[13]=y):y=e[13];let v;e[14]!==y?(v=n.jsxs("div",{className:"flex items-center gap-1.5",children:[j,n.jsx("span",{className:"text-xs text-muted-foreground",children:y})]}),e[14]=y,e[15]=v):v=e[15];let x;e[16]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-chart-2 shrink-0"}),e[16]=x):x=e[16];let g;e[17]!==u||e[18]!==a?(g=a("chat.contextPanel.assistantPercent",{pct:u.toFixed(1)}),e[17]=u,e[18]=a,e[19]=g):g=e[19];let b;e[20]!==g?(b=n.jsxs("div",{className:"flex items-center gap-1.5",children:[x,n.jsx("span",{className:"text-xs text-muted-foreground",children:g})]}),e[20]=g,e[21]=b):b=e[21];let S;e[22]!==l||e[23]!==i||e[24]!==a?(S=i>0&&n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-muted-foreground/30 shrink-0"}),n.jsx("span",{className:"text-xs text-muted-foreground",children:a("chat.contextPanel.otherPercent",{pct:l.toFixed(1)})})]}),e[22]=l,e[23]=i,e[24]=a,e[25]=S):S=e[25];let p;e[26]!==b||e[27]!==S||e[28]!==v?(p=n.jsxs("div",{className:"flex flex-wrap gap-x-3 gap-y-1",children:[v,b,S]}),e[26]=b,e[27]=S,e[28]=v,e[29]=p):p=e[29];let k;return e[30]!==p||e[31]!==h?(k=n.jsxs("div",{className:"flex flex-col gap-2",children:[h,p]}),e[30]=p,e[31]=h,e[32]=k):k=e[32],k}function Bn(t){const e=A.c(14),{agentId:s,isError:r}=t,i=Ee(s),a=K();let o;e[0]!==i?.title||e[1]!==a?(o=i?.title??a("chat.subtask.subtaskNoun"),e[0]=i?.title,e[1]=a,e[2]=o):o=e[2];const c=o,u=i?.icon??null;let l;e[3]!==u||e[4]!==c?(l=n.jsx(wt,{icon:u,name:c,size:"xs",className:"size-6 rounded-md shrink-0"}),e[3]=u,e[4]=c,e[5]=l):l=e[5];const d=r?"text-destructive":"text-foreground";let m;e[6]!==d?(m=se("shrink-0 font-medium",d),e[6]=d,e[7]=m):m=e[7];let f;e[8]!==c||e[9]!==m?(f=n.jsx("span",{className:m,children:c}),e[8]=c,e[9]=m,e[10]=f):f=e[10];let h;return e[11]!==l||e[12]!==f?(h=n.jsxs(n.Fragment,{children:[l,f]}),e[11]=l,e[12]=f,e[13]=h):h=e[13],h}function Dn(t){const e=A.c(12),{isError:s}=t,r=K();let i;e[0]!==r?(i=r("chat.contextPanel.subtask"),e[0]=r,e[1]=i):i=e[1];const a=i;let o;e[2]!==a?(o=n.jsx(wt,{icon:null,name:a,size:"xs",className:"size-6 rounded-md shrink-0"}),e[2]=a,e[3]=o):o=e[3];const c=s?"text-destructive":"text-foreground";let u;e[4]!==c?(u=se("shrink-0 font-medium",c),e[4]=c,e[5]=u):u=e[5];let l;e[6]!==a||e[7]!==u?(l=n.jsx("span",{className:u,children:a}),e[6]=a,e[7]=u,e[8]=l):l=e[8];let d;return e[9]!==o||e[10]!==l?(d=n.jsxs(n.Fragment,{children:[o,l]}),e[9]=o,e[10]=l,e[11]=d):d=e[11],d}function zn(t){const e=A.c(18),{part:s}=t,r=s.input?.agent_id,i=s.state==="input-streaming"||s.state==="input-available"||s.state==="output-available"&&s.preliminary===!0,a=s.state==="output-error",o=s.state==="approval-requested";let c;e[0]!==a?(c=n.jsx(Dn,{isError:a}),e[0]=a,e[1]=c):c=e[1];let u;e[2]!==r||e[3]!==a?(u=n.jsx(Bn,{agentId:r,isError:a}),e[2]=r,e[3]=a,e[4]=u):u=e[4];let l;e[5]!==c||e[6]!==u?(l=n.jsx(B.Suspense,{fallback:c,children:u}),e[5]=c,e[6]=u,e[7]=l):l=e[7];let d;e[8]!==s.input?(d=s.input?.prompt&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-muted-foreground/50",children:"·"}),n.jsx("span",{className:"truncate text-muted-foreground",children:s.input.prompt})]}),e[8]=s.input,e[9]=d):d=e[9];let m;e[10]!==o||e[11]!==a||e[12]!==i?(m=n.jsx("span",{className:"ml-auto shrink-0",children:i?n.jsx(ve,{className:"size-3 text-muted-foreground"}):a?n.jsx(cs,{size:12,className:"text-destructive"}):o?n.jsx(We,{size:12,className:"text-warning"}):n.jsx(As,{size:12,className:"text-success"})}),e[10]=o,e[11]=a,e[12]=i,e[13]=m):m=e[13];let f;return e[14]!==l||e[15]!==d||e[16]!==m?(f=n.jsxs("div",{className:"flex items-center gap-2 text-xs min-w-0",children:[l,d,m]}),e[14]=l,e[15]=d,e[16]=m,e[17]=f):f=e[17],f}function Gn(t){const e=A.c(51),{onClose:s,back:r,className:i}=t,a=K(),[o,c]=B.useState(null),{messages:u}=Ye(),{activeTask:l}=$e(),{selectedModel:d,selectedVirtualMcp:m}=St(),f=ws(u),h=[...u].reverse().find(ea),j=h?.metadata?.usage,y=[...u].reverse().find(Jn)?.metadata?.models?.thinking,v=h?.metadata?.modelLimits?.contextWindow??(!y||y.id===d?.modelId?d?.limits?.contextWindow:null)??null,x=j?.contextTokens??0,g=v&&v>0?(x/v*100).toFixed(1):null,b=u;let S;e[0]!==b?(S=b.filter(Xn).reduce(Qn,0),e[0]=b,e[1]=S):S=e[1];const p=S,k=u;let T;e[2]!==k?(T=k.filter(Zn).reduce(Yn,0),e[2]=k,e[3]=T):T=e[3];const N=T,_=Math.max(0,f.totalTokens-p-N),w=u[0],I=u.at(-1),P=w?.metadata?.created_at??l?.created_at,L=I?.metadata?.created_at??l?.updated_at,$=u.filter(Wn),E=u.flatMap(Un),F=En(y?.id??d?.modelId),R=m?.title??"Super Agent",M=$s(),C=[{label:a("chat.contextPanel.sessionLabel"),value:l?.title??a("chat.contextPanel.newChat")},{label:a("chat.contextPanel.messagesLabel"),value:$.length},{label:a("chat.contextPanel.agentLabel"),value:R},...M?[{label:a("chat.contextPanel.modelLabel"),value:F}]:[],{label:a("chat.contextPanel.contextLimitLabel"),value:v?be(v):"—"},{label:a("chat.contextPanel.sessionTokensLabel"),value:f.totalTokens>0?be(f.totalTokens):"0"},{label:a("chat.contextPanel.usageLabel"),value:g!==null?`${g}%`:"—"},{label:a("chat.contextPanel.inputTokensLabel"),value:f.inputTokens>0?be(f.inputTokens):"0"},{label:a("chat.contextPanel.outputTokensLabel"),value:f.outputTokens>0?be(f.outputTokens):"0"},{label:a("chat.contextPanel.reasoningTokensLabel"),value:f.reasoningTokens>0?be(f.reasoningTokens):"0"},...M?[{label:a("chat.contextPanel.costLabel"),value:f.cost>0?`$${f.cost<.001?f.cost.toFixed(6):f.cost.toFixed(4)}`:"$0.00"}]:[],{label:a("chat.contextPanel.sessionCreatedLabel"),value:ze(P)},{label:a("chat.contextPanel.lastActivityLabel"),value:ze(L)}];if(!l&&$.length===0){let D;e[4]!==i?(D=se("flex flex-col h-full w-full border-l border-border bg-background",i),e[4]=i,e[5]=D):D=e[5];let re;e[6]!==a?(re=a("chat.contextPanel.title"),e[6]=a,e[7]=re):re=e[7];let X;e[8]!==re?(X=n.jsx("span",{className:"text-sm font-medium text-foreground",children:re}),e[8]=re,e[9]=X):X=e[9];let J;e[10]!==r?(J=r?n.jsx(at,{size:14,className:"text-muted-foreground"}):n.jsx(rt,{size:14,className:"text-muted-foreground"}),e[10]=r,e[11]=J):J=e[11];let ee;e[12]!==s||e[13]!==J?(ee=n.jsx("button",{type:"button",onClick:s,className:"flex size-6 items-center justify-center hover:bg-accent transition-colors rounded-lg",children:J}),e[12]=s,e[13]=J,e[14]=ee):ee=e[14];let ne;e[15]!==X||e[16]!==ee?(ne=n.jsxs("div",{className:"h-11 px-4 flex items-center justify-between shrink-0 border-b border-border/50",children:[X,ee]}),e[15]=X,e[16]=ee,e[17]=ne):ne=e[17];let ie;e[18]!==a?(ie=a("chat.contextPanel.emptyState"),e[18]=a,e[19]=ie):ie=e[19];let te;e[20]!==ie?(te=n.jsx("div",{className:"flex-1 flex items-center justify-center px-4 text-center",children:n.jsx("p",{className:"text-xs text-muted-foreground",children:ie})}),e[20]=ie,e[21]=te):te=e[21];let oe;return e[22]!==ne||e[23]!==te||e[24]!==D?(oe=n.jsxs("div",{className:D,children:[ne,te]}),e[22]=ne,e[23]=te,e[24]=D,e[25]=oe):oe=e[25],oe}let G;e[26]!==i?(G=se("flex flex-col h-full w-full border-l border-border bg-background overflow-y-auto",i),e[26]=i,e[27]=G):G=e[27];let z;e[28]!==a?(z=a("chat.contextPanel.title"),e[28]=a,e[29]=z):z=e[29];let H;e[30]!==z?(H=n.jsx("span",{className:"text-sm font-medium text-foreground",children:z}),e[30]=z,e[31]=H):H=e[31];let O;e[32]!==r?(O=r?n.jsx(at,{className:"size-3.5"}):n.jsx(rt,{className:"size-3.5"}),e[32]=r,e[33]=O):O=e[33];let U;e[34]!==s||e[35]!==O?(U=n.jsx(qe,{type:"button",variant:"ghost",size:"icon-sm",onClick:s,className:"text-muted-foreground",children:O}),e[34]=s,e[35]=O,e[36]=U):U=e[36];let Z;e[37]!==H||e[38]!==U?(Z=n.jsxs("div",{className:"flex h-11 shrink-0 items-center justify-between border-b border-border/50 px-4",children:[H,U]}),e[37]=H,e[38]=U,e[39]=Z):Z=e[39];let Y;e[40]!==a?(Y=a("chat.contextPanel.contextBreakdownSection"),e[40]=a,e[41]=Y):Y=e[41];let Q;e[42]!==Y?(Q=n.jsx("span",{className:"text-xs text-muted-foreground",children:Y}),e[42]=Y,e[43]=Q):Q=e[43];let q;e[44]!==N||e[45]!==_||e[46]!==p?(q=n.jsx(On,{userTokens:p,assistantTokens:N,otherTokens:_}),e[44]=N,e[45]=_,e[46]=p,e[47]=q):q=e[47];let le;return e[48]!==Q||e[49]!==q?(le=n.jsxs("div",{className:"flex flex-col gap-3",children:[Q,q]}),e[48]=Q,e[49]=q,e[50]=le):le=e[50],n.jsxs("div",{className:G,children:[Z,n.jsxs("div",{className:"flex flex-col gap-8 p-6",children:[E.length>0&&n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("span",{className:"text-xs text-muted-foreground",children:a("chat.contextPanel.subtasksSection")}),n.jsx("div",{className:"flex flex-col gap-1",children:E.map(Kn)})]}),n.jsx(Fn,{items:C}),le,$.length>0&&n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("span",{className:"text-xs text-muted-foreground",children:a("chat.contextPanel.rawMessagesSection")}),n.jsx("div",{className:"flex flex-col gap-1",children:$.map(D=>{const re=D.metadata?.created_at,X=o?.id===D.id;return n.jsxs("div",{className:"rounded-md border border-border/50 overflow-hidden",children:[n.jsxs("button",{type:"button",onClick:()=>c(X?null:D),className:"flex items-center justify-between gap-2 px-3 py-2 text-xs hover:bg-accent w-full text-left cursor-pointer",children:[n.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[n.jsx("span",{className:se("shrink-0 font-medium",D.role==="user"?"text-chart-1":"text-chart-2"),children:D.role}),n.jsx("span",{className:"text-muted-foreground",children:"•"}),n.jsx("span",{className:"truncate text-muted-foreground font-mono",children:D.id})]}),re&&n.jsx("span",{className:"shrink-0 text-muted-foreground tabular-nums",children:ze(re)})]}),X&&n.jsxs(n.Fragment,{children:[D.role==="assistant"&&(()=>{const J=D.metadata?._request;if(!J)return null;const ee=J.systemSections??[],ne=Math.max(1,...ee.map(Vn)),ie=ee.reduce(Hn,0);return n.jsxs("div",{className:"border-t border-border/50 px-3 py-2.5 text-xs space-y-2.5",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"font-medium text-foreground",children:a("chat.contextPanel.requestLabel")}),n.jsxs("span",{className:"text-muted-foreground tabular-nums",children:[J.activeTools??0," / ",J.tools??0," ",a("chat.contextPanel.toolsActive")]})]}),ee.length>0&&n.jsxs("div",{className:"space-y-1.5",children:[n.jsxs("div",{className:"text-muted-foreground",children:[a("chat.contextPanel.systemPromptLabel")," ",n.jsxs("span",{className:"tabular-nums",children:["~",Math.round(ie/4).toLocaleString()," ",a("chat.contextPanel.tokAbbrev")]})]}),ee.map((te,oe)=>{const ce=te.preview.match(/^<([a-z-]+)/i)?.[1]??`section ${oe}`,xe=te.chars/ne*100,de=Math.round(te.chars/4);return n.jsxs("div",{className:"space-y-0.5",children:[n.jsxs("div",{className:"flex items-center justify-between gap-2",children:[n.jsx("span",{className:"font-mono text-foreground truncate",children:ce}),n.jsxs("span",{className:"text-muted-foreground tabular-nums shrink-0",children:["~",de.toLocaleString()," ",a("chat.contextPanel.tokAbbrev")]})]}),n.jsx("div",{className:"h-1 w-full rounded-full bg-muted overflow-hidden",children:n.jsx("div",{className:"h-full rounded-full bg-chart-3",style:{width:`${xe}%`}})})]},oe)})]})]})})(),n.jsx("pre",{className:"text-xs font-mono bg-muted px-3 py-2 overflow-auto whitespace-pre-wrap break-all border-t border-border/50 max-h-64",children:JSON.stringify(D,null,2)})]})]},D.id)})})]})]})]})}function Hn(t,e){return t+e.chars}function Vn(t){return t.chars}function Kn(t,e){return n.jsx(zn,{part:t},e)}function Un(t){return(t.parts??[]).filter(qn)}function qn(t){return t.type==="tool-subtask"}function Wn(t){return t.role!=="system"}function Yn(t,e){const s=e.metadata?.usage;return t+(s?.outputTokens??0)}function Zn(t){return t.role==="assistant"}function Qn(t,e){const s=e.metadata?.usage;return t+(s?.inputTokens??0)}function Xn(t){return t.role==="user"}function Jn(t){return t.role==="assistant"&&t.metadata?.models}function ea(t){return t.role==="assistant"&&t.metadata?.usage}function ta(t){const e=A.c(21),{onOpenContextPanel:s}=t,{org:r}=ae(),{selectedVirtualMcp:i}=St();let a;e[0]!==r.id?(a=je(r.id),e[0]=r.id,e[1]=a):a=e[1];const c=i??a,l=Ee(c.id)??c,d=l.title??"Super Agent",m=l.icon??null,f=l.description??null;let h;e[2]!==m||e[3]!==d?(h=n.jsx(ye,{icon:m,name:d,size:"lg"}),e[2]=m,e[3]=d,e[4]=h):h=e[4];let j;e[5]!==d?(j=n.jsx("h2",{className:"text-2xl font-semibold tracking-tight text-foreground",children:d}),e[5]=d,e[6]=j):j=e[6];let y;e[7]!==f?(y=f?n.jsx("p",{className:"text-sm text-muted-foreground max-w-md text-balance",children:f}):null,e[7]=f,e[8]=y):y=e[8];let v;e[9]!==j||e[10]!==y?(v=n.jsxs("div",{className:"space-y-1.5",children:[j,y]}),e[9]=j,e[10]=y,e[11]=v):v=e[11];let x;e[12]!==h||e[13]!==v?(x=n.jsxs("div",{className:"flex-1 min-h-0 flex flex-col items-center justify-center gap-4 px-6 text-center overflow-hidden",children:[h,v]}),e[12]=h,e[13]=v,e[14]=x):x=e[14];let g;e[15]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(W.IceBreakers,{className:"pb-3"}),e[15]=g):g=e[15];let b;e[16]!==s?(b=n.jsxs(W.Footer,{children:[g,n.jsx(W.Input,{onOpenContextPanel:s})]}),e[16]=s,e[17]=b):b=e[17];let S;return e[18]!==x||e[19]!==b?(S=n.jsxs(n.Fragment,{children:[x,b]}),e[18]=x,e[19]=b,e[20]=S):S=e[20],S}function ot(t){const e=A.c(17),{outputs:s,collapsed:r,onToggle:i,variant:a}=t,o=a==="card"?"rounded-xl bg-muted/95 shadow-edge backdrop-blur-sm":"border-b border-border bg-background";let c;e[0]!==o?(c=se(o),e[0]=o,e[1]=c):c=e[1];let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx("span",{className:"text-sm font-medium text-foreground",children:"Files in this task"}),e[2]=u):u=e[2];const l=r&&"-rotate-90";let d;e[3]!==l?(d=se("size-4 text-muted-foreground transition-transform",l),e[3]=l,e[4]=d):d=e[4];let m;e[5]!==d?(m=n.jsx(Ze,{className:d}),e[5]=d,e[6]=m):m=e[6];let f;e[7]!==i||e[8]!==m?(f=n.jsxs("button",{type:"button",onClick:i,className:"flex w-full items-center justify-between px-3 py-2.5 text-left",children:[u,m]}),e[7]=i,e[8]=m,e[9]=f):f=e[9];let h;e[10]!==r||e[11]!==s?(h=!r&&n.jsx("div",{className:"flex max-h-72 flex-col gap-1.5 overflow-y-auto px-2 pb-2",children:s.map(sa)}),e[10]=r,e[11]=s,e[12]=h):h=e[12];let j;return e[13]!==c||e[14]!==f||e[15]!==h?(j=n.jsxs("div",{className:c,children:[f,h]}),e[13]=c,e[14]=f,e[15]=h,e[16]=j):j=e[16],j}function sa(t){return n.jsx(Es,{file:t},t.key)}function na(){const t=A.c(13),e=Le()?.taskId??null,s=Fs();let r;t[0]!==s?(r={enabled:s},t[0]=s,t[1]=r):r=t[1];const{data:i}=Rs(e,r),[a,o]=B.useState(!1),[c,u]=B.useState(!0);if(!e||!i||i.length===0)return null;let l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l=()=>o(ra),t[2]=l):l=t[2];let d;t[3]!==a||t[4]!==i?(d=n.jsx("div",{className:"absolute top-2 right-2 z-10 hidden w-72 @[1280px]:block",children:n.jsx(ot,{variant:"card",outputs:i,collapsed:a,onToggle:l})}),t[3]=a,t[4]=i,t[5]=d):d=t[5];let m;t[6]===Symbol.for("react.memo_cache_sentinel")?(m=()=>u(aa),t[6]=m):m=t[6];let f;t[7]!==c||t[8]!==i?(f=n.jsx("div",{className:"shrink-0 @[1280px]:hidden",children:n.jsx(ot,{variant:"bar",outputs:i,collapsed:c,onToggle:m})}),t[7]=c,t[8]=i,t[9]=f):f=t[9];let h;return t[10]!==d||t[11]!==f?(h=n.jsxs(n.Fragment,{children:[d,f]}),t[10]=d,t[11]=f,t[12]=h):h=t[12],h}function aa(t){return!t}function ra(t){return!t}function ia(){const t=A.c(1);B.use(Ye().ready);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(ks,{children:n.jsx(la,{})}),t[0]=e):e=t[0],e}function la(){const t=A.c(29),{active:e}=Ns(),{org:s}=ae(),r=Le(),{isChatEmpty:i}=Ye(),[a,o]=B.useState("chat"),c=Os(),u=K(),l=An(),{runtime:d}=jt(r?.virtualMcpId);if(l!==null&&d!=="cms"){let N;return t[0]!==l||t[1]!==u?(N=n.jsx(W,{className:"animate-in fade-in-0 duration-200",children:n.jsx(W.Main,{className:"flex flex-col items-center",children:n.jsx(W.EmptyState,{children:l==="codex-provider"?n.jsx(W.NoAiProviderEmptyState,{title:u("settings.codexSubscription.setupHeading"),description:u("settings.codexSubscription.setupDescription"),providerFilter:yt}):l==="claude-code-provider"?n.jsx(W.NoAiProviderEmptyState,{title:u("chat.noAiProviderEmptyState.supportedHeading"),description:u("chat.noAiProviderEmptyState.supportedSubtitle"),providerFilter:kt}):n.jsx(W.NoAiProviderEmptyState,{})})})}),t[0]=l,t[1]=u,t[2]=N):N=t[2],N}let f;t[3]!==c.hasDecoKey||t[4]!==c.hasOnlyDecoProvider||t[5]!==c.isLoading||t[6]!==c.isZeroBalance||t[7]!==i||t[8]!==s?(f=c.hasDecoKey&&c.isZeroBalance&&c.hasOnlyDecoProvider&&!c.isLoading&&i&&!js(s.id),t[3]=c.hasDecoKey,t[4]=c.hasOnlyDecoProvider,t[5]=c.isLoading,t[6]=c.isZeroBalance,t[7]=i,t[8]=s,t[9]=f):f=t[9];const h=f;let j;t[10]!==h?(j=h&&n.jsx(W.CreditsEmptyState,{}),t[10]=h,t[11]=j):j=t[11];let y;t[12]!==a||t[13]!==i||t[14]!==d||t[15]!==e?(y=!e&&n.jsx("div",{inert:a!=="chat"?!0:void 0,"aria-hidden":a!=="chat",className:se("absolute inset-0 flex flex-col transition-opacity duration-100 ease-out",a!=="chat"?"opacity-0 pointer-events-none":"opacity-100"),children:i&&d!=="cms"?n.jsx(ta,{onOpenContextPanel:()=>o("context")}):n.jsxs(n.Fragment,{children:[n.jsxs(W.Main,{className:"relative flex flex-col overflow-hidden @container",children:[n.jsx(na,{}),n.jsx("div",{className:"min-h-0 flex-1",children:n.jsx(W.Messages,{})})]}),n.jsx(W.Footer,{children:n.jsx(W.Input,{onOpenContextPanel:()=>o("context")})})]})}),t[12]=a,t[13]=i,t[14]=d,t[15]=e,t[16]=y):y=t[16];let v;t[17]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(Ts,{}),t[17]=v):v=t[17];const x=a!=="context"?!0:void 0,g=a!=="context",b=a==="context"?"opacity-100":"opacity-0 pointer-events-none";let S;t[18]!==b?(S=se("absolute inset-0 flex flex-col transition-opacity duration-100 ease-out",b),t[18]=b,t[19]=S):S=t[19];let p;t[20]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx(Gn,{back:!0,onClose:()=>o("chat")}),t[20]=p):p=t[20];let k;t[21]!==x||t[22]!==g||t[23]!==S?(k=n.jsx("div",{inert:x,"aria-hidden":g,className:S,children:p}),t[21]=x,t[22]=g,t[23]=S,t[24]=k):k=t[24];let T;return t[25]!==j||t[26]!==y||t[27]!==k?(T=n.jsxs(W,{className:"relative overflow-hidden animate-in fade-in-0 duration-200",children:[j,y,v,k]}),t[25]=j,t[26]=y,t[27]=k,t[28]=T):T=t[28],T}function oa(){const t=A.c(7),e=K();let s;t[0]!==e?(s=e("agentShellLayout.agentShellLayout.chatLoadingError"),t[0]=e,t[1]=s):s=t[1];let r;t[2]!==s?(r=n.jsx("div",{role:"alert",className:"flex h-full flex-1 items-center justify-center text-sm text-muted-foreground",children:s}),t[2]=s,t[3]=r):r=t[3];let i;t[4]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(Ie,{children:n.jsx(ia,{})}),t[4]=i):i=t[4];let a;return t[5]!==r?(a=n.jsx(pt,{fallback:r,children:i}),t[5]=r,t[6]=a):a=t[6],a}function ca(t){const e=A.c(10),{org:s}=ae(),r=qs(),{data:i}=pe.useSession(),a=i?.user?.id,o=t?.id??null,c=!!t&&!!a&&!!t.created_by&&t.created_by!==a;let u;e[0]!==s.id||e[1]!==o?(u=fe.viewedThreadMetadataRefresh(s.id,o??""),e[0]=s.id,e[1]=o,e[2]=u):u=e[2];const l=!!r&&!!o&&c;let d;e[3]!==r||e[4]!==o?(d=async()=>(await r?.refreshThreadMetadata(o??""),!0),e[3]=r,e[4]=o,e[5]=d):d=e[5];let m;e[6]!==u||e[7]!==l||e[8]!==d?(m={queryKey:u,enabled:l,staleTime:Number.POSITIVE_INFINITY,queryFn:d},e[6]=u,e[7]=l,e[8]=d,e[9]=m):m=e[9],me(m)}function Ge(t){const e=A.c(14),{label:s,value:r,onChange:i,options:a}=t;let o;e[0]!==s?(o=n.jsx("span",{className:"text-sm text-muted-foreground",children:s}),e[0]=s,e[1]=o):o=e[1];let c;e[2]!==i?(c=m=>m&&i(m),e[2]=i,e[3]=c):c=e[3];let u;e[4]!==a?(u=a.map(da),e[4]=a,e[5]=u):u=e[5];let l;e[6]!==s||e[7]!==c||e[8]!==u||e[9]!==r?(l=n.jsx(rn,{type:"single",size:"sm",value:r,onValueChange:c,"aria-label":s,className:"gap-0.5 rounded-lg border border-border bg-muted/50 p-0.5",children:u}),e[6]=s,e[7]=c,e[8]=u,e[9]=r,e[10]=l):l=e[10];let d;return e[11]!==o||e[12]!==l?(d=n.jsxs("div",{className:"flex items-center justify-between gap-3",children:[o,l]}),e[11]=o,e[12]=l,e[13]=d):d=e[13],d}function da(t){return n.jsxs(an,{value:t.value,className:"h-6 gap-1.5 rounded-lg px-2 text-xs font-medium text-muted-foreground hover:bg-transparent data-[state=on]:bg-card data-[state=on]:text-foreground data-[state=on]:shadow-edge",children:[t.icon,t.label]},t.value)}function ua(t){const e=A.c(91),{panel:s,className:r}=t,i=r===void 0?"md:size-[34px]":r,a=K();let o;e[0]!==a?(o=a("sidebar.taskGroupsList.filterChats"),e[0]=a,e[1]=o):o=e[1];let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(ds,{size:16}),e[2]=c):c=e[2];let u;e[3]!==s.filtersActive?(u=s.filtersActive&&n.jsx("span",{className:"absolute right-1 top-1 size-1.5 rounded-full bg-primary ring-2 ring-sidebar"}),e[3]=s.filtersActive,e[4]=u):u=e[4];let l;e[5]!==i||e[6]!==s.filtersActive||e[7]!==o||e[8]!==u?(l=n.jsx(Fe,{asChild:!0,children:n.jsx(Lt,{asChild:!0,children:n.jsxs(_e,{"aria-label":o,active:s.filtersActive,className:i,children:[c,u]})})}),e[5]=i,e[6]=s.filtersActive,e[7]=o,e[8]=u,e[9]=l):l=e[9];let d;e[10]!==a?(d=a("sidebar.taskGroupsList.filterChats"),e[10]=a,e[11]=d):d=e[11];let m;e[12]!==d?(m=n.jsx(Re,{side:"bottom",children:d}),e[12]=d,e[13]=m):m=e[13];let f;e[14]!==l||e[15]!==m?(f=n.jsxs(Oe,{children:[l,m]}),e[14]=l,e[15]=m,e[16]=f):f=e[16];let h;e[17]!==a?(h=a("sidebar.taskGroupsList.filterView"),e[17]=a,e[18]=h):h=e[18];const j=s.groupBy;let y;e[19]!==s?(y=D=>{he("tasks_panel_group_by_changed",{to_value:D}),s.setGroupBy(D)},e[19]=s,e[20]=y):y=e[20];let v;e[21]!==a?(v=a("sidebar.taskGroupsList.viewList"),e[21]=a,e[22]=v):v=e[22];let x;e[23]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(us,{size:13}),e[23]=x):x=e[23];let g;e[24]!==v?(g={value:"flat",label:v,icon:x},e[24]=v,e[25]=g):g=e[25];let b;e[26]!==a?(b=a("sidebar.taskGroupsList.viewStatus"),e[26]=a,e[27]=b):b=e[27];let S;e[28]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx(fs,{size:13}),e[28]=S):S=e[28];let p;e[29]!==b?(p={value:"status",label:b,icon:S},e[29]=b,e[30]=p):p=e[30];let k;e[31]!==g||e[32]!==p?(k=[g,p],e[31]=g,e[32]=p,e[33]=k):k=e[33];let T;e[34]!==s.groupBy||e[35]!==y||e[36]!==k||e[37]!==h?(T=n.jsx(Ge,{label:h,value:j,onChange:y,options:k}),e[34]=s.groupBy,e[35]=y,e[36]=k,e[37]=h,e[38]=T):T=e[38];let N;e[39]!==a?(N=a("sidebar.taskGroupsList.filterType"),e[39]=a,e[40]=N):N=e[40];const _=s.typeFilter;let w;e[41]!==s?(w=D=>{he("tasks_panel_filter_changed",{to_value:D}),s.setTypeFilter(D)},e[41]=s,e[42]=w):w=e[42];let I;e[43]!==a?(I=a("sidebar.taskGroupsList.typeAll"),e[43]=a,e[44]=I):I=e[44];let P;e[45]!==I?(P={value:"all",label:I},e[45]=I,e[46]=P):P=e[46];let L;e[47]!==a?(L=a("sidebar.taskGroupsList.typeChats"),e[47]=a,e[48]=L):L=e[48];let $;e[49]!==L?($={value:"manual",label:L},e[49]=L,e[50]=$):$=e[50];let E;e[51]!==a?(E=a("sidebar.taskGroupsList.typeAuto"),e[51]=a,e[52]=E):E=e[52];let F;e[53]!==E?(F={value:"automation",label:E},e[53]=E,e[54]=F):F=e[54];let R;e[55]!==P||e[56]!==$||e[57]!==F?(R=[P,$,F],e[55]=P,e[56]=$,e[57]=F,e[58]=R):R=e[58];let M;e[59]!==s.typeFilter||e[60]!==N||e[61]!==w||e[62]!==R?(M=n.jsx(Ge,{label:N,value:_,onChange:w,options:R}),e[59]=s.typeFilter,e[60]=N,e[61]=w,e[62]=R,e[63]=M):M=e[63];let C;e[64]!==a?(C=a("sidebar.taskGroupsList.filterScope"),e[64]=a,e[65]=C):C=e[65];const G=s.showAll?"team":"mine";let z;e[66]!==s?(z=D=>s.setShowAll(D==="team"),e[66]=s,e[67]=z):z=e[67];let H;e[68]!==a?(H=a("sidebar.taskGroupsList.scopeMine"),e[68]=a,e[69]=H):H=e[69];let O;e[70]!==H?(O={value:"mine",label:H},e[70]=H,e[71]=O):O=e[71];let U;e[72]!==a?(U=a("sidebar.taskGroupsList.scopeTeam"),e[72]=a,e[73]=U):U=e[73];let Z;e[74]!==U?(Z={value:"team",label:U},e[74]=U,e[75]=Z):Z=e[75];let Y;e[76]!==O||e[77]!==Z?(Y=[O,Z],e[76]=O,e[77]=Z,e[78]=Y):Y=e[78];let Q;e[79]!==C||e[80]!==G||e[81]!==z||e[82]!==Y?(Q=n.jsx(Ge,{label:C,value:G,onChange:z,options:Y}),e[79]=C,e[80]=G,e[81]=z,e[82]=Y,e[83]=Q):Q=e[83];let q;e[84]!==T||e[85]!==M||e[86]!==Q?(q=n.jsxs($t,{align:"start",className:"w-64 flex flex-col gap-3 p-3",children:[T,M,Q]}),e[84]=T,e[85]=M,e[86]=Q,e[87]=q):q=e[87];let le;return e[88]!==q||e[89]!==f?(le=n.jsxs(Et,{children:[f,q]}),e[88]=q,e[89]=f,e[90]=le):le=e[90],le}function fa(t,e){return t.filter(s=>s.id===e||!!s.trigger_id||tn(s))}function ma(){const t=A.c(2),e=Ls()??[];let s;return t[0]!==e?(s=r=>{if(!r)return;const i=e.find(a=>a.id===r);return i?Pt(i.metadata):void 0},t[0]=e,t[1]=s):s=t[1],s}function ha(t){const e=A.c(9),{virtualMcpId:s,size:r,showAutomationBadge:i}=t,a=r===void 0?"sm":r,o=K();let c;e[0]!==a||e[1]!==s?(c=s?n.jsx(pa,{virtualMcpId:s,size:a}):n.jsx(ye,{icon:null,name:"?",size:a}),e[0]=a,e[1]=s,e[2]=c):c=e[2];let u;e[3]!==i||e[4]!==o?(u=i&&n.jsx("span",{"aria-label":o("tasksPanel.mcpAvatar.automationTriggered"),className:"absolute -bottom-0.5 -right-0.5 flex size-4 items-center justify-center rounded-full bg-special border border-special text-special-foreground",children:n.jsx(Ot,{size:10,className:"text-white"})}),e[3]=i,e[4]=o,e[5]=u):u=e[5];let l;return e[6]!==c||e[7]!==u?(l=n.jsxs("div",{className:"relative shrink-0",children:[c,u]}),e[6]=c,e[7]=u,e[8]=l):l=e[8],l}function pa(t){const e=A.c(6),{virtualMcpId:s,size:r}=t,i=Tt(s);if(!i){let c;return e[0]!==r?(c=n.jsx(ye,{icon:null,name:"?",size:r}),e[0]=r,e[1]=c):c=e[1],c}const a=i.icon??null;let o;return e[2]!==i.title||e[3]!==r||e[4]!==a?(o=n.jsx(ye,{icon:a,name:i.title,size:r}),e[2]=i.title,e[3]=r,e[4]=a,e[5]=o):o=e[5],o}const ct=["thread"];function xa(t){const e=A.c(53),{open:s,onOpenChange:r}=t,[i,a]=B.useState(""),{org:o}=ae(),{setTaskId:c}=Qe(),u=Pe(),l=K();let d,m,f,h;e[0]!==o.id||e[1]!==i?(h=i.trim(),d=h?20:10,f=me,m=fe.globalSearch(o.id,h,d,ct),e[0]=o.id,e[1]=i,e[2]=d,e[3]=m,e[4]=f,e[5]=h):(d=e[2],m=e[3],f=e[4],h=e[5]);let j;e[6]!==d||e[7]!==u||e[8]!==h?(j=async()=>{const C=await u.call("GLOBAL_SEARCH",{query:h,limit:d,types:[...ct]});return{...C,items:C.items.filter(ga)}},e[6]=d,e[7]=u,e[8]=h,e[9]=j):j=e[9];let y;e[10]!==s||e[11]!==m||e[12]!==j?(y={queryKey:m,enabled:s,queryFn:j,staleTime:1e4},e[10]=s,e[11]=m,e[12]=j,e[13]=y):y=e[13];const{data:v,isFetching:x}=f(y);let g;e[14]!==v?.items?(g=v?.items??[],e[14]=v?.items,e[15]=g):g=e[15];const b=g;let S;e[16]!==r?(S=C=>{C||a(""),r(C)},e[16]=r,e[17]=S):S=e[17];const p=S;let k;e[18]!==p||e[19]!==c?(k=C=>{p(!1),c(C.id,C.virtual_mcp_id??void 0)},e[18]=p,e[19]=c,e[20]=k):k=e[20];const T=k;let N;e[21]!==l?(N=l("tasksPanel.globalSearchDialog.title"),e[21]=l,e[22]=N):N=e[22];let _;e[23]!==N?(_=n.jsx(Wt,{children:N}),e[23]=N,e[24]=_):_=e[24];let w;e[25]!==l?(w=l("tasksPanel.globalSearchDialog.description"),e[25]=l,e[26]=w):w=e[26];let I;e[27]!==w?(I=n.jsx(Yt,{children:w}),e[27]=w,e[28]=I):I=e[28];let P;e[29]!==I||e[30]!==_?(P=n.jsxs(Zt,{className:"sr-only",children:[_,I]}),e[29]=I,e[30]=_,e[31]=P):P=e[31];let L;e[32]!==l?(L=l("tasksPanel.globalSearchDialog.placeholder"),e[32]=l,e[33]=L):L=e[33];let $;e[34]!==i||e[35]!==L?($=n.jsx(hn,{value:i,onValueChange:a,placeholder:L}),e[34]=i,e[35]=L,e[36]=$):$=e[36];let E;e[37]!==T||e[38]!==x||e[39]!==b||e[40]!==l||e[41]!==h?(E=n.jsx(dn,{children:x&&b.length===0?n.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:l("tasksPanel.globalSearchDialog.searching")}):b.length===0?n.jsx(un,{children:l("tasksPanel.globalSearchDialog.noResults")}):n.jsx(fn,{heading:h?void 0:l("tasksPanel.globalSearchDialog.recent"),children:b.map(C=>C.type==="thread"?n.jsxs(mn,{value:`thread:${C.id}:${C.title}`,onSelect:()=>T(C),className:"gap-2.5",children:[n.jsx(ha,{virtualMcpId:C.virtual_mcp_id,size:"xs"}),n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx("div",{className:"text-sm text-foreground truncate",children:C.title||l("tasksPanel.globalSearchDialog.untitledChat")})}),n.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:new Date(C.updated_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},`thread:${C.id}`):null)})}),e[37]=T,e[38]=x,e[39]=b,e[40]=l,e[41]=h,e[42]=E):E=e[42];let F;e[43]!==$||e[44]!==E?(F=n.jsxs(pn,{shouldFilter:!1,className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:[$,E]}),e[43]=$,e[44]=E,e[45]=F):F=e[45];let R;e[46]!==P||e[47]!==F?(R=n.jsxs(Qt,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[P,F]}),e[46]=P,e[47]=F,e[48]=R):R=e[48];let M;return e[49]!==p||e[50]!==s||e[51]!==R?(M=n.jsx(Xt,{open:s,onOpenChange:p,children:R}),e[49]=p,e[50]=s,e[51]=R,e[52]=M):M=e[52],M}function ga(t){return t.type==="thread"}function ba(t,e,s){if(!s)return;const r=t.findIndex(i=>i.id===e);if(r!==-1){for(let i=r+1;i<t.length;i++){const a=t[i];if(a?.created_by===s)return a}for(let i=r-1;i>=0;i--){const a=t[i];if(a?.created_by===s)return a}}}function va(t){return t==="ephemeral"||t.startsWith("thread:")}function Gt(t){const e=A.c(45),{task:s,isActive:r,onClick:i,onArchive:a,showAutomationBadge:o,showAgentIcon:c,hideStatusIdle:u,indented:l}=t,d=K(),m=xn(s.status),f=m.icon,h=s.metadata?.kind==="tool_call_run",j=Tt(h?void 0:s.virtual_mcp_id);let y;e[0]!==j?(y=_t(j),e[0]=j,e[1]=y):y=e[1];const v=y;vn(6e4);const x=o||!!s.trigger_id,g=s.id,b="button",S=0;let p;e[2]!==i?(p=z=>{z.target===z.currentTarget&&(z.key==="Enter"||z.key===" ")&&(z.preventDefault(),i())},e[2]=i,e[3]=p):p=e[3];const k=l?"-ml-4 pl-6":"pl-[9px]",T=r?"bg-accent text-accent-foreground":"hover:bg-accent";let N;e[4]!==k||e[5]!==T?(N=se("group/row flex items-center gap-2 py-1.5 rounded-md cursor-pointer transition-colors",k,"focus-visible:outline-none focus-visible:inset-ring-2 focus-visible:inset-ring-ring/50",T),e[4]=k,e[5]=T,e[6]=N):N=e[6];let _;e[7]!==h||e[8]!==c||e[9]!==j?.icon||e[10]!==j?.title?(_=c&&!h&&n.jsx(ye,{icon:j?.icon??null,name:j?.title??"?",size:"2xs"}),e[7]=h,e[8]=c,e[9]=j?.icon,e[10]=j?.title,e[11]=_):_=e[11];let w;e[12]!==x||e[13]!==d?(w=x&&n.jsx(Ot,{size:12,"aria-label":d("tasksPanel.taskRow.automationTriggered"),className:"shrink-0 text-special"}),e[12]=x,e[13]=d,e[14]=w):w=e[14];let I;e[15]!==d||e[16]!==s.title?(I=s.title||d("tasksPanel.taskRow.untitledTask"),e[15]=d,e[16]=s.title,e[17]=I):I=e[17];let P;e[18]!==I?(P=n.jsx("div",{className:"text-sm text-foreground truncate",children:I}),e[18]=I,e[19]=P):P=e[19];let L;e[20]!==w||e[21]!==P?(L=n.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[w,P]}),e[20]=w,e[21]=P,e[22]=L):L=e[22];let $;e[23]!==r||e[24]!==v||e[25]!==s.branch||e[26]!==s.updated_at?($=s.updated_at&&n.jsxs("div",{className:se("flex items-center gap-1 text-2xs min-w-0",r?"text-accent-foreground/70":"text-muted-foreground/60"),children:[s.branch&&!va(s.branch)?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"truncate font-mono",children:s.branch}),n.jsx("span",{className:"shrink-0",children:"·"})]}):v?n.jsxs(n.Fragment,{children:[n.jsxs("span",{className:"truncate",children:[v.owner,"/",v.name]}),n.jsx("span",{className:"shrink-0",children:"·"})]}):null,n.jsx("span",{className:"shrink-0",children:bn(new Date(s.updated_at))})]}),e[23]=r,e[24]=v,e[25]=s.branch,e[26]=s.updated_at,e[27]=$):$=e[27];let E;e[28]!==L||e[29]!==$?(E=n.jsxs("div",{className:"flex-1 min-w-0",children:[L,$]}),e[28]=L,e[29]=$,e[30]=E):E=e[30];const F="shrink-0 grid [grid-template-areas:'slot'] items-center justify-items-center",R=!u&&n.jsx("span",{className:se("[grid-area:slot] flex size-8 items-center justify-center pointer-events-none transition-opacity",a&&"group-hover/row:opacity-0"),"aria-label":d("tasksPanel.taskRow.statusLabel",{status:d(m.labelKey)}),children:s.status==="in_progress"?n.jsx(ve,{className:se("size-3.5",m.iconClassName)}):n.jsx(f,{size:14,className:m.iconClassName})});let M;e[31]!==a||e[32]!==d?(M=a&&n.jsxs(Oe,{children:[n.jsx(Fe,{asChild:!0,children:n.jsx(qe,{variant:"ghost",size:"icon","aria-label":d("tasksPanel.taskRow.archiveTask"),onClick:z=>{z.stopPropagation(),a()},className:"[grid-area:slot] opacity-0 pointer-events-none group-hover/row:opacity-100 group-hover/row:pointer-events-auto focus-visible:opacity-100 focus-visible:pointer-events-auto text-muted-foreground",children:n.jsx(Jt,{className:"size-3.5"})})}),n.jsx(Re,{side:"right",children:d("tasksPanel.taskRow.archive")})]}),e[31]=a,e[32]=d,e[33]=M):M=e[33];let C;e[34]!==R||e[35]!==M?(C=n.jsxs("div",{className:F,children:[R,M]}),e[34]=R,e[35]=M,e[36]=C):C=e[36];let G;return e[37]!==i||e[38]!==E||e[39]!==C||e[40]!==p||e[41]!==N||e[42]!==_||e[43]!==s.id?(G=n.jsxs("div",{"data-task-id":g,role:b,tabIndex:S,onClick:i,onKeyDown:p,className:N,children:[_,E,C]}),e[37]=i,e[38]=E,e[39]=C,e[40]=p,e[41]=N,e[42]=_,e[43]=s.id,e[44]=G):G=e[44],G}const dt=["requires_action","in_progress","failed","expired","completed"];function ya(t){const e=new Map(dt.map(s=>[s,[]]));for(const s of t){const r=s.status??"completed";(e.get(r)??e.get("completed")).push(s)}return dt.map(s=>({status:s,threads:e.get(s)}))}const ja="sidebar.group.expanded.";function Sa(t,e){const s=A.c(3),[r,i]=xt(`${ja}${t}`,e);let a;return s[0]!==r||s[1]!==i?(a=[r,i],s[0]=r,s[1]=i,s[2]=a):a=s[2],a}function Ht(t){const e=A.c(18),{onClick:s,isFetching:r,indented:i}=t,a=K();let o;e[0]!==a?(o=a("sidebar.showMoreButton.ariaLabel"),e[0]=a,e[1]=o):o=e[1];const c=i?"-ml-4 pl-6 pr-2":"px-2";let u;e[2]!==c?(u=se("flex items-center gap-2 py-1.5 rounded-lg text-sm text-muted-foreground",c,"hover:bg-sidebar-accent hover:text-foreground focus-ring","transition-colors disabled:cursor-progress disabled:opacity-60"),e[2]=c,e[3]=u):u=e[3];let l;e[4]!==r?(l=r&&n.jsx(ve,{className:"size-3.5"}),e[4]=r,e[5]=l):l=e[5];let d;e[6]!==r||e[7]!==a?(d=a(r?"sidebar.showMoreButton.loading":"sidebar.showMoreButton.showMore"),e[6]=r,e[7]=a,e[8]=d):d=e[8];let m;e[9]!==d?(m=n.jsx("span",{children:d}),e[9]=d,e[10]=m):m=e[10];let f;return e[11]!==r||e[12]!==s||e[13]!==o||e[14]!==u||e[15]!==l||e[16]!==m?(f=n.jsxs("button",{type:"button","aria-label":o,onClick:s,disabled:r,className:u,children:[l,m]}),e[11]=r,e[12]=s,e[13]=o,e[14]=u,e[15]=l,e[16]=m,e[17]=f):f=e[17],f}function ka(t,e,s,r){return[t,e,s,r.type,r.member,r.currentUserId??""].join("|")}function Na(t){return t.member==="mine"&&!t.currentUserId}const Vt=4;let Te=0;const Ke=[];function Ta(){for(;Te<Vt&&Ke.length>0;){const t=Ke.shift();t&&t()}}function Kt(t){return new Promise((e,s)=>{const r=()=>{Te++,t().then(e,s).finally(()=>{Te--,Ta()})};Te<Vt?r():Ke.push(r)})}const Be=10;function ut(t,e,s,r,i){const a={hidden:!1};r.member==="mine"&&r.currentUserId&&(a.created_by=r.currentUserId),r.type==="automation"&&(a.has_trigger=!0),r.type==="manual"&&(a.has_trigger=!1);const o={where:a,limit:i,offset:s,orderBy:[{field:["updated_at"],direction:"desc"}]};return o.status=e,o}function _a(t,e,s,r){let i=0;for(const a of t)Ut(a,e,s,r)&&i++;return i}function He(t,e,s,r){return _a(t,e,s,r)}function wa(t,e){return!!(t>=Be||t===0&&e)}function ft(t,e){return t<e}function Ca(t,e){return e===!1?!1:e===!0?!0:t}function Ut(t,e,s,r){return!(t.hidden||(t.status??"completed")!==s||r.member==="mine"&&r.currentUserId&&t.created_by!==r.currentUserId||r.type==="automation"&&!t.trigger_id||r.type==="manual"&&t.trigger_id)}const Ce=new Map,Ne=new Map;function Pa(t,e){return e?t>=Be?!0:null:!1}function mt(t){return Ce.get(t)}function Ia(t,e){Ce.set(t,e)}function Ma(t,e,s){const r=Ce.get(t);if(r!==void 0){s(r);return}let i=Ne.get(t);i||(i=Kt(e).then(a=>(Ce.set(t,a),Ne.delete(t),a)).catch(()=>(Ne.delete(t),Promise.reject(new Error("group probe failed")))),Ne.set(t,i)),i.then(s,()=>s(!1))}function ht(t){const e=t,s=Array.isArray(e.items)?e.items:[];return{items:s,hasMore:e.hasMore??s.length===Be,totalCount:typeof e.totalCount=="number"?e.totalCount:void 0}}function Aa(t,e,s,r,i){let a=0;for(const o of t)e.has(o.id)||Ut(o,s,r,i)&&a++;return a}function La(t,e,s,r){const i=A.c(8),{org:a}=ae(),o=ka(a.id,t,e,s);let c;i[0]!==s?(c=Na(s),i[0]=s,i[1]=c):c=i[1];const u=c,[l,d]=B.useState({isFetching:!1,isProbing:!1,identity:o,probeSubscribedIdentity:null,serverHasMore:null});l.identity!==o&&d({isFetching:!1,isProbing:!1,identity:o,probeSubscribedIdentity:null,serverHasMore:null});const m=Xe(),{threads:f,hasMore:h}=Je(),j=He(f,t,e,s),y=wa(j,h),v=Pa(j,h),x=Pe();if(l.identity===o&&l.serverHasMore===null){const T=v??mt(o);T!==void 0&&d({isFetching:!1,isProbing:!1,identity:o,probeSubscribedIdentity:l.probeSubscribedIdentity,serverHasMore:T})}!u&&l.identity===o&&l.serverHasMore===null&&v===null&&mt(o)===void 0&&l.probeSubscribedIdentity!==o&&(d(T=>T.identity===o?{...T,isProbing:!0,probeSubscribedIdentity:o}:T),Ma(o,async()=>{const T=ut(t,e,0,s,1),N=await x.call("COLLECTION_THREADS_LIST",T),{totalCount:_}=ht(N),w=He(m.threads.get(),t,e,s);return _===void 0?!1:ft(w,_)},T=>{d(N=>N.identity!==o?N:{...N,isProbing:!1,serverHasMore:T})}));const b=async function(){if(l.isFetching||l.isProbing||u)return;const N=o;d(_=>_.identity===N?{..._,isFetching:!0}:_);try{const _=He(f,t,e,s),w=ut(t,e,_,s,Be),I=await Kt(()=>x.call("COLLECTION_THREADS_LIST",w)),{items:P,hasMore:L,totalCount:$}=ht(I),E=new Set(f.map($a)),F=Aa(P,E,t,e,s),R=_;m.mergeThreads(P),d(M=>{if(M.identity!==N)return M;let C;return $!==void 0?C=ft(R+F,$):C=P.length===0||F===0?!1:L,Ia(N,C),{...M,isFetching:!1,serverHasMore:C}})}catch(_){const w=_,I=w instanceof Error?w.message:String(w);es.error(`Could not load more tasks: ${I}`),d(P=>P.identity===N?{...P,isFetching:!1}:P)}},S=l.isFetching||l.isProbing,p=!u&&!S&&Ca(y,l.serverHasMore);let k;return i[2]!==S||i[3]!==b||i[4]!==p||i[5]!==l.isProbing||i[6]!==l.serverHasMore?(k={hasMore:p,isFetching:S,isProbing:l.isProbing,serverHasMore:l.serverHasMore,loadMore:b},i[2]=S,i[3]=b,i[4]=p,i[5]=l.isProbing,i[6]=l.serverHasMore,i[7]=k):k=i[7],k}function $a(t){return t.id}function Ea(t){const e=A.c(20),{status:s,threads:r,activeTaskId:i,onSelectTask:a,onArchiveTask:o,canArchive:c,filters:u}=t,{isFetching:l,isProbing:d,loadMore:m,hasMore:f,serverHasMore:h}=La("status",s,u),[j,y]=B.useState(!1);!j&&r.length===0&&h===!0&&!l&&!d&&(y(!0),queueMicrotask(()=>{m()}));let v;if(e[0]!==i||e[1]!==c||e[2]!==u||e[3]!==o||e[4]!==a||e[5]!==r){let b;e[7]!==i||e[8]!==c||e[9]!==u||e[10]!==o||e[11]!==a?(b=S=>n.jsx(Gt,{task:S,isActive:i===S.id,onClick:()=>a(S),onArchive:c&&S.created_by===u.currentUserId?()=>o(S):void 0,showAutomationBadge:!!S.trigger_id,showAgentIcon:!0,hideStatusIdle:!0,indented:!0},S.id),e[7]=i,e[8]=c,e[9]=u,e[10]=o,e[11]=a,e[12]=b):b=e[12],v=r.map(b),e[0]=i,e[1]=c,e[2]=u,e[3]=o,e[4]=a,e[5]=r,e[6]=v}else v=e[6];let x;e[13]!==f||e[14]!==l||e[15]!==m?(x=(f||l)&&n.jsx(Ht,{onClick:()=>{m()},isFetching:l,indented:!0}),e[13]=f,e[14]=l,e[15]=m,e[16]=x):x=e[16];let g;return e[17]!==v||e[18]!==x?(g=n.jsxs(n.Fragment,{children:[v,x]}),e[17]=v,e[18]=x,e[19]=g):g=e[19],g}function Fa(t){const e=A.c(43),{status:s,threads:r,activeTaskId:i,onSelectTask:a,onArchiveTask:o,canArchive:c,filters:u}=t,l=K(),d=gn[s],m=d.icon,[f,h]=Sa(`status-${s}`,!1);let j;e[0]!==f||e[1]!==h?(j=function(){h(!f)},e[0]=f,e[1]=h,e[2]=j):j=e[2];const y=j;let v;e[3]!==d.labelKey||e[4]!==l?(v=l("sidebar.taskGroupsList.toggleStatusGroup",{status:l(d.labelKey)}),e[3]=d.labelKey,e[4]=l,e[5]=v):v=e[5];let x;e[6]!==y?(x=I=>{I.target===I.currentTarget&&(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),y())},e[6]=y,e[7]=x):x=e[7];let g;e[8]!==m||e[9]!==d.iconClassName?(g=n.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:n.jsx(m,{size:12,className:d.iconClassName})}),e[8]=m,e[9]=d.iconClassName,e[10]=g):g=e[10];let b;e[11]!==f?(b=n.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-muted-foreground opacity-0 transition-opacity group-hover/group:opacity-100",children:f?n.jsx(Ze,{size:14}):n.jsx(ts,{size:14})}),e[11]=f,e[12]=b):b=e[12];let S;e[13]!==g||e[14]!==b?(S=n.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[g,b]}),e[13]=g,e[14]=b,e[15]=S):S=e[15];let p;e[16]!==d.labelKey||e[17]!==l?(p=l(d.labelKey),e[16]=d.labelKey,e[17]=l,e[18]=p):p=e[18];let k;e[19]!==p?(k=n.jsx("span",{className:"flex-1 truncate",children:p}),e[19]=p,e[20]=k):k=e[20];let T;e[21]!==r.length?(T=n.jsx("div",{className:"size-5 shrink-0 flex items-center justify-center",children:n.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:r.length})}),e[21]=r.length,e[22]=T):T=e[22];let N;e[23]!==f||e[24]!==y||e[25]!==v||e[26]!==x||e[27]!==S||e[28]!==k||e[29]!==T?(N=n.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":f,"aria-label":v,onClick:y,onKeyDown:x,className:"group/group flex items-center gap-2 px-2 py-1.5 rounded-lg text-sm font-medium text-foreground cursor-pointer hover:bg-sidebar-accent focus-ring transition-colors",children:[S,k,T]}),e[23]=f,e[24]=y,e[25]=v,e[26]=x,e[27]=S,e[28]=k,e[29]=T,e[30]=N):N=e[30];let _;e[31]!==i||e[32]!==c||e[33]!==f||e[34]!==u||e[35]!==o||e[36]!==a||e[37]!==s||e[38]!==r?(_=f&&n.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:n.jsx(Ea,{status:s,threads:r,activeTaskId:i,onSelectTask:a,onArchiveTask:o,canArchive:c,filters:u})}),e[31]=i,e[32]=c,e[33]=f,e[34]=u,e[35]=o,e[36]=a,e[37]=s,e[38]=r,e[39]=_):_=e[39];let w;return e[40]!==N||e[41]!==_?(w=n.jsxs("div",{className:"flex flex-col gap-0.5",children:[N,_]}),e[40]=N,e[41]=_,e[42]=w):w=e[42],w}function Ra(t){const e=A.c(41),{threads:s,groupBy:r,activeTaskId:i,onSelectTask:a,onArchiveTask:o,filters:c,hasMore:u,isFetchingMore:l,onLoadMore:d,filtersActive:m}=t,f=K();if(s.length===0&&!u&&!l){let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(ms,{className:"size-6 opacity-60"}),e[0]=x):x=e[0];let g;e[1]!==m||e[2]!==f?(g=f(m?"sidebar.myThreadsSection.noChatsMatchFilters":"sidebar.myThreadsSection.noChatsYet"),e[1]=m,e[2]=f,e[3]=g):g=e[3];let b;return e[4]!==g?(b=n.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 px-4 py-12 text-center text-muted-foreground",children:[x,n.jsx("p",{className:"text-sm",children:g})]}),e[4]=g,e[5]=b):b=e[5],b}const h=s.length>1||u;if(r==="status"){let x;if(e[6]!==i||e[7]!==h||e[8]!==c||e[9]!==o||e[10]!==a||e[11]!==s){let b;e[13]!==i||e[14]!==h||e[15]!==c||e[16]!==o||e[17]!==a?(b=S=>n.jsx(Fa,{status:S.status,threads:S.threads,activeTaskId:i,onSelectTask:a,onArchiveTask:o,canArchive:h,filters:c},S.status),e[13]=i,e[14]=h,e[15]=c,e[16]=o,e[17]=a,e[18]=b):b=e[18],x=ya(s).map(b),e[6]=i,e[7]=h,e[8]=c,e[9]=o,e[10]=a,e[11]=s,e[12]=x}else x=e[12];let g;return e[19]!==x?(g=n.jsx(n.Fragment,{children:x}),e[19]=x,e[20]=g):g=e[20],g}let j;if(e[21]!==i||e[22]!==h||e[23]!==c||e[24]!==o||e[25]!==a||e[26]!==s){let x;e[28]!==i||e[29]!==h||e[30]!==c||e[31]!==o||e[32]!==a?(x=g=>n.jsx(Gt,{task:g,isActive:i===g.id,onClick:()=>a(g),onArchive:h&&g.created_by===c.currentUserId?()=>o(g):void 0,showAutomationBadge:!!g.trigger_id,showAgentIcon:!0},g.id),e[28]=i,e[29]=h,e[30]=c,e[31]=o,e[32]=a,e[33]=x):x=e[33],j=s.map(x),e[21]=i,e[22]=h,e[23]=c,e[24]=o,e[25]=a,e[26]=s,e[27]=j}else j=e[27];let y;e[34]!==u||e[35]!==l||e[36]!==d?(y=(u||l)&&n.jsx(Ht,{onClick:d,isFetching:l}),e[34]=u,e[35]=l,e[36]=d,e[37]=y):y=e[37];let v;return e[38]!==j||e[39]!==y?(v=n.jsxs(n.Fragment,{children:[j,y]}),e[38]=j,e[39]=y,e[40]=v):v=e[40],v}function Oa(t){const e=A.c(11),{panel:s}=t;let r;return e[0]!==s.activeTaskId||e[1]!==s.archiveTask||e[2]!==s.filters||e[3]!==s.filtersActive||e[4]!==s.groupBy||e[5]!==s.hasMore||e[6]!==s.isFetchingMore||e[7]!==s.loadMore||e[8]!==s.selectTask||e[9]!==s.threads?(r=n.jsx(Ra,{threads:s.threads,groupBy:s.groupBy,activeTaskId:s.activeTaskId,onSelectTask:s.selectTask,onArchiveTask:s.archiveTask,filters:s.filters,hasMore:s.hasMore,isFetchingMore:s.isFetchingMore,onLoadMore:s.loadMore,filtersActive:s.filtersActive}),e[0]=s.activeTaskId,e[1]=s.archiveTask,e[2]=s.filters,e[3]=s.filtersActive,e[4]=s.groupBy,e[5]=s.hasMore,e[6]=s.isFetchingMore,e[7]=s.loadMore,e[8]=s.selectTask,e[9]=s.threads,e[10]=r):r=e[10],r}function Ba(t){const e=A.c(67);let s;e[0]!==t?(s=t===void 0?{}:t,e[0]=t,e[1]=s):s=e[1];const{onNavigate:r}=s,{data:i}=pe.useSession(),a=i?.user?.id,{org:o}=ae();let c;e[2]!==o.id?(c=je(o.id),e[2]=o.id,e[3]=c):c=e[3];const u=c.id,l=ma(),d=Nt(),{threads:m,hasMore:f,isFetchingMore:h,fetchNextPage:j}=Je(),y=m.filter(Ha),{hide:v,setScope:x}=It(),g=Me(),{setTaskId:b,createNewTask:S}=Qe(),p=Ft(),k=et();let T;e[4]!==k||e[5]!==m||e[6]!==p?(T=ln({routeAgentId:p,threadVirtualMcpId:m.find(V=>V.id===k)?.virtual_mcp_id}),e[4]=k,e[5]=m,e[6]=p,e[7]=T):T=e[7];const N=T;let _;e[8]!==r?(_=()=>{r?.()},e[8]=r,e[9]=_):_=e[9];const w=_,I=[...y].sort(Ga),[P,L]=B.useState("all"),[$,E]=B.useState("flat"),[F,R]=xt("sidebar-threads-scope-all",!1),[M,C]=B.useState(!1),[G,z]=B.useState(!1);let H;e[10]!==C?(H=()=>{he("tasks_panel_search_opened"),z(!0),C(!0)},e[10]=C,e[11]=H):H=e[11];const O=H,U=a??null;let Z;e[12]!==U||e[13]!==P?(Z={type:P,member:"mine",currentUserId:U},e[12]=U,e[13]=P,e[14]=Z):Z=e[14];const Y=Z,Q={};F||(Q.created_by="me"),x(Q);let q;e[15]!==a?(q=V=>a?V.filter(ue=>ue.created_by===a):[],e[15]=a,e[16]=q):q=e[16];const le=q;let D;e[17]!==P?(D=V=>P==="automation"?V.filter(za):P==="manual"?V.filter(Da):V,e[17]=P,e[18]=D):D=e[18];const re=D,X=fa(re(F?I:le(I)),k);let J;e[19]!==k||e[20]!==w||e[21]!==a||e[22]!==v||e[23]!==g||e[24]!==o.slug||e[25]!==b||e[26]!==X?(J=V=>{if(a&&V.created_by&&V.created_by!==a)return;const ue=V.id===k;if(v(V.id),Bs(V.id),!ue)return;const ge=ba(X,V.id,a);w(),ge?b(ge.id,ge.virtual_mcp_id):g({to:"/$org",params:{org:o.slug}})},e[19]=k,e[20]=w,e[21]=a,e[22]=v,e[23]=g,e[24]=o.slug,e[25]=b,e[26]=X,e[27]=J):J=e[27];const ee=J;let ne;e[28]!==w||e[29]!==b?(ne=V=>{w(),b(V.id,V.virtual_mcp_id)},e[28]=w,e[29]=b,e[30]=ne):ne=e[30];const ie=ne;let te;e[31]!==N||e[32]!==k||e[33]!==m||e[34]!==w||e[35]!==S||e[36]!==a||e[37]!==u||e[38]!==l||e[39]!==d||e[40]!==b?(te=()=>{const V=N??u;he("sidebar_new_thread_clicked",{virtual_mcp_id:V}),w();const ue=Ys(m,V,a,l(V));if(ue){b(ue.id,ue.virtual_mcp_id,{newThread:!0});return}const ge=d?null:m.find(qt=>qt.id===k)?.branch??null;S(V,ge)},e[31]=N,e[32]=k,e[33]=m,e[34]=w,e[35]=S,e[36]=a,e[37]=u,e[38]=l,e[39]=d,e[40]=b,e[41]=te):te=e[41];const oe=te;let ce;e[42]!==j?(ce=()=>{j()},e[42]=j,e[43]=ce):ce=e[43];const xe=$!=="flat"||P!=="all"||F;let de;e[44]!==G||e[45]!==M||e[46]!==C?(de=G?n.jsx(xa,{open:M,onOpenChange:C}):null,e[44]=G,e[45]=M,e[46]=C,e[47]=de):de=e[47];let ke;return e[48]!==k||e[49]!==ee||e[50]!==Y||e[51]!==$||e[52]!==f||e[53]!==h||e[54]!==oe||e[55]!==O||e[56]!==ie||e[57]!==E||e[58]!==R||e[59]!==L||e[60]!==F||e[61]!==ce||e[62]!==xe||e[63]!==de||e[64]!==P||e[65]!==X?(ke={threads:X,activeTaskId:k,filters:Y,hasMore:f,isFetchingMore:h,loadMore:ce,groupBy:$,setGroupBy:E,typeFilter:P,setTypeFilter:L,showAll:F,setShowAll:R,filtersActive:xe,selectTask:ie,archiveTask:ee,newThread:oe,openSearch:O,searchDialog:de},e[48]=k,e[49]=ee,e[50]=Y,e[51]=$,e[52]=f,e[53]=h,e[54]=oe,e[55]=O,e[56]=ie,e[57]=E,e[58]=R,e[59]=L,e[60]=F,e[61]=ce,e[62]=xe,e[63]=de,e[64]=P,e[65]=X,e[66]=ke):ke=e[66],ke}function Da(t){return!t.trigger_id}function za(t){return!!t.trigger_id}function Ga(t,e){return(e.updated_at??"").localeCompare(t.updated_at??"")}function Ha(t){return!t.hidden}function Va(){const t=A.c(59),e=K(),[s,r]=B.useState(!1);let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i={onNavigate:()=>r(!1)},t[0]=i):i=t[0];const a=Ba(i),o=Le()?.activeTask;let c;t[1]!==o?.title||t[2]!==a.activeTaskId||t[3]!==a.threads||t[4]!==e?(c=o?.title||a.threads.find(M=>M.id===a.activeTaskId)?.title||e("tasksPanel.taskRow.untitledTask"),t[1]=o?.title,t[2]=a.activeTaskId,t[3]=a.threads,t[4]=e,t[5]=c):c=t[5];const u=c;let l;t[6]!==a?(l=()=>{r(!1),a.openSearch()},t[6]=a,t[7]=l):l=t[7];const d=l;let m;t[8]!==e?(m=e("chat.threadsMenu.chats"),t[8]=e,t[9]=m):m=t[9];const f=s&&"bg-sidebar-accent";let h;t[10]!==f?(h=se("flex h-[34px] min-w-0 shrink items-center gap-1.5 rounded-lg px-2 text-sm text-foreground transition-colors hover:bg-accent focus-ring",f),t[10]=f,t[11]=h):h=t[11];let j;t[12]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(hs,{size:16,className:"shrink-0"}),t[12]=j):j=t[12];let y;t[13]!==u?(y=n.jsx("span",{className:"truncate max-w-[10rem] font-medium",children:u}),t[13]=u,t[14]=y):y=t[14];let v;t[15]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(Ze,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),t[15]=v):v=t[15];let x;t[16]!==m||t[17]!==h||t[18]!==y?(x=n.jsx(Fe,{asChild:!0,children:n.jsx(Lt,{asChild:!0,children:n.jsxs("button",{type:"button","aria-label":m,className:h,children:[j,y,v]})})}),t[16]=m,t[17]=h,t[18]=y,t[19]=x):x=t[19];let g;t[20]!==e?(g=e("chat.threadsMenu.chats"),t[20]=e,t[21]=g):g=t[21];let b;t[22]!==g?(b=n.jsx(Re,{side:"bottom",children:g}),t[22]=g,t[23]=b):b=t[23];let S;t[24]!==b||t[25]!==x?(S=n.jsxs(Oe,{children:[x,b]}),t[24]=b,t[25]=x,t[26]=S):S=t[26];let p;t[27]!==a?(p=n.jsx(ua,{panel:a,className:"size-8"}),t[27]=a,t[28]=p):p=t[28];let k;t[29]!==e?(k=e("sidebar.taskGroupsList.searchChats"),t[29]=e,t[30]=k):k=t[30];let T;t[31]===Symbol.for("react.memo_cache_sentinel")?(T=n.jsx(ps,{size:16}),t[31]=T):T=t[31];let N;t[32]!==d||t[33]!==k?(N=n.jsx(_e,{"aria-label":k,onClick:d,className:"size-8",children:T}),t[32]=d,t[33]=k,t[34]=N):N=t[34];let _;t[35]!==e?(_=e("sidebar.taskGroupsList.newChat"),t[35]=e,t[36]=_):_=t[36];let w;t[37]===Symbol.for("react.memo_cache_sentinel")?(w=n.jsx(vt,{size:16}),t[37]=w):w=t[37];let I;t[38]!==a.newThread||t[39]!==_?(I=n.jsx(_e,{"aria-label":_,onClick:a.newThread,className:"size-8",children:w}),t[38]=a.newThread,t[39]=_,t[40]=I):I=t[40];let P;t[41]!==N||t[42]!==I?(P=n.jsxs("div",{className:"flex items-center gap-0.5",children:[N,I]}),t[41]=N,t[42]=I,t[43]=P):P=t[43];let L;t[44]!==p||t[45]!==P?(L=n.jsxs("div",{className:"flex shrink-0 items-center justify-between",children:[p,P]}),t[44]=p,t[45]=P,t[46]=L):L=t[46];let $;t[47]!==a?($=n.jsx("div",{className:"flex max-h-[60vh] min-h-0 flex-col gap-0.5 overflow-y-auto overscroll-contain",children:n.jsx(Oa,{panel:a})}),t[47]=a,t[48]=$):$=t[48];let E;t[49]!==L||t[50]!==$?(E=n.jsxs($t,{align:"start",side:"bottom",onOpenAutoFocus:Ka,className:"flex w-80 flex-col gap-2 p-2",children:[L,$]}),t[49]=L,t[50]=$,t[51]=E):E=t[51];let F;t[52]!==s||t[53]!==S||t[54]!==E?(F=n.jsxs(Et,{open:s,onOpenChange:r,children:[S,E]}),t[52]=s,t[53]=S,t[54]=E,t[55]=F):F=t[55];let R;return t[56]!==a.searchDialog||t[57]!==F?(R=n.jsxs(n.Fragment,{children:[F,a.searchDialog]}),t[56]=a.searchDialog,t[57]=F,t[58]=R):R=t[58],R}function Ka(t){return t.preventDefault()}function Ua(){const t=A.c(20),e=K(),{threads:s}=Je(),{createNewTask:r}=Qe(),i=Rt(),a=et();let o;t[0]!==a||t[1]!==s?(o=s.find(v=>v.id===a)?.branch??null,t[0]=a,t[1]=s,t[2]=o):o=t[2];const c=o;let u;t[3]!==i||t[4]!==r||t[5]!==c?(u=()=>{r(i,c)},t[3]=i,t[4]=r,t[5]=c,t[6]=u):u=t[6];const l=u;let d;t[7]!==e?(d=e("sidebar.taskGroupsList.newChat"),t[7]=e,t[8]=d):d=t[8];let m;t[9]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(vt,{size:16}),t[9]=m):m=t[9];let f;t[10]!==l||t[11]!==d?(f=n.jsx(Fe,{asChild:!0,children:n.jsx("button",{type:"button",onClick:l,"aria-label":d,className:"flex shrink-0 items-center rounded-lg p-1.5 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-ring",children:m})}),t[10]=l,t[11]=d,t[12]=f):f=t[12];let h;t[13]!==e?(h=e("sidebar.taskGroupsList.newChat"),t[13]=e,t[14]=h):h=t[14];let j;t[15]!==h?(j=n.jsx(Re,{side:"bottom",children:h}),t[15]=h,t[16]=j):j=t[16];let y;return t[17]!==f||t[18]!==j?(y=n.jsxs(Oe,{children:[f,j]}),t[17]=f,t[18]=j,t[19]=y):y=t[19],y}function qa(t){const e=A.c(16),{virtualMcpId:s,taskId:r}=t,{openPanel:i}=Bt();let a;e[0]!==r||e[1]!==s?(a={virtualMcpId:s,taskId:r},e[0]=r,e[1]=s,e[2]=a):a=e[2];const{tabs:o,activeTab:c,mainOpen:u}=Dt(a);if(o.length===0)return null;let l;if(e[3]!==c||e[4]!==u||e[5]!==i||e[6]!==o||e[7]!==s){let m;e[9]!==c||e[10]!==u||e[11]!==i||e[12]!==s?(m=f=>{const h=f.id==="automations"?ss({activeTab:c,mainOpen:u}):u&&f.id===c;return n.jsxs(st.Tab,{active:h,onClick:()=>{h||(he("main_panel_tab_clicked",{virtual_mcp_id:s,tab_id:f.id,tab_kind:f.kind,was_active:!1}),i(f.id))},children:[n.jsx("span",{"aria-hidden":"true",className:"flex size-4 shrink-0 items-center justify-center",children:n.jsx(we,{icon:f.icon})}),f.title]},f.id)},e[9]=c,e[10]=u,e[11]=i,e[12]=s,e[13]=m):m=e[13],l=o.map(m),e[3]=c,e[4]=u,e[5]=i,e[6]=o,e[7]=s,e[8]=l}else l=e[8];let d;return e[14]!==l?(d=n.jsx(st.Tabs,{"data-tour":Ds.surfaceTabs,children:l}),e[14]=l,e[15]=d):d=e[15],d}function Wa(t){return{threadId:t.routeThreadId,providerKey:t.routeThreadId??t.fallbackKey}}const Ve="__mobile-main-panel-tab-select__",Ue="main";function Ya({tabs:t,activeTab:e,mainOpen:s,t:r}){const i=t.find(o=>o.id===e),a=r("mainPanelTabs.mobileMainPanelTabSelect.mainView");return s?i?.title??a:i?.title??t[0]?.title??a}const Za={kind:"component",Component:xs},Qa={kind:"component",Component:gs},Xa={kind:"component",Component:bs},Ja={kind:"component",Component:jn};function er({tabs:t,overlayEnabled:e,t:s}){return[{value:"chat",title:s("mainPanelTabs.mobileMainPanelTabSelect.chat"),icon:Za},...t.length>0?t.map(r=>({value:r.id,title:r.title,icon:r.icon})):[{value:Ue,title:s("mainPanelTabs.mobileMainPanelTabSelect.mainView"),icon:Ja}],...e?[{value:"board",title:s("mainPanelTabs.mobileMainPanelTabSelect.tasks"),icon:Qa},{value:"files",title:s("mainPanelTabs.mobileMainPanelTabSelect.library"),icon:Xa}]:[]]}function tr(t){const e=A.c(53),{virtualMcpId:s,taskId:r}=t,i=K(),a=Me(),{openPanel:o}=Bt();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={strict:!1},e[0]=c):c=e[0];const u=Se(c);let l;e[1]!==r||e[2]!==s?(l={virtualMcpId:s,taskId:r},e[1]=r,e[2]=s,e[3]=l):l=e[3];const{tabs:d,activeTab:m,mainOpen:f}=Dt(l),{org:h}=ae(),j=Ms();let y;e[4]!==h.id?(y=nt(h.id),e[4]=h.id,e[5]=y):y=e[5];const v=s===y;let x,g,b,S,p,k,T,N,_,w;if(e[6]!==m||e[7]!==f||e[8]!==a||e[9]!==v||e[10]!==o||e[11]!==h.id||e[12]!==u.org||e[13]!==u.taskId||e[14]!==j||e[15]!==i||e[16]!==d||e[17]!==s){S=Symbol.for("react.early_return_sentinel");e:{const L=er({tabs:d,overlayEnabled:!!(u.org&&u.taskId),t:i}),$=f?L.find(O=>O.value===m)?.value??Ue:"chat",E=L.find(O=>O.value===$),F=E?.title??Ya({tabs:d,activeTab:m,mainOpen:f,t:i});let R;e[28]!==a?(R=O=>{a({to:".",search:U=>({...U,...sn(O)}),replace:!0})},e[28]=a,e[29]=R):R=e[29];const M=R;let C;e[30]!==v||e[31]!==o||e[32]!==h.id||e[33]!==j||e[34]!==M||e[35]!==s?(C=O=>{if(O!==Ve){if(he("main_panel_tab_clicked",{virtual_mcp_id:s,tab_id:O,source:"mobile_select"}),zs({reportsOnly:j,onReportAgent:v,tabId:O})){o(O,{virtualmcpid:nt(h.id),search:ar});return}if(O==="chat"||O===Ue){M(O==="chat"?"chat":"main");return}o(O,{search:nr})}},e[30]=v,e[31]=o,e[32]=h.id,e[33]=j,e[34]=M,e[35]=s,e[36]=C):C=e[36];const G=C,z=L.find(O=>O.value!==$);if(L.length===2&&z){S=n.jsxs("button",{type:"button",onClick:()=>G(z.value),"aria-label":i("mainPanelTabs.mobileMainPanelTabSelect.switchTo",{name:z.title}),className:"flex h-10 min-w-0 max-w-[7.5rem] items-center gap-1.5 rounded-lg px-1.5 text-xs text-foreground transition-colors hover:bg-accent focus-ring",children:[n.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center",children:n.jsx(we,{icon:z.icon,className:"size-5"})}),n.jsx("span",{className:"min-w-0 truncate",children:z.title})]});break e}g=kn,_=Ve,w=G;let H;e[37]!==i?(H=i("mainPanelTabs.mobileMainPanelTabSelect.view"),e[37]=i,e[38]=H):H=e[38],b=n.jsx(Sn,{"aria-label":H,className:"h-10! w-full min-w-0 max-w-[7.5rem] rounded-lg border-0 bg-transparent px-1.5 text-xs shadow-none [--shadow-edge:none]",children:n.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[E&&n.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center",children:n.jsx(we,{icon:E.icon,className:"size-5"})}),n.jsx("span",{className:"min-w-0 truncate",children:F})]})}),x=Nn,p="end",k="w-56",e[39]!==F?(T=n.jsx(zt,{value:Ve,disabled:!0,hideCheck:!0,className:"hidden",children:F}),e[39]=F,e[40]=T):T=e[40],N=L.map(sr)}e[6]=m,e[7]=f,e[8]=a,e[9]=v,e[10]=o,e[11]=h.id,e[12]=u.org,e[13]=u.taskId,e[14]=j,e[15]=i,e[16]=d,e[17]=s,e[18]=x,e[19]=g,e[20]=b,e[21]=S,e[22]=p,e[23]=k,e[24]=T,e[25]=N,e[26]=_,e[27]=w}else x=e[18],g=e[19],b=e[20],S=e[21],p=e[22],k=e[23],T=e[24],N=e[25],_=e[26],w=e[27];if(S!==Symbol.for("react.early_return_sentinel"))return S;let I;e[41]!==x||e[42]!==p||e[43]!==k||e[44]!==T||e[45]!==N?(I=n.jsxs(x,{align:p,className:k,children:[T,N]}),e[41]=x,e[42]=p,e[43]=k,e[44]=T,e[45]=N,e[46]=I):I=e[46];let P;return e[47]!==g||e[48]!==b||e[49]!==I||e[50]!==_||e[51]!==w?(P=n.jsxs(g,{value:_,onValueChange:w,children:[b,I]}),e[47]=g,e[48]=b,e[49]=I,e[50]=_,e[51]=w,e[52]=P):P=e[52],P}function sr(t){return n.jsx(zt,{value:t.value,children:n.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[n.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center",children:n.jsx(we,{icon:t.icon})}),n.jsx("span",{className:"min-w-0 truncate",children:t.title})]})},t.value)}function nr(t){return{...t,sidepanel:!1}}function ar(t){return{...t,thread:void 0,sidepanel:!1}}function rr(){const t=A.c(3),e=ns();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s={select:ir},t[0]=s):s=t[0];const r=gt(s);if(!e||!r)return!1;let i;return t[1]!==r?(i=r==="app"||Tn.includes(r),t[1]=r,t[2]=i):i=t[2],i}function ir(t){const{staticData:e}=t.matches.findLast(lr)??{};return e?.siteEditorView?"site-editor":e?.mainView}function lr(t){return t.staticData.mainView}function or(t,e,s){const r=A.c(33),i=Xe(),{locator:a}=ae(),o=B.useSyncExternalStore(i.threads.subscribe,i.threads.get),c=B.useSyncExternalStore(i.threadsStatus.subscribe,i.threadsStatus.get);let u;r[0]!==t||r[1]!==o?(u=t===null?null:o.find(p=>p.id===t&&!p.partial)??null,r[0]=t,r[1]=o,r[2]=u):u=r[2];const l=u,[d,m]=B.useState(void 0),[f,h]=B.useState(t);f!==t&&(h(t),m(void 0));let j,y;r[3]!==d||r[4]!==t||r[5]!==l||r[6]!==i||r[7]!==c.kind?(j=()=>{t!==null&&(l||c.kind!=="loading"&&d===void 0&&(m("pending"),i.fetchThreadIntoSlot(t).then(p=>{m(p)})))},y=[t,l,c.kind,d,i],r[3]=d,r[4]=t,r[5]=l,r[6]=i,r[7]=c.kind,r[8]=j,r[9]=y):(j=r[8],y=r[9]),B.useEffect(j,y);let v;r[10]!==s||r[11]!==a||r[12]!==i||r[13]!==e?(v={mutationFn:async p=>i.create({id:p,virtual_mcp_id:e,...s?{branch:s}:{},...Ws(sessionStorage,a,p)})},r[10]=s,r[11]=a,r[12]=i,r[13]=e,r[14]=v):v=r[14];const x=as(v);let g,b;if(r[15]!==x||r[16]!==d||r[17]!==t||r[18]!==l||r[19]!==c.kind?(g=()=>{t!==null&&(l||d===null&&c.kind!=="loading"&&(x.isPending||x.variables!==t&&x.mutate(t)))},b=[t,l,d,c.kind,x],r[15]=x,r[16]=d,r[17]=t,r[18]=l,r[19]=c.kind,r[20]=g,r[21]=b):(g=r[20],b=r[21]),B.useEffect(g,b),t===null){let p;return r[22]===Symbol.for("react.memo_cache_sentinel")?(p={status:"ready",task:null},r[22]=p):p=r[22],p}if(l){let p;return r[23]!==l?(p={status:"ready",task:l},r[23]=l,r[24]=p):p=r[24],p}if(d&&typeof d=="object"){let p;return r[25]!==d?(p={status:"ready",task:d},r[25]=d,r[26]=p):p=r[26],p}if(x.data){let p;return r[27]!==x.data?(p={status:"ready",task:x.data},r[27]=x.data,r[28]=p):p=r[28],p}if(x.isError){let p;return r[29]!==x.error?(p={status:"error",error:x.error},r[29]=x.error,r[30]=p):p=r[30],p}if(x.isPending||c.kind!=="loading"){let p;return r[31]===Symbol.for("react.memo_cache_sentinel")?(p={status:"creating"},r[31]=p):p=r[31],p}let S;return r[32]===Symbol.for("react.memo_cache_sentinel")?(S={status:"loading"},r[32]=S):S=r[32],S}const cr=50;function dr(t,e){const s=A.c(15),{org:r}=ae(),i=Pe(),{data:a}=pe.useSession(),o=a?.user?.id??"";let c;s[0]!==r.id||s[1]!==o||s[2]!==t?(c=fe.agentEntryThreads(r.id,o,t),s[0]=r.id,s[1]=o,s[2]=t,s[3]=c):c=s[3];const u=e&&!!o;let l;s[4]!==i||s[5]!==t?(l=async()=>{try{return(await i.call("COLLECTION_THREADS_LIST",{limit:cr,offset:0,orderBy:[{field:["updated_at"],direction:"desc"}],where:{hidden:!1,created_by:"me",virtual_mcp_id:t}})).items}catch{return[]}},s[4]=i,s[5]=t,s[6]=l):l=s[6];let d;s[7]!==c||s[8]!==u||s[9]!==l?(d={queryKey:c,enabled:u,staleTime:0,refetchOnWindowFocus:!1,refetchOnReconnect:!1,queryFn:l},s[7]=c,s[8]=u,s[9]=l,s[10]=d):d=s[10];const m=me(d);if(!e||!o){let h;return s[11]===Symbol.for("react.memo_cache_sentinel")?(h={status:"idle"},s[11]=h):h=s[11],h}if(!m.data||m.isFetching){let h;return s[12]===Symbol.for("react.memo_cache_sentinel")?(h={status:"loading"},s[12]=h):h=s[12],h}let f;return s[13]!==m.data?(f={status:"ready",threads:m.data},s[13]=m.data,s[14]=f):f=s[14],f}function ur(t){const e=A.c(13),{children:s}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},e[0]=r):r=e[0];const i=Se(r);let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[1]=a):a=e[1];const o=Ae(a);let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c={select:fr},e[2]=c):c=e[2];const u=gt(c),{org:l}=ae();let d;e[3]!==l||e[4]!==i.agentId||e[5]!==i.legacyView||e[6]!==i.org||e[7]!==u||e[8]!==o?(d=i.org?rs({pathname:u,org:i.org,pathAgentId:i.agentId,pathLegacyView:i.legacyView,fallbackAgentId:je(l.id).id,search:o}):null,e[3]=l,e[4]=i.agentId,e[5]=i.legacyView,e[6]=i.org,e[7]=u,e[8]=o,e[9]=d):d=e[9];const m=d;let f;return e[10]!==s||e[11]!==m?(f=m?n.jsx(tt,{target:m}):s,e[10]=s,e[11]=m,e[12]=f):f=e[12],f}function fr(t){return t.matches.at(-1)?.pathname??t.location.pathname}function mr(){const t=A.c(7);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const s=Se(e);let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},t[1]=r):r=t[1];const i=Ae(r),{org:a}=ae(),{org:o,taskId:c}=s;if(!o||c===void 0)return null;let u;return t[2]!==o||t[3]!==a.id||t[4]!==i||t[5]!==c?(u=is({org:o,taskId:c,fallbackAgentId:je(a.id).id,search:i}),t[2]=o,t[3]=a.id,t[4]=i,t[5]=c,t[6]=u):u=t[6],u}function hr(){const t=A.c(2),e=mr();let s;return t[0]!==e?(s=e?n.jsx(tt,{target:e}):null,t[0]=e,t[1]=s):s=t[1],s}function pr(){const t=A.c(6),e=wn(),s=Me();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},t[0]=r):r=t[0];const{preview:i}=Ae(r);if(!e||!i)return null;let a;t[1]!==s?(a=()=>s({to:".",search:xr}),t[1]=s,t[2]=a):a=t[2];let o;return t[3]!==i||t[4]!==a?(o=n.jsx(Cn,{previewPath:i,onClose:a,showSeeInLibrary:!0}),t[3]=i,t[4]=a,t[5]=o):o=t[5],o}function xr(t){const{preview:e,...s}=t;return s}function gr(t){const e=A.c(11),{children:s}=t,r=K();let i;e[0]!==r?(i=r("agentShellLayout.agentShellLayout.chatLoadingError"),e[0]=r,e[1]=i):i=e[1];let a;e[2]!==i?(a=n.jsx("div",{role:"alert",className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:i}),e[2]=i,e[3]=a):a=e[3];let o;e[4]!==s?(o=s??n.jsx(oa,{}),e[4]=s,e[5]=o):o=e[5];let c;e[6]!==o?(c=n.jsx(Ie,{children:o}),e[6]=o,e[7]=c):c=e[7];let u;return e[8]!==a||e[9]!==c?(u=n.jsx(pt,{fallback:a,children:c}),e[8]=a,e[9]=c,e[10]=u):u=e[10],u}function br(t){const e=A.c(5),{threadId:s,children:r}=t;if(s===null){let a;return e[0]!==r?(a=n.jsx(W.ThreadlessProvider,{children:r}),e[0]=r,e[1]=a):a=e[1],a}let i;return e[2]!==r||e[3]!==s?(i=n.jsx(W.ActiveTaskProvider,{taskId:s,children:r}),e[2]=r,e[3]=s,e[4]=i):i=e[4],i}function vr(t){const e=A.c(3),{onNewTaskRef:s,createNewTask:r}=t;let i;return e[0]!==r||e[1]!==s?(i=()=>(s.current=r,()=>{s.current=null}),e[0]=r,e[1]=s,e[2]=i):i=e[2],B.useLayoutEffect(i),null}function yr({virtualMcpId:t,hasActiveRepository:e,sandboxMap:s,children:r}){const i=K(),{currentBranch:a,activeTask:o,setCurrentTaskBranch:c}=$e(),{data:u}=pe.useSession(),l=u?.user?.id,d=!Cs(o?.harness_id),m=Qs({agentSandboxMap:s,threadSandboxMap:o?.metadata?.sandboxMap,userId:l,ownerId:o?.created_by,branch:a}),f=e||Hs(o?.metadata),h=B.useRef(null),j=d&&Xs({threadLoaded:!!o,isOwner:!!l&&o?.created_by===l,hasActiveRepository:f,branch:a??null,attempted:h.current===(o?.id??null)});B.useEffect(()=>{!j||!o||(h.current=o.id,c(Ct(u?.user?.name||u?.user?.email?.split("@")[0])))},[j,o,u,c]);const y=jt(t),v=Ee(t),x=Mt(v,a),{releases:g,createRelease:b}=Vs(t),p=!!l&&o?.created_by===l&&!!a&&a!==x&&!g.some(L=>L.branch===a),k=B.useRef(null);B.useEffect(()=>{!p||!a||k.current!==a&&(k.current=a,b({branch:a,name:Us(g,i("thread.branchPicker.defaultVersionName")),color:Ks(g.length),createdBy:l,createdAt:new Date().toISOString()}).catch(()=>{}))},[p,a,g,b,l,i]);const T=y.resolved?y.runtime:null,N=Js(t,a??void 0),w=(l&&a?In(m?.[l]?.[a]):{})["agent-sandbox"]??null,I=w?.previewUrl??null,P=d&&T!=="cms"&&(!!w||N);return d?T==="cms"?n.jsx(lt,{children:r},`${t}:${a??"no-branch"}:${o?.id??""}`):n.jsx(Ss,{virtualMcpId:t,branch:a??null,previewUrl:I,enabled:P,children:n.jsx(en,{executionEnabled:d,virtualMcpId:t,branch:a??null,userId:l??null,hasActiveRepository:f,vmEntry:w,threadId:o?.id??null,children:n.jsx(lt,{children:r},`${t}:${a??"no-branch"}:${o?.id??""}`)})},o?.id??"no-thread"):n.jsx("div",{className:"flex-1 min-h-0 pr-1.5 pb-1.5 overflow-hidden",children:n.jsx("div",{className:"flex h-full rounded-[0.75rem] bg-background shadow-edge",children:n.jsx(At,{image:n.jsx(We,{size:48,className:"text-muted-foreground"}),title:i("agentShellLayout.agentShellLayout.runtimeUnavailableOnWeb"),description:i("agentShellLayout.agentShellLayout.runtimeUnavailableOnWebDescription")})})})}function jr(){const t=A.c(16),e=K(),{toggleSidebar:s}=ys(),{virtualMcpId:r,taskId:i}=$e();let a;t[0]!==e?(a=e("layouts.shellControls.toggleSidebar"),t[0]=e,t[1]=a):a=t[1];let o;t[2]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(vs,{size:16}),t[2]=o):o=t[2];let c;t[3]!==a||t[4]!==s?(c=n.jsx(_e,{className:"md:hidden",onClick:s,"aria-label":a,children:o}),t[3]=a,t[4]=s,t[5]=c):c=t[5];let u;t[6]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(Va,{}),t[6]=u):u=t[6];let l;t[7]!==c?(l=n.jsxs(De.Topbar.Left,{children:[c,u]}),t[7]=c,t[8]=l):l=t[8];let d;t[9]!==i||t[10]!==r?(d=n.jsx("div",{className:"min-w-0 md:hidden",children:n.jsx(tr,{virtualMcpId:r,taskId:i})}),t[9]=i,t[10]=r,t[11]=d):d=t[11];let m;t[12]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(De.Topbar.Right,{className:"shrink-0",children:n.jsx(Ua,{})}),t[12]=m):m=t[12];let f;return t[13]!==l||t[14]!==d?(f=n.jsxs(De.Topbar,{className:"border-b border-border/60 px-3",children:[l,d,m]}),t[13]=l,t[14]=d,t[15]=f):f=t[15],f}function Sr(t){const e=A.c(22),{layout:s,onNewTaskRef:r,createNewTask:i}=t,{virtualMcpId:a,taskId:o}=$e(),c=yn()??"overview",u=rr(),[l,d]=B.useState(null),m=l===c,f=u?m:s.threadOpen;let h;e[0]!==c||e[1]!==s||e[2]!==u||e[3]!==m?(h=u?()=>d(m?null:c):s.toggleThread,e[0]=c,e[1]=s,e[2]=u,e[3]=m,e[4]=h):h=e[4];const j=h;let y;e[5]!==i||e[6]!==r?(y=n.jsx(vr,{onNewTaskRef:r,createNewTask:i}),e[5]=i,e[6]=r,e[7]=y):y=e[7];let v;e[8]!==o||e[9]!==a?(v=n.jsx(qa,{virtualMcpId:a,taskId:o}),e[8]=o,e[9]=a,e[10]=v):v=e[10];let x,g;e[11]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(it.Thread,{topbar:n.jsx(jr,{}),children:n.jsx(gr,{})}),g=n.jsx(bt,{}),e[11]=x,e[12]=g):(x=e[11],g=e[12]);let b;e[13]!==c||e[14]!==s||e[15]!==v||e[16]!==f||e[17]!==j?(b=n.jsxs(it,{...s,threadOpen:f,toggleThread:j,contentKey:c,contentNavigation:v,children:[x,g]}),e[13]=c,e[14]=s,e[15]=v,e[16]=f,e[17]=j,e[18]=b):b=e[18];let S;return e[19]!==y||e[20]!==b?(S=n.jsxs(n.Fragment,{children:[y,b]}),e[19]=y,e[20]=b,e[21]=S):S=e[21],S}function kr(){const t=K(),e=Me(),s=on(),{create:r}=It(),{org:i}=ae(),o=Se({strict:!1}).org??"",c=Ae({strict:!1}),u=et(),l=Rt(),d=Ft(),[m]=B.useState(()=>crypto.randomUUID()),{data:f}=pe.useSession(),[h]=B.useState(()=>Ct(f?.user?.name||f?.user?.email?.split("@")[0])),j=Xe(),y=B.useSyncExternalStore(j.threads.subscribe,j.threads.get),v=B.useSyncExternalStore(j.threadsStatus.subscribe,j.threadsStatus.get),x=Ee(l),g=!!(x&&_t(x)),b=Mt(x,null),S=u===null&&!!d&&!!x,p=M=>Zs(M,l,f?.user?.id,Pt(x?.metadata),g,{baseBranch:b}),k=S&&v.kind!=="loading"?p(y):void 0,T=dr(l,S&&v.kind!=="loading"&&!k),N=or(u,l,h);ca(N.status==="ready"?N.task:null);const _=x?.metadata?.ui?.layout??null,w=_?{defaultMainView:_.defaultMainView??null,chatDefaultOpen:_.chatDefaultOpen??null}:null,I=nn(w),{threadId:P,providerKey:L}=Wa({routeThreadId:u,fallbackKey:m}),$=async()=>{const M=crypto.randomUUID(),C=y.find(G=>G.id===P)?.branch??null;try{await r({id:M,virtual_mcp_id:l,...C?{branch:C}:{}})}catch{}s(M,()=>({}))},E=B.useRef(null);B.useEffect(()=>{const M=C=>{Gs(C)&&C.shiftKey&&C.code==="KeyS"&&!C.repeat&&(C.preventDefault(),E.current?.())};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[]);const F=N.status==="ready"?N.task:null,R=F?.virtual_mcp_id;if(F&&R&&!cn({routeAgentId:l,threadAgentId:R})){const M=ls({org:o,agentId:R,superAgentId:je(i.id).id});return n.jsx(tt,{target:{route:M,search:{thread:F.id,sidepanel:c.sidepanel,mainpanel:c.mainpanel,autosend:c.autosend}}})}if(S){if(v.kind==="loading"||T.status==="loading")return n.jsx("div",{className:"flex-1 min-h-0 pr-1.5 pb-1.5 overflow-hidden",children:n.jsxs("div",{role:"status","aria-live":"polite",className:"flex h-full items-center justify-center bg-background shadow-edge rounded-[0.75rem] text-sm text-muted-foreground",children:[n.jsx(ve,{className:"size-4 mr-2"}),t("agentShellLayout.agentShellLayout.creatingTask")]})});const C=(k??(T.status==="ready"?p(T.threads):void 0))?.id??(g?m:null);if(C)return n.jsx(os,{to:".",replace:!0,search:G=>({...G,thread:C})})}return N.status==="creating"||N.status==="loading"?n.jsx("div",{className:"flex-1 min-h-0 pr-1.5 pb-1.5 overflow-hidden",children:n.jsxs("div",{role:"status","aria-live":"polite",className:"flex h-full items-center justify-center bg-background shadow-edge rounded-[0.75rem] text-sm text-muted-foreground",children:[n.jsx(ve,{className:"size-4 mr-2"}),t("agentShellLayout.agentShellLayout.creatingTask")]})}):N.status==="error"?n.jsx("div",{className:"flex-1 min-h-0 pr-1.5 pb-1.5 overflow-hidden",children:n.jsxs("div",{role:"alert",className:"flex flex-col h-full items-center justify-center gap-2 bg-background shadow-edge rounded-[0.75rem] p-8 text-sm",children:[n.jsx("div",{className:"font-medium",children:t("agentShellLayout.agentShellLayout.taskUnavailable")}),n.jsx("div",{className:"text-muted-foreground",children:N.error.message})]})}):x?n.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:n.jsx(W.Provider,{virtualMcpId:l,task:N.status==="ready"?N.task:null,children:n.jsx(_s,{layout:I,children:n.jsx(yr,{virtualMcpId:l,hasActiveRepository:g,sandboxMap:x.metadata?.sandboxMap,children:n.jsx(br,{threadId:P,children:n.jsx(Ie,{children:n.jsx(Sr,{layout:I,onNewTaskRef:E,createNewTask:$})})},L)})})},l)}):n.jsx("div",{className:"flex-1 min-h-0 pr-1.5 pb-1.5 overflow-hidden",children:n.jsx("div",{className:"flex flex-col h-full bg-background overflow-hidden shadow-edge rounded-[0.75rem]",children:n.jsx(At,{image:n.jsx(We,{size:48,className:"text-muted-foreground"}),title:t("agentShellLayout.agentShellLayout.agentNotFound"),description:t("agentShellLayout.agentShellLayout.agentNotFoundDescription",{virtualMcpId:l}),actions:n.jsx(qe,{variant:"outline",onClick:()=>e({to:"/$org",params:{org:o}}),children:t("agentShellLayout.agentShellLayout.goToOrgHome")})})})})}function Io(){const t=A.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const s=Se(e);if(s.taskId!==void 0){let i;return t[1]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(hr,{}),t[1]=i):i=t[1],i}if(s._splat!==void 0){let i;return t[2]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(bt,{}),t[2]=i):i=t[2],i}let r;return t[3]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(Ie,{children:n.jsx(ur,{children:n.jsx(_n,{children:n.jsxs(Pn,{children:[n.jsx(kr,{}),n.jsx(pr,{})]})})})}),t[3]=r):r=t[3],r}export{Io as default};
@@ -1 +0,0 @@
1
- import{aF as s,bY as e,aG as o,bZ as d,b_ as l}from"./index-CaH7O3hJ.js";const a=500;s({title:o().max(a),url:o().max(a),icon:o().max(a)});const t=s({keyId:o().max(a),modelId:o().max(a),title:o().max(a).optional()}).nullable();d(["fast","smart","thinking","image","web_search","deep_research"]);d(["fast","smart","thinking"]);const b=s({tiers:s({fast:t,smart:t,thinking:t,image:t,web_search:t,deep_research:t})});s({tiers:s({fast:t.optional(),smart:t.optional(),thinking:t.optional()})});const f=50,c=/^[a-zA-Z0-9.-]+(?::[0-9]+)?$/;s({host:o().trim().toLowerCase().min(1).max(a).regex(c).describe("Git host, e.g. 'github.com' (bare hostname, no scheme)."),secretId:o().min(1).max(a).describe("Vault secret id holding the PAT used to authenticate this host.")});s({ids:l(o().max(a)).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});const u=s({voice_mode:e().optional(),home_task_intake_enabled:e().optional().describe("Show Task mode on the Home composer and allow reports to start tasks."),demo_mode:e().optional().describe("Curated demo org: the commerce connect modal proceeds without a configured required data source."),reports_only:e().optional().describe("Curated Deco Score look: hides agent navigation, the home Customize button, and the Settings/Automations tabs. Defaulted on for orgs created by commerce onboarding."),reviewer_enabled:e().optional().describe("Run the Reviewer on a task's pull request when the card reaches In Review — it reviews the code with the repo's stack-appropriate skills, fixes what it finds on the PR's own branch, then exercises the change on the deploy preview and approves or hands the card to a human."),qa_agent_enabled:e().optional().describe("Deprecated: see reviewer_enabled."),code_reviewer_enabled:e().optional().describe("Deprecated: see reviewer_enabled."),auto_merge:e().optional().describe("When a card reaches Ready for Deployment, merge its pull request automatically instead of waiting for someone to press Ship."),auto_resolve_conflicts:e().optional().describe("When a pull request in Ready for Deployment can't be merged because it conflicts with its base branch, hand it back to the Super Agent to resolve the conflict (check out the branch, merge the base, push). Unset, it follows `auto_merge`; set it explicitly to run one without the other."),cheap_reviewer_model:e().optional().describe("Run the Reviewer on a cheaper model than the Super Agent that wrote the code. On by default — turning it off trades cost for some review depth."),coding_agent_org_mcps:e().optional().describe("Give a coding-agent run (the claude-code harness in a sandbox) every MCP connection in the org as its own MCP server, on top of the narrow Studio surface it always gets. Off by default: each connection is one more server the agent connects to at session start, and all of their tools land in its context."),coding_agents_claude_code:e().optional().describe("Run chats on a Code Agent (an agent imported from a GitHub repo) with the claude-code harness inside its sandbox, instead of hosted Decopilot. Off by default: it changes the runtime of every such chat, and claude-code flushes whole turns rather than streaming tokens."),task_board_codex:e().optional().describe("Allow tasks to select the Codex harness. Off by default; existing tasks keep Claude Code. Reviewers keep their own runtime."),chat_harness_codex:e().optional().describe("Use Codex for new sandbox chats. Off by default; requires hosted sandboxes and a ChatGPT subscription or Responses API provider. Existing chats keep their pinned runtime."),chat_harness_sandbox_only:e().optional().describe("Run every chat with the claude-code harness in its own sandbox instead of hosted Decopilot. On by default (see DEFAULT_ON_FLAGS); a deployment without hosted sandboxes keeps Decopilot regardless."),sandbox_repo_snapshots:e().optional().describe("Keep a Freestyle snapshot of each project repo at its default branch's head, with its dependencies installed and its dev server running, so a new sandbox for that repo starts already serving. Off by default: each push to a default branch costs a snapshot build the next time a sandbox starts."),auto_assign_report_tasks_to_super_agent:e().optional().describe("When a Deco Score import creates a task board item without an assignee, delegate it to the Super Agent automatically instead of leaving it unassigned."),hosting_enabled:e().optional().describe("Per-site Hosting tab (deployments, domains, deploy outcomes). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. `HOSTING_CONTROL_PLANE_GA` opens it (and its peers) to every org at once."),deco_analytics_enabled:e().optional().describe("Per-site Deco Analytics tab (traffic, realtime, usage & limits). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. `HOSTING_CONTROL_PLANE_GA` opens it (and its peers) to every org at once."),e2e_enabled:e().optional().describe("Per-site E2E tab (end-to-end test runs). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. `HOSTING_CONTROL_PLANE_GA` opens it (and its peers) to every org at once."),experiments_enabled:e().optional().describe("Per-site Experiments tab (A/B tests + variant results). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org."),experiments_v2_enabled:e().optional().describe("Rebuilt Experiments tab: describe the test in prose and an agent drafts it, plus inline editing and the implement/preview tools that write the split into the site. Off by default — an org without it keeps the table-and-dialog tab, which only records experiment metadata. Requires `experiments_enabled`, which still decides whether the tab exists at all."),monitor_enabled:e().optional().describe("Per-site Monitor tab (CDN Performance + Audience from the stats-lake warehouse). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. Its own deployment-wide switch `MONITOR_GA` opens it to every org at once (independent of the control-plane trio)."),site_create_enabled:e().optional().describe('The "Create a new site" option under New project: generates a GitHub repository from a site template in an account the org connected, and opens it as a project. Off by default, for every org — deco.cx staff included.'),new_blocks_editor:e().optional().describe("Use the redesigned blocks editor for every member of the organization. Off by default — the classic editor stays until an admin opts the org in."),blog_ai_enabled:e().optional().describe("The blog's brand context tab and its agentic generation — campaigns, post drafting and link suggestions. Off by default; with it off the blog is written by hand and every BLOG_* tool refuses, over MCP and in the app alike, so an agent cannot spend the organization's credits on a feature it turned off."),site_apps_install_enabled:e().optional().describe("Installing a site app from the Apps tab: writes the app module, the npm dependency and the registry entry into the project's repository, then reinstalls dependencies and restarts the dev script on the running sandbox. Off by default, for every org — the catalogue stays browsable without it and nothing is installable. Rollout lever, separate from the deploy."),hide_default_blog_blocks:e().optional().describe("Hide the `deco-cms/blog` built-in post blocks everywhere a post is written — the inserter, the format briefs, and generated drafts — so only the site's own `site/sections/Blog/Post/*` blocks are eligible. Off by default. Blocks already present in a post keep rendering; this only governs what can be added.")}),h=new Set(["reviewer_enabled","cheap_reviewer_model","chat_harness_sandbox_only"]);function g(i,n){const r=i?.[n];return h.has(n)?r!==!1:r===!0}function m(i){const n=i?.auto_resolve_conflicts;return typeof n=="boolean"?n:i?.auto_merge===!0}export{h as D,f as G,u as O,b as S,m as a,c as b,g as o};
@@ -1 +0,0 @@
1
- import{c as ye,b as ke,j as O,r as et,af as $t,B as xt,l as Lt,a5 as Ct}from"./index-CaH7O3hJ.js";import{a as Mt}from"./Copy01-DC8f0fwU.js";import{a as Bt,b as Vt,A as Dt}from"./alert-B29bfkXd.js";import{u as It}from"./use-copy-d7X6hrKI.js";const te="https://docs.decocms.com/storefront/blocks",Ut={quickstart:`${te}/next/quickstart`,siteEditor:`${te}/next/site-editor#edit-on-your-machine`,serve:`${te}/next/cli#deco-serve`,schema:`${te}/next/cli#deco-schema-and-deco-content`,troubleshooting:`${te}/next/troubleshooting#site-editor`};function Jr(e){const t=ye.c(4),{text:r}=e;let n;t[0]!==r?(n=r.split("`").map(Ft),t[0]=r,t[1]=n):n=t[1];let s;return t[2]!==n?(s=O.jsx(O.Fragment,{children:n}),t[2]=n,t[3]=s):s=t[3],s}function Ft(e,t){return t%2===1?O.jsx("code",{className:"whitespace-nowrap rounded bg-muted px-1 py-px font-mono text-[0.85em] text-foreground",children:e},t):O.jsx(et.Fragment,{children:e},t)}function en(e){const t=ye.c(31),{command:r}=e,n=ke(),{handleCopy:s,copied:i}=It();let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=O.jsxs("span",{"aria-hidden":"true",className:"select-none text-muted-foreground",children:["$"," "]}),t[0]=a):a=t[0];let l;t[1]!==r?(l=r.split(" ").map(Yt),t[1]=r,t[2]=l):l=t[2];let f;t[3]!==l?(f=O.jsxs("code",{className:"min-w-0 flex-1 overflow-x-auto py-1.5 font-mono text-xs leading-5 text-foreground",children:[a,l]}),t[3]=l,t[4]=f):f=t[4];let _;t[5]!==n?(_=n("decoServe.guide.copy"),t[5]=n,t[6]=_):_=t[6];let h;t[7]!==r||t[8]!==s?(h=()=>{s(r).catch(Nt)},t[7]=r,t[8]=s,t[9]=h):h=t[9];let E;t[10]!==i?(E=i?O.jsx($t,{className:"text-success"}):O.jsx(Mt,{}),t[10]=i,t[11]=E):E=t[11];let $;t[12]!==i||t[13]!==n?($=n(i?"decoServe.guide.copied":"decoServe.guide.copyShort"),t[12]=i,t[13]=n,t[14]=$):$=t[14];let x;t[15]!==$?(x=O.jsx("span",{"aria-hidden":"true",children:$}),t[15]=$,t[16]=x):x=t[16];let D;t[17]!==_||t[18]!==h||t[19]!==E||t[20]!==x?(D=O.jsxs(xt,{type:"button",variant:"ghost",size:"sm",className:"shrink-0 self-start","aria-label":_,onClick:h,children:[E,x]}),t[17]=_,t[18]=h,t[19]=E,t[20]=x,t[21]=D):D=t[21];let P;t[22]!==i||t[23]!==n?(P=i?n("decoServe.guide.copiedAnnouncement"):"",t[22]=i,t[23]=n,t[24]=P):P=t[24];let I;t[25]!==P?(I=O.jsx("span",{className:"sr-only","aria-live":"polite",children:P}),t[25]=P,t[26]=I):I=t[26];let Y;return t[27]!==I||t[28]!==f||t[29]!==D?(Y=O.jsxs("div",{className:"flex items-center gap-1 rounded-lg border border-border bg-muted/60 py-1 pr-1 pl-3",children:[f,D,I]}),t[27]=I,t[28]=f,t[29]=D,t[30]=Y):Y=t[30],Y}function Nt(){}function Yt(e,t){return O.jsxs(et.Fragment,{children:[t>0&&" ",O.jsx("span",{className:"whitespace-nowrap",children:e})]},t)}const zt={quickstart:"decoServe.docs.quickstart",siteEditor:"decoServe.docs.siteEditor",serve:"decoServe.docs.serve",schema:"decoServe.docs.schema",troubleshooting:"decoServe.docs.troubleshooting"};function tn(e){const t=ye.c(20),{links:r,className:n}=e,s=ke();let i;t[0]!==s?(i=s("decoServe.docs.heading"),t[0]=s,t[1]=i):i=t[1];let a;t[2]!==n?(a=Lt("flex flex-col gap-2 text-sm",n),t[2]=n,t[3]=a):a=t[3];let l;t[4]!==s?(l=s("decoServe.docs.heading"),t[4]=s,t[5]=l):l=t[5];let f;t[6]!==l?(f=O.jsx("span",{className:"text-muted-foreground",children:l}),t[6]=l,t[7]=f):f=t[7];let _;if(t[8]!==r||t[9]!==s){let $;t[11]!==s?($=x=>O.jsxs("a",{href:Ut[x],target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-foreground underline-offset-4 hover:underline focus-visible:underline",children:[s(zt[x]),O.jsx(Ct,{"aria-hidden":"true",className:"size-3.5"}),O.jsx("span",{className:"sr-only",children:s("decoServe.docs.newTab")})]},x),t[11]=s,t[12]=$):$=t[12],_=r.map($),t[8]=r,t[9]=s,t[10]=_}else _=t[10];let h;t[13]!==_?(h=O.jsx("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1",children:_}),t[13]=_,t[14]=h):h=t[14];let E;return t[15]!==i||t[16]!==a||t[17]!==f||t[18]!==h?(E=O.jsxs("nav",{"aria-label":i,className:a,children:[f,h]}),t[15]=i,t[16]=a,t[17]=f,t[18]=h,t[19]=E):E=t[19],E}function rn(e,t,r){switch(t.reason){case"not-answering":return{title:e("decoServe.state.notAnswering.title"),body:e("decoServe.state.notAnswering.short",{host:r})};case"outdated":return{title:e("decoServe.state.outdated.title"),body:e("decoServe.state.outdated.body",{host:r})};case"version-mismatch":return{title:e("decoServe.state.versionMismatch.title"),body:e("decoServe.state.versionMismatch.body",{host:r})};case"not-deco-serve":return{title:e("decoServe.state.notDecoServe.title",{host:r}),body:e("decoServe.state.notDecoServe.body",{host:r})};case"not-v8":return{title:e("decoServe.state.notV8.title"),body:e("decoServe.state.notV8.body",{host:r})};case"error":return{title:e("decoServe.state.error.title"),body:e("decoServe.state.error.body",{detail:t.detail??""})}}}function nn(){const e=ye.c(11),t=ke();let r;e[0]!==t?(r=t("decoServe.lna.deniedTitle"),e[0]=t,e[1]=r):r=e[1];let n;e[2]!==r?(n=O.jsx(Bt,{className:"line-clamp-none",children:r}),e[2]=r,e[3]=n):n=e[3];let s;e[4]!==t?(s=t("decoServe.lna.deniedBody"),e[4]=t,e[5]=s):s=e[5];let i;e[6]!==s?(i=O.jsx(Vt,{children:s}),e[6]=s,e[7]=i):i=e[7];let a;return e[8]!==n||e[9]!==i?(a=O.jsx(Dt,{variant:"destructive",children:O.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[n,i]})}),e[8]=n,e[9]=i,e[10]=a):a=e[10],a}const sn="website/loaders/secret.ts",on=["website/actions/secrets/encrypt.ts","$live/actions/secrets/encrypt.ts"],Wt=/^(?:[0-9a-f]{2})*$/i;function qt(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;const t=e.__resolveType;return typeof t=="string"&&(t.endsWith("/secret.ts")||t.includes("loaders/secret"))}function Kt(e){return typeof e=="string"&&Wt.test(e)}class Ht extends Error{constructor(t){super(`Secret at "${t}" is not encrypted. Re-enter it in the Secret field so it is encrypted before saving.`),this.path=t,this.name="PlaintextSecretError"}path}function He(e,t=""){if(Array.isArray(e))return e.map((n,s)=>He(n,`${t}/${s}`));if(!e||typeof e!="object")return e;const r=Object.entries(e);if(qt(e)){const n=e.encrypted;if(n!==void 0&&!Kt(n))throw new Ht(t||"/");return Object.fromEntries(r.filter(([s])=>s!=="value"))}return Object.fromEntries(r.map(([n,s])=>[n,He(s,`${t}/${n}`)]))}function Ge(e){if(!e.startsWith("#")||!e.includes("@"))return null;const t=e.indexOf("@");return{moduleResolveType:e.slice(1,t),blockId:e.slice(t+1)}}function Gt(e){return e.includes("@")}function Qe(e){const t=e.lastIndexOf("@");return t<0||t===e.length-1?null:e.slice(t+1)}function an(e,t){if(e===t)return!0;const r=Qe(e);return r?t===r||Qe(t)===r:!1}function se(e,t){const r=e.manifest?.blocks??{};for(const[n,s]of Object.entries(r))if(t in s)return n;return null}function cn(e,t){return se(e,t)!==null}function Pe(e,t){const r=se(e,t);return r!==null&&r.includes("sections")}function Qt(e,t){const r=se(e,t);return r!==null&&r.includes("apps")}function Xt(e,t){const r=se(e,t);return r!==null&&r.includes("matchers")}function de(e,t){return!(!e||t&&se(t,e)!==null||/\.\w+$/.test(e)||e==="__proto__"||e==="constructor")}function je(e){try{return decodeURIComponent(e).startsWith("Preview ")}catch{return e.startsWith("Preview ")}}const ln="oklch(0.7278 0.151 289)",Zt="website/matchers/always.ts",tt="website/matchers/never.ts",ge="website/flags/multivariate.ts",J="website/flags/multivariate/section.ts";function we(){return{__resolveType:Zt}}function X(e){const t=e.split("/");return(t[t.length-1]??e).replace(/\.(tsx?|jsx?|html?)$/,"").replace(/[-_]/g," ").replace(/\b\w/g,n=>n.toUpperCase())||e}const Jt=12,er=8,Te=32,tr=40,rr="__SECTION_REF__";function ae(e){const t=e.type;return t==="array"||Array.isArray(t)&&t.includes("array")}function Xe(e,t){let r=e.items;if(!r)return!1;if(typeof r.$ref=="string"&&(r=t(r.$ref)),Array.isArray(r.anyOf)||Array.isArray(r.oneOf))return!0;const s=r.properties?.__resolveType?.enum;return Array.isArray(s)&&typeof s[0]=="string"}const nr="VideoWidget";function Q(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function rt(e){return typeof btoa=="function"?btoa(e):Buffer.from(e).toString("base64")}function $e(e){const t=e.match(/^site\/apps\/([^/]+)\/([^/.]+)\.tsx?$/);return t?{vendor:t[1],app:t[2]}:null}function xe(e){const t=e.match(/^([^/]+)\/apps\/([^/.]+)\.tsx?$/);return t?{vendor:t[1],app:t[2]}:null}function nt(e,t){return[`site/apps/${e}/${t}.ts`,`site/apps/${e}/${t}.tsx`,`${e}/apps/${t}.ts`,`${e}/apps/${t}.tsx`]}function Le(e,t){const r=t.manifest?.blocks??{};for(const l of Object.values(r))if(l[e])return l[e];const n=$e(e)??xe(e);if(n){for(const l of nt(n.vendor,n.app))for(const f of Object.values(r))if(f[l])return f[l]}const s=rt(e);for(const l of Object.values(r))if(l[s])return l[s];const i=t.schema??{};return(i.$defs??i.definitions??{})[s]?{$ref:`#/definitions/${s}`}:{}}function st(e,t){if(Qt(e,t))return!0;const r=$e(t)??xe(t);if(!r)return!1;const n=e.manifest?.blocks?.apps??{};if(nt(r.vendor,r.app).some(a=>a in n))return!0;const s=rt(t),i=e.schema?.$defs??e.schema?.definitions??{};return s in i}function sr(e){return e==="site/apps/site.ts"?!1:$e(e)!==null||xe(e)!==null}function it(e,t){return ot(t,{resolveType:e})}function un(e,t){return ot(t,{ref:e})}function ot(e,t){const r=e.schema??{},n="resolveType"in t?Le(t.resolveType,e):{},s=r.$defs??r.definitions??{},i=r.root??{},a=o=>{if(o.startsWith("#/root/")){const c=o.slice(7);return i[c]??{}}const d=o.split("/").pop()??"",m=s[d];return m||(d===rr?i.sections??{}:{})};let l;typeof n.$ref=="string"?l=a(n.$ref):Object.keys(n).length>0?l=n:l=r;const f=o=>typeof o.$ref=="string"?a(o.$ref):o,_=o=>{const m=f(o).properties?.type;if(m){if(typeof m.const=="string")return m.const;if(typeof m.default=="string")return m.default;if(Array.isArray(m.enum)&&typeof m.enum[0]=="string")return m.enum[0]}},h=(o,d)=>{const m=f(o);return typeof m.title=="string"&&!m.title.startsWith("#")?m.title:d},E=(o,d=new Set)=>{if(typeof o.$ref!="string"||o.properties||o.anyOf||o.allOf||o.oneOf||o.type)return o;const m=o.$ref.split("/").pop()??"";return!m||d.has(m)?o:E(a(o.$ref),new Set([...d,m]))},$=o=>{const d=o.properties?.__resolveType?.enum;return Array.isArray(d)&&typeof d[0]=="string"?d[0]:void 0},x=o=>$(o)!==void 0,D=(o,d=new Set)=>{if(typeof o.$ref!="string")return[];const m=o.$ref.split("/").pop()??"";if(!m||d.has(m))return[];const c=a(o.$ref),C=c.anyOf??c.oneOf;if(!Array.isArray(C))return[];const w=new Set([...d,m]);return C.flatMap(L=>x(L)?[L]:D(L,w))},P=o=>{const d=o.hide;return d===!0||d==="true"},I=o=>typeof o=="string"&&(o.includes("://")||!/\s/.test(o)&&(o.includes("|")||o.includes("&")||o.includes("@"))),Y=(o,d=new Set,m=0)=>{if(m>Jt)return{};if(typeof o.$ref=="string"){const C=o.$ref.split("/").pop()??"";return d.has(C)?{}:Y(a(o.$ref),new Set([...d,C]),m+1)}let c={};o.properties&&typeof o.properties=="object"&&(c={...c,...o.properties}),Array.isArray(o.required)&&(c.__required=[...Q(c.__required),...Q(o.required)]);for(const C of["allOf","anyOf","oneOf"]){const w=o[C];if(Array.isArray(w))for(const L of w){const U=Q(c.__required),z=Y(L,d,m+1);c={...c,...z};const B=C==="allOf"?[...U,...Q(z.__required)]:U;B.length>0?c.__required=B:delete c.__required}}return c},V=(o,d=0,m=new Set)=>{let c=o,C;if(typeof o.$ref=="string"){c=a(o.$ref);const k=o.$ref.split("/").pop()??"";C=k,k===nr&&!c.format&&(c={...c,format:"video-uri"})}c=E(c);const w=C!==void 0&&m.has(C),L=C!==void 0?new Set([...m,C]):m,U=(k,g,S,b=!0)=>!w&&(!b||S<=tr)&&g<er?V(k,g,L):void 0;let z;{const k=c.anyOf??c.oneOf;if(Array.isArray(k)){const g=k.filter(b=>!(b.type==="null"||b.type===null)),S=b=>{if(typeof b.const=="string"||typeof b.const=="number")return b.const;if(Array.isArray(b.enum)&&b.enum.length===1&&(typeof b.enum[0]=="string"||typeof b.enum[0]=="number"))return b.enum[0]};g.length>0&&g.every(b=>S(b)!==void 0)&&(z=g.map(b=>S(b)))}}let B,ee,Fe=!1;if(c.type)B=Array.isArray(c.type)?String(c.type.find(k=>k!=="null")??c.type[0]):String(c.type);else if(c.anyOf||c.oneOf){const g=(c.anyOf??c.oneOf).filter(S=>!(S.type==="null"||S.type===null));if(g.length===0)B="null";else if(g.length===1){const S=g[0];ee=S,B=S.type?Array.isArray(S.type)?String(S.type[0]):String(S.type):typeof S.$ref=="string"?"object":"string"}else{if(z){const y=u=>typeof o[u]=="string"?o[u]:typeof c[u]=="string"?c[u]:void 0;return{type:"string",title:typeof c.title=="string"?c.title:void 0,description:typeof c.description=="string"?c.description:void 0,enum:z,format:y("format"),options:y("options")}}const S=g.filter(x),b=g.map(y=>E(y)).find(ae),H=y=>{if(typeof y.$ref!="string")return;const u=E(y),p=u.anyOf??u.oneOf;if(!Array.isArray(p))return;const v=[...p.filter(x),...p.filter(T=>!x(T)).flatMap(T=>D(T))],j=p.filter(T=>{if(x(T)||T.type==="null")return!1;const M=f(T),F=M.properties;return!F?.__resolveType&&!M.anyOf&&!M.oneOf&&(M.type==="object"||!!F)});return v.length>0&&j.length>0?{data:j,loaders:v}:void 0},G=g.flatMap(y=>{const u=H(y);return u?[u]:[]}),kt=G.length===0&&g.filter(y=>!ae(E(y))).every(y=>typeof y.$ref=="string"||S.includes(y)),Pt=S.some(y=>{const u=y.properties?.__resolveType?.enum;return Array.isArray(u)&&u[0]===ge}),he=(y=[])=>{const u=new Map;for(const R of[...S,...g.filter(A=>!S.includes(A)).flatMap(A=>D(A)),...y]){const A=$(R);A&&!u.has(A)&&u.set(A,R)}const p=[...u].map(([R,A])=>({resolveType:R,title:typeof A.title=="string"?A.title:X(R),description:typeof A.description=="string"?A.description:void 0,schema:U(A,d+1,u.size)})),v=[];for(const R of g){if(S.includes(R)||typeof R.$ref!="string")continue;const A=a(R.$ref);let W;const q=A.properties?.__resolveType;if(Array.isArray(q?.enum)&&typeof q.enum[0]=="string"&&(W=q.enum[0]),!W&&Array.isArray(A.allOf))for(const wt of A.allOf){const Ae=wt.properties?.__resolveType?.enum;if(Array.isArray(Ae)&&typeof Ae[0]=="string"){W=Ae[0];break}}W&&v.push({resolveType:W,title:typeof A.title=="string"&&!A.title.startsWith("#")?A.title:X(W),description:typeof A.description=="string"?A.description:void 0,schema:U(A,d+1,g.length)})}const j=new Set(p.map(R=>R.resolveType)),T=[...p,...v.filter(R=>!j.has(R.resolveType))],M=g.filter(R=>!S.includes(R)),F=M.length===1&&!w?V(M[0],d+1,L):void 0;return{type:"block-ref",title:typeof o.title=="string"?o.title:typeof c.title=="string"?c.title:void 0,description:typeof o.description=="string"?o.description:typeof c.description=="string"?c.description:void 0,anyOfRefs:T,plainSchema:F,hidden:P(c)||P(o)?!0:void 0}};if(b){const y=!Xe(b,a);if(y&&G.length>0){const u=typeof o.title=="string"?o.title:typeof c.title=="string"&&!I(c.title)?c.title:void 0,p=typeof o.description=="string"?o.description:typeof c.description=="string"?c.description:void 0,v=g.find(T=>ae(E(T))),j=G.flatMap(T=>T.data);return{type:"inline-union",title:u,description:p,inlineUnionBranches:[...j.map((T,M)=>({title:h(T,`Option ${M+1}`),schema:V(T,d+1,L)})),{title:h(v,`Option ${j.length+1}`),schema:V(b,d+1,L)}],loaderRef:{...he(G.flatMap(T=>T.loaders)),title:u,description:p},hidden:P(c)||P(o)?!0:void 0}}if(y&&g.length>1&&kt){const u=V(b,d+1,L),p=typeof o.title=="string"?o.title:typeof c.title=="string"?c.title:u.title,v=typeof o.description=="string"?o.description:typeof c.description=="string"?c.description:u.description;return{...u,type:"array",title:p,description:v,loaderRef:S.length>0?{...he(),title:p,description:v}:void 0}}if(Pt){const u=V(b,d+1,L);return{...u,type:"array",title:typeof c.title=="string"?c.title:u.title,description:typeof c.description=="string"?c.description:u.description}}}if(S.length>0)return he();const ze=y=>{const u=f(y);if(typeof u.title=="string"&&Ge(u.title))return!0;const p=u.properties?.__resolveType?.enum;if(Array.isArray(p)&&typeof p[0]=="string")return!0;if(Array.isArray(u.allOf))for(const v of u.allOf){const j=v.properties?.__resolveType?.enum;if(Array.isArray(j)&&typeof j[0]=="string")return!0}return!1},We=g.map(y=>_(y));if(g.length>1&&We.every(y=>typeof y=="string")&&!g.some(ze)){const y=g.map((u,p)=>{const v=f(u),j=We[p];return{resolveType:j,title:h(u,j),description:typeof v.description=="string"?v.description:void 0,discriminatorValue:j,schema:U(v,d+1,g.length,!1)}});return{type:"block-ref",title:typeof o.title=="string"?o.title:typeof c.title=="string"?c.title:void 0,description:typeof o.description=="string"?o.description:typeof c.description=="string"?c.description:void 0,discriminatorKey:"type",anyOfRefs:y,hidden:P(c)||P(o)?!0:void 0}}const qe=y=>{if(ze(y))return!1;const u=f(y);return u.type==="object"||!!u.properties},jt=y=>{const u=E(y);return ae(u)?!Xe(u,a):!1},Ke=d<Te&&g.every(y=>qe(y)||jt(y))&&g.some(qe);if(g.every(y=>typeof y.$ref=="string")&&!Ke){const y=[];for(const u of g){const p=a(u.$ref);let v,j,T=!1;if(typeof p.title=="string"){const R=Ge(p.title);R&&(v=R.blockId,j=R.blockId)}if(!v&&Array.isArray(p.allOf))for(const R of p.allOf){const q=((R.properties??{}).__resolveType??{}).enum;if(Array.isArray(q)&&typeof q[0]=="string"){v=q[0],T=!0;break}}if(!v){const A=p.properties?.__resolveType?.enum;Array.isArray(A)&&typeof A[0]=="string"&&(v=A[0],T=!0)}v||(v=u.$ref.split("/").pop()??"");const M=v.includes("/")||T&&!Gt(v),F=M?void 0:_(u);!F&&!M||T&&v==="lazy"||y.push({resolveType:F??v,title:j??(typeof p.title=="string"&&!p.title.startsWith("#")?p.title:X(v)),description:typeof p.description=="string"?p.description:void 0,discriminatorValue:F,schema:U(p,d+1,g.length)})}return{type:"block-ref",title:typeof o.title=="string"?o.title:typeof c.title=="string"?c.title:void 0,description:typeof o.description=="string"?o.description:typeof c.description=="string"?c.description:void 0,anyOfRefs:y,hidden:P(c)||P(o)?!0:void 0}}if(Ke){const y=p=>{if(typeof p.const=="string"||typeof p.const=="number"||typeof p.const=="boolean")return p.const;if(Array.isArray(p.enum)&&p.enum.length===1&&(typeof p.enum[0]=="string"||typeof p.enum[0]=="number"||typeof p.enum[0]=="boolean"))return p.enum[0]},u=g.map((p,v)=>{const j=f(p).properties??{},T={};for(const[M,F]of Object.entries(j)){const R=y(F);R!==void 0&&(T[M]=R)}return{title:h(p,`Option ${v+1}`),schema:V(p,d+1),discriminators:Object.keys(T).length?T:void 0}});return{type:"inline-union",title:typeof o.title=="string"?o.title:typeof c.title=="string"?c.title:void 0,description:typeof c.description=="string"?c.description:void 0,inlineUnionBranches:u,hidden:P(c)||P(o)?!0:void 0}}B="object"}}else c.allOf?(B="object",Fe=I(c.title)):typeof o.$ref=="string"&&(B="object");let oe,Ne,Ye=!1;if(d<Te&&!w){const k=Y(c),g=k.__resolveType?.enum;Ye=Array.isArray(g)&&g.length===1&&g[0]==="lazy";const S=Q(k.__required);S.length>0&&(Ne=S);const b=Object.entries(k).filter(([H])=>!H.startsWith("__")&&H!=="@type");if(b.length>0){oe={};for(const[H,G]of b)oe[H]=V(G,d+1,L)}}let _e;if((B==="array"||c.type==="array")&&d<Te&&!w){const k=c.items;if(k){_e=V(k,d+1,L);const g=f(k);typeof g.title=="string"&&g.title.includes("{{")&&(_e.titleBy=g.title)}}const K=k=>{const g=ee?.[k];return typeof g=="string"?g:void 0},Ot=()=>{if("default"in o)return o.default;if("default"in c)return c.default;if(ee&&"default"in ee)return ee.default};return{type:B??"string",title:typeof o.title=="string"?o.title:!Fe&&typeof c.title=="string"?c.title:K("title"),description:typeof o.description=="string"?o.description:typeof c.description=="string"?c.description:K("description"),default:Ot(),enum:Array.isArray(c.enum)?c.enum:z??void 0,format:typeof o.format=="string"?o.format:typeof c.format=="string"?c.format:K("format"),properties:oe,required:Ne,items:_e,lazy:Ye&&oe?.value?!0:void 0,recursiveRef:w&&typeof o.$ref=="string"&&(B==="object"||B==="array"||c.type==="array")?o.$ref:void 0,hidden:P(c)||P(o)?!0:void 0,titleBy:typeof c.titleBy=="string"?c.titleBy:K("titleBy"),image:typeof c.image=="string"?c.image:K("image"),options:typeof o.options=="string"?o.options:typeof c.options=="string"?c.options:K("options")}};if("ref"in t)return V({$ref:t.ref});const De=l.properties??{},Rt=Object.keys(De).every(o=>o.startsWith("__"));if(Array.isArray(l.allOf)&&l.allOf.length===1&&Rt){const o=De.__resolveType,d=Array.isArray(o?.enum)&&typeof o.enum[0]=="string"?o.enum[0]:typeof o?.const=="string"?o.const:typeof o?.default=="string"?o.default:void 0;for(const m of l.allOf){const c=E(m);if(!(Array.isArray(c.anyOf)||Array.isArray(c.oneOf))||c.properties)continue;const w=V(c,0);if(w.type==="inline-union"&&w.inlineUnionBranches){const L=I(w.title);return{...w,title:L?void 0:w.title,inlineUnionBranches:d?w.inlineUnionBranches.map(U=>({...U,discriminators:{...U.discriminators??{},__resolveType:d}})):w.inlineUnionBranches}}}}const Ie=Y(l),ve={};for(const[o,d]of Object.entries(Ie))o.startsWith("__")||o==="@type"||(ve[o]=V(d,0));if(Object.keys(ve).length===0)return null;const Ue=Q(Ie.__required);return{type:"object",title:typeof l.title=="string"?l.title:void 0,properties:ve,required:Ue.length>0?Ue:void 0}}function fn(e,t){const r=t.schema??{},n=Le(e,t),s=r.$defs??r.definitions??{},i=typeof n.$ref=="string"?s[n.$ref.split("/").pop()??""]??{}:n,a=i.properties??{};if(Object.keys(a).some(_=>!_.startsWith("__")))return!1;if(i.additionalProperties===!0)return!0;const f=a.__resolveType;return!!f&&Array.isArray(f.enum)&&f.enum[0]===e}function pn(e){const t=n=>{switch(typeof n){case"number":return{type:"number"};case"boolean":return{type:"boolean"};case"object":{if(n===null)return{type:"string"};if(Array.isArray(n))return{type:"array",items:t(n[0])};const s={};for(const[i,a]of Object.entries(n))i.startsWith("__")||(s[i]=t(a));return{type:"object",properties:s}}default:return{type:"string"}}},r={};for(const[n,s]of Object.entries(e))n.startsWith("__")||(r[n]=t(s));return Object.keys(r).length===0?null:{type:"object",properties:r}}function Ce(e,t){const r=t.schema??{},n=Le(e,t),s=r.$defs??r.definitions??{},i=typeof n.$ref=="string"?s[n.$ref.split("/").pop()??""]??{}:Object.keys(n).length>0?n:{...r,...n},a=i.icon,l=i.logo,f=i,_=E=>E===!0||E==="true",h=_(f.hide)||_(f.ignore)||_(f.unlisted);return{title:typeof i.title=="string"?i.title:void 0,description:typeof i.description=="string"?i.description:void 0,icon:typeof a=="string"?a:void 0,logo:typeof l=="string"?l:void 0,hidden:h||void 0}}function at(e){return e.replace(/\/+$/,"")||"/"}function yn(e){return e.trim().replace(/^\/+|\/+$/g,"")}function ir(e){const t=e.trim();return!(!t.startsWith("/")||t.startsWith("//")||t.includes("..")||t.includes("\\"))}function dn(e){const t=e.trim();return t?ir(t)?null:"Path must start with / and must not contain .. or //.":"Path is required."}const Me=/:([A-Za-z0-9_-]+)|\*/g;function gn(e){const t=[];for(const r of e.matchAll(Me)){const n=r[1]??"*";t.includes(n)||t.push(n)}return t}function ct(e){return e.replace(/\{([^{}]*)\}\?/g,"$1")}function mn(e){e=ct(e);const t=[];let r=0;for(const n of e.matchAll(Me))n.index>r&&t.push({type:"text",text:e.slice(r,n.index)}),t.push({type:"param",name:n[1]??"*"}),r=n.index+n[0].length;return r<e.length&&t.push({type:"text",text:e.slice(r)}),t}function vn(e,t){return ct(e).replace(Me,(r,n)=>{const s=t[n??"*"]?.trim();return s?n!==void 0?encodeURIComponent(s):s.split("/").filter(Boolean).map(encodeURIComponent).join("/")||r:r})}const or=["website/sections/Rendering/Lazy.tsx","website/sections/Rendering/SingleDeferred.tsx"],Ze="website/sections/Rendering/Lazy.tsx";function N(e){return or.some(t=>e.endsWith(t))}const lt=["website/pages/Page.tsx","$live/pages/LivePage.tsx"],ut=new Set(lt),ar=lt[0],cr=new Set(["site/sections/Theme/Theme.tsx"]);function me(e){return!!(cr.has(e)||N(e)||e.toLowerCase().includes("preview"))}function lr(e){const t=e.manifest?.blocks??{};for(const r of Object.values(t))for(const n of Object.keys(r))if(ut.has(n))return n;return Object.hasOwn(t.pages??{},"page")?"page":ar}function be(e){if(!e)return[];if(e.anyOfRefs?.length)return e.anyOfRefs;if(e.items)return be(e.items);if(e.properties){const t=[];for(const r of Object.values(e.properties))t.push(...be(r));return t}return[]}function ur(e){const t=e.manifest?.blocks??{},r=[];for(const[n,s]of Object.entries(t))if(n.includes("sections"))for(const i of Object.keys(s)){if(me(i))continue;const a=Ce(i,e);r.push({resolveType:i,title:a.title??X(i),description:a.description,previewBlock:i,isSavedBlock:!1})}return r}function _n(e){const t=e.manifest?.blocks??{},r=new Map;for(const[n,s]of Object.entries(t))if(n.includes("sections"))for(const i of Object.keys(s))me(i)||r.has(i)||r.set(i,{resolveType:i,title:X(i)});return[...r.values()].sort((n,s)=>n.title.localeCompare(s.title))}function ft(e,t){const r=t.__resolveType;if(typeof r!="string")return"";if(r!==J)return r;const n=t.variants;if(!Array.isArray(n))return r;for(const s of n){const i=s?.value;if(!i)continue;let a=i.__resolveType;if(typeof a=="string"&&N(a)&&(a=i.section?.__resolveType??a),typeof a=="string"&&Pe(e,a))return a}return r}function fr(e,t){return ft(e,t)!==t.__resolveType}function pt(e,t){const r=[];for(const[n,s]of Object.entries(t)){if(n.includes("/")||je(n)||!s||typeof s!="object"||Array.isArray(s))continue;const i=s,a=i.__resolveType;typeof a!="string"||ut.has(a)||typeof i.path=="string"||me(a)||!(Pe(e,a)||a===J&&fr(e,i))||r.push({resolveType:n,title:n,description:typeof i.name=="string"?i.name:void 0,previewBlock:n,isSavedBlock:!0})}return r}function pr(e,t){const r=de(t.resolveType,e),n=r?{}:Ce(t.resolveType,e);return{resolveType:t.resolveType,title:t.title||n.title||X(t.resolveType),description:t.description??n.description,previewBlock:t.resolveType,isSavedBlock:r}}function hn(e,t){const r=lr(e),n=it(r,e),s=be(n?.properties?.sections),i=new Map,a=l=>{if(!me(l.resolveType)){if(de(l.resolveType,e)){je(l.resolveType)||i.set(l.resolveType,l);return}Pe(e,l.resolveType)&&(i.has(l.resolveType)||i.set(l.resolveType,l))}};for(const l of ur(e))a(l);for(const l of s)a(pr(e,l));for(const l of pt(e,t))a(l);return[...i.values()].sort((l,f)=>l.title.localeCompare(f.title))}function An(e){const t=e.site;if(!t||typeof t!="object"||Array.isArray(t))return;const r=t.theme;if(!(!r||typeof r!="object"||Array.isArray(r)))return r}const Be="website/loaders/redirect.ts",Tn=new Set([Be,"website/loaders/redirects.ts"]),Ve="redirect",yr=[301,302,307,308],dr={temporary:307,permanent:301};function Sn(e){return e.flat?e.status??(e.type==="permanent"?301:302):dr[e.type]}const ue=e=>typeof e=="string"?e:"",gr=e=>e==="permanent"?"permanent":"temporary",mr=e=>yr.find(t=>t===e);function vr(e){const t=mr(e.status);return{from:ue(e.from),to:ue(e.to),type:e.permanent===!0?"permanent":"temporary",discardQueryParameters:e.discardQueryParameters===!0,flat:!0,...t?{status:t}:{}}}function yt(e){if(e?.__resolveType===Ve)return vr(e);const t=e&&typeof e.redirect=="object"&&e.redirect!==null&&!Array.isArray(e.redirect)?e.redirect:{};return{from:ue(t.from),to:ue(t.to),type:gr(t.type),discardQueryParameters:t.discardQueryParameters===!0}}function _r(e){const t=[];for(const[r,n]of Object.entries(e)){if(!n||typeof n!="object"||Array.isArray(n))continue;const s=n;s.__resolveType!==Be&&s.__resolveType!==Ve||t.push({key:r,...yt(s)})}return t}function bn(e){return yt(e)}function En(e,t){if(e.flat){const{status:n,discardQueryParameters:s,...i}=t??{};return{...i,__resolveType:Ve,from:e.from,to:e.to,permanent:e.type==="permanent",...e.status?{status:e.status}:{},...e.discardQueryParameters?{discardQueryParameters:!0}:{}}}const r={from:e.from,to:e.to,type:e.type};return e.discardQueryParameters&&(r.discardQueryParameters=!0),{redirect:r,__resolveType:Be}}function hr(e){return(e.split(/[?#]/)[0]??"").replace(/^\/+/,"").replace(/[^a-zA-Z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,32)||"redirect"}const Ar=1e3;function Rn(e,t){const r=hr(t);for(let n=0;n<Ar;n++){const s=`redirects-${r}-${crypto.randomUUID()}`;if(!Object.hasOwn(e,s))return s}throw new Error("Could not generate a unique redirect block key")}function Tr(e){let t=e;t.startsWith("pages-")&&(t=t.slice(6)),t=t.replace(/-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,""),t=t.replace(/-[0-9a-f]{8,}$/i,"");try{return decodeURIComponent(t)}catch{return t}}function On(e,t){const{pageId:r,path:n,pathTemplate:s}=t;if(r){const i=e.find(l=>l.key===r);if(i)return i;const a=e.find(l=>l.key.endsWith(`-${r}`));if(a)return a}if(n){const i=Je(e,n);if(i)return i}if(s){const i=Je(e,s);if(i)return i}return null}function Je(e,t,r){const n=at;if(r){const i=e.find(a=>a.key===r);if(i)return i}const s=e.filter(i=>n(i.path)===n(t));return s.length===0?null:s.length===1?s[0]??null:[...s].sort((i,a)=>i.key.localeCompare(a.key))[0]??null}const Sr=new Set(["website/pages/Page.tsx","$live/pages/LivePage.tsx"]);function dt(e,t){return Sr.has(e)||Object.hasOwn(t?.manifest?.blocks?.pages??{},e)}const ne="site",gt="site/apps/site.ts";function Ee(e,t){return e===ne?!0:t.__resolveType===gt}function kn(e,t){return e?mt(e,t).length>0||_r(e).length>0?!0:t?kr(e,t).length>0||Rr(e,t)?!0:Or(e,t).length>0:!1:!1}function br(e,t,r){if(!t||typeof t!="object"||Array.isArray(t))return null;const n=t;return typeof n.__resolveType!="string"||!dt(n.__resolveType,r)||typeof n.path!="string"?null:{key:e,name:typeof n.name=="string"?n.name:Tr(e),path:n.path}}function mt(e,t){const r=[];for(const[n,s]of Object.entries(e)){const i=br(n,s,t);i&&r.push(i)}return r}function fe(e,t,r=0){if(r>64||!e||typeof e!="object")return!1;if(Array.isArray(e))return e.some(s=>fe(s,t,r+1));const n=e;return typeof n.__resolveType=="string"&&t.has(n.__resolveType)?!0:Object.values(n).some(s=>fe(s,t,r+1))}function Er(e,t,r){const n=mt(e,r),s=new Set(n.map(a=>a.key)),i=new Set([t]);for(let a=!0;a;){a=!1;for(const[l,f]of Object.entries(e))i.has(l)||s.has(l)||fe(f,i)&&(i.add(l),a=!0)}return n.filter(a=>a.key!==t&&fe(e[a.key],i))}function Pn(e,t,r){const n=i=>at(i.path)==="/"?0:/:[A-Za-z0-9_-]|\*/.test(i.path)?2:1,[s]=Er(e,t,r).sort((i,a)=>n(i)-n(a)||(i.path<a.path?-1:i.path>a.path?1:0));return s??null}function vt(e,t){if(typeof t.name=="string"){const r=t.name.trim();if(r)return r}return e.replace(/[-_]/g," ").replace(/\b\w/g,r=>r.toUpperCase())}function Re(e,t,r){const n=typeof t.__resolveType=="string"?t.__resolveType:"",s=n?Ce(n,r):{};if(s.title)return s.title;if(typeof t.name=="string"){const i=t.name.trim();if(i)return i}return e.replace(/[-_]/g," ").replace(/\b\w/g,i=>i.toUpperCase())}function Rr(e,t){const r=e[ne];if(r&&typeof r=="object"&&!Array.isArray(r)){const n=r,s=n.__resolveType;if(typeof s=="string"&&(Ee(ne,n)||st(t,s)))return{key:ne,name:Re(ne,n,t),resolveType:s}}for(const[n,s]of Object.entries(e)){if(n.includes("/")||!s||typeof s!="object"||Array.isArray(s))continue;const i=s;if(!Ee(n,i))continue;const a=typeof i.__resolveType=="string"?i.__resolveType:gt;return{key:n,name:Re(n,i,t),resolveType:a}}return null}function Or(e,t){const r=[];for(const[n,s]of Object.entries(e)){if(n.includes("/")||!s||typeof s!="object"||Array.isArray(s))continue;const i=s,a=i.__resolveType;typeof a=="string"&&(dt(a,t)||typeof i.path!="string"&&(Ee(n,i)||!st(t,a)&&!sr(a)||r.push({key:n,name:Re(n,i,t),resolveType:a})))}return r.sort((n,s)=>n.name.localeCompare(s.name))}function kr(e,t){return pt(t,e).map(r=>{const n=e[r.resolveType],s=ft(t,n);return{key:r.resolveType,name:r.description??vt(r.resolveType,n),resolveType:s}}).sort((r,n)=>r.name.localeCompare(n.name))}const Pr=new Set(["website/pages/Page.tsx","$live/pages/LivePage.tsx"]);function jr(e){return e.includes("matchers")||e.includes("Match")}function _t(e,t){const r=e.__resolveType;return typeof r!="string"||!r||Pr.has(r)?!1:t?Xt(t,r):jr(r)}function jn(e,t){const r=[];for(const[n,s]of Object.entries(t)){if(n.includes("/")||!de(n,e)||je(n)||!s||typeof s!="object"||Array.isArray(s))continue;const i=s;_t(i,e)&&r.push({blockKey:n,matcherResolveType:i.__resolveType??"",name:typeof i.name=="string"?i.name:void 0})}return r.sort((n,s)=>(n.name??n.blockKey).localeCompare(s.name??s.blockKey))}function ie(e,t,r){if(!e)return!1;const n=e.__resolveType;if(typeof n!="string"||!de(n,r)||!Object.hasOwn(t,n))return!1;const s=t[n];return!s||typeof s!="object"||Array.isArray(s)?!1:_t(s,r)}function wn(e,t,r){return ie(e,t,r)?e?.__resolveType??null:null}function ht(e,t,r){if(!e)return null;const n=e.__resolveType??"";if(!n)return null;if(ie(e,t,r)){const a=t[n]??{},l=a.__resolveType??n,{__resolveType:f,name:_,...h}=a;return{resolveType:l,data:h,blockKey:n}}const{__resolveType:s,...i}=e;return{resolveType:n,data:i}}function wr(e,t,r){const n=ht(e,t,r);return n?{__resolveType:n.resolveType,...n.data}:{__resolveType:""}}function $n(e,t,r){if(e)return ie(e,t,r)?wr(e,t,r):e}function $r(e,t,r,n){if(!e)return"Default";if(ie(e,t,n)){const s=e.__resolveType??"",i=t[s];return vt(s,i)}return r(e)}function xn(e,t,r){return{__resolveType:e,...t,name:r}}function Ln(e){return{__resolveType:e}}function Cn(e,t,r){const n=ht(e,t,r);return n?{resolveType:n.resolveType,formValue:n.data}:{resolveType:"",formValue:{}}}function Mn(e,t){const r={__resolveType:e};if(!e||!t)return r;const n=it(e,t),s=n?.type==="inline-union"?n.inlineUnionBranches?.[0]?.discriminators:void 0;return s?{...r,...s}:r}function At(e){const t=e.__resolveType??"";return N(t)?e.section??e:e}function pe(e){const s=(N(e.__resolveType??"")?e.section:e)?.variants?.[0];return s?.rule?.__resolveType!==tt?null:s?.value??null}function Bn(e){const t=At(e);return{__resolveType:J,variants:[{value:t,rule:{__resolveType:tt}}]}}function Vn(e){const t=e.__resolveType??"";if(!t)return null;if(N(t))return e.section??null;const r=pe(e);return r?N(r.__resolveType??"")?r:{__resolveType:Ze,section:At(r)}:{__resolveType:Ze,section:e}}function ce(e){const t=e.__resolveType??"";if(!t)return null;if(N(t)){const r=e.section,n=r?.__resolveType??"";return!n||!r?null:{resolveType:n,data:r}}return{resolveType:t,data:e}}function Dn(e){const t=pe(e);if(t)return ce(t);if(N(e.__resolveType??"")){const n=e.section;if(!n)return null;const s=pe(n);return ce(s||n)}return ce(e)}function In(e){return pe(e)}const xr=["website/matchers/always.ts","$live/matchers/MatchAlways.ts"];function Tt(e){if(!e)return!1;const t=e.__resolveType??"";return t===""?Object.keys(e).length===0:xr.includes(t)||t.includes("always")}function Lr(e){const t=e.variants??[];if(t.length===0)return-1;const r=t.findIndex(n=>Tt(n.rule));return r!==-1?r:t.length-1}function Un(e,t,r){const n=r.variants??[];if(n.length===0)return null;const s=Lr(r),i=n[s]?.value;if(!i)return null;const a=structuredClone(i);return t.isLazy?{...e,section:a}:a}function St(e,t){return t.isMultivariate?t.isLazy?e.section??null:e:null}function Fn(e,t){return Array.isArray(e.variants)?e.variants.map((r,n)=>({label:t(r.rule)||`Variant ${n+1}`,value:r.value??{},rule:r.rule})):[]}function Nn(e,t){const r=e.__resolveType??"";if(!r)return null;if(N(r)){const n=e.section??e,s=n.__resolveType??r;if(!s.includes("/")&&s in t){const i=t[s]??{};return{data:{...i},resolveType:i.__resolveType??s}}return{data:{...n},resolveType:s}}if(!r.includes("/")&&r in t){const n=t[r]??{};return{data:{...n},resolveType:n.__resolveType??r}}return{data:{...e},resolveType:r}}function Cr(e,t){const r=e.__resolveType??"";return N(r)?{...e,section:t}:t}function Mr(e,t,r){return t.isLazy?{...e,section:r}:r}function Yn(e,t,r){const n=[...e.variants??[]],s=n[t];if(!s)return e;const i=s.value??{};return n[t]={...s,value:Cr(i,r)},{...e,variants:n}}function zn(e,t,r){const n=[...e.variants??[]];return n[t]?(n[t]={...n[t],rule:r},{...e,variants:n}):e}function Wn(e,t){const r=[...e.variants??[]],n=r[t];return n?(r.splice(t+1,0,structuredClone(n)),{...e,variants:r}):e}function qn(e,t,r){const n=[...e.variants??[]];if(t===r||t<0||r<0||t>=n.length||r>=n.length)return e;const[s]=n.splice(t,1);return s?(n.splice(r,0,s),{...e,variants:n}):e}function Kn(e,t){const r=[...e.variants??[]];return r.length<=1?null:(r.splice(t,1),{...e,variants:r})}function Oe(e){return{rule:we(),value:structuredClone(e)}}function bt(e,t){return{...t,__resolveType:J,variants:e}}function Hn(e){return e.isHidden!==!0&&e.isSavedBlock!==!0}function Br(e,t){if(t.isHidden)return null;if(t.isMultivariate){const n=St(e,t)?.variants??[],s=n[n.length-1]?.value;return s?structuredClone(s):null}if(t.isLazy){const r=e.section;return r?structuredClone(r):null}return structuredClone(e)}function Vr(e,t,r){if(t.isMultivariate||t.isHidden)return null;const n=Br(e,t);if(!n)return null;const s=bt([Oe(n),Oe(n)]);return t.isLazy?{...e,section:s}:s}function Gn(e,t,r){if(t.isHidden||t.isSavedBlock)return null;if(t.isMultivariate){const s=St(e,t);if(!s)return null;const i=s.variants??[],a=i[i.length-1]?.value;if(!a)return null;const l=bt([...i,Oe(a)],s);return{section:Mr(e,t,l),newVariantIndex:i.length}}const n=Vr(e,t);return n?{section:n,newVariantIndex:1}:null}function Dr(e){return e.anyOfRefs?.some(t=>t.resolveType!==ge?!1:t.schema?.properties?.variants?.items?.properties?.value?.type==="array")??!1}function Qn(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;const t=e;return t.__resolveType===J&&Array.isArray(t.variants)}function Et(e){return!e||typeof e!="object"||Array.isArray(e)?!1:e.__resolveType===ge}function Xn(e){if(!Et(e))return null;const t=e.variants;if(!Array.isArray(t))return null;const r=t[0]?.value;return Array.isArray(r)?r:null}function Zn(e,t){if(!Et(e))return t;const r=structuredClone(e),n=[...r.variants??[]];return n.length===0?n.push({rule:we(),value:t}):n[0]={...n[0],value:t},{...r,variants:n}}function Jn(e,t){const n=e[t]?.sections;if(!n||Array.isArray(n))return 1;const s=n;return Array.isArray(s.variants)?s.variants.length:1}function es(e,t,r){const s=e[t]?.sections;if(Array.isArray(s))return r===0?s:[];if(s&&typeof s=="object"){const i=s.variants;if(Array.isArray(i)){const a=i[r];return Array.isArray(a?.value)?a.value:[]}}return[]}function ts(e,t,r){if(Array.isArray(e))return[{label:"Default",sections:e}];if(e&&typeof e=="object"){const n=e;if(Array.isArray(n.variants)){const s=n.variants,i=s.map(f=>$r(f.rule,t,r)),a=i.reduce((f,_)=>(f[_]=(f[_]??0)+1,f),{}),l={};return s.map((f,_)=>{const h=i[_]??`Variant ${_+1}`,E=a[h]??1;let $=h;return E>1&&(l[h]=(l[h]??0)+1,$=`${h} ${l[h]}`),{label:$||`Variant ${_+1}`,sections:Array.isArray(f.value)?f.value:[],rule:f.rule}})}}return[]}function re(e){return{rule:we(),value:e}}function Z(e,t){return{...t,__resolveType:ge,variants:e}}function rs(e,t){const r=structuredClone(t);if(Array.isArray(e))return Z([re(e),re(r)]);if(e&&typeof e=="object"){const n=e;return Array.isArray(n.variants)?Z([...n.variants,re(r)],n):null}return Z([re([]),re(r)])}function ns(e){const t=e.variants;return Array.isArray(t)?t.length-1:1}function ss(e,t){const r=e[t];if(!r)return null;const n=[...e];return n.splice(t+1,0,structuredClone(r)),n}function is(e,t){if(t.length===0)return Z([],e);if(t.length===1){const r=t[0],n=r?.rule;if(!Tt(n))return Z(t,e);if(Array.isArray(r?.value))return r.value}return Z(t,e)}function Ir(e,t,r){const n=[];for(const[i,a]of Object.entries(e))i!==t&&n.push(a);const s=new Set;for(;n.length>0;){const i=n.pop();if(!(!i||typeof i!="object")&&!s.has(i)){if(s.add(i),Array.isArray(i)){for(const a of i)n.push(a);continue}r(i);for(const a of Object.values(i))n.push(a)}}}function os(e,t,r){if(!t)return 0;let n=0;return Ir(e,t,s=>{s.__resolveType===t&&ie(s,e,r)&&n++}),n}const as={claiming:{long:"Reserving sandbox",short:"Reserving sandbox"},"waiting-for-capacity":{long:"Waiting for cluster capacity",short:"Waiting for capacity"},"pulling-image":{long:"Downloading sandbox image",short:"Downloading image"},"starting-container":{long:"Starting your sandbox",short:"Starting container"},"warming-daemon":{long:"Connecting to your sandbox",short:"Connecting to sandbox"}};function le(e){return e.includes("/sections/")||e.includes("multivariate/section")||e===J}function Ur(e){if(e.type==="block-ref"&&e.anyOfRefs?.length)return e.anyOfRefs.some(r=>le(r.resolveType));if(e.anyOfRefs?.length)return e.anyOfRefs.some(r=>le(r.resolveType));const t=e.properties?.__resolveType;return t?.type==="block-ref"&&t.anyOfRefs?.length?t.anyOfRefs.some(r=>le(r.resolveType)):!1}function cs(e){return e.type!=="block-ref"||!e.anyOfRefs?.length?!1:e.anyOfRefs.some(t=>le(t.resolveType))}function ls(e,t){if(t==="global"||t==="sections"||Dr(e))return!0;const r=e.type==="array"?e.items:void 0;return r?Ur(r):!1}const us="secret",Fr=[256,384,512],Nr=12,Yr=16,zr=/^v1\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$/;function Wr(e){let t="";for(const r of e)t+=String.fromCharCode(r);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function Se(e){if(!/^[A-Za-z0-9_-]*$/.test(e)||e.length%4===1)return null;const t=e.replace(/-/g,"+").replace(/_/g,"/")+"=".repeat((4-e.length%4)%4);let r;try{r=atob(t)}catch{return null}const n=Uint8Array.from(r,s=>s.charCodeAt(0));return Wr(n)===e?n:null}function qr(e){if(typeof e!="string"||!zr.test(e))return null;const[,t="",r="",n=""]=e.split("."),s=Se(t),i=Se(r),a=Se(n);return!s||!i||!a||!Fr.includes(s.byteLength)||i.byteLength!==Nr||a.byteLength<Yr?null:{wrappedKey:s,iv:i,ciphertext:a}}function fs(e){return qr(e)!==null}export{X as $,Re as A,Ce as B,as as C,ar as D,dr as E,Sn as F,He as G,ln as H,On as I,Rr as J,_r as K,nn as L,_n as M,tt as N,Jn as O,rs as P,Rn as Q,Jr as R,us as S,En as T,Ut as U,be as V,de as W,ge as X,an as Y,Ge as Z,Qe as _,Tr as a,Gt as a0,Zt as a1,J as a2,Dr as a3,un as a4,cn as a5,ls as a6,jn as a7,wr as a8,Ln as a9,An as aA,Hn as aB,St as aC,Fn as aD,Nn as aE,ht as aF,Gn as aG,ns as aH,qn as aI,Mr as aJ,Un as aK,Kn as aL,Wn as aM,zn as aN,Vn as aO,In as aP,Bn as aQ,is as aR,os as aS,Yn as aT,Lr as aU,ss as aV,bn as aW,yr as aX,$n as aa,ts as ab,cs as ac,hn as ad,we as ae,Tt as af,$r as ag,wn as ah,Cn as ai,ie as aj,xn as ak,Mn as al,Kt as am,on as an,sn as ao,fs as ap,Qn as aq,Et as ar,Xn as as,Zn as at,Tn as au,je as av,fn as aw,pn as ax,st as ay,Dn as az,qt as b,le as c,Pn as d,gn as e,vn as f,vt as g,en as h,Ee as i,tn as j,N as k,mn as l,yn as m,at as n,kn as o,br as p,mt as q,kr as r,rn as s,Je as t,es as u,dn as v,lr as w,it as x,gt as y,sr as z};
@@ -1,4 +0,0 @@
1
- import{c as it,b as Ft,r as R,l as ae,j as i,b5 as Oi,B as _t,U as sn,ag as Li,X as $i,V as zi,a as vo,F as Hi,K as xo,m as Wi,o as qi,h as Gi,t as oe}from"./index-CaH7O3hJ.js";import{u as Ui}from"./chat-context-_d3c57p1.js";import{a5 as Yi,T as Wn,a6 as Ji,a7 as Qi,a8 as Xi,a9 as Zi,aa as ea,ab as ta,ac as Br,ad as na,ae as sa,G as jt,af as wt,ag as ze,ah as ra,H as Fn,E as On,b as oa,j as ia,u as aa,ai as Kr,q as la,aj as ca,s as ua,o as da,ak as yo,p as _n,al as fa,am as ma,A as Fr,an as pa,ao as ha,ap as Bn,aq as Or,ar as Lr,as as $r,at as us,au as ga,av as va,F as xa,aw as zr,ax as ya,ay as Hr,az as Wr,M as Sa,aA as qr,a as ba,aB as Sn,aC as ja,aD as wa,aE as bn,aF as ds}from"./blocks-tab-states-jGeS9iVz.js";import{c as _a}from"./repository-binding-BLgLcT4o.js";import{n as ka,t as Ea}from"./ChevronUp-C8mqlnDX.js";import{ac as So,b as zn,ar as Ra,G as Aa,a5 as Gr,a1 as Ur}from"./agent-icon-U4gZaLOQ.js";import{S as rn}from"./scroll-area-Bnrys5oj.js";import{c as kt,T as Et,a as Rt}from"./tooltip-B5RmO6BW.js";import{am as Ca,g as Yr,J as Na,u as Ta,K as Va,w as Ma,ab as Da,x as Pa,d as Pt,f as It,a7 as Ia,ar as Ba}from"./site-editor-toast-BtFL0E4q.js";import{m as Ka,u as Fa,P as Oa}from"./mustache-BxPGtFxk.js";import{az as La,k as Rs,aB as bo,H as $a,aC as xt,aD as vs,aE as jo,aj as Gt,a8 as xs,aF as ys,ak as Kt,a9 as on,q as za,t as Ha,g as Wa,x as Kn,ar as qa,ai as jn,aa as fs,ah as Bt,ag as wn,aG as Ga,P as Ua,aH as Ya,al as Jr,a1 as Qr,aI as Ja,aJ as qt,aK as Qa,aL as Xa,aM as Za,aN as Xr,aO as el,aP as tl,aQ as nl,af as sl,aR as rl,aS as ol,aT as il,aU as al,ae as ll,aV as cl}from"./secret-ciphertext-DZr2qcb4.js";import{a as ul}from"./Copy01-DC8f0fwU.js";import{a as Ss,f as wo}from"./UserSquare-Drp4z0v0.js";import{i as Zr}from"./Tool01-BM29_KWq.js";import{s as eo}from"./Image01-D7F4wuKx.js";import{s as dl}from"./Plus-BDveVGJf.js";import{s as fl}from"./Trash01-D92WhXf2.js";import{i as bs}from"./ZoomOut-BfQx-fBr.js";import{u as ml,a as to,K as pl,P as hl,b as gl,C as vl,D as xl,c as yl}from"./core.esm-DNra8pgf.js";import{u as Sl,s as bl,a as Ln,S as jl,v as wl}from"./sortable.esm-C1zl1f3P.js";import{s as _l,g as kl,u as El,A as Rl}from"./use-section-preview-base-Ca45yoz9.js";import{A as ms}from"./avatar-RpIBVCkY.js";import{e as Al,d as no,b as Cl,A as Nl,a as Tl,f as Vl}from"./alert-dialog-CKDHmJ-l.js";import{b as Ml}from"./format-time-Cq80KKvY.js";import{d as Dl}from"./shell-layout-vQvYndIW.js";import{u as Pl}from"./use-members-h3MYd8gX.js";import{a as Il,P as so,b as Bl}from"./page-seo-form-PX_1VQkb.js";import{c as ro,d as oo,e as Kl,f as Fl}from"./variant-draft-pointer-_apEPqxm.js";import"./use-panel-navigate-DoD4Atgz.js";import"./thread-route-CQ0phZyI.js";import"./use-project-scope-Cq4vb2Sy.js";import"./autosend-BZOm698U.js";import"./thread-intent-DKuqiaG7.js";import"./use-mcp-client-MRThuZpK.js";import"./auth-hgpoCSIS.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-DwBbAQ97.js";import"./task-board-DRNr9Dsj.js";import"./schema-BdFq22Hl.js";import"./slugify-CEUa2lfQ.js";import"./use-decopilot-events-AlKmmETJ.js";import"./use-ai-providers-D1TJRnIR.js";import"./location-V0VwTJTt.js";import"./use-organization-settings-DhvN44pQ.js";import"./input-D2sd1bar.js";import"./usage-stats-BkcKNXzu.js";import"./tool-namespace-DTl3so75.js";import"./form-Dpwt-9St.js";import"./label-Cnc4HQwP.js";import"./utils-CVEq3hMx.js";import"./markdown-CA3yd3L6.js";import"./use-copy-d7X6hrKI.js";import"./use-mobile-DCpa1RnA.js";import"./XClose-dOW_RI9u.js";import"./icon-button-CwrVRVUS.js";import"./file-type-icon-DPqHd815.js";import"./chat-draft-CKcHhXuF.js";import"./LinkBroken01-BJx0R97x.js";import"./ArrowUp-bYg1aEOe.js";import"./ShoppingBag01-BMRnsG58.js";import"./Upload01-BSDy4f7m.js";import"./AlertCircle-Ctbquk5a.js";import"./select-CSQbGY9x.js";import"./index-BdQq_4o_.js";import"./index-C9OgV5Vt.js";import"./ArrowLeft-DZ0mAFgb.js";import"./tabs-2NCCfhSA.js";import"./active-indicator-CCMhAsc_.js";import"./use-deco-credits-Dx8wT8P5.js";import"./toggle-group-CtdhsZGp.js";import"./use-open-billing-url-B2NuYLXS.js";import"./index-BpRXpcv4.js";import"./checkbox-CUzk21sc.js";import"./Minus-C1PMcNV0.js";import"./ChevronSelectorVertical-DaUdbCWk.js";import"./Key01-u4HXXUPa.js";import"./SearchMd-Cuf45jFP.js";import"./ai-providers-logos-DD3qZ33J.js";import"./Monitor01-D3VwU2ni.js";import"./popover-DSRFfUdL.js";import"./drawer-ZlYTI3Z6.js";import"./input-DN6U5jAj.js";import"./suggestion-Wgq7DDQo.js";import"./use-mcp-prompts-DHm-ZTib.js";import"./use-org-fs-D_4Q985K.js";import"./useInfiniteQuery-ZoWXsJcj.js";import"./infiniteQueryObserver-u-Zd7Oxq.js";import"./Link01-BoUupQbW.js";import"./question-004-sINsf4GQ.js";import"./feature-paywall-D-GfxA1X.js";import"./plan-ladder-BydnH1hR.js";import"./add-connection-dialog-B0vtW1sl.js";import"./collection-search-gW4FCqmq.js";import"./extract-connection-data-CNLani4P.js";import"./metadata-D72DunRR.js";import"./connection-Dik4epzq.js";import"./url-slug-B41xLFy_.js";import"./connection-card-DCnmTKpJ.js";import"./connection-slug-CITJ0kGN.js";import"./integration-icon-DCiBepJw.js";import"./textarea-CxhXyMKI.js";import"./use-connection-BwU_KLSF.js";import"./schema-Cx9ZLa-H.js";import"./connection-form-helpers-ta2yIvIb.js";import"./authenticate-and-persist-oauth-jn1R1qId.js";import"./mcp-oauth-3Gakbc_U.js";import"./mcp-oauth-CxgfM8zh.js";import"./collection-tabs-DIFXv7hR.js";import"./badge-Cnnepvq1.js";import"./use-infinite-scroll-BO0n6TVn.js";import"./useSuspenseInfiniteQuery-D2W70ffp.js";import"./use-task-board-events-CSRq29Tm.js";import"./use-chat-layout-state-BNudmQ0u.js";import"./utils-DzhKsxx8.js";import"./Play-DxsFk4r2.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-5gOZrfkD.js";import"./collapsible-CeBZpglT.js";import"./use-clock-tick-D3FoyBXt.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-Xaw0krD3.js";import"./types-Bt5yyj-z.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./sheet-C-yunzji.js";import"./use-navigate-to-agent-Bt0oZ-ou.js";import"./use-thread-outputs-jyAHyZHI.js";import"./switch-DYA2xfHU.js";import"./command-C7n5qLsN.js";import"./index-DK4LlU65.js";import"./monaco-editor-C7rmyhBT.js";import"./editor-BFHySd1K.js";import"./calendar-DqVFnL9A.js";import"./SwitchHorizontal01-CshMTQzi.js";import"./editor-classes-DPi5BWR5.js";import"./combobox-DlpsfK7m.js";import"./DotsVertical-BvwGTDkC.js";import"./search-input-CXQLMhKZ.js";import"./use-debounced-value-DJkh4QSx.js";import"./use-file-configs-tsH4be9V.js";import"./asset-utils-DrTFUoo_.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./sandbox-git-api-CRxdlhrN.js";import"./sandbox-url-D3mC8qhT.js";import"./empty-state-Bok1L2hc.js";import"./Building02-BHIVlbfK.js";import"./CheckCircle-C2ndOEUO.js";import"./CreditCard01-P7j8oDkg.js";import"./Globe04-D6C-ihBU.js";import"./Sun-sKGpeIhM.js";import"./User01-Cn3JqTjv.js";import"./Users01-Cxbx87gg.js";import"./use-main-schema-v8-CZLsOlEV.js";import"./index-CJu3ft8V.js";import"./alert-B29bfkXd.js";import"./section-preview-url-7zfngvgW.js";import"./differenceInSeconds-C3x8sHUj.js";import"./project-icon-njec1yh1.js";import"./new-project-dialog-DpHJ0D5s.js";import"./repository-import-picker-lphgZTGu.js";import"./repository-picker-Dadd-3sc.js";import"./required-auth-layout-e3_y0Tns.js";import"./use-org-sso-LC63-uuA.js";import"./use-org-auth-client-CL0a2tPL.js";const Ol={escape:Yi};function Ll(n,e){for(const s of _l(n,e)){const o=typeof s.title=="string"?s.title:void 0;if(o?.includes("{{"))return o}}function $l(n,e){if(!e)return;const s=La(n);if(s)try{const o=Ll(s.resolveType,e);return o&&Ka.render(o,s.data,{},Ol).trim()||void 0}catch{return}}function zl(n){const e=it.c(13),{icon:s,label:o,className:a}=n;let u;e[0]!==a?(u=ae("size-3.5",a),e[0]=a,e[1]=u):u=e[1];let h;e[2]!==s||e[3]!==u?(h=i.jsx(s,{className:u}),e[2]=s,e[3]=u,e[4]=h):h=e[4];let d;e[5]!==o||e[6]!==h?(d=i.jsx(Et,{asChild:!0,children:i.jsx("span",{role:"img","aria-label":o,className:"shrink-0 cursor-help",children:h})}),e[5]=o,e[6]=h,e[7]=d):d=e[7];let v;e[8]!==o?(v=i.jsx(Rt,{className:"max-w-56",children:o}),e[8]=o,e[9]=v):v=e[9];let m;return e[10]!==d||e[11]!==v?(m=i.jsxs(kt,{children:[d,v]}),e[10]=d,e[11]=v,e[12]=m):m=e[12],m}const Hl="text-global-section-fg focus:bg-global-section/12 focus:text-global-section-fg dark:text-global-section-fg-dark dark:focus:bg-global-section/15 dark:focus:text-global-section-fg-dark [&_svg]:!text-global-section";function io(n){return Array.from({length:n},(e,s)=>({id:crypto.randomUUID(),index:s}))}function _o(n){return n.map((e,s)=>({...e,index:s}))}function Wl(n,e){if(e===n.length)return n;if(e<n.length)return _o(n.slice(0,e));const s=Array.from({length:e-n.length},(o,a)=>({id:crypto.randomUUID(),index:n.length+a}));return[...n,...s]}function ko(n){const e=it.c(44),{section:s,raw:o,meta:a,decofile:u}=n,h=Ft(),d=Wn(),v=s.isSavedBlock===!0,m=s.isMultivariate===!0;let j;e[0]!==a||e[1]!==o?(j=o&&a?kl(o,a):void 0,e[0]=a,e[1]=o,e[2]=j):j=e[2];const A=j;let $;e[3]!==a||e[4]!==m||e[5]!==o||e[6]!==v?($=o&&a&&!v&&!m?$l(o,a):void 0,e[3]=a,e[4]=m,e[5]=o,e[6]=v,e[7]=$):$=e[7];const z=$;let H;e[8]!==u||e[9]!==a||e[10]!==o||e[11]!==s?(H=ta(o,s,u,a),e[8]=u,e[9]=a,e[10]=o,e[11]=s,e[12]=H):H=e[12];const F=H;let f;e[13]!==m||e[14]!==o?.__resolveType?(f=!m&&Rs(o?.__resolveType??""),e[13]=m,e[14]=o?.__resolveType,e[15]=f):f=e[15];const k=f,X=v?zn:m?So:wo;let w;e[16]!==m||e[17]!==v?(w=v?{color:$a}:m?{color:"oklch(0.65 0.15 160)"}:void 0,e[16]=m,e[17]=v,e[18]=w):w=e[18];const I=w;let V;e[19]!==X||e[20]!==d?(V=d?i.jsxs("span",{className:"relative size-4 shrink-0",children:[i.jsx(X,{className:"absolute inset-0 size-4 text-muted-foreground transition-opacity group-hover:opacity-0 group-has-[:focus-visible]:opacity-0"}),i.jsx(sa,{"aria-hidden":!0,className:"absolute inset-0 size-4 opacity-0 transition-opacity group-hover:opacity-100 group-has-[:focus-visible]:opacity-100"})]}):i.jsx(Ra,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[19]=X,e[20]=d,e[21]=V):V=e[21];let y;e[22]!==A?(y=A&&i.jsx("img",{src:A,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded-[var(--studio-control-radius,var(--radius))] object-cover"}),e[22]=A,e[23]=y):y=e[23];let C;e[24]!==d||e[25]!==I?(C=!d&&i.jsx(Ss,{className:"h-4 w-4 shrink-0",style:I}),e[24]=d,e[25]=I,e[26]=C):C=e[26];const x=d?"shrink":"flex-1",Y=s.isHidden&&"line-through opacity-50";let D;e[27]!==Y||e[28]!==x?(D=ae("min-w-0 truncate text-sm font-medium",x,Y),e[27]=Y,e[28]=x,e[29]=D):D=e[29];const ge=z??s.label;let me;e[30]!==D||e[31]!==ge?(me=i.jsx("span",{className:D,children:ge}),e[30]=D,e[31]=ge,e[32]=me):me=e[32];let le;e[33]!==k||e[34]!==d||e[35]!==F||e[36]!==h?(le=d?i.jsxs(i.Fragment,{children:[k&&i.jsx(zl,{icon:bs,label:h("sectionsEditor.sectionList.asyncBadge"),className:"text-muted-foreground"}),F&&i.jsx(Br,{}),i.jsx("span",{className:"min-w-0 flex-1"})]}):F&&i.jsx(Br,{className:"absolute -right-0.5 -top-0.5"}),e[33]=k,e[34]=d,e[35]=F,e[36]=h,e[37]=le):le=e[37];let ee;return e[38]!==me||e[39]!==le||e[40]!==V||e[41]!==y||e[42]!==C?(ee=i.jsxs(i.Fragment,{children:[V,y,C,me,le]}),e[38]=me,e[39]=le,e[40]=V,e[41]=y,e[42]=C,e[43]=ee):ee=e[43],ee}const ql="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",Gl="text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]";function Eo(n,e,s){if(s)return na({selected:e});const o=n.isSavedBlock===!0,a=n.isMultivariate===!0;return ae("group relative flex select-none items-center gap-2 rounded-[var(--studio-control-radius,var(--radius-md))] px-2 py-2.5",e?"bg-accent text-accent-foreground":o?ql:a?Gl:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function ps(n,e){return ae("h-7 shrink-0 overflow-hidden",e?"w-7 ml-0 opacity-100 [transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]":n?"w-7 ml-0 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:opacity-100 group-has-[:focus-visible]:opacity-100":"w-0 -ml-2 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:ml-0 group-hover:w-7 group-hover:opacity-100 group-hover:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms] group-has-[:focus-visible]:ml-0 group-has-[:focus-visible]:w-7 group-has-[:focus-visible]:opacity-100 group-has-[:focus-visible]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]")}function Ul(n){const e=it.c(90),{section:s,raw:o,meta:a,decofile:u,sortableId:h,selected:d,onSelect:v,onDelete:m,onDuplicate:j,onMakeReusable:A,onToggleHidden:$,onToggleLazy:z,onAddVariant:H,onDetach:F}=n,f=Ft(),k=Wn(),X=o?Rs(o.__resolveType??""):!1,w=s.isHidden===!0,I=X||w;let V;e[0]!==s?(V=bo(s),e[0]=s,e[1]=V):V=e[1];const y=V,C=!!z&&!s.isMultivariate;let x;e[2]!==h?(x={id:h,animateLayoutChanges:Ql},e[2]=h,e[3]=x):x=e[3];const{attributes:Y,listeners:D,setNodeRef:ge,transform:me,isDragging:le}=Sl(x);let ee;e[4]!==me?(ee=vl.Transform.toString(me?{...me,x:0}:null),e[4]=me,e[5]=ee):ee=e[5];const pe=le?0:void 0;let ce;e[6]!==ee||e[7]!==pe?(ce={transform:ee,opacity:pe},e[6]=ee,e[7]=pe,e[8]=ce):ce=e[8];const he=ce;let ve;e[9]!==s?(ve=Qi(s),e[9]=s,e[10]=ve):ve=e[10];const b=ve,B="button",xe=0;let T;e[11]!==v?(T=re=>{(re.key==="Enter"||re.key===" ")&&(re.preventDefault(),v())},e[11]=v,e[12]=T):T=e[12];const ye=le?"cursor-grabbing":"cursor-pointer";let K;e[13]!==k||e[14]!==s||e[15]!==d||e[16]!==ye?(K=ae("touch-none transition-colors",ye,Eo(s,d,k)),e[13]=k,e[14]=s,e[15]=d,e[16]=ye,e[17]=K):K=e[17];let Se;e[18]!==u||e[19]!==a||e[20]!==o||e[21]!==s?(Se=i.jsx(ko,{section:s,raw:o,meta:a,decofile:u}),e[18]=u,e[19]=a,e[20]=o,e[21]=s,e[22]=Se):Se=e[22];const ue=!k&&C&&i.jsxs(kt,{children:[i.jsx(Et,{asChild:!0,children:i.jsx(_t,{type:"button",variant:"ghost",size:"icon","aria-label":f(X?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:ae(ps(I,X)),onClick:re=>{re.stopPropagation(),z?.()},onPointerDown:Jl,children:i.jsx(bs,{className:ae("h-3.5 w-3.5",X&&"text-warning")})})}),i.jsx(Rt,{side:"bottom",children:f(X?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),te=k?i.jsx(Xi,{label:f(w?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),active:w,onToggle:$,children:w?i.jsx(Zr,{className:"h-3.5 w-3.5"}):i.jsx(eo,{className:"h-3.5 w-3.5"})}):i.jsxs(kt,{children:[i.jsx(Et,{asChild:!0,children:i.jsx(_t,{type:"button",variant:"ghost",size:"icon","aria-label":f(w?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),className:ae(ps(I,w)),onClick:re=>{re.stopPropagation(),$()},onPointerDown:Yl,children:w?i.jsx(Zr,{className:"h-3.5 w-3.5"}):i.jsx(eo,{className:"h-3.5 w-3.5"})})}),i.jsx(Rt,{side:"bottom",children:f(w?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection")})]}),se=$i,Te=Zi;let Z;e[23]!==f?(Z=f("sectionsEditor.sectionList.sectionActionsMenu"),e[23]=f,e[24]=Z):Z=e[24];const _e=ae(ps(I,!1),"data-[state=open]:ml-0 data-[state=open]:w-7 data-[state=open]:opacity-100 data-[state=open]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]");let be;e[25]!==Te||e[26]!==Z||e[27]!==_e?(be=i.jsx(Te,{label:Z,classicClassName:_e}),e[25]=Te,e[26]=Z,e[27]=_e,e[28]=be):be=e[28];let q;e[29]!==k||e[30]!==C||e[31]!==X||e[32]!==z||e[33]!==f?(q=k&&C&&i.jsxs(i.Fragment,{children:[i.jsxs(sn,{onClick:re=>{re.stopPropagation(),z?.()},children:[i.jsx(bs,{className:"h-4 w-4"}),f(X?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")]}),i.jsx(Li,{})]}),e[29]=k,e[30]=C,e[31]=X,e[32]=z,e[33]=f,e[34]=q):q=e[34];let O;e[35]!==j?(O=re=>{re.stopPropagation(),j()},e[35]=j,e[36]=O):O=e[36];let Ke;e[37]===Symbol.for("react.memo_cache_sentinel")?(Ke=i.jsx(ul,{className:"h-4 w-4"}),e[37]=Ke):Ke=e[37];let Qe;e[38]!==f?(Qe=f("sectionsEditor.sectionList.duplicateMenuItem"),e[38]=f,e[39]=Qe):Qe=e[39];let Xe;e[40]!==O||e[41]!==Qe?(Xe=i.jsxs(sn,{onClick:O,children:[Ke,Qe]}),e[40]=O,e[41]=Qe,e[42]=Xe):Xe=e[42];let Ye;e[43]!==k||e[44]!==y||e[45]!==H||e[46]!==f?(Ye=y&&i.jsxs(sn,{className:ae(!k&&ea),onClick:re=>{re.stopPropagation(),H()},children:[i.jsx(So,{className:"h-4 w-4"}),f("sectionsEditor.sectionList.addVariantMenuItem")]}),e[43]=k,e[44]=y,e[45]=H,e[46]=f,e[47]=Ye):Ye=e[47];let Q;e[48]!==k||e[49]!==b||e[50]!==A||e[51]!==f?(Q=b&&i.jsxs(sn,{className:ae(!k&&Hl),onClick:re=>{re.stopPropagation(),A()},children:[k?i.jsx(zn,{className:"h-4 w-4"}):i.jsx(Ss,{className:"h-4 w-4"}),f("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[48]=k,e[49]=b,e[50]=A,e[51]=f,e[52]=Q):Q=e[52];let ke;e[53]!==k||e[54]!==F||e[55]!==s.isMultivariate||e[56]!==s.isSavedBlock||e[57]!==f?(ke=s.isSavedBlock===!0&&!s.isMultivariate&&i.jsxs(sn,{onClick:re=>{re.stopPropagation(),F()},children:[k?i.jsx(wo,{className:"h-4 w-4"}):i.jsx(Ss,{className:"h-4 w-4"}),f("sectionsEditor.sectionList.detachMenuItem")]}),e[53]=k,e[54]=F,e[55]=s.isMultivariate,e[56]=s.isSavedBlock,e[57]=f,e[58]=ke):ke=e[58];let He;e[59]!==m?(He=re=>{re.stopPropagation(),m()},e[59]=m,e[60]=He):He=e[60];let We;e[61]===Symbol.for("react.memo_cache_sentinel")?(We=i.jsx(fl,{className:"h-4 w-4"}),e[61]=We):We=e[61];let Ee;e[62]!==f?(Ee=f("sectionsEditor.sectionList.deleteMenuItem"),e[62]=f,e[63]=Ee):Ee=e[63];let Ie;e[64]!==He||e[65]!==Ee?(Ie=i.jsxs(sn,{variant:"destructive",onClick:He,children:[We,Ee]}),e[64]=He,e[65]=Ee,e[66]=Ie):Ie=e[66];let Ve;e[67]!==q||e[68]!==Xe||e[69]!==Ye||e[70]!==Q||e[71]!==ke||e[72]!==Ie?(Ve=i.jsxs(zi,{align:"end",className:"w-44",children:[q,Xe,Ye,Q,ke,Ie]}),e[67]=q,e[68]=Xe,e[69]=Ye,e[70]=Q,e[71]=ke,e[72]=Ie,e[73]=Ve):Ve=e[73];let Ze;e[74]!==se||e[75]!==be||e[76]!==Ve?(Ze=i.jsxs(se,{children:[be,Ve]}),e[74]=se,e[75]=be,e[76]=Ve,e[77]=Ze):Ze=e[77];let Fe;return e[78]!==Y||e[79]!==D||e[80]!==v||e[81]!==ge||e[82]!==he||e[83]!==K||e[84]!==Se||e[85]!==ue||e[86]!==te||e[87]!==Ze||e[88]!==T?(Fe=i.jsxs("div",{ref:ge,style:he,...Y,...D,role:B,tabIndex:xe,onClick:v,onKeyDown:T,className:K,children:[Se,ue,te,Ze]}),e[78]=Y,e[79]=D,e[80]=v,e[81]=ge,e[82]=he,e[83]=K,e[84]=Se,e[85]=ue,e[86]=te,e[87]=Ze,e[88]=T,e[89]=Fe):Fe=e[89],Fe}function Yl(n){return n.stopPropagation()}function Jl(n){return n.stopPropagation()}function Ql(){return!1}function js(n){const e=it.c(11),{canAddSection:s,onAddSection:o,className:a,size:u}=n,h=Ft();let d;e[0]!==a?(d=ae("w-full",a),e[0]=a,e[1]=d):d=e[1];const v=!s;let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(dl,{size:14}),e[2]=m):m=e[2];let j;e[3]!==h?(j=h("sectionsEditor.sectionList.addSectionButton"),e[3]=h,e[4]=j):j=e[4];let A;return e[5]!==o||e[6]!==u||e[7]!==d||e[8]!==v||e[9]!==j?(A=i.jsxs(_t,{type:"button",variant:"outline",size:u,className:d,disabled:v,onClick:o,children:[m,j]}),e[5]=o,e[6]=u,e[7]=d,e[8]=v,e[9]=j,e[10]=A):A=e[10],A}function Xl(n){const e=it.c(101),{listKey:s,rawSections:o,sections:a,meta:u,decofile:h,selectedIndex:d,onSelect:v,onReorder:m,onDelete:j,onDuplicate:A,onMakeReusable:$,onToggleHidden:z,onToggleLazy:H,onAddVariant:F,onDetach:f,onAddSection:k,canAddSection:X}=n,w=X===void 0?!0:X,I=Ft(),V=Wn();let y;e[0]!==a.length?(y=()=>io(a.length),e[0]=a.length,e[1]=y):y=e[1];const[C,x]=R.useState(y),[Y,D]=R.useState(null),[ge,me]=R.useState(s),[le,ee]=R.useState(a.length),pe=R.useRef(!1);ge!==s?(me(s),ee(a.length),x(io(a.length))):le!==a.length&&(ee(a.length),x(dt=>Wl(dt,a.length)));let ce;e[2]===Symbol.for("react.memo_cache_sentinel")?(ce={activationConstraint:{distance:8}},e[2]=ce):ce=e[2];let he;e[3]===Symbol.for("react.memo_cache_sentinel")?(he={coordinateGetter:bl},e[3]=he):he=e[3];const ve=ml(to(hl,ce),to(pl,he));let b;e[4]!==C?(b=C.map(Zl),e[4]=C,e[5]=b):b=e[5];const B=b;let xe;e[6]===Symbol.for("react.memo_cache_sentinel")?(xe=dt=>{D(String(dt.active.id))},e[6]=xe):xe=e[6];const T=xe;let ye;e[7]!==B||e[8]!==m?(ye=dt=>{D(null);const{active:ne,over:Me}=dt;if(!Me||ne.id===Me.id)return;const yt=B.indexOf(String(ne.id)),et=B.indexOf(String(Me.id));yt===-1||et===-1||(x(ft=>_o(Ln([...ft],yt,et))),pe.current=!0,requestAnimationFrame(()=>{pe.current=!1}),m?.(yt,et))},e[7]=B,e[8]=m,e[9]=ye):ye=e[9];const K=ye;let Se;e[10]===Symbol.for("react.memo_cache_sentinel")?(Se=()=>{D(null)},e[10]=Se):Se=e[10];const ue=Se;let te,se,Te,Z,_e,be,q,O,Ke,Qe,Xe,Ye,Q,ke,He;if(e[11]!==Y||e[12]!==w||e[13]!==V||e[14]!==h||e[15]!==C||e[16]!==B||e[17]!==K||e[18]!==u||e[19]!==k||e[20]!==F||e[21]!==j||e[22]!==f||e[23]!==A||e[24]!==$||e[25]!==v||e[26]!==z||e[27]!==H||e[28]!==o||e[29]!==a||e[30]!==d||e[31]!==ve||e[32]!==I){ke=Symbol.for("react.early_return_sentinel");e:{const dt=ne=>{pe.current||v(ne)};if(e[48]!==Y||e[49]!==w||e[50]!==V||e[51]!==C||e[52]!==k||e[53]!==o||e[54]!==a||e[55]!==I){const ne=Y?C.find(Me=>Me.id===Y):null;if(Z=ne!=null?a[ne.index]:null,Te=ne!=null?o[ne.index]:void 0,C.length===0){let Me;e[59]!==I?(Me=I("sectionsEditor.sectionList.noSections"),e[59]=I,e[60]=Me):Me=e[60];let yt;e[61]!==Me?(yt=i.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:Me}),e[61]=Me,e[62]=yt):yt=e[62];const et=yt;let ft;e[63]!==w||e[64]!==V||e[65]!==et||e[66]!==k?(ft=V?et:i.jsxs("div",{className:"space-y-2",children:[et,i.jsx(js,{canAddSection:w,onAddSection:k,size:"sm"})]}),e[63]=w,e[64]=V,e[65]=et,e[66]=k,e[67]=ft):ft=e[67],ke=ft;break e}Q=ae(ne&&"cursor-grabbing"),e[48]=Y,e[49]=w,e[50]=V,e[51]=C,e[52]=k,e[53]=o,e[54]=a,e[55]=I,e[56]=Te,e[57]=Z,e[58]=Q}else Te=e[56],Z=e[57],Q=e[58];se=xl,O=ve,Ke=yl,Qe=T,Xe=K,Ye=ue,te=jl,be=B,q=wl,He="space-y-1",_e=C.map(ne=>{const Me=a[ne.index];return Me?i.jsx(Ul,{sortableId:ne.id,section:Me,raw:o[ne.index],meta:u,decofile:h,selected:d===ne.index,onSelect:()=>dt(ne.index),onDelete:()=>j(ne.index),onDuplicate:()=>A(ne.index),onMakeReusable:()=>$(ne.index),onToggleHidden:()=>z(ne.index),onToggleLazy:H?()=>H(ne.index):void 0,onAddVariant:()=>F(ne.index),onDetach:()=>f(ne.index)},ne.id):null})}e[11]=Y,e[12]=w,e[13]=V,e[14]=h,e[15]=C,e[16]=B,e[17]=K,e[18]=u,e[19]=k,e[20]=F,e[21]=j,e[22]=f,e[23]=A,e[24]=$,e[25]=v,e[26]=z,e[27]=H,e[28]=o,e[29]=a,e[30]=d,e[31]=ve,e[32]=I,e[33]=te,e[34]=se,e[35]=Te,e[36]=Z,e[37]=_e,e[38]=be,e[39]=q,e[40]=O,e[41]=Ke,e[42]=Qe,e[43]=Xe,e[44]=Ye,e[45]=Q,e[46]=ke,e[47]=He}else te=e[33],se=e[34],Te=e[35],Z=e[36],_e=e[37],be=e[38],q=e[39],O=e[40],Ke=e[41],Qe=e[42],Xe=e[43],Ye=e[44],Q=e[45],ke=e[46],He=e[47];if(ke!==Symbol.for("react.early_return_sentinel"))return ke;let We;e[68]!==_e||e[69]!==He?(We=i.jsx("div",{className:He,children:_e}),e[68]=_e,e[69]=He,e[70]=We):We=e[70];let Ee;e[71]!==te||e[72]!==be||e[73]!==q||e[74]!==We?(Ee=i.jsx(te,{items:be,strategy:q,children:We}),e[71]=te,e[72]=be,e[73]=q,e[74]=We,e[75]=Ee):Ee=e[75];let Ie;e[76]!==Te||e[77]!==Z||e[78]!==V||e[79]!==h||e[80]!==u?(Ie=Z?i.jsx("div",{className:ae("cursor-grabbing shadow-lift",Eo(Z,!1,V)),children:i.jsx(ko,{section:Z,raw:Te,meta:u,decofile:h})}):null,e[76]=Te,e[77]=Z,e[78]=V,e[79]=h,e[80]=u,e[81]=Ie):Ie=e[81];let Ve;e[82]!==Ie?(Ve=Oi.createPortal(i.jsx(gl,{dropAnimation:Ji,children:Ie}),document.body),e[82]=Ie,e[83]=Ve):Ve=e[83];let Ze;e[84]!==se||e[85]!==O||e[86]!==Ke||e[87]!==Qe||e[88]!==Xe||e[89]!==Ye||e[90]!==Ee||e[91]!==Ve?(Ze=i.jsxs(se,{sensors:O,collisionDetection:Ke,onDragStart:Qe,onDragEnd:Xe,onDragCancel:Ye,children:[Ee,Ve]}),e[84]=se,e[85]=O,e[86]=Ke,e[87]=Qe,e[88]=Xe,e[89]=Ye,e[90]=Ee,e[91]=Ve,e[92]=Ze):Ze=e[92];let Fe;e[93]!==w||e[94]!==V||e[95]!==k?(Fe=!V&&i.jsx(js,{canAddSection:w,onAddSection:k,size:"sm",className:"mt-2"}),e[93]=w,e[94]=V,e[95]=k,e[96]=Fe):Fe=e[96];let re;return e[97]!==Q||e[98]!==Ze||e[99]!==Fe?(re=i.jsxs("div",{className:Q,children:[Ze,Fe]}),e[97]=Q,e[98]=Ze,e[99]=Fe,e[100]=re):re=e[100],re}function Zl(n){return n.id}function hs(n,e,s,o){if(!n||!e)return null;if(!e.isMultivariate)return jt(n,e,o)?.data??null;const a=xt(n,e),u=a?vs(a,wt)[s]:void 0;return u?jo(u.value,o)?.data??null:null}const ec=50;function tc(n,e){n.own.push(ze(e)),n.own.length>ec&&n.own.shift()}function ao(n,e){return n.own.includes(ze(e))}function nc(n,e){const{sectionIndex:s,variantIndex:o,shown:a,next:u,sectionCount:h}=e;return n&&n.sectionIndex===s&&n.variantIndex===o&&n.emitted===a?(n.emitted=u,n):a?{sectionIndex:s,variantIndex:o,base:a,emitted:u,sectionCount:h,own:[ze(a)]}:null}function Ro(n,e){return e!==null&&ze(n)!==ze(e)}function Ao(n,e){return n.__resolveType!==e.__resolveType}function sc(n,e,s,o){if(e.length===o)return"here";const a=ze(n),u=e.flatMap((h,d)=>d!==s&&h!==null&&ze(h)===a?[d]:[]);return u.length===1?u[0]:"unknown"}function lo({formBase:n,rebased:e,versionOf:s}){let o=null;return{ifMatch:a=>{o=a,n&&(n.version===void 0||e)&&(n.version=s(a));const u=n?n.version:s(a);return u===void 0?void 0:{[a]:u}},onApplied:a=>{n&&o!==null&&Object.hasOwn(a,o)&&(n.version=a[o])},reloadOnConflict:!0}}function rc({merged:n,tracked:e,current:s,saved:o}){return!!n&&!!e&&s===e&&e.emitted===o}function co(n,e){return!!n&&!!e&&n.contains(e)}function ws(n){const e=[],s=_s("",n.ancestor,n.mine,n.theirs,e);return{...n,merged:s,pointers:e}}function _s(n,e,s,o,a){const u=(h,d)=>ze(h)===ze(d);if(u(s,o)||u(e,o))return s;if(u(e,s))return o;if(gs(s)&&gs(o)){const h=gs(e)?e:{},d={},v=[...Object.keys(s),...Object.keys(o).filter(m=>!(m in s))];for(const m of v){const j=_s(`${n}/${m.replaceAll("~","~0").replaceAll("/","~1")}`,h[m],s[m],o[m],a);j!==void 0&&(d[m]=j)}return d}return Array.isArray(e)&&Array.isArray(s)&&Array.isArray(o)&&s.length===e.length&&o.length===e.length?e.map((h,d)=>_s(`${n}/${d}`,h,s[d],o[d],a)):(a.push(n),o)}function gs(n){return!!n&&typeof n=="object"&&!Array.isArray(n)}function oc(n,e){let s=n.merged;for(const o of n.pointers)e[o]==="mine"&&(s=cc(s,o,Ut(n.mine,o)));return s}function ic(n,e){return Object.fromEntries(n.pointers.map(s=>[s,e]))}function Co(n){return ic(n,"mine")}function ks(n,e,s){const o=Co(s);for(const a of s.pointers){const u=e[a];if(!u||!n.pointers.includes(a))continue;["mine","theirs"].every(d=>ze(Ut(n[d],a))===ze(Ut(s[d],a)))&&(o[a]=u)}return o}function No(n,e,s={}){const o=e.pointers.filter(a=>!n.pointers.includes(a)||ze(Ut(n.theirs,a))!==ze(Ut(e.theirs,a)));return o.length===0?s:{...s,...Object.fromEntries(o.map(a=>[a,(s[a]??0)+1]))}}function ac(n,e,s){if(!e||Ao(n.plan.ancestor,e)||!Ro(n.plan.theirs,e)||s(e))return null;const o=ws({...n.plan,theirs:e});return o.pointers.length===0?null:{plan:o,choices:ks(n.plan,n.choices,o),fresh:No(n.plan,o,n.fresh)}}function lc(n,e){return n.pointers.map(s=>({pointer:s,label:ra(s,e),mine:Ut(n.mine,s),theirs:Ut(n.theirs,s),schema:uc(e??null,s)}))}function As(n){return n.split("/").slice(1).map(e=>e.replaceAll("~1","/").replaceAll("~0","~"))}function Ut(n,e){let s=n;for(const o of As(e))if(Array.isArray(s))s=s[Number(o)];else if(s&&typeof s=="object")s=s[o];else return;return s}function cc(n,e,s){const o=As(e),a=(u,h)=>{if(h===o.length)return s;const d=o[h];if(Array.isArray(u)){const j=[...u];return j[Number(d)]=a(u[Number(d)],h+1),j}const v=u&&typeof u=="object"?{...u}:{},m=a(v[d],h+1);return m===void 0?delete v[d]:v[d]=m,v};return a(n,0)}function uc(n,e){let s=n;for(const o of As(e)){if(!s)return null;s=/^\d+$/.test(o)&&!s.properties?.[o]?s.items:s.properties?.[o]}return s??null}const dc=/\.(png|jpe?g|gif|webp|avif|svg)(\?.*)?$/i,uo=60,fc=3;function To(n,e){return e?.format==="image-uri"?!0:n.startsWith("data:image/")||/^(https?:)?\/\//.test(n)&&dc.test(n)}function Es(n,e){if(!(e?.format==="rich-text"||e?.format==="rich-text-inline"||e?.format==="html"||/<\/?[a-z][^>]*>/i.test(n)))return n;const o=n.replace(/<br\s*\/?>/gi,`
2
- `).replace(/<\/(p|div|li|h[1-6])>/gi,`
3
- `);return pc(o).replace(/\u00a0/g," ").replace(/\n{2,}/g,`
4
- `).trim()}const mc={"&nbsp;":" ","&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"};function pc(n){if(typeof DOMParser<"u")return new DOMParser().parseFromString(n,"text/html").body.textContent??"";let e=n;for(let s="";s!==e;)s=e,e=e.replace(/<[^<>]*>/g,"");return e.replace(/<|>/g,"").replace(/&(nbsp|amp|lt|gt|quot|#39);/g,s=>mc[s]??s)}function $n(n){const e=n.replace(/\s+/g," ").trim();return e.length>uo?`${e.slice(0,uo-1)}…`:e}function hc(n){if(n.startsWith("data:"))return"image";const e=n.split(/[?#]/)[0]??n;return decodeURIComponent(e.split("/").pop()||n)}function Hn(n,e){if(n==null||n==="")return{kind:"empty"};if(typeof n=="string")return To(n,e)?{kind:"image",src:n}:{kind:"text",text:Es(n,e)};if(typeof n=="number"||typeof n=="bigint")return{kind:"text",text:String(n)};if(typeof n=="boolean")return{kind:"yesNo",value:n};if(Array.isArray(n)){const s=e?.items??null;return{kind:"list",count:n.length,items:n.slice(0,fc).map(o=>gc(o,s)??"")}}if(typeof n=="object"){const s=n;if("value"in s&&Object.keys(s).length<=2)return Hn(s.value,e?.properties?.value??e);const o=Object.entries(s).filter(([a,u])=>!a.startsWith("__")&&u!==void 0).flatMap(([a,u])=>{const h=e?.properties?.[a]??null,d=Hn(u,h);if(d.kind==="empty")return[];const v=d.kind==="text"?$n(d.text):d.kind==="image"?hc(d.src):d.kind==="yesNo"?d.value?"✓":"✗":d.kind==="list"?`${d.count}`:"…";return[{label:h?.title?.trim()||a,text:v}]}).slice(0,4);return o.length>0?{kind:"fields",entries:o}:{kind:"empty"}}return{kind:"text",text:String(n)}}function gc(n,e){if(typeof n=="string")return $n(Es(n,e));if(!n||typeof n!="object"||Array.isArray(n))return null;const s=n,o=e?.titleBy,a=o?s[o]:void 0;if(typeof a=="string"&&a.trim())return $n(a);for(const[u,h]of Object.entries(s))if(!(u.startsWith("__")||typeof h!="string"||!h.trim())&&!To(h,e?.properties?.[u]??null))return $n(Es(h,null));return null}const fo=1500;function vc(n,e){const s=n.split(/(\s+)/).filter(j=>j!==""),o=e.split(/(\s+)/).filter(j=>j!=="");if(s.length>fo||o.length>fo)return{mine:[{text:n,kind:"changed"}],theirs:[{text:e,kind:"changed"}]};const a=Array.from({length:s.length+1},()=>new Array(o.length+1).fill(0));for(let j=s.length-1;j>=0;j--)for(let A=o.length-1;A>=0;A--){const $=a[j];$[A]=s[j]===o[A]?a[j+1][A+1]+1:Math.max(a[j+1][A],$[A+1])}const u=[],h=[],d=(j,A,$)=>{const z=j.at(-1);z&&(z.kind===$||$==="same"&&!A.trim())?z.text+=A:j.push({text:A,kind:$})};let v=0,m=0;for(;v<s.length&&m<o.length;)s[v]===o[m]?(d(u,s[v],"same"),d(h,o[m],"same"),v++,m++):a[v+1][m]>=a[v][m+1]?(d(u,s[v],"changed"),v++):(d(h,o[m],"changed"),m++);for(;v<s.length;v++)d(u,s[v],"changed");for(;m<o.length;m++)d(h,o[m],"changed");return{mine:u,theirs:h}}function xc(n){const e=it.c(10);let s,o;e[0]!==n?({open:s,...o}=n,e[0]=n,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{data:a}=vo.useSession();let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=ae("max-h-[85vh] grid-rows-[auto_minmax(0,1fr)_auto] sm:max-w-lg"),e[3]=u):u=e[3];const h=a?.user??null;let d;e[4]!==o||e[5]!==h?(d=i.jsx(Al,{className:u,"data-testid":"form-conflict-dialog",onEscapeKeyDown:Sc,children:i.jsx(Ec,{...o,viewer:h,heading:yc})}),e[4]=o,e[5]=h,e[6]=d):d=e[6];let v;return e[7]!==s||e[8]!==d?(v=i.jsx(Vl,{open:s,children:d}),e[7]=s,e[8]=d,e[9]=v):v=e[9],v}function yc(n,e){return i.jsxs(Cl,{className:"text-left",children:[i.jsx(Nl,{children:n}),i.jsx(Tl,{children:e})]})}function Sc(n){return n.preventDefault()}const bc={},jc=(n,e)=>i.jsxs("div",{className:"flex flex-col gap-2",children:[i.jsx("h2",{className:"text-lg font-semibold",children:n}),i.jsx("p",{className:"text-sm text-muted-foreground",children:e})]});function wc(n,e,s=0,o={},a=null){const u=e[Math.min(s,e.length-1)],h=a?.you?void 0:a?.name?.split(/\s+/)[0],d={field:u?kc(u.label):"",label:u?.label??"",name:h??""},v=(m,j,A)=>n(a?.you?A:h?j:m,d);return e.length<=1?{title:v("sectionsEditor.formConflict.titleOne","sectionsEditor.formConflict.titleOneNamed","sectionsEditor.formConflict.titleOneYou"),description:n("sectionsEditor.formConflict.descriptionOne")}:{title:v("sectionsEditor.formConflict.titleStep","sectionsEditor.formConflict.titleStepNamed","sectionsEditor.formConflict.titleStepYou"),description:s>=e.length-1?i.jsx(_c,{t:n,fields:e,choices:o,name:h}):n("sectionsEditor.formConflict.descriptionStep")}}function _c(n){const e=it.c(11),{t:s,fields:o,choices:a,name:u}=n;let h;if(e[0]!==a||e[1]!==o||e[2]!==u||e[3]!==s){let v;e[5]!==a||e[6]!==u||e[7]!==s?(v=(m,j)=>i.jsxs(R.Fragment,{children:[j>0&&" · ",`${m.label}: `,i.jsx("span",{className:"font-medium text-foreground",children:s((a[m.pointer]??"mine")==="mine"?"sectionsEditor.formConflict.summaryYours":u?"sectionsEditor.formConflict.summaryTheirsNamed":"sectionsEditor.formConflict.summaryTheirs",{name:u??""})})]},m.pointer),e[5]=a,e[6]=u,e[7]=s,e[8]=v):v=e[8],h=o.map(v),e[0]=a,e[1]=o,e[2]=u,e[3]=s,e[4]=h}else h=e[4];let d;return e[9]!==h?(d=i.jsx("span",{"data-testid":"form-conflict-summary",children:h}),e[9]=h,e[10]=d):d=e[10],d}function kc(n){return/^[A-Z][a-z]/.test(n)&&!n.includes("›")?n.charAt(0).toLowerCase()+n.slice(1):n}function Ec(n){const e=it.c(68),s=Ft(),{fields:o,choices:a,changedAgain:u,fresh:h,heading:d}=n,v=u===void 0?!1:u,m=h===void 0?bc:h,j=d===void 0?jc:d,A=o.length>1,[$,z]=R.useState(0),[H,F]=R.useState(Rc);let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f={},e[0]=f):f=e[0];const[k,X]=R.useState(f),w=Math.max(0,Math.min($,o.length-1)),I=o[w],V=w===o.length-1;let y;e[1]!==w||e[2]!==o||e[3]!==m?(y=Se=>{const ue=o[w],te=o[Se];!ue||!te||Se===w||(F(se=>new Set(se).add(ue.pointer)),X(se=>({...se,[ue.pointer]:m[ue.pointer]??0,[te.pointer]:m[te.pointer]??0})),z(Se))},e[1]=w,e[2]=o,e[3]=m,e[4]=y):y=e[4];const C=y;let x;e[5]!==w||e[6]!==C?(x=Se=>{if(!Se)return;const ue=te=>{const se={ArrowLeft:-1,ArrowRight:1}[te.key];!se||te.defaultPrevented||te.altKey||te.ctrlKey||te.metaKey||te.shiftKey||Dl(te.target)||(te.preventDefault(),C(w+se))};return Se.ownerDocument.addEventListener("keydown",ue),()=>Se.ownerDocument.removeEventListener("keydown",ue)},e[5]=w,e[6]=C,e[7]=x):x=e[7];const Y=x;if(!I)return null;let D,ge,me,le,ee;if(e[8]!==H||e[9]!==w||e[10]!==a||e[11]!==o||e[12]!==m||e[13]!==C||e[14]!==j||e[15]!==Y||e[16]!==A||e[17]!==n||e[18]!==k||e[19]!==s){const{title:Se,description:ue}=wc(s,o,w,a,n.author??null);let te;e[25]!==n?(te=se=>{se.detail>1||n.onApply()},e[25]=n,e[26]=te):te=e[26],D=te,ge=A?Y:void 0,me="flex min-w-0 flex-col gap-3",e[27]!==H||e[28]!==w||e[29]!==o||e[30]!==m||e[31]!==C||e[32]!==A||e[33]!==k||e[34]!==s?(le=A&&i.jsxs("div",{className:"flex items-center justify-between gap-3",children:[i.jsx("div",{role:"group","aria-label":s("sectionsEditor.formConflict.steps"),className:"-m-1 flex flex-wrap items-center",children:o.map((se,Te)=>{const Z=Te!==w&&(m[se.pointer]??0)>(k[se.pointer]??0);return i.jsx("button",{type:"button","aria-label":Z?s("sectionsEditor.formConflict.stepChangedAgain",{label:se.label}):se.label,"aria-current":Te===w?"step":void 0,"data-answered":Te!==w&&H.has(se.pointer)?"":void 0,"data-changed-again":Z?"":void 0,onClick:()=>C(Te),className:"group cursor-pointer rounded-full p-1 focus-ring",children:i.jsx("span",{className:ae("block h-2 w-2 rounded-full bg-border transition-[width,background-color,box-shadow] motion-reduce:transition-none","group-hover:bg-muted-foreground/60","group-data-[answered]:bg-foreground/45","group-aria-[current=step]:w-5 group-aria-[current=step]:bg-foreground","group-data-[changed-again]:ring-2 group-data-[changed-again]:ring-warning group-data-[changed-again]:ring-offset-1 group-data-[changed-again]:ring-offset-background")})},se.pointer)})}),i.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:s("sectionsEditor.formConflict.stepCount",{step:String(w+1),count:String(o.length)})})]}),e[27]=H,e[28]=w,e[29]=o,e[30]=m,e[31]=C,e[32]=A,e[33]=k,e[34]=s,e[35]=le):le=e[35],ee=j(Se,ue),e[8]=H,e[9]=w,e[10]=a,e[11]=o,e[12]=m,e[13]=C,e[14]=j,e[15]=Y,e[16]=A,e[17]=n,e[18]=k,e[19]=s,e[20]=D,e[21]=ge,e[22]=me,e[23]=le,e[24]=ee}else D=e[20],ge=e[21],me=e[22],le=e[23],ee=e[24];let pe;e[36]!==ge||e[37]!==me||e[38]!==le||e[39]!==ee?(pe=i.jsxs("div",{ref:ge,className:me,children:[le,ee]}),e[36]=ge,e[37]=me,e[38]=le,e[39]=ee,e[40]=pe):pe=e[40];const ce=!v&&"sr-only";let he;e[41]!==ce?(he=ae("text-sm text-muted-foreground",ce),e[41]=ce,e[42]=he):he=e[42];let ve;e[43]!==v||e[44]!==A||e[45]!==s?(ve=v?s(A?"sectionsEditor.formConflict.changedAgainSteps":"sectionsEditor.formConflict.changedAgain"):"",e[43]=v,e[44]=A,e[45]=s,e[46]=ve):ve=e[46];let b;e[47]!==he||e[48]!==ve?(b=i.jsx("p",{role:"status",className:he,children:ve}),e[47]=he,e[48]=ve,e[49]=b):b=e[49];const B=A?"vertical":"all";let xe;e[50]!==I||e[51]!==n||e[52]!==B?(xe=i.jsx(Tc,{field:I,...n,arrows:B}),e[50]=I,e[51]=n,e[52]=B,e[53]=xe):xe=e[53];let T;e[54]!==b||e[55]!==xe?(T=i.jsxs("div",{className:"-mx-2 flex min-h-0 flex-col gap-3 overflow-y-auto px-2 py-1",children:[b,xe]}),e[54]=b,e[55]=xe,e[56]=T):T=e[56];let ye;e[57]!==D||e[58]!==w||e[59]!==C||e[60]!==V||e[61]!==A||e[62]!==s?(ye=A?i.jsxs(no,{className:"flex-row flex-wrap items-center justify-between gap-2 sm:justify-between",children:[i.jsx(_t,{type:"button",variant:"outline","aria-disabled":w===0,onClick:()=>C(w-1),className:"aria-disabled:cursor-default aria-disabled:opacity-45",children:s("sectionsEditor.formConflict.back")}),i.jsx(_t,{type:"button","data-testid":"form-conflict-primary",onClick:V?D:()=>C(w+1),children:s(V?"sectionsEditor.formConflict.ok":"sectionsEditor.formConflict.next")})]}):i.jsx(no,{className:"items-center gap-2",children:i.jsx(_t,{type:"button","data-testid":"form-conflict-primary",onClick:D,children:s("sectionsEditor.formConflict.ok")})}),e[57]=D,e[58]=w,e[59]=C,e[60]=V,e[61]=A,e[62]=s,e[63]=ye):ye=e[63];let K;return e[64]!==pe||e[65]!==T||e[66]!==ye?(K=i.jsxs(i.Fragment,{children:[pe,T,ye]}),e[64]=pe,e[65]=T,e[66]=ye,e[67]=K):K=e[67],K}function Rc(){return new Set}function Ac(n){const e=Hn(n.mine,n.schema),s=Hn(n.theirs,n.schema),o=e.kind==="text"&&s.kind==="text"?vc(e.text,s.text):null;return a=>o?i.jsx(Mc,{parts:o[a]}):i.jsx(Pc,{preview:a==="mine"?e:s})}const Cc={all:{ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1},vertical:{ArrowDown:1,ArrowUp:-1}};function Nc(n,e){const s=Cc[e][n.key];if(!s)return;const o=[...n.currentTarget.querySelectorAll('[role="radio"]')],a=o.indexOf(document.activeElement);if(a<0)return;n.preventDefault();const u=o[(a+s+o.length)%o.length];u?.focus(),u?.click()}function Tc(n){const e=it.c(65),{field:s,choices:o,viewer:a,author:u,onChoose:h,arrows:d}=n,v=u===void 0?null:u,m=Ft(),[j]=Hi(),{language:A}=j;let $,z,H,F,f,k,X,w,I,V,y,C,x,Y;if(e[0]!==d||e[1]!==v||e[2]!==o||e[3]!==s||e[4]!==A||e[5]!==h||e[6]!==m||e[7]!==a?.image||e[8]!==a?.name){const me=Ac(s),le=o[s.pointer]??"mine",ee=a?.image??void 0;let pe;e[23]!==m||e[24]!==a?.name?(pe=a?.name?.trim()||m("sectionsEditor.formConflict.you"),e[23]=m,e[24]=a?.name,e[25]=pe):pe=e[25];let ce;e[26]!==ee||e[27]!==pe?(ce=i.jsx(ms,{url:ee,fallback:pe,shape:"circle",size:"sm",className:"text-xs"}),e[26]=ee,e[27]=pe,e[28]=ce):ce=e[28];const he=ce;let ve;e[29]!==v||e[30]!==he?(ve=v?.you?he:v?.name?i.jsx(ms,{url:v.avatarUrl,fallback:v.name,shape:"circle",size:"sm",className:"text-xs"}):i.jsx(ms,{url:"icon://user",fallback:"",muted:!0,shape:"circle",size:"sm"}),e[29]=v,e[30]=he,e[31]=ve):ve=e[31];const b=ve,B=v?new Date(v.at):null;H="radiogroup",F=s.label,f="flex flex-col gap-2",e[32]!==d?(k=K=>Nc(K,d),e[32]=d,e[33]=k):k=e[33];let xe;e[34]!==s.pointer||e[35]!==h?(xe=()=>h(s.pointer,"mine"),e[34]=s.pointer,e[35]=h,e[36]=xe):xe=e[36];let T;e[37]!==m?(T=m("sectionsEditor.formConflict.you"),e[37]=m,e[38]=T):T=e[38];let ye;e[39]!==m?(ye=m("sectionsEditor.formConflict.yourVersionNotSaved"),e[39]=m,e[40]=ye):ye=e[40],X=i.jsx(mo,{side:"mine",checked:le==="mine",onChoose:xe,avatar:he,who:T,meta:ye,children:me("mine")}),$=mo,w="theirs",I=le==="theirs",e[41]!==s.pointer||e[42]!==h?(V=()=>h(s.pointer,"theirs"),e[41]=s.pointer,e[42]=h,e[43]=V):V=e[43],y=b,e[44]!==v?.name||e[45]!==v?.you||e[46]!==m?(C=v?.you?m("sectionsEditor.formConflict.youElsewhere"):v?.name||m("sectionsEditor.formConflict.someoneElse"),e[44]=v?.name,e[45]=v?.you,e[46]=m,e[47]=C):C=e[47],x=B?m("sectionsEditor.formConflict.savedAt",{when:Ml(B,A)}):m("sectionsEditor.formConflict.theirVersionSaved"),Y=B?Vc(B,A):void 0,z=me("theirs"),e[0]=d,e[1]=v,e[2]=o,e[3]=s,e[4]=A,e[5]=h,e[6]=m,e[7]=a?.image,e[8]=a?.name,e[9]=$,e[10]=z,e[11]=H,e[12]=F,e[13]=f,e[14]=k,e[15]=X,e[16]=w,e[17]=I,e[18]=V,e[19]=y,e[20]=C,e[21]=x,e[22]=Y}else $=e[9],z=e[10],H=e[11],F=e[12],f=e[13],k=e[14],X=e[15],w=e[16],I=e[17],V=e[18],y=e[19],C=e[20],x=e[21],Y=e[22];let D;e[48]!==$||e[49]!==z||e[50]!==w||e[51]!==I||e[52]!==V||e[53]!==y||e[54]!==C||e[55]!==x||e[56]!==Y?(D=i.jsx($,{side:w,checked:I,onChoose:V,avatar:y,who:C,meta:x,metaTitle:Y,children:z}),e[48]=$,e[49]=z,e[50]=w,e[51]=I,e[52]=V,e[53]=y,e[54]=C,e[55]=x,e[56]=Y,e[57]=D):D=e[57];let ge;return e[58]!==H||e[59]!==F||e[60]!==f||e[61]!==k||e[62]!==X||e[63]!==D?(ge=i.jsxs("div",{role:H,"aria-label":F,className:f,onKeyDown:k,children:[X,D]}),e[58]=H,e[59]=F,e[60]=f,e[61]=k,e[62]=X,e[63]=D,e[64]=ge):ge=e[64],ge}const Vc=(n,e)=>n.toLocaleString(e,{dateStyle:"medium",timeStyle:"short"});function mo(n){const e=it.c(28),{side:s,checked:o,onChoose:a,avatar:u,who:h,meta:d,metaTitle:v,children:m}=n,j=R.useId(),A=`${j}-who`,$=`${j}-meta ${j}-value`,z=o?0:-1,H=o?"border-primary bg-primary/5 ring-1 ring-primary":"hover:bg-accent";let F;e[0]!==H?(F=ae("grid w-full cursor-pointer grid-cols-[auto_minmax(0,1fr)] items-start gap-3 rounded-xl border bg-background p-3 text-left transition-[border-color,box-shadow,background-color] focus-ring",H),e[0]=H,e[1]=F):F=e[1];const f=`${j}-who`;let k;e[2]!==f||e[3]!==h?(k=i.jsx("span",{id:f,className:"text-sm font-medium text-foreground",children:h}),e[2]=f,e[3]=h,e[4]=k):k=e[4];const X=`${j}-meta`;let w;e[5]!==d||e[6]!==v||e[7]!==X?(w=i.jsx("span",{id:X,title:v,children:d}),e[5]=d,e[6]=v,e[7]=X,e[8]=w):w=e[8];let I;e[9]!==k||e[10]!==w?(I=i.jsxs("span",{className:"flex flex-wrap items-baseline gap-x-1.5 text-xs text-muted-foreground",children:[k,w]}),e[9]=k,e[10]=w,e[11]=I):I=e[11];const V=`${j}-value`,y=`conflict-${s}`;let C;e[12]!==m||e[13]!==V||e[14]!==y?(C=i.jsx("span",{id:V,"data-testid":y,className:"min-w-0 text-sm",children:m}),e[12]=m,e[13]=V,e[14]=y,e[15]=C):C=e[15];let x;e[16]!==I||e[17]!==C?(x=i.jsxs("span",{className:"flex min-w-0 flex-col gap-1",children:[I,C]}),e[16]=I,e[17]=C,e[18]=x):x=e[18];let Y;return e[19]!==u||e[20]!==o||e[21]!==a||e[22]!==A||e[23]!==x||e[24]!==$||e[25]!==z||e[26]!==F?(Y=i.jsxs("button",{type:"button",role:"radio","aria-checked":o,"aria-labelledby":A,"aria-describedby":$,tabIndex:z,onClick:a,className:F,children:[u,x]}),e[19]=u,e[20]=o,e[21]=a,e[22]=A,e[23]=x,e[24]=$,e[25]=z,e[26]=F,e[27]=Y):Y=e[27],Y}function Mc(n){const e=it.c(4),{parts:s}=n;let o;e[0]!==s?(o=s.map(Dc),e[0]=s,e[1]=o):o=e[1];let a;return e[2]!==o?(a=i.jsx("span",{className:"whitespace-pre-wrap break-words",children:o}),e[2]=o,e[3]=a):a=e[3],a}function Dc(n,e){return n.kind==="changed"?i.jsx("mark",{className:"rounded-sm bg-warning/20 px-0.5 text-foreground",children:n.text},e):i.jsx("span",{children:n.text},e)}function Pc(n){const e=it.c(29),{preview:s}=n,o=Ft();switch(s.kind){case"empty":{let a;e[0]!==o?(a=o("sectionsEditor.formConflict.empty"),e[0]=o,e[1]=a):a=e[1];let u;return e[2]!==a?(u=i.jsx("span",{className:"italic text-muted-foreground",children:a}),e[2]=a,e[3]=u):u=e[3],u}case"text":{let a;return e[4]!==s.text?(a=i.jsx("span",{className:"whitespace-pre-wrap break-words",children:s.text}),e[4]=s.text,e[5]=a):a=e[5],a}case"image":{let a;return e[6]!==s.src?(a=i.jsx("img",{src:s.src,alt:"",className:"max-h-24 max-w-full rounded border object-contain"}),e[6]=s.src,e[7]=a):a=e[7],a}case"yesNo":{const a=s.value?"sectionsEditor.formConflict.yes":"sectionsEditor.formConflict.no";let u;e[8]!==o||e[9]!==a?(u=o(a),e[8]=o,e[9]=a,e[10]=u):u=e[10];let h;return e[11]!==u?(h=i.jsx("span",{children:u}),e[11]=u,e[12]=h):h=e[12],h}case"list":{const a=s.count===1?"sectionsEditor.formConflict.oneItem":"sectionsEditor.formConflict.items",u=String(s.count);let h;e[13]!==o||e[14]!==a||e[15]!==u?(h=o(a,{count:u}),e[13]=o,e[14]=a,e[15]=u,e[16]=h):h=e[16];let d;e[17]!==h?(d=i.jsx("span",{className:"text-muted-foreground",children:h}),e[17]=h,e[18]=d):d=e[18];let v;e[19]!==s.count||e[20]!==s.items?(v=s.items.some(Boolean)&&i.jsxs("span",{className:"flex flex-col",children:[s.items.map(Bc),s.count>s.items.length&&i.jsx("span",{children:"…"})]}),e[19]=s.count,e[20]=s.items,e[21]=v):v=e[21];let m;return e[22]!==d||e[23]!==v?(m=i.jsxs("span",{className:"flex flex-col gap-1",children:[d,v]}),e[22]=d,e[23]=v,e[24]=m):m=e[24],m}case"fields":{let a;e[25]!==s.entries?(a=s.entries.map(Ic),e[25]=s.entries,e[26]=a):a=e[26];let u;return e[27]!==a?(u=i.jsx("dl",{className:"grid grid-cols-[auto_minmax(0,1fr)] gap-x-2 gap-y-0.5",children:a}),e[27]=a,e[28]=u):u=e[28],u}}}function Ic(n){return i.jsxs("div",{className:"contents",children:[i.jsx("dt",{className:"text-muted-foreground",children:n.label}),i.jsx("dd",{className:"truncate",children:n.text})]},n.label)}function Bc(n,e){return i.jsx("span",{className:"truncate",children:`${e+1}. ${n||"…"}`},e)}function Kc(n,e){return n.kind==="protocol"&&n.source==="github"?e:null}function Fc(n,e){if(Object.hasOwn(n,e))return n[e]??null;const s=Yr(e),o=Object.keys(n).find(a=>Yr(a)===s);return o===void 0?null:n[o]??null}async function Oc(n,e){try{const s=await fetch(`/api/${n.orgSlug}/decofile/${encodeURIComponent(n.virtualMcpId)}/${encodeURIComponent(n.branch)}`,{cache:"no-store",headers:Ca("v8")});if(!s.ok)return null;const o=await s.json().catch(()=>({})),a=Fc(o.changedBy??{},e);return a&&typeof a.userId=="string"&&Number.isFinite(Date.parse(a.at))?a:null}catch{return null}}function Lc(n,e,s){const o=e.find(h=>h.userId===n.userId),a=o?.user?.name?.trim(),u=o?.user?.image??void 0;return{...a?{name:a}:{},...u?{avatarUrl:u}:{},at:n.at,you:!!s&&n.userId===s}}function $c(n){let e=2166136261,s=0;for(let o=0;o<n.length;o++){const a=n.charCodeAt(o);e=Math.imul(e^a,16777619),s=Math.imul(s,31)+a|0}return`${(e>>>0).toString(36)}${(s>>>0).toString(36)}:${n.length}`}function zc(n,e,s){const o=it.c(19),a=!!n&&!!e&&s!==null;let u;o[0]!==e||o[1]!==n||o[2]!==s?(u=xo.conflictAuthor(n?`${n.orgSlug}/${n.virtualMcpId}/${n.branch}`:"",e??"",s??""),o[0]=e,o[1]=n,o[2]=s,o[3]=u):u=o[3];let h;o[4]!==e||o[5]!==n?(h=()=>Oc(n,e),o[4]=e,o[5]=n,o[6]=h):h=o[6];let d;o[7]!==a||o[8]!==u||o[9]!==h?(d={queryKey:u,queryFn:h,enabled:a,staleTime:Number.POSITIVE_INFINITY,gcTime:6e5,retry:!1,refetchOnWindowFocus:!1},o[7]=a,o[8]=u,o[9]=h,o[10]=d):d=o[10];const{data:v}=Wi(d),m=a?v??null:null,j=!!m;let A;o[11]!==j?(A={enabled:j},o[11]=j,o[12]=A):A=o[12];const{data:$}=Pl(A);let z;o[13]!==$?(z=$?.data?.members??[],o[13]=$,o[14]=z):z=o[14];const H=z,{data:F}=vo.useSession();if(!m)return null;const f=F?.user?.id??null;let k;return o[15]!==m||o[16]!==H||o[17]!==f?(k=Lc(m,H,f),o[15]=m,o[16]=H,o[17]=f,o[18]=k):k=o[18],k}function Hc(n,e,s,o){if(!n||typeof n!="object")return{kind:"error",reason:"no-matcher-rule"};const a=e.trim();if(!a)return Gt(n,s,o)?{kind:"inline",blockKey:n.__resolveType??"",inlinedRule:xs(n,s,o)}:{kind:"noop"};const u=ys(n,s,o);if(!u)return{kind:"error",reason:"unreadable-rule"};if(u.blockKey)return{kind:"updateBlock",blockKey:u.blockKey,blockData:Kt(u.resolveType,u.data,a)};const h=Fn(a),d=On(h,s);return d?{kind:"error",reason:"invalid-block-id",message:d}:{kind:"createBlock",blockId:h,blockData:Kt(u.resolveType,u.data,a),reference:on(h)}}const po="section-form-stale-save",Wc=3,qc=1e3;function ho(n,e){const s=e.global&&e.pageKey?[{label:"Default",sections:[{__resolveType:e.pageKey}]}]:yo(e.pageKey?n[e.pageKey]?.sections:void 0,n),o=Math.max(0,Math.min(e.pageVariantIndex,s.length-1)),a=s[o]?.sections??[];return{pageVariants:s,variantIndex:o,rawSections:a,parsedSections:_n(a,n)}}const go=new WeakMap;let Gc=0;function Uc(n){let e=go.get(n);return e===void 0&&(e=++Gc,go.set(n,e)),e}function em({orgSlug:n,virtualMcpId:e,branch:s,previewReady:o=!0,previewUrl:a,currentPath:u,activePageBlockKey:h=null,activeGlobalBlockKey:d=null,externalSelection:v,onSaved:m,initialEditSeo:j=!1,onExitSeo:A,onSelectRoot:$,onViewJsonFile:z,onFocusedBlockChange:H,onVariantPreviewOverride:F}){const f=Ft(),k=Ui(),X=k?.taskId??null,w=o?{orgSlug:n,virtualMcpId:e,branch:s,threadId:X,previewUrl:a}:null,[I,V]=R.useState([]),{data:y,isLoading:C}=Na(w,{pollWhile:I.length>0}),{data:x,isLoading:Y}=oa(w),D=Wn(),ge=k?.virtualMcpId,le=_a(ge===e?e:null)?.metadata?.siteSlug??null,ee=El({virtualMcpId:e,branch:s,sandboxUrl:a}),pe=Ta(e,s),ce=Va(pe),he=!ce,ve=!!ee||ce,[b,B]=R.useState(null),[xe,T]=R.useState(null),[ye,K]=R.useState(null),[Se,ue]=R.useState(0),[te,se]=R.useState(void 0),[Te,Z]=R.useState(null),[_e,be]=R.useState(null),[q,O]=R.useState([]),Ke=R.useRef(null),[Qe,Xe]=R.useState(q.length);Qe!==q.length&&(Xe(q.length),requestAnimationFrame(()=>{Ke.current&&(Ke.current.scrollTop=0)}));const[Ye,Q]=R.useState(0),[ke,He]=R.useState(null),[We,Ee]=R.useState(null),[Ie,Ve]=R.useState(null),[Ze,Fe]=R.useState(!1),[re,dt]=R.useState(!1),ne=R.useRef(null),[Me,yt]=R.useState(!0),[et,ft]=R.useState(!1),[Ot,kn]=R.useState(!1),[qe,an]=R.useState(j),[Cs,Ns]=R.useState(j);j&&!Cs&&(Ns(!0),an(!0),B(null),T(null),K(null),O([])),!j&&Cs&&Ns(!1);const[Vo,ln]=R.useState(null),[Ts,En]=R.useState(void 0),[Vs,Lt]=R.useState([]),[Ms,Yt]=R.useState(0),[Je,at]=R.useState(0),[Mo,tt]=R.useState(null),[Jt,st]=R.useState(null),[Ds,Ps]=R.useState(null),Is=qi(),Bs=Ma({orgSlug:n,virtualMcpId:e,branch:s},{tunnel:!1}),cn=ia({orgSlug:n,virtualMcpId:e,branch:s}),[Do,Po]=R.useState(u),[Io,Bo]=R.useState(h),[Ko,Fo]=R.useState(d);(Do!==u||Io!==h||Ko!==d)&&(queueMicrotask(()=>cn.flush()),Po(u),Bo(h),Fo(d),B(null),T(null),K(null),ue(0),Z(null),be(null),at(0),tt(null),st(null),O([]),Q(t=>t+1),an(!1),ln(null),En(void 0),Lt([]),Yt(t=>t+1));const G=aa({orgSlug:n,virtualMcpId:e,branch:s}),un=ba((t,r)=>{G.mutate({blockKey:t,data:r},{onSuccess:()=>m?.(),onError:G.reportError})}),Rn=Fa({orgSlug:n,virtualMcpId:e,branch:s}),[Qt,Xt]=R.useState(!1),W=R.useRef(null),At=R.useRef(null),mt=R.useRef(null),pt=R.useRef(null),An=R.useRef({}),$t=R.useRef(null),dn=R.useRef(!1),fn=R.useRef(!1),Oe=R.useRef(new Map),Zt=R.useRef(!1),St=R.useRef([]),qn=R.useRef(new WeakSet);Da(n,e,t=>{const{activePageKey:r,rawSections:l,parsedSections:c,selectedSectionIndex:p}=Le.current,S=new Set;r&&S.add(r);for(const g of[At.current?.sectionIndex,p]){const _=g==null?void 0:l[g],L=g==null?void 0:c[g],N=_&&L?.isSavedBlock?ds(_,L):null;N&&S.add(N)}if([...S].some(g=>t.has(g))){for(const g of[W,mt,pt])g.current&&clearTimeout(g.current),g.current=null;At.current=null,Oe.current.clear(),r&&t.has(r)&&(An.current={})}});const Le=R.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null}),[Ks,Fs]=R.useState(0),[Oo,Lo]=R.useState(0),$o=zc(Kc(pe,{orgSlug:n,virtualMcpId:e,branch:s}),I[0]?.blockKey??null,I[0]?$c(ze(I[0].plan.theirs)):null),[zo,Ho]=R.useState(null),Gn=Pa(n,e).epoch,[Wo,qo]=R.useState(Gn);if(!o||C||Y)return i.jsx("div",{className:"h-full w-full flex items-center justify-center",children:i.jsx(Gi,{className:"size-5 text-muted-foreground"})});if(!y||!x)return i.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:f("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const Go=za(y,x),ie=!!d,je=ie?null:Ha(Go,u,h),E=ie?d:je?.key??null,Un=ie&&d?y[d]:void 0,Os=ie&&d&&Un?Wa(d,Un):ie&&d?d:"",mn=!ie&&E&&y[E]?y[E]:null,Yn=qe&&y&&x&&E&&je?Kr(y,{kind:"page",pageKey:E,pageName:String(je.name??""),path:String(je.path??"")},x):null,Uo=qe?mn?.seo:void 0,Cn=Ts!==void 0?Ts:Uo,Yo=qe?la(Cn):void 0,Ls=Yn?.seoTypeOptions??[],$s=qe&&x?ca(x):"",Jn=Vo??Yo??{},Nn=qe&&Yn?Il(Jn,Yn):null,zs=qe&&Nn&&ua(Cn)?Kn(Nn,x):null,Hs=qe?da(y,x)?.seoData:void 0,De=ie?[{label:"Default",sections:[{__resolveType:d}]}]:yo(mn?.sections,y??{}),ht=De.length>1,we=Math.min(Se,De.length-1),rt=De[we],U=rt?.sections??[],Pe=_n(U,y),Qn=!ie&&qa(mn?.sections);if(ie&&d&&Ds!==d){Ps(d);const t=U[0],r=Pe[0];if(t&&r){B(0),at(0),O([]);const l=jt(t,r,y);l&&(T(l.data),K(l.resolveType),st(null),tt(null))}}!ie&&Ds!==null&&Ps(null),Le.current={rawSections:U,parsedSections:Pe,decofile:y??{},activePageKey:E,pageVariants:De,variantIndex:we,sectionVariantIndex:Je,selectedSectionIndex:b};const Jo=()=>({multivariate:Qn,index:we,variants:De.map(t=>({rule:t.rule}))}),Xn=(t,r)=>{if(!F)return;if(!E||!Qn||t.length<=1){F(null);return}const l={multivariate:!0,index:r,variants:t},c=ce?ro(E,l):oo(E,l,y,x);F(c.length>0?c:null)},Zn=F&&E&&Qn&&ht&&!C&&!Y?E:null;if(Zn!==zo&&(Ho(Zn),Zn)){const t=De.map(l=>({rule:l.rule})),r=we;queueMicrotask(()=>Xn(t,r))}const en=(t,r,l)=>{if(!F)return;if(!E){F(null);return}const c=Jo(),p=ce?ro(E,c):oo(E,c,y,x);if(!t||r<0){F(p.length>0?p:null);return}const S={pageKey:E,page:c,sectionIndex:r,sectionLazy:Pe[r]?.isLazy??!1,mvObj:t,selectedVariantIndex:l},g=ce?Kl(S):Fl({...S,decofile:y,meta:x}),_=[...p,...g];F(_.length>0?_:null)},bt=(t,r,l,c=b??-1,p=!1)=>{const S=xt(t,r);if(!S){T(null),K(null),st(null),tt(null),p&&en(null,c,l);return}const _=vs(S,wt)[l];if(!_){T(null),K(null),st(null),tt(null),p&&en(null,c,l);return}const L=jo(_.value,y);T(L?.data??null),K(L?.resolveType??null);const{resolveType:N,formValue:M}=jn(_.rule,y,x??void 0);st(N),tt(M),p&&en(S,c,l)},pn=v?.index;if(v!==void 0&&(v?.seq??null)!==te&&(se(v?.seq??null),typeof pn=="number")){const t=U[pn],r=Pe[pn];if(t&&r)if(B(pn),at(0),O([]),Q(l=>l+1),r.isMultivariate)bt(t,r,0,pn);else{const l=jt(t,r,y);l?(T(l.data),K(l.resolveType)):(T(null),K(null)),st(null),tt(null)}}if(Gn!==Wo){qo(Gn);const t=W.current!==null||Oe.current.size>0||pt.current!==null||mt.current!==null||G.isPending||cn.isPending||I.length>0,r=b!==null&&co(Ke.current,document.activeElement);if(!t&&r&&(Zt.current=!0),!t&&!r&&b!==null){const l=U[b],c=Pe[b];if(O([]),Q(p=>p+1),!l||!c)B(null),T(null),K(null);else if(c.isMultivariate)bt(l,c,Je,b);else{const p=jt(l,c,y);T(p?.data??null),K(p?.resolveType??null)}}!t&&qe&&(ln(null),En(void 0),Yt(l=>l+1))}if(Ks!==Oo){Lo(Ks);const t=b!==null?U[b]:null,r=b!==null?Pe[b]:null;if(t&&r&&b!==null)if(O([]),Q(l=>l+1),r.isMultivariate)bt(t,r,Je,b);else{const l=jt(t,r,y);T(l?.data??null),K(l?.resolveType??null)}}const lt=I[0];if(lt){const{formBase:t,target:r}=lt,l=ho(y,r),c=t.sectionIndex,p=l.rawSections.length===t.sectionCount?hs(l.rawSections[c],l.parsedSections[c],r.sectionVariantIndex,y):null,S=ac(lt,p,g=>ao(t,g));if(S){const _=[{...lt,...S,changedAgain:!0},...I.slice(1)];St.current=_,V(_)}}const hn={orgSlug:n,virtualMcpId:e,branch:s,threadId:X,previewUrl:ce?void 0:a??void 0,siteSlug:le},Tn=ye&&x?Kn(ye,x):null,ct=(t,r)=>{if(!E)return;W.current&&(clearTimeout(W.current),W.current=null),Oe.current.clear(),pt.current&&(clearTimeout(pt.current),pt.current=null),mt.current&&(clearTimeout(mt.current),mt.current=null);const l=Sn(y,E,t,we,De);G.mutate({blockKey:E,data:l},{onSuccess:()=>r?.onSuccess?.()??m?.(),onError:c=>{r?.onError?.(),G.reportError(c)}})},zt=()=>{H?.(null),B(null),kn(!1),T(null),K(null),at(0),tt(null),st(null),O([]),Q(t=>t+1)},Ws=()=>co(Ke.current,document.activeElement),es=(t=f("sectionsEditor.sectionsEditor.blockChangedElsewhere"))=>{if(W.current&&(clearTimeout(W.current),W.current=null),Oe.current.clear(),At.current=null,oe.error(t,{id:po}),Ws()){Zt.current=!0;return}Fs(r=>r+1)},qs=()=>{!Zt.current||Ws()||St.current.length>0||W.current!==null||dn.current||fn.current||Oe.current.size>0||(Zt.current=!1,Fs(t=>t+1))},Gs=()=>{Zt.current&&setTimeout(qs,0)},Us=t=>Ba(Is,Bs,t),Ys=t=>{Oe.current.size!==0&&setTimeout(()=>{if(dn.current||fn.current)return;const r=[...Oe.current.values()];Oe.current.clear();for(const l of r)l()},t)},Qo=t=>{const{activePageKey:r,variantIndex:l,sectionVariantIndex:c}=Le.current,p=$t.current;return{formBase:p?.sectionIndex===t&&p.variantIndex===c?p:null,pageKey:r,global:ie,pageVariantIndex:l,sectionVariantIndex:c,schema:Tn}},gn=t=>{St.current=t,V(t)},Xo=t=>{const r=St.current,l=r.findIndex(S=>S.formBase===t.formBase),c=l>=0?r[l]:void 0,p=c?r.with(l,{...t,choices:ks(c.plan,c.choices,t.plan),fresh:No(c.plan,t.plan,c.fresh),changedAgain:c.changedAgain||ze(c.plan.theirs)!==ze(t.plan.theirs)}):[...r,{...t,changedAgain:qn.current.has(t.formBase)}];gn(p)},Js=(t,r)=>{const l=St.current,c=l.findIndex(g=>g.formBase===t),p=l[c];if(!p)return!1;if(ze(p.plan.mine)===ze(r))return!0;const S=ws({...p.plan,mine:r});if(S.pointers.length===0){const g=l.filter(_=>_!==p);return gn(g),!1}return gn(l.with(c,{...p,plan:S,choices:ks(p.plan,p.choices,S)})),!0},Zo=t=>{const r=Le.current;return r.selectedSectionIndex===t.formBase.sectionIndex&&r.activePageKey===t.target.pageKey&&r.variantIndex===t.target.pageVariantIndex&&r.sectionVariantIndex===t.target.sectionVariantIndex},ei=()=>{const t=St.current[0];if(!t)return null;const{formBase:r,target:l}=t;W.current&&At.current?.sectionIndex===r.sectionIndex&&At.current.sectionVariantIndex===l.sectionVariantIndex&&(clearTimeout(W.current),W.current=null,At.current=null),Oe.current.delete(`${l.pageKey}:${r.sectionIndex}:${l.sectionVariantIndex}`);const c=r.emitted;return c&&typeof c=="object"&&!Js(r,c)&&vn(c,r.sectionIndex,0,l),St.current[0]??null},ti=()=>{const t=St.current[0],r=ei();if(!r||!t||r.formBase!==t.formBase||r.plan.pointers.some(S=>!t.plan.pointers.includes(S)))return;const l=oc(r.plan,r.choices);gn(St.current.slice(1));const{formBase:c,target:p}=r;c.base=r.plan.theirs,c.version=void 0,c.emitted=l,qn.current.add(c),($t.current===c||Zo(r))&&($t.current=c,T(l),Q(S=>S+1)),vn(l,c.sectionIndex,0,p)},ni=t=>{const[r,...l]=St.current;r&&gn([{...r,choices:t},...l])},vn=(t,r,l=0,c)=>{const p=c??Qo(r),S=p.sectionVariantIndex,g=p.formBase,_=At.current;W.current&&(clearTimeout(W.current),W.current=null,_&&(_.sectionIndex!==r||_.sectionVariantIndex!==S)&&_.write());const L=`${p.pageKey}:${r}:${S}`,N=()=>{if(dn.current||fn.current){Oe.current.set(L,N);return}const M=typeof t=="function"?t():t;if(g&&Js(g,M))return;const P=Le.current.decofile,{rawSections:de,parsedSections:Re,pageVariants:nt,variantIndex:Be}=ho(P,p),Ge=p.pageKey,J=de[r];if(!J)return;const fe=Re[r];if(!fe)return;const Ce=g?.base,Ue=hs(J,fe,S,P),gt=!!Ce&&!!Ue&&Ro(Ce,Ue)&&!(g&&ao(g,Ue));if(gt&&Ce&&Ue){if(Ao(Ce,Ue)){es(f("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}const Ae=fe.isSavedBlock?"here":sc(Ce,de.map((Ne,Dt)=>hs(Ne,Re[Dt],S,P)),r,g?.sectionCount??de.length);if(Ae==="unknown"){es(f("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}if(typeof Ae=="number"&&g){g.sectionCount=de.length,g.sectionIndex=Ae,$t.current===g&&B(Ae),vn(M,Ae,l,p);return}}const ot=gt&&Ce&&Ue?ws({ancestor:Ce,mine:M,theirs:Ue}):null;if(ot&&ot.pointers.length>0&&g){g.sectionCount=de.length,Xo({plan:ot,formBase:g,target:p,sectionIndex:r,choices:Co(ot),changedAgain:!1,blockKey:fe.isSavedBlock?ds(J,fe):Ge,fresh:{}});return}const vt=ot?ot.merged:null,Mt=vt??M,Dr=rc({merged:!!vt,tracked:g,current:$t.current,saved:M});vt&&oe.info(f("sectionsEditor.sectionsEditor.blockMergedWithOthers"),{id:po}),Dr&&g&&(g.emitted=vt,T(vt));const cs=Dr||!vt?Mt:M;g&&(g.base=cs,g.sectionCount=de.length,tc(g,cs));const Pr={onSuccess:()=>{g&&qn.current.delete(g),m?.()},onError:Ae=>{if(g?.base===cs&&Ce&&(g.base=Ce),Ae instanceof Ia){g&&(g.version=void 0),l<Wc?(Oe.current.delete(L),fn.current=!0,setTimeout(()=>{fn.current=!1,vn(()=>{const Ne=g?.emitted;return Ne&&typeof Ne=="object"?Ne:M},r,l+1,p),Oe.current.delete(L),Ys(bn)},qc*2**l)):es();return}G.reportError(Ae)}},Ir=Ae=>{dn.current=!0;let Ne=!1;G.mutateAsync(Ae).then(()=>Pr.onSuccess(),Dt=>{Ne=!0,Pr.onError(Dt)}).finally(()=>{dn.current=!1,Ys(Ne?bn:0),qs()})};if(fe.isSavedBlock){const Ae=ds(J,fe);if(!Ae)return;Ir({blockKey:Ae,data:Mt,...Ce?{base:{value:vt?Ue:Ce}}:{},rebaseOnConflict:!1,guard:lo({formBase:g,rebased:!!vt,versionOf:Us})});return}if(!Ge)return;const In={...P[Ge]},Wt=[...de];if(fe.isMultivariate){const Ae=xt(J,fe);if(!Ae||!Ge)return;const Ne=il(Ae,S,Mt);Wt[r]=qt(J,fe,Ne)}else if(fe.isHidden){const Ae=Rs(J.__resolveType),Ne=Ae?{...J.section}:{...J},Dt=Array.isArray(Ne.variants)?[...Ne.variants]:[];Dt[0]&&(Dt[0]={...Dt[0],value:Mt}),Ne.variants=Dt,Ae?Wt[r]={...J,section:Ne}:Wt[r]=Ne}else fe.isLazy?Wt[r]={...J,section:Mt}:Wt[r]=Mt;if(nt.length>1){const Ae=In.sections,Ne=[...Ae?.variants??[]];Ne[Be]&&(Ne[Be]={...Ne[Be],value:Wt}),In.sections={...Ae,variants:Ne}}else In.sections=Wt;Ir({blockKey:Ge,data:In,rebaseOnConflict:!1,guard:lo({formBase:null,rebased:!1,versionOf:Us})})};At.current={sectionIndex:r,sectionVariantIndex:S,write:N},W.current=setTimeout(()=>{W.current=null,N()},bn)},si=t=>{Zt.current=!1,B(t),at(0),O([]),Q(p=>p+1);const r=U[t],l=Pe[t];if(H?.(l?.isSavedBlock?l.resolveType??null:null),!r||!l)return;if(l.isMultivariate){bt(r,l,0,t);return}const c=jt(r,l,y);if(!c){T(null),K(null),st(null),tt(null),en(null,t,0);return}T(c.data),K(c.resolveType),st(null),tt(null),en(null,t,0)},Qs=t=>{const r=t;b!==null&&($t.current=nc($t.current,{sectionIndex:b,variantIndex:Le.current.sectionVariantIndex,shown:xe,next:r,sectionCount:Le.current.rawSections.length})),T(r),b!==null&&vn(r,b)},ts=t=>{if(!E||!y||!x||!je)return;const r={kind:"page",pageKey:E,pageName:String(je.name??""),path:String(je.path??"")},l=Kr(y,r,x);l&&cn.save(E,()=>{const c=Is.getQueryData(xo.decofile(Bs))?.[E];if(!c||typeof c!="object"||c===null||Array.isArray(c))return null;const p={...c,...An.current};return An.current={},t?.raw!==void 0?{...p,seo:t.raw}:t?.inner!==void 0?Bl(r,l,p,t.inner):p})},Xs=(t,r)=>{E&&(An.current[t]=r,ts())},ri=(t,r)=>{if(!E)return;const l=Ln([...U],t,r);b!==null&&(b===t?B(r):t<b&&r>=b?B(b-1):t>b&&r<=b&&B(b+1)),ct(l)},oi=t=>{if(!E)return;const r=U.filter((l,c)=>c!==t);b===t?zt():b!==null&&b>t&&B(b-1),ct(r)},ii=t=>{if(!E)return;const r=U[t];if(!r)return;const l=[...U];l.splice(t+1,0,ja(r)),b!==null&&b>t&&B(b+1),ct(l)},ai=t=>{if(!E)return;const r=U[t],l=Pe[t];if(!r||!l)return;const c=l.isHidden?tl(r):nl(r);if(!c)return;const p=[...U];p[t]=c,b===t&&zt(),ct(p)},li=t=>{if(!E)return;const r=U[t],l=Pe[t];if(!r||!l||l.isMultivariate)return;const c=el(r);if(!c)return;const p=[...U];p[t]=c,b===t&&zt(),ct(p)},ci=t=>{if(!E)return;const r=U[t],l=Pe[t];if(!r||!l?.isSavedBlock)return;const c=jt(r,l,y);if(!c?.data)return;const{name:p,...S}=c.data,g=[...U];l.isLazy?g[t]={...r,section:S}:g[t]=S,b===t&&zt(),ct(g)},ui=t=>{if(!E)return;const r=[...U,{__resolveType:t.resolveType}],l=r.length-1;ct(r,{onError:()=>{Le.current.selectedSectionIndex===l&&zt()}}),Fe(!1),B(l),at(0),O([]),Q(g=>g+1);const c=r[l],p=_n(r,y)[l];if(!c||!p)return;if(p.isMultivariate){bt(c,p,0);return}const S=jt(c,p,y);if(!S){T(null),K(null),st(null),tt(null);return}T(S.data),K(S.resolveType),st(null),tt(null)},Zs=t=>{ne.current=t.append,Fe(!0)},di=t=>{const r=ne.current;if(!r){ui(t);return}r({__resolveType:t.resolveType}),Fe(!1),ne.current=null},er=t=>{if(b===null)return;const r=U[b],l=Pe[b];!r||!l?.isMultivariate||(at(t),O([]),Q(c=>c+1),bt(r,l,t,b,!0))},fi=t=>{if(b===null||!E)return;const r=U[b],l=Pe[b];if(!r||!l?.isMultivariate)return;const c=xt(r,l);if(!c)return;const p=Xa(c,t);if(!p){oe.error(f("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const S=[...U];S[b]=qt(r,l,p);const g=p.variants;let _=Je;t===Je?_=Math.min(t,g.length-1):t<Je&&(_=Je-1),at(_),O([]),Q(L=>L+1),bt(S[b],l,_),ct(S)},mi=t=>{if(b===null||!E)return;const r=U[b],l=Pe[b];if(!r||!l?.isMultivariate)return;const c=xt(r,l);if(!c)return;const p=Za(c,t),S=[...U];S[b]=qt(r,l,p);const g=t+1;at(g),O([]),Q(_=>_+1),bt(S[b],l,g),ct(S)},pi=(t,r)=>{if(b===null||!E||t===r)return;const l=U[b],c=Pe[b];if(!l||!c?.isMultivariate)return;const p=xt(l,c);if(!p)return;const S=Ja(p,t,r),g=[...U];g[b]=qt(l,c,S);let _=Je;Je===t?_=r:t<Je&&r>=Je?_=Je-1:t>Je&&r<=Je&&(_=Je+1),at(_),bt(g[b],c,_),ct(g)},xn=t=>{const r=t??b;if(r===null||!E)return;const l=U[r],c=Pe[r];if(!l||!c)return;const p=Ga(l,c);if(!p){oe.error(f("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const S=[...U];S[r]=p.section;const g=_n(S,y)[r];if(!g?.isMultivariate){oe.error(f("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}B(r),at(p.newVariantIndex),O([]),Q(_=>_+1),bt(p.section,g,p.newVariantIndex,r),ct(S)},tr=()=>{if(b===null||!E)return;const t=U[b],r=Pe[b];if(!t||!r?.isMultivariate)return;const l=xt(t,r);if(!l)return;const c=Qa(t,r,l);if(!c){oe.error(f("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const p=[...U];p[b]=c;const S=_n(p,y)[b];if(!S)return;at(0),st(null),tt(null),O([]),Q(_=>_+1);const g=jt(c,S,y);g?(T(g.data),K(g.resolveType)):(T(null),K(null)),en(null,b,0),ct(p)},hi=async t=>{if(ke===null||!E)return;const r=On(t,y,x);if(r){oe.error(r);return}const l=U[ke],c=Pe[ke];if(!l||!c)return;const p=jt(l,c,y);if(!p){oe.error(f("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const S={...p.data,name:t};try{await G.mutateAsync({blockKey:t,data:S});const g=[...U];g[ke]={__resolveType:t},await G.mutateAsync({blockKey:E,data:Sn(y,E,g,we,De)}),b===ke&&zt(),He(null),oe.success(f("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),m?.()}catch(g){oe.error(f("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"),{description:Pt(f,It(g))})}},nr=rt?.rule;if(ht&&b===null&&_e===null&&nr){const{resolveType:t,formValue:r}=jn(nr,y??{},x??void 0);be(t),Z(r)}const tn=x?fa(x):[],ns=x&&y?ma(x,y):[],sr=!ie&&!!(ve&&x&&y),rr=_e&&x?Kn(_e,x):null,Ct=()=>{mt.current&&(clearTimeout(mt.current),mt.current=null),pt.current&&(clearTimeout(pt.current),pt.current=null)},Ht=async(t,r)=>{if(!(ol(r,t,x)>0))try{await Rn.mutateAsync({blockKey:t})}catch(l){oe.error(f("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"),{description:Pt(f,It(l))})}},or=t=>{mt.current&&clearTimeout(mt.current),mt.current=setTimeout(()=>{const{activePageKey:r,decofile:l,variantIndex:c}=Le.current;if(!r)return;const p={...l[r]},S={...p.sections},g=[...S.variants??[]],_=g[c],L=_?.rule;if(Gt(L,l,x)){const N=L?.__resolveType??"",M=l[N],P=typeof M?.name=="string"?M.name:N,{__resolveType:de,...Re}=t;G.mutate({blockKey:N,data:Kt(de??"",Re,P)},{onSuccess:()=>m?.(),onError:G.reportError});return}_&&(g[c]={..._,rule:t}),p.sections={...S,variants:g},G.mutate({blockKey:r,data:p},{onSuccess:()=>m?.(),onError:G.reportError})},bn)},ir=t=>{be(t);const r=t?Jr(t,x):{__resolveType:Qr};Z(t?r:{}),or(r)},ar=t=>{const r=t;Z(r);const l=_e?{__resolveType:_e,...r}:{...r};or(l)},lr=async t=>{Ct();const{activePageKey:r,decofile:l,variantIndex:c}=Le.current;if(!r)return;const p=l[r],S=p?.sections;if(!S||typeof S!="object"||Array.isArray(S))return;const g=S;if(!Array.isArray(g.variants))return;const _=[...g.variants],L=_[c];if(!L)return;const N=Bt(L.rule,l,x),M=on(t);_[c]={...L,rule:M};const P={...l,[r]:{...p,sections:{...g,variants:_}}},{resolveType:de,formValue:Re}=jn(M,P,x??void 0);be(de),Z(Re);try{await G.mutateAsync({blockKey:r,data:P[r]}),N&&N!==t&&await Ht(N,P),m?.()}catch(nt){oe.error(f("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Pt(f,It(nt))})}},cr=t=>{pt.current&&clearTimeout(pt.current);const{selectedSectionIndex:r,sectionVariantIndex:l}=Le.current;r!==null&&(pt.current=setTimeout(()=>{const{rawSections:c,parsedSections:p,decofile:S,activePageKey:g,pageVariants:_,variantIndex:L}=Le.current;if(!g)return;const N=c[r],M=p[r];if(!N||!M?.isMultivariate)return;const P=xt(N,M);if(!P)return;const Re=(P.variants??[])[l]?.rule;if(Gt(Re,S,x)){const J=Re?.__resolveType??"",fe=S[J],Ce=typeof fe?.name=="string"?fe.name:J,{__resolveType:Ue,...gt}=t;G.mutate({blockKey:J,data:Kt(Ue??"",gt,Ce)},{onSuccess:()=>m?.(),onError:G.reportError});return}const nt=Xr(P,l,t),Be=[...c];Be[r]=qt(N,M,nt);const Ge=Sn(S,g,Be,L,_);G.mutate({blockKey:g,data:Ge},{onSuccess:()=>m?.(),onError:G.reportError})},bn))},gi=t=>{st(t);const r=t?Jr(t,x):{__resolveType:Qr};tt(t?r:{}),cr(r)},vi=t=>{const r=t;tt(r);const l=Jt?{__resolveType:Jt,...r}:{...r};cr(l)},xi=async t=>{Ct();const{selectedSectionIndex:r,sectionVariantIndex:l,rawSections:c,parsedSections:p,decofile:S,activePageKey:g,pageVariants:_,variantIndex:L}=Le.current;if(r===null||!g)return;const N=c[r],M=p[r];if(!N||!M?.isMultivariate)return;const P=xt(N,M);if(!P)return;const de=P.variants??[],Re=Bt(de[l]?.rule,S,x),nt=on(t),Be=Xr(P,l,nt),Ge=[...c];Ge[r]=qt(N,M,Be);const J=Sn(S,g,Ge,L,_),fe={...S,[g]:J},{resolveType:Ce,formValue:Ue}=jn(nt,fe,x??void 0);st(Ce),tt(Ue);try{await G.mutateAsync({blockKey:g,data:J}),Re&&Re!==t&&await Ht(Re,fe),m?.()}catch(gt){oe.error(f("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Pt(f,It(gt))})}};if(!ie&&!je)return i.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:f("sectionsEditor.sectionsEditor.noPageFound",{currentPath:u})});if(ie&&!Un)return i.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:f("sectionsEditor.sectionsEditor.globalBlockNotFound")});const $e=b!==null?Pe[b]??null:null,ur=b!==null?U[b]:null,dr=ur&&$e?.isMultivariate?xt(ur,$e):null,Nt=dr?vs(dr,wt):[],Vn=Math.min(Je,Math.max(Nt.length-1,0)),nn=Nt[Vn]??null,Tt=$e?.isMultivariate===!0,ss=b!==null&&$e!==null,Vt=ss&&(Tt||!!(Tn&&xe)),yi=Vt&&!ie&&$e?.isSavedBlock===!0,ut=ie||yi,fr=ie?Os:$e?.label??"",Si=Jt&&x?Kn(Jt,x):null,mr=(t,r)=>r&&D?`${t} · ${r}`:t,pr=$e?$e.variantOf??$e.label:"",bi=(()=>{const t=Tt&&nn?nn.label:null;return t?D?[mr(pr,t)]:[$e.label,t]:[$e?.label??""]})(),rs=mr(je?.name??"",ht?rt?.label:null),Mn=Vt&&(!ie||q.length>0)?ie?[Os,...q]:[rs,...bi,...q]:[],hr=qe&&je?[je.name,"SEO",...Vs]:[],gr=f("sectionsEditor.pageVariantTabs.variantsLabel"),vr=et&&je?[je.name,gr]:Ot&&je&&$e?[rs,pr,gr]:[],Dn=vr.length>0?vr:hr.length>0?hr:ut?Mn.length>0?Mn:[fr]:Mn.length>0?Mn:[rs],xr=ss&&!Tt&&!$e?.isHidden&&!!E,ji=ut||!ie&&ht&&!!rt||xr,wi=ss&&!Tt&&!ie&&q.length===0&&!!$e&&bo($e)&&!!E,_i=D&&Vt&&!Ot&&Tt&&q.length===0&&!!nn,yr=D&&q.length>0?Fr(q[q.length-1]):null,ki=q.length>1?Fr(q[q.length-2]):null,Sr=ut?fr:Vt?$e?.label??"":je?.name??"",Ei=et||Ot?f("sectionsEditor.pageVariantTabs.variantsLabel"):qe?f("sectionsEditor.panelSections.seo"):yr??Sr,br=Ot?$e?.variantOf??$e?.label??"":et||qe?je?.name??"":yr?ki??Sr:ut?f("sectionsEditor.sectionsEditor.globalSectionSubtitle"):Vt?je?.name??"":je?.path??"",os=!et&&!Ot&&!qe&&!Vt&&!ut,Ri=!D&&!qe&&!ie&&Tt&&q.length===0,yn=()=>{if(!E)return;Ct(),W.current&&(clearTimeout(W.current),W.current=null),Oe.current.clear();const t=y[E],r=Ua(t.sections,U);if(!r)return;const l=Ya(r);G.mutate({blockKey:E,data:{...t,sections:r}},{onSuccess:()=>{ue(l),B(null),T(null),K(null),O([]),Z(null),be(null)},onError:G.reportError})},Pn=(t,r,l)=>{if(!E)return;Ct(),W.current&&(clearTimeout(W.current),W.current=null),Oe.current.clear();const c=y[E],p=c.sections;if(!p||typeof p!="object"||Array.isArray(p))return;const S=p;if(!Array.isArray(S.variants))return;const g=t([...S.variants]);if(!g)return;const _=rl(S,g),L={...y,[E]:{...c,sections:_}};G.mutate({blockKey:E,data:L[E]},{onSuccess:()=>{r?.();const N=typeof l=="string"?[l]:l??[];(async()=>{for(const M of N)await Ht(M,L)})()},onError:G.reportError})},is=t=>{Ee(null),ue(t),B(null),T(null),K(null),O([]);const r=De[t]?.rule,{resolveType:l,formValue:c}=jn(r,y??{},x??void 0);be(l),Z(c),Xn(De.map(p=>({rule:p.rule})),t)},jr=(t,r)=>{if(t===r)return;let l=we;we===t?l=r:t<we&&r>=we?l=we-1:t>we&&r<=we&&(l=we+1),ue(l);const c=Ln(De.map(p=>({rule:p.rule})),t,r);Xn(c,l),Pn(p=>Ln(p,t,r))},wr=t=>{const r=De[t]?.rule,l=Bt(r,y??{},x??void 0);Pn(c=>c.length<=1?null:(c.splice(t,1),c),()=>{De.length-1===1?ue(0):t<we?ue(we-1):t===we&&ue(Math.max(0,t-1)),B(null),T(null),K(null),O([]),Z(null),be(null)},l)},Ai=()=>{const t=De.map((r,l)=>({variant:r,index:l})).filter(({variant:r})=>!sl(r.rule)).map(({variant:r})=>Bt(r.rule,y??{},x??void 0)).filter(r=>!!r);Pn(r=>{const l=al({variants:r}),c=r[l];return c?[{...c,rule:ll()}]:null},()=>{ue(0),B(null),T(null),K(null),O([]),Z(null),be(null),ft(!1)},t)},_r=t=>{Pn(r=>cl(r,t),()=>{ue(t+1),B(null),T(null),K(null),O([]),Z(null),be(null)})},Ci=async(t,r)=>{Ct(),W.current&&(clearTimeout(W.current),W.current=null),Oe.current.clear();const l=Le.current.activePageKey,c=Le.current.decofile;if(!l)return;const p=c[l],S=p.sections;if(!S||typeof S!="object"||Array.isArray(S))return;const g=S;if(!Array.isArray(g.variants))return;const _=[...g.variants],L=_[t];if(!L?.rule||typeof L.rule!="object"){oe.error(f("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const N=L.rule,M=r.trim();Xt(!0);try{if(!M){if(!Gt(N,c,x)){Ee(null);return}const Ge=N.__resolveType??"";_[t]={...L,rule:xs(N,c,x)};const J={...c,[l]:{...p,sections:{...g,variants:_}}};await G.mutateAsync({blockKey:l,data:J[l]}),await Ht(Ge,J),Ee(null),m?.();return}const P=ys(N,c,x);if(!P){oe.error(f("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(P.blockKey){await G.mutateAsync({blockKey:P.blockKey,data:Kt(P.resolveType,P.data,M)}),Ee(null),m?.();return}const de=Fn(M),Re=On(de,c,x);if(Re){oe.error(Re);return}const nt=Kt(P.resolveType,P.data,M);let Be=null;try{await G.mutateAsync({blockKey:de,data:nt}),Be=de,_[t]={...L,rule:on(de)},await G.mutateAsync({blockKey:l,data:{...p,sections:{...g,variants:_}}}),Be=null}catch(Ge){throw Be&&await Rn.mutateAsync({blockKey:Be}).catch(()=>{}),Ge}Ee(null),oe.success(f("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:M})),m?.()}catch(P){oe.error(f("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Pt(f,It(P))})}finally{Xt(!1)}},Ni=async(t,r)=>{Ct(),W.current&&(clearTimeout(W.current),W.current=null),Oe.current.clear();const{selectedSectionIndex:l,rawSections:c,parsedSections:p,decofile:S,activePageKey:g,pageVariants:_,variantIndex:L}=Le.current;if(l===null||!g)return;const N=c[l],M=p[l];if(!N||!M?.isMultivariate)return;const P=xt(N,M);if(!P)return;const de=P.variants??[],Re=de[t];if(!Re?.rule||typeof Re.rule!="object"){oe.error(f("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const nt=Re.rule,Be=r.trim();Xt(!0);const Ge=async J=>{const fe={...P,variants:J},Ce=[...c];Ce[l]=qt(N,M,fe);const Ue=Sn(S,g,Ce,L,_);return await G.mutateAsync({blockKey:g,data:Ue}),{...S,[g]:Ue}};try{if(!Be){if(!Gt(nt,S,x)){Ve(null);return}const ot=nt.__resolveType??"",vt=[...de];vt[t]={...Re,rule:xs(nt,S,x)};const Mt=await Ge(vt);await Ht(ot,Mt),Ve(null),m?.();return}const J=ys(nt,S,x);if(!J){oe.error(f("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(J.blockKey){await G.mutateAsync({blockKey:J.blockKey,data:Kt(J.resolveType,J.data,Be)}),Ve(null),m?.();return}const fe=Fn(Be),Ce=On(fe,S,x);if(Ce){oe.error(Ce);return}const Ue=Kt(J.resolveType,J.data,Be);let gt=null;try{await G.mutateAsync({blockKey:fe,data:Ue}),gt=fe;const ot=[...de];ot[t]={...Re,rule:on(fe)},await Ge(ot),gt=null}catch(ot){throw gt&&await Rn.mutateAsync({blockKey:gt}).catch(()=>{}),ot}Ve(null),oe.success(f("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:Be})),m?.()}catch(J){oe.error(f("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Pt(f,It(J))})}finally{Xt(!1)}},kr=async(t,r,l)=>{T(l);try{await G.mutateAsync({blockKey:t,data:l})}catch(c){throw T(p=>p===l?r:p),c}},Ti={rename:async(t,r,l)=>{Ct(),W.current&&(clearTimeout(W.current),W.current=null),Oe.current.clear();const{activePageKey:c,decofile:p}=Le.current;if(!c)return;const S=Array.isArray(t.variants)?[...t.variants]:[],g=S[r],_=g?.rule&&typeof g.rule=="object"?g.rule:void 0,L=async M=>{const P={...t,variants:M};return await kr(c,t,P),{...p,[c]:P}},N=Hc(_,l,p,x);if(N.kind!=="noop"){if(N.kind==="error"){oe.error(N.reason==="no-matcher-rule"?f("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"):N.reason==="unreadable-rule"?f("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"):N.message??f("sectionsEditor.sectionsEditor.failedToRenameVariant"));return}Xt(!0);try{if(N.kind==="inline"){const P=[...S];P[r]={...g,rule:N.inlinedRule};const de=await L(P);await Ht(N.blockKey,de),m?.();return}if(N.kind==="updateBlock"){await G.mutateAsync({blockKey:N.blockKey,data:N.blockData}),m?.();return}let M=null;try{await G.mutateAsync({blockKey:N.blockId,data:N.blockData}),M=N.blockId;const P=[...S];P[r]={...g,rule:N.reference},await L(P),M=null}catch(P){throw M&&await Rn.mutateAsync({blockKey:M}).catch(()=>{}),P}oe.success(f("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:l.trim()})),m?.()}catch(M){oe.error(f("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Pt(f,It(M))})}finally{Xt(!1)}}},selectGlobal:async(t,r,l)=>{Ct(),W.current&&(clearTimeout(W.current),W.current=null),Oe.current.clear();const{activePageKey:c,decofile:p}=Le.current;if(!c)return;const S=Array.isArray(t.variants)?[...t.variants]:[],g=S[r];if(!g)return;const _=Bt(g.rule,p,x);S[r]={...g,rule:on(l)};const L={...t,variants:S},N={...p,[c]:L};try{await kr(c,t,L),_&&_!==l&&await Ht(_,N),m?.()}catch(M){oe.error(f("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Pt(f,It(M))})}}},Er=()=>{zt()},Rr=t=>{ln(t),ts({inner:t})},Ar=t=>{En(t),ts({raw:t})},Cr=()=>{ln(null),Lt([])},Nr=()=>Yt(t=>t+1),Tr=()=>{cn.flush(),an(!1),ln(null),En(void 0),Lt([]),Yt(t=>t+1),A?.()},Vi=()=>{ft(!1),kn(!1),B(null),an(!0)},Mi=()=>{qe&&Tr(),B(null),ft(!0)},Di=()=>kn(!0),as=t=>{if(et&&t===0){ft(!1);return}if(Ot&&t<2){kn(!1),t===0&&B(null);return}if(qe){if(t===0){Tr();return}if(t===1){Lt([]),Yt(l=>l+1);return}Lt(Vs.slice(0,t-1)),Yt(l=>l+1);return}if(ie){O(q.slice(0,t)),Q(l=>l+1);return}if(t===0){Er();return}if(t===1){O([]),Q(l=>l+1);return}const r=!D&&Tt&&nn?1:0;if(r===1&&t===2){O([]),Q(l=>l+1);return}O(q.slice(0,t-1-r))},ls=Dn.length>1?i.jsx("button",{type:"button",onClick:()=>as(wa(Dn.length,{isMultivariateSectionTop:Ri})),title:f("sectionsEditor.sectionsEditor.back"),"aria-label":f("sectionsEditor.sectionsEditor.back"),className:ae("shrink-0 inline-flex size-6 items-center justify-center rounded-[var(--studio-control-radius,var(--radius-md))] transition-colors",ut?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:i.jsx(Aa,{className:"size-4"})}):null,Pi=ut||Vt||qe?ji&&i.jsxs("div",{className:ae("border-b px-3 py-2.5",ut&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[i.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[!ie&&ht&&rt&&i.jsxs("button",{type:"button",onClick:Er,title:f("sectionsEditor.sectionsEditor.editingInVariant",{variant:rt.label}),className:ae("shrink-0 inline-flex items-center gap-1 rounded-lg h-6 px-1.5 text-xs font-medium cursor-pointer transition-opacity hover:opacity-80",ha),children:[i.jsx(pa,{rule:fs(rt.rule,y??{},x??void 0),matchers:tn}),i.jsx("span",{className:"max-w-[160px] truncate",children:rt.label})]}),i.jsx("div",{className:"flex-1"}),ut&&i.jsxs(kt,{children:[i.jsx(Et,{asChild:!0,children:i.jsx("span",{className:"shrink-0 cursor-help",children:i.jsx(zn,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),i.jsx(Rt,{side:"bottom",className:"max-w-[260px]",children:f("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),xr&&i.jsx(Bn,{onClick:()=>xn()})]}),ut&&i.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:f("sectionsEditor.sectionsEditor.globalSectionBanner")})]}):i.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[i.jsx("div",{className:"flex-1 min-w-0",children:i.jsx(Or,{pageKey:E,initialName:je.name,initialPath:je.path,onFieldChange:Xs,variant:"header"})}),i.jsxs(kt,{children:[i.jsx(Et,{asChild:!0,children:i.jsx(_t,{type:"button",variant:"ghost",size:"icon-sm","aria-label":f("sectionsEditor.sectionsEditor.editSeo"),className:"shrink-0",onClick:()=>an(!0),children:i.jsx(Gr,{size:14})})}),i.jsx(Rt,{side:"bottom",children:f("sectionsEditor.sectionsEditor.editSeo")})]}),i.jsxs(kt,{children:[i.jsx(Et,{asChild:!0,children:i.jsx(_t,{type:"button",variant:"ghost",size:"icon-sm","aria-label":f("sectionsEditor.sectionsEditor.viewJson"),className:"shrink-0",onClick:()=>z&&E?z():dt(!0),children:i.jsx(Ur,{size:14})})}),i.jsx(Rt,{side:"bottom",children:f("sectionsEditor.sectionsEditor.viewJson")})]}),i.jsx(Bn,{onClick:yn})]}),Ii=i.jsxs(i.Fragment,{children:[ht&&E&&i.jsx(Lr,{listKey:E,variants:De,activeIndex:we,decofile:y??{},meta:x,matchers:tn,onSelect:is,onReorder:jr,onRename:Ee,onDuplicate:_r,onDelete:wr,onAdd:yn}),ht&&_e!==null&&i.jsx($r,{className:"mt-3",children:i.jsx("div",{className:ae("space-y-3",Qt&&"pointer-events-none opacity-50"),children:i.jsx(us,{currentRt:_e,currentLabel:wn(rt?.rule,y??{},wt,x??void 0),currentGlobalKey:Bt(rt?.rule,y??{},x??void 0)??void 0,matchers:tn,globals:ns,onSelect:ir,onSelectGlobal:lr,schema:rr,formValue:Te,onChange:ar,formKey:`${we}:${_e??""}`,formWrapperClassName:"space-y-3",meta:x??void 0,decofile:y,onSaveReferencedBlock:un,sandbox:hn})})})]}),Vr=i.jsxs(i.Fragment,{children:[i.jsx(ga,{listKey:`${E??""}:${b??""}`,variants:Nt.map((t,r)=>({index:r,label:t.label})),selectedIndex:Vn,onSelect:er,onRename:Ve,onDuplicate:mi,onDelete:fi,onRemoveAll:tr,onReorder:pi,onAdd:()=>xn()}),i.jsx($r,{children:i.jsx(us,{currentRt:Jt??"",currentLabel:wn(nn?.rule,y??{},wt,x??void 0),currentGlobalKey:Bt(nn?.rule,y??{},x??void 0)??void 0,matchers:tn,globals:ns,onSelect:gi,onSelectGlobal:xi,schema:Si,formValue:Mo,onChange:vi,formKey:`${b??"none"}:${Vn}:${Jt??""}`,formWrapperClassName:"pt-1",meta:x??void 0,decofile:y,onSaveReferencedBlock:un,sandbox:hn})})]}),Mr=i.jsx("div",{className:ae(D?"px-2":"p-2 pt-3"),children:i.jsx(Xl,{listKey:`${E??""}-${we}`,rawSections:U,sections:Pe,meta:x,decofile:y,selectedIndex:b,onSelect:si,onReorder:ri,onDelete:oi,onDuplicate:ii,onMakeReusable:He,onToggleHidden:ai,onToggleLazy:he?li:void 0,onAddVariant:xn,onDetach:ci,onAddSection:()=>Fe(!0),canAddSection:sr})}),Bi=i.jsxs("div",{className:"min-w-0 max-w-full space-y-4 overflow-x-hidden px-3",children:[E&&je&&i.jsx(Or,{pageKey:E,initialName:je.name,initialPath:je.path,onFieldChange:Xs}),mn&&E?i.jsx(so,{rawSeo:Cn,innerSeo:Jn,defaultResolveType:$s,seoSchema:zs,activeResolveType:Nn,seoTypeOptions:Ls,formResetKey:Ms,siteDefaultSeo:Hs,onBreadcrumbChange:Lt,onPersistRaw:Ar,onInnerChange:Rr,onClearForm:Cr,onBumpFormKey:Nr,asyncRenderAvailable:he}):i.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:f("sectionsEditor.sectionsEditor.seoSchemaNotFound")})]}),Ki=i.jsx(rn,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:i.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:i.jsx("div",{className:"mx-auto max-w-2xl",children:mn&&E?i.jsx(so,{rawSeo:Cn,innerSeo:Jn,defaultResolveType:$s,seoSchema:zs,activeResolveType:Nn,seoTypeOptions:Ls,formResetKey:Ms,siteDefaultSeo:Hs,onBreadcrumbChange:Lt,onPersistRaw:Ar,onInnerChange:Rr,onClearForm:Cr,onBumpFormKey:Nr,asyncRenderAvailable:he}):i.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:f("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"),Fi=i.jsxs(rn,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[ht&&E&&i.jsx(Lr,{listKey:E,variants:De,activeIndex:we,decofile:y??{},meta:x,matchers:tn,onSelect:is,onReorder:jr,onRename:Ee,onDuplicate:_r,onDelete:wr,onAdd:yn}),ht&&_e!==null&&i.jsxs("div",{className:ae("px-3 border-b",Me?"pt-3 pb-5 space-y-3":"py-2"),children:[i.jsxs("button",{type:"button",onClick:()=>yt(t=>!t),className:"flex w-full items-center justify-between gap-2 text-left cursor-pointer rounded-[var(--studio-control-radius,var(--radius-sm))] py-0.5 hover:bg-accent","aria-expanded":Me,children:[i.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:f("sectionsEditor.sectionsEditor.variantRule")}),Me?i.jsx(ka,{className:"size-3.5 shrink-0 text-muted-foreground"}):i.jsx(Ea,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),Me&&i.jsx("div",{className:ae("space-y-3",Qt&&"pointer-events-none opacity-50"),children:i.jsx(us,{currentRt:_e,currentLabel:wn(rt?.rule,y??{},wt,x??void 0),currentGlobalKey:Bt(rt?.rule,y??{},x??void 0)??void 0,matchers:tn,globals:ns,onSelect:ir,onSelectGlobal:lr,schema:rr,formValue:Te,onChange:ar,formKey:`${we}:${_e??""}`,formWrapperClassName:"space-y-3",meta:x??void 0,decofile:y,onSaveReferencedBlock:un,sandbox:hn})})]}),Mr]},"editor-section-list");return i.jsx(va,{children:i.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[!D&&ls&&i.jsx("div",{className:"flex min-w-0 shrink-0 items-center gap-2 px-3 py-2",children:ls}),(D||Dn.length>1)&&i.jsx(xa,{crumbs:Dn,onSelect:as,onSelectRoot:()=>{cn.flush(),$?$():as(0)}}),i.jsx("div",{className:"shrink-0",children:D?i.jsxs("div",{className:ae("flex items-center gap-2 border-b px-3 py-2.5",ut&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[D&&ls,ut&&i.jsxs(kt,{children:[i.jsx(Et,{asChild:!0,children:i.jsx("span",{className:"shrink-0 cursor-help",children:i.jsx(zn,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),i.jsx(Rt,{side:"bottom",className:"max-w-[260px]",children:f("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),i.jsxs("div",{className:"flex min-w-0 flex-1 flex-col leading-tight",children:[i.jsx("span",{className:"truncate text-sm font-semibold",children:Ei}),br&&i.jsx("span",{className:"truncate text-xs text-muted-foreground",children:br})]}),os&&ht&&rt&&i.jsx(zr,{variants:De,activeIndex:we,onSelect:is,onManage:Mi,onRemoveAll:Ai}),_i&&i.jsx(zr,{variants:Nt,activeIndex:Vn,onSelect:er,onManage:Di,onRemoveAll:tr}),os&&!ht&&i.jsx(Bn,{onClick:yn}),wi&&i.jsx(Bn,{onClick:()=>xn()}),i.jsx(ya,{}),os&&i.jsxs(i.Fragment,{children:[i.jsxs(kt,{children:[i.jsx(Et,{asChild:!0,children:i.jsx(_t,{type:"button",variant:"outline",size:"icon-sm","aria-label":f("sectionsEditor.sectionsEditor.editSeo"),className:"shrink-0",onClick:Vi,children:i.jsx(Gr,{size:14})})}),i.jsx(Rt,{side:"bottom",children:f("sectionsEditor.sectionsEditor.editSeo")})]}),!z&&i.jsxs(kt,{children:[i.jsx(Et,{asChild:!0,children:i.jsx(_t,{type:"button",variant:"outline",size:"icon-sm","aria-label":f("sectionsEditor.sectionsEditor.viewJson"),className:"shrink-0",onClick:()=>dt(!0),children:i.jsx(Ur,{size:14})})}),i.jsx(Rt,{side:"bottom",children:f("sectionsEditor.sectionsEditor.viewJson")})]})]})]}):Pi}),lt&&i.jsx(xc,{open:!0,fields:lc(lt.plan,lt.target.schema),choices:lt.choices,changedAgain:lt.changedAgain,author:$o,fresh:lt.fresh,onChoose:(t,r)=>ni({...lt.choices,[t]:r}),onApply:ti},Uc(lt.formBase)),Ot?i.jsx(Hr,{onAdd:()=>xn(),children:Vr},"editor-section-variants"):Vt?i.jsxs(rn,{viewportRef:Ke,onBlur:Gs,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[!D&&Tt&&Nt.length>0&&q.length===0&&Vr,i.jsx(Wr,{activeSchema:Tn,formValue:xe,formResetKey:Ye,onFormChange:Qs,onBreadcrumbChange:O,breadcrumbPath:q,emptyMessage:f("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:x,decofile:y,onSaveReferencedBlock:un,sandbox:hn,previewBaseUrl:ee,onRequestAddSection:Zs,onVariantMatcherOp:ie?Ti:void 0})]},"editor-section-form"):ie?i.jsx(rn,{viewportRef:Ke,onBlur:Gs,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:i.jsx(Wr,{activeSchema:Tn,formValue:xe,formResetKey:Ye,onFormChange:Qs,onBreadcrumbChange:O,breadcrumbPath:q,emptyMessage:f("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:x,decofile:y,onSaveReferencedBlock:un,sandbox:hn,previewBaseUrl:ee,onRequestAddSection:Zs})},"editor-global-block"):qe?D?i.jsx(rn,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:i.jsx("div",{className:"p-3",children:Bi})},"editor-seo"):Ki:et?i.jsx(Hr,{onAdd:yn,children:Ii},"editor-variants"):D?i.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[i.jsx(rn,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:i.jsx("div",{className:"py-2",children:Mr})}),i.jsx("div",{className:"shrink-0 border-t p-2",children:i.jsx(js,{canAddSection:sr,onAddSection:()=>Fe(!0)})})]},"editor-section-list"):Fi,i.jsx(Sa,{open:ke!==null,onOpenChange:t=>{t||He(null)},defaultBlockId:ke!==null?Fn(Pe[ke]?.label??""):"",isPending:G.isPending,onSubmit:hi}),ve&&i.jsx(Rl,{open:Ze,onOpenChange:t=>{Fe(t),t||(ne.current=null)},meta:x,decofile:y,previewBaseUrl:ee,onSelect:di}),re&&E&&y&&i.jsx(Oa,{open:re,onOpenChange:dt,pageKey:E,decofile:y}),We!==null&&i.jsx(qr,{open:!0,initialName:Gt(De[We]?.rule,y??{},x??void 0)?wn(De[We]?.rule,y??{},wt,x??void 0):"",autoLabel:wt(fs(De[We]?.rule,y??{},x??void 0)),isPending:Qt,onSubmit:async t=>{await Ci(We,t)},onOpenChange:t=>{!t&&!Qt&&Ee(null)}}),Ie!==null&&i.jsx(qr,{open:!0,initialName:Gt(Nt[Ie]?.rule,y??{},x??void 0)?wn(Nt[Ie]?.rule,y??{},wt,x??void 0):"",autoLabel:wt(fs(Nt[Ie]?.rule,y??{},x??void 0)),isPending:Qt,onSubmit:async t=>{await Ni(Ie,t)},onOpenChange:t=>{!t&&!Qt&&Ve(null)}})]})})}export{em as SectionsEditor};