decocms 4.513.0 → 4.513.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 (395) hide show
  1. package/dist/client/assets/{ActiveShapeUtils-LBvsEtIF.js → ActiveShapeUtils-DLigh1zJ.js} +1 -1
  2. package/dist/client/assets/{AlertCircle-Cvem4Y6m.js → AlertCircle-BGsPYuR3.js} +1 -1
  3. package/dist/client/assets/{AreaChart-I34_ZlKp.js → AreaChart-CzXIOspF.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-BJyRuK9C.js → ArrowLeft-BY0o9p-g.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-QuecNIl2.js → ArrowUp-BIUPa0Dd.js} +1 -1
  6. package/dist/client/assets/{BarChart-pbqGOvnz.js → BarChart-C93WKtUQ.js} +1 -1
  7. package/dist/client/assets/{Building02-BN2ObsvL.js → Building02-DRJukUHS.js} +1 -1
  8. package/dist/client/assets/{CartesianChart-BedGXqvm.js → CartesianChart-Dm7PETVH.js} +1 -1
  9. package/dist/client/assets/{CategoricalChart--HklPf_2.js → CategoricalChart-71YzazvL.js} +1 -1
  10. package/dist/client/assets/{CheckCircle-CGmhPfvZ.js → CheckCircle-BMzfjrcN.js} +1 -1
  11. package/dist/client/assets/{ChevronSelectorVertical-U9ccH2nL.js → ChevronSelectorVertical-OsgtEFsS.js} +1 -1
  12. package/dist/client/assets/{ChevronUp-lK1rs_GL.js → ChevronUp-gQvBs5Wr.js} +1 -1
  13. package/dist/client/assets/{Copy01-Bx8Y-gRl.js → Copy01-B6uJ5A3t.js} +1 -1
  14. package/dist/client/assets/{CreditCard01-DJaSdmGa.js → CreditCard01-CVvsJVHy.js} +1 -1
  15. package/dist/client/assets/{DotsVertical-BNZNyNFz.js → DotsVertical-CRoDrMwf.js} +1 -1
  16. package/dist/client/assets/{ErrorBarContext-DzKnIsKK.js → ErrorBarContext-B-ZKQrQu.js} +1 -1
  17. package/dist/client/assets/{Globe04-De900zqZ.js → Globe04-mgILh7rR.js} +1 -1
  18. package/dist/client/assets/{Image01-B8PoGELO.js → Image01-D3cjfdzm.js} +1 -1
  19. package/dist/client/assets/{Key01-BljyWDFA.js → Key01-DBuAbIfl.js} +1 -1
  20. package/dist/client/assets/{Link01-C3oYUEbC.js → Link01-BkraNRbc.js} +1 -1
  21. package/dist/client/assets/{LinkBroken01-Y3mt2hVL.js → LinkBroken01-COSlZBTJ.js} +1 -1
  22. package/dist/client/assets/{Monitor01-HFhvTdbN.js → Monitor01-CSJlATNa.js} +1 -1
  23. package/dist/client/assets/{Play-d5F43Knt.js → Play-CS7ZIu7O.js} +1 -1
  24. package/dist/client/assets/{Plus-Bqqgzhs9.js → Plus-Dam4fGJv.js} +1 -1
  25. package/dist/client/assets/{ReferenceLine-BJB76XEK.js → ReferenceLine-D2WOwhtk.js} +1 -1
  26. package/dist/client/assets/{SearchMd-B9CuCbEU.js → SearchMd-BmY7B7q3.js} +1 -1
  27. package/dist/client/assets/{Sector-5t1y_8w7.js → Sector-BZsKaQxF.js} +1 -1
  28. package/dist/client/assets/{ShoppingBag01-CKzXoaBh.js → ShoppingBag01-Di2JjyaO.js} +1 -1
  29. package/dist/client/assets/{Sun-e4Jz5epu.js → Sun-CBRr2mzj.js} +1 -1
  30. package/dist/client/assets/{SwitchHorizontal01-DUci_dzf.js → SwitchHorizontal01-CVhIGWzI.js} +1 -1
  31. package/dist/client/assets/{Tool01-BE48oOYM.js → Tool01-C0tA6_WY.js} +1 -1
  32. package/dist/client/assets/{Trash01-hjqx0xiP.js → Trash01-BWvgZ-My.js} +1 -1
  33. package/dist/client/assets/{Upload01-Dui_BQYy.js → Upload01-Ayc3pkY7.js} +1 -1
  34. package/dist/client/assets/{User01-DBEYfJmD.js → User01-Cv65FqsE.js} +1 -1
  35. package/dist/client/assets/{UserSquare-BQx0PoRd.js → UserSquare-jVbr-XG_.js} +1 -1
  36. package/dist/client/assets/{Users01-eugfopoG.js → Users01-C8djc4kj.js} +1 -1
  37. package/dist/client/assets/{XClose-Bowm5HJz.js → XClose-J1FWOmKL.js} +1 -1
  38. package/dist/client/assets/{ZoomOut-ChtZny13.js → ZoomOut-DOsQL5PZ.js} +1 -1
  39. package/dist/client/assets/{access-gate-DPS87CJq.js → access-gate-CSnpnsDz.js} +1 -1
  40. package/dist/client/assets/{add-connection-dialog-DAySVccA.js → add-connection-dialog-9kRnWMWN.js} +1 -1
  41. package/dist/client/assets/{agent-analytics-CrMNgewv.js → agent-analytics-BksVEHnl.js} +1 -1
  42. package/dist/client/assets/agent-app-BvW3NdzM.js +1 -0
  43. package/dist/client/assets/{agent-assets-DWhf_SEf.js → agent-assets-tvE-HIyg.js} +1 -1
  44. package/dist/client/assets/{agent-automation-lORFyc9I.js → agent-automation-V4FV4x5y.js} +1 -1
  45. package/dist/client/assets/{agent-automations-RkIafiu4.js → agent-automations-Cc2YYUR6.js} +1 -1
  46. package/dist/client/assets/{agent-connect-sources-CMhIynuO.js → agent-connect-sources-tJKzdDG2.js} +1 -1
  47. package/dist/client/assets/agent-deck-VsdzJHTb.js +1 -0
  48. package/dist/client/assets/{agent-e2e-D4ENm6k_.js → agent-e2e-DGsy6V0w.js} +1 -1
  49. package/dist/client/assets/{agent-experiments-BtEg3B74.js → agent-experiments-CEmVLVx7.js} +1 -1
  50. package/dist/client/assets/agent-file-BS9xNFAD.js +1 -0
  51. package/dist/client/assets/{agent-hosting-QFiH6VR3.js → agent-hosting-SI9CUAyr.js} +1 -1
  52. package/dist/client/assets/{agent-icon-DlDNTTdr.js → agent-icon-BAsaPIPW.js} +1 -1
  53. package/dist/client/assets/agent-library-DGYQBCM9.js +1 -0
  54. package/dist/client/assets/agent-library-file-DewMMSvO.js +1 -0
  55. package/dist/client/assets/{agent-monitor-BHnCA5z7.js → agent-monitor-BAD4Hlpg.js} +1 -1
  56. package/dist/client/assets/{agent-overview-BwDPLgMe.js → agent-overview-yn0Mx7V2.js} +1 -1
  57. package/dist/client/assets/{agent-releases-Bofb2T7R.js → agent-releases-BROUPRoA.js} +1 -1
  58. package/dist/client/assets/agent-settings-CSFW5nek.js +1 -0
  59. package/dist/client/assets/{agent-site-editor-D7rBmOw2.js → agent-site-editor-Bc4JzAtX.js} +1 -1
  60. package/dist/client/assets/agent-site-editor-code-MU0whE6U.js +2 -0
  61. package/dist/client/assets/agent-site-editor-content-zSQpYEGg.js +1 -0
  62. package/dist/client/assets/agent-site-editor-preview-txveR_ds.js +1 -0
  63. package/dist/client/assets/agent-view-B4w7PCL8.js +1 -0
  64. package/dist/client/assets/{agent-view-guard-DyDnDg7y.js → agent-view-guard-COE0o9OW.js} +1 -1
  65. package/dist/client/assets/{agents-list-T2KWhjOT.js → agents-list-DsnUnijY.js} +1 -1
  66. package/dist/client/assets/{ai-providers-Bnd-GLut.js → ai-providers-_9Q72ibF.js} +1 -1
  67. package/dist/client/assets/{alert-BwaNqkbw.js → alert-DVLk8Iin.js} +1 -1
  68. package/dist/client/assets/{alert-dialog-CmKQuDkV.js → alert-dialog-BXsSwOCK.js} +1 -1
  69. package/dist/client/assets/{analytics-sections-DwtWSdAK.js → analytics-sections-CVdZcg3H.js} +1 -1
  70. package/dist/client/assets/{api-keys-KcVvFrOK.js → api-keys-C5_mr7Dx.js} +1 -1
  71. package/dist/client/assets/api-keys-DZBvZYm9.js +1 -0
  72. package/dist/client/assets/{app-editor-BxQO_X8O.js → app-editor-CAZxpcHR.js} +1 -1
  73. package/dist/client/assets/{asset-utils-DBfxeqs4.js → asset-utils-BYeUUuYD.js} +1 -1
  74. package/dist/client/assets/{auth-CxzzB0A-.js → auth-BGlQUcUq.js} +1 -1
  75. package/dist/client/assets/{auth-catchall-YU9hssz4.js → auth-catchall-B57MQTC7.js} +1 -1
  76. package/dist/client/assets/{auth-entry-BDxcstat.js → auth-entry-DEDwSnje.js} +1 -1
  77. package/dist/client/assets/{auth-split-layout-uPIZ06pl.js → auth-split-layout-Bywa1Rdj.js} +1 -1
  78. package/dist/client/assets/{authenticate-and-persist-oauth-pViKD1Gc.js → authenticate-and-persist-oauth-DawdQrNH.js} +1 -1
  79. package/dist/client/assets/{automation-list-row-VbClolLO.js → automation-list-row-DxgABVkv.js} +1 -1
  80. package/dist/client/assets/{automation-runs-Ji-ZINaE.js → automation-runs-CiiZvO3g.js} +1 -1
  81. package/dist/client/assets/{automations-D-FftS8j.js → automations-BYa97um_.js} +1 -1
  82. package/dist/client/assets/{autosend-DpLh7dWJ.js → autosend-C7UE5qBo.js} +1 -1
  83. package/dist/client/assets/{avatar-B7fJfb4h.js → avatar-D92LQoMs.js} +1 -1
  84. package/dist/client/assets/{badge-jakYyc_g.js → badge-Qo4xyqqo.js} +1 -1
  85. package/dist/client/assets/{block-document-DG8gJAvd.js → block-document-skQMirff.js} +1 -1
  86. package/dist/client/assets/{blocks-preview-workspace-context-BDcQiasN.js → blocks-preview-workspace-context-C5n4-2zD.js} +1 -1
  87. package/dist/client/assets/{blocks-tab-states-MA76RVeA.js → blocks-tab-states-ZrFyRJRO.js} +3 -3
  88. package/dist/client/assets/{blog-schema-D9C9kwxP.js → blog-schema-BLRxEC9n.js} +1 -1
  89. package/dist/client/assets/{board-analytics-DalD9fQ3.js → board-analytics-CUpSvAlz.js} +1 -1
  90. package/dist/client/assets/{buckets-Dn6CexmT.js → buckets-BJtJwr6_.js} +1 -1
  91. package/dist/client/assets/{build-improve-prompt-doc-BBxdElnJ.js → build-improve-prompt-doc-8Y6fyKcx.js} +1 -1
  92. package/dist/client/assets/{calendar-C3YpQYuA.js → calendar-O9AxJqnv.js} +1 -1
  93. package/dist/client/assets/{capability-load-error-BiQECpRV.js → capability-load-error-CNqk0tFF.js} +1 -1
  94. package/dist/client/assets/{category-editor-DTbDHa8_.js → category-editor-Be436pUw.js} +1 -1
  95. package/dist/client/assets/{chart-Br89Gn0m.js → chart-D6QCrw1j.js} +1 -1
  96. package/dist/client/assets/{chat-context-Bt_IpHdn.js → chat-context-CHUVtsDo.js} +1 -1
  97. package/dist/client/assets/{chat-draft-BGbvxGKi.js → chat-draft-DxqHQ-qR.js} +1 -1
  98. package/dist/client/assets/{checkbox-ltNhNDM4.js → checkbox-D1J9YzHt.js} +1 -1
  99. package/dist/client/assets/{choose-editor-BPKHXrR8.js → choose-editor-zF0EkKBL.js} +1 -1
  100. package/dist/client/assets/{cli-auth-success-LMenui54.js → cli-auth-success-BIVUc0bz.js} +1 -1
  101. package/dist/client/assets/{client-icons-DZCTBLc_.js → client-icons-NYHaAc2_.js} +1 -1
  102. package/dist/client/assets/cms-settings-editor-TWoAtc7Q.js +1 -0
  103. package/dist/client/assets/{collapsible-zZWIPLJZ.js → collapsible-4U8s9Q7m.js} +1 -1
  104. package/dist/client/assets/{collection-detail-DIQzmK8m.js → collection-detail-DrU7rdOW.js} +1 -1
  105. package/dist/client/assets/{collection-display-button-KTr_BPyD.js → collection-display-button-BaRotray.js} +1 -1
  106. package/dist/client/assets/{collection-search-YuTRrSRO.js → collection-search-Da85q05W.js} +1 -1
  107. package/dist/client/assets/{collection-table-wrapper-DLVMl8sg.js → collection-table-wrapper-Dnz2lweC.js} +1 -1
  108. package/dist/client/assets/{collection-tabs-c6VqSBVf.js → collection-tabs-Mlp_Rejx.js} +1 -1
  109. package/dist/client/assets/{column-rules-CjQsEHE1.js → column-rules-B6lY_qpw.js} +1 -1
  110. package/dist/client/assets/{combobox-NN0PZi2X.js → combobox-BCOMReLT.js} +1 -1
  111. package/dist/client/assets/{coming-soon-page-BJ9pltmN.js → coming-soon-page-CvYKECN2.js} +1 -1
  112. package/dist/client/assets/{command-De4hkzkI.js → command-DEXvL0cT.js} +1 -1
  113. package/dist/client/assets/{companion-mcps-section-Czb-JWAm.js → companion-mcps-section-B8jhQ1lU.js} +1 -1
  114. package/dist/client/assets/{config-C3xx9JGl.js → config-Ujr94uo2.js} +1 -1
  115. package/dist/client/assets/{connect-CnHwICLf.js → connect-CJaggTPx.js} +1 -1
  116. package/dist/client/assets/{connect-layout-CyExoM2e.js → connect-layout-cAlAMnNX.js} +1 -1
  117. package/dist/client/assets/{connection-card-D-zYcnvX.js → connection-card-BJdYhmjP.js} +1 -1
  118. package/dist/client/assets/{connection-detail-D0Ov4Y6W.js → connection-detail-BW1b2Mg7.js} +1 -1
  119. package/dist/client/assets/{connection-form-helpers-B4YACDyO.js → connection-form-helpers-CEC9pgiR.js} +1 -1
  120. package/dist/client/assets/{connection-DNHX-zI2.js → connection-vIWlN3YD.js} +1 -1
  121. package/dist/client/assets/{connections-CxrYf-kX.js → connections-DHSlk7eF.js} +1 -1
  122. package/dist/client/assets/{content-tab-DGigAgtr.js → content-tab-D6dlC_eK.js} +3 -3
  123. package/dist/client/assets/{context-CqSnYEDh.js → context-D9Kj70hJ.js} +1 -1
  124. package/dist/client/assets/{context-menu-DytMQMuj.js → context-menu-BdSGqs_f.js} +1 -1
  125. package/dist/client/assets/{context-shell-B_t5yOoc.js → context-shell-BcUuYMwr.js} +3 -3
  126. package/dist/client/assets/{core.esm-ELTg1p5B.js → core.esm-C_n7cKI9.js} +1 -1
  127. package/dist/client/assets/{create-organization-dialog-OyCDluH-.js → create-organization-dialog-BCynjnXm.js} +1 -1
  128. package/dist/client/assets/{daily-pulse-B8GWVVWD.js → daily-pulse-jLaM72aD.js} +1 -1
  129. package/dist/client/assets/{discover-CY6WK9ZB.js → discover-WzG-rd-A.js} +1 -1
  130. package/dist/client/assets/{domain-settings-BPxde74J.js → domain-settings-BctCKhK5.js} +1 -1
  131. package/dist/client/assets/{drawer-tVqfqfgS.js → drawer-PNF7GPi2.js} +1 -1
  132. package/dist/client/assets/{editor-u4-EEM31.js → editor-DOvs1ZAj.js} +1 -1
  133. package/dist/client/assets/{editor-classes-DuHYsQXo.js → editor-classes-BJdm0od6.js} +1 -1
  134. package/dist/client/assets/{empty-state-DOXszr-G.js → empty-state-Czk_KZf6.js} +1 -1
  135. package/dist/client/assets/{empty-state-DhQ6b-4X.js → empty-state-DRKp6xDi.js} +1 -1
  136. package/dist/client/assets/{extract-connection-data-Noi2laOR.js → extract-connection-data-B-l9PdV0.js} +1 -1
  137. package/dist/client/assets/{feature-gate-BCWJGTl6.js → feature-gate-Cfsfll5L.js} +1 -1
  138. package/dist/client/assets/{feature-paywall-DSUE7uWN.js → feature-paywall-CpCMXj0j.js} +1 -1
  139. package/dist/client/assets/{file-explorer-cyqbbj8g.js → file-explorer-B_BhjGuw.js} +1 -1
  140. package/dist/client/assets/{file-preview-BjiRATef.js → file-preview-BgeZG3Ut.js} +1 -1
  141. package/dist/client/assets/{file-share-button-D64rdBSQ.js → file-share-button-CjByqgRv.js} +1 -1
  142. package/dist/client/assets/{file-type-icon-C8TsjujV.js → file-type-icon-DrKVTY_y.js} +1 -1
  143. package/dist/client/assets/flat-project-CoYmpFOt.js +1 -0
  144. package/dist/client/assets/{folder-icon-B9zlfCiB.js → folder-icon-BL3ikPej.js} +1 -1
  145. package/dist/client/assets/{form-CSFIwIoN.js → form-BReygSsa.js} +1 -1
  146. package/dist/client/assets/{general-BXsEOlZ5.js → general-ayENLq_6.js} +1 -1
  147. package/dist/client/assets/{home-CBma7wvX.js → home-Be7m5c5B.js} +1 -1
  148. package/dist/client/assets/{hosted-publish-feedback-Dg4Y4bkK.js → hosted-publish-feedback-DJnIOpIA.js} +1 -1
  149. package/dist/client/assets/{icon-button-DJlTsKMg.js → icon-button-BMIQVqVD.js} +1 -1
  150. package/dist/client/assets/{index-CWXy03he.js → index--jYyuT9F.js} +1 -1
  151. package/dist/client/assets/{index-BFpWqRZ0.js → index-59MGyrbA.js} +1 -1
  152. package/dist/client/assets/{index-eSoO1i0F.js → index-B-_uoizr.js} +1 -1
  153. package/dist/client/assets/{index-lvF8BPVu.js → index-BPxS5t0S.js} +1 -1
  154. package/dist/client/assets/{index-Dv5iQt6B.js → index-Bf67UBtK.js} +1 -1
  155. package/dist/client/assets/{index-fTp2wmQ3.js → index-BqhDNSVy.js} +1 -1
  156. package/dist/client/assets/{index-KNQWtaCb.js → index-CB34n0pr.js} +1 -1
  157. package/dist/client/assets/{index-B2TzlpQ3.js → index-CNWJYHvX.js} +2 -2
  158. package/dist/client/assets/{index-ooKcIXhe.js → index-CPKH5oCf.js} +1 -1
  159. package/dist/client/assets/{index-DHfIFZth.js → index-CsPw2N1B.js} +1 -1
  160. package/dist/client/assets/{index-CY0geMFq.js → index-DG1Kruym.js} +1 -1
  161. package/dist/client/assets/{index-BY2lzf-u.js → index-DYoNho4Y.js} +3 -3
  162. package/dist/client/assets/{index-LRv4COmF.js → index-Dg_sZbJ0.js} +1 -1
  163. package/dist/client/assets/{index-B9bk7VCc.js → index-DmRWIJlm.js} +1 -1
  164. package/dist/client/assets/{index-DsQzKhrM.js → index-DrCJgI2a.js} +1 -1
  165. package/dist/client/assets/{index-yL8irnL4.js → index-IZZ1QWYx.js} +1 -1
  166. package/dist/client/assets/{index-redirect-BeoaztAB.js → index-redirect-DZaEKj9N.js} +1 -1
  167. package/dist/client/assets/{infiniteQueryObserver-BPxNO74V.js → infiniteQueryObserver-BZJj1RTX.js} +1 -1
  168. package/dist/client/assets/{infra-billing-DAC7xXxq.js → infra-billing-BGzk-gx3.js} +1 -1
  169. package/dist/client/assets/input-C14RAevO.js +17 -0
  170. package/dist/client/assets/{input-Ct6LNWBH.js → input-DQjMvdWZ.js} +1 -1
  171. package/dist/client/assets/{integration-icon-GE6gXozG.js → integration-icon-A_JAytZI.js} +1 -1
  172. package/dist/client/assets/{jira-icon-DJu4VOlJ.js → jira-icon-BaW-JhER.js} +1 -1
  173. package/dist/client/assets/{label-BZWf9QYv.js → label-DKrrhY82.js} +1 -1
  174. package/dist/client/assets/{layout-DFE-VkxR.js → layout-D0vGvTyD.js} +1 -1
  175. package/dist/client/assets/{legacy-agents-deep-BoBSHh4p.js → legacy-agents-deep-DHz8EBj2.js} +1 -1
  176. package/dist/client/assets/{legacy-main-redirect-BzTdSNma.js → legacy-main-redirect-CXWM5YMx.js} +1 -1
  177. package/dist/client/assets/library-DgG4D6VI.js +1 -0
  178. package/dist/client/assets/{library-tab-BotaUMxF.js → library-tab-DkG0GP2E.js} +1 -1
  179. package/dist/client/assets/{login-BGNHu7VT.js → login-7DjR_ib1.js} +1 -1
  180. package/dist/client/assets/{markdown-BDFrzJxg.js → markdown-Dkv8vF7I.js} +1 -1
  181. package/dist/client/assets/{mcp-app-renderer-DrvF9Pa7.js → mcp-app-renderer-BTmNB3HB.js} +1 -1
  182. package/dist/client/assets/{mcp-oauth-Cz4ZcdFq.js → mcp-oauth-B26YcM5J.js} +1 -1
  183. package/dist/client/assets/{mcp-oauth-DCzrBgix.js → mcp-oauth-D8hJrLwY.js} +1 -1
  184. package/dist/client/assets/{members-i_wujRIe.js → members-E4TpKIKd.js} +1 -1
  185. package/dist/client/assets/{memory-BQXcCBLH.js → memory-oZaHxU5s.js} +1 -1
  186. package/dist/client/assets/{mini-report-page-tiAHPa9i.js → mini-report-page-BArv5mW4.js} +1 -1
  187. package/dist/client/assets/{mock-board-BR-zRSgi.js → mock-board-Bwwa0M9R.js} +1 -1
  188. package/dist/client/assets/{monaco-editor-BhXbxyIo.js → monaco-editor-BqY_G1yM.js} +1 -1
  189. package/dist/client/assets/monitoring-Bbj5Lns2.js +1 -0
  190. package/dist/client/assets/{monitoring-stats-row-WEAYPHMD.js → monitoring-stats-row-DVnv34v6.js} +1 -1
  191. package/dist/client/assets/{multi-select-BbCHHIsr.js → multi-select-Cbl9yFmn.js} +1 -1
  192. package/dist/client/assets/{mustache-CLs-t0EC.js → mustache-CKwi1qbg.js} +1 -1
  193. package/dist/client/assets/{new-project-dialog-Ceh0T8Zf.js → new-project-dialog-N-lmXyX9.js} +1 -1
  194. package/dist/client/assets/{oauth-callback-DoEjttDw.js → oauth-callback-CO5zT2gX.js} +1 -1
  195. package/dist/client/assets/{oauth-callback-ai-provider-DoDUw7wL.js → oauth-callback-ai-provider-DUDQxWlr.js} +1 -1
  196. package/dist/client/assets/{onboarding-L82roMb_.js → onboarding-BTnElaEx.js} +1 -1
  197. package/dist/client/assets/{openai-conversation-DAtvucBP.js → openai-conversation-n75eRcLs.js} +1 -1
  198. package/dist/client/assets/{optimistic-project-sidebar-views-BasKJepJ.js → optimistic-project-sidebar-views-DQouTCdv.js} +1 -1
  199. package/dist/client/assets/{order-monitor-day-k6dr4Zbg.js → order-monitor-day-04mjD1ep.js} +1 -1
  200. package/dist/client/assets/{organization-choice-PC77U28J.js → organization-choice-Cp6NuWiL.js} +1 -1
  201. package/dist/client/assets/{orgs-CIp7lq46.js → orgs-ClkY5PpT.js} +1 -1
  202. package/dist/client/assets/{page-seo-form-CpA9AjIr.js → page-seo-form-CPFkTIUJ.js} +1 -1
  203. package/dist/client/assets/{pair-CDXhexja.js → pair-B8IyaaR6.js} +1 -1
  204. package/dist/client/assets/plan-BlqG-PLe.js +1 -0
  205. package/dist/client/assets/{plan-ladder-ChIYVMh8.js → plan-ladder-CsKZpYtk.js} +1 -1
  206. package/dist/client/assets/{popover-DSQOAh-c.js → popover-D5cvllcj.js} +1 -1
  207. package/dist/client/assets/{post-calendar-DZAFc_0t.js → post-calendar-BjbOMFj8.js} +1 -1
  208. package/dist/client/assets/{post-editor-hE-yOtFr.js → post-editor-Bkg0zAby.js} +1 -1
  209. package/dist/client/assets/{preview-content-C1y4Cni-.js → preview-content-DOlR7Sto.js} +1 -1
  210. package/dist/client/assets/{preview-dialog-BXoibHar.js → preview-dialog-BFeDZCyo.js} +1 -1
  211. package/dist/client/assets/{preview-panel-DwwDdJ8h.js → preview-panel-hig46M8n.js} +1 -1
  212. package/dist/client/assets/{preview-tab-B17aL0uv.js → preview-tab-Db6Udxne.js} +3 -3
  213. package/dist/client/assets/{product-picker-dialog-hqwivccT.js → product-picker-dialog-BoRMhmF_.js} +1 -1
  214. package/dist/client/assets/{profile-D1aXcB6j.js → profile-DWc7hq2C.js} +1 -1
  215. package/dist/client/assets/{project-app-view-c32i0SfA.js → project-app-view-D2zjD9lX.js} +1 -1
  216. package/dist/client/assets/{project-apps-D81NGCcl.js → project-apps-BccHfSJ8.js} +1 -1
  217. package/dist/client/assets/{project-feed-CEyfQQlk.js → project-feed-rwZLZcmg.js} +1 -1
  218. package/dist/client/assets/{project-icon-DMkjvbD2.js → project-icon-C5PSWWOk.js} +1 -1
  219. package/dist/client/assets/project-reports-C5VIbCKB.js +1 -0
  220. package/dist/client/assets/project-tasks-DY-VwdNN.js +1 -0
  221. package/dist/client/assets/{projects-empty-state-DaO_LK3i.js → projects-empty-state-BbguoYWh.js} +1 -1
  222. package/dist/client/assets/{projects-CVwQvEzi.js → projects-yiMF0-RY.js} +1 -1
  223. package/dist/client/assets/{prompts-C_XE1PBe.js → prompts-DpUxXr6K.js} +1 -1
  224. package/dist/client/assets/record-editor-CgQYmq0a.js +1 -0
  225. package/dist/client/assets/{redirect-editor-D1A3peeB.js → redirect-editor-cabEvZG6.js} +1 -1
  226. package/dist/client/assets/{reports-BI-WplZi.js → reports-B_iXvMFR.js} +1 -1
  227. package/dist/client/assets/reports-CDdk6ylM.js +1 -0
  228. package/dist/client/assets/{reports-onboarding-Bny-I2Ds.js → reports-onboarding-D2u26MsR.js} +1 -1
  229. package/dist/client/assets/{reports-tab-BJw03qVv.js → reports-tab-BaXzi2FM.js} +2 -2
  230. package/dist/client/assets/repositories-BLczkc5V.js +1 -0
  231. package/dist/client/assets/{repositories-D-ENxt9m.js → repositories-CLCQSYhg.js} +1 -1
  232. package/dist/client/assets/{repository-binding-BHR5kpih.js → repository-binding-CGk3ZX0j.js} +1 -1
  233. package/dist/client/assets/{repository-import-picker-Qyk6d7Zu.js → repository-import-picker-BTeoI4rZ.js} +1 -1
  234. package/dist/client/assets/{repository-picker-Bj1Nc6kr.js → repository-picker-CoWZ9iTd.js} +1 -1
  235. package/dist/client/assets/{require-capability-CAruTncm.js → require-capability-D-ZlkNFz.js} +1 -1
  236. package/dist/client/assets/{required-auth-layout-C77EYaMY.js → required-auth-layout-BtRjrHP0.js} +1 -1
  237. package/dist/client/assets/{reset-password-BkBiknMt.js → reset-password-5BD1CHP9.js} +1 -1
  238. package/dist/client/assets/{resizable-Cdm-hXXC.js → resizable-2vxsnemp.js} +1 -1
  239. package/dist/client/assets/{resolve-tab-icon-CLxwJMYD.js → resolve-tab-icon-BernL4Vf.js} +1 -1
  240. package/dist/client/assets/{review-settings-DJcdSi1O.js → review-settings-QBVdfldx.js} +1 -1
  241. package/dist/client/assets/{roles-Ctu--JGK.js → roles-DOHABx88.js} +1 -1
  242. package/dist/client/assets/route-BJz_Tse0.js +1 -0
  243. package/dist/client/assets/{route-BcljPCXS.js → route-DFi5KwM0.js} +1 -1
  244. package/dist/client/assets/{route-Bv7zngSu.js → route-E8TOccvZ.js} +1 -1
  245. package/dist/client/assets/{sandbox-lifecycle-context-DiQubSE3.js → sandbox-lifecycle-context-D_9evUyh.js} +1 -1
  246. package/dist/client/assets/{schema-BJSITXJ8.js → schema-BEutq4eJ.js} +1 -1
  247. package/dist/client/assets/{schema-C7iS0wFx.js → schema-L6FFXvke.js} +1 -1
  248. package/dist/client/assets/{scroll-area-PyP08N60.js → scroll-area-D7vhzfPi.js} +1 -1
  249. package/dist/client/assets/{search-input-C1UN1o4M.js → search-input-Dujh_El7.js} +1 -1
  250. package/dist/client/assets/{search-toggle-XARujNee.js → search-toggle-DnvRupWM.js} +1 -1
  251. package/dist/client/assets/{secret-ciphertext-C105RZR8.js → secret-ciphertext-CQx2VEMI.js} +1 -1
  252. package/dist/client/assets/{secret-picker--t9IEGre.js → secret-picker-CPXxDZGW.js} +1 -1
  253. package/dist/client/assets/{secrets-a886ZQjo.js → secrets-DGJVx-Hd.js} +1 -1
  254. package/dist/client/assets/{sections--OK8BqVo.js → sections-CJqhzmZf.js} +1 -1
  255. package/dist/client/assets/{sections-editor-ODb5eT5K.js → sections-editor-BtYUAQwb.js} +1 -1
  256. package/dist/client/assets/{select-CbXBky5o.js → select-DZhmnwp_.js} +1 -1
  257. package/dist/client/assets/{select-model-DnqdlTY0.js → select-model-CMMJURkr.js} +1 -1
  258. package/dist/client/assets/{seo-editor-_gXa0jQZ.js → seo-editor-B_llRc49.js} +1 -1
  259. package/dist/client/assets/{separator-BvB_O5R3.js → separator-D1JWkxza.js} +1 -1
  260. package/dist/client/assets/settings-tab-BBqyUPly.js +1 -0
  261. package/dist/client/assets/{sheet-DJ-bT8ZN.js → sheet-EBRPi3dD.js} +1 -1
  262. package/dist/client/assets/{shell-layout-zTHQ8o3e.js → shell-layout-Cng6sPGR.js} +1 -1
  263. package/dist/client/assets/site-editor-BGIwq6Fv.js +1 -0
  264. package/dist/client/assets/{site-editor-toast-VSiTWj1-.js → site-editor-toast-CB9KCYI4.js} +1 -1
  265. package/dist/client/assets/{skills-CY75dh6w.js → skills-t2RbhpKV.js} +1 -1
  266. package/dist/client/assets/{slider-DLQnZK5w.js → slider-B1Au3IHI.js} +1 -1
  267. package/dist/client/assets/{sortable.esm-C1Eh7IYA.js → sortable.esm-BMPY9Sd5.js} +1 -1
  268. package/dist/client/assets/{sso-HvcRYsLs.js → sso-BCCAXBz3.js} +1 -1
  269. package/dist/client/assets/{suggestion-Bd2p1cFs.js → suggestion-BWGM-l4J.js} +1 -1
  270. package/dist/client/assets/{switch-CBoIFiQt.js → switch-zkrdrMZj.js} +1 -1
  271. package/dist/client/assets/{symbol-DWwkR4VS.js → symbol-Dy_rO5Hd.js} +1 -1
  272. package/dist/client/assets/{synced-repos-BHAxDLjN.js → synced-repos-Ci3QmgG7.js} +1 -1
  273. package/dist/client/assets/{tab-icon-glyph-4oa_teIT.js → tab-icon-glyph-RNaGE4GF.js} +1 -1
  274. package/dist/client/assets/{table-DR5sKbqx.js → table-WldSmBJB.js} +1 -1
  275. package/dist/client/assets/{tabs-CNGqHoIP.js → tabs-D6AJgzOF.js} +1 -1
  276. package/dist/client/assets/{task-assignee-avatar-DHQM3xug.js → task-assignee-avatar-DSa4iRni.js} +1 -1
  277. package/dist/client/assets/{task-board-CcHSIY54.js → task-board-Dg8D4L_r.js} +1 -1
  278. package/dist/client/assets/{task-route-SZvHObwH.js → task-route-C97BcCaG.js} +1 -1
  279. package/dist/client/assets/{task-status-DWiZUPkY.js → task-status-BYiz6w3h.js} +1 -1
  280. package/dist/client/assets/taskboard-analytics-DAGovxBg.js +1 -0
  281. package/dist/client/assets/{tasks-DS6EMqnA.js → tasks-BugNujmt.js} +1 -1
  282. package/dist/client/assets/tasks-DAULEt97.js +1 -0
  283. package/dist/client/assets/{textarea-DyZlrsVq.js → textarea-ynJNuYy7.js} +1 -1
  284. package/dist/client/assets/{thread-analytics-DHjhymZ1.js → thread-analytics-CRzIsQDC.js} +1 -1
  285. package/dist/client/assets/{thread-intent-DDbt1zFs.js → thread-intent-DEna0N6y.js} +1 -1
  286. package/dist/client/assets/{thread-route-BfzBR-qP.js → thread-route-Bo3gwmaG.js} +1 -1
  287. package/dist/client/assets/{thread-route-BuNjfRbE.js → thread-route-CKIN4nc-.js} +1 -1
  288. package/dist/client/assets/{thread-sheet-body-DKb5Tkbf.js → thread-sheet-body-By8NyP0y.js} +1 -1
  289. package/dist/client/assets/{time-range-picker-C3KImImw.js → time-range-picker-CtXKDXpg.js} +1 -1
  290. package/dist/client/assets/{toggle-group-NHMm81uy.js → toggle-group-COK-wW8I.js} +1 -1
  291. package/dist/client/assets/{tool-namespace-cOMZbGcB.js → tool-namespace-rRU5qMc_.js} +1 -1
  292. package/dist/client/assets/{toolbar-icon-button-BDnjVLQO.js → toolbar-icon-button-BKHwq05w.js} +1 -1
  293. package/dist/client/assets/{tooltip-CPnhEOeb.js → tooltip-BwU3TfFp.js} +1 -1
  294. package/dist/client/assets/{tooltipContext-CcxsGSie.js → tooltipContext-CAHajv8a.js} +1 -1
  295. package/dist/client/assets/{track-CdsiPzAC.js → track-BPoEwC0E.js} +1 -1
  296. package/dist/client/assets/{types-B1hCJ-PH.js → types-DRalEM3C.js} +1 -1
  297. package/dist/client/assets/{url-slug-BlavxIAd.js → url-slug-COrOe0WW.js} +1 -1
  298. package/dist/client/assets/{usage-stats-evHtcCgH.js → usage-stats-XZL_1T4w.js} +1 -1
  299. package/dist/client/assets/{use-ai-providers-NTub8QOK.js → use-ai-providers-Cp5F1VcY.js} +1 -1
  300. package/dist/client/assets/{use-automations-BwkvJGBq.js → use-automations-eFmS2FKe.js} +1 -1
  301. package/dist/client/assets/{use-autosave-B6_j9303.js → use-autosave-C9nj8WNq.js} +1 -1
  302. package/dist/client/assets/{use-chat-layout-state-Bq1kK1d0.js → use-chat-layout-state-xTXMyKKk.js} +1 -1
  303. package/dist/client/assets/{use-clock-tick-AQvE7bKr.js → use-clock-tick-Ea25VUYb.js} +1 -1
  304. package/dist/client/assets/{use-connect-companion-wPVbpX2v.js → use-connect-companion-POnaAIsR.js} +1 -1
  305. package/dist/client/assets/{use-connection-Brqa7Ss0.js → use-connection-K9rEqDx3.js} +1 -1
  306. package/dist/client/assets/{use-content-sync-CMGC5Qk5.js → use-content-sync-C_a-vn-B.js} +1 -1
  307. package/dist/client/assets/{use-copy-DuLRO-Fh.js → use-copy-B5Nw2ln-.js} +1 -1
  308. package/dist/client/assets/{use-create-virtual-mcp-DtbsfC0A.js → use-create-virtual-mcp-BM5JgPZg.js} +1 -1
  309. package/dist/client/assets/{use-date-fns-locale-BPO9eUd-.js → use-date-fns-locale-CtFSWiK4.js} +1 -1
  310. package/dist/client/assets/{use-debounced-autosave-Bqicbzgb.js → use-debounced-autosave-CpCeYixJ.js} +1 -1
  311. package/dist/client/assets/{use-debounced-value-vhxkuBRI.js → use-debounced-value-BOMWTPY3.js} +1 -1
  312. package/dist/client/assets/{use-deco-credits-DYXvHZvv.js → use-deco-credits-DR8-Tka6.js} +1 -1
  313. package/dist/client/assets/{use-decopilot-events-DuEo5esR.js → use-decopilot-events-Qf3fSwYr.js} +1 -1
  314. package/dist/client/assets/{use-delete-connection-B6sEpykr.js → use-delete-connection-BGCZqvQL.js} +1 -1
  315. package/dist/client/assets/{use-deployment-admin-CXTN6dcC.js → use-deployment-admin-Bar4XffR.js} +1 -1
  316. package/dist/client/assets/{use-ensure-project-folder-BjmSBA08.js → use-ensure-project-folder-SxuhSqkI.js} +1 -1
  317. package/dist/client/assets/{use-fast-preview-draft-url-MiSihGpC.js → use-fast-preview-draft-url-EV84odfX.js} +1 -1
  318. package/dist/client/assets/{use-file-configs-DqTgPICU.js → use-file-configs-DCrTPP04.js} +1 -1
  319. package/dist/client/assets/{use-inbox-feed-CW81Gsok.js → use-inbox-feed-bSceDcjX.js} +1 -1
  320. package/dist/client/assets/{use-infinite-scroll-rQID4ALa.js → use-infinite-scroll-HwZjX02J.js} +1 -1
  321. package/dist/client/assets/{use-join-requests-hKm0f1kJ.js → use-join-requests-C5AvVu_b.js} +1 -1
  322. package/dist/client/assets/{use-main-panel-tabs-AvyS9cfs.js → use-main-panel-tabs-dd8MU14H.js} +1 -1
  323. package/dist/client/assets/{use-main-schema-v8-HicBcdhy.js → use-main-schema-v8-CEMheePi.js} +1 -1
  324. package/dist/client/assets/{use-mcp-auth-status-C9h87_Be.js → use-mcp-auth-status-DijdJpV2.js} +1 -1
  325. package/dist/client/assets/{use-mcp-client-BtBrdGJv.js → use-mcp-client-BqxufeFQ.js} +1 -1
  326. package/dist/client/assets/{use-mcp-prompts-BHoghaTR.js → use-mcp-prompts-x85qdRTs.js} +1 -1
  327. package/dist/client/assets/{use-mcp-tools-C9XRg5hE.js → use-mcp-tools-C7RNSCm2.js} +1 -1
  328. package/dist/client/assets/{use-members-BdFbg_Mm.js → use-members-hZfDNsyQ.js} +1 -1
  329. package/dist/client/assets/{use-mobile-B3guCu1w.js → use-mobile-B-6bodzw.js} +1 -1
  330. package/dist/client/assets/{use-navigate-to-agent-DzJ4GpEZ.js → use-navigate-to-agent-B4nMFFrr.js} +1 -1
  331. package/dist/client/assets/{use-open-billing-url-CdXn5_vW.js → use-open-billing-url-BnVW18Te.js} +1 -1
  332. package/dist/client/assets/{use-org-auth-client-eVmapzts.js → use-org-auth-client-DbZXNKzp.js} +1 -1
  333. package/dist/client/assets/{use-org-fs-CIqZsziN.js → use-org-fs-DvrG4oqK.js} +1 -1
  334. package/dist/client/assets/{use-org-repo-syncs-dS9FSvkG.js → use-org-repo-syncs-BsfQ-AYu.js} +1 -1
  335. package/dist/client/assets/{use-org-sso-DwazSX6k.js → use-org-sso-B5w9Y6-K.js} +1 -1
  336. package/dist/client/assets/{use-organization-roles-BiMGfJ70.js → use-organization-roles-DKryRiui.js} +1 -1
  337. package/dist/client/assets/{use-organization-settings-BcZ9BFJG.js → use-organization-settings-CT_gWjCV.js} +1 -1
  338. package/dist/client/assets/{use-panel-navigate-B-vjXQrO.js → use-panel-navigate-C5hBMKoK.js} +1 -1
  339. package/dist/client/assets/{use-project-native-view-presence-0vSzphBC.js → use-project-native-view-presence-BTvz93hM.js} +1 -1
  340. package/dist/client/assets/{use-project-scope-DEadi158.js → use-project-scope-BOmNgUbL.js} +1 -1
  341. package/dist/client/assets/{use-recent-apps-BbY9Gh07.js → use-recent-apps-DnoPUgq-.js} +1 -1
  342. package/dist/client/assets/{use-releases-CgicO3CW.js → use-releases-xYpnMQ0G.js} +1 -1
  343. package/dist/client/assets/{use-reports-diagnostic-GYWr-M97.js → use-reports-diagnostic-CrPfCARR.js} +1 -1
  344. package/dist/client/assets/{use-secrets-CHPX0iF7.js → use-secrets-BK9OUQjp.js} +1 -1
  345. package/dist/client/assets/{use-section-preview-base-BdGcCaRc.js → use-section-preview-base-D-BAP2Kx.js} +1 -1
  346. package/dist/client/assets/{use-sidebar-collapsed-CFQZVlEf.js → use-sidebar-collapsed-ztBUIrIJ.js} +1 -1
  347. package/dist/client/assets/{use-tags-ZJAZZKBe.js → use-tags-CRZAuKXI.js} +1 -1
  348. package/dist/client/assets/{use-task-board-analytics-u_O6doFC.js → use-task-board-analytics-C3khGqxr.js} +1 -1
  349. package/dist/client/assets/{use-task-board-events-Bc0NLtD6.js → use-task-board-events-CEFK_U8B.js} +1 -1
  350. package/dist/client/assets/{use-task-board-item-prs-Bll-IQgK.js → use-task-board-item-prs-D_DLSRFh.js} +1 -1
  351. package/dist/client/assets/{use-task-metadata-DiCUjyvF.js → use-task-metadata-DQNI_DYQ.js} +1 -1
  352. package/dist/client/assets/{use-thread-analytics-YIvbbfjU.js → use-thread-analytics-CKrVTOjH.js} +1 -1
  353. package/dist/client/assets/{use-thread-outputs-CFKmmshn.js → use-thread-outputs-fctBbSfO.js} +1 -1
  354. package/dist/client/assets/useInfiniteQuery-DYe2VDkL.js +1 -0
  355. package/dist/client/assets/{useQueries--n-b-7z3.js → useQueries-DApBF_hk.js} +1 -1
  356. package/dist/client/assets/useSuspenseInfiniteQuery-DrwXhpXt.js +1 -0
  357. package/dist/client/assets/{users--QRo4rfP.js → users-B0WV36dy.js} +1 -1
  358. package/dist/client/assets/{utils-CmBQ_sIU.js → utils-DqDe2PdG.js} +1 -1
  359. package/dist/client/assets/{variant-calendar-Bh20TlOL.js → variant-calendar-Cw6bsyC8.js} +1 -1
  360. package/dist/client/assets/{variant-draft-pointer-Bs4oKxZX.js → variant-draft-pointer-ybS7yl-Y.js} +1 -1
  361. package/dist/client/assets/{view-mode-toggle-Bg52aP2b.js → view-mode-toggle-B4L0Gqe-.js} +1 -1
  362. package/dist/client/assets/{virtual-mcp-DHr3dTxJ.js → virtual-mcp-m7xS4Fyh.js} +1 -1
  363. package/dist/client/assets/{watch-sse-pool-DLxI6U1q.js → watch-sse-pool-BZYzglPJ.js} +1 -1
  364. package/dist/client/index.html +1 -1
  365. package/dist/server/server.js +1 -1
  366. package/package.json +1 -1
  367. package/dist/client/assets/agent-app-WJHllD8s.js +0 -1
  368. package/dist/client/assets/agent-deck-Dd6sBGr8.js +0 -1
  369. package/dist/client/assets/agent-file-Cv4GNKAu.js +0 -1
  370. package/dist/client/assets/agent-library-DrqQUbdQ.js +0 -1
  371. package/dist/client/assets/agent-library-file-6uox-pXr.js +0 -1
  372. package/dist/client/assets/agent-settings-DFZRcTqc.js +0 -1
  373. package/dist/client/assets/agent-site-editor-code-CHHgreNV.js +0 -2
  374. package/dist/client/assets/agent-site-editor-content-DpXXf6a-.js +0 -1
  375. package/dist/client/assets/agent-site-editor-preview-GazN0kVi.js +0 -1
  376. package/dist/client/assets/agent-view-C8Skk6kr.js +0 -1
  377. package/dist/client/assets/api-keys-D-DVIp0w.js +0 -1
  378. package/dist/client/assets/cms-settings-editor-Bx8oZCiE.js +0 -1
  379. package/dist/client/assets/flat-project-CSSZxBOE.js +0 -1
  380. package/dist/client/assets/input-C6aPvUej.js +0 -17
  381. package/dist/client/assets/library-D0guJwzz.js +0 -1
  382. package/dist/client/assets/monitoring-ByTqoKkm.js +0 -1
  383. package/dist/client/assets/plan-DMGu-u0K.js +0 -1
  384. package/dist/client/assets/project-reports-C__FSGIV.js +0 -1
  385. package/dist/client/assets/project-tasks-Cc3a2zti.js +0 -1
  386. package/dist/client/assets/record-editor-DCZHnUOF.js +0 -1
  387. package/dist/client/assets/reports-BLOeTE2J.js +0 -1
  388. package/dist/client/assets/repositories-DcSyG13S.js +0 -1
  389. package/dist/client/assets/route-C_XW9SML.js +0 -1
  390. package/dist/client/assets/settings-tab-CQaLGUBt.js +0 -1
  391. package/dist/client/assets/site-editor-xZY1UAX7.js +0 -1
  392. package/dist/client/assets/taskboard-analytics-DudxlCXA.js +0 -1
  393. package/dist/client/assets/tasks-DlxMQA6S.js +0 -1
  394. package/dist/client/assets/useInfiniteQuery-CkPcoq7e.js +0 -1
  395. package/dist/client/assets/useSuspenseInfiniteQuery-DWp7pfSN.js +0 -1
