decocms 4.578.1 → 4.579.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 (409) hide show
  1. package/dist/client/assets/{AlertCircle-BttmH_EW.js → AlertCircle-zr0wX6rF.js} +1 -1
  2. package/dist/client/assets/{AreaChart-BeQ7O-oz.js → AreaChart-B2N9Bcti.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-C_GHEWeK.js → ArrowLeft-Bl_oOK1R.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-51wIoVbi.js → ArrowUp-elivCbuw.js} +1 -1
  5. package/dist/client/assets/{BookOpen01-CDYle7oQ.js → BookOpen01-CQcU8DEw.js} +1 -1
  6. package/dist/client/assets/{CartesianChart-Ydd3fzeG.js → CartesianChart-GQIn_cdf.js} +1 -1
  7. package/dist/client/assets/{CategoricalChart-DeS4pERs.js → CategoricalChart-CuZXhd65.js} +1 -1
  8. package/dist/client/assets/{CheckCircle-C3-mSikS.js → CheckCircle-BQ_BsFXT.js} +1 -1
  9. package/dist/client/assets/{ChevronSelectorVertical-B417CqKz.js → ChevronSelectorVertical-CWcLLogC.js} +1 -1
  10. package/dist/client/assets/{ChevronUp-EmQwLtzg.js → ChevronUp-DKklQ3bJ.js} +1 -1
  11. package/dist/client/assets/{CreditCard01-DANJ2Q0i.js → CreditCard01-5LLU-cS_.js} +1 -1
  12. package/dist/client/assets/{Globe04-Cuhejf9G.js → Globe04-C_iZve3L.js} +1 -1
  13. package/dist/client/assets/{Key01-qpabI11H.js → Key01-D0p4-oSK.js} +1 -1
  14. package/dist/client/assets/{LinkBroken01-CrTBWjs0.js → LinkBroken01-BTepcmNH.js} +1 -1
  15. package/dist/client/assets/{Minus-CzyQFk6M.js → Minus-DWgslVyP.js} +1 -1
  16. package/dist/client/assets/{Monitor01-CuxWk6vM.js → Monitor01-B2hjJJ-O.js} +1 -1
  17. package/dist/client/assets/{Play-s__3_cku.js → Play-DuBKbsmQ.js} +1 -1
  18. package/dist/client/assets/{Plus-niUoy_uM.js → Plus-CRtXbDBy.js} +1 -1
  19. package/dist/client/assets/{ReferenceLine-D7fZO7Od.js → ReferenceLine-BTwFdzkB.js} +1 -1
  20. package/dist/client/assets/{SearchMd-DcWhidrm.js → SearchMd-DDfy6PV0.js} +1 -1
  21. package/dist/client/assets/{ShoppingBag01-CiAvRXvs.js → ShoppingBag01-onaGPnUG.js} +1 -1
  22. package/dist/client/assets/{Sun-CB2w_c2y.js → Sun-CEK9L4UW.js} +1 -1
  23. package/dist/client/assets/{SwitchHorizontal01-D4s0wqq6.js → SwitchHorizontal01-DzexFd3R.js} +1 -1
  24. package/dist/client/assets/{Tool01-DRAEzq3d.js → Tool01-B0TI67n-.js} +1 -1
  25. package/dist/client/assets/{Tooltip-CPqx6foD.js → Tooltip-2DMIJ5gg.js} +1 -1
  26. package/dist/client/assets/{Trash01-B0DFZIg9.js → Trash01-1vS11V6D.js} +1 -1
  27. package/dist/client/assets/{Upload01-CF32qbWU.js → Upload01-B5OG3xe6.js} +1 -1
  28. package/dist/client/assets/{UserSquare-C01-Jxv6.js → UserSquare-BAJzbhuU.js} +1 -1
  29. package/dist/client/assets/{Users01-BnjH2fbf.js → Users01-DaLahyDL.js} +1 -1
  30. package/dist/client/assets/{XClose-CznGRv9E.js → XClose-RigEwdbR.js} +1 -1
  31. package/dist/client/assets/{Zap-DRZwAN9E.js → Zap-D0gg60Xv.js} +1 -1
  32. package/dist/client/assets/{access-gate-DKCp0oSn.js → access-gate-DpTCyI4G.js} +1 -1
  33. package/dist/client/assets/{add-connection-dialog-DNldeOcj.js → add-connection-dialog-BFjNmoUE.js} +1 -1
  34. package/dist/client/assets/agent-app-Bpqc5TKb.js +1 -0
  35. package/dist/client/assets/{agent-assets-DZ2i3aIp.js → agent-assets-BZW4eVF1.js} +1 -1
  36. package/dist/client/assets/{agent-automation-DM5au--P.js → agent-automation-DeQnvGwK.js} +3 -3
  37. package/dist/client/assets/{agent-automations-BgMKlEKo.js → agent-automations-EY7zcVw5.js} +1 -1
  38. package/dist/client/assets/{agent-blog-DRawqCX5.js → agent-blog-DB-VUOMq.js} +2 -2
  39. package/dist/client/assets/{agent-blog-post-4Yzlewwc.js → agent-blog-post-C7YY31uh.js} +2 -2
  40. package/dist/client/assets/{agent-calendar-C9NotvdT.js → agent-calendar-B8bUAVQB.js} +1 -1
  41. package/dist/client/assets/{agent-capabilities-jT-VtqUC.js → agent-capabilities-DIA4hYXj.js} +1 -1
  42. package/dist/client/assets/{agent-connect-sources-CrnDKgE0.js → agent-connect-sources-D-xJzGQW.js} +1 -1
  43. package/dist/client/assets/agent-deck-Cf_ErplN.js +1 -0
  44. package/dist/client/assets/{agent-e2e-mvh6F0Be.js → agent-e2e-g0nOI_x-.js} +1 -1
  45. package/dist/client/assets/agent-experiments-B-8UgQO-.js +1 -0
  46. package/dist/client/assets/agent-file-YPpATd9K.js +1 -0
  47. package/dist/client/assets/{agent-hosting-BC9PAjNJ.js → agent-hosting-CveWqfNK.js} +1 -1
  48. package/dist/client/assets/{agent-icon-Clk7SRdQ.js → agent-icon-mmszwibp.js} +1 -1
  49. package/dist/client/assets/agent-library-Dlt2bvFQ.js +1 -0
  50. package/dist/client/assets/agent-library-file-B139Zw2D.js +1 -0
  51. package/dist/client/assets/agent-overview-_bAVR0wp.js +1 -0
  52. package/dist/client/assets/{agent-releases-BV2KNppz.js → agent-releases-CJfKJEbr.js} +1 -1
  53. package/dist/client/assets/agent-settings-DOFZ9TlT.js +1 -0
  54. package/dist/client/assets/{agent-site-editor-Bow7ioXm.js → agent-site-editor-BGtiRMtL.js} +1 -1
  55. package/dist/client/assets/agent-site-editor-code-Bk7jz-8p.js +2 -0
  56. package/dist/client/assets/agent-site-editor-content-CNbkww_K.js +1 -0
  57. package/dist/client/assets/agent-site-editor-preview-BjbJovHJ.js +1 -0
  58. package/dist/client/assets/agent-view--Q6sRyG-.js +1 -0
  59. package/dist/client/assets/{agent-view-guard-D7RNQw3n.js → agent-view-guard-D3OOa7MK.js} +1 -1
  60. package/dist/client/assets/{ai-providers-C10gOn1c.js → ai-providers-B59fTAqi.js} +1 -1
  61. package/dist/client/assets/{alert-C40ffdTq.js → alert-BIXfxm9q.js} +1 -1
  62. package/dist/client/assets/{analytics-sections-C8V0d1eU.js → analytics-sections-BbaWW2MU.js} +1 -1
  63. package/dist/client/assets/{api-keys-Cr8tyjtC.js → api-keys-B-fVnLBR.js} +1 -1
  64. package/dist/client/assets/api-keys-B7T782Eb.js +1 -0
  65. package/dist/client/assets/{app-editor-ByystBM6.js → app-editor-DqTsVzBi.js} +1 -1
  66. package/dist/client/assets/{asset-utils-D4HWdZ_7.js → asset-utils-drPwMw_i.js} +1 -1
  67. package/dist/client/assets/{auth-D_w34xQ-.js → auth-Dpio94p4.js} +1 -1
  68. package/dist/client/assets/{auth-catchall-gVavleR3.js → auth-catchall-CFF3U0RI.js} +1 -1
  69. package/dist/client/assets/{auth-entry-Bhy_H_Rg.js → auth-entry-LKpobRVJ.js} +1 -1
  70. package/dist/client/assets/{auth-split-layout-Dlt5Y9Yo.js → auth-split-layout-CAxtAhO0.js} +1 -1
  71. package/dist/client/assets/{authenticate-and-persist-oauth-jwCoKgM4.js → authenticate-and-persist-oauth-uFSi1ddd.js} +1 -1
  72. package/dist/client/assets/{automation-list-row-CJf3Hfci.js → automation-list-row-i2iBmqhL.js} +1 -1
  73. package/dist/client/assets/{automation-runs-DFAxj_hn.js → automation-runs-M9kcTzv1.js} +1 -1
  74. package/dist/client/assets/{automations-Bnx6noDz.js → automations-DVuSVNP2.js} +1 -1
  75. package/dist/client/assets/{badge-Bec4Z79_.js → badge-DQH-sPh3.js} +1 -1
  76. package/dist/client/assets/{block-document-3uCBlgZI.js → block-document-CLjK5rGg.js} +3 -3
  77. package/dist/client/assets/{blocks-preview-workspace-context-CFT39hTK.js → blocks-preview-workspace-context-D5d1lCvq.js} +1 -1
  78. package/dist/client/assets/{blocks-tab-states-DgLrbRiD.js → blocks-tab-states-BWSDyN-L.js} +1 -1
  79. package/dist/client/assets/{blog-preview-url-DiFMPgbV.js → blog-preview-url-DrIHzDC1.js} +1 -1
  80. package/dist/client/assets/{blog-schema-BS2v2MSK.js → blog-schema-Dud6I1hB.js} +1 -1
  81. package/dist/client/assets/{blog-source-gate-CwZXRzP6.js → blog-source-gate-DgI6bq3U.js} +1 -1
  82. package/dist/client/assets/{blog-view-gate-hTnrbFjq.js → blog-view-gate-B2-t_Jmu.js} +1 -1
  83. package/dist/client/assets/{buckets-DRTwHO8z.js → buckets-BqsIwhzU.js} +1 -1
  84. package/dist/client/assets/{build-improve-prompt-doc-DDEce0zc.js → build-improve-prompt-doc-CxH_m3ql.js} +1 -1
  85. package/dist/client/assets/{calendar-BHxqLYB2.js → calendar-B5V9ahxZ.js} +1 -1
  86. package/dist/client/assets/{capability-load-error-Cg21B6QM.js → capability-load-error-Cy1nsQed.js} +1 -1
  87. package/dist/client/assets/{category-editor-DrwVl4Sl.js → category-editor-uRLzcWX7.js} +1 -1
  88. package/dist/client/assets/{category-tree-CgP369CP.js → category-tree-DSMV8uvW.js} +1 -1
  89. package/dist/client/assets/{chart-Cz95W4qb.js → chart-CxiHJ7Yx.js} +1 -1
  90. package/dist/client/assets/{chat-context-2_7VL2Se.js → chat-context-DdWQJl7N.js} +1 -1
  91. package/dist/client/assets/{chat-draft-BH8Etp5p.js → chat-draft-CHOcPtOp.js} +1 -1
  92. package/dist/client/assets/{checkbox-DcSwaw9N.js → checkbox-CVml-3os.js} +1 -1
  93. package/dist/client/assets/{choose-editor-C4LsHc8P.js → choose-editor-CJgNaynn.js} +1 -1
  94. package/dist/client/assets/{cli-auth-success-Dg6G0C4J.js → cli-auth-success-BSNEAo2d.js} +1 -1
  95. package/dist/client/assets/{client-icons-ohal0kIt.js → client-icons-Cvv9MyID.js} +1 -1
  96. package/dist/client/assets/{cms-settings-editor-_WpAeDPl.js → cms-settings-editor-DOHwi8qO.js} +1 -1
  97. package/dist/client/assets/{cms-store-drafts-DXYwm7p9.js → cms-store-drafts-Co6hs1Gm.js} +1 -1
  98. package/dist/client/assets/{collapsible-C0DaEqwH.js → collapsible-ZjNF64KD.js} +1 -1
  99. package/dist/client/assets/{collection-detail-DqPGF8Zk.js → collection-detail-CFrXFPV3.js} +1 -1
  100. package/dist/client/assets/{collection-display-button-BYPP-sV7.js → collection-display-button-D7AaZ59Q.js} +1 -1
  101. package/dist/client/assets/{collection-search-n_O3WZGN.js → collection-search-DrspIufR.js} +1 -1
  102. package/dist/client/assets/{collection-table-wrapper-nXT01FCH.js → collection-table-wrapper-BTpP_R57.js} +1 -1
  103. package/dist/client/assets/{collection-tabs-Bj6L8MsE.js → collection-tabs-2wU6BwIq.js} +1 -1
  104. package/dist/client/assets/{combobox-CgNU2tMt.js → combobox-BdUyw8jq.js} +1 -1
  105. package/dist/client/assets/{command-BtcP4IBQ.js → command-ByEG2lpR.js} +1 -1
  106. package/dist/client/assets/{companion-mcps-section-CPNG8Vx3.js → companion-mcps-section-BpRA6d5a.js} +1 -1
  107. package/dist/client/assets/{config-C9iB0RU8.js → config-ViHsIgIA.js} +1 -1
  108. package/dist/client/assets/{connect-D3tjGmEi.js → connect-Aly-0ASI.js} +3 -3
  109. package/dist/client/assets/{connect-layout-eEBnzEV_.js → connect-layout-CbUmd0fU.js} +1 -1
  110. package/dist/client/assets/{connect-source-dialog-_DXcUm0Y.js → connect-source-dialog-BI_iSjsz.js} +1 -1
  111. package/dist/client/assets/{connection-BKTcYZml.js → connection-Bmlh47OD.js} +1 -1
  112. package/dist/client/assets/{connection-card-COLQiOkG.js → connection-card-IGbEiasZ.js} +1 -1
  113. package/dist/client/assets/{connection-detail-DzBabz1S.js → connection-detail-D7WtScT_.js} +1 -1
  114. package/dist/client/assets/{connection-form-helpers-9_MGiUYQ.js → connection-form-helpers-CM8A7qxi.js} +1 -1
  115. package/dist/client/assets/{connection-slug-DXuQYZmG.js → connection-slug-rgdaPyVS.js} +1 -1
  116. package/dist/client/assets/{connections-CLDKZJVw.js → connections-8AsK7z6U.js} +1 -1
  117. package/dist/client/assets/content-tab-6WPOlhG9.js +19 -0
  118. package/dist/client/assets/{context-f8fDVtNj.js → context-Dgx2LMji.js} +1 -1
  119. package/dist/client/assets/{context-menu-Dsw1Ex34.js → context-menu-h4YtCxvM.js} +1 -1
  120. package/dist/client/assets/{context-shell-DpQEYO74.js → context-shell-BbE88Tyf.js} +3 -3
  121. package/dist/client/assets/{core.esm-rweyZtAP.js → core.esm-BzH_Nko5.js} +1 -1
  122. package/dist/client/assets/{create-organization-dialog-DUk4B45U.js → create-organization-dialog-CnHhjS0p.js} +1 -1
  123. package/dist/client/assets/{delete-copy-DZE-3KQB.js → delete-copy-pOul_Q0z.js} +1 -1
  124. package/dist/client/assets/{device-hint-CQX1G1PE.js → device-hint-BQG6K9Hf.js} +1 -1
  125. package/dist/client/assets/{discover-uwdyIAIK.js → discover-kJdAd045.js} +1 -1
  126. package/dist/client/assets/{domain-settings-Ba1MIa2U.js → domain-settings-Bs--YGSm.js} +1 -1
  127. package/dist/client/assets/{drawer-XRqK1CkH.js → drawer-D7zE3h2P.js} +1 -1
  128. package/dist/client/assets/{editor-CBAsUN_D.js → editor-B0kphvbT.js} +1 -1
  129. package/dist/client/assets/{editor-classes-DJG-Wj7v.js → editor-classes-SfZ5uUGn.js} +1 -1
  130. package/dist/client/assets/{empty-message-DgtU67aA.js → empty-message-DkX3rdbv.js} +2 -2
  131. package/dist/client/assets/{empty-state-BVQ9VzOU.js → empty-state-DKuRC7c7.js} +1 -1
  132. package/dist/client/assets/{empty-state-CfzBgpuZ.js → empty-state-Deh8mRpo.js} +1 -1
  133. package/dist/client/assets/{experiments-tab-choice-DuLgqqx_.js → experiments-tab-choice-BBShWrmo.js} +1 -1
  134. package/dist/client/assets/{extract-connection-data-EIjdoFBg.js → extract-connection-data-BklHKw1M.js} +1 -1
  135. package/dist/client/assets/{feature-gate-Bsh6-M6w.js → feature-gate-BlKXdO61.js} +1 -1
  136. package/dist/client/assets/{feature-paywall-DGSKlw9o.js → feature-paywall-6uSnqIFO.js} +1 -1
  137. package/dist/client/assets/{file-explorer-DnoVcCFG.js → file-explorer-CvkaKFET.js} +1 -1
  138. package/dist/client/assets/{file-preview-D_0IU7PB.js → file-preview-B39yfF4F.js} +1 -1
  139. package/dist/client/assets/{file-share-button-B1Fk0nBQ.js → file-share-button-C2MhJgEK.js} +2 -2
  140. package/dist/client/assets/{file-type-icon-DED9IxiZ.js → file-type-icon-DVZfJOKC.js} +1 -1
  141. package/dist/client/assets/{folder-icon-Detn5ugB.js → folder-icon-Dtva_-KR.js} +1 -1
  142. package/dist/client/assets/{form-CxSSvRAm.js → form-DnzJbdNw.js} +1 -1
  143. package/dist/client/assets/{frame-navigation-MwhFGymR.js → frame-navigation-mE1IyLxt.js} +1 -1
  144. package/dist/client/assets/{general-DEU4SDIa.js → general-DUr6-t_c.js} +1 -1
  145. package/dist/client/assets/{github-icon-N9MEN1MZ.js → github-icon-Cd5dQEKt.js} +1 -1
  146. package/dist/client/assets/{held-block-view-D_87TUke.js → held-block-view-HcOuBva8.js} +1 -1
  147. package/dist/client/assets/{home-6nU3ZamX.js → home-BcJ5qMwh.js} +1 -1
  148. package/dist/client/assets/{home-overview-C3Zj8fkv.js → home-overview-BEZlL4ib.js} +1 -1
  149. package/dist/client/assets/{hosted-reconcile-f9zR8ohF.js → hosted-reconcile-DSYVUxqr.js} +1 -1
  150. package/dist/client/assets/{icon-button-DUjjoGv_.js → icon-button-CR6dftyf.js} +1 -1
  151. package/dist/client/assets/{index-Rlc6g0eH.js → index-AyKz2l6b.js} +1 -1
  152. package/dist/client/assets/{index-DIeS-zcI.js → index-B1RqPkvO.js} +1 -1
  153. package/dist/client/assets/{index-CpQGG70q.js → index-BpJqVb3l.js} +1 -1
  154. package/dist/client/assets/{index-BhtDSp6y.js → index-C5bUqIA_.js} +6 -6
  155. package/dist/client/assets/{index-B3ab16ZV.js → index-CBlU77jJ.js} +1 -1
  156. package/dist/client/assets/{index-BRMdzLQF.js → index-CDiUvHd3.js} +1 -1
  157. package/dist/client/assets/{index-1TeON1d1.js → index-CU2-l5Z1.js} +1 -1
  158. package/dist/client/assets/{index-DkcRNYY4.js → index-D8HDDDUz.js} +9 -9
  159. package/dist/client/assets/{index-BX-xETn9.js → index-DGscs1DX.js} +1 -1
  160. package/dist/client/assets/{index-D2WZClU1.js → index-DOkOhXW8.js} +1 -1
  161. package/dist/client/assets/{index-DK-8s7Az.js → index-DaVJsKZ7.js} +1 -1
  162. package/dist/client/assets/{index-DyJk9i7m.js → index-De51YIVR.js} +1 -1
  163. package/dist/client/assets/{index-CAJpA_Gg.js → index-PstEiCy7.js} +1 -1
  164. package/dist/client/assets/{index-DoI9gwtY.js → index-b6QIszGC.js} +1 -1
  165. package/dist/client/assets/{index-DKvQA4se.js → index-gXWGEUwJ.js} +1 -1
  166. package/dist/client/assets/{index-Dn1sSLiR.js → index-odrPj5u2.js} +3 -3
  167. package/dist/client/assets/{index-redirect-xsDNsYua.js → index-redirect-Dj3mFirc.js} +1 -1
  168. package/dist/client/assets/{index-Dsc22z2E.js → index-uoYFNgrb.js} +1 -1
  169. package/dist/client/assets/{infiniteQueryObserver-Bitq8wqo.js → infiniteQueryObserver-C3DB8A3F.js} +1 -1
  170. package/dist/client/assets/{infra-billing-Bq7lICUo.js → infra-billing-Dv0Y4nq2.js} +1 -1
  171. package/dist/client/assets/{input-Z8vNy904.js → input-B9-LxoR8.js} +1 -1
  172. package/dist/client/assets/{input-cZnIeAU-.js → input-DCkWhN8u.js} +3 -3
  173. package/dist/client/assets/{integration-icon-D_f17Dc0.js → integration-icon-D10Wu8in.js} +1 -1
  174. package/dist/client/assets/item-actions-ChF-Wajz.js +1 -0
  175. package/dist/client/assets/{jira-icon-B_i3CvQt.js → jira-icon-BTl7-hxa.js} +1 -1
  176. package/dist/client/assets/{label-Dn3Jp5Ws.js → label-C6Eod_61.js} +1 -1
  177. package/dist/client/assets/{layout-Uu1mBCHM.js → layout-KD23pdsL.js} +1 -1
  178. package/dist/client/assets/{legacy-admin-welcome-dialog-BZv5i7Tg.js → legacy-admin-welcome-dialog-DY8Bixis.js} +1 -1
  179. package/dist/client/assets/{legacy-agents-deep-DP_-DfVk.js → legacy-agents-deep-DqEHBKxS.js} +1 -1
  180. package/dist/client/assets/{legacy-main-redirect-BUWLccLo.js → legacy-main-redirect-xIr91LSW.js} +1 -1
  181. package/dist/client/assets/library-1Y_LcuJb.js +1 -0
  182. package/dist/client/assets/{library-tab-BFNRWK_p.js → library-tab-C-gyz3ep.js} +1 -1
  183. package/dist/client/assets/{login-bQ_A0WZT.js → login-LU1xbL-m.js} +1 -1
  184. package/dist/client/assets/{markdown-b_kJoSST.js → markdown-xlCS0Umn.js} +1 -1
  185. package/dist/client/assets/{mcp-app-renderer-DnzeUjpd.js → mcp-app-renderer-P6d9M0PC.js} +1 -1
  186. package/dist/client/assets/{mcp-oauth-DFR30m4O.js → mcp-oauth-B7XWBzzN.js} +1 -1
  187. package/dist/client/assets/{mcp-oauth-DtWQzykq.js → mcp-oauth-B_8eWy31.js} +1 -1
  188. package/dist/client/assets/{members-D0Lz_KgP.js → members-TkhB8ase.js} +1 -1
  189. package/dist/client/assets/{memory-BoBRHeM6.js → memory-0HN4vn-X.js} +1 -1
  190. package/dist/client/assets/{mock-board-DHgHCl4G.js → mock-board-DEylkukw.js} +3 -3
  191. package/dist/client/assets/{monaco-editor-UZynMXqx.js → monaco-editor-D37e6fWN.js} +1 -1
  192. package/dist/client/assets/{monitoring-DxDbj9fw.js → monitoring-CWDPvUi9.js} +1 -1
  193. package/dist/client/assets/{monitoring-stats-row-Cuheh0jS.js → monitoring-stats-row-BaRGE1me.js} +1 -1
  194. package/dist/client/assets/{multi-select-DME84cUe.js → multi-select-jJMhnt_d.js} +1 -1
  195. package/dist/client/assets/{mustache-y-ZQsp_m.js → mustache-B5ZYo9QF.js} +1 -1
  196. package/dist/client/assets/{named-rule-step-DN_fLt7U.js → named-rule-step-DxjJGQ3W.js} +1 -1
  197. package/dist/client/assets/{named-rule-view-DZEGURWO.js → named-rule-view-UfrOXS5F.js} +1 -1
  198. package/dist/client/assets/{new-project-dialog-woRLqi3-.js → new-project-dialog-Czv5HvtS.js} +1 -1
  199. package/dist/client/assets/{oauth-callback-BgK3JUto.js → oauth-callback-PiEldV4w.js} +1 -1
  200. package/dist/client/assets/{oauth-callback-ai-provider-DIdeF5L_.js → oauth-callback-ai-provider-DUkKBpBm.js} +1 -1
  201. package/dist/client/assets/{oauth-consent-DeoVyPXJ.js → oauth-consent-CKXF9rY9.js} +1 -1
  202. package/dist/client/assets/{onboarding-CrBz7CJY.js → onboarding-ACGqZ934.js} +1 -1
  203. package/dist/client/assets/{openai-conversation-Cv54h2Lp.js → openai-conversation-BrQdLDfo.js} +1 -1
  204. package/dist/client/assets/{optimistic-project-sidebar-views-BZ1sAhod.js → optimistic-project-sidebar-views-wCpU8FHx.js} +1 -1
  205. package/dist/client/assets/{order-monitor-day-HVJjPS8X.js → order-monitor-day-az11vn38.js} +1 -1
  206. package/dist/client/assets/{organization-choice-DiOY09h_.js → organization-choice-B4DvsWTU.js} +1 -1
  207. package/dist/client/assets/{orgs-CDazo1cx.js → orgs-BcVTs2Na.js} +1 -1
  208. package/dist/client/assets/{own-accounts-section-DFgMqqFp.js → own-accounts-section-C9C2gCIB.js} +1 -1
  209. package/dist/client/assets/{pair-BV9OnQjN.js → pair-CBh8Ssld.js} +1 -1
  210. package/dist/client/assets/{parse-sections-DRVKTg0R.js → parse-sections-HRX0mYs4.js} +2 -2
  211. package/dist/client/assets/{plan-Cts1Yk_E.js → plan-D-fnFfEU.js} +1 -1
  212. package/dist/client/assets/{plan-ladder-KbWc-Or1.js → plan-ladder-B-kol46S.js} +1 -1
  213. package/dist/client/assets/{plan-usage-card-CN7VFizA.js → plan-usage-card-C1wYjY71.js} +1 -1
  214. package/dist/client/assets/{popover-DGUQnbhk.js → popover-BvzfBeCD.js} +1 -1
  215. package/dist/client/assets/{post-calendar-CqQDC3t2.js → post-calendar-DGT8MPVI.js} +1 -1
  216. package/dist/client/assets/{post-editor-D5cDZX8g.js → post-editor-CJ6LWCYX.js} +2 -2
  217. package/dist/client/assets/{preview-content-5E4VEVNy.js → preview-content-Dg6p6zYi.js} +1 -1
  218. package/dist/client/assets/{preview-dialog-CW0UxxZH.js → preview-dialog-C6UJFd8t.js} +1 -1
  219. package/dist/client/assets/{preview-panel-X9Db-uFN.js → preview-panel-XviDcPal.js} +1 -1
  220. package/dist/client/assets/{preview-tab-D3OqBk4l.js → preview-tab-Bsa49d5X.js} +3 -3
  221. package/dist/client/assets/{product-picker-dialog-WEdrqBYL.js → product-picker-dialog-YdUbY-7g.js} +1 -1
  222. package/dist/client/assets/{profile-Dr7jNljC.js → profile-CePaZKJY.js} +1 -1
  223. package/dist/client/assets/{project-app-view-BlutJfNT.js → project-app-view-DfiChkFV.js} +1 -1
  224. package/dist/client/assets/{project-apps-I71-E6Qd.js → project-apps-C9_2F9T-.js} +1 -1
  225. package/dist/client/assets/{project-icon-DwgAxTAv.js → project-icon-CaBBGJPF.js} +1 -1
  226. package/dist/client/assets/{project-index-iv5dTkyZ.js → project-index-C7nzWFsU.js} +1 -1
  227. package/dist/client/assets/project-reports-CoqhcCxn.js +1 -0
  228. package/dist/client/assets/project-tasks-Seoutc84.js +1 -0
  229. package/dist/client/assets/{projects-gSmj9ecH.js → projects-CO4WaEwj.js} +1 -1
  230. package/dist/client/assets/{projects-empty-state-CupYJqrY.js → projects-empty-state-C5B5zjIl.js} +1 -1
  231. package/dist/client/assets/{prompts-CBaHiUu4.js → prompts-BjcWFXkv.js} +1 -1
  232. package/dist/client/assets/{record-editor-Dhg3qN0D.js → record-editor-CjT1Sg-6.js} +1 -1
  233. package/dist/client/assets/{redirect-editor-P9JRSoek.js → redirect-editor-OA8-5zJv.js} +1 -1
  234. package/dist/client/assets/{reports-DcvRbz_i.js → reports-BQZNrA6z.js} +1 -1
  235. package/dist/client/assets/reports-CwkGwbxw.js +1 -0
  236. package/dist/client/assets/{reports-onboarding-CNToIJAM.js → reports-onboarding-Bo8neYb7.js} +1 -1
  237. package/dist/client/assets/{reports-tab-BZqA8TQ_.js → reports-tab-DgZa_ici.js} +2 -2
  238. package/dist/client/assets/repositories-BD2JywIJ.js +1 -0
  239. package/dist/client/assets/{repositories-Ccur-dYQ.js → repositories-aSnJEtAN.js} +1 -1
  240. package/dist/client/assets/{repository-binding-BLl1r28B.js → repository-binding-Dv276sdb.js} +1 -1
  241. package/dist/client/assets/{repository-picker-BOvn8tow.js → repository-picker-QBlZoWDu.js} +1 -1
  242. package/dist/client/assets/{require-capability-CbgooziO.js → require-capability-DR0RkcLX.js} +1 -1
  243. package/dist/client/assets/{required-auth-layout-Du4rT7sh.js → required-auth-layout-DQ6ys2Lb.js} +1 -1
  244. package/dist/client/assets/{reset-password-BWHhQAiH.js → reset-password-Cey_yJ7E.js} +1 -1
  245. package/dist/client/assets/{resizable-vWMGfcV5.js → resizable-B8_D-RUQ.js} +1 -1
  246. package/dist/client/assets/{resolve-tab-icon-CyktvCbJ.js → resolve-tab-icon-BR3-CACo.js} +1 -1
  247. package/dist/client/assets/{review-settings-BYvflnLC.js → review-settings-oSfLAO7Q.js} +1 -1
  248. package/dist/client/assets/{role-color-DXKobZxk.js → role-color-BUSBfkmC.js} +1 -1
  249. package/dist/client/assets/{roles-DtM-OJk0.js → roles-CjDfMF0i.js} +1 -1
  250. package/dist/client/assets/{route-C8tElGsM.js → route-8L849BD5.js} +1 -1
  251. package/dist/client/assets/{route-DYywXwGr.js → route-K2NA94TK.js} +1 -1
  252. package/dist/client/assets/route-hkkxUpPa.js +1 -0
  253. package/dist/client/assets/{sandbox-lifecycle-context-CVRjjAk0.js → sandbox-lifecycle-context-D0Fc_zJJ.js} +1 -1
  254. package/dist/client/assets/{save-status-DnvkIbvY.js → save-status-1UoG7f0k.js} +1 -1
  255. package/dist/client/assets/{schema-CAleC_3r.js → schema-CFwkIhKP.js} +1 -1
  256. package/dist/client/assets/{schema-C2C3qx85.js → schema-gPek6tvx.js} +1 -1
  257. package/dist/client/assets/{scroll-area-DMASCzA7.js → scroll-area-BhLv10mq.js} +1 -1
  258. package/dist/client/assets/{search-input-BzsoblR3.js → search-input-CLSXdutD.js} +1 -1
  259. package/dist/client/assets/{search-toggle-C8mpkT93.js → search-toggle-DukKK1PI.js} +1 -1
  260. package/dist/client/assets/{secret-picker-1TYTZlJ-.js → secret-picker-BF4D31uF.js} +1 -1
  261. package/dist/client/assets/{secrets-D8N8c2eG.js → secrets-DZpaifDz.js} +1 -1
  262. package/dist/client/assets/{section-array-field-CBlVxN-e.js → section-array-field-BtcjWtvt.js} +1 -1
  263. package/dist/client/assets/{sections-D5nPXiNR.js → sections-DiXXDwzo.js} +1 -1
  264. package/dist/client/assets/{sections-editor-DDwn5ekg.js → sections-editor-Nvt7HB4y.js} +1 -1
  265. package/dist/client/assets/{select-DVeciAl9.js → select-CpVl3_2f.js} +1 -1
  266. package/dist/client/assets/{select-model-BNTO0fSE.js → select-model-BMlbS-e4.js} +1 -1
  267. package/dist/client/assets/{seo-editor-BZPpMR_G.js → seo-editor-M_gwXcCt.js} +1 -1
  268. package/dist/client/assets/{separator-4lVFkBOm.js → separator-DGA-poR7.js} +1 -1
  269. package/dist/client/assets/settings-tab-BOF9Hfhu.js +1 -0
  270. package/dist/client/assets/{sheet-DgqpeU2r.js → sheet-C6rtTUBz.js} +1 -1
  271. package/dist/client/assets/{shell-layout-Dqg0y9U5.js → shell-layout-DWWwIk_z.js} +1 -1
  272. package/dist/client/assets/{site-draft-actions-BU5wxMfk.js → site-draft-actions-D5Biudjs.js} +1 -1
  273. package/dist/client/assets/{site-draft-view-0GYco8RC.js → site-draft-view-NNy8S2-k.js} +1 -1
  274. package/dist/client/assets/site-editor-Du_VAI4F.js +1 -0
  275. package/dist/client/assets/{site-editor-toast-DHWingRQ.js → site-editor-toast-BEWqoKlP.js} +1 -1
  276. package/dist/client/assets/{skills-QMeBFjVZ.js → skills-zwuWEnTI.js} +1 -1
  277. package/dist/client/assets/{slider-DkvAjMqC.js → slider-CBof_Q_V.js} +1 -1
  278. package/dist/client/assets/{sortable.esm-D1XbpNQK.js → sortable.esm-Dy1h1l2l.js} +1 -1
  279. package/dist/client/assets/{sso-CA2di6VE.js → sso-DA1qOy6T.js} +1 -1
  280. package/dist/client/assets/{suggestion-DKq9tnks.js → suggestion-D56UF_pQ.js} +1 -1
  281. package/dist/client/assets/{super-agent-icon-Des3Gzt2.js → super-agent-icon-CN88o8hG.js} +1 -1
  282. package/dist/client/assets/{switch-D_fyZtAR.js → switch-CG9p29mC.js} +1 -1
  283. package/dist/client/assets/{synced-repos-q-9Pq41U.js → synced-repos-ClnsQNcV.js} +1 -1
  284. package/dist/client/assets/{tab-icon-glyph-CnCjm5vj.js → tab-icon-glyph-1_FRhmF-.js} +1 -1
  285. package/dist/client/assets/{table-B6gmAyVe.js → table--WoW2Lor.js} +1 -1
  286. package/dist/client/assets/{tabs-C3-glM5w.js → tabs-CnNsL319.js} +1 -1
  287. package/dist/client/assets/{task-board-F0C1flaU.js → task-board-DUfmZVQ7.js} +1 -1
  288. package/dist/client/assets/{task-route-CgJ6kEGQ.js → task-route-BZiSHzMD.js} +1 -1
  289. package/dist/client/assets/{task-status-DtZHG42q.js → task-status-DckguLMB.js} +1 -1
  290. package/dist/client/assets/{taskboard-analytics-DhB06IEO.js → taskboard-analytics-EKZ_Hvd3.js} +1 -1
  291. package/dist/client/assets/tasks-B2EqX_zH.js +1 -0
  292. package/dist/client/assets/{tasks-BjEh1sq-.js → tasks-ChO6GiZ2.js} +1 -1
  293. package/dist/client/assets/{textarea-BcNUedZJ.js → textarea-Cgu68q3w.js} +1 -1
  294. package/dist/client/assets/{thread-analytics-CHIWrhgS.js → thread-analytics-D56cWHrl.js} +1 -1
  295. package/dist/client/assets/{thread-intent-BBtcC3eO.js → thread-intent-DFlRKb26.js} +1 -1
  296. package/dist/client/assets/{thread-route-BDEM9uAG.js → thread-route-BRv2L7da.js} +1 -1
  297. package/dist/client/assets/{thread-route-B-8pwMl6.js → thread-route-CCB-rd-1.js} +1 -1
  298. package/dist/client/assets/{thread-sheet-body-XQutdGAn.js → thread-sheet-body-CLb6QMKy.js} +1 -1
  299. package/dist/client/assets/{time-range-picker-DIndNk54.js → time-range-picker-DJQsn3p1.js} +1 -1
  300. package/dist/client/assets/{toggle-group-BJvueItv.js → toggle-group-lGOrFANX.js} +1 -1
  301. package/dist/client/assets/{tool-namespace-8W3F8hsl.js → tool-namespace-cagFCGCV.js} +1 -1
  302. package/dist/client/assets/{tool-set-selector-HD2rc5mb.js → tool-set-selector-B71rNLSq.js} +1 -1
  303. package/dist/client/assets/{toolbar-icon-button-DqwBIL-q.js → toolbar-icon-button-jXG-KQc2.js} +1 -1
  304. package/dist/client/assets/{tooltip-CcU7DhuT.js → tooltip-BZFegydB.js} +1 -1
  305. package/dist/client/assets/{tooltipContext-qk98CIlc.js → tooltipContext-C1F2kuWH.js} +1 -1
  306. package/dist/client/assets/{track-DQBd80xZ.js → track-lfFXhuhn.js} +1 -1
  307. package/dist/client/assets/{types-CBXbXFqf.js → types-FZCQuIv_.js} +1 -1
  308. package/dist/client/assets/{url-slug-D48mGvuH.js → url-slug-B9Zc1vGv.js} +1 -1
  309. package/dist/client/assets/{usage-stats-D6OFaO8E.js → usage-stats-CphPEBVe.js} +1 -1
  310. package/dist/client/assets/{use-ai-providers-BJ7TKB-_.js → use-ai-providers-xj5bugI1.js} +1 -1
  311. package/dist/client/assets/{use-apply-named-rule-BDDeFxUe.js → use-apply-named-rule-BWoo6p5O.js} +1 -1
  312. package/dist/client/assets/use-ask-in-chat-Ckzzwqrc.js +1 -0
  313. package/dist/client/assets/{use-automations-DGdQY13E.js → use-automations-D1alWz_j.js} +1 -1
  314. package/dist/client/assets/{use-autosave-yYU_ezVq.js → use-autosave-iBowYJcP.js} +1 -1
  315. package/dist/client/assets/use-blocks-v8-project-DUspd_UU.js +1 -0
  316. package/dist/client/assets/{use-chat-layout-state-7fLexK-W.js → use-chat-layout-state-DfKn-NxL.js} +1 -1
  317. package/dist/client/assets/{use-cms-publish-actions-Di7RH3ic.js → use-cms-publish-actions-3jMkJE3K.js} +1 -1
  318. package/dist/client/assets/{use-connect-companion-Ddgl8MAG.js → use-connect-companion-C_A5Vxk7.js} +1 -1
  319. package/dist/client/assets/{use-connection-8PrHxvAI.js → use-connection-CU6X3Wkq.js} +1 -1
  320. package/dist/client/assets/{use-content-sync-8KVw9tn9.js → use-content-sync-DmmeRMs-.js} +1 -1
  321. package/dist/client/assets/{use-copy-F5Ataqy3.js → use-copy-Bn5xNYDY.js} +1 -1
  322. package/dist/client/assets/{use-date-fns-locale-D8L_b1Z0.js → use-date-fns-locale-BwLIR0jW.js} +1 -1
  323. package/dist/client/assets/{use-debounced-autosave-D2pTqcG8.js → use-debounced-autosave-CsKCSmG6.js} +1 -1
  324. package/dist/client/assets/{use-debounced-value-CbdraSYQ.js → use-debounced-value-Bd_QEBiw.js} +1 -1
  325. package/dist/client/assets/{use-deco-credits-D5BjRSSa.js → use-deco-credits-C0pODutp.js} +1 -1
  326. package/dist/client/assets/{use-decopilot-events-CoAHF-ln.js → use-decopilot-events-BEba0iFr.js} +1 -1
  327. package/dist/client/assets/{use-delete-block-B_3TZ6oj.js → use-delete-block-C2VDoxSY.js} +1 -1
  328. package/dist/client/assets/{use-delete-connection-BiAYYkr3.js → use-delete-connection-Dmwz6pLO.js} +1 -1
  329. package/dist/client/assets/{use-deployment-admin-glI5z0S-.js → use-deployment-admin-DBDDA5Db.js} +1 -1
  330. package/dist/client/assets/{use-entitlements-C7UoqTI0.js → use-entitlements-D_NXTAyp.js} +1 -1
  331. package/dist/client/assets/{use-fast-preview-draft-url-BK4D_Y49.js → use-fast-preview-draft-url-DO0FxQgi.js} +1 -1
  332. package/dist/client/assets/{use-file-configs-C0B0PjW_.js → use-file-configs-Css7VrGO.js} +1 -1
  333. package/dist/client/assets/{use-id-selection-CTG-YWBc.js → use-id-selection-tdP-DqUr.js} +1 -1
  334. package/dist/client/assets/{use-inbox-feed-Br6iChGF.js → use-inbox-feed-gupZrbXm.js} +1 -1
  335. package/dist/client/assets/{use-infinite-scroll-Ca25srcJ.js → use-infinite-scroll-BW-rJXd9.js} +1 -1
  336. package/dist/client/assets/{use-join-requests-Dfcdd55y.js → use-join-requests-B4rRAy5i.js} +1 -1
  337. package/dist/client/assets/{use-main-panel-tabs-HePCt0jA.js → use-main-panel-tabs-1Vj7wm8E.js} +1 -1
  338. package/dist/client/assets/use-mcp-auth-status-CCeGVwSv.js +1 -0
  339. package/dist/client/assets/{use-mcp-client-DFeSZL8q.js → use-mcp-client-CluVMhVq.js} +1 -1
  340. package/dist/client/assets/{use-mcp-prompts-BTRRV8Ft.js → use-mcp-prompts-YffkWL7I.js} +1 -1
  341. package/dist/client/assets/{use-mcp-tools-TDs-I0b1.js → use-mcp-tools-C1QW6bpR.js} +1 -1
  342. package/dist/client/assets/{use-mobile-BnBdDTHN.js → use-mobile-D2Sn1D9v.js} +1 -1
  343. package/dist/client/assets/{use-move-blocks-CckOr-lB.js → use-move-blocks-CWhuO9hg.js} +1 -1
  344. package/dist/client/assets/{use-navigate-to-agent-D12paxCm.js → use-navigate-to-agent-DG4RRc2l.js} +1 -1
  345. package/dist/client/assets/{use-never-published-DFEsFGpN.js → use-never-published-D8nGboC4.js} +1 -1
  346. package/dist/client/assets/{use-org-fs-BVX55_QU.js → use-org-fs-BySi7x_E.js} +1 -1
  347. package/dist/client/assets/{use-org-repo-syncs-ZSOjbeOM.js → use-org-repo-syncs-CR3rL8dY.js} +1 -1
  348. package/dist/client/assets/{use-org-sso-BjEvyyup.js → use-org-sso-C1PNiOLX.js} +1 -1
  349. package/dist/client/assets/{use-organization-settings-Bp5pncRd.js → use-organization-settings-HcETy7Sy.js} +1 -1
  350. package/dist/client/assets/{use-project-native-view-presence-BygogdOC.js → use-project-native-view-presence-DwgE9Oo5.js} +1 -1
  351. package/dist/client/assets/{use-project-scope-DOHE3bKU.js → use-project-scope-C_D7G_Rp.js} +1 -1
  352. package/dist/client/assets/{use-recent-apps-DP2oLcqz.js → use-recent-apps-h9IShd63.js} +1 -1
  353. package/dist/client/assets/{use-reports-diagnostic-DpDAVu1I.js → use-reports-diagnostic-CKOsUeqn.js} +1 -1
  354. package/dist/client/assets/{use-sandbox-events-EhUTp4km.js → use-sandbox-events-BRyRagyy.js} +1 -1
  355. package/dist/client/assets/{use-secrets-CxjuCsrh.js → use-secrets-BDiRf3Zk.js} +1 -1
  356. package/dist/client/assets/{use-section-preview-base-cdgVeEAb.js → use-section-preview-base-C9b4a3IM.js} +1 -1
  357. package/dist/client/assets/{use-sidebar-collapsed-BIEPyypZ.js → use-sidebar-collapsed-I4_8P9uh.js} +1 -1
  358. package/dist/client/assets/{use-tags-C3U-POZn.js → use-tags-BLAg8Bt6.js} +1 -1
  359. package/dist/client/assets/{use-task-board-analytics-C3VZMz7B.js → use-task-board-analytics-fe_SM3oJ.js} +1 -1
  360. package/dist/client/assets/{use-task-board-events-DbjmwIOB.js → use-task-board-events-DLrBUovp.js} +1 -1
  361. package/dist/client/assets/{use-task-board-item-prs-EqF0sY_y.js → use-task-board-item-prs-CwDomqDS.js} +1 -1
  362. package/dist/client/assets/{use-task-board-items-qkbAWHCl.js → use-task-board-items-Bm6zwfzn.js} +1 -1
  363. package/dist/client/assets/{use-task-board-prompts-Rl7l1WO8.js → use-task-board-prompts-CjwAHKAM.js} +1 -1
  364. package/dist/client/assets/{use-task-metadata-Cd0VDdAR.js → use-task-metadata-CM4snwYN.js} +1 -1
  365. package/dist/client/assets/{use-thread-outputs-BVOJLuSg.js → use-thread-outputs-hVznlgM2.js} +1 -1
  366. package/dist/client/assets/{use-view-draft-kind-CLUDIePm.js → use-view-draft-kind-Bb6178QK.js} +1 -1
  367. package/dist/client/assets/{use-voice-input-Bl7eFiVx.js → use-voice-input-4p-Pv-qm.js} +1 -1
  368. package/dist/client/assets/useInfiniteQuery-D3dviUwm.js +1 -0
  369. package/dist/client/assets/{useQueries-BoFvlKGQ.js → useQueries-BDKcwXY5.js} +1 -1
  370. package/dist/client/assets/useSuspenseInfiniteQuery-CX7nH5DS.js +1 -0
  371. package/dist/client/assets/{users-CNjQRe0O.js → users-JZFItgDj.js} +1 -1
  372. package/dist/client/assets/{utils-BQSMlXSP.js → utils-Cjet4zZt.js} +2 -2
  373. package/dist/client/assets/{variant-calendar-NNYJdzAI.js → variant-calendar-D2b6pfPb.js} +1 -1
  374. package/dist/client/assets/{variant-matcher-override-DT5fklqI.js → variant-matcher-override-CNk4J4xE.js} +1 -1
  375. package/dist/client/assets/{view-header-tpv-7x2O.js → view-header-DeTc05o9.js} +1 -1
  376. package/dist/client/assets/{virtual-mcp-MVkHUb3W.js → virtual-mcp-Dhzw4N7R.js} +1 -1
  377. package/dist/client/assets/{watch-sse-pool-Dj-biyb-.js → watch-sse-pool-C_8RX2D3.js} +1 -1
  378. package/dist/client/index.html +1 -1
  379. package/dist/server/server.js +1 -1
  380. package/package.json +1 -1
  381. package/dist/client/assets/agent-app-B-urmXmZ.js +0 -1
  382. package/dist/client/assets/agent-deck-BBmqDT35.js +0 -1
  383. package/dist/client/assets/agent-experiments-tJkf5zEV.js +0 -1
  384. package/dist/client/assets/agent-file-BO8UjxRg.js +0 -1
  385. package/dist/client/assets/agent-library-BKkTVzrq.js +0 -1
  386. package/dist/client/assets/agent-library-file-BrZYdHRW.js +0 -1
  387. package/dist/client/assets/agent-overview-B1REPbfy.js +0 -1
  388. package/dist/client/assets/agent-settings-DbGtVJ2w.js +0 -1
  389. package/dist/client/assets/agent-site-editor-code-BJ6yQoLJ.js +0 -2
  390. package/dist/client/assets/agent-site-editor-content-Cg8Mk6hH.js +0 -1
  391. package/dist/client/assets/agent-site-editor-preview-CqN3vC1Y.js +0 -1
  392. package/dist/client/assets/agent-view-DV1ov_VY.js +0 -1
  393. package/dist/client/assets/api-keys-DxmWJBFA.js +0 -1
  394. package/dist/client/assets/content-tab-DHk7zASR.js +0 -19
  395. package/dist/client/assets/item-actions-tUfJogkL.js +0 -1
  396. package/dist/client/assets/library-CEXxPUaa.js +0 -1
  397. package/dist/client/assets/project-reports-D_a4jtSV.js +0 -1
  398. package/dist/client/assets/project-tasks-BCzd3AL6.js +0 -1
  399. package/dist/client/assets/reports-DehFoQ2c.js +0 -1
  400. package/dist/client/assets/repositories-DPEF306T.js +0 -1
  401. package/dist/client/assets/route-ptA81iuF.js +0 -1
  402. package/dist/client/assets/settings-tab-DNW19Zfd.js +0 -1
  403. package/dist/client/assets/site-editor-Bb1utT9X.js +0 -1
  404. package/dist/client/assets/tasks-rVWKpPqZ.js +0 -1
  405. package/dist/client/assets/use-ask-in-chat-BqR7YrFk.js +0 -1
  406. package/dist/client/assets/use-blocks-v8-project-fuQSIOiU.js +0 -1
  407. package/dist/client/assets/use-mcp-auth-status-BZvjXleK.js +0 -1
  408. package/dist/client/assets/useInfiniteQuery-DAeB0Xdz.js +0 -1
  409. package/dist/client/assets/useSuspenseInfiniteQuery-D8216v2q.js +0 -1
@@ -1 +1 @@
1
- import{c as w,ar as le,at as re,b as se,a4 as ce,l as de,j as s,m as ue,n as ae,r as D,d as he,aR as Z,R as J,P as z,aZ as fe,B as me}from"./index-DkcRNYY4.js";import{u as pe}from"./use-mobile-BnBdDTHN.js";import{h as ge,c as be,u as xe,m as ye}from"./use-sidebar-collapsed-BIEPyypZ.js";import{a as ie,R as je,b as Se}from"./resizable-vWMGfcV5.js";import{c as ve,r as Ce,m as Te}from"./use-chat-layout-state-7fLexK-W.js";import{M as Le,o as Ne}from"./agent-icon-Clk7SRdQ.js";import{c as Q,T as X,a as ee}from"./tooltip-CcU7DhuT.js";import{T as te}from"./toolbar-icon-button-DqwBIL-q.js";import{u as we}from"./use-project-scope-DOHE3bKU.js";import{b as Pe}from"./repository-binding-BLl1r28B.js";function ne(l,e){const a=typeof l=="number"?l:Number(l);return!Number.isFinite(a)||a<=0||a>=100?e:a}function ze(l,e){const a=w.c(8);let o;a[0]!==e?(o=c=>ne(c,e),a[0]=e,a[1]=o):o=a[1];const[t,i]=le(l,o);let n;a[2]!==e||a[3]!==t?(n=ne(t,e),a[2]=e,a[3]=t,a[4]=n):n=a[4];let u;return a[5]!==i||a[6]!==n?(u=[n,i],a[5]=i,a[6]=n,a[7]=u):u=a[7],u}const _e=33;function Oe(){const l=w.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=re.sidePanelWidth(),l[0]=e):e=l[0],ze(e,_e)}function Ee(l){const e=w.c(64),{actions:a,navigation:o}=l,t=se(),{org:i}=ce(),n=we(),u=Pe(n),c=ge(),{toggleSidebar:d}=be(),h=xe(),r=oe();let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f={select:Me},e[0]=f):f=e[0];const m=de(f),b=m?.mainView==="overview";let x;e[1]!==u?.title||e[2]!==t?(x=u?.title??t("common.loading"),e[1]=u?.title,e[2]=t,e[3]=x):x=e[3];const y=x;let j;e[4]!==b||e[5]!==m?.mainView||e[6]!==m?.pageTitle||e[7]!==y||e[8]!==n||e[9]!==t?(j=b?n?y:t("sidebar.navDestinations.home"):m?.mainView==="files"?t("sidebar.navDestinations.context"):t(m?.pageTitle??"page.view"),e[4]=b,e[5]=m?.mainView,e[6]=m?.pageTitle,e[7]=y,e[8]=n,e[9]=t,e[10]=j):j=e[10];const S=j,C=n??"";let T;e[11]!==i.slug||e[12]!==C?(T={to:"/$org/projects/$agentId",params:{org:i.slug,agentId:C}},e[11]=i.slug,e[12]=C,e[13]=T):T=e[13];const p=T;let g;if(e[14]!==c||e[15]!==b||e[16]!==i.slug||e[17]!==p||e[18]!==y||e[19]!==n||e[20]!==t||e[21]!==S){if(g=[],c){let v;e[23]!==t?(v=t("sidebar.navDestinations.settings"),e[23]=t,e[24]=v):v=e[24];let B;e[25]!==i.slug?(B={to:"/$org/settings/general",params:{org:i.slug}},e[25]=i.slug,e[26]=B):B=e[26];let K;e[27]!==v||e[28]!==B?(K={key:"settings",label:v,link:B},e[27]=v,e[28]=B,e[29]=K):K=e[29],g.push(K)}else if(n&&!b){let v;e[30]!==p||e[31]!==y?(v={key:"project",label:y,link:p},e[30]=p,e[31]=y,e[32]=v):v=e[32],g.push(v)}let V;e[33]!==S?(V={key:"page",label:S},e[33]=S,e[34]=V):V=e[34],g.push(V),e[14]=c,e[15]=b,e[16]=i.slug,e[17]=p,e[18]=y,e[19]=n,e[20]=t,e[21]=S,e[22]=g}else g=e[22];const L=h,N=!!r&&!r.threadless&&r.threadOpen;let P;e[35]!==r||e[36]!==L||e[37]!==t?(P=L&&r&&!r.threadless&&s.jsxs(Q,{children:[s.jsx(X,{asChild:!0,children:s.jsx(te,{"aria-label":t(r.threadOpen?"page.closeThread":"page.openThread"),"aria-pressed":r.threadOpen,active:r.threadOpen,onClick:r.toggleThread,children:s.jsx(Le,{size:16})})}),s.jsx(ee,{side:"bottom",children:t(r.threadOpen?"page.closeThread":"page.openThread")})]}),e[35]=r,e[36]=L,e[37]=t,e[38]=P):P=e[38];const W=P,q=(!L||N)&&"md:hidden";let _;e[39]!==q?(_=ue(q),e[39]=q,e[40]=_):_=e[40];let O;e[41]!==t?(O=t("page.expandSidebar"),e[41]=t,e[42]=O):O=e[42];let A;e[43]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(Ne,{size:16}),e[43]=A):A=e[43];let E;e[44]!==_||e[45]!==O||e[46]!==d?(E=s.jsx(X,{asChild:!0,children:s.jsx(te,{className:_,onClick:d,"aria-label":O,children:A})}),e[44]=_,e[45]=O,e[46]=d,e[47]=E):E=e[47];let M;e[48]!==t?(M=t("page.expandSidebar"),e[48]=t,e[49]=M):M=e[49];let R;e[50]!==M?(R=s.jsx(ee,{side:"bottom",children:M}),e[50]=M,e[51]=R):R=e[51];let k;e[52]!==E||e[53]!==R?(k=s.jsxs(Q,{children:[E,R]}),e[52]=E,e[53]=R,e[54]=k):k=e[54];let I;e[55]!==W||e[56]!==k?(I=s.jsxs(s.Fragment,{children:[k,W]}),e[55]=W,e[56]=k,e[57]=I):I=e[57];let H;return e[58]!==a||e[59]!==g||e[60]!==o||e[61]!==i.name||e[62]!==I?(H=s.jsx(ae.Header,{leading:I,breadcrumbs:g,scope:i.name,actions:a,navigation:o}),e[58]=a,e[59]=g,e[60]=o,e[61]=i.name,e[62]=I,e[63]=H):H=e[63],H}function Me(l){return l.matches.findLast(Re)?.staticData}function Re(l){return l.staticData.pageTitle}const $="chat-layout-thread",F="chat-layout-content",G=D.createContext(null);function ke(){return U()}function oe(){return D.use(G)}function U(){const l=D.use(G);if(!l)throw new Error("ChatLayout regions require a ChatLayout");return l}function Ie(l){const e=w.c(23),{children:a,...o}=l,t=pe(),i=he(),n=D.useRef(null),[u,c]=Oe(),{threadOpen:d,contentOpen:h}=o,r=ve(o),f=d&&h?u:r.side,m=100-f,b=p=>{const g=p.getLayout(),L=g[$],N=g[F];typeof L!="number"||typeof N!="number"||Math.abs(L-f)<.001&&Math.abs(N-m)<.001||p.setLayout({[$]:f,[F]:m})},x=Ce({visibility:o,threadVisibilityExplicit:o.threadVisibilityExplicit});let y;e[0]!==t||e[1]!==o||e[2]!==x?(y={...o,isMobile:t,mobileSurface:x},e[0]=t,e[1]=o,e[2]=x,e[3]=y):y=e[3];const j=y;let S;e[4]!==t||e[5]!==o||e[6]!==i||e[7]!==d||e[8]!==j?(S=!o.threadless&&s.jsx(ye,{open:t?j.mobileSurface==="chat":d,onToggle:()=>{t?i({to:".",search:p=>({...p,...Te(j.mobileSurface==="chat"?"main":"chat")}),replace:!0}):o.toggleThread()}}),e[4]=t,e[5]=o,e[6]=i,e[7]=d,e[8]=j,e[9]=S):S=e[9];let C;e[10]!==a||e[11]!==h||e[12]!==m||e[13]!==t||e[14]!==c||e[15]!==b||e[16]!==d||e[17]!==f?(C=t?s.jsx("div",{"data-slot":"chat-layout",className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-background",children:a}):s.jsx(je,{ref:p=>{if(n.current=p,!p)return;let g=!0;return queueMicrotask(()=>{g&&b(p)}),()=>{g=!1,n.current===p&&(n.current=null)}},defaultLayout:{[$]:f,[F]:m},orientation:"horizontal","data-slot":"chat-layout",className:"flex-1 min-h-0 pt-1 pb-1 pr-1 pl-0 [&>[data-chat-layout-panel-open]]:!min-w-[320px]",style:{overflow:"visible"},onLayoutChanged:(p,g)=>{const{isUserInteraction:L}=g;if(!L){const P=n.current;P&&b(P);return}const N=p[$];d&&h&&typeof N=="number"&&N>0&&N<100&&c(N)},children:a}),e[10]=a,e[11]=h,e[12]=m,e[13]=t,e[14]=c,e[15]=b,e[16]=d,e[17]=f,e[18]=C):C=e[18];let T;return e[19]!==S||e[20]!==C||e[21]!==j?(T=s.jsxs(G,{value:j,children:[S,C]}),e[19]=S,e[20]=C,e[21]=j,e[22]=T):T=e[22],T}function Be(l){const e=w.c(16),{children:a,topbar:o}=l,t=U();if(t.isMobile){let r;return e[0]!==a||e[1]!==t.mobileSurface||e[2]!==o?(r=t.mobileSurface==="chat"?s.jsxs(z,{variant:"plain","data-slot":"chat-layout-thread",children:[o,s.jsx(z.Content,{"data-testid":"chat-panel",children:a})]}):null,e[0]=a,e[1]=t.mobileSurface,e[2]=o,e[3]=r):r=e[3],r}const i=t.threadOpen?"":void 0;let n;e[4]!==a||e[5]!==t.threadOpen||e[6]!==o?(n=t.threadOpen&&s.jsxs(s.Fragment,{children:[o,s.jsx(z.Content,{"data-testid":"chat-panel",children:a})]}),e[4]=a,e[5]=t.threadOpen,e[6]=o,e[7]=n):n=e[7];let u;e[8]!==n?(u=s.jsx("div",{className:"h-full min-h-0 p-0.5",children:s.jsx(z,{"data-testid":"side-panel",children:n})}),e[8]=n,e[9]=u):u=e[9];let c;e[10]!==i||e[11]!==u?(c=s.jsx(ie,{id:$,defaultSize:"33%",minSize:"20%",collapsible:!0,collapsedSize:"0%","data-chat-layout-panel-open":i,className:"min-w-0 overflow-hidden bg-sidebar",children:u}),e[10]=i,e[11]=u,e[12]=c):c=e[12];let d;e[13]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Se,{className:"bg-sidebar"}),e[13]=d):d=e[13];let h;return e[14]!==c?(h=s.jsxs(s.Fragment,{children:[c,d]}),e[14]=c,e[15]=h):h=e[15],h}function $e({children:l,routeId:e}){return l}function Y(l){const e=w.c(23),{children:a,actions:o,drawer:t,aside:i}=l,n=U();if(n.isMobile&&n.mobileSurface!=="main")return null;const u=n.isMobile?"plain":"card";let c;e[0]!==o||e[1]!==n.contentNavigation?(c=s.jsx(Ee,{navigation:n.contentNavigation,actions:o}),e[0]=o,e[1]=n.contentNavigation,e[2]=c):c=e[2];let d;e[3]!==a||e[4]!==n.contentKey?(d=s.jsx(Z,{children:s.jsx($e,{routeId:n.contentKey,children:a})}),e[3]=a,e[4]=n.contentKey,e[5]=d):d=e[5];let h;e[6]!==n.contentKey||e[7]!==d?(h=s.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:s.jsx(J,{children:d},n.contentKey)}),e[6]=n.contentKey,e[7]=d,e[8]=h):h=e[8];let r;e[9]!==t||e[10]!==h?(r=s.jsxs(z.Content,{children:[h,t]}),e[9]=t,e[10]=h,e[11]=r):r=e[11];let f;e[12]!==c||e[13]!==r?(f=s.jsxs(ae.Breadcrumbs.Provider,{children:[c,r]}),e[12]=c,e[13]=r,e[14]=f):f=e[14];let m;e[15]!==u||e[16]!==f?(m=s.jsx(z,{"data-testid":"main-panel",variant:u,children:f}),e[15]=u,e[16]=f,e[17]=m):m=e[17];const b=m;let x;return e[18]!==i||e[19]!==n.contentOpen||e[20]!==n.isMobile||e[21]!==b?(x=n.isMobile?b:s.jsx(ie,{id:F,defaultSize:"67%",minSize:"20%",collapsible:!0,collapsedSize:"0%","data-chat-layout-panel-open":n.contentOpen?"":void 0,className:"min-w-0 overflow-hidden bg-sidebar",children:s.jsxs("div",{className:"flex h-full min-h-0",children:[s.jsx("div",{className:"h-full min-h-0 min-w-0 flex-1 p-0.5",children:b}),i&&s.jsx("div",{className:"h-full min-h-0 w-[42%] min-w-80 shrink-0 p-0.5",children:s.jsx(z,{"data-testid":"aside-panel",children:s.jsx(J,{children:s.jsx(Z,{children:i})},D.isValidElement(i)?i.key??void 0:void 0)})})]})}),e[18]=i,e[19]=n.contentOpen,e[20]=n.isMobile,e[21]=b,e[22]=x):x=e[22],x}function De(){const l=w.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Y,{children:s.jsx(fe,{})}),l[0]=e):e=l[0],e}function Ae(l){const e=w.c(18),{error:a,reset:o}=l,t=se();let i;e[0]!==t?(i=t("common.errorBoundary.somethingWentWrong"),e[0]=t,e[1]=i):i=e[1];let n;e[2]!==i?(n=s.jsx("h2",{className:"text-lg font-medium",children:i}),e[2]=i,e[3]=n):n=e[3];let u;e[4]!==a.message||e[5]!==t?(u=a.message||t("common.errorBoundary.unexpectedError"),e[4]=a.message,e[5]=t,e[6]=u):u=e[6];let c;e[7]!==u?(c=s.jsx("p",{className:"max-w-lg whitespace-pre-wrap text-sm text-muted-foreground",children:u}),e[7]=u,e[8]=c):c=e[8];let d;e[9]!==t?(d=t("common.errorBoundary.tryAgain"),e[9]=t,e[10]=d):d=e[10];let h;e[11]!==o||e[12]!==d?(h=s.jsx(me,{variant:"outline",onClick:o,children:d}),e[11]=o,e[12]=d,e[13]=h):h=e[13];let r;return e[14]!==n||e[15]!==c||e[16]!==h?(r=s.jsx(Y,{children:s.jsxs("div",{role:"alert",className:"flex h-full flex-col items-center justify-center gap-4 p-6 text-center",children:[n,c,h]})}),e[14]=n,e[15]=c,e[16]=h,e[17]=r):r=e[17],r}const He=Object.assign(Ie,{Thread:Be,Content:Y}),Qe=Object.freeze(Object.defineProperty({__proto__:null,ChatLayout:He,ChatLayoutError:Ae,ChatLayoutPending:De,useChatLayout:ke,useOptionalChatLayout:oe},Symbol.toStringTag,{value:"Module"}));export{He as C,Ee as R,Qe as i,ke as u};
1
+ import{c as w,ar as le,at as re,b as se,a4 as ce,l as de,j as s,m as ue,n as ae,r as D,d as he,aR as Z,R as J,P as z,aZ as fe,B as me}from"./index-D8HDDDUz.js";import{u as pe}from"./use-mobile-D2Sn1D9v.js";import{h as ge,c as be,u as xe,m as ye}from"./use-sidebar-collapsed-I4_8P9uh.js";import{a as ie,R as je,b as Se}from"./resizable-B8_D-RUQ.js";import{c as ve,r as Ce,m as Te}from"./use-chat-layout-state-DfKn-NxL.js";import{M as Le,o as Ne}from"./agent-icon-mmszwibp.js";import{c as Q,T as X,a as ee}from"./tooltip-BZFegydB.js";import{T as te}from"./toolbar-icon-button-jXG-KQc2.js";import{u as we}from"./use-project-scope-C_D7G_Rp.js";import{b as Pe}from"./repository-binding-Dv276sdb.js";function ne(l,e){const a=typeof l=="number"?l:Number(l);return!Number.isFinite(a)||a<=0||a>=100?e:a}function ze(l,e){const a=w.c(8);let o;a[0]!==e?(o=c=>ne(c,e),a[0]=e,a[1]=o):o=a[1];const[t,i]=le(l,o);let n;a[2]!==e||a[3]!==t?(n=ne(t,e),a[2]=e,a[3]=t,a[4]=n):n=a[4];let u;return a[5]!==i||a[6]!==n?(u=[n,i],a[5]=i,a[6]=n,a[7]=u):u=a[7],u}const _e=33;function Oe(){const l=w.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=re.sidePanelWidth(),l[0]=e):e=l[0],ze(e,_e)}function Ee(l){const e=w.c(64),{actions:a,navigation:o}=l,t=se(),{org:i}=ce(),n=we(),u=Pe(n),c=ge(),{toggleSidebar:d}=be(),h=xe(),r=oe();let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f={select:Me},e[0]=f):f=e[0];const m=de(f),b=m?.mainView==="overview";let x;e[1]!==u?.title||e[2]!==t?(x=u?.title??t("common.loading"),e[1]=u?.title,e[2]=t,e[3]=x):x=e[3];const y=x;let j;e[4]!==b||e[5]!==m?.mainView||e[6]!==m?.pageTitle||e[7]!==y||e[8]!==n||e[9]!==t?(j=b?n?y:t("sidebar.navDestinations.home"):m?.mainView==="files"?t("sidebar.navDestinations.context"):t(m?.pageTitle??"page.view"),e[4]=b,e[5]=m?.mainView,e[6]=m?.pageTitle,e[7]=y,e[8]=n,e[9]=t,e[10]=j):j=e[10];const S=j,C=n??"";let T;e[11]!==i.slug||e[12]!==C?(T={to:"/$org/projects/$agentId",params:{org:i.slug,agentId:C}},e[11]=i.slug,e[12]=C,e[13]=T):T=e[13];const p=T;let g;if(e[14]!==c||e[15]!==b||e[16]!==i.slug||e[17]!==p||e[18]!==y||e[19]!==n||e[20]!==t||e[21]!==S){if(g=[],c){let v;e[23]!==t?(v=t("sidebar.navDestinations.settings"),e[23]=t,e[24]=v):v=e[24];let B;e[25]!==i.slug?(B={to:"/$org/settings/general",params:{org:i.slug}},e[25]=i.slug,e[26]=B):B=e[26];let K;e[27]!==v||e[28]!==B?(K={key:"settings",label:v,link:B},e[27]=v,e[28]=B,e[29]=K):K=e[29],g.push(K)}else if(n&&!b){let v;e[30]!==p||e[31]!==y?(v={key:"project",label:y,link:p},e[30]=p,e[31]=y,e[32]=v):v=e[32],g.push(v)}let V;e[33]!==S?(V={key:"page",label:S},e[33]=S,e[34]=V):V=e[34],g.push(V),e[14]=c,e[15]=b,e[16]=i.slug,e[17]=p,e[18]=y,e[19]=n,e[20]=t,e[21]=S,e[22]=g}else g=e[22];const L=h,N=!!r&&!r.threadless&&r.threadOpen;let P;e[35]!==r||e[36]!==L||e[37]!==t?(P=L&&r&&!r.threadless&&s.jsxs(Q,{children:[s.jsx(X,{asChild:!0,children:s.jsx(te,{"aria-label":t(r.threadOpen?"page.closeThread":"page.openThread"),"aria-pressed":r.threadOpen,active:r.threadOpen,onClick:r.toggleThread,children:s.jsx(Le,{size:16})})}),s.jsx(ee,{side:"bottom",children:t(r.threadOpen?"page.closeThread":"page.openThread")})]}),e[35]=r,e[36]=L,e[37]=t,e[38]=P):P=e[38];const W=P,q=(!L||N)&&"md:hidden";let _;e[39]!==q?(_=ue(q),e[39]=q,e[40]=_):_=e[40];let O;e[41]!==t?(O=t("page.expandSidebar"),e[41]=t,e[42]=O):O=e[42];let A;e[43]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(Ne,{size:16}),e[43]=A):A=e[43];let E;e[44]!==_||e[45]!==O||e[46]!==d?(E=s.jsx(X,{asChild:!0,children:s.jsx(te,{className:_,onClick:d,"aria-label":O,children:A})}),e[44]=_,e[45]=O,e[46]=d,e[47]=E):E=e[47];let M;e[48]!==t?(M=t("page.expandSidebar"),e[48]=t,e[49]=M):M=e[49];let R;e[50]!==M?(R=s.jsx(ee,{side:"bottom",children:M}),e[50]=M,e[51]=R):R=e[51];let k;e[52]!==E||e[53]!==R?(k=s.jsxs(Q,{children:[E,R]}),e[52]=E,e[53]=R,e[54]=k):k=e[54];let I;e[55]!==W||e[56]!==k?(I=s.jsxs(s.Fragment,{children:[k,W]}),e[55]=W,e[56]=k,e[57]=I):I=e[57];let H;return e[58]!==a||e[59]!==g||e[60]!==o||e[61]!==i.name||e[62]!==I?(H=s.jsx(ae.Header,{leading:I,breadcrumbs:g,scope:i.name,actions:a,navigation:o}),e[58]=a,e[59]=g,e[60]=o,e[61]=i.name,e[62]=I,e[63]=H):H=e[63],H}function Me(l){return l.matches.findLast(Re)?.staticData}function Re(l){return l.staticData.pageTitle}const $="chat-layout-thread",F="chat-layout-content",G=D.createContext(null);function ke(){return U()}function oe(){return D.use(G)}function U(){const l=D.use(G);if(!l)throw new Error("ChatLayout regions require a ChatLayout");return l}function Ie(l){const e=w.c(23),{children:a,...o}=l,t=pe(),i=he(),n=D.useRef(null),[u,c]=Oe(),{threadOpen:d,contentOpen:h}=o,r=ve(o),f=d&&h?u:r.side,m=100-f,b=p=>{const g=p.getLayout(),L=g[$],N=g[F];typeof L!="number"||typeof N!="number"||Math.abs(L-f)<.001&&Math.abs(N-m)<.001||p.setLayout({[$]:f,[F]:m})},x=Ce({visibility:o,threadVisibilityExplicit:o.threadVisibilityExplicit});let y;e[0]!==t||e[1]!==o||e[2]!==x?(y={...o,isMobile:t,mobileSurface:x},e[0]=t,e[1]=o,e[2]=x,e[3]=y):y=e[3];const j=y;let S;e[4]!==t||e[5]!==o||e[6]!==i||e[7]!==d||e[8]!==j?(S=!o.threadless&&s.jsx(ye,{open:t?j.mobileSurface==="chat":d,onToggle:()=>{t?i({to:".",search:p=>({...p,...Te(j.mobileSurface==="chat"?"main":"chat")}),replace:!0}):o.toggleThread()}}),e[4]=t,e[5]=o,e[6]=i,e[7]=d,e[8]=j,e[9]=S):S=e[9];let C;e[10]!==a||e[11]!==h||e[12]!==m||e[13]!==t||e[14]!==c||e[15]!==b||e[16]!==d||e[17]!==f?(C=t?s.jsx("div",{"data-slot":"chat-layout",className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-background",children:a}):s.jsx(je,{ref:p=>{if(n.current=p,!p)return;let g=!0;return queueMicrotask(()=>{g&&b(p)}),()=>{g=!1,n.current===p&&(n.current=null)}},defaultLayout:{[$]:f,[F]:m},orientation:"horizontal","data-slot":"chat-layout",className:"flex-1 min-h-0 pt-1 pb-1 pr-1 pl-0 [&>[data-chat-layout-panel-open]]:!min-w-[320px]",style:{overflow:"visible"},onLayoutChanged:(p,g)=>{const{isUserInteraction:L}=g;if(!L){const P=n.current;P&&b(P);return}const N=p[$];d&&h&&typeof N=="number"&&N>0&&N<100&&c(N)},children:a}),e[10]=a,e[11]=h,e[12]=m,e[13]=t,e[14]=c,e[15]=b,e[16]=d,e[17]=f,e[18]=C):C=e[18];let T;return e[19]!==S||e[20]!==C||e[21]!==j?(T=s.jsxs(G,{value:j,children:[S,C]}),e[19]=S,e[20]=C,e[21]=j,e[22]=T):T=e[22],T}function Be(l){const e=w.c(16),{children:a,topbar:o}=l,t=U();if(t.isMobile){let r;return e[0]!==a||e[1]!==t.mobileSurface||e[2]!==o?(r=t.mobileSurface==="chat"?s.jsxs(z,{variant:"plain","data-slot":"chat-layout-thread",children:[o,s.jsx(z.Content,{"data-testid":"chat-panel",children:a})]}):null,e[0]=a,e[1]=t.mobileSurface,e[2]=o,e[3]=r):r=e[3],r}const i=t.threadOpen?"":void 0;let n;e[4]!==a||e[5]!==t.threadOpen||e[6]!==o?(n=t.threadOpen&&s.jsxs(s.Fragment,{children:[o,s.jsx(z.Content,{"data-testid":"chat-panel",children:a})]}),e[4]=a,e[5]=t.threadOpen,e[6]=o,e[7]=n):n=e[7];let u;e[8]!==n?(u=s.jsx("div",{className:"h-full min-h-0 p-0.5",children:s.jsx(z,{"data-testid":"side-panel",children:n})}),e[8]=n,e[9]=u):u=e[9];let c;e[10]!==i||e[11]!==u?(c=s.jsx(ie,{id:$,defaultSize:"33%",minSize:"20%",collapsible:!0,collapsedSize:"0%","data-chat-layout-panel-open":i,className:"min-w-0 overflow-hidden bg-sidebar",children:u}),e[10]=i,e[11]=u,e[12]=c):c=e[12];let d;e[13]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Se,{className:"bg-sidebar"}),e[13]=d):d=e[13];let h;return e[14]!==c?(h=s.jsxs(s.Fragment,{children:[c,d]}),e[14]=c,e[15]=h):h=e[15],h}function $e({children:l,routeId:e}){return l}function Y(l){const e=w.c(23),{children:a,actions:o,drawer:t,aside:i}=l,n=U();if(n.isMobile&&n.mobileSurface!=="main")return null;const u=n.isMobile?"plain":"card";let c;e[0]!==o||e[1]!==n.contentNavigation?(c=s.jsx(Ee,{navigation:n.contentNavigation,actions:o}),e[0]=o,e[1]=n.contentNavigation,e[2]=c):c=e[2];let d;e[3]!==a||e[4]!==n.contentKey?(d=s.jsx(Z,{children:s.jsx($e,{routeId:n.contentKey,children:a})}),e[3]=a,e[4]=n.contentKey,e[5]=d):d=e[5];let h;e[6]!==n.contentKey||e[7]!==d?(h=s.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:s.jsx(J,{children:d},n.contentKey)}),e[6]=n.contentKey,e[7]=d,e[8]=h):h=e[8];let r;e[9]!==t||e[10]!==h?(r=s.jsxs(z.Content,{children:[h,t]}),e[9]=t,e[10]=h,e[11]=r):r=e[11];let f;e[12]!==c||e[13]!==r?(f=s.jsxs(ae.Breadcrumbs.Provider,{children:[c,r]}),e[12]=c,e[13]=r,e[14]=f):f=e[14];let m;e[15]!==u||e[16]!==f?(m=s.jsx(z,{"data-testid":"main-panel",variant:u,children:f}),e[15]=u,e[16]=f,e[17]=m):m=e[17];const b=m;let x;return e[18]!==i||e[19]!==n.contentOpen||e[20]!==n.isMobile||e[21]!==b?(x=n.isMobile?b:s.jsx(ie,{id:F,defaultSize:"67%",minSize:"20%",collapsible:!0,collapsedSize:"0%","data-chat-layout-panel-open":n.contentOpen?"":void 0,className:"min-w-0 overflow-hidden bg-sidebar",children:s.jsxs("div",{className:"flex h-full min-h-0",children:[s.jsx("div",{className:"h-full min-h-0 min-w-0 flex-1 p-0.5",children:b}),i&&s.jsx("div",{className:"h-full min-h-0 w-[42%] min-w-80 shrink-0 p-0.5",children:s.jsx(z,{"data-testid":"aside-panel",children:s.jsx(J,{children:s.jsx(Z,{children:i})},D.isValidElement(i)?i.key??void 0:void 0)})})]})}),e[18]=i,e[19]=n.contentOpen,e[20]=n.isMobile,e[21]=b,e[22]=x):x=e[22],x}function De(){const l=w.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Y,{children:s.jsx(fe,{})}),l[0]=e):e=l[0],e}function Ae(l){const e=w.c(18),{error:a,reset:o}=l,t=se();let i;e[0]!==t?(i=t("common.errorBoundary.somethingWentWrong"),e[0]=t,e[1]=i):i=e[1];let n;e[2]!==i?(n=s.jsx("h2",{className:"text-lg font-medium",children:i}),e[2]=i,e[3]=n):n=e[3];let u;e[4]!==a.message||e[5]!==t?(u=a.message||t("common.errorBoundary.unexpectedError"),e[4]=a.message,e[5]=t,e[6]=u):u=e[6];let c;e[7]!==u?(c=s.jsx("p",{className:"max-w-lg whitespace-pre-wrap text-sm text-muted-foreground",children:u}),e[7]=u,e[8]=c):c=e[8];let d;e[9]!==t?(d=t("common.errorBoundary.tryAgain"),e[9]=t,e[10]=d):d=e[10];let h;e[11]!==o||e[12]!==d?(h=s.jsx(me,{variant:"outline",onClick:o,children:d}),e[11]=o,e[12]=d,e[13]=h):h=e[13];let r;return e[14]!==n||e[15]!==c||e[16]!==h?(r=s.jsx(Y,{children:s.jsxs("div",{role:"alert",className:"flex h-full flex-col items-center justify-center gap-4 p-6 text-center",children:[n,c,h]})}),e[14]=n,e[15]=c,e[16]=h,e[17]=r):r=e[17],r}const He=Object.assign(Ie,{Thread:Be,Content:Y}),Qe=Object.freeze(Object.defineProperty({__proto__:null,ChatLayout:He,ChatLayoutError:Ae,ChatLayoutPending:De,useChatLayout:ke,useOptionalChatLayout:oe},Symbol.toStringTag,{value:"Module"}));export{He as C,Ee as R,Qe as i,ke as u};
@@ -1,4 +1,4 @@
1
- import{N as P,q as De,c as k,R as Ie,r as Pe,t as se,v as E,w as Oe,T as H,x as je,y as M,z as L,A as ve,D as Q,B as Z,C as Fe,G as _e,H as Ve,I as Ke,J as q,f as Xe}from"./usage-stats-D6OFaO8E.js";const qe=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,Ue=P.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:e}){return["img",k(this.options.HTMLAttributes,e)]},parseMarkdown:(e,t)=>t.createNode("image",{src:e.href,title:e.title,alt:e.text}),renderMarkdown:e=>{var t,n,o,l,r,s;const c=(t=(n=e.attrs)===null||n===void 0?void 0:n.src)!==null&&t!==void 0?t:"",i=(o=(l=e.attrs)===null||l===void 0?void 0:l.alt)!==null&&o!==void 0?o:"",a=(r=(s=e.attrs)===null||s===void 0?void 0:s.title)!==null&&r!==void 0?r:"";return a?`![${i}](${c} "${a}")`:`![${i}](${c})`},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>"u")return null;const{directions:e,minWidth:t,minHeight:n,alwaysPreserveAspectRatio:o}=this.options.resize,l=new Set(["src","width","height"]);return({node:r,getPos:s,HTMLAttributes:c,editor:i})=>{const a=document.createElement("img");a.draggable=!1;const d=k(this.options.HTMLAttributes,c);Object.entries(d).forEach(([w,S])=>{if(S!=null)switch(w){case"src":case"width":case"height":break;default:a.setAttribute(w,S)}}),d.src!==null&&(a.src=d.src);let u={...c};const f=w=>{if(typeof w=="string"&&w!==""){a.getAttribute("src")!==w&&(a.src=w);return}a.hasAttribute("src")&&a.removeAttribute("src"),a.src!==""&&(a.src="")};f(c.src);const p=w=>{if(w.type!==r.type)return!1;const S=i.extensionManager.attributes.filter(A=>A.type===w.type.name),y=Pe(w,S);return Object.keys(u).forEach(A=>{!l.has(A)&&!(A in y)&&a.removeAttribute(A)}),Object.entries(y).forEach(([A,R])=>{l.has(A)||(R!=null?a.setAttribute(A,R):a.removeAttribute(A))}),f(y.src),u=y,!0},h=new Ie({element:a,editor:i,node:r,getPos:s,onResize:(w,S)=>{a.style.width=`${w}px`,a.style.height=`${S}px`},onCommit:(w,S)=>{const y=s();y!==void 0&&this.editor.chain().setNodeSelection(y).updateAttributes(this.name,{width:w,height:S}).run()},onUpdate:p,options:{directions:e,min:{width:t,height:n},preserveAspectRatio:o===!0}}),g=h.dom,m=()=>{g.style.visibility="",g.style.pointerEvents=""};return g.style.visibility="hidden",g.style.pointerEvents="none",a.complete&&a.naturalWidth>0?m():(a.onload=m,a.onerror=m),h}},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[De({find:qe,type:this.type,getAttributes:e=>{const[,,t,n,o]=e;return{src:n,alt:t,title:o}}})]}});var un=Ue;let ee,te;if(typeof WeakMap<"u"){let e=new WeakMap;ee=t=>e.get(t),te=(t,n)=>(e.set(t,n),n)}else{const e=[];let n=0;ee=o=>{for(let l=0;l<e.length;l+=2)if(e[l]==o)return e[l+1]},te=(o,l)=>(n==10&&(n=0),e[n++]=o,e[n++]=l)}var C=class{constructor(e,t,n,o){this.width=e,this.height=t,this.map=n,this.problems=o}findCell(e){for(let t=0;t<this.map.length;t++){const n=this.map[t];if(n!=e)continue;const o=t%this.width,l=t/this.width|0;let r=o+1,s=l+1;for(let c=1;r<this.width&&this.map[t+c]==n;c++)r++;for(let c=1;s<this.height&&this.map[t+this.width*c]==n;c++)s++;return{left:o,top:l,right:r,bottom:s}}throw new RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw new RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){const{left:o,right:l,top:r,bottom:s}=this.findCell(e);return t=="horiz"?(n<0?o==0:l==this.width)?null:this.map[r*this.width+(n<0?o-1:l)]:(n<0?r==0:s==this.height)?null:this.map[o+this.width*(n<0?r-1:s)]}rectBetween(e,t){const{left:n,right:o,top:l,bottom:r}=this.findCell(e),{left:s,right:c,top:i,bottom:a}=this.findCell(t);return{left:Math.min(n,s),top:Math.min(l,i),right:Math.max(o,c),bottom:Math.max(r,a)}}cellsInRect(e){const t=[],n={};for(let o=e.top;o<e.bottom;o++)for(let l=e.left;l<e.right;l++){const r=o*this.width+l,s=this.map[r];n[s]||(n[s]=!0,!(l==e.left&&l&&this.map[r-1]==s||o==e.top&&o&&this.map[r-this.width]==s)&&t.push(s))}return t}positionAt(e,t,n){for(let o=0,l=0;;o++){const r=l+n.child(o).nodeSize;if(o==e){let s=t+e*this.width;const c=(e+1)*this.width;for(;s<c&&this.map[s]<l;)s++;return s==c?r-1:this.map[s]}l=r}}static get(e){return ee(e)||te(e,Je(e))}};function Je(e){if(e.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+e.type.name);const t=Ge(e),n=e.childCount,o=[];let l=0,r=null;const s=[];for(let a=0,d=t*n;a<d;a++)o[a]=0;for(let a=0,d=0;a<n;a++){const u=e.child(a);d++;for(let h=0;;h++){for(;l<o.length&&o[l]!=0;)l++;if(h==u.childCount)break;const g=u.child(h),{colspan:m,rowspan:w,colwidth:S}=g.attrs;for(let y=0;y<w;y++){if(y+a>=n){(r||(r=[])).push({type:"overlong_rowspan",pos:d,n:w-y});break}const A=l+y*t;for(let R=0;R<m;R++){o[A+R]==0?o[A+R]=d:(r||(r=[])).push({type:"collision",row:a,pos:d,n:m-R});const O=S&&S[R];if(O){const D=(A+R)%t*2,G=s[D];G==null||G!=O&&s[D+1]==1?(s[D]=O,s[D+1]=1):G==O&&s[D+1]++}}}l+=m,d+=g.nodeSize}const f=(a+1)*t;let p=0;for(;l<f;)o[l++]==0&&p++;p&&(r||(r=[])).push({type:"missing",row:a,n:p}),d++}(t===0||n===0)&&(r||(r=[])).push({type:"zero_sized"});const c=new C(t,n,o,r);let i=!1;for(let a=0;!i&&a<s.length;a+=2)s[a]!=null&&s[a+1]<n&&(i=!0);return i&&Ye(c,s,e),c}function Ge(e){let t=-1,n=!1;for(let o=0;o<e.childCount;o++){const l=e.child(o);let r=0;if(n)for(let s=0;s<o;s++){const c=e.child(s);for(let i=0;i<c.childCount;i++){const a=c.child(i);s+a.attrs.rowspan>o&&(r+=a.attrs.colspan)}}for(let s=0;s<l.childCount;s++){const c=l.child(s);r+=c.attrs.colspan,c.attrs.rowspan>1&&(n=!0)}t==-1?t=r:t!=r&&(t=Math.max(t,r))}return t}function Ye(e,t,n){e.problems||(e.problems=[]);const o={};for(let l=0;l<e.map.length;l++){const r=e.map[l];if(o[r])continue;o[r]=!0;const s=n.nodeAt(r);if(!s)throw new RangeError(`No cell with offset ${r} found`);let c=null;const i=s.attrs;for(let a=0;a<i.colspan;a++){const d=t[(l+a)%e.width*2];d!=null&&(!i.colwidth||i.colwidth[a]!=d)&&((c||(c=Qe(i)))[a]=d)}c&&e.problems.unshift({type:"colwidth mismatch",pos:r,colwidth:c})}}function Qe(e){if(e.colwidth)return e.colwidth.slice();const t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function v(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(const n in e.nodes){const o=e.nodes[n],l=o.spec.tableRole;l&&(t[l]=o)}}return t}const $=new se("selectingCells");function W(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole=="row")return e.node(0).resolve(e.before(t+1));return null}function Ze(e){for(let t=e.depth;t>0;t--){const n=e.node(t).type.spec.tableRole;if(n==="cell"||n==="header_cell")return e.node(t)}return null}function T(e){const t=e.selection.$head;for(let n=t.depth;n>0;n--)if(t.node(n).type.spec.tableRole=="row")return!0;return!1}function J(e){const t=e.selection;if("$anchorCell"in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if("node"in t&&t.node&&t.node.type.spec.tableRole=="cell")return t.$anchor;const n=W(t.$head)||et(t.$head);if(n)return n;throw new RangeError(`No cell found around position ${t.head}`)}function et(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){const o=t.type.spec.tableRole;if(o=="cell"||o=="header_cell")return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){const o=t.type.spec.tableRole;if(o=="cell"||o=="header_cell")return e.doc.resolve(n-t.nodeSize)}}function ne(e){return e.parent.type.spec.tableRole=="row"&&!!e.nodeAfter}function tt(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function ie(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function Re(e,t,n){const o=e.node(-1),l=C.get(o),r=e.start(-1),s=l.nextCell(e.pos-r,t,n);return s==null?null:e.node(0).resolve(r+s)}function B(e,t,n=1){const o={...e,colspan:e.colspan-n};return o.colwidth&&(o.colwidth=o.colwidth.slice(),o.colwidth.splice(t,n),o.colwidth.some(l=>l>0)||(o.colwidth=null)),o}function xe(e,t,n=1){const o={...e,colspan:e.colspan+n};if(o.colwidth){o.colwidth=o.colwidth.slice();for(let l=0;l<n;l++)o.colwidth.splice(t,0,0)}return o}function nt(e,t,n){const o=v(t.type.schema).header_cell;for(let l=0;l<e.height;l++)if(t.nodeAt(e.map[n+l*e.width]).type!=o)return!1;return!0}var b=class N extends E{constructor(t,n=t){const o=t.node(-1),l=C.get(o),r=t.start(-1),s=l.rectBetween(t.pos-r,n.pos-r),c=t.node(0),i=l.cellsInRect(s).filter(d=>d!=n.pos-r);i.unshift(n.pos-r);const a=i.map(d=>{const u=o.nodeAt(d);if(!u)throw new RangeError(`No cell with offset ${d} found`);const f=r+d+1;return new je(c.resolve(f),c.resolve(f+u.content.size))});super(a[0].$from,a[0].$to,a),this.$anchorCell=t,this.$headCell=n}map(t,n){const o=t.resolve(n.map(this.$anchorCell.pos)),l=t.resolve(n.map(this.$headCell.pos));if(ne(o)&&ne(l)&&ie(o,l)){const r=this.$anchorCell.node(-1)!=o.node(-1);return r&&this.isRowSelection()?N.rowSelection(o,l):r&&this.isColSelection()?N.colSelection(o,l):new N(o,l)}return H.between(o,l)}content(){const t=this.$anchorCell.node(-1),n=C.get(t),o=this.$anchorCell.start(-1),l=n.rectBetween(this.$anchorCell.pos-o,this.$headCell.pos-o),r={},s=[];for(let i=l.top;i<l.bottom;i++){const a=[];for(let d=i*n.width+l.left,u=l.left;u<l.right;u++,d++){const f=n.map[d];if(r[f])continue;r[f]=!0;const p=n.findCell(f);let h=t.nodeAt(f);if(!h)throw new RangeError(`No cell with offset ${f} found`);const g=l.left-p.left,m=p.right-l.right;if(g>0||m>0){let w=h.attrs;if(g>0&&(w=B(w,0,g)),m>0&&(w=B(w,w.colspan-m,m)),p.left<l.left){if(h=h.type.createAndFill(w),!h)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(w)}`)}else h=h.type.create(w,h.content)}if(p.top<l.top||p.bottom>l.bottom){const w={...h.attrs,rowspan:Math.min(p.bottom,l.bottom)-Math.max(p.top,l.top)};p.top<l.top?h=h.type.createAndFill(w):h=h.type.create(w,h.content)}a.push(h)}s.push(t.child(i).copy(M.from(a)))}const c=this.isColSelection()&&this.isRowSelection()?t:s;return new L(M.from(c),1,1)}replace(t,n=L.empty){const o=t.steps.length,l=this.ranges;for(let s=0;s<l.length;s++){const{$from:c,$to:i}=l[s],a=t.mapping.slice(o);t.replace(a.map(c.pos),a.map(i.pos),s?L.empty:n)}const r=E.findFrom(t.doc.resolve(t.mapping.slice(o).map(this.to)),-1);r&&t.setSelection(r)}replaceWith(t,n){this.replace(t,new L(M.from(n),0,0))}forEachCell(t){const n=this.$anchorCell.node(-1),o=C.get(n),l=this.$anchorCell.start(-1),r=o.cellsInRect(o.rectBetween(this.$anchorCell.pos-l,this.$headCell.pos-l));for(let s=0;s<r.length;s++)t(n.nodeAt(r[s]),l+r[s])}isColSelection(){const t=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(t,n)>0)return!1;const o=t+this.$anchorCell.nodeAfter.attrs.rowspan,l=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(o,l)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){const o=t.node(-1),l=C.get(o),r=t.start(-1),s=l.findCell(t.pos-r),c=l.findCell(n.pos-r),i=t.node(0);return s.top<=c.top?(s.top>0&&(t=i.resolve(r+l.map[s.left])),c.bottom<l.height&&(n=i.resolve(r+l.map[l.width*(l.height-1)+c.right-1]))):(c.top>0&&(n=i.resolve(r+l.map[c.left])),s.bottom<l.height&&(t=i.resolve(r+l.map[l.width*(l.height-1)+s.right-1]))),new N(t,n)}isRowSelection(){const t=this.$anchorCell.node(-1),n=C.get(t),o=this.$anchorCell.start(-1),l=n.colCount(this.$anchorCell.pos-o),r=n.colCount(this.$headCell.pos-o);if(Math.min(l,r)>0)return!1;const s=l+this.$anchorCell.nodeAfter.attrs.colspan,c=r+this.$headCell.nodeAfter.attrs.colspan;return Math.max(s,c)==n.width}eq(t){return t instanceof N&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){const o=t.node(-1),l=C.get(o),r=t.start(-1),s=l.findCell(t.pos-r),c=l.findCell(n.pos-r),i=t.node(0);return s.left<=c.left?(s.left>0&&(t=i.resolve(r+l.map[s.top*l.width])),c.right<l.width&&(n=i.resolve(r+l.map[l.width*(c.top+1)-1]))):(c.left>0&&(n=i.resolve(r+l.map[c.top*l.width])),s.right<l.width&&(t=i.resolve(r+l.map[l.width*(s.top+1)-1]))),new N(t,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new N(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,o=n){return new N(t.resolve(n),t.resolve(o))}getBookmark(){return new ot(this.$anchorCell.pos,this.$headCell.pos)}};b.prototype.visible=!1;E.jsonID("cell",b);var ot=class Te{constructor(t,n){this.anchor=t,this.head=n}map(t){return new Te(t.map(this.anchor),t.map(this.head))}resolve(t){const n=t.resolve(this.anchor),o=t.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&o.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&o.index()<o.parent.childCount&&ie(n,o)?new b(n,o):E.near(o,1)}};function lt(e){if(!(e.selection instanceof b))return null;const t=[];return e.selection.forEachCell((n,o)=>{t.push(Z.node(o,o+n.nodeSize,{class:"selectedCell"}))}),Q.create(e.doc,t)}function rt({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,o=t.pos,l=e.depth;for(;l>=0&&!(e.after(l+1)<e.end(l));l--,n++);for(let r=t.depth;r>=0&&!(t.before(r+1)>t.start(r));r--,o--);return n==o&&/row|table/.test(e.node(l).type.spec.tableRole)}function st({$from:e,$to:t}){let n,o;for(let l=e.depth;l>0;l--){const r=e.node(l);if(r.type.spec.tableRole==="cell"||r.type.spec.tableRole==="header_cell"){n=r;break}}for(let l=t.depth;l>0;l--){const r=t.node(l);if(r.type.spec.tableRole==="cell"||r.type.spec.tableRole==="header_cell"){o=r;break}}return n!==o&&t.parentOffset===0}function it(e,t,n){const o=(t||e).selection,l=(t||e).doc;let r,s;if(o instanceof Fe&&(s=o.node.type.spec.tableRole)){if(s=="cell"||s=="header_cell")r=b.create(l,o.from);else if(s=="row"){const c=l.resolve(o.from+1);r=b.rowSelection(c,c)}else if(!n){const c=C.get(o.node),i=o.from+1,a=i+c.map[c.width*c.height-1];r=b.create(l,i+1,a)}}else o instanceof H&&rt(o)?r=H.create(l,o.from):o instanceof H&&st(o)&&(r=H.create(l,o.$from.start(),o.$from.end()));return r&&(t||(t=e.tr)).setSelection(r),t}const ct=new se("fix-tables");function Me(e,t,n,o){const l=e.childCount,r=t.childCount;e:for(let s=0,c=0;s<r;s++){const i=t.child(s);for(let a=c,d=Math.min(l,s+3);a<d;a++)if(e.child(a)==i){c=a+1,n+=i.nodeSize;continue e}o(i,n),c<l&&e.child(c).sameMarkup(i)?Me(e.child(c),i,n+1,o):i.nodesBetween(0,i.content.size,o,n+1),n+=i.nodeSize}}function ze(e,t){let n;const o=(l,r)=>{l.type.spec.tableRole=="table"&&(n=at(e,l,r,n))};return t?t.doc!=e.doc&&Me(t.doc,e.doc,0,o):e.doc.descendants(o),n}function at(e,t,n,o){const l=C.get(t);if(!l.problems)return o;o||(o=e.tr);const r=[];for(let i=0;i<l.height;i++)r.push(0);for(let i=0;i<l.problems.length;i++){const a=l.problems[i];if(a.type=="collision"){const d=t.nodeAt(a.pos);if(!d)continue;const u=d.attrs;for(let f=0;f<u.rowspan;f++)r[a.row+f]+=a.n;o.setNodeMarkup(o.mapping.map(n+1+a.pos),null,B(u,u.colspan-a.n,a.n))}else if(a.type=="missing")r[a.row]+=a.n;else if(a.type=="overlong_rowspan"){const d=t.nodeAt(a.pos);if(!d)continue;o.setNodeMarkup(o.mapping.map(n+1+a.pos),null,{...d.attrs,rowspan:d.attrs.rowspan-a.n})}else if(a.type=="colwidth mismatch"){const d=t.nodeAt(a.pos);if(!d)continue;o.setNodeMarkup(o.mapping.map(n+1+a.pos),null,{...d.attrs,colwidth:a.colwidth})}else if(a.type=="zero_sized"){const d=o.mapping.map(n);o.delete(d,d+t.nodeSize)}}let s,c;for(let i=0;i<r.length;i++)r[i]&&(s==null&&(s=i),c=i);for(let i=0,a=n+1;i<l.height;i++){const d=t.child(i),u=a+d.nodeSize,f=r[i];if(f>0){let p="cell";d.firstChild&&(p=d.firstChild.type.spec.tableRole);const h=[];for(let m=0;m<f;m++){const w=v(e.schema)[p].createAndFill();w&&h.push(w)}const g=(i==0||s==i-1)&&c==i?a+1:u-1;o.insert(o.mapping.map(g),h)}a=u}return o.setMeta(ct,{fixTables:!0})}function z(e){const t=e.selection,n=J(e),o=n.node(-1),l=n.start(-1),r=C.get(o);return{...t instanceof b?r.rectBetween(t.$anchorCell.pos-l,t.$headCell.pos-l):r.findCell(n.pos-l),tableStart:l,map:r,table:o}}function Ne(e,{map:t,tableStart:n,table:o},l){let r=l>0?-1:0;nt(t,o,l+r)&&(r=l==0||l==t.width?null:0);for(let s=0;s<t.height;s++){const c=s*t.width+l;if(l>0&&l<t.width&&t.map[c-1]==t.map[c]){const i=t.map[c],a=o.nodeAt(i);e.setNodeMarkup(e.mapping.map(n+i),null,xe(a.attrs,l-t.colCount(i))),s+=a.attrs.rowspan-1}else{const i=r==null?v(o.type.schema).cell:o.nodeAt(t.map[c+r]).type,a=t.positionAt(s,l,o);e.insert(e.mapping.map(n+a),i.createAndFill())}}return e}function dt(e,t){if(!T(e))return!1;if(t){const n=z(e);t(Ne(e.tr,n,n.left))}return!0}function ut(e,t){if(!T(e))return!1;if(t){const n=z(e);t(Ne(e.tr,n,n.right))}return!0}function ft(e,{map:t,table:n,tableStart:o},l){const r=e.mapping.maps.length;for(let s=0;s<t.height;){const c=s*t.width+l,i=t.map[c],a=n.nodeAt(i),d=a.attrs;if(l>0&&t.map[c-1]==i||l<t.width-1&&t.map[c+1]==i)e.setNodeMarkup(e.mapping.slice(r).map(o+i),null,B(d,l-t.colCount(i)));else{const u=e.mapping.slice(r).map(o+i);e.delete(u,u+a.nodeSize)}s+=d.rowspan}}function ht(e,t){if(!T(e))return!1;if(t){const n=z(e),o=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let l=n.right-1;ft(o,n,l),l!=n.left;l--){const r=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!r)throw new RangeError("No table found");n.table=r,n.map=C.get(r)}t(o)}return!0}function pt(e,t,n){var o;const l=v(t.type.schema).header_cell;for(let r=0;r<e.width;r++)if(((o=t.nodeAt(e.map[r+n*e.width]))===null||o===void 0?void 0:o.type)!=l)return!1;return!0}function Ee(e,{map:t,tableStart:n,table:o},l){let r=n;for(let a=0;a<l;a++)r+=o.child(a).nodeSize;const s=[];let c=l>0?-1:0;pt(t,o,l+c)&&(c=l==0||l==t.height?null:0);for(let a=0,d=t.width*l;a<t.width;a++,d++)if(l>0&&l<t.height&&t.map[d]==t.map[d-t.width]){const u=t.map[d],f=o.nodeAt(u).attrs;e.setNodeMarkup(n+u,null,{...f,rowspan:f.rowspan+1}),a+=f.colspan-1}else{var i;const u=c==null?v(o.type.schema).cell:(i=o.nodeAt(t.map[d+c*t.width]))===null||i===void 0?void 0:i.type,f=u?.createAndFill();f&&s.push(f)}return e.insert(r,v(o.type.schema).row.create(null,s)),e}function mt(e,t){if(!T(e))return!1;if(t){const n=z(e);t(Ee(e.tr,n,n.top))}return!0}function gt(e,t){if(!T(e))return!1;if(t){const n=z(e);t(Ee(e.tr,n,n.bottom))}return!0}function wt(e,{map:t,table:n,tableStart:o},l){let r=0;for(let a=0;a<l;a++)r+=n.child(a).nodeSize;const s=r+n.child(l).nodeSize,c=e.mapping.maps.length;e.delete(r+o,s+o);const i=new Set;for(let a=0,d=l*t.width;a<t.width;a++,d++){const u=t.map[d];if(!i.has(u)){if(i.add(u),l>0&&u==t.map[d-t.width]){const f=n.nodeAt(u).attrs;e.setNodeMarkup(e.mapping.slice(c).map(u+o),null,{...f,rowspan:f.rowspan-1}),a+=f.colspan-1}else if(l<t.height&&u==t.map[d+t.width]){const f=n.nodeAt(u),p=f.attrs,h=f.type.create({...p,rowspan:f.attrs.rowspan-1},f.content),g=t.positionAt(l+1,a,n);e.insert(e.mapping.slice(c).map(o+g),h),a+=p.colspan-1}}}}function bt(e,t){if(!T(e))return!1;if(t){const n=z(e),o=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let l=n.bottom-1;wt(o,n,l),l!=n.top;l--){const r=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!r)throw new RangeError("No table found");n.table=r,n.map=C.get(n.table)}t(o)}return!0}function ce(e){const t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function Ct({width:e,height:t,map:n},o){let l=o.top*e+o.left,r=l,s=(o.bottom-1)*e+o.left,c=l+(o.right-o.left-1);for(let i=o.top;i<o.bottom;i++){if(o.left>0&&n[r]==n[r-1]||o.right<e&&n[c]==n[c+1])return!0;r+=e,c+=e}for(let i=o.left;i<o.right;i++){if(o.top>0&&n[l]==n[l-e]||o.bottom<t&&n[s]==n[s+e])return!0;l++,s++}return!1}function ae(e,t){const n=e.selection;if(!(n instanceof b)||n.$anchorCell.pos==n.$headCell.pos)return!1;const o=z(e),{map:l}=o;if(Ct(l,o))return!1;if(t){const r=e.tr,s={};let c=M.empty,i,a;for(let d=o.top;d<o.bottom;d++)for(let u=o.left;u<o.right;u++){const f=l.map[d*l.width+u],p=o.table.nodeAt(f);if(!(s[f]||!p))if(s[f]=!0,i==null)i=f,a=p;else{ce(p)||(c=c.append(p.content));const h=r.mapping.map(f+o.tableStart);r.delete(h,h+p.nodeSize)}}if(i==null||a==null)return!0;if(r.setNodeMarkup(i+o.tableStart,null,{...xe(a.attrs,a.attrs.colspan,o.right-o.left-a.attrs.colspan),rowspan:o.bottom-o.top}),c.size>0){const d=i+1+a.content.size,u=ce(a)?i+1:d;r.replaceWith(u+o.tableStart,d+o.tableStart,c)}r.setSelection(new b(r.doc.resolve(i+o.tableStart))),t(r)}return!0}function de(e,t){const n=v(e.schema);return yt(({node:o})=>n[o.type.spec.tableRole])(e,t)}function yt(e){return(t,n)=>{const o=t.selection;let l,r;if(o instanceof b){if(o.$anchorCell.pos!=o.$headCell.pos)return!1;l=o.$anchorCell.nodeAfter,r=o.$anchorCell.pos}else{var s;if(l=Ze(o.$from),!l)return!1;r=(s=W(o.$from))===null||s===void 0?void 0:s.pos}if(l==null||r==null||l.attrs.colspan==1&&l.attrs.rowspan==1)return!1;if(n){let c=l.attrs;const i=[],a=c.colwidth;c.rowspan>1&&(c={...c,rowspan:1}),c.colspan>1&&(c={...c,colspan:1});const d=z(t),u=t.tr;for(let p=0;p<d.right-d.left;p++)i.push(a?{...c,colwidth:a&&a[p]?[a[p]]:null}:c);let f;for(let p=d.top;p<d.bottom;p++){let h=d.map.positionAt(p,d.left,d.table);p==d.top&&(h+=l.nodeSize);for(let g=d.left,m=0;g<d.right;g++,m++)g==d.left&&p==d.top||u.insert(f=u.mapping.map(h+d.tableStart,1),e({node:l,row:p,col:g}).createAndFill(i[m]))}u.setNodeMarkup(r,e({node:l,row:d.top,col:d.left}),i[0]),o instanceof b&&u.setSelection(new b(u.doc.resolve(o.$anchorCell.pos),f?u.doc.resolve(f):void 0)),n(u)}return!0}}function At(e,t){return function(n,o){if(!T(n))return!1;const l=J(n);if(l.nodeAfter.attrs[e]===t)return!1;if(o){const r=n.tr;n.selection instanceof b?n.selection.forEachCell((s,c)=>{s.attrs[e]!==t&&r.setNodeMarkup(c,null,{...s.attrs,[e]:t})}):r.setNodeMarkup(l.pos,null,{...l.nodeAfter.attrs,[e]:t}),o(r)}return!0}}function St(e){return function(t,n){if(!T(t))return!1;if(n){const o=v(t.schema),l=z(t),r=t.tr,s=l.map.cellsInRect(e=="column"?{left:l.left,top:0,right:l.right,bottom:l.map.height}:e=="row"?{left:0,top:l.top,right:l.map.width,bottom:l.bottom}:l),c=s.map(i=>l.table.nodeAt(i));for(let i=0;i<s.length;i++)c[i].type==o.header_cell&&r.setNodeMarkup(l.tableStart+s[i],o.cell,c[i].attrs);if(r.steps.length===0)for(let i=0;i<s.length;i++)r.setNodeMarkup(l.tableStart+s[i],o.header_cell,c[i].attrs);n(r)}return!0}}function ue(e,t,n){const o=t.map.cellsInRect({left:0,top:0,right:e=="row"?t.map.width:1,bottom:e=="column"?t.map.height:1});for(let l=0;l<o.length;l++){const r=t.table.nodeAt(o[l]);if(r&&r.type!==n.header_cell)return!1}return!0}function I(e,t){return t=t||{useDeprecatedLogic:!1},t.useDeprecatedLogic?St(e):function(n,o){if(!T(n))return!1;if(o){const l=v(n.schema),r=z(n),s=n.tr,c=ue("row",r,l),i=ue("column",r,l),a=(e==="column"?c:e==="row"&&i)?1:0,d=e=="column"?{left:0,top:a,right:1,bottom:r.map.height}:e=="row"?{left:a,top:0,right:r.map.width,bottom:1}:r,u=e=="column"?i?l.cell:l.header_cell:e=="row"?c?l.cell:l.header_cell:l.cell;r.map.cellsInRect(d).forEach(f=>{const p=f+r.tableStart,h=s.doc.nodeAt(p);h&&s.setNodeMarkup(p,u,h.attrs)}),o(s)}return!0}}I("row",{useDeprecatedLogic:!0});I("column",{useDeprecatedLogic:!0});const vt=I("cell",{useDeprecatedLogic:!0});function Rt(e,t){if(t<0){const n=e.nodeBefore;if(n)return e.pos-n.nodeSize;for(let o=e.index(-1)-1,l=e.before();o>=0;o--){const r=e.node(-1).child(o),s=r.lastChild;if(s)return l-1-s.nodeSize;l-=r.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;const n=e.node(-1);for(let o=e.indexAfter(-1),l=e.after();o<n.childCount;o++){const r=n.child(o);if(r.childCount)return l+1;l+=r.nodeSize}}return null}function fe(e){return function(t,n){if(!T(t))return!1;const o=Rt(J(t),e);if(o==null)return!1;if(n){const l=t.doc.resolve(o);n(t.tr.setSelection(H.between(l,tt(l))).scrollIntoView())}return!0}}function xt(e,t){const n=e.selection.$anchor;for(let o=n.depth;o>0;o--)if(n.node(o).type.spec.tableRole=="table")return t&&t(e.tr.delete(n.before(o),n.after(o)).scrollIntoView()),!0;return!1}function j(e,t){const n=e.selection;if(!(n instanceof b))return!1;if(t){const o=e.tr,l=v(e.schema).cell.createAndFill().content;n.forEachCell((r,s)=>{r.content.eq(l)||o.replace(o.mapping.map(s+1),o.mapping.map(s+r.nodeSize-1),new L(l,0,0))}),o.docChanged&&t(o)}return!0}function Tt(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:o}=e;for(;t.childCount==1&&(n>0&&o>0||t.child(0).type.spec.tableRole=="table");)n--,o--,t=t.child(0).content;const l=t.child(0),r=l.type.spec.tableRole,s=l.type.schema,c=[];if(r=="row")for(let i=0;i<t.childCount;i++){let a=t.child(i).content;const d=i?0:Math.max(0,n-1),u=i<t.childCount-1?0:Math.max(0,o-1);(d||u)&&(a=oe(v(s).row,new L(a,d,u)).content),c.push(a)}else if(r=="cell"||r=="header_cell")c.push(n||o?oe(v(s).row,new L(t,n,o)).content:t);else return null;return Mt(s,c)}function Mt(e,t){const n=[];for(let l=0;l<t.length;l++){const r=t[l];for(let s=r.childCount-1;s>=0;s--){const{rowspan:c,colspan:i}=r.child(s).attrs;for(let a=l;a<l+c;a++)n[a]=(n[a]||0)+i}}let o=0;for(let l=0;l<n.length;l++)o=Math.max(o,n[l]);for(let l=0;l<n.length;l++)if(l>=t.length&&t.push(M.empty),n[l]<o){const r=v(e).cell.createAndFill(),s=[];for(let c=n[l];c<o;c++)s.push(r);t[l]=t[l].append(M.from(s))}return{height:t.length,width:o,rows:t}}function oe(e,t){const n=e.createAndFill();return new _e(n).replace(0,n.content.size,t).doc}function zt({width:e,height:t,rows:n},o,l){if(e!=o){const r=[],s=[];for(let c=0;c<n.length;c++){const i=n[c],a=[];for(let d=r[c]||0,u=0;d<o;u++){let f=i.child(u%i.childCount);d+f.attrs.colspan>o&&(f=f.type.createChecked(B(f.attrs,f.attrs.colspan,d+f.attrs.colspan-o),f.content)),a.push(f),d+=f.attrs.colspan;for(let p=1;p<f.attrs.rowspan;p++)r[c+p]=(r[c+p]||0)+f.attrs.colspan}s.push(M.from(a))}n=s,e=o}if(t!=l){const r=[];for(let s=0,c=0;s<l;s++,c++){const i=[],a=n[c%t];for(let d=0;d<a.childCount;d++){let u=a.child(d);s+u.attrs.rowspan>l&&(u=u.type.create({...u.attrs,rowspan:Math.max(1,l-u.attrs.rowspan)},u.content)),i.push(u)}r.push(M.from(i))}n=r,t=l}return{width:e,height:t,rows:n}}function Nt(e,t,n,o,l,r,s){const c=e.doc.type.schema,i=v(c);let a,d;if(l>t.width)for(let u=0,f=0;u<t.height;u++){const p=n.child(u);f+=p.nodeSize;const h=[];let g;p.lastChild==null||p.lastChild.type==i.cell?g=a||(a=i.cell.createAndFill()):g=d||(d=i.header_cell.createAndFill());for(let m=t.width;m<l;m++)h.push(g);e.insert(e.mapping.slice(s).map(f-1+o),h)}if(r>t.height){const u=[];for(let h=0,g=(t.height-1)*t.width;h<Math.max(t.width,l);h++){const m=h>=t.width?!1:n.nodeAt(t.map[g+h]).type==i.header_cell;u.push(m?d||(d=i.header_cell.createAndFill()):a||(a=i.cell.createAndFill()))}const f=i.row.create(null,M.from(u)),p=[];for(let h=t.height;h<r;h++)p.push(f);e.insert(e.mapping.slice(s).map(o+n.nodeSize-2),p)}return!!(a||d)}function he(e,t,n,o,l,r,s,c){if(s==0||s==t.height)return!1;let i=!1;for(let a=l;a<r;a++){const d=s*t.width+a,u=t.map[d];if(t.map[d-t.width]==u){i=!0;const f=n.nodeAt(u),{top:p,left:h}=t.findCell(u);e.setNodeMarkup(e.mapping.slice(c).map(u+o),null,{...f.attrs,rowspan:s-p}),e.insert(e.mapping.slice(c).map(t.positionAt(s,h,n)),f.type.createAndFill({...f.attrs,rowspan:p+f.attrs.rowspan-s})),a+=f.attrs.colspan-1}}return i}function pe(e,t,n,o,l,r,s,c){if(s==0||s==t.width)return!1;let i=!1;for(let a=l;a<r;a++){const d=a*t.width+s,u=t.map[d];if(t.map[d-1]==u){i=!0;const f=n.nodeAt(u),p=t.colCount(u),h=e.mapping.slice(c).map(u+o);e.setNodeMarkup(h,null,B(f.attrs,s-p,f.attrs.colspan-(s-p))),e.insert(h+f.nodeSize,f.type.createAndFill(B(f.attrs,0,s-p))),a+=f.attrs.rowspan-1}}return i}function me(e,t,n,o,l){let r=n?e.doc.nodeAt(n-1):e.doc;if(!r)throw new Error("No table found");let s=C.get(r);const{top:c,left:i}=o,a=i+l.width,d=c+l.height,u=e.tr;let f=0;function p(){if(r=n?u.doc.nodeAt(n-1):u.doc,!r)throw new Error("No table found");s=C.get(r),f=u.mapping.maps.length}Nt(u,s,r,n,a,d,f)&&p(),he(u,s,r,n,i,a,c,f)&&p(),he(u,s,r,n,i,a,d,f)&&p(),pe(u,s,r,n,c,d,i,f)&&p(),pe(u,s,r,n,c,d,a,f)&&p();for(let h=c;h<d;h++){const g=s.positionAt(h,i,r),m=s.positionAt(h,a,r);u.replace(u.mapping.slice(f).map(g+n),u.mapping.slice(f).map(m+n),new L(l.rows[h-c],0,0))}p(),u.setSelection(new b(u.doc.resolve(n+s.positionAt(c,i,r)),u.doc.resolve(n+s.positionAt(d-1,a-1,r)))),t(u)}const Et=Oe({ArrowLeft:F("horiz",-1),ArrowRight:F("horiz",1),ArrowUp:F("vert",-1),ArrowDown:F("vert",1),"Shift-ArrowLeft":_("horiz",-1),"Shift-ArrowRight":_("horiz",1),"Shift-ArrowUp":_("vert",-1),"Shift-ArrowDown":_("vert",1),Backspace:j,"Mod-Backspace":j,Delete:j,"Mod-Delete":j});function K(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function F(e,t){return(n,o,l)=>{if(!l)return!1;const r=n.selection;if(r instanceof b)return K(n,o,E.near(r.$headCell,t));if(e!="horiz"&&!r.empty)return!1;const s=He(l,e,t);if(s==null)return!1;if(e=="horiz")return K(n,o,E.near(n.doc.resolve(r.head+t),t));{const c=n.doc.resolve(s),i=Re(c,e,t);let a;return i?a=E.near(i,1):t<0?a=E.near(n.doc.resolve(c.before(-1)),-1):a=E.near(n.doc.resolve(c.after(-1)),1),K(n,o,a)}}}function _(e,t){return(n,o,l)=>{if(!l)return!1;const r=n.selection;let s;if(r instanceof b)s=r;else{const i=He(l,e,t);if(i==null)return!1;s=new b(n.doc.resolve(i))}const c=Re(s.$headCell,e,t);return c?K(n,o,new b(s.$anchorCell,c)):!1}}function Ht(e,t){const n=e.state.doc,o=W(n.resolve(t));return o?(e.dispatch(e.state.tr.setSelection(new b(o))),!0):!1}function $t(e,t,n){if(!T(e.state))return!1;let o=Tt(n);const l=e.state.selection;if(l instanceof b){o||(o={width:1,height:1,rows:[M.from(oe(v(e.state.schema).cell,n))]});const r=l.$anchorCell.node(-1),s=l.$anchorCell.start(-1),c=C.get(r).rectBetween(l.$anchorCell.pos-s,l.$headCell.pos-s);return o=zt(o,c.right-c.left,c.bottom-c.top),me(e.state,e.dispatch,s,c,o),!0}else if(o){const r=J(e.state),s=r.start(-1);return me(e.state,e.dispatch,s,C.get(r.node(-1)).findCell(r.pos-s),o),!0}else return!1}function Lt(e,t){var n;if(t.button!=0||t.ctrlKey||t.metaKey)return;const o=ge(e,t.target);let l;if(t.shiftKey&&e.state.selection instanceof b)r(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&o&&(l=W(e.state.selection.$anchor))!=null&&((n=Y(e,t))===null||n===void 0?void 0:n.pos)!=l.pos)r(l,t),t.preventDefault();else if(!o)return;function r(i,a){let d=Y(e,a);const u=$.getState(e.state)==null;if(!d||!ie(i,d))if(u)d=i;else return;const f=new b(i,d);if(u||!e.state.selection.eq(f)){const p=e.state.tr.setSelection(f);u&&p.setMeta($,i.pos),e.dispatch(p)}}function s(){e.root.removeEventListener("mouseup",s),e.root.removeEventListener("dragstart",s),e.root.removeEventListener("mousemove",c),$.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta($,-1))}function c(i){const a=i,d=$.getState(e.state);let u;if(d!=null)u=e.state.doc.resolve(d);else if(ge(e,a.target)!=o&&(u=Y(e,t),!u))return s();u&&r(u,a)}e.root.addEventListener("mouseup",s),e.root.addEventListener("dragstart",s),e.root.addEventListener("mousemove",c)}function He(e,t,n){if(!(e.state.selection instanceof H))return null;const{$head:o}=e.state.selection;for(let l=o.depth-1;l>=0;l--){const r=o.node(l);if((n<0?o.index(l):o.indexAfter(l))!=(n<0?0:r.childCount))return null;if(r.type.spec.tableRole=="cell"||r.type.spec.tableRole=="header_cell"){const s=o.before(l),c=t=="vert"?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(c)?s:null}}return null}function ge(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName=="TD"||t.nodeName=="TH")return t;return null}function Y(e,t){const n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:o,pos:l}=n;return o>=0&&W(e.state.doc.resolve(o))||W(e.state.doc.resolve(l))}var kt=class{constructor(t,n){this.node=t,this.defaultCellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${n}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),le(t,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!=this.node.type?!1:(this.node=t,le(t,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(t){return t.type=="attributes"&&(t.target==this.table||this.colgroup.contains(t.target))}};function le(e,t,n,o,l,r){let s=0,c=!0,i=t.firstChild;const a=e.firstChild;if(a){for(let u=0,f=0;u<a.childCount;u++){const{colspan:p,colwidth:h}=a.child(u).attrs;for(let g=0;g<p;g++,f++){const m=l==f?r:h&&h[g],w=m?m+"px":"";if(s+=m||o,m||(c=!1),i)i.style.width!=w&&(i.style.width=w),i=i.nextSibling;else{const S=document.createElement("col");S.style.width=w,t.appendChild(S)}}}for(;i;){var d;const u=i.nextSibling;(d=i.parentNode)===null||d===void 0||d.removeChild(i),i=u}c?(n.style.width=s+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=s+"px")}}const x=new se("tableColumnResizing");function Wt({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:o=kt,lastColumnResizable:l=!0}={}){const r=new ve({key:x,state:{init(s,c){var i;const a=(i=r.spec)===null||i===void 0||(i=i.props)===null||i===void 0?void 0:i.nodeViews,d=v(c.schema).table.name;return o&&a&&(a[d]=(u,f)=>new o(u,n,f)),new Bt(-1,!1)},apply(s,c){return c.apply(s)}},props:{attributes:s=>{const c=x.getState(s);return c&&c.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(s,c)=>{Dt(s,c,e,l)},mouseleave:s=>{It(s)},mousedown:(s,c)=>{Pt(s,c,t,n)}},decorations:s=>{const c=x.getState(s);if(c&&c.activeHandle>-1)return Vt(s,c.activeHandle)},nodeViews:{}}});return r}var Bt=class X{constructor(t,n){this.activeHandle=t,this.dragging=n}apply(t){const n=this,o=t.getMeta(x);if(o&&o.setHandle!=null)return new X(o.setHandle,!1);if(o&&o.setDragging!==void 0)return new X(n.activeHandle,o.setDragging);if(n.activeHandle>-1&&t.docChanged){let l=t.mapping.map(n.activeHandle,-1);return ne(t.doc.resolve(l))||(l=-1),new X(l,n.dragging)}return n}};function Dt(e,t,n,o){if(!e.editable)return;const l=x.getState(e.state);if(l&&!l.dragging){const r=jt(t.target);let s=-1;if(r){const{left:c,right:i}=r.getBoundingClientRect();t.clientX-c<=n?s=we(e,t,"left",n):i-t.clientX<=n&&(s=we(e,t,"right",n))}if(s!=l.activeHandle){if(!o&&s!==-1){const c=e.state.doc.resolve(s),i=c.node(-1),a=C.get(i),d=c.start(-1);if(a.colCount(c.pos-d)+c.nodeAfter.attrs.colspan-1==a.width-1)return}$e(e,s)}}}function It(e){if(!e.editable)return;const t=x.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&$e(e,-1)}function Pt(e,t,n,o){var l;if(!e.editable)return!1;const r=(l=e.dom.ownerDocument.defaultView)!==null&&l!==void 0?l:window,s=x.getState(e.state);if(!s||s.activeHandle==-1||s.dragging)return!1;const c=e.state.doc.nodeAt(s.activeHandle),i=Ot(e,s.activeHandle,c.attrs);e.dispatch(e.state.tr.setMeta(x,{setDragging:{startX:t.clientX,startWidth:i}}));function a(u){r.removeEventListener("mouseup",a),r.removeEventListener("mousemove",d);const f=x.getState(e.state);f?.dragging&&(Ft(e,f.activeHandle,be(f.dragging,u,n)),e.dispatch(e.state.tr.setMeta(x,{setDragging:null})))}function d(u){if(!u.which)return a(u);const f=x.getState(e.state);if(f&&f.dragging){const p=be(f.dragging,u,n);Ce(e,f.activeHandle,p,o)}}return Ce(e,s.activeHandle,i,o),r.addEventListener("mouseup",a),r.addEventListener("mousemove",d),t.preventDefault(),!0}function Ot(e,t,{colspan:n,colwidth:o}){const l=o&&o[o.length-1];if(l)return l;const r=e.domAtPos(t);let s=r.node.childNodes[r.offset].offsetWidth,c=n;if(o)for(let i=0;i<n;i++)o[i]&&(s-=o[i],c--);return s/c}function jt(e){for(;e&&e.nodeName!="TD"&&e.nodeName!="TH";)e=e.classList&&e.classList.contains("ProseMirror")?null:e.parentNode;return e}function we(e,t,n,o){const l=n=="right"?-o:o,r=e.posAtCoords({left:t.clientX+l,top:t.clientY});if(!r)return-1;const{pos:s}=r,c=W(e.state.doc.resolve(s));if(!c)return-1;if(n=="right")return c.pos;const i=C.get(c.node(-1)),a=c.start(-1),d=i.map.indexOf(c.pos-a);return d%i.width==0?-1:a+i.map[d-1]}function be(e,t,n){const o=t.clientX-e.startX;return Math.max(n,e.startWidth+o)}function $e(e,t){e.dispatch(e.state.tr.setMeta(x,{setHandle:t}))}function Ft(e,t,n){const o=e.state.doc.resolve(t),l=o.node(-1),r=C.get(l),s=o.start(-1),c=r.colCount(o.pos-s)+o.nodeAfter.attrs.colspan-1,i=e.state.tr;for(let a=0;a<r.height;a++){const d=a*r.width+c;if(a&&r.map[d]==r.map[d-r.width])continue;const u=r.map[d],f=l.nodeAt(u).attrs,p=f.colspan==1?0:c-r.colCount(u);if(f.colwidth&&f.colwidth[p]==n)continue;const h=f.colwidth?f.colwidth.slice():_t(f.colspan);h[p]=n,i.setNodeMarkup(s+u,null,{...f,colwidth:h})}i.docChanged&&e.dispatch(i)}function Ce(e,t,n,o){const l=e.state.doc.resolve(t),r=l.node(-1),s=l.start(-1),c=C.get(r).colCount(l.pos-s)+l.nodeAfter.attrs.colspan-1;let i=e.domAtPos(l.start(-1)).node;for(;i&&i.nodeName!="TABLE";)i=i.parentNode;i&&le(r,i.firstChild,i,o,c,n)}function _t(e){return Array(e).fill(0)}function Vt(e,t){const n=[],o=e.doc.resolve(t),l=o.node(-1);if(!l)return Q.empty;const r=C.get(l),s=o.start(-1),c=r.colCount(o.pos-s)+o.nodeAfter.attrs.colspan-1;for(let a=0;a<r.height;a++){const d=c+a*r.width;if((c==r.width-1||r.map[d]!=r.map[d+1])&&(a==0||r.map[d]!=r.map[d-r.width])){var i;const u=r.map[d],f=s+u+l.nodeAt(u).nodeSize-1,p=document.createElement("div");p.className="column-resize-handle",!((i=x.getState(e))===null||i===void 0)&&i.dragging&&n.push(Z.node(s+u,s+u+l.nodeAt(u).nodeSize,{class:"column-resize-dragging"})),n.push(Z.widget(f,p))}}return Q.create(e.doc,n)}function Kt({allowTableNodeSelection:e=!1}={}){return new ve({key:$,state:{init(){return null},apply(t,n){const o=t.getMeta($);if(o!=null)return o==-1?null:o;if(n==null||!t.docChanged)return n;const{deleted:l,pos:r}=t.mapping.mapResult(n);return l?null:r}},props:{decorations:lt,handleDOMEvents:{mousedown:Lt},createSelectionBetween(t){return $.getState(t.state)!=null?t.state.selection:null},handleTripleClick:Ht,handleKeyDown:Et,handlePaste:$t},appendTransaction(t,n,o){return it(o,ze(o,n),e)}})}function U(e){return e==="left"||e==="right"||e==="center"?e:null}function Xt(e){const t=(e.style.textAlign||"").trim().toLowerCase(),n=(e.getAttribute("align")||"").trim().toLowerCase();return U(t||n)}function qt(e){return U(e?.align)}function Le(){return{default:null,parseHTML:e=>Xt(e),renderHTML:e=>e.align?{style:`text-align: ${e.align}`}:{}}}function Ut(e){var t;const n=e.parentElement,o=e.closest("table");if(!n||!o)return null;const l=Array.from(n.children).indexOf(e),r=(t=o.querySelectorAll("colgroup > col")[l])===null||t===void 0?void 0:t.getAttribute("width");return r?[parseInt(r,10)]:null}function ke(e){const t=e.getAttribute("colwidth");return t?t.split(",").map(n=>parseInt(n,10)):Ut(e)}const Jt=/[ \t\r\n\f]+/g;function We(e){var t;return e.children.length>0?!1:((t=e.textContent)!==null&&t!==void 0?t:"").replace(Jt,"")===""}function Be(e){const t=e.createAndFill();if(!t)throw new Error(`[tiptap error]: "${e.name}" has no default content to backfill.`);return t.content}const Gt=P.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:ke},align:Le()}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td",getAttrs:e=>We(e)?{}:!1,getContent:(e,t)=>Be(t.nodes[this.name])},{tag:"td"}]},renderHTML({HTMLAttributes:e}){return["td",k(this.options.HTMLAttributes,e),0]}}),Yt=P.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:ke},align:Le()}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th",getAttrs:e=>We(e)?{}:!1,getContent:(e,t)=>Be(t.nodes[this.name])},{tag:"th"}]},renderHTML({HTMLAttributes:e}){return["th",k(this.options.HTMLAttributes,e),0]}}),Qt=P.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:e}){return["tr",k(this.options.HTMLAttributes,e),0]}});function re(e,t){return t?["width",`${Math.max(t,e)}px`]:["min-width",`${e}px`]}function ye(e,t,n,o,l,r){let s=0,c=!0,i=t.firstChild;const a=e.firstChild;if(a!==null)for(let f=0,p=0;f<a.childCount;f+=1){const{colspan:h,colwidth:g}=a.child(f).attrs;for(let m=0;m<h;m+=1,p+=1){const w=l===p?r:g&&g[m],S=w?`${w}px`:"";if(s+=w||o,w||(c=!1),i){if(i.style.width!==S){const[y,A]=re(o,w);i.style.setProperty(y,A)}i=i.nextSibling}else{const y=document.createElement("col"),[A,R]=re(o,w);y.style.setProperty(A,R),t.appendChild(y)}}}for(;i;){var d;const f=i.nextSibling;(d=i.parentNode)===null||d===void 0||d.removeChild(i),i=f}const u=e.attrs.style&&typeof e.attrs.style=="string"&&/\bwidth\s*:/i.test(e.attrs.style);c&&!u?(n.style.width=`${s}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${s}px`)}var Zt=class{constructor(e,t,n,o={}){this.node=e,this.cellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table"));for(const[l,r]of Object.entries(o))r!=null&&(l==="style"?this.table.style.cssText=String(r):this.table.setAttribute(l,String(r)));e.attrs.style&&(this.table.style.cssText=e.attrs.style),this.colgroup=this.table.appendChild(document.createElement("colgroup")),ye(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!==this.node.type?!1:(this.node=e,ye(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){const t=e.target,n=this.dom.contains(t),o=this.contentDOM.contains(t);return!!(n&&!o&&(e.type==="attributes"||e.type==="childList"||e.type==="characterData"))}};function en(e,t,n,o){let l=0,r=!0;const s=[],c=e.firstChild;if(!c)return{};for(let d=0,u=0;d<c.childCount;d+=1){const{colspan:f,colwidth:p}=c.child(d).attrs;for(let h=0;h<f;h+=1,u+=1){const g=n===u?o:p&&p[h];l+=g||t,g||(r=!1);const[m,w]=re(t,g);s.push(["col",{style:`${m}: ${w}`}])}}const i=r?`${l}px`:"",a=r?"":`${l}px`;return{colgroup:["colgroup",{},...s],tableWidth:i,tableMinWidth:a}}function Ae(e,t){return e.createAndFill()}function tn(e){if(e.cached.tableNodeTypes)return e.cached.tableNodeTypes;const t={};return Object.keys(e.nodes).forEach(n=>{const o=e.nodes[n];o.spec.tableRole&&(t[o.spec.tableRole]=o)}),e.cached.tableNodeTypes=t,t}function nn(e,t,n,o,l){const r=tn(e),s=[],c=[];for(let a=0;a<n;a+=1){const d=Ae(r.cell);if(d&&c.push(d),o){const u=Ae(r.header_cell);u&&s.push(u)}}const i=[];for(let a=0;a<t;a+=1)i.push(r.row.createChecked(null,o&&a===0?s:c));return r.table.createChecked(null,i)}function on(e){return e instanceof b}const V=({editor:e})=>{const{selection:t}=e.state;if(!on(t))return!1;let n=0;const o=q(t.ranges[0].$from,l=>l.type.name==="table");return o?.node.descendants(l=>{if(l.type.name==="table")return!1;["tableCell","tableHeader"].includes(l.type.name)&&(n+=1)}),n!==t.ranges.length?!1:(e.commands.deleteTable(),!0)};function Se(e,t){const n=e.mapping.map(t),o=q(e.selection.$from,s=>s.type.name==="table");if(o?.pos===n)return;const l=e.doc.nodeAt(n);if(!l)return;const r=n+l.nodeSize-1;e.setSelection(H.near(e.doc.resolve(r),-1))}function ln(e){let t="",n=0;for(;n<e.length;){if(e[n]==="\\"&&n+1<e.length){t+=e[n]+e[n+1],n+=2;continue}if(e[n]!=="`"){t+=e[n++];continue}let o=0;for(;n+o<e.length&&e[n+o]==="`";)o+=1;let l=n+o,r=!1;for(;l<e.length;){if(e[l]!=="`"){l+=1;continue}let s=0;for(;l+s<e.length&&e[l+s]==="`";)s+=1;if(s===o){const c=e.slice(n+o,l);t+=e.slice(n,n+o)+c.replace(/\\\||\|/g,i=>i==="|"?"\\|":i)+e.slice(l,l+o),n=l+o,r=!0;break}l+=s}r||(t+=e.slice(n,n+o),n+=o)}return t}function rn(e){return e.split(`
1
+ import{N as P,q as De,c as k,R as Ie,r as Pe,t as se,v as E,w as Oe,T as H,x as je,y as M,z as L,A as ve,D as Q,B as Z,C as Fe,G as _e,H as Ve,I as Ke,J as q,f as Xe}from"./usage-stats-CphPEBVe.js";const qe=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,Ue=P.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:e}){return["img",k(this.options.HTMLAttributes,e)]},parseMarkdown:(e,t)=>t.createNode("image",{src:e.href,title:e.title,alt:e.text}),renderMarkdown:e=>{var t,n,o,l,r,s;const c=(t=(n=e.attrs)===null||n===void 0?void 0:n.src)!==null&&t!==void 0?t:"",i=(o=(l=e.attrs)===null||l===void 0?void 0:l.alt)!==null&&o!==void 0?o:"",a=(r=(s=e.attrs)===null||s===void 0?void 0:s.title)!==null&&r!==void 0?r:"";return a?`![${i}](${c} "${a}")`:`![${i}](${c})`},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>"u")return null;const{directions:e,minWidth:t,minHeight:n,alwaysPreserveAspectRatio:o}=this.options.resize,l=new Set(["src","width","height"]);return({node:r,getPos:s,HTMLAttributes:c,editor:i})=>{const a=document.createElement("img");a.draggable=!1;const d=k(this.options.HTMLAttributes,c);Object.entries(d).forEach(([w,S])=>{if(S!=null)switch(w){case"src":case"width":case"height":break;default:a.setAttribute(w,S)}}),d.src!==null&&(a.src=d.src);let u={...c};const f=w=>{if(typeof w=="string"&&w!==""){a.getAttribute("src")!==w&&(a.src=w);return}a.hasAttribute("src")&&a.removeAttribute("src"),a.src!==""&&(a.src="")};f(c.src);const p=w=>{if(w.type!==r.type)return!1;const S=i.extensionManager.attributes.filter(A=>A.type===w.type.name),y=Pe(w,S);return Object.keys(u).forEach(A=>{!l.has(A)&&!(A in y)&&a.removeAttribute(A)}),Object.entries(y).forEach(([A,R])=>{l.has(A)||(R!=null?a.setAttribute(A,R):a.removeAttribute(A))}),f(y.src),u=y,!0},h=new Ie({element:a,editor:i,node:r,getPos:s,onResize:(w,S)=>{a.style.width=`${w}px`,a.style.height=`${S}px`},onCommit:(w,S)=>{const y=s();y!==void 0&&this.editor.chain().setNodeSelection(y).updateAttributes(this.name,{width:w,height:S}).run()},onUpdate:p,options:{directions:e,min:{width:t,height:n},preserveAspectRatio:o===!0}}),g=h.dom,m=()=>{g.style.visibility="",g.style.pointerEvents=""};return g.style.visibility="hidden",g.style.pointerEvents="none",a.complete&&a.naturalWidth>0?m():(a.onload=m,a.onerror=m),h}},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[De({find:qe,type:this.type,getAttributes:e=>{const[,,t,n,o]=e;return{src:n,alt:t,title:o}}})]}});var un=Ue;let ee,te;if(typeof WeakMap<"u"){let e=new WeakMap;ee=t=>e.get(t),te=(t,n)=>(e.set(t,n),n)}else{const e=[];let n=0;ee=o=>{for(let l=0;l<e.length;l+=2)if(e[l]==o)return e[l+1]},te=(o,l)=>(n==10&&(n=0),e[n++]=o,e[n++]=l)}var C=class{constructor(e,t,n,o){this.width=e,this.height=t,this.map=n,this.problems=o}findCell(e){for(let t=0;t<this.map.length;t++){const n=this.map[t];if(n!=e)continue;const o=t%this.width,l=t/this.width|0;let r=o+1,s=l+1;for(let c=1;r<this.width&&this.map[t+c]==n;c++)r++;for(let c=1;s<this.height&&this.map[t+this.width*c]==n;c++)s++;return{left:o,top:l,right:r,bottom:s}}throw new RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw new RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){const{left:o,right:l,top:r,bottom:s}=this.findCell(e);return t=="horiz"?(n<0?o==0:l==this.width)?null:this.map[r*this.width+(n<0?o-1:l)]:(n<0?r==0:s==this.height)?null:this.map[o+this.width*(n<0?r-1:s)]}rectBetween(e,t){const{left:n,right:o,top:l,bottom:r}=this.findCell(e),{left:s,right:c,top:i,bottom:a}=this.findCell(t);return{left:Math.min(n,s),top:Math.min(l,i),right:Math.max(o,c),bottom:Math.max(r,a)}}cellsInRect(e){const t=[],n={};for(let o=e.top;o<e.bottom;o++)for(let l=e.left;l<e.right;l++){const r=o*this.width+l,s=this.map[r];n[s]||(n[s]=!0,!(l==e.left&&l&&this.map[r-1]==s||o==e.top&&o&&this.map[r-this.width]==s)&&t.push(s))}return t}positionAt(e,t,n){for(let o=0,l=0;;o++){const r=l+n.child(o).nodeSize;if(o==e){let s=t+e*this.width;const c=(e+1)*this.width;for(;s<c&&this.map[s]<l;)s++;return s==c?r-1:this.map[s]}l=r}}static get(e){return ee(e)||te(e,Je(e))}};function Je(e){if(e.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+e.type.name);const t=Ge(e),n=e.childCount,o=[];let l=0,r=null;const s=[];for(let a=0,d=t*n;a<d;a++)o[a]=0;for(let a=0,d=0;a<n;a++){const u=e.child(a);d++;for(let h=0;;h++){for(;l<o.length&&o[l]!=0;)l++;if(h==u.childCount)break;const g=u.child(h),{colspan:m,rowspan:w,colwidth:S}=g.attrs;for(let y=0;y<w;y++){if(y+a>=n){(r||(r=[])).push({type:"overlong_rowspan",pos:d,n:w-y});break}const A=l+y*t;for(let R=0;R<m;R++){o[A+R]==0?o[A+R]=d:(r||(r=[])).push({type:"collision",row:a,pos:d,n:m-R});const O=S&&S[R];if(O){const D=(A+R)%t*2,G=s[D];G==null||G!=O&&s[D+1]==1?(s[D]=O,s[D+1]=1):G==O&&s[D+1]++}}}l+=m,d+=g.nodeSize}const f=(a+1)*t;let p=0;for(;l<f;)o[l++]==0&&p++;p&&(r||(r=[])).push({type:"missing",row:a,n:p}),d++}(t===0||n===0)&&(r||(r=[])).push({type:"zero_sized"});const c=new C(t,n,o,r);let i=!1;for(let a=0;!i&&a<s.length;a+=2)s[a]!=null&&s[a+1]<n&&(i=!0);return i&&Ye(c,s,e),c}function Ge(e){let t=-1,n=!1;for(let o=0;o<e.childCount;o++){const l=e.child(o);let r=0;if(n)for(let s=0;s<o;s++){const c=e.child(s);for(let i=0;i<c.childCount;i++){const a=c.child(i);s+a.attrs.rowspan>o&&(r+=a.attrs.colspan)}}for(let s=0;s<l.childCount;s++){const c=l.child(s);r+=c.attrs.colspan,c.attrs.rowspan>1&&(n=!0)}t==-1?t=r:t!=r&&(t=Math.max(t,r))}return t}function Ye(e,t,n){e.problems||(e.problems=[]);const o={};for(let l=0;l<e.map.length;l++){const r=e.map[l];if(o[r])continue;o[r]=!0;const s=n.nodeAt(r);if(!s)throw new RangeError(`No cell with offset ${r} found`);let c=null;const i=s.attrs;for(let a=0;a<i.colspan;a++){const d=t[(l+a)%e.width*2];d!=null&&(!i.colwidth||i.colwidth[a]!=d)&&((c||(c=Qe(i)))[a]=d)}c&&e.problems.unshift({type:"colwidth mismatch",pos:r,colwidth:c})}}function Qe(e){if(e.colwidth)return e.colwidth.slice();const t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function v(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(const n in e.nodes){const o=e.nodes[n],l=o.spec.tableRole;l&&(t[l]=o)}}return t}const $=new se("selectingCells");function W(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole=="row")return e.node(0).resolve(e.before(t+1));return null}function Ze(e){for(let t=e.depth;t>0;t--){const n=e.node(t).type.spec.tableRole;if(n==="cell"||n==="header_cell")return e.node(t)}return null}function T(e){const t=e.selection.$head;for(let n=t.depth;n>0;n--)if(t.node(n).type.spec.tableRole=="row")return!0;return!1}function J(e){const t=e.selection;if("$anchorCell"in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if("node"in t&&t.node&&t.node.type.spec.tableRole=="cell")return t.$anchor;const n=W(t.$head)||et(t.$head);if(n)return n;throw new RangeError(`No cell found around position ${t.head}`)}function et(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){const o=t.type.spec.tableRole;if(o=="cell"||o=="header_cell")return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){const o=t.type.spec.tableRole;if(o=="cell"||o=="header_cell")return e.doc.resolve(n-t.nodeSize)}}function ne(e){return e.parent.type.spec.tableRole=="row"&&!!e.nodeAfter}function tt(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function ie(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function Re(e,t,n){const o=e.node(-1),l=C.get(o),r=e.start(-1),s=l.nextCell(e.pos-r,t,n);return s==null?null:e.node(0).resolve(r+s)}function B(e,t,n=1){const o={...e,colspan:e.colspan-n};return o.colwidth&&(o.colwidth=o.colwidth.slice(),o.colwidth.splice(t,n),o.colwidth.some(l=>l>0)||(o.colwidth=null)),o}function xe(e,t,n=1){const o={...e,colspan:e.colspan+n};if(o.colwidth){o.colwidth=o.colwidth.slice();for(let l=0;l<n;l++)o.colwidth.splice(t,0,0)}return o}function nt(e,t,n){const o=v(t.type.schema).header_cell;for(let l=0;l<e.height;l++)if(t.nodeAt(e.map[n+l*e.width]).type!=o)return!1;return!0}var b=class N extends E{constructor(t,n=t){const o=t.node(-1),l=C.get(o),r=t.start(-1),s=l.rectBetween(t.pos-r,n.pos-r),c=t.node(0),i=l.cellsInRect(s).filter(d=>d!=n.pos-r);i.unshift(n.pos-r);const a=i.map(d=>{const u=o.nodeAt(d);if(!u)throw new RangeError(`No cell with offset ${d} found`);const f=r+d+1;return new je(c.resolve(f),c.resolve(f+u.content.size))});super(a[0].$from,a[0].$to,a),this.$anchorCell=t,this.$headCell=n}map(t,n){const o=t.resolve(n.map(this.$anchorCell.pos)),l=t.resolve(n.map(this.$headCell.pos));if(ne(o)&&ne(l)&&ie(o,l)){const r=this.$anchorCell.node(-1)!=o.node(-1);return r&&this.isRowSelection()?N.rowSelection(o,l):r&&this.isColSelection()?N.colSelection(o,l):new N(o,l)}return H.between(o,l)}content(){const t=this.$anchorCell.node(-1),n=C.get(t),o=this.$anchorCell.start(-1),l=n.rectBetween(this.$anchorCell.pos-o,this.$headCell.pos-o),r={},s=[];for(let i=l.top;i<l.bottom;i++){const a=[];for(let d=i*n.width+l.left,u=l.left;u<l.right;u++,d++){const f=n.map[d];if(r[f])continue;r[f]=!0;const p=n.findCell(f);let h=t.nodeAt(f);if(!h)throw new RangeError(`No cell with offset ${f} found`);const g=l.left-p.left,m=p.right-l.right;if(g>0||m>0){let w=h.attrs;if(g>0&&(w=B(w,0,g)),m>0&&(w=B(w,w.colspan-m,m)),p.left<l.left){if(h=h.type.createAndFill(w),!h)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(w)}`)}else h=h.type.create(w,h.content)}if(p.top<l.top||p.bottom>l.bottom){const w={...h.attrs,rowspan:Math.min(p.bottom,l.bottom)-Math.max(p.top,l.top)};p.top<l.top?h=h.type.createAndFill(w):h=h.type.create(w,h.content)}a.push(h)}s.push(t.child(i).copy(M.from(a)))}const c=this.isColSelection()&&this.isRowSelection()?t:s;return new L(M.from(c),1,1)}replace(t,n=L.empty){const o=t.steps.length,l=this.ranges;for(let s=0;s<l.length;s++){const{$from:c,$to:i}=l[s],a=t.mapping.slice(o);t.replace(a.map(c.pos),a.map(i.pos),s?L.empty:n)}const r=E.findFrom(t.doc.resolve(t.mapping.slice(o).map(this.to)),-1);r&&t.setSelection(r)}replaceWith(t,n){this.replace(t,new L(M.from(n),0,0))}forEachCell(t){const n=this.$anchorCell.node(-1),o=C.get(n),l=this.$anchorCell.start(-1),r=o.cellsInRect(o.rectBetween(this.$anchorCell.pos-l,this.$headCell.pos-l));for(let s=0;s<r.length;s++)t(n.nodeAt(r[s]),l+r[s])}isColSelection(){const t=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(t,n)>0)return!1;const o=t+this.$anchorCell.nodeAfter.attrs.rowspan,l=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(o,l)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){const o=t.node(-1),l=C.get(o),r=t.start(-1),s=l.findCell(t.pos-r),c=l.findCell(n.pos-r),i=t.node(0);return s.top<=c.top?(s.top>0&&(t=i.resolve(r+l.map[s.left])),c.bottom<l.height&&(n=i.resolve(r+l.map[l.width*(l.height-1)+c.right-1]))):(c.top>0&&(n=i.resolve(r+l.map[c.left])),s.bottom<l.height&&(t=i.resolve(r+l.map[l.width*(l.height-1)+s.right-1]))),new N(t,n)}isRowSelection(){const t=this.$anchorCell.node(-1),n=C.get(t),o=this.$anchorCell.start(-1),l=n.colCount(this.$anchorCell.pos-o),r=n.colCount(this.$headCell.pos-o);if(Math.min(l,r)>0)return!1;const s=l+this.$anchorCell.nodeAfter.attrs.colspan,c=r+this.$headCell.nodeAfter.attrs.colspan;return Math.max(s,c)==n.width}eq(t){return t instanceof N&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){const o=t.node(-1),l=C.get(o),r=t.start(-1),s=l.findCell(t.pos-r),c=l.findCell(n.pos-r),i=t.node(0);return s.left<=c.left?(s.left>0&&(t=i.resolve(r+l.map[s.top*l.width])),c.right<l.width&&(n=i.resolve(r+l.map[l.width*(c.top+1)-1]))):(c.left>0&&(n=i.resolve(r+l.map[c.top*l.width])),s.right<l.width&&(t=i.resolve(r+l.map[l.width*(s.top+1)-1]))),new N(t,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new N(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,o=n){return new N(t.resolve(n),t.resolve(o))}getBookmark(){return new ot(this.$anchorCell.pos,this.$headCell.pos)}};b.prototype.visible=!1;E.jsonID("cell",b);var ot=class Te{constructor(t,n){this.anchor=t,this.head=n}map(t){return new Te(t.map(this.anchor),t.map(this.head))}resolve(t){const n=t.resolve(this.anchor),o=t.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&o.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&o.index()<o.parent.childCount&&ie(n,o)?new b(n,o):E.near(o,1)}};function lt(e){if(!(e.selection instanceof b))return null;const t=[];return e.selection.forEachCell((n,o)=>{t.push(Z.node(o,o+n.nodeSize,{class:"selectedCell"}))}),Q.create(e.doc,t)}function rt({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,o=t.pos,l=e.depth;for(;l>=0&&!(e.after(l+1)<e.end(l));l--,n++);for(let r=t.depth;r>=0&&!(t.before(r+1)>t.start(r));r--,o--);return n==o&&/row|table/.test(e.node(l).type.spec.tableRole)}function st({$from:e,$to:t}){let n,o;for(let l=e.depth;l>0;l--){const r=e.node(l);if(r.type.spec.tableRole==="cell"||r.type.spec.tableRole==="header_cell"){n=r;break}}for(let l=t.depth;l>0;l--){const r=t.node(l);if(r.type.spec.tableRole==="cell"||r.type.spec.tableRole==="header_cell"){o=r;break}}return n!==o&&t.parentOffset===0}function it(e,t,n){const o=(t||e).selection,l=(t||e).doc;let r,s;if(o instanceof Fe&&(s=o.node.type.spec.tableRole)){if(s=="cell"||s=="header_cell")r=b.create(l,o.from);else if(s=="row"){const c=l.resolve(o.from+1);r=b.rowSelection(c,c)}else if(!n){const c=C.get(o.node),i=o.from+1,a=i+c.map[c.width*c.height-1];r=b.create(l,i+1,a)}}else o instanceof H&&rt(o)?r=H.create(l,o.from):o instanceof H&&st(o)&&(r=H.create(l,o.$from.start(),o.$from.end()));return r&&(t||(t=e.tr)).setSelection(r),t}const ct=new se("fix-tables");function Me(e,t,n,o){const l=e.childCount,r=t.childCount;e:for(let s=0,c=0;s<r;s++){const i=t.child(s);for(let a=c,d=Math.min(l,s+3);a<d;a++)if(e.child(a)==i){c=a+1,n+=i.nodeSize;continue e}o(i,n),c<l&&e.child(c).sameMarkup(i)?Me(e.child(c),i,n+1,o):i.nodesBetween(0,i.content.size,o,n+1),n+=i.nodeSize}}function ze(e,t){let n;const o=(l,r)=>{l.type.spec.tableRole=="table"&&(n=at(e,l,r,n))};return t?t.doc!=e.doc&&Me(t.doc,e.doc,0,o):e.doc.descendants(o),n}function at(e,t,n,o){const l=C.get(t);if(!l.problems)return o;o||(o=e.tr);const r=[];for(let i=0;i<l.height;i++)r.push(0);for(let i=0;i<l.problems.length;i++){const a=l.problems[i];if(a.type=="collision"){const d=t.nodeAt(a.pos);if(!d)continue;const u=d.attrs;for(let f=0;f<u.rowspan;f++)r[a.row+f]+=a.n;o.setNodeMarkup(o.mapping.map(n+1+a.pos),null,B(u,u.colspan-a.n,a.n))}else if(a.type=="missing")r[a.row]+=a.n;else if(a.type=="overlong_rowspan"){const d=t.nodeAt(a.pos);if(!d)continue;o.setNodeMarkup(o.mapping.map(n+1+a.pos),null,{...d.attrs,rowspan:d.attrs.rowspan-a.n})}else if(a.type=="colwidth mismatch"){const d=t.nodeAt(a.pos);if(!d)continue;o.setNodeMarkup(o.mapping.map(n+1+a.pos),null,{...d.attrs,colwidth:a.colwidth})}else if(a.type=="zero_sized"){const d=o.mapping.map(n);o.delete(d,d+t.nodeSize)}}let s,c;for(let i=0;i<r.length;i++)r[i]&&(s==null&&(s=i),c=i);for(let i=0,a=n+1;i<l.height;i++){const d=t.child(i),u=a+d.nodeSize,f=r[i];if(f>0){let p="cell";d.firstChild&&(p=d.firstChild.type.spec.tableRole);const h=[];for(let m=0;m<f;m++){const w=v(e.schema)[p].createAndFill();w&&h.push(w)}const g=(i==0||s==i-1)&&c==i?a+1:u-1;o.insert(o.mapping.map(g),h)}a=u}return o.setMeta(ct,{fixTables:!0})}function z(e){const t=e.selection,n=J(e),o=n.node(-1),l=n.start(-1),r=C.get(o);return{...t instanceof b?r.rectBetween(t.$anchorCell.pos-l,t.$headCell.pos-l):r.findCell(n.pos-l),tableStart:l,map:r,table:o}}function Ne(e,{map:t,tableStart:n,table:o},l){let r=l>0?-1:0;nt(t,o,l+r)&&(r=l==0||l==t.width?null:0);for(let s=0;s<t.height;s++){const c=s*t.width+l;if(l>0&&l<t.width&&t.map[c-1]==t.map[c]){const i=t.map[c],a=o.nodeAt(i);e.setNodeMarkup(e.mapping.map(n+i),null,xe(a.attrs,l-t.colCount(i))),s+=a.attrs.rowspan-1}else{const i=r==null?v(o.type.schema).cell:o.nodeAt(t.map[c+r]).type,a=t.positionAt(s,l,o);e.insert(e.mapping.map(n+a),i.createAndFill())}}return e}function dt(e,t){if(!T(e))return!1;if(t){const n=z(e);t(Ne(e.tr,n,n.left))}return!0}function ut(e,t){if(!T(e))return!1;if(t){const n=z(e);t(Ne(e.tr,n,n.right))}return!0}function ft(e,{map:t,table:n,tableStart:o},l){const r=e.mapping.maps.length;for(let s=0;s<t.height;){const c=s*t.width+l,i=t.map[c],a=n.nodeAt(i),d=a.attrs;if(l>0&&t.map[c-1]==i||l<t.width-1&&t.map[c+1]==i)e.setNodeMarkup(e.mapping.slice(r).map(o+i),null,B(d,l-t.colCount(i)));else{const u=e.mapping.slice(r).map(o+i);e.delete(u,u+a.nodeSize)}s+=d.rowspan}}function ht(e,t){if(!T(e))return!1;if(t){const n=z(e),o=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let l=n.right-1;ft(o,n,l),l!=n.left;l--){const r=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!r)throw new RangeError("No table found");n.table=r,n.map=C.get(r)}t(o)}return!0}function pt(e,t,n){var o;const l=v(t.type.schema).header_cell;for(let r=0;r<e.width;r++)if(((o=t.nodeAt(e.map[r+n*e.width]))===null||o===void 0?void 0:o.type)!=l)return!1;return!0}function Ee(e,{map:t,tableStart:n,table:o},l){let r=n;for(let a=0;a<l;a++)r+=o.child(a).nodeSize;const s=[];let c=l>0?-1:0;pt(t,o,l+c)&&(c=l==0||l==t.height?null:0);for(let a=0,d=t.width*l;a<t.width;a++,d++)if(l>0&&l<t.height&&t.map[d]==t.map[d-t.width]){const u=t.map[d],f=o.nodeAt(u).attrs;e.setNodeMarkup(n+u,null,{...f,rowspan:f.rowspan+1}),a+=f.colspan-1}else{var i;const u=c==null?v(o.type.schema).cell:(i=o.nodeAt(t.map[d+c*t.width]))===null||i===void 0?void 0:i.type,f=u?.createAndFill();f&&s.push(f)}return e.insert(r,v(o.type.schema).row.create(null,s)),e}function mt(e,t){if(!T(e))return!1;if(t){const n=z(e);t(Ee(e.tr,n,n.top))}return!0}function gt(e,t){if(!T(e))return!1;if(t){const n=z(e);t(Ee(e.tr,n,n.bottom))}return!0}function wt(e,{map:t,table:n,tableStart:o},l){let r=0;for(let a=0;a<l;a++)r+=n.child(a).nodeSize;const s=r+n.child(l).nodeSize,c=e.mapping.maps.length;e.delete(r+o,s+o);const i=new Set;for(let a=0,d=l*t.width;a<t.width;a++,d++){const u=t.map[d];if(!i.has(u)){if(i.add(u),l>0&&u==t.map[d-t.width]){const f=n.nodeAt(u).attrs;e.setNodeMarkup(e.mapping.slice(c).map(u+o),null,{...f,rowspan:f.rowspan-1}),a+=f.colspan-1}else if(l<t.height&&u==t.map[d+t.width]){const f=n.nodeAt(u),p=f.attrs,h=f.type.create({...p,rowspan:f.attrs.rowspan-1},f.content),g=t.positionAt(l+1,a,n);e.insert(e.mapping.slice(c).map(o+g),h),a+=p.colspan-1}}}}function bt(e,t){if(!T(e))return!1;if(t){const n=z(e),o=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let l=n.bottom-1;wt(o,n,l),l!=n.top;l--){const r=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!r)throw new RangeError("No table found");n.table=r,n.map=C.get(n.table)}t(o)}return!0}function ce(e){const t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function Ct({width:e,height:t,map:n},o){let l=o.top*e+o.left,r=l,s=(o.bottom-1)*e+o.left,c=l+(o.right-o.left-1);for(let i=o.top;i<o.bottom;i++){if(o.left>0&&n[r]==n[r-1]||o.right<e&&n[c]==n[c+1])return!0;r+=e,c+=e}for(let i=o.left;i<o.right;i++){if(o.top>0&&n[l]==n[l-e]||o.bottom<t&&n[s]==n[s+e])return!0;l++,s++}return!1}function ae(e,t){const n=e.selection;if(!(n instanceof b)||n.$anchorCell.pos==n.$headCell.pos)return!1;const o=z(e),{map:l}=o;if(Ct(l,o))return!1;if(t){const r=e.tr,s={};let c=M.empty,i,a;for(let d=o.top;d<o.bottom;d++)for(let u=o.left;u<o.right;u++){const f=l.map[d*l.width+u],p=o.table.nodeAt(f);if(!(s[f]||!p))if(s[f]=!0,i==null)i=f,a=p;else{ce(p)||(c=c.append(p.content));const h=r.mapping.map(f+o.tableStart);r.delete(h,h+p.nodeSize)}}if(i==null||a==null)return!0;if(r.setNodeMarkup(i+o.tableStart,null,{...xe(a.attrs,a.attrs.colspan,o.right-o.left-a.attrs.colspan),rowspan:o.bottom-o.top}),c.size>0){const d=i+1+a.content.size,u=ce(a)?i+1:d;r.replaceWith(u+o.tableStart,d+o.tableStart,c)}r.setSelection(new b(r.doc.resolve(i+o.tableStart))),t(r)}return!0}function de(e,t){const n=v(e.schema);return yt(({node:o})=>n[o.type.spec.tableRole])(e,t)}function yt(e){return(t,n)=>{const o=t.selection;let l,r;if(o instanceof b){if(o.$anchorCell.pos!=o.$headCell.pos)return!1;l=o.$anchorCell.nodeAfter,r=o.$anchorCell.pos}else{var s;if(l=Ze(o.$from),!l)return!1;r=(s=W(o.$from))===null||s===void 0?void 0:s.pos}if(l==null||r==null||l.attrs.colspan==1&&l.attrs.rowspan==1)return!1;if(n){let c=l.attrs;const i=[],a=c.colwidth;c.rowspan>1&&(c={...c,rowspan:1}),c.colspan>1&&(c={...c,colspan:1});const d=z(t),u=t.tr;for(let p=0;p<d.right-d.left;p++)i.push(a?{...c,colwidth:a&&a[p]?[a[p]]:null}:c);let f;for(let p=d.top;p<d.bottom;p++){let h=d.map.positionAt(p,d.left,d.table);p==d.top&&(h+=l.nodeSize);for(let g=d.left,m=0;g<d.right;g++,m++)g==d.left&&p==d.top||u.insert(f=u.mapping.map(h+d.tableStart,1),e({node:l,row:p,col:g}).createAndFill(i[m]))}u.setNodeMarkup(r,e({node:l,row:d.top,col:d.left}),i[0]),o instanceof b&&u.setSelection(new b(u.doc.resolve(o.$anchorCell.pos),f?u.doc.resolve(f):void 0)),n(u)}return!0}}function At(e,t){return function(n,o){if(!T(n))return!1;const l=J(n);if(l.nodeAfter.attrs[e]===t)return!1;if(o){const r=n.tr;n.selection instanceof b?n.selection.forEachCell((s,c)=>{s.attrs[e]!==t&&r.setNodeMarkup(c,null,{...s.attrs,[e]:t})}):r.setNodeMarkup(l.pos,null,{...l.nodeAfter.attrs,[e]:t}),o(r)}return!0}}function St(e){return function(t,n){if(!T(t))return!1;if(n){const o=v(t.schema),l=z(t),r=t.tr,s=l.map.cellsInRect(e=="column"?{left:l.left,top:0,right:l.right,bottom:l.map.height}:e=="row"?{left:0,top:l.top,right:l.map.width,bottom:l.bottom}:l),c=s.map(i=>l.table.nodeAt(i));for(let i=0;i<s.length;i++)c[i].type==o.header_cell&&r.setNodeMarkup(l.tableStart+s[i],o.cell,c[i].attrs);if(r.steps.length===0)for(let i=0;i<s.length;i++)r.setNodeMarkup(l.tableStart+s[i],o.header_cell,c[i].attrs);n(r)}return!0}}function ue(e,t,n){const o=t.map.cellsInRect({left:0,top:0,right:e=="row"?t.map.width:1,bottom:e=="column"?t.map.height:1});for(let l=0;l<o.length;l++){const r=t.table.nodeAt(o[l]);if(r&&r.type!==n.header_cell)return!1}return!0}function I(e,t){return t=t||{useDeprecatedLogic:!1},t.useDeprecatedLogic?St(e):function(n,o){if(!T(n))return!1;if(o){const l=v(n.schema),r=z(n),s=n.tr,c=ue("row",r,l),i=ue("column",r,l),a=(e==="column"?c:e==="row"&&i)?1:0,d=e=="column"?{left:0,top:a,right:1,bottom:r.map.height}:e=="row"?{left:a,top:0,right:r.map.width,bottom:1}:r,u=e=="column"?i?l.cell:l.header_cell:e=="row"?c?l.cell:l.header_cell:l.cell;r.map.cellsInRect(d).forEach(f=>{const p=f+r.tableStart,h=s.doc.nodeAt(p);h&&s.setNodeMarkup(p,u,h.attrs)}),o(s)}return!0}}I("row",{useDeprecatedLogic:!0});I("column",{useDeprecatedLogic:!0});const vt=I("cell",{useDeprecatedLogic:!0});function Rt(e,t){if(t<0){const n=e.nodeBefore;if(n)return e.pos-n.nodeSize;for(let o=e.index(-1)-1,l=e.before();o>=0;o--){const r=e.node(-1).child(o),s=r.lastChild;if(s)return l-1-s.nodeSize;l-=r.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;const n=e.node(-1);for(let o=e.indexAfter(-1),l=e.after();o<n.childCount;o++){const r=n.child(o);if(r.childCount)return l+1;l+=r.nodeSize}}return null}function fe(e){return function(t,n){if(!T(t))return!1;const o=Rt(J(t),e);if(o==null)return!1;if(n){const l=t.doc.resolve(o);n(t.tr.setSelection(H.between(l,tt(l))).scrollIntoView())}return!0}}function xt(e,t){const n=e.selection.$anchor;for(let o=n.depth;o>0;o--)if(n.node(o).type.spec.tableRole=="table")return t&&t(e.tr.delete(n.before(o),n.after(o)).scrollIntoView()),!0;return!1}function j(e,t){const n=e.selection;if(!(n instanceof b))return!1;if(t){const o=e.tr,l=v(e.schema).cell.createAndFill().content;n.forEachCell((r,s)=>{r.content.eq(l)||o.replace(o.mapping.map(s+1),o.mapping.map(s+r.nodeSize-1),new L(l,0,0))}),o.docChanged&&t(o)}return!0}function Tt(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:o}=e;for(;t.childCount==1&&(n>0&&o>0||t.child(0).type.spec.tableRole=="table");)n--,o--,t=t.child(0).content;const l=t.child(0),r=l.type.spec.tableRole,s=l.type.schema,c=[];if(r=="row")for(let i=0;i<t.childCount;i++){let a=t.child(i).content;const d=i?0:Math.max(0,n-1),u=i<t.childCount-1?0:Math.max(0,o-1);(d||u)&&(a=oe(v(s).row,new L(a,d,u)).content),c.push(a)}else if(r=="cell"||r=="header_cell")c.push(n||o?oe(v(s).row,new L(t,n,o)).content:t);else return null;return Mt(s,c)}function Mt(e,t){const n=[];for(let l=0;l<t.length;l++){const r=t[l];for(let s=r.childCount-1;s>=0;s--){const{rowspan:c,colspan:i}=r.child(s).attrs;for(let a=l;a<l+c;a++)n[a]=(n[a]||0)+i}}let o=0;for(let l=0;l<n.length;l++)o=Math.max(o,n[l]);for(let l=0;l<n.length;l++)if(l>=t.length&&t.push(M.empty),n[l]<o){const r=v(e).cell.createAndFill(),s=[];for(let c=n[l];c<o;c++)s.push(r);t[l]=t[l].append(M.from(s))}return{height:t.length,width:o,rows:t}}function oe(e,t){const n=e.createAndFill();return new _e(n).replace(0,n.content.size,t).doc}function zt({width:e,height:t,rows:n},o,l){if(e!=o){const r=[],s=[];for(let c=0;c<n.length;c++){const i=n[c],a=[];for(let d=r[c]||0,u=0;d<o;u++){let f=i.child(u%i.childCount);d+f.attrs.colspan>o&&(f=f.type.createChecked(B(f.attrs,f.attrs.colspan,d+f.attrs.colspan-o),f.content)),a.push(f),d+=f.attrs.colspan;for(let p=1;p<f.attrs.rowspan;p++)r[c+p]=(r[c+p]||0)+f.attrs.colspan}s.push(M.from(a))}n=s,e=o}if(t!=l){const r=[];for(let s=0,c=0;s<l;s++,c++){const i=[],a=n[c%t];for(let d=0;d<a.childCount;d++){let u=a.child(d);s+u.attrs.rowspan>l&&(u=u.type.create({...u.attrs,rowspan:Math.max(1,l-u.attrs.rowspan)},u.content)),i.push(u)}r.push(M.from(i))}n=r,t=l}return{width:e,height:t,rows:n}}function Nt(e,t,n,o,l,r,s){const c=e.doc.type.schema,i=v(c);let a,d;if(l>t.width)for(let u=0,f=0;u<t.height;u++){const p=n.child(u);f+=p.nodeSize;const h=[];let g;p.lastChild==null||p.lastChild.type==i.cell?g=a||(a=i.cell.createAndFill()):g=d||(d=i.header_cell.createAndFill());for(let m=t.width;m<l;m++)h.push(g);e.insert(e.mapping.slice(s).map(f-1+o),h)}if(r>t.height){const u=[];for(let h=0,g=(t.height-1)*t.width;h<Math.max(t.width,l);h++){const m=h>=t.width?!1:n.nodeAt(t.map[g+h]).type==i.header_cell;u.push(m?d||(d=i.header_cell.createAndFill()):a||(a=i.cell.createAndFill()))}const f=i.row.create(null,M.from(u)),p=[];for(let h=t.height;h<r;h++)p.push(f);e.insert(e.mapping.slice(s).map(o+n.nodeSize-2),p)}return!!(a||d)}function he(e,t,n,o,l,r,s,c){if(s==0||s==t.height)return!1;let i=!1;for(let a=l;a<r;a++){const d=s*t.width+a,u=t.map[d];if(t.map[d-t.width]==u){i=!0;const f=n.nodeAt(u),{top:p,left:h}=t.findCell(u);e.setNodeMarkup(e.mapping.slice(c).map(u+o),null,{...f.attrs,rowspan:s-p}),e.insert(e.mapping.slice(c).map(t.positionAt(s,h,n)),f.type.createAndFill({...f.attrs,rowspan:p+f.attrs.rowspan-s})),a+=f.attrs.colspan-1}}return i}function pe(e,t,n,o,l,r,s,c){if(s==0||s==t.width)return!1;let i=!1;for(let a=l;a<r;a++){const d=a*t.width+s,u=t.map[d];if(t.map[d-1]==u){i=!0;const f=n.nodeAt(u),p=t.colCount(u),h=e.mapping.slice(c).map(u+o);e.setNodeMarkup(h,null,B(f.attrs,s-p,f.attrs.colspan-(s-p))),e.insert(h+f.nodeSize,f.type.createAndFill(B(f.attrs,0,s-p))),a+=f.attrs.rowspan-1}}return i}function me(e,t,n,o,l){let r=n?e.doc.nodeAt(n-1):e.doc;if(!r)throw new Error("No table found");let s=C.get(r);const{top:c,left:i}=o,a=i+l.width,d=c+l.height,u=e.tr;let f=0;function p(){if(r=n?u.doc.nodeAt(n-1):u.doc,!r)throw new Error("No table found");s=C.get(r),f=u.mapping.maps.length}Nt(u,s,r,n,a,d,f)&&p(),he(u,s,r,n,i,a,c,f)&&p(),he(u,s,r,n,i,a,d,f)&&p(),pe(u,s,r,n,c,d,i,f)&&p(),pe(u,s,r,n,c,d,a,f)&&p();for(let h=c;h<d;h++){const g=s.positionAt(h,i,r),m=s.positionAt(h,a,r);u.replace(u.mapping.slice(f).map(g+n),u.mapping.slice(f).map(m+n),new L(l.rows[h-c],0,0))}p(),u.setSelection(new b(u.doc.resolve(n+s.positionAt(c,i,r)),u.doc.resolve(n+s.positionAt(d-1,a-1,r)))),t(u)}const Et=Oe({ArrowLeft:F("horiz",-1),ArrowRight:F("horiz",1),ArrowUp:F("vert",-1),ArrowDown:F("vert",1),"Shift-ArrowLeft":_("horiz",-1),"Shift-ArrowRight":_("horiz",1),"Shift-ArrowUp":_("vert",-1),"Shift-ArrowDown":_("vert",1),Backspace:j,"Mod-Backspace":j,Delete:j,"Mod-Delete":j});function K(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function F(e,t){return(n,o,l)=>{if(!l)return!1;const r=n.selection;if(r instanceof b)return K(n,o,E.near(r.$headCell,t));if(e!="horiz"&&!r.empty)return!1;const s=He(l,e,t);if(s==null)return!1;if(e=="horiz")return K(n,o,E.near(n.doc.resolve(r.head+t),t));{const c=n.doc.resolve(s),i=Re(c,e,t);let a;return i?a=E.near(i,1):t<0?a=E.near(n.doc.resolve(c.before(-1)),-1):a=E.near(n.doc.resolve(c.after(-1)),1),K(n,o,a)}}}function _(e,t){return(n,o,l)=>{if(!l)return!1;const r=n.selection;let s;if(r instanceof b)s=r;else{const i=He(l,e,t);if(i==null)return!1;s=new b(n.doc.resolve(i))}const c=Re(s.$headCell,e,t);return c?K(n,o,new b(s.$anchorCell,c)):!1}}function Ht(e,t){const n=e.state.doc,o=W(n.resolve(t));return o?(e.dispatch(e.state.tr.setSelection(new b(o))),!0):!1}function $t(e,t,n){if(!T(e.state))return!1;let o=Tt(n);const l=e.state.selection;if(l instanceof b){o||(o={width:1,height:1,rows:[M.from(oe(v(e.state.schema).cell,n))]});const r=l.$anchorCell.node(-1),s=l.$anchorCell.start(-1),c=C.get(r).rectBetween(l.$anchorCell.pos-s,l.$headCell.pos-s);return o=zt(o,c.right-c.left,c.bottom-c.top),me(e.state,e.dispatch,s,c,o),!0}else if(o){const r=J(e.state),s=r.start(-1);return me(e.state,e.dispatch,s,C.get(r.node(-1)).findCell(r.pos-s),o),!0}else return!1}function Lt(e,t){var n;if(t.button!=0||t.ctrlKey||t.metaKey)return;const o=ge(e,t.target);let l;if(t.shiftKey&&e.state.selection instanceof b)r(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&o&&(l=W(e.state.selection.$anchor))!=null&&((n=Y(e,t))===null||n===void 0?void 0:n.pos)!=l.pos)r(l,t),t.preventDefault();else if(!o)return;function r(i,a){let d=Y(e,a);const u=$.getState(e.state)==null;if(!d||!ie(i,d))if(u)d=i;else return;const f=new b(i,d);if(u||!e.state.selection.eq(f)){const p=e.state.tr.setSelection(f);u&&p.setMeta($,i.pos),e.dispatch(p)}}function s(){e.root.removeEventListener("mouseup",s),e.root.removeEventListener("dragstart",s),e.root.removeEventListener("mousemove",c),$.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta($,-1))}function c(i){const a=i,d=$.getState(e.state);let u;if(d!=null)u=e.state.doc.resolve(d);else if(ge(e,a.target)!=o&&(u=Y(e,t),!u))return s();u&&r(u,a)}e.root.addEventListener("mouseup",s),e.root.addEventListener("dragstart",s),e.root.addEventListener("mousemove",c)}function He(e,t,n){if(!(e.state.selection instanceof H))return null;const{$head:o}=e.state.selection;for(let l=o.depth-1;l>=0;l--){const r=o.node(l);if((n<0?o.index(l):o.indexAfter(l))!=(n<0?0:r.childCount))return null;if(r.type.spec.tableRole=="cell"||r.type.spec.tableRole=="header_cell"){const s=o.before(l),c=t=="vert"?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(c)?s:null}}return null}function ge(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName=="TD"||t.nodeName=="TH")return t;return null}function Y(e,t){const n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:o,pos:l}=n;return o>=0&&W(e.state.doc.resolve(o))||W(e.state.doc.resolve(l))}var kt=class{constructor(t,n){this.node=t,this.defaultCellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${n}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),le(t,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!=this.node.type?!1:(this.node=t,le(t,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(t){return t.type=="attributes"&&(t.target==this.table||this.colgroup.contains(t.target))}};function le(e,t,n,o,l,r){let s=0,c=!0,i=t.firstChild;const a=e.firstChild;if(a){for(let u=0,f=0;u<a.childCount;u++){const{colspan:p,colwidth:h}=a.child(u).attrs;for(let g=0;g<p;g++,f++){const m=l==f?r:h&&h[g],w=m?m+"px":"";if(s+=m||o,m||(c=!1),i)i.style.width!=w&&(i.style.width=w),i=i.nextSibling;else{const S=document.createElement("col");S.style.width=w,t.appendChild(S)}}}for(;i;){var d;const u=i.nextSibling;(d=i.parentNode)===null||d===void 0||d.removeChild(i),i=u}c?(n.style.width=s+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=s+"px")}}const x=new se("tableColumnResizing");function Wt({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:o=kt,lastColumnResizable:l=!0}={}){const r=new ve({key:x,state:{init(s,c){var i;const a=(i=r.spec)===null||i===void 0||(i=i.props)===null||i===void 0?void 0:i.nodeViews,d=v(c.schema).table.name;return o&&a&&(a[d]=(u,f)=>new o(u,n,f)),new Bt(-1,!1)},apply(s,c){return c.apply(s)}},props:{attributes:s=>{const c=x.getState(s);return c&&c.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(s,c)=>{Dt(s,c,e,l)},mouseleave:s=>{It(s)},mousedown:(s,c)=>{Pt(s,c,t,n)}},decorations:s=>{const c=x.getState(s);if(c&&c.activeHandle>-1)return Vt(s,c.activeHandle)},nodeViews:{}}});return r}var Bt=class X{constructor(t,n){this.activeHandle=t,this.dragging=n}apply(t){const n=this,o=t.getMeta(x);if(o&&o.setHandle!=null)return new X(o.setHandle,!1);if(o&&o.setDragging!==void 0)return new X(n.activeHandle,o.setDragging);if(n.activeHandle>-1&&t.docChanged){let l=t.mapping.map(n.activeHandle,-1);return ne(t.doc.resolve(l))||(l=-1),new X(l,n.dragging)}return n}};function Dt(e,t,n,o){if(!e.editable)return;const l=x.getState(e.state);if(l&&!l.dragging){const r=jt(t.target);let s=-1;if(r){const{left:c,right:i}=r.getBoundingClientRect();t.clientX-c<=n?s=we(e,t,"left",n):i-t.clientX<=n&&(s=we(e,t,"right",n))}if(s!=l.activeHandle){if(!o&&s!==-1){const c=e.state.doc.resolve(s),i=c.node(-1),a=C.get(i),d=c.start(-1);if(a.colCount(c.pos-d)+c.nodeAfter.attrs.colspan-1==a.width-1)return}$e(e,s)}}}function It(e){if(!e.editable)return;const t=x.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&$e(e,-1)}function Pt(e,t,n,o){var l;if(!e.editable)return!1;const r=(l=e.dom.ownerDocument.defaultView)!==null&&l!==void 0?l:window,s=x.getState(e.state);if(!s||s.activeHandle==-1||s.dragging)return!1;const c=e.state.doc.nodeAt(s.activeHandle),i=Ot(e,s.activeHandle,c.attrs);e.dispatch(e.state.tr.setMeta(x,{setDragging:{startX:t.clientX,startWidth:i}}));function a(u){r.removeEventListener("mouseup",a),r.removeEventListener("mousemove",d);const f=x.getState(e.state);f?.dragging&&(Ft(e,f.activeHandle,be(f.dragging,u,n)),e.dispatch(e.state.tr.setMeta(x,{setDragging:null})))}function d(u){if(!u.which)return a(u);const f=x.getState(e.state);if(f&&f.dragging){const p=be(f.dragging,u,n);Ce(e,f.activeHandle,p,o)}}return Ce(e,s.activeHandle,i,o),r.addEventListener("mouseup",a),r.addEventListener("mousemove",d),t.preventDefault(),!0}function Ot(e,t,{colspan:n,colwidth:o}){const l=o&&o[o.length-1];if(l)return l;const r=e.domAtPos(t);let s=r.node.childNodes[r.offset].offsetWidth,c=n;if(o)for(let i=0;i<n;i++)o[i]&&(s-=o[i],c--);return s/c}function jt(e){for(;e&&e.nodeName!="TD"&&e.nodeName!="TH";)e=e.classList&&e.classList.contains("ProseMirror")?null:e.parentNode;return e}function we(e,t,n,o){const l=n=="right"?-o:o,r=e.posAtCoords({left:t.clientX+l,top:t.clientY});if(!r)return-1;const{pos:s}=r,c=W(e.state.doc.resolve(s));if(!c)return-1;if(n=="right")return c.pos;const i=C.get(c.node(-1)),a=c.start(-1),d=i.map.indexOf(c.pos-a);return d%i.width==0?-1:a+i.map[d-1]}function be(e,t,n){const o=t.clientX-e.startX;return Math.max(n,e.startWidth+o)}function $e(e,t){e.dispatch(e.state.tr.setMeta(x,{setHandle:t}))}function Ft(e,t,n){const o=e.state.doc.resolve(t),l=o.node(-1),r=C.get(l),s=o.start(-1),c=r.colCount(o.pos-s)+o.nodeAfter.attrs.colspan-1,i=e.state.tr;for(let a=0;a<r.height;a++){const d=a*r.width+c;if(a&&r.map[d]==r.map[d-r.width])continue;const u=r.map[d],f=l.nodeAt(u).attrs,p=f.colspan==1?0:c-r.colCount(u);if(f.colwidth&&f.colwidth[p]==n)continue;const h=f.colwidth?f.colwidth.slice():_t(f.colspan);h[p]=n,i.setNodeMarkup(s+u,null,{...f,colwidth:h})}i.docChanged&&e.dispatch(i)}function Ce(e,t,n,o){const l=e.state.doc.resolve(t),r=l.node(-1),s=l.start(-1),c=C.get(r).colCount(l.pos-s)+l.nodeAfter.attrs.colspan-1;let i=e.domAtPos(l.start(-1)).node;for(;i&&i.nodeName!="TABLE";)i=i.parentNode;i&&le(r,i.firstChild,i,o,c,n)}function _t(e){return Array(e).fill(0)}function Vt(e,t){const n=[],o=e.doc.resolve(t),l=o.node(-1);if(!l)return Q.empty;const r=C.get(l),s=o.start(-1),c=r.colCount(o.pos-s)+o.nodeAfter.attrs.colspan-1;for(let a=0;a<r.height;a++){const d=c+a*r.width;if((c==r.width-1||r.map[d]!=r.map[d+1])&&(a==0||r.map[d]!=r.map[d-r.width])){var i;const u=r.map[d],f=s+u+l.nodeAt(u).nodeSize-1,p=document.createElement("div");p.className="column-resize-handle",!((i=x.getState(e))===null||i===void 0)&&i.dragging&&n.push(Z.node(s+u,s+u+l.nodeAt(u).nodeSize,{class:"column-resize-dragging"})),n.push(Z.widget(f,p))}}return Q.create(e.doc,n)}function Kt({allowTableNodeSelection:e=!1}={}){return new ve({key:$,state:{init(){return null},apply(t,n){const o=t.getMeta($);if(o!=null)return o==-1?null:o;if(n==null||!t.docChanged)return n;const{deleted:l,pos:r}=t.mapping.mapResult(n);return l?null:r}},props:{decorations:lt,handleDOMEvents:{mousedown:Lt},createSelectionBetween(t){return $.getState(t.state)!=null?t.state.selection:null},handleTripleClick:Ht,handleKeyDown:Et,handlePaste:$t},appendTransaction(t,n,o){return it(o,ze(o,n),e)}})}function U(e){return e==="left"||e==="right"||e==="center"?e:null}function Xt(e){const t=(e.style.textAlign||"").trim().toLowerCase(),n=(e.getAttribute("align")||"").trim().toLowerCase();return U(t||n)}function qt(e){return U(e?.align)}function Le(){return{default:null,parseHTML:e=>Xt(e),renderHTML:e=>e.align?{style:`text-align: ${e.align}`}:{}}}function Ut(e){var t;const n=e.parentElement,o=e.closest("table");if(!n||!o)return null;const l=Array.from(n.children).indexOf(e),r=(t=o.querySelectorAll("colgroup > col")[l])===null||t===void 0?void 0:t.getAttribute("width");return r?[parseInt(r,10)]:null}function ke(e){const t=e.getAttribute("colwidth");return t?t.split(",").map(n=>parseInt(n,10)):Ut(e)}const Jt=/[ \t\r\n\f]+/g;function We(e){var t;return e.children.length>0?!1:((t=e.textContent)!==null&&t!==void 0?t:"").replace(Jt,"")===""}function Be(e){const t=e.createAndFill();if(!t)throw new Error(`[tiptap error]: "${e.name}" has no default content to backfill.`);return t.content}const Gt=P.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:ke},align:Le()}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td",getAttrs:e=>We(e)?{}:!1,getContent:(e,t)=>Be(t.nodes[this.name])},{tag:"td"}]},renderHTML({HTMLAttributes:e}){return["td",k(this.options.HTMLAttributes,e),0]}}),Yt=P.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:ke},align:Le()}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th",getAttrs:e=>We(e)?{}:!1,getContent:(e,t)=>Be(t.nodes[this.name])},{tag:"th"}]},renderHTML({HTMLAttributes:e}){return["th",k(this.options.HTMLAttributes,e),0]}}),Qt=P.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:e}){return["tr",k(this.options.HTMLAttributes,e),0]}});function re(e,t){return t?["width",`${Math.max(t,e)}px`]:["min-width",`${e}px`]}function ye(e,t,n,o,l,r){let s=0,c=!0,i=t.firstChild;const a=e.firstChild;if(a!==null)for(let f=0,p=0;f<a.childCount;f+=1){const{colspan:h,colwidth:g}=a.child(f).attrs;for(let m=0;m<h;m+=1,p+=1){const w=l===p?r:g&&g[m],S=w?`${w}px`:"";if(s+=w||o,w||(c=!1),i){if(i.style.width!==S){const[y,A]=re(o,w);i.style.setProperty(y,A)}i=i.nextSibling}else{const y=document.createElement("col"),[A,R]=re(o,w);y.style.setProperty(A,R),t.appendChild(y)}}}for(;i;){var d;const f=i.nextSibling;(d=i.parentNode)===null||d===void 0||d.removeChild(i),i=f}const u=e.attrs.style&&typeof e.attrs.style=="string"&&/\bwidth\s*:/i.test(e.attrs.style);c&&!u?(n.style.width=`${s}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${s}px`)}var Zt=class{constructor(e,t,n,o={}){this.node=e,this.cellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table"));for(const[l,r]of Object.entries(o))r!=null&&(l==="style"?this.table.style.cssText=String(r):this.table.setAttribute(l,String(r)));e.attrs.style&&(this.table.style.cssText=e.attrs.style),this.colgroup=this.table.appendChild(document.createElement("colgroup")),ye(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!==this.node.type?!1:(this.node=e,ye(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){const t=e.target,n=this.dom.contains(t),o=this.contentDOM.contains(t);return!!(n&&!o&&(e.type==="attributes"||e.type==="childList"||e.type==="characterData"))}};function en(e,t,n,o){let l=0,r=!0;const s=[],c=e.firstChild;if(!c)return{};for(let d=0,u=0;d<c.childCount;d+=1){const{colspan:f,colwidth:p}=c.child(d).attrs;for(let h=0;h<f;h+=1,u+=1){const g=n===u?o:p&&p[h];l+=g||t,g||(r=!1);const[m,w]=re(t,g);s.push(["col",{style:`${m}: ${w}`}])}}const i=r?`${l}px`:"",a=r?"":`${l}px`;return{colgroup:["colgroup",{},...s],tableWidth:i,tableMinWidth:a}}function Ae(e,t){return e.createAndFill()}function tn(e){if(e.cached.tableNodeTypes)return e.cached.tableNodeTypes;const t={};return Object.keys(e.nodes).forEach(n=>{const o=e.nodes[n];o.spec.tableRole&&(t[o.spec.tableRole]=o)}),e.cached.tableNodeTypes=t,t}function nn(e,t,n,o,l){const r=tn(e),s=[],c=[];for(let a=0;a<n;a+=1){const d=Ae(r.cell);if(d&&c.push(d),o){const u=Ae(r.header_cell);u&&s.push(u)}}const i=[];for(let a=0;a<t;a+=1)i.push(r.row.createChecked(null,o&&a===0?s:c));return r.table.createChecked(null,i)}function on(e){return e instanceof b}const V=({editor:e})=>{const{selection:t}=e.state;if(!on(t))return!1;let n=0;const o=q(t.ranges[0].$from,l=>l.type.name==="table");return o?.node.descendants(l=>{if(l.type.name==="table")return!1;["tableCell","tableHeader"].includes(l.type.name)&&(n+=1)}),n!==t.ranges.length?!1:(e.commands.deleteTable(),!0)};function Se(e,t){const n=e.mapping.map(t),o=q(e.selection.$from,s=>s.type.name==="table");if(o?.pos===n)return;const l=e.doc.nodeAt(n);if(!l)return;const r=n+l.nodeSize-1;e.setSelection(H.near(e.doc.resolve(r),-1))}function ln(e){let t="",n=0;for(;n<e.length;){if(e[n]==="\\"&&n+1<e.length){t+=e[n]+e[n+1],n+=2;continue}if(e[n]!=="`"){t+=e[n++];continue}let o=0;for(;n+o<e.length&&e[n+o]==="`";)o+=1;let l=n+o,r=!1;for(;l<e.length;){if(e[l]!=="`"){l+=1;continue}let s=0;for(;l+s<e.length&&e[l+s]==="`";)s+=1;if(s===o){const c=e.slice(n+o,l);t+=e.slice(n,n+o)+c.replace(/\\\||\|/g,i=>i==="|"?"\\|":i)+e.slice(l,l+o),n=l+o,r=!0;break}l+=s}r||(t+=e.slice(n,n+o),n+=o)}return t}function rn(e){return e.split(`
2
2
  `).map(t=>!t.includes("|")||!t.includes("`")?t:ln(t)).join(`
3
3
  `)}function sn(e){return(e||"").replace(/\s+/g," ").trim()}function cn(e,t,n={}){var o;const l=(o=n.cellLineSeparator)!==null&&o!==void 0?o:"";if(!e||!e.content||e.content.length===0)return"";const r=[];e.content.forEach(h=>{const g=[];h.content&&h.content.forEach(m=>{let w="";m.content&&Array.isArray(m.content)&&m.content.length>1?w=m.content.map(R=>t.renderChildren(R)).join(l):w=m.content?t.renderChildren(m.content):"";const S=sn(w.split(l).join(`
4
4
  `).replace(/[ \t]*\r?\n[ \t]*/g,"<br>")),y=m.type==="tableHeader",A=qt(m.attrs);g.push({text:S,isHeader:y,align:A})}),r.push(g)});const s=r.reduce((h,g)=>Math.max(h,g.length),0);if(s===0)return"";const c=Array.from({length:s}).fill(0);r.forEach(h=>{for(let m=0;m<s;m+=1){var g;const w=(((g=h[m])===null||g===void 0?void 0:g.text)||"").length;w>c[m]&&(c[m]=w),c[m]<3&&(c[m]=3)}});const i=(h,g)=>h+" ".repeat(Math.max(0,g-h.length)),a=r[0],d=a.some(h=>h.isHeader),u=Array.from({length:s}).fill(null);r.forEach(h=>{for(let m=0;m<s;m+=1){var g;!u[m]&&(!((g=h[m])===null||g===void 0)&&g.align)&&(u[m]=h[m].align)}});let f=`
@@ -1 +1 @@
1
- import{r as i,j as t,c3 as o}from"./index-DkcRNYY4.js";var s=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),d="VisuallyHidden",e=i.forwardRef((r,a)=>t.jsx(o.span,{...r,ref:a,style:{...s,...r.style}}));e.displayName=d;var n=e;export{n as R,s as V};
1
+ import{r as i,j as t,c3 as o}from"./index-D8HDDDUz.js";var s=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),d="VisuallyHidden",e=i.forwardRef((r,a)=>t.jsx(o.span,{...r,ref:a,style:{...s,...r.style}}));e.displayName=d;var n=e;export{n as R,s as V};
@@ -1 +1 @@
1
- import{c as I,a4 as A,aS as le,m as R,j as r,R as ae,r as L,b as $,t as z,h as H,w as U,x as V,v as Q,D as W,d as X,E as G,aT as ne,B as Y}from"./index-DkcRNYY4.js";import{n as oe}from"./ArrowUp-51wIoVbi.js";import{d as ie,b as Z,f as ce,u as de,T as me,A as ue,n as fe,o as pe,c as xe,p as he,q as ge,t as be,L as je}from"./chat-context-2_7VL2Se.js";import{s as ye,g as J,d as ve}from"./tool-namespace-8W3F8hsl.js";import{b as F,T as we,a as Ne,c as Ce}from"./tooltip-CcU7DhuT.js";import{e as Se,b as Te,a as Pe,D as ke}from"./drawer-XRqK1CkH.js";import{C as Ee}from"./collection-search-n_O3WZGN.js";import{u as De}from"./use-mobile-BnBdDTHN.js";import{u as Me}from"./use-mcp-client-DFeSZL8q.js";import{u as _e,g as Be}from"./use-mcp-prompts-BTRRV8Ft.js";import{h as Ie,P as Le}from"./usage-stats-D6OFaO8E.js";import{T as Re,c as Oe,b as $e,d as Ae,H as Fe}from"./input-cZnIeAU-.js";import{u as ze,a as He,S as Ge,M as q}from"./pair-BV9OnQjN.js";import{u as qe,i as Ke}from"./thread-intent-BBtcC3eO.js";import{b as Ue}from"./use-view-draft-kind-CLUDIePm.js";import{N as Ve}from"./index-B3ab16ZV.js";import{i as Qe}from"./LinkBroken01-CrTBWjs0.js";import{f as ee}from"./agent-icon-Clk7SRdQ.js";import{d as We}from"./use-entitlements-C7UoqTI0.js";import{u as Xe}from"./use-deco-credits-D5BjRSSa.js";import{F as Ye}from"./feature-paywall-DGSKlw9o.js";import{i as Ze}from"./AlertCircle-BttmH_EW.js";const K=3,te="inline-flex items-center gap-2 px-5 py-2.5 rounded-full bg-muted text-muted-foreground text-sm font-medium transition-colors cursor-pointer",Je="flex flex-col gap-1.5 p-4 rounded-xl bg-accent/40 text-sm leading-snug transition-colors cursor-pointer text-left";function se(t){const e=I.c(46),{item:l,onSelect:a,isLoading:s,isDisabled:n,variant:m}=t,o=m===void 0?"pill":m,{prompt:i}=l;let d;if(e[0]!==i._meta||e[1]!==i.name||e[2]!==i.title){const P=J(i._meta);d=i.title??ve(i.name,P),e[0]=i._meta,e[1]=i.name,e[2]=i.title,e[3]=d}else d=e[3];const c=d,f=i.description||null;if(o==="card"){let P;e[4]!==a||e[5]!==i?(P=()=>a(i),e[4]=a,e[5]=i,e[6]=P):P=e[6];const M=n||s,_=s&&"bg-accent/40",k=(n||s)&&"cursor-not-allowed opacity-50";let E;e[7]!==_||e[8]!==k?(E=R(Je,"hover:bg-accent text-foreground",_,k),e[7]=_,e[8]=k,e[9]=E):E=e[9];let h;e[10]!==c?(h=r.jsx("span",{className:"font-medium truncate capitalize",children:c}),e[10]=c,e[11]=h):h=e[11];let N;e[12]!==s?(N=s&&r.jsx(H,{size:"xs"}),e[12]=s,e[13]=N):N=e[13];let x;e[14]!==h||e[15]!==N?(x=r.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h,N]}),e[14]=h,e[15]=N,e[16]=x):x=e[16];let D;e[17]!==f?(D=f&&r.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:f}),e[17]=f,e[18]=D):D=e[18];let B;return e[19]!==x||e[20]!==D||e[21]!==P||e[22]!==M||e[23]!==E?(B=r.jsxs("button",{type:"button",onClick:P,disabled:M,className:E,children:[x,D]}),e[19]=x,e[20]=D,e[21]=P,e[22]=M,e[23]=E,e[24]=B):B=e[24],B}let u;e[25]!==a||e[26]!==i?(u=()=>a(i),e[25]=a,e[26]=i,e[27]=u):u=e[27];const g=n||s,p=s&&"bg-muted/50",w=(n||s)&&"cursor-not-allowed opacity-50";let b;e[28]!==p||e[29]!==w?(b=R(te,"hover:bg-accent hover:text-foreground",p,w),e[28]=p,e[29]=w,e[30]=b):b=e[30];let y;e[31]!==c?(y=r.jsx("span",{className:"capitalize",children:c}),e[31]=c,e[32]=y):y=e[32];let C;e[33]!==s?(C=s&&r.jsx(H,{size:"xs"}),e[33]=s,e[34]=C):C=e[34];let v;e[35]!==u||e[36]!==g||e[37]!==b||e[38]!==y||e[39]!==C?(v=r.jsx(we,{asChild:!0,children:r.jsxs("button",{type:"button",onClick:u,disabled:g,className:b,children:[y,C]})}),e[35]=u,e[36]=g,e[37]=b,e[38]=y,e[39]=C,e[40]=v):v=e[40];const S=f??c;let j;e[41]!==S?(j=r.jsx(Ne,{side:"top",className:"max-w-xs",children:r.jsx("p",{className:"text-xs",children:S})}),e[41]=S,e[42]=j):j=e[42];let T;return e[43]!==v||e[44]!==j?(T=r.jsxs(Ce,{delayDuration:400,children:[v,j]}),e[43]=v,e[44]=j,e[45]=T):T=e[45],T}function et(t){const e=I.c(61),{items:l,open:a,onOpenChange:s,onSelect:n,loadingPrompt:m}=t,o=$(),[i,d]=L.useState(""),c=!!m;let f;e[0]!==l||e[1]!==i?(f=i.trim()?l.filter(h=>{const N=i.toLowerCase();return h.prompt.name.toLowerCase().includes(N)||(h.prompt.title??"").toLowerCase().includes(N)||(h.prompt.description??"").toLowerCase().includes(N)}):l,e[0]=l,e[1]=i,e[2]=f):f=e[2];const u=f,g=De();let p;e[3]!==u.length||e[4]!==i||e[5]!==o?(p=u.length===0&&r.jsx("p",{className:"col-span-4 text-sm text-muted-foreground text-center py-8",children:o("chat.iceBreakers.noPromptsMatch",{search:i})}),e[3]=u.length,e[4]=i,e[5]=o,e[6]=p):p=e[6];let w;if(e[7]!==u||e[8]!==c||e[9]!==m?.name||e[10]!==s||e[11]!==n){let h;e[13]!==c||e[14]!==m?.name||e[15]!==s||e[16]!==n?(h=N=>r.jsx(se,{item:N,variant:"card",onSelect:x=>{s(!1),n(x)},isLoading:m?.name===N.prompt.name,isDisabled:c&&m?.name!==N.prompt.name},N.prompt.name),e[13]=c,e[14]=m?.name,e[15]=s,e[16]=n,e[17]=h):h=e[17],w=u.map(h),e[7]=u,e[8]=c,e[9]=m?.name,e[10]=s,e[11]=n,e[12]=w}else w=e[12];let b;e[18]!==p||e[19]!==w?(b=r.jsx("div",{className:"flex-1 overflow-y-auto [scrollbar-gutter:stable]",children:r.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3 p-5",children:[p,w]})}),e[18]=p,e[19]=w,e[20]=b):b=e[20];const y=b;let C;e[21]!==o?(C=o("chat.iceBreakers.searchPromptsPlaceholder"),e[21]=o,e[22]=C):C=e[22];let v;e[23]===Symbol.for("react.memo_cache_sentinel")?(v=h=>{h.key==="Escape"&&d("")},e[23]=v):v=e[23];let S;e[24]!==i||e[25]!==C?(S=r.jsx(Ee,{value:i,onChange:d,placeholder:C,onKeyDown:v}),e[24]=i,e[25]=C,e[26]=S):S=e[26];const j=S;if(g){let h;e[27]!==o?(h=o("chat.iceBreakers.allPromptsTitle"),e[27]=o,e[28]=h):h=e[28];let N;e[29]!==h?(N=r.jsx(Se,{className:"sr-only",children:r.jsx(Te,{children:h})}),e[29]=h,e[30]=N):N=e[30];let x;e[31]!==o?(x=o("chat.iceBreakers.promptsLabel"),e[31]=o,e[32]=x):x=e[32];let D;e[33]!==x?(D=r.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 shrink-0",children:r.jsx("span",{className:"text-sm font-medium text-foreground",children:x})}),e[33]=x,e[34]=D):D=e[34];let B;e[35]!==y||e[36]!==j||e[37]!==D||e[38]!==N?(B=r.jsxs(Pe,{className:"h-[85vh] flex flex-col p-0 gap-0",children:[N,D,j,y]}),e[35]=y,e[36]=j,e[37]=D,e[38]=N,e[39]=B):B=e[39];let O;return e[40]!==s||e[41]!==a||e[42]!==B?(O=r.jsx(F,{delayDuration:400,children:r.jsx(ke,{open:a,onOpenChange:s,children:B})}),e[40]=s,e[41]=a,e[42]=B,e[43]=O):O=e[43],O}let T;e[44]!==o?(T=o("chat.iceBreakers.allPromptsTitle"),e[44]=o,e[45]=T):T=e[45];let P;e[46]!==T?(P=r.jsx(U,{className:"sr-only",children:r.jsx(V,{children:T})}),e[46]=T,e[47]=P):P=e[47];let M;e[48]!==o?(M=o("chat.iceBreakers.promptsLabel"),e[48]=o,e[49]=M):M=e[49];let _;e[50]!==M?(_=r.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 shrink-0",children:r.jsx("span",{className:"text-sm font-medium text-foreground",children:M})}),e[50]=M,e[51]=_):_=e[51];let k;e[52]!==y||e[53]!==j||e[54]!==_||e[55]!==P?(k=r.jsxs(Q,{className:"sm:max-w-[1100px] h-[680px] p-0 gap-0 overflow-hidden flex flex-col",children:[P,_,j,y]}),e[52]=y,e[53]=j,e[54]=_,e[55]=P,e[56]=k):k=e[56];let E;return e[57]!==s||e[58]!==a||e[59]!==k?(E=r.jsx(F,{delayDuration:400,children:r.jsx(W,{open:a,onOpenChange:s,children:k})}),e[57]=s,e[58]=a,e[59]=k,e[60]=E):E=e[60],E}function tt(t){const e=I.c(30),{items:l,onSelect:a,loadingPrompt:s,className:n}=t,m=$(),[o,i]=L.useState(!1);if(l.length===0)return null;let d,c,f,u,g;if(e[0]!==n||e[1]!==l||e[2]!==s||e[3]!==a||e[4]!==m){const y=l.slice(0,K),C=l.slice(K),v=!!s;let S;e[10]!==v||e[11]!==s?.name||e[12]!==a?(S=T=>r.jsx(se,{item:T,onSelect:a,isLoading:s?.name===T.prompt.name,isDisabled:v&&s?.name!==T.prompt.name},T.prompt.name),e[10]=v,e[11]=s?.name,e[12]=a,e[13]=S):S=e[13];const j=y.map(S);d=F,g=400,e[14]!==n?(c=R("w-full flex flex-wrap gap-2 justify-center",n),e[14]=n,e[15]=c):c=e[15],f=j,u=C.length>0&&r.jsx("button",{type:"button",disabled:v,onClick:()=>i(!0),className:R(te,"hover:bg-accent hover:text-foreground",v&&"opacity-50 cursor-not-allowed"),children:m("chat.iceBreakers.moreButton",{count:C.length})}),e[0]=n,e[1]=l,e[2]=s,e[3]=a,e[4]=m,e[5]=d,e[6]=c,e[7]=f,e[8]=u,e[9]=g}else d=e[5],c=e[6],f=e[7],u=e[8],g=e[9];let p;e[16]!==c||e[17]!==f||e[18]!==u?(p=r.jsxs("div",{className:c,children:[f,u]}),e[16]=c,e[17]=f,e[18]=u,e[19]=p):p=e[19];let w;e[20]!==l||e[21]!==s||e[22]!==o||e[23]!==a?(w=r.jsx(et,{items:l,open:o,onOpenChange:i,onSelect:a,loadingPrompt:s}),e[20]=l,e[21]=s,e[22]=o,e[23]=a,e[24]=w):w=e[24];let b;return e[25]!==d||e[26]!==g||e[27]!==p||e[28]!==w?(b=r.jsxs(d,{delayDuration:g,children:[p,w]}),e[25]=d,e[26]=g,e[27]=p,e[28]=w,e[29]=b):b=e[29],b}function st(){return null}function rt(t,e){switch(e.type){case"SELECT_PROMPT":return!e.prompt.arguments||e.prompt.arguments.length===0?{stage:"loading",prompt:e.prompt}:{stage:"idle"};case"START_LOADING":return{stage:"loading",prompt:e.prompt,arguments:e.arguments};case"RESET":return{stage:"idle"};default:return t}}function lt(t){const e=I.c(31),{connectionId:l}=t,a=$(),{sendMessage:s}=Z(),{org:n}=A();let m;e[0]!==l||e[1]!==n.id||e[2]!==n.slug?(m={connectionId:l,orgId:n.id,orgSlug:n.slug},e[0]=l,e[1]=n.id,e[2]=n.slug,e[3]=m):m=e[3];const o=Me(m);let i;e[4]!==o?(i={client:o,staleTime:6e4},e[4]=o,e[5]=i):i=e[5];const{data:d}=_e(i);let c;e[6]!==d?.prompts?(c=d?.prompts??[],e[6]=d?.prompts,e[7]=c):c=e[7];const f=c;let u;e[8]!==f?(u=f.map(at),e[8]=f,e[9]=u):u=e[9];const g=u;let p;e[10]===Symbol.for("react.memo_cache_sentinel")?(p={stage:"idle"},e[10]=p):p=e[10];const[w,b]=L.useReducer(rt,p),[y,C]=L.useState(null);let v;e[11]!==o||e[12]!==s||e[13]!==a?(v=async(x,D)=>{if(!o){z.error(a("chat.iceBreakers.mcpClientNotAvailable")),b({type:"RESET"});return}try{const B=await Be(o,x.name,D);b({type:"RESET"});const O={type:"doc",content:[{type:"paragraph",content:[Ie({id:x.name,name:ye(x.name,J(x._meta)),metadata:B.messages,char:"/",kind:"prompt",args:D}),{type:"text",text:" "}]}]};await s(O)}catch(B){console.error("[ice-breakers] Failed to fetch prompt:",B),z.error(a("chat.iceBreakers.failedToLoadPrompt")),b({type:"RESET"})}},e[11]=o,e[12]=s,e[13]=a,e[14]=v):v=e[14];const S=v;let j;e[15]!==S?(j=async x=>{if(x.arguments&&x.arguments.length>0){b({type:"SELECT_PROMPT",prompt:x}),C(x);return}b({type:"START_LOADING",prompt:x}),await S(x)},e[15]=S,e[16]=j):j=e[16];const T=j;let P;e[17]!==y||e[18]!==S?(P=async x=>{y&&(b({type:"START_LOADING",prompt:y,arguments:x}),C(null),await S(y,x))},e[17]=y,e[18]=S,e[19]=P):P=e[19];const M=P;if(g.length===0)return null;const _=w.stage==="loading"?w.prompt:null;let k;e[20]!==T||e[21]!==g||e[22]!==_?(k=r.jsx(tt,{items:g,onSelect:T,loadingPrompt:_}),e[20]=T,e[21]=g,e[22]=_,e[23]=k):k=e[23];let E;e[24]===Symbol.for("react.memo_cache_sentinel")?(E=()=>{C(null),b({type:"RESET"})},e[24]=E):E=e[24];let h;e[25]!==y||e[26]!==M?(h=r.jsx(Le,{prompt:y,setPrompt:E,onSubmit:M}),e[25]=y,e[26]=M,e[27]=h):h=e[27];let N;return e[28]!==k||e[29]!==h?(N=r.jsxs(r.Fragment,{children:[k,h]}),e[28]=k,e[29]=h,e[30]=N):N=e[30],N}function at(t){return{prompt:t}}function nt(t){const e=I.c(13),{className:l}=t,{selectedVirtualMcp:a}=ie(),{org:s}=A();let n;e[0]!==s.id?(n=le(s.id),e[0]=s.id,e[1]=n):n=e[1];const m=n.id,o=a?.id??m;let i;e[2]!==l?(i=R("w-full @container",l),e[2]=l,e[3]=i):i=e[3];const d=o??"default";let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=r.jsx(st,{}),e[4]=c):c=e[4];let f;e[5]!==o?(f=r.jsx(lt,{connectionId:o}),e[5]=o,e[6]=f):f=e[6];let u;e[7]!==d||e[8]!==f?(u=r.jsx(ae,{fallback:null,children:r.jsx(L.Suspense,{fallback:c,children:f},d)}),e[7]=d,e[8]=f,e[9]=u):u=e[9];let g;return e[10]!==i||e[11]!==u?(g=r.jsx("div",{className:i,children:u}),e[10]=i,e[11]=u,e[12]=g):g=e[12],g}function ot(t){let e=0;for(const l of t)for(const a of l.parts??[]){const s=a;s.type==="tool-load_repo"&&s.state==="output-available"&&s.output?.success===!0&&e++}return e}function it(){const t=I.c(11),{openPanel:e}=Ue(),l=qe(),a=ce()?.messages??[],s=de(),n=s?.taskId??null,m=s?.currentBranch;let o;t[0]!==m?(o=Ke(m),t[0]=m,t[1]=o):o=t[1];const i=o;let d;t[2]!==a?(d=ot(a),t[2]=a,t[3]=d):d=t[3];const c=d,f=L.useRef(null),u=L.useRef(null);let g,p;t[4]!==i||t[5]!==c||t[6]!==l||t[7]!==e||t[8]!==n?(g=()=>{if(!c||!n)return;const w=`${n}:${c}`;u.current!==w&&(u.current=w,l?.refreshThreadMetadata(n)),f.current!==n&&(f.current=n,i||e("site-editor"))},p=[c,n,e,l,i],t[4]=i,t[5]=c,t[6]=l,t[7]=e,t[8]=n,t[9]=g,t[10]=p):(g=t[9],p=t[10]),L.useEffect(g,p)}function re(t){return`deco-credits-empty-dismissed:${t}`}function zt(t){try{return localStorage.getItem(re(t))==="1"}catch{return!1}}function ct(){const t=I.c(56),e=$(),{org:l}=A(),a=We("credits"),s=X(),{decoKeyId:n}=Xe(),[m,o]=L.useState(!0);let i;t[0]!==l.id?(i=()=>{G("credits_empty_state_dismissed",{organization_id:l.id}),o(!1);try{localStorage.setItem(re(l.id),"1")}catch{}},t[0]=l.id,t[1]=i):i=t[1];const d=i;let c,f;if(t[2]!==m||t[3]!==l.id?(c=()=>{m&&G("credits_empty_state_shown",{organization_id:l.id})},f=[m,l.id],t[2]=m,t[3]=l.id,t[4]=c,t[5]=f):(c=t[4],f=t[5]),L.useEffect(c,f),!m)return null;if(!a){let x;t[6]!==e?(x=e("chat.input.allowanceExhaustedTitle"),t[6]=e,t[7]=x):x=t[7];let D;t[8]!==x?(D={title:x},t[8]=x,t[9]=D):D=t[9];let B;return t[10]!==d||t[11]!==D?(B=r.jsx(Ye,{feature:"chat",copy:D,onDismiss:d}),t[10]=d,t[11]=D,t[12]=B):B=t[12],B}let u;t[13]!==d?(u=x=>!x&&d(),t[13]=d,t[14]=u):u=t[14];let g;t[15]===Symbol.for("react.memo_cache_sentinel")?(g=r.jsx("div",{className:"absolute inset-x-0 top-0 h-24 bg-gradient-to-b from-warning/8 to-transparent pointer-events-none rounded-t-lg"}),t[15]=g):g=t[15];let p;t[16]===Symbol.for("react.memo_cache_sentinel")?(p=r.jsx("div",{className:"flex items-center justify-center size-11 rounded-full bg-warning/10 border border-warning/20 mx-auto",children:r.jsx(ee,{size:20,className:"text-warning"})}),t[16]=p):p=t[16];let w;t[17]!==e?(w=e("chat.creditsEmptyState.title"),t[17]=e,t[18]=w):w=t[18];let b;t[19]!==w?(b=r.jsx(V,{className:"text-lg font-semibold",children:w}),t[19]=w,t[20]=b):b=t[20];let y;t[21]!==e?(y=e("chat.creditsEmptyState.description"),t[21]=e,t[22]=y):y=t[22];let C;t[23]!==y?(C=r.jsx(ne,{className:"mt-2 text-sm leading-relaxed max-w-[320px] mx-auto",children:y}),t[23]=y,t[24]=C):C=t[24];let v;t[25]!==b||t[26]!==C?(v=r.jsxs("div",{className:"relative px-6 pt-7 pb-5",children:[g,r.jsxs(U,{className:"relative gap-3",children:[p,r.jsxs("div",{className:"text-center",children:[b,C]})]})]}),t[25]=b,t[26]=C,t[27]=v):v=t[27];let S;t[28]!==n||t[29]!==d?(S=n&&r.jsx("div",{className:"px-6 pb-5",children:r.jsx(Re,{source:"empty_state",onDone:d})}),t[28]=n,t[29]=d,t[30]=S):S=t[30];let j;t[31]!==d||t[32]!==s||t[33]!==l.slug?(j=()=>{s({to:"/$org/settings/ai-providers",params:{org:l.slug}}),d()},t[31]=d,t[32]=s,t[33]=l.slug,t[34]=j):j=t[34];let T;t[35]!==e?(T=e("chat.creditsEmptyState.useYourOwnProvider"),t[35]=e,t[36]=T):T=t[36];let P;t[37]===Symbol.for("react.memo_cache_sentinel")?(P=r.jsx(Qe,{size:12,className:"transition-transform duration-150 group-hover:translate-x-0.5"}),t[37]=P):P=t[37];let M;t[38]!==j||t[39]!==T?(M=r.jsxs("button",{type:"button",className:"group flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:j,children:[T,P]}),t[38]=j,t[39]=T,t[40]=M):M=t[40];let _;t[41]!==e?(_=e("chat.creditsEmptyState.skipForNow"),t[41]=e,t[42]=_):_=t[42];let k;t[43]!==d||t[44]!==_?(k=r.jsx(Y,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground",onClick:d,children:_}),t[43]=d,t[44]=_,t[45]=k):k=t[45];let E;t[46]!==M||t[47]!==k?(E=r.jsxs("div",{className:"px-6 py-3.5 border-t border-border bg-muted/30 flex items-center justify-between",children:[M,k]}),t[46]=M,t[47]=k,t[48]=E):E=t[48];let h;t[49]!==v||t[50]!==S||t[51]!==E?(h=r.jsxs(Q,{className:"sm:max-w-[500px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:dt,children:[v,S,E]}),t[49]=v,t[50]=S,t[51]=E,t[52]=h):h=t[52];let N;return t[53]!==h||t[54]!==u?(N=r.jsx(W,{open:!0,onOpenChange:u,children:h}),t[53]=h,t[54]=u,t[55]=N):N=t[55],N}function dt(t){return t.preventDefault()}function mt(t){const e=I.c(6),{balanceDollars:l}=t;let a;e[0]!==l?(a=l.toFixed(2),e[0]=l,e[1]=a):a=e[1];const s=a;let n,m;e[2]===Symbol.for("react.memo_cache_sentinel")?(n=R("inline-flex items-center gap-1.5 px-3 py-1 rounded-full","bg-success/10 border border-success/20","animate-in fade-in-0 slide-in-from-bottom-2 duration-300"),m=r.jsx(ee,{size:13,className:"text-success"}),e[2]=n,e[3]=m):(n=e[2],m=e[3]);let o;return e[4]!==s?(o=r.jsxs("div",{className:n,children:[m,r.jsxs("span",{className:"text-xs font-medium text-success tabular-nums",children:["$",s," in credits to get started"]})]}),e[4]=s,e[5]=o):o=e[5],o}function ut(){const t=I.c(8),{org:e}=A(),l=X();let a;t[0]!==l||t[1]!==e.slug?(a=()=>l({to:"/$org/settings/ai-providers",params:{org:e.slug}}),t[0]=l,t[1]=e.slug,t[2]=a):a=t[2];let s,n,m;t[3]===Symbol.for("react.memo_cache_sentinel")?(s=R("inline-flex items-center gap-1.5 px-3 py-1 rounded-lg cursor-pointer","bg-warning/10 border border-warning/20","hover:bg-warning/15","transition-colors duration-150","animate-in fade-in-0 slide-in-from-bottom-2 duration-300"),n=r.jsx(Ze,{size:13,className:"text-warning"}),m=r.jsx("span",{className:"text-xs font-medium text-warning",children:"No credits remaining · Add more"}),t[3]=s,t[4]=n,t[5]=m):(s=t[3],n=t[4],m=t[5]);let o;return t[6]!==a?(o=r.jsxs("button",{type:"button",onClick:a,className:s,children:[n,m]}),t[6]=a,t[7]=o):o=t[7],o}function ft(t){const e=I.c(7),{scrollRef:l,sentinelRef:a,hasMoreOlder:s,isFetchingOlder:n,fetchOlderMessages:m}=t;let o,i;e[0]!==m||e[1]!==s||e[2]!==n||e[3]!==l||e[4]!==a?(o=()=>{const d=a.current,c=l.current;if(!d||!c||!s)return;const f=new IntersectionObserver(async u=>{if(!u[0]?.isIntersecting||n||!s)return;const p=c.scrollHeight,w=c.scrollTop;await m(),requestAnimationFrame(()=>{const b=c.scrollHeight;c.scrollTop=w+(b-p)})},{root:c,rootMargin:"200px 0px 0px 0px"});return f.observe(d),()=>f.disconnect()},i=[l,a,s,n,m],e[0]=m,e[1]=s,e[2]=n,e[3]=l,e[4]=a,e[5]=o,e[6]=i):(o=e[5],i=e[6]),L.useEffect(o,i)}function pt(t){const e=I.c(5),{className:l,children:a}=t;let s;e[0]!==l?(s=R("flex flex-col h-full w-full bg-background transform-[translateZ(0)]",l),e[0]=l,e[1]=s):s=e[1];let n;return e[2]!==a||e[3]!==s?(n=r.jsx("div",{className:s,children:a}),e[2]=a,e[3]=s,e[4]=n):n=e[4],n}function xt(t){const e=I.c(5),{children:l,className:a}=t;let s;e[0]!==a?(s=R("flex-1 min-h-0 overflow-y-auto isolate",a),e[0]=a,e[1]=s):s=e[1];let n;return e[2]!==l||e[3]!==s?(n=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=n):n=e[4],n}function ht(t){const e=I.c(2),{children:l}=t;let a;return e[0]!==l?(a=r.jsx("div",{className:"min-h-full shrink-0 w-full flex items-center justify-center max-w-2xl mx-auto py-10",children:l}),e[0]=l,e[1]=a):a=e[1],a}function gt(){const t=$(),{messages:e,status:l,hasMoreOlder:a,isFetchingOlder:s,fetchOlderMessages:n,isRunInProgress:m}=Z(),{taskId:o}=xe();it();const i=he(o??""),d=ge(i),c=d.size===0?e:e.filter(j=>!d.has(j.id)),f=be(c,l==="submitted"||l==="streaming"||m),u=f.visible,g=ze(u),p=g.at(-1),b=Ae()*Fe+16,y=L.useRef(null),C=L.useRef(null);ft({scrollRef:y,sentinelRef:C,hasMoreOlder:a,isFetchingOlder:s,fetchOlderMessages:n});const v=He({initial:!1}),S=j=>{y.current=j,v.scrollRef(j)};return r.jsx(je.Provider,{value:f,children:r.jsx(Ge,{messages:e,children:r.jsxs("div",{className:"relative h-full w-full min-w-0",children:[r.jsx("div",{ref:S,"data-chat-scroller":!0,className:"w-full min-w-0 max-w-full overflow-y-auto h-full [container-type:size]",style:{paddingBottom:b},children:r.jsxs("div",{ref:v.contentRef,className:"overflow-x-clip",children:[r.jsxs("div",{className:"flex flex-col min-w-0 max-w-2xl mx-auto w-full",children:[r.jsx("div",{ref:C,"aria-hidden":!0,className:"h-px"}),s&&r.jsx("div",{className:"flex items-center justify-center py-3 text-xs text-muted-foreground",children:t("chat.chat.loadingOlderMessages")}),g.slice(0,-1).map((j,T)=>r.jsx(q,{pair:j,isLastPair:!1,status:T===g.length-1?l:void 0},`pair-${j.user?.id??j.assistant?.id}`))]}),p&&r.jsx("div",{className:"min-h-[100cqh] min-w-0 max-w-2xl mx-auto w-full",children:r.jsx(q,{pair:p,isLastPair:!0,status:l},`pair-${p.user?.id??p.assistant?.id}`)})]})}),!v.isAtBottom&&r.jsx(Y,{type:"button",variant:"outline",size:"icon-sm","aria-label":t("chat.chat.jumpToLatest"),className:"absolute left-1/2 z-50 -translate-x-1/2 shadow-soft animate-in fade-in duration-200 dark:bg-background dark:hover:bg-accent",style:{bottom:b+8},onClick:()=>{v.scrollToBottom()},children:r.jsx(oe,{size:14})})]})})})}function bt(t){const e=I.c(5),{children:l,className:a}=t;let s;e[0]!==a?(s=R("flex-none w-full mx-auto p-2 pt-0","max-w-2xl min-w-0",a),e[0]=a,e[1]=s):s=e[1];let n;return e[2]!==l||e[3]!==s?(n=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=n):n=e[4],n}const Ht=Object.assign(pt,{Main:xt,Messages:gt,EmptyState:ht,Footer:bt,Input:$e,Provider:pe,StreamHost:fe,ActiveTaskStreamSource:ue,ThreadlessStreamSource:me,IceBreakers:nt,NoAiProviderEmptyState:Ve,CreditsEmptyState:ct,CreditsEyebrow:mt,NoCreditsEyebrow:ut,CreditsExhaustedBanner:Oe});export{Ht as C,zt as w};
1
+ import{c as I,a4 as A,aS as le,m as R,j as r,R as ae,r as L,b as $,t as z,h as H,w as U,x as V,v as Q,D as W,d as X,E as G,aT as ne,B as Y}from"./index-D8HDDDUz.js";import{n as oe}from"./ArrowUp-elivCbuw.js";import{d as ie,b as Z,f as ce,u as de,T as me,A as ue,n as fe,o as pe,c as xe,p as he,q as ge,t as be,L as je}from"./chat-context-DdWQJl7N.js";import{s as ye,g as J,d as ve}from"./tool-namespace-cagFCGCV.js";import{b as F,T as we,a as Ne,c as Ce}from"./tooltip-BZFegydB.js";import{e as Se,b as Te,a as Pe,D as ke}from"./drawer-D7zE3h2P.js";import{C as Ee}from"./collection-search-DrspIufR.js";import{u as De}from"./use-mobile-D2Sn1D9v.js";import{u as Me}from"./use-mcp-client-CluVMhVq.js";import{u as _e,g as Be}from"./use-mcp-prompts-YffkWL7I.js";import{h as Ie,P as Le}from"./usage-stats-CphPEBVe.js";import{T as Re,c as Oe,b as $e,d as Ae,H as Fe}from"./input-DCkWhN8u.js";import{u as ze,a as He,S as Ge,M as q}from"./pair-CBh8Ssld.js";import{u as qe,i as Ke}from"./thread-intent-DFlRKb26.js";import{b as Ue}from"./use-view-draft-kind-Bb6178QK.js";import{N as Ve}from"./index-CBlU77jJ.js";import{i as Qe}from"./LinkBroken01-BTepcmNH.js";import{f as ee}from"./agent-icon-mmszwibp.js";import{d as We}from"./use-entitlements-D_NXTAyp.js";import{u as Xe}from"./use-deco-credits-C0pODutp.js";import{F as Ye}from"./feature-paywall-6uSnqIFO.js";import{i as Ze}from"./AlertCircle-zr0wX6rF.js";const K=3,te="inline-flex items-center gap-2 px-5 py-2.5 rounded-full bg-muted text-muted-foreground text-sm font-medium transition-colors cursor-pointer",Je="flex flex-col gap-1.5 p-4 rounded-xl bg-accent/40 text-sm leading-snug transition-colors cursor-pointer text-left";function se(t){const e=I.c(46),{item:l,onSelect:a,isLoading:s,isDisabled:n,variant:m}=t,o=m===void 0?"pill":m,{prompt:i}=l;let d;if(e[0]!==i._meta||e[1]!==i.name||e[2]!==i.title){const P=J(i._meta);d=i.title??ve(i.name,P),e[0]=i._meta,e[1]=i.name,e[2]=i.title,e[3]=d}else d=e[3];const c=d,f=i.description||null;if(o==="card"){let P;e[4]!==a||e[5]!==i?(P=()=>a(i),e[4]=a,e[5]=i,e[6]=P):P=e[6];const M=n||s,_=s&&"bg-accent/40",k=(n||s)&&"cursor-not-allowed opacity-50";let E;e[7]!==_||e[8]!==k?(E=R(Je,"hover:bg-accent text-foreground",_,k),e[7]=_,e[8]=k,e[9]=E):E=e[9];let h;e[10]!==c?(h=r.jsx("span",{className:"font-medium truncate capitalize",children:c}),e[10]=c,e[11]=h):h=e[11];let N;e[12]!==s?(N=s&&r.jsx(H,{size:"xs"}),e[12]=s,e[13]=N):N=e[13];let x;e[14]!==h||e[15]!==N?(x=r.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h,N]}),e[14]=h,e[15]=N,e[16]=x):x=e[16];let D;e[17]!==f?(D=f&&r.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:f}),e[17]=f,e[18]=D):D=e[18];let B;return e[19]!==x||e[20]!==D||e[21]!==P||e[22]!==M||e[23]!==E?(B=r.jsxs("button",{type:"button",onClick:P,disabled:M,className:E,children:[x,D]}),e[19]=x,e[20]=D,e[21]=P,e[22]=M,e[23]=E,e[24]=B):B=e[24],B}let u;e[25]!==a||e[26]!==i?(u=()=>a(i),e[25]=a,e[26]=i,e[27]=u):u=e[27];const g=n||s,p=s&&"bg-muted/50",w=(n||s)&&"cursor-not-allowed opacity-50";let b;e[28]!==p||e[29]!==w?(b=R(te,"hover:bg-accent hover:text-foreground",p,w),e[28]=p,e[29]=w,e[30]=b):b=e[30];let y;e[31]!==c?(y=r.jsx("span",{className:"capitalize",children:c}),e[31]=c,e[32]=y):y=e[32];let C;e[33]!==s?(C=s&&r.jsx(H,{size:"xs"}),e[33]=s,e[34]=C):C=e[34];let v;e[35]!==u||e[36]!==g||e[37]!==b||e[38]!==y||e[39]!==C?(v=r.jsx(we,{asChild:!0,children:r.jsxs("button",{type:"button",onClick:u,disabled:g,className:b,children:[y,C]})}),e[35]=u,e[36]=g,e[37]=b,e[38]=y,e[39]=C,e[40]=v):v=e[40];const S=f??c;let j;e[41]!==S?(j=r.jsx(Ne,{side:"top",className:"max-w-xs",children:r.jsx("p",{className:"text-xs",children:S})}),e[41]=S,e[42]=j):j=e[42];let T;return e[43]!==v||e[44]!==j?(T=r.jsxs(Ce,{delayDuration:400,children:[v,j]}),e[43]=v,e[44]=j,e[45]=T):T=e[45],T}function et(t){const e=I.c(61),{items:l,open:a,onOpenChange:s,onSelect:n,loadingPrompt:m}=t,o=$(),[i,d]=L.useState(""),c=!!m;let f;e[0]!==l||e[1]!==i?(f=i.trim()?l.filter(h=>{const N=i.toLowerCase();return h.prompt.name.toLowerCase().includes(N)||(h.prompt.title??"").toLowerCase().includes(N)||(h.prompt.description??"").toLowerCase().includes(N)}):l,e[0]=l,e[1]=i,e[2]=f):f=e[2];const u=f,g=De();let p;e[3]!==u.length||e[4]!==i||e[5]!==o?(p=u.length===0&&r.jsx("p",{className:"col-span-4 text-sm text-muted-foreground text-center py-8",children:o("chat.iceBreakers.noPromptsMatch",{search:i})}),e[3]=u.length,e[4]=i,e[5]=o,e[6]=p):p=e[6];let w;if(e[7]!==u||e[8]!==c||e[9]!==m?.name||e[10]!==s||e[11]!==n){let h;e[13]!==c||e[14]!==m?.name||e[15]!==s||e[16]!==n?(h=N=>r.jsx(se,{item:N,variant:"card",onSelect:x=>{s(!1),n(x)},isLoading:m?.name===N.prompt.name,isDisabled:c&&m?.name!==N.prompt.name},N.prompt.name),e[13]=c,e[14]=m?.name,e[15]=s,e[16]=n,e[17]=h):h=e[17],w=u.map(h),e[7]=u,e[8]=c,e[9]=m?.name,e[10]=s,e[11]=n,e[12]=w}else w=e[12];let b;e[18]!==p||e[19]!==w?(b=r.jsx("div",{className:"flex-1 overflow-y-auto [scrollbar-gutter:stable]",children:r.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3 p-5",children:[p,w]})}),e[18]=p,e[19]=w,e[20]=b):b=e[20];const y=b;let C;e[21]!==o?(C=o("chat.iceBreakers.searchPromptsPlaceholder"),e[21]=o,e[22]=C):C=e[22];let v;e[23]===Symbol.for("react.memo_cache_sentinel")?(v=h=>{h.key==="Escape"&&d("")},e[23]=v):v=e[23];let S;e[24]!==i||e[25]!==C?(S=r.jsx(Ee,{value:i,onChange:d,placeholder:C,onKeyDown:v}),e[24]=i,e[25]=C,e[26]=S):S=e[26];const j=S;if(g){let h;e[27]!==o?(h=o("chat.iceBreakers.allPromptsTitle"),e[27]=o,e[28]=h):h=e[28];let N;e[29]!==h?(N=r.jsx(Se,{className:"sr-only",children:r.jsx(Te,{children:h})}),e[29]=h,e[30]=N):N=e[30];let x;e[31]!==o?(x=o("chat.iceBreakers.promptsLabel"),e[31]=o,e[32]=x):x=e[32];let D;e[33]!==x?(D=r.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 shrink-0",children:r.jsx("span",{className:"text-sm font-medium text-foreground",children:x})}),e[33]=x,e[34]=D):D=e[34];let B;e[35]!==y||e[36]!==j||e[37]!==D||e[38]!==N?(B=r.jsxs(Pe,{className:"h-[85vh] flex flex-col p-0 gap-0",children:[N,D,j,y]}),e[35]=y,e[36]=j,e[37]=D,e[38]=N,e[39]=B):B=e[39];let O;return e[40]!==s||e[41]!==a||e[42]!==B?(O=r.jsx(F,{delayDuration:400,children:r.jsx(ke,{open:a,onOpenChange:s,children:B})}),e[40]=s,e[41]=a,e[42]=B,e[43]=O):O=e[43],O}let T;e[44]!==o?(T=o("chat.iceBreakers.allPromptsTitle"),e[44]=o,e[45]=T):T=e[45];let P;e[46]!==T?(P=r.jsx(U,{className:"sr-only",children:r.jsx(V,{children:T})}),e[46]=T,e[47]=P):P=e[47];let M;e[48]!==o?(M=o("chat.iceBreakers.promptsLabel"),e[48]=o,e[49]=M):M=e[49];let _;e[50]!==M?(_=r.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 shrink-0",children:r.jsx("span",{className:"text-sm font-medium text-foreground",children:M})}),e[50]=M,e[51]=_):_=e[51];let k;e[52]!==y||e[53]!==j||e[54]!==_||e[55]!==P?(k=r.jsxs(Q,{className:"sm:max-w-[1100px] h-[680px] p-0 gap-0 overflow-hidden flex flex-col",children:[P,_,j,y]}),e[52]=y,e[53]=j,e[54]=_,e[55]=P,e[56]=k):k=e[56];let E;return e[57]!==s||e[58]!==a||e[59]!==k?(E=r.jsx(F,{delayDuration:400,children:r.jsx(W,{open:a,onOpenChange:s,children:k})}),e[57]=s,e[58]=a,e[59]=k,e[60]=E):E=e[60],E}function tt(t){const e=I.c(30),{items:l,onSelect:a,loadingPrompt:s,className:n}=t,m=$(),[o,i]=L.useState(!1);if(l.length===0)return null;let d,c,f,u,g;if(e[0]!==n||e[1]!==l||e[2]!==s||e[3]!==a||e[4]!==m){const y=l.slice(0,K),C=l.slice(K),v=!!s;let S;e[10]!==v||e[11]!==s?.name||e[12]!==a?(S=T=>r.jsx(se,{item:T,onSelect:a,isLoading:s?.name===T.prompt.name,isDisabled:v&&s?.name!==T.prompt.name},T.prompt.name),e[10]=v,e[11]=s?.name,e[12]=a,e[13]=S):S=e[13];const j=y.map(S);d=F,g=400,e[14]!==n?(c=R("w-full flex flex-wrap gap-2 justify-center",n),e[14]=n,e[15]=c):c=e[15],f=j,u=C.length>0&&r.jsx("button",{type:"button",disabled:v,onClick:()=>i(!0),className:R(te,"hover:bg-accent hover:text-foreground",v&&"opacity-50 cursor-not-allowed"),children:m("chat.iceBreakers.moreButton",{count:C.length})}),e[0]=n,e[1]=l,e[2]=s,e[3]=a,e[4]=m,e[5]=d,e[6]=c,e[7]=f,e[8]=u,e[9]=g}else d=e[5],c=e[6],f=e[7],u=e[8],g=e[9];let p;e[16]!==c||e[17]!==f||e[18]!==u?(p=r.jsxs("div",{className:c,children:[f,u]}),e[16]=c,e[17]=f,e[18]=u,e[19]=p):p=e[19];let w;e[20]!==l||e[21]!==s||e[22]!==o||e[23]!==a?(w=r.jsx(et,{items:l,open:o,onOpenChange:i,onSelect:a,loadingPrompt:s}),e[20]=l,e[21]=s,e[22]=o,e[23]=a,e[24]=w):w=e[24];let b;return e[25]!==d||e[26]!==g||e[27]!==p||e[28]!==w?(b=r.jsxs(d,{delayDuration:g,children:[p,w]}),e[25]=d,e[26]=g,e[27]=p,e[28]=w,e[29]=b):b=e[29],b}function st(){return null}function rt(t,e){switch(e.type){case"SELECT_PROMPT":return!e.prompt.arguments||e.prompt.arguments.length===0?{stage:"loading",prompt:e.prompt}:{stage:"idle"};case"START_LOADING":return{stage:"loading",prompt:e.prompt,arguments:e.arguments};case"RESET":return{stage:"idle"};default:return t}}function lt(t){const e=I.c(31),{connectionId:l}=t,a=$(),{sendMessage:s}=Z(),{org:n}=A();let m;e[0]!==l||e[1]!==n.id||e[2]!==n.slug?(m={connectionId:l,orgId:n.id,orgSlug:n.slug},e[0]=l,e[1]=n.id,e[2]=n.slug,e[3]=m):m=e[3];const o=Me(m);let i;e[4]!==o?(i={client:o,staleTime:6e4},e[4]=o,e[5]=i):i=e[5];const{data:d}=_e(i);let c;e[6]!==d?.prompts?(c=d?.prompts??[],e[6]=d?.prompts,e[7]=c):c=e[7];const f=c;let u;e[8]!==f?(u=f.map(at),e[8]=f,e[9]=u):u=e[9];const g=u;let p;e[10]===Symbol.for("react.memo_cache_sentinel")?(p={stage:"idle"},e[10]=p):p=e[10];const[w,b]=L.useReducer(rt,p),[y,C]=L.useState(null);let v;e[11]!==o||e[12]!==s||e[13]!==a?(v=async(x,D)=>{if(!o){z.error(a("chat.iceBreakers.mcpClientNotAvailable")),b({type:"RESET"});return}try{const B=await Be(o,x.name,D);b({type:"RESET"});const O={type:"doc",content:[{type:"paragraph",content:[Ie({id:x.name,name:ye(x.name,J(x._meta)),metadata:B.messages,char:"/",kind:"prompt",args:D}),{type:"text",text:" "}]}]};await s(O)}catch(B){console.error("[ice-breakers] Failed to fetch prompt:",B),z.error(a("chat.iceBreakers.failedToLoadPrompt")),b({type:"RESET"})}},e[11]=o,e[12]=s,e[13]=a,e[14]=v):v=e[14];const S=v;let j;e[15]!==S?(j=async x=>{if(x.arguments&&x.arguments.length>0){b({type:"SELECT_PROMPT",prompt:x}),C(x);return}b({type:"START_LOADING",prompt:x}),await S(x)},e[15]=S,e[16]=j):j=e[16];const T=j;let P;e[17]!==y||e[18]!==S?(P=async x=>{y&&(b({type:"START_LOADING",prompt:y,arguments:x}),C(null),await S(y,x))},e[17]=y,e[18]=S,e[19]=P):P=e[19];const M=P;if(g.length===0)return null;const _=w.stage==="loading"?w.prompt:null;let k;e[20]!==T||e[21]!==g||e[22]!==_?(k=r.jsx(tt,{items:g,onSelect:T,loadingPrompt:_}),e[20]=T,e[21]=g,e[22]=_,e[23]=k):k=e[23];let E;e[24]===Symbol.for("react.memo_cache_sentinel")?(E=()=>{C(null),b({type:"RESET"})},e[24]=E):E=e[24];let h;e[25]!==y||e[26]!==M?(h=r.jsx(Le,{prompt:y,setPrompt:E,onSubmit:M}),e[25]=y,e[26]=M,e[27]=h):h=e[27];let N;return e[28]!==k||e[29]!==h?(N=r.jsxs(r.Fragment,{children:[k,h]}),e[28]=k,e[29]=h,e[30]=N):N=e[30],N}function at(t){return{prompt:t}}function nt(t){const e=I.c(13),{className:l}=t,{selectedVirtualMcp:a}=ie(),{org:s}=A();let n;e[0]!==s.id?(n=le(s.id),e[0]=s.id,e[1]=n):n=e[1];const m=n.id,o=a?.id??m;let i;e[2]!==l?(i=R("w-full @container",l),e[2]=l,e[3]=i):i=e[3];const d=o??"default";let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=r.jsx(st,{}),e[4]=c):c=e[4];let f;e[5]!==o?(f=r.jsx(lt,{connectionId:o}),e[5]=o,e[6]=f):f=e[6];let u;e[7]!==d||e[8]!==f?(u=r.jsx(ae,{fallback:null,children:r.jsx(L.Suspense,{fallback:c,children:f},d)}),e[7]=d,e[8]=f,e[9]=u):u=e[9];let g;return e[10]!==i||e[11]!==u?(g=r.jsx("div",{className:i,children:u}),e[10]=i,e[11]=u,e[12]=g):g=e[12],g}function ot(t){let e=0;for(const l of t)for(const a of l.parts??[]){const s=a;s.type==="tool-load_repo"&&s.state==="output-available"&&s.output?.success===!0&&e++}return e}function it(){const t=I.c(11),{openPanel:e}=Ue(),l=qe(),a=ce()?.messages??[],s=de(),n=s?.taskId??null,m=s?.currentBranch;let o;t[0]!==m?(o=Ke(m),t[0]=m,t[1]=o):o=t[1];const i=o;let d;t[2]!==a?(d=ot(a),t[2]=a,t[3]=d):d=t[3];const c=d,f=L.useRef(null),u=L.useRef(null);let g,p;t[4]!==i||t[5]!==c||t[6]!==l||t[7]!==e||t[8]!==n?(g=()=>{if(!c||!n)return;const w=`${n}:${c}`;u.current!==w&&(u.current=w,l?.refreshThreadMetadata(n)),f.current!==n&&(f.current=n,i||e("site-editor"))},p=[c,n,e,l,i],t[4]=i,t[5]=c,t[6]=l,t[7]=e,t[8]=n,t[9]=g,t[10]=p):(g=t[9],p=t[10]),L.useEffect(g,p)}function re(t){return`deco-credits-empty-dismissed:${t}`}function zt(t){try{return localStorage.getItem(re(t))==="1"}catch{return!1}}function ct(){const t=I.c(56),e=$(),{org:l}=A(),a=We("credits"),s=X(),{decoKeyId:n}=Xe(),[m,o]=L.useState(!0);let i;t[0]!==l.id?(i=()=>{G("credits_empty_state_dismissed",{organization_id:l.id}),o(!1);try{localStorage.setItem(re(l.id),"1")}catch{}},t[0]=l.id,t[1]=i):i=t[1];const d=i;let c,f;if(t[2]!==m||t[3]!==l.id?(c=()=>{m&&G("credits_empty_state_shown",{organization_id:l.id})},f=[m,l.id],t[2]=m,t[3]=l.id,t[4]=c,t[5]=f):(c=t[4],f=t[5]),L.useEffect(c,f),!m)return null;if(!a){let x;t[6]!==e?(x=e("chat.input.allowanceExhaustedTitle"),t[6]=e,t[7]=x):x=t[7];let D;t[8]!==x?(D={title:x},t[8]=x,t[9]=D):D=t[9];let B;return t[10]!==d||t[11]!==D?(B=r.jsx(Ye,{feature:"chat",copy:D,onDismiss:d}),t[10]=d,t[11]=D,t[12]=B):B=t[12],B}let u;t[13]!==d?(u=x=>!x&&d(),t[13]=d,t[14]=u):u=t[14];let g;t[15]===Symbol.for("react.memo_cache_sentinel")?(g=r.jsx("div",{className:"absolute inset-x-0 top-0 h-24 bg-gradient-to-b from-warning/8 to-transparent pointer-events-none rounded-t-lg"}),t[15]=g):g=t[15];let p;t[16]===Symbol.for("react.memo_cache_sentinel")?(p=r.jsx("div",{className:"flex items-center justify-center size-11 rounded-full bg-warning/10 border border-warning/20 mx-auto",children:r.jsx(ee,{size:20,className:"text-warning"})}),t[16]=p):p=t[16];let w;t[17]!==e?(w=e("chat.creditsEmptyState.title"),t[17]=e,t[18]=w):w=t[18];let b;t[19]!==w?(b=r.jsx(V,{className:"text-lg font-semibold",children:w}),t[19]=w,t[20]=b):b=t[20];let y;t[21]!==e?(y=e("chat.creditsEmptyState.description"),t[21]=e,t[22]=y):y=t[22];let C;t[23]!==y?(C=r.jsx(ne,{className:"mt-2 text-sm leading-relaxed max-w-[320px] mx-auto",children:y}),t[23]=y,t[24]=C):C=t[24];let v;t[25]!==b||t[26]!==C?(v=r.jsxs("div",{className:"relative px-6 pt-7 pb-5",children:[g,r.jsxs(U,{className:"relative gap-3",children:[p,r.jsxs("div",{className:"text-center",children:[b,C]})]})]}),t[25]=b,t[26]=C,t[27]=v):v=t[27];let S;t[28]!==n||t[29]!==d?(S=n&&r.jsx("div",{className:"px-6 pb-5",children:r.jsx(Re,{source:"empty_state",onDone:d})}),t[28]=n,t[29]=d,t[30]=S):S=t[30];let j;t[31]!==d||t[32]!==s||t[33]!==l.slug?(j=()=>{s({to:"/$org/settings/ai-providers",params:{org:l.slug}}),d()},t[31]=d,t[32]=s,t[33]=l.slug,t[34]=j):j=t[34];let T;t[35]!==e?(T=e("chat.creditsEmptyState.useYourOwnProvider"),t[35]=e,t[36]=T):T=t[36];let P;t[37]===Symbol.for("react.memo_cache_sentinel")?(P=r.jsx(Qe,{size:12,className:"transition-transform duration-150 group-hover:translate-x-0.5"}),t[37]=P):P=t[37];let M;t[38]!==j||t[39]!==T?(M=r.jsxs("button",{type:"button",className:"group flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:j,children:[T,P]}),t[38]=j,t[39]=T,t[40]=M):M=t[40];let _;t[41]!==e?(_=e("chat.creditsEmptyState.skipForNow"),t[41]=e,t[42]=_):_=t[42];let k;t[43]!==d||t[44]!==_?(k=r.jsx(Y,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground",onClick:d,children:_}),t[43]=d,t[44]=_,t[45]=k):k=t[45];let E;t[46]!==M||t[47]!==k?(E=r.jsxs("div",{className:"px-6 py-3.5 border-t border-border bg-muted/30 flex items-center justify-between",children:[M,k]}),t[46]=M,t[47]=k,t[48]=E):E=t[48];let h;t[49]!==v||t[50]!==S||t[51]!==E?(h=r.jsxs(Q,{className:"sm:max-w-[500px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:dt,children:[v,S,E]}),t[49]=v,t[50]=S,t[51]=E,t[52]=h):h=t[52];let N;return t[53]!==h||t[54]!==u?(N=r.jsx(W,{open:!0,onOpenChange:u,children:h}),t[53]=h,t[54]=u,t[55]=N):N=t[55],N}function dt(t){return t.preventDefault()}function mt(t){const e=I.c(6),{balanceDollars:l}=t;let a;e[0]!==l?(a=l.toFixed(2),e[0]=l,e[1]=a):a=e[1];const s=a;let n,m;e[2]===Symbol.for("react.memo_cache_sentinel")?(n=R("inline-flex items-center gap-1.5 px-3 py-1 rounded-full","bg-success/10 border border-success/20","animate-in fade-in-0 slide-in-from-bottom-2 duration-300"),m=r.jsx(ee,{size:13,className:"text-success"}),e[2]=n,e[3]=m):(n=e[2],m=e[3]);let o;return e[4]!==s?(o=r.jsxs("div",{className:n,children:[m,r.jsxs("span",{className:"text-xs font-medium text-success tabular-nums",children:["$",s," in credits to get started"]})]}),e[4]=s,e[5]=o):o=e[5],o}function ut(){const t=I.c(8),{org:e}=A(),l=X();let a;t[0]!==l||t[1]!==e.slug?(a=()=>l({to:"/$org/settings/ai-providers",params:{org:e.slug}}),t[0]=l,t[1]=e.slug,t[2]=a):a=t[2];let s,n,m;t[3]===Symbol.for("react.memo_cache_sentinel")?(s=R("inline-flex items-center gap-1.5 px-3 py-1 rounded-lg cursor-pointer","bg-warning/10 border border-warning/20","hover:bg-warning/15","transition-colors duration-150","animate-in fade-in-0 slide-in-from-bottom-2 duration-300"),n=r.jsx(Ze,{size:13,className:"text-warning"}),m=r.jsx("span",{className:"text-xs font-medium text-warning",children:"No credits remaining · Add more"}),t[3]=s,t[4]=n,t[5]=m):(s=t[3],n=t[4],m=t[5]);let o;return t[6]!==a?(o=r.jsxs("button",{type:"button",onClick:a,className:s,children:[n,m]}),t[6]=a,t[7]=o):o=t[7],o}function ft(t){const e=I.c(7),{scrollRef:l,sentinelRef:a,hasMoreOlder:s,isFetchingOlder:n,fetchOlderMessages:m}=t;let o,i;e[0]!==m||e[1]!==s||e[2]!==n||e[3]!==l||e[4]!==a?(o=()=>{const d=a.current,c=l.current;if(!d||!c||!s)return;const f=new IntersectionObserver(async u=>{if(!u[0]?.isIntersecting||n||!s)return;const p=c.scrollHeight,w=c.scrollTop;await m(),requestAnimationFrame(()=>{const b=c.scrollHeight;c.scrollTop=w+(b-p)})},{root:c,rootMargin:"200px 0px 0px 0px"});return f.observe(d),()=>f.disconnect()},i=[l,a,s,n,m],e[0]=m,e[1]=s,e[2]=n,e[3]=l,e[4]=a,e[5]=o,e[6]=i):(o=e[5],i=e[6]),L.useEffect(o,i)}function pt(t){const e=I.c(5),{className:l,children:a}=t;let s;e[0]!==l?(s=R("flex flex-col h-full w-full bg-background transform-[translateZ(0)]",l),e[0]=l,e[1]=s):s=e[1];let n;return e[2]!==a||e[3]!==s?(n=r.jsx("div",{className:s,children:a}),e[2]=a,e[3]=s,e[4]=n):n=e[4],n}function xt(t){const e=I.c(5),{children:l,className:a}=t;let s;e[0]!==a?(s=R("flex-1 min-h-0 overflow-y-auto isolate",a),e[0]=a,e[1]=s):s=e[1];let n;return e[2]!==l||e[3]!==s?(n=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=n):n=e[4],n}function ht(t){const e=I.c(2),{children:l}=t;let a;return e[0]!==l?(a=r.jsx("div",{className:"min-h-full shrink-0 w-full flex items-center justify-center max-w-2xl mx-auto py-10",children:l}),e[0]=l,e[1]=a):a=e[1],a}function gt(){const t=$(),{messages:e,status:l,hasMoreOlder:a,isFetchingOlder:s,fetchOlderMessages:n,isRunInProgress:m}=Z(),{taskId:o}=xe();it();const i=he(o??""),d=ge(i),c=d.size===0?e:e.filter(j=>!d.has(j.id)),f=be(c,l==="submitted"||l==="streaming"||m),u=f.visible,g=ze(u),p=g.at(-1),b=Ae()*Fe+16,y=L.useRef(null),C=L.useRef(null);ft({scrollRef:y,sentinelRef:C,hasMoreOlder:a,isFetchingOlder:s,fetchOlderMessages:n});const v=He({initial:!1}),S=j=>{y.current=j,v.scrollRef(j)};return r.jsx(je.Provider,{value:f,children:r.jsx(Ge,{messages:e,children:r.jsxs("div",{className:"relative h-full w-full min-w-0",children:[r.jsx("div",{ref:S,"data-chat-scroller":!0,className:"w-full min-w-0 max-w-full overflow-y-auto h-full [container-type:size]",style:{paddingBottom:b},children:r.jsxs("div",{ref:v.contentRef,className:"overflow-x-clip",children:[r.jsxs("div",{className:"flex flex-col min-w-0 max-w-2xl mx-auto w-full",children:[r.jsx("div",{ref:C,"aria-hidden":!0,className:"h-px"}),s&&r.jsx("div",{className:"flex items-center justify-center py-3 text-xs text-muted-foreground",children:t("chat.chat.loadingOlderMessages")}),g.slice(0,-1).map((j,T)=>r.jsx(q,{pair:j,isLastPair:!1,status:T===g.length-1?l:void 0},`pair-${j.user?.id??j.assistant?.id}`))]}),p&&r.jsx("div",{className:"min-h-[100cqh] min-w-0 max-w-2xl mx-auto w-full",children:r.jsx(q,{pair:p,isLastPair:!0,status:l},`pair-${p.user?.id??p.assistant?.id}`)})]})}),!v.isAtBottom&&r.jsx(Y,{type:"button",variant:"outline",size:"icon-sm","aria-label":t("chat.chat.jumpToLatest"),className:"absolute left-1/2 z-50 -translate-x-1/2 shadow-soft animate-in fade-in duration-200 dark:bg-background dark:hover:bg-accent",style:{bottom:b+8},onClick:()=>{v.scrollToBottom()},children:r.jsx(oe,{size:14})})]})})})}function bt(t){const e=I.c(5),{children:l,className:a}=t;let s;e[0]!==a?(s=R("flex-none w-full mx-auto p-2 pt-0","max-w-2xl min-w-0",a),e[0]=a,e[1]=s):s=e[1];let n;return e[2]!==l||e[3]!==s?(n=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=n):n=e[4],n}const Ht=Object.assign(pt,{Main:xt,Messages:gt,EmptyState:ht,Footer:bt,Input:$e,Provider:pe,StreamHost:fe,ActiveTaskStreamSource:ue,ThreadlessStreamSource:me,IceBreakers:nt,NoAiProviderEmptyState:Ve,CreditsEmptyState:ct,CreditsEyebrow:mt,NoCreditsEyebrow:ut,CreditsExhaustedBanner:Oe});export{Ht as C,zt as w};
@@ -1 +1 @@
1
- import{d4 as _}from"./index-DkcRNYY4.js";var S={exports:{}},r={};var $;function I(){if($)return r;$=1;var m=Symbol.for("react.element"),y=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),f=Symbol.for("react.context"),x=Symbol.for("react.server_context"),u=Symbol.for("react.forward_ref"),i=Symbol.for("react.suspense"),l=Symbol.for("react.suspense_list"),a=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),R=Symbol.for("react.offscreen"),b;b=Symbol.for("react.module.reference");function t(e){if(typeof e=="object"&&e!==null){var d=e.$$typeof;switch(d){case m:switch(e=e.type,e){case o:case s:case n:case i:case l:return e;default:switch(e=e&&e.$$typeof,e){case x:case f:case u:case p:case a:case c:return e;default:return d}}case y:return d}}}return r.ContextConsumer=f,r.ContextProvider=c,r.Element=m,r.ForwardRef=u,r.Fragment=o,r.Lazy=p,r.Memo=a,r.Portal=y,r.Profiler=s,r.StrictMode=n,r.Suspense=i,r.SuspenseList=l,r.isAsyncMode=function(){return!1},r.isConcurrentMode=function(){return!1},r.isContextConsumer=function(e){return t(e)===f},r.isContextProvider=function(e){return t(e)===c},r.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===m},r.isForwardRef=function(e){return t(e)===u},r.isFragment=function(e){return t(e)===o},r.isLazy=function(e){return t(e)===p},r.isMemo=function(e){return t(e)===a},r.isPortal=function(e){return t(e)===y},r.isProfiler=function(e){return t(e)===s},r.isStrictMode=function(e){return t(e)===n},r.isSuspense=function(e){return t(e)===i},r.isSuspenseList=function(e){return t(e)===l},r.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===o||e===s||e===n||e===i||e===l||e===R||typeof e=="object"&&e!==null&&(e.$$typeof===p||e.$$typeof===a||e.$$typeof===c||e.$$typeof===f||e.$$typeof===u||e.$$typeof===b||e.getModuleId!==void 0)},r.typeOf=t,r}var v;function C(){return v||(v=1,S.exports=I()),S.exports}var g=C();const h=_(g);export{h as R,g as r};
1
+ import{d4 as _}from"./index-D8HDDDUz.js";var S={exports:{}},r={};var $;function I(){if($)return r;$=1;var m=Symbol.for("react.element"),y=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),f=Symbol.for("react.context"),x=Symbol.for("react.server_context"),u=Symbol.for("react.forward_ref"),i=Symbol.for("react.suspense"),l=Symbol.for("react.suspense_list"),a=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),R=Symbol.for("react.offscreen"),b;b=Symbol.for("react.module.reference");function t(e){if(typeof e=="object"&&e!==null){var d=e.$$typeof;switch(d){case m:switch(e=e.type,e){case o:case s:case n:case i:case l:return e;default:switch(e=e&&e.$$typeof,e){case x:case f:case u:case p:case a:case c:return e;default:return d}}case y:return d}}}return r.ContextConsumer=f,r.ContextProvider=c,r.Element=m,r.ForwardRef=u,r.Fragment=o,r.Lazy=p,r.Memo=a,r.Portal=y,r.Profiler=s,r.StrictMode=n,r.Suspense=i,r.SuspenseList=l,r.isAsyncMode=function(){return!1},r.isConcurrentMode=function(){return!1},r.isContextConsumer=function(e){return t(e)===f},r.isContextProvider=function(e){return t(e)===c},r.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===m},r.isForwardRef=function(e){return t(e)===u},r.isFragment=function(e){return t(e)===o},r.isLazy=function(e){return t(e)===p},r.isMemo=function(e){return t(e)===a},r.isPortal=function(e){return t(e)===y},r.isProfiler=function(e){return t(e)===s},r.isStrictMode=function(e){return t(e)===n},r.isSuspense=function(e){return t(e)===i},r.isSuspenseList=function(e){return t(e)===l},r.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===o||e===s||e===n||e===i||e===l||e===R||typeof e=="object"&&e!==null&&(e.$$typeof===p||e.$$typeof===a||e.$$typeof===c||e.$$typeof===f||e.$$typeof===u||e.$$typeof===b||e.getModuleId!==void 0)},r.typeOf=t,r}var v;function C(){return v||(v=1,S.exports=I()),S.exports}var g=C();const h=_(g);export{h as R,g as r};
@@ -1 +1 @@
1
- import{c as I,b as X,r as $,m as W,j as s,a4 as ze,e as nt,t as je,D as it,v as lt,w as ot,x as at,y as ct,B as Fe,au as dt,Y as ke,a5 as ut,E as H,X as ft,Z as mt,_ as ht,d as pt,aB as gt,l as bt,H as xt,ar as $e,L as Ye,$ as jt,at as Ge,aC as yt,P as vt}from"./index-DkcRNYY4.js";import{u as Ie,c as Ze,i as St,j as wt,k as Ct,l as _t}from"./use-sidebar-collapsed-BIEPyypZ.js";import{S as kt,a as Ot,b as zt}from"./sheet-DgqpeU2r.js";import{u as Rt}from"./use-mobile-BnBdDTHN.js";import{u as Et,a as Dt,D as Nt,c as Tt,C as Lt,P as Pt}from"./core.esm-rweyZtAP.js";import{S as At,v as Mt,u as $t}from"./sortable.esm-D1XbpNQK.js";import{i as It}from"./Tool01-DRAEzq3d.js";import{y as Kt,z as Ft,B as Bt,C as Ut,A as Wt,D as Be,l as Ht}from"./agent-icon-Clk7SRdQ.js";import{s as Xt}from"./Plus-niUoy_uM.js";import{i as Yt}from"./UserSquare-C01-Jxv6.js";import{s as qe}from"./XClose-CznGRv9E.js";import{T as ge,a as be,c as xe}from"./tooltip-CcU7DhuT.js";import{C as Pe,f as Gt,g as Zt,e as qt}from"./context-menu-Dsw1Ex34.js";import{a as Vt,O as Ve,w as Jt,b as Qt,c as es,E as ts,r as Oe,d as ss,e as rs,h as ns,t as is,f as Je,m as ls,o as os}from"./shell-layout-Dqg0y9U5.js";import{C as as}from"./create-organization-dialog-DUk4B45U.js";import{P as cs}from"./project-apps-I71-E6Qd.js";import{u as ds,a as us}from"./use-recent-apps-DP2oLcqz.js";import{a as fs}from"./use-navigate-to-agent-D12paxCm.js";import{a as ms,u as hs}from"./use-project-scope-DOHE3bKU.js";import{C as Ue,a as ps,b as gs,c as bs,d as xs}from"./command-BtcP4IBQ.js";import{u as js}from"./use-debounced-value-CbdraSYQ.js";import{n as ys}from"./BookOpen01-CDYle7oQ.js";import{F as vs,a as Ae,b as Ss,c as Qe}from"./feedback-BqoIMOg7.js";import{T as ws}from"./textarea-BcNUedZJ.js";function Cs(t){const e=I.c(48),{open:n,onOpenChange:r,orgs:i,currentSlug:c,onSelect:l}=t,d=X(),[o,f]=$.useState("");let b;e[0]!==o?(b=o.trim(),e[0]=o,e[1]=b):b=e[1];const h=b,p=js(h,150),m=h.length>0,u=p===h,{hits:y,isSearching:j,isStale:C,isError:w}=Vt(m?p:""),a=m?y:i;let x;e[2]!==r?(x=L=>{r(L),L||f("")},e[2]=r,e[3]=x):x=e[3];const g=x;let v;e[4]!==d?(v=d("sidebar.rail.searchOrganizations"),e[4]=d,e[5]=v):v=e[5];let S;e[6]!==d?(S=d("sidebar.rail.searchPlaceholder"),e[6]=d,e[7]=S):S=e[7];let k;e[8]!==d?(k=d("sidebar.rail.searchPlaceholder"),e[8]=d,e[9]=k):k=e[9];let _;e[10]!==o||e[11]!==k?(_=s.jsx(ps,{value:o,onValueChange:f,placeholder:k}),e[10]=o,e[11]=k,e[12]=_):_=e[12];const T=m&&(C||!u)&&"opacity-50";let R;e[13]!==T?(R=W(T),e[13]=T,e[14]=R):R=e[14];let O;e[15]!==w||e[16]!==m||e[17]!==d?(O=m&&w&&s.jsx(Ue,{children:d("sidebar.rail.searchFailed")}),e[15]=w,e[16]=m,e[17]=d,e[18]=O):O=e[18];let E;e[19]!==w||e[20]!==j||e[21]!==a.length||e[22]!==u||e[23]!==d?(E=!w&&u&&!j&&a.length===0&&s.jsx(Ue,{children:d("sidebar.rail.searchEmpty")}),e[19]=w,e[20]=j,e[21]=a.length,e[22]=u,e[23]=d,e[24]=E):E=e[24];let D;if(e[25]!==c||e[26]!==l||e[27]!==g||e[28]!==a||e[29]!==d){let L;e[31]!==c||e[32]!==l||e[33]!==g||e[34]!==d?(L=P=>s.jsxs(gs,{value:P.slug,onSelect:()=>{g(!1),P.slug!==c&&l(P.slug)},className:"gap-2.5",children:[s.jsx(Ve,{org:P,size:"sm"}),s.jsx("span",{className:"min-w-0 flex-1 truncate",children:P.name}),P.slug===c&&s.jsx("span",{className:"text-meta shrink-0",children:d("sidebar.rail.currentOrganization")})]},P.id),e[31]=c,e[32]=l,e[33]=g,e[34]=d,e[35]=L):L=e[35],D=a.map(L),e[25]=c,e[26]=l,e[27]=g,e[28]=a,e[29]=d,e[30]=D}else D=e[30];let z;e[36]!==E||e[37]!==D||e[38]!==R||e[39]!==O?(z=s.jsxs(bs,{className:R,children:[O,E,D]}),e[36]=E,e[37]=D,e[38]=R,e[39]=O,e[40]=z):z=e[40];let A;return e[41]!==n||e[42]!==g||e[43]!==z||e[44]!==v||e[45]!==S||e[46]!==_?(A=s.jsxs(xs,{open:n,onOpenChange:g,title:v,description:S,shouldFilter:!1,children:[_,z]}),e[41]=n,e[42]=g,e[43]=z,e[44]=v,e[45]=S,e[46]=_,e[47]=A):A=e[47],A}function _s(t){const e=I.c(4),{size:n,className:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("path",{d:"M20.317 4.37a19.79 19.79 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.865-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.74 19.74 0 0 0 3.677 4.37a.07.07 0 0 0-.032.028C.533 9.046-.32 13.58.099 18.058a.082.082 0 0 0 .031.056 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028c.462-.63.874-1.295 1.226-1.994a.076.076 0 0 0-.042-.106 13.1 13.1 0 0 1-1.872-.892.077.077 0 0 1-.008-.128c.126-.094.252-.192.372-.291a.074.074 0 0 1 .078-.01c3.927 1.793 8.18 1.793 12.061 0a.074.074 0 0 1 .079.009c.12.099.246.198.373.292a.077.077 0 0 1-.007.128 12.3 12.3 0 0 1-1.873.891.077.077 0 0 0-.041.107c.36.698.772 1.363 1.225 1.993a.076.076 0 0 0 .084.029 19.84 19.84 0 0 0 6.002-3.03.077.077 0 0 0 .032-.055c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.029ZM8.02 15.331c-1.183 0-2.157-1.086-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.095 2.157 2.42 0 1.332-.956 2.418-2.157 2.418Zm7.975 0c-1.183 0-2.157-1.086-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.095 2.157 2.42 0 1.332-.946 2.418-2.157 2.418Z"}),e[0]=i):i=e[0];let c;return e[1]!==r||e[2]!==n?(c=s.jsx("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:r,children:i}),e[1]=r,e[2]=n,e[3]=c):c=e[3],c}const ks=250;function Os(){return typeof navigator<"u"&&!!navigator.mediaDevices?.getDisplayMedia}function We(t,e,n){return new Promise(r=>t.toBlob(r,e,n))}async function zs(){const t=await navigator.mediaDevices.getDisplayMedia({video:{displaySurface:"browser"},audio:!1,preferCurrentTab:!0,selfBrowserSurface:"include"});try{const e=document.createElement("video");e.muted=!0,e.srcObject=t,await e.play(),await new Promise(c=>setTimeout(c,ks));const n=document.createElement("canvas");n.width=e.videoWidth,n.height=e.videoHeight,n.getContext("2d")?.drawImage(e,0,0),e.srcObject=null;let r=await We(n,"image/png");if((!r||r.size>Qe)&&(r=await We(n,"image/jpeg",.85)),!r)throw new Error("Could not encode the screenshot");const i=r.type==="image/png"?"png":"jpg";return new File([r],`screenshot.${i}`,{type:r.type})}finally{for(const e of t.getTracks())e.stop()}}function He({kind:t,open:e,onOpenChange:n}){const r=X(),i=t==="problem"?{title:r("sidebar.problem.title"),placeholder:r("sidebar.problem.placeholder"),sent:r("sidebar.problem.sent"),failed:r("sidebar.problem.failed")}:{title:r("sidebar.feedback.title"),placeholder:r("sidebar.feedback.placeholder"),sent:r("sidebar.feedback.sent"),failed:r("sidebar.feedback.failed")},{org:c}=ze(),[l,d]=$.useState(""),[o,f]=$.useState([]),[b,h]=$.useState(!1),p=()=>{for(const a of o)URL.revokeObjectURL(a.previewUrl);f([]),d("")},m=a=>{const x=a.filter(S=>Ss.includes(S.type)?S.size>Qe?(je.error(r("sidebar.feedback.screenshotTooLarge")),!1):!0:!1),g=Ae-o.length;x.length>g&&je.error(r("sidebar.feedback.tooManyScreenshots",{max:String(Ae)}));const v=x.slice(0,Math.max(g,0)).map(S=>({file:S,previewUrl:URL.createObjectURL(S)}));v.length>0&&f(S=>[...S,...v])},u=a=>{URL.revokeObjectURL(a.previewUrl),f(x=>x.filter(g=>g!==a))},y=async()=>{h(!0);try{m([await zs()])}catch(a){a instanceof DOMException&&a.name==="NotAllowedError"||(console.error("[feedback] screenshot failed",a),je.error(r("sidebar.feedback.screenshotFailed")))}finally{h(!1)}},j=a=>{const x=Array.from(a.clipboardData.files).filter(g=>g.type.startsWith("image/"));x.length!==0&&(a.preventDefault(),m(x))},C=nt({mutationFn:async()=>{const a=new FormData;a.set("kind",t),a.set("message",l.trim()),a.set("pageUrl",window.location.href);for(const g of o)a.append("screenshot",g.file);const x=await fetch(`/api/${encodeURIComponent(c.slug)}/feedback`,{method:"POST",body:a});if(!x.ok)throw new Error(`Feedback failed: ${x.status}`)},onSuccess:()=>{je.success(i.sent),p(),n(!1)},onError:()=>je.error(i.failed)}),w=l.trim().length>0&&!C.isPending;return s.jsx(it,{open:e&&!b,onOpenChange:n,children:s.jsxs(lt,{className:"sm:max-w-lg","aria-describedby":void 0,children:[s.jsx(ot,{children:s.jsx(at,{children:i.title})}),s.jsx(ws,{autoFocus:!0,value:l,onChange:a=>d(a.target.value),onPaste:j,onKeyDown:a=>{a.key==="Enter"&&(a.metaKey||a.ctrlKey)&&(a.preventDefault(),w&&C.mutate())},placeholder:i.placeholder,className:"min-h-32 max-h-80",maxLength:vs}),o.length>0&&s.jsx("div",{className:"flex flex-wrap gap-2",children:o.map((a,x)=>s.jsxs("div",{className:"group relative size-20 overflow-hidden rounded-lg shadow-edge",children:[s.jsx("a",{href:a.previewUrl,target:"_blank",rel:"noreferrer",children:s.jsx("img",{src:a.previewUrl,alt:r("sidebar.feedback.screenshotAlt",{n:String(x+1)}),className:"size-full object-cover"})}),s.jsx("button",{type:"button",onClick:()=>u(a),"aria-label":r("sidebar.feedback.removeScreenshot"),className:"absolute top-1 right-1 flex size-5 items-center justify-center rounded-full bg-background/90 text-foreground opacity-0 shadow-edge transition-opacity group-hover:opacity-100 focus-visible:opacity-100",children:s.jsx(qe,{size:12})})]},a.previewUrl))}),s.jsxs(ct,{className:"sm:justify-between",children:[Os()?s.jsxs(Fe,{type:"button",variant:"outline",onClick:y,disabled:o.length>=Ae,children:[s.jsx(Kt,{size:14}),r("sidebar.feedback.takeScreenshot")]}):s.jsx("span",{}),s.jsx(Fe,{type:"button",onClick:()=>C.mutate(),disabled:!w,children:C.isPending?r("sidebar.feedback.sending"):r("sidebar.feedback.send")})]})]})})}function ye(t){const e=I.c(11),{active:n,label:r,children:i}=t,c=n?"h-7 opacity-100":"h-2 opacity-0 group-hover/rail:opacity-60";let l;e[0]!==c?(l=W("w-1 rounded-r-full bg-foreground","transition-[height,opacity] duration-200 ease-[var(--ease-out-cubic)]","motion-reduce:transition-none",c),e[0]=c,e[1]=l):l=e[1];let d;e[2]!==l?(d=s.jsx("span",{"aria-hidden":!0,className:"absolute top-0 -left-2.5 flex h-9 items-center",children:s.jsx("span",{className:l})}),e[2]=l,e[3]=d):d=e[3];let o;e[4]!==n||e[5]!==r?(o=r&&s.jsx("span",{"aria-hidden":!0,className:W("line-clamp-2 w-full px-0.5 text-center text-2xs text-ellipsis transition-colors",n?"font-medium text-sidebar-foreground":"text-muted-foreground group-hover/rail:text-sidebar-foreground"),children:r}),e[4]=n,e[5]=r,e[6]=o):o=e[6];let f;return e[7]!==i||e[8]!==d||e[9]!==o?(f=s.jsxs("div",{className:"group/rail relative flex w-full shrink-0 flex-col items-center gap-1",children:[d,i,o]}),e[7]=i,e[8]=d,e[9]=o,e[10]=f):f=e[10],f}const Rs="https://docs.decocms.com/",Es="https://discord.gg/EQkX7CymV";function Ds(){const t=I.c(39),e=X(),{org:n}=ze(),[r,i]=$.useState(null),c=!!n.id;let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=_=>{H("help_menu_dialog_opened",{kind:_}),i(_)},t[0]=l):l=t[0];const d=l;let o;t[1]!==e?(o=e("sidebar.help.button"),t[1]=e,t[2]=o):o=t[2];let f;t[3]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(Bt,{size:18}),t[3]=f):f=t[3];let b;t[4]!==o?(b=s.jsx(ge,{asChild:!0,children:s.jsx(ft,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":o,onClick:Ls,className:"flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-foreground focus-ring data-[state=open]:bg-sidebar-accent data-[state=open]:text-foreground",children:f})})}),t[4]=o,t[5]=b):b=t[5];let h;t[6]!==e?(h=e("sidebar.help.button"),t[6]=e,t[7]=h):h=t[7];let p;t[8]!==h?(p=s.jsx(be,{side:"right",children:h}),t[8]=h,t[9]=p):p=t[9];let m;t[10]!==b||t[11]!==p?(m=s.jsxs(xe,{children:[b,p]}),t[10]=b,t[11]=p,t[12]=m):m=t[12];let u;t[13]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(ys,{}),t[13]=u):u=t[13];let y;t[14]!==e?(y=e("sidebar.help.guides"),t[14]=e,t[15]=y):y=t[15];let j;t[16]!==y?(j=s.jsx(ke,{asChild:!0,children:s.jsxs("a",{href:Rs,target:"_blank",rel:"noopener noreferrer",onClick:Ts,children:[u,y]})}),t[16]=y,t[17]=j):j=t[17];let C;t[18]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(_s,{}),t[18]=C):C=t[18];let w;t[19]!==e?(w=e("sidebar.help.discord"),t[19]=e,t[20]=w):w=t[20];let a;t[21]!==w?(a=s.jsx(ke,{asChild:!0,children:s.jsxs("a",{href:Es,target:"_blank",rel:"noopener noreferrer",onClick:Ns,children:[C,w]})}),t[21]=w,t[22]=a):a=t[22];let x;t[23]!==c||t[24]!==e?(x=c&&s.jsxs(s.Fragment,{children:[s.jsx(dt,{}),s.jsxs(ke,{onSelect:()=>d("problem"),children:[s.jsx(ut,{}),e("sidebar.help.reportProblem")]}),s.jsxs(ke,{onSelect:()=>d("feedback"),children:[s.jsx(Ft,{}),e("sidebar.feedback.button")]})]}),t[23]=c,t[24]=e,t[25]=x):x=t[25];let g;t[26]!==a||t[27]!==x||t[28]!==j?(g=s.jsxs(mt,{side:"right",align:"end",className:"w-56",children:[j,a,x]}),t[26]=a,t[27]=x,t[28]=j,t[29]=g):g=t[29];let v;t[30]!==g||t[31]!==m?(v=s.jsx(ye,{active:!1,children:s.jsxs(ht,{children:[m,g]})}),t[30]=g,t[31]=m,t[32]=v):v=t[32];let S;t[33]!==c||t[34]!==r?(S=c&&s.jsxs(s.Fragment,{children:[s.jsx(He,{kind:"problem",open:r==="problem",onOpenChange:_=>i(_?"problem":null)}),s.jsx(He,{kind:"feedback",open:r==="feedback",onOpenChange:_=>i(_?"feedback":null)})]}),t[33]=c,t[34]=r,t[35]=S):S=t[35];let k;return t[36]!==v||t[37]!==S?(k=s.jsxs(s.Fragment,{children:[v,S]}),t[36]=v,t[37]=S,t[38]=k):k=t[38],k}function Ns(){return H("help_menu_discord_opened")}function Ts(){return H("help_menu_guides_opened")}function Ls(){return H("help_menu_opened")}function Ps(t){return globalThis.addEventListener("resize",t),()=>globalThis.removeEventListener("resize",t)}const As=()=>Je(globalThis.innerHeight),Ms=()=>Je(0);function $s(t){const e=I.c(59),{org:n,active:r,onSelect:i,pinned:c,onOpenSettings:l,onTogglePin:d,onHide:o}=t,f=X();let b;e[0]!==n.slug?(b={id:n.slug},e[0]=n.slug,e[1]=b):b=e[1];const{setNodeRef:h,listeners:p,transform:m,transition:u,isDragging:y}=$t(b);let j;e[2]!==m?(j=Lt.Transform.toString(m?{...m,x:0}:null),e[2]=m,e[3]=j):j=e[3];const C=y?1:void 0,w=`rail-org-${n.slug}`;let a;e[4]!==j||e[5]!==C||e[6]!==w||e[7]!==u?(a={transform:j,transition:u,zIndex:C,viewTransitionName:w},e[4]=j,e[5]=C,e[6]=w,e[7]=u,e[8]=a):a=e[8];const x=n.name,g=r||void 0,v=r?"opacity-100":"opacity-60 hover:scale-105 hover:opacity-100",S=i&&"cursor-pointer";let k;e[9]!==v||e[10]!==S?(k=W("relative flex shrink-0 items-center justify-center rounded-xl focus-ring","transition-[opacity,transform] duration-150 ease-out",v,S),e[9]=v,e[10]=S,e[11]=k):k=e[11];let _;e[12]!==n?(_=s.jsx(Ve,{org:n,size:"lg"}),e[12]=n,e[13]=_):_=e[13];let T;e[14]!==c?(T=c&&s.jsx("span",{"aria-hidden":!0,className:"absolute -top-1 -right-1 flex size-4 items-center justify-center rounded-full bg-sidebar-accent text-muted-foreground ring-2 ring-sidebar",children:s.jsx(Be,{size:9})}),e[14]=c,e[15]=T):T=e[15];let R;e[16]!==i||e[17]!==n.name||e[18]!==k||e[19]!==_||e[20]!==T||e[21]!==g?(R=s.jsx(ge,{asChild:!0,children:s.jsx(Gt,{asChild:!0,children:s.jsxs("button",{type:"button","aria-label":x,"aria-current":g,onClick:i,className:k,children:[_,T]})})}),e[16]=i,e[17]=n.name,e[18]=k,e[19]=_,e[20]=T,e[21]=g,e[22]=R):R=e[22];let O;e[23]!==n.name?(O=s.jsx(be,{side:"right",children:n.name}),e[23]=n.name,e[24]=O):O=e[24];let E;e[25]!==R||e[26]!==O?(E=s.jsxs(xe,{children:[R,O]}),e[25]=R,e[26]=O,e[27]=E):E=e[27];let D;e[28]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(Ht,{}),e[28]=D):D=e[28];let z;e[29]!==f?(z=f("sidebar.rail.organizationSettings"),e[29]=f,e[30]=z):z=e[30];let A;e[31]!==l||e[32]!==z?(A=s.jsxs(Pe,{onSelect:l,children:[D,z]}),e[31]=l,e[32]=z,e[33]=A):A=e[33];let L;e[34]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx(Be,{}),e[34]=L):L=e[34];let P;e[35]!==c||e[36]!==f?(P=f(c?"sidebar.rail.unpinOrganization":"sidebar.rail.pinOrganization"),e[35]=c,e[36]=f,e[37]=P):P=e[37];let F;e[38]!==d||e[39]!==P?(F=s.jsxs(Pe,{onSelect:d,children:[L,P]}),e[38]=d,e[39]=P,e[40]=F):F=e[40];let B;e[41]!==o||e[42]!==f?(B=o&&s.jsxs(Pe,{onSelect:o,children:[s.jsx(It,{}),f("sidebar.rail.hideOrganization")]}),e[41]=o,e[42]=f,e[43]=B):B=e[43];let Y;e[44]!==A||e[45]!==F||e[46]!==B?(Y=s.jsxs(Zt,{children:[A,F,B]}),e[44]=A,e[45]=F,e[46]=B,e[47]=Y):Y=e[47];let K;e[48]!==E||e[49]!==Y?(K=s.jsxs(qt,{children:[E,Y]}),e[48]=E,e[49]=Y,e[50]=K):K=e[50];let U;e[51]!==r||e[52]!==K?(U=s.jsx(ye,{active:r,children:K}),e[51]=r,e[52]=K,e[53]=U):U=e[53];let G;return e[54]!==p||e[55]!==h||e[56]!==U||e[57]!==a?(G=s.jsx("div",{ref:h,...p,style:a,className:"w-full shrink-0 touch-none",children:U}),e[54]=p,e[55]=h,e[56]=U,e[57]=a,e[58]=G):G=e[58],G}function Is(t){const e=I.c(64),{project:n,orgSlug:r,active:i,onClose:c,onNavigate:l}=t,d=X();let o,f,b,h,p,m,u,y,j,C,w;if(e[0]!==i||e[1]!==l||e[2]!==r||e[3]!==n.icon||e[4]!==n.id||e[5]!==n.title){const L=Ut(n.icon,n.title);w="group/rail relative flex w-full flex-col items-center gap-1",b=xe,f=ge,C=!0,o=Ye,h=jt.root,e[17]!==r||e[18]!==n.id?(p={org:r,agentId:n.id},e[17]=r,e[18]=n.id,e[19]=p):p=e[19],m=n.title,u=i||void 0,e[20]!==l?(y=()=>{H("org_rail_recent_project_opened"),l?.()},e[20]=l,e[21]=y):y=e[21],j=W("flex shrink-0 rounded-lg focus-ring",L.text,i&&"ring-[1.5px] ring-current"),e[0]=i,e[1]=l,e[2]=r,e[3]=n.icon,e[4]=n.id,e[5]=n.title,e[6]=o,e[7]=f,e[8]=b,e[9]=h,e[10]=p,e[11]=m,e[12]=u,e[13]=y,e[14]=j,e[15]=C,e[16]=w}else o=e[6],f=e[7],b=e[8],h=e[9],p=e[10],m=e[11],u=e[12],y=e[13],j=e[14],C=e[15],w=e[16];let a;e[22]!==n.icon||e[23]!==n.title?(a=s.jsx(Wt,{icon:n.icon,name:n.title,size:"sm",className:"size-8 rounded-lg"}),e[22]=n.icon,e[23]=n.title,e[24]=a):a=e[24];let x;e[25]!==o||e[26]!==h||e[27]!==p||e[28]!==m||e[29]!==u||e[30]!==y||e[31]!==j||e[32]!==a?(x=s.jsx(o,{to:h,params:p,"aria-label":m,"aria-current":u,onClick:y,className:j,children:a}),e[25]=o,e[26]=h,e[27]=p,e[28]=m,e[29]=u,e[30]=y,e[31]=j,e[32]=a,e[33]=x):x=e[33];let g;e[34]!==f||e[35]!==x||e[36]!==C?(g=s.jsx(f,{asChild:C,children:x}),e[34]=f,e[35]=x,e[36]=C,e[37]=g):g=e[37];let v;e[38]!==n.title?(v=s.jsx(be,{side:"right",children:n.title}),e[38]=n.title,e[39]=v):v=e[39];let S;e[40]!==b||e[41]!==g||e[42]!==v?(S=s.jsxs(b,{children:[g,v]}),e[40]=b,e[41]=g,e[42]=v,e[43]=S):S=e[43];const k=i?"font-medium text-sidebar-foreground":"text-muted-foreground group-hover/rail:text-sidebar-foreground";let _;e[44]!==k?(_=W("line-clamp-2 w-full text-center text-2xs break-words transition-colors",k),e[44]=k,e[45]=_):_=e[45];let T;e[46]!==n.title||e[47]!==_?(T=s.jsx("span",{"aria-hidden":!0,className:_,children:n.title}),e[46]=n.title,e[47]=_,e[48]=T):T=e[48];let R;e[49]!==n.title||e[50]!==d?(R=d("sidebar.rail.closeApp",{name:n.title}),e[49]=n.title,e[50]=d,e[51]=R):R=e[51];let O;e[52]!==c?(O=()=>{H("org_rail_recent_project_closed"),c()},e[52]=c,e[53]=O):O=e[53];let E,D;e[54]===Symbol.for("react.memo_cache_sentinel")?(E=W("absolute -top-1.5 right-[calc(50%-1.25rem)] flex size-4 cursor-pointer items-center justify-center rounded-full","bg-sidebar-accent text-muted-foreground ring-2 ring-sidebar hover:text-foreground","opacity-0 transition-opacity duration-150 group-hover/rail:opacity-100 focus-visible:opacity-100 focus-visible:outline-none"),D=s.jsx(qe,{size:10}),e[54]=E,e[55]=D):(E=e[54],D=e[55]);let z;e[56]!==R||e[57]!==O?(z=s.jsx("button",{type:"button","aria-label":R,onClick:O,className:E,children:D}),e[56]=R,e[57]=O,e[58]=z):z=e[58];let A;return e[59]!==S||e[60]!==T||e[61]!==z||e[62]!==w?(A=s.jsxs("div",{className:w,children:[S,T,z]}),e[59]=S,e[60]=T,e[61]=z,e[62]=w,e[63]=A):A=e[63],A}const Ks={"site-editor":"/site-editor"};function Fs(t){const e=I.c(26),{app:n}=t,r=X(),i=cs[n],c=Ks[n];if(!i||!c)return null;let l;e[0]!==i.labelKey||e[1]!==r?(l=r(i.labelKey),e[0]=i.labelKey,e[1]=r,e[2]=l):l=e[2];let d;e[3]!==i.labelKey||e[4]!==r?(d=r(i.labelKey),e[3]=i.labelKey,e[4]=r,e[5]=d):d=e[5];let o;e[6]!==i.tone?(o=W("flex size-9 shrink-0 items-center justify-center rounded-xl focus-ring opacity-100",i.tone),e[6]=i.tone,e[7]=o):o=e[7];let f;e[8]!==i.Icon?(f=s.jsx(i.Icon,{size:18}),e[8]=i.Icon,e[9]=f):f=e[9];let b;e[10]!==d||e[11]!==o||e[12]!==f||e[13]!==c?(b=s.jsx(ge,{asChild:!0,children:s.jsx(Ye,{to:c,"aria-label":d,"aria-current":"page","data-testid":"org-rail-local-app",className:o,children:f})}),e[10]=d,e[11]=o,e[12]=f,e[13]=c,e[14]=b):b=e[14];let h;e[15]!==i.labelKey||e[16]!==r?(h=r(i.labelKey),e[15]=i.labelKey,e[16]=r,e[17]=h):h=e[17];let p;e[18]!==h?(p=s.jsx(be,{side:"right",children:h}),e[18]=h,e[19]=p):p=e[19];let m;e[20]!==b||e[21]!==p?(m=s.jsxs(xe,{children:[b,p]}),e[20]=b,e[21]=p,e[22]=m):m=e[22];let u;return e[23]!==l||e[24]!==m?(u=s.jsx(ye,{active:!0,label:l,children:m}),e[23]=l,e[24]=m,e[25]=u):u=e[25],u}function Bs(){const{org:t}=ze();return ds(t.slug),null}function et(t){const e=I.c(77),{onNavigate:n}=t===void 0?{}:t,r=X(),i=pt(),{org:c}=ze(),l=gt();let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d={select:Xs},e[0]=d):d=e[0];const o=bt(d);let f;e[1]!==o||e[2]!==l?(f=o?l({to:"/$org",fuzzy:!0,pending:!0}):!1,e[1]=o,e[2]=l,e[3]=f):f=e[3];const b=f,h=b?b.org:c.slug,{data:p}=xt(),[m,u]=$.useState(!1),[y,j]=$.useState(!1),C=Ie(),{recent:w,forget:a}=fs(c.slug),{projects:x}=ms(),g=hs(),v=us(),S=v&&v.projectId===null?v.app:null,k=S?[]:w.flatMap(N=>x.filter(M=>M.id===N)),_=Jt(p??[],c),{recent:T}=Qt(),R=es();let O;e[4]===Symbol.for("react.memo_cache_sentinel")?(O=Ge.railOrgPrefs(),e[4]=O):O=e[4];const[E,D]=$e(O,ts),z=Oe(E),A=$.useSyncExternalStore(Ps,As,Ms),{shown:L}=ss(rs(_,z,c.slug),T,c.slug,A,z.pinned);let P;e[5]===Symbol.for("react.memo_cache_sentinel")?(P={activationConstraint:{distance:8}},e[5]=P):P=e[5];const F=Et(Dt(Pt,P)),B=N=>{const{active:M,over:Ke}=N;Ke&&(H("org_rail_reordered"),D(rt=>ls(Oe(rt),L.map(Hs),String(M.id),String(Ke.id))))},Y=N=>{n?.(),i({to:"/$org/home",params:{org:N},viewTransition:!0})},K=N=>{H("org_rail_travel"),n?.(),R(N,L.map(Ws))},U=()=>{if(H("org_rail_search_opened"),!c.id){j(!0);return}n?.(),os()},G=!C&&"border-r border-sidebar-border";let Z;e[6]!==G?(Z=W("flex w-[68px] shrink-0 flex-col bg-sidebar",G),e[6]=G,e[7]=Z):Z=e[7];const st="flex min-h-0 flex-1 flex-col items-center gap-2.5 overflow-y-auto px-2.5 pt-3 pb-2 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden";let q;e[8]!==r?(q=r("sidebar.rail.ariaLabel"),e[8]=r,e[9]=q):q=e[9];const Re=Nt,Ee=Tt,De=At,Ne=L.map(Us),Te=Mt,Le=L.map(N=>s.jsxs($.Fragment,{children:[s.jsx($s,{org:N,active:N.slug===h,pinned:z.pinned.includes(N.slug),onSelect:N.slug!==c.slug?()=>K(N.slug):g?()=>Y(N.slug):void 0,onOpenSettings:()=>{n?.(),i({to:"/$org/settings",params:{org:N.slug}})},onTogglePin:()=>D(M=>is(Oe(M),N.slug)),onHide:N.slug===c.slug?void 0:()=>D(M=>ns(Oe(M),N.slug))}),N.slug===c.slug&&k.length>0&&s.jsx("div",{style:{viewTransitionName:"rail-projects"},className:"-mx-1.5 flex w-[calc(100%+0.75rem)] flex-col items-center gap-3 rounded-[12px] bg-foreground/4 px-1 py-3",children:k.map(M=>s.jsx(Is,{project:M,orgSlug:c.slug,active:g===M.id,onClose:()=>a(M.id),onNavigate:n},M.id))})]},N.id));let V;e[10]!==De||e[11]!==Ne||e[12]!==Te||e[13]!==Le?(V=s.jsx(De,{items:Ne,strategy:Te,children:Le}),e[10]=De,e[11]=Ne,e[12]=Te,e[13]=Le,e[14]=V):V=e[14];let J;e[15]!==Re||e[16]!==B||e[17]!==F||e[18]!==Ee||e[19]!==V?(J=s.jsx(Re,{sensors:F,collisionDetection:Ee,onDragEnd:B,children:V}),e[15]=Re,e[16]=B,e[17]=F,e[18]=Ee,e[19]=V,e[20]=J):J=e[20];let Q;e[21]!==S?(Q=S&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"my-2 h-px w-6 shrink-0 bg-sidebar-border","aria-hidden":!0}),s.jsx(Fs,{app:S})]}),e[21]=S,e[22]=Q):Q=e[22];let ee;e[23]!==J||e[24]!==Q||e[25]!==q?(ee=s.jsxs("div",{className:st,"aria-label":q,children:[J,Q]}),e[23]=J,e[24]=Q,e[25]=q,e[26]=ee):ee=e[26];let te;e[27]!==r?(te=r("sidebar.rail.search"),e[27]=r,e[28]=te):te=e[28];let ve;e[29]===Symbol.for("react.memo_cache_sentinel")?(ve=s.jsx(Yt,{size:18}),e[29]=ve):ve=e[29];let se;e[30]!==U||e[31]!==te?(se=s.jsx(ge,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":te,"aria-keyshortcuts":"Meta+K Control+K",onClick:U,className:"flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-foreground focus-ring",children:ve})}),e[30]=U,e[31]=te,e[32]=se):se=e[32];let re;e[33]!==r?(re=r("sidebar.rail.search"),e[33]=r,e[34]=re):re=e[34];let Se;e[35]===Symbol.for("react.memo_cache_sentinel")?(Se=s.jsx("span",{className:"ml-2 text-muted-foreground",children:yt.commandPalette.keys.join("")}),e[35]=Se):Se=e[35];let ne;e[36]!==re?(ne=s.jsxs(be,{side:"right",children:[re,Se]}),e[36]=re,e[37]=ne):ne=e[37];let ie;e[38]!==se||e[39]!==ne?(ie=s.jsx(ye,{active:!1,children:s.jsxs(xe,{children:[se,ne]})}),e[38]=se,e[39]=ne,e[40]=ie):ie=e[40];let le;e[41]!==r?(le=r("sidebar.picker.newOrganization"),e[41]=r,e[42]=le):le=e[42];let oe;e[43]!==u?(oe=()=>u(!0),e[43]=u,e[44]=oe):oe=e[44];let we;e[45]===Symbol.for("react.memo_cache_sentinel")?(we=s.jsx(Xt,{size:18}),e[45]=we):we=e[45];let ae;e[46]!==le||e[47]!==oe?(ae=s.jsx(ge,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":le,onClick:oe,className:"flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-foreground focus-ring",children:we})}),e[46]=le,e[47]=oe,e[48]=ae):ae=e[48];let ce;e[49]!==r?(ce=r("sidebar.picker.newOrganization"),e[49]=r,e[50]=ce):ce=e[50];let de;e[51]!==ce?(de=s.jsx(be,{side:"right",children:ce}),e[51]=ce,e[52]=de):de=e[52];let ue;e[53]!==ae||e[54]!==de?(ue=s.jsx(ye,{active:!1,children:s.jsxs(xe,{children:[ae,de]})}),e[53]=ae,e[54]=de,e[55]=ue):ue=e[55];let Ce;e[56]===Symbol.for("react.memo_cache_sentinel")?(Ce=s.jsx(Ds,{}),e[56]=Ce):Ce=e[56];let fe;e[57]!==ie||e[58]!==ue?(fe=s.jsxs("div",{className:"flex shrink-0 flex-col items-center gap-1 px-2.5 pt-2 pb-3",children:[ie,ue,Ce]}),e[57]=ie,e[58]=ue,e[59]=fe):fe=e[59];let me;e[60]!==ee||e[61]!==fe||e[62]!==Z?(me=s.jsxs("div",{className:Z,children:[ee,fe]}),e[60]=ee,e[61]=fe,e[62]=Z,e[63]=me):me=e[63];let he;e[64]!==c.slug||e[65]!==_||e[66]!==y||e[67]!==j||e[68]!==K?(he=s.jsx(Cs,{open:y,onOpenChange:j,orgs:_,currentSlug:c.slug,onSelect:K}),e[64]=c.slug,e[65]=_,e[66]=y,e[67]=j,e[68]=K,e[69]=he):he=e[69];let pe;e[70]!==m||e[71]!==u?(pe=s.jsx(as,{open:m,onOpenChange:u}),e[70]=m,e[71]=u,e[72]=pe):pe=e[72];let _e;return e[73]!==me||e[74]!==he||e[75]!==pe?(_e=s.jsxs(s.Fragment,{children:[me,he,pe]}),e[73]=me,e[74]=he,e[75]=pe,e[76]=_e):_e=e[76],_e}function Us(t){return t.slug}function Ws(t){return t.slug}function Hs(t){return t.slug}function Xs(t){return t.isLoading}function Ys(t){const e=I.c(15),{width:n,minWidth:r,maxWidth:i,onPointerDown:c,onKeyDown:l,onDoubleClick:d}=t,o=X(),{isMobile:f}=Ze(),b=Ie();if(f||b)return null;let h;e[0]!==o?(h=o("sidebar.sidebarResizeHandle.ariaLabel"),e[0]=o,e[1]=h):h=e[1];let p;e[2]!==o?(p=o("sidebar.sidebarResizeHandle.title"),e[2]=o,e[3]=p):p=e[3];let m,u;e[4]===Symbol.for("react.memo_cache_sentinel")?(m={left:"var(--sidebar-width)"},u=s.jsx("span",{className:"pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-transparent transition-colors duration-150 group-hover/resize:bg-border group-active/resize:bg-border group-focus-visible/resize:bg-ring"}),e[4]=m,e[5]=u):(m=e[4],u=e[5]);let y;return e[6]!==i||e[7]!==r||e[8]!==d||e[9]!==l||e[10]!==c||e[11]!==h||e[12]!==p||e[13]!==n?(y=s.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":h,"aria-valuenow":n,"aria-valuemin":r,"aria-valuemax":i,title:p,tabIndex:0,onPointerDown:c,onKeyDown:l,onDoubleClick:d,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize focus-visible:outline-none",style:m,children:u}),e[6]=i,e[7]=r,e[8]=d,e[9]=l,e[10]=c,e[11]=h,e[12]=p,e[13]=n,e[14]=y):y=e[14],y}const Me=400,Xe=16,Gs="sidebar.width.v2";function Zs(){const t=I.c(14),e=qs;let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=u=>typeof u=="number"?e(u):192,t[0]=n):n=t[0];const[r,i]=$e(Gs,n),c=$.useRef(null);let l;t[1]!==i||t[2]!==r?(l=u=>{u.preventDefault();const y=u.clientX,j=e(r),C=c.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),w=C?Array.from(C.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const g of w)g.style.transition="none";const a=g=>{const v=e(j+(g.clientX-y));C?.style.setProperty("--sidebar-width",`${v}px`)},x=g=>{const v=e(j+(g.clientX-y));i(v);for(const S of w)S.style.transition="";window.removeEventListener("pointermove",a),window.removeEventListener("pointerup",x),window.removeEventListener("pointercancel",x),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",a),window.addEventListener("pointerup",x),window.addEventListener("pointercancel",x)},t[1]=i,t[2]=r,t[3]=l):l=t[3];const d=l;let o;t[4]!==i?(o=()=>{i(192)},t[4]=i,t[5]=o):o=t[5];const f=o;let b;t[6]!==i||t[7]!==r?(b=u=>{if(u.key==="ArrowLeft")i(e(r-Xe));else if(u.key==="ArrowRight")i(e(r+Xe));else if(u.key==="Home")i(192);else if(u.key==="End")i(Me);else return;u.preventDefault()},t[6]=i,t[7]=r,t[8]=b):b=t[8];const h=b,p=e(r);let m;return t[9]!==h||t[10]!==d||t[11]!==f||t[12]!==p?(m={width:p,minWidth:192,maxWidth:Me,wrapperRef:c,onStartResize:d,onKeyDownResize:h,resetWidth:f},t[9]=h,t[10]=d,t[11]=f,t[12]=p,t[13]=m):m=t[13],m}function qs(t){return Math.max(192,Math.min(Me,t))}const tt=$.createContext(null);function Vs(){const t=$.use(tt);if(!t)throw new Error("Layout regions require a Layout");return t}function Js({children:t,notice:e,outsideOrg:n}){const r=Rt(),[i,c]=$e(Ge.sidebarOpen(),!0),l=Zs();return s.jsx(tt,{value:{isMobile:r,resize:l},children:s.jsx(St,{open:i,onOpenChange:c,children:s.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[e,s.jsxs("div",{className:"flex flex-1 flex-row min-h-0",children:[!n&&s.jsx(Bs,{}),!r&&(n?.rail??!0)&&s.jsx(et,{}),s.jsx(wt,{ref:l.wrapperRef,className:"flex-1 bg-sidebar relative min-h-0",style:{"--sidebar-width":`${l.width}px`,"--sidebar-width-icon":"0px"},children:s.jsx(Ct,{children:t})})]})]})})})}function Qs(t){const e=I.c(36),{children:n,renderMobile:r}=t,i=X(),{isMobile:c,resize:l}=Vs(),{openMobile:d,setOpenMobile:o}=Ze(),f=Ie();let b;e[0]!==o?(b=()=>o(!1),e[0]=o,e[1]=b):b=e[1];const h=b;if(!c){let x;e[2]!==n||e[3]!==f?(x=s.jsx("div",{className:"contents",inert:f,children:n}),e[2]=n,e[3]=f,e[4]=x):x=e[4];let g;e[5]!==l.maxWidth||e[6]!==l.minWidth||e[7]!==l.onKeyDownResize||e[8]!==l.onStartResize||e[9]!==l.resetWidth||e[10]!==l.width?(g=s.jsx(Ys,{width:l.width,minWidth:l.minWidth,maxWidth:l.maxWidth,onPointerDown:l.onStartResize,onKeyDown:l.onKeyDownResize,onDoubleClick:l.resetWidth}),e[5]=l.maxWidth,e[6]=l.minWidth,e[7]=l.onKeyDownResize,e[8]=l.onStartResize,e[9]=l.resetWidth,e[10]=l.width,e[11]=g):g=e[11];let v;return e[12]!==x||e[13]!==g?(v=s.jsxs(s.Fragment,{children:[x,g]}),e[12]=x,e[13]=g,e[14]=v):v=e[14],v}let p;e[15]!==i?(p=i("layouts.shellControls.navigationTitle"),e[15]=i,e[16]=p):p=e[16];let m;e[17]!==p?(m=s.jsx(kt,{className:"sr-only",children:p}),e[17]=p,e[18]=m):m=e[18];let u;e[19]!==h?(u=s.jsx(et,{onNavigate:h}),e[19]=h,e[20]=u):u=e[20];let y;e[21]!==h||e[22]!==r?(y=r({onClose:h}),e[21]=h,e[22]=r,e[23]=y):y=e[23];let j;e[24]!==y?(j=s.jsx("div",{className:"min-w-0 flex-1",children:y}),e[24]=y,e[25]=j):j=e[25];let C;e[26]!==u||e[27]!==j?(C=s.jsxs("div",{className:"flex h-full min-h-0",children:[u,j]}),e[26]=u,e[27]=j,e[28]=C):C=e[28];let w;e[29]!==m||e[30]!==C?(w=s.jsxs(Ot,{side:"left",hideCloseButton:!0,className:"w-screen max-w-none! p-0",onOpenAutoFocus:er,children:[m,C]}),e[29]=m,e[30]=C,e[31]=w):w=e[31];let a;return e[32]!==d||e[33]!==o||e[34]!==w?(a=s.jsx(zt,{open:d,onOpenChange:o,children:w}),e[32]=d,e[33]=o,e[34]=w,e[35]=a):a=e[35],a}function er(t){return t.preventDefault()}function tr(t){const e=I.c(3),{children:n}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={background:"transparent",containerType:"inline-size"},e[0]=r):r=e[0];let i;return e[1]!==n?(i=s.jsx(_t,{className:"flex flex-col min-h-0",style:r,children:s.jsx(vt,{variant:"plain",className:"bg-sidebar",children:s.jsx("div",{className:"relative flex-1 min-h-0 flex flex-row",children:n})})}),e[1]=n,e[2]=i):i=e[2],i}const kr=Object.assign(Js,{Sidebar:Qs,Content:tr});export{kr as L};
1
+ import{c as I,b as X,r as $,m as W,j as s,a4 as ze,e as nt,t as je,D as it,v as lt,w as ot,x as at,y as ct,B as Fe,au as dt,Y as ke,a5 as ut,E as H,X as ft,Z as mt,_ as ht,d as pt,aB as gt,l as bt,H as xt,ar as $e,L as Ye,$ as jt,at as Ge,aC as yt,P as vt}from"./index-D8HDDDUz.js";import{u as Ie,c as Ze,i as St,j as wt,k as Ct,l as _t}from"./use-sidebar-collapsed-I4_8P9uh.js";import{S as kt,a as Ot,b as zt}from"./sheet-C6rtTUBz.js";import{u as Rt}from"./use-mobile-D2Sn1D9v.js";import{u as Et,a as Dt,D as Nt,c as Tt,C as Lt,P as Pt}from"./core.esm-BzH_Nko5.js";import{S as At,v as Mt,u as $t}from"./sortable.esm-Dy1h1l2l.js";import{i as It}from"./Tool01-B0TI67n-.js";import{y as Kt,z as Ft,B as Bt,C as Ut,A as Wt,D as Be,l as Ht}from"./agent-icon-mmszwibp.js";import{s as Xt}from"./Plus-CRtXbDBy.js";import{i as Yt}from"./UserSquare-BAJzbhuU.js";import{s as qe}from"./XClose-RigEwdbR.js";import{T as ge,a as be,c as xe}from"./tooltip-BZFegydB.js";import{C as Pe,f as Gt,g as Zt,e as qt}from"./context-menu-h4YtCxvM.js";import{a as Vt,O as Ve,w as Jt,b as Qt,c as es,E as ts,r as Oe,d as ss,e as rs,h as ns,t as is,f as Je,m as ls,o as os}from"./shell-layout-DWWwIk_z.js";import{C as as}from"./create-organization-dialog-CnHhjS0p.js";import{P as cs}from"./project-apps-C9_2F9T-.js";import{u as ds,a as us}from"./use-recent-apps-h9IShd63.js";import{a as fs}from"./use-navigate-to-agent-DG4RRc2l.js";import{a as ms,u as hs}from"./use-project-scope-C_D7G_Rp.js";import{C as Ue,a as ps,b as gs,c as bs,d as xs}from"./command-ByEG2lpR.js";import{u as js}from"./use-debounced-value-Bd_QEBiw.js";import{n as ys}from"./BookOpen01-CQcU8DEw.js";import{F as vs,a as Ae,b as Ss,c as Qe}from"./feedback-BqoIMOg7.js";import{T as ws}from"./textarea-Cgu68q3w.js";function Cs(t){const e=I.c(48),{open:n,onOpenChange:r,orgs:i,currentSlug:c,onSelect:l}=t,d=X(),[o,f]=$.useState("");let b;e[0]!==o?(b=o.trim(),e[0]=o,e[1]=b):b=e[1];const h=b,p=js(h,150),m=h.length>0,u=p===h,{hits:y,isSearching:j,isStale:C,isError:w}=Vt(m?p:""),a=m?y:i;let x;e[2]!==r?(x=L=>{r(L),L||f("")},e[2]=r,e[3]=x):x=e[3];const g=x;let v;e[4]!==d?(v=d("sidebar.rail.searchOrganizations"),e[4]=d,e[5]=v):v=e[5];let S;e[6]!==d?(S=d("sidebar.rail.searchPlaceholder"),e[6]=d,e[7]=S):S=e[7];let k;e[8]!==d?(k=d("sidebar.rail.searchPlaceholder"),e[8]=d,e[9]=k):k=e[9];let _;e[10]!==o||e[11]!==k?(_=s.jsx(ps,{value:o,onValueChange:f,placeholder:k}),e[10]=o,e[11]=k,e[12]=_):_=e[12];const T=m&&(C||!u)&&"opacity-50";let R;e[13]!==T?(R=W(T),e[13]=T,e[14]=R):R=e[14];let O;e[15]!==w||e[16]!==m||e[17]!==d?(O=m&&w&&s.jsx(Ue,{children:d("sidebar.rail.searchFailed")}),e[15]=w,e[16]=m,e[17]=d,e[18]=O):O=e[18];let E;e[19]!==w||e[20]!==j||e[21]!==a.length||e[22]!==u||e[23]!==d?(E=!w&&u&&!j&&a.length===0&&s.jsx(Ue,{children:d("sidebar.rail.searchEmpty")}),e[19]=w,e[20]=j,e[21]=a.length,e[22]=u,e[23]=d,e[24]=E):E=e[24];let D;if(e[25]!==c||e[26]!==l||e[27]!==g||e[28]!==a||e[29]!==d){let L;e[31]!==c||e[32]!==l||e[33]!==g||e[34]!==d?(L=P=>s.jsxs(gs,{value:P.slug,onSelect:()=>{g(!1),P.slug!==c&&l(P.slug)},className:"gap-2.5",children:[s.jsx(Ve,{org:P,size:"sm"}),s.jsx("span",{className:"min-w-0 flex-1 truncate",children:P.name}),P.slug===c&&s.jsx("span",{className:"text-meta shrink-0",children:d("sidebar.rail.currentOrganization")})]},P.id),e[31]=c,e[32]=l,e[33]=g,e[34]=d,e[35]=L):L=e[35],D=a.map(L),e[25]=c,e[26]=l,e[27]=g,e[28]=a,e[29]=d,e[30]=D}else D=e[30];let z;e[36]!==E||e[37]!==D||e[38]!==R||e[39]!==O?(z=s.jsxs(bs,{className:R,children:[O,E,D]}),e[36]=E,e[37]=D,e[38]=R,e[39]=O,e[40]=z):z=e[40];let A;return e[41]!==n||e[42]!==g||e[43]!==z||e[44]!==v||e[45]!==S||e[46]!==_?(A=s.jsxs(xs,{open:n,onOpenChange:g,title:v,description:S,shouldFilter:!1,children:[_,z]}),e[41]=n,e[42]=g,e[43]=z,e[44]=v,e[45]=S,e[46]=_,e[47]=A):A=e[47],A}function _s(t){const e=I.c(4),{size:n,className:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("path",{d:"M20.317 4.37a19.79 19.79 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.865-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.74 19.74 0 0 0 3.677 4.37a.07.07 0 0 0-.032.028C.533 9.046-.32 13.58.099 18.058a.082.082 0 0 0 .031.056 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028c.462-.63.874-1.295 1.226-1.994a.076.076 0 0 0-.042-.106 13.1 13.1 0 0 1-1.872-.892.077.077 0 0 1-.008-.128c.126-.094.252-.192.372-.291a.074.074 0 0 1 .078-.01c3.927 1.793 8.18 1.793 12.061 0a.074.074 0 0 1 .079.009c.12.099.246.198.373.292a.077.077 0 0 1-.007.128 12.3 12.3 0 0 1-1.873.891.077.077 0 0 0-.041.107c.36.698.772 1.363 1.225 1.993a.076.076 0 0 0 .084.029 19.84 19.84 0 0 0 6.002-3.03.077.077 0 0 0 .032-.055c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.029ZM8.02 15.331c-1.183 0-2.157-1.086-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.095 2.157 2.42 0 1.332-.956 2.418-2.157 2.418Zm7.975 0c-1.183 0-2.157-1.086-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.095 2.157 2.42 0 1.332-.946 2.418-2.157 2.418Z"}),e[0]=i):i=e[0];let c;return e[1]!==r||e[2]!==n?(c=s.jsx("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:r,children:i}),e[1]=r,e[2]=n,e[3]=c):c=e[3],c}const ks=250;function Os(){return typeof navigator<"u"&&!!navigator.mediaDevices?.getDisplayMedia}function We(t,e,n){return new Promise(r=>t.toBlob(r,e,n))}async function zs(){const t=await navigator.mediaDevices.getDisplayMedia({video:{displaySurface:"browser"},audio:!1,preferCurrentTab:!0,selfBrowserSurface:"include"});try{const e=document.createElement("video");e.muted=!0,e.srcObject=t,await e.play(),await new Promise(c=>setTimeout(c,ks));const n=document.createElement("canvas");n.width=e.videoWidth,n.height=e.videoHeight,n.getContext("2d")?.drawImage(e,0,0),e.srcObject=null;let r=await We(n,"image/png");if((!r||r.size>Qe)&&(r=await We(n,"image/jpeg",.85)),!r)throw new Error("Could not encode the screenshot");const i=r.type==="image/png"?"png":"jpg";return new File([r],`screenshot.${i}`,{type:r.type})}finally{for(const e of t.getTracks())e.stop()}}function He({kind:t,open:e,onOpenChange:n}){const r=X(),i=t==="problem"?{title:r("sidebar.problem.title"),placeholder:r("sidebar.problem.placeholder"),sent:r("sidebar.problem.sent"),failed:r("sidebar.problem.failed")}:{title:r("sidebar.feedback.title"),placeholder:r("sidebar.feedback.placeholder"),sent:r("sidebar.feedback.sent"),failed:r("sidebar.feedback.failed")},{org:c}=ze(),[l,d]=$.useState(""),[o,f]=$.useState([]),[b,h]=$.useState(!1),p=()=>{for(const a of o)URL.revokeObjectURL(a.previewUrl);f([]),d("")},m=a=>{const x=a.filter(S=>Ss.includes(S.type)?S.size>Qe?(je.error(r("sidebar.feedback.screenshotTooLarge")),!1):!0:!1),g=Ae-o.length;x.length>g&&je.error(r("sidebar.feedback.tooManyScreenshots",{max:String(Ae)}));const v=x.slice(0,Math.max(g,0)).map(S=>({file:S,previewUrl:URL.createObjectURL(S)}));v.length>0&&f(S=>[...S,...v])},u=a=>{URL.revokeObjectURL(a.previewUrl),f(x=>x.filter(g=>g!==a))},y=async()=>{h(!0);try{m([await zs()])}catch(a){a instanceof DOMException&&a.name==="NotAllowedError"||(console.error("[feedback] screenshot failed",a),je.error(r("sidebar.feedback.screenshotFailed")))}finally{h(!1)}},j=a=>{const x=Array.from(a.clipboardData.files).filter(g=>g.type.startsWith("image/"));x.length!==0&&(a.preventDefault(),m(x))},C=nt({mutationFn:async()=>{const a=new FormData;a.set("kind",t),a.set("message",l.trim()),a.set("pageUrl",window.location.href);for(const g of o)a.append("screenshot",g.file);const x=await fetch(`/api/${encodeURIComponent(c.slug)}/feedback`,{method:"POST",body:a});if(!x.ok)throw new Error(`Feedback failed: ${x.status}`)},onSuccess:()=>{je.success(i.sent),p(),n(!1)},onError:()=>je.error(i.failed)}),w=l.trim().length>0&&!C.isPending;return s.jsx(it,{open:e&&!b,onOpenChange:n,children:s.jsxs(lt,{className:"sm:max-w-lg","aria-describedby":void 0,children:[s.jsx(ot,{children:s.jsx(at,{children:i.title})}),s.jsx(ws,{autoFocus:!0,value:l,onChange:a=>d(a.target.value),onPaste:j,onKeyDown:a=>{a.key==="Enter"&&(a.metaKey||a.ctrlKey)&&(a.preventDefault(),w&&C.mutate())},placeholder:i.placeholder,className:"min-h-32 max-h-80",maxLength:vs}),o.length>0&&s.jsx("div",{className:"flex flex-wrap gap-2",children:o.map((a,x)=>s.jsxs("div",{className:"group relative size-20 overflow-hidden rounded-lg shadow-edge",children:[s.jsx("a",{href:a.previewUrl,target:"_blank",rel:"noreferrer",children:s.jsx("img",{src:a.previewUrl,alt:r("sidebar.feedback.screenshotAlt",{n:String(x+1)}),className:"size-full object-cover"})}),s.jsx("button",{type:"button",onClick:()=>u(a),"aria-label":r("sidebar.feedback.removeScreenshot"),className:"absolute top-1 right-1 flex size-5 items-center justify-center rounded-full bg-background/90 text-foreground opacity-0 shadow-edge transition-opacity group-hover:opacity-100 focus-visible:opacity-100",children:s.jsx(qe,{size:12})})]},a.previewUrl))}),s.jsxs(ct,{className:"sm:justify-between",children:[Os()?s.jsxs(Fe,{type:"button",variant:"outline",onClick:y,disabled:o.length>=Ae,children:[s.jsx(Kt,{size:14}),r("sidebar.feedback.takeScreenshot")]}):s.jsx("span",{}),s.jsx(Fe,{type:"button",onClick:()=>C.mutate(),disabled:!w,children:C.isPending?r("sidebar.feedback.sending"):r("sidebar.feedback.send")})]})]})})}function ye(t){const e=I.c(11),{active:n,label:r,children:i}=t,c=n?"h-7 opacity-100":"h-2 opacity-0 group-hover/rail:opacity-60";let l;e[0]!==c?(l=W("w-1 rounded-r-full bg-foreground","transition-[height,opacity] duration-200 ease-[var(--ease-out-cubic)]","motion-reduce:transition-none",c),e[0]=c,e[1]=l):l=e[1];let d;e[2]!==l?(d=s.jsx("span",{"aria-hidden":!0,className:"absolute top-0 -left-2.5 flex h-9 items-center",children:s.jsx("span",{className:l})}),e[2]=l,e[3]=d):d=e[3];let o;e[4]!==n||e[5]!==r?(o=r&&s.jsx("span",{"aria-hidden":!0,className:W("line-clamp-2 w-full px-0.5 text-center text-2xs text-ellipsis transition-colors",n?"font-medium text-sidebar-foreground":"text-muted-foreground group-hover/rail:text-sidebar-foreground"),children:r}),e[4]=n,e[5]=r,e[6]=o):o=e[6];let f;return e[7]!==i||e[8]!==d||e[9]!==o?(f=s.jsxs("div",{className:"group/rail relative flex w-full shrink-0 flex-col items-center gap-1",children:[d,i,o]}),e[7]=i,e[8]=d,e[9]=o,e[10]=f):f=e[10],f}const Rs="https://docs.decocms.com/",Es="https://discord.gg/EQkX7CymV";function Ds(){const t=I.c(39),e=X(),{org:n}=ze(),[r,i]=$.useState(null),c=!!n.id;let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=_=>{H("help_menu_dialog_opened",{kind:_}),i(_)},t[0]=l):l=t[0];const d=l;let o;t[1]!==e?(o=e("sidebar.help.button"),t[1]=e,t[2]=o):o=t[2];let f;t[3]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(Bt,{size:18}),t[3]=f):f=t[3];let b;t[4]!==o?(b=s.jsx(ge,{asChild:!0,children:s.jsx(ft,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":o,onClick:Ls,className:"flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-foreground focus-ring data-[state=open]:bg-sidebar-accent data-[state=open]:text-foreground",children:f})})}),t[4]=o,t[5]=b):b=t[5];let h;t[6]!==e?(h=e("sidebar.help.button"),t[6]=e,t[7]=h):h=t[7];let p;t[8]!==h?(p=s.jsx(be,{side:"right",children:h}),t[8]=h,t[9]=p):p=t[9];let m;t[10]!==b||t[11]!==p?(m=s.jsxs(xe,{children:[b,p]}),t[10]=b,t[11]=p,t[12]=m):m=t[12];let u;t[13]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(ys,{}),t[13]=u):u=t[13];let y;t[14]!==e?(y=e("sidebar.help.guides"),t[14]=e,t[15]=y):y=t[15];let j;t[16]!==y?(j=s.jsx(ke,{asChild:!0,children:s.jsxs("a",{href:Rs,target:"_blank",rel:"noopener noreferrer",onClick:Ts,children:[u,y]})}),t[16]=y,t[17]=j):j=t[17];let C;t[18]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(_s,{}),t[18]=C):C=t[18];let w;t[19]!==e?(w=e("sidebar.help.discord"),t[19]=e,t[20]=w):w=t[20];let a;t[21]!==w?(a=s.jsx(ke,{asChild:!0,children:s.jsxs("a",{href:Es,target:"_blank",rel:"noopener noreferrer",onClick:Ns,children:[C,w]})}),t[21]=w,t[22]=a):a=t[22];let x;t[23]!==c||t[24]!==e?(x=c&&s.jsxs(s.Fragment,{children:[s.jsx(dt,{}),s.jsxs(ke,{onSelect:()=>d("problem"),children:[s.jsx(ut,{}),e("sidebar.help.reportProblem")]}),s.jsxs(ke,{onSelect:()=>d("feedback"),children:[s.jsx(Ft,{}),e("sidebar.feedback.button")]})]}),t[23]=c,t[24]=e,t[25]=x):x=t[25];let g;t[26]!==a||t[27]!==x||t[28]!==j?(g=s.jsxs(mt,{side:"right",align:"end",className:"w-56",children:[j,a,x]}),t[26]=a,t[27]=x,t[28]=j,t[29]=g):g=t[29];let v;t[30]!==g||t[31]!==m?(v=s.jsx(ye,{active:!1,children:s.jsxs(ht,{children:[m,g]})}),t[30]=g,t[31]=m,t[32]=v):v=t[32];let S;t[33]!==c||t[34]!==r?(S=c&&s.jsxs(s.Fragment,{children:[s.jsx(He,{kind:"problem",open:r==="problem",onOpenChange:_=>i(_?"problem":null)}),s.jsx(He,{kind:"feedback",open:r==="feedback",onOpenChange:_=>i(_?"feedback":null)})]}),t[33]=c,t[34]=r,t[35]=S):S=t[35];let k;return t[36]!==v||t[37]!==S?(k=s.jsxs(s.Fragment,{children:[v,S]}),t[36]=v,t[37]=S,t[38]=k):k=t[38],k}function Ns(){return H("help_menu_discord_opened")}function Ts(){return H("help_menu_guides_opened")}function Ls(){return H("help_menu_opened")}function Ps(t){return globalThis.addEventListener("resize",t),()=>globalThis.removeEventListener("resize",t)}const As=()=>Je(globalThis.innerHeight),Ms=()=>Je(0);function $s(t){const e=I.c(59),{org:n,active:r,onSelect:i,pinned:c,onOpenSettings:l,onTogglePin:d,onHide:o}=t,f=X();let b;e[0]!==n.slug?(b={id:n.slug},e[0]=n.slug,e[1]=b):b=e[1];const{setNodeRef:h,listeners:p,transform:m,transition:u,isDragging:y}=$t(b);let j;e[2]!==m?(j=Lt.Transform.toString(m?{...m,x:0}:null),e[2]=m,e[3]=j):j=e[3];const C=y?1:void 0,w=`rail-org-${n.slug}`;let a;e[4]!==j||e[5]!==C||e[6]!==w||e[7]!==u?(a={transform:j,transition:u,zIndex:C,viewTransitionName:w},e[4]=j,e[5]=C,e[6]=w,e[7]=u,e[8]=a):a=e[8];const x=n.name,g=r||void 0,v=r?"opacity-100":"opacity-60 hover:scale-105 hover:opacity-100",S=i&&"cursor-pointer";let k;e[9]!==v||e[10]!==S?(k=W("relative flex shrink-0 items-center justify-center rounded-xl focus-ring","transition-[opacity,transform] duration-150 ease-out",v,S),e[9]=v,e[10]=S,e[11]=k):k=e[11];let _;e[12]!==n?(_=s.jsx(Ve,{org:n,size:"lg"}),e[12]=n,e[13]=_):_=e[13];let T;e[14]!==c?(T=c&&s.jsx("span",{"aria-hidden":!0,className:"absolute -top-1 -right-1 flex size-4 items-center justify-center rounded-full bg-sidebar-accent text-muted-foreground ring-2 ring-sidebar",children:s.jsx(Be,{size:9})}),e[14]=c,e[15]=T):T=e[15];let R;e[16]!==i||e[17]!==n.name||e[18]!==k||e[19]!==_||e[20]!==T||e[21]!==g?(R=s.jsx(ge,{asChild:!0,children:s.jsx(Gt,{asChild:!0,children:s.jsxs("button",{type:"button","aria-label":x,"aria-current":g,onClick:i,className:k,children:[_,T]})})}),e[16]=i,e[17]=n.name,e[18]=k,e[19]=_,e[20]=T,e[21]=g,e[22]=R):R=e[22];let O;e[23]!==n.name?(O=s.jsx(be,{side:"right",children:n.name}),e[23]=n.name,e[24]=O):O=e[24];let E;e[25]!==R||e[26]!==O?(E=s.jsxs(xe,{children:[R,O]}),e[25]=R,e[26]=O,e[27]=E):E=e[27];let D;e[28]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(Ht,{}),e[28]=D):D=e[28];let z;e[29]!==f?(z=f("sidebar.rail.organizationSettings"),e[29]=f,e[30]=z):z=e[30];let A;e[31]!==l||e[32]!==z?(A=s.jsxs(Pe,{onSelect:l,children:[D,z]}),e[31]=l,e[32]=z,e[33]=A):A=e[33];let L;e[34]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx(Be,{}),e[34]=L):L=e[34];let P;e[35]!==c||e[36]!==f?(P=f(c?"sidebar.rail.unpinOrganization":"sidebar.rail.pinOrganization"),e[35]=c,e[36]=f,e[37]=P):P=e[37];let F;e[38]!==d||e[39]!==P?(F=s.jsxs(Pe,{onSelect:d,children:[L,P]}),e[38]=d,e[39]=P,e[40]=F):F=e[40];let B;e[41]!==o||e[42]!==f?(B=o&&s.jsxs(Pe,{onSelect:o,children:[s.jsx(It,{}),f("sidebar.rail.hideOrganization")]}),e[41]=o,e[42]=f,e[43]=B):B=e[43];let Y;e[44]!==A||e[45]!==F||e[46]!==B?(Y=s.jsxs(Zt,{children:[A,F,B]}),e[44]=A,e[45]=F,e[46]=B,e[47]=Y):Y=e[47];let K;e[48]!==E||e[49]!==Y?(K=s.jsxs(qt,{children:[E,Y]}),e[48]=E,e[49]=Y,e[50]=K):K=e[50];let U;e[51]!==r||e[52]!==K?(U=s.jsx(ye,{active:r,children:K}),e[51]=r,e[52]=K,e[53]=U):U=e[53];let G;return e[54]!==p||e[55]!==h||e[56]!==U||e[57]!==a?(G=s.jsx("div",{ref:h,...p,style:a,className:"w-full shrink-0 touch-none",children:U}),e[54]=p,e[55]=h,e[56]=U,e[57]=a,e[58]=G):G=e[58],G}function Is(t){const e=I.c(64),{project:n,orgSlug:r,active:i,onClose:c,onNavigate:l}=t,d=X();let o,f,b,h,p,m,u,y,j,C,w;if(e[0]!==i||e[1]!==l||e[2]!==r||e[3]!==n.icon||e[4]!==n.id||e[5]!==n.title){const L=Ut(n.icon,n.title);w="group/rail relative flex w-full flex-col items-center gap-1",b=xe,f=ge,C=!0,o=Ye,h=jt.root,e[17]!==r||e[18]!==n.id?(p={org:r,agentId:n.id},e[17]=r,e[18]=n.id,e[19]=p):p=e[19],m=n.title,u=i||void 0,e[20]!==l?(y=()=>{H("org_rail_recent_project_opened"),l?.()},e[20]=l,e[21]=y):y=e[21],j=W("flex shrink-0 rounded-lg focus-ring",L.text,i&&"ring-[1.5px] ring-current"),e[0]=i,e[1]=l,e[2]=r,e[3]=n.icon,e[4]=n.id,e[5]=n.title,e[6]=o,e[7]=f,e[8]=b,e[9]=h,e[10]=p,e[11]=m,e[12]=u,e[13]=y,e[14]=j,e[15]=C,e[16]=w}else o=e[6],f=e[7],b=e[8],h=e[9],p=e[10],m=e[11],u=e[12],y=e[13],j=e[14],C=e[15],w=e[16];let a;e[22]!==n.icon||e[23]!==n.title?(a=s.jsx(Wt,{icon:n.icon,name:n.title,size:"sm",className:"size-8 rounded-lg"}),e[22]=n.icon,e[23]=n.title,e[24]=a):a=e[24];let x;e[25]!==o||e[26]!==h||e[27]!==p||e[28]!==m||e[29]!==u||e[30]!==y||e[31]!==j||e[32]!==a?(x=s.jsx(o,{to:h,params:p,"aria-label":m,"aria-current":u,onClick:y,className:j,children:a}),e[25]=o,e[26]=h,e[27]=p,e[28]=m,e[29]=u,e[30]=y,e[31]=j,e[32]=a,e[33]=x):x=e[33];let g;e[34]!==f||e[35]!==x||e[36]!==C?(g=s.jsx(f,{asChild:C,children:x}),e[34]=f,e[35]=x,e[36]=C,e[37]=g):g=e[37];let v;e[38]!==n.title?(v=s.jsx(be,{side:"right",children:n.title}),e[38]=n.title,e[39]=v):v=e[39];let S;e[40]!==b||e[41]!==g||e[42]!==v?(S=s.jsxs(b,{children:[g,v]}),e[40]=b,e[41]=g,e[42]=v,e[43]=S):S=e[43];const k=i?"font-medium text-sidebar-foreground":"text-muted-foreground group-hover/rail:text-sidebar-foreground";let _;e[44]!==k?(_=W("line-clamp-2 w-full text-center text-2xs break-words transition-colors",k),e[44]=k,e[45]=_):_=e[45];let T;e[46]!==n.title||e[47]!==_?(T=s.jsx("span",{"aria-hidden":!0,className:_,children:n.title}),e[46]=n.title,e[47]=_,e[48]=T):T=e[48];let R;e[49]!==n.title||e[50]!==d?(R=d("sidebar.rail.closeApp",{name:n.title}),e[49]=n.title,e[50]=d,e[51]=R):R=e[51];let O;e[52]!==c?(O=()=>{H("org_rail_recent_project_closed"),c()},e[52]=c,e[53]=O):O=e[53];let E,D;e[54]===Symbol.for("react.memo_cache_sentinel")?(E=W("absolute -top-1.5 right-[calc(50%-1.25rem)] flex size-4 cursor-pointer items-center justify-center rounded-full","bg-sidebar-accent text-muted-foreground ring-2 ring-sidebar hover:text-foreground","opacity-0 transition-opacity duration-150 group-hover/rail:opacity-100 focus-visible:opacity-100 focus-visible:outline-none"),D=s.jsx(qe,{size:10}),e[54]=E,e[55]=D):(E=e[54],D=e[55]);let z;e[56]!==R||e[57]!==O?(z=s.jsx("button",{type:"button","aria-label":R,onClick:O,className:E,children:D}),e[56]=R,e[57]=O,e[58]=z):z=e[58];let A;return e[59]!==S||e[60]!==T||e[61]!==z||e[62]!==w?(A=s.jsxs("div",{className:w,children:[S,T,z]}),e[59]=S,e[60]=T,e[61]=z,e[62]=w,e[63]=A):A=e[63],A}const Ks={"site-editor":"/site-editor"};function Fs(t){const e=I.c(26),{app:n}=t,r=X(),i=cs[n],c=Ks[n];if(!i||!c)return null;let l;e[0]!==i.labelKey||e[1]!==r?(l=r(i.labelKey),e[0]=i.labelKey,e[1]=r,e[2]=l):l=e[2];let d;e[3]!==i.labelKey||e[4]!==r?(d=r(i.labelKey),e[3]=i.labelKey,e[4]=r,e[5]=d):d=e[5];let o;e[6]!==i.tone?(o=W("flex size-9 shrink-0 items-center justify-center rounded-xl focus-ring opacity-100",i.tone),e[6]=i.tone,e[7]=o):o=e[7];let f;e[8]!==i.Icon?(f=s.jsx(i.Icon,{size:18}),e[8]=i.Icon,e[9]=f):f=e[9];let b;e[10]!==d||e[11]!==o||e[12]!==f||e[13]!==c?(b=s.jsx(ge,{asChild:!0,children:s.jsx(Ye,{to:c,"aria-label":d,"aria-current":"page","data-testid":"org-rail-local-app",className:o,children:f})}),e[10]=d,e[11]=o,e[12]=f,e[13]=c,e[14]=b):b=e[14];let h;e[15]!==i.labelKey||e[16]!==r?(h=r(i.labelKey),e[15]=i.labelKey,e[16]=r,e[17]=h):h=e[17];let p;e[18]!==h?(p=s.jsx(be,{side:"right",children:h}),e[18]=h,e[19]=p):p=e[19];let m;e[20]!==b||e[21]!==p?(m=s.jsxs(xe,{children:[b,p]}),e[20]=b,e[21]=p,e[22]=m):m=e[22];let u;return e[23]!==l||e[24]!==m?(u=s.jsx(ye,{active:!0,label:l,children:m}),e[23]=l,e[24]=m,e[25]=u):u=e[25],u}function Bs(){const{org:t}=ze();return ds(t.slug),null}function et(t){const e=I.c(77),{onNavigate:n}=t===void 0?{}:t,r=X(),i=pt(),{org:c}=ze(),l=gt();let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d={select:Xs},e[0]=d):d=e[0];const o=bt(d);let f;e[1]!==o||e[2]!==l?(f=o?l({to:"/$org",fuzzy:!0,pending:!0}):!1,e[1]=o,e[2]=l,e[3]=f):f=e[3];const b=f,h=b?b.org:c.slug,{data:p}=xt(),[m,u]=$.useState(!1),[y,j]=$.useState(!1),C=Ie(),{recent:w,forget:a}=fs(c.slug),{projects:x}=ms(),g=hs(),v=us(),S=v&&v.projectId===null?v.app:null,k=S?[]:w.flatMap(N=>x.filter(M=>M.id===N)),_=Jt(p??[],c),{recent:T}=Qt(),R=es();let O;e[4]===Symbol.for("react.memo_cache_sentinel")?(O=Ge.railOrgPrefs(),e[4]=O):O=e[4];const[E,D]=$e(O,ts),z=Oe(E),A=$.useSyncExternalStore(Ps,As,Ms),{shown:L}=ss(rs(_,z,c.slug),T,c.slug,A,z.pinned);let P;e[5]===Symbol.for("react.memo_cache_sentinel")?(P={activationConstraint:{distance:8}},e[5]=P):P=e[5];const F=Et(Dt(Pt,P)),B=N=>{const{active:M,over:Ke}=N;Ke&&(H("org_rail_reordered"),D(rt=>ls(Oe(rt),L.map(Hs),String(M.id),String(Ke.id))))},Y=N=>{n?.(),i({to:"/$org/home",params:{org:N},viewTransition:!0})},K=N=>{H("org_rail_travel"),n?.(),R(N,L.map(Ws))},U=()=>{if(H("org_rail_search_opened"),!c.id){j(!0);return}n?.(),os()},G=!C&&"border-r border-sidebar-border";let Z;e[6]!==G?(Z=W("flex w-[68px] shrink-0 flex-col bg-sidebar",G),e[6]=G,e[7]=Z):Z=e[7];const st="flex min-h-0 flex-1 flex-col items-center gap-2.5 overflow-y-auto px-2.5 pt-3 pb-2 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden";let q;e[8]!==r?(q=r("sidebar.rail.ariaLabel"),e[8]=r,e[9]=q):q=e[9];const Re=Nt,Ee=Tt,De=At,Ne=L.map(Us),Te=Mt,Le=L.map(N=>s.jsxs($.Fragment,{children:[s.jsx($s,{org:N,active:N.slug===h,pinned:z.pinned.includes(N.slug),onSelect:N.slug!==c.slug?()=>K(N.slug):g?()=>Y(N.slug):void 0,onOpenSettings:()=>{n?.(),i({to:"/$org/settings",params:{org:N.slug}})},onTogglePin:()=>D(M=>is(Oe(M),N.slug)),onHide:N.slug===c.slug?void 0:()=>D(M=>ns(Oe(M),N.slug))}),N.slug===c.slug&&k.length>0&&s.jsx("div",{style:{viewTransitionName:"rail-projects"},className:"-mx-1.5 flex w-[calc(100%+0.75rem)] flex-col items-center gap-3 rounded-[12px] bg-foreground/4 px-1 py-3",children:k.map(M=>s.jsx(Is,{project:M,orgSlug:c.slug,active:g===M.id,onClose:()=>a(M.id),onNavigate:n},M.id))})]},N.id));let V;e[10]!==De||e[11]!==Ne||e[12]!==Te||e[13]!==Le?(V=s.jsx(De,{items:Ne,strategy:Te,children:Le}),e[10]=De,e[11]=Ne,e[12]=Te,e[13]=Le,e[14]=V):V=e[14];let J;e[15]!==Re||e[16]!==B||e[17]!==F||e[18]!==Ee||e[19]!==V?(J=s.jsx(Re,{sensors:F,collisionDetection:Ee,onDragEnd:B,children:V}),e[15]=Re,e[16]=B,e[17]=F,e[18]=Ee,e[19]=V,e[20]=J):J=e[20];let Q;e[21]!==S?(Q=S&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"my-2 h-px w-6 shrink-0 bg-sidebar-border","aria-hidden":!0}),s.jsx(Fs,{app:S})]}),e[21]=S,e[22]=Q):Q=e[22];let ee;e[23]!==J||e[24]!==Q||e[25]!==q?(ee=s.jsxs("div",{className:st,"aria-label":q,children:[J,Q]}),e[23]=J,e[24]=Q,e[25]=q,e[26]=ee):ee=e[26];let te;e[27]!==r?(te=r("sidebar.rail.search"),e[27]=r,e[28]=te):te=e[28];let ve;e[29]===Symbol.for("react.memo_cache_sentinel")?(ve=s.jsx(Yt,{size:18}),e[29]=ve):ve=e[29];let se;e[30]!==U||e[31]!==te?(se=s.jsx(ge,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":te,"aria-keyshortcuts":"Meta+K Control+K",onClick:U,className:"flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-foreground focus-ring",children:ve})}),e[30]=U,e[31]=te,e[32]=se):se=e[32];let re;e[33]!==r?(re=r("sidebar.rail.search"),e[33]=r,e[34]=re):re=e[34];let Se;e[35]===Symbol.for("react.memo_cache_sentinel")?(Se=s.jsx("span",{className:"ml-2 text-muted-foreground",children:yt.commandPalette.keys.join("")}),e[35]=Se):Se=e[35];let ne;e[36]!==re?(ne=s.jsxs(be,{side:"right",children:[re,Se]}),e[36]=re,e[37]=ne):ne=e[37];let ie;e[38]!==se||e[39]!==ne?(ie=s.jsx(ye,{active:!1,children:s.jsxs(xe,{children:[se,ne]})}),e[38]=se,e[39]=ne,e[40]=ie):ie=e[40];let le;e[41]!==r?(le=r("sidebar.picker.newOrganization"),e[41]=r,e[42]=le):le=e[42];let oe;e[43]!==u?(oe=()=>u(!0),e[43]=u,e[44]=oe):oe=e[44];let we;e[45]===Symbol.for("react.memo_cache_sentinel")?(we=s.jsx(Xt,{size:18}),e[45]=we):we=e[45];let ae;e[46]!==le||e[47]!==oe?(ae=s.jsx(ge,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":le,onClick:oe,className:"flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-foreground focus-ring",children:we})}),e[46]=le,e[47]=oe,e[48]=ae):ae=e[48];let ce;e[49]!==r?(ce=r("sidebar.picker.newOrganization"),e[49]=r,e[50]=ce):ce=e[50];let de;e[51]!==ce?(de=s.jsx(be,{side:"right",children:ce}),e[51]=ce,e[52]=de):de=e[52];let ue;e[53]!==ae||e[54]!==de?(ue=s.jsx(ye,{active:!1,children:s.jsxs(xe,{children:[ae,de]})}),e[53]=ae,e[54]=de,e[55]=ue):ue=e[55];let Ce;e[56]===Symbol.for("react.memo_cache_sentinel")?(Ce=s.jsx(Ds,{}),e[56]=Ce):Ce=e[56];let fe;e[57]!==ie||e[58]!==ue?(fe=s.jsxs("div",{className:"flex shrink-0 flex-col items-center gap-1 px-2.5 pt-2 pb-3",children:[ie,ue,Ce]}),e[57]=ie,e[58]=ue,e[59]=fe):fe=e[59];let me;e[60]!==ee||e[61]!==fe||e[62]!==Z?(me=s.jsxs("div",{className:Z,children:[ee,fe]}),e[60]=ee,e[61]=fe,e[62]=Z,e[63]=me):me=e[63];let he;e[64]!==c.slug||e[65]!==_||e[66]!==y||e[67]!==j||e[68]!==K?(he=s.jsx(Cs,{open:y,onOpenChange:j,orgs:_,currentSlug:c.slug,onSelect:K}),e[64]=c.slug,e[65]=_,e[66]=y,e[67]=j,e[68]=K,e[69]=he):he=e[69];let pe;e[70]!==m||e[71]!==u?(pe=s.jsx(as,{open:m,onOpenChange:u}),e[70]=m,e[71]=u,e[72]=pe):pe=e[72];let _e;return e[73]!==me||e[74]!==he||e[75]!==pe?(_e=s.jsxs(s.Fragment,{children:[me,he,pe]}),e[73]=me,e[74]=he,e[75]=pe,e[76]=_e):_e=e[76],_e}function Us(t){return t.slug}function Ws(t){return t.slug}function Hs(t){return t.slug}function Xs(t){return t.isLoading}function Ys(t){const e=I.c(15),{width:n,minWidth:r,maxWidth:i,onPointerDown:c,onKeyDown:l,onDoubleClick:d}=t,o=X(),{isMobile:f}=Ze(),b=Ie();if(f||b)return null;let h;e[0]!==o?(h=o("sidebar.sidebarResizeHandle.ariaLabel"),e[0]=o,e[1]=h):h=e[1];let p;e[2]!==o?(p=o("sidebar.sidebarResizeHandle.title"),e[2]=o,e[3]=p):p=e[3];let m,u;e[4]===Symbol.for("react.memo_cache_sentinel")?(m={left:"var(--sidebar-width)"},u=s.jsx("span",{className:"pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-transparent transition-colors duration-150 group-hover/resize:bg-border group-active/resize:bg-border group-focus-visible/resize:bg-ring"}),e[4]=m,e[5]=u):(m=e[4],u=e[5]);let y;return e[6]!==i||e[7]!==r||e[8]!==d||e[9]!==l||e[10]!==c||e[11]!==h||e[12]!==p||e[13]!==n?(y=s.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":h,"aria-valuenow":n,"aria-valuemin":r,"aria-valuemax":i,title:p,tabIndex:0,onPointerDown:c,onKeyDown:l,onDoubleClick:d,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize focus-visible:outline-none",style:m,children:u}),e[6]=i,e[7]=r,e[8]=d,e[9]=l,e[10]=c,e[11]=h,e[12]=p,e[13]=n,e[14]=y):y=e[14],y}const Me=400,Xe=16,Gs="sidebar.width.v2";function Zs(){const t=I.c(14),e=qs;let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=u=>typeof u=="number"?e(u):192,t[0]=n):n=t[0];const[r,i]=$e(Gs,n),c=$.useRef(null);let l;t[1]!==i||t[2]!==r?(l=u=>{u.preventDefault();const y=u.clientX,j=e(r),C=c.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),w=C?Array.from(C.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const g of w)g.style.transition="none";const a=g=>{const v=e(j+(g.clientX-y));C?.style.setProperty("--sidebar-width",`${v}px`)},x=g=>{const v=e(j+(g.clientX-y));i(v);for(const S of w)S.style.transition="";window.removeEventListener("pointermove",a),window.removeEventListener("pointerup",x),window.removeEventListener("pointercancel",x),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",a),window.addEventListener("pointerup",x),window.addEventListener("pointercancel",x)},t[1]=i,t[2]=r,t[3]=l):l=t[3];const d=l;let o;t[4]!==i?(o=()=>{i(192)},t[4]=i,t[5]=o):o=t[5];const f=o;let b;t[6]!==i||t[7]!==r?(b=u=>{if(u.key==="ArrowLeft")i(e(r-Xe));else if(u.key==="ArrowRight")i(e(r+Xe));else if(u.key==="Home")i(192);else if(u.key==="End")i(Me);else return;u.preventDefault()},t[6]=i,t[7]=r,t[8]=b):b=t[8];const h=b,p=e(r);let m;return t[9]!==h||t[10]!==d||t[11]!==f||t[12]!==p?(m={width:p,minWidth:192,maxWidth:Me,wrapperRef:c,onStartResize:d,onKeyDownResize:h,resetWidth:f},t[9]=h,t[10]=d,t[11]=f,t[12]=p,t[13]=m):m=t[13],m}function qs(t){return Math.max(192,Math.min(Me,t))}const tt=$.createContext(null);function Vs(){const t=$.use(tt);if(!t)throw new Error("Layout regions require a Layout");return t}function Js({children:t,notice:e,outsideOrg:n}){const r=Rt(),[i,c]=$e(Ge.sidebarOpen(),!0),l=Zs();return s.jsx(tt,{value:{isMobile:r,resize:l},children:s.jsx(St,{open:i,onOpenChange:c,children:s.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[e,s.jsxs("div",{className:"flex flex-1 flex-row min-h-0",children:[!n&&s.jsx(Bs,{}),!r&&(n?.rail??!0)&&s.jsx(et,{}),s.jsx(wt,{ref:l.wrapperRef,className:"flex-1 bg-sidebar relative min-h-0",style:{"--sidebar-width":`${l.width}px`,"--sidebar-width-icon":"0px"},children:s.jsx(Ct,{children:t})})]})]})})})}function Qs(t){const e=I.c(36),{children:n,renderMobile:r}=t,i=X(),{isMobile:c,resize:l}=Vs(),{openMobile:d,setOpenMobile:o}=Ze(),f=Ie();let b;e[0]!==o?(b=()=>o(!1),e[0]=o,e[1]=b):b=e[1];const h=b;if(!c){let x;e[2]!==n||e[3]!==f?(x=s.jsx("div",{className:"contents",inert:f,children:n}),e[2]=n,e[3]=f,e[4]=x):x=e[4];let g;e[5]!==l.maxWidth||e[6]!==l.minWidth||e[7]!==l.onKeyDownResize||e[8]!==l.onStartResize||e[9]!==l.resetWidth||e[10]!==l.width?(g=s.jsx(Ys,{width:l.width,minWidth:l.minWidth,maxWidth:l.maxWidth,onPointerDown:l.onStartResize,onKeyDown:l.onKeyDownResize,onDoubleClick:l.resetWidth}),e[5]=l.maxWidth,e[6]=l.minWidth,e[7]=l.onKeyDownResize,e[8]=l.onStartResize,e[9]=l.resetWidth,e[10]=l.width,e[11]=g):g=e[11];let v;return e[12]!==x||e[13]!==g?(v=s.jsxs(s.Fragment,{children:[x,g]}),e[12]=x,e[13]=g,e[14]=v):v=e[14],v}let p;e[15]!==i?(p=i("layouts.shellControls.navigationTitle"),e[15]=i,e[16]=p):p=e[16];let m;e[17]!==p?(m=s.jsx(kt,{className:"sr-only",children:p}),e[17]=p,e[18]=m):m=e[18];let u;e[19]!==h?(u=s.jsx(et,{onNavigate:h}),e[19]=h,e[20]=u):u=e[20];let y;e[21]!==h||e[22]!==r?(y=r({onClose:h}),e[21]=h,e[22]=r,e[23]=y):y=e[23];let j;e[24]!==y?(j=s.jsx("div",{className:"min-w-0 flex-1",children:y}),e[24]=y,e[25]=j):j=e[25];let C;e[26]!==u||e[27]!==j?(C=s.jsxs("div",{className:"flex h-full min-h-0",children:[u,j]}),e[26]=u,e[27]=j,e[28]=C):C=e[28];let w;e[29]!==m||e[30]!==C?(w=s.jsxs(Ot,{side:"left",hideCloseButton:!0,className:"w-screen max-w-none! p-0",onOpenAutoFocus:er,children:[m,C]}),e[29]=m,e[30]=C,e[31]=w):w=e[31];let a;return e[32]!==d||e[33]!==o||e[34]!==w?(a=s.jsx(zt,{open:d,onOpenChange:o,children:w}),e[32]=d,e[33]=o,e[34]=w,e[35]=a):a=e[35],a}function er(t){return t.preventDefault()}function tr(t){const e=I.c(3),{children:n}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={background:"transparent",containerType:"inline-size"},e[0]=r):r=e[0];let i;return e[1]!==n?(i=s.jsx(_t,{className:"flex flex-col min-h-0",style:r,children:s.jsx(vt,{variant:"plain",className:"bg-sidebar",children:s.jsx("div",{className:"relative flex-1 min-h-0 flex flex-row",children:n})})}),e[1]=n,e[2]=i):i=e[2],i}const kr=Object.assign(Js,{Sidebar:Qs,Content:tr});export{kr as L};