@@ -1 +1 @@
1
- import{c as w,au as ee,aw as te,b as J,a2 as ne,aa as se,k as ae,j as s,l as ie,n as Q,r as M,d as oe,aK as V,H as F,P,a_ as le,B as re}from"./index-B2TzlpQ3.js";import{u as ce}from"./use-mobile-B3guCu1w.js";import{h as de,c as ue,u as he,m as me}from"./use-sidebar-collapsed-CFQZVlEf.js";import{a as X,R as fe,b as pe}from"./resizable-Cdm-hXXC.js";import{c as ge,r as xe,m as be}from"./use-chat-layout-state-Bq1kK1d0.js";import{N as je,m as W}from"./agent-icon-DlDNTTdr.js";import{c as q,T as G,a as U}from"./tooltip-CPnhEOeb.js";import{T as D}from"./toolbar-icon-button-BDnjVLQO.js";import{a as ye}from"./use-project-scope-DEadi158.js";import{c as Se}from"./repository-binding-BHR5kpih.js";function Y(l,e){const a=typeof l=="number"?l:Number(l);return!Number.isFinite(a)||a<=0||a>=100?e:a}function ve(l,e){const a=w.c(8);let o;a[0]!==e?(o=c=>Y(c,e),a[0]=e,a[1]=o):o=a[1];const[t,i]=ee(l,o);let n;a[2]!==e||a[3]!==t?(n=Y(t,e),a[2]=e,a[3]=t,a[4]=n):n=a[4];let d;return a[5]!==i||a[6]!==n?(d=[n,i],a[5]=i,a[6]=n,a[7]=d):d=a[7],d}const Ce=33;function Te(){const l=w.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=te.sidePanelWidth(),l[0]=e):e=l[0],ve(e,Ce)}function Ne(l){const e=w.c(55),{actions:a,navigation:o}=l,t=J(),{org:i}=ne(),n=ye(),d=Se(n),c=de(),{toggleSidebar:r}=ue(),h=he(),u=Z(),m=se();let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b={select:Le},e[0]=b):b=e[0];const f=ae(b),j=f?.mainView==="overview";let N;e[1]!==d?.title||e[2]!==t?(N=d?.title??t("common.loading"),e[1]=d?.title,e[2]=t,e[3]=N):N=e[3];const x=N;let v;e[4]!==j||e[5]!==f?.mainView||e[6]!==f?.pageTitle||e[7]!==m||e[8]!==x||e[9]!==n||e[10]!==t?(v=j?n?x:t("sidebar.navDestinations.home"):m&&f?.mainView==="files"?t("sidebar.navDestinations.context"):t(f?.pageTitle??"page.view"),e[4]=j,e[5]=f?.mainView,e[6]=f?.pageTitle,e[7]=m,e[8]=x,e[9]=n,e[10]=t,e[11]=v):v=e[11];const y=v;let L;e[12]!==i.slug||e[13]!==m||e[14]!==n?(L=m?{to:"/$org/projects",params:{org:i.slug},search:{project:n??void 0}}:{to:"/$org/projects/$agentId",params:{org:i.slug,agentId:n??""}},e[12]=i.slug,e[13]=m,e[14]=n,e[15]=L):L=e[15];const p=L;let g;if(e[16]!==c||e[17]!==j||e[18]!==i.slug||e[19]!==p||e[20]!==x||e[21]!==n||e[22]!==t||e[23]!==y){if(g=[],c){let T;e[25]!==t?(T=t("sidebar.navDestinations.settings"),e[25]=t,e[26]=T):T=e[26];let E;e[27]!==i.slug?(E={to:"/$org/settings/general",params:{org:i.slug}},e[27]=i.slug,e[28]=E):E=e[28];let $;e[29]!==T||e[30]!==E?($={key:"settings",label:T,link:E},e[29]=T,e[30]=E,e[31]=$):$=e[31],g.push($)}else if(n&&!j){let T;e[32]!==p||e[33]!==x?(T={key:"project",label:x,link:p},e[32]=p,e[33]=x,e[34]=T):T=e[34],g.push(T)}let R;e[35]!==y?(R={key:"page",label:y},e[35]=y,e[36]=R):R=e[36],g.push(R),e[16]=c,e[17]=j,e[18]=i.slug,e[19]=p,e[20]=x,e[21]=n,e[22]=t,e[23]=y,e[24]=g}else g=e[24];const C=m&&h;let S;e[37]!==u||e[38]!==C||e[39]!==t?(S=C&&u&&!u.threadless&&s.jsxs(q,{children:[s.jsx(G,{asChild:!0,children:s.jsx(D,{"aria-label":t(u.threadOpen?"page.closeThread":"page.openThread"),"aria-pressed":u.threadOpen,active:u.threadOpen,onClick:u.toggleThread,children:s.jsx(je,{size:16})})}),s.jsx(U,{side:"bottom",children:t(u.threadOpen?"page.closeThread":"page.openThread")})]}),e[37]=u,e[38]=C,e[39]=t,e[40]=S):S=e[40];const z=S;let _;e[41]!==m||e[42]!==C||e[43]!==t||e[44]!==r?(_=m?s.jsxs(q,{children:[s.jsx(G,{asChild:!0,children:s.jsx(D,{className:ie(!C&&"md:hidden"),onClick:r,"aria-label":t("page.expandSidebar"),children:s.jsx(W,{size:16})})}),s.jsx(U,{side:"bottom",children:t("page.expandSidebar")})]}):s.jsx(D,{className:"md:hidden",onClick:r,"aria-label":t("layouts.shellControls.toggleSidebar"),children:s.jsx(W,{size:16})}),e[41]=m,e[42]=C,e[43]=t,e[44]=r,e[45]=_):_=e[45];let O;e[46]!==z||e[47]!==_?(O=s.jsxs(s.Fragment,{children:[_,z]}),e[46]=z,e[47]=_,e[48]=O):O=e[48];let I;return e[49]!==a||e[50]!==g||e[51]!==o||e[52]!==i.name||e[53]!==O?(I=s.jsx(Q.Header,{leading:O,breadcrumbs:g,scope:i.name,actions:a,navigation:o}),e[49]=a,e[50]=g,e[51]=o,e[52]=i.name,e[53]=O,e[54]=I):I=e[54],I}function Le(l){return l.matches.findLast(we)?.staticData}function we(l){return l.staticData.pageTitle}const k="chat-layout-thread",B="chat-layout-content",A=M.createContext(null);function Pe(){return H()}function Z(){return M.use(A)}function H(){const l=M.use(A);if(!l)throw new Error("ChatLayout regions require a ChatLayout");return l}function ze(l){const e=w.c(23),{children:a,...o}=l,t=ce(),i=oe(),n=M.useRef(null),[d,c]=Te(),{threadOpen:r,contentOpen:h}=o,u=ge(o),m=r&&h?d:u.side,b=100-m,f=p=>{const g=p.getLayout(),C=g[k],S=g[B];typeof C!="number"||typeof S!="number"||Math.abs(C-m)<.001&&Math.abs(S-b)<.001||p.setLayout({[k]:m,[B]:b})},j=xe({visibility:o,threadVisibilityExplicit:o.threadVisibilityExplicit});let N;e[0]!==t||e[1]!==o||e[2]!==j?(N={...o,isMobile:t,mobileSurface:j},e[0]=t,e[1]=o,e[2]=j,e[3]=N):N=e[3];const x=N;let v;e[4]!==t||e[5]!==o||e[6]!==i||e[7]!==r||e[8]!==x?(v=!o.threadless&&s.jsx(me,{open:t?x.mobileSurface==="chat":r,onToggle:()=>{t?i({to:".",search:p=>({...p,...be(x.mobileSurface==="chat"?"main":"chat")}),replace:!0}):o.toggleThread()}}),e[4]=t,e[5]=o,e[6]=i,e[7]=r,e[8]=x,e[9]=v):v=e[9];let y;e[10]!==a||e[11]!==h||e[12]!==b||e[13]!==t||e[14]!==c||e[15]!==f||e[16]!==r||e[17]!==m?(y=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(fe,{ref:p=>{if(n.current=p,!p)return;let g=!0;return queueMicrotask(()=>{g&&f(p)}),()=>{g=!1,n.current===p&&(n.current=null)}},defaultLayout:{[k]:m,[B]:b},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:C}=g;if(!C){const z=n.current;z&&f(z);return}const S=p[k];r&&h&&typeof S=="number"&&S>0&&S<100&&c(S)},children:a}),e[10]=a,e[11]=h,e[12]=b,e[13]=t,e[14]=c,e[15]=f,e[16]=r,e[17]=m,e[18]=y):y=e[18];let L;return e[19]!==v||e[20]!==y||e[21]!==x?(L=s.jsxs(A,{value:x,children:[v,y]}),e[19]=v,e[20]=y,e[21]=x,e[22]=L):L=e[22],L}function _e(l){const e=w.c(16),{children:a,topbar:o}=l,t=H();if(t.isMobile){let u;return e[0]!==a||e[1]!==t.mobileSurface||e[2]!==o?(u=t.mobileSurface==="chat"?s.jsxs(P,{variant:"plain","data-slot":"chat-layout-thread",children:[o,s.jsx(P.Content,{"data-testid":"chat-panel",children:a})]}):null,e[0]=a,e[1]=t.mobileSurface,e[2]=o,e[3]=u):u=e[3],u}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(P.Content,{"data-testid":"chat-panel",children:a})]}),e[4]=a,e[5]=t.threadOpen,e[6]=o,e[7]=n):n=e[7];let d;e[8]!==n?(d=s.jsx("div",{className:"h-full min-h-0 p-0.5",children:s.jsx(P,{"data-testid":"side-panel",children:n})}),e[8]=n,e[9]=d):d=e[9];let c;e[10]!==i||e[11]!==d?(c=s.jsx(X,{id:k,defaultSize:"33%",minSize:"20%",collapsible:!0,collapsedSize:"0%","data-chat-layout-panel-open":i,className:"min-w-0 overflow-hidden bg-sidebar",children:d}),e[10]=i,e[11]=d,e[12]=c):c=e[12];let r;e[13]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(pe,{className:"bg-sidebar"}),e[13]=r):r=e[13];let h;return e[14]!==c?(h=s.jsxs(s.Fragment,{children:[c,r]}),e[14]=c,e[15]=h):h=e[15],h}function Oe({children:l,routeId:e}){return l}function K(l){const e=w.c(23),{children:a,actions:o,drawer:t,aside:i}=l,n=H();if(n.isMobile&&n.mobileSurface!=="main")return null;const d=n.isMobile?"plain":"card";let c;e[0]!==o||e[1]!==n.contentNavigation?(c=s.jsx(Ne,{navigation:n.contentNavigation,actions:o}),e[0]=o,e[1]=n.contentNavigation,e[2]=c):c=e[2];let r;e[3]!==a||e[4]!==n.contentKey?(r=s.jsx(V,{children:s.jsx(Oe,{routeId:n.contentKey,children:a})}),e[3]=a,e[4]=n.contentKey,e[5]=r):r=e[5];let h;e[6]!==n.contentKey||e[7]!==r?(h=s.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:s.jsx(F,{children:r},n.contentKey)}),e[6]=n.contentKey,e[7]=r,e[8]=h):h=e[8];let u;e[9]!==t||e[10]!==h?(u=s.jsxs(P.Content,{children:[h,t]}),e[9]=t,e[10]=h,e[11]=u):u=e[11];let m;e[12]!==c||e[13]!==u?(m=s.jsxs(Q.Breadcrumbs.Provider,{children:[c,u]}),e[12]=c,e[13]=u,e[14]=m):m=e[14];let b;e[15]!==d||e[16]!==m?(b=s.jsx(P,{"data-testid":"main-panel",variant:d,children:m}),e[15]=d,e[16]=m,e[17]=b):b=e[17];const f=b;let j;return e[18]!==i||e[19]!==n.contentOpen||e[20]!==n.isMobile||e[21]!==f?(j=n.isMobile?f:s.jsx(X,{id:B,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:f}),i&&s.jsx("div",{className:"h-full min-h-0 w-[42%] min-w-80 shrink-0 p-0.5",children:s.jsx(P,{"data-testid":"aside-panel",children:s.jsx(F,{children:s.jsx(V,{children:i})},M.isValidElement(i)?i.key??void 0:void 0)})})]})}),e[18]=i,e[19]=n.contentOpen,e[20]=n.isMobile,e[21]=f,e[22]=j):j=e[22],j}function Ee(){const l=w.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(K,{children:s.jsx(le,{})}),l[0]=e):e=l[0],e}function ke(l){const e=w.c(18),{error:a,reset:o}=l,t=J();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 d;e[4]!==a.message||e[5]!==t?(d=a.message||t("common.errorBoundary.unexpectedError"),e[4]=a.message,e[5]=t,e[6]=d):d=e[6];let c;e[7]!==d?(c=s.jsx("p",{className:"max-w-lg whitespace-pre-wrap text-sm text-muted-foreground",children:d}),e[7]=d,e[8]=c):c=e[8];let r;e[9]!==t?(r=t("common.errorBoundary.tryAgain"),e[9]=t,e[10]=r):r=e[10];let h;e[11]!==o||e[12]!==r?(h=s.jsx(re,{variant:"outline",onClick:o,children:r}),e[11]=o,e[12]=r,e[13]=h):h=e[13];let u;return e[14]!==n||e[15]!==c||e[16]!==h?(u=s.jsx(K,{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]=u):u=e[17],u}const Me=Object.assign(ze,{Thread:_e,Content:K}),We=Object.freeze(Object.defineProperty({__proto__:null,ChatLayout:Me,ChatLayoutError:ke,ChatLayoutPending:Ee,useChatLayout:Pe,useOptionalChatLayout:Z},Symbol.toStringTag,{value:"Module"}));export{Me as C,Ne as R,We as i,Pe as u};
1
+ import{c as w,au as ee,aw as te,b as J,a2 as ne,aa as se,k as ae,j as s,l as ie,n as Q,r as M,d as oe,aK as V,H as F,P,a_ as le,B as re}from"./index-CNWJYHvX.js";import{u as ce}from"./use-mobile-B-6bodzw.js";import{h as de,c as ue,u as he,m as me}from"./use-sidebar-collapsed-ztBUIrIJ.js";import{a as X,R as fe,b as pe}from"./resizable-2vxsnemp.js";import{c as ge,r as xe,m as be}from"./use-chat-layout-state-xTXMyKKk.js";import{N as je,m as W}from"./agent-icon-BAsaPIPW.js";import{c as q,T as G,a as U}from"./tooltip-BwU3TfFp.js";import{T as D}from"./toolbar-icon-button-BKHwq05w.js";import{a as ye}from"./use-project-scope-BOmNgUbL.js";import{c as Se}from"./repository-binding-CGk3ZX0j.js";function Y(l,e){const a=typeof l=="number"?l:Number(l);return!Number.isFinite(a)||a<=0||a>=100?e:a}function ve(l,e){const a=w.c(8);let o;a[0]!==e?(o=c=>Y(c,e),a[0]=e,a[1]=o):o=a[1];const[t,i]=ee(l,o);let n;a[2]!==e||a[3]!==t?(n=Y(t,e),a[2]=e,a[3]=t,a[4]=n):n=a[4];let d;return a[5]!==i||a[6]!==n?(d=[n,i],a[5]=i,a[6]=n,a[7]=d):d=a[7],d}const Ce=33;function Te(){const l=w.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=te.sidePanelWidth(),l[0]=e):e=l[0],ve(e,Ce)}function Ne(l){const e=w.c(55),{actions:a,navigation:o}=l,t=J(),{org:i}=ne(),n=ye(),d=Se(n),c=de(),{toggleSidebar:r}=ue(),h=he(),u=Z(),m=se();let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b={select:Le},e[0]=b):b=e[0];const f=ae(b),j=f?.mainView==="overview";let N;e[1]!==d?.title||e[2]!==t?(N=d?.title??t("common.loading"),e[1]=d?.title,e[2]=t,e[3]=N):N=e[3];const x=N;let v;e[4]!==j||e[5]!==f?.mainView||e[6]!==f?.pageTitle||e[7]!==m||e[8]!==x||e[9]!==n||e[10]!==t?(v=j?n?x:t("sidebar.navDestinations.home"):m&&f?.mainView==="files"?t("sidebar.navDestinations.context"):t(f?.pageTitle??"page.view"),e[4]=j,e[5]=f?.mainView,e[6]=f?.pageTitle,e[7]=m,e[8]=x,e[9]=n,e[10]=t,e[11]=v):v=e[11];const y=v;let L;e[12]!==i.slug||e[13]!==m||e[14]!==n?(L=m?{to:"/$org/projects",params:{org:i.slug},search:{project:n??void 0}}:{to:"/$org/projects/$agentId",params:{org:i.slug,agentId:n??""}},e[12]=i.slug,e[13]=m,e[14]=n,e[15]=L):L=e[15];const p=L;let g;if(e[16]!==c||e[17]!==j||e[18]!==i.slug||e[19]!==p||e[20]!==x||e[21]!==n||e[22]!==t||e[23]!==y){if(g=[],c){let T;e[25]!==t?(T=t("sidebar.navDestinations.settings"),e[25]=t,e[26]=T):T=e[26];let E;e[27]!==i.slug?(E={to:"/$org/settings/general",params:{org:i.slug}},e[27]=i.slug,e[28]=E):E=e[28];let $;e[29]!==T||e[30]!==E?($={key:"settings",label:T,link:E},e[29]=T,e[30]=E,e[31]=$):$=e[31],g.push($)}else if(n&&!j){let T;e[32]!==p||e[33]!==x?(T={key:"project",label:x,link:p},e[32]=p,e[33]=x,e[34]=T):T=e[34],g.push(T)}let R;e[35]!==y?(R={key:"page",label:y},e[35]=y,e[36]=R):R=e[36],g.push(R),e[16]=c,e[17]=j,e[18]=i.slug,e[19]=p,e[20]=x,e[21]=n,e[22]=t,e[23]=y,e[24]=g}else g=e[24];const C=m&&h;let S;e[37]!==u||e[38]!==C||e[39]!==t?(S=C&&u&&!u.threadless&&s.jsxs(q,{children:[s.jsx(G,{asChild:!0,children:s.jsx(D,{"aria-label":t(u.threadOpen?"page.closeThread":"page.openThread"),"aria-pressed":u.threadOpen,active:u.threadOpen,onClick:u.toggleThread,children:s.jsx(je,{size:16})})}),s.jsx(U,{side:"bottom",children:t(u.threadOpen?"page.closeThread":"page.openThread")})]}),e[37]=u,e[38]=C,e[39]=t,e[40]=S):S=e[40];const z=S;let _;e[41]!==m||e[42]!==C||e[43]!==t||e[44]!==r?(_=m?s.jsxs(q,{children:[s.jsx(G,{asChild:!0,children:s.jsx(D,{className:ie(!C&&"md:hidden"),onClick:r,"aria-label":t("page.expandSidebar"),children:s.jsx(W,{size:16})})}),s.jsx(U,{side:"bottom",children:t("page.expandSidebar")})]}):s.jsx(D,{className:"md:hidden",onClick:r,"aria-label":t("layouts.shellControls.toggleSidebar"),children:s.jsx(W,{size:16})}),e[41]=m,e[42]=C,e[43]=t,e[44]=r,e[45]=_):_=e[45];let O;e[46]!==z||e[47]!==_?(O=s.jsxs(s.Fragment,{children:[_,z]}),e[46]=z,e[47]=_,e[48]=O):O=e[48];let I;return e[49]!==a||e[50]!==g||e[51]!==o||e[52]!==i.name||e[53]!==O?(I=s.jsx(Q.Header,{leading:O,breadcrumbs:g,scope:i.name,actions:a,navigation:o}),e[49]=a,e[50]=g,e[51]=o,e[52]=i.name,e[53]=O,e[54]=I):I=e[54],I}function Le(l){return l.matches.findLast(we)?.staticData}function we(l){return l.staticData.pageTitle}const k="chat-layout-thread",B="chat-layout-content",A=M.createContext(null);function Pe(){return H()}function Z(){return M.use(A)}function H(){const l=M.use(A);if(!l)throw new Error("ChatLayout regions require a ChatLayout");return l}function ze(l){const e=w.c(23),{children:a,...o}=l,t=ce(),i=oe(),n=M.useRef(null),[d,c]=Te(),{threadOpen:r,contentOpen:h}=o,u=ge(o),m=r&&h?d:u.side,b=100-m,f=p=>{const g=p.getLayout(),C=g[k],S=g[B];typeof C!="number"||typeof S!="number"||Math.abs(C-m)<.001&&Math.abs(S-b)<.001||p.setLayout({[k]:m,[B]:b})},j=xe({visibility:o,threadVisibilityExplicit:o.threadVisibilityExplicit});let N;e[0]!==t||e[1]!==o||e[2]!==j?(N={...o,isMobile:t,mobileSurface:j},e[0]=t,e[1]=o,e[2]=j,e[3]=N):N=e[3];const x=N;let v;e[4]!==t||e[5]!==o||e[6]!==i||e[7]!==r||e[8]!==x?(v=!o.threadless&&s.jsx(me,{open:t?x.mobileSurface==="chat":r,onToggle:()=>{t?i({to:".",search:p=>({...p,...be(x.mobileSurface==="chat"?"main":"chat")}),replace:!0}):o.toggleThread()}}),e[4]=t,e[5]=o,e[6]=i,e[7]=r,e[8]=x,e[9]=v):v=e[9];let y;e[10]!==a||e[11]!==h||e[12]!==b||e[13]!==t||e[14]!==c||e[15]!==f||e[16]!==r||e[17]!==m?(y=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(fe,{ref:p=>{if(n.current=p,!p)return;let g=!0;return queueMicrotask(()=>{g&&f(p)}),()=>{g=!1,n.current===p&&(n.current=null)}},defaultLayout:{[k]:m,[B]:b},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:C}=g;if(!C){const z=n.current;z&&f(z);return}const S=p[k];r&&h&&typeof S=="number"&&S>0&&S<100&&c(S)},children:a}),e[10]=a,e[11]=h,e[12]=b,e[13]=t,e[14]=c,e[15]=f,e[16]=r,e[17]=m,e[18]=y):y=e[18];let L;return e[19]!==v||e[20]!==y||e[21]!==x?(L=s.jsxs(A,{value:x,children:[v,y]}),e[19]=v,e[20]=y,e[21]=x,e[22]=L):L=e[22],L}function _e(l){const e=w.c(16),{children:a,topbar:o}=l,t=H();if(t.isMobile){let u;return e[0]!==a||e[1]!==t.mobileSurface||e[2]!==o?(u=t.mobileSurface==="chat"?s.jsxs(P,{variant:"plain","data-slot":"chat-layout-thread",children:[o,s.jsx(P.Content,{"data-testid":"chat-panel",children:a})]}):null,e[0]=a,e[1]=t.mobileSurface,e[2]=o,e[3]=u):u=e[3],u}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(P.Content,{"data-testid":"chat-panel",children:a})]}),e[4]=a,e[5]=t.threadOpen,e[6]=o,e[7]=n):n=e[7];let d;e[8]!==n?(d=s.jsx("div",{className:"h-full min-h-0 p-0.5",children:s.jsx(P,{"data-testid":"side-panel",children:n})}),e[8]=n,e[9]=d):d=e[9];let c;e[10]!==i||e[11]!==d?(c=s.jsx(X,{id:k,defaultSize:"33%",minSize:"20%",collapsible:!0,collapsedSize:"0%","data-chat-layout-panel-open":i,className:"min-w-0 overflow-hidden bg-sidebar",children:d}),e[10]=i,e[11]=d,e[12]=c):c=e[12];let r;e[13]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(pe,{className:"bg-sidebar"}),e[13]=r):r=e[13];let h;return e[14]!==c?(h=s.jsxs(s.Fragment,{children:[c,r]}),e[14]=c,e[15]=h):h=e[15],h}function Oe({children:l,routeId:e}){return l}function K(l){const e=w.c(23),{children:a,actions:o,drawer:t,aside:i}=l,n=H();if(n.isMobile&&n.mobileSurface!=="main")return null;const d=n.isMobile?"plain":"card";let c;e[0]!==o||e[1]!==n.contentNavigation?(c=s.jsx(Ne,{navigation:n.contentNavigation,actions:o}),e[0]=o,e[1]=n.contentNavigation,e[2]=c):c=e[2];let r;e[3]!==a||e[4]!==n.contentKey?(r=s.jsx(V,{children:s.jsx(Oe,{routeId:n.contentKey,children:a})}),e[3]=a,e[4]=n.contentKey,e[5]=r):r=e[5];let h;e[6]!==n.contentKey||e[7]!==r?(h=s.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:s.jsx(F,{children:r},n.contentKey)}),e[6]=n.contentKey,e[7]=r,e[8]=h):h=e[8];let u;e[9]!==t||e[10]!==h?(u=s.jsxs(P.Content,{children:[h,t]}),e[9]=t,e[10]=h,e[11]=u):u=e[11];let m;e[12]!==c||e[13]!==u?(m=s.jsxs(Q.Breadcrumbs.Provider,{children:[c,u]}),e[12]=c,e[13]=u,e[14]=m):m=e[14];let b;e[15]!==d||e[16]!==m?(b=s.jsx(P,{"data-testid":"main-panel",variant:d,children:m}),e[15]=d,e[16]=m,e[17]=b):b=e[17];const f=b;let j;return e[18]!==i||e[19]!==n.contentOpen||e[20]!==n.isMobile||e[21]!==f?(j=n.isMobile?f:s.jsx(X,{id:B,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:f}),i&&s.jsx("div",{className:"h-full min-h-0 w-[42%] min-w-80 shrink-0 p-0.5",children:s.jsx(P,{"data-testid":"aside-panel",children:s.jsx(F,{children:s.jsx(V,{children:i})},M.isValidElement(i)?i.key??void 0:void 0)})})]})}),e[18]=i,e[19]=n.contentOpen,e[20]=n.isMobile,e[21]=f,e[22]=j):j=e[22],j}function Ee(){const l=w.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(K,{children:s.jsx(le,{})}),l[0]=e):e=l[0],e}function ke(l){const e=w.c(18),{error:a,reset:o}=l,t=J();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 d;e[4]!==a.message||e[5]!==t?(d=a.message||t("common.errorBoundary.unexpectedError"),e[4]=a.message,e[5]=t,e[6]=d):d=e[6];let c;e[7]!==d?(c=s.jsx("p",{className:"max-w-lg whitespace-pre-wrap text-sm text-muted-foreground",children:d}),e[7]=d,e[8]=c):c=e[8];let r;e[9]!==t?(r=t("common.errorBoundary.tryAgain"),e[9]=t,e[10]=r):r=e[10];let h;e[11]!==o||e[12]!==r?(h=s.jsx(re,{variant:"outline",onClick:o,children:r}),e[11]=o,e[12]=r,e[13]=h):h=e[13];let u;return e[14]!==n||e[15]!==c||e[16]!==h?(u=s.jsx(K,{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]=u):u=e[17],u}const Me=Object.assign(ze,{Thread:_e,Content:K}),We=Object.freeze(Object.defineProperty({__proto__:null,ChatLayout:Me,ChatLayoutError:ke,ChatLayoutPending:Ee,useChatLayout:Pe,useOptionalChatLayout:Z},Symbol.toStringTag,{value:"Module"}));export{Me as C,Ne as R,We as i,Pe as u};
@@ -1 +1 @@
1
- import{r as l,bx as ce,j as p,bD as _,bC as T,bA as C,bH as le,bw as de,bT as ue,bP as fe,bI as me}from"./index-B2TzlpQ3.js";import{c as Y}from"./index-BdQq_4o_.js";var $=["PageUp","PageDown"],X=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],G={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},M="Slider",[z,Se,pe]=le(M),[W]=fe(M,[pe]),[he,V]=W(M),q=l.forwardRef((e,t)=>{const{name:o,min:n=0,max:s=100,step:c=1,orientation:r="horizontal",disabled:a=!1,minStepsBetweenThumbs:u=0,defaultValue:b=[n],value:h,onValueChange:i=()=>{},onValueCommit:d=()=>{},inverted:v=!1,form:R,...g}=e,m=l.useRef(new Set),f=l.useRef(0),w=r==="horizontal"?ge:ve,[S=[],I]=ce({prop:h,defaultProp:b,onChange:x=>{[...m.current][f.current]?.focus(),i(x)}}),j=l.useRef(S);function B(x){const y=ye(S,x);K(x,y)}function se(x){K(x,f.current)}function ae(){const x=j.current[f.current];S[f.current]!==x&&d(S)}function K(x,y,{commit:k}={commit:!1}){const U=_e(c),H=Ce(Math.round((x-n)/c)*c+n,U),A=Y(H,[n,s]);I((E=[])=>{const P=xe(E,A,y);if(Ee(P,u*c)){f.current=P.indexOf(A);const F=String(P)!==String(E);return F&&k&&d(P),F?P:E}else return E})}return p.jsx(he,{scope:e.__scopeSlider,name:o,disabled:a,min:n,max:s,valueIndexToChangeRef:f,thumbs:m.current,values:S,orientation:r,form:R,children:p.jsx(z.Provider,{scope:e.__scopeSlider,children:p.jsx(z.Slot,{scope:e.__scopeSlider,children:p.jsx(w,{"aria-disabled":a,"data-disabled":a?"":void 0,...g,ref:t,onPointerDown:_(g.onPointerDown,()=>{a||(j.current=S)}),min:n,max:s,inverted:v,onSlideStart:a?void 0:B,onSlideMove:a?void 0:se,onSlideEnd:a?void 0:ae,onHomeKeyDown:()=>!a&&K(n,0,{commit:!0}),onEndKeyDown:()=>!a&&K(s,S.length-1,{commit:!0}),onStepKeyDown:({event:x,direction:y})=>{if(!a){const H=$.includes(x.key)||x.shiftKey&&X.includes(x.key)?10:1,A=f.current,E=S[A],P=c*H*y;K(E+P,A,{commit:!0})}}})})})})});q.displayName=M;var[J,Q]=W(M,{startEdge:"left",endEdge:"right",size:"width",direction:1}),ge=l.forwardRef((e,t)=>{const{min:o,max:n,dir:s,inverted:c,onSlideStart:r,onSlideMove:a,onSlideEnd:u,onStepKeyDown:b,...h}=e,[i,d]=l.useState(null),v=C(t,w=>d(w)),R=l.useRef(void 0),g=de(s),m=g==="ltr",f=m&&!c||!m&&c;function D(w){const S=R.current||i.getBoundingClientRect(),I=[0,S.width],B=O(I,f?[o,n]:[n,o]);return R.current=S,B(w-S.left)}return p.jsx(J,{scope:e.__scopeSlider,startEdge:f?"left":"right",endEdge:f?"right":"left",direction:f?1:-1,size:"width",children:p.jsx(Z,{dir:g,"data-orientation":"horizontal",...h,ref:v,style:{...h.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:w=>{const S=D(w.clientX);r?.(S)},onSlideMove:w=>{const S=D(w.clientX);a?.(S)},onSlideEnd:()=>{R.current=void 0,u?.()},onStepKeyDown:w=>{const I=G[f?"from-left":"from-right"].includes(w.key);b?.({event:w,direction:I?-1:1})}})})}),ve=l.forwardRef((e,t)=>{const{min:o,max:n,inverted:s,onSlideStart:c,onSlideMove:r,onSlideEnd:a,onStepKeyDown:u,...b}=e,h=l.useRef(null),i=C(t,h),d=l.useRef(void 0),v=!s;function R(g){const m=d.current||h.current.getBoundingClientRect(),f=[0,m.height],w=O(f,v?[n,o]:[o,n]);return d.current=m,w(g-m.top)}return p.jsx(J,{scope:e.__scopeSlider,startEdge:v?"bottom":"top",endEdge:v?"top":"bottom",size:"height",direction:v?1:-1,children:p.jsx(Z,{"data-orientation":"vertical",...b,ref:i,style:{...b.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:g=>{const m=R(g.clientY);c?.(m)},onSlideMove:g=>{const m=R(g.clientY);r?.(m)},onSlideEnd:()=>{d.current=void 0,a?.()},onStepKeyDown:g=>{const f=G[v?"from-bottom":"from-top"].includes(g.key);u?.({event:g,direction:f?-1:1})}})})}),Z=l.forwardRef((e,t)=>{const{__scopeSlider:o,onSlideStart:n,onSlideMove:s,onSlideEnd:c,onHomeKeyDown:r,onEndKeyDown:a,onStepKeyDown:u,...b}=e,h=V(M,o);return p.jsx(T.span,{...b,ref:t,onKeyDown:_(e.onKeyDown,i=>{i.key==="Home"?(r(i),i.preventDefault()):i.key==="End"?(a(i),i.preventDefault()):$.concat(X).includes(i.key)&&(u(i),i.preventDefault())}),onPointerDown:_(e.onPointerDown,i=>{const d=i.target;d.setPointerCapture(i.pointerId),i.preventDefault(),h.thumbs.has(d)?d.focus():n(i)}),onPointerMove:_(e.onPointerMove,i=>{i.target.hasPointerCapture(i.pointerId)&&s(i)}),onPointerUp:_(e.onPointerUp,i=>{const d=i.target;d.hasPointerCapture(i.pointerId)&&(d.releasePointerCapture(i.pointerId),c(i))})})}),ee="SliderTrack",te=l.forwardRef((e,t)=>{const{__scopeSlider:o,...n}=e,s=V(ee,o);return p.jsx(T.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...n,ref:t})});te.displayName=ee;var N="SliderRange",ne=l.forwardRef((e,t)=>{const{__scopeSlider:o,...n}=e,s=V(N,o),c=Q(N,o),r=l.useRef(null),a=C(t,r),u=s.values.length,b=s.values.map(d=>ie(d,s.min,s.max)),h=u>1?Math.min(...b):0,i=100-Math.max(...b);return p.jsx(T.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...n,ref:a,style:{...e.style,[c.startEdge]:h+"%",[c.endEdge]:i+"%"}})});ne.displayName=N;var L="SliderThumb",oe=l.forwardRef((e,t)=>{const o=Se(e.__scopeSlider),[n,s]=l.useState(null),c=C(t,a=>s(a)),r=l.useMemo(()=>n?o().findIndex(a=>a.ref.current===n):-1,[o,n]);return p.jsx(be,{...e,ref:c,index:r})}),be=l.forwardRef((e,t)=>{const{__scopeSlider:o,index:n,name:s,...c}=e,r=V(L,o),a=Q(L,o),[u,b]=l.useState(null),h=C(t,D=>b(D)),i=u?r.form||!!u.closest("form"):!0,d=ue(u),v=r.values[n],R=v===void 0?0:ie(v,r.min,r.max),g=Re(n,r.values.length),m=d?.[a.size],f=m?Pe(m,R,a.direction):0;return l.useEffect(()=>{if(u)return r.thumbs.add(u),()=>{r.thumbs.delete(u)}},[u,r.thumbs]),p.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[a.startEdge]:`calc(${R}% + ${f}px)`},children:[p.jsx(z.ItemSlot,{scope:e.__scopeSlider,children:p.jsx(T.span,{role:"slider","aria-label":e["aria-label"]||g,"aria-valuemin":r.min,"aria-valuenow":v,"aria-valuemax":r.max,"aria-orientation":r.orientation,"data-orientation":r.orientation,"data-disabled":r.disabled?"":void 0,tabIndex:r.disabled?void 0:0,...c,ref:h,style:v===void 0?{display:"none"}:e.style,onFocus:_(e.onFocus,()=>{r.valueIndexToChangeRef.current=n})})}),i&&p.jsx(re,{name:s??(r.name?r.name+(r.values.length>1?"[]":""):void 0),form:r.form,value:v},n)]})});oe.displayName=L;var we="RadioBubbleInput",re=l.forwardRef(({__scopeSlider:e,value:t,...o},n)=>{const s=l.useRef(null),c=C(s,n),r=me(t);return l.useEffect(()=>{const a=s.current;if(!a)return;const u=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(u,"value").set;if(r!==t&&h){const i=new Event("input",{bubbles:!0});h.call(a,t),a.dispatchEvent(i)}},[r,t]),p.jsx(T.input,{style:{display:"none"},...o,ref:c,defaultValue:t})});re.displayName=we;function xe(e=[],t,o){const n=[...e];return n[o]=t,n.sort((s,c)=>s-c)}function ie(e,t,o){const c=100/(o-t)*(e-t);return Y(c,[0,100])}function Re(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function ye(e,t){if(e.length===1)return 0;const o=e.map(s=>Math.abs(s-t)),n=Math.min(...o);return o.indexOf(n)}function Pe(e,t,o){const n=e/2,c=O([0,50],[0,n]);return(n-c(t)*o)*o}function De(e){return e.slice(0,-1).map((t,o)=>e[o+1]-t)}function Ee(e,t){if(t>0){const o=De(e);return Math.min(...o)>=t}return!0}function O(e,t){return o=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(o-e[0])}}function _e(e){return(String(e).split(".")[1]||"").length}function Ce(e,t){const o=Math.pow(10,t);return Math.round(e*o)/o}var Ke=q,Ae=te,Te=ne,Ve=oe;export{Te as R,Ae as T,Ke as a,Ve as b};
1
+ import{r as l,bx as ce,j as p,bD as _,bC as T,bA as C,bH as le,bw as de,bT as ue,bP as fe,bI as me}from"./index-CNWJYHvX.js";import{c as Y}from"./index-BdQq_4o_.js";var $=["PageUp","PageDown"],X=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],G={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},M="Slider",[z,Se,pe]=le(M),[W]=fe(M,[pe]),[he,V]=W(M),q=l.forwardRef((e,t)=>{const{name:o,min:n=0,max:s=100,step:c=1,orientation:r="horizontal",disabled:a=!1,minStepsBetweenThumbs:u=0,defaultValue:b=[n],value:h,onValueChange:i=()=>{},onValueCommit:d=()=>{},inverted:v=!1,form:R,...g}=e,m=l.useRef(new Set),f=l.useRef(0),w=r==="horizontal"?ge:ve,[S=[],I]=ce({prop:h,defaultProp:b,onChange:x=>{[...m.current][f.current]?.focus(),i(x)}}),j=l.useRef(S);function B(x){const y=ye(S,x);K(x,y)}function se(x){K(x,f.current)}function ae(){const x=j.current[f.current];S[f.current]!==x&&d(S)}function K(x,y,{commit:k}={commit:!1}){const U=_e(c),H=Ce(Math.round((x-n)/c)*c+n,U),A=Y(H,[n,s]);I((E=[])=>{const P=xe(E,A,y);if(Ee(P,u*c)){f.current=P.indexOf(A);const F=String(P)!==String(E);return F&&k&&d(P),F?P:E}else return E})}return p.jsx(he,{scope:e.__scopeSlider,name:o,disabled:a,min:n,max:s,valueIndexToChangeRef:f,thumbs:m.current,values:S,orientation:r,form:R,children:p.jsx(z.Provider,{scope:e.__scopeSlider,children:p.jsx(z.Slot,{scope:e.__scopeSlider,children:p.jsx(w,{"aria-disabled":a,"data-disabled":a?"":void 0,...g,ref:t,onPointerDown:_(g.onPointerDown,()=>{a||(j.current=S)}),min:n,max:s,inverted:v,onSlideStart:a?void 0:B,onSlideMove:a?void 0:se,onSlideEnd:a?void 0:ae,onHomeKeyDown:()=>!a&&K(n,0,{commit:!0}),onEndKeyDown:()=>!a&&K(s,S.length-1,{commit:!0}),onStepKeyDown:({event:x,direction:y})=>{if(!a){const H=$.includes(x.key)||x.shiftKey&&X.includes(x.key)?10:1,A=f.current,E=S[A],P=c*H*y;K(E+P,A,{commit:!0})}}})})})})});q.displayName=M;var[J,Q]=W(M,{startEdge:"left",endEdge:"right",size:"width",direction:1}),ge=l.forwardRef((e,t)=>{const{min:o,max:n,dir:s,inverted:c,onSlideStart:r,onSlideMove:a,onSlideEnd:u,onStepKeyDown:b,...h}=e,[i,d]=l.useState(null),v=C(t,w=>d(w)),R=l.useRef(void 0),g=de(s),m=g==="ltr",f=m&&!c||!m&&c;function D(w){const S=R.current||i.getBoundingClientRect(),I=[0,S.width],B=O(I,f?[o,n]:[n,o]);return R.current=S,B(w-S.left)}return p.jsx(J,{scope:e.__scopeSlider,startEdge:f?"left":"right",endEdge:f?"right":"left",direction:f?1:-1,size:"width",children:p.jsx(Z,{dir:g,"data-orientation":"horizontal",...h,ref:v,style:{...h.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:w=>{const S=D(w.clientX);r?.(S)},onSlideMove:w=>{const S=D(w.clientX);a?.(S)},onSlideEnd:()=>{R.current=void 0,u?.()},onStepKeyDown:w=>{const I=G[f?"from-left":"from-right"].includes(w.key);b?.({event:w,direction:I?-1:1})}})})}),ve=l.forwardRef((e,t)=>{const{min:o,max:n,inverted:s,onSlideStart:c,onSlideMove:r,onSlideEnd:a,onStepKeyDown:u,...b}=e,h=l.useRef(null),i=C(t,h),d=l.useRef(void 0),v=!s;function R(g){const m=d.current||h.current.getBoundingClientRect(),f=[0,m.height],w=O(f,v?[n,o]:[o,n]);return d.current=m,w(g-m.top)}return p.jsx(J,{scope:e.__scopeSlider,startEdge:v?"bottom":"top",endEdge:v?"top":"bottom",size:"height",direction:v?1:-1,children:p.jsx(Z,{"data-orientation":"vertical",...b,ref:i,style:{...b.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:g=>{const m=R(g.clientY);c?.(m)},onSlideMove:g=>{const m=R(g.clientY);r?.(m)},onSlideEnd:()=>{d.current=void 0,a?.()},onStepKeyDown:g=>{const f=G[v?"from-bottom":"from-top"].includes(g.key);u?.({event:g,direction:f?-1:1})}})})}),Z=l.forwardRef((e,t)=>{const{__scopeSlider:o,onSlideStart:n,onSlideMove:s,onSlideEnd:c,onHomeKeyDown:r,onEndKeyDown:a,onStepKeyDown:u,...b}=e,h=V(M,o);return p.jsx(T.span,{...b,ref:t,onKeyDown:_(e.onKeyDown,i=>{i.key==="Home"?(r(i),i.preventDefault()):i.key==="End"?(a(i),i.preventDefault()):$.concat(X).includes(i.key)&&(u(i),i.preventDefault())}),onPointerDown:_(e.onPointerDown,i=>{const d=i.target;d.setPointerCapture(i.pointerId),i.preventDefault(),h.thumbs.has(d)?d.focus():n(i)}),onPointerMove:_(e.onPointerMove,i=>{i.target.hasPointerCapture(i.pointerId)&&s(i)}),onPointerUp:_(e.onPointerUp,i=>{const d=i.target;d.hasPointerCapture(i.pointerId)&&(d.releasePointerCapture(i.pointerId),c(i))})})}),ee="SliderTrack",te=l.forwardRef((e,t)=>{const{__scopeSlider:o,...n}=e,s=V(ee,o);return p.jsx(T.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...n,ref:t})});te.displayName=ee;var N="SliderRange",ne=l.forwardRef((e,t)=>{const{__scopeSlider:o,...n}=e,s=V(N,o),c=Q(N,o),r=l.useRef(null),a=C(t,r),u=s.values.length,b=s.values.map(d=>ie(d,s.min,s.max)),h=u>1?Math.min(...b):0,i=100-Math.max(...b);return p.jsx(T.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...n,ref:a,style:{...e.style,[c.startEdge]:h+"%",[c.endEdge]:i+"%"}})});ne.displayName=N;var L="SliderThumb",oe=l.forwardRef((e,t)=>{const o=Se(e.__scopeSlider),[n,s]=l.useState(null),c=C(t,a=>s(a)),r=l.useMemo(()=>n?o().findIndex(a=>a.ref.current===n):-1,[o,n]);return p.jsx(be,{...e,ref:c,index:r})}),be=l.forwardRef((e,t)=>{const{__scopeSlider:o,index:n,name:s,...c}=e,r=V(L,o),a=Q(L,o),[u,b]=l.useState(null),h=C(t,D=>b(D)),i=u?r.form||!!u.closest("form"):!0,d=ue(u),v=r.values[n],R=v===void 0?0:ie(v,r.min,r.max),g=Re(n,r.values.length),m=d?.[a.size],f=m?Pe(m,R,a.direction):0;return l.useEffect(()=>{if(u)return r.thumbs.add(u),()=>{r.thumbs.delete(u)}},[u,r.thumbs]),p.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[a.startEdge]:`calc(${R}% + ${f}px)`},children:[p.jsx(z.ItemSlot,{scope:e.__scopeSlider,children:p.jsx(T.span,{role:"slider","aria-label":e["aria-label"]||g,"aria-valuemin":r.min,"aria-valuenow":v,"aria-valuemax":r.max,"aria-orientation":r.orientation,"data-orientation":r.orientation,"data-disabled":r.disabled?"":void 0,tabIndex:r.disabled?void 0:0,...c,ref:h,style:v===void 0?{display:"none"}:e.style,onFocus:_(e.onFocus,()=>{r.valueIndexToChangeRef.current=n})})}),i&&p.jsx(re,{name:s??(r.name?r.name+(r.values.length>1?"[]":""):void 0),form:r.form,value:v},n)]})});oe.displayName=L;var we="RadioBubbleInput",re=l.forwardRef(({__scopeSlider:e,value:t,...o},n)=>{const s=l.useRef(null),c=C(s,n),r=me(t);return l.useEffect(()=>{const a=s.current;if(!a)return;const u=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(u,"value").set;if(r!==t&&h){const i=new Event("input",{bubbles:!0});h.call(a,t),a.dispatchEvent(i)}},[r,t]),p.jsx(T.input,{style:{display:"none"},...o,ref:c,defaultValue:t})});re.displayName=we;function xe(e=[],t,o){const n=[...e];return n[o]=t,n.sort((s,c)=>s-c)}function ie(e,t,o){const c=100/(o-t)*(e-t);return Y(c,[0,100])}function Re(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function ye(e,t){if(e.length===1)return 0;const o=e.map(s=>Math.abs(s-t)),n=Math.min(...o);return o.indexOf(n)}function Pe(e,t,o){const n=e/2,c=O([0,50],[0,n]);return(n-c(t)*o)*o}function De(e){return e.slice(0,-1).map((t,o)=>e[o+1]-t)}function Ee(e,t){if(t>0){const o=De(e);return Math.min(...o)>=t}return!0}function O(e,t){return o=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(o-e[0])}}function _e(e){return(String(e).split(".")[1]||"").length}function Ce(e,t){const o=Math.pow(10,t);return Math.round(e*o)/o}var Ke=q,Ae=te,Te=ne,Ve=oe;export{Te as R,Ae as T,Ke as a,Ve as b};
@@ -1 +1 @@
1
- import{cv as _}from"./index-B2TzlpQ3.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{cv as _}from"./index-CNWJYHvX.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{n as $,x as D,_ as We,T as H,$ as je,a0 as I,a1 as U,o as W,a2 as G,a3 as J,a4 as me,a5 as qe,a6 as we,a7 as Xe,E as be,a8 as Ye,a9 as Ge,e as ve}from"./usage-stats-evHtcCgH.js";import{eQ as ye,fv as Ce,eP as Se,fw as Re,fx as Ee,fy as Te,fz as Oe,fA as Ae,eS as Ie,d$ as Me,r as C,b4 as ze}from"./index-B2TzlpQ3.js";let Z,Q;if(typeof WeakMap<"u"){let e=new WeakMap;Z=t=>e.get(t),Q=(t,n)=>(e.set(t,n),n)}else{const e=[];let n=0;Z=o=>{for(let i=0;i<e.length;i+=2)if(e[i]==o)return e[i+1]},Q=(o,i)=>(n==10&&(n=0),e[n++]=o,e[n++]=i)}var v=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,i=t/this.width|0;let s=o+1,l=i+1;for(let r=1;s<this.width&&this.map[t+r]==n;r++)s++;for(let r=1;l<this.height&&this.map[t+this.width*r]==n;r++)l++;return{left:o,top:i,right:s,bottom:l}}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:i,top:s,bottom:l}=this.findCell(e);return t=="horiz"?(n<0?o==0:i==this.width)?null:this.map[s*this.width+(n<0?o-1:i)]:(n<0?s==0:l==this.height)?null:this.map[o+this.width*(n<0?s-1:l)]}rectBetween(e,t){const{left:n,right:o,top:i,bottom:s}=this.findCell(e),{left:l,right:r,top:a,bottom:c}=this.findCell(t);return{left:Math.min(n,l),top:Math.min(i,a),right:Math.max(o,r),bottom:Math.max(s,c)}}cellsInRect(e){const t=[],n={};for(let o=e.top;o<e.bottom;o++)for(let i=e.left;i<e.right;i++){const s=o*this.width+i,l=this.map[s];n[l]||(n[l]=!0,!(i==e.left&&i&&this.map[s-1]==l||o==e.top&&o&&this.map[s-this.width]==l)&&t.push(l))}return t}positionAt(e,t,n){for(let o=0,i=0;;o++){const s=i+n.child(o).nodeSize;if(o==e){let l=t+e*this.width;const r=(e+1)*this.width;for(;l<r&&this.map[l]<i;)l++;return l==r?s-1:this.map[l]}i=s}}static get(e){return Z(e)||Q(e,Je(e))}};function Je(e){if(e.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+e.type.name);const t=Ze(e),n=e.childCount,o=[];let i=0,s=null;const l=[];for(let c=0,u=t*n;c<u;c++)o[c]=0;for(let c=0,u=0;c<n;c++){const d=e.child(c);u++;for(let p=0;;p++){for(;i<o.length&&o[i]!=0;)i++;if(p==d.childCount)break;const g=d.child(p),{colspan:m,rowspan:w,colwidth:R}=g.attrs;for(let y=0;y<w;y++){if(y+c>=n){(s||(s=[])).push({type:"overlong_rowspan",pos:u,n:w-y});break}const T=i+y*t;for(let O=0;O<m;O++){o[T+O]==0?o[T+O]=u:(s||(s=[])).push({type:"collision",row:c,pos:u,n:m-O});const L=R&&R[O];if(L){const B=(T+O)%t*2,q=l[B];q==null||q!=L&&l[B+1]==1?(l[B]=L,l[B+1]=1):q==L&&l[B+1]++}}}i+=m,u+=g.nodeSize}const h=(c+1)*t;let f=0;for(;i<h;)o[i++]==0&&f++;f&&(s||(s=[])).push({type:"missing",row:c,n:f}),u++}(t===0||n===0)&&(s||(s=[])).push({type:"zero_sized"});const r=new v(t,n,o,s);let a=!1;for(let c=0;!a&&c<l.length;c+=2)l[c]!=null&&l[c+1]<n&&(a=!0);return a&&Qe(r,l,e),r}function Ze(e){let t=-1,n=!1;for(let o=0;o<e.childCount;o++){const i=e.child(o);let s=0;if(n)for(let l=0;l<o;l++){const r=e.child(l);for(let a=0;a<r.childCount;a++){const c=r.child(a);l+c.attrs.rowspan>o&&(s+=c.attrs.colspan)}}for(let l=0;l<i.childCount;l++){const r=i.child(l);s+=r.attrs.colspan,r.attrs.rowspan>1&&(n=!0)}t==-1?t=s:t!=s&&(t=Math.max(t,s))}return t}function Qe(e,t,n){e.problems||(e.problems=[]);const o={};for(let i=0;i<e.map.length;i++){const s=e.map[i];if(o[s])continue;o[s]=!0;const l=n.nodeAt(s);if(!l)throw new RangeError(`No cell with offset ${s} found`);let r=null;const a=l.attrs;for(let c=0;c<a.colspan;c++){const u=t[(i+c)%e.width*2];u!=null&&(!a.colwidth||a.colwidth[c]!=u)&&((r||(r=et(a)))[c]=u)}r&&e.problems.unshift({type:"colwidth mismatch",pos:s,colwidth:r})}}function et(e){if(e.colwidth)return e.colwidth.slice();const t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function S(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(const n in e.nodes){const o=e.nodes[n],i=o.spec.tableRole;i&&(t[i]=o)}}return t}const x=new $("selectingCells");function N(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 tt(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 A(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=N(t.$head)||nt(t.$head);if(n)return n;throw new RangeError(`No cell found around position ${t.head}`)}function nt(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 ee(e){return e.parent.type.spec.tableRole=="row"&&!!e.nodeAfter}function ot(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 De(e,t,n){const o=e.node(-1),i=v.get(o),s=e.start(-1),l=i.nextCell(e.pos-s,t,n);return l==null?null:e.node(0).resolve(s+l)}function P(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(i=>i>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 i=0;i<n;i++)o.colwidth.splice(t,0,0)}return o}function it(e,t,n){const o=S(t.type.schema).header_cell;for(let i=0;i<e.height;i++)if(t.nodeAt(e.map[n+i*e.width]).type!=o)return!1;return!0}var b=class z extends D{constructor(t,n=t){const o=t.node(-1),i=v.get(o),s=t.start(-1),l=i.rectBetween(t.pos-s,n.pos-s),r=t.node(0),a=i.cellsInRect(l).filter(u=>u!=n.pos-s);a.unshift(n.pos-s);const c=a.map(u=>{const d=o.nodeAt(u);if(!d)throw new RangeError(`No cell with offset ${u} found`);const h=s+u+1;return new je(r.resolve(h),r.resolve(h+d.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=t,this.$headCell=n}map(t,n){const o=t.resolve(n.map(this.$anchorCell.pos)),i=t.resolve(n.map(this.$headCell.pos));if(ee(o)&&ee(i)&&ie(o,i)){const s=this.$anchorCell.node(-1)!=o.node(-1);return s&&this.isRowSelection()?z.rowSelection(o,i):s&&this.isColSelection()?z.colSelection(o,i):new z(o,i)}return H.between(o,i)}content(){const t=this.$anchorCell.node(-1),n=v.get(t),o=this.$anchorCell.start(-1),i=n.rectBetween(this.$anchorCell.pos-o,this.$headCell.pos-o),s={},l=[];for(let a=i.top;a<i.bottom;a++){const c=[];for(let u=a*n.width+i.left,d=i.left;d<i.right;d++,u++){const h=n.map[u];if(s[h])continue;s[h]=!0;const f=n.findCell(h);let p=t.nodeAt(h);if(!p)throw new RangeError(`No cell with offset ${h} found`);const g=i.left-f.left,m=f.right-i.right;if(g>0||m>0){let w=p.attrs;if(g>0&&(w=P(w,0,g)),m>0&&(w=P(w,w.colspan-m,m)),f.left<i.left){if(p=p.type.createAndFill(w),!p)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(w)}`)}else p=p.type.create(w,p.content)}if(f.top<i.top||f.bottom>i.bottom){const w={...p.attrs,rowspan:Math.min(f.bottom,i.bottom)-Math.max(f.top,i.top)};f.top<i.top?p=p.type.createAndFill(w):p=p.type.create(w,p.content)}c.push(p)}l.push(t.child(a).copy(I.from(c)))}const r=this.isColSelection()&&this.isRowSelection()?t:l;return new U(I.from(r),1,1)}replace(t,n=U.empty){const o=t.steps.length,i=this.ranges;for(let l=0;l<i.length;l++){const{$from:r,$to:a}=i[l],c=t.mapping.slice(o);t.replace(c.map(r.pos),c.map(a.pos),l?U.empty:n)}const s=D.findFrom(t.doc.resolve(t.mapping.slice(o).map(this.to)),-1);s&&t.setSelection(s)}replaceWith(t,n){this.replace(t,new U(I.from(n),0,0))}forEachCell(t){const n=this.$anchorCell.node(-1),o=v.get(n),i=this.$anchorCell.start(-1),s=o.cellsInRect(o.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i));for(let l=0;l<s.length;l++)t(n.nodeAt(s[l]),i+s[l])}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,i=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(o,i)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){const o=t.node(-1),i=v.get(o),s=t.start(-1),l=i.findCell(t.pos-s),r=i.findCell(n.pos-s),a=t.node(0);return l.top<=r.top?(l.top>0&&(t=a.resolve(s+i.map[l.left])),r.bottom<i.height&&(n=a.resolve(s+i.map[i.width*(i.height-1)+r.right-1]))):(r.top>0&&(n=a.resolve(s+i.map[r.left])),l.bottom<i.height&&(t=a.resolve(s+i.map[i.width*(i.height-1)+l.right-1]))),new z(t,n)}isRowSelection(){const t=this.$anchorCell.node(-1),n=v.get(t),o=this.$anchorCell.start(-1),i=n.colCount(this.$anchorCell.pos-o),s=n.colCount(this.$headCell.pos-o);if(Math.min(i,s)>0)return!1;const l=i+this.$anchorCell.nodeAfter.attrs.colspan,r=s+this.$headCell.nodeAfter.attrs.colspan;return Math.max(l,r)==n.width}eq(t){return t instanceof z&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){const o=t.node(-1),i=v.get(o),s=t.start(-1),l=i.findCell(t.pos-s),r=i.findCell(n.pos-s),a=t.node(0);return l.left<=r.left?(l.left>0&&(t=a.resolve(s+i.map[l.top*i.width])),r.right<i.width&&(n=a.resolve(s+i.map[i.width*(r.top+1)-1]))):(r.left>0&&(n=a.resolve(s+i.map[r.top*i.width])),l.right<i.width&&(t=a.resolve(s+i.map[i.width*(l.top+1)-1]))),new z(t,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new z(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,o=n){return new z(t.resolve(n),t.resolve(o))}getBookmark(){return new st(this.$anchorCell.pos,this.$headCell.pos)}};b.prototype.visible=!1;D.jsonID("cell",b);var st=class Ue{constructor(t,n){this.anchor=t,this.head=n}map(t){return new Ue(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):D.near(o,1)}};function lt(e){if(!(e.selection instanceof b))return null;const t=[];return e.selection.forEachCell((n,o)=>{t.push(J.node(o,o+n.nodeSize,{class:"selectedCell"}))}),G.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,i=e.depth;for(;i>=0&&!(e.after(i+1)<e.end(i));i--,n++);for(let s=t.depth;s>=0&&!(t.before(s+1)>t.start(s));s--,o--);return n==o&&/row|table/.test(e.node(i).type.spec.tableRole)}function at({$from:e,$to:t}){let n,o;for(let i=e.depth;i>0;i--){const s=e.node(i);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){n=s;break}}for(let i=t.depth;i>0;i--){const s=t.node(i);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){o=s;break}}return n!==o&&t.parentOffset===0}function ct(e,t,n){const o=(t||e).selection,i=(t||e).doc;let s,l;if(o instanceof me&&(l=o.node.type.spec.tableRole)){if(l=="cell"||l=="header_cell")s=b.create(i,o.from);else if(l=="row"){const r=i.resolve(o.from+1);s=b.rowSelection(r,r)}else if(!n){const r=v.get(o.node),a=o.from+1,c=a+r.map[r.width*r.height-1];s=b.create(i,a+1,c)}}else o instanceof H&&rt(o)?s=H.create(i,o.from):o instanceof H&&at(o)&&(s=H.create(i,o.$from.start(),o.$from.end()));return s&&(t||(t=e.tr)).setSelection(s),t}const dt=new $("fix-tables");function He(e,t,n,o){const i=e.childCount,s=t.childCount;e:for(let l=0,r=0;l<s;l++){const a=t.child(l);for(let c=r,u=Math.min(i,l+3);c<u;c++)if(e.child(c)==a){r=c+1,n+=a.nodeSize;continue e}o(a,n),r<i&&e.child(r).sameMarkup(a)?He(e.child(r),a,n+1,o):a.nodesBetween(0,a.content.size,o,n+1),n+=a.nodeSize}}function ut(e,t){let n;const o=(i,s)=>{i.type.spec.tableRole=="table"&&(n=ht(e,i,s,n))};return t?t.doc!=e.doc&&He(t.doc,e.doc,0,o):e.doc.descendants(o),n}function ht(e,t,n,o){const i=v.get(t);if(!i.problems)return o;o||(o=e.tr);const s=[];for(let a=0;a<i.height;a++)s.push(0);for(let a=0;a<i.problems.length;a++){const c=i.problems[a];if(c.type=="collision"){const u=t.nodeAt(c.pos);if(!u)continue;const d=u.attrs;for(let h=0;h<d.rowspan;h++)s[c.row+h]+=c.n;o.setNodeMarkup(o.mapping.map(n+1+c.pos),null,P(d,d.colspan-c.n,c.n))}else if(c.type=="missing")s[c.row]+=c.n;else if(c.type=="overlong_rowspan"){const u=t.nodeAt(c.pos);if(!u)continue;o.setNodeMarkup(o.mapping.map(n+1+c.pos),null,{...u.attrs,rowspan:u.attrs.rowspan-c.n})}else if(c.type=="colwidth mismatch"){const u=t.nodeAt(c.pos);if(!u)continue;o.setNodeMarkup(o.mapping.map(n+1+c.pos),null,{...u.attrs,colwidth:c.colwidth})}else if(c.type=="zero_sized"){const u=o.mapping.map(n);o.delete(u,u+t.nodeSize)}}let l,r;for(let a=0;a<s.length;a++)s[a]&&(l==null&&(l=a),r=a);for(let a=0,c=n+1;a<i.height;a++){const u=t.child(a),d=c+u.nodeSize,h=s[a];if(h>0){let f="cell";u.firstChild&&(f=u.firstChild.type.spec.tableRole);const p=[];for(let m=0;m<h;m++){const w=S(e.schema)[f].createAndFill();w&&p.push(w)}const g=(a==0||l==a-1)&&r==a?c+1:d-1;o.insert(o.mapping.map(g),p)}c=d}return o.setMeta(dt,{fixTables:!0})}function M(e){const t=e.selection,n=j(e),o=n.node(-1),i=n.start(-1),s=v.get(o);return{...t instanceof b?s.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):s.findCell(n.pos-i),tableStart:i,map:s,table:o}}function Ne(e,{map:t,tableStart:n,table:o},i){let s=i>0?-1:0;it(t,o,i+s)&&(s=i==0||i==t.width?null:0);for(let l=0;l<t.height;l++){const r=l*t.width+i;if(i>0&&i<t.width&&t.map[r-1]==t.map[r]){const a=t.map[r],c=o.nodeAt(a);e.setNodeMarkup(e.mapping.map(n+a),null,xe(c.attrs,i-t.colCount(a))),l+=c.attrs.rowspan-1}else{const a=s==null?S(o.type.schema).cell:o.nodeAt(t.map[r+s]).type,c=t.positionAt(l,i,o);e.insert(e.mapping.map(n+c),a.createAndFill())}}return e}function an(e,t){if(!A(e))return!1;if(t){const n=M(e);t(Ne(e.tr,n,n.left))}return!0}function cn(e,t){if(!A(e))return!1;if(t){const n=M(e);t(Ne(e.tr,n,n.right))}return!0}function ft(e,{map:t,table:n,tableStart:o},i){const s=e.mapping.maps.length;for(let l=0;l<t.height;){const r=l*t.width+i,a=t.map[r],c=n.nodeAt(a),u=c.attrs;if(i>0&&t.map[r-1]==a||i<t.width-1&&t.map[r+1]==a)e.setNodeMarkup(e.mapping.slice(s).map(o+a),null,P(u,i-t.colCount(a)));else{const d=e.mapping.slice(s).map(o+a);e.delete(d,d+c.nodeSize)}l+=u.rowspan}}function dn(e,t){if(!A(e))return!1;if(t){const n=M(e),o=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let i=n.right-1;ft(o,n,i),i!=n.left;i--){const s=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!s)throw new RangeError("No table found");n.table=s,n.map=v.get(s)}t(o)}return!0}function pt(e,t,n){var o;const i=S(t.type.schema).header_cell;for(let s=0;s<e.width;s++)if(((o=t.nodeAt(e.map[s+n*e.width]))===null||o===void 0?void 0:o.type)!=i)return!1;return!0}function Pe(e,{map:t,tableStart:n,table:o},i){let s=n;for(let c=0;c<i;c++)s+=o.child(c).nodeSize;const l=[];let r=i>0?-1:0;pt(t,o,i+r)&&(r=i==0||i==t.height?null:0);for(let c=0,u=t.width*i;c<t.width;c++,u++)if(i>0&&i<t.height&&t.map[u]==t.map[u-t.width]){const d=t.map[u],h=o.nodeAt(d).attrs;e.setNodeMarkup(n+d,null,{...h,rowspan:h.rowspan+1}),c+=h.colspan-1}else{var a;const d=r==null?S(o.type.schema).cell:(a=o.nodeAt(t.map[u+r*t.width]))===null||a===void 0?void 0:a.type,h=d?.createAndFill();h&&l.push(h)}return e.insert(s,S(o.type.schema).row.create(null,l)),e}function un(e,t){if(!A(e))return!1;if(t){const n=M(e);t(Pe(e.tr,n,n.top))}return!0}function hn(e,t){if(!A(e))return!1;if(t){const n=M(e);t(Pe(e.tr,n,n.bottom))}return!0}function gt(e,{map:t,table:n,tableStart:o},i){let s=0;for(let c=0;c<i;c++)s+=n.child(c).nodeSize;const l=s+n.child(i).nodeSize,r=e.mapping.maps.length;e.delete(s+o,l+o);const a=new Set;for(let c=0,u=i*t.width;c<t.width;c++,u++){const d=t.map[u];if(!a.has(d)){if(a.add(d),i>0&&d==t.map[u-t.width]){const h=n.nodeAt(d).attrs;e.setNodeMarkup(e.mapping.slice(r).map(d+o),null,{...h,rowspan:h.rowspan-1}),c+=h.colspan-1}else if(i<t.height&&d==t.map[u+t.width]){const h=n.nodeAt(d),f=h.attrs,p=h.type.create({...f,rowspan:h.attrs.rowspan-1},h.content),g=t.positionAt(i+1,c,n);e.insert(e.mapping.slice(r).map(o+g),p),c+=f.colspan-1}}}}function fn(e,t){if(!A(e))return!1;if(t){const n=M(e),o=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let i=n.bottom-1;gt(o,n,i),i!=n.top;i--){const s=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!s)throw new RangeError("No table found");n.table=s,n.map=v.get(n.table)}t(o)}return!0}function le(e){const t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function mt({width:e,height:t,map:n},o){let i=o.top*e+o.left,s=i,l=(o.bottom-1)*e+o.left,r=i+(o.right-o.left-1);for(let a=o.top;a<o.bottom;a++){if(o.left>0&&n[s]==n[s-1]||o.right<e&&n[r]==n[r+1])return!0;s+=e,r+=e}for(let a=o.left;a<o.right;a++){if(o.top>0&&n[i]==n[i-e]||o.bottom<t&&n[l]==n[l+e])return!0;i++,l++}return!1}function pn(e,t){const n=e.selection;if(!(n instanceof b)||n.$anchorCell.pos==n.$headCell.pos)return!1;const o=M(e),{map:i}=o;if(mt(i,o))return!1;if(t){const s=e.tr,l={};let r=I.empty,a,c;for(let u=o.top;u<o.bottom;u++)for(let d=o.left;d<o.right;d++){const h=i.map[u*i.width+d],f=o.table.nodeAt(h);if(!(l[h]||!f))if(l[h]=!0,a==null)a=h,c=f;else{le(f)||(r=r.append(f.content));const p=s.mapping.map(h+o.tableStart);s.delete(p,p+f.nodeSize)}}if(a==null||c==null)return!0;if(s.setNodeMarkup(a+o.tableStart,null,{...xe(c.attrs,c.attrs.colspan,o.right-o.left-c.attrs.colspan),rowspan:o.bottom-o.top}),r.size>0){const u=a+1+c.content.size,d=le(c)?a+1:u;s.replaceWith(d+o.tableStart,u+o.tableStart,r)}s.setSelection(new b(s.doc.resolve(a+o.tableStart))),t(s)}return!0}function gn(e,t){const n=S(e.schema);return wt(({node:o})=>n[o.type.spec.tableRole])(e,t)}function wt(e){return(t,n)=>{const o=t.selection;let i,s;if(o instanceof b){if(o.$anchorCell.pos!=o.$headCell.pos)return!1;i=o.$anchorCell.nodeAfter,s=o.$anchorCell.pos}else{var l;if(i=tt(o.$from),!i)return!1;s=(l=N(o.$from))===null||l===void 0?void 0:l.pos}if(i==null||s==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(n){let r=i.attrs;const a=[],c=r.colwidth;r.rowspan>1&&(r={...r,rowspan:1}),r.colspan>1&&(r={...r,colspan:1});const u=M(t),d=t.tr;for(let f=0;f<u.right-u.left;f++)a.push(c?{...r,colwidth:c&&c[f]?[c[f]]:null}:r);let h;for(let f=u.top;f<u.bottom;f++){let p=u.map.positionAt(f,u.left,u.table);f==u.top&&(p+=i.nodeSize);for(let g=u.left,m=0;g<u.right;g++,m++)g==u.left&&f==u.top||d.insert(h=d.mapping.map(p+u.tableStart,1),e({node:i,row:f,col:g}).createAndFill(a[m]))}d.setNodeMarkup(s,e({node:i,row:u.top,col:u.left}),a[0]),o instanceof b&&d.setSelection(new b(d.doc.resolve(o.$anchorCell.pos),h?d.doc.resolve(h):void 0)),n(d)}return!0}}function mn(e,t){return function(n,o){if(!A(n))return!1;const i=j(n);if(i.nodeAfter.attrs[e]===t)return!1;if(o){const s=n.tr;n.selection instanceof b?n.selection.forEachCell((l,r)=>{l.attrs[e]!==t&&s.setNodeMarkup(r,null,{...l.attrs,[e]:t})}):s.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[e]:t}),o(s)}return!0}}function bt(e){return function(t,n){if(!A(t))return!1;if(n){const o=S(t.schema),i=M(t),s=t.tr,l=i.map.cellsInRect(e=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:e=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),r=l.map(a=>i.table.nodeAt(a));for(let a=0;a<l.length;a++)r[a].type==o.header_cell&&s.setNodeMarkup(i.tableStart+l[a],o.cell,r[a].attrs);if(s.steps.length===0)for(let a=0;a<l.length;a++)s.setNodeMarkup(i.tableStart+l[a],o.header_cell,r[a].attrs);n(s)}return!0}}function re(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 i=0;i<o.length;i++){const s=t.table.nodeAt(o[i]);if(s&&s.type!==n.header_cell)return!1}return!0}function se(e,t){return t=t||{useDeprecatedLogic:!1},t.useDeprecatedLogic?bt(e):function(n,o){if(!A(n))return!1;if(o){const i=S(n.schema),s=M(n),l=n.tr,r=re("row",s,i),a=re("column",s,i),c=(e==="column"?r:e==="row"&&a)?1:0,u=e=="column"?{left:0,top:c,right:1,bottom:s.map.height}:e=="row"?{left:c,top:0,right:s.map.width,bottom:1}:s,d=e=="column"?a?i.cell:i.header_cell:e=="row"?r?i.cell:i.header_cell:i.cell;s.map.cellsInRect(u).forEach(h=>{const f=h+s.tableStart,p=l.doc.nodeAt(f);p&&l.setNodeMarkup(f,d,p.attrs)}),o(l)}return!0}}se("row",{useDeprecatedLogic:!0});se("column",{useDeprecatedLogic:!0});const wn=se("cell",{useDeprecatedLogic:!0});function vt(e,t){if(t<0){const n=e.nodeBefore;if(n)return e.pos-n.nodeSize;for(let o=e.index(-1)-1,i=e.before();o>=0;o--){const s=e.node(-1).child(o),l=s.lastChild;if(l)return i-1-l.nodeSize;i-=s.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),i=e.after();o<n.childCount;o++){const s=n.child(o);if(s.childCount)return i+1;i+=s.nodeSize}}return null}function bn(e){return function(t,n){if(!A(t))return!1;const o=vt(j(t),e);if(o==null)return!1;if(n){const i=t.doc.resolve(o);n(t.tr.setSelection(H.between(i,ot(i))).scrollIntoView())}return!0}}function vn(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 V(e,t){const n=e.selection;if(!(n instanceof b))return!1;if(t){const o=e.tr,i=S(e.schema).cell.createAndFill().content;n.forEachCell((s,l)=>{s.content.eq(i)||o.replace(o.mapping.map(l+1),o.mapping.map(l+s.nodeSize-1),new U(i,0,0))}),o.docChanged&&t(o)}return!0}function yt(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 i=t.child(0),s=i.type.spec.tableRole,l=i.type.schema,r=[];if(s=="row")for(let a=0;a<t.childCount;a++){let c=t.child(a).content;const u=a?0:Math.max(0,n-1),d=a<t.childCount-1?0:Math.max(0,o-1);(u||d)&&(c=te(S(l).row,new U(c,u,d)).content),r.push(c)}else if(s=="cell"||s=="header_cell")r.push(n||o?te(S(l).row,new U(t,n,o)).content:t);else return null;return Ct(l,r)}function Ct(e,t){const n=[];for(let i=0;i<t.length;i++){const s=t[i];for(let l=s.childCount-1;l>=0;l--){const{rowspan:r,colspan:a}=s.child(l).attrs;for(let c=i;c<i+r;c++)n[c]=(n[c]||0)+a}}let o=0;for(let i=0;i<n.length;i++)o=Math.max(o,n[i]);for(let i=0;i<n.length;i++)if(i>=t.length&&t.push(I.empty),n[i]<o){const s=S(e).cell.createAndFill(),l=[];for(let r=n[i];r<o;r++)l.push(s);t[i]=t[i].append(I.from(l))}return{height:t.length,width:o,rows:t}}function te(e,t){const n=e.createAndFill();return new qe(n).replace(0,n.content.size,t).doc}function St({width:e,height:t,rows:n},o,i){if(e!=o){const s=[],l=[];for(let r=0;r<n.length;r++){const a=n[r],c=[];for(let u=s[r]||0,d=0;u<o;d++){let h=a.child(d%a.childCount);u+h.attrs.colspan>o&&(h=h.type.createChecked(P(h.attrs,h.attrs.colspan,u+h.attrs.colspan-o),h.content)),c.push(h),u+=h.attrs.colspan;for(let f=1;f<h.attrs.rowspan;f++)s[r+f]=(s[r+f]||0)+h.attrs.colspan}l.push(I.from(c))}n=l,e=o}if(t!=i){const s=[];for(let l=0,r=0;l<i;l++,r++){const a=[],c=n[r%t];for(let u=0;u<c.childCount;u++){let d=c.child(u);l+d.attrs.rowspan>i&&(d=d.type.create({...d.attrs,rowspan:Math.max(1,i-d.attrs.rowspan)},d.content)),a.push(d)}s.push(I.from(a))}n=s,t=i}return{width:e,height:t,rows:n}}function Rt(e,t,n,o,i,s,l){const r=e.doc.type.schema,a=S(r);let c,u;if(i>t.width)for(let d=0,h=0;d<t.height;d++){const f=n.child(d);h+=f.nodeSize;const p=[];let g;f.lastChild==null||f.lastChild.type==a.cell?g=c||(c=a.cell.createAndFill()):g=u||(u=a.header_cell.createAndFill());for(let m=t.width;m<i;m++)p.push(g);e.insert(e.mapping.slice(l).map(h-1+o),p)}if(s>t.height){const d=[];for(let p=0,g=(t.height-1)*t.width;p<Math.max(t.width,i);p++){const m=p>=t.width?!1:n.nodeAt(t.map[g+p]).type==a.header_cell;d.push(m?u||(u=a.header_cell.createAndFill()):c||(c=a.cell.createAndFill()))}const h=a.row.create(null,I.from(d)),f=[];for(let p=t.height;p<s;p++)f.push(h);e.insert(e.mapping.slice(l).map(o+n.nodeSize-2),f)}return!!(c||u)}function ae(e,t,n,o,i,s,l,r){if(l==0||l==t.height)return!1;let a=!1;for(let c=i;c<s;c++){const u=l*t.width+c,d=t.map[u];if(t.map[u-t.width]==d){a=!0;const h=n.nodeAt(d),{top:f,left:p}=t.findCell(d);e.setNodeMarkup(e.mapping.slice(r).map(d+o),null,{...h.attrs,rowspan:l-f}),e.insert(e.mapping.slice(r).map(t.positionAt(l,p,n)),h.type.createAndFill({...h.attrs,rowspan:f+h.attrs.rowspan-l})),c+=h.attrs.colspan-1}}return a}function ce(e,t,n,o,i,s,l,r){if(l==0||l==t.width)return!1;let a=!1;for(let c=i;c<s;c++){const u=c*t.width+l,d=t.map[u];if(t.map[u-1]==d){a=!0;const h=n.nodeAt(d),f=t.colCount(d),p=e.mapping.slice(r).map(d+o);e.setNodeMarkup(p,null,P(h.attrs,l-f,h.attrs.colspan-(l-f))),e.insert(p+h.nodeSize,h.type.createAndFill(P(h.attrs,0,l-f))),c+=h.attrs.rowspan-1}}return a}function de(e,t,n,o,i){let s=n?e.doc.nodeAt(n-1):e.doc;if(!s)throw new Error("No table found");let l=v.get(s);const{top:r,left:a}=o,c=a+i.width,u=r+i.height,d=e.tr;let h=0;function f(){if(s=n?d.doc.nodeAt(n-1):d.doc,!s)throw new Error("No table found");l=v.get(s),h=d.mapping.maps.length}Rt(d,l,s,n,c,u,h)&&f(),ae(d,l,s,n,a,c,r,h)&&f(),ae(d,l,s,n,a,c,u,h)&&f(),ce(d,l,s,n,r,u,a,h)&&f(),ce(d,l,s,n,r,u,c,h)&&f();for(let p=r;p<u;p++){const g=l.positionAt(p,a,s),m=l.positionAt(p,c,s);d.replace(d.mapping.slice(h).map(g+n),d.mapping.slice(h).map(m+n),new U(i.rows[p-r],0,0))}f(),d.setSelection(new b(d.doc.resolve(n+l.positionAt(r,a,s)),d.doc.resolve(n+l.positionAt(u-1,c-1,s)))),t(d)}const Et=We({ArrowLeft:K("horiz",-1),ArrowRight:K("horiz",1),ArrowUp:K("vert",-1),ArrowDown:K("vert",1),"Shift-ArrowLeft":_("horiz",-1),"Shift-ArrowRight":_("horiz",1),"Shift-ArrowUp":_("vert",-1),"Shift-ArrowDown":_("vert",1),Backspace:V,"Mod-Backspace":V,Delete:V,"Mod-Delete":V});function k(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function K(e,t){return(n,o,i)=>{if(!i)return!1;const s=n.selection;if(s instanceof b)return k(n,o,D.near(s.$headCell,t));if(e!="horiz"&&!s.empty)return!1;const l=Le(i,e,t);if(l==null)return!1;if(e=="horiz")return k(n,o,D.near(n.doc.resolve(s.head+t),t));{const r=n.doc.resolve(l),a=De(r,e,t);let c;return a?c=D.near(a,1):t<0?c=D.near(n.doc.resolve(r.before(-1)),-1):c=D.near(n.doc.resolve(r.after(-1)),1),k(n,o,c)}}}function _(e,t){return(n,o,i)=>{if(!i)return!1;const s=n.selection;let l;if(s instanceof b)l=s;else{const a=Le(i,e,t);if(a==null)return!1;l=new b(n.doc.resolve(a))}const r=De(l.$headCell,e,t);return r?k(n,o,new b(l.$anchorCell,r)):!1}}function Tt(e,t){const n=e.state.doc,o=N(n.resolve(t));return o?(e.dispatch(e.state.tr.setSelection(new b(o))),!0):!1}function Ot(e,t,n){if(!A(e.state))return!1;let o=yt(n);const i=e.state.selection;if(i instanceof b){o||(o={width:1,height:1,rows:[I.from(te(S(e.state.schema).cell,n))]});const s=i.$anchorCell.node(-1),l=i.$anchorCell.start(-1),r=v.get(s).rectBetween(i.$anchorCell.pos-l,i.$headCell.pos-l);return o=St(o,r.right-r.left,r.bottom-r.top),de(e.state,e.dispatch,l,r,o),!0}else if(o){const s=j(e.state),l=s.start(-1);return de(e.state,e.dispatch,l,v.get(s.node(-1)).findCell(s.pos-l),o),!0}else return!1}function At(e,t){var n;if(t.button!=0||t.ctrlKey||t.metaKey)return;const o=ue(e,t.target);let i;if(t.shiftKey&&e.state.selection instanceof b)s(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&o&&(i=N(e.state.selection.$anchor))!=null&&((n=X(e,t))===null||n===void 0?void 0:n.pos)!=i.pos)s(i,t),t.preventDefault();else if(!o)return;function s(a,c){let u=X(e,c);const d=x.getState(e.state)==null;if(!u||!ie(a,u))if(d)u=a;else return;const h=new b(a,u);if(d||!e.state.selection.eq(h)){const f=e.state.tr.setSelection(h);d&&f.setMeta(x,a.pos),e.dispatch(f)}}function l(){e.root.removeEventListener("mouseup",l),e.root.removeEventListener("dragstart",l),e.root.removeEventListener("mousemove",r),x.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(x,-1))}function r(a){const c=a,u=x.getState(e.state);let d;if(u!=null)d=e.state.doc.resolve(u);else if(ue(e,c.target)!=o&&(d=X(e,t),!d))return l();d&&s(d,c)}e.root.addEventListener("mouseup",l),e.root.addEventListener("dragstart",l),e.root.addEventListener("mousemove",r)}function Le(e,t,n){if(!(e.state.selection instanceof H))return null;const{$head:o}=e.state.selection;for(let i=o.depth-1;i>=0;i--){const s=o.node(i);if((n<0?o.index(i):o.indexAfter(i))!=(n<0?0:s.childCount))return null;if(s.type.spec.tableRole=="cell"||s.type.spec.tableRole=="header_cell"){const l=o.before(i),r=t=="vert"?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(r)?l:null}}return null}function ue(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName=="TD"||t.nodeName=="TH")return t;return null}function X(e,t){const n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:o,pos:i}=n;return o>=0&&N(e.state.doc.resolve(o))||N(e.state.doc.resolve(i))}var It=class{constructor(e,t){this.node=e,this.defaultCellMinWidth=t,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",`${t}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),ne(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,ne(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function ne(e,t,n,o,i,s){let l=0,r=!0,a=t.firstChild;const c=e.firstChild;if(c){for(let d=0,h=0;d<c.childCount;d++){const{colspan:f,colwidth:p}=c.child(d).attrs;for(let g=0;g<f;g++,h++){const m=i==h?s:p&&p[g],w=m?m+"px":"";if(l+=m||o,m||(r=!1),a)a.style.width!=w&&(a.style.width=w),a=a.nextSibling;else{const R=document.createElement("col");R.style.width=w,t.appendChild(R)}}}for(;a;){var u;const d=a.nextSibling;(u=a.parentNode)===null||u===void 0||u.removeChild(a),a=d}r?(n.style.width=l+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=l+"px")}}const E=new $("tableColumnResizing");function yn({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:o=It,lastColumnResizable:i=!0}={}){const s=new W({key:E,state:{init(l,r){var a;const c=(a=s.spec)===null||a===void 0||(a=a.props)===null||a===void 0?void 0:a.nodeViews,u=S(r.schema).table.name;return o&&c&&(c[u]=(d,h)=>new o(d,n,h)),new Mt(-1,!1)},apply(l,r){return r.apply(l)}},props:{attributes:l=>{const r=E.getState(l);return r&&r.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(l,r)=>{zt(l,r,e,i)},mouseleave:l=>{Dt(l)},mousedown:(l,r)=>{xt(l,r,t,n)}},decorations:l=>{const r=E.getState(l);if(r&&r.activeHandle>-1)return Lt(l,r.activeHandle)},nodeViews:{}}});return s}var Mt=class F{constructor(t,n){this.activeHandle=t,this.dragging=n}apply(t){const n=this,o=t.getMeta(E);if(o&&o.setHandle!=null)return new F(o.setHandle,!1);if(o&&o.setDragging!==void 0)return new F(n.activeHandle,o.setDragging);if(n.activeHandle>-1&&t.docChanged){let i=t.mapping.map(n.activeHandle,-1);return ee(t.doc.resolve(i))||(i=-1),new F(i,n.dragging)}return n}};function zt(e,t,n,o){if(!e.editable)return;const i=E.getState(e.state);if(i&&!i.dragging){const s=Ht(t.target);let l=-1;if(s){const{left:r,right:a}=s.getBoundingClientRect();t.clientX-r<=n?l=he(e,t,"left",n):a-t.clientX<=n&&(l=he(e,t,"right",n))}if(l!=i.activeHandle){if(!o&&l!==-1){const r=e.state.doc.resolve(l),a=r.node(-1),c=v.get(a),u=r.start(-1);if(c.colCount(r.pos-u)+r.nodeAfter.attrs.colspan-1==c.width-1)return}$e(e,l)}}}function Dt(e){if(!e.editable)return;const t=E.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&$e(e,-1)}function xt(e,t,n,o){var i;if(!e.editable)return!1;const s=(i=e.dom.ownerDocument.defaultView)!==null&&i!==void 0?i:window,l=E.getState(e.state);if(!l||l.activeHandle==-1||l.dragging)return!1;const r=e.state.doc.nodeAt(l.activeHandle),a=Ut(e,l.activeHandle,r.attrs);e.dispatch(e.state.tr.setMeta(E,{setDragging:{startX:t.clientX,startWidth:a}}));function c(d){s.removeEventListener("mouseup",c),s.removeEventListener("mousemove",u);const h=E.getState(e.state);h?.dragging&&(Nt(e,h.activeHandle,fe(h.dragging,d,n)),e.dispatch(e.state.tr.setMeta(E,{setDragging:null})))}function u(d){if(!d.which)return c(d);const h=E.getState(e.state);if(h&&h.dragging){const f=fe(h.dragging,d,n);pe(e,h.activeHandle,f,o)}}return pe(e,l.activeHandle,a,o),s.addEventListener("mouseup",c),s.addEventListener("mousemove",u),t.preventDefault(),!0}function Ut(e,t,{colspan:n,colwidth:o}){const i=o&&o[o.length-1];if(i)return i;const s=e.domAtPos(t);let l=s.node.childNodes[s.offset].offsetWidth,r=n;if(o)for(let a=0;a<n;a++)o[a]&&(l-=o[a],r--);return l/r}function Ht(e){for(;e&&e.nodeName!="TD"&&e.nodeName!="TH";)e=e.classList&&e.classList.contains("ProseMirror")?null:e.parentNode;return e}function he(e,t,n,o){const i=n=="right"?-o:o,s=e.posAtCoords({left:t.clientX+i,top:t.clientY});if(!s)return-1;const{pos:l}=s,r=N(e.state.doc.resolve(l));if(!r)return-1;if(n=="right")return r.pos;const a=v.get(r.node(-1)),c=r.start(-1),u=a.map.indexOf(r.pos-c);return u%a.width==0?-1:c+a.map[u-1]}function fe(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(E,{setHandle:t}))}function Nt(e,t,n){const o=e.state.doc.resolve(t),i=o.node(-1),s=v.get(i),l=o.start(-1),r=s.colCount(o.pos-l)+o.nodeAfter.attrs.colspan-1,a=e.state.tr;for(let c=0;c<s.height;c++){const u=c*s.width+r;if(c&&s.map[u]==s.map[u-s.width])continue;const d=s.map[u],h=i.nodeAt(d).attrs,f=h.colspan==1?0:r-s.colCount(d);if(h.colwidth&&h.colwidth[f]==n)continue;const p=h.colwidth?h.colwidth.slice():Pt(h.colspan);p[f]=n,a.setNodeMarkup(l+d,null,{...h,colwidth:p})}a.docChanged&&e.dispatch(a)}function pe(e,t,n,o){const i=e.state.doc.resolve(t),s=i.node(-1),l=i.start(-1),r=v.get(s).colCount(i.pos-l)+i.nodeAfter.attrs.colspan-1;let a=e.domAtPos(i.start(-1)).node;for(;a&&a.nodeName!="TABLE";)a=a.parentNode;a&&ne(s,a.firstChild,a,o,r,n)}function Pt(e){return Array(e).fill(0)}function Lt(e,t){const n=[],o=e.doc.resolve(t),i=o.node(-1);if(!i)return G.empty;const s=v.get(i),l=o.start(-1),r=s.colCount(o.pos-l)+o.nodeAfter.attrs.colspan-1;for(let c=0;c<s.height;c++){const u=r+c*s.width;if((r==s.width-1||s.map[u]!=s.map[u+1])&&(c==0||s.map[u]!=s.map[u-s.width])){var a;const d=s.map[u],h=l+d+i.nodeAt(d).nodeSize-1,f=document.createElement("div");f.className="column-resize-handle",!((a=E.getState(e))===null||a===void 0)&&a.dragging&&n.push(J.node(l+d,l+d+i.nodeAt(d).nodeSize,{class:"column-resize-dragging"})),n.push(J.widget(h,f))}}return G.create(e.doc,n)}function Cn({allowTableNodeSelection:e=!1}={}){return new W({key:x,state:{init(){return null},apply(t,n){const o=t.getMeta(x);if(o!=null)return o==-1?null:o;if(n==null||!t.docChanged)return n;const{deleted:i,pos:s}=t.mapping.mapResult(n);return i?null:s}},props:{decorations:lt,handleDOMEvents:{mousedown:At},createSelectionBetween(t){return x.getState(t.state)!=null?t.state.selection:null},handleTripleClick:Tt,handleKeyDown:Et,handlePaste:Ot},appendTransaction(t,n,o){return ct(o,ut(o,n),e)}})}function $t(e,t){const n=Math.min(e.top,t.top),o=Math.max(e.bottom,t.bottom),i=Math.min(e.left,t.left),s=Math.max(e.right,t.right)-i,l=o-n;return new DOMRect(i,n,s,l)}var Bt=class{get middlewares(){const e=[];return this.floatingUIOptions.flip&&e.push(ye(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&e.push(Ce(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&e.push(Se(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&e.push(Re(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(Ee(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&e.push(Te(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&e.push(Oe(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&e.push(Ae(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),e}get virtualElement(){var e,t;const{selection:n}=this.editor.state,o=(e=this.getReferencedVirtualElement)===null||e===void 0?void 0:e.call(this);if(o)return o;if(!(!((t=this.view)===null||t===void 0||(t=t.dom)===null||t===void 0)&&t.parentNode))return;const i=we(this.view,n.from,n.to);let s={getBoundingClientRect:()=>i,getClientRects:()=>[i]};if(n instanceof me){let l=this.view.nodeDOM(n.from);const r=l.dataset.nodeViewWrapper?l:l.querySelector("[data-node-view-wrapper]");r&&(l=r),l&&(s={getBoundingClientRect:()=>l.getBoundingClientRect(),getClientRects:()=>[l.getBoundingClientRect()]})}if(n instanceof b){const{$anchorCell:l,$headCell:r}=n,a=l?l.pos:r.pos,c=r?r.pos:l.pos,u=this.view.nodeDOM(a),d=this.view.nodeDOM(c);if(!u||!d)return;const h=u===d?u.getBoundingClientRect():$t(u.getBoundingClientRect(),d.getBoundingClientRect());s={getBoundingClientRect:()=>h,getClientRects:()=>[h]}}return s}constructor({editor:e,element:t,view:n,pluginKey:o="bubbleMenu",updateDelay:i=250,resizeDelay:s=60,shouldShow:l,appendTo:r,getReferencedVirtualElement:a,options:c}){var u;this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.floatingUIOptions={strategy:"absolute",placement:"top",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1,onShow:void 0,onHide:void 0,onUpdate:void 0,onDestroy:void 0},this.shouldShow=({view:d,state:h,from:f,to:p})=>{const{doc:g,selection:m}=h,{empty:w}=m,R=!g.textBetween(f,p).length&&Xe(h.selection),y=this.element.contains(document.activeElement);return!(!(d.hasFocus()||y)||w||R||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:d})=>{var h;if(this.editor.isDestroyed){this.destroy();return}if(this.preventHide){this.preventHide=!1;return}d?.relatedTarget&&(!((h=this.element.parentNode)===null||h===void 0)&&h.contains(d.relatedTarget))||d?.relatedTarget!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(d,h)=>{const f=!h?.selection.eq(d.state.selection),p=!h?.doc.eq(d.state.doc);!f&&!p||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(d,f,p,h)},this.updateDelay))},this.updateHandler=(d,h,f,p)=>{const{composing:g}=d;if(!(g||!h&&!f)){if(!this.getShouldShow(p)){this.hide();return}this.show(),this.updatePosition()}},this.transactionHandler=({transaction:d})=>{const h=d.getMeta(this.pluginKey);h==="updatePosition"?this.updatePosition():h&&typeof h=="object"&&h.type==="updateOptions"?this.updateOptions(h.options):h==="hide"?this.hide():h==="show"&&(this.updatePosition(),this.show())},this.editor=e,this.element=t,this.view=n,this.pluginKey=o,this.updateDelay=i,this.resizeDelay=s,this.appendTo=r,this.scrollTarget=(u=c?.scrollTarget)!==null&&u!==void 0?u:window,this.getReferencedVirtualElement=a,this.floatingUIOptions={...this.floatingUIOptions,...c},this.element.tabIndex=0,l&&(this.shouldShow=l),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}updatePosition(){if(!this.isVisible)return;const e=this.virtualElement;e&&Ie(e,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:t,y:n,strategy:o,middlewareData:i})=>{var s,l;if(!(!this.isVisible||this.editor.isDestroyed||!this.element.isConnected)){if(!((s=i.hide)===null||s===void 0)&&s.referenceHidden||!((l=i.hide)===null||l===void 0)&&l.escaped){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=o,this.element.style.left=`${t}px`,this.element.style.top=`${n}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()}})}update(e,t){const{state:n}=e,o=n.selection.from!==n.selection.to;if(this.updateDelay>0&&o){this.handleDebouncedUpdate(e,t);return}const i=!t?.selection.eq(e.state.selection),s=!t?.doc.eq(e.state.doc);this.updateHandler(e,i,s,t)}getShouldShow(e){var t;const{state:n}=this.view,{selection:o}=n,{ranges:i}=o,s=Math.min(...i.map(r=>r.$from.pos)),l=Math.max(...i.map(r=>r.$to.pos));return((t=this.shouldShow)===null||t===void 0?void 0:t.call(this,{editor:this.editor,element:this.element,view:this.view,state:n,oldState:e,from:s,to:l}))||!1}show(){var e;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const t=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(e=t??this.view.dom.parentElement)===null||e===void 0||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}updateOptions(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.getReferencedVirtualElement!==void 0&&(this.getReferencedVirtualElement=e.getReferencedVirtualElement),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){var t;const n=(t=e.options.scrollTarget)!==null&&t!==void 0?t:window;n!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=n,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}};const Be=e=>new W({key:typeof e.pluginKey=="string"?new $(e.pluginKey):e.pluginKey,view:t=>new Bt({view:t,...e})});be.create({name:"bubbleMenu",addOptions(){return{element:null,pluginKey:"bubbleMenu",updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Be({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,options:this.options.options,appendTo:this.options.appendTo,getReferencedVirtualElement:this.options.getReferencedVirtualElement,shouldShow:this.options.shouldShow})]:[]}});var Vt=class{getTextContent(e){return Ye(e,{textSerializers:Ge(this.editor.schema)})}get middlewares(){const e=[];return this.floatingUIOptions.flip&&e.push(ye(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&e.push(Ce(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&e.push(Se(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&e.push(Re(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(Ee(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&e.push(Te(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&e.push(Oe(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&e.push(Ae(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),e}constructor({editor:e,element:t,view:n,pluginKey:o="floatingMenu",updateDelay:i=250,resizeDelay:s=60,options:l,appendTo:r,shouldShow:a}){var c;this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.shouldShow=({view:u,state:d})=>{const{selection:h}=d,{$anchor:f,empty:p}=h,g=f.depth===1,m=f.parent.isTextblock&&!f.parent.type.spec.code&&!f.parent.textContent&&f.parent.childCount===0&&!this.getTextContent(f.parent);return!(!u.hasFocus()||!p||!g||!m||!this.editor.isEditable)},this.floatingUIOptions={strategy:"absolute",placement:"right",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1},this.updateHandler=(u,d,h,f)=>{const{composing:p}=u;if(!(p||!d&&!h)){if(!this.getShouldShow(f)){this.hide();return}this.updatePosition(),this.show()}},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:u})=>{var d;if(this.preventHide){this.preventHide=!1;return}u?.relatedTarget&&(!((d=this.element.parentNode)===null||d===void 0)&&d.contains(u.relatedTarget))||u?.relatedTarget!==this.editor.view.dom&&this.hide()},this.transactionHandler=({transaction:u})=>{const d=u.getMeta(this.pluginKey);d==="updatePosition"?this.updatePosition():d&&typeof d=="object"&&d.type==="updateOptions"?this.updateOptions(d.options):d==="hide"?this.hide():d==="show"&&(this.updatePosition(),this.show())},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.editor=e,this.element=t,this.view=n,this.pluginKey=o,this.updateDelay=i,this.resizeDelay=s,this.appendTo=r,this.scrollTarget=(c=l?.scrollTarget)!==null&&c!==void 0?c:window,this.floatingUIOptions={...this.floatingUIOptions,...l},this.element.tabIndex=0,a&&(this.shouldShow=a),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}getShouldShow(e){var t;const{state:n}=this.view,{selection:o}=n,{ranges:i}=o,s=Math.min(...i.map(r=>r.$from.pos)),l=Math.max(...i.map(r=>r.$to.pos));return(t=this.shouldShow)===null||t===void 0?void 0:t.call(this,{editor:this.editor,view:this.view,state:n,oldState:e,from:s,to:l})}updateOptions(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){var t;const n=(t=e.options.scrollTarget)!==null&&t!==void 0?t:window;n!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=n,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}updatePosition(){var e;if(!(!((e=this.view)===null||e===void 0||(e=e.dom)===null||e===void 0)&&e.parentNode))return;const{selection:t}=this.editor.state,n=we(this.view,t.from,t.to);Ie({getBoundingClientRect:()=>n,getClientRects:()=>[n]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:o,y:i,strategy:s,middlewareData:l})=>{var r,a;if(!((r=l.hide)===null||r===void 0)&&r.referenceHidden||!((a=l.hide)===null||a===void 0)&&a.escaped){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=s,this.element.style.left=`${o}px`,this.element.style.top=`${i}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(e,t){const n=!t?.selection.eq(e.state.selection),o=!t?.doc.eq(e.state.doc);this.updateHandler(e,n,o,t)}show(){var e;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const t=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(e=t??this.view.dom.parentElement)===null||e===void 0||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}};const Ve=e=>new W({key:typeof e.pluginKey=="string"?new $(e.pluginKey):e.pluginKey,view:t=>new Vt({view:t,...e})});be.create({name:"floatingMenu",addOptions(){return{element:null,options:{},pluginKey:"floatingMenu",updateDelay:void 0,resizeDelay:void 0,appendTo:void 0,shouldShow:null}},addCommands(){return{updateFloatingMenuPosition:()=>({tr:e,dispatch:t})=>(t&&e.setMeta(this.options.pluginKey,"updatePosition"),!0)}},addProseMirrorPlugins(){return this.options.element?[Ve({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,resizeDelay:this.options.resizeDelay,options:this.options.options,appendTo:this.options.appendTo,shouldShow:this.options.shouldShow})]:[]}});function Ke(e,t){return e??new $(t)}const Kt=typeof window<"u"?C.useLayoutEffect:C.useEffect,_e=new Set(["left","opacity","position","top","visibility","width"]),_t=new Set(["animationIterationCount","aspectRatio","borderImageOutset","borderImageSlice","borderImageWidth","columnCount","columns","fillOpacity","flex","flexGrow","flexShrink","fontWeight","gridArea","gridColumn","gridColumnEnd","gridColumnStart","gridRow","gridRowEnd","gridRowStart","lineClamp","lineHeight","opacity","order","orphans","scale","stopOpacity","strokeDasharray","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth","tabSize","widows","zIndex","zoom"]),kt=new Set(["children","className","style"]),Ft=new Set(["tabIndex"]),Wt=new Set(["accessKey","autoCapitalize","contentEditable","contextMenu","dir","draggable","enterKeyHint","hidden","id","lang","nonce","role","slot","spellCheck","tabIndex","title","translate"]),jt={Blur:"focusout",DoubleClick:"dblclick",Focus:"focusin",MouseEnter:"mouseenter",MouseLeave:"mouseleave"};function oe(e,t){return/^on[A-Z]/.test(e)&&typeof t=="function"}function qt(e){return e.startsWith("aria-")||e.startsWith("data-"),e}function Xt(e){return e.startsWith("aria-")||e.startsWith("data-")||Wt.has(e)}function ke(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Yt(e){var t;const n=e.endsWith("Capture"),o=(n?e.slice(0,-7):e).slice(2);return{eventName:(t=jt[o])!==null&&t!==void 0?t:o.toLowerCase(),options:n?{capture:!0}:void 0}}function Gt(e,t){let n=t.defaultPrevented,o=!1;const i=Object.create(t);return Object.defineProperties(i,{nativeEvent:{value:t},currentTarget:{value:e},target:{value:t.target},persist:{value:()=>{}},isDefaultPrevented:{value:()=>n},isPropagationStopped:{value:()=>o},preventDefault:{value:()=>{n=!0,t.preventDefault()}},stopPropagation:{value:()=>{o=!0,t.stopPropagation()}}}),i}function Y(e){return Ft.has(e)}function ge(e,t,n){if(t==="tabIndex"){e.tabIndex=Number(n);return}e[t]=n}function Jt(e,t){if(t==="tabIndex"){e.removeAttribute("tabindex");return}const n=e[t];if(typeof n=="boolean"){e[t]=!1;return}if(typeof n=="number"){e[t]=0;return}e[t]=""}function Zt(e,t){return typeof t!="number"||t===0||e.startsWith("--")||_t.has(e)?String(t):`${t}px`}function Qt(e,t){_e.has(t)||e.style.removeProperty(ke(t))}function en(e,t,n){_e.has(t)||e.style.setProperty(ke(t),Zt(t,n))}function tn(e,t,n){new Set([...Object.keys(t),...Object.keys(n)]).forEach(o=>{if(kt.has(o)||!Xt(o)||oe(o,t[o])||oe(o,n[o]))return;const i=t[o],s=n[o];if(i===s)return;const l=qt(o);if(s==null||s===!1){Y(o)&&Jt(e,o),e.removeAttribute(l);return}if(s===!0){Y(o)&&ge(e,o,!0),e.setAttribute(l,"");return}if(Y(o)){ge(e,o,s);return}e.setAttribute(l,String(s))})}function nn(e,t,n){if(t!==n){if(n){e.className=n;return}e.removeAttribute("class")}}function on(e,t,n){const o=t??{},i=n??{};new Set([...Object.keys(o),...Object.keys(i)]).forEach(s=>{const l=o[s],r=i[s];if(l!==r){if(r==null){Qt(e,s);return}en(e,s,r)}})}function sn(e,t,n){t.forEach(({eventName:i,listener:s,options:l})=>{e.removeEventListener(i,s,l)});const o=[];return Object.entries(n).forEach(([i,s])=>{if(!oe(i,s))return;const{eventName:l,options:r}=Yt(i),a=c=>{s(Gt(e,c))};e.addEventListener(l,a,r),o.push({eventName:l,listener:a,options:r})}),o}function Fe(e,t){const n=C.useRef({}),o=C.useRef([]);Kt(()=>{const i=n.current;return nn(e,i.className,t.className),on(e,i.style,t.style),tn(e,i,t),o.current=sn(e,o.current,t),n.current=t,()=>{o.current.forEach(({eventName:s,listener:l,options:r})=>{e.removeEventListener(s,l,r)}),o.current=[]}},[e,t])}const Sn=Me.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:o,appendTo:i,shouldShow:s=null,getReferencedVirtualElement:l,options:r,children:a,...c},u)=>{const d=C.useRef(document.createElement("div")),h=C.useRef(Ke(e,"bubbleMenu")).current;Fe(d.current,c),typeof u=="function"?u(d.current):u&&(u.current=d.current);const{editor:f}=ve(),p=t||f,g={updateDelay:n,resizeDelay:o,appendTo:i,pluginKey:h,shouldShow:s,getReferencedVirtualElement:l,options:r},m=C.useRef(g);m.current=g;const[w,R]=C.useState(!1),y=C.useRef(!0);return C.useEffect(()=>{if(p?.isDestroyed)return;if(!p){console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");return}const T=d.current;T.style.visibility="hidden",T.style.position="absolute";const O=Be({...m.current,editor:p,element:T});p.registerPlugin(O);const L=m.current.pluginKey;return y.current=!0,R(!0),()=>{R(!1),p.unregisterPlugin(L),window.requestAnimationFrame(()=>{T.parentNode&&T.parentNode.removeChild(T)})}},[p]),C.useEffect(()=>{if(!(!w||!p||p.isDestroyed)){if(y.current){y.current=!1;return}p.view.dispatch(p.state.tr.setMeta(h,{type:"updateOptions",options:m.current}))}},[w,p,n,o,s,r,i,l,h]),ze.createPortal(a,d.current)});Me.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:o,appendTo:i,shouldShow:s=null,options:l,children:r,...a},c)=>{const u=C.useRef(document.createElement("div")),d=C.useRef(Ke(e,"floatingMenu")).current;Fe(u.current,a),typeof c=="function"?c(u.current):c&&(c.current=u.current);const{editor:h}=ve(),f=t||h,p={updateDelay:n,resizeDelay:o,appendTo:i,pluginKey:d,shouldShow:s,options:l},g=C.useRef(p);g.current=p;const[m,w]=C.useState(!1),R=C.useRef(!0);return C.useEffect(()=>{if(f?.isDestroyed)return;if(!f){console.warn("FloatingMenu component is not rendered inside of an editor component or does not have editor prop.");return}const y=u.current;y.style.visibility="hidden",y.style.position="absolute";const T=Ve({...g.current,editor:f,element:y});f.registerPlugin(T);const O=g.current.pluginKey;return R.current=!0,w(!0),()=>{w(!1),f.unregisterPlugin(O),window.requestAnimationFrame(()=>{y.parentNode&&y.parentNode.removeChild(y)})}},[f]),C.useEffect(()=>{if(!(!m||!f||f.isDestroyed)){if(R.current){R.current=!1;return}f.view.dispatch(f.state.tr.setMeta(d,{type:"updateOptions",options:g.current}))}},[m,f,n,o,s,l,i,d]),ze.createPortal(r,u.current)});export{Sn as B,b as C,gn as a,wn as b,yn as c,se as d,vn as e,ut as f,bn as g,fn as h,hn as i,un as j,dn as k,cn as l,pn as m,an as n,mn as s,Cn as t};
1
+ import{n as $,x as D,_ as We,T as H,$ as je,a0 as I,a1 as U,o as W,a2 as G,a3 as J,a4 as me,a5 as qe,a6 as we,a7 as Xe,E as be,a8 as Ye,a9 as Ge,e as ve}from"./usage-stats-XZL_1T4w.js";import{eQ as ye,fv as Ce,eP as Se,fw as Re,fx as Ee,fy as Te,fz as Oe,fA as Ae,eS as Ie,d$ as Me,r as C,b4 as ze}from"./index-CNWJYHvX.js";let Z,Q;if(typeof WeakMap<"u"){let e=new WeakMap;Z=t=>e.get(t),Q=(t,n)=>(e.set(t,n),n)}else{const e=[];let n=0;Z=o=>{for(let i=0;i<e.length;i+=2)if(e[i]==o)return e[i+1]},Q=(o,i)=>(n==10&&(n=0),e[n++]=o,e[n++]=i)}var v=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,i=t/this.width|0;let s=o+1,l=i+1;for(let r=1;s<this.width&&this.map[t+r]==n;r++)s++;for(let r=1;l<this.height&&this.map[t+this.width*r]==n;r++)l++;return{left:o,top:i,right:s,bottom:l}}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:i,top:s,bottom:l}=this.findCell(e);return t=="horiz"?(n<0?o==0:i==this.width)?null:this.map[s*this.width+(n<0?o-1:i)]:(n<0?s==0:l==this.height)?null:this.map[o+this.width*(n<0?s-1:l)]}rectBetween(e,t){const{left:n,right:o,top:i,bottom:s}=this.findCell(e),{left:l,right:r,top:a,bottom:c}=this.findCell(t);return{left:Math.min(n,l),top:Math.min(i,a),right:Math.max(o,r),bottom:Math.max(s,c)}}cellsInRect(e){const t=[],n={};for(let o=e.top;o<e.bottom;o++)for(let i=e.left;i<e.right;i++){const s=o*this.width+i,l=this.map[s];n[l]||(n[l]=!0,!(i==e.left&&i&&this.map[s-1]==l||o==e.top&&o&&this.map[s-this.width]==l)&&t.push(l))}return t}positionAt(e,t,n){for(let o=0,i=0;;o++){const s=i+n.child(o).nodeSize;if(o==e){let l=t+e*this.width;const r=(e+1)*this.width;for(;l<r&&this.map[l]<i;)l++;return l==r?s-1:this.map[l]}i=s}}static get(e){return Z(e)||Q(e,Je(e))}};function Je(e){if(e.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+e.type.name);const t=Ze(e),n=e.childCount,o=[];let i=0,s=null;const l=[];for(let c=0,u=t*n;c<u;c++)o[c]=0;for(let c=0,u=0;c<n;c++){const d=e.child(c);u++;for(let p=0;;p++){for(;i<o.length&&o[i]!=0;)i++;if(p==d.childCount)break;const g=d.child(p),{colspan:m,rowspan:w,colwidth:R}=g.attrs;for(let y=0;y<w;y++){if(y+c>=n){(s||(s=[])).push({type:"overlong_rowspan",pos:u,n:w-y});break}const T=i+y*t;for(let O=0;O<m;O++){o[T+O]==0?o[T+O]=u:(s||(s=[])).push({type:"collision",row:c,pos:u,n:m-O});const L=R&&R[O];if(L){const B=(T+O)%t*2,q=l[B];q==null||q!=L&&l[B+1]==1?(l[B]=L,l[B+1]=1):q==L&&l[B+1]++}}}i+=m,u+=g.nodeSize}const h=(c+1)*t;let f=0;for(;i<h;)o[i++]==0&&f++;f&&(s||(s=[])).push({type:"missing",row:c,n:f}),u++}(t===0||n===0)&&(s||(s=[])).push({type:"zero_sized"});const r=new v(t,n,o,s);let a=!1;for(let c=0;!a&&c<l.length;c+=2)l[c]!=null&&l[c+1]<n&&(a=!0);return a&&Qe(r,l,e),r}function Ze(e){let t=-1,n=!1;for(let o=0;o<e.childCount;o++){const i=e.child(o);let s=0;if(n)for(let l=0;l<o;l++){const r=e.child(l);for(let a=0;a<r.childCount;a++){const c=r.child(a);l+c.attrs.rowspan>o&&(s+=c.attrs.colspan)}}for(let l=0;l<i.childCount;l++){const r=i.child(l);s+=r.attrs.colspan,r.attrs.rowspan>1&&(n=!0)}t==-1?t=s:t!=s&&(t=Math.max(t,s))}return t}function Qe(e,t,n){e.problems||(e.problems=[]);const o={};for(let i=0;i<e.map.length;i++){const s=e.map[i];if(o[s])continue;o[s]=!0;const l=n.nodeAt(s);if(!l)throw new RangeError(`No cell with offset ${s} found`);let r=null;const a=l.attrs;for(let c=0;c<a.colspan;c++){const u=t[(i+c)%e.width*2];u!=null&&(!a.colwidth||a.colwidth[c]!=u)&&((r||(r=et(a)))[c]=u)}r&&e.problems.unshift({type:"colwidth mismatch",pos:s,colwidth:r})}}function et(e){if(e.colwidth)return e.colwidth.slice();const t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function S(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(const n in e.nodes){const o=e.nodes[n],i=o.spec.tableRole;i&&(t[i]=o)}}return t}const x=new $("selectingCells");function N(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 tt(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 A(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=N(t.$head)||nt(t.$head);if(n)return n;throw new RangeError(`No cell found around position ${t.head}`)}function nt(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 ee(e){return e.parent.type.spec.tableRole=="row"&&!!e.nodeAfter}function ot(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 De(e,t,n){const o=e.node(-1),i=v.get(o),s=e.start(-1),l=i.nextCell(e.pos-s,t,n);return l==null?null:e.node(0).resolve(s+l)}function P(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(i=>i>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 i=0;i<n;i++)o.colwidth.splice(t,0,0)}return o}function it(e,t,n){const o=S(t.type.schema).header_cell;for(let i=0;i<e.height;i++)if(t.nodeAt(e.map[n+i*e.width]).type!=o)return!1;return!0}var b=class z extends D{constructor(t,n=t){const o=t.node(-1),i=v.get(o),s=t.start(-1),l=i.rectBetween(t.pos-s,n.pos-s),r=t.node(0),a=i.cellsInRect(l).filter(u=>u!=n.pos-s);a.unshift(n.pos-s);const c=a.map(u=>{const d=o.nodeAt(u);if(!d)throw new RangeError(`No cell with offset ${u} found`);const h=s+u+1;return new je(r.resolve(h),r.resolve(h+d.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=t,this.$headCell=n}map(t,n){const o=t.resolve(n.map(this.$anchorCell.pos)),i=t.resolve(n.map(this.$headCell.pos));if(ee(o)&&ee(i)&&ie(o,i)){const s=this.$anchorCell.node(-1)!=o.node(-1);return s&&this.isRowSelection()?z.rowSelection(o,i):s&&this.isColSelection()?z.colSelection(o,i):new z(o,i)}return H.between(o,i)}content(){const t=this.$anchorCell.node(-1),n=v.get(t),o=this.$anchorCell.start(-1),i=n.rectBetween(this.$anchorCell.pos-o,this.$headCell.pos-o),s={},l=[];for(let a=i.top;a<i.bottom;a++){const c=[];for(let u=a*n.width+i.left,d=i.left;d<i.right;d++,u++){const h=n.map[u];if(s[h])continue;s[h]=!0;const f=n.findCell(h);let p=t.nodeAt(h);if(!p)throw new RangeError(`No cell with offset ${h} found`);const g=i.left-f.left,m=f.right-i.right;if(g>0||m>0){let w=p.attrs;if(g>0&&(w=P(w,0,g)),m>0&&(w=P(w,w.colspan-m,m)),f.left<i.left){if(p=p.type.createAndFill(w),!p)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(w)}`)}else p=p.type.create(w,p.content)}if(f.top<i.top||f.bottom>i.bottom){const w={...p.attrs,rowspan:Math.min(f.bottom,i.bottom)-Math.max(f.top,i.top)};f.top<i.top?p=p.type.createAndFill(w):p=p.type.create(w,p.content)}c.push(p)}l.push(t.child(a).copy(I.from(c)))}const r=this.isColSelection()&&this.isRowSelection()?t:l;return new U(I.from(r),1,1)}replace(t,n=U.empty){const o=t.steps.length,i=this.ranges;for(let l=0;l<i.length;l++){const{$from:r,$to:a}=i[l],c=t.mapping.slice(o);t.replace(c.map(r.pos),c.map(a.pos),l?U.empty:n)}const s=D.findFrom(t.doc.resolve(t.mapping.slice(o).map(this.to)),-1);s&&t.setSelection(s)}replaceWith(t,n){this.replace(t,new U(I.from(n),0,0))}forEachCell(t){const n=this.$anchorCell.node(-1),o=v.get(n),i=this.$anchorCell.start(-1),s=o.cellsInRect(o.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i));for(let l=0;l<s.length;l++)t(n.nodeAt(s[l]),i+s[l])}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,i=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(o,i)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){const o=t.node(-1),i=v.get(o),s=t.start(-1),l=i.findCell(t.pos-s),r=i.findCell(n.pos-s),a=t.node(0);return l.top<=r.top?(l.top>0&&(t=a.resolve(s+i.map[l.left])),r.bottom<i.height&&(n=a.resolve(s+i.map[i.width*(i.height-1)+r.right-1]))):(r.top>0&&(n=a.resolve(s+i.map[r.left])),l.bottom<i.height&&(t=a.resolve(s+i.map[i.width*(i.height-1)+l.right-1]))),new z(t,n)}isRowSelection(){const t=this.$anchorCell.node(-1),n=v.get(t),o=this.$anchorCell.start(-1),i=n.colCount(this.$anchorCell.pos-o),s=n.colCount(this.$headCell.pos-o);if(Math.min(i,s)>0)return!1;const l=i+this.$anchorCell.nodeAfter.attrs.colspan,r=s+this.$headCell.nodeAfter.attrs.colspan;return Math.max(l,r)==n.width}eq(t){return t instanceof z&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){const o=t.node(-1),i=v.get(o),s=t.start(-1),l=i.findCell(t.pos-s),r=i.findCell(n.pos-s),a=t.node(0);return l.left<=r.left?(l.left>0&&(t=a.resolve(s+i.map[l.top*i.width])),r.right<i.width&&(n=a.resolve(s+i.map[i.width*(r.top+1)-1]))):(r.left>0&&(n=a.resolve(s+i.map[r.top*i.width])),l.right<i.width&&(t=a.resolve(s+i.map[i.width*(l.top+1)-1]))),new z(t,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new z(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,o=n){return new z(t.resolve(n),t.resolve(o))}getBookmark(){return new st(this.$anchorCell.pos,this.$headCell.pos)}};b.prototype.visible=!1;D.jsonID("cell",b);var st=class Ue{constructor(t,n){this.anchor=t,this.head=n}map(t){return new Ue(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):D.near(o,1)}};function lt(e){if(!(e.selection instanceof b))return null;const t=[];return e.selection.forEachCell((n,o)=>{t.push(J.node(o,o+n.nodeSize,{class:"selectedCell"}))}),G.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,i=e.depth;for(;i>=0&&!(e.after(i+1)<e.end(i));i--,n++);for(let s=t.depth;s>=0&&!(t.before(s+1)>t.start(s));s--,o--);return n==o&&/row|table/.test(e.node(i).type.spec.tableRole)}function at({$from:e,$to:t}){let n,o;for(let i=e.depth;i>0;i--){const s=e.node(i);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){n=s;break}}for(let i=t.depth;i>0;i--){const s=t.node(i);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){o=s;break}}return n!==o&&t.parentOffset===0}function ct(e,t,n){const o=(t||e).selection,i=(t||e).doc;let s,l;if(o instanceof me&&(l=o.node.type.spec.tableRole)){if(l=="cell"||l=="header_cell")s=b.create(i,o.from);else if(l=="row"){const r=i.resolve(o.from+1);s=b.rowSelection(r,r)}else if(!n){const r=v.get(o.node),a=o.from+1,c=a+r.map[r.width*r.height-1];s=b.create(i,a+1,c)}}else o instanceof H&&rt(o)?s=H.create(i,o.from):o instanceof H&&at(o)&&(s=H.create(i,o.$from.start(),o.$from.end()));return s&&(t||(t=e.tr)).setSelection(s),t}const dt=new $("fix-tables");function He(e,t,n,o){const i=e.childCount,s=t.childCount;e:for(let l=0,r=0;l<s;l++){const a=t.child(l);for(let c=r,u=Math.min(i,l+3);c<u;c++)if(e.child(c)==a){r=c+1,n+=a.nodeSize;continue e}o(a,n),r<i&&e.child(r).sameMarkup(a)?He(e.child(r),a,n+1,o):a.nodesBetween(0,a.content.size,o,n+1),n+=a.nodeSize}}function ut(e,t){let n;const o=(i,s)=>{i.type.spec.tableRole=="table"&&(n=ht(e,i,s,n))};return t?t.doc!=e.doc&&He(t.doc,e.doc,0,o):e.doc.descendants(o),n}function ht(e,t,n,o){const i=v.get(t);if(!i.problems)return o;o||(o=e.tr);const s=[];for(let a=0;a<i.height;a++)s.push(0);for(let a=0;a<i.problems.length;a++){const c=i.problems[a];if(c.type=="collision"){const u=t.nodeAt(c.pos);if(!u)continue;const d=u.attrs;for(let h=0;h<d.rowspan;h++)s[c.row+h]+=c.n;o.setNodeMarkup(o.mapping.map(n+1+c.pos),null,P(d,d.colspan-c.n,c.n))}else if(c.type=="missing")s[c.row]+=c.n;else if(c.type=="overlong_rowspan"){const u=t.nodeAt(c.pos);if(!u)continue;o.setNodeMarkup(o.mapping.map(n+1+c.pos),null,{...u.attrs,rowspan:u.attrs.rowspan-c.n})}else if(c.type=="colwidth mismatch"){const u=t.nodeAt(c.pos);if(!u)continue;o.setNodeMarkup(o.mapping.map(n+1+c.pos),null,{...u.attrs,colwidth:c.colwidth})}else if(c.type=="zero_sized"){const u=o.mapping.map(n);o.delete(u,u+t.nodeSize)}}let l,r;for(let a=0;a<s.length;a++)s[a]&&(l==null&&(l=a),r=a);for(let a=0,c=n+1;a<i.height;a++){const u=t.child(a),d=c+u.nodeSize,h=s[a];if(h>0){let f="cell";u.firstChild&&(f=u.firstChild.type.spec.tableRole);const p=[];for(let m=0;m<h;m++){const w=S(e.schema)[f].createAndFill();w&&p.push(w)}const g=(a==0||l==a-1)&&r==a?c+1:d-1;o.insert(o.mapping.map(g),p)}c=d}return o.setMeta(dt,{fixTables:!0})}function M(e){const t=e.selection,n=j(e),o=n.node(-1),i=n.start(-1),s=v.get(o);return{...t instanceof b?s.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):s.findCell(n.pos-i),tableStart:i,map:s,table:o}}function Ne(e,{map:t,tableStart:n,table:o},i){let s=i>0?-1:0;it(t,o,i+s)&&(s=i==0||i==t.width?null:0);for(let l=0;l<t.height;l++){const r=l*t.width+i;if(i>0&&i<t.width&&t.map[r-1]==t.map[r]){const a=t.map[r],c=o.nodeAt(a);e.setNodeMarkup(e.mapping.map(n+a),null,xe(c.attrs,i-t.colCount(a))),l+=c.attrs.rowspan-1}else{const a=s==null?S(o.type.schema).cell:o.nodeAt(t.map[r+s]).type,c=t.positionAt(l,i,o);e.insert(e.mapping.map(n+c),a.createAndFill())}}return e}function an(e,t){if(!A(e))return!1;if(t){const n=M(e);t(Ne(e.tr,n,n.left))}return!0}function cn(e,t){if(!A(e))return!1;if(t){const n=M(e);t(Ne(e.tr,n,n.right))}return!0}function ft(e,{map:t,table:n,tableStart:o},i){const s=e.mapping.maps.length;for(let l=0;l<t.height;){const r=l*t.width+i,a=t.map[r],c=n.nodeAt(a),u=c.attrs;if(i>0&&t.map[r-1]==a||i<t.width-1&&t.map[r+1]==a)e.setNodeMarkup(e.mapping.slice(s).map(o+a),null,P(u,i-t.colCount(a)));else{const d=e.mapping.slice(s).map(o+a);e.delete(d,d+c.nodeSize)}l+=u.rowspan}}function dn(e,t){if(!A(e))return!1;if(t){const n=M(e),o=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let i=n.right-1;ft(o,n,i),i!=n.left;i--){const s=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!s)throw new RangeError("No table found");n.table=s,n.map=v.get(s)}t(o)}return!0}function pt(e,t,n){var o;const i=S(t.type.schema).header_cell;for(let s=0;s<e.width;s++)if(((o=t.nodeAt(e.map[s+n*e.width]))===null||o===void 0?void 0:o.type)!=i)return!1;return!0}function Pe(e,{map:t,tableStart:n,table:o},i){let s=n;for(let c=0;c<i;c++)s+=o.child(c).nodeSize;const l=[];let r=i>0?-1:0;pt(t,o,i+r)&&(r=i==0||i==t.height?null:0);for(let c=0,u=t.width*i;c<t.width;c++,u++)if(i>0&&i<t.height&&t.map[u]==t.map[u-t.width]){const d=t.map[u],h=o.nodeAt(d).attrs;e.setNodeMarkup(n+d,null,{...h,rowspan:h.rowspan+1}),c+=h.colspan-1}else{var a;const d=r==null?S(o.type.schema).cell:(a=o.nodeAt(t.map[u+r*t.width]))===null||a===void 0?void 0:a.type,h=d?.createAndFill();h&&l.push(h)}return e.insert(s,S(o.type.schema).row.create(null,l)),e}function un(e,t){if(!A(e))return!1;if(t){const n=M(e);t(Pe(e.tr,n,n.top))}return!0}function hn(e,t){if(!A(e))return!1;if(t){const n=M(e);t(Pe(e.tr,n,n.bottom))}return!0}function gt(e,{map:t,table:n,tableStart:o},i){let s=0;for(let c=0;c<i;c++)s+=n.child(c).nodeSize;const l=s+n.child(i).nodeSize,r=e.mapping.maps.length;e.delete(s+o,l+o);const a=new Set;for(let c=0,u=i*t.width;c<t.width;c++,u++){const d=t.map[u];if(!a.has(d)){if(a.add(d),i>0&&d==t.map[u-t.width]){const h=n.nodeAt(d).attrs;e.setNodeMarkup(e.mapping.slice(r).map(d+o),null,{...h,rowspan:h.rowspan-1}),c+=h.colspan-1}else if(i<t.height&&d==t.map[u+t.width]){const h=n.nodeAt(d),f=h.attrs,p=h.type.create({...f,rowspan:h.attrs.rowspan-1},h.content),g=t.positionAt(i+1,c,n);e.insert(e.mapping.slice(r).map(o+g),p),c+=f.colspan-1}}}}function fn(e,t){if(!A(e))return!1;if(t){const n=M(e),o=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let i=n.bottom-1;gt(o,n,i),i!=n.top;i--){const s=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!s)throw new RangeError("No table found");n.table=s,n.map=v.get(n.table)}t(o)}return!0}function le(e){const t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function mt({width:e,height:t,map:n},o){let i=o.top*e+o.left,s=i,l=(o.bottom-1)*e+o.left,r=i+(o.right-o.left-1);for(let a=o.top;a<o.bottom;a++){if(o.left>0&&n[s]==n[s-1]||o.right<e&&n[r]==n[r+1])return!0;s+=e,r+=e}for(let a=o.left;a<o.right;a++){if(o.top>0&&n[i]==n[i-e]||o.bottom<t&&n[l]==n[l+e])return!0;i++,l++}return!1}function pn(e,t){const n=e.selection;if(!(n instanceof b)||n.$anchorCell.pos==n.$headCell.pos)return!1;const o=M(e),{map:i}=o;if(mt(i,o))return!1;if(t){const s=e.tr,l={};let r=I.empty,a,c;for(let u=o.top;u<o.bottom;u++)for(let d=o.left;d<o.right;d++){const h=i.map[u*i.width+d],f=o.table.nodeAt(h);if(!(l[h]||!f))if(l[h]=!0,a==null)a=h,c=f;else{le(f)||(r=r.append(f.content));const p=s.mapping.map(h+o.tableStart);s.delete(p,p+f.nodeSize)}}if(a==null||c==null)return!0;if(s.setNodeMarkup(a+o.tableStart,null,{...xe(c.attrs,c.attrs.colspan,o.right-o.left-c.attrs.colspan),rowspan:o.bottom-o.top}),r.size>0){const u=a+1+c.content.size,d=le(c)?a+1:u;s.replaceWith(d+o.tableStart,u+o.tableStart,r)}s.setSelection(new b(s.doc.resolve(a+o.tableStart))),t(s)}return!0}function gn(e,t){const n=S(e.schema);return wt(({node:o})=>n[o.type.spec.tableRole])(e,t)}function wt(e){return(t,n)=>{const o=t.selection;let i,s;if(o instanceof b){if(o.$anchorCell.pos!=o.$headCell.pos)return!1;i=o.$anchorCell.nodeAfter,s=o.$anchorCell.pos}else{var l;if(i=tt(o.$from),!i)return!1;s=(l=N(o.$from))===null||l===void 0?void 0:l.pos}if(i==null||s==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(n){let r=i.attrs;const a=[],c=r.colwidth;r.rowspan>1&&(r={...r,rowspan:1}),r.colspan>1&&(r={...r,colspan:1});const u=M(t),d=t.tr;for(let f=0;f<u.right-u.left;f++)a.push(c?{...r,colwidth:c&&c[f]?[c[f]]:null}:r);let h;for(let f=u.top;f<u.bottom;f++){let p=u.map.positionAt(f,u.left,u.table);f==u.top&&(p+=i.nodeSize);for(let g=u.left,m=0;g<u.right;g++,m++)g==u.left&&f==u.top||d.insert(h=d.mapping.map(p+u.tableStart,1),e({node:i,row:f,col:g}).createAndFill(a[m]))}d.setNodeMarkup(s,e({node:i,row:u.top,col:u.left}),a[0]),o instanceof b&&d.setSelection(new b(d.doc.resolve(o.$anchorCell.pos),h?d.doc.resolve(h):void 0)),n(d)}return!0}}function mn(e,t){return function(n,o){if(!A(n))return!1;const i=j(n);if(i.nodeAfter.attrs[e]===t)return!1;if(o){const s=n.tr;n.selection instanceof b?n.selection.forEachCell((l,r)=>{l.attrs[e]!==t&&s.setNodeMarkup(r,null,{...l.attrs,[e]:t})}):s.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[e]:t}),o(s)}return!0}}function bt(e){return function(t,n){if(!A(t))return!1;if(n){const o=S(t.schema),i=M(t),s=t.tr,l=i.map.cellsInRect(e=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:e=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),r=l.map(a=>i.table.nodeAt(a));for(let a=0;a<l.length;a++)r[a].type==o.header_cell&&s.setNodeMarkup(i.tableStart+l[a],o.cell,r[a].attrs);if(s.steps.length===0)for(let a=0;a<l.length;a++)s.setNodeMarkup(i.tableStart+l[a],o.header_cell,r[a].attrs);n(s)}return!0}}function re(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 i=0;i<o.length;i++){const s=t.table.nodeAt(o[i]);if(s&&s.type!==n.header_cell)return!1}return!0}function se(e,t){return t=t||{useDeprecatedLogic:!1},t.useDeprecatedLogic?bt(e):function(n,o){if(!A(n))return!1;if(o){const i=S(n.schema),s=M(n),l=n.tr,r=re("row",s,i),a=re("column",s,i),c=(e==="column"?r:e==="row"&&a)?1:0,u=e=="column"?{left:0,top:c,right:1,bottom:s.map.height}:e=="row"?{left:c,top:0,right:s.map.width,bottom:1}:s,d=e=="column"?a?i.cell:i.header_cell:e=="row"?r?i.cell:i.header_cell:i.cell;s.map.cellsInRect(u).forEach(h=>{const f=h+s.tableStart,p=l.doc.nodeAt(f);p&&l.setNodeMarkup(f,d,p.attrs)}),o(l)}return!0}}se("row",{useDeprecatedLogic:!0});se("column",{useDeprecatedLogic:!0});const wn=se("cell",{useDeprecatedLogic:!0});function vt(e,t){if(t<0){const n=e.nodeBefore;if(n)return e.pos-n.nodeSize;for(let o=e.index(-1)-1,i=e.before();o>=0;o--){const s=e.node(-1).child(o),l=s.lastChild;if(l)return i-1-l.nodeSize;i-=s.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),i=e.after();o<n.childCount;o++){const s=n.child(o);if(s.childCount)return i+1;i+=s.nodeSize}}return null}function bn(e){return function(t,n){if(!A(t))return!1;const o=vt(j(t),e);if(o==null)return!1;if(n){const i=t.doc.resolve(o);n(t.tr.setSelection(H.between(i,ot(i))).scrollIntoView())}return!0}}function vn(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 V(e,t){const n=e.selection;if(!(n instanceof b))return!1;if(t){const o=e.tr,i=S(e.schema).cell.createAndFill().content;n.forEachCell((s,l)=>{s.content.eq(i)||o.replace(o.mapping.map(l+1),o.mapping.map(l+s.nodeSize-1),new U(i,0,0))}),o.docChanged&&t(o)}return!0}function yt(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 i=t.child(0),s=i.type.spec.tableRole,l=i.type.schema,r=[];if(s=="row")for(let a=0;a<t.childCount;a++){let c=t.child(a).content;const u=a?0:Math.max(0,n-1),d=a<t.childCount-1?0:Math.max(0,o-1);(u||d)&&(c=te(S(l).row,new U(c,u,d)).content),r.push(c)}else if(s=="cell"||s=="header_cell")r.push(n||o?te(S(l).row,new U(t,n,o)).content:t);else return null;return Ct(l,r)}function Ct(e,t){const n=[];for(let i=0;i<t.length;i++){const s=t[i];for(let l=s.childCount-1;l>=0;l--){const{rowspan:r,colspan:a}=s.child(l).attrs;for(let c=i;c<i+r;c++)n[c]=(n[c]||0)+a}}let o=0;for(let i=0;i<n.length;i++)o=Math.max(o,n[i]);for(let i=0;i<n.length;i++)if(i>=t.length&&t.push(I.empty),n[i]<o){const s=S(e).cell.createAndFill(),l=[];for(let r=n[i];r<o;r++)l.push(s);t[i]=t[i].append(I.from(l))}return{height:t.length,width:o,rows:t}}function te(e,t){const n=e.createAndFill();return new qe(n).replace(0,n.content.size,t).doc}function St({width:e,height:t,rows:n},o,i){if(e!=o){const s=[],l=[];for(let r=0;r<n.length;r++){const a=n[r],c=[];for(let u=s[r]||0,d=0;u<o;d++){let h=a.child(d%a.childCount);u+h.attrs.colspan>o&&(h=h.type.createChecked(P(h.attrs,h.attrs.colspan,u+h.attrs.colspan-o),h.content)),c.push(h),u+=h.attrs.colspan;for(let f=1;f<h.attrs.rowspan;f++)s[r+f]=(s[r+f]||0)+h.attrs.colspan}l.push(I.from(c))}n=l,e=o}if(t!=i){const s=[];for(let l=0,r=0;l<i;l++,r++){const a=[],c=n[r%t];for(let u=0;u<c.childCount;u++){let d=c.child(u);l+d.attrs.rowspan>i&&(d=d.type.create({...d.attrs,rowspan:Math.max(1,i-d.attrs.rowspan)},d.content)),a.push(d)}s.push(I.from(a))}n=s,t=i}return{width:e,height:t,rows:n}}function Rt(e,t,n,o,i,s,l){const r=e.doc.type.schema,a=S(r);let c,u;if(i>t.width)for(let d=0,h=0;d<t.height;d++){const f=n.child(d);h+=f.nodeSize;const p=[];let g;f.lastChild==null||f.lastChild.type==a.cell?g=c||(c=a.cell.createAndFill()):g=u||(u=a.header_cell.createAndFill());for(let m=t.width;m<i;m++)p.push(g);e.insert(e.mapping.slice(l).map(h-1+o),p)}if(s>t.height){const d=[];for(let p=0,g=(t.height-1)*t.width;p<Math.max(t.width,i);p++){const m=p>=t.width?!1:n.nodeAt(t.map[g+p]).type==a.header_cell;d.push(m?u||(u=a.header_cell.createAndFill()):c||(c=a.cell.createAndFill()))}const h=a.row.create(null,I.from(d)),f=[];for(let p=t.height;p<s;p++)f.push(h);e.insert(e.mapping.slice(l).map(o+n.nodeSize-2),f)}return!!(c||u)}function ae(e,t,n,o,i,s,l,r){if(l==0||l==t.height)return!1;let a=!1;for(let c=i;c<s;c++){const u=l*t.width+c,d=t.map[u];if(t.map[u-t.width]==d){a=!0;const h=n.nodeAt(d),{top:f,left:p}=t.findCell(d);e.setNodeMarkup(e.mapping.slice(r).map(d+o),null,{...h.attrs,rowspan:l-f}),e.insert(e.mapping.slice(r).map(t.positionAt(l,p,n)),h.type.createAndFill({...h.attrs,rowspan:f+h.attrs.rowspan-l})),c+=h.attrs.colspan-1}}return a}function ce(e,t,n,o,i,s,l,r){if(l==0||l==t.width)return!1;let a=!1;for(let c=i;c<s;c++){const u=c*t.width+l,d=t.map[u];if(t.map[u-1]==d){a=!0;const h=n.nodeAt(d),f=t.colCount(d),p=e.mapping.slice(r).map(d+o);e.setNodeMarkup(p,null,P(h.attrs,l-f,h.attrs.colspan-(l-f))),e.insert(p+h.nodeSize,h.type.createAndFill(P(h.attrs,0,l-f))),c+=h.attrs.rowspan-1}}return a}function de(e,t,n,o,i){let s=n?e.doc.nodeAt(n-1):e.doc;if(!s)throw new Error("No table found");let l=v.get(s);const{top:r,left:a}=o,c=a+i.width,u=r+i.height,d=e.tr;let h=0;function f(){if(s=n?d.doc.nodeAt(n-1):d.doc,!s)throw new Error("No table found");l=v.get(s),h=d.mapping.maps.length}Rt(d,l,s,n,c,u,h)&&f(),ae(d,l,s,n,a,c,r,h)&&f(),ae(d,l,s,n,a,c,u,h)&&f(),ce(d,l,s,n,r,u,a,h)&&f(),ce(d,l,s,n,r,u,c,h)&&f();for(let p=r;p<u;p++){const g=l.positionAt(p,a,s),m=l.positionAt(p,c,s);d.replace(d.mapping.slice(h).map(g+n),d.mapping.slice(h).map(m+n),new U(i.rows[p-r],0,0))}f(),d.setSelection(new b(d.doc.resolve(n+l.positionAt(r,a,s)),d.doc.resolve(n+l.positionAt(u-1,c-1,s)))),t(d)}const Et=We({ArrowLeft:K("horiz",-1),ArrowRight:K("horiz",1),ArrowUp:K("vert",-1),ArrowDown:K("vert",1),"Shift-ArrowLeft":_("horiz",-1),"Shift-ArrowRight":_("horiz",1),"Shift-ArrowUp":_("vert",-1),"Shift-ArrowDown":_("vert",1),Backspace:V,"Mod-Backspace":V,Delete:V,"Mod-Delete":V});function k(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function K(e,t){return(n,o,i)=>{if(!i)return!1;const s=n.selection;if(s instanceof b)return k(n,o,D.near(s.$headCell,t));if(e!="horiz"&&!s.empty)return!1;const l=Le(i,e,t);if(l==null)return!1;if(e=="horiz")return k(n,o,D.near(n.doc.resolve(s.head+t),t));{const r=n.doc.resolve(l),a=De(r,e,t);let c;return a?c=D.near(a,1):t<0?c=D.near(n.doc.resolve(r.before(-1)),-1):c=D.near(n.doc.resolve(r.after(-1)),1),k(n,o,c)}}}function _(e,t){return(n,o,i)=>{if(!i)return!1;const s=n.selection;let l;if(s instanceof b)l=s;else{const a=Le(i,e,t);if(a==null)return!1;l=new b(n.doc.resolve(a))}const r=De(l.$headCell,e,t);return r?k(n,o,new b(l.$anchorCell,r)):!1}}function Tt(e,t){const n=e.state.doc,o=N(n.resolve(t));return o?(e.dispatch(e.state.tr.setSelection(new b(o))),!0):!1}function Ot(e,t,n){if(!A(e.state))return!1;let o=yt(n);const i=e.state.selection;if(i instanceof b){o||(o={width:1,height:1,rows:[I.from(te(S(e.state.schema).cell,n))]});const s=i.$anchorCell.node(-1),l=i.$anchorCell.start(-1),r=v.get(s).rectBetween(i.$anchorCell.pos-l,i.$headCell.pos-l);return o=St(o,r.right-r.left,r.bottom-r.top),de(e.state,e.dispatch,l,r,o),!0}else if(o){const s=j(e.state),l=s.start(-1);return de(e.state,e.dispatch,l,v.get(s.node(-1)).findCell(s.pos-l),o),!0}else return!1}function At(e,t){var n;if(t.button!=0||t.ctrlKey||t.metaKey)return;const o=ue(e,t.target);let i;if(t.shiftKey&&e.state.selection instanceof b)s(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&o&&(i=N(e.state.selection.$anchor))!=null&&((n=X(e,t))===null||n===void 0?void 0:n.pos)!=i.pos)s(i,t),t.preventDefault();else if(!o)return;function s(a,c){let u=X(e,c);const d=x.getState(e.state)==null;if(!u||!ie(a,u))if(d)u=a;else return;const h=new b(a,u);if(d||!e.state.selection.eq(h)){const f=e.state.tr.setSelection(h);d&&f.setMeta(x,a.pos),e.dispatch(f)}}function l(){e.root.removeEventListener("mouseup",l),e.root.removeEventListener("dragstart",l),e.root.removeEventListener("mousemove",r),x.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(x,-1))}function r(a){const c=a,u=x.getState(e.state);let d;if(u!=null)d=e.state.doc.resolve(u);else if(ue(e,c.target)!=o&&(d=X(e,t),!d))return l();d&&s(d,c)}e.root.addEventListener("mouseup",l),e.root.addEventListener("dragstart",l),e.root.addEventListener("mousemove",r)}function Le(e,t,n){if(!(e.state.selection instanceof H))return null;const{$head:o}=e.state.selection;for(let i=o.depth-1;i>=0;i--){const s=o.node(i);if((n<0?o.index(i):o.indexAfter(i))!=(n<0?0:s.childCount))return null;if(s.type.spec.tableRole=="cell"||s.type.spec.tableRole=="header_cell"){const l=o.before(i),r=t=="vert"?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(r)?l:null}}return null}function ue(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName=="TD"||t.nodeName=="TH")return t;return null}function X(e,t){const n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:o,pos:i}=n;return o>=0&&N(e.state.doc.resolve(o))||N(e.state.doc.resolve(i))}var It=class{constructor(e,t){this.node=e,this.defaultCellMinWidth=t,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",`${t}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),ne(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,ne(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function ne(e,t,n,o,i,s){let l=0,r=!0,a=t.firstChild;const c=e.firstChild;if(c){for(let d=0,h=0;d<c.childCount;d++){const{colspan:f,colwidth:p}=c.child(d).attrs;for(let g=0;g<f;g++,h++){const m=i==h?s:p&&p[g],w=m?m+"px":"";if(l+=m||o,m||(r=!1),a)a.style.width!=w&&(a.style.width=w),a=a.nextSibling;else{const R=document.createElement("col");R.style.width=w,t.appendChild(R)}}}for(;a;){var u;const d=a.nextSibling;(u=a.parentNode)===null||u===void 0||u.removeChild(a),a=d}r?(n.style.width=l+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=l+"px")}}const E=new $("tableColumnResizing");function yn({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:o=It,lastColumnResizable:i=!0}={}){const s=new W({key:E,state:{init(l,r){var a;const c=(a=s.spec)===null||a===void 0||(a=a.props)===null||a===void 0?void 0:a.nodeViews,u=S(r.schema).table.name;return o&&c&&(c[u]=(d,h)=>new o(d,n,h)),new Mt(-1,!1)},apply(l,r){return r.apply(l)}},props:{attributes:l=>{const r=E.getState(l);return r&&r.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(l,r)=>{zt(l,r,e,i)},mouseleave:l=>{Dt(l)},mousedown:(l,r)=>{xt(l,r,t,n)}},decorations:l=>{const r=E.getState(l);if(r&&r.activeHandle>-1)return Lt(l,r.activeHandle)},nodeViews:{}}});return s}var Mt=class F{constructor(t,n){this.activeHandle=t,this.dragging=n}apply(t){const n=this,o=t.getMeta(E);if(o&&o.setHandle!=null)return new F(o.setHandle,!1);if(o&&o.setDragging!==void 0)return new F(n.activeHandle,o.setDragging);if(n.activeHandle>-1&&t.docChanged){let i=t.mapping.map(n.activeHandle,-1);return ee(t.doc.resolve(i))||(i=-1),new F(i,n.dragging)}return n}};function zt(e,t,n,o){if(!e.editable)return;const i=E.getState(e.state);if(i&&!i.dragging){const s=Ht(t.target);let l=-1;if(s){const{left:r,right:a}=s.getBoundingClientRect();t.clientX-r<=n?l=he(e,t,"left",n):a-t.clientX<=n&&(l=he(e,t,"right",n))}if(l!=i.activeHandle){if(!o&&l!==-1){const r=e.state.doc.resolve(l),a=r.node(-1),c=v.get(a),u=r.start(-1);if(c.colCount(r.pos-u)+r.nodeAfter.attrs.colspan-1==c.width-1)return}$e(e,l)}}}function Dt(e){if(!e.editable)return;const t=E.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&$e(e,-1)}function xt(e,t,n,o){var i;if(!e.editable)return!1;const s=(i=e.dom.ownerDocument.defaultView)!==null&&i!==void 0?i:window,l=E.getState(e.state);if(!l||l.activeHandle==-1||l.dragging)return!1;const r=e.state.doc.nodeAt(l.activeHandle),a=Ut(e,l.activeHandle,r.attrs);e.dispatch(e.state.tr.setMeta(E,{setDragging:{startX:t.clientX,startWidth:a}}));function c(d){s.removeEventListener("mouseup",c),s.removeEventListener("mousemove",u);const h=E.getState(e.state);h?.dragging&&(Nt(e,h.activeHandle,fe(h.dragging,d,n)),e.dispatch(e.state.tr.setMeta(E,{setDragging:null})))}function u(d){if(!d.which)return c(d);const h=E.getState(e.state);if(h&&h.dragging){const f=fe(h.dragging,d,n);pe(e,h.activeHandle,f,o)}}return pe(e,l.activeHandle,a,o),s.addEventListener("mouseup",c),s.addEventListener("mousemove",u),t.preventDefault(),!0}function Ut(e,t,{colspan:n,colwidth:o}){const i=o&&o[o.length-1];if(i)return i;const s=e.domAtPos(t);let l=s.node.childNodes[s.offset].offsetWidth,r=n;if(o)for(let a=0;a<n;a++)o[a]&&(l-=o[a],r--);return l/r}function Ht(e){for(;e&&e.nodeName!="TD"&&e.nodeName!="TH";)e=e.classList&&e.classList.contains("ProseMirror")?null:e.parentNode;return e}function he(e,t,n,o){const i=n=="right"?-o:o,s=e.posAtCoords({left:t.clientX+i,top:t.clientY});if(!s)return-1;const{pos:l}=s,r=N(e.state.doc.resolve(l));if(!r)return-1;if(n=="right")return r.pos;const a=v.get(r.node(-1)),c=r.start(-1),u=a.map.indexOf(r.pos-c);return u%a.width==0?-1:c+a.map[u-1]}function fe(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(E,{setHandle:t}))}function Nt(e,t,n){const o=e.state.doc.resolve(t),i=o.node(-1),s=v.get(i),l=o.start(-1),r=s.colCount(o.pos-l)+o.nodeAfter.attrs.colspan-1,a=e.state.tr;for(let c=0;c<s.height;c++){const u=c*s.width+r;if(c&&s.map[u]==s.map[u-s.width])continue;const d=s.map[u],h=i.nodeAt(d).attrs,f=h.colspan==1?0:r-s.colCount(d);if(h.colwidth&&h.colwidth[f]==n)continue;const p=h.colwidth?h.colwidth.slice():Pt(h.colspan);p[f]=n,a.setNodeMarkup(l+d,null,{...h,colwidth:p})}a.docChanged&&e.dispatch(a)}function pe(e,t,n,o){const i=e.state.doc.resolve(t),s=i.node(-1),l=i.start(-1),r=v.get(s).colCount(i.pos-l)+i.nodeAfter.attrs.colspan-1;let a=e.domAtPos(i.start(-1)).node;for(;a&&a.nodeName!="TABLE";)a=a.parentNode;a&&ne(s,a.firstChild,a,o,r,n)}function Pt(e){return Array(e).fill(0)}function Lt(e,t){const n=[],o=e.doc.resolve(t),i=o.node(-1);if(!i)return G.empty;const s=v.get(i),l=o.start(-1),r=s.colCount(o.pos-l)+o.nodeAfter.attrs.colspan-1;for(let c=0;c<s.height;c++){const u=r+c*s.width;if((r==s.width-1||s.map[u]!=s.map[u+1])&&(c==0||s.map[u]!=s.map[u-s.width])){var a;const d=s.map[u],h=l+d+i.nodeAt(d).nodeSize-1,f=document.createElement("div");f.className="column-resize-handle",!((a=E.getState(e))===null||a===void 0)&&a.dragging&&n.push(J.node(l+d,l+d+i.nodeAt(d).nodeSize,{class:"column-resize-dragging"})),n.push(J.widget(h,f))}}return G.create(e.doc,n)}function Cn({allowTableNodeSelection:e=!1}={}){return new W({key:x,state:{init(){return null},apply(t,n){const o=t.getMeta(x);if(o!=null)return o==-1?null:o;if(n==null||!t.docChanged)return n;const{deleted:i,pos:s}=t.mapping.mapResult(n);return i?null:s}},props:{decorations:lt,handleDOMEvents:{mousedown:At},createSelectionBetween(t){return x.getState(t.state)!=null?t.state.selection:null},handleTripleClick:Tt,handleKeyDown:Et,handlePaste:Ot},appendTransaction(t,n,o){return ct(o,ut(o,n),e)}})}function $t(e,t){const n=Math.min(e.top,t.top),o=Math.max(e.bottom,t.bottom),i=Math.min(e.left,t.left),s=Math.max(e.right,t.right)-i,l=o-n;return new DOMRect(i,n,s,l)}var Bt=class{get middlewares(){const e=[];return this.floatingUIOptions.flip&&e.push(ye(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&e.push(Ce(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&e.push(Se(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&e.push(Re(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(Ee(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&e.push(Te(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&e.push(Oe(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&e.push(Ae(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),e}get virtualElement(){var e,t;const{selection:n}=this.editor.state,o=(e=this.getReferencedVirtualElement)===null||e===void 0?void 0:e.call(this);if(o)return o;if(!(!((t=this.view)===null||t===void 0||(t=t.dom)===null||t===void 0)&&t.parentNode))return;const i=we(this.view,n.from,n.to);let s={getBoundingClientRect:()=>i,getClientRects:()=>[i]};if(n instanceof me){let l=this.view.nodeDOM(n.from);const r=l.dataset.nodeViewWrapper?l:l.querySelector("[data-node-view-wrapper]");r&&(l=r),l&&(s={getBoundingClientRect:()=>l.getBoundingClientRect(),getClientRects:()=>[l.getBoundingClientRect()]})}if(n instanceof b){const{$anchorCell:l,$headCell:r}=n,a=l?l.pos:r.pos,c=r?r.pos:l.pos,u=this.view.nodeDOM(a),d=this.view.nodeDOM(c);if(!u||!d)return;const h=u===d?u.getBoundingClientRect():$t(u.getBoundingClientRect(),d.getBoundingClientRect());s={getBoundingClientRect:()=>h,getClientRects:()=>[h]}}return s}constructor({editor:e,element:t,view:n,pluginKey:o="bubbleMenu",updateDelay:i=250,resizeDelay:s=60,shouldShow:l,appendTo:r,getReferencedVirtualElement:a,options:c}){var u;this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.floatingUIOptions={strategy:"absolute",placement:"top",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1,onShow:void 0,onHide:void 0,onUpdate:void 0,onDestroy:void 0},this.shouldShow=({view:d,state:h,from:f,to:p})=>{const{doc:g,selection:m}=h,{empty:w}=m,R=!g.textBetween(f,p).length&&Xe(h.selection),y=this.element.contains(document.activeElement);return!(!(d.hasFocus()||y)||w||R||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:d})=>{var h;if(this.editor.isDestroyed){this.destroy();return}if(this.preventHide){this.preventHide=!1;return}d?.relatedTarget&&(!((h=this.element.parentNode)===null||h===void 0)&&h.contains(d.relatedTarget))||d?.relatedTarget!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(d,h)=>{const f=!h?.selection.eq(d.state.selection),p=!h?.doc.eq(d.state.doc);!f&&!p||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(d,f,p,h)},this.updateDelay))},this.updateHandler=(d,h,f,p)=>{const{composing:g}=d;if(!(g||!h&&!f)){if(!this.getShouldShow(p)){this.hide();return}this.show(),this.updatePosition()}},this.transactionHandler=({transaction:d})=>{const h=d.getMeta(this.pluginKey);h==="updatePosition"?this.updatePosition():h&&typeof h=="object"&&h.type==="updateOptions"?this.updateOptions(h.options):h==="hide"?this.hide():h==="show"&&(this.updatePosition(),this.show())},this.editor=e,this.element=t,this.view=n,this.pluginKey=o,this.updateDelay=i,this.resizeDelay=s,this.appendTo=r,this.scrollTarget=(u=c?.scrollTarget)!==null&&u!==void 0?u:window,this.getReferencedVirtualElement=a,this.floatingUIOptions={...this.floatingUIOptions,...c},this.element.tabIndex=0,l&&(this.shouldShow=l),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}updatePosition(){if(!this.isVisible)return;const e=this.virtualElement;e&&Ie(e,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:t,y:n,strategy:o,middlewareData:i})=>{var s,l;if(!(!this.isVisible||this.editor.isDestroyed||!this.element.isConnected)){if(!((s=i.hide)===null||s===void 0)&&s.referenceHidden||!((l=i.hide)===null||l===void 0)&&l.escaped){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=o,this.element.style.left=`${t}px`,this.element.style.top=`${n}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()}})}update(e,t){const{state:n}=e,o=n.selection.from!==n.selection.to;if(this.updateDelay>0&&o){this.handleDebouncedUpdate(e,t);return}const i=!t?.selection.eq(e.state.selection),s=!t?.doc.eq(e.state.doc);this.updateHandler(e,i,s,t)}getShouldShow(e){var t;const{state:n}=this.view,{selection:o}=n,{ranges:i}=o,s=Math.min(...i.map(r=>r.$from.pos)),l=Math.max(...i.map(r=>r.$to.pos));return((t=this.shouldShow)===null||t===void 0?void 0:t.call(this,{editor:this.editor,element:this.element,view:this.view,state:n,oldState:e,from:s,to:l}))||!1}show(){var e;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const t=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(e=t??this.view.dom.parentElement)===null||e===void 0||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}updateOptions(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.getReferencedVirtualElement!==void 0&&(this.getReferencedVirtualElement=e.getReferencedVirtualElement),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){var t;const n=(t=e.options.scrollTarget)!==null&&t!==void 0?t:window;n!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=n,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}};const Be=e=>new W({key:typeof e.pluginKey=="string"?new $(e.pluginKey):e.pluginKey,view:t=>new Bt({view:t,...e})});be.create({name:"bubbleMenu",addOptions(){return{element:null,pluginKey:"bubbleMenu",updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Be({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,options:this.options.options,appendTo:this.options.appendTo,getReferencedVirtualElement:this.options.getReferencedVirtualElement,shouldShow:this.options.shouldShow})]:[]}});var Vt=class{getTextContent(e){return Ye(e,{textSerializers:Ge(this.editor.schema)})}get middlewares(){const e=[];return this.floatingUIOptions.flip&&e.push(ye(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&e.push(Ce(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&e.push(Se(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&e.push(Re(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(Ee(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&e.push(Te(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&e.push(Oe(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&e.push(Ae(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),e}constructor({editor:e,element:t,view:n,pluginKey:o="floatingMenu",updateDelay:i=250,resizeDelay:s=60,options:l,appendTo:r,shouldShow:a}){var c;this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.shouldShow=({view:u,state:d})=>{const{selection:h}=d,{$anchor:f,empty:p}=h,g=f.depth===1,m=f.parent.isTextblock&&!f.parent.type.spec.code&&!f.parent.textContent&&f.parent.childCount===0&&!this.getTextContent(f.parent);return!(!u.hasFocus()||!p||!g||!m||!this.editor.isEditable)},this.floatingUIOptions={strategy:"absolute",placement:"right",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1},this.updateHandler=(u,d,h,f)=>{const{composing:p}=u;if(!(p||!d&&!h)){if(!this.getShouldShow(f)){this.hide();return}this.updatePosition(),this.show()}},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:u})=>{var d;if(this.preventHide){this.preventHide=!1;return}u?.relatedTarget&&(!((d=this.element.parentNode)===null||d===void 0)&&d.contains(u.relatedTarget))||u?.relatedTarget!==this.editor.view.dom&&this.hide()},this.transactionHandler=({transaction:u})=>{const d=u.getMeta(this.pluginKey);d==="updatePosition"?this.updatePosition():d&&typeof d=="object"&&d.type==="updateOptions"?this.updateOptions(d.options):d==="hide"?this.hide():d==="show"&&(this.updatePosition(),this.show())},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.editor=e,this.element=t,this.view=n,this.pluginKey=o,this.updateDelay=i,this.resizeDelay=s,this.appendTo=r,this.scrollTarget=(c=l?.scrollTarget)!==null&&c!==void 0?c:window,this.floatingUIOptions={...this.floatingUIOptions,...l},this.element.tabIndex=0,a&&(this.shouldShow=a),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}getShouldShow(e){var t;const{state:n}=this.view,{selection:o}=n,{ranges:i}=o,s=Math.min(...i.map(r=>r.$from.pos)),l=Math.max(...i.map(r=>r.$to.pos));return(t=this.shouldShow)===null||t===void 0?void 0:t.call(this,{editor:this.editor,view:this.view,state:n,oldState:e,from:s,to:l})}updateOptions(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){var t;const n=(t=e.options.scrollTarget)!==null&&t!==void 0?t:window;n!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=n,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}updatePosition(){var e;if(!(!((e=this.view)===null||e===void 0||(e=e.dom)===null||e===void 0)&&e.parentNode))return;const{selection:t}=this.editor.state,n=we(this.view,t.from,t.to);Ie({getBoundingClientRect:()=>n,getClientRects:()=>[n]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:o,y:i,strategy:s,middlewareData:l})=>{var r,a;if(!((r=l.hide)===null||r===void 0)&&r.referenceHidden||!((a=l.hide)===null||a===void 0)&&a.escaped){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=s,this.element.style.left=`${o}px`,this.element.style.top=`${i}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(e,t){const n=!t?.selection.eq(e.state.selection),o=!t?.doc.eq(e.state.doc);this.updateHandler(e,n,o,t)}show(){var e;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const t=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(e=t??this.view.dom.parentElement)===null||e===void 0||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}};const Ve=e=>new W({key:typeof e.pluginKey=="string"?new $(e.pluginKey):e.pluginKey,view:t=>new Vt({view:t,...e})});be.create({name:"floatingMenu",addOptions(){return{element:null,options:{},pluginKey:"floatingMenu",updateDelay:void 0,resizeDelay:void 0,appendTo:void 0,shouldShow:null}},addCommands(){return{updateFloatingMenuPosition:()=>({tr:e,dispatch:t})=>(t&&e.setMeta(this.options.pluginKey,"updatePosition"),!0)}},addProseMirrorPlugins(){return this.options.element?[Ve({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,resizeDelay:this.options.resizeDelay,options:this.options.options,appendTo:this.options.appendTo,shouldShow:this.options.shouldShow})]:[]}});function Ke(e,t){return e??new $(t)}const Kt=typeof window<"u"?C.useLayoutEffect:C.useEffect,_e=new Set(["left","opacity","position","top","visibility","width"]),_t=new Set(["animationIterationCount","aspectRatio","borderImageOutset","borderImageSlice","borderImageWidth","columnCount","columns","fillOpacity","flex","flexGrow","flexShrink","fontWeight","gridArea","gridColumn","gridColumnEnd","gridColumnStart","gridRow","gridRowEnd","gridRowStart","lineClamp","lineHeight","opacity","order","orphans","scale","stopOpacity","strokeDasharray","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth","tabSize","widows","zIndex","zoom"]),kt=new Set(["children","className","style"]),Ft=new Set(["tabIndex"]),Wt=new Set(["accessKey","autoCapitalize","contentEditable","contextMenu","dir","draggable","enterKeyHint","hidden","id","lang","nonce","role","slot","spellCheck","tabIndex","title","translate"]),jt={Blur:"focusout",DoubleClick:"dblclick",Focus:"focusin",MouseEnter:"mouseenter",MouseLeave:"mouseleave"};function oe(e,t){return/^on[A-Z]/.test(e)&&typeof t=="function"}function qt(e){return e.startsWith("aria-")||e.startsWith("data-"),e}function Xt(e){return e.startsWith("aria-")||e.startsWith("data-")||Wt.has(e)}function ke(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Yt(e){var t;const n=e.endsWith("Capture"),o=(n?e.slice(0,-7):e).slice(2);return{eventName:(t=jt[o])!==null&&t!==void 0?t:o.toLowerCase(),options:n?{capture:!0}:void 0}}function Gt(e,t){let n=t.defaultPrevented,o=!1;const i=Object.create(t);return Object.defineProperties(i,{nativeEvent:{value:t},currentTarget:{value:e},target:{value:t.target},persist:{value:()=>{}},isDefaultPrevented:{value:()=>n},isPropagationStopped:{value:()=>o},preventDefault:{value:()=>{n=!0,t.preventDefault()}},stopPropagation:{value:()=>{o=!0,t.stopPropagation()}}}),i}function Y(e){return Ft.has(e)}function ge(e,t,n){if(t==="tabIndex"){e.tabIndex=Number(n);return}e[t]=n}function Jt(e,t){if(t==="tabIndex"){e.removeAttribute("tabindex");return}const n=e[t];if(typeof n=="boolean"){e[t]=!1;return}if(typeof n=="number"){e[t]=0;return}e[t]=""}function Zt(e,t){return typeof t!="number"||t===0||e.startsWith("--")||_t.has(e)?String(t):`${t}px`}function Qt(e,t){_e.has(t)||e.style.removeProperty(ke(t))}function en(e,t,n){_e.has(t)||e.style.setProperty(ke(t),Zt(t,n))}function tn(e,t,n){new Set([...Object.keys(t),...Object.keys(n)]).forEach(o=>{if(kt.has(o)||!Xt(o)||oe(o,t[o])||oe(o,n[o]))return;const i=t[o],s=n[o];if(i===s)return;const l=qt(o);if(s==null||s===!1){Y(o)&&Jt(e,o),e.removeAttribute(l);return}if(s===!0){Y(o)&&ge(e,o,!0),e.setAttribute(l,"");return}if(Y(o)){ge(e,o,s);return}e.setAttribute(l,String(s))})}function nn(e,t,n){if(t!==n){if(n){e.className=n;return}e.removeAttribute("class")}}function on(e,t,n){const o=t??{},i=n??{};new Set([...Object.keys(o),...Object.keys(i)]).forEach(s=>{const l=o[s],r=i[s];if(l!==r){if(r==null){Qt(e,s);return}en(e,s,r)}})}function sn(e,t,n){t.forEach(({eventName:i,listener:s,options:l})=>{e.removeEventListener(i,s,l)});const o=[];return Object.entries(n).forEach(([i,s])=>{if(!oe(i,s))return;const{eventName:l,options:r}=Yt(i),a=c=>{s(Gt(e,c))};e.addEventListener(l,a,r),o.push({eventName:l,listener:a,options:r})}),o}function Fe(e,t){const n=C.useRef({}),o=C.useRef([]);Kt(()=>{const i=n.current;return nn(e,i.className,t.className),on(e,i.style,t.style),tn(e,i,t),o.current=sn(e,o.current,t),n.current=t,()=>{o.current.forEach(({eventName:s,listener:l,options:r})=>{e.removeEventListener(s,l,r)}),o.current=[]}},[e,t])}const Sn=Me.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:o,appendTo:i,shouldShow:s=null,getReferencedVirtualElement:l,options:r,children:a,...c},u)=>{const d=C.useRef(document.createElement("div")),h=C.useRef(Ke(e,"bubbleMenu")).current;Fe(d.current,c),typeof u=="function"?u(d.current):u&&(u.current=d.current);const{editor:f}=ve(),p=t||f,g={updateDelay:n,resizeDelay:o,appendTo:i,pluginKey:h,shouldShow:s,getReferencedVirtualElement:l,options:r},m=C.useRef(g);m.current=g;const[w,R]=C.useState(!1),y=C.useRef(!0);return C.useEffect(()=>{if(p?.isDestroyed)return;if(!p){console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");return}const T=d.current;T.style.visibility="hidden",T.style.position="absolute";const O=Be({...m.current,editor:p,element:T});p.registerPlugin(O);const L=m.current.pluginKey;return y.current=!0,R(!0),()=>{R(!1),p.unregisterPlugin(L),window.requestAnimationFrame(()=>{T.parentNode&&T.parentNode.removeChild(T)})}},[p]),C.useEffect(()=>{if(!(!w||!p||p.isDestroyed)){if(y.current){y.current=!1;return}p.view.dispatch(p.state.tr.setMeta(h,{type:"updateOptions",options:m.current}))}},[w,p,n,o,s,r,i,l,h]),ze.createPortal(a,d.current)});Me.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:o,appendTo:i,shouldShow:s=null,options:l,children:r,...a},c)=>{const u=C.useRef(document.createElement("div")),d=C.useRef(Ke(e,"floatingMenu")).current;Fe(u.current,a),typeof c=="function"?c(u.current):c&&(c.current=u.current);const{editor:h}=ve(),f=t||h,p={updateDelay:n,resizeDelay:o,appendTo:i,pluginKey:d,shouldShow:s,options:l},g=C.useRef(p);g.current=p;const[m,w]=C.useState(!1),R=C.useRef(!0);return C.useEffect(()=>{if(f?.isDestroyed)return;if(!f){console.warn("FloatingMenu component is not rendered inside of an editor component or does not have editor prop.");return}const y=u.current;y.style.visibility="hidden",y.style.position="absolute";const T=Ve({...g.current,editor:f,element:y});f.registerPlugin(T);const O=g.current.pluginKey;return R.current=!0,w(!0),()=>{w(!1),f.unregisterPlugin(O),window.requestAnimationFrame(()=>{y.parentNode&&y.parentNode.removeChild(y)})}},[f]),C.useEffect(()=>{if(!(!m||!f||f.isDestroyed)){if(R.current){R.current=!1;return}f.view.dispatch(f.state.tr.setMeta(d,{type:"updateOptions",options:g.current}))}},[m,f,n,o,s,l,i,d]),ze.createPortal(r,u.current)});export{Sn as B,b as C,gn as a,wn as b,yn as c,se as d,vn as e,ut as f,bn as g,fn as h,hn as i,un as j,dn as k,cn as l,pn as m,an as n,mn as s,Cn as t};
@@ -1 +1 @@
1
- import{c as X,r as U,l as Y,j as i,b as J,B as we,a as me,t as oe,G as Me,au as pe,aw as ve,m as Ke,K as We,ae as Fe,a2 as Re,d as Be,E as Ge,L as Ne,Y as He,y as ge,aa as Ee,P as Xe}from"./index-B2TzlpQ3.js";import{u as ye,c as Te,i as qe,j as Ye,k as Ue,l as Je}from"./use-sidebar-collapsed-CFQZVlEf.js";import{S as Ve,a as Qe,b as Ze}from"./sheet-DJ-bT8ZN.js";import{u as et}from"./use-mobile-B3guCu1w.js";import{u as tt,a as st,D as nt,c as it,C as rt,P as ot}from"./core.esm-ELTg1p5B.js";import{S as lt,v as at,u as ct}from"./sortable.esm-C1Eh7IYA.js";import{i as dt}from"./Tool01-BE48oOYM.js";import{C as ut,A as ft,D as ze,E as ht}from"./agent-icon-DlDNTTdr.js";import{s as mt}from"./Plus-Bqqgzhs9.js";import{s as Ae}from"./XClose-Bowm5HJz.js";import{T as ce,a as de,c as ue}from"./tooltip-CPnhEOeb.js";import{C as be,f as gt,g as pt,e as xt}from"./context-menu-DytMQMuj.js";import{C as bt}from"./create-organization-dialog-OyCDluH-.js";import{P as jt}from"./project-apps-D81NGCcl.js";import{u as vt,a as yt}from"./use-recent-apps-BbY9Gh07.js";import{b as St}from"./use-navigate-to-agent-DzJ4GpEZ.js";import{u as wt,a as zt}from"./use-project-scope-DEadi158.js";import{i as Ot}from"./UserSquare-BQx0PoRd.js";import{C as Oe,e as Ct,b as _t,c as Rt,f as Nt}from"./command-De4hkzkI.js";import{u as Et}from"./use-debounced-value-vhxkuBRI.js";function Tt(t){let e=0;for(let o=0;o<t.length;o++)e=t.charCodeAt(o)+((e<<5)-e);const s=Math.abs(e)%360;return{backgroundColor:`hsl(${s} 55% 70%)`,color:`hsl(${s} 55% 20%)`}}const At={xs:{box:"size-5",text:"text-[9px]"},sm:{box:"size-6",text:"text-xs"},md:{box:"size-8",text:"text-sm"},lg:{box:"size-9",text:"text-sm"}};function Se(t){const e=X.c(14),{org:s,size:o,rounded:r}=t,l=o===void 0?"sm":o,n=r===void 0?"rounded-md":r,{box:a,text:c}=At[l],[u,p]=U.useState(null),m=s.logo&&s.logo!==u?s.logo:null;let h;e[0]!==n||e[1]!==a?(h=Y(a,n,"shrink-0 flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=n,e[1]=a,e[2]=h):h=e[2];let f;e[3]!==m||e[4]!==s.name?(f=m?void 0:Tt(s.name),e[3]=m,e[4]=s.name,e[5]=f):f=e[5];let d;e[6]!==m||e[7]!==s.name||e[8]!==c?(d=m?i.jsx("img",{src:m,alt:"",className:"size-full object-cover",onError:()=>p(m)}):i.jsx("span",{className:Y("font-semibold leading-none",c),children:s.name.slice(0,2).toUpperCase()}),e[6]=m,e[7]=s.name,e[8]=c,e[9]=d):d=e[9];let g;return e[10]!==h||e[11]!==f||e[12]!==d?(g=i.jsx("div",{className:h,style:f,children:d}),e[10]=h,e[11]=f,e[12]=d,e[13]=g):g=e[13],g}function Is({invitation:t,onChanged:e}){const s=J(),[o,r]=U.useState(!1),l=t.organizationName??s("header.orgSwitcher.unknownOrganization"),n=async()=>{r(!0);try{const u=await me.organization.acceptInvitation({invitationId:t.id});if(u.error){oe.error(u.error.message),r(!1);return}}catch{oe.error(s("header.orgSwitcher.failedToAcceptInvitation")),r(!1);return}oe.success(s("header.orgSwitcher.joined",{name:l})),Me();let c;try{c=(await me.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=c?`/${c}`:"/"},a=async()=>{r(!0);try{const c=await me.organization.rejectInvitation({invitationId:t.id});if(c.error){oe.error(c.error.message),r(!1);return}oe.success(s("header.orgSwitcher.invitationDeclined")),r(!1),e()}catch{oe.error(s("header.orgSwitcher.failedToDeclineInvitation")),r(!1)}};return i.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-dashed border-border px-3 py-2.5",children:[i.jsx(Se,{org:{name:l},size:"sm"}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("p",{className:"truncate text-sm font-medium",children:l}),i.jsx("p",{className:"truncate text-xs text-muted-foreground",children:s("header.orgSwitcher.invitedToJoin")})]}),i.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[i.jsx(we,{size:"sm",variant:"default",className:"h-7 text-xs",onClick:n,disabled:o,children:s("header.orgSwitcher.accept")}),i.jsx(we,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground",onClick:a,disabled:o,"aria-label":s("header.orgSwitcher.declineInvitationTo",{name:l}),children:i.jsx(Ae,{size:14})})]})]})}const It=3,Ie=10,Lt=440,kt=55;function Le(t){const e=Math.floor((t-Lt)/kt);return Math.min(Ie,Math.max(It,e))}function Pt(t,e,s=Ie*3,o=[]){return[...new Set([e,...o,...t])].slice(0,s)}function Dt(t,e){return!e.id||t.some(s=>s.slug===e.slug)?[...t]:[...t,e]}function $t(t,e,s,o,r=[]){if(t.length<=o)return{shown:[...t],hidden:[]};const l=new Map(t.map(a=>[a.slug,a])),n=new Set;s&&l.has(s)&&n.add(s);for(const a of r)l.has(a)&&n.add(a);for(const a of e){if(n.size>=o)break;l.has(a)&&n.add(a)}for(const a of t){if(n.size>=o)break;n.add(a.slug)}return{shown:t.filter(a=>n.has(a.slug)),hidden:t.filter(a=>!n.has(a.slug))}}const Ce=[];function Mt(){const t=X.c(6);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=ve.recentOrgs(),t[0]=e):e=t[0];const[s,o]=pe(e,Ce),r=Array.isArray(s)?s:Ce;let l;t[1]!==o?(l=(a,c)=>o(u=>Pt(Array.isArray(u)?u:[],a,void 0,c)),t[1]=o,t[2]=l):l=t[2];let n;return t[3]!==r||t[4]!==l?(n={recent:r,remember:l},t[3]=r,t[4]=l,t[5]=n):n=t[5],n}const ke={hidden:[],pinned:[],order:[]},ae=(t,e)=>t.filter(s=>s!==e);function le(t){if(typeof t!="object"||t===null)return ke;const e=o=>Array.isArray(o)?o.filter(r=>typeof r=="string"):[],s=t;return{hidden:e(s.hidden),pinned:e(s.pinned),order:e(s.order)}}function Kt(t,e){return{...t,hidden:[...ae(t.hidden,e),e],pinned:ae(t.pinned,e)}}function Wt(t,e){return{...t,hidden:ae(t.hidden,e)}}function Ft(t,e){return t.pinned.includes(e)?{...t,pinned:ae(t.pinned,e)}:{...t,hidden:ae(t.hidden,e),pinned:[...t.pinned,e]}}function Bt(t,e,s){const o=r=>{const l=e.order.indexOf(r);return l===-1?Number.MAX_SAFE_INTEGER:l};return t.filter(r=>r.slug===s||!e.hidden.includes(r.slug)).map((r,l)=>({org:r,index:l})).sort((r,l)=>Number(e.pinned.includes(l.org.slug))-Number(e.pinned.includes(r.org.slug))||o(r.org.slug)-o(l.org.slug)||r.index-l.index).map(({org:r})=>r)}function Gt(t,e,s,o){const r=e.indexOf(s),l=e.indexOf(o);if(r===-1||l===-1||r===l||t.pinned.includes(s)!==t.pinned.includes(o))return t;const n=[...e];return n.splice(r,1),n.splice(l,0,s),{...t,order:[...n,...t.order.filter(a=>!n.includes(a))]}}function xe(t){const e=X.c(11),{active:s,label:o,children:r}=t,l=s?"h-7 opacity-100":"h-2 opacity-0 group-hover/rail:opacity-60";let n;e[0]!==l?(n=Y("w-1 rounded-r-full bg-foreground","transition-[height,opacity] duration-200 ease-[var(--ease-out-cubic)]","motion-reduce:transition-none",l),e[0]=l,e[1]=n):n=e[1];let a;e[2]!==n?(a=i.jsx("span",{"aria-hidden":!0,className:"absolute top-0 -left-2.5 flex h-9 items-center",children:i.jsx("span",{className:n})}),e[2]=n,e[3]=a):a=e[3];let c;e[4]!==s||e[5]!==o?(c=o&&i.jsx("span",{"aria-hidden":!0,className:Y("line-clamp-2 w-full px-0.5 text-center text-2xs text-ellipsis transition-colors",s?"font-medium text-sidebar-foreground":"text-muted-foreground group-hover/rail:text-sidebar-foreground"),children:o}),e[4]=s,e[5]=o,e[6]=c):c=e[6];let u;return e[7]!==r||e[8]!==a||e[9]!==c?(u=i.jsxs("div",{className:"group/rail relative flex w-full shrink-0 flex-col items-center gap-1",children:[a,r,c]}),e[7]=r,e[8]=a,e[9]=c,e[10]=u):u=e[10],u}function Ht(t){const e=X.c(13),s=t.trim(),{data:o}=me.useSession(),r=o?.user?.id??"",l=s.length>0&&!!r,n=We.organizationSearch(r,s);let a;e[0]!==s?(a=async b=>{const{signal:O}=b,x=await fetch(`/api/_me/organizations/search?q=${encodeURIComponent(s)}`,{signal:O});if(!x.ok)throw new Error(`Organization search failed: ${x.status}`);return await x.json()},e[0]=s,e[1]=a):a=e[1];let c;e[2]!==l||e[3]!==n||e[4]!==a?(c={queryKey:n,queryFn:a,enabled:l,placeholderData:Fe,staleTime:3e4,retry:!1},e[2]=l,e[3]=n,e[4]=a,e[5]=c):c=e[5];const{data:u,isFetching:p,isPlaceholderData:m,isError:h}=Ke(c);let f;e[6]!==u?.items?(f=u?.items??[],e[6]=u?.items,e[7]=f):f=e[7];const d=l&&p,g=l&&m;let j;return e[8]!==h||e[9]!==f||e[10]!==d||e[11]!==g?(j={hits:f,isSearching:d,isStale:g,isError:h},e[8]=h,e[9]=f,e[10]=d,e[11]=g,e[12]=j):j=e[12],j}function Xt(t){const e=X.c(61),{orgs:s,currentSlug:o,hiddenCount:r,onSelect:l}=t,n=J(),[a,c]=U.useState(!1),[u,p]=U.useState("");let m;e[0]!==u?(m=u.trim(),e[0]=u,e[1]=m):m=e[1];const h=m,f=Et(h,150),d=h.length>0,g=f===h,{hits:j,isSearching:b,isStale:O,isError:x}=Ht(d?f:""),v=d?j:s;let z;e[2]===Symbol.for("react.memo_cache_sentinel")?(z=B=>{c(B),B||p("")},e[2]=z):z=e[2];const y=z;let S;e[3]!==n?(S=n("sidebar.rail.searchOrganizations"),e[3]=n,e[4]=S):S=e[4];let A;e[5]===Symbol.for("react.memo_cache_sentinel")?(A=()=>y(!0),e[5]=A):A=e[5];let w;e[6]===Symbol.for("react.memo_cache_sentinel")?(w=i.jsx(Ot,{size:18}),e[6]=w):w=e[6];let C;e[7]!==S?(C=i.jsx(ce,{asChild:!0,children:i.jsx("button",{type:"button","aria-label":S,onClick:A,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-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:w})}),e[7]=S,e[8]=C):C=e[8];let R;e[9]!==r||e[10]!==n?(R=r>0?n("sidebar.rail.searchMoreOrganizations",{count:r}):n("sidebar.rail.searchOrganizations"),e[9]=r,e[10]=n,e[11]=R):R=e[11];let N;e[12]!==R?(N=i.jsx(de,{side:"right",children:R}),e[12]=R,e[13]=N):N=e[13];let I;e[14]!==C||e[15]!==N?(I=i.jsx(xe,{active:!1,children:i.jsxs(ue,{children:[C,N]})}),e[14]=C,e[15]=N,e[16]=I):I=e[16];let L;e[17]!==n?(L=n("sidebar.rail.searchOrganizations"),e[17]=n,e[18]=L):L=e[18];let E;e[19]!==n?(E=n("sidebar.rail.searchPlaceholder"),e[19]=n,e[20]=E):E=e[20];let _;e[21]!==n?(_=n("sidebar.rail.searchPlaceholder"),e[21]=n,e[22]=_):_=e[22];let k;e[23]!==u||e[24]!==_?(k=i.jsx(Ct,{value:u,onValueChange:p,placeholder:_}),e[23]=u,e[24]=_,e[25]=k):k=e[25];const F=d&&(O||!g)&&"opacity-50";let D;e[26]!==F?(D=Y(F),e[26]=F,e[27]=D):D=e[27];let $;e[28]!==x||e[29]!==d||e[30]!==n?($=d&&x&&i.jsx(Oe,{children:n("sidebar.rail.searchFailed")}),e[28]=x,e[29]=d,e[30]=n,e[31]=$):$=e[31];let M;e[32]!==x||e[33]!==b||e[34]!==v.length||e[35]!==g||e[36]!==n?(M=!x&&g&&!b&&v.length===0&&i.jsx(Oe,{children:n("sidebar.rail.searchEmpty")}),e[32]=x,e[33]=b,e[34]=v.length,e[35]=g,e[36]=n,e[37]=M):M=e[37];let K;if(e[38]!==o||e[39]!==l||e[40]!==v||e[41]!==n){let B;e[43]!==o||e[44]!==l||e[45]!==n?(B=G=>i.jsxs(_t,{value:G.slug,onSelect:()=>{y(!1),G.slug!==o&&l(G.slug)},className:"gap-2.5",children:[i.jsx(Se,{org:G,size:"sm"}),i.jsx("span",{className:"min-w-0 flex-1 truncate",children:G.name}),G.slug===o&&i.jsx("span",{className:"text-meta shrink-0",children:n("sidebar.rail.currentOrganization")})]},G.id),e[43]=o,e[44]=l,e[45]=n,e[46]=B):B=e[46],K=v.map(B),e[38]=o,e[39]=l,e[40]=v,e[41]=n,e[42]=K}else K=e[42];let W;e[47]!==D||e[48]!==$||e[49]!==M||e[50]!==K?(W=i.jsxs(Rt,{className:D,children:[$,M,K]}),e[47]=D,e[48]=$,e[49]=M,e[50]=K,e[51]=W):W=e[51];let P;e[52]!==a||e[53]!==L||e[54]!==E||e[55]!==k||e[56]!==W?(P=i.jsxs(Nt,{open:a,onOpenChange:y,title:L,description:E,shouldFilter:!1,children:[k,W]}),e[52]=a,e[53]=L,e[54]=E,e[55]=k,e[56]=W,e[57]=P):P=e[57];let q;return e[58]!==P||e[59]!==I?(q=i.jsxs(i.Fragment,{children:[I,P]}),e[58]=P,e[59]=I,e[60]=q):q=e[60],q}function qt(t){return globalThis.addEventListener("resize",t),()=>globalThis.removeEventListener("resize",t)}const Yt=()=>Le(globalThis.innerHeight),Ut=()=>Le(0);function Jt(t){const e=X.c(59),{org:s,active:o,onSelect:r,pinned:l,onOpenSettings:n,onTogglePin:a,onHide:c}=t,u=J();let p;e[0]!==s.slug?(p={id:s.slug},e[0]=s.slug,e[1]=p):p=e[1];const{setNodeRef:m,listeners:h,transform:f,transition:d,isDragging:g}=ct(p);let j;e[2]!==f?(j=rt.Transform.toString(f?{...f,x:0}:null),e[2]=f,e[3]=j):j=e[3];const b=g?1:void 0,O=`rail-org-${s.slug}`;let x;e[4]!==j||e[5]!==b||e[6]!==O||e[7]!==d?(x={transform:j,transition:d,zIndex:b,viewTransitionName:O},e[4]=j,e[5]=b,e[6]=O,e[7]=d,e[8]=x):x=e[8];const v=s.name,z=o||void 0,y=o?"opacity-100":"opacity-60 hover:scale-105 hover:opacity-100",S=r&&"cursor-pointer";let A;e[9]!==y||e[10]!==S?(A=Y("relative flex shrink-0 items-center justify-center rounded-xl focus-ring","transition-[opacity,transform] duration-150 ease-out",y,S),e[9]=y,e[10]=S,e[11]=A):A=e[11];let w;e[12]!==s?(w=i.jsx(Se,{org:s,size:"lg",rounded:"rounded-xl"}),e[12]=s,e[13]=w):w=e[13];let C;e[14]!==l?(C=l&&i.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:i.jsx(ze,{size:9})}),e[14]=l,e[15]=C):C=e[15];let R;e[16]!==r||e[17]!==s.name||e[18]!==A||e[19]!==w||e[20]!==C||e[21]!==z?(R=i.jsx(ce,{asChild:!0,children:i.jsx(gt,{asChild:!0,children:i.jsxs("button",{type:"button","aria-label":v,"aria-current":z,onClick:r,className:A,children:[w,C]})})}),e[16]=r,e[17]=s.name,e[18]=A,e[19]=w,e[20]=C,e[21]=z,e[22]=R):R=e[22];let N;e[23]!==s.name?(N=i.jsx(de,{side:"right",children:s.name}),e[23]=s.name,e[24]=N):N=e[24];let I;e[25]!==R||e[26]!==N?(I=i.jsxs(ue,{children:[R,N]}),e[25]=R,e[26]=N,e[27]=I):I=e[27];let L;e[28]===Symbol.for("react.memo_cache_sentinel")?(L=i.jsx(ht,{}),e[28]=L):L=e[28];let E;e[29]!==u?(E=u("sidebar.rail.organizationSettings"),e[29]=u,e[30]=E):E=e[30];let _;e[31]!==n||e[32]!==E?(_=i.jsxs(be,{onSelect:n,children:[L,E]}),e[31]=n,e[32]=E,e[33]=_):_=e[33];let k;e[34]===Symbol.for("react.memo_cache_sentinel")?(k=i.jsx(ze,{}),e[34]=k):k=e[34];let F;e[35]!==l||e[36]!==u?(F=u(l?"sidebar.rail.unpinOrganization":"sidebar.rail.pinOrganization"),e[35]=l,e[36]=u,e[37]=F):F=e[37];let D;e[38]!==a||e[39]!==F?(D=i.jsxs(be,{onSelect:a,children:[k,F]}),e[38]=a,e[39]=F,e[40]=D):D=e[40];let $;e[41]!==c||e[42]!==u?($=c&&i.jsxs(be,{onSelect:c,children:[i.jsx(dt,{}),u("sidebar.rail.hideOrganization")]}),e[41]=c,e[42]=u,e[43]=$):$=e[43];let M;e[44]!==_||e[45]!==D||e[46]!==$?(M=i.jsxs(pt,{children:[_,D,$]}),e[44]=_,e[45]=D,e[46]=$,e[47]=M):M=e[47];let K;e[48]!==I||e[49]!==M?(K=i.jsxs(xt,{children:[I,M]}),e[48]=I,e[49]=M,e[50]=K):K=e[50];let W;e[51]!==o||e[52]!==K?(W=i.jsx(xe,{active:o,children:K}),e[51]=o,e[52]=K,e[53]=W):W=e[53];let P;return e[54]!==h||e[55]!==m||e[56]!==W||e[57]!==x?(P=i.jsx("div",{ref:m,...h,style:x,className:"w-full shrink-0 touch-none",children:W}),e[54]=h,e[55]=m,e[56]=W,e[57]=x,e[58]=P):P=e[58],P}function Vt(t){const e=X.c(64),{project:s,orgSlug:o,active:r,onClose:l,onNavigate:n}=t,a=J();let c,u,p,m,h,f,d,g,j,b,O;if(e[0]!==r||e[1]!==n||e[2]!==o||e[3]!==s.icon||e[4]!==s.id||e[5]!==s.title){const k=ut(s.icon,s.title);O="group/rail relative flex w-full flex-col items-center gap-1",p=ue,u=ce,b=!0,c=Ne,m=He.root,e[17]!==o||e[18]!==s.id?(h={org:o,agentId:s.id},e[17]=o,e[18]=s.id,e[19]=h):h=e[19],f=s.title,d=r||void 0,e[20]!==n?(g=()=>{ge("org_rail_recent_project_opened"),n?.()},e[20]=n,e[21]=g):g=e[21],j=Y("flex shrink-0 rounded-lg focus-ring",k.text,r&&"ring-[1.5px] ring-current"),e[0]=r,e[1]=n,e[2]=o,e[3]=s.icon,e[4]=s.id,e[5]=s.title,e[6]=c,e[7]=u,e[8]=p,e[9]=m,e[10]=h,e[11]=f,e[12]=d,e[13]=g,e[14]=j,e[15]=b,e[16]=O}else c=e[6],u=e[7],p=e[8],m=e[9],h=e[10],f=e[11],d=e[12],g=e[13],j=e[14],b=e[15],O=e[16];let x;e[22]!==s.icon||e[23]!==s.title?(x=i.jsx(ft,{icon:s.icon,name:s.title,size:"sm",className:"size-8 rounded-lg"}),e[22]=s.icon,e[23]=s.title,e[24]=x):x=e[24];let v;e[25]!==c||e[26]!==m||e[27]!==h||e[28]!==f||e[29]!==d||e[30]!==g||e[31]!==j||e[32]!==x?(v=i.jsx(c,{to:m,params:h,"aria-label":f,"aria-current":d,onClick:g,className:j,children:x}),e[25]=c,e[26]=m,e[27]=h,e[28]=f,e[29]=d,e[30]=g,e[31]=j,e[32]=x,e[33]=v):v=e[33];let z;e[34]!==u||e[35]!==v||e[36]!==b?(z=i.jsx(u,{asChild:b,children:v}),e[34]=u,e[35]=v,e[36]=b,e[37]=z):z=e[37];let y;e[38]!==s.title?(y=i.jsx(de,{side:"right",children:s.title}),e[38]=s.title,e[39]=y):y=e[39];let S;e[40]!==p||e[41]!==z||e[42]!==y?(S=i.jsxs(p,{children:[z,y]}),e[40]=p,e[41]=z,e[42]=y,e[43]=S):S=e[43];const A=r?"font-medium text-sidebar-foreground":"text-muted-foreground group-hover/rail:text-sidebar-foreground";let w;e[44]!==A?(w=Y("line-clamp-2 w-full text-center text-2xs break-words transition-colors",A),e[44]=A,e[45]=w):w=e[45];let C;e[46]!==s.title||e[47]!==w?(C=i.jsx("span",{"aria-hidden":!0,className:w,children:s.title}),e[46]=s.title,e[47]=w,e[48]=C):C=e[48];let R;e[49]!==s.title||e[50]!==a?(R=a("sidebar.rail.closeApp",{name:s.title}),e[49]=s.title,e[50]=a,e[51]=R):R=e[51];let N;e[52]!==l?(N=()=>{ge("org_rail_recent_project_closed"),l()},e[52]=l,e[53]=N):N=e[53];let I,L;e[54]===Symbol.for("react.memo_cache_sentinel")?(I=Y("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"),L=i.jsx(Ae,{size:10}),e[54]=I,e[55]=L):(I=e[54],L=e[55]);let E;e[56]!==R||e[57]!==N?(E=i.jsx("button",{type:"button","aria-label":R,onClick:N,className:I,children:L}),e[56]=R,e[57]=N,e[58]=E):E=e[58];let _;return e[59]!==S||e[60]!==C||e[61]!==E||e[62]!==O?(_=i.jsxs("div",{className:O,children:[S,C,E]}),e[59]=S,e[60]=C,e[61]=E,e[62]=O,e[63]=_):_=e[63],_}const Qt={"site-editor":"/site-editor"};function Zt(t){const e=X.c(26),{app:s}=t,o=J(),r=jt[s],l=Qt[s];if(!r||!l)return null;let n;e[0]!==r.labelKey||e[1]!==o?(n=o(r.labelKey),e[0]=r.labelKey,e[1]=o,e[2]=n):n=e[2];let a;e[3]!==r.labelKey||e[4]!==o?(a=o(r.labelKey),e[3]=r.labelKey,e[4]=o,e[5]=a):a=e[5];let c;e[6]!==r.tone?(c=Y("flex size-9 shrink-0 items-center justify-center rounded-xl focus-ring opacity-100",r.tone),e[6]=r.tone,e[7]=c):c=e[7];let u;e[8]!==r.Icon?(u=i.jsx(r.Icon,{size:18}),e[8]=r.Icon,e[9]=u):u=e[9];let p;e[10]!==a||e[11]!==c||e[12]!==u||e[13]!==l?(p=i.jsx(ce,{asChild:!0,children:i.jsx(Ne,{to:l,"aria-label":a,"aria-current":"page","data-testid":"org-rail-local-app",className:c,children:u})}),e[10]=a,e[11]=c,e[12]=u,e[13]=l,e[14]=p):p=e[14];let m;e[15]!==r.labelKey||e[16]!==o?(m=o(r.labelKey),e[15]=r.labelKey,e[16]=o,e[17]=m):m=e[17];let h;e[18]!==m?(h=i.jsx(de,{side:"right",children:m}),e[18]=m,e[19]=h):h=e[19];let f;e[20]!==p||e[21]!==h?(f=i.jsxs(ue,{children:[p,h]}),e[20]=p,e[21]=h,e[22]=f):f=e[22];let d;return e[23]!==n||e[24]!==f?(d=i.jsx(xe,{active:!0,label:n,children:f}),e[23]=n,e[24]=f,e[25]=d):d=e[25],d}function es(){const{org:t}=Re();return vt(t.slug),null}function Pe(t){const e=X.c(52),{onNavigate:s}=t===void 0?{}:t,o=J(),r=Be(),{org:l}=Re(),{data:n}=Ge(),[a,c]=U.useState(!1),u=ye(),{recent:p,forget:m}=St(l.slug),{projects:h}=wt(),f=zt(),d=yt(),g=d&&d.projectId===null?d.app:null,j=g?[]:p.flatMap(T=>h.filter(H=>H.id===T)),b=Dt(n??[],l),{recent:O,remember:x}=Mt();let v;e[0]===Symbol.for("react.memo_cache_sentinel")?(v=ve.railOrgPrefs(),e[0]=v):v=e[0];const[z,y]=pe(v,ke),S=le(z),A=U.useSyncExternalStore(qt,Yt,Ut),{shown:w}=$t(Bt(b,S,l.slug),O,l.slug,A,S.pinned);let C;e[1]===Symbol.for("react.memo_cache_sentinel")?(C={activationConstraint:{distance:8}},e[1]=C):C=e[1];const R=tt(st(ot,C)),N=T=>{const{active:H,over:re}=T;re&&(ge("org_rail_reordered"),y($e=>Gt(le($e),w.map(ns),String(H.id),String(re.id))))},I=T=>{s?.(),r({to:"/$org/home",params:{org:T},viewTransition:!0})},L=T=>{ge("org_rail_travel");const H=w.some(re=>re.slug===T);y(re=>Wt(le(re),T)),x(T,H?w.map(ss):void 0),I(T)},E=!u&&"border-r border-sidebar-border";let _;e[2]!==E?(_=Y("flex w-[68px] shrink-0 flex-col items-center gap-2.5 overflow-y-auto bg-sidebar px-2.5 pt-3 pb-2 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",E),e[2]=E,e[3]=_):_=e[3];let k;e[4]!==o?(k=o("sidebar.rail.ariaLabel"),e[4]=o,e[5]=k):k=e[5];const F=nt,D=it,$=lt,M=w.map(ts),K=at,W=w.map(T=>i.jsxs(U.Fragment,{children:[i.jsx(Jt,{org:T,active:T.slug===l.slug,pinned:S.pinned.includes(T.slug),onSelect:T.slug!==l.slug?()=>L(T.slug):f?()=>I(T.slug):void 0,onOpenSettings:()=>{s?.(),r({to:"/$org/settings",params:{org:T.slug}})},onTogglePin:()=>y(H=>Ft(le(H),T.slug)),onHide:T.slug===l.slug?void 0:()=>y(H=>Kt(le(H),T.slug))}),T.slug===l.slug&&j.length>0&&i.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:j.map(H=>i.jsx(Vt,{project:H,orgSlug:l.slug,active:f===H.id,onClose:()=>m(H.id),onNavigate:s},H.id))})]},T.id));let P;e[6]!==$||e[7]!==W||e[8]!==M||e[9]!==K?(P=i.jsx($,{items:M,strategy:K,children:W}),e[6]=$,e[7]=W,e[8]=M,e[9]=K,e[10]=P):P=e[10];let q;e[11]!==F||e[12]!==N||e[13]!==R||e[14]!==P||e[15]!==D?(q=i.jsx(F,{sensors:R,collisionDetection:D,onDragEnd:N,children:P}),e[11]=F,e[12]=N,e[13]=R,e[14]=P,e[15]=D,e[16]=q):q=e[16];let B;e[17]!==l.slug||e[18]!==b||e[19]!==w.length||e[20]!==L?(B=b.length>w.length&&i.jsx(Xt,{orgs:b,currentSlug:l.slug,hiddenCount:b.length-w.length,onSelect:L}),e[17]=l.slug,e[18]=b,e[19]=w.length,e[20]=L,e[21]=B):B=e[21];let G;e[22]!==o?(G=o("sidebar.picker.newOrganization"),e[22]=o,e[23]=G):G=e[23];let V;e[24]!==c?(V=()=>c(!0),e[24]=c,e[25]=V):V=e[25];let fe;e[26]===Symbol.for("react.memo_cache_sentinel")?(fe=i.jsx(mt,{size:18}),e[26]=fe):fe=e[26];let Q;e[27]!==G||e[28]!==V?(Q=i.jsx(ce,{asChild:!0,children:i.jsx("button",{type:"button","aria-label":G,onClick:V,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-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:fe})}),e[27]=G,e[28]=V,e[29]=Q):Q=e[29];let Z;e[30]!==o?(Z=o("sidebar.picker.newOrganization"),e[30]=o,e[31]=Z):Z=e[31];let ee;e[32]!==Z?(ee=i.jsx(de,{side:"right",children:Z}),e[32]=Z,e[33]=ee):ee=e[33];let te;e[34]!==Q||e[35]!==ee?(te=i.jsx(xe,{active:!1,children:i.jsxs(ue,{children:[Q,ee]})}),e[34]=Q,e[35]=ee,e[36]=te):te=e[36];let se;e[37]!==g?(se=g&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"my-2 h-px w-6 shrink-0 bg-sidebar-border","aria-hidden":!0}),i.jsx(Zt,{app:g})]}),e[37]=g,e[38]=se):se=e[38];let ne;e[39]!==q||e[40]!==B||e[41]!==te||e[42]!==se||e[43]!==_||e[44]!==k?(ne=i.jsxs("div",{className:_,"aria-label":k,children:[q,B,te,se]}),e[39]=q,e[40]=B,e[41]=te,e[42]=se,e[43]=_,e[44]=k,e[45]=ne):ne=e[45];let ie;e[46]!==a||e[47]!==c?(ie=i.jsx(bt,{open:a,onOpenChange:c}),e[46]=a,e[47]=c,e[48]=ie):ie=e[48];let he;return e[49]!==ne||e[50]!==ie?(he=i.jsxs(i.Fragment,{children:[ne,ie]}),e[49]=ne,e[50]=ie,e[51]=he):he=e[51],he}function ts(t){return t.slug}function ss(t){return t.slug}function ns(t){return t.slug}function is(t){const e=X.c(15),{width:s,minWidth:o,maxWidth:r,onPointerDown:l,onKeyDown:n,onDoubleClick:a}=t,c=J(),{isMobile:u}=Te(),p=ye();if(u||p)return null;let m;e[0]!==c?(m=c("sidebar.sidebarResizeHandle.ariaLabel"),e[0]=c,e[1]=m):m=e[1];let h;e[2]!==c?(h=c("sidebar.sidebarResizeHandle.title"),e[2]=c,e[3]=h):h=e[3];let f,d;e[4]===Symbol.for("react.memo_cache_sentinel")?(f={left:"var(--sidebar-width)"},d=i.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]=f,e[5]=d):(f=e[4],d=e[5]);let g;return e[6]!==r||e[7]!==o||e[8]!==a||e[9]!==n||e[10]!==l||e[11]!==m||e[12]!==h||e[13]!==s?(g=i.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":m,"aria-valuenow":s,"aria-valuemin":o,"aria-valuemax":r,title:h,tabIndex:0,onPointerDown:l,onKeyDown:n,onDoubleClick:a,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize focus-visible:outline-none",style:f,children:d}),e[6]=r,e[7]=o,e[8]=a,e[9]=n,e[10]=l,e[11]=m,e[12]=h,e[13]=s,e[14]=g):g=e[14],g}const je=400,_e=16,rs="sidebar.width.v2";function os(){const t=X.c(14),e=ls;let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=d=>typeof d=="number"?e(d):192,t[0]=s):s=t[0];const[o,r]=pe(rs,s),l=U.useRef(null);let n;t[1]!==r||t[2]!==o?(n=d=>{d.preventDefault();const g=d.clientX,j=e(o),b=l.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),O=b?Array.from(b.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const z of O)z.style.transition="none";const x=z=>{const y=e(j+(z.clientX-g));b?.style.setProperty("--sidebar-width",`${y}px`)},v=z=>{const y=e(j+(z.clientX-g));r(y);for(const S of O)S.style.transition="";window.removeEventListener("pointermove",x),window.removeEventListener("pointerup",v),window.removeEventListener("pointercancel",v),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",x),window.addEventListener("pointerup",v),window.addEventListener("pointercancel",v)},t[1]=r,t[2]=o,t[3]=n):n=t[3];const a=n;let c;t[4]!==r?(c=()=>{r(192)},t[4]=r,t[5]=c):c=t[5];const u=c;let p;t[6]!==r||t[7]!==o?(p=d=>{if(d.key==="ArrowLeft")r(e(o-_e));else if(d.key==="ArrowRight")r(e(o+_e));else if(d.key==="Home")r(192);else if(d.key==="End")r(je);else return;d.preventDefault()},t[6]=r,t[7]=o,t[8]=p):p=t[8];const m=p,h=e(o);let f;return t[9]!==m||t[10]!==a||t[11]!==u||t[12]!==h?(f={width:h,minWidth:192,maxWidth:je,wrapperRef:l,onStartResize:a,onKeyDownResize:m,resetWidth:u},t[9]=m,t[10]=a,t[11]=u,t[12]=h,t[13]=f):f=t[13],f}function ls(t){return Math.max(192,Math.min(je,t))}const De=U.createContext(null);function as(){const t=U.use(De);if(!t)throw new Error("Layout regions require a Layout");return t}function cs({children:t,notice:e,outsideOrg:s}){const o=et(),[r,l]=pe(ve.sidebarOpen(),!0),n=os(),a=Ee();return i.jsx(De,{value:{isMobile:o,resize:n},children:i.jsx(qe,{open:r,onOpenChange:l,children:i.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[e,i.jsxs("div",{className:"flex flex-1 flex-row min-h-0",children:[a&&!s&&i.jsx(es,{}),!o&&a&&(s?.rail??!0)&&i.jsx(Pe,{}),i.jsx(Ye,{ref:n.wrapperRef,className:"flex-1 bg-sidebar relative min-h-0",style:{"--sidebar-width":`${n.width}px`,"--sidebar-width-icon":a?"0px":"3.125rem"},children:i.jsx(Ue,{children:t})})]})]})})})}function ds(t){const e=X.c(37),{children:s,renderMobile:o}=t,r=J(),{isMobile:l,resize:n}=as(),{openMobile:a,setOpenMobile:c}=Te(),u=ye(),p=Ee();let m;e[0]!==c?(m=()=>c(!1),e[0]=c,e[1]=m):m=e[1];const h=m;if(!l){const z=p&&u;let y;e[2]!==s||e[3]!==z?(y=i.jsx("div",{className:"contents",inert:z,children:s}),e[2]=s,e[3]=z,e[4]=y):y=e[4];let S;e[5]!==n.maxWidth||e[6]!==n.minWidth||e[7]!==n.onKeyDownResize||e[8]!==n.onStartResize||e[9]!==n.resetWidth||e[10]!==n.width?(S=i.jsx(is,{width:n.width,minWidth:n.minWidth,maxWidth:n.maxWidth,onPointerDown:n.onStartResize,onKeyDown:n.onKeyDownResize,onDoubleClick:n.resetWidth}),e[5]=n.maxWidth,e[6]=n.minWidth,e[7]=n.onKeyDownResize,e[8]=n.onStartResize,e[9]=n.resetWidth,e[10]=n.width,e[11]=S):S=e[11];let A;return e[12]!==y||e[13]!==S?(A=i.jsxs(i.Fragment,{children:[y,S]}),e[12]=y,e[13]=S,e[14]=A):A=e[14],A}let f;e[15]!==r?(f=r("layouts.shellControls.navigationTitle"),e[15]=r,e[16]=f):f=e[16];let d;e[17]!==f?(d=i.jsx(Ve,{className:"sr-only",children:f}),e[17]=f,e[18]=d):d=e[18];let g;e[19]!==h||e[20]!==p?(g=p&&i.jsx(Pe,{onNavigate:h}),e[19]=h,e[20]=p,e[21]=g):g=e[21];let j;e[22]!==h||e[23]!==o?(j=o({onClose:h}),e[22]=h,e[23]=o,e[24]=j):j=e[24];let b;e[25]!==j?(b=i.jsx("div",{className:"min-w-0 flex-1",children:j}),e[25]=j,e[26]=b):b=e[26];let O;e[27]!==g||e[28]!==b?(O=i.jsxs("div",{className:"flex h-full min-h-0",children:[g,b]}),e[27]=g,e[28]=b,e[29]=O):O=e[29];let x;e[30]!==d||e[31]!==O?(x=i.jsxs(Qe,{side:"left",hideCloseButton:!0,className:"w-screen max-w-none! p-0",onOpenAutoFocus:us,children:[d,O]}),e[30]=d,e[31]=O,e[32]=x):x=e[32];let v;return e[33]!==a||e[34]!==c||e[35]!==x?(v=i.jsx(Ze,{open:a,onOpenChange:c,children:x}),e[33]=a,e[34]=c,e[35]=x,e[36]=v):v=e[36],v}function us(t){return t.preventDefault()}function fs(t){const e=X.c(3),{children:s}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={background:"transparent",containerType:"inline-size"},e[0]=o):o=e[0];let r;return e[1]!==s?(r=i.jsx(Je,{className:"flex flex-col min-h-0",style:o,children:i.jsx(Xe,{variant:"plain",className:"bg-sidebar",children:i.jsx("div",{className:"relative flex-1 min-h-0 flex flex-row",children:s})})}),e[1]=s,e[2]=r):r=e[2],r}const Ls=Object.assign(cs,{Sidebar:ds,Content:fs});export{Is as I,Ls as L,Se as O,Ht as u,Dt as w};
1
+ import{c as X,r as U,l as Y,j as i,b as J,B as we,a as me,t as oe,G as Me,au as pe,aw as ve,m as Ke,K as We,ae as Fe,a2 as Re,d as Be,E as Ge,L as Ne,Y as He,y as ge,aa as Ee,P as Xe}from"./index-CNWJYHvX.js";import{u as ye,c as Te,i as qe,j as Ye,k as Ue,l as Je}from"./use-sidebar-collapsed-ztBUIrIJ.js";import{S as Ve,a as Qe,b as Ze}from"./sheet-EBRPi3dD.js";import{u as et}from"./use-mobile-B-6bodzw.js";import{u as tt,a as st,D as nt,c as it,C as rt,P as ot}from"./core.esm-C_n7cKI9.js";import{S as lt,v as at,u as ct}from"./sortable.esm-BMPY9Sd5.js";import{i as dt}from"./Tool01-C0tA6_WY.js";import{C as ut,A as ft,D as ze,E as ht}from"./agent-icon-BAsaPIPW.js";import{s as mt}from"./Plus-Dam4fGJv.js";import{s as Ae}from"./XClose-J1FWOmKL.js";import{T as ce,a as de,c as ue}from"./tooltip-BwU3TfFp.js";import{C as be,f as gt,g as pt,e as xt}from"./context-menu-BdSGqs_f.js";import{C as bt}from"./create-organization-dialog-BCynjnXm.js";import{P as jt}from"./project-apps-BccHfSJ8.js";import{u as vt,a as yt}from"./use-recent-apps-DnoPUgq-.js";import{b as St}from"./use-navigate-to-agent-B4nMFFrr.js";import{u as wt,a as zt}from"./use-project-scope-BOmNgUbL.js";import{i as Ot}from"./UserSquare-jVbr-XG_.js";import{C as Oe,e as Ct,b as _t,c as Rt,f as Nt}from"./command-DEXvL0cT.js";import{u as Et}from"./use-debounced-value-BOMWTPY3.js";function Tt(t){let e=0;for(let o=0;o<t.length;o++)e=t.charCodeAt(o)+((e<<5)-e);const s=Math.abs(e)%360;return{backgroundColor:`hsl(${s} 55% 70%)`,color:`hsl(${s} 55% 20%)`}}const At={xs:{box:"size-5",text:"text-[9px]"},sm:{box:"size-6",text:"text-xs"},md:{box:"size-8",text:"text-sm"},lg:{box:"size-9",text:"text-sm"}};function Se(t){const e=X.c(14),{org:s,size:o,rounded:r}=t,l=o===void 0?"sm":o,n=r===void 0?"rounded-md":r,{box:a,text:c}=At[l],[u,p]=U.useState(null),m=s.logo&&s.logo!==u?s.logo:null;let h;e[0]!==n||e[1]!==a?(h=Y(a,n,"shrink-0 flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=n,e[1]=a,e[2]=h):h=e[2];let f;e[3]!==m||e[4]!==s.name?(f=m?void 0:Tt(s.name),e[3]=m,e[4]=s.name,e[5]=f):f=e[5];let d;e[6]!==m||e[7]!==s.name||e[8]!==c?(d=m?i.jsx("img",{src:m,alt:"",className:"size-full object-cover",onError:()=>p(m)}):i.jsx("span",{className:Y("font-semibold leading-none",c),children:s.name.slice(0,2).toUpperCase()}),e[6]=m,e[7]=s.name,e[8]=c,e[9]=d):d=e[9];let g;return e[10]!==h||e[11]!==f||e[12]!==d?(g=i.jsx("div",{className:h,style:f,children:d}),e[10]=h,e[11]=f,e[12]=d,e[13]=g):g=e[13],g}function Is({invitation:t,onChanged:e}){const s=J(),[o,r]=U.useState(!1),l=t.organizationName??s("header.orgSwitcher.unknownOrganization"),n=async()=>{r(!0);try{const u=await me.organization.acceptInvitation({invitationId:t.id});if(u.error){oe.error(u.error.message),r(!1);return}}catch{oe.error(s("header.orgSwitcher.failedToAcceptInvitation")),r(!1);return}oe.success(s("header.orgSwitcher.joined",{name:l})),Me();let c;try{c=(await me.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=c?`/${c}`:"/"},a=async()=>{r(!0);try{const c=await me.organization.rejectInvitation({invitationId:t.id});if(c.error){oe.error(c.error.message),r(!1);return}oe.success(s("header.orgSwitcher.invitationDeclined")),r(!1),e()}catch{oe.error(s("header.orgSwitcher.failedToDeclineInvitation")),r(!1)}};return i.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-dashed border-border px-3 py-2.5",children:[i.jsx(Se,{org:{name:l},size:"sm"}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("p",{className:"truncate text-sm font-medium",children:l}),i.jsx("p",{className:"truncate text-xs text-muted-foreground",children:s("header.orgSwitcher.invitedToJoin")})]}),i.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[i.jsx(we,{size:"sm",variant:"default",className:"h-7 text-xs",onClick:n,disabled:o,children:s("header.orgSwitcher.accept")}),i.jsx(we,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground",onClick:a,disabled:o,"aria-label":s("header.orgSwitcher.declineInvitationTo",{name:l}),children:i.jsx(Ae,{size:14})})]})]})}const It=3,Ie=10,Lt=440,kt=55;function Le(t){const e=Math.floor((t-Lt)/kt);return Math.min(Ie,Math.max(It,e))}function Pt(t,e,s=Ie*3,o=[]){return[...new Set([e,...o,...t])].slice(0,s)}function Dt(t,e){return!e.id||t.some(s=>s.slug===e.slug)?[...t]:[...t,e]}function $t(t,e,s,o,r=[]){if(t.length<=o)return{shown:[...t],hidden:[]};const l=new Map(t.map(a=>[a.slug,a])),n=new Set;s&&l.has(s)&&n.add(s);for(const a of r)l.has(a)&&n.add(a);for(const a of e){if(n.size>=o)break;l.has(a)&&n.add(a)}for(const a of t){if(n.size>=o)break;n.add(a.slug)}return{shown:t.filter(a=>n.has(a.slug)),hidden:t.filter(a=>!n.has(a.slug))}}const Ce=[];function Mt(){const t=X.c(6);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=ve.recentOrgs(),t[0]=e):e=t[0];const[s,o]=pe(e,Ce),r=Array.isArray(s)?s:Ce;let l;t[1]!==o?(l=(a,c)=>o(u=>Pt(Array.isArray(u)?u:[],a,void 0,c)),t[1]=o,t[2]=l):l=t[2];let n;return t[3]!==r||t[4]!==l?(n={recent:r,remember:l},t[3]=r,t[4]=l,t[5]=n):n=t[5],n}const ke={hidden:[],pinned:[],order:[]},ae=(t,e)=>t.filter(s=>s!==e);function le(t){if(typeof t!="object"||t===null)return ke;const e=o=>Array.isArray(o)?o.filter(r=>typeof r=="string"):[],s=t;return{hidden:e(s.hidden),pinned:e(s.pinned),order:e(s.order)}}function Kt(t,e){return{...t,hidden:[...ae(t.hidden,e),e],pinned:ae(t.pinned,e)}}function Wt(t,e){return{...t,hidden:ae(t.hidden,e)}}function Ft(t,e){return t.pinned.includes(e)?{...t,pinned:ae(t.pinned,e)}:{...t,hidden:ae(t.hidden,e),pinned:[...t.pinned,e]}}function Bt(t,e,s){const o=r=>{const l=e.order.indexOf(r);return l===-1?Number.MAX_SAFE_INTEGER:l};return t.filter(r=>r.slug===s||!e.hidden.includes(r.slug)).map((r,l)=>({org:r,index:l})).sort((r,l)=>Number(e.pinned.includes(l.org.slug))-Number(e.pinned.includes(r.org.slug))||o(r.org.slug)-o(l.org.slug)||r.index-l.index).map(({org:r})=>r)}function Gt(t,e,s,o){const r=e.indexOf(s),l=e.indexOf(o);if(r===-1||l===-1||r===l||t.pinned.includes(s)!==t.pinned.includes(o))return t;const n=[...e];return n.splice(r,1),n.splice(l,0,s),{...t,order:[...n,...t.order.filter(a=>!n.includes(a))]}}function xe(t){const e=X.c(11),{active:s,label:o,children:r}=t,l=s?"h-7 opacity-100":"h-2 opacity-0 group-hover/rail:opacity-60";let n;e[0]!==l?(n=Y("w-1 rounded-r-full bg-foreground","transition-[height,opacity] duration-200 ease-[var(--ease-out-cubic)]","motion-reduce:transition-none",l),e[0]=l,e[1]=n):n=e[1];let a;e[2]!==n?(a=i.jsx("span",{"aria-hidden":!0,className:"absolute top-0 -left-2.5 flex h-9 items-center",children:i.jsx("span",{className:n})}),e[2]=n,e[3]=a):a=e[3];let c;e[4]!==s||e[5]!==o?(c=o&&i.jsx("span",{"aria-hidden":!0,className:Y("line-clamp-2 w-full px-0.5 text-center text-2xs text-ellipsis transition-colors",s?"font-medium text-sidebar-foreground":"text-muted-foreground group-hover/rail:text-sidebar-foreground"),children:o}),e[4]=s,e[5]=o,e[6]=c):c=e[6];let u;return e[7]!==r||e[8]!==a||e[9]!==c?(u=i.jsxs("div",{className:"group/rail relative flex w-full shrink-0 flex-col items-center gap-1",children:[a,r,c]}),e[7]=r,e[8]=a,e[9]=c,e[10]=u):u=e[10],u}function Ht(t){const e=X.c(13),s=t.trim(),{data:o}=me.useSession(),r=o?.user?.id??"",l=s.length>0&&!!r,n=We.organizationSearch(r,s);let a;e[0]!==s?(a=async b=>{const{signal:O}=b,x=await fetch(`/api/_me/organizations/search?q=${encodeURIComponent(s)}`,{signal:O});if(!x.ok)throw new Error(`Organization search failed: ${x.status}`);return await x.json()},e[0]=s,e[1]=a):a=e[1];let c;e[2]!==l||e[3]!==n||e[4]!==a?(c={queryKey:n,queryFn:a,enabled:l,placeholderData:Fe,staleTime:3e4,retry:!1},e[2]=l,e[3]=n,e[4]=a,e[5]=c):c=e[5];const{data:u,isFetching:p,isPlaceholderData:m,isError:h}=Ke(c);let f;e[6]!==u?.items?(f=u?.items??[],e[6]=u?.items,e[7]=f):f=e[7];const d=l&&p,g=l&&m;let j;return e[8]!==h||e[9]!==f||e[10]!==d||e[11]!==g?(j={hits:f,isSearching:d,isStale:g,isError:h},e[8]=h,e[9]=f,e[10]=d,e[11]=g,e[12]=j):j=e[12],j}function Xt(t){const e=X.c(61),{orgs:s,currentSlug:o,hiddenCount:r,onSelect:l}=t,n=J(),[a,c]=U.useState(!1),[u,p]=U.useState("");let m;e[0]!==u?(m=u.trim(),e[0]=u,e[1]=m):m=e[1];const h=m,f=Et(h,150),d=h.length>0,g=f===h,{hits:j,isSearching:b,isStale:O,isError:x}=Ht(d?f:""),v=d?j:s;let z;e[2]===Symbol.for("react.memo_cache_sentinel")?(z=B=>{c(B),B||p("")},e[2]=z):z=e[2];const y=z;let S;e[3]!==n?(S=n("sidebar.rail.searchOrganizations"),e[3]=n,e[4]=S):S=e[4];let A;e[5]===Symbol.for("react.memo_cache_sentinel")?(A=()=>y(!0),e[5]=A):A=e[5];let w;e[6]===Symbol.for("react.memo_cache_sentinel")?(w=i.jsx(Ot,{size:18}),e[6]=w):w=e[6];let C;e[7]!==S?(C=i.jsx(ce,{asChild:!0,children:i.jsx("button",{type:"button","aria-label":S,onClick:A,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-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:w})}),e[7]=S,e[8]=C):C=e[8];let R;e[9]!==r||e[10]!==n?(R=r>0?n("sidebar.rail.searchMoreOrganizations",{count:r}):n("sidebar.rail.searchOrganizations"),e[9]=r,e[10]=n,e[11]=R):R=e[11];let N;e[12]!==R?(N=i.jsx(de,{side:"right",children:R}),e[12]=R,e[13]=N):N=e[13];let I;e[14]!==C||e[15]!==N?(I=i.jsx(xe,{active:!1,children:i.jsxs(ue,{children:[C,N]})}),e[14]=C,e[15]=N,e[16]=I):I=e[16];let L;e[17]!==n?(L=n("sidebar.rail.searchOrganizations"),e[17]=n,e[18]=L):L=e[18];let E;e[19]!==n?(E=n("sidebar.rail.searchPlaceholder"),e[19]=n,e[20]=E):E=e[20];let _;e[21]!==n?(_=n("sidebar.rail.searchPlaceholder"),e[21]=n,e[22]=_):_=e[22];let k;e[23]!==u||e[24]!==_?(k=i.jsx(Ct,{value:u,onValueChange:p,placeholder:_}),e[23]=u,e[24]=_,e[25]=k):k=e[25];const F=d&&(O||!g)&&"opacity-50";let D;e[26]!==F?(D=Y(F),e[26]=F,e[27]=D):D=e[27];let $;e[28]!==x||e[29]!==d||e[30]!==n?($=d&&x&&i.jsx(Oe,{children:n("sidebar.rail.searchFailed")}),e[28]=x,e[29]=d,e[30]=n,e[31]=$):$=e[31];let M;e[32]!==x||e[33]!==b||e[34]!==v.length||e[35]!==g||e[36]!==n?(M=!x&&g&&!b&&v.length===0&&i.jsx(Oe,{children:n("sidebar.rail.searchEmpty")}),e[32]=x,e[33]=b,e[34]=v.length,e[35]=g,e[36]=n,e[37]=M):M=e[37];let K;if(e[38]!==o||e[39]!==l||e[40]!==v||e[41]!==n){let B;e[43]!==o||e[44]!==l||e[45]!==n?(B=G=>i.jsxs(_t,{value:G.slug,onSelect:()=>{y(!1),G.slug!==o&&l(G.slug)},className:"gap-2.5",children:[i.jsx(Se,{org:G,size:"sm"}),i.jsx("span",{className:"min-w-0 flex-1 truncate",children:G.name}),G.slug===o&&i.jsx("span",{className:"text-meta shrink-0",children:n("sidebar.rail.currentOrganization")})]},G.id),e[43]=o,e[44]=l,e[45]=n,e[46]=B):B=e[46],K=v.map(B),e[38]=o,e[39]=l,e[40]=v,e[41]=n,e[42]=K}else K=e[42];let W;e[47]!==D||e[48]!==$||e[49]!==M||e[50]!==K?(W=i.jsxs(Rt,{className:D,children:[$,M,K]}),e[47]=D,e[48]=$,e[49]=M,e[50]=K,e[51]=W):W=e[51];let P;e[52]!==a||e[53]!==L||e[54]!==E||e[55]!==k||e[56]!==W?(P=i.jsxs(Nt,{open:a,onOpenChange:y,title:L,description:E,shouldFilter:!1,children:[k,W]}),e[52]=a,e[53]=L,e[54]=E,e[55]=k,e[56]=W,e[57]=P):P=e[57];let q;return e[58]!==P||e[59]!==I?(q=i.jsxs(i.Fragment,{children:[I,P]}),e[58]=P,e[59]=I,e[60]=q):q=e[60],q}function qt(t){return globalThis.addEventListener("resize",t),()=>globalThis.removeEventListener("resize",t)}const Yt=()=>Le(globalThis.innerHeight),Ut=()=>Le(0);function Jt(t){const e=X.c(59),{org:s,active:o,onSelect:r,pinned:l,onOpenSettings:n,onTogglePin:a,onHide:c}=t,u=J();let p;e[0]!==s.slug?(p={id:s.slug},e[0]=s.slug,e[1]=p):p=e[1];const{setNodeRef:m,listeners:h,transform:f,transition:d,isDragging:g}=ct(p);let j;e[2]!==f?(j=rt.Transform.toString(f?{...f,x:0}:null),e[2]=f,e[3]=j):j=e[3];const b=g?1:void 0,O=`rail-org-${s.slug}`;let x;e[4]!==j||e[5]!==b||e[6]!==O||e[7]!==d?(x={transform:j,transition:d,zIndex:b,viewTransitionName:O},e[4]=j,e[5]=b,e[6]=O,e[7]=d,e[8]=x):x=e[8];const v=s.name,z=o||void 0,y=o?"opacity-100":"opacity-60 hover:scale-105 hover:opacity-100",S=r&&"cursor-pointer";let A;e[9]!==y||e[10]!==S?(A=Y("relative flex shrink-0 items-center justify-center rounded-xl focus-ring","transition-[opacity,transform] duration-150 ease-out",y,S),e[9]=y,e[10]=S,e[11]=A):A=e[11];let w;e[12]!==s?(w=i.jsx(Se,{org:s,size:"lg",rounded:"rounded-xl"}),e[12]=s,e[13]=w):w=e[13];let C;e[14]!==l?(C=l&&i.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:i.jsx(ze,{size:9})}),e[14]=l,e[15]=C):C=e[15];let R;e[16]!==r||e[17]!==s.name||e[18]!==A||e[19]!==w||e[20]!==C||e[21]!==z?(R=i.jsx(ce,{asChild:!0,children:i.jsx(gt,{asChild:!0,children:i.jsxs("button",{type:"button","aria-label":v,"aria-current":z,onClick:r,className:A,children:[w,C]})})}),e[16]=r,e[17]=s.name,e[18]=A,e[19]=w,e[20]=C,e[21]=z,e[22]=R):R=e[22];let N;e[23]!==s.name?(N=i.jsx(de,{side:"right",children:s.name}),e[23]=s.name,e[24]=N):N=e[24];let I;e[25]!==R||e[26]!==N?(I=i.jsxs(ue,{children:[R,N]}),e[25]=R,e[26]=N,e[27]=I):I=e[27];let L;e[28]===Symbol.for("react.memo_cache_sentinel")?(L=i.jsx(ht,{}),e[28]=L):L=e[28];let E;e[29]!==u?(E=u("sidebar.rail.organizationSettings"),e[29]=u,e[30]=E):E=e[30];let _;e[31]!==n||e[32]!==E?(_=i.jsxs(be,{onSelect:n,children:[L,E]}),e[31]=n,e[32]=E,e[33]=_):_=e[33];let k;e[34]===Symbol.for("react.memo_cache_sentinel")?(k=i.jsx(ze,{}),e[34]=k):k=e[34];let F;e[35]!==l||e[36]!==u?(F=u(l?"sidebar.rail.unpinOrganization":"sidebar.rail.pinOrganization"),e[35]=l,e[36]=u,e[37]=F):F=e[37];let D;e[38]!==a||e[39]!==F?(D=i.jsxs(be,{onSelect:a,children:[k,F]}),e[38]=a,e[39]=F,e[40]=D):D=e[40];let $;e[41]!==c||e[42]!==u?($=c&&i.jsxs(be,{onSelect:c,children:[i.jsx(dt,{}),u("sidebar.rail.hideOrganization")]}),e[41]=c,e[42]=u,e[43]=$):$=e[43];let M;e[44]!==_||e[45]!==D||e[46]!==$?(M=i.jsxs(pt,{children:[_,D,$]}),e[44]=_,e[45]=D,e[46]=$,e[47]=M):M=e[47];let K;e[48]!==I||e[49]!==M?(K=i.jsxs(xt,{children:[I,M]}),e[48]=I,e[49]=M,e[50]=K):K=e[50];let W;e[51]!==o||e[52]!==K?(W=i.jsx(xe,{active:o,children:K}),e[51]=o,e[52]=K,e[53]=W):W=e[53];let P;return e[54]!==h||e[55]!==m||e[56]!==W||e[57]!==x?(P=i.jsx("div",{ref:m,...h,style:x,className:"w-full shrink-0 touch-none",children:W}),e[54]=h,e[55]=m,e[56]=W,e[57]=x,e[58]=P):P=e[58],P}function Vt(t){const e=X.c(64),{project:s,orgSlug:o,active:r,onClose:l,onNavigate:n}=t,a=J();let c,u,p,m,h,f,d,g,j,b,O;if(e[0]!==r||e[1]!==n||e[2]!==o||e[3]!==s.icon||e[4]!==s.id||e[5]!==s.title){const k=ut(s.icon,s.title);O="group/rail relative flex w-full flex-col items-center gap-1",p=ue,u=ce,b=!0,c=Ne,m=He.root,e[17]!==o||e[18]!==s.id?(h={org:o,agentId:s.id},e[17]=o,e[18]=s.id,e[19]=h):h=e[19],f=s.title,d=r||void 0,e[20]!==n?(g=()=>{ge("org_rail_recent_project_opened"),n?.()},e[20]=n,e[21]=g):g=e[21],j=Y("flex shrink-0 rounded-lg focus-ring",k.text,r&&"ring-[1.5px] ring-current"),e[0]=r,e[1]=n,e[2]=o,e[3]=s.icon,e[4]=s.id,e[5]=s.title,e[6]=c,e[7]=u,e[8]=p,e[9]=m,e[10]=h,e[11]=f,e[12]=d,e[13]=g,e[14]=j,e[15]=b,e[16]=O}else c=e[6],u=e[7],p=e[8],m=e[9],h=e[10],f=e[11],d=e[12],g=e[13],j=e[14],b=e[15],O=e[16];let x;e[22]!==s.icon||e[23]!==s.title?(x=i.jsx(ft,{icon:s.icon,name:s.title,size:"sm",className:"size-8 rounded-lg"}),e[22]=s.icon,e[23]=s.title,e[24]=x):x=e[24];let v;e[25]!==c||e[26]!==m||e[27]!==h||e[28]!==f||e[29]!==d||e[30]!==g||e[31]!==j||e[32]!==x?(v=i.jsx(c,{to:m,params:h,"aria-label":f,"aria-current":d,onClick:g,className:j,children:x}),e[25]=c,e[26]=m,e[27]=h,e[28]=f,e[29]=d,e[30]=g,e[31]=j,e[32]=x,e[33]=v):v=e[33];let z;e[34]!==u||e[35]!==v||e[36]!==b?(z=i.jsx(u,{asChild:b,children:v}),e[34]=u,e[35]=v,e[36]=b,e[37]=z):z=e[37];let y;e[38]!==s.title?(y=i.jsx(de,{side:"right",children:s.title}),e[38]=s.title,e[39]=y):y=e[39];let S;e[40]!==p||e[41]!==z||e[42]!==y?(S=i.jsxs(p,{children:[z,y]}),e[40]=p,e[41]=z,e[42]=y,e[43]=S):S=e[43];const A=r?"font-medium text-sidebar-foreground":"text-muted-foreground group-hover/rail:text-sidebar-foreground";let w;e[44]!==A?(w=Y("line-clamp-2 w-full text-center text-2xs break-words transition-colors",A),e[44]=A,e[45]=w):w=e[45];let C;e[46]!==s.title||e[47]!==w?(C=i.jsx("span",{"aria-hidden":!0,className:w,children:s.title}),e[46]=s.title,e[47]=w,e[48]=C):C=e[48];let R;e[49]!==s.title||e[50]!==a?(R=a("sidebar.rail.closeApp",{name:s.title}),e[49]=s.title,e[50]=a,e[51]=R):R=e[51];let N;e[52]!==l?(N=()=>{ge("org_rail_recent_project_closed"),l()},e[52]=l,e[53]=N):N=e[53];let I,L;e[54]===Symbol.for("react.memo_cache_sentinel")?(I=Y("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"),L=i.jsx(Ae,{size:10}),e[54]=I,e[55]=L):(I=e[54],L=e[55]);let E;e[56]!==R||e[57]!==N?(E=i.jsx("button",{type:"button","aria-label":R,onClick:N,className:I,children:L}),e[56]=R,e[57]=N,e[58]=E):E=e[58];let _;return e[59]!==S||e[60]!==C||e[61]!==E||e[62]!==O?(_=i.jsxs("div",{className:O,children:[S,C,E]}),e[59]=S,e[60]=C,e[61]=E,e[62]=O,e[63]=_):_=e[63],_}const Qt={"site-editor":"/site-editor"};function Zt(t){const e=X.c(26),{app:s}=t,o=J(),r=jt[s],l=Qt[s];if(!r||!l)return null;let n;e[0]!==r.labelKey||e[1]!==o?(n=o(r.labelKey),e[0]=r.labelKey,e[1]=o,e[2]=n):n=e[2];let a;e[3]!==r.labelKey||e[4]!==o?(a=o(r.labelKey),e[3]=r.labelKey,e[4]=o,e[5]=a):a=e[5];let c;e[6]!==r.tone?(c=Y("flex size-9 shrink-0 items-center justify-center rounded-xl focus-ring opacity-100",r.tone),e[6]=r.tone,e[7]=c):c=e[7];let u;e[8]!==r.Icon?(u=i.jsx(r.Icon,{size:18}),e[8]=r.Icon,e[9]=u):u=e[9];let p;e[10]!==a||e[11]!==c||e[12]!==u||e[13]!==l?(p=i.jsx(ce,{asChild:!0,children:i.jsx(Ne,{to:l,"aria-label":a,"aria-current":"page","data-testid":"org-rail-local-app",className:c,children:u})}),e[10]=a,e[11]=c,e[12]=u,e[13]=l,e[14]=p):p=e[14];let m;e[15]!==r.labelKey||e[16]!==o?(m=o(r.labelKey),e[15]=r.labelKey,e[16]=o,e[17]=m):m=e[17];let h;e[18]!==m?(h=i.jsx(de,{side:"right",children:m}),e[18]=m,e[19]=h):h=e[19];let f;e[20]!==p||e[21]!==h?(f=i.jsxs(ue,{children:[p,h]}),e[20]=p,e[21]=h,e[22]=f):f=e[22];let d;return e[23]!==n||e[24]!==f?(d=i.jsx(xe,{active:!0,label:n,children:f}),e[23]=n,e[24]=f,e[25]=d):d=e[25],d}function es(){const{org:t}=Re();return vt(t.slug),null}function Pe(t){const e=X.c(52),{onNavigate:s}=t===void 0?{}:t,o=J(),r=Be(),{org:l}=Re(),{data:n}=Ge(),[a,c]=U.useState(!1),u=ye(),{recent:p,forget:m}=St(l.slug),{projects:h}=wt(),f=zt(),d=yt(),g=d&&d.projectId===null?d.app:null,j=g?[]:p.flatMap(T=>h.filter(H=>H.id===T)),b=Dt(n??[],l),{recent:O,remember:x}=Mt();let v;e[0]===Symbol.for("react.memo_cache_sentinel")?(v=ve.railOrgPrefs(),e[0]=v):v=e[0];const[z,y]=pe(v,ke),S=le(z),A=U.useSyncExternalStore(qt,Yt,Ut),{shown:w}=$t(Bt(b,S,l.slug),O,l.slug,A,S.pinned);let C;e[1]===Symbol.for("react.memo_cache_sentinel")?(C={activationConstraint:{distance:8}},e[1]=C):C=e[1];const R=tt(st(ot,C)),N=T=>{const{active:H,over:re}=T;re&&(ge("org_rail_reordered"),y($e=>Gt(le($e),w.map(ns),String(H.id),String(re.id))))},I=T=>{s?.(),r({to:"/$org/home",params:{org:T},viewTransition:!0})},L=T=>{ge("org_rail_travel");const H=w.some(re=>re.slug===T);y(re=>Wt(le(re),T)),x(T,H?w.map(ss):void 0),I(T)},E=!u&&"border-r border-sidebar-border";let _;e[2]!==E?(_=Y("flex w-[68px] shrink-0 flex-col items-center gap-2.5 overflow-y-auto bg-sidebar px-2.5 pt-3 pb-2 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",E),e[2]=E,e[3]=_):_=e[3];let k;e[4]!==o?(k=o("sidebar.rail.ariaLabel"),e[4]=o,e[5]=k):k=e[5];const F=nt,D=it,$=lt,M=w.map(ts),K=at,W=w.map(T=>i.jsxs(U.Fragment,{children:[i.jsx(Jt,{org:T,active:T.slug===l.slug,pinned:S.pinned.includes(T.slug),onSelect:T.slug!==l.slug?()=>L(T.slug):f?()=>I(T.slug):void 0,onOpenSettings:()=>{s?.(),r({to:"/$org/settings",params:{org:T.slug}})},onTogglePin:()=>y(H=>Ft(le(H),T.slug)),onHide:T.slug===l.slug?void 0:()=>y(H=>Kt(le(H),T.slug))}),T.slug===l.slug&&j.length>0&&i.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:j.map(H=>i.jsx(Vt,{project:H,orgSlug:l.slug,active:f===H.id,onClose:()=>m(H.id),onNavigate:s},H.id))})]},T.id));let P;e[6]!==$||e[7]!==W||e[8]!==M||e[9]!==K?(P=i.jsx($,{items:M,strategy:K,children:W}),e[6]=$,e[7]=W,e[8]=M,e[9]=K,e[10]=P):P=e[10];let q;e[11]!==F||e[12]!==N||e[13]!==R||e[14]!==P||e[15]!==D?(q=i.jsx(F,{sensors:R,collisionDetection:D,onDragEnd:N,children:P}),e[11]=F,e[12]=N,e[13]=R,e[14]=P,e[15]=D,e[16]=q):q=e[16];let B;e[17]!==l.slug||e[18]!==b||e[19]!==w.length||e[20]!==L?(B=b.length>w.length&&i.jsx(Xt,{orgs:b,currentSlug:l.slug,hiddenCount:b.length-w.length,onSelect:L}),e[17]=l.slug,e[18]=b,e[19]=w.length,e[20]=L,e[21]=B):B=e[21];let G;e[22]!==o?(G=o("sidebar.picker.newOrganization"),e[22]=o,e[23]=G):G=e[23];let V;e[24]!==c?(V=()=>c(!0),e[24]=c,e[25]=V):V=e[25];let fe;e[26]===Symbol.for("react.memo_cache_sentinel")?(fe=i.jsx(mt,{size:18}),e[26]=fe):fe=e[26];let Q;e[27]!==G||e[28]!==V?(Q=i.jsx(ce,{asChild:!0,children:i.jsx("button",{type:"button","aria-label":G,onClick:V,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-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:fe})}),e[27]=G,e[28]=V,e[29]=Q):Q=e[29];let Z;e[30]!==o?(Z=o("sidebar.picker.newOrganization"),e[30]=o,e[31]=Z):Z=e[31];let ee;e[32]!==Z?(ee=i.jsx(de,{side:"right",children:Z}),e[32]=Z,e[33]=ee):ee=e[33];let te;e[34]!==Q||e[35]!==ee?(te=i.jsx(xe,{active:!1,children:i.jsxs(ue,{children:[Q,ee]})}),e[34]=Q,e[35]=ee,e[36]=te):te=e[36];let se;e[37]!==g?(se=g&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"my-2 h-px w-6 shrink-0 bg-sidebar-border","aria-hidden":!0}),i.jsx(Zt,{app:g})]}),e[37]=g,e[38]=se):se=e[38];let ne;e[39]!==q||e[40]!==B||e[41]!==te||e[42]!==se||e[43]!==_||e[44]!==k?(ne=i.jsxs("div",{className:_,"aria-label":k,children:[q,B,te,se]}),e[39]=q,e[40]=B,e[41]=te,e[42]=se,e[43]=_,e[44]=k,e[45]=ne):ne=e[45];let ie;e[46]!==a||e[47]!==c?(ie=i.jsx(bt,{open:a,onOpenChange:c}),e[46]=a,e[47]=c,e[48]=ie):ie=e[48];let he;return e[49]!==ne||e[50]!==ie?(he=i.jsxs(i.Fragment,{children:[ne,ie]}),e[49]=ne,e[50]=ie,e[51]=he):he=e[51],he}function ts(t){return t.slug}function ss(t){return t.slug}function ns(t){return t.slug}function is(t){const e=X.c(15),{width:s,minWidth:o,maxWidth:r,onPointerDown:l,onKeyDown:n,onDoubleClick:a}=t,c=J(),{isMobile:u}=Te(),p=ye();if(u||p)return null;let m;e[0]!==c?(m=c("sidebar.sidebarResizeHandle.ariaLabel"),e[0]=c,e[1]=m):m=e[1];let h;e[2]!==c?(h=c("sidebar.sidebarResizeHandle.title"),e[2]=c,e[3]=h):h=e[3];let f,d;e[4]===Symbol.for("react.memo_cache_sentinel")?(f={left:"var(--sidebar-width)"},d=i.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]=f,e[5]=d):(f=e[4],d=e[5]);let g;return e[6]!==r||e[7]!==o||e[8]!==a||e[9]!==n||e[10]!==l||e[11]!==m||e[12]!==h||e[13]!==s?(g=i.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":m,"aria-valuenow":s,"aria-valuemin":o,"aria-valuemax":r,title:h,tabIndex:0,onPointerDown:l,onKeyDown:n,onDoubleClick:a,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize focus-visible:outline-none",style:f,children:d}),e[6]=r,e[7]=o,e[8]=a,e[9]=n,e[10]=l,e[11]=m,e[12]=h,e[13]=s,e[14]=g):g=e[14],g}const je=400,_e=16,rs="sidebar.width.v2";function os(){const t=X.c(14),e=ls;let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=d=>typeof d=="number"?e(d):192,t[0]=s):s=t[0];const[o,r]=pe(rs,s),l=U.useRef(null);let n;t[1]!==r||t[2]!==o?(n=d=>{d.preventDefault();const g=d.clientX,j=e(o),b=l.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),O=b?Array.from(b.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const z of O)z.style.transition="none";const x=z=>{const y=e(j+(z.clientX-g));b?.style.setProperty("--sidebar-width",`${y}px`)},v=z=>{const y=e(j+(z.clientX-g));r(y);for(const S of O)S.style.transition="";window.removeEventListener("pointermove",x),window.removeEventListener("pointerup",v),window.removeEventListener("pointercancel",v),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",x),window.addEventListener("pointerup",v),window.addEventListener("pointercancel",v)},t[1]=r,t[2]=o,t[3]=n):n=t[3];const a=n;let c;t[4]!==r?(c=()=>{r(192)},t[4]=r,t[5]=c):c=t[5];const u=c;let p;t[6]!==r||t[7]!==o?(p=d=>{if(d.key==="ArrowLeft")r(e(o-_e));else if(d.key==="ArrowRight")r(e(o+_e));else if(d.key==="Home")r(192);else if(d.key==="End")r(je);else return;d.preventDefault()},t[6]=r,t[7]=o,t[8]=p):p=t[8];const m=p,h=e(o);let f;return t[9]!==m||t[10]!==a||t[11]!==u||t[12]!==h?(f={width:h,minWidth:192,maxWidth:je,wrapperRef:l,onStartResize:a,onKeyDownResize:m,resetWidth:u},t[9]=m,t[10]=a,t[11]=u,t[12]=h,t[13]=f):f=t[13],f}function ls(t){return Math.max(192,Math.min(je,t))}const De=U.createContext(null);function as(){const t=U.use(De);if(!t)throw new Error("Layout regions require a Layout");return t}function cs({children:t,notice:e,outsideOrg:s}){const o=et(),[r,l]=pe(ve.sidebarOpen(),!0),n=os(),a=Ee();return i.jsx(De,{value:{isMobile:o,resize:n},children:i.jsx(qe,{open:r,onOpenChange:l,children:i.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[e,i.jsxs("div",{className:"flex flex-1 flex-row min-h-0",children:[a&&!s&&i.jsx(es,{}),!o&&a&&(s?.rail??!0)&&i.jsx(Pe,{}),i.jsx(Ye,{ref:n.wrapperRef,className:"flex-1 bg-sidebar relative min-h-0",style:{"--sidebar-width":`${n.width}px`,"--sidebar-width-icon":a?"0px":"3.125rem"},children:i.jsx(Ue,{children:t})})]})]})})})}function ds(t){const e=X.c(37),{children:s,renderMobile:o}=t,r=J(),{isMobile:l,resize:n}=as(),{openMobile:a,setOpenMobile:c}=Te(),u=ye(),p=Ee();let m;e[0]!==c?(m=()=>c(!1),e[0]=c,e[1]=m):m=e[1];const h=m;if(!l){const z=p&&u;let y;e[2]!==s||e[3]!==z?(y=i.jsx("div",{className:"contents",inert:z,children:s}),e[2]=s,e[3]=z,e[4]=y):y=e[4];let S;e[5]!==n.maxWidth||e[6]!==n.minWidth||e[7]!==n.onKeyDownResize||e[8]!==n.onStartResize||e[9]!==n.resetWidth||e[10]!==n.width?(S=i.jsx(is,{width:n.width,minWidth:n.minWidth,maxWidth:n.maxWidth,onPointerDown:n.onStartResize,onKeyDown:n.onKeyDownResize,onDoubleClick:n.resetWidth}),e[5]=n.maxWidth,e[6]=n.minWidth,e[7]=n.onKeyDownResize,e[8]=n.onStartResize,e[9]=n.resetWidth,e[10]=n.width,e[11]=S):S=e[11];let A;return e[12]!==y||e[13]!==S?(A=i.jsxs(i.Fragment,{children:[y,S]}),e[12]=y,e[13]=S,e[14]=A):A=e[14],A}let f;e[15]!==r?(f=r("layouts.shellControls.navigationTitle"),e[15]=r,e[16]=f):f=e[16];let d;e[17]!==f?(d=i.jsx(Ve,{className:"sr-only",children:f}),e[17]=f,e[18]=d):d=e[18];let g;e[19]!==h||e[20]!==p?(g=p&&i.jsx(Pe,{onNavigate:h}),e[19]=h,e[20]=p,e[21]=g):g=e[21];let j;e[22]!==h||e[23]!==o?(j=o({onClose:h}),e[22]=h,e[23]=o,e[24]=j):j=e[24];let b;e[25]!==j?(b=i.jsx("div",{className:"min-w-0 flex-1",children:j}),e[25]=j,e[26]=b):b=e[26];let O;e[27]!==g||e[28]!==b?(O=i.jsxs("div",{className:"flex h-full min-h-0",children:[g,b]}),e[27]=g,e[28]=b,e[29]=O):O=e[29];let x;e[30]!==d||e[31]!==O?(x=i.jsxs(Qe,{side:"left",hideCloseButton:!0,className:"w-screen max-w-none! p-0",onOpenAutoFocus:us,children:[d,O]}),e[30]=d,e[31]=O,e[32]=x):x=e[32];let v;return e[33]!==a||e[34]!==c||e[35]!==x?(v=i.jsx(Ze,{open:a,onOpenChange:c,children:x}),e[33]=a,e[34]=c,e[35]=x,e[36]=v):v=e[36],v}function us(t){return t.preventDefault()}function fs(t){const e=X.c(3),{children:s}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={background:"transparent",containerType:"inline-size"},e[0]=o):o=e[0];let r;return e[1]!==s?(r=i.jsx(Je,{className:"flex flex-col min-h-0",style:o,children:i.jsx(Xe,{variant:"plain",className:"bg-sidebar",children:i.jsx("div",{className:"relative flex-1 min-h-0 flex flex-row",children:s})})}),e[1]=s,e[2]=r):r=e[2],r}const Ls=Object.assign(cs,{Sidebar:ds,Content:fs});export{Is as I,Ls as L,Se as O,Ht as u,Dt as w};