@zeniai/web-cockpit-ui 1.15.65-dev → 1.15.66-dev

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 (265) hide show
  1. package/dist/assets/{ACHDetailsPage-BShpKoIj-DBPKn0sX.js → ACHDetailsPage-BShpKoIj-CW1imKMz.js} +1 -1
  2. package/dist/assets/{AIPerformancePage-CFErwUsE-BYOi4eif.js → AIPerformancePage-CFErwUsE-C9puPCCO.js} +1 -1
  3. package/dist/assets/{AccountInfoPage-B8upbXj9-DVCxjo1L.js → AccountInfoPage-B8upbXj9-Dtz8WQyO.js} +1 -1
  4. package/dist/assets/{AccountInfoPageContent-CKpeDot5-C4xEct6y.js → AccountInfoPageContent-CKpeDot5-DIGFDBxC.js} +1 -1
  5. package/dist/assets/{AccountLockedInfoModal-c30P9O_3-BXRFFhii.js → AccountLockedInfoModal-c30P9O_3-n0xGj_zZ.js} +1 -1
  6. package/dist/assets/{AccountReconDetailsDrawerPage-CO9BYPWm-Det_iJaE.js → AccountReconDetailsDrawerPage-CO9BYPWm-Mg0FsDRd.js} +1 -1
  7. package/dist/assets/{AccountRow-BrW_eEjE-HoBl8v8H.js → AccountRow-BrW_eEjE-DlgTvuFF.js} +1 -1
  8. package/dist/assets/{AccountsPromoCardStack-De2yNNuZ-C74RtM0g.js → AccountsPromoCardStack-De2yNNuZ-G5M7i2un.js} +1 -1
  9. package/dist/assets/{AddAddressForCardDrawer-riOPLnxb-hTaoKUhW.js → AddAddressForCardDrawer-riOPLnxb-4wUmSook.js} +1 -1
  10. package/dist/assets/{AddToWalletPage-CsOmzC7v-XA_Ukf0G.js → AddToWalletPage-CsOmzC7v-DDekkTcs.js} +1 -1
  11. package/dist/assets/{AgingReportsPage-D9I9afnB-j70-fH52.js → AgingReportsPage-D9I9afnB-Pr6LqJHU.js} +1 -1
  12. package/dist/assets/{AllUserItems-Dq7NcP-o-bQnq3Yy5.js → AllUserItems-Dq7NcP-o-BNPnQC3d.js} +1 -1
  13. package/dist/assets/{ApAgingDetailPage-Z5JgfH-e-DlNnTpGB.js → ApAgingDetailPage-Z5JgfH-e-BCqAdteh.js} +1 -1
  14. package/dist/assets/{AppBasePage-B5sDynhi-B6PJcirc.js → AppBasePage-B5sDynhi-CUXe21st.js} +1 -1
  15. package/dist/assets/{AppDrawerContent-D9Q8ir0T-BlV3y7qg.js → AppDrawerContent-D9Q8ir0T-CV--mref.js} +1 -1
  16. package/dist/assets/{ApprovalRulesSettingsPage-DVGvJsQG-g3c3aBsx.js → ApprovalRulesSettingsPage-DVGvJsQG-COBJqCxP.js} +1 -1
  17. package/dist/assets/{ArAgingChart-Tcu0Lja_-DlvMwgJ3.js → ArAgingChart-Tcu0Lja_-Dcd3iM-I.js} +1 -1
  18. package/dist/assets/{ArAgingDetailPage-B5vqkc3v-xHE7Qc0m.js → ArAgingDetailPage-B5vqkc3v-DkiCuj_D.js} +1 -1
  19. package/dist/assets/{AttachmentView-CiYfninr-BohG7XjP.js → AttachmentView-CiYfninr-76W0iAd5.js} +1 -1
  20. package/dist/assets/{BalancesInsightWithToolTip-tiQUQUbX-C692_oh-.js → BalancesInsightWithToolTip-tiQUQUbX-C4adSAUq.js} +1 -1
  21. package/dist/assets/{BankAccountSection-EZtscP2z-aKL8vcpJ.js → BankAccountSection-EZtscP2z-BUefIH5V.js} +1 -1
  22. package/dist/assets/{BankAccountWarningSection-DCfyIUlu-DyMLU3Tg.js → BankAccountWarningSection-DCfyIUlu-CKci9TET.js} +1 -1
  23. package/dist/assets/{BankConnectionsSettingsPage-CQWy9jvt-B-n6frCU.js → BankConnectionsSettingsPage-CQWy9jvt-BdLZIBvy.js} +1 -1
  24. package/dist/assets/{BillDetailPage-pt1k5AQf-BM9-GtkV.js → BillDetailPage-pt1k5AQf-BjT4Ihsm.js} +1 -1
  25. package/dist/assets/{BillPayApprovalRuleDetailPage-Drh7Bhi8-CDpJ0g2R.js → BillPayApprovalRuleDetailPage-Drh7Bhi8-091yCGF7.js} +1 -1
  26. package/dist/assets/{BillPayApprovalRulesPage-Cmyo59xB-pg1tP0xq.js → BillPayApprovalRulesPage-Cmyo59xB-Bc1FlC0c.js} +1 -1
  27. package/dist/assets/{BillPayPromoPage-Dgpz2TLG-BFCcBeGF.js → BillPayPromoPage-Dgpz2TLG-RoPtYKEQ.js} +1 -1
  28. package/dist/assets/{BillPaySetUpPage-B6Pd_eBf-BC27u6lI.js → BillPaySetUpPage-B6Pd_eBf-CWUn729m.js} +1 -1
  29. package/dist/assets/{BillingSettingsPage-CYsvBrFV-BWO0QWBs.js → BillingSettingsPage-CYsvBrFV-DtV08_g9.js} +1 -1
  30. package/dist/assets/{BillsBulkReviewDrawerPage-DNnAmqWz-BQr-aBSF.js → BillsBulkReviewDrawerPage-DNnAmqWz-CEdBVzVe.js} +1 -1
  31. package/dist/assets/{BoxItem-B06DK4G--CNFqY3pV.js → BoxItem-B06DK4G--Bupc4dyY.js} +1 -1
  32. package/dist/assets/{BusinessVerificationPage-Dgk5gyMv-BdAKTgt0.js → BusinessVerificationPage-Dgk5gyMv-BKMYH8C3.js} +1 -1
  33. package/dist/assets/{CardNumberSubText-CcH9jUoZ-BGeGZCAA.js → CardNumberSubText-CcH9jUoZ-mqNKBu9B.js} +1 -1
  34. package/dist/assets/{CashbackDetailPage-5eysaHGf-qWx0m6gR.js → CashbackDetailPage-5eysaHGf-O2irFEC3.js} +1 -1
  35. package/dist/assets/{ChargeCardDetailPage-Diwf-gwZ-DmopcUlO.js → ChargeCardDetailPage-Diwf-gwZ-BUyvgd6i.js} +1 -1
  36. package/dist/assets/{ChargeCardListPage-C-RTGkKK-Bb-QwUsn.js → ChargeCardListPage-C-RTGkKK-DLkixTq5.js} +1 -1
  37. package/dist/assets/{ChargeCardListTable-B-bNbtZQ-Bfw8s7pe.js → ChargeCardListTable-B-bNbtZQ--LQKl6Xj.js} +1 -1
  38. package/dist/assets/{ChargeCardPaymentHistoryPage-Cu-zT5tO-C6SEcidH.js → ChargeCardPaymentHistoryPage-Cu-zT5tO-CNtnC-O7.js} +1 -1
  39. package/dist/assets/{ChargeCardPromoPage-Cz3rNFwM-N71PCrPp.js → ChargeCardPromoPage-Cz3rNFwM-D_0OzJRZ.js} +1 -1
  40. package/dist/assets/{ChargeCardSetupPage-BcTB9Yy5-DkE42DK5.js → ChargeCardSetupPage-BcTB9Yy5-BOaP0LVe.js} +1 -1
  41. package/dist/assets/{ChargeCardStatementsPage-B_ERvgmB-DFHNpOVz.js → ChargeCardStatementsPage-B_ERvgmB-DjHyNuHd.js} +1 -1
  42. package/dist/assets/{CheckDepositDrawerPage-D7_usOVn-C_GuSSOC.js → CheckDepositDrawerPage-D7_usOVn-B0KdoA_b.js} +1 -1
  43. package/dist/assets/{CollapsableReportTable-h0vIfI8o-Bg2RfRDJ.js → CollapsableReportTable-h0vIfI8o-D3Pt-4FZ.js} +1 -1
  44. package/dist/assets/{CompanyOfficerDetailsSection-CWADX4kZ-IHJvDX6-.js → CompanyOfficerDetailsSection-CWADX4kZ-jF_BBJt5.js} +1 -1
  45. package/dist/assets/{CompanyPassportCard-DF9LFrFD-DjueOJ3s.js → CompanyPassportCard-DF9LFrFD-nY8e_5Nd.js} +1 -1
  46. package/dist/assets/{CompanyPassportPage-BtAopyLq-DbU6xdRd.js → CompanyPassportPage-BtAopyLq-BcF__FaA.js} +1 -1
  47. package/dist/assets/{CompleteProfile-CsbsHQ0p-BLF2mnNn.js → CompleteProfile-CsbsHQ0p-Da1z9Z7H.js} +1 -1
  48. package/dist/assets/{ConfettiBurst-duD341Gp-Bb3-s_zN.js → ConfettiBurst-duD341Gp-CRM9LgmA.js} +1 -1
  49. package/dist/assets/{ConstrainedInnerElement-hv51KpGg-DTOZooRA.js → ConstrainedInnerElement-hv51KpGg-CXln6N2t.js} +1 -1
  50. package/dist/assets/{CreateOrEditVendorPage-C2xU6c51-DT9rwnbq.js → CreateOrEditVendorPage-C2xU6c51-B-kxLo4f.js} +1 -1
  51. package/dist/assets/{CreditCardPaymentDrawerPage-CeagMaCu-D6hhhd3N.js → CreditCardPaymentDrawerPage-CeagMaCu-tu_QZ5if.js} +1 -1
  52. package/dist/assets/{CurrencySelectField-B8EoF2aF-uavVFTum.js → CurrencySelectField-B8EoF2aF-GOW4qR7m.js} +1 -1
  53. package/dist/assets/{CustomerOnboardingActivationPage-CIeR2XvU-B59q7JSL.js → CustomerOnboardingActivationPage-CIeR2XvU-CK8C5kkD.js} +1 -1
  54. package/dist/assets/CustomerOnboardingContainerPage-DVL4s-eV-BLPiI0Mv.js +1 -0
  55. package/dist/assets/{CustomerOnboardingDetailPageSkeleton-kUbwh2r2-zrrFUTGk.js → CustomerOnboardingDetailPageSkeleton-kUbwh2r2-J-3HD8z8.js} +1 -1
  56. package/dist/assets/{CustomerOnboardingNoStepsPage-Br0jy7Pu-C04-tCb6.js → CustomerOnboardingNoStepsPage-Br0jy7Pu-ChmYYCLk.js} +1 -1
  57. package/dist/assets/{CustomerOnboardingPage-Dm2Si769-DsN6K-ie.js → CustomerOnboardingPage-Dm2Si769-D58-iBoA.js} +1 -1
  58. package/dist/assets/{CustomerOnboardingProductSuitePage-Cz81Q5jC-eSuGAIqK.js → CustomerOnboardingProductSuitePage-Cz81Q5jC-n81ts80h.js} +1 -1
  59. package/dist/assets/{Dashboard-DReG_aaf-C4aSoq3o.js → Dashboard-DReG_aaf-DwSOFg0b.js} +1 -1
  60. package/dist/assets/{DashboardReportPage-BXSlwsR7-4jSB_qXZ.js → DashboardReportPage-BXSlwsR7-CQ7UXe-C.js} +1 -1
  61. package/dist/assets/{DashboardSidebarBackgroundAnimation-B3dtVAe2-BBvO3tiT.js → DashboardSidebarBackgroundAnimation-B3dtVAe2-B6yGX6Ah.js} +1 -1
  62. package/dist/assets/{DepositAccTransactionItem-YuSXjbLh-dhpmj79R.js → DepositAccTransactionItem-YuSXjbLh-C2vDDOod.js} +1 -1
  63. package/dist/assets/{DepositAccTransactionListPage-C-FAvZwD-5kKsnSxM.js → DepositAccTransactionListPage-C-FAvZwD-BbAq4nWD.js} +1 -1
  64. package/dist/assets/{DomesticWireDetailsPage-BaiSpc0N-BaNvy8Dj.js → DomesticWireDetailsPage-BaiSpc0N-DnjTEbYw.js} +1 -1
  65. package/dist/assets/{DownloadOverlay-BpRKCn-0-GQtzMlpD.js → DownloadOverlay-BpRKCn-0-CHKRQCgV.js} +1 -1
  66. package/dist/assets/{DrawerPage-DQ3Xuekx-71bFG_xW.js → DrawerPage-DQ3Xuekx-B9p3dBku.js} +1 -1
  67. package/dist/assets/{EditPeoplePage-8DalSMWH-BO--FbCf.js → EditPeoplePage-8DalSMWH-Ckh9exV5.js} +1 -1
  68. package/dist/assets/{EditReimbursementDetailPage-CC2BjMkR-BrDBl4Nx.js → EditReimbursementDetailPage-CC2BjMkR-CV9Xwg25.js} +1 -1
  69. package/dist/assets/{EntityDetailPage-fmWuxHTZ-BEOMoyTE.js → EntityDetailPage-fmWuxHTZ-DJDbCj57.js} +1 -1
  70. package/dist/assets/{EntitySummarySection-vsEMiXYh-UA5Y35sl.js → EntitySummarySection-vsEMiXYh-CDZa-Mc3.js} +1 -1
  71. package/dist/assets/{ExpenseAutomationOverviewPage-B3HPfIsK-4ZtjmO8G.js → ExpenseAutomationOverviewPage-B3HPfIsK-CWN4kP2X.js} +1 -1
  72. package/dist/assets/{ExpenseAutomationPage-4LJefgNh-YH8canW3.js → ExpenseAutomationPage-4LJefgNh-isL_Jc14.js} +1 -1
  73. package/dist/assets/{ExpressPayPage-BH7oCW_F-HW0llOdu.js → ExpressPayPage-BH7oCW_F-ls2gqEkj.js} +1 -1
  74. package/dist/assets/{FeaturePreviewPage-DSv61BhF-rk5VNvfQ.js → FeaturePreviewPage-DSv61BhF-D3bUAc_I.js} +1 -1
  75. package/dist/assets/{FollowStepsSection-Bgy9MpO4-DCiZAX41.js → FollowStepsSection-Bgy9MpO4-DjmY6ECY.js} +1 -1
  76. package/dist/assets/{GlobalReviewListPage-VRq_gimm-D4JxkgEf.js → GlobalReviewListPage-VRq_gimm-BJViyoax.js} +1 -1
  77. package/dist/assets/{InformationCardStack-rx0fypl3-C50dsns2.js → InformationCardStack-rx0fypl3-PVL5sP4g.js} +1 -1
  78. package/dist/assets/{InsightsCardStack-uJWMkIZL-k2gW7JtA.js → InsightsCardStack-uJWMkIZL-BMcef6eP.js} +1 -1
  79. package/dist/assets/{InsightsSection-ByFf2oGn-BaSZhycl.js → InsightsSection-ByFf2oGn-v8_DJRM0.js} +1 -1
  80. package/dist/assets/{IntegrationsSettingsPage-Cj01Nub6-JLccDpyu.js → IntegrationsSettingsPage-Cj01Nub6-Ckk6jPFc.js} +1 -1
  81. package/dist/assets/{InternationalWireSwiftDetailsPage-C2PM97sv-CXe5WYRW.js → InternationalWireSwiftDetailsPage-C2PM97sv-DZ12UKs3.js} +1 -1
  82. package/dist/assets/{InternationalWireVerificationPage-Cr3sDrT--Bq6HNEU0.js → InternationalWireVerificationPage-Cr3sDrT--DP2ZfrSL.js} +1 -1
  83. package/dist/assets/{InviteFormPage-dsMpScvq-CF55W3d2.js → InviteFormPage-dsMpScvq-CwRYtYza.js} +1 -1
  84. package/dist/assets/{InvitePageListView-e7vGSbFa-wcp0OLc4.js → InvitePageListView-e7vGSbFa-DcUjhdI-.js} +1 -1
  85. package/dist/assets/{InvitePeoplePage-BT_YVCP4-yRtlk6wv.js → InvitePeoplePage-BT_YVCP4-CgT1m3Z3.js} +1 -1
  86. package/dist/assets/{InvoiceUploadSection-Dg1-uunA-DejmnF3G.js → InvoiceUploadSection-Dg1-uunA-CW2z21hh.js} +1 -1
  87. package/dist/assets/{IssueChargeCardPage-CyF9wrb0-DIt_LpMY.js → IssueChargeCardPage-CyF9wrb0-CEZ2-O-B.js} +1 -1
  88. package/dist/assets/{LabeledAddressValue-3l0Bv00--DmuSRVDq.js → LabeledAddressValue-3l0Bv00--CRsMpkI1.js} +1 -1
  89. package/dist/assets/{LabeledAddressValueField-F9kvUR_r-BCeaFKsb.js → LabeledAddressValueField-F9kvUR_r--rBMYRFp.js} +1 -1
  90. package/dist/assets/{LabeledControlledCheckBoxField-BgC8y0D6-Cxk0wWCO.js → LabeledControlledCheckBoxField-BgC8y0D6-BL02IYWO.js} +1 -1
  91. package/dist/assets/{LabeledCountryMultiSelectField-3qI_4noU-BCLCbVPc.js → LabeledCountryMultiSelectField-3qI_4noU-BwwxeoBQ.js} +1 -1
  92. package/dist/assets/{LabeledCreatableSingleSelectField-BV3h9bh7-BAj07yW-.js → LabeledCreatableSingleSelectField-BV3h9bh7-D2WoBuGQ.js} +1 -1
  93. package/dist/assets/{LabeledDocumentField-rriEcsdr-CkxtZhMI.js → LabeledDocumentField-rriEcsdr-DuJ2zUxk.js} +1 -1
  94. package/dist/assets/{LabeledDropDownFormattedTextField-DoVSg3nZ-Be0l5Q_z.js → LabeledDropDownFormattedTextField-DoVSg3nZ-k-dWGYUh.js} +1 -1
  95. package/dist/assets/{LabeledText-DGZ7hxY4-IuE8fmYf.js → LabeledText-DGZ7hxY4-DsEkDfJy.js} +1 -1
  96. package/dist/assets/{LabeledUserSingleSelectWithSubtitlesField-DI07Eicg-DgE4V-VP.js → LabeledUserSingleSelectWithSubtitlesField-DI07Eicg-BdZT_J4k.js} +1 -1
  97. package/dist/assets/{LabeledZeniRolesDropDownField-jIrTovp--Bw9Copum.js → LabeledZeniRolesDropDownField-jIrTovp--BhxE0P_I.js} +1 -1
  98. package/dist/assets/{LinkJETransactionPage-Bvbqpltz-Bc-21K8g.js → LinkJETransactionPage-Bvbqpltz-HF3tsHRK.js} +1 -1
  99. package/dist/assets/{LockCardPage-DyEQBJYx-BLiE9GBP.js → LockCardPage-DyEQBJYx-Cp9KP7Ha.js} +1 -1
  100. package/dist/assets/{LowBalancePopup-C2vHKMNF-PKO6ElPE.js → LowBalancePopup-C2vHKMNF-bdPNLfbg.js} +1 -1
  101. package/dist/assets/{MagicLinkACHDetailsPage-lAAwAtH7-SJ0jUK4M.js → MagicLinkACHDetailsPage-lAAwAtH7-Ck-bBlpT.js} +1 -1
  102. package/dist/assets/{MagicLinkDomesticWireDetailsPage-cv823ASo-DimLQOFo.js → MagicLinkDomesticWireDetailsPage-cv823ASo-o8N9E1Vn.js} +1 -1
  103. package/dist/assets/{MagicLinkInternationalWireDetailsPage-C_SjsgC9-Bvgil6AB.js → MagicLinkInternationalWireDetailsPage-C_SjsgC9-VMrnWF1u.js} +1 -1
  104. package/dist/assets/{MagicLinkSuccessPage-B1LBYM2F-BYLLbXss.js → MagicLinkSuccessPage-B1LBYM2F-6icyR0Uu.js} +1 -1
  105. package/dist/assets/{MagicLinkTitleSection-ClAnBBt9-CxQuR-QP.js → MagicLinkTitleSection-ClAnBBt9-BG2qP1eV.js} +1 -1
  106. package/dist/assets/{MailingDetailsSection-9_XLl4bT-BB3mmWQ9.js → MailingDetailsSection-9_XLl4bT-aum9pUe4.js} +1 -1
  107. package/dist/assets/{MyBankConnectionsSettingsPage-CBNYcuP4-DwZ11Kbp.js → MyBankConnectionsSettingsPage-CBNYcuP4-JphRdcv2.js} +1 -1
  108. package/dist/assets/{MyPendingActivationChargeCardListPage-n71n40uQ-DzAksyAj.js → MyPendingActivationChargeCardListPage-n71n40uQ-Dl2qH7gb.js} +1 -1
  109. package/dist/assets/{MyProfileSettingsPage-BUMIjZYc-CtFmjBIE.js → MyProfileSettingsPage-BUMIjZYc-Bnuq---Y.js} +1 -1
  110. package/dist/assets/{NavBarWithPicker-CbjFNysh-BLH7wXCB.js → NavBarWithPicker-CbjFNysh-fM8X8YaY.js} +1 -1
  111. package/dist/assets/{NavigationArrow-Dpc7u6y4-94AYlIy-.js → NavigationArrow-Dpc7u6y4-BiRqyGkx.js} +1 -1
  112. package/dist/assets/{NavigationDots-DCpslVnm-BIAw9fTc.js → NavigationDots-DCpslVnm-DccClgwI.js} +1 -1
  113. package/dist/assets/{NewGlobalMerchantPage-B10sY6Q_-Owh-T5As.js → NewGlobalMerchantPage-B10sY6Q_-VgMXWXS2.js} +1 -1
  114. package/dist/assets/{NoDataChart-9-bhq204-jF2VPuzU.js → NoDataChart-9-bhq204-Mk2SpDph.js} +1 -1
  115. package/dist/assets/{NoDataTable-C6Q2Anpz-DB9htpIj.js → NoDataTable-C6Q2Anpz-DUKNluuK.js} +1 -1
  116. package/dist/assets/{NotFoundPage-4mPhXD5--Dq1iR5VQ.js → NotFoundPage-4mPhXD5--D8Xe2RH2.js} +1 -1
  117. package/dist/assets/{NotificationSettingsPage-BTxCoB_b-BHZscHCj.js → NotificationSettingsPage-BTxCoB_b-EQULZcKC.js} +1 -1
  118. package/dist/assets/{NotificationsListConfig-CylnViXd-Dg2fm6St.js → NotificationsListConfig-CylnViXd-BsFR_NcM.js} +1 -1
  119. package/dist/assets/{NotificationsPage-D41h0mS6-Dzdq9z4a.js → NotificationsPage-D41h0mS6-Bb6S9Jk3.js} +1 -1
  120. package/dist/assets/{OpExByVendorPage-BV_uJSCh-BHuftqJi.js → OpExByVendorPage-BV_uJSCh-DSWgiZdt.js} +1 -1
  121. package/dist/assets/{OverlayContainerPage-CkUYOhlh-ChB_ia4V.js → OverlayContainerPage-CkUYOhlh-BnCo9_OT.js} +1 -1
  122. package/dist/assets/{PandLWithForecastPage-Cj3UWjG4-Ufv6uGVt.js → PandLWithForecastPage-Cj3UWjG4-Daok_AzA.js} +1 -1
  123. package/dist/assets/{PaymentAccountSetupBillingAddressSection-BWFl695q-DUUCCWV6.js → PaymentAccountSetupBillingAddressSection-BWFl695q-CDWvoSql.js} +1 -1
  124. package/dist/assets/{PeoplePage-DcGqWtAP-CfVqJS-U.js → PeoplePage-DcGqWtAP-DkPagYKu.js} +1 -1
  125. package/dist/assets/{Preview-DHku7oFH.js → Preview-Cc9vKqgF.js} +1 -1
  126. package/dist/assets/{ProductsCarousel-C9JoJQeH-7TCp-gr7.js → ProductsCarousel-C9JoJQeH-x81n9I1l.js} +1 -1
  127. package/dist/assets/{PromoBaseCards-mFk7SsOr-cB2eyHgD.js → PromoBaseCards-mFk7SsOr-qtCHMf8v.js} +1 -1
  128. package/dist/assets/{QBOConnectionDialog-CJsIrEZq-Djdbh1G7.js → QBOConnectionDialog-CJsIrEZq-Cv6iSpTz.js} +1 -1
  129. package/dist/assets/{QBOSetupSection-C_fqHza_-B8WpC_yY.js → QBOSetupSection-C_fqHza_-DgpfNI-0.js} +1 -1
  130. package/dist/assets/{ReimbursementApprovalRuleDetailPage-BMZnKpsk-CX5NlTL7.js → ReimbursementApprovalRuleDetailPage-BMZnKpsk-C2eUzL_F.js} +1 -1
  131. package/dist/assets/{ReimbursementApprovalRulesPage-C2zNa8dT-CGtrNpR7.js → ReimbursementApprovalRulesPage-C2zNa8dT-BewT1FOV.js} +1 -1
  132. package/dist/assets/{ReimbursementDetailPage-B1o8ea57-BrBovHlf.js → ReimbursementDetailPage-B1o8ea57-DRCLvjWj.js} +1 -1
  133. package/dist/assets/{ReimbursementPromoPage-Df5QmXzC-CzrrekBH.js → ReimbursementPromoPage-Df5QmXzC-CiqDm3oM.js} +1 -1
  134. package/dist/assets/{ReimbursementSetUpPage-D450RVsP-BNS45RtV.js → ReimbursementSetUpPage-D450RVsP-CoGf8qvT.js} +1 -1
  135. package/dist/assets/{ReimbursementsBulkReviewDrawerPage-DwgKrhlQ-BYy6jU6w.js → ReimbursementsBulkReviewDrawerPage-DwgKrhlQ-qH0UNUqD.js} +1 -1
  136. package/dist/assets/{ReloadCard-D5cvzWxe-BSJWwb6T.js → ReloadCard-D5cvzWxe-B3IyXnq9.js} +1 -1
  137. package/dist/assets/{ReportTableViewSelector-Ig41fOPb-DyEm5Q02.js → ReportTableViewSelector-Ig41fOPb-CLRRGAhe.js} +1 -1
  138. package/dist/assets/{ReportsPage-CRAVAUTO-D_QRWGM1.js → ReportsPage-CRAVAUTO-Cw7xKvAS.js} +1 -1
  139. package/dist/assets/{RevenueChart-DtQu0KAn-DJYGsojB.js → RevenueChart-DtQu0KAn-D8weCECA.js} +1 -1
  140. package/dist/assets/{ReviewDetailsPage-vui4TqeA-gjxKkEYH.js → ReviewDetailsPage-vui4TqeA-D-XziIJQ.js} +1 -1
  141. package/dist/assets/{ReviewOverlay-CUnL7H-a-BjFaE0id.js → ReviewOverlay-CUnL7H-a-17YpOTAb.js} +1 -1
  142. package/dist/assets/{RoleWithToolTip-x2rnvWn9-BzchKu5T.js → RoleWithToolTip-x2rnvWn9-Decoe-vI.js} +1 -1
  143. package/dist/assets/{ScheduleDetailsFixedAssetsPage-D_Cls2jC-CNWyfY4t.js → ScheduleDetailsFixedAssetsPage-D_Cls2jC-BwmKM1Tl.js} +1 -1
  144. package/dist/assets/{ScheduleDetailsPage-DmSLuM8g-5vyMikmE.js → ScheduleDetailsPage-DmSLuM8g-DYOZWouJ.js} +1 -1
  145. package/dist/assets/{ScheduleSequenceTable-js9_P_Lo-CeLb4ONW.js → ScheduleSequenceTable-js9_P_Lo-CzCZ3H3Q.js} +1 -1
  146. package/dist/assets/{ScreenRoutes-ziq-yiHW.js → ScreenRoutes-VDuiXW2A.js} +1 -1
  147. package/dist/assets/{SetUpAccountSection-DYRWWXcL-D3Lz2J4N.js → SetUpAccountSection-DYRWWXcL-CqyVY0zk.js} +1 -1
  148. package/dist/assets/{SignIn-CUJkZb3S-DEoVYbuM.js → SignIn-CUJkZb3S-BQ5cYlKz.js} +1 -1
  149. package/dist/assets/{SignInScreen-CMKiwyNN.js → SignInScreen-BxnvlP3D.js} +1 -1
  150. package/dist/assets/{SpendManagementListViewPage-BieufnDb-DWfo1rZv.js → SpendManagementListViewPage-BieufnDb-DsSgx26K.js} +3 -3
  151. package/dist/assets/{SpendManagementPerTabPage-BmUp80QX-D3VMwaS-.js → SpendManagementPerTabPage-BmUp80QX-_fIZmx1n.js} +1 -1
  152. package/dist/assets/{SpendManagementSection-DKZNTYXT-mbKmW3pW.js → SpendManagementSection-DKZNTYXT-Y5i2WptS.js} +1 -1
  153. package/dist/assets/{StatementItem-Dyt5Q0eR-DHmcaJ-e.js → StatementItem-Dyt5Q0eR-ge2odajX.js} +1 -1
  154. package/dist/assets/{StatementsPage-CbtnJM5y-COycJvfL.js → StatementsPage-CbtnJM5y-D7odQb22.js} +1 -1
  155. package/dist/assets/{StatusSwitcher-BfQ9VbBH-DC0t3Flj.js → StatusSwitcher-BfQ9VbBH-B-KO1Buq.js} +1 -1
  156. package/dist/assets/{SubTabSwitcher-CzGiuhk3-DLbV8WBg.js → SubTabSwitcher-CzGiuhk3-BJdsqPl7.js} +1 -1
  157. package/dist/assets/{SummaryCard-D61xzK3a-DMSW9KNv.js → SummaryCard-D61xzK3a-D5OwtVH7.js} +1 -1
  158. package/dist/assets/{TaskManagementPage-ucVAdv7x-AkXJlFwQ.js → TaskManagementPage-ucVAdv7x-DzPLVMfi.js} +1 -1
  159. package/dist/assets/{TimeRangeSwitcher-C3jXm39I-tjiVSjZN.js → TimeRangeSwitcher-C3jXm39I-pg9s0UqV.js} +1 -1
  160. package/dist/assets/{TimeframeSwitcher-CcYg-YQJ-C2j1iPoK.js → TimeframeSwitcher-CcYg-YQJ-B8uZpFtx.js} +1 -1
  161. package/dist/assets/{TimeframeSwitcherWithToggle-w4YJno-p-Bi4h2wB2.js → TimeframeSwitcherWithToggle-w4YJno-p-B2pTF6KS.js} +1 -1
  162. package/dist/assets/{TopExCard-D2PRxvFc-DTkmCs_e.js → TopExCard-D2PRxvFc-jwp5OjNB.js} +1 -1
  163. package/dist/assets/{TopExDetailPage-C0uHdU7N-CkEVyz2B.js → TopExDetailPage-C0uHdU7N-D9KWDen5.js} +1 -1
  164. package/dist/assets/{TransactionActivityLogPage-CqYb19tY-v__opMvt.js → TransactionActivityLogPage-CqYb19tY-BvG_2MHQ.js} +1 -1
  165. package/dist/assets/{TransactionDetailPage-D-NR_yZG-DdONq5Tf.js → TransactionDetailPage-D-NR_yZG-DLNp0Ym3.js} +1 -1
  166. package/dist/assets/{TransactionList-f6yB-byH-Oxgdaak4.js → TransactionList-f6yB-byH-BeXigMDL.js} +1 -1
  167. package/dist/assets/{TransactionListBig-BrDWayQS-C0zQ3f5X.js → TransactionListBig-BrDWayQS-DsH6Jycs.js} +1 -1
  168. package/dist/assets/{TransactionListPage-C-Z62y2d-DnIWNXku.js → TransactionListPage-C-Z62y2d-BZTkx2mc.js} +1 -1
  169. package/dist/assets/{TransactionVendorDetailPage-CQQuAR6V-Dt6j0ppt.js → TransactionVendorDetailPage-CQQuAR6V-D21ZQKzj.js} +1 -1
  170. package/dist/assets/{TransferDrawerPage-DfFm-1-3-Dp1b_ezH.js → TransferDrawerPage-DfFm-1-3-DcsnoXjo.js} +1 -1
  171. package/dist/assets/{TreasuryOverviewPage-CKSanlUG-BJ3RsJkb.js → TreasuryOverviewPage-CKSanlUG-CsJ07wXK.js} +1 -1
  172. package/dist/assets/{TreasuryPromoPage-Dyip3H10-ClQVvPZy.js → TreasuryPromoPage-Dyip3H10-BFjPECcI.js} +1 -1
  173. package/dist/assets/{TreasuryStatementsPage-mljf2Van-DInZXjo_.js → TreasuryStatementsPage-mljf2Van-CKwUR6NQ.js} +1 -1
  174. package/dist/assets/{TreasuryTaxLetterPage-D3cV3a-8-CcMHT6vj.js → TreasuryTaxLetterPage-D3cV3a-8-L4BwstYA.js} +1 -1
  175. package/dist/assets/{TrendChart-fFlHCvNx-DADa9lxz.js → TrendChart-fFlHCvNx--8jxSfa_.js} +1 -1
  176. package/dist/assets/{TrendWithTransactions-It4KDov3-BNez-K-6.js → TrendWithTransactions-It4KDov3-uJUU6y8f.js} +1 -1
  177. package/dist/assets/{UncategorizedAccountsMappingPage-BxBz2Ce0-BSZYER7A.js → UncategorizedAccountsMappingPage-BxBz2Ce0-CNPxhzU9.js} +1 -1
  178. package/dist/assets/{UnitIntegrationPage-gVgsk2ji-Dz79ORBq.js → UnitIntegrationPage-gVgsk2ji-COCsJfhk.js} +1 -1
  179. package/dist/assets/{UploadAdditionalDocumentOverlay-C5m8jqup-5PpZVQjf.js → UploadAdditionalDocumentOverlay-C5m8jqup-S0ohEV34.js} +1 -1
  180. package/dist/assets/{Vendor2FAPopup-DRwBzOwn-C-SwMKWw.js → Vendor2FAPopup-DRwBzOwn-DhtM-fsI.js} +1 -1
  181. package/dist/assets/{VendorACHDetailsPage-By2Ya2bv-CjVBmCig.js → VendorACHDetailsPage-By2Ya2bv-q_tye6Vo.js} +1 -1
  182. package/dist/assets/{VendorDetailPage-jci1LqX3-QbESQx0s.js → VendorDetailPage-jci1LqX3-BiOnbd3f.js} +1 -1
  183. package/dist/assets/{VendorDomesticWireDetailsPage-uIDE-n5v-CEtT0uGT.js → VendorDomesticWireDetailsPage-uIDE-n5v-CXJb5J3y.js} +1 -1
  184. package/dist/assets/{VendorFiling1099EditablePage-8pYT3u-X-D-wgniGH.js → VendorFiling1099EditablePage-8pYT3u-X-D_UDyuhP.js} +1 -1
  185. package/dist/assets/{VendorFirstReviewPage-CafakxA1-CDJXyRr2.js → VendorFirstReviewPage-CafakxA1-DLht7hvz.js} +1 -1
  186. package/dist/assets/{VendorInternationalWireDetailsPage-DJeI-ZFW-DlATitk5.js → VendorInternationalWireDetailsPage-DJeI-ZFW-Y_m9RvHt.js} +1 -1
  187. package/dist/assets/{VendorInternationalWireSwiftDetailsPage-Co-5nTam-Dq9Sjb3M.js → VendorInternationalWireSwiftDetailsPage-Co-5nTam-2AgQI36C.js} +1 -1
  188. package/dist/assets/{VendorsAccountsSection-YX2g8ETe-D60z7JWq.js → VendorsAccountsSection-YX2g8ETe-e-Ebd3i7.js} +1 -1
  189. package/dist/assets/{VerifyDevice-DeHW4GAi-COYWduJ8.js → VerifyDevice-DeHW4GAi-BrrxSvi2.js} +1 -1
  190. package/dist/assets/{VideoPlayer-DxIfGrPu-_quRL0IB.js → VideoPlayer-DxIfGrPu-DG9_29pb.js} +2 -2
  191. package/dist/assets/{VideoPopup-CUP7ctgS-CvuTwYjE.js → VideoPopup-CUP7ctgS-CnQZCBbO.js} +1 -1
  192. package/dist/assets/{WarningsDrawerPage--s6b380L-kLxITMYx.js → WarningsDrawerPage--s6b380L-BvzCi6Jk.js} +1 -1
  193. package/dist/assets/{ZeniAccountDetailPage-7NdkdSg3-DUqxr3Vg.js → ZeniAccountDetailPage-7NdkdSg3-CzyDTlLy.js} +1 -1
  194. package/dist/assets/{ZeniAccountListViewPage-B-cs_xnc-yymuGC8c.js → ZeniAccountListViewPage-B-cs_xnc-CitANkcs.js} +1 -1
  195. package/dist/assets/{ZeniAccountNavBarPieces-CjRip0v9-CWaUJ8t5.js → ZeniAccountNavBarPieces-CjRip0v9-fqy5uhYF.js} +1 -1
  196. package/dist/assets/{ZeniAccountPromoPage-BikXtkeH-CZNOzkma.js → ZeniAccountPromoPage-BikXtkeH-DjpOin1U.js} +1 -1
  197. package/dist/assets/{ZeniAccountSetupPage-BRBsijVt-4J2hs6F_.js → ZeniAccountSetupPage-BRBsijVt-CVgD2Uf6.js} +1 -1
  198. package/dist/assets/{ZeniCopyright-DDGvdmLF-BbItEQ1K.js → ZeniCopyright-DDGvdmLF-447g6hlp.js} +1 -1
  199. package/dist/assets/{ZeniTransferAmountSlider-Cdg0TlHk-C5Juk6O6.js → ZeniTransferAmountSlider-Cdg0TlHk-DPnsENMy.js} +1 -1
  200. package/dist/assets/{add-to-wallet-DgdBD8_G-BPAwAHT2.js → add-to-wallet-DgdBD8_G-Tvhq1Gb8.js} +1 -1
  201. package/dist/assets/{analytics-B3XlZNQ8.js → analytics-BSh5cBTM.js} +1 -1
  202. package/dist/assets/{analyticsHelper-D9xdJK4b-C8beHKtm.js → analyticsHelper-D9xdJK4b-DdFbzSx8.js} +1 -1
  203. package/dist/assets/{analyticsHelper-Bnej6boJ.js → analyticsHelper-DOE_CVQ_.js} +1 -1
  204. package/dist/assets/{arrow-south-east-round-PEovUgvH-DYcTfV8-.js → arrow-south-east-round-PEovUgvH-D9NhRqZJ.js} +1 -1
  205. package/dist/assets/{auto-transfer-rule-mbafm5D3-C0L9GopF.js → auto-transfer-rule-mbafm5D3-Bd8ltJD0.js} +1 -1
  206. package/dist/assets/{chartTypes-Dq3hUz_T-D0weDXco.js → chartTypes-Dq3hUz_T-CZIhQYGg.js} +1 -1
  207. package/dist/assets/{commonDimensions-CGHIQ2To-BXIDDuOd.js → commonDimensions-CGHIQ2To-ChTwXt2F.js} +1 -1
  208. package/dist/assets/{commonTypes-BAJPaPYg-BqOkop1Y.js → commonTypes-BAJPaPYg-ZRT2EIAq.js} +1 -1
  209. package/dist/assets/{constants-BcG8RJNm.js → constants-Ca2l-eSK.js} +1 -1
  210. package/dist/assets/{core-DTlL91ob.js → core-BBKQkJb7.js} +1 -1
  211. package/dist/assets/{dash.all.min-wCYxg1-F.js → dash.all.min-DzQe-Q97.js} +1 -1
  212. package/dist/assets/{downloadPdf-BI2Y41h2-DmQ3wa5x.js → downloadPdf-BI2Y41h2-CJxUrMkc.js} +1 -1
  213. package/dist/assets/{empty-DTLC6acq.js → empty-BAhHXN-J.js} +1 -1
  214. package/dist/assets/{empty-9h6tGMxX.js → empty-CvQ9mfdA.js} +1 -1
  215. package/dist/assets/{epic-CSBGbcOS.js → epic-DPl_yeEQ.js} +1 -1
  216. package/dist/assets/{gift-box-Cmt9OgIZ-CvfvQG3y.js → gift-box-Cmt9OgIZ-DeI78FXp.js} +1 -1
  217. package/dist/assets/{graphic-no-data-l-DU4J8fDt-ChqWps-8.js → graphic-no-data-l-DU4J8fDt-l3Wpg2uF.js} +1 -1
  218. package/dist/assets/{graphic-no-data-net-burn-l-CzmycA0m-1sZH3huZ.js → graphic-no-data-net-burn-l-CzmycA0m-Dyry9S3b.js} +1 -1
  219. package/dist/assets/{handshake-BPg58FML-C8qC_oIS.js → handshake-BPg58FML-CAcdkk5J.js} +1 -1
  220. package/dist/assets/{helper-z5-P4a-y-DCqj7mqg.js → helper-z5-P4a-y-BjC38EFp.js} +1 -1
  221. package/dist/assets/{index-CTllXPEB.js → index-BSFE83ps.js} +1 -1
  222. package/dist/assets/{index-DA1Z8sqg.js → index-C2tYLV1-.js} +1 -1
  223. package/dist/assets/{index-CXoFWELS.js → index-CbQy18LL.js} +1 -1
  224. package/dist/assets/{index-BRlvHWYX.js → index-Co5CHcL-.js} +1 -1
  225. package/dist/assets/{index-DivE10Xm.js → index-D1n9iNXR.js} +1 -1
  226. package/dist/assets/{index-BTxAEBwp.js → index-Di0PzFTw.js} +1 -1
  227. package/dist/assets/{index-nssLOVFu.js → index-DmJDLobC.js} +6 -6
  228. package/dist/assets/{lexical-CoKvBbaA.js → lexical-CC2d_kE2.js} +1 -1
  229. package/dist/assets/{liveblocks-offUbtxr.js → liveblocks-D1Gf9COF.js} +1 -1
  230. package/dist/assets/{lottie-Cqel28AC.js → lottie-B-DVrXwa.js} +1 -1
  231. package/dist/assets/{mapLoadingInProgressToTreeNode-DrC2Zs2y-BuaBdgp1.js → mapLoadingInProgressToTreeNode-DrC2Zs2y-BjsjwyTG.js} +1 -1
  232. package/dist/assets/{mapSectionWithAcOnlyToTreeNode-dsBogxKz-D78gQ4Dn.js → mapSectionWithAcOnlyToTreeNode-dsBogxKz-4f0Ul0l4.js} +1 -1
  233. package/dist/assets/{mapSpacerToTreeNode-DMDEaLzQ-ibbyX8vz.js → mapSpacerToTreeNode-DMDEaLzQ-V5HoG67-.js} +1 -1
  234. package/dist/assets/{mapTimeframeBalancesToTreeNode-CW_wzI5T-he6bfb8d.js → mapTimeframeBalancesToTreeNode-CW_wzI5T-DDDj-Taw.js} +1 -1
  235. package/dist/assets/{mapTimeframeBalancesToTreeNode-DvfKBCs5-GyIWCN5D.js → mapTimeframeBalancesToTreeNode-DvfKBCs5-BZ6MszHu.js} +1 -1
  236. package/dist/assets/{mapTimeframeHeaderLoadingInProgressToTreeNode-CGdkzFsp-DlA9TyjC.js → mapTimeframeHeaderLoadingInProgressToTreeNode-CGdkzFsp-LJEHXizn.js} +1 -1
  237. package/dist/assets/{mui-BVCBQYdL.js → mui-Bgk_7_3h.js} +1 -1
  238. package/dist/assets/{page-detail-CWX5S47F-D1vlmLcE.js → page-detail-CWX5S47F-DpTi0lr5.js} +1 -1
  239. package/dist/assets/{panelSelectedMixin-Cddsb26L-CSqoRxwG.js → panelSelectedMixin-Cddsb26L-BeWHMcNi.js} +1 -1
  240. package/dist/assets/{radio-default-CiSgisfh-BGMZB5pj.js → radio-default-CiSgisfh-Dt6ezU-k.js} +1 -1
  241. package/dist/assets/{react-CSBaF2r0.js → react-0s0M_CAb.js} +1 -1
  242. package/dist/assets/{react-QuNdLWH0.js → react-8rwwNA9S.js} +1 -1
  243. package/dist/assets/{react-CLksnFSH.js → react-93CibPtS.js} +1 -1
  244. package/dist/assets/{react-BXvNRT2q.js → react-Cz3x_Ojh.js} +1 -1
  245. package/dist/assets/{react-C_JPVQ2C.js → react-Dfxv8P4v.js} +1 -1
  246. package/dist/assets/{react-DRddHEvz.js → react-DwGR9wjl.js} +1 -1
  247. package/dist/assets/{react-jkd7J1Kg.js → react-TtlD7S5U.js} +2 -2
  248. package/dist/assets/{react-BEal1Iuh.js → react-vKhkI9QX.js} +1 -1
  249. package/dist/assets/{recharts-DAsNs3BU.js → recharts-DQ94kkTy.js} +1 -1
  250. package/dist/assets/{sentry-Fca4mdIl.js → sentry-L3H0lnBS.js} +1 -1
  251. package/dist/assets/{shield-DOlUxcFf-CRgtaaqW.js → shield-DOlUxcFf-BeXfYuLC.js} +1 -1
  252. package/dist/assets/{toCOABalancesWithID-P7keEtAg-DZcYuHA-.js → toCOABalancesWithID-P7keEtAg-CKsrAJNb.js} +1 -1
  253. package/dist/assets/{toChartData-BUf5HHim-DGDFToOH.js → toChartData-BUf5HHim-DU5WiVJh.js} +1 -1
  254. package/dist/assets/{upload-reimbursement-receipt-O2N8vcO7-BVwF7gzx.js → upload-reimbursement-receipt-O2N8vcO7-N655yXJS.js} +1 -1
  255. package/dist/assets/{uploadAttachment-DJA30WSD-CHN4VO1K.js → uploadAttachment-DJA30WSD-Ce-ZEqY3.js} +1 -1
  256. package/dist/assets/{uploadReceipts-CqDftTRt-Bj47leio.js → uploadReceipts-CqDftTRt-DXWV7iem.js} +1 -1
  257. package/dist/assets/{url-DdD720VJ.js → url-3bnwMjsG.js} +1 -1
  258. package/dist/assets/{url-DkjikAwv.js → url-CVUNFFPg.js} +1 -1
  259. package/dist/assets/{useLongPress-GCK2COYQ-DXicXlES.js → useLongPress-GCK2COYQ-rqfVb6ME.js} +1 -1
  260. package/dist/assets/{usp-line-BBd1wKwW-BQlBhf7H.js → usp-line-BBd1wKwW-J8zgXRmN.js} +1 -1
  261. package/dist/assets/{utils-Cgs4R-d4.js → utils-WSIc2RtD.js} +1 -1
  262. package/dist/assets/{zeni-epic-state-BZv12Eez.js → zeni-epic-state-B9Z2lD6g.js} +3 -3
  263. package/dist/index.html +1 -1
  264. package/package.json +3 -3
  265. package/dist/assets/CustomerOnboardingContainerPage-DVL4s-eV-Betf7XiO.js +0 -1
@@ -1,4 +1,4 @@
1
- import{r as zg,a as f,b as ii,g as Vg,P as me,R as Kg}from"./sentry-Fca4mdIl.js";import{r as Ls,X as bd}from"./core-DTlL91ob.js";import{r as qg,t as Ec,i as Ed}from"./zeni-epic-state-BZv12Eez.js";(function(){try{var e=typeof window<"u"?window:typeof Wn<"u"?Wn:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="bf3d2347-72e1-4909-b356-03f981804c98",e._sentryDebugIdIdentifier="sentry-dbid-bf3d2347-72e1-4909-b356-03f981804c98")}catch{}})();var Aa={exports:{}},Hr={};var Dc;function Gg(){if(Dc)return Hr;Dc=1;var e=zg(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function a(i,u,c){var l,d={},m=null,g=null;c!==void 0&&(m=""+c),u.key!==void 0&&(m=""+u.key),u.ref!==void 0&&(g=u.ref);for(l in u)r.call(u,l)&&!s.hasOwnProperty(l)&&(d[l]=u[l]);if(i&&i.defaultProps)for(l in u=i.defaultProps,u)d[l]===void 0&&(d[l]=u[l]);return{$$typeof:t,type:i,key:m,ref:g,props:d,_owner:o.current}}return Hr.Fragment=n,Hr.jsx=a,Hr.jsxs=a,Hr}var wc;function Yg(){return wc||(wc=1,Aa.exports=Gg()),Aa.exports}var p=Yg(),Xg="@liveblocks/react",Zg="2.23.0",Jg="esm";function NF(e){const[t,n]=f.useState(!1);return f.useEffect(()=>{n(!0)},[]),p.jsx(f.Suspense,{fallback:e.fallback,children:t?typeof e.children=="function"?e.children():e.children:e.fallback})}var Qg=Object.defineProperty,e0=(e,t)=>{for(var n in t)Qg(e,n,{get:t[n],enumerable:!0})},t0="@liveblocks/core",Xi="2.23.0",n0="esm",$o=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof ii<"u"?ii:{},r0="https://liveblocks.io/docs/errors/dupes",o0=" ";function s0(e){console.error(e)}function Zi(e,t,n){const r=Symbol.for(e),o=`${t} (${n})`;if(!$o[r])$o[r]=o;else if($o[r]!==o){const s=[`Multiple copies of Liveblocks are being loaded in your project. This will cause issues! See ${r0+o0}`,"","Conflicts:",`- ${e} ${$o[r]} (already loaded)`,`- ${e} ${o} (trying to load this now)`].join(`
1
+ import{r as zg,a as f,b as ii,g as Vg,P as me,R as Kg}from"./sentry-L3H0lnBS.js";import{r as Ls,X as bd}from"./core-BBKQkJb7.js";import{r as qg,t as Ec,i as Ed}from"./zeni-epic-state-B9Z2lD6g.js";(function(){try{var e=typeof window<"u"?window:typeof Wn<"u"?Wn:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="bf3d2347-72e1-4909-b356-03f981804c98",e._sentryDebugIdIdentifier="sentry-dbid-bf3d2347-72e1-4909-b356-03f981804c98")}catch{}})();var Aa={exports:{}},Hr={};var Dc;function Gg(){if(Dc)return Hr;Dc=1;var e=zg(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function a(i,u,c){var l,d={},m=null,g=null;c!==void 0&&(m=""+c),u.key!==void 0&&(m=""+u.key),u.ref!==void 0&&(g=u.ref);for(l in u)r.call(u,l)&&!s.hasOwnProperty(l)&&(d[l]=u[l]);if(i&&i.defaultProps)for(l in u=i.defaultProps,u)d[l]===void 0&&(d[l]=u[l]);return{$$typeof:t,type:i,key:m,ref:g,props:d,_owner:o.current}}return Hr.Fragment=n,Hr.jsx=a,Hr.jsxs=a,Hr}var wc;function Yg(){return wc||(wc=1,Aa.exports=Gg()),Aa.exports}var p=Yg(),Xg="@liveblocks/react",Zg="2.23.0",Jg="esm";function NF(e){const[t,n]=f.useState(!1);return f.useEffect(()=>{n(!0)},[]),p.jsx(f.Suspense,{fallback:e.fallback,children:t?typeof e.children=="function"?e.children():e.children:e.fallback})}var Qg=Object.defineProperty,e0=(e,t)=>{for(var n in t)Qg(e,n,{get:t[n],enumerable:!0})},t0="@liveblocks/core",Xi="2.23.0",n0="esm",$o=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof ii<"u"?ii:{},r0="https://liveblocks.io/docs/errors/dupes",o0=" ";function s0(e){console.error(e)}function Zi(e,t,n){const r=Symbol.for(e),o=`${t} (${n})`;if(!$o[r])$o[r]=o;else if($o[r]!==o){const s=[`Multiple copies of Liveblocks are being loaded in your project. This will cause issues! See ${r0+o0}`,"","Conflicts:",`- ${e} ${$o[r]} (already loaded)`,`- ${e} ${o} (trying to load this now)`].join(`
2
2
  `);s0(s)}}function ui(e){const t=e.editedAt?new Date(e.editedAt):void 0,n=new Date(e.createdAt),r=e.reactions.map(o=>({...o,createdAt:new Date(o.createdAt)}));if(e.body)return{...e,reactions:r,createdAt:n,editedAt:t};{const o=new Date(e.deletedAt);return{...e,reactions:r,createdAt:n,editedAt:t,deletedAt:o}}}function fn(e){const t=new Date(e.createdAt),n=new Date(e.updatedAt),r=e.comments.map(o=>ui(o));return{...e,createdAt:t,updatedAt:n,comments:r}}function a0(e){return{...e,createdAt:new Date(e.createdAt)}}function In(e){const t=new Date(e.notifiedAt),n=e.readAt?new Date(e.readAt):null;if("activities"in e){const r=e.activities.map(o=>({...o,createdAt:new Date(o.createdAt)}));return{...e,notifiedAt:t,readAt:n,activities:r}}return{...e,notifiedAt:t,readAt:n}}function xa(e){const t=new Date(e.deletedAt);return{...e,deletedAt:t}}function Oa(e){const t=new Date(e.deletedAt);return{...e,deletedAt:t}}var Cn={};e0(Cn,{error:()=>Ao,errorWithTitle:()=>xd,warn:()=>ft,warnWithTitle:()=>u0});var Dd="background:#0e0d12;border-radius:9999px;color:#fff;padding:3px 7px;font-family:sans-serif;font-weight:600;",i0="font-weight:600";function wd(e){return typeof window>"u"?console[e]:(t,...n)=>console[e]("%cLiveblocks",Dd,t,...n)}var ft=wd("warn"),Ao=wd("error");function Ad(e){return typeof window>"u"?console[e]:(t,n,...r)=>console[e](`%cLiveblocks%c ${t}`,Dd,i0,n,...r)}var u0=Ad("warn"),xd=Ad("error");function nn(e){return e!==null&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"}function ci(e){return nn(e)&&typeof e.startsWith=="string"}function wt(e){throw new Error(e)}function Ji(e){return Object.entries(e)}function c0(e){return Object.keys(e)}function l0(e,t){return typeof t<"u"?Object.create(e,t):Object.create(e)}function $s(e){try{return JSON.parse(e)}catch{return}}function oo(e){return JSON.parse(JSON.stringify(e))}function f0(e){try{const t=e.replace(/-/g,"+").replace(/_/g,"/");return decodeURIComponent(atob(t).split("").map(function(r){return"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)}).join(""))}catch{return atob(e)}}function li(e){return e.filter(t=>t!=null)}function xo(e){const t={...e};return Object.keys(e).forEach(n=>{const r=n;t[r]===void 0&&delete t[r]}),t}function d0(e){return new Promise(t=>setTimeout(t,e))}async function Ac(e,t,n){let r;const o=new Promise((s,a)=>{r=setTimeout(()=>{a(new Error(n))},t)});return Promise.race([e,o]).finally(()=>clearTimeout(r))}function xc(e){let t=null;return()=>(t===null&&(t=e().catch(n=>{throw setTimeout(()=>{t=null},5e3),n})),t)}var xr=class Od extends Error{response;details;constructor(t,n,r){super(t),this.name="HttpError",this.response=n,this.details=r}static async fromResponse(t){let n;try{n=await t.text()}catch{}const r=n?$s(n):void 0;let o;nn(r)&&(o=r);let s="";s||=typeof o?.message=="string"?o.message:"",s||=typeof o?.error=="string"?o.error:"",r===void 0&&(s||=n||""),s||=t.statusText;let a;try{a=new URL(t.url).pathname}catch{}s+=a!==void 0?` (got status ${t.status} from ${a})`:` (got status ${t.status})`;const i=o;return new Od(s,t,i)}get status(){return this.response.status}},h0=e=>e instanceof xr&&e.status>=400&&e.status<500;async function Zr(e,t,n,r=h0){const o=n.length>0?n[n.length-1]:0;let s=0;for(;;){s++;try{return await e()}catch(i){if(r(i))throw i;if(s>=t)throw new Error(`Failed after ${t} attempts: ${String(i)}`)}const a=n[s-1]??o;ft(`Attempt ${s} was unsuccessful. Retrying in ${a} milliseconds.`),await d0(a)}}function Sd(){let e,t;return[new Promise((r,o)=>{e=r,t=o}),e,t]}function Td(){const[e,t,n]=Sd();return{promise:e,resolve:t,reject:n}}function Ie(){const e=new Set;function t(a){return e.add(a),()=>e.delete(a)}function n(a){const i=t(u=>(i(),a(u)));return i}async function r(a){let i;return new Promise(u=>{i=t(c=>{(a===void 0||a(c))&&u(c)})}).finally(()=>i?.())}function o(a){let i=!1;for(const u of e)u(a),i=!0;return i}function s(){return e.size}return{notify:o,subscribe:t,subscribeOnce:n,count:s,waitUntil:r,[Symbol.dispose]:()=>{e.clear()},observable:{subscribe:t,subscribeOnce:n,waitUntil:r}}}function p0(){const e=Ie();let t=null;function n(){t=[]}function r(){if(t!==null){for(const s of t)e.notify(s);t=null}}function o(s){return t!==null?(t.push(s),!1):e.notify(s)}return{...e,notify:o,pause:n,unpause:r,[Symbol.dispose]:()=>{e[Symbol.dispose](),t!==null&&(t.length=0)}}}var En=e=>e,Bn=Symbol("kSinks"),gs=Symbol("kTrigger"),dr=null,_n=null;function ct(e){if(dr!==null){e();return}dr=new Set;try{e()}finally{for(const t of dr)t[gs]();dr=null}}function Qi(e){dr||wt("Expected to be in an active batch"),dr.add(e)}function Rd(e,t){let n=!1;const r={...e};return Object.keys(t).forEach(o=>{const s=o,a=t[s];r[s]!==a&&(a===void 0?delete r[s]:r[s]=a,n=!0)}),n?r:e}var eu=class{equals;#e;[Bn];constructor(e){this.equals=e??Object.is,this.#e=Ie(),this[Bn]=new Set,this.get=this.get.bind(this),this.subscribe=this.subscribe.bind(this),this.subscribeOnce=this.subscribeOnce.bind(this)}[Symbol.dispose](){this.#e[Symbol.dispose](),this.#e="(disposed)",this.equals="(disposed)"}get hasWatchers(){if(this.#e.count()>0)return!0;for(const e of this[Bn])if(e.hasWatchers)return!0;return!1}[gs](){this.#e.notify();for(const e of this[Bn])Qi(e)}subscribe(e){return this.#e.count()===0&&this.get(),this.#e.subscribe(e)}subscribeOnce(e){const t=this.subscribe(()=>(t(),e()));return t}waitUntil(){throw new Error("waitUntil not supported on Signals")}markSinksDirty(){for(const e of this[Bn])e.markDirty()}addSink(e){this[Bn].add(e)}removeSink(e){this[Bn].delete(e)}asReadonly(){return this}},zt=class extends eu{#e;constructor(e,t){super(t),this.#e=En(e)}[Symbol.dispose](){super[Symbol.dispose](),this.#e="(disposed)"}get(){return _n?.add(this),this.#e}set(e){ct(()=>{typeof e=="function"&&(e=e(this.#e)),this.equals(this.#e,e)||(this.#e=En(e),this.markSinksDirty(),Qi(this))})}},m0=class extends zt{constructor(e){super(En(xo(e)))}set(){throw new Error("Don't call .set() directly, use .patch()")}patch(e){super.set(t=>Rd(t,e))}},v0=Symbol(),Xe=class fi extends eu{#e;#t;#n;#r;#s;static from(...t){const n=t.pop();if(typeof n!="function"&&wt("Invalid .from() call, last argument expected to be a function"),typeof t[t.length-1]=="function"){const r=n,o=t.pop();return new fi(t,o,r)}else{const r=n;return new fi(t,r)}}constructor(t,n,r){super(r),this.#t=!0,this.#e=v0,this.#r=t,this.#n=new Set,this.#s=n}[Symbol.dispose](){for(const t of this.#n)t.removeSink(this);this.#e="(disposed)",this.#n="(disposed)",this.#r="(disposed)",this.#s="(disposed)"}get isDirty(){return this.#t}#o(){const t=_n;let n;_n=new Set;try{n=this.#s(...this.#r.map(r=>r.get()))}finally{const r=this.#n;this.#n=new Set;for(const o of _n)this.#n.add(o),r.delete(o);for(const o of r)o.removeSink(this);for(const o of this.#n)o.addSink(this);_n=t}return this.#t=!1,this.equals(this.#e,n)?!1:(this.#e=n,!0)}markDirty(){this.#t||(this.#t=!0,this.markSinksDirty())}get(){return this.#t&&this.#o(),_n?.add(this),this.#e}[gs](){if(!this.hasWatchers)return;this.#o()&&super[gs]()}},Zn=class extends eu{#e;constructor(e){super(),this.#e=e}[Symbol.dispose](){super[Symbol.dispose](),this.#e="(disposed)"}get(){return _n?.add(this),this.#e}mutate(e){ct(()=>{const t=e?e(this.#e):!0;t!==null&&typeof t=="object"&&"then"in t&&wt("MutableSignal.mutate() does not support async callbacks"),t!==!1&&(this.markSinksDirty(),Qi(this))})}};function g0(e,t){return t!==null&&typeof t=="object"&&!Array.isArray(t)?Object.keys(t).sort().reduce((n,r)=>(n[r]=t[r],n),{}):t}function Vn(e){return JSON.stringify(e,g0)}function tn(e){try{return JSON.stringify(e)}catch(t){throw console.error(`Could not stringify: ${t.message}`),console.error(e),t}}var C0=50,y0=class{input;resolve;reject;promise;constructor(e){this.input=e;const{promise:t,resolve:n,reject:r}=Td();this.promise=t,this.resolve=n,this.reject=r}},Jr=class{#e=[];#t;#n;#r;#s;error=!1;constructor(e,t){this.#t=e,this.#n=t.size??C0,this.#r=t.delay}#o(){this.#s!==void 0&&(clearTimeout(this.#s),this.#s=void 0)}#i(){this.#e.length===this.#n?this.#a():this.#e.length===1&&(this.#o(),this.#s=setTimeout(()=>void this.#a(),this.#r))}async#a(){if(this.#e.length===0)return;const e=this.#e.splice(0),t=e.map(n=>n.input);try{const n=await this.#t(t);this.error=!1,e.forEach((r,o)=>{const s=n?.[o];Array.isArray(n)?e.length!==n.length?r.reject(new Error(`Callback must return an array of the same length as the number of provided items. Expected ${e.length}, but got ${n.length}.`)):s instanceof Error?r.reject(s):r.resolve(s):r.reject(new Error("Callback must return an array."))})}catch(n){this.error=!0,e.forEach(r=>{r.reject(n)})}}get(e){const t=this.#e.find(r=>Vn(r.input)===Vn(e));if(t)return t.promise;const n=new y0(e);return this.#e.push(n),this.#i(),n.promise}clear(){this.#e=[],this.error=!1,this.#o()}};function di(e){const t=new Zn(new Map);function n(u){return Vn(u)}function r(u,c){t.mutate(l=>{l.set(u,c)})}function o(u){t.mutate(c=>{if(Array.isArray(u))for(const l of u)c.delete(n(l));else c.clear()})}async function s(u){const c=n(u);if(!t.get().has(c))try{r(c,{isLoading:!0});const d=await e.get(u);r(c,{isLoading:!1,data:d})}catch(d){r(c,{isLoading:!1,error:d})}}function a(u){const c=n(u);return t.get().get(c)}function i(){return[...t.get().keys()]}return{subscribe:t.subscribe,enqueue:s,getItemState:a,invalidate:o,batch:e,_cacheKeys:i}}function b0(e,t){const n=[];for(let r=0,o=e.length;r<o;r+=t)n.push(e.slice(r,r+t));return n}var Nr=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,n)=>t+=(n&=63)<36?n.toString(36):n<62?(n-26).toString(36).toUpperCase():n<63?"_":"-",""),E0="th",D0="cm",w0="at";function tu(e){return`${e}_${Nr()}`}function Id(){return tu(E0)}function Cs(){return tu(D0)}function Bd(){return tu(w0)}var It=class extends Map{#e;constructor(e,t){super(t),this.#e=e}getOrCreate(e,t){if(super.has(e))return super.get(e);{const r=(t??this.#e??wt("DefaultMap used without a factory function"))(e);return this.set(e,r),r}}},A0=/^[a-zA-Z_][a-zA-Z0-9_]*$/;function Oc(e){let t=[];const n=Object.entries(e),r=[],o=[],s=[];return n.forEach(([a,i])=>{if(!A0.test(a))throw new Error("Key must only contain letters, numbers, _");Rc(i)?r.push([a,i]):nn(i)&&(ci(i)?o.push([a,i]):s.push([a,i]))}),t=[...Sc(r),...Tc(o)],s.forEach(([a,i])=>{const u=Object.entries(i),c=[],l=[];u.forEach(([d,m])=>{if(x0(d))throw new Error("Key cannot be empty");Rc(m)?c.push([Ic(a,d),m]):ci(m)&&l.push([Ic(a,d),m])}),t=[...t,...Sc(c),...Tc(l)]}),t.map(({key:a,operator:i,value:u})=>`${a}${i}${Fd(u)}`).join(" ")}var Sc=e=>{const t=[];return e.forEach(([n,r])=>{t.push({key:n,operator:":",value:r})}),t},Tc=e=>{const t=[];return e.forEach(([n,r])=>{"startsWith"in r&&typeof r.startsWith=="string"&&t.push({key:n,operator:"^",value:r.startsWith})}),t},Rc=e=>typeof e=="string"||typeof e=="number"||typeof e=="boolean"||e===null,Ic=(e,t)=>t?`${e}[${Fd(t)}]`:e,x0=e=>!e||e.toString().trim()==="";function Fd(e){const t=JSON.stringify(e);return typeof e!="string"||t.includes("'")?t:`'${t.slice(1,-1).replace(/\\"/g,'"')}'`}function O0(e){const t=new URLSearchParams;for(const[n,r]of Object.entries(e))r!=null&&t.set(n,r.toString());return t}function S0(e,t,n){const r=new URL(t,e);return n!==void 0&&(r.search=(n instanceof URLSearchParams?n:O0(n)).toString()),r.toString()}function be(e,...t){return e.reduce((n,r,o)=>n+encodeURIComponent(t[o-1]??"")+r)}function T0({baseUrl:e,authManager:t,fetchPolyfill:n}){const r=new R0(e,n);async function o(T){const q=await r.get(be`/v2/c/rooms/${T.roomId}/threads/delta`,await t.getAuthValue({requestedScope:"comments:read",roomId:T.roomId}),{since:T.since.toISOString()},{signal:T.signal});return{threads:{updated:q.data.map(fn),deleted:q.deletedThreads.map(xa)},inboxNotifications:{updated:q.inboxNotifications.map(In),deleted:q.deletedInboxNotifications.map(Oa)},requestedAt:new Date(q.meta.requestedAt),permissionHints:q.meta.permissionHints}}async function s(T){let q;T.query&&(q=Oc(T.query));const ne=50;try{const ie=await r.get(be`/v2/c/rooms/${T.roomId}/threads`,await t.getAuthValue({requestedScope:"comments:read",roomId:T.roomId}),{cursor:T.cursor,query:q,limit:ne});return{threads:ie.data.map(fn),inboxNotifications:ie.inboxNotifications.map(In),nextCursor:ie.meta.nextCursor,requestedAt:new Date(ie.meta.requestedAt),permissionHints:ie.meta.permissionHints}}catch(ie){if(ie instanceof xr&&ie.status===404)return{threads:[],inboxNotifications:[],nextCursor:null,requestedAt:new Date(Date.now()-6*60*60*1e3),permissionHints:{}};throw ie}}async function a(T){const q=T.commentId??Cs(),ne=T.threadId??Id(),ie=await r.post(be`/v2/c/rooms/${T.roomId}/threads`,await t.getAuthValue({requestedScope:"comments:read",roomId:T.roomId}),{id:ne,comment:{id:q,body:T.body,attachmentIds:T.attachmentIds},metadata:T.metadata});return fn(ie)}async function i(T){await r.delete(be`/v2/c/rooms/${T.roomId}/threads/${T.threadId}`,await t.getAuthValue({requestedScope:"comments:read",roomId:T.roomId}))}async function u(T){const q=await r.rawGet(be`/v2/c/rooms/${T.roomId}/thread-with-notification/${T.threadId}`,await t.getAuthValue({requestedScope:"comments:read",roomId:T.roomId}));if(q.ok){const ne=await q.json();return{thread:fn(ne.thread),inboxNotification:ne.inboxNotification?In(ne.inboxNotification):void 0}}else{if(q.status===404)return{thread:void 0,inboxNotification:void 0};throw new Error(`There was an error while getting thread ${T.threadId}.`)}}async function c(T){return await r.post(be`/v2/c/rooms/${T.roomId}/threads/${T.threadId}/metadata`,await t.getAuthValue({requestedScope:"comments:read",roomId:T.roomId}),T.metadata)}async function l(T){const q=T.commentId??Cs(),ne=await r.post(be`/v2/c/rooms/${T.roomId}/threads/${T.threadId}/comments`,await t.getAuthValue({requestedScope:"comments:read",roomId:T.roomId}),{id:q,body:T.body,attachmentIds:T.attachmentIds});return ui(ne)}async function d(T){const q=await r.post(be`/v2/c/rooms/${T.roomId}/threads/${T.threadId}/comments/${T.commentId}`,await t.getAuthValue({requestedScope:"comments:read",roomId:T.roomId}),{body:T.body,attachmentIds:T.attachmentIds});return ui(q)}async function m(T){await r.delete(be`/v2/c/rooms/${T.roomId}/threads/${T.threadId}/comments/${T.commentId}`,await t.getAuthValue({requestedScope:"comments:read",roomId:T.roomId}))}async function g(T){const q=await r.post(be`/v2/c/rooms/${T.roomId}/threads/${T.threadId}/comments/${T.commentId}/reactions`,await t.getAuthValue({requestedScope:"comments:read",roomId:T.roomId}),{emoji:T.emoji});return a0(q)}async function C(T){await r.delete(be`/v2/c/rooms/${T.roomId}/threads/${T.threadId}/comments/${T.commentId}/reactions/${T.emoji}`,await t.getAuthValue({requestedScope:"comments:read",roomId:T.roomId}))}async function v(T){await r.post(be`/v2/c/rooms/${T.roomId}/threads/${T.threadId}/mark-as-resolved`,await t.getAuthValue({requestedScope:"comments:read",roomId:T.roomId}))}async function h(T){await r.post(be`/v2/c/rooms/${T.roomId}/threads/${T.threadId}/mark-as-unresolved`,await t.getAuthValue({requestedScope:"comments:read",roomId:T.roomId}))}async function E(T){const q=T.roomId,ne=T.signal,ie=T.attachment,we=ne?new DOMException(`Upload of attachment ${T.attachment.id} was aborted.`,"AbortError"):void 0;if(ne?.aborted)throw we;const xe=Ce=>{if(ne?.aborted)throw we;if(Ce instanceof xr&&Ce.status===413)throw Ce;return!1},ae=5*1024*1024,Te=10,je=[2e3,2e3,2e3,2e3,2e3,2e3,2e3,2e3,2e3,2e3];function he(Ce){const ke=[];let Pe=0;for(;Pe<Ce.size;){const ye=Math.min(Pe+ae,Ce.size);ke.push({partNumber:ke.length+1,part:Ce.slice(Pe,ye)}),Pe=ye}return ke}if(ie.size<=ae)return Zr(async()=>r.putBlob(be`/v2/c/rooms/${q}/attachments/${ie.id}/upload/${encodeURIComponent(ie.name)}`,await t.getAuthValue({requestedScope:"comments:read",roomId:q}),ie.file,{fileSize:ie.size},{signal:ne}),Te,je,xe);{let Ce;const ke=[],Pe=await Zr(async()=>r.post(be`/v2/c/rooms/${q}/attachments/${ie.id}/multipart/${encodeURIComponent(ie.name)}`,await t.getAuthValue({requestedScope:"comments:read",roomId:q}),void 0,{signal:ne},{fileSize:ie.size}),Te,je,xe);try{Ce=Pe.uploadId;const ye=he(ie.file);if(ne?.aborted)throw we;const Ee=b0(ye,5);for(const $e of Ee){const qe=[];for(const{part:yt,partNumber:Je}of $e)qe.push(Zr(async()=>r.putBlob(be`/v2/c/rooms/${q}/attachments/${ie.id}/multipart/${Pe.uploadId}/${String(Je)}`,await t.getAuthValue({requestedScope:"comments:read",roomId:q}),yt,void 0,{signal:ne}),Te,je,xe));ke.push(...await Promise.all(qe))}if(ne?.aborted)throw we;const Ct=ke.sort(($e,qe)=>$e.partNumber-qe.partNumber);return r.post(be`/v2/c/rooms/${q}/attachments/${ie.id}/multipart/${Ce}/complete`,await t.getAuthValue({requestedScope:"comments:read",roomId:q}),{parts:Ct},{signal:ne})}catch(ye){if(Ce&&ye?.name&&(ye.name==="AbortError"||ye.name==="TimeoutError"))try{await r.rawDelete(be`/v2/c/rooms/${q}/attachments/${ie.id}/multipart/${Ce}`,await t.getAuthValue({requestedScope:"comments:read",roomId:q}))}catch{}throw ye}}}const b=new It(T=>{const q=new Jr(async ne=>{const ie=ne.flat(),{urls:we}=await r.post(be`/v2/c/rooms/${T}/attachments/presigned-urls`,await t.getAuthValue({requestedScope:"comments:read",roomId:T}),{attachmentIds:ie});return we.map(xe=>xe??new Error("There was an error while getting this attachment's URL"))},{delay:50});return di(q)});function w(T){return b.getOrCreate(T)}function D(T){return w(T.roomId).batch.get(T.attachmentId)}async function x(T){return r.get(be`/v2/c/rooms/${T.roomId}/notification-settings`,await t.getAuthValue({requestedScope:"comments:read",roomId:T.roomId}),void 0,{signal:T.signal})}async function I(T){return r.post(be`/v2/c/rooms/${T.roomId}/notification-settings`,await t.getAuthValue({requestedScope:"comments:read",roomId:T.roomId}),T.settings)}const O=new It(T=>new Jr(async q=>{const ne=q.flat();return await r.post(be`/v2/c/rooms/${T}/inbox-notifications/read`,await t.getAuthValue({requestedScope:"comments:read",roomId:T}),{inboxNotificationIds:ne}),ne},{delay:50}));async function F(T){return O.getOrCreate(T.roomId).get(T.inboxNotificationId)}async function H(T){await r.rawPost(be`/v2/c/rooms/${T.roomId}/text-mentions`,await t.getAuthValue({requestedScope:"comments:read",roomId:T.roomId}),{userId:T.userId,mentionId:T.mentionId})}async function N(T){await r.rawDelete(be`/v2/c/rooms/${T.roomId}/text-mentions/${T.mentionId}`,await t.getAuthValue({requestedScope:"comments:read",roomId:T.roomId}))}async function j(T){return r.rawGet(be`/v2/c/rooms/${T.roomId}/y-version/${T.versionId}`,await t.getAuthValue({requestedScope:"comments:read",roomId:T.roomId}))}async function B(T){await r.rawPost(be`/v2/c/rooms/${T.roomId}/version`,await t.getAuthValue({requestedScope:"comments:read",roomId:T.roomId}))}async function k(T){await r.rawPost(be`/v2/c/rooms/${T.roomId}/text-metadata`,await t.getAuthValue({requestedScope:"comments:read",roomId:T.roomId}),{type:T.type,rootKey:T.rootKey})}async function M(T){const q=await r.post(be`/v2/c/rooms/${T.roomId}/ai/contextual-prompt`,await t.getAuthValue({requestedScope:"room:read",roomId:T.roomId}),{prompt:T.prompt,context:{beforeSelection:T.context.beforeSelection,selection:T.context.selection,afterSelection:T.context.afterSelection},previous:T.previous},{signal:T.signal});if(!q||q.content.length===0)throw new Error("No content returned from server");return q.content[0].text}async function W(T){const q=await r.get(be`/v2/c/rooms/${T.roomId}/versions`,await t.getAuthValue({requestedScope:"comments:read",roomId:T.roomId}));return{versions:q.versions.map(({createdAt:ne,...ie})=>({createdAt:new Date(ne),...ie})),requestedAt:new Date(q.meta.requestedAt)}}async function re(T){const q=await r.get(be`/v2/c/rooms/${T.roomId}/versions/delta`,await t.getAuthValue({requestedScope:"comments:read",roomId:T.roomId}),{since:T.since.toISOString()},{signal:T.signal});return{versions:q.versions.map(({createdAt:ne,...ie})=>({createdAt:new Date(ne),...ie})),requestedAt:new Date(q.meta.requestedAt)}}async function Y(T){return await(await r.rawGet(be`/v2/c/rooms/${T.roomId}/storage`,await t.getAuthValue({requestedScope:"room:read",roomId:T.roomId}))).json()}async function ee(T){return r.rawPost(be`/v2/c/rooms/${T.roomId}/send-message`,await t.getAuthValue({requestedScope:"room:read",roomId:T.roomId}),{nonce:T.nonce,messages:T.messages})}async function L(T){const ne=await r.get(be`/v2/c/inbox-notifications`,await t.getAuthValue({requestedScope:"comments:read"}),{cursor:T?.cursor,limit:50});return{inboxNotifications:ne.inboxNotifications.map(In),threads:ne.threads.map(fn),nextCursor:ne.meta.nextCursor,requestedAt:new Date(ne.meta.requestedAt)}}async function Q(T){const q=await r.get(be`/v2/c/inbox-notifications/delta`,await t.getAuthValue({requestedScope:"comments:read"}),{since:T.since.toISOString()},{signal:T.signal});return{inboxNotifications:{updated:q.inboxNotifications.map(In),deleted:q.deletedInboxNotifications.map(Oa)},threads:{updated:q.threads.map(fn),deleted:q.deletedThreads.map(xa)},requestedAt:new Date(q.meta.requestedAt)}}async function V(){const{count:T}=await r.get(be`/v2/c/inbox-notifications/count`,await t.getAuthValue({requestedScope:"comments:read"}));return T}async function te(){await r.post(be`/v2/c/inbox-notifications/read`,await t.getAuthValue({requestedScope:"comments:read"}),{inboxNotificationIds:"all"})}async function se(T){await r.post(be`/v2/c/inbox-notifications/read`,await t.getAuthValue({requestedScope:"comments:read"}),{inboxNotificationIds:T})}const de=new Jr(async T=>{const q=T.flat();return await se(q),q},{delay:50});async function G(T){await de.get(T)}async function R(){await r.delete(be`/v2/c/inbox-notifications`,await t.getAuthValue({requestedScope:"comments:read"}))}async function _(T){await r.delete(be`/v2/c/inbox-notifications/${T}`,await t.getAuthValue({requestedScope:"comments:read"}))}async function U(T){return r.get(be`/v2/c/notification-settings`,await t.getAuthValue({requestedScope:"comments:read"}),void 0,{signal:T?.signal})}async function X(T){return r.post(be`/v2/c/notification-settings`,await t.getAuthValue({requestedScope:"comments:read"}),T)}async function fe(T){let q;T?.query&&(q=Oc(T.query));const ie=await r.get(be`/v2/c/threads`,await t.getAuthValue({requestedScope:"comments:read"}),{cursor:T?.cursor,query:q,limit:50});return{threads:ie.threads.map(fn),inboxNotifications:ie.inboxNotifications.map(In),nextCursor:ie.meta.nextCursor,requestedAt:new Date(ie.meta.requestedAt),permissionHints:ie.meta.permissionHints}}async function le(T){const q=await r.get(be`/v2/c/threads/delta`,await t.getAuthValue({requestedScope:"comments:read"}),{since:T.since.toISOString()},{signal:T.signal});return{threads:{updated:q.threads.map(fn),deleted:q.deletedThreads.map(xa)},inboxNotifications:{updated:q.inboxNotifications.map(In),deleted:q.deletedInboxNotifications.map(Oa)},requestedAt:new Date(q.meta.requestedAt),permissionHints:q.meta.permissionHints}}return{getThreads:s,getThreadsSince:o,createThread:a,getThread:u,deleteThread:i,editThreadMetadata:c,createComment:l,editComment:d,deleteComment:m,addReaction:g,removeReaction:C,markThreadAsResolved:v,markThreadAsUnresolved:h,markRoomInboxNotificationAsRead:F,getNotificationSettings:x,updateNotificationSettings:I,createTextMention:H,deleteTextMention:N,getTextVersion:j,createTextVersion:B,reportTextEditor:k,listTextVersions:W,listTextVersionsSince:re,getAttachmentUrl:D,uploadAttachment:E,getOrCreateAttachmentUrlsStore:w,streamStorage:Y,sendMessages:ee,getInboxNotifications:L,getInboxNotificationsSince:Q,getUnreadInboxNotificationsCount:V,markAllInboxNotificationsAsRead:te,markInboxNotificationAsRead:G,deleteAllInboxNotifications:R,deleteInboxNotification:_,getUserNotificationSettings:U,updateUserNotificationSettings:X,getUserThreads_experimental:fe,getUserThreadsSince_experimental:le,executeContextualPrompt:M}}function Pd(e){return e.type==="public"?e.publicApiKey:e.token.raw}var R0=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t}async#n(e,t,n,r){e.startsWith("/v2/c/")||wt("This client can only be used to make /v2/c/* requests");const o=S0(this.#e,e,r);return await this.#t(o,{...n,headers:{"Content-Type":"application/json; charset=utf-8",...n?.headers,Authorization:`Bearer ${Pd(t)}`,"X-LB-Client":Xi}})}async#r(e,t,n,r){const o=await this.#n(e,t,n,r);if(!o.ok)throw await xr.fromResponse(o);let s;try{s=await o.json()}catch{s={}}return s}async rawGet(e,t,n,r){return await this.#n(e,t,r,n)}async rawPost(e,t,n){return await this.#n(e,t,{method:"POST",body:tn(n)})}async rawDelete(e,t){return await this.#n(e,t,{method:"DELETE"})}async get(e,t,n,r){return await this.#r(e,t,r,n)}async post(e,t,n,r,o){return await this.#r(e,t,{...r,method:"POST",body:tn(n)},o)}async delete(e,t){return await this.#r(e,t,{method:"DELETE"})}async putBlob(e,t,n,r,o){return await this.#r(e,t,{...o,method:"PUT",headers:{"Content-Type":"application/octet-stream"},body:n},r)}};function lt(e,t){throw new Error(t)}function pe(e,t="Expected value to be non-nullable"){return e}function I0(e,t){if(e===t)return[0,0];const n=e.split("."),r=t.split("."),o=Math.min(n.length,r.length);let s=0;for(;s<o&&n[s]===r[s];s++);const a=n.length-s,i=r.length-s;return[a,i]}function B0(e,t){const n=e.split(".");if(t<1||t>n.length+1)throw new Error("Invalid number of levels");const r=[];t>n.length&&r.push("*");for(let o=n.length-t+1;o<n.length;o++){const s=n.slice(0,o);s.length>0&&r.push(s.join(".")+".*")}return r.push(e),r}var F0=class{#e;constructor(e){this.#e=e}get current(){return this.#e}allowPatching(e){const t=this;let n=!0;const r={...this.#e,patch(o){if(n){t.#e=Object.assign({},t.#e,o);for(const s of Object.entries(o)){const[a,i]=s;a!=="patch"&&(this[a]=i)}}else throw new Error("Can no longer patch stale context")}};e(r),n=!1}},P0=1,Nd=class{id;#e;#t;#n;#r;#s;#o;events;#i;#a;#l;get#d(){const e=this.#n.values()[Symbol.iterator]().next();if(e.done)throw new Error("No states defined yet");return e.value}get currentState(){if(this.#r===null)throw this.#e===0?new Error("Not started yet"):new Error("Already stopped");return this.#r}start(){if(this.#e!==0)throw new Error("State machine has already started");return this.#e=1,this.#r=this.#d,this.#c(null),this}stop(){if(this.#e!==1)throw new Error("Cannot stop a state machine that hasn't started yet");this.#f(null),this.#e=2,this.#r=null}constructor(e){this.id=P0++,this.#e=0,this.#r=null,this.#n=new Set,this.#a=new Map,this.#i=[],this.#l=new Set,this.#s=new Map,this.#t=new F0(e),this.#o={didReceiveEvent:Ie(),willTransition:Ie(),didIgnoreEvent:Ie(),willExitState:Ie(),didEnterState:Ie()},this.events={didReceiveEvent:this.#o.didReceiveEvent.observable,willTransition:this.#o.willTransition.observable,didIgnoreEvent:this.#o.didIgnoreEvent.observable,willExitState:this.#o.willExitState.observable,didEnterState:this.#o.didEnterState.observable}}get context(){return this.#t.current}addState(e){if(this.#e!==0)throw new Error("Already started");return this.#n.add(e),this}onEnter(e,t){if(this.#e!==0)throw new Error("Already started");if(this.#a.has(e))throw new Error(`enter/exit function for ${e} already exists`);return this.#a.set(e,t),this}onEnterAsync(e,t,n,r,o){return this.onEnter(e,()=>{const s=new AbortController,a=s.signal,i=o?setTimeout(()=>{const c=new Error("Timed out");this.#u({type:"ASYNC_ERROR",reason:c},r)},o):void 0;let u=!1;return t(this.#t.current,a).then(c=>{a.aborted||(u=!0,this.#u({type:"ASYNC_OK",data:c},n))},c=>{a.aborted||(u=!0,this.#u({type:"ASYNC_ERROR",reason:c},r))}),()=>{clearTimeout(i),u||s.abort()}})}#h(e){const t=[];if(e==="*")for(const n of this.#n)t.push(n);else if(e.endsWith(".*")){const n=e.slice(0,-1);for(const r of this.#n)r.startsWith(n)&&t.push(r)}else{const n=e;this.#n.has(n)&&t.push(n)}if(t.length===0)throw new Error(`No states match ${JSON.stringify(e)}`);return t}addTransitions(e,t){if(this.#e!==0)throw new Error("Already started");for(const n of this.#h(e)){let r=this.#s.get(n);r===void 0&&(r=new Map,this.#s.set(n,r));for(const[o,s]of Object.entries(t)){if(r.has(o))throw new Error(`Trying to set transition "${o}" on "${n}" (via "${e}"), but a transition already exists there.`);const a=s;if(this.#l.add(o),a!==void 0){const i=typeof a=="function"?a:()=>a;r.set(o,i)}}}return this}addTimedTransition(e,t,n){return this.onEnter(e,()=>{const r=typeof t=="function"?t(this.#t.current):t,o=setTimeout(()=>{this.#u({type:"TIMER"},n)},r);return()=>{clearTimeout(o)}})}#p(e){return this.#s.get(this.currentState)?.get(e)}#f(e){this.#o.willExitState.notify(this.currentState),this.#t.allowPatching(t=>{e=e??this.#i.length;for(let n=0;n<e;n++)this.#i.pop()?.(t)})}#c(e){const t=B0(this.currentState,e??this.currentState.split(".").length+1);this.#t.allowPatching(n=>{for(const r of t){const s=this.#a.get(r)?.(n);typeof s=="function"?this.#i.push(s):this.#i.push(null)}}),this.#o.didEnterState.notify(this.currentState)}send(e){if(!this.#l.has(e.type))throw new Error(`Invalid event ${JSON.stringify(e.type)}`);if(this.#e===2)return;const t=this.#p(e.type);if(t!==void 0)return this.#u(e,t);this.#o.didIgnoreEvent.notify(e)}#u(e,t){this.#o.didReceiveEvent.notify(e);const n=this.currentState,o=(typeof t=="function"?t:()=>t)(e,this.#t.current);let s,a;if(o===null){this.#o.didIgnoreEvent.notify(e);return}if(typeof o=="string"?s=o:(s=o.target,a=Array.isArray(o.effect)?o.effect:[o.effect]),!this.#n.has(s))throw new Error(`Invalid next state name: ${JSON.stringify(s)}`);this.#o.willTransition.notify({from:n,to:s});const[i,u]=I0(this.currentState,s);if(i>0&&this.#f(i),this.#r=s,a!==void 0){const c=a;this.#t.allowPatching(l=>{for(const d of c)typeof d=="function"?d(l,e):l.patch(d)})}u>0&&this.#c(u)}},Zt=(e=>(e[e.UPDATE_PRESENCE=100]="UPDATE_PRESENCE",e[e.USER_JOINED=101]="USER_JOINED",e[e.USER_LEFT=102]="USER_LEFT",e[e.BROADCASTED_EVENT=103]="BROADCASTED_EVENT",e[e.ROOM_STATE=104]="ROOM_STATE",e[e.INITIAL_STORAGE_STATE=200]="INITIAL_STORAGE_STATE",e[e.UPDATE_STORAGE=201]="UPDATE_STORAGE",e[e.REJECT_STORAGE_OP=299]="REJECT_STORAGE_OP",e[e.UPDATE_YDOC=300]="UPDATE_YDOC",e[e.THREAD_CREATED=400]="THREAD_CREATED",e[e.THREAD_DELETED=407]="THREAD_DELETED",e[e.THREAD_METADATA_UPDATED=401]="THREAD_METADATA_UPDATED",e[e.THREAD_UPDATED=408]="THREAD_UPDATED",e[e.COMMENT_CREATED=402]="COMMENT_CREATED",e[e.COMMENT_EDITED=403]="COMMENT_EDITED",e[e.COMMENT_DELETED=404]="COMMENT_DELETED",e[e.COMMENT_REACTION_ADDED=405]="COMMENT_REACTION_ADDED",e[e.COMMENT_REACTION_REMOVED=406]="COMMENT_REACTION_REMOVED",e))(Zt||{});function Bc(e){return e===4999||e>=4e3&&e<4100}function N0(e){return e>=4100&&e<4200}function Fc(e){return e===1013||e>=4200&&e<4300}function k0(e){return e==="initial"||e==="disconnected"}function kd(e){const t=e.currentState;switch(t){case"@ok.connected":case"@ok.awaiting-pong":return"connected";case"@idle.initial":return"initial";case"@auth.busy":case"@auth.backoff":case"@connecting.busy":case"@connecting.backoff":case"@idle.zombie":return e.context.successCount>0?"reconnecting":"connecting";case"@idle.failed":return"disconnected";default:return lt(t,"Unknown state")}}var Md=[250,500,1e3,2e3,4e3,8e3,1e4],Uo=Md[0]-1,M0=[2e3,3e4,6e4,3e5],_0=3e4,j0=2e3,L0=1e4,$0=1e4,Ln=class extends Error{constructor(e){super(e)}};function _d(e,t){return t.find(n=>n>e)??t[t.length-1]}function or(e){e.patch({backoffDelay:_d(e.backoffDelay,Md)})}function Pc(e){e.patch({backoffDelay:_d(e.backoffDelay,M0)})}function Nc(e){e.patch({successCount:0})}function lr(e,t){const n=e===2?Ao:e===1?ft:()=>{};return()=>{n(t)}}function kc(e){const t="Connection to Liveblocks websocket server";return n=>{e instanceof Error?ft(`${t} could not be established. ${String(e)}`):ft(jd(e)?`${t} closed prematurely (code: ${e.code}). Retrying in ${n.backoffDelay}ms.`:`${t} could not be established.`)}}function Sa(e){const t=[`code: ${e.code}`];return e.reason&&t.push(`reason: ${e.reason}`),n=>{ft(`Connection to Liveblocks websocket server closed (${t.join(", ")}). Retrying in ${n.backoffDelay}ms.`)}}var U0=lr(1,"Connection to WebSocket closed permanently. Won't retry.");function jd(e){return!(e instanceof Error)&&e.type==="close"}function H0(e){const t=new Date().getTime();function n(...o){ft(`${((new Date().getTime()-t)/1e3).toFixed(2)} [FSM #${e.id}]`,...o)}const r=[e.events.didReceiveEvent.subscribe(o=>n(`Event ${o.type}`)),e.events.willTransition.subscribe(({from:o,to:s})=>n("Transitioning",o,"→",s)),e.events.didIgnoreEvent.subscribe(o=>n("Ignored event",o.type,o,"(current state won't handle it)"))];return()=>{for(const o of r)o()}}function W0(e){const t=Ie(),n=Ie(),r=Ie();let o=null;const s=e.events.didEnterState.subscribe(()=>{const a=kd(e);a!==o&&t.notify(a),o==="connected"&&a!=="connected"?r.notify():o!=="connected"&&a==="connected"&&n.notify(),o=a});return{statusDidChange:t.observable,didConnect:n.observable,didDisconnect:r.observable,unsubscribe:s}}var Ho=e=>t=>t.patch(e);function z0(e,t){const n=p0();n.pause();const r=Ie();function o(b,w){return()=>{r.notify({message:b,code:w})}}const s={successCount:0,authValue:null,socket:null,backoffDelay:Uo},a=new Nd(s).addState("@idle.initial").addState("@idle.failed").addState("@idle.zombie").addState("@auth.busy").addState("@auth.backoff").addState("@connecting.busy").addState("@connecting.backoff").addState("@ok.connected").addState("@ok.awaiting-pong");a.addTransitions("*",{RECONNECT:{target:"@auth.backoff",effect:[or,Nc]},DISCONNECT:"@idle.initial"}),a.onEnter("@idle.*",Nc).addTransitions("@idle.*",{CONNECT:(b,w)=>w.authValue!==null?"@connecting.busy":"@auth.busy"}),a.addTransitions("@auth.backoff",{NAVIGATOR_ONLINE:{target:"@auth.busy",effect:Ho({backoffDelay:Uo})}}).addTimedTransition("@auth.backoff",b=>b.backoffDelay,"@auth.busy").onEnterAsync("@auth.busy",()=>Ac(e.authenticate(),L0,"Timed out during auth"),b=>({target:"@connecting.busy",effect:Ho({authValue:b.data})}),b=>b.reason instanceof Ln?{target:"@idle.failed",effect:[lr(2,b.reason.message),o(b.reason.message,-1)]}:{target:"@auth.backoff",effect:[or,lr(2,`Authentication failed: ${b.reason instanceof Error?b.reason.message:String(b.reason)}`)]});const i=b=>a.send({type:"EXPLICIT_SOCKET_ERROR",event:b}),u=b=>a.send({type:"EXPLICIT_SOCKET_CLOSE",event:b}),c=b=>b.data==="pong"?a.send({type:"PONG"}):n.notify(b);function l(b){b&&(b.removeEventListener("error",i),b.removeEventListener("close",u),b.removeEventListener("message",c),b.close())}a.addTransitions("@connecting.backoff",{NAVIGATOR_ONLINE:{target:"@connecting.busy",effect:Ho({backoffDelay:Uo})}}).addTimedTransition("@connecting.backoff",b=>b.backoffDelay,"@connecting.busy").onEnterAsync("@connecting.busy",async(b,w)=>{let D=null,x=null;const I=new Promise((O,F)=>{if(b.authValue===null)throw new Error("No auth authValue");const H=e.createSocket(b.authValue);x=H;function N(M){D=M,H.removeEventListener("message",c),F(M)}const[j,B]=Sd();t.waitForActorId||B();function k(M){$s(M.data)?.type===104&&B()}H.addEventListener("message",c),t.waitForActorId&&H.addEventListener("message",k),H.addEventListener("error",N),H.addEventListener("close",N),H.addEventListener("open",()=>{H.addEventListener("error",i),H.addEventListener("close",u);const M=()=>{H.removeEventListener("error",N),H.removeEventListener("close",N),H.removeEventListener("message",k)};j.then(()=>{O([H,M])})})});return Ac(I,$0,"Timed out during websocket connection").then(([O,F])=>{if(F(),w.aborted)throw new Error("Aborted");if(D)throw D;return O}).catch(O=>{throw l(x),O})},b=>({target:"@ok.connected",effect:Ho({socket:b.data,backoffDelay:Uo})}),b=>{const w=b.reason;if(w instanceof Ln)return{target:"@idle.failed",effect:[lr(2,w.message),o(w.message,-1)]};if(jd(w)){if(w.code===4109)return"@auth.busy";if(Fc(w.code))return{target:"@connecting.backoff",effect:[Pc,kc(w)]};if(Bc(w.code))return{target:"@idle.failed",effect:[lr(2,w.reason),o(w.reason,w.code)]}}return{target:"@auth.backoff",effect:[or,kc(w)]}});const d={target:"@ok.awaiting-pong",effect:b=>{b.socket?.send("ping")}},m=()=>(typeof document<"u"?document:void 0)?.visibilityState==="hidden"&&e.canZombie()?"@idle.zombie":d;if(a.addTimedTransition("@ok.connected",_0,m).addTransitions("@ok.connected",{NAVIGATOR_OFFLINE:m,WINDOW_GOT_FOCUS:d}),a.addTransitions("@idle.zombie",{WINDOW_GOT_FOCUS:"@connecting.backoff"}),a.onEnter("@ok.*",b=>{b.patch({successCount:b.successCount+1});const w=setTimeout(n.unpause,0);return D=>{l(D.socket),D.patch({socket:null}),clearTimeout(w),n.pause()}}).addTransitions("@ok.awaiting-pong",{PONG:"@ok.connected"}).addTimedTransition("@ok.awaiting-pong",j0,{target:"@connecting.busy",effect:lr(1,"Received no pong from server, assume implicit connection loss.")}).addTransitions("@ok.*",{EXPLICIT_SOCKET_ERROR:(b,w)=>w.socket?.readyState===1?null:{target:"@connecting.backoff",effect:or},EXPLICIT_SOCKET_CLOSE:b=>Bc(b.event.code)?{target:"@idle.failed",effect:[U0,o(b.event.reason,b.event.code)]}:N0(b.event.code)?b.event.code===4109?"@auth.busy":{target:"@auth.backoff",effect:[or,Sa(b.event)]}:Fc(b.event.code)?{target:"@connecting.backoff",effect:[Pc,Sa(b.event)]}:{target:"@connecting.backoff",effect:[or,Sa(b.event)]}}),typeof document<"u"){const b=typeof document<"u"?document:void 0,w=typeof window<"u"?window:void 0,D=w??b;a.onEnter("*",x=>{function I(){a.send({type:"NAVIGATOR_OFFLINE"})}function O(){a.send({type:"NAVIGATOR_ONLINE"})}function F(){b?.visibilityState==="visible"&&a.send({type:"WINDOW_GOT_FOCUS"})}return w?.addEventListener("online",O),w?.addEventListener("offline",I),D?.addEventListener("visibilitychange",F),()=>{D?.removeEventListener("visibilitychange",F),w?.removeEventListener("online",O),w?.removeEventListener("offline",I),l(x.socket)}})}const g=[],{statusDidChange:C,didConnect:v,didDisconnect:h,unsubscribe:E}=W0(a);return g.push(E),t.enableDebugLogging&&g.push(H0(a)),a.start(),{machine:a,cleanups:g,events:{statusDidChange:C,didConnect:v,didDisconnect:h,onMessage:n.observable,onConnectionError:r.observable}}}var V0=class{#e;#t;events;constructor(e,t=!1,n=!0){const{machine:r,events:o,cleanups:s}=z0(e,{waitForActorId:n,enableDebugLogging:t});this.#e=r,this.events=o,this.#t=s}getStatus(){try{return kd(this.#e)}catch{return"initial"}}get authValue(){return this.#e.context.authValue}connect(){this.#e.send({type:"CONNECT"})}reconnect(){this.#e.send({type:"RECONNECT"})}disconnect(){this.#e.send({type:"DISCONNECT"})}destroy(){this.#e.stop();let e;for(;e=this.#t.pop();)e()}send(e){const t=this.#e.context?.socket;t===null?ft("Cannot send: not connected yet",e):t.readyState!==1?ft("Cannot send: WebSocket no longer open",e):t.send(e)}_privateSendMachineEvent(e){this.#e.send(e)}},hi=(e=>(e.Read="room:read",e.Write="room:write",e.PresenceWrite="room:presence:write",e.CommentsWrite="comments:write",e.CommentsRead="comments:read",e))(hi||{});function pi(e){return e.includes("room:write")}function Ld(e){return e.includes("comments:write")||e.includes("room:write")}function K0(e){return nn(e)&&(e.k==="acc"||e.k==="id"||e.k==="sec-legacy")}function Mc(e){const t=e.split(".");if(t.length!==3)throw new Error("Authentication error: invalid JWT token");const n=$s(f0(t[1]));if(!(n&&K0(n)))throw new Error("Authentication error: expected a valid token but did not get one. Hint: if you are using a callback, ensure the room is passed when creating the token. For more information: https://liveblocks.io/docs/api-reference/liveblocks-client#createClientCallback");return{raw:e,parsed:n}}function q0(e,t){const n=G0(e),r=new Set,o=[],s=[],a=new Map;function i(){r.clear(),o.length=0,s.length=0,a.clear()}function u(m,g){return m==="comments:read"?g.includes("comments:read")||g.includes("comments:write")||g.includes("room:read")||g.includes("room:write"):m==="room:read"?g.includes("room:read")||g.includes("room:write"):!1}function c(m){const g=Math.ceil(Date.now()/1e3);for(let C=o.length-1;C>=0;C--){const v=o[C];if(s[C]<=g){o.splice(C,1),s.splice(C,1);continue}if(v.parsed.k==="id")return v;if(v.parsed.k==="acc"){if(!m.roomId&&Object.entries(v.parsed.perms).length===0)return v;for(const[E,b]of Object.entries(v.parsed.perms))if(m.roomId){if(E.includes("*")&&m.roomId.startsWith(E.replace("*",""))||m.roomId===E&&u(m.requestedScope,b))return v}else if(E.includes("*")&&u(m.requestedScope,b))return v}}}async function l(m){const g=e.polyfills?.fetch??(typeof window>"u"?void 0:window.fetch);if(n.type==="private"){if(g===void 0)throw new Ln("To use Liveblocks client in a non-DOM environment with a url as auth endpoint, you need to provide a fetch polyfill.");const C=await Y0(g,n.url,{room:m.roomId}),v=Mc(C.token);if(r.has(v.raw))throw new Ln("The same Liveblocks auth token was issued from the backend before. Caching Liveblocks tokens is not supported.");return t?.(v.parsed),v}if(n.type==="custom"){const C=await n.callback(m.roomId);if(C&&typeof C=="object"){if(typeof C.token=="string"){const v=Mc(C.token);return t?.(v.parsed),v}else if(typeof C.error=="string"){const v=`Authentication failed: ${"reason"in C&&typeof C.reason=="string"?C.reason:"Forbidden"}`;throw C.error==="forbidden"?new Ln(v):new Error(v)}}throw new Error('Your authentication callback function should return a token, but it did not. Hint: the return value should look like: { token: "..." }')}throw new Error("Unexpected authentication type. Must be private or custom.")}async function d(m){if(n.type==="public")return{type:"public",publicApiKey:n.publicApiKey};const g=c(m);if(g!==void 0)return{type:"secret",token:g};let C;m.roomId?(C=a.get(m.roomId),C===void 0&&(C=l(m),a.set(m.roomId,C))):(C=a.get("liveblocks-user-token"),C===void 0&&(C=l(m),a.set("liveblocks-user-token",C)));try{const v=await C,E=Math.floor(Date.now()/1e3)+(v.parsed.exp-v.parsed.iat)-30;return r.add(v.raw),v.parsed.k!=="sec-legacy"&&(o.push(v),s.push(E)),{type:"secret",token:v}}finally{m.roomId?a.delete(m.roomId):a.delete("liveblocks-user-token")}}return{reset:i,getAuthValue:d}}function G0(e){const{publicApiKey:t,authEndpoint:n}=e;if(n!==void 0&&t!==void 0)throw new Error("You cannot simultaneously use `publicApiKey` and `authEndpoint` options. Please pick one and leave the other option unspecified. For more information: https://liveblocks.io/docs/api-reference/liveblocks-client#createClient");if(typeof t=="string"){if(t.startsWith("sk_"))throw new Error("Invalid `publicApiKey` option. The value you passed is a secret key, which should not be used from the client. Please only ever pass a public key here. For more information: https://liveblocks.io/docs/api-reference/liveblocks-client#createClientPublicKey");if(!t.startsWith("pk_"))throw new Error("Invalid key. Please use the public key format: pk_<public key>. For more information: https://liveblocks.io/docs/api-reference/liveblocks-client#createClientPublicKey");return{type:"public",publicApiKey:t}}if(typeof n=="string")return{type:"private",url:n};if(typeof n=="function")return{type:"custom",callback:n};throw n!==void 0?new Error("The `authEndpoint` option must be a string or a function. For more information: https://liveblocks.io/docs/api-reference/liveblocks-client#createClientAuthEndpoint"):new Error("Invalid Liveblocks client options. Please provide either a `publicApiKey` or `authEndpoint` option. They cannot both be empty. For more information: https://liveblocks.io/docs/api-reference/liveblocks-client#createClient")}async function Y0(e,t,n){const r=await e(t,{method:"POST",headers:{"Content-Type":"application/json"},body:tn(n)});if(!r.ok){const a=`${(await r.text()).trim()||"reason not provided in auth response"} (${r.status} returned by POST ${t})`;throw r.status===401||r.status===403?new Ln(`Unauthorized: ${a}`):new Error(`Failed to authenticate: ${a}`)}let o;try{o=await r.json()}catch(a){throw new Error(`Expected a JSON response when doing a POST request on "${t}". ${String(a)}`)}if(!nn(o)||typeof o.token!="string")throw new Error(`Expected a JSON response of the form \`{ token: "..." }\` when doing a POST request on "${t}", but got ${tn(o)}`);const{token:s}=o;return{token:s}}var X0="https://api.liveblocks.io",Oe=Symbol(),Z0=Ie();Z0.observable;var Qr=Symbol("user-notification-settings-plain");function ys(e){const t=["email","slack","teams","webPush"],n={[Qr]:{value:e,enumerable:!1}};for(const r of t)n[r]={enumerable:!0,get(){const o=this[Qr][r];return typeof o>"u"?(Ao(`In order to use the '${r}' channel, please set up your project first. For more information: https://liveblocks.io/docs/errors/enable-a-notification-channel`),null):o}};return l0(null,n)}function J0(e,t){const n=ys({...e[Qr]});for(const r of c0(t)){const o=t[r];if(o!==void 0){const s=Object.fromEntries(Ji(o).filter(([,a])=>a!==void 0));n[Qr][r]={...n[Qr][r],...s}}}return n}var Pt=32,Dn=126,Q0=Dn-Pt+1,nu=ru(0),Us=ru(1),eC=nu+ru(-1);function ru(e){const t=Pt+(e<0?Q0+e:e);if(t<Pt||t>Dn)throw new Error(`Invalid n value: ${e}`);return String.fromCharCode(t)}function Yt(e,t){return e!==void 0&&t!==void 0?rC(e,t):e!==void 0?nC(e):t!==void 0?tC(t):Us}function tC(e){const t=e.length-1;for(let n=0;n<=t;n++){const r=e.charCodeAt(n);if(!(r<=Pt))return n===t?r===Pt+1?e.substring(0,n)+eC:e.substring(0,n)+String.fromCharCode(r-1):e.substring(0,n+1)}return Us}function nC(e){for(let t=0;t<=e.length-1;t++){const n=e.charCodeAt(t);if(!(n>=Dn))return e.substring(0,t)+String.fromCharCode(n+1)}return e+Us}function rC(e,t){if(e<t)return mi(e,t);if(e>t)return mi(t,e);throw new Error("Cannot compute value between two equal positions")}function mi(e,t){let n=0;const r=e.length,o=t.length;for(;;){const s=n<r?e.charCodeAt(n):Pt,a=n<o?t.charCodeAt(n):Dn;if(s===a){n++;continue}if(a-s===1){const i=n+1;let u=e.substring(0,i);u.length<i&&(u+=nu.repeat(i-u.length));const c=e.substring(i);return u+mi(c,"")}else return oC(e,n)+String.fromCharCode(a+s>>1)}}function oC(e,t){return t<e.length?e.substring(0,t):e+nu.repeat(t-e.length)}var sC=Pt+1;function aC(e){if(e==="")return!1;const t=e.length-1,n=e.charCodeAt(t);if(n<sC||n>Dn)return!1;for(let r=0;r<t;r++){const o=e.charCodeAt(r);if(o<Pt||o>Dn)return!1}return!0}function iC(e){const t=[];for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);t.push(r<Pt?Pt:r>Dn?Dn:r)}for(;t.length>0&&t[t.length-1]===Pt;)t.length--;return t.length>0?String.fromCharCode(...t):Us}function so(e){return aC(e)?e:iC(e)}function uC(e){return e.type===5&&e.id==="ACK"}function cC(e,t){const{getCurrentConnectionId:n,onDispatch:r,isStorageWritable:o=()=>!0}=t;let s=0,a=0;const i=new Map;return{roomId:e,nodes:i,getNode:u=>i.get(u),addNode:(u,c)=>void i.set(u,c),deleteNode:u=>void i.delete(u),generateId:()=>`${n()}:${s++}`,generateOpId:()=>`${n()}:${a++}`,dispatch(u,c,l){r?.(u,c,l)},assertStorageIsWritable:()=>{if(!o())throw new Error("Cannot write to storage with a read only user, please ensure the user has write permissions")}}}function _c(e,t,n=so(t)){return Object.freeze({type:"HasParent",node:e,key:t,pos:n})}var jc=Object.freeze({type:"NoParent"});function lC(e,t=so(e)){return Object.freeze({type:"Orphaned",oldKey:e,oldPos:t})}var Hs=class{#e;#t;#n=jc;_getParentKeyOrThrow(){switch(this.parent.type){case"HasParent":return this.parent.key;case"NoParent":throw new Error("Parent key is missing");case"Orphaned":return this.parent.oldKey;default:return lt(this.parent,"Unknown state")}}get _parentPos(){switch(this.parent.type){case"HasParent":return this.parent.pos;case"NoParent":throw new Error("Parent key is missing");case"Orphaned":return this.parent.oldPos;default:return lt(this.parent,"Unknown state")}}get _pool(){return this.#e}get roomId(){return this.#e?this.#e.roomId:null}get _id(){return this.#t}get parent(){return this.#n}get _parentKey(){switch(this.parent.type){case"HasParent":return this.parent.key;case"NoParent":return null;case"Orphaned":return this.parent.oldKey;default:return lt(this.parent,"Unknown state")}}_apply(e,t){switch(e.type){case 5:return this.parent.type==="HasParent"?this.parent.node._detachChild(this):{modified:!1}}return{modified:!1}}_setParentLink(e,t){switch(this.parent.type){case"HasParent":if(this.parent.node!==e)throw new Error("Cannot set parent: node already has a parent");this.#n=_c(e,t);return;case"Orphaned":case"NoParent":{this.#n=_c(e,t);return}default:return lt(this.parent,"Unknown state")}}_attach(e,t){if(this.#t||this.#e)throw new Error("Cannot attach node: already attached");t.addNode(e,this),this.#t=e,this.#e=t}_detach(){switch(this.#e&&this.#t&&this.#e.deleteNode(this.#t),this.parent.type){case"HasParent":{this.#n=lC(this.parent.key,this.parent.pos);break}case"NoParent":{this.#n=jc;break}case"Orphaned":break;default:lt(this.parent,"Unknown state")}this.#e=void 0}#r;#s;#o;invalidate(){(this.#r!==void 0||this.#o!==void 0)&&(this.#r=void 0,this.#o=void 0,this.parent.type==="HasParent"&&this.parent.node.invalidate())}toTreeNode(e){return(this.#o===void 0||this.#s!==e)&&(this.#s=e,this.#o=this._toTreeNode(e)),this.#o}toImmutable(){return this.#r===void 0&&(this.#r=this._toImmutable()),this.#r}};function fC(e){return e.type===0&&!dC(e)}function dC(e){return e.parentId!==void 0&&e.parentKey!==void 0}var Sn=class $d extends Hs{#e;constructor(t){super(),this.#e=t}get data(){return this.#e}static _deserialize([t,n],r,o){const s=new $d(n.data);return s._attach(t,o),s}_toOps(t,n,r){if(this._id===void 0)throw new Error("Cannot serialize register if parentId or parentKey is undefined");return[{type:8,opId:r?.generateOpId(),id:this._id,parentId:t,parentKey:n,data:this.data}]}_serialize(){if(this.parent.type!=="HasParent")throw new Error("Cannot serialize LiveRegister if parent is missing");return{type:3,parentId:pe(this.parent.node._id,"Parent node expected to have ID"),parentKey:this.parent.key,data:this.data}}_attachChild(t){throw new Error("Method not implemented.")}_detachChild(t){throw new Error("Method not implemented.")}_apply(t,n){return super._apply(t,n)}_toTreeNode(t){return{type:"Json",id:this._id??Nr(),key:t,payload:this.#e}}_toImmutable(){return this.#e}clone(){return oo(this.data)}};function hC(e,t){const n=e._parentPos,r=t._parentPos;return n===r?0:n<r?-1:1}var kr=class vi extends Hs{#e;#t;#n;constructor(t){super(),this.#e=[],this.#t=new WeakSet,this.#n=new Map;let n;for(const r of t){const o=Yt(n),s=vr(r);s._setParentLink(this,o),this.#e.push(s),n=o}}static _deserialize([t],n,r){const o=new vi([]);o._attach(t,r);const s=n.get(t);if(s===void 0)return o;for(const[a,i]of s){const u=Wd([a,i],n,r);u._setParentLink(o,i.parentKey),o._insertAndSort(u)}return o}_toOps(t,n,r){if(this._id===void 0)throw new Error("Cannot serialize item is not attached");const o=[],s={id:this._id,opId:r?.generateOpId(),type:2,parentId:t,parentKey:n};o.push(s);for(const a of this.#e){const i=a._getParentKeyOrThrow(),u=zo(a._toOps(this._id,i,r),void 0),c=u[0].opId;c!==void 0&&this.#n.set(i,c),o.push(...u)}return o}_insertAndSort(t){this.#e.push(t),this._sortItems()}_sortItems(){this.#e.sort(hC),this.invalidate()}_indexOfPosition(t){return this.#e.findIndex(n=>n._getParentKeyOrThrow()===t)}_attach(t,n){super._attach(t,n);for(const r of this.#e)r._attach(n.generateId(),n)}_detach(){super._detach();for(const t of this.#e)t._detach()}#r(t){if(this._pool===void 0)throw new Error("Can't attach child if managed pool is not present");const{id:n,parentKey:r}=t,o=Kr(t);o._attach(n,this._pool),o._setParentLink(this,r);const s=t.deletedId,a=this._indexOfPosition(r);if(a!==-1){const i=this.#e[a];if(i._id===s)return i._detach(),this.#e[a]=o,{modified:Fe(this,[sr(a,o)]),reverse:[]};{this.#t.add(i),this.#e[a]=o;const u=[sr(a,o)],c=this.#o(t.deletedId);return c&&u.push(c),{modified:Fe(this,u),reverse:[]}}}else{const i=[],u=this.#o(t.deletedId);return u&&i.push(u),this._insertAndSort(o),i.push(_t(this._indexOfPosition(r),o)),{reverse:[],modified:Fe(this,i)}}}#s(t){if(this._pool===void 0)throw new Error("Can't attach child if managed pool is not present");const n=[],r=this.#o(t.deletedId);r&&n.push(r);const o=this.#n.get(t.parentKey);if(o!==void 0){if(o!==t.opId)return n.length===0?{modified:!1}:{modified:Fe(this,n),reverse:[]};this.#n.delete(t.parentKey)}const s=this._indexOfPosition(t.parentKey),a=this.#e.find(i=>i._id===t.id);if(a!==void 0){if(a._parentKey===t.parentKey)return{modified:n.length>0?Fe(this,n):!1,reverse:[]};if(s!==-1){this.#t.add(this.#e[s]);const[c]=this.#e.splice(s,1);n.push(Wo(s,c))}const i=this.#e.indexOf(a);a._setParentLink(this,t.parentKey),this._sortItems();const u=this.#e.indexOf(a);return u!==i&&n.push(Fn(i,u,a)),{modified:n.length>0?Fe(this,n):!1,reverse:[]}}else{const i=this._pool.getNode(t.id);if(i&&this.#t.has(i)){i._setParentLink(this,t.parentKey),this.#t.delete(i),this._insertAndSort(i);const u=this.#e.indexOf(i);return{modified:Fe(this,[s===-1?_t(u,i):sr(u,i),...n]),reverse:[]}}else{s!==-1&&this.#e.splice(s,1);const{newItem:u,newIndex:c}=this.#c(t,t.parentKey);return{modified:Fe(this,[s===-1?_t(c,u):sr(c,u),...n]),reverse:[]}}}}#o(t){if(t===void 0||this._pool===void 0)return null;const n=this._pool.getNode(t);if(n===void 0)return null;const r=this._detachChild(n);return r.modified===!1?null:r.modified.updates[0]}#i(t){if(this._pool===void 0)throw new Error("Can't attach child if managed pool is not present");const n=so(t.parentKey),r=this._indexOfPosition(n);r!==-1&&this.#u(r,n);const{newItem:o,newIndex:s}=this.#c(t,n);return{modified:Fe(this,[_t(s,o)]),reverse:[]}}#a(t){const n=this.#e.find(s=>s._id===t.id),r=so(t.parentKey),o=this._indexOfPosition(r);if(n){if(n._parentKey===r)return{modified:!1};{const s=this.#e.indexOf(n);o!==-1&&this.#u(o,r),n._setParentLink(this,r),this._sortItems();const a=this._indexOfPosition(r);return a===s?{modified:!1}:{modified:Fe(this,[Fn(s,a,n)]),reverse:[]}}}else{const s=pe(this._pool).getNode(t.id);if(s&&this.#t.has(s)){s._setParentLink(this,r),this.#t.delete(s),this._insertAndSort(s);const a=this._indexOfPosition(r);return{modified:Fe(this,[_t(a,s)]),reverse:[]}}else{o!==-1&&this.#u(o,r);const{newItem:a,newIndex:i}=this.#c(t,r);return{modified:Fe(this,[_t(i,a)]),reverse:[]}}}}#l(t){const{id:n,parentKey:r}=t,o=Kr(t);if(this._pool?.getNode(n)!==void 0)return{modified:!1};o._attach(n,pe(this._pool)),o._setParentLink(this,r);const s=this._indexOfPosition(r);let a=r;if(s!==-1){const u=this.#e[s]?._parentPos,c=this.#e[s+1]?._parentPos;a=Yt(u,c),o._setParentLink(this,a)}this._insertAndSort(o);const i=this._indexOfPosition(a);return{modified:Fe(this,[_t(i,o)]),reverse:[{type:5,id:n}]}}#d(t){const{id:n,parentKey:r}=t,o=Kr(t);if(this._pool?.getNode(n)!==void 0)return{modified:!1};this.#n.set(r,pe(t.opId));const s=this._indexOfPosition(r);o._attach(n,pe(this._pool)),o._setParentLink(this,r);const a=r;if(s!==-1){const i=this.#e[s];i._detach(),this.#e[s]=o;const u=zo(i._toOps(pe(this._id),r,this._pool),t.id),c=[sr(s,o)],l=this.#o(t.deletedId);return l&&c.push(l),{modified:Fe(this,c),reverse:u}}else{this._insertAndSort(o),this.#o(t.deletedId);const i=this._indexOfPosition(a);return{reverse:[{type:5,id:n}],modified:Fe(this,[_t(i,o)])}}}_attachChild(t,n){if(this._pool===void 0)throw new Error("Can't attach child if managed pool is not present");let r;return t.intent==="set"?n===1?r=this.#r(t):n===2?r=this.#s(t):r=this.#d(t):n===1?r=this.#i(t):n===2?r=this.#a(t):r=this.#l(t),r.modified!==!1&&this.invalidate(),r}_detachChild(t){if(t){const n=pe(t._parentKey),r=t._toOps(pe(this._id),n,this._pool),o=this.#e.indexOf(t);if(o===-1)return{modified:!1};const[s]=this.#e.splice(o,1);return this.invalidate(),t._detach(),{modified:Fe(this,[Wo(o,s)]),reverse:r}}return{modified:!1}}#h(t,n){if(this.#t.has(n)){this.#t.delete(n),n._setParentLink(this,t),this._insertAndSort(n);const s=this.#e.indexOf(n);return{modified:Fe(this,[_t(s,n)]),reverse:[]}}const r=n._parentKey;if(t===r)return{modified:!1};const o=this._indexOfPosition(t);if(o===-1){const s=this.#e.indexOf(n);n._setParentLink(this,t),this._sortItems();const a=this.#e.indexOf(n);return a===s?{modified:!1}:{modified:Fe(this,[Fn(s,a,n)]),reverse:[]}}else{this.#e[o]._setParentLink(this,Yt(t,this.#e[o+1]?._parentPos));const s=this.#e.indexOf(n);n._setParentLink(this,t),this._sortItems();const a=this.#e.indexOf(n);return a===s?{modified:!1}:{modified:Fe(this,[Fn(s,a,n)]),reverse:[]}}}#p(t,n){const r=pe(n._parentKey);if(this.#t.has(n)){const o=this._indexOfPosition(t);return this.#t.delete(n),o!==-1&&this.#e[o]._setParentLink(this,Yt(t,this.#e[o+1]?._parentPos)),n._setParentLink(this,t),this._insertAndSort(n),{modified:!1}}else{if(t===r)return{modified:!1};const o=this.#e.indexOf(n),s=this._indexOfPosition(t);s!==-1&&this.#e[s]._setParentLink(this,Yt(t,this.#e[s+1]?._parentPos)),n._setParentLink(this,t),this._sortItems();const a=this.#e.indexOf(n);return o===a?{modified:!1}:{modified:Fe(this,[Fn(o,a,n)]),reverse:[]}}}#f(t,n){const r=pe(n._parentKey),o=this.#e.indexOf(n),s=this._indexOfPosition(t);s!==-1&&this.#e[s]._setParentLink(this,Yt(t,this.#e[s+1]?._parentPos)),n._setParentLink(this,t),this._sortItems();const a=this.#e.indexOf(n);return o===a?{modified:!1}:{modified:Fe(this,[Fn(o,a,n)]),reverse:[{type:1,id:pe(n._id),parentKey:r}]}}_setChildKey(t,n,r){return r===1?this.#h(t,n):r===2?this.#p(t,n):this.#f(t,n)}_apply(t,n){return super._apply(t,n)}_serialize(){if(this.parent.type!=="HasParent")throw new Error("Cannot serialize LiveList if parent is missing");return{type:1,parentId:pe(this.parent.node._id,"Parent node expected to have ID"),parentKey:this.parent.key}}get length(){return this.#e.length}push(t){return this._pool?.assertStorageIsWritable(),this.insert(t,this.length)}insert(t,n){if(this._pool?.assertStorageIsWritable(),n<0||n>this.#e.length)throw new Error(`Cannot insert list item at index "${n}". index should be between 0 and ${this.#e.length}`);const r=this.#e[n-1]?this.#e[n-1]._parentPos:void 0,o=this.#e[n]?this.#e[n]._parentPos:void 0,s=Yt(r,o),a=vr(t);if(a._setParentLink(this,s),this._insertAndSort(a),this._pool&&this._id){const i=this._pool.generateId();a._attach(i,this._pool),this._pool.dispatch(a._toOps(this._id,s,this._pool),[{type:5,id:i}],new Map([[this._id,Fe(this,[_t(n,a)])]]))}}move(t,n){if(this._pool?.assertStorageIsWritable(),n<0)throw new Error("targetIndex cannot be less than 0");if(n>=this.#e.length)throw new Error("targetIndex cannot be greater or equal than the list length");if(t<0)throw new Error("index cannot be less than 0");if(t>=this.#e.length)throw new Error("index cannot be greater or equal than the list length");let r=null,o=null;t<n?(o=n===this.#e.length-1?void 0:this.#e[n+1]._parentPos,r=this.#e[n]._parentPos):(o=this.#e[n]._parentPos,r=n===0?void 0:this.#e[n-1]._parentPos);const s=Yt(r,o),a=this.#e[t],i=a._getParentKeyOrThrow();if(a._setParentLink(this,s),this._sortItems(),this._pool&&this._id){const u=new Map([[this._id,Fe(this,[Fn(t,n,a)])]]);this._pool.dispatch([{type:1,id:pe(a._id),opId:this._pool.generateOpId(),parentKey:s}],[{type:1,id:pe(a._id),parentKey:i}],u)}}delete(t){if(this._pool?.assertStorageIsWritable(),t<0||t>=this.#e.length)throw new Error(`Cannot delete list item at index "${t}". index should be between 0 and ${this.#e.length-1}`);const n=this.#e[t];n._detach();const[r]=this.#e.splice(t,1);if(this.invalidate(),this._pool){const o=n._id;if(o){const s=new Map;s.set(pe(this._id),Fe(this,[Wo(t,r)])),this._pool.dispatch([{id:o,opId:this._pool.generateOpId(),type:5}],n._toOps(pe(this._id),n._getParentKeyOrThrow()),s)}}}clear(){if(this._pool?.assertStorageIsWritable(),this._pool){const t=[],n=[],r=[];for(const s of this.#e){s._detach();const a=s._id;a&&(t.push({type:5,id:a,opId:this._pool.generateOpId()}),n.push(...s._toOps(pe(this._id),s._getParentKeyOrThrow())),r.push(Wo(0,s)))}this.#e=[],this.invalidate();const o=new Map;o.set(pe(this._id),Fe(this,r)),this._pool.dispatch(t,n,o)}else{for(const t of this.#e)t._detach();this.#e=[],this.invalidate()}}set(t,n){if(this._pool?.assertStorageIsWritable(),t<0||t>=this.#e.length)throw new Error(`Cannot set list item at index "${t}". index should be between 0 and ${this.#e.length-1}`);const r=this.#e[t],o=r._getParentKeyOrThrow(),s=r._id;r._detach();const a=vr(n);if(a._setParentLink(this,o),this.#e[t]=a,this.invalidate(),this._pool&&this._id){const i=this._pool.generateId();a._attach(i,this._pool);const u=new Map;u.set(this._id,Fe(this,[sr(t,a)]));const c=zo(a._toOps(this._id,o,this._pool),s);this.#n.set(o,pe(c[0].opId));const l=zo(r._toOps(this._id,o,void 0),i);this._pool.dispatch(c,l,u)}}toArray(){return this.#e.map(t=>$n(t))}every(t){return this.toArray().every(t)}filter(t){return this.toArray().filter(t)}find(t){return this.toArray().find(t)}findIndex(t){return this.toArray().findIndex(t)}forEach(t){return this.toArray().forEach(t)}get(t){if(!(t<0||t>=this.#e.length))return $n(this.#e[t])}indexOf(t,n){return this.toArray().indexOf(t,n)}lastIndexOf(t,n){return this.toArray().lastIndexOf(t,n)}map(t){return this.#e.map((n,r)=>t($n(n),r))}some(t){return this.toArray().some(t)}[Symbol.iterator](){return new pC(this.#e)}#c(t,n){const r=Kr(t);r._attach(t.id,pe(this._pool)),r._setParentLink(this,n),this._insertAndSort(r);const o=this._indexOfPosition(n);return{newItem:r,newIndex:o}}#u(t,n){const r=Yt(n,this.#e.length>t+1?this.#e[t+1]?._parentPos:void 0);this.#e[t]._setParentLink(this,r)}_toTreeNode(t){return{type:"LiveList",id:this._id??Nr(),key:t,payload:this.#e.map((n,r)=>n.toTreeNode(r.toString()))}}toImmutable(){return super.toImmutable()}_toImmutable(){return this.#e.map(n=>n.toImmutable())}clone(){return new vi(this.#e.map(t=>t.clone()))}},pC=class{#e;constructor(e){this.#e=e[Symbol.iterator]()}[Symbol.iterator](){return this}next(){const e=this.#e.next();return e.done?{done:!0,value:void 0}:{value:$n(e.value)}}};function Fe(e,t){return{node:e,type:"LiveList",updates:t}}function sr(e,t){return{index:e,type:"set",item:t instanceof Sn?t.data:t}}function Wo(e,t){return{type:"delete",index:e,deletedItem:t instanceof Sn?t.data:t}}function _t(e,t){return{index:e,type:"insert",item:t instanceof Sn?t.data:t}}function Fn(e,t,n){return{type:"move",index:t,item:n instanceof Sn?n.data:n,previousIndex:e}}function zo(e,t){return e.map((n,r)=>r===0?{...n,intent:"set",deletedId:t}:n)}var Mr=class gi extends Hs{#e;#t;constructor(t){if(super(),this.#t=new Map,t){const n=[];for(const[r,o]of t){const s=vr(o);s._setParentLink(this,r),n.push([r,s])}this.#e=new Map(n)}else this.#e=new Map}_toOps(t,n,r){if(this._id===void 0)throw new Error("Cannot serialize item is not attached");const o=[],s={id:this._id,opId:r?.generateOpId(),type:7,parentId:t,parentKey:n};o.push(s);for(const[a,i]of this.#e)o.push(...i._toOps(this._id,a,r));return o}static _deserialize([t,n],r,o){const s=new gi;s._attach(t,o);const a=r.get(t);if(a===void 0)return s;for(const[i,u]of a){const c=Wd([i,u],r,o);c._setParentLink(s,u.parentKey),s.#e.set(u.parentKey,c),s.invalidate()}return s}_attach(t,n){super._attach(t,n);for(const[r,o]of this.#e)We(o)&&o._attach(n.generateId(),n)}_attachChild(t,n){if(this._pool===void 0)throw new Error("Can't attach child if managed pool is not present");const{id:r,parentKey:o,opId:s}=t,a=o,i=Kr(t);if(this._pool.getNode(r)!==void 0)return{modified:!1};if(n===2){const l=this.#t.get(a);if(l===s)return this.#t.delete(a),{modified:!1};if(l!==void 0)return{modified:!1}}else n===1&&this.#t.delete(a);const u=this.#e.get(a);let c;if(u){const l=pe(this._id);c=u._toOps(l,a),u._detach()}else c=[{type:5,id:r}];return i._setParentLink(this,a),i._attach(r,this._pool),this.#e.set(a,i),this.invalidate(),{modified:{node:this,type:"LiveMap",updates:{[a]:{type:"update"}}},reverse:c}}_detach(){super._detach();for(const t of this.#e.values())t._detach()}_detachChild(t){const n=pe(this._id),r=pe(t._parentKey),o=t._toOps(n,r,this._pool);for(const[a,i]of this.#e)i===t&&(this.#e.delete(a),this.invalidate());return t._detach(),{modified:{node:this,type:"LiveMap",updates:{[r]:{type:"delete"}}},reverse:o}}_serialize(){if(this.parent.type!=="HasParent")throw new Error("Cannot serialize LiveMap if parent is missing");return{type:2,parentId:pe(this.parent.node._id,"Parent node expected to have ID"),parentKey:this.parent.key}}get(t){const n=this.#e.get(t);if(n!==void 0)return $n(n)}set(t,n){this._pool?.assertStorageIsWritable();const r=this.#e.get(t);r&&r._detach();const o=vr(n);if(o._setParentLink(this,t),this.#e.set(t,o),this.invalidate(),this._pool&&this._id){const s=this._pool.generateId();o._attach(s,this._pool);const a=new Map;a.set(this._id,{node:this,type:"LiveMap",updates:{[t]:{type:"update"}}});const i=o._toOps(this._id,t,this._pool);this.#t.set(t,pe(i[0].opId)),this._pool.dispatch(o._toOps(this._id,t,this._pool),r?r._toOps(this._id,t):[{type:5,id:s}],a)}}get size(){return this.#e.size}has(t){return this.#e.has(t)}delete(t){this._pool?.assertStorageIsWritable();const n=this.#e.get(t);if(n===void 0)return!1;if(n._detach(),this.#e.delete(t),this.invalidate(),this._pool&&n._id){const r=pe(this._id),o=new Map;o.set(r,{node:this,type:"LiveMap",updates:{[t]:{type:"delete"}}}),this._pool.dispatch([{type:5,id:n._id,opId:this._pool.generateOpId()}],n._toOps(r,t),o)}return!0}entries(){const t=this.#e.entries();return{[Symbol.iterator](){return this},next(){const n=t.next();if(n.done)return{done:!0,value:void 0};const o=n.value[0],s=$n(n.value[1]);return{value:[o,s]}}}}[Symbol.iterator](){return this.entries()}keys(){return this.#e.keys()}values(){const t=this.#e.values();return{[Symbol.iterator](){return this},next(){const n=t.next();return n.done?{done:!0,value:void 0}:{value:$n(n.value)}}}}forEach(t){for(const n of this)t(n[1],n[0],this)}_toTreeNode(t){return{type:"LiveMap",id:this._id??Nr(),key:t,payload:Array.from(this.#e.entries()).map(([n,r])=>r.toTreeNode(n))}}toImmutable(){return super.toImmutable()}_toImmutable(){const t=new Map;for(const[n,r]of this.#e)t.set(n,r.toImmutable());return En(t)}clone(){return new gi(Array.from(this.#e).map(([t,n])=>[t,n.clone()]))}},Jn=class Vr extends Hs{#e;#t;static#n(t){const n=new Map;let r=null;for(const[o,s]of t)if(fC(s))r=[o,s];else{const a=[o,s],i=n.get(s.parentId);i!==void 0?i.push(a):n.set(s.parentId,[a])}if(r===null)throw new Error("Root can't be null");return[r,n]}static _fromItems(t,n){const[r,o]=Vr.#n(t);return Vr._deserialize(r,o,n)}constructor(t={}){super(),this.#t=new Map;const n=xo(t);for(const r of Object.keys(n)){const o=n[r];We(o)&&o._setParentLink(this,r)}this.#e=new Map(Object.entries(n))}_toOps(t,n,r){if(this._id===void 0)throw new Error("Cannot serialize item is not attached");const o=r?.generateOpId(),s=[],a={type:4,id:this._id,opId:o,parentId:t,parentKey:n,data:{}};s.push(a);for(const[i,u]of this.#e)We(u)?s.push(...u._toOps(this._id,i,r)):a.data[i]=u;return s}static _deserialize([t,n],r,o){const s=new Vr(n.data);return s._attach(t,o),this._deserializeChildren(s,r,o)}static _deserializeChildren(t,n,r){const o=n.get(pe(t._id));if(o===void 0)return t;for(const[s,a]of o){const i=mC([s,a],n,r);hr(i)&&i._setParentLink(t,a.parentKey),t.#e.set(a.parentKey,i),t.invalidate()}return t}_attach(t,n){super._attach(t,n);for(const[r,o]of this.#e)We(o)&&o._attach(n.generateId(),n)}_attachChild(t,n){if(this._pool===void 0)throw new Error("Can't attach child if managed pool is not present");const{id:r,opId:o,parentKey:s}=t,a=Ud(t);if(this._pool.getNode(r)!==void 0)return this.#t.get(s)===o&&this.#t.delete(s),{modified:!1};if(n===0)this.#t.set(s,pe(o));else if(this.#t.get(s)!==void 0)return this.#t.get(s)===o?(this.#t.delete(s),{modified:!1}):{modified:!1};const i=pe(this._id),u=this.#e.get(s);let c;return We(u)?(c=u._toOps(i,s),u._detach()):u===void 0?c=[{type:6,id:i,key:s}]:c=[{type:3,id:i,data:{[s]:u}}],this.#e.set(s,a),this.invalidate(),hr(a)&&(a._setParentLink(this,s),a._attach(r,this._pool)),{reverse:c,modified:{node:this,type:"LiveObject",updates:{[s]:{type:"update"}}}}}_detachChild(t){if(t){const n=pe(this._id),r=pe(t._parentKey),o=t._toOps(n,r,this._pool);for(const[a,i]of this.#e)i===t&&(this.#e.delete(a),this.invalidate());return t._detach(),{modified:{node:this,type:"LiveObject",updates:{[r]:{type:"delete"}}},reverse:o}}return{modified:!1}}_detach(){super._detach();for(const t of this.#e.values())We(t)&&t._detach()}_apply(t,n){return t.type===3?this.#r(t,n):t.type===6?this.#s(t,n):super._apply(t,n)}_serialize(){const t={};for(const[n,r]of this.#e)We(r)||(t[n]=r);return this.parent.type==="HasParent"&&this.parent.node._id?{type:0,parentId:this.parent.node._id,parentKey:this.parent.key,data:t}:{type:0,data:t}}#r(t,n){let r=!1;const o=pe(this._id),s=[],a={type:3,id:o,data:{}};for(const u in t.data){const c=this.#e.get(u);We(c)?(s.push(...c._toOps(o,u)),c._detach()):c!==void 0?a.data[u]=c:c===void 0&&s.push({type:6,id:o,key:u})}const i={};for(const u in t.data){const c=t.data[u];if(c===void 0)continue;if(n)this.#t.set(u,pe(t.opId));else if(this.#t.get(u)===void 0)r=!0;else if(this.#t.get(u)===t.opId){this.#t.delete(u);continue}else continue;const l=this.#e.get(u);We(l)&&l._detach(),r=!0,i[u]={type:"update"},this.#e.set(u,c),this.invalidate()}return Object.keys(a.data).length!==0&&s.unshift(a),r?{modified:{node:this,type:"LiveObject",updates:i},reverse:s}:{modified:!1}}#s(t,n){const r=t.key;if(this.#e.has(r)===!1)return{modified:!1};if(!n&&this.#t.get(r)!==void 0)return{modified:!1};const o=this.#e.get(r),s=pe(this._id);let a=[];return We(o)?(a=o._toOps(s,t.key),o._detach()):o!==void 0&&(a=[{type:3,id:s,data:{[r]:o}}]),this.#e.delete(r),this.invalidate(),{modified:{node:this,type:"LiveObject",updates:{[t.key]:{type:"delete"}}},reverse:a}}toObject(){return Object.fromEntries(this.#e)}set(t,n){this._pool?.assertStorageIsWritable(),this.update({[t]:n})}get(t){return this.#e.get(t)}delete(t){this._pool?.assertStorageIsWritable();const n=t,r=this.#e.get(n);if(r===void 0)return;if(this._pool===void 0||this._id===void 0){We(r)&&r._detach(),this.#e.delete(n),this.invalidate();return}let o;We(r)?(r._detach(),o=r._toOps(this._id,n)):o=[{type:3,data:{[n]:r},id:this._id}],this.#e.delete(n),this.invalidate();const s=new Map;s.set(this._id,{node:this,type:"LiveObject",updates:{[t]:{type:"delete"}}}),this._pool.dispatch([{type:6,key:n,id:this._id,opId:this._pool.generateOpId()}],o,s)}update(t){if(this._pool?.assertStorageIsWritable(),this._pool===void 0||this._id===void 0){for(const c in t){const l=t[c];if(l===void 0)continue;const d=this.#e.get(c);We(d)&&d._detach(),We(l)&&l._setParentLink(this,c),this.#e.set(c,l),this.invalidate()}return}const n=[],r=[],o=this._pool.generateOpId(),s={},a={id:this._id,type:3,data:{}},i={};for(const c in t){const l=t[c];if(l===void 0)continue;const d=this.#e.get(c);if(We(d)?(r.push(...d._toOps(this._id,c)),d._detach()):d===void 0?r.push({type:6,id:this._id,key:c}):a.data[c]=d,We(l)){l._setParentLink(this,c),l._attach(this._pool.generateId(),this._pool);const m=l._toOps(this._id,c,this._pool),g=m.find(C=>C.parentId===this._id);g&&this.#t.set(c,pe(g.opId)),n.push(...m)}else s[c]=l,this.#t.set(c,o);this.#e.set(c,l),this.invalidate(),i[c]={type:"update"}}Object.keys(a.data).length!==0&&r.unshift(a),Object.keys(s).length!==0&&n.unshift({opId:o,id:this._id,type:3,data:s});const u=new Map;u.set(this._id,{node:this,type:"LiveObject",updates:i}),this._pool.dispatch(n,r,u)}toImmutable(){return super.toImmutable()}toTreeNode(t){return super.toTreeNode(t)}_toTreeNode(t){const n=this._id??Nr();return{type:"LiveObject",id:n,key:t,payload:Array.from(this.#e.entries()).map(([r,o])=>We(o)?o.toTreeNode(r):{type:"Json",id:`${n}:${r}`,key:r,payload:o})}}_toImmutable(){const t={};for(const[n,r]of this.#e)t[n]=hr(r)?r.toImmutable():r;return t}clone(){return new Vr(Object.fromEntries(Array.from(this.#e).map(([t,n])=>[t,hr(n)?n.clone():oo(n)])))}};function Kr(e){return vr(Ud(e))}function Ud(e){switch(e.type){case 8:return e.data;case 4:return new Jn(e.data);case 7:return new Mr;case 2:return new kr([]);default:return lt(e,"Unknown creation Op")}}function Hd(e,t){return e===t?!0:e.parent.type==="HasParent"?Hd(e.parent.node,t):!1}function Wd([e,t],n,r){switch(t.type){case 0:return Jn._deserialize([e,t],n,r);case 1:return kr._deserialize([e,t],n,r);case 2:return Mr._deserialize([e,t],n,r);case 3:return Sn._deserialize([e,t],n,r);default:throw new Error("Unexpected CRDT type")}}function mC([e,t],n,r){switch(t.type){case 0:return Jn._deserialize([e,t],n,r);case 1:return kr._deserialize([e,t],n,r);case 2:return Mr._deserialize([e,t],n,r);case 3:return t.data;default:throw new Error("Unexpected CRDT type")}}function hr(e){return zd(e)||vC(e)||gC(e)}function We(e){return hr(e)||CC(e)}function zd(e){return e instanceof kr}function vC(e){return e instanceof Mr}function gC(e){return e instanceof Jn}function CC(e){return e instanceof Sn}function yC(e){return e===void 0?void 0:hr(e)?e.clone():oo(e)}function $n(e){return e instanceof Sn?e.data:e instanceof kr||e instanceof Mr||e instanceof Jn?e:lt(e,"Unknown AbstractCrdt")}function vr(e){return e instanceof Jn||e instanceof Mr||e instanceof kr?e:new Sn(e)}function bC(e,t){const n=[];return e.forEach((r,o)=>{t.get(o)||n.push({type:5,id:o})}),t.forEach((r,o)=>{const s=e.get(o);if(s)r.type===0&&(s.type!==0||tn(r.data)!==tn(s.data))&&n.push({type:3,id:o,data:r.data}),r.parentKey!==s.parentKey&&n.push({type:1,id:o,parentKey:pe(r.parentKey,"Parent key must not be missing")});else switch(r.type){case 3:n.push({type:8,id:o,parentId:r.parentId,parentKey:r.parentKey,data:r.data});break;case 1:n.push({type:2,id:o,parentId:r.parentId,parentKey:r.parentKey});break;case 0:if(r.parentId===void 0||r.parentKey===void 0)throw new Error("Internal error. Cannot serialize storage root into an operation");n.push({type:4,id:o,parentId:r.parentId,parentKey:r.parentKey,data:r.data});break;case 2:n.push({type:7,id:o,parentId:r.parentId,parentKey:r.parentKey});break}}),n}function EC(e,t){const n=e.updates;for(const[r,o]of Ji(t.updates))n[r]=o;return{...t,updates:n}}function DC(e,t){const n=e.updates;for(const[r,o]of Ji(t.updates))n[r]=o;return{...t,updates:n}}function wC(e,t){const n=e.updates;return{...t,updates:n.concat(t.updates)}}function Ta(e,t){return e===void 0?t:e.type==="LiveObject"&&t.type==="LiveObject"?EC(e,t):e.type==="LiveMap"&&t.type==="LiveMap"?DC(e,t):e.type==="LiveList"&&t.type==="LiveList"?wC(e,t):t}var Ra=class{#e;#t;#n;#r;constructor(){this.#e={},this.#t=0,this.#n=1,this.#r=0}get length(){return this.#r}*[Symbol.iterator](){const e=this.#r,t=this.#t;for(let n=0;n<e;n++)yield this.#e[t+n]}push(e){const t=Array.isArray(e)?e:[e];this.#n>Number.MAX_SAFE_INTEGER-t.length-1&&wt("Deque full");for(const n of t)this.#e[this.#n++-1]=n;this.#r+=t.length}pop(){if(this.#r<1)return;this.#n--;const e=this.#e[this.#n-1];return delete this.#e[this.#n-1],this.#r--,e}pushLeft(e){const t=Array.isArray(e)?e:[e];this.#t<Number.MIN_SAFE_INTEGER+t.length&&wt("Deque full");for(let n=t.length-1;n>=0;n--)this.#e[--this.#t]=t[n];this.#r+=t.length}popLeft(){if(this.#r<1)return;const e=this.#e[this.#t];return delete this.#e[this.#t],this.#t++,this.#r--,e}};function AC(e){return e===null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function Vd(e){return Array.isArray(e)}function xC(e){return!AC(e)&&!Vd(e)}function OC(e,t){const{connectionId:n,id:r,info:o}=e,s=pi(e.scopes);return En(xo({connectionId:n,id:r,info:o,canWrite:s,canComment:Ld(e.scopes),isReadOnly:!s,presence:t}))}var SC=class{#e;#t;signal;constructor(){this.#e=new Zn({connections:new Map,presences:new Map}),this.signal=Xe.from(this.#e,e=>li(Array.from(this.#e.get().presences.keys()).map(t=>this.getUser(Number(t))))),this.#t=new Map}get(){return this.signal.get()}connectionIds(){return this.#e.get().connections.keys()}clearOthers(){this.#e.mutate(e=>{e.connections.clear(),e.presences.clear(),this.#t.clear()})}#n(e){const t=this.#e.get(),n=t.connections.get(e),r=t.presences.get(e);if(n!==void 0&&r!==void 0)return OC(n,r)}getUser(e){const t=this.#t.get(e);if(t)return t;const n=this.#n(e);if(n)return this.#t.set(e,n),n}#r(e){this.#t.delete(e)}setConnection(e,t,n,r){this.#e.mutate(o=>(o.connections.set(e,En({connectionId:e,id:t,info:n,scopes:r})),o.presences.has(e)?this.#r(e):!1))}removeConnection(e){this.#e.mutate(t=>{t.connections.delete(e),t.presences.delete(e),this.#r(e)})}setOther(e,t){this.#e.mutate(n=>(n.presences.set(e,En(xo(t))),n.connections.has(e)?this.#r(e):!1))}patchOther(e,t){this.#e.mutate(n=>{const r=n.presences.get(e);if(r===void 0)return!1;const o=Rd(r,t);return r===o?!1:(n.presences.set(e,En(o)),this.#r(e))})}},Kd=class qd extends Error{context;constructor(t,n,r){super(t,{cause:r}),this.context=n,this.name="LiveblocksError"}get roomId(){return this.context.roomId}get code(){return this.context.code}static from(t,n){return new qd(TC(t),t,n)}};function TC(e){switch(e.type){case"ROOM_CONNECTION_ERROR":switch(e.code){case 4001:return"Not allowed to connect to the room";case 4005:return"Room is already full";case 4006:return"Kicked out of the room, because the room ID changed";default:return"Could not connect to the room"}case"CREATE_THREAD_ERROR":return"Could not create new thread";case"DELETE_THREAD_ERROR":return"Could not delete thread";case"EDIT_THREAD_METADATA_ERROR":return"Could not edit thread metadata";case"MARK_THREAD_AS_RESOLVED_ERROR":return"Could not mark thread as resolved";case"MARK_THREAD_AS_UNRESOLVED_ERROR":return"Could not mark thread as unresolved";case"CREATE_COMMENT_ERROR":return"Could not create new comment";case"EDIT_COMMENT_ERROR":return"Could not edit comment";case"DELETE_COMMENT_ERROR":return"Could not delete comment";case"ADD_REACTION_ERROR":return"Could not add reaction";case"REMOVE_REACTION_ERROR":return"Could not remove reaction";case"MARK_INBOX_NOTIFICATION_AS_READ_ERROR":return"Could not mark inbox notification as read";case"DELETE_INBOX_NOTIFICATION_ERROR":return"Could not delete inbox notification";case"MARK_ALL_INBOX_NOTIFICATIONS_AS_READ_ERROR":return"Could not mark all inbox notifications as read";case"DELETE_ALL_INBOX_NOTIFICATIONS_ERROR":return"Could not delete all inbox notifications";case"UPDATE_NOTIFICATION_SETTINGS_ERROR":return"Could not update notification settings";case"UPDATE_USER_NOTIFICATION_SETTINGS_ERROR":return"Could not update user notification settings";default:return lt(e,"Unhandled case")}}var Lc=1024*1024-512;function RC(e){let t=0;return()=>`${e}:${t++}`}function $c(e,t){return{type:"User",id:`${t.connectionId}`,key:e,payload:{connectionId:t.connectionId,id:t.id,info:t.info,presence:t.presence,isReadOnly:!t.canWrite}}}function IC(){const e=typeof document<"u"?document:void 0,t={current:null};function n(){e?.visibilityState==="hidden"?t.current=t.current??Date.now():t.current=null}return e?.addEventListener("visibilitychange",n),[t,()=>{e?.removeEventListener("visibilitychange",n)}]}function BC(e,t){const n=t.roomId,r=e.initialPresence,o=e.initialStorage,s=t.roomHttpClient,[a,i]=IC(),u={...t.delegates,canZombie(){return t.backgroundKeepAliveTimeout!==void 0&&a.current!==null&&Date.now()>a.current+t.backgroundKeepAliveTimeout&&_o()!=="synchronizing"}},c=new V0(u,t.enableDebugLogging),l={buffer:{flushTimerID:void 0,lastFlushedAt:0,presenceUpdates:{type:"full",data:r},messages:[],storageOperations:[]},staticSessionInfoSig:new zt(null),dynamicSessionInfoSig:new zt(null),myPresence:new m0(r),others:new SC,initialStorage:o,idFactory:null,yjsProvider:void 0,yjsProviderDidChange:Ie(),pool:cC(n,{getCurrentConnectionId:R,onDispatch:b,isStorageWritable:w}),root:void 0,undoStack:[],redoStack:[],pausedHistory:null,activeBatch:null,unacknowledgedOps:new Map};let d;function m(A){const K=c.authValue;if(K!==null){const Z=Pd(K);if(Z!==d)if(d=Z,K.type==="secret"){const oe=K.token.parsed;l.staticSessionInfoSig.set({userId:oe.k==="sec-legacy"?oe.id:oe.uid,userInfo:oe.k==="sec-legacy"?oe.info:oe.ui})}else l.staticSessionInfoSig.set({userId:void 0,userInfo:void 0})}D.status.notify(A),L()}let g,C=!1;function v(A){A==="reconnecting"?g=setTimeout(()=>{D.lostConnection.notify("lost"),C=!0,l.others.clearOthers(),G({others:[{type:"reset"}]})},t.lostConnectionTimeout):(clearTimeout(g),C&&(A==="disconnected"?D.lostConnection.notify("failed"):D.lostConnection.notify("restored"),C=!1))}function h(){l.buffer.presenceUpdates={type:"full",data:{...l.myPresence.get()}},Ee!==null&&yt({flush:!1}),he()}function E(){clearTimeout(l.buffer.flushTimerID)}c.events.onMessage.subscribe(je),c.events.statusDidChange.subscribe(m),c.events.statusDidChange.subscribe(v),c.events.didConnect.subscribe(h),c.events.didDisconnect.subscribe(E),c.events.onConnectionError.subscribe(({message:A,code:K})=>{const Z="ROOM_CONNECTION_ERROR",oe=new Kd(A,{type:Z,code:K,roomId:n});t.errorEventSource.notify(oe)});function b(A,K,Z){if(l.activeBatch){for(const oe of A)l.activeBatch.ops.push(oe);for(const[oe,Se]of Z)l.activeBatch.updates.storageUpdates.set(oe,Ta(l.activeBatch.updates.storageUpdates.get(oe),Se));l.activeBatch.reverseOps.pushLeft(K)}else de(K),l.redoStack.length=0,ye(A),G({storageUpdates:Z})}function w(){const A=l.dynamicSessionInfoSig.get()?.scopes;return A!==void 0?pi(A):!0}const D={status:Ie(),lostConnection:Ie(),customEvent:Ie(),self:Ie(),myPresence:Ie(),others:Ie(),storageBatch:Ie(),history:Ie(),storageDidLoad:Ie(),storageStatus:Ie(),ydoc:Ie(),comments:Ie(),roomWillDestroy:Ie()};async function x(A,K){return s.createTextMention({roomId:n,userId:A,mentionId:K})}async function I(A){return s.deleteTextMention({roomId:n,mentionId:A})}async function O(A,K){await s.reportTextEditor({roomId:n,type:A,rootKey:K})}async function F(){return s.listTextVersions({roomId:n})}async function H(A){return s.listTextVersionsSince({roomId:n,since:A.since,signal:A.signal})}async function N(A){return s.getTextVersion({roomId:n,versionId:A})}async function j(){return s.createTextVersion({roomId:n})}async function B(A){return s.executeContextualPrompt({roomId:n,...A})}function*k(A){const{ops:K,...Z}=A;if(K.length<2)throw new Error("Cannot split ops into smaller chunks");const oe=Math.floor(K.length/2),Se=K.slice(0,oe),Re=K.slice(oe);for(const Mt of[Se,Re]){const Qe={ops:Mt,...Z},Rn=tn([Qe]);W(Rn)?yield*k(Qe):yield Rn}}function*M(A){if(A.length<2)if(A[0].type===201){yield*k(A[0]);return}else throw new Error("Cannot split into chunks smaller than the allowed message size");const K=Math.floor(A.length/2),Z=A.slice(0,K),oe=A.slice(K);for(const Se of[Z,oe]){const Re=tn(Se);W(Re)?yield*M(Se):yield Re}}function W(A){return A.length*4<Lc?!1:new TextEncoder().encode(A).length>=Lc}function re(A){const K=t.largeMessageStrategy??"default",Z=tn(A);if(!W(Z))return c.send(Z);switch(K){case"default":{Ao("Message is too large for websockets, not sending. Configure largeMessageStrategy option to deal with this.");return}case"split":{ft("Message is too large for websockets, splitting into smaller chunks");for(const oe of M(A))c.send(oe);return}case"experimental-fallback-to-http":{ft("Message is too large for websockets, so sending over HTTP instead");const oe=l.dynamicSessionInfoSig.get()?.nonce??wt("Session is not authorized to send message over HTTP");s.sendMessages({roomId:n,nonce:oe,messages:A}).then(Se=>{!Se.ok&&Se.status===403&&c.reconnect()});return}}}const Y=Xe.from(l.staticSessionInfoSig,l.dynamicSessionInfoSig,l.myPresence,(A,K,Z)=>{if(A===null||K===null)return null;{const oe=pi(K.scopes);return{connectionId:K.actor,id:A.userId,info:A.userInfo,presence:Z,canWrite:oe,canComment:Ld(K.scopes)}}});let ee;function L(){const A=Y.get();A!==null&&A!==ee&&(D.self.notify(A),ee=A)}const Q=Xe.from(Y,A=>A!==null?$c("Me",A):null);function V(A){if(A.items.length===0)throw new Error("Internal error: cannot load storage without items");l.root!==void 0?te(A.items):l.root=Jn._fromItems(A.items,l.pool);const K=Y.get()?.canWrite??!0,Z=l.undoStack.length;for(const oe in l.initialStorage)l.root.get(oe)===void 0&&(K?l.root.set(oe,yC(l.initialStorage[oe])):ft(`Attempted to populate missing storage key '${oe}', but current user has no write access`));l.undoStack.length=Z}function te(A){if(l.root===void 0)return;const K=new Map;for(const[Se,Re]of l.pool.nodes)K.set(Se,Re._serialize());const Z=bC(K,new Map(A)),oe=_(Z,!1);G(oe.updates)}function se(A){l.undoStack.length>=50&&l.undoStack.shift(),l.undoStack.push(A),ie()}function de(A){l.pausedHistory!==null?l.pausedHistory.pushLeft(A):se(A)}function G(A){const K=A.storageUpdates,Z=A.others;if(Z!==void 0&&Z.length>0){const oe=l.others.get();for(const Se of Z)D.others.notify({...Se,others:oe})}if((A.presence??!1)&&(L(),D.myPresence.notify(l.myPresence.get())),K!==void 0&&K.size>0){const oe=Array.from(K.values());D.storageBatch.notify(oe)}jo()}function R(){const A=l.dynamicSessionInfoSig.get();if(A)return A.actor;throw new Error("Internal. Tried to get connection id but connection was never open")}function _(A,K){const Z={reverse:new Ra,storageUpdates:new Map,presence:!1},oe=new Set,Se=A.map(Re=>Re.type!=="presence"&&!Re.opId?{...Re,opId:l.pool.generateOpId()}:Re);for(const Re of Se)if(Re.type==="presence"){const Mt={type:"presence",data:{}};for(const Qe in Re.data)Mt.data[Qe]=l.myPresence.get()[Qe];if(l.myPresence.patch(Re.data),l.buffer.presenceUpdates===null)l.buffer.presenceUpdates={type:"partial",data:Re.data};else for(const Qe in Re.data)l.buffer.presenceUpdates.data[Qe]=Re.data[Qe];Z.reverse.pushLeft(Mt),Z.presence=!0}else{let Mt;if(K)Mt=0;else{const Rn=pe(Re.opId);Mt=l.unacknowledgedOps.delete(Rn)?2:1}const Qe=U(Re,Mt);if(Qe.modified){const Rn=Qe.modified.node._id;Rn&&oe.has(Rn)||(Z.storageUpdates.set(pe(Qe.modified.node._id),Ta(Z.storageUpdates.get(pe(Qe.modified.node._id)),Qe.modified)),Z.reverse.pushLeft(Qe.reverse)),(Re.type===2||Re.type===7||Re.type===4)&&oe.add(pe(Re.id))}}return{ops:Se,reverse:Array.from(Z.reverse),updates:{storageUpdates:Z.storageUpdates,presence:Z.presence}}}function U(A,K){if(uC(A))return{modified:!1};switch(A.type){case 6:case 3:case 5:{const Z=l.pool.nodes.get(A.id);return Z===void 0?{modified:!1}:Z._apply(A,K===0)}case 1:{const Z=l.pool.nodes.get(A.id);return Z===void 0?{modified:!1}:Z.parent.type==="HasParent"&&zd(Z.parent.node)?Z.parent.node._setChildKey(so(A.parentKey),Z,K):{modified:!1}}case 4:case 2:case 7:case 8:{if(A.parentId===void 0)return{modified:!1};const Z=l.pool.nodes.get(A.parentId);return Z===void 0?{modified:!1}:Z._attachChild(A,K)}}}function X(A,K){const Z={};l.buffer.presenceUpdates===null&&(l.buffer.presenceUpdates={type:"partial",data:{}});for(const oe in A){const Se=A[oe];Se!==void 0&&(l.buffer.presenceUpdates.data[oe]=Se,Z[oe]=l.myPresence.get()[oe])}l.myPresence.patch(A),l.activeBatch?(K?.addToHistory&&l.activeBatch.reverseOps.pushLeft({type:"presence",data:Z}),l.activeBatch.updates.presence=!0):(he(),K?.addToHistory&&de([{type:"presence",data:Z}]),G({presence:!0}))}function fe(A){if(A.targetActor!==void 0){const Z=l.others.getUser(A.actor);l.others.setOther(A.actor,A.data);const oe=l.others.getUser(A.actor);if(Z===void 0&&oe!==void 0)return{type:"enter",user:oe}}else l.others.patchOther(A.actor,A.data);const K=l.others.getUser(A.actor);if(K)return{type:"update",updates:A.data,user:K}}function le(A){const K=l.others.getUser(A.actor);return K?(l.others.removeConnection(A.actor),{type:"leave",user:K}):null}function T(A){l.dynamicSessionInfoSig.set({actor:A.actor,nonce:A.nonce,scopes:A.scopes}),l.idFactory=RC(A.actor),L();for(const K of l.others.connectionIds())A.users[K]===void 0&&l.others.removeConnection(K);for(const K in A.users){const Z=A.users[K],oe=Number(K);l.others.setConnection(oe,Z.id,Z.info,Z.scopes)}return{type:"reset"}}function q(){return l.undoStack.length>0}function ne(){return l.redoStack.length>0}function ie(){D.history.notify({canUndo:q(),canRedo:ne()})}function we(A){l.others.setConnection(A.actor,A.id,A.info,A.scopes),l.buffer.messages.push({type:100,data:l.myPresence.get(),targetActor:A.actor}),he();const K=l.others.getUser(A.actor);return K?{type:"enter",user:K}:void 0}function xe(A){return xC(A)?A:null}function ae(A){const K=$s(A);return K===void 0?null:Vd(K)?li(K.map(Z=>xe(Z))):li([xe(K)])}function Te(A){if(A.size===0)return;const K=[],Z=Array.from(A.values()),oe=_(Z,!0);K.push({type:201,ops:oe.ops}),G(oe.updates),re(K)}function je(A){if(typeof A.data!="string")return;const K=ae(A.data);if(K===null||K.length===0)return;const Z={storageUpdates:new Map,others:[]};for(const oe of K)switch(oe.type){case 101:{const Se=we(oe);Se&&Z.others.push(Se);break}case 100:{const Se=fe(oe);Se&&Z.others.push(Se);break}case 103:{const Se=l.others.get();D.customEvent.notify({connectionId:oe.actor,user:oe.actor<0?null:Se.find(Re=>Re.connectionId===oe.actor)??null,event:oe.event});break}case 102:{const Se=le(oe);Se&&Z.others.push(Se);break}case 300:{D.ydoc.notify(oe);break}case 104:{Z.others.push(T(oe));break}case 200:{$e(oe);break}case 201:{const Se=_(oe.ops,!1);for(const[Re,Mt]of Se.updates.storageUpdates)Z.storageUpdates.set(Re,Ta(Z.storageUpdates.get(Re),Mt));break}case 299:{xd("Storage mutation rejection error",oe.reason);break}case 400:case 407:case 401:case 408:case 405:case 406:case 402:case 403:case 404:{D.comments.notify(oe);break}}G(Z)}function he(){const A=l.buffer.storageOperations;if(A.length>0){for(const oe of A)l.unacknowledgedOps.set(pe(oe.opId),oe);jo()}if(c.getStatus()!=="connected"){l.buffer.storageOperations=[];return}const K=Date.now(),Z=K-l.buffer.lastFlushedAt;if(Z>=t.throttleDelay){const oe=Ce();if(oe.length===0)return;re(oe),l.buffer={flushTimerID:void 0,lastFlushedAt:K,messages:[],storageOperations:[],presenceUpdates:null}}else clearTimeout(l.buffer.flushTimerID),l.buffer.flushTimerID=setTimeout(he,t.throttleDelay-Z)}function Ce(){const A=[];l.buffer.presenceUpdates&&A.push(l.buffer.presenceUpdates.type==="full"?{type:100,targetActor:-1,data:l.buffer.presenceUpdates.data}:{type:100,data:l.buffer.presenceUpdates.data});for(const K of l.buffer.messages)A.push(K);return l.buffer.storageOperations.length>0&&A.push({type:201,ops:l.buffer.storageOperations}),A}function ke(A,K,Z){const oe={type:301,update:A,guid:K,v2:Z};l.buffer.messages.push(oe),D.ydoc.notify(oe),he()}function Pe(A,K={shouldQueueEventIfNotReady:!1}){c.getStatus()!=="connected"&&!K.shouldQueueEventIfNotReady||(l.buffer.messages.push({type:103,event:A}),he())}function ye(A){const{storageOperations:K}=l.buffer;for(const Z of A)K.push(Z);he()}let Ee=null,Ct=null;function $e(A){const K=new Map(l.unacknowledgedOps);V(A),Te(K),Ct?.(),jo(),D.storageDidLoad.notify()}async function qe(){if(!c.authValue)return;const A=await s.streamStorage({roomId:n});$e({items:A})}function yt(A){const K=l.buffer.messages;t.unstable_streamData?qe():K.some(Z=>Z.type===200)||K.push({type:200}),A.flush&&he()}function Je(){return Ee===null&&(yt({flush:!0}),Ee=new Promise(A=>{Ct=A}),jo()),Ee}function rr(){const A=l.root;return A!==void 0?A:(Je(),null)}async function cn(){return l.root!==void 0?Promise.resolve({root:l.root}):(await Je(),{root:pe(l.root)})}function ln(A,K,Z){l.buffer.messages.find(oe=>oe.type===300&&oe.vector===A&&oe.guid===K&&oe.v2===Z)||l.buffer.messages.push({type:300,vector:A,guid:K,v2:Z}),he()}function ga(){if(l.activeBatch)throw new Error("undo is not allowed during a batch");const A=l.undoStack.pop();if(A===void 0)return;l.pausedHistory=null;const K=_(A,!0);G(K.updates),l.redoStack.push(K.reverse),ie();for(const Z of K.ops)Z.type!=="presence"&&l.buffer.storageOperations.push(Z);he()}function Ca(){if(l.activeBatch)throw new Error("redo is not allowed during a batch");const A=l.redoStack.pop();if(A===void 0)return;l.pausedHistory=null;const K=_(A,!0);G(K.updates),l.undoStack.push(K.reverse),ie();for(const Z of K.ops)Z.type!=="presence"&&l.buffer.storageOperations.push(Z);he()}function ya(){l.undoStack.length=0,l.redoStack.length=0}function ba(A){if(l.activeBatch)return A();let K;l.activeBatch={ops:[],updates:{storageUpdates:new Map,presence:!1,others:[]},reverseOps:new Ra};try{K=A()}finally{const Z=l.activeBatch;l.activeBatch=null,Z.reverseOps.length>0&&de(Array.from(Z.reverseOps)),Z.ops.length>0&&(l.redoStack.length=0),Z.ops.length>0&&ye(Z.ops),G(Z.updates),he()}return K}function Ea(){l.pausedHistory===null&&(l.pausedHistory=new Ra)}function Da(){const A=l.pausedHistory;l.pausedHistory=null,A!==null&&A.length>0&&se(Array.from(A))}const vc=t.createSyncSource();function _o(){return l.root===void 0?Ee===null?"not-loaded":"loading":l.unacknowledgedOps.size===0?"synchronized":"synchronizing"}let gc=_o();function jo(){const A=_o();gc!==A&&(gc=A,D.storageStatus.notify(A)),vc.setSyncStatus(A==="synchronizing"?"synchronizing":"synchronized")}function Cc(){return Y.get()!==null}async function Dg(){for(;!Cc();){const{promise:A,resolve:K}=Td(),Z=Lo.self.subscribeOnce(K),oe=Lo.status.subscribeOnce(K);await A,Z(),oe()}}function yc(){return rr()!==null}async function wg(){for(;!yc();)await cn()}const Ag=Xe.from(l.others.signal,A=>A.map((K,Z)=>$c(`Other ${Z}`,K))),Lo={status:D.status.observable,lostConnection:D.lostConnection.observable,customEvent:D.customEvent.observable,others:D.others.observable,self:D.self.observable,myPresence:D.myPresence.observable,storage:D.storageBatch.observable,storageBatch:D.storageBatch.observable,history:D.history.observable,storageDidLoad:D.storageDidLoad.observable,storageStatus:D.storageStatus.observable,ydoc:D.ydoc.observable,comments:D.comments.observable,roomWillDestroy:D.roomWillDestroy.observable};async function xg(A){return s.getThreadsSince({roomId:n,since:A.since,signal:A.signal})}async function Og(A){return s.getThreads({roomId:n,query:A?.query,cursor:A?.cursor})}async function Sg(A){return s.getThread({roomId:n,threadId:A})}async function Tg(A){return s.createThread({roomId:n,threadId:A.threadId,commentId:A.commentId,metadata:A.metadata,body:A.body,attachmentIds:A.attachmentIds})}async function Rg(A){return s.deleteThread({roomId:n,threadId:A})}async function Ig({metadata:A,threadId:K}){return s.editThreadMetadata({roomId:n,threadId:K,metadata:A})}async function Bg(A){return s.markThreadAsResolved({roomId:n,threadId:A})}async function Fg(A){return s.markThreadAsUnresolved({roomId:n,threadId:A})}async function Pg(A){return s.createComment({roomId:n,threadId:A.threadId,commentId:A.commentId,body:A.body,attachmentIds:A.attachmentIds})}async function Ng(A){return s.editComment({roomId:n,threadId:A.threadId,commentId:A.commentId,body:A.body,attachmentIds:A.attachmentIds})}async function kg({threadId:A,commentId:K}){return s.deleteComment({roomId:n,threadId:A,commentId:K})}async function Mg({threadId:A,commentId:K,emoji:Z}){return s.addReaction({roomId:n,threadId:A,commentId:K,emoji:Z})}async function _g({threadId:A,commentId:K,emoji:Z}){return await s.removeReaction({roomId:n,threadId:A,commentId:K,emoji:Z})}function jg(A){return{type:"localAttachment",status:"idle",id:Bd(),name:A.name,size:A.size,mimeType:A.type,file:A}}async function Lg(A,K={}){return s.uploadAttachment({roomId:n,attachment:A,signal:K.signal})}function $g(A){return s.getAttachmentUrl({roomId:n,attachmentId:A})}function Ug(A){return s.getNotificationSettings({roomId:n,signal:A?.signal})}function Hg(A){return s.updateNotificationSettings({roomId:n,settings:A})}async function Wg(A){await s.markRoomInboxNotificationAsRead({roomId:n,inboxNotificationId:A})}const bc=t.createSyncSource();function wa(A){return bc.setSyncStatus(A==="synchronizing"?"synchronizing":"synchronized")}return Object.defineProperty({[Oe]:{get presenceBuffer(){return oo(l.buffer.presenceUpdates?.data??null)},get undoStack(){return oo(l.undoStack)},get nodeCount(){return l.pool.nodes.size},getYjsProvider(){return l.yjsProvider},setYjsProvider(A){l.yjsProvider?.off("status",wa),l.yjsProvider=A,A?.on("status",wa),l.yjsProviderDidChange.notify()},yjsProviderDidChange:l.yjsProviderDidChange.observable,reportTextEditor:O,createTextMention:x,deleteTextMention:I,listTextVersions:F,listTextVersionsSince:H,getTextVersion:N,createTextVersion:j,executeContextualPrompt:B,getSelf_forDevTools:()=>Q.get(),getOthers_forDevTools:()=>Ag.get(),simulate:{explicitClose:A=>c._privateSendMachineEvent({type:"EXPLICIT_SOCKET_CLOSE",event:A}),rawSend:A=>c.send(A)},attachmentUrlsStore:s.getOrCreateAttachmentUrlsStore(n)},id:n,subscribe:FC(n,Lo,t.errorEventSource),connect:()=>c.connect(),reconnect:()=>c.reconnect(),disconnect:()=>c.disconnect(),destroy:()=>{const{roomWillDestroy:A,...K}=D;for(const Z of Object.values(K))Z[Symbol.dispose]();D.roomWillDestroy.notify(),l.yjsProvider?.off("status",wa),vc.destroy(),bc.destroy(),i(),c.destroy(),A[Symbol.dispose]()},updatePresence:X,updateYDoc:ke,broadcastEvent:Pe,batch:ba,history:{undo:ga,redo:Ca,canUndo:q,canRedo:ne,clear:ya,pause:Ea,resume:Da},fetchYDoc:ln,getStorage:cn,getStorageSnapshot:rr,getStorageStatus:_o,isPresenceReady:Cc,isStorageReady:yc,waitUntilPresenceReady:xc(Dg),waitUntilStorageReady:xc(wg),events:Lo,getStatus:()=>c.getStatus(),getSelf:()=>Y.get(),getPresence:()=>l.myPresence.get(),getOthers:()=>l.others.get(),getThreads:Og,getThreadsSince:xg,getThread:Sg,createThread:Tg,deleteThread:Rg,editThreadMetadata:Ig,markThreadAsResolved:Bg,markThreadAsUnresolved:Fg,createComment:Pg,editComment:Ng,deleteComment:kg,addReaction:Mg,removeReaction:_g,prepareAttachment:jg,uploadAttachment:Lg,getAttachmentUrl:$g,getNotificationSettings:Ug,updateNotificationSettings:Hg,markInboxNotificationAsRead:Wg},Oe,{enumerable:!1})}function FC(e,t,n){function r(a,i){return t.storageBatch.subscribe(u=>{const c=u.filter(l=>Hd(l.node,a));c.length>0&&i(c)})}function o(a,i){return t.storageBatch.subscribe(u=>{for(const c of u)c.node._id===a._id&&i(c.node)})}function s(a,i,u){if(typeof a=="string"&&PC(a)){if(typeof i!="function")throw new Error("Second argument must be a callback function");const c=i;switch(a){case"event":return t.customEvent.subscribe(c);case"my-presence":return t.myPresence.subscribe(c);case"others":{const l=c;return t.others.subscribe(d=>{const{others:m,...g}=d;return l(m,g)})}case"error":return n.subscribe(l=>{if(l.roomId===e)return c(l)});case"status":return t.status.subscribe(c);case"lost-connection":return t.lostConnection.subscribe(c);case"history":return t.history.subscribe(c);case"storage-status":return t.storageStatus.subscribe(c);case"comments":return t.comments.subscribe(c);default:return lt(a,`"${String(a)}" is not a valid event name`)}}if(i===void 0||typeof a=="function")if(typeof a=="function"){const c=a;return t.storageBatch.subscribe(c)}else throw new Error("Please specify a listener callback");if(We(a)){const c=a;return u?.isDeep?r(c,i):o(c,i)}throw new Error(`${String(a)} is not a value that can be subscribed to.`)}return s}function PC(e){return e==="my-presence"||e==="others"||e==="event"||e==="error"||e==="history"||e==="status"||e==="storage-status"||e==="lost-connection"||e==="connection"||e==="comments"}function NC(e,t){return async()=>t.getAuthValue({requestedScope:"room:read",roomId:e})}function kC(e,t,n){return r=>{const o=n??(typeof WebSocket>"u"?void 0:WebSocket);if(o===void 0)throw new Ln("To use Liveblocks client in a non-DOM environment, you need to provide a WebSocket polyfill.");const s=new URL(t);if(s.protocol=s.protocol==="http:"?"ws":"wss",s.pathname="/v7",s.searchParams.set("roomId",e),r.type==="secret")s.searchParams.set("tok",r.token.raw);else if(r.type==="public")s.searchParams.set("pubkey",r.publicApiKey);else return lt(r,"Unhandled case");return s.searchParams.set("version",Xi),new o(s.toString())}}var MC=16,_C=1e3,jC=100,LC=15e3,$C=200,UC=1e3,HC=3e4,WC=5e3,zC=50,VC=50;function KC(e){return typeof e=="string"&&e.startsWith("http")?e:X0}function qC(e){const t=e,n=YC(t.throttle??jC),r=XC(t.lostConnectionTimeout??WC),o=GC(t.backgroundKeepAliveTimeout),s=KC(t.baseUrl),a=new zt(void 0),i=q0(e,V=>{const te=V.k==="sec-legacy"?V.id:V.uid;a.set(()=>te)}),u=t.polyfills?.fetch||globalThis.fetch?.bind(globalThis),c=T0({baseUrl:s,fetchPolyfill:u,authManager:i}),l=new Map;function d(V){V.id,l.delete(V.id),V.destroy()}function m(V){const te=()=>{const se=te;V.unsubs.delete(se)?V.unsubs.size===0&&d(V.room):ft("This leave function was already called. Calling it more than once has no effect.")};return V.unsubs.add(te),{room:V.room,leave:te}}function g(V,...te){const se=l.get(V);if(se!==void 0)return m(se);const de=te[0]??{},G=(typeof de.initialPresence=="function"?de.initialPresence(V):de.initialPresence)??{},R=(typeof de.initialStorage=="function"?de.initialStorage(V):de.initialStorage)??{},_=BC({initialPresence:G,initialStorage:R},{roomId:V,throttleDelay:n,lostConnectionTimeout:r,backgroundKeepAliveTimeout:o,polyfills:t.polyfills,delegates:t.mockedDelegates??{createSocket:kC(V,s,t.polyfills?.WebSocket),authenticate:NC(V,i)},enableDebugLogging:t.enableDebugLogging,baseUrl:s,errorEventSource:M,largeMessageStrategy:t.largeMessageStrategy??(t.unstable_fallbackToHTTP?"experimental-fallback-to-http":void 0),unstable_streamData:!!t.unstable_streamData,roomHttpClient:c,createSyncSource:Y}),U={room:_,unsubs:new Set};if(l.set(V,U),de.autoConnect??!0){if(typeof atob>"u"){if(t.polyfills?.atob===void 0)throw new Error("You need to polyfill atob to use the client in your environment. Please follow the instructions at https://liveblocks.io/docs/errors/liveblocks-client/atob-polyfill");ii.atob=t.polyfills.atob}_.connect()}return m(U)}function C(V){const te=l.get(V)?.room;return te||null}function v(){i.reset(),a.set(()=>{});for(const{room:V}of l.values())k0(V.getStatus())||V.reconnect()}const h=t.resolveUsers,E=Uc(()=>!h,"Set the resolveUsers option in createClient to specify user info."),b=new Jr(async V=>{const te=V.flat(),se=await h?.({userIds:te});return E(),se??te.map(()=>{})},{delay:zC}),w=di(b);function D(V){w.invalidate(V)}const x=t.resolveRoomsInfo,I=Uc(()=>!x,"Set the resolveRoomsInfo option in createClient to specify room info."),O=new Jr(async V=>{const te=V.flat(),se=await x?.({roomIds:te});return I(),se??te.map(()=>{})},{delay:VC}),F=di(O);function H(V){F.invalidate(V)}const N=new Map;function j(){N.clear()}const B=[],k=new zt("synchronized"),M=Ie();function W(){const V=k.get();return V==="synchronizing"?V:"synchronized"}function re(){k.set(B.some(V=>V.get()==="synchronizing")?"synchronizing":B.some(V=>V.get()==="has-local-changes")?"has-local-changes":"synchronized")}function Y(){const V=new zt("synchronized");B.push(V);const te=V.subscribe(()=>re());function se(G){V.set(G)}function de(){te();const G=B.findIndex(R=>R===V);if(G>-1){const[R]=B.splice(G,1);R.get()!=="synchronized"&&re()}}return{setSyncStatus:se,destroy:de}}{const V=se=>{t.preventUnsavedChanges&&k.get()!=="synchronized"&&se.preventDefault()};(typeof window<"u"?window:void 0)?.addEventListener("beforeunload",V)}async function ee(V){const te=await c.getUserNotificationSettings(V);return ys(te)}async function L(V){const te=await c.updateUserNotificationSettings(V);return ys(te)}const Q=Object.defineProperty({enterRoom:g,getRoom:C,logout:v,getInboxNotifications:c.getInboxNotifications,getInboxNotificationsSince:c.getInboxNotificationsSince,getUnreadInboxNotificationsCount:c.getUnreadInboxNotificationsCount,markAllInboxNotificationsAsRead:c.markAllInboxNotificationsAsRead,markInboxNotificationAsRead:c.markInboxNotificationAsRead,deleteAllInboxNotifications:c.deleteAllInboxNotifications,deleteInboxNotification:c.deleteInboxNotification,getNotificationSettings:ee,updateNotificationSettings:L,resolvers:{invalidateUsers:D,invalidateRoomsInfo:H,invalidateMentionSuggestions:j},getSyncStatus:W,events:{error:M,syncStatus:k},[Oe]:{currentUserId:a,mentionSuggestionsCache:N,resolveMentionSuggestions:t.resolveMentionSuggestions,usersStore:w,roomsInfoStore:F,getRoomIds(){return Array.from(l.keys())},httpClient:c,as:()=>Q,createSyncSource:Y,emitError:(V,te)=>{const se=Kd.from(V,te);M.notify(se)||Ao(se.message)}}},Oe,{enumerable:!1});return Q}function ou(e,t,n,r,o){if(typeof t!="number"||t<n||r!==void 0&&t>r)throw new Error(r!==void 0?`${e} should be between ${o??n} and ${r}.`:`${e} should be at least ${o??n}.`);return t}function GC(e){if(e!==void 0)return ou("backgroundKeepAliveTimeout",e,LC)}function YC(e){return ou("throttle",e,MC,_C)}function XC(e){return ou("lostConnectionTimeout",e,$C,HC,UC)}function Uc(e,...t){return()=>{}}function ZC(e){return"type"in e&&e.type==="paragraph"}function JC(e){return!("type"in e)&&"text"in e&&typeof e.text=="string"}function QC(e){return"type"in e&&e.type==="mention"}function ey(e){return"type"in e&&e.type==="link"}var ty={paragraph:ZC,text:JC,link:ey,mention:QC};function ny(e,t,n){if(!e||!e?.content)return;const o=ty[t],s=n;for(const a of e.content)for(const i of a.children)o(i)&&s?.(i)}function ry(e){const t=new Set;return ny(e,"mention",n=>t.add(n.id)),Array.from(t)}var oy={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};new RegExp(Object.keys(oy).map(e=>`\\${e}`).join("|"),"g");var sy={_:"\\_","*":"\\*","#":"\\#","`":"\\`","~":"\\~","!":"\\!","|":"\\|","(":"\\(",")":"\\)","{":"\\{","}":"\\}","[":"\\[","]":"\\]"};new RegExp(Object.keys(sy).map(e=>`\\${e}`).join("|"),"g");var Ia=[1e3,2e3,4e3,8e3,1e4];function gr(e,t,n){const r=performance.now(),o=typeof document<"u"?document:void 0,s=typeof window<"u"?window:void 0,a=n?.maxStaleTimeMs??Number.POSITIVE_INFINITY,i={inForeground:o?.visibilityState!=="hidden",lastSuccessfulPollAt:r,count:0,backoff:0};function u(){return i.count>0&&i.inForeground}const c=new Nd({}).addState("@idle").addState("@enabled").addState("@polling");c.addTransitions("@idle",{START:"@enabled"}),c.addTransitions("@enabled",{STOP:"@idle",POLL:"@polling"}),c.addTimedTransition("@enabled",()=>{const E=i.lastSuccessfulPollAt+t;return Math.max(0,E-performance.now())+i.backoff},"@polling"),c.onEnterAsync("@polling",async(h,E)=>{await e(E),E.aborted||(i.lastSuccessfulPollAt=performance.now())},()=>({target:u()?"@enabled":"@idle",effect:()=>{i.backoff=0}}),()=>({target:u()?"@enabled":"@idle",effect:()=>{i.backoff=Ia.find(h=>h>i.backoff)??Ia[Ia.length-1]}}),3e4);function l(){u()?c.send({type:"START"}):c.send({type:"STOP"})}function d(){i.count++,l()}function m(){i.count--,i.count<0&&(i.count=0),l()}function g(){performance.now()-i.lastSuccessfulPollAt>a&&c.send({type:"POLL"})}function C(h){i.inForeground=h,l(),g()}function v(){C(o?.visibilityState!=="hidden")}return o?.addEventListener("visibilitychange",v),s?.addEventListener("online",v),s?.addEventListener("focus",g),c.start(),{inc:d,dec:m,pollNowIfStale:g,setInForeground:C}}function ay(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Object.is(e[n],t[n]))return!1;return!0}function iy(e,t){if(!nn(e)||!nn(t))return!1;const n=Object.keys(e);return n.length!==Object.keys(t).length?!1:n.every(r=>Object.prototype.hasOwnProperty.call(t,r)&&Object.is(e[r],t[r]))}function Bt(e,t){if(Object.is(e,t))return!0;const n=Array.isArray(e),r=Array.isArray(t);return n||r?!n||!r?!1:ay(e,t):iy(e,t)}function uy(e,t,n){let r=0,o=e.length;for(;r<o;){const s=r+(o-r>>1);n(t,e[s])?o=s:r=s+1}return r}var Hc=class as{#e;#t;constructor(t,n){this.#t=n,this.#e=t}static from(t,n){const r=new as([],n);for(const o of t)r.add(o);return r}static fromAlreadySorted(t,n){return new as(t,n)}clone(){return new as(this.#e.slice(),this.#t)}add(t){const n=uy(this.#e,t,this.#t);this.#e.splice(n,0,t)}remove(t){const n=this.#e.indexOf(t);return n>=0?(this.#e.splice(n,1),!0):!1}get length(){return this.#e.length}*filter(t){for(const n of this.#e)t(n)&&(yield n)}[Symbol.iterator](){return this.#e[Symbol.iterator]()}};Zi(t0,Xi,n0);var cy="@liveblocks/client",ly="2.23.0",fy="esm";Zi(cy,ly,fy);var Gd=f.createContext(null);function dy(){return f.useContext(Gd)}function hy(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}function Ws(e,t,n,r,o){const s=f.useRef(null);let a;s.current===null?(a={hasValue:!1,value:null},s.current=a):a=s.current;const[i,u]=f.useMemo(()=>{let l=!1,d,m;const g=E=>{if(!l){l=!0,d=E;const x=r(E);if(o!==void 0&&a.hasValue){const I=a.value;if(o(I,x))return m=I,I}return m=x,x}const b=d,w=m;if(hy(b,E))return w;const D=r(E);return o!==void 0&&o(w,D)?(d=E,w):(d=E,m=D,D)},C=n===void 0?null:n;return[()=>g(t()),C===null?void 0:()=>g(C())]},[t,n,r,o]),c=f.useSyncExternalStore(e,i,u);return f.useEffect(()=>{a.hasValue=!0,a.value=c},[c]),f.useDebugValue(c),c}var py=e=>e;function Qn(e,t,n){return Ws(e.subscribe,e.get,e.get,t??py,n)}var fr=1e3,Pn=60*fr,bt={NOTIFICATIONS_POLL_INTERVAL:1*Pn,NOTIFICATIONS_MAX_STALE_TIME:5*fr,ROOM_THREADS_POLL_INTERVAL:5*Pn,ROOM_THREADS_MAX_STALE_TIME:5*fr,USER_THREADS_POLL_INTERVAL:1*Pn,USER_THREADS_MAX_STALE_TIME:30*fr,HISTORY_VERSIONS_POLL_INTERVAL:1*Pn,HISTORY_VERSIONS_MAX_STALE_TIME:5*fr,NOTIFICATION_SETTINGS_POLL_INTERVAL:1*Pn,NOTIFICATION_SETTINGS_MAX_STALE_TIME:5*fr,USER_NOTIFICATION_SETTINGS_INTERVAL:5*Pn,USER_NOTIFICATION_SETTINGS_MAX_STALE_TIME:1*Pn},bs=Object.freeze({isLoading:!0}),Yd=e=>Object.freeze({isLoading:!1,error:e});function Cr(e,t){return arguments.length===1?Object.freeze({isLoading:!1,data:e}):Object.freeze({isLoading:!1,[e]:t})}function my(e,t){for(const n of e)if(t(n))return n}function vy(e){const t=f.useRef(e);return f.useEffect(()=>{t.current=e},[e]),t}var gy=e=>e;function ut(e){return f.useReducer(gy,e)[0]}function Vo(e){const t=ut(e);if(typeof t=="function"){const n=vy(e);return f.useCallback((...r)=>n.current(...r),[n])}else return t}function su(e){const t=new Set;t.add("constructor");let n=e.constructor.prototype;do for(const r of Reflect.ownKeys(n)){if(t.has(r))continue;typeof Reflect.getOwnPropertyDescriptor(n,r)?.value=="function"&&(t.add(r),e[r]=e[r].bind(e))}while((n=Reflect.getPrototypeOf(n))&&n!==Object.prototype)}function Wc(e,t){if(!nn(e)||!nn(t))return Bt(e,t);const n=Object.keys(e);return n.length!==Object.keys(t).length?!1:n.every(r=>Object.prototype.hasOwnProperty.call(t,r)&&Bt(e[r],t[r]))}function Cy(e){return t=>yy(t,e)&&by(t,e)}function yy(e,t){return t.resolved===void 0||e.resolved===t.resolved}function by(e,t){const n=e.metadata;return t.metadata===void 0||Object.entries(t.metadata).every(([r,o])=>o===void 0||Ey(n[r],o))}function Ey(e,t){return t===null?e===void 0:ci(t)?typeof e=="string"&&e.startsWith(t.startsWith):e===t}function Dy(e){return e.deletedAt&&e.comments.length>0?{...e,comments:[]}:e.comments.some(n=>!n.deletedAt)?e:{...e,deletedAt:new Date,comments:[]}}var wy=class Xd{#e;#t;#n;signal;constructor(){this.#t=Hc.from([],(t,n)=>{const r=t.createdAt,o=n.createdAt;return r<o?!0:r===o?t.id<n.id:!1}),this.#n=Hc.from([],(t,n)=>{const r=n.updatedAt,o=t.updatedAt;return r<o?!0:r===o?n.id<t.id:!1}),this.#e=new Map,this.signal=new Zn(this)}clone(){const t=new Xd;return t.#e=new Map(this.#e),t.#t=this.#t.clone(),t.#n=this.#n.clone(),t}get(t){const n=this.getEvenIfDeleted(t);return n?.deletedAt?void 0:n}getEvenIfDeleted(t){return this.#e.get(t)}upsert(t){this.signal.mutate(()=>{t=Dy(t);const n=t.id,r=this.#e.get(n);if(r){if(r.deletedAt)return!1;this.#t.remove(r),this.#n.remove(r)}return t.deletedAt||(this.#t.add(t),this.#n.add(t)),this.#e.set(n,t),!0})}upsertIfNewer(t){const n=this.get(t.id);(!n||t.updatedAt>=n.updatedAt)&&this.upsert(t)}applyDelta(t,n){ct(()=>{for(const r of t)this.upsertIfNewer(r);for(const{id:r,deletedAt:o}of n)this.getEvenIfDeleted(r)&&this.delete(r,o)})}delete(t,n){const r=this.#e.get(t);r&&!r.deletedAt&&this.upsert({...r,deletedAt:n,updatedAt:n})}findMany(t,n,r){const o=r==="desc"?this.#n:this.#t,s=[];return t!==void 0&&s.push(a=>a.roomId===t),s.push(Cy(n)),Array.from(o.filter(a=>s.every(i=>i(a))))}};function Ay(e,t){return Vn([e,t??{}])}function xy(e){return Vn(e??{})}function Zd(e){if("status"in e)return e;const t=e;return t.status="pending",t.then(n=>{t.status="fulfilled",t.value=n},n=>{t.status="rejected",t.reason=n}),t}var Oy=Promise.resolve(),Ba=class{#e;signal;#t;#n;constructor(e){this.#e=new zt(bs),this.#t=e,this.#n=null,this.signal=this.#e.asReadonly(),su(this)}get(){return this.#e.get()}#r(e){const t=this.#e.get();t.data!==void 0&&this.#e.set(Cr({...t.data,...e}))}async#s(){const e=this.#e.get();if(!(!e.data?.cursor||e.data.isFetchingMore)){this.#r({isFetchingMore:!0});try{const t=await this.#t(e.data.cursor);this.#r({cursor:t,hasFetchedAll:t===null,fetchMoreError:void 0,isFetchingMore:!1})}catch(t){this.#r({isFetchingMore:!1,fetchMoreError:t})}}}fetchMore(){return this.#e.get().data?.cursor?(this.#n||(this.#n=this.#s().finally(()=>{this.#n=null})),this.#n):Oy}#o=null;waitUntilLoaded(){if(this.#o)return this.#o;const e=Zr(()=>this.#t(void 0),5,[5e3,5e3,1e4,15e3]),t=Zd(e);return t.then(n=>{this.#e.set(Cr({cursor:n,hasFetchedAll:n===null,isFetchingMore:!1,fetchMoreError:void 0,fetchMore:this.fetchMore}))},n=>{this.#e.set(Yd(n)),setTimeout(()=>{this.#o=null,this.#e.set(bs)},5e3)}),this.#o=t,this.#o}},Fa=class{#e;signal;#t;constructor(e){this.#e=new zt(bs),this.signal=this.#e.asReadonly(),this.#t=e,su(this)}get(){return this.#e.get()}#n=null;waitUntilLoaded(){if(this.#n)return this.#n;const e=Zr(()=>this.#t(),5,[5e3,5e3,1e4,15e3]),t=Zd(e);return t.then(()=>{this.#e.set(Cr(void 0))},n=>{this.#e.set(Yd(n)),setTimeout(()=>{this.#n=null,this.#e.set(bs)},5e3)}),this.#n=t,t}};function Sy(){const e=new Zn(new Map);function t(u,c){e.mutate(l=>{const d=l.get(u);return d?(l.set(u,{...d,readAt:c}),!0):!1})}function n(u){e.mutate(c=>{for(const l of c.values())l.readAt=u})}function r(u){e.mutate(c=>c.delete(u))}function o(){e.mutate(u=>u.clear())}function s(u,c){e.mutate(l=>{let d=!1;for(const m of u){const g=l.get(m.id);g&&_y(g,m)===1||(l.set(m.id,m),d=!0)}for(const m of c)l.delete(m.id),d=!0;return d})}function a(u){e.mutate(c=>{const l=my(c.values(),d=>d.kind==="thread"&&d.threadId===u.threadId);return l?(c.set(l.id,{...l,notifiedAt:u.createdAt,readAt:u.createdAt}),!0):!1})}function i(u){e.mutate(c=>{c.set(u.id,u)})}return{signal:e.asReadonly(),markAllRead:n,markRead:t,delete:r,applyDelta:s,clear:o,updateAssociatedNotification:a,upsert:i}}function Ty(e){const t=new Zn(new Map);function n(r,o){t.mutate(s=>{s.set(r,o)})}return{signal:Xe.from(t,e,(r,o)=>ky(r,o)),update:n}}function Ry(){const e=new Zn(new It(()=>new Map));function t(n,r){e.mutate(o=>{const s=o.getOrCreate(n);for(const a of r)s.set(a.id,a)})}return{signal:Xe.from(e,n=>Object.fromEntries([...n].map(([r,o])=>[r,Object.fromEntries(o)]))),update:t}}function Iy(){const e=new Zn(new It(()=>new Set));function t(n){e.mutate(r=>{for(const[o,s]of Object.entries(n)){const a=r.getOrCreate(o);for(const i of s)a.add(i)}})}return{signal:e.asReadonly(),update:t}}function By(e){const t=new zt(ys({}));function n(r){t.set(r)}return{signal:Xe.from(t,e,(r,o)=>My(r,o)),update:n}}function Fy(e){const t=new zt([]),n=e[Oe].createSyncSource();t.subscribe(()=>n.setSyncStatus(t.get().length>0?"synchronizing":"synchronized"));function r(s){const a=Nr(),i={...s,id:a};return t.set(u=>[...u,i]),a}function o(s){t.set(a=>a.filter(i=>i.id!==s))}return{signal:t.asReadonly(),add:r,remove:o}}var Py=class{#e;threads;notifications;roomNotificationSettings;historyVersions;permissionHints;userNotificationSettings;optimisticUpdates;outputs;#t=null;#n;#r=new Map;#s=null;#o=new Map;#i;constructor(e){this.#e=e[Oe].as(),this.optimisticUpdates=Fy(this.#e),this.permissionHints=Iy(),this.#n=new Ba(async d=>{const m=await this.#e.getInboxNotifications({cursor:d});return this.updateThreadifications(m.threads,m.inboxNotifications),this.#t===null&&(this.#t=m.requestedAt),m.nextCursor});const t=async()=>{const d=await this.#e.getNotificationSettings();this.userNotificationSettings.update(d)};this.userNotificationSettings=By(this.optimisticUpdates.signal),this.#i=new Fa(t),this.threads=new wy,this.notifications=Sy(),this.roomNotificationSettings=Ty(this.optimisticUpdates.signal),this.historyVersions=Ry();const n=Xe.from(this.threads.signal,this.notifications.signal,this.optimisticUpdates.signal,(d,m,g)=>Ny(d,m,g)),r=Xe.from(n,d=>d.threadsDB),o=Xe.from(n,d=>({sortedNotifications:d.sortedNotifications,notificationsById:d.notificationsById}),Bt),s=new It(d=>{const m=JSON.parse(d),g=new Ba(async v=>{const h=await this.#e[Oe].httpClient.getUserThreads_experimental({cursor:v,query:m});return this.updateThreadifications(h.threads,h.inboxNotifications),this.permissionHints.update(h.permissionHints),this.#s===null&&(this.#s=h.requestedAt),h.nextCursor});return{signal:Xe.from(()=>{const v=g.get();if(v.isLoading||v.error)return v;const h=this.outputs.threads.get().findMany(void 0,m??{},"desc"),E=v.data;return{isLoading:!1,threads:h,hasFetchedAll:E.hasFetchedAll,isFetchingMore:E.isFetchingMore,fetchMoreError:E.fetchMoreError,fetchMore:E.fetchMore}},Wc),waitUntilLoaded:g.waitUntilLoaded}}),a=new It(d=>{const[m,g]=JSON.parse(d),C=new Ba(async h=>{const E=await this.#e[Oe].httpClient.getThreads({roomId:m,cursor:h,query:g});this.updateThreadifications(E.threads,E.inboxNotifications),this.permissionHints.update(E.permissionHints);const b=this.#r.get(m);return(b===void 0||b>E.requestedAt)&&this.#r.set(m,E.requestedAt),E.nextCursor});return{signal:Xe.from(()=>{const h=C.get();if(h.isLoading||h.error)return h;const E=this.outputs.threads.get().findMany(m,g??{},"asc"),b=h.data;return{isLoading:!1,threads:E,hasFetchedAll:b.hasFetchedAll,isFetchingMore:b.isFetchingMore,fetchMoreError:b.fetchMoreError,fetchMore:b.fetchMore}},Wc),waitUntilLoaded:C.waitUntilLoaded}}),i={signal:Xe.from(()=>{const m=this.#n.get();if(m.isLoading||m.error)return m;const g=m.data;return{isLoading:!1,inboxNotifications:this.outputs.notifications.get().sortedNotifications,hasFetchedAll:g.hasFetchedAll,isFetchingMore:g.isFetchingMore,fetchMoreError:g.fetchMoreError,fetchMore:g.fetchMore}}),waitUntilLoaded:this.#n.waitUntilLoaded},u=new It(d=>{const m=new Fa(async()=>{const C=this.#e.getRoom(d);if(C===null)throw new Error(`Room '${d}' is not available on client`);const v=await C.getNotificationSettings();this.roomNotificationSettings.update(d,v)});return{signal:Xe.from(()=>{const C=m.get();return C.isLoading||C.error?C:Cr("settings",pe(this.roomNotificationSettings.signal.get()[d]))},Bt),waitUntilLoaded:m.waitUntilLoaded}}),c=new It(d=>{const m=new Fa(async()=>{const C=this.#e.getRoom(d);if(C===null)throw new Error(`Room '${d}' is not available on client`);const v=await C[Oe].listTextVersions();this.historyVersions.update(d,v.versions);const h=this.#o.get(d);(h===void 0||h>v.requestedAt)&&this.#o.set(d,v.requestedAt)});return{signal:Xe.from(()=>{const C=m.get();return C.isLoading||C.error?C:Cr("versions",Object.values(this.historyVersions.signal.get()[d]??{}))},Bt),waitUntilLoaded:m.waitUntilLoaded}}),l={signal:Xe.from(()=>{const d=this.#i.get();return d.isLoading||d.error?d:Cr("settings",pe(this.userNotificationSettings.signal.get()))},Bt),waitUntilLoaded:this.#i.waitUntilLoaded};this.outputs={threadifications:n,threads:r,loadingRoomThreads:a,loadingUserThreads:s,notifications:o,loadingNotifications:i,settingsByRoomId:u,versionsByRoomId:c,userNotificationSettings:l},su(this)}markInboxNotificationRead(e,t,n){ct(()=>{this.optimisticUpdates.remove(n),this.notifications.markRead(e,t)})}markAllInboxNotificationsRead(e,t){ct(()=>{this.optimisticUpdates.remove(e),this.notifications.markAllRead(t)})}deleteInboxNotification(e,t){ct(()=>{this.optimisticUpdates.remove(t),this.notifications.delete(e)})}deleteAllInboxNotifications(e){ct(()=>{this.optimisticUpdates.remove(e),this.notifications.clear()})}createThread(e,t){ct(()=>{this.optimisticUpdates.remove(e),this.threads.upsert(t)})}#a(e,t,n,r){ct(()=>{t!==null&&this.optimisticUpdates.remove(t);const o=this.threads,s=o.get(e);s&&(r&&s.updatedAt>r||o.upsert(n(s)))})}patchThread(e,t,n,r){return this.#a(e,t,o=>({...o,...xo(n)}),r)}addReaction(e,t,n,r,o){this.#a(e,t,s=>Qd(s,n,r),o)}removeReaction(e,t,n,r,o,s){this.#a(e,t,a=>eh(a,n,r,o,s),s)}deleteThread(e,t){return this.#a(e,t,n=>({...n,updatedAt:new Date,deletedAt:new Date}))}createComment(e,t){ct(()=>{this.optimisticUpdates.remove(t);const n=this.threads.get(e.threadId);n&&(this.threads.upsert(Es(n,e)),this.notifications.updateAssociatedNotification(e))})}editComment(e,t,n){return this.#a(e,t,r=>Es(r,n))}deleteComment(e,t,n,r){return this.#a(e,t,o=>Jd(o,n,r),r)}updateThreadifications(e,t,n=[],r=[]){ct(()=>{this.threads.applyDelta(e,n),this.notifications.applyDelta(t,r)})}updateRoomNotificationSettings(e,t,n){ct(()=>{this.optimisticUpdates.remove(t),this.roomNotificationSettings.update(e,n)})}async fetchNotificationsDeltaUpdate(e){const t=this.#t;if(t===null)return;const n=await this.#e.getInboxNotificationsSince({since:t,signal:e});t<n.requestedAt&&(this.#t=n.requestedAt),this.updateThreadifications(n.threads.updated,n.inboxNotifications.updated,n.threads.deleted,n.inboxNotifications.deleted)}async fetchRoomThreadsDeltaUpdate(e,t){const n=this.#r.get(e);if(n===void 0)return;const r=await this.#e[Oe].httpClient.getThreadsSince({roomId:e,since:n,signal:t});this.updateThreadifications(r.threads.updated,r.inboxNotifications.updated,r.threads.deleted,r.inboxNotifications.deleted),this.permissionHints.update(r.permissionHints),n<r.requestedAt&&this.#r.set(e,r.requestedAt)}async fetchUserThreadsDeltaUpdate(e){const t=this.#s;if(t===null)return;const n=await this.#e[Oe].httpClient.getUserThreadsSince_experimental({since:t,signal:e});t<n.requestedAt&&(this.#t=n.requestedAt),this.updateThreadifications(n.threads.updated,n.inboxNotifications.updated,n.threads.deleted,n.inboxNotifications.deleted),this.permissionHints.update(n.permissionHints)}async fetchRoomVersionsDeltaUpdate(e,t){const n=this.#o.get(e);if(n===void 0)return;const o=await pe(this.#e.getRoom(e),`Room with id ${e} is not available on client`)[Oe].listTextVersionsSince({since:n,signal:t});this.historyVersions.update(e,o.versions),n<o.requestedAt&&this.#o.set(e,o.requestedAt)}async refreshRoomNotificationSettings(e,t){const r=await pe(this.#e.getRoom(e),`Room with id ${e} is not available on client`).getNotificationSettings({signal:t});this.roomNotificationSettings.update(e,r)}async refreshUserNotificationSettings(e){const t=await this.#e.getNotificationSettings({signal:e});this.userNotificationSettings.update(t)}updateUserNotificationSettings_confirmOptimisticUpdate(e,t){ct(()=>{this.optimisticUpdates.remove(t),this.userNotificationSettings.update(e)})}};function Ny(e,t,n){const r=e.clone();let o=Object.fromEntries(t);for(const a of n)switch(a.type){case"create-thread":{r.upsert(a.thread);break}case"edit-thread-metadata":{const i=r.get(a.threadId);if(i===void 0||i.updatedAt>a.updatedAt)break;r.upsert({...i,updatedAt:a.updatedAt,metadata:{...i.metadata,...a.metadata}});break}case"mark-thread-as-resolved":{const i=r.get(a.threadId);if(i===void 0)break;r.upsert({...i,resolved:!0});break}case"mark-thread-as-unresolved":{const i=r.get(a.threadId);if(i===void 0)break;r.upsert({...i,resolved:!1});break}case"create-comment":{const i=r.get(a.comment.threadId);if(i===void 0)break;r.upsert(Es(i,a.comment));const u=Object.values(o).find(c=>c.kind==="thread"&&c.threadId===i.id);if(u===void 0)break;o[u.id]={...u,notifiedAt:a.comment.createdAt,readAt:a.comment.createdAt};break}case"edit-comment":{const i=r.get(a.comment.threadId);if(i===void 0)break;r.upsert(Es(i,a.comment));break}case"delete-comment":{const i=r.get(a.threadId);if(i===void 0)break;r.upsert(Jd(i,a.commentId,a.deletedAt));break}case"delete-thread":{const i=r.get(a.threadId);if(i===void 0)break;r.upsert({...i,deletedAt:a.deletedAt,updatedAt:a.deletedAt,comments:[]});break}case"add-reaction":{const i=r.get(a.threadId);if(i===void 0)break;r.upsert(Qd(i,a.commentId,a.reaction));break}case"remove-reaction":{const i=r.get(a.threadId);if(i===void 0)break;r.upsert(eh(i,a.commentId,a.emoji,a.userId,a.removedAt));break}case"mark-inbox-notification-as-read":{const i=o[a.inboxNotificationId];if(i===void 0)break;o[a.inboxNotificationId]={...i,readAt:a.readAt};break}case"mark-all-inbox-notifications-as-read":{for(const i in o){const u=o[i];if(u===void 0)break;o[i]={...u,readAt:a.readAt}}break}case"delete-inbox-notification":{delete o[a.inboxNotificationId];break}case"delete-all-inbox-notifications":{o={};break}}return{sortedNotifications:Object.values(o).filter(a=>a.kind==="thread"?r.get(a.threadId)!==void 0:!0).sort((a,i)=>i.notifiedAt.getTime()-a.notifiedAt.getTime()),notificationsById:o,threadsDB:r}}function ky(e,t){const n=Object.fromEntries(e);for(const r of t)switch(r.type){case"update-notification-settings":{const o=n[r.roomId];if(o===void 0)break;n[r.roomId]={...o,...r.settings}}}return n}function My(e,t){let n=e;for(const r of t)r.type==="update-user-notification-settings"&&(n=J0(n,r.settings));return n}function _y(e,t){return e.notifiedAt>t.notifiedAt?1:e.notifiedAt<t.notifiedAt?-1:e.readAt&&t.readAt?e.readAt>t.readAt?1:e.readAt<t.readAt?-1:0:e.readAt||t.readAt?e.readAt?1:-1:0}function Es(e,t){if(e.deletedAt!==void 0)return e;if(t.threadId!==e.id)return Cn.warn(`Comment ${t.id} does not belong to thread ${e.id}`),e;const n=e.comments.find(r=>r.id===t.id);if(n===void 0){const r=new Date(Math.max(e.updatedAt.getTime(),t.createdAt.getTime()));return{...e,updatedAt:r,comments:[...e.comments,t]}}if(n.deletedAt!==void 0)return e;if(n.editedAt===void 0||t.editedAt===void 0||n.editedAt<=t.editedAt){const r=e.comments.map(s=>s.id===t.id?t:s);return{...e,updatedAt:new Date(Math.max(e.updatedAt.getTime(),t.editedAt?.getTime()||t.createdAt.getTime())),comments:r}}return e}function Jd(e,t,n){if(e.deletedAt!==void 0)return e;const r=e.comments.find(s=>s.id===t);if(r===void 0||r.deletedAt!==void 0)return e;const o=e.comments.map(s=>s.id===t?{...s,deletedAt:n,body:void 0,attachments:[]}:s);return o.every(s=>s.deletedAt!==void 0)?{...e,deletedAt:n,updatedAt:n}:{...e,updatedAt:n,comments:o}}function Qd(e,t,n){if(e.deletedAt!==void 0)return e;const r=e.comments.find(s=>s.id===t);if(r===void 0||r.deletedAt!==void 0)return e;const o=e.comments.map(s=>s.id===t?{...s,reactions:jy(s.reactions,n)}:s);return{...e,updatedAt:new Date(Math.max(n.createdAt.getTime(),e.updatedAt.getTime())),comments:o}}function eh(e,t,n,r,o){if(e.deletedAt!==void 0)return e;const s=e.comments.find(i=>i.id===t);if(s===void 0||s.deletedAt!==void 0)return e;const a=e.comments.map(i=>i.id===t?{...i,reactions:i.reactions.map(u=>u.emoji===n?{...u,users:u.users.filter(c=>c.id!==r)}:u).filter(u=>u.users.length>0)}:i);return{...e,updatedAt:new Date(Math.max(o.getTime(),e.updatedAt.getTime())),comments:a}}function jy(e,t){const n=e.find(r=>r.emoji===t.emoji);return n===void 0?[...e,{emoji:t.emoji,createdAt:t.createdAt,users:[{id:t.userId}]}]:n.users.some(r=>r.id===t.userId)===!1?e.map(r=>r.emoji===t.emoji?{...r,users:[...r.users,{id:t.userId}]}:r):e}var th=f.createContext(null);function nh(e){return new Error(`resolveUsers didn't return anything for user '${e}'`)}function Ly(e){return new Error(`resolveRoomsInfo didn't return anything for room '${e}'`)}function $y(e){return e}var zc=new WeakMap,Vc=new WeakMap;function Uy(e,t){return e===void 0||e?.isLoading?e??{isLoading:!0}:e.error?e:e.data?{isLoading:!1,user:e.data}:{isLoading:!1,error:nh(t)}}function Hy(e,t){return e===void 0||e?.isLoading?e??{isLoading:!0}:e.error?e:e.data?{isLoading:!1,info:e.data}:{isLoading:!1,error:Ly(t)}}function rh(e){let t=zc.get(e);return t||(t=new Py(e),zc.set(e,t)),t}function Oo(e){let t=Vc.get(e);return t||(t=Wy(e),Vc.set(e,t)),t}function Wy(e){const t=rh(e),n=gr(async s=>{try{return await t.fetchNotificationsDeltaUpdate(s)}catch(a){throw console.warn(`Polling new inbox notifications failed: ${String(a)}`),a}},bt.NOTIFICATIONS_POLL_INTERVAL,{maxStaleTimeMs:bt.NOTIFICATIONS_MAX_STALE_TIME}),r=gr(async s=>{try{return await t.fetchUserThreadsDeltaUpdate(s)}catch(a){throw console.warn(`Polling new user threads failed: ${String(a)}`),a}},bt.USER_THREADS_POLL_INTERVAL,{maxStaleTimeMs:bt.USER_THREADS_MAX_STALE_TIME}),o=gr(async s=>{try{return await t.refreshUserNotificationSettings(s)}catch(a){throw console.warn(`Polling new user notification settings failed: ${String(a)}`),a}},bt.USER_NOTIFICATION_SETTINGS_INTERVAL,{maxStaleTimeMs:bt.USER_NOTIFICATION_SETTINGS_MAX_STALE_TIME});return{store:t,notificationsPoller:n,userThreadsPoller:r,userNotificationSettingsPoller:o}}function zy(e,t,n){const{store:r,notificationsPoller:o}=Oo(e);return f.useEffect(()=>void r.outputs.loadingNotifications.waitUntilLoaded()),f.useEffect(()=>(o.inc(),o.pollNowIfStale(),()=>{o.dec()}),[o]),Qn(r.outputs.loadingNotifications.signal,t,n)}function Vy(e){return f.useCallback(t=>{const{store:n}=Oo(e),r=new Date,o=n.optimisticUpdates.add({type:"mark-inbox-notification-as-read",inboxNotificationId:t,readAt:r});e.markInboxNotificationAsRead(t).then(()=>{n.markInboxNotificationRead(t,r,o)},s=>{n.optimisticUpdates.remove(o),e[Oe].emitError({type:"MARK_INBOX_NOTIFICATION_AS_READ_ERROR",inboxNotificationId:t},s)})},[e])}function Ky(e){return f.useCallback(t=>{const{store:n}=Oo(e),r=new Date,o=n.optimisticUpdates.add({type:"delete-inbox-notification",inboxNotificationId:t,deletedAt:r});e.deleteInboxNotification(t).then(()=>{n.deleteInboxNotification(t,o)},s=>{n.optimisticUpdates.remove(o),e[Oe].emitError({type:"DELETE_INBOX_NOTIFICATION_ERROR",inboxNotificationId:t},s)})},[e])}function qy(e,t){const{store:n}=Oo(e);return Qn(n.outputs.threadifications,f.useCallback(r=>{const o=r.notificationsById[t]??wt(`Inbox notification with ID "${t}" not found`);return o.kind!=="thread"&&wt(`Inbox notification with ID "${t}" is not of kind "thread"`),r.threadsDB.get(o.threadId)??wt(`Thread with ID "${o.threadId}" not found, this inbox notification might not be of kind "thread"`)},[t]))}function Gy(e,t){const n=e[Oe].usersStore,r=f.useCallback(()=>n.getItemState(t),[n,t]),o=f.useCallback(a=>Uy(a,t),[t]),s=Ws(n.subscribe,r,r,o,Bt);return f.useEffect(()=>void n.enqueue(t)),s}function Yy(e,t){const n=e[Oe].usersStore,r=f.useCallback(()=>n.getItemState(t),[n,t]),o=r();if(!o||o.isLoading)throw n.enqueue(t);if(o.error)throw o.error;if(!o.data)throw nh(t);const s=f.useSyncExternalStore(n.subscribe,r,r);return s.isLoading,s.error,{isLoading:!1,user:s.data,error:void 0}}function Xy(e,t){const n=e[Oe].roomsInfoStore,r=f.useCallback(()=>n.getItemState(t),[n,t]),o=f.useCallback(a=>Hy(a,t),[t]),s=Ws(n.subscribe,r,r,o,Bt);return f.useEffect(()=>void n.enqueue(t)),s}function Zy(e){const t=au();if(!e?.allowNesting&&t!==null)throw new Error("You cannot nest multiple LiveblocksProvider instances in the same React tree.")}function au(){return f.useContext(th)}function Be(){return au()??wt("LiveblocksProvider is missing from the React tree.")}function Jy(e){return Zy(e),p.jsx(th.Provider,{value:e.client,children:e.children})}function kF(e){const{children:t,...n}=e,r={publicApiKey:ut(n.publicApiKey),throttle:ut(n.throttle),lostConnectionTimeout:ut(n.lostConnectionTimeout),backgroundKeepAliveTimeout:ut(n.backgroundKeepAliveTimeout),polyfills:ut(n.polyfills),largeMessageStrategy:ut(n.largeMessageStrategy),unstable_fallbackToHTTP:ut(n.unstable_fallbackToHTTP),unstable_streamData:ut(n.unstable_streamData),preventUnsavedChanges:ut(n.preventUnsavedChanges),authEndpoint:Vo(n.authEndpoint),resolveMentionSuggestions:Vo(n.resolveMentionSuggestions),resolveUsers:Vo(n.resolveUsers),resolveRoomsInfo:Vo(n.resolveRoomsInfo),baseUrl:ut(n.baseUrl),enableDebugLogging:ut(n.enableDebugLogging)},o=f.useMemo(()=>qC(r),[]);return p.jsx(Jy,{client:o,children:t})}function Qy(e={}){const t=Be(),{store:n,userThreadsPoller:r}=Oo(t),o=xy(e.query);return f.useEffect(()=>void n.outputs.loadingUserThreads.getOrCreate(o).waitUntilLoaded()),f.useEffect(()=>(r.inc(),r.pollNowIfStale(),()=>{r.dec()}),[r]),Qn(n.outputs.loadingUserThreads.getOrCreate(o).signal)}function MF(){return zy(Be(),$y,Bt)}function eb(e){return qy(Be(),e)}function tb(){return Vy(Be())}function nb(){return Ky(Be())}function rb(e){const t=Be();return Gy(t,e)}function ob(e){const t=Be();return Yy(t,e)}function iu(e){return Xy(Be(),e)}var sb=eb,oh=rb,_F=ob,jF=Qy;function ab(e,t){if(e===!1||!t.threads||!(typeof window<"u"))return;const o=window.location.hash.slice(1);if(!o.startsWith("cm_"))return;const s=document.getElementById(o);s===null||!t.threads.flatMap(u=>u.comments).some(u=>u.id===o)||s.scrollIntoView()}function ib(e,t){f.useEffect(()=>{ab(e,t)},[t.isLoading])}function zs(e){const t=e[Oe].currentUserId.get();return t===void 0?"anonymous":t}var Kc=new WeakMap;function vt(e){let t=Kc.get(e);return t||(t=ub(e),Kc.set(e,t)),t}function ub(e){const t=rh(e);function n(a,i,u){if(t.optimisticUpdates.remove(a),u instanceof xr){if(u.status===403){const c=[u.message,u.details?.suggestion,u.details?.docs].filter(Boolean).join(`
3
3
  `);Cn.error(c)}e[Oe].emitError(i,u)}else throw u}const r=new It(a=>gr(async i=>{try{return await t.fetchRoomThreadsDeltaUpdate(a,i)}catch(u){throw Cn.warn(`Polling new threads for '${a}' failed: ${String(u)}`),u}},bt.ROOM_THREADS_POLL_INTERVAL,{maxStaleTimeMs:bt.ROOM_THREADS_MAX_STALE_TIME})),o=new It(a=>gr(async i=>{try{return await t.fetchRoomVersionsDeltaUpdate(a,i)}catch(u){throw Cn.warn(`Polling new history versions for '${a}' failed: ${String(u)}`),u}},bt.HISTORY_VERSIONS_POLL_INTERVAL,{maxStaleTimeMs:bt.HISTORY_VERSIONS_MAX_STALE_TIME})),s=new It(a=>gr(async i=>{try{return await t.refreshRoomNotificationSettings(a,i)}catch(u){throw Cn.warn(`Polling notification settings for '${a}' failed: ${String(u)}`),u}},bt.NOTIFICATION_SETTINGS_POLL_INTERVAL,{maxStaleTimeMs:bt.NOTIFICATION_SETTINGS_MAX_STALE_TIME}));return{store:t,onMutationFailure:n,getOrCreateThreadsPollerForRoomId:r.getOrCreate.bind(r),getOrCreateVersionsPollerForRoomId:o.getOrCreate.bind(o),getOrCreateNotificationsSettingsPollerForRoomId:s.getOrCreate.bind(s)}}function cb(e){const t=Be(),[n]=f.useState(()=>new Map),r=f.useCallback((o,s)=>{const a=n.get(o);if(a)return a;const i=t.enterRoom(o,s),u=i.leave;return i.leave=()=>{u(),n.delete(o)},n.set(o,i),i},[t,n]);return p.jsx(lb,{...e,stableEnterRoom:r})}function lb(e){const t=Be(),{id:n,stableEnterRoom:r}=e,o=ut({initialPresence:e.initialPresence,initialStorage:e.initialStorage,autoConnect:e.autoConnect??typeof window<"u"}),[{room:s},a]=f.useState(()=>r(n,{...o,autoConnect:!1}));return f.useEffect(()=>{const{store:i}=vt(t);async function u(c){if(c.type===Zt.THREAD_DELETED){i.deleteThread(c.threadId,null);return}const l=await s.getThread(c.threadId);if(!l.thread){i.deleteThread(c.threadId,null);return}const{thread:d,inboxNotification:m}=l,g=i.outputs.threads.get().getEvenIfDeleted(c.threadId);switch(c.type){case Zt.COMMENT_EDITED:case Zt.THREAD_METADATA_UPDATED:case Zt.THREAD_UPDATED:case Zt.COMMENT_REACTION_ADDED:case Zt.COMMENT_REACTION_REMOVED:case Zt.COMMENT_DELETED:if(!g)break;i.updateThreadifications([d],m?[m]:[]);break;case Zt.COMMENT_CREATED:i.updateThreadifications([d],m?[m]:[]);break}}return s.events.comments.subscribe(c=>void u(c))},[t,s]),f.useEffect(()=>{const i=r(n,o);a(i);const{room:u,leave:c}=i;return o.autoConnect&&u.connect(),()=>{c()}},[n,o,r]),p.jsx(Gd.Provider,{value:s,children:e.children})}function uu(e){const t=dy();if(t===null&&!e?.allowOutsideRoom)throw new Error("RoomProvider is missing from the React tree.");return t}function cu(){return Be()[Oe].resolveMentionSuggestions}function fb(){return Be()[Oe].mentionSuggestionsCache}function db(e={}){const{scrollOnLoad:t=!0}=e,n=Be(),r=uu(),{store:o,getOrCreateThreadsPollerForRoomId:s}=vt(n),a=Ay(r.id,e.query),i=s(r.id);f.useEffect(()=>void o.outputs.loadingRoomThreads.getOrCreate(a).waitUntilLoaded()),f.useEffect(()=>(i.inc(),i.pollNowIfStale(),()=>i.dec()),[i]);const u=Qn(o.outputs.loadingRoomThreads.getOrCreate(a).signal);return ib(t,u),u}function hb(){return sh(uu().id)}function sh(e){const t=Be();return f.useCallback(n=>{const r=n.body,o=n.metadata??{},s=n.attachments,a=Id(),i=Cs(),u=new Date,c={id:i,threadId:a,roomId:e,createdAt:u,type:"comment",userId:zs(t),body:r,reactions:[],attachments:s??[]},l={id:a,type:"thread",createdAt:u,updatedAt:u,roomId:e,metadata:o,comments:[c],resolved:!1},{store:d,onMutationFailure:m}=vt(t),g=d.optimisticUpdates.add({type:"create-thread",thread:l,roomId:e}),C=s?.map(v=>v.id);return t[Oe].httpClient.createThread({roomId:e,threadId:a,commentId:i,body:r,metadata:o,attachmentIds:C}).then(v=>{d.createThread(g,v)},v=>m(g,{type:"CREATE_THREAD_ERROR",roomId:e,threadId:a,commentId:i,body:r,metadata:o},v)),l},[t,e])}function pb(e){const t=Be();return f.useCallback(({threadId:n,body:r,attachments:o})=>{const s=Cs(),i={id:s,threadId:n,roomId:e,type:"comment",createdAt:new Date,userId:zs(t),body:r,reactions:[],attachments:o??[]},{store:u,onMutationFailure:c}=vt(t),l=u.optimisticUpdates.add({type:"create-comment",comment:i}),d=o?.map(m=>m.id);return t[Oe].httpClient.createComment({roomId:e,threadId:n,commentId:s,body:r,attachmentIds:d}).then(m=>{u.createComment(m,l)},m=>c(l,{type:"CREATE_COMMENT_ERROR",roomId:e,threadId:n,commentId:s,body:r},m)),i},[t,e])}function ah(e){const t=Be();return f.useCallback(({threadId:n,commentId:r,body:o,attachments:s})=>{const a=new Date,{store:i,onMutationFailure:u}=vt(t),c=i.outputs.threads.get().getEvenIfDeleted(n);if(c===void 0){Cn.warn(`Internal unexpected behavior. Cannot edit comment in thread "${n}" because the thread does not exist in the cache.`);return}const l=c.comments.find(g=>g.id===r);if(l===void 0||l.deletedAt!==void 0){Cn.warn(`Internal unexpected behavior. Cannot edit comment "${r}" in thread "${n}" because the comment does not exist in the cache.`);return}const d=i.optimisticUpdates.add({type:"edit-comment",comment:{...l,editedAt:a,body:o,attachments:s??[]}}),m=s?.map(g=>g.id);t[Oe].httpClient.editComment({roomId:e,threadId:n,commentId:r,body:o,attachmentIds:m}).then(g=>{i.editComment(n,d,g)},g=>u(d,{type:"EDIT_COMMENT_ERROR",roomId:e,threadId:n,commentId:r,body:o},g))},[t,e])}function mb(e){const t=Be();return f.useCallback(({threadId:n,commentId:r})=>{const o=new Date,{store:s,onMutationFailure:a}=vt(t),i=s.optimisticUpdates.add({type:"delete-comment",threadId:n,commentId:r,deletedAt:o,roomId:e});t[Oe].httpClient.deleteComment({roomId:e,threadId:n,commentId:r}).then(()=>{s.deleteComment(n,i,r,o)},u=>a(i,{type:"DELETE_COMMENT_ERROR",roomId:e,threadId:n,commentId:r},u))},[t,e])}function ih(e){const t=Be();return f.useCallback(({threadId:n,commentId:r,emoji:o})=>{const s=new Date,a=zs(t),{store:i,onMutationFailure:u}=vt(t),c=i.optimisticUpdates.add({type:"add-reaction",threadId:n,commentId:r,reaction:{emoji:o,userId:a,createdAt:s}});t[Oe].httpClient.addReaction({roomId:e,threadId:n,commentId:r,emoji:o}).then(l=>{i.addReaction(n,c,r,l,s)},l=>u(c,{type:"ADD_REACTION_ERROR",roomId:e,threadId:n,commentId:r,emoji:o},l))},[t,e])}function uh(e){const t=Be();return f.useCallback(({threadId:n,commentId:r,emoji:o})=>{const s=zs(t),a=new Date,{store:i,onMutationFailure:u}=vt(t),c=i.optimisticUpdates.add({type:"remove-reaction",threadId:n,commentId:r,emoji:o,userId:s,removedAt:a});t[Oe].httpClient.removeReaction({roomId:e,threadId:n,commentId:r,emoji:o}).then(()=>{i.removeReaction(n,c,r,o,s,a)},l=>u(c,{type:"REMOVE_REACTION_ERROR",roomId:e,threadId:n,commentId:r,emoji:o},l))},[t,e])}function vb(e){const t=Be();return f.useCallback(n=>{const{store:r,onMutationFailure:o}=vt(t),s=Object.values(r.outputs.notifications.get().notificationsById).find(u=>u.kind==="thread"&&u.threadId===n);if(!s)return;const a=new Date,i=r.optimisticUpdates.add({type:"mark-inbox-notification-as-read",inboxNotificationId:s.id,readAt:a});t[Oe].httpClient.markRoomInboxNotificationAsRead({roomId:e,inboxNotificationId:s.id}).then(()=>{r.markInboxNotificationRead(s.id,a,i)},u=>{o(i,{type:"MARK_INBOX_NOTIFICATION_AS_READ_ERROR",roomId:e,inboxNotificationId:s.id},u)})},[t,e])}function gb(e){const t=Be();return f.useCallback(n=>{const r=new Date,{store:o,onMutationFailure:s}=vt(t),a=o.optimisticUpdates.add({type:"mark-thread-as-resolved",threadId:n,updatedAt:r});t[Oe].httpClient.markThreadAsResolved({roomId:e,threadId:n}).then(()=>{o.patchThread(n,a,{resolved:!0},r)},i=>s(a,{type:"MARK_THREAD_AS_RESOLVED_ERROR",roomId:e,threadId:n},i))},[t,e])}function Cb(e){const t=Be();return f.useCallback(n=>{const r=new Date,{store:o,onMutationFailure:s}=vt(t),a=o.optimisticUpdates.add({type:"mark-thread-as-unresolved",threadId:n,updatedAt:r});t[Oe].httpClient.markThreadAsUnresolved({roomId:e,threadId:n}).then(()=>{o.patchThread(n,a,{resolved:!1},r)},i=>s(a,{type:"MARK_THREAD_AS_UNRESOLVED_ERROR",roomId:e,threadId:n},i))},[t,e])}function yb(e){const t=Be(),{store:n}=vt(t),r=n.outputs.threadifications,o=f.useCallback(s=>{const a=s.sortedNotifications.find(u=>u.kind==="thread"&&u.threadId===e),i=s.threadsDB.get(e);return a===void 0||i===void 0?{status:"not-subscribed"}:{status:"subscribed",unreadSince:a.readAt}},[e]);return Qn(r,o,Bt)}function bb(e){return e===void 0||e?.isLoading?e??{isLoading:!0}:e.error?e:(e.data,{isLoading:!1,url:e.data})}function Vs(e,t){const r=Be()[Oe].httpClient.getOrCreateAttachmentUrlsStore(t),o=f.useCallback(()=>r.getItemState(e),[r,e]);return f.useEffect(()=>{r.enqueue(e)},[r,e]),Ws(r.subscribe,o,o,bb,Bt)}var Eb=new Set;function Db(e){const t=Be(),n=vt(t).store;return Qn(n.permissionHints.signal,r=>r.get(e)??Eb)}var LF=cb,ch=uu,$F=hb,UF=db;Zi(Xg,Zg,Jg);var Vt=typeof window<"u"?f.useLayoutEffect:f.useEffect,qc=500;function wb(e,t){const[n,r]=f.useState(),o=f.useRef(),s=cu(),a=fb();return f.useEffect(()=>{if(t===void 0||!s)return;const i={text:t,roomId:e},u=Vn(i);let c,l=!1;const d=async()=>{try{o.current=performance.now();const m=await s(i);l||(r(m),a.set(u,m))}catch(m){console.error(m?.message)}};return a.has(u)?r(a.get(u)):!o.current||Math.abs(performance.now()-o.current)>qc?d():c=window.setTimeout(()=>{d()},qc),()=>{l=!0,window.clearTimeout(c)}},[t,e,s,a]),n}function Ab(){const t=Be()[Oe].createSyncSource,[n,r]=f.useState();return f.useEffect(()=>{const o=t();return r(o),()=>o.destroy()},[t]),n}function ve(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}function kt(e){const t=f.useRef(e);return f.useEffect(()=>{t.current=e}),f.useMemo(()=>(...n)=>t.current?.(...n),[])}function So({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=xb({defaultProp:t,onChange:n}),s=e!==void 0,a=s?e:r,i=kt(n),u=f.useCallback(c=>{if(s){const d=typeof c=="function"?c(e):c;d!==e&&i(d)}else o(c)},[s,e,o,i]);return[a,u]}function xb({defaultProp:e,onChange:t}){const n=f.useState(e),[r]=n,o=f.useRef(r),s=kt(t);return f.useEffect(()=>{o.current!==r&&(s(r),o.current=r)},[r,o,s]),n}function Ob(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Ks(...e){return t=>e.forEach(n=>Ob(n,t))}function Ke(...e){return f.useCallback(Ks(...e),e)}var Ne=f.forwardRef((e,t)=>{const{children:n,...r}=e,o=f.Children.toArray(n),s=o.find(Sb);if(s){const a=s.props.children,i=o.map(u=>u===s?f.Children.count(a)>1?f.Children.only(null):f.isValidElement(a)?a.props.children:null:u);return p.jsx(Ci,{...r,ref:t,children:f.isValidElement(a)?f.cloneElement(a,void 0,i):null})}return p.jsx(Ci,{...r,ref:t,children:n})});Ne.displayName="Slot";var Ci=f.forwardRef((e,t)=>{const{children:n,...r}=e;if(f.isValidElement(n)){const o=Rb(n);return f.cloneElement(n,{...Tb(r,n.props),ref:t?Ks(t,o):o})}return f.Children.count(n)>1?f.Children.only(null):null});Ci.displayName="SlotClone";var lu=({children:e})=>p.jsx(p.Fragment,{children:e});function Sb(e){return f.isValidElement(e)&&e.type===lu}function Tb(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...i)=>{s(...i),o(...i)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Rb(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Ib=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],He=Ib.reduce((e,t)=>{const n=f.forwardRef((r,o)=>{const{asChild:s,...a}=r,i=s?Ne:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(i,{...a,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function lh(e,t){e&&Ls.flushSync(()=>e.dispatchEvent(t))}var Bb="Toggle",fh=f.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r=!1,onPressedChange:o,...s}=e,[a=!1,i]=So({prop:n,onChange:o,defaultProp:r});return p.jsx(He.button,{type:"button","aria-pressed":a,"data-state":a?"on":"off","data-disabled":e.disabled?"":void 0,...s,ref:t,onClick:ve(e.onClick,()=>{e.disabled||i(!a)})})});fh.displayName=Bb;var fu=fh;function Ae(...e){return e.filter(t=>typeof t=="string"||typeof t=="number").join(" ")}const Gc=20,Yc=20;function Ue({children:e,className:t,...n}){return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:Gc,height:Yc,viewBox:`0 0 ${Gc} ${Yc}`,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",role:"presentation",className:Ae("lb-icon",t),...n,children:e})}function dh(e){return p.jsx(Ue,{...e,children:p.jsx("path",{d:"M16 6L8 14L4 10"})})}function du(e){return p.jsxs(Ue,{...e,children:[p.jsx("path",{d:"M15 5L5 15"}),p.jsx("path",{d:"M5 5L15 15"})]})}function hh(e){return p.jsx(Ue,{...e,children:p.jsx("path",{d:"M4.5 6.5h11M14 6.5V14a1.5 1.5 0 0 1-1.5 1.5h-5A1.5 1.5 0 0 1 6 14V6.5M7.5 6.5V5a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1v1.5"})})}function Fb(e){return p.jsx(Ue,{...e,children:p.jsx("path",{d:"m11.784 5.797-6.13 6.138a4 4 0 0 0-1.03 1.775L4 16l2.285-.624a4 4 0 0 0 1.776-1.032l6.145-6.152m-2.422-2.395 1.244-1.246c.608-.608 1.826-.81 2.53-.104.7.7.499 1.893-.122 2.515l-1.23 1.23m-2.422-2.395 2.422 2.395"})})}function ph(e){return p.jsxs(Ue,{fill:"currentColor",...e,children:[p.jsx("circle",{cx:5,cy:10,r:.75}),p.jsx("circle",{cx:10,cy:10,r:.75}),p.jsx("circle",{cx:15,cy:10,r:.75})]})}function Xc(e){return p.jsxs(Ue,{...e,children:[p.jsx("path",{d:"M11 3.07A7 7 0 1 0 16.93 9"}),p.jsx("path",{d:"M7.5 11.5S8.25 13 10 13s2.5-1.5 2.5-1.5M8 8h0"}),p.jsx("path",{d:"M12 8h0"}),p.jsx("path",{d:"M13 5h4m-2-2v4"}),p.jsx("circle",{cx:"8",cy:"8",r:".25"}),p.jsx("circle",{cx:"12",cy:"8",r:".25"})]})}const To=6,qs=10,Pb="'Apple Color Emoji', 'Noto Color Emoji', 'Twemoji Mozilla', 'Android Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', EmojiSymbols, sans-serif",Nb=f.forwardRef(({emoji:e,style:t,asChild:n,...r},o)=>{const s=n?Ne:"span";return p.jsx(s,{role:"img","aria-label":e,"data-emoji":e,style:{...t,fontFamily:Pb,display:"inline-flex",alignItems:"center",justifyContent:"center",width:"1em",whiteSpace:"nowrap"},...r,ref:o,children:e})}),hu=f.forwardRef(({className:e,...t},n)=>p.jsx(Nb,{className:Ae("lb-emoji",e),...t,ref:n}));function Pa(e,t,n){return e===1?t:n??`${t}s`}const kb={locale:"en",dir:"ltr",USER_SELF:"you",USER_UNKNOWN:"Anonymous",LIST_REMAINING:e=>`${e} more`,LIST_REMAINING_USERS:e=>`${e} ${Pa(e,"other")}`,LIST_REMAINING_COMMENTS:e=>`${e} more ${Pa(e,"comment")}`,EMOJI_PICKER_SEARCH_PLACEHOLDER:"Search…",EMOJI_PICKER_EMPTY:"No emoji found.",EMOJI_PICKER_ERROR:()=>"There was an error while getting the list of emoji.",EMOJI_PICKER_CHANGE_SKIN_TONE:"Change skin tone",ATTACHMENT_TOO_LARGE:e=>e?`The file is larger than ${e}`:"The file is too large",ATTACHMENT_ERROR:()=>"The file couldn’t be uploaded.",COMPOSER_INSERT_MENTION:"Mention someone",COMPOSER_INSERT_EMOJI:"Add emoji",COMPOSER_ATTACH_FILES:"Attach files",COMPOSER_REMOVE_ATTACHMENT:"Remove attachment",COMPOSER_PLACEHOLDER:"Write a comment…",COMPOSER_SEND:"Send",COMPOSER_TOGGLE_MARK:e=>{switch(e){case"bold":return"Bold";case"italic":return"Italic";case"strikethrough":return"Strikethrough";case"code":return"Inline code";default:return lt(e,"Unexpected mark")}},COMMENT_EDITED:"(edited)",COMMENT_DELETED:"This comment has been deleted.",COMMENT_MORE:"More",COMMENT_EDIT:"Edit comment",COMMENT_EDIT_COMPOSER_PLACEHOLDER:"Edit comment…",COMMENT_EDIT_COMPOSER_CANCEL:"Cancel",COMMENT_EDIT_COMPOSER_SAVE:"Save",COMMENT_DELETE:"Delete comment",COMMENT_DELETE_ATTACHMENT:"Delete attachment",COMMENT_ADD_REACTION:"Add reaction",COMMENT_REACTION_LIST:(e,t)=>p.jsxs(p.Fragment,{children:[e," reacted with ",p.jsx(hu,{emoji:t})]}),COMMENT_REACTION_DESCRIPTION:(e,t)=>`${t} ${Pa(t,"reaction")}, react with ${e}`,THREAD_RESOLVE:"Resolve thread",THREAD_UNRESOLVE:"Re-open thread",THREAD_NEW_INDICATOR:"New",THREAD_NEW_INDICATOR_DESCRIPTION:"New comments",THREAD_COMPOSER_PLACEHOLDER:"Reply to thread…",THREAD_COMPOSER_SEND:"Reply",INBOX_NOTIFICATION_MORE:"More",INBOX_NOTIFICATION_MARK_AS_READ:"Mark as read",INBOX_NOTIFICATION_DELETE:"Delete notification",INBOX_NOTIFICATION_THREAD_COMMENTS_LIST:(e,t)=>p.jsxs(p.Fragment,{children:[e," commented",t?p.jsxs(p.Fragment,{children:[" in ",t]}):p.jsx(p.Fragment,{children:" in a thread"})]}),INBOX_NOTIFICATION_THREAD_MENTION:(e,t)=>p.jsxs(p.Fragment,{children:[e," mentioned you",t?p.jsxs(p.Fragment,{children:[" in ",t]}):null]}),INBOX_NOTIFICATION_TEXT_MENTION:(e,t)=>p.jsxs(p.Fragment,{children:[e," mentioned you",t?p.jsxs(p.Fragment,{children:[" in ",t]}):null]}),HISTORY_VERSION_PREVIEW_AUTHORS_LIST:e=>p.jsxs(p.Fragment,{children:["Edits from ",e]}),HISTORY_VERSION_PREVIEW_RESTORE:"Restore",HISTORY_VERSION_PREVIEW_EMPTY:"No content.",HISTORY_VERSION_PREVIEW_ERROR:()=>"There was an error while getting this version."},Mb=f.createContext(void 0);function Ze(e){const t=f.useContext(Mb);return f.useMemo(()=>({...kb,...t,...e}),[t,e])}function Zc(e){return Object.prototype.toString.call(e)==="[object Object]"}function ze(e){var t,n;return Zc(e)===!1?!1:(t=e.constructor,t===void 0?!0:(n=t.prototype,!(Zc(n)===!1||n.hasOwnProperty("isPrototypeOf")===!1)))}var mh=Symbol.for("immer-nothing"),Jc=Symbol.for("immer-draftable"),ht=Symbol.for("immer-state");function Rt(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Or=Object.getPrototypeOf;function Kn(e){return!!e&&!!e[ht]}function qn(e){return e?vh(e)||Array.isArray(e)||!!e[Jc]||!!e.constructor?.[Jc]||Ys(e)||Xs(e):!1}var _b=Object.prototype.constructor.toString();function vh(e){if(!e||typeof e!="object")return!1;const t=Or(e);if(t===null)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===_b}function Ds(e,t){Gs(e)===0?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function Gs(e){const t=e[ht];return t?t.type_:Array.isArray(e)?1:Ys(e)?2:Xs(e)?3:0}function yi(e,t){return Gs(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function gh(e,t,n){const r=Gs(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function jb(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Ys(e){return e instanceof Map}function Xs(e){return e instanceof Set}function kn(e){return e.copy_||e.base_}function bi(e,t){if(Ys(e))return new Map(e);if(Xs(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&vh(e))return Or(e)?{...e}:Object.assign(Object.create(null),e);const n=Object.getOwnPropertyDescriptors(e);delete n[ht];let r=Reflect.ownKeys(n);for(let o=0;o<r.length;o++){const s=r[o],a=n[s];a.writable===!1&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(n[s]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[s]})}return Object.create(Or(e),n)}function pu(e,t=!1){return Zs(e)||Kn(e)||!qn(e)||(Gs(e)>1&&(e.set=e.add=e.clear=e.delete=Lb),Object.freeze(e),t&&Object.entries(e).forEach(([n,r])=>pu(r,!0))),e}function Lb(){Rt(2)}function Zs(e){return Object.isFrozen(e)}var $b={};function Gn(e){const t=$b[e];return t||Rt(0,e),t}var ao;function Ch(){return ao}function Ub(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Qc(e,t){t&&(Gn("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Ei(e){Di(e),e.drafts_.forEach(Hb),e.drafts_=null}function Di(e){e===ao&&(ao=e.parent_)}function el(e){return ao=Ub(ao,e)}function Hb(e){const t=e[ht];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function tl(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[ht].modified_&&(Ei(t),Rt(4)),qn(e)&&(e=ws(t,e),t.parent_||As(t,e)),t.patches_&&Gn("Patches").generateReplacementPatches_(n[ht].base_,e,t.patches_,t.inversePatches_)):e=ws(t,n,[]),Ei(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==mh?e:void 0}function ws(e,t,n){if(Zs(t))return t;const r=t[ht];if(!r)return Ds(t,(o,s)=>nl(e,r,t,o,s,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return As(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const o=r.copy_;let s=o,a=!1;r.type_===3&&(s=new Set(o),o.clear(),a=!0),Ds(s,(i,u)=>nl(e,r,o,i,u,n,a)),As(e,o,!1),n&&e.patches_&&Gn("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function nl(e,t,n,r,o,s,a){if(Kn(o)){const i=s&&t&&t.type_!==3&&!yi(t.assigned_,r)?s.concat(r):void 0,u=ws(e,o,i);if(gh(n,r,u),Kn(u))e.canAutoFreeze_=!1;else return}else a&&n.add(o);if(qn(o)&&!Zs(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;ws(e,o),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&Object.prototype.propertyIsEnumerable.call(n,r)&&As(e,o)}}function As(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&pu(t,n)}function Wb(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:Ch(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,s=mu;n&&(o=[r],s=io);const{revoke:a,proxy:i}=Proxy.revocable(o,s);return r.draft_=i,r.revoke_=a,i}var mu={get(e,t){if(t===ht)return e;const n=kn(e);if(!yi(n,t))return zb(e,n,t);const r=n[t];return e.finalized_||!qn(r)?r:r===Na(e.base_,t)?(ka(e),e.copy_[t]=Ai(r,e)):r},has(e,t){return t in kn(e)},ownKeys(e){return Reflect.ownKeys(kn(e))},set(e,t,n){const r=yh(kn(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const o=Na(kn(e),t),s=o?.[ht];if(s&&s.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(jb(n,o)&&(n!==void 0||yi(e.base_,t)))return!0;ka(e),wi(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return Na(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,ka(e),wi(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=kn(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){Rt(11)},getPrototypeOf(e){return Or(e.base_)},setPrototypeOf(){Rt(12)}},io={};Ds(mu,(e,t)=>{io[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});io.deleteProperty=function(e,t){return io.set.call(this,e,t,void 0)};io.set=function(e,t,n){return mu.set.call(this,e[0],t,n,e[0])};function Na(e,t){const n=e[ht];return(n?kn(n):e)[t]}function zb(e,t,n){const r=yh(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}function yh(e,t){if(!(t in e))return;let n=Or(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Or(n)}}function wi(e){e.modified_||(e.modified_=!0,e.parent_&&wi(e.parent_))}function ka(e){e.copy_||(e.copy_=bi(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Vb=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const s=n;n=t;const a=this;return function(u=s,...c){return a.produce(u,l=>n.call(this,l,...c))}}typeof n!="function"&&Rt(6),r!==void 0&&typeof r!="function"&&Rt(7);let o;if(qn(t)){const s=el(this),a=Ai(t,void 0);let i=!0;try{o=n(a),i=!1}finally{i?Ei(s):Di(s)}return Qc(s,r),tl(o,s)}else if(!t||typeof t!="object"){if(o=n(t),o===void 0&&(o=t),o===mh&&(o=void 0),this.autoFreeze_&&pu(o,!0),r){const s=[],a=[];Gn("Patches").generateReplacementPatches_(t,o,s,a),r(s,a)}return o}else Rt(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(a,...i)=>this.produceWithPatches(a,u=>t(u,...i));let r,o;return[this.produce(t,n,(a,i)=>{r=a,o=i}),r,o]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){qn(e)||Rt(8),Kn(e)&&(e=Kb(e));const t=el(this),n=Ai(e,void 0);return n[ht].isManual_=!0,Di(t),n}finishDraft(e,t){const n=e&&e[ht];(!n||!n.isManual_)&&Rt(9);const{scope_:r}=n;return Qc(r,t),tl(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const o=t[n];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}n>-1&&(t=t.slice(n+1));const r=Gn("Patches").applyPatches_;return Kn(e)?r(e,t):this.produce(e,o=>r(o,t))}};function Ai(e,t){const n=Ys(e)?Gn("MapSet").proxyMap_(e,t):Xs(e)?Gn("MapSet").proxySet_(e,t):Wb(e,t);return(t?t.scope_:Ch()).drafts_.push(n),n}function Kb(e){return Kn(e)||Rt(10,e),bh(e)}function bh(e){if(!qn(e)||Zs(e))return e;const t=e[ht];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=bi(e,t.scope_.immer_.useStrictShallowCopy_)}else n=bi(e,!0);return Ds(n,(r,o)=>{gh(n,r,bh(o))}),t&&(t.finalized_=!1),n}var pt=new Vb,vu=pt.produce;pt.produceWithPatches.bind(pt);pt.setAutoFreeze.bind(pt);pt.setUseStrictShallowCopy.bind(pt);pt.applyPatches.bind(pt);var rl=pt.createDraft.bind(pt),ol=pt.finishDraft.bind(pt),qb={transform(e,t){var{current:n,affinity:r}=e;if(n!=null){var o=S.transform(n,t,{affinity:r});e.current=o,o==null&&e.unref()}}},Gb={transform(e,t){var{current:n,affinity:r}=e;if(n!=null){var o=De.transform(n,t,{affinity:r});e.current=o,o==null&&e.unref()}}},Yb={transform(e,t){var{current:n,affinity:r}=e;if(n!=null){var o=P.transform(n,t,{affinity:r});e.current=o,o==null&&e.unref()}}},xs=new WeakMap,Os=new WeakMap,eo=new WeakMap,Eh=new WeakMap,sl=new WeakMap,al=new WeakMap,il=new WeakMap,S={ancestors(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{reverse:n=!1}=t,r=S.levels(e,t);return n?r=r.slice(1):r=r.slice(0,-1),r},common(e,t){for(var n=[],r=0;r<e.length&&r<t.length;r++){var o=e[r],s=t[r];if(o!==s)break;n.push(o)}return n},compare(e,t){for(var n=Math.min(e.length,t.length),r=0;r<n;r++){if(e[r]<t[r])return-1;if(e[r]>t[r])return 1}return 0},endsAfter(e,t){var n=e.length-1,r=e.slice(0,n),o=t.slice(0,n),s=e[n],a=t[n];return S.equals(r,o)&&s>a},endsAt(e,t){var n=e.length,r=e.slice(0,n),o=t.slice(0,n);return S.equals(r,o)},endsBefore(e,t){var n=e.length-1,r=e.slice(0,n),o=t.slice(0,n),s=e[n],a=t[n];return S.equals(r,o)&&s<a},equals(e,t){return e.length===t.length&&e.every((n,r)=>n===t[r])},hasPrevious(e){return e[e.length-1]>0},isAfter(e,t){return S.compare(e,t)===1},isAncestor(e,t){return e.length<t.length&&S.compare(e,t)===0},isBefore(e,t){return S.compare(e,t)===-1},isChild(e,t){return e.length===t.length+1&&S.compare(e,t)===0},isCommon(e,t){return e.length<=t.length&&S.compare(e,t)===0},isDescendant(e,t){return e.length>t.length&&S.compare(e,t)===0},isParent(e,t){return e.length+1===t.length&&S.compare(e,t)===0},isPath(e){return Array.isArray(e)&&(e.length===0||typeof e[0]=="number")},isSibling(e,t){if(e.length!==t.length)return!1;var n=e.slice(0,-1),r=t.slice(0,-1),o=e[e.length-1],s=t[t.length-1];return o!==s&&S.equals(n,r)},levels(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{reverse:n=!1}=t,r=[],o=0;o<=e.length;o++)r.push(e.slice(0,o));return n&&r.reverse(),r},next(e){if(e.length===0)throw new Error("Cannot get the next path of a root path [".concat(e,"], because it has no next index."));var t=e[e.length-1];return e.slice(0,-1).concat(t+1)},operationCanTransformPath(e){switch(e.type){case"insert_node":case"remove_node":case"merge_node":case"split_node":case"move_node":return!0;default:return!1}},parent(e){if(e.length===0)throw new Error("Cannot get the parent path of the root path [".concat(e,"]."));return e.slice(0,-1)},previous(e){if(e.length===0)throw new Error("Cannot get the previous path of a root path [".concat(e,"], because it has no previous index."));var t=e[e.length-1];if(t<=0)throw new Error("Cannot get the previous path of a first child path [".concat(e,"] because it would result in a negative index."));return e.slice(0,-1).concat(t-1)},relative(e,t){if(!S.isAncestor(t,e)&&!S.equals(e,t))throw new Error("Cannot get the relative path of [".concat(e,"] inside ancestor [").concat(t,"], because it is not above or equal to the path."));return e.slice(t.length)},transform(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!e)return null;var r=[...e],{affinity:o="forward"}=n;if(e.length===0)return r;switch(t.type){case"insert_node":{var{path:s}=t;(S.equals(s,r)||S.endsBefore(s,r)||S.isAncestor(s,r))&&(r[s.length-1]+=1);break}case"remove_node":{var{path:a}=t;if(S.equals(a,r)||S.isAncestor(a,r))return null;S.endsBefore(a,r)&&(r[a.length-1]-=1);break}case"merge_node":{var{path:i,position:u}=t;S.equals(i,r)||S.endsBefore(i,r)?r[i.length-1]-=1:S.isAncestor(i,r)&&(r[i.length-1]-=1,r[i.length]+=u);break}case"split_node":{var{path:c,position:l}=t;if(S.equals(c,r)){if(o==="forward")r[r.length-1]+=1;else if(o!=="backward")return null}else S.endsBefore(c,r)?r[c.length-1]+=1:S.isAncestor(c,r)&&e[c.length]>=l&&(r[c.length-1]+=1,r[c.length]-=l);break}case"move_node":{var{path:d,newPath:m}=t;if(S.equals(d,m))return r;if(S.isAncestor(d,r)||S.equals(d,r)){var g=m.slice();return S.endsBefore(d,m)&&d.length<m.length&&(g[d.length-1]-=1),g.concat(r.slice(d.length))}else S.isSibling(d,m)&&(S.isAncestor(m,r)||S.equals(m,r))?S.endsBefore(d,r)?r[d.length-1]-=1:r[d.length-1]+=1:S.endsBefore(m,r)||S.equals(m,r)||S.isAncestor(m,r)?(S.endsBefore(d,r)&&(r[d.length-1]-=1),r[m.length-1]+=1):S.endsBefore(d,r)&&(S.equals(m,r)&&(r[m.length-1]+=1),r[d.length-1]-=1);break}}return r}};function uo(e){"@babel/helpers - typeof";return uo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},uo(e)}function Xb(e,t){if(uo(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(uo(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Zb(e){var t=Xb(e,"string");return uo(t)==="symbol"?t:String(t)}function rt(e,t,n){return t=Zb(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ul(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Wr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ul(Object(n),!0).forEach(function(r){rt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ul(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Jb=(e,t,n)=>{switch(n.type){case"insert_node":{var{path:r,node:o}=n,s=J.parent(e,r),a=r[r.length-1];if(a>s.children.length)throw new Error('Cannot apply an "insert_node" operation at path ['.concat(r,"] because the destination is past the end of the node."));if(s.children.splice(a,0,o),t)for(var[i,u]of P.points(t))t[u]=De.transform(i,n);break}case"insert_text":{var{path:c,offset:l,text:d}=n;if(d.length===0)break;var m=J.leaf(e,c),g=m.text.slice(0,l),C=m.text.slice(l);if(m.text=g+d+C,t)for(var[v,h]of P.points(t))t[h]=De.transform(v,n);break}case"merge_node":{var{path:E}=n,b=J.get(e,E),w=S.previous(E),D=J.get(e,w),x=J.parent(e,E),I=E[E.length-1];if(ce.isText(b)&&ce.isText(D))D.text+=b.text;else if(!ce.isText(b)&&!ce.isText(D))D.children.push(...b.children);else throw new Error('Cannot apply a "merge_node" operation at path ['.concat(E,"] to nodes of different interfaces: ").concat(Ve.stringify(b)," ").concat(Ve.stringify(D)));if(x.children.splice(I,1),t)for(var[O,F]of P.points(t))t[F]=De.transform(O,n);break}case"move_node":{var{path:H,newPath:N}=n;if(S.isAncestor(H,N))throw new Error("Cannot move a path [".concat(H,"] to new path [").concat(N,"] because the destination is inside itself."));var j=J.get(e,H),B=J.parent(e,H),k=H[H.length-1];B.children.splice(k,1);var M=S.transform(H,n),W=J.get(e,S.parent(M)),re=M[M.length-1];if(W.children.splice(re,0,j),t)for(var[Y,ee]of P.points(t))t[ee]=De.transform(Y,n);break}case"remove_node":{var{path:L}=n,Q=L[L.length-1],V=J.parent(e,L);if(V.children.splice(Q,1),t)for(var[te,se]of P.points(t)){var de=De.transform(te,n);if(t!=null&&de!=null)t[se]=de;else{var G=void 0,R=void 0;for(var[_,U]of J.texts(e))if(S.compare(U,L)===-1)G=[_,U];else{R=[_,U];break}var X=!1;G&&R&&(S.equals(R[1],L)?X=!S.hasPrevious(R[1]):X=S.common(G[1],L).length<S.common(R[1],L).length),G&&!X?(te.path=G[1],te.offset=G[0].text.length):R?(te.path=R[1],te.offset=0):t=null}}break}case"remove_text":{var{path:fe,offset:le,text:T}=n;if(T.length===0)break;var q=J.leaf(e,fe),ne=q.text.slice(0,le),ie=q.text.slice(le+T.length);if(q.text=ne+ie,t)for(var[we,xe]of P.points(t))t[xe]=De.transform(we,n);break}case"set_node":{var{path:ae,properties:Te,newProperties:je}=n;if(ae.length===0)throw new Error("Cannot set properties on the root node!");var he=J.get(e,ae);for(var Ce in je){if(Ce==="children"||Ce==="text")throw new Error('Cannot set the "'.concat(Ce,'" property of nodes!'));var ke=je[Ce];ke==null?delete he[Ce]:he[Ce]=ke}for(var Pe in Te)je.hasOwnProperty(Pe)||delete he[Pe];break}case"set_selection":{var{newProperties:ye}=n;if(ye==null)t=ye;else{if(t==null){if(!P.isRange(ye))throw new Error('Cannot apply an incomplete "set_selection" operation properties '.concat(Ve.stringify(ye)," when there is no current selection."));t=Wr({},ye)}for(var Ee in ye){var Ct=ye[Ee];if(Ct==null){if(Ee==="anchor"||Ee==="focus")throw new Error('Cannot remove the "'.concat(Ee,'" selection property'));delete t[Ee]}else t[Ee]=Ct}}break}case"split_node":{var{path:$e,position:qe,properties:yt}=n;if($e.length===0)throw new Error('Cannot apply a "split_node" operation at path ['.concat($e,"] because the root node cannot be split."));var Je=J.get(e,$e),rr=J.parent(e,$e),cn=$e[$e.length-1],ln;if(ce.isText(Je)){var ga=Je.text.slice(0,qe),Ca=Je.text.slice(qe);Je.text=ga,ln=Wr(Wr({},yt),{},{text:Ca})}else{var ya=Je.children.slice(0,qe),ba=Je.children.slice(qe);Je.children=ya,ln=Wr(Wr({},yt),{},{children:ba})}if(rr.children.splice(cn+1,0,ln),t)for(var[Ea,Da]of P.points(t))t[Da]=De.transform(Ea,n);break}}return t},Qb={transform(e,t){e.children=rl(e.children);var n=e.selection&&rl(e.selection);try{n=Jb(e,n,t)}finally{e.children=ol(e.children),n?e.selection=Kn(n)?ol(n):n:e.selection=null}}},eE={insertNodes(e,t,n){e.insertNodes(t,n)},liftNodes(e,t){e.liftNodes(t)},mergeNodes(e,t){e.mergeNodes(t)},moveNodes(e,t){e.moveNodes(t)},removeNodes(e,t){e.removeNodes(t)},setNodes(e,t,n){e.setNodes(t,n)},splitNodes(e,t){e.splitNodes(t)},unsetNodes(e,t,n){e.unsetNodes(t,n)},unwrapNodes(e,t){e.unwrapNodes(t)},wrapNodes(e,t,n){e.wrapNodes(t,n)}},tE={collapse(e,t){e.collapse(t)},deselect(e){e.deselect()},move(e,t){e.move(t)},select(e,t){e.select(t)},setPoint(e,t,n){e.setPoint(t,n)},setSelection(e,t){e.setSelection(t)}},Dh=(e,t)=>{for(var n in e){var r=e[n],o=t[n];if(ze(r)&&ze(o)){if(!Dh(r,o))return!1}else if(Array.isArray(r)&&Array.isArray(o)){if(r.length!==o.length)return!1;for(var s=0;s<r.length;s++)if(r[s]!==o[s])return!1}else if(r!==o)return!1}for(var a in t)if(e[a]===void 0&&t[a]!==void 0)return!1;return!0};function nE(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,s;for(s=0;s<r.length;s++)o=r[s],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function rn(e,t){if(e==null)return{};var n=nE(e,t),r,o;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(o=0;o<s.length;o++)r=s[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var rE=["anchor","focus"];function cl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function oE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?cl(Object(n),!0).forEach(function(r){rt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cl(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var P={edges(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{reverse:n=!1}=t,{anchor:r,focus:o}=e;return P.isBackward(e)===n?[r,o]:[o,r]},end(e){var[,t]=P.edges(e);return t},equals(e,t){return De.equals(e.anchor,t.anchor)&&De.equals(e.focus,t.focus)},surrounds(e,t){var n=P.intersection(e,t);return n?P.equals(n,t):!1},includes(e,t){if(P.isRange(t)){if(P.includes(e,t.anchor)||P.includes(e,t.focus))return!0;var[n,r]=P.edges(e),[o,s]=P.edges(t);return De.isBefore(n,o)&&De.isAfter(r,s)}var[a,i]=P.edges(e),u=!1,c=!1;return De.isPoint(t)?(u=De.compare(t,a)>=0,c=De.compare(t,i)<=0):(u=S.compare(t,a.path)>=0,c=S.compare(t,i.path)<=0),u&&c},intersection(e,t){var n=rn(e,rE),[r,o]=P.edges(e),[s,a]=P.edges(t),i=De.isBefore(r,s)?s:r,u=De.isBefore(o,a)?o:a;return De.isBefore(u,i)?null:oE({anchor:i,focus:u},n)},isBackward(e){var{anchor:t,focus:n}=e;return De.isAfter(t,n)},isCollapsed(e){var{anchor:t,focus:n}=e;return De.equals(t,n)},isExpanded(e){return!P.isCollapsed(e)},isForward(e){return!P.isBackward(e)},isRange(e){return ze(e)&&De.isPoint(e.anchor)&&De.isPoint(e.focus)},*points(e){yield[e.anchor,"anchor"],yield[e.focus,"focus"]},start(e){var[t]=P.edges(e);return t},transform(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return vu(e,r=>{if(r===null)return null;var{affinity:o="inward"}=n,s,a;if(o==="inward"){var i=P.isCollapsed(r);P.isForward(r)?(s="forward",a=i?s:"backward"):(s="backward",a=i?s:"forward")}else o==="outward"?P.isForward(r)?(s="backward",a="forward"):(s="forward",a="backward"):(s=o,a=o);var u=De.transform(r.anchor,t,{affinity:s}),c=De.transform(r.focus,t,{affinity:a});if(!u||!c)return null;r.anchor=u,r.focus=c})}},ll=e=>ze(e)&&J.isNodeList(e.children)&&!y.isEditor(e),ue={isAncestor(e){return ze(e)&&J.isNodeList(e.children)},isElement:ll,isElementList(e){return Array.isArray(e)&&e.every(t=>ue.isElement(t))},isElementProps(e){return e.children!==void 0},isElementType:function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"type";return ll(t)&&t[r]===n},matches(e,t){for(var n in t)if(n!=="children"&&e[n]!==t[n])return!1;return!0}},sE=["children"],aE=["text"],fl=new WeakMap,J={ancestor(e,t){var n=J.get(e,t);if(ce.isText(n))throw new Error("Cannot get the ancestor node at path [".concat(t,"] because it refers to a text node instead: ").concat(Ve.stringify(n)));return n},ancestors(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return function*(){for(var r of S.ancestors(t,n)){var o=J.ancestor(e,r),s=[o,r];yield s}}()},child(e,t){if(ce.isText(e))throw new Error("Cannot get the child of a text node: ".concat(Ve.stringify(e)));var n=e.children[t];if(n==null)throw new Error("Cannot get child at index `".concat(t,"` in node: ").concat(Ve.stringify(e)));return n},children(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return function*(){for(var{reverse:r=!1}=n,o=J.ancestor(e,t),{children:s}=o,a=r?s.length-1:0;r?a>=0:a<s.length;){var i=J.child(o,a),u=t.concat(a);yield[i,u],a=r?a-1:a+1}}()},common(e,t,n){var r=S.common(t,n),o=J.get(e,r);return[o,r]},descendant(e,t){var n=J.get(e,t);if(y.isEditor(n))throw new Error("Cannot get the descendant node at path [".concat(t,"] because it refers to the root editor node instead: ").concat(Ve.stringify(n)));return n},descendants(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){for(var[n,r]of J.nodes(e,t))r.length!==0&&(yield[n,r])}()},elements(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){for(var[n,r]of J.nodes(e,t))ue.isElement(n)&&(yield[n,r])}()},extractProps(e){if(ue.isAncestor(e)){var t=rn(e,sE);return t}else{var t=rn(e,aE);return t}},first(e,t){for(var n=t.slice(),r=J.get(e,n);r&&!(ce.isText(r)||r.children.length===0);)r=r.children[0],n.push(0);return[r,n]},fragment(e,t){if(ce.isText(e))throw new Error("Cannot get a fragment starting from a root text node: ".concat(Ve.stringify(e)));var n=vu({children:e.children},r=>{var[o,s]=P.edges(t),a=J.nodes(r,{reverse:!0,pass:m=>{var[,g]=m;return!P.includes(t,g)}});for(var[,i]of a){if(!P.includes(t,i)){var u=J.parent(r,i),c=i[i.length-1];u.children.splice(c,1)}if(S.equals(i,s.path)){var l=J.leaf(r,i);l.text=l.text.slice(0,s.offset)}if(S.equals(i,o.path)){var d=J.leaf(r,i);d.text=d.text.slice(o.offset)}}y.isEditor(r)&&(r.selection=null)});return n.children},get(e,t){var n=J.getIf(e,t);if(n===void 0)throw new Error("Cannot find a descendant at path [".concat(t,"] in node: ").concat(Ve.stringify(e)));return n},getIf(e,t){for(var n=e,r=0;r<t.length;r++){var o=t[r];if(ce.isText(n)||!n.children[o])return;n=n.children[o]}return n},has(e,t){for(var n=e,r=0;r<t.length;r++){var o=t[r];if(ce.isText(n)||!n.children[o])return!1;n=n.children[o]}return!0},isNode(e){return ce.isText(e)||ue.isElement(e)||y.isEditor(e)},isNodeList(e){if(!Array.isArray(e))return!1;var t=fl.get(e);if(t!==void 0)return t;var n=e.every(r=>J.isNode(r));return fl.set(e,n),n},last(e,t){for(var n=t.slice(),r=J.get(e,n);r&&!(ce.isText(r)||r.children.length===0);){var o=r.children.length-1;r=r.children[o],n.push(o)}return[r,n]},leaf(e,t){var n=J.get(e,t);if(!ce.isText(n))throw new Error("Cannot get the leaf node at path [".concat(t,"] because it refers to a non-leaf node: ").concat(Ve.stringify(n)));return n},levels(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return function*(){for(var r of S.levels(t,n)){var o=J.get(e,r);yield[o,r]}}()},matches(e,t){return ue.isElement(e)&&ue.isElementProps(t)&&ue.matches(e,t)||ce.isText(e)&&ce.isTextProps(t)&&ce.matches(e,t)},nodes(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){for(var{pass:n,reverse:r=!1}=t,{from:o=[],to:s}=t,a=new Set,i=[],u=e;!(s&&(r?S.isBefore(i,s):S.isAfter(i,s)));){if(a.has(u)||(yield[u,i]),!a.has(u)&&!ce.isText(u)&&u.children.length!==0&&(n==null||n([u,i])===!1)){a.add(u);var c=r?u.children.length-1:0;S.isAncestor(i,o)&&(c=o[i.length]),i=i.concat(c),u=J.get(e,i);continue}if(i.length===0)break;if(!r){var l=S.next(i);if(J.has(e,l)){i=l,u=J.get(e,i);continue}}if(r&&i[i.length-1]!==0){var d=S.previous(i);i=d,u=J.get(e,i);continue}i=S.parent(i),u=J.get(e,i),a.add(u)}}()},parent(e,t){var n=S.parent(t),r=J.get(e,n);if(ce.isText(r))throw new Error("Cannot get the parent of path [".concat(t,"] because it does not exist in the root."));return r},string(e){return ce.isText(e)?e.text:e.children.map(J.string).join("")},texts(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){for(var[n,r]of J.nodes(e,t))ce.isText(n)&&(yield[n,r])}()}};function dl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Me(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?dl(Object(n),!0).forEach(function(r){rt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dl(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var yn={isNodeOperation(e){return yn.isOperation(e)&&e.type.endsWith("_node")},isOperation(e){if(!ze(e))return!1;switch(e.type){case"insert_node":return S.isPath(e.path)&&J.isNode(e.node);case"insert_text":return typeof e.offset=="number"&&typeof e.text=="string"&&S.isPath(e.path);case"merge_node":return typeof e.position=="number"&&S.isPath(e.path)&&ze(e.properties);case"move_node":return S.isPath(e.path)&&S.isPath(e.newPath);case"remove_node":return S.isPath(e.path)&&J.isNode(e.node);case"remove_text":return typeof e.offset=="number"&&typeof e.text=="string"&&S.isPath(e.path);case"set_node":return S.isPath(e.path)&&ze(e.properties)&&ze(e.newProperties);case"set_selection":return e.properties===null&&P.isRange(e.newProperties)||e.newProperties===null&&P.isRange(e.properties)||ze(e.properties)&&ze(e.newProperties);case"split_node":return S.isPath(e.path)&&typeof e.position=="number"&&ze(e.properties);default:return!1}},isOperationList(e){return Array.isArray(e)&&e.every(t=>yn.isOperation(t))},isSelectionOperation(e){return yn.isOperation(e)&&e.type.endsWith("_selection")},isTextOperation(e){return yn.isOperation(e)&&e.type.endsWith("_text")},inverse(e){switch(e.type){case"insert_node":return Me(Me({},e),{},{type:"remove_node"});case"insert_text":return Me(Me({},e),{},{type:"remove_text"});case"merge_node":return Me(Me({},e),{},{type:"split_node",path:S.previous(e.path)});case"move_node":{var{newPath:t,path:n}=e;if(S.equals(t,n))return e;if(S.isSibling(n,t))return Me(Me({},e),{},{path:t,newPath:n});var r=S.transform(n,e),o=S.transform(S.next(n),e);return Me(Me({},e),{},{path:r,newPath:o})}case"remove_node":return Me(Me({},e),{},{type:"insert_node"});case"remove_text":return Me(Me({},e),{},{type:"insert_text"});case"set_node":{var{properties:s,newProperties:a}=e;return Me(Me({},e),{},{properties:a,newProperties:s})}case"set_selection":{var{properties:i,newProperties:u}=e;return i==null?Me(Me({},e),{},{properties:u,newProperties:null}):u==null?Me(Me({},e),{},{properties:null,newProperties:i}):Me(Me({},e),{},{properties:u,newProperties:i})}case"split_node":return Me(Me({},e),{},{type:"merge_node",path:S.next(e.path)})}}},hl=new WeakMap,iE=e=>{var t=hl.get(e);if(t!==void 0)return t;if(!ze(e))return!1;var n=typeof e.addMark=="function"&&typeof e.apply=="function"&&typeof e.deleteFragment=="function"&&typeof e.insertBreak=="function"&&typeof e.insertSoftBreak=="function"&&typeof e.insertFragment=="function"&&typeof e.insertNode=="function"&&typeof e.insertText=="function"&&typeof e.isElementReadOnly=="function"&&typeof e.isInline=="function"&&typeof e.isSelectable=="function"&&typeof e.isVoid=="function"&&typeof e.normalizeNode=="function"&&typeof e.onChange=="function"&&typeof e.removeMark=="function"&&typeof e.getDirtyPaths=="function"&&(e.marks===null||ze(e.marks))&&(e.selection===null||P.isRange(e.selection))&&J.isNodeList(e.children)&&yn.isOperationList(e.operations);return hl.set(e,n),n},y={above(e,t){return e.above(t)},addMark(e,t,n){e.addMark(t,n)},after(e,t,n){return e.after(t,n)},before(e,t,n){return e.before(t,n)},deleteBackward(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{unit:n="character"}=t;e.deleteBackward(n)},deleteForward(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{unit:n="character"}=t;e.deleteForward(n)},deleteFragment(e,t){e.deleteFragment(t)},edges(e,t){return e.edges(t)},elementReadOnly(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return e.elementReadOnly(t)},end(e,t){return e.end(t)},first(e,t){return e.first(t)},fragment(e,t){return e.fragment(t)},hasBlocks(e,t){return e.hasBlocks(t)},hasInlines(e,t){return e.hasInlines(t)},hasPath(e,t){return e.hasPath(t)},hasTexts(e,t){return e.hasTexts(t)},insertBreak(e){e.insertBreak()},insertFragment(e,t,n){e.insertFragment(t,n)},insertNode(e,t){e.insertNode(t)},insertSoftBreak(e){e.insertSoftBreak()},insertText(e,t){e.insertText(t)},isBlock(e,t){return e.isBlock(t)},isEdge(e,t,n){return e.isEdge(t,n)},isEditor(e){return iE(e)},isElementReadOnly(e,t){return e.isElementReadOnly(t)},isEmpty(e,t){return e.isEmpty(t)},isEnd(e,t,n){return e.isEnd(t,n)},isInline(e,t){return e.isInline(t)},isNormalizing(e){return e.isNormalizing()},isSelectable(e,t){return e.isSelectable(t)},isStart(e,t,n){return e.isStart(t,n)},isVoid(e,t){return e.isVoid(t)},last(e,t){return e.last(t)},leaf(e,t,n){return e.leaf(t,n)},levels(e,t){return e.levels(t)},marks(e){return e.getMarks()},next(e,t){return e.next(t)},node(e,t,n){return e.node(t,n)},nodes(e,t){return e.nodes(t)},normalize(e,t){e.normalize(t)},parent(e,t,n){return e.parent(t,n)},path(e,t,n){return e.path(t,n)},pathRef(e,t,n){return e.pathRef(t,n)},pathRefs(e){return e.pathRefs()},point(e,t,n){return e.point(t,n)},pointRef(e,t,n){return e.pointRef(t,n)},pointRefs(e){return e.pointRefs()},positions(e,t){return e.positions(t)},previous(e,t){return e.previous(t)},range(e,t,n){return e.range(t,n)},rangeRef(e,t,n){return e.rangeRef(t,n)},rangeRefs(e){return e.rangeRefs()},removeMark(e,t){e.removeMark(t)},setNormalizing(e,t){e.setNormalizing(t)},start(e,t){return e.start(t)},string(e,t,n){return e.string(t,n)},unhangRange(e,t,n){return e.unhangRange(t,n)},void(e,t){return e.void(t)},withoutNormalizing(e,t){e.withoutNormalizing(t)},shouldMergeNodesRemovePrevNode:(e,t,n)=>e.shouldMergeNodesRemovePrevNode(t,n)},uE={isSpan(e){return Array.isArray(e)&&e.length===2&&e.every(S.isPath)}};function pl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function ml(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pl(Object(n),!0).forEach(function(r){rt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pl(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var De={compare(e,t){var n=S.compare(e.path,t.path);return n===0?e.offset<t.offset?-1:e.offset>t.offset?1:0:n},isAfter(e,t){return De.compare(e,t)===1},isBefore(e,t){return De.compare(e,t)===-1},equals(e,t){return e.offset===t.offset&&S.equals(e.path,t.path)},isPoint(e){return ze(e)&&typeof e.offset=="number"&&S.isPath(e.path)},transform(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return vu(e,r=>{if(r===null)return null;var{affinity:o="forward"}=n,{path:s,offset:a}=r;switch(t.type){case"insert_node":case"move_node":{r.path=S.transform(s,t,n);break}case"insert_text":{S.equals(t.path,s)&&(t.offset<a||t.offset===a&&o==="forward")&&(r.offset+=t.text.length);break}case"merge_node":{S.equals(t.path,s)&&(r.offset+=t.position),r.path=S.transform(s,t,n);break}case"remove_text":{S.equals(t.path,s)&&t.offset<=a&&(r.offset-=Math.min(a-t.offset,t.text.length));break}case"remove_node":{if(S.equals(t.path,s)||S.isAncestor(t.path,s))return null;r.path=S.transform(s,t,n);break}case"split_node":{if(S.equals(t.path,s)){if(t.position===a&&o==null)return null;(t.position<a||t.position===a&&o==="forward")&&(r.offset-=t.position,r.path=S.transform(s,t,ml(ml({},n),{},{affinity:"forward"})))}else r.path=S.transform(s,t,n);break}}})}},vl=void 0,Ve={setScrubber(e){vl=e},stringify(e){return JSON.stringify(e,vl)}},cE=["text"],lE=["anchor","focus"];function gl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Xt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gl(Object(n),!0).forEach(function(r){rt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gl(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var ce={equals(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{loose:r=!1}=n;function o(s){var a=rn(s,cE);return a}return Dh(r?o(e):e,r?o(t):t)},isText(e){return ze(e)&&typeof e.text=="string"},isTextList(e){return Array.isArray(e)&&e.every(t=>ce.isText(t))},isTextProps(e){return e.text!==void 0},matches(e,t){for(var n in t)if(n!=="text"&&(!e.hasOwnProperty(n)||e[n]!==t[n]))return!1;return!0},decorations(e,t){var n=[Xt({},e)];for(var r of t){var o=rn(r,lE),[s,a]=P.edges(r),i=[],u=0,c=s.offset,l=a.offset;for(var d of n){var{length:m}=d.text,g=u;if(u+=m,c<=g&&u<=l){Object.assign(d,o),i.push(d);continue}if(c!==l&&(c===u||l===g)||c>u||l<g||l===g&&g!==0){i.push(d);continue}var C=d,v=void 0,h=void 0;if(l<u){var E=l-g;h=Xt(Xt({},C),{},{text:C.text.slice(E)}),C=Xt(Xt({},C),{},{text:C.text.slice(0,E)})}if(c>g){var b=c-g;v=Xt(Xt({},C),{},{text:C.text.slice(0,b)}),C=Xt(Xt({},C),{},{text:C.text.slice(b)})}Object.assign(C,o),v&&i.push(v),i.push(C),h&&i.push(h)}n=i}return n}},gu=e=>e.selection?e.selection:e.children.length>0?y.end(e,[]):[0],_r=(e,t)=>{var[n]=y.node(e,t);return r=>r===n},Cu=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=!n,o=n?vE(t):t,s=ge.None,a=ge.None,i=0,u=null,c=null;for(var l of o){var d=l.codePointAt(0);if(!d)break;var m=TE(l,d);if([s,a]=r?[a,m]:[m,s],pr(s,ge.ZWJ)&&pr(a,ge.ExtPict)&&(r?u=Cl(t.substring(0,i)):u=Cl(t.substring(0,t.length-i)),!u)||pr(s,ge.RI)&&pr(a,ge.RI)&&(c!==null?c=!c:r?c=!0:c=PE(t.substring(0,t.length-i)),!c)||s!==ge.None&&a!==ge.None&&IE(s,a))break;i+=l.length}return i||1},fE=/\s/,dE=/[\u002B\u0021-\u0023\u0025-\u002A\u002C-\u002F\u003A\u003B\u003F\u0040\u005B-\u005D\u005F\u007B\u007D\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E3B\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/,hE=/['\u2018\u2019]/,pE=function(t){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=0,o=!1;t.length>0;){var s=Cu(t,n),[a,i]=yu(t,s,n);if(mE(a,i,n))o=!0,r+=s;else if(!o)r+=s;else break;t=i}return r},yu=(e,t,n)=>{if(n){var r=e.length-t;return[e.slice(r,e.length),e.slice(0,r)]}return[e.slice(0,t),e.slice(t)]},mE=function e(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(fE.test(t))return!1;if(hE.test(t)){var o=Cu(n,r),[s,a]=yu(n,o,r);if(e(s,a,r))return!0}return!dE.test(t)},vE=function*(t){for(var n=t.length-1,r=0;r<t.length;r++){var o=t.charAt(n-r);if(CE(o.charCodeAt(0))){var s=t.charAt(n-r-1);if(gE(s.charCodeAt(0))){yield s+o,r++;continue}}yield o}},gE=e=>e>=55296&&e<=56319,CE=e=>e>=56320&&e<=57343,ge;(function(e){e[e.None=0]="None",e[e.Extend=1]="Extend",e[e.ZWJ=2]="ZWJ",e[e.RI=4]="RI",e[e.Prepend=8]="Prepend",e[e.SpacingMark=16]="SpacingMark",e[e.L=32]="L",e[e.V=64]="V",e[e.T=128]="T",e[e.LV=256]="LV",e[e.LVT=512]="LVT",e[e.ExtPict=1024]="ExtPict",e[e.Any=2048]="Any"})(ge||(ge={}));var yE=/^(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09BE\u09C1-\u09C4\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3E\u0B3F\u0B41-\u0B44\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE\u0BC0\u0BCD\u0BD7\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC2\u0CC6\u0CCC\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D3E\u0D41-\u0D44\u0D4D\u0D57\u0D62\u0D63\u0D81\u0DCA\u0DCF\u0DD2-\u0DD4\u0DD6\u0DDF\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200C\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC01\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDE41\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF3E\uDF40\uDF57\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB0\uDCB3-\uDCB8\uDCBA\uDCBD\uDCBF\uDCC0\uDCC2\uDCC3\uDDAF\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD30\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4\uDF00\uDF01\uDF36-\uDF3A\uDF40\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65\uDD67-\uDD69\uDD6E-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF])$/,bE=/^(?:[\u0600-\u0605\u06DD\u070F\u0890\u0891\u08E2\u0D4E]|\uD804[\uDCBD\uDCCD\uDDC2\uDDC3]|\uD806[\uDD3F\uDD41\uDE3A\uDE84-\uDE89]|\uD807\uDD46)$/,EE=/^(?:[\u0903\u093B\u093E-\u0940\u0949-\u094C\u094E\u094F\u0982\u0983\u09BF\u09C0\u09C7\u09C8\u09CB\u09CC\u0A03\u0A3E-\u0A40\u0A83\u0ABE-\u0AC0\u0AC9\u0ACB\u0ACC\u0B02\u0B03\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0C01-\u0C03\u0C41-\u0C44\u0C82\u0C83\u0CBE\u0CC0\u0CC1\u0CC3\u0CC4\u0CC7\u0CC8\u0CCA\u0CCB\u0D02\u0D03\u0D3F\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D82\u0D83\u0DD0\u0DD1\u0DD8-\u0DDE\u0DF2\u0DF3\u0E33\u0EB3\u0F3E\u0F3F\u0F7F\u1031\u103B\u103C\u1056\u1057\u1084\u1715\u1734\u17B6\u17BE-\u17C5\u17C7\u17C8\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1A19\u1A1A\u1A55\u1A57\u1A6D-\u1A72\u1B04\u1B3B\u1B3D-\u1B41\u1B43\u1B44\u1B82\u1BA1\u1BA6\u1BA7\u1BAA\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1C24-\u1C2B\u1C34\u1C35\u1CE1\u1CF7\uA823\uA824\uA827\uA880\uA881\uA8B4-\uA8C3\uA952\uA953\uA983\uA9B4\uA9B5\uA9BA\uA9BB\uA9BE-\uA9C0\uAA2F\uAA30\uAA33\uAA34\uAA4D\uAAEB\uAAEE\uAAEF\uAAF5\uABE3\uABE4\uABE6\uABE7\uABE9\uABEA\uABEC]|\uD804[\uDC00\uDC02\uDC82\uDCB0-\uDCB2\uDCB7\uDCB8\uDD2C\uDD45\uDD46\uDD82\uDDB3-\uDDB5\uDDBF\uDDC0\uDDCE\uDE2C-\uDE2E\uDE32\uDE33\uDE35\uDEE0-\uDEE2\uDF02\uDF03\uDF3F\uDF41-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF62\uDF63]|\uD805[\uDC35-\uDC37\uDC40\uDC41\uDC45\uDCB1\uDCB2\uDCB9\uDCBB\uDCBC\uDCBE\uDCC1\uDDB0\uDDB1\uDDB8-\uDDBB\uDDBE\uDE30-\uDE32\uDE3B\uDE3C\uDE3E\uDEAC\uDEAE\uDEAF\uDEB6\uDF26]|\uD806[\uDC2C-\uDC2E\uDC38\uDD31-\uDD35\uDD37\uDD38\uDD3D\uDD40\uDD42\uDDD1-\uDDD3\uDDDC-\uDDDF\uDDE4\uDE39\uDE57\uDE58\uDE97]|\uD807[\uDC2F\uDC3E\uDCA9\uDCB1\uDCB4\uDD8A-\uDD8E\uDD93\uDD94\uDD96\uDEF5\uDEF6]|\uD81B[\uDF51-\uDF87\uDFF0\uDFF1]|\uD834[\uDD66\uDD6D])$/,DE=/^[\u1100-\u115F\uA960-\uA97C]$/,wE=/^[\u1160-\u11A7\uD7B0-\uD7C6]$/,AE=/^[\u11A8-\u11FF\uD7CB-\uD7FB]$/,xE=/^[\uAC00\uAC1C\uAC38\uAC54\uAC70\uAC8C\uACA8\uACC4\uACE0\uACFC\uAD18\uAD34\uAD50\uAD6C\uAD88\uADA4\uADC0\uADDC\uADF8\uAE14\uAE30\uAE4C\uAE68\uAE84\uAEA0\uAEBC\uAED8\uAEF4\uAF10\uAF2C\uAF48\uAF64\uAF80\uAF9C\uAFB8\uAFD4\uAFF0\uB00C\uB028\uB044\uB060\uB07C\uB098\uB0B4\uB0D0\uB0EC\uB108\uB124\uB140\uB15C\uB178\uB194\uB1B0\uB1CC\uB1E8\uB204\uB220\uB23C\uB258\uB274\uB290\uB2AC\uB2C8\uB2E4\uB300\uB31C\uB338\uB354\uB370\uB38C\uB3A8\uB3C4\uB3E0\uB3FC\uB418\uB434\uB450\uB46C\uB488\uB4A4\uB4C0\uB4DC\uB4F8\uB514\uB530\uB54C\uB568\uB584\uB5A0\uB5BC\uB5D8\uB5F4\uB610\uB62C\uB648\uB664\uB680\uB69C\uB6B8\uB6D4\uB6F0\uB70C\uB728\uB744\uB760\uB77C\uB798\uB7B4\uB7D0\uB7EC\uB808\uB824\uB840\uB85C\uB878\uB894\uB8B0\uB8CC\uB8E8\uB904\uB920\uB93C\uB958\uB974\uB990\uB9AC\uB9C8\uB9E4\uBA00\uBA1C\uBA38\uBA54\uBA70\uBA8C\uBAA8\uBAC4\uBAE0\uBAFC\uBB18\uBB34\uBB50\uBB6C\uBB88\uBBA4\uBBC0\uBBDC\uBBF8\uBC14\uBC30\uBC4C\uBC68\uBC84\uBCA0\uBCBC\uBCD8\uBCF4\uBD10\uBD2C\uBD48\uBD64\uBD80\uBD9C\uBDB8\uBDD4\uBDF0\uBE0C\uBE28\uBE44\uBE60\uBE7C\uBE98\uBEB4\uBED0\uBEEC\uBF08\uBF24\uBF40\uBF5C\uBF78\uBF94\uBFB0\uBFCC\uBFE8\uC004\uC020\uC03C\uC058\uC074\uC090\uC0AC\uC0C8\uC0E4\uC100\uC11C\uC138\uC154\uC170\uC18C\uC1A8\uC1C4\uC1E0\uC1FC\uC218\uC234\uC250\uC26C\uC288\uC2A4\uC2C0\uC2DC\uC2F8\uC314\uC330\uC34C\uC368\uC384\uC3A0\uC3BC\uC3D8\uC3F4\uC410\uC42C\uC448\uC464\uC480\uC49C\uC4B8\uC4D4\uC4F0\uC50C\uC528\uC544\uC560\uC57C\uC598\uC5B4\uC5D0\uC5EC\uC608\uC624\uC640\uC65C\uC678\uC694\uC6B0\uC6CC\uC6E8\uC704\uC720\uC73C\uC758\uC774\uC790\uC7AC\uC7C8\uC7E4\uC800\uC81C\uC838\uC854\uC870\uC88C\uC8A8\uC8C4\uC8E0\uC8FC\uC918\uC934\uC950\uC96C\uC988\uC9A4\uC9C0\uC9DC\uC9F8\uCA14\uCA30\uCA4C\uCA68\uCA84\uCAA0\uCABC\uCAD8\uCAF4\uCB10\uCB2C\uCB48\uCB64\uCB80\uCB9C\uCBB8\uCBD4\uCBF0\uCC0C\uCC28\uCC44\uCC60\uCC7C\uCC98\uCCB4\uCCD0\uCCEC\uCD08\uCD24\uCD40\uCD5C\uCD78\uCD94\uCDB0\uCDCC\uCDE8\uCE04\uCE20\uCE3C\uCE58\uCE74\uCE90\uCEAC\uCEC8\uCEE4\uCF00\uCF1C\uCF38\uCF54\uCF70\uCF8C\uCFA8\uCFC4\uCFE0\uCFFC\uD018\uD034\uD050\uD06C\uD088\uD0A4\uD0C0\uD0DC\uD0F8\uD114\uD130\uD14C\uD168\uD184\uD1A0\uD1BC\uD1D8\uD1F4\uD210\uD22C\uD248\uD264\uD280\uD29C\uD2B8\uD2D4\uD2F0\uD30C\uD328\uD344\uD360\uD37C\uD398\uD3B4\uD3D0\uD3EC\uD408\uD424\uD440\uD45C\uD478\uD494\uD4B0\uD4CC\uD4E8\uD504\uD520\uD53C\uD558\uD574\uD590\uD5AC\uD5C8\uD5E4\uD600\uD61C\uD638\uD654\uD670\uD68C\uD6A8\uD6C4\uD6E0\uD6FC\uD718\uD734\uD750\uD76C\uD788]$/,OE=/^[\uAC01-\uAC1B\uAC1D-\uAC37\uAC39-\uAC53\uAC55-\uAC6F\uAC71-\uAC8B\uAC8D-\uACA7\uACA9-\uACC3\uACC5-\uACDF\uACE1-\uACFB\uACFD-\uAD17\uAD19-\uAD33\uAD35-\uAD4F\uAD51-\uAD6B\uAD6D-\uAD87\uAD89-\uADA3\uADA5-\uADBF\uADC1-\uADDB\uADDD-\uADF7\uADF9-\uAE13\uAE15-\uAE2F\uAE31-\uAE4B\uAE4D-\uAE67\uAE69-\uAE83\uAE85-\uAE9F\uAEA1-\uAEBB\uAEBD-\uAED7\uAED9-\uAEF3\uAEF5-\uAF0F\uAF11-\uAF2B\uAF2D-\uAF47\uAF49-\uAF63\uAF65-\uAF7F\uAF81-\uAF9B\uAF9D-\uAFB7\uAFB9-\uAFD3\uAFD5-\uAFEF\uAFF1-\uB00B\uB00D-\uB027\uB029-\uB043\uB045-\uB05F\uB061-\uB07B\uB07D-\uB097\uB099-\uB0B3\uB0B5-\uB0CF\uB0D1-\uB0EB\uB0ED-\uB107\uB109-\uB123\uB125-\uB13F\uB141-\uB15B\uB15D-\uB177\uB179-\uB193\uB195-\uB1AF\uB1B1-\uB1CB\uB1CD-\uB1E7\uB1E9-\uB203\uB205-\uB21F\uB221-\uB23B\uB23D-\uB257\uB259-\uB273\uB275-\uB28F\uB291-\uB2AB\uB2AD-\uB2C7\uB2C9-\uB2E3\uB2E5-\uB2FF\uB301-\uB31B\uB31D-\uB337\uB339-\uB353\uB355-\uB36F\uB371-\uB38B\uB38D-\uB3A7\uB3A9-\uB3C3\uB3C5-\uB3DF\uB3E1-\uB3FB\uB3FD-\uB417\uB419-\uB433\uB435-\uB44F\uB451-\uB46B\uB46D-\uB487\uB489-\uB4A3\uB4A5-\uB4BF\uB4C1-\uB4DB\uB4DD-\uB4F7\uB4F9-\uB513\uB515-\uB52F\uB531-\uB54B\uB54D-\uB567\uB569-\uB583\uB585-\uB59F\uB5A1-\uB5BB\uB5BD-\uB5D7\uB5D9-\uB5F3\uB5F5-\uB60F\uB611-\uB62B\uB62D-\uB647\uB649-\uB663\uB665-\uB67F\uB681-\uB69B\uB69D-\uB6B7\uB6B9-\uB6D3\uB6D5-\uB6EF\uB6F1-\uB70B\uB70D-\uB727\uB729-\uB743\uB745-\uB75F\uB761-\uB77B\uB77D-\uB797\uB799-\uB7B3\uB7B5-\uB7CF\uB7D1-\uB7EB\uB7ED-\uB807\uB809-\uB823\uB825-\uB83F\uB841-\uB85B\uB85D-\uB877\uB879-\uB893\uB895-\uB8AF\uB8B1-\uB8CB\uB8CD-\uB8E7\uB8E9-\uB903\uB905-\uB91F\uB921-\uB93B\uB93D-\uB957\uB959-\uB973\uB975-\uB98F\uB991-\uB9AB\uB9AD-\uB9C7\uB9C9-\uB9E3\uB9E5-\uB9FF\uBA01-\uBA1B\uBA1D-\uBA37\uBA39-\uBA53\uBA55-\uBA6F\uBA71-\uBA8B\uBA8D-\uBAA7\uBAA9-\uBAC3\uBAC5-\uBADF\uBAE1-\uBAFB\uBAFD-\uBB17\uBB19-\uBB33\uBB35-\uBB4F\uBB51-\uBB6B\uBB6D-\uBB87\uBB89-\uBBA3\uBBA5-\uBBBF\uBBC1-\uBBDB\uBBDD-\uBBF7\uBBF9-\uBC13\uBC15-\uBC2F\uBC31-\uBC4B\uBC4D-\uBC67\uBC69-\uBC83\uBC85-\uBC9F\uBCA1-\uBCBB\uBCBD-\uBCD7\uBCD9-\uBCF3\uBCF5-\uBD0F\uBD11-\uBD2B\uBD2D-\uBD47\uBD49-\uBD63\uBD65-\uBD7F\uBD81-\uBD9B\uBD9D-\uBDB7\uBDB9-\uBDD3\uBDD5-\uBDEF\uBDF1-\uBE0B\uBE0D-\uBE27\uBE29-\uBE43\uBE45-\uBE5F\uBE61-\uBE7B\uBE7D-\uBE97\uBE99-\uBEB3\uBEB5-\uBECF\uBED1-\uBEEB\uBEED-\uBF07\uBF09-\uBF23\uBF25-\uBF3F\uBF41-\uBF5B\uBF5D-\uBF77\uBF79-\uBF93\uBF95-\uBFAF\uBFB1-\uBFCB\uBFCD-\uBFE7\uBFE9-\uC003\uC005-\uC01F\uC021-\uC03B\uC03D-\uC057\uC059-\uC073\uC075-\uC08F\uC091-\uC0AB\uC0AD-\uC0C7\uC0C9-\uC0E3\uC0E5-\uC0FF\uC101-\uC11B\uC11D-\uC137\uC139-\uC153\uC155-\uC16F\uC171-\uC18B\uC18D-\uC1A7\uC1A9-\uC1C3\uC1C5-\uC1DF\uC1E1-\uC1FB\uC1FD-\uC217\uC219-\uC233\uC235-\uC24F\uC251-\uC26B\uC26D-\uC287\uC289-\uC2A3\uC2A5-\uC2BF\uC2C1-\uC2DB\uC2DD-\uC2F7\uC2F9-\uC313\uC315-\uC32F\uC331-\uC34B\uC34D-\uC367\uC369-\uC383\uC385-\uC39F\uC3A1-\uC3BB\uC3BD-\uC3D7\uC3D9-\uC3F3\uC3F5-\uC40F\uC411-\uC42B\uC42D-\uC447\uC449-\uC463\uC465-\uC47F\uC481-\uC49B\uC49D-\uC4B7\uC4B9-\uC4D3\uC4D5-\uC4EF\uC4F1-\uC50B\uC50D-\uC527\uC529-\uC543\uC545-\uC55F\uC561-\uC57B\uC57D-\uC597\uC599-\uC5B3\uC5B5-\uC5CF\uC5D1-\uC5EB\uC5ED-\uC607\uC609-\uC623\uC625-\uC63F\uC641-\uC65B\uC65D-\uC677\uC679-\uC693\uC695-\uC6AF\uC6B1-\uC6CB\uC6CD-\uC6E7\uC6E9-\uC703\uC705-\uC71F\uC721-\uC73B\uC73D-\uC757\uC759-\uC773\uC775-\uC78F\uC791-\uC7AB\uC7AD-\uC7C7\uC7C9-\uC7E3\uC7E5-\uC7FF\uC801-\uC81B\uC81D-\uC837\uC839-\uC853\uC855-\uC86F\uC871-\uC88B\uC88D-\uC8A7\uC8A9-\uC8C3\uC8C5-\uC8DF\uC8E1-\uC8FB\uC8FD-\uC917\uC919-\uC933\uC935-\uC94F\uC951-\uC96B\uC96D-\uC987\uC989-\uC9A3\uC9A5-\uC9BF\uC9C1-\uC9DB\uC9DD-\uC9F7\uC9F9-\uCA13\uCA15-\uCA2F\uCA31-\uCA4B\uCA4D-\uCA67\uCA69-\uCA83\uCA85-\uCA9F\uCAA1-\uCABB\uCABD-\uCAD7\uCAD9-\uCAF3\uCAF5-\uCB0F\uCB11-\uCB2B\uCB2D-\uCB47\uCB49-\uCB63\uCB65-\uCB7F\uCB81-\uCB9B\uCB9D-\uCBB7\uCBB9-\uCBD3\uCBD5-\uCBEF\uCBF1-\uCC0B\uCC0D-\uCC27\uCC29-\uCC43\uCC45-\uCC5F\uCC61-\uCC7B\uCC7D-\uCC97\uCC99-\uCCB3\uCCB5-\uCCCF\uCCD1-\uCCEB\uCCED-\uCD07\uCD09-\uCD23\uCD25-\uCD3F\uCD41-\uCD5B\uCD5D-\uCD77\uCD79-\uCD93\uCD95-\uCDAF\uCDB1-\uCDCB\uCDCD-\uCDE7\uCDE9-\uCE03\uCE05-\uCE1F\uCE21-\uCE3B\uCE3D-\uCE57\uCE59-\uCE73\uCE75-\uCE8F\uCE91-\uCEAB\uCEAD-\uCEC7\uCEC9-\uCEE3\uCEE5-\uCEFF\uCF01-\uCF1B\uCF1D-\uCF37\uCF39-\uCF53\uCF55-\uCF6F\uCF71-\uCF8B\uCF8D-\uCFA7\uCFA9-\uCFC3\uCFC5-\uCFDF\uCFE1-\uCFFB\uCFFD-\uD017\uD019-\uD033\uD035-\uD04F\uD051-\uD06B\uD06D-\uD087\uD089-\uD0A3\uD0A5-\uD0BF\uD0C1-\uD0DB\uD0DD-\uD0F7\uD0F9-\uD113\uD115-\uD12F\uD131-\uD14B\uD14D-\uD167\uD169-\uD183\uD185-\uD19F\uD1A1-\uD1BB\uD1BD-\uD1D7\uD1D9-\uD1F3\uD1F5-\uD20F\uD211-\uD22B\uD22D-\uD247\uD249-\uD263\uD265-\uD27F\uD281-\uD29B\uD29D-\uD2B7\uD2B9-\uD2D3\uD2D5-\uD2EF\uD2F1-\uD30B\uD30D-\uD327\uD329-\uD343\uD345-\uD35F\uD361-\uD37B\uD37D-\uD397\uD399-\uD3B3\uD3B5-\uD3CF\uD3D1-\uD3EB\uD3ED-\uD407\uD409-\uD423\uD425-\uD43F\uD441-\uD45B\uD45D-\uD477\uD479-\uD493\uD495-\uD4AF\uD4B1-\uD4CB\uD4CD-\uD4E7\uD4E9-\uD503\uD505-\uD51F\uD521-\uD53B\uD53D-\uD557\uD559-\uD573\uD575-\uD58F\uD591-\uD5AB\uD5AD-\uD5C7\uD5C9-\uD5E3\uD5E5-\uD5FF\uD601-\uD61B\uD61D-\uD637\uD639-\uD653\uD655-\uD66F\uD671-\uD68B\uD68D-\uD6A7\uD6A9-\uD6C3\uD6C5-\uD6DF\uD6E1-\uD6FB\uD6FD-\uD717\uD719-\uD733\uD735-\uD74F\uD751-\uD76B\uD76D-\uD787\uD789-\uD7A3]$/,SE=/^(?:[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u2388\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2605\u2607-\u2612\u2614-\u2685\u2690-\u2705\u2708-\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763-\u2767\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC00-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDAD-\uDDE5\uDE01-\uDE0F\uDE1A\uDE2F\uDE32-\uDE3A\uDE3C-\uDE3F\uDE49-\uDFFA]|\uD83D[\uDC00-\uDD3D\uDD46-\uDE4F\uDE80-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDEFF]|\uD83F[\uDC00-\uDFFD])$/,TE=(e,t)=>{var n=ge.Any;return e.search(yE)!==-1&&(n|=ge.Extend),t===8205&&(n|=ge.ZWJ),t>=127462&&t<=127487&&(n|=ge.RI),e.search(bE)!==-1&&(n|=ge.Prepend),e.search(EE)!==-1&&(n|=ge.SpacingMark),e.search(DE)!==-1&&(n|=ge.L),e.search(wE)!==-1&&(n|=ge.V),e.search(AE)!==-1&&(n|=ge.T),e.search(xE)!==-1&&(n|=ge.LV),e.search(OE)!==-1&&(n|=ge.LVT),e.search(SE)!==-1&&(n|=ge.ExtPict),n};function pr(e,t){return(e&t)!==0}var RE=[[ge.L,ge.L|ge.V|ge.LV|ge.LVT],[ge.LV|ge.V,ge.V|ge.T],[ge.LVT|ge.T,ge.T],[ge.Any,ge.Extend|ge.ZWJ],[ge.Any,ge.SpacingMark],[ge.Prepend,ge.Any],[ge.ZWJ,ge.ExtPict],[ge.RI,ge.RI]];function IE(e,t){return RE.findIndex(n=>pr(e,n[0])&&pr(t,n[1]))===-1}var BE=/(?:[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u2388\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2605\u2607-\u2612\u2614-\u2685\u2690-\u2705\u2708-\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763-\u2767\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC00-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDAD-\uDDE5\uDE01-\uDE0F\uDE1A\uDE2F\uDE32-\uDE3A\uDE3C-\uDE3F\uDE49-\uDFFA]|\uD83D[\uDC00-\uDD3D\uDD46-\uDE4F\uDE80-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDEFF]|\uD83F[\uDC00-\uDFFD])(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09BE\u09C1-\u09C4\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3E\u0B3F\u0B41-\u0B44\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE\u0BC0\u0BCD\u0BD7\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC2\u0CC6\u0CCC\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D3E\u0D41-\u0D44\u0D4D\u0D57\u0D62\u0D63\u0D81\u0DCA\u0DCF\u0DD2-\u0DD4\u0DD6\u0DDF\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200C\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC01\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDE41\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF3E\uDF40\uDF57\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB0\uDCB3-\uDCB8\uDCBA\uDCBD\uDCBF\uDCC0\uDCC2\uDCC3\uDDAF\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD30\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4\uDF00\uDF01\uDF36-\uDF3A\uDF40\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65\uDD67-\uDD69\uDD6E-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF])*\u200D$/,Cl=e=>e.search(BE)!==-1,FE=/(?:\uD83C[\uDDE6-\uDDFF])+$/g,PE=e=>{var t=e.match(FE);if(t===null)return!1;var n=t[0].length/2;return n%2===1},NE={delete(e,t){e.delete(t)},insertFragment(e,t,n){e.insertFragment(t,n)},insertText(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};y.withoutNormalizing(e,()=>{var{voids:r=!1}=n,{at:o=gu(e)}=n;if(S.isPath(o)&&(o=y.range(e,o)),P.isRange(o))if(P.isCollapsed(o))o=o.anchor;else{var s=P.end(o);if(!r&&y.void(e,{at:s}))return;var a=P.start(o),i=y.pointRef(e,a),u=y.pointRef(e,s);$.delete(e,{at:o,voids:r});var c=i.unref(),l=u.unref();o=c||l,$.setSelection(e,{anchor:o,focus:o})}if(!(!r&&y.void(e,{at:o})||y.elementReadOnly(e,{at:o}))){var{path:d,offset:m}=o;t.length>0&&e.apply({type:"insert_text",path:d,offset:m,text:t})}})}};function yl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Ko(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yl(Object(n),!0).forEach(function(r){rt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yl(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var $=Ko(Ko(Ko(Ko({},Qb),eE),tE),NE),is=new WeakMap,kE=e=>is.get(e)||!1,ME=(e,t,n)=>{var r=is.get(e)||!1;is.set(e,!0);try{t(),n()}finally{is.set(e,r)}};function wh(e,t,n){var r=xs.get(e)||[],o=Os.get(e)||new Set,s,a,i=d=>{if(d){var m=d.join(",");a.has(m)||(a.add(m),s.push(d))}};if(n){s=[],a=new Set;for(var u of r){var c=n(u);i(c)}}else s=r,a=o;for(var l of t)i(l);xs.set(e,s),Os.set(e,a)}var _E=(e,t)=>{for(var n of y.pathRefs(e))qb.transform(n,t);for(var r of y.pointRefs(e))Gb.transform(r,t);for(var o of y.rangeRefs(e))Yb.transform(o,t);if(!kE(e)){var s=S.operationCanTransformPath(t)?a=>S.transform(a,t):void 0;wh(e,e.getDirtyPaths(t),s)}$.transform(e,t),e.operations.push(t),y.normalize(e,{operation:t}),t.type==="set_selection"&&(e.marks=null),eo.get(e)||(eo.set(e,!0),Promise.resolve().then(()=>{eo.set(e,!1),e.onChange({operation:t}),e.operations=[]}))},jE=(e,t)=>{switch(t.type){case"insert_text":case"remove_text":case"set_node":{var{path:n}=t;return S.levels(n)}case"insert_node":{var{node:r,path:o}=t,s=S.levels(o),a=ce.isText(r)?[]:Array.from(J.nodes(r),N=>{var[,j]=N;return o.concat(j)});return[...s,...a]}case"merge_node":{var{path:i}=t,u=S.ancestors(i),c=S.previous(i);return[...u,c]}case"move_node":{var{path:l,newPath:d}=t;if(S.equals(l,d))return[];var m=[],g=[];for(var C of S.ancestors(l)){var v=S.transform(C,t);m.push(v)}for(var h of S.ancestors(d)){var E=S.transform(h,t);g.push(E)}var b=g[g.length-1],w=d[d.length-1],D=b.concat(w);return[...m,...g,D]}case"remove_node":{var{path:x}=t,I=S.ancestors(x);return[...I]}case"split_node":{var{path:O}=t,F=S.levels(O),H=S.next(O);return[...F,H]}default:return[]}},LE=e=>{var{selection:t}=e;return t?J.fragment(e,t):[]},$E=(e,t)=>{var[n,r]=t;if(!ce.isText(n)){if(ue.isElement(n)&&n.children.length===0){var o={text:""};$.insertNodes(e,o,{at:r.concat(0),voids:!0});return}for(var s=y.isEditor(n)?!1:ue.isElement(n)&&(e.isInline(n)||n.children.length===0||ce.isText(n.children[0])||e.isInline(n.children[0])),a=0,i=0;i<n.children.length;i++,a++){var u=J.get(e,r);if(!ce.isText(u)){var c=u.children[a],l=u.children[a-1],d=i===n.children.length-1,m=ce.isText(c)||ue.isElement(c)&&e.isInline(c);if(m!==s)$.removeNodes(e,{at:r.concat(a),voids:!0}),a--;else if(ue.isElement(c)){if(e.isInline(c)){if(l==null||!ce.isText(l)){var g={text:""};$.insertNodes(e,g,{at:r.concat(a),voids:!0}),a++}else if(d){var C={text:""};$.insertNodes(e,C,{at:r.concat(a+1),voids:!0}),a++}}}else{if(!ce.isText(c)&&!("children"in c)){var v=c;v.children=[]}l!=null&&ce.isText(l)&&(ce.equals(c,l,{loose:!0})?($.mergeNodes(e,{at:r.concat(a),voids:!0}),a--):l.text===""?($.removeNodes(e,{at:r.concat(a-1),voids:!0}),a--):c.text===""&&($.removeNodes(e,{at:r.concat(a),voids:!0}),a--))}}}}},UE=(e,t)=>{var{iteration:n,initialDirtyPathsLength:r}=t,o=r*42;if(n>o)throw new Error("Could not completely normalize the editor after ".concat(o," iterations! This is usually due to incorrect normalization logic that leaves a node in an invalid state."));return!0},HE=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{voids:r=!1,mode:o="lowest",at:s=t.selection,match:a}=n;if(s){var i=y.path(t,s),u=o==="lowest";for(var[c,l]of y.levels(t,{at:i,voids:r,match:a,reverse:u}))if(!ce.isText(c)){if(P.isRange(s)){if(S.isAncestor(l,s.anchor.path)&&S.isAncestor(l,s.focus.path))return[c,l]}else if(!S.equals(i,l))return[c,l]}}};function bl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function El(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bl(Object(n),!0).forEach(function(r){rt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bl(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var WE=(e,t,n)=>{var{selection:r}=e;if(r){var o=(d,m)=>{if(!ce.isText(d))return!1;var[g,C]=y.parent(e,m);return!e.isVoid(g)||e.markableVoid(g)},s=P.isExpanded(r),a=!1;if(!s){var[i,u]=y.node(e,r);if(i&&o(i,u)){var[c]=y.parent(e,u);a=c&&e.markableVoid(c)}}if(s||a)$.setNodes(e,{[t]:n},{match:o,split:!0,voids:!0});else{var l=El(El({},y.marks(e)||{}),{},{[t]:n});e.marks=l,eo.get(e)||e.onChange()}}};function Dl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function wl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Dl(Object(n),!0).forEach(function(r){rt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Dl(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var zE=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=y.point(t,n,{edge:"end"}),s=y.end(t,[]),a={anchor:o,focus:s},{distance:i=1}=r,u=0,c;for(var l of y.positions(t,wl(wl({},r),{},{at:a}))){if(u>i)break;u!==0&&(c=l),u++}return c};function Al(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function xl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Al(Object(n),!0).forEach(function(r){rt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Al(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var VE=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=y.start(t,[]),s=y.point(t,n,{edge:"start"}),a={anchor:o,focus:s},{distance:i=1}=r,u=0,c;for(var l of y.positions(t,xl(xl({},r),{},{at:a,reverse:!0}))){if(u>i)break;u!==0&&(c=l),u++}return c},KE=(e,t)=>{var{selection:n}=e;n&&P.isCollapsed(n)&&$.delete(e,{unit:t,reverse:!0})},qE=(e,t)=>{var{selection:n}=e;n&&P.isCollapsed(n)&&$.delete(e,{unit:t})},GE=function(t){var{direction:n="forward"}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{selection:r}=t;r&&P.isExpanded(r)&&$.delete(t,{reverse:n==="backward"})},YE=(e,t)=>[y.start(e,t),y.end(e,t)];function Ol(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Sl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ol(Object(n),!0).forEach(function(r){rt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ol(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var XE=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return y.above(t,Sl(Sl({},n),{},{match:r=>ue.isElement(r)&&y.isElementReadOnly(t,r)}))},ZE=(e,t)=>y.point(e,t,{edge:"end"}),JE=(e,t)=>{var n=y.path(e,t,{edge:"start"});return y.node(e,n)},QE=(e,t)=>{var n=y.range(e,t);return J.fragment(e,n)};function Tl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Rl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Tl(Object(n),!0).forEach(function(r){rt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tl(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var eD=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return y.above(t,Rl(Rl({},n),{},{match:r=>ue.isElement(r)&&y.isVoid(t,r)}))},tD=(e,t)=>t.children.some(n=>ue.isElement(n)&&y.isBlock(e,n)),nD=(e,t)=>t.children.some(n=>ce.isText(n)||y.isInline(e,n)),rD=(e,t)=>J.has(e,t),oD=(e,t)=>t.children.every(n=>ce.isText(n)),sD=e=>{$.splitNodes(e,{always:!0})},aD=(e,t,n)=>{$.insertNodes(e,t,n)},iD=e=>{$.splitNodes(e,{always:!0})};function Il(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function uD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Il(Object(n),!0).forEach(function(r){rt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Il(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Ah=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{selection:o,marks:s}=t;if(o){if(s){var a=uD({text:n},s);$.insertNodes(t,a,{at:r.at,voids:r.voids})}else $.insertText(t,n,r);t.marks=null}},cD=(e,t)=>!e.isInline(t),lD=(e,t,n)=>y.isStart(e,t,n)||y.isEnd(e,t,n),fD=(e,t)=>{var{children:n}=t,[r]=n;return n.length===0||n.length===1&&ce.isText(r)&&r.text===""&&!e.isVoid(t)},dD=(e,t,n)=>{var r=y.end(e,n);return De.equals(t,r)},hD=e=>{var t=Eh.get(e);return t===void 0?!0:t},pD=(e,t,n)=>{if(t.offset!==0)return!1;var r=y.start(e,n);return De.equals(t,r)},mD=(e,t)=>{var n=y.path(e,t,{edge:"end"});return y.node(e,n)},vD=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=y.path(t,n,r),s=J.leaf(t,o);return[s,o]};function gD(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){var{at:n=e.selection,reverse:r=!1,voids:o=!1}=t,{match:s}=t;if(s==null&&(s=()=>!0),!!n){var a=[],i=y.path(e,n);for(var[u,c]of J.levels(e,i))if(s(u,c)&&(a.push([u,c]),!o&&ue.isElement(u)&&y.isVoid(e,u)))break;r&&a.reverse(),yield*a}}()}var CD=["text"],yD=["text"],bD=function(t){var{marks:n,selection:r}=t;if(!r)return null;var{anchor:o,focus:s}=r;if(n)return n;if(P.isExpanded(r)){var a=P.isBackward(r);a&&([s,o]=[o,s]);var i=y.isEnd(t,o,o.path);if(i){var u=y.after(t,o);u&&(o=u)}var[c]=y.nodes(t,{match:ce.isText,at:{anchor:o,focus:s}});if(c){var[l]=c,d=rn(l,CD);return d}else return{}}var{path:m}=o,[g]=y.leaf(t,m);if(o.offset===0){var C=y.previous(t,{at:m,match:ce.isText}),v=y.above(t,{match:x=>ue.isElement(x)&&y.isVoid(t,x)&&t.markableVoid(x)});if(!v){var h=y.above(t,{match:x=>ue.isElement(x)&&y.isBlock(t,x)});if(C&&h){var[E,b]=C,[,w]=h;S.isAncestor(w,b)&&(g=E)}}}var D=rn(g,yD);return D},ED=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{mode:r="lowest",voids:o=!1}=n,{match:s,at:a=t.selection}=n;if(a){var i=y.after(t,a,{voids:o});if(i){var[,u]=y.last(t,[]),c=[i.path,u];if(S.isPath(a)&&a.length===0)throw new Error("Cannot get the next node from the root node!");if(s==null)if(S.isPath(a)){var[l]=y.parent(t,a);s=m=>l.children.includes(m)}else s=()=>!0;var[d]=y.nodes(t,{at:c,match:s,mode:r,voids:o});return d}}},DD=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=y.path(t,n,r),s=J.get(t,o);return[s,o]};function wD(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){var{at:n=e.selection,mode:r="all",universal:o=!1,reverse:s=!1,voids:a=!1,ignoreNonSelectable:i=!1}=t,{match:u}=t;if(u||(u=()=>!0),!!n){var c,l;if(uE.isSpan(n))c=n[0],l=n[1];else{var d=y.path(e,n,{edge:"start"}),m=y.path(e,n,{edge:"end"});c=s?m:d,l=s?d:m}var g=J.nodes(e,{reverse:s,from:c,to:l,pass:D=>{var[x]=D;return ue.isElement(x)?!!(!a&&(y.isVoid(e,x)||y.isElementReadOnly(e,x))||i&&!y.isSelectable(e,x)):!1}}),C=[],v;for(var[h,E]of g)if(!(i&&ue.isElement(h)&&!y.isSelectable(e,h))){var b=v&&S.compare(E,v[1])===0;if(!(r==="highest"&&b)){if(!u(h,E)){if(o&&!b&&ce.isText(h))return;continue}if(r==="lowest"&&b){v=[h,E];continue}var w=r==="lowest"?v:[h,E];w&&(o?C.push(w):yield w),v=[h,E]}}r==="lowest"&&v&&(o?C.push(v):yield v),o&&(yield*C)}}()}var AD=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{force:r=!1,operation:o}=n,s=l=>xs.get(l)||[],a=l=>Os.get(l)||new Set,i=l=>{var d=s(l).pop(),m=d.join(",");return a(l).delete(m),d};if(y.isNormalizing(t)){if(r){var u=Array.from(J.nodes(t),l=>{var[,d]=l;return d}),c=new Set(u.map(l=>l.join(",")));xs.set(t,u),Os.set(t,c)}s(t).length!==0&&y.withoutNormalizing(t,()=>{for(var l of s(t))if(J.has(t,l)){var d=y.node(t,l),[m,g]=d;ue.isElement(m)&&m.children.length===0&&t.normalizeNode(d,{operation:o})}for(var C=s(t),v=C.length,h=0;C.length!==0;){if(!t.shouldNormalize({dirtyPaths:C,iteration:h,initialDirtyPathsLength:v,operation:o}))return;var E=i(t);if(J.has(t,E)){var b=y.node(t,E);t.normalizeNode(b,{operation:o})}h++,C=s(t)}})}},xD=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=y.path(t,n,r),s=S.parent(o),a=y.node(t,s);return a},OD=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{affinity:o="forward"}=r,s={current:n,affinity:o,unref(){var{current:i}=s,u=y.pathRefs(t);return u.delete(s),s.current=null,i}},a=y.pathRefs(t);return a.add(s),s},SD=e=>{var t=sl.get(e);return t||(t=new Set,sl.set(e,t)),t},TD=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{depth:o,edge:s}=r;if(S.isPath(n)){if(s==="start"){var[,a]=J.first(t,n);n=a}else if(s==="end"){var[,i]=J.last(t,n);n=i}}return P.isRange(n)&&(s==="start"?n=P.start(n):s==="end"?n=P.end(n):n=S.common(n.anchor.path,n.focus.path)),De.isPoint(n)&&(n=n.path),o!=null&&(n=n.slice(0,o)),n},RD=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{affinity:o="forward"}=r,s={current:n,affinity:o,unref(){var{current:i}=s,u=y.pointRefs(t);return u.delete(s),s.current=null,i}},a=y.pointRefs(t);return a.add(s),s},ID=e=>{var t=al.get(e);return t||(t=new Set,al.set(e,t)),t},BD=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{edge:o="start"}=r;if(S.isPath(n)){var s;if(o==="end"){var[,a]=J.last(t,n);s=a}else{var[,i]=J.first(t,n);s=i}var u=J.get(t,s);if(!ce.isText(u))throw new Error("Cannot get the ".concat(o," point in the node at path [").concat(n,"] because it has no ").concat(o," text node."));return{path:s,offset:o==="end"?u.text.length:0}}if(P.isRange(n)){var[c,l]=P.edges(n);return o==="start"?c:l}return n};function FD(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){var{at:n=e.selection,unit:r="offset",reverse:o=!1,voids:s=!1,ignoreNonSelectable:a=!1}=t;if(!n)return;var i=y.range(e,n),[u,c]=P.edges(i),l=o?c:u,d=!1,m="",g=0,C=0,v=0;for(var[h,E]of y.nodes(e,{at:n,reverse:o,voids:s,ignoreNonSelectable:a})){if(ue.isElement(h)){if(!s&&(e.isVoid(h)||e.isElementReadOnly(h))){yield y.start(e,E);continue}if(e.isInline(h))continue;if(y.hasInlines(e,h)){var b=S.isAncestor(E,c.path)?c:y.end(e,E),w=S.isAncestor(E,u.path)?u:y.start(e,E);m=y.string(e,{anchor:w,focus:b},{voids:s}),d=!0}}if(ce.isText(h)){var D=S.equals(E,l.path);for(D?(C=o?l.offset:h.text.length-l.offset,v=l.offset):(C=h.text.length,v=o?C:0),(D||d||r==="offset")&&(yield{path:E,offset:v},d=!1);;){if(g===0){if(m==="")break;g=x(m,r,o),m=yu(m,g,o)[1]}if(v=o?v-g:v+g,C=C-g,C<0){g=-C;break}g=0,yield{path:E,offset:v}}}}function x(I,O,F){return O==="character"?Cu(I,F):O==="word"?pE(I,F):O==="line"||O==="block"?I.length:1}}()}var PD=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{mode:r="lowest",voids:o=!1}=n,{match:s,at:a=t.selection}=n;if(a){var i=y.before(t,a,{voids:o});if(i){var[,u]=y.first(t,[]),c=[i.path,u];if(S.isPath(a)&&a.length===0)throw new Error("Cannot get the previous node from the root node!");if(s==null)if(S.isPath(a)){var[l]=y.parent(t,a);s=m=>l.children.includes(m)}else s=()=>!0;var[d]=y.nodes(t,{reverse:!0,at:c,match:s,mode:r,voids:o});return d}}},ND=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{affinity:o="forward"}=r,s={current:n,affinity:o,unref(){var{current:i}=s,u=y.rangeRefs(t);return u.delete(s),s.current=null,i}},a=y.rangeRefs(t);return a.add(s),s},kD=e=>{var t=il.get(e);return t||(t=new Set,il.set(e,t)),t},MD=(e,t,n)=>{if(P.isRange(t)&&!n)return t;var r=y.start(e,t),o=y.end(e,n||t);return{anchor:r,focus:o}};function Bl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function _D(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Bl(Object(n),!0).forEach(function(r){rt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bl(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var jD=(e,t)=>{var{selection:n}=e;if(n){var r=(l,d)=>{if(!ce.isText(l))return!1;var[m,g]=y.parent(e,d);return!e.isVoid(m)||e.markableVoid(m)},o=P.isExpanded(n),s=!1;if(!o){var[a,i]=y.node(e,n);if(a&&r(a,i)){var[u]=y.parent(e,i);s=u&&e.markableVoid(u)}}if(o||s)$.unsetNodes(e,t,{match:r,split:!0,voids:!0});else{var c=_D({},y.marks(e)||{});delete c[t],e.marks=c,eo.get(e)||e.onChange()}}},LD=(e,t)=>{Eh.set(e,t)},$D=(e,t)=>y.point(e,t,{edge:"start"}),UD=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{voids:o=!1}=r,s=y.range(t,n),[a,i]=P.edges(s),u="";for(var[c,l]of y.nodes(t,{at:s,match:ce.isText,voids:o})){var d=c.text;S.equals(l,i.path)&&(d=d.slice(0,i.offset)),S.equals(l,a.path)&&(d=d.slice(a.offset)),u+=d}return u},HD=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{voids:o=!1}=r,[s,a]=P.edges(n);if(s.offset!==0||a.offset!==0||P.isCollapsed(n)||S.hasPrevious(a.path))return n;var i=y.above(t,{at:a,match:C=>ue.isElement(C)&&y.isBlock(t,C),voids:o}),u=i?i[1]:[],c=y.start(t,s),l={anchor:c,focus:a},d=!0;for(var[m,g]of y.nodes(t,{at:l,match:ce.isText,reverse:!0,voids:o})){if(d){d=!1;continue}if(m.text!==""||S.isBefore(g,u)){a={path:g,offset:m.text.length};break}}return{anchor:s,focus:a}},WD=(e,t)=>{var n=y.isNormalizing(e);y.setNormalizing(e,!1);try{t()}finally{y.setNormalizing(e,n)}y.normalize(e)},zD=(e,t,n)=>{var[r,o]=t;return ue.isElement(r)&&y.isEmpty(e,r)||ce.isText(r)&&r.text===""&&o[o.length-1]!==0},VD=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};y.withoutNormalizing(t,()=>{var r,o,{reverse:s=!1,unit:a="character",distance:i=1,voids:u=!1}=n,{at:c=t.selection,hanging:l=!1}=n;if(c){var d=!1;if(P.isRange(c)&&P.isCollapsed(c)&&(d=!0,c=c.anchor),De.isPoint(c)){var m=y.void(t,{at:c,mode:"highest"});if(!u&&m){var[,g]=m;c=g}else{var C={unit:a,distance:i},v=s?y.before(t,c,C)||y.start(t,[]):y.after(t,c,C)||y.end(t,[]);c={anchor:c,focus:v},l=!0}}if(S.isPath(c)){$.removeNodes(t,{at:c,voids:u});return}if(!P.isCollapsed(c)){if(!l){var[,h]=P.edges(c),E=y.end(t,[]);De.equals(h,E)||(c=y.unhangRange(t,c,{voids:u}))}var[b,w]=P.edges(c),D=y.above(t,{match:ne=>ue.isElement(ne)&&y.isBlock(t,ne),at:b,voids:u}),x=y.above(t,{match:ne=>ue.isElement(ne)&&y.isBlock(t,ne),at:w,voids:u}),I=D&&x&&!S.equals(D[1],x[1]),O=S.equals(b.path,w.path),F=u?null:(r=y.void(t,{at:b,mode:"highest"}))!==null&&r!==void 0?r:y.elementReadOnly(t,{at:b,mode:"highest"}),H=u?null:(o=y.void(t,{at:w,mode:"highest"}))!==null&&o!==void 0?o:y.elementReadOnly(t,{at:w,mode:"highest"});if(F){var N=y.before(t,b);N&&D&&S.isAncestor(D[1],N.path)&&(b=N)}if(H){var j=y.after(t,w);j&&x&&S.isAncestor(x[1],j.path)&&(w=j)}var B=[],k;for(var M of y.nodes(t,{at:c,voids:u})){var[W,re]=M;k&&S.compare(re,k)===0||(!u&&ue.isElement(W)&&(y.isVoid(t,W)||y.isElementReadOnly(t,W))||!S.isCommon(re,b.path)&&!S.isCommon(re,w.path))&&(B.push(M),k=re)}var Y=Array.from(B,ne=>{var[,ie]=ne;return y.pathRef(t,ie)}),ee=y.pointRef(t,b),L=y.pointRef(t,w),Q="";if(!O&&!F){var V=ee.current,[te]=y.leaf(t,V),{path:se}=V,{offset:de}=b,G=te.text.slice(de);G.length>0&&(t.apply({type:"remove_text",path:se,offset:de,text:G}),Q=G)}if(Y.reverse().map(ne=>ne.unref()).filter(ne=>ne!==null).forEach(ne=>$.removeNodes(t,{at:ne,voids:u})),!H){var R=L.current,[_]=y.leaf(t,R),{path:U}=R,X=O?b.offset:0,fe=_.text.slice(X,w.offset);fe.length>0&&(t.apply({type:"remove_text",path:U,offset:X,text:fe}),Q=fe)}!O&&I&&L.current&&ee.current&&$.mergeNodes(t,{at:L.current,hanging:!0,voids:u}),d&&s&&a==="character"&&Q.length>1&&Q.match(/[\u0E00-\u0E7F]+/)&&$.insertText(t,Q.slice(0,Q.length-i));var le=ee.unref(),T=L.unref(),q=s?le||T:T||le;n.at==null&&q&&$.select(t,q)}}})},KD=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};y.withoutNormalizing(t,()=>{var{hanging:o=!1,voids:s=!1}=r,{at:a=gu(t),batchDirty:i=!0}=r;if(n.length){if(P.isRange(a))if(o||(a=y.unhangRange(t,a,{voids:s})),P.isCollapsed(a))a=a.anchor;else{var[,u]=P.edges(a);if(!s&&y.void(t,{at:u}))return;var c=y.pointRef(t,u);$.delete(t,{at:a}),a=c.unref()}else S.isPath(a)&&(a=y.start(t,a));if(!(!s&&y.void(t,{at:a}))){var l=y.above(t,{at:a,match:G=>ue.isElement(G)&&y.isInline(t,G),mode:"highest",voids:s});if(l){var[,d]=l;if(y.isEnd(t,a,d)){var m=y.after(t,d);a=m}else if(y.isStart(t,a,d)){var g=y.before(t,d);a=g}}var C=y.above(t,{match:G=>ue.isElement(G)&&y.isBlock(t,G),at:a,voids:s}),[,v]=C,h=y.isStart(t,a,v),E=y.isEnd(t,a,v),b=h&&E,w=!h||h&&E,D=!E,[,x]=J.first({children:n},[]),[,I]=J.last({children:n},[]),O=[],F=G=>{var[R,_]=G,U=_.length===0;return U?!1:b?!0:!(w&&S.isAncestor(_,x)&&ue.isElement(R)&&!t.isVoid(R)&&!t.isInline(R)||D&&S.isAncestor(_,I)&&ue.isElement(R)&&!t.isVoid(R)&&!t.isInline(R))};for(var H of J.nodes({children:n},{pass:F}))F(H)&&O.push(H);var N=[],j=[],B=[],k=!0,M=!1;for(var[W]of O)ue.isElement(W)&&!t.isInline(W)?(k=!1,M=!0,j.push(W)):k?N.push(W):B.push(W);var[re]=y.nodes(t,{at:a,match:G=>ce.isText(G)||y.isInline(t,G),mode:"highest",voids:s}),[,Y]=re,ee=y.isStart(t,a,Y),L=y.isEnd(t,a,Y),Q=y.pathRef(t,E&&!B.length?S.next(v):v),V=y.pathRef(t,L?S.next(Y):Y);$.splitNodes(t,{at:a,match:G=>M?ue.isElement(G)&&y.isBlock(t,G):ce.isText(G)||y.isInline(t,G),mode:M?"lowest":"highest",always:M&&(!h||N.length>0)&&(!E||B.length>0),voids:s});var te=y.pathRef(t,!ee||ee&&L?S.next(Y):Y);if($.insertNodes(t,N,{at:te.current,match:G=>ce.isText(G)||y.isInline(t,G),mode:"highest",voids:s,batchDirty:i}),b&&!N.length&&j.length&&!B.length&&$.delete(t,{at:v,voids:s}),$.insertNodes(t,j,{at:Q.current,match:G=>ue.isElement(G)&&y.isBlock(t,G),mode:"lowest",voids:s,batchDirty:i}),$.insertNodes(t,B,{at:V.current,match:G=>ce.isText(G)||y.isInline(t,G),mode:"highest",voids:s,batchDirty:i}),!r.at){var se;if(B.length>0&&V.current?se=S.previous(V.current):j.length>0&&Q.current?se=S.previous(Q.current):te.current&&(se=S.previous(te.current)),se){var de=y.end(t,se);$.select(t,de)}}te.unref(),Q.unref(),V.unref()}}})},qD=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{edge:r="anchor"}=n,{selection:o}=t;if(o){if(r==="anchor")$.select(t,o.anchor);else if(r==="focus")$.select(t,o.focus);else if(r==="start"){var[s]=P.edges(o);$.select(t,s)}else if(r==="end"){var[,a]=P.edges(o);$.select(t,a)}}else return},GD=e=>{var{selection:t}=e;t&&e.apply({type:"set_selection",properties:t,newProperties:null})},YD=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{selection:r}=t,{distance:o=1,unit:s="character",reverse:a=!1}=n,{edge:i=null}=n;if(r){i==="start"&&(i=P.isBackward(r)?"focus":"anchor"),i==="end"&&(i=P.isBackward(r)?"anchor":"focus");var{anchor:u,focus:c}=r,l={distance:o,unit:s,ignoreNonSelectable:!0},d={};if(i==null||i==="anchor"){var m=a?y.before(t,u,l):y.after(t,u,l);m&&(d.anchor=m)}if(i==null||i==="focus"){var g=a?y.before(t,c,l):y.after(t,c,l);g&&(d.focus=g)}$.setSelection(t,d)}},XD=(e,t)=>{var{selection:n}=e;if(t=y.range(e,t),n){$.setSelection(e,t);return}if(!P.isRange(t))throw new Error("When setting the selection and the current selection is `null` you must provide at least an `anchor` and `focus`, but you passed: ".concat(Ve.stringify(t)));e.apply({type:"set_selection",properties:n,newProperties:t})};function Fl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Pl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Fl(Object(n),!0).forEach(function(r){rt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fl(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var ZD=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{selection:o}=t,{edge:s="both"}=r;if(o){s==="start"&&(s=P.isBackward(o)?"focus":"anchor"),s==="end"&&(s=P.isBackward(o)?"anchor":"focus");var{anchor:a,focus:i}=o,u=s==="anchor"?a:i;$.setSelection(t,{[s==="anchor"?"anchor":"focus"]:Pl(Pl({},u),n)})}},JD=(e,t)=>{var{selection:n}=e,r={},o={};if(n){for(var s in t)(s==="anchor"&&t.anchor!=null&&!De.equals(t.anchor,n.anchor)||s==="focus"&&t.focus!=null&&!De.equals(t.focus,n.focus)||s!=="anchor"&&s!=="focus"&&t[s]!==n[s])&&(r[s]=n[s],o[s]=t[s]);Object.keys(r).length>0&&e.apply({type:"set_selection",properties:r,newProperties:o})}},QD=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};y.withoutNormalizing(t,()=>{var{hanging:o=!1,voids:s=!1,mode:a="lowest",batchDirty:i=!0}=r,{at:u,match:c,select:l}=r;if(J.isNode(n)&&(n=[n]),n.length!==0){var[d]=n;if(u||(u=gu(t),l!==!1&&(l=!0)),l==null&&(l=!1),P.isRange(u))if(o||(u=y.unhangRange(t,u,{voids:s})),P.isCollapsed(u))u=u.anchor;else{var[,m]=P.edges(u),g=y.pointRef(t,m);$.delete(t,{at:u}),u=g.unref()}if(De.isPoint(u)){c==null&&(ce.isText(d)?c=N=>ce.isText(N):t.isInline(d)?c=N=>ce.isText(N)||y.isInline(t,N):c=N=>ue.isElement(N)&&y.isBlock(t,N));var[C]=y.nodes(t,{at:u.path,match:c,mode:a,voids:s});if(C){var[,v]=C,h=y.pathRef(t,v),E=y.isEnd(t,u,v);$.splitNodes(t,{at:u,match:c,mode:a,voids:s});var b=h.unref();u=E?S.next(b):b}else return}var w=S.parent(u),D=u[u.length-1];if(!(!s&&y.void(t,{at:w}))){if(i){var x=[],I=S.levels(w);ME(t,()=>{var N=function(){var k=w.concat(D);D++;var M={type:"insert_node",path:k,node:j};t.apply(M),u=S.next(u),x.push(M),ce.isText?I.push(...Array.from(J.nodes(j),W=>{var[,re]=W;return k.concat(re)})):I.push(k)};for(var j of n)N()},()=>{wh(t,I,N=>{var j=N;for(var B of x)if(S.operationCanTransformPath(B)&&(j=S.transform(j,B),!j))return null;return j})})}else for(var O of n){var F=w.concat(D);D++,t.apply({type:"insert_node",path:F,node:O}),u=S.next(u)}if(u=S.previous(u),l){var H=y.end(t,u);H&&$.select(t,H)}}}})},ew=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};y.withoutNormalizing(t,()=>{var{at:r=t.selection,mode:o="lowest",voids:s=!1}=n,{match:a}=n;if(a==null&&(a=S.isPath(r)?_r(t,r):D=>ue.isElement(D)&&y.isBlock(t,D)),!!r){var i=y.nodes(t,{at:r,match:a,mode:o,voids:s}),u=Array.from(i,D=>{var[,x]=D;return y.pathRef(t,x)});for(var c of u){var l=c.unref();if(l.length<2)throw new Error("Cannot lift node at a path [".concat(l,"] because it has a depth of less than `2`."));var d=y.node(t,S.parent(l)),[m,g]=d,C=l[l.length-1],{length:v}=m.children;if(v===1){var h=S.next(g);$.moveNodes(t,{at:l,to:h,voids:s}),$.removeNodes(t,{at:g,voids:s})}else if(C===0)$.moveNodes(t,{at:l,to:g,voids:s});else if(C===v-1){var E=S.next(g);$.moveNodes(t,{at:l,to:E,voids:s})}else{var b=S.next(l),w=S.next(g);$.splitNodes(t,{at:b,voids:s}),$.moveNodes(t,{at:l,to:w,voids:s})}}}})},tw=["text"],nw=["children"],xh=(e,t)=>{if(ue.isElement(t)){var n=t;return y.isVoid(e,t)?!0:n.children.length===1?xh(e,n.children[0]):!1}else return!y.isEditor(t)},rw=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};y.withoutNormalizing(t,()=>{var{match:r,at:o=t.selection}=n,{hanging:s=!1,voids:a=!1,mode:i="lowest"}=n;if(o){if(r==null)if(S.isPath(o)){var[u]=y.parent(t,o);r=N=>u.children.includes(N)}else r=N=>ue.isElement(N)&&y.isBlock(t,N);if(!s&&P.isRange(o)&&(o=y.unhangRange(t,o,{voids:a})),P.isRange(o))if(P.isCollapsed(o))o=o.anchor;else{var[,c]=P.edges(o),l=y.pointRef(t,c);$.delete(t,{at:o}),o=l.unref(),n.at==null&&$.select(t,o)}var[d]=y.nodes(t,{at:o,match:r,voids:a,mode:i}),m=y.previous(t,{at:o,match:r,voids:a,mode:i});if(!(!d||!m)){var[g,C]=d,[v,h]=m;if(!(C.length===0||h.length===0)){var E=S.next(h),b=S.common(C,h),w=S.isSibling(C,h),D=Array.from(y.levels(t,{at:C}),N=>{var[j]=N;return j}).slice(b.length).slice(0,-1),x=y.above(t,{at:C,mode:"highest",match:N=>D.includes(N)&&xh(t,N)}),I=x&&y.pathRef(t,x[1]),O,F;if(ce.isText(g)&&ce.isText(v)){var H=rn(g,tw);F=v.text.length,O=H}else if(ue.isElement(g)&&ue.isElement(v)){var H=rn(g,nw);F=v.children.length,O=H}else throw new Error("Cannot merge the node at path [".concat(C,"] with the previous sibling because it is not the same kind: ").concat(Ve.stringify(g)," ").concat(Ve.stringify(v)));w||$.moveNodes(t,{at:C,to:E,voids:a}),I&&$.removeNodes(t,{at:I.current,voids:a}),y.shouldMergeNodesRemovePrevNode(t,m,d)?$.removeNodes(t,{at:h,voids:a}):t.apply({type:"merge_node",path:E,position:F,properties:O}),I&&I.unref()}}}})},ow=(e,t)=>{y.withoutNormalizing(e,()=>{var{to:n,at:r=e.selection,mode:o="lowest",voids:s=!1}=t,{match:a}=t;if(r){a==null&&(a=S.isPath(r)?_r(e,r):g=>ue.isElement(g)&&y.isBlock(e,g));var i=y.pathRef(e,n),u=y.nodes(e,{at:r,match:a,mode:o,voids:s}),c=Array.from(u,g=>{var[,C]=g;return y.pathRef(e,C)});for(var l of c){var d=l.unref(),m=i.current;d.length!==0&&e.apply({type:"move_node",path:d,newPath:m}),i.current&&S.isSibling(m,d)&&S.isAfter(m,d)&&(i.current=S.next(i.current))}i.unref()}})},sw=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};y.withoutNormalizing(t,()=>{var{hanging:r=!1,voids:o=!1,mode:s="lowest"}=n,{at:a=t.selection,match:i}=n;if(a){i==null&&(i=S.isPath(a)?_r(t,a):g=>ue.isElement(g)&&y.isBlock(t,g)),!r&&P.isRange(a)&&(a=y.unhangRange(t,a,{voids:o}));var u=y.nodes(t,{at:a,match:i,mode:s,voids:o}),c=Array.from(u,g=>{var[,C]=g;return y.pathRef(t,C)});for(var l of c){var d=l.unref();if(d){var[m]=y.node(t,d);t.apply({type:"remove_node",path:d,node:m})}}}})},aw=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};y.withoutNormalizing(t,()=>{var{match:o,at:s=t.selection,compare:a,merge:i}=r,{hanging:u=!1,mode:c="lowest",split:l=!1,voids:d=!1}=r;if(s){if(o==null&&(o=S.isPath(s)?_r(t,s):F=>ue.isElement(F)&&y.isBlock(t,F)),!u&&P.isRange(s)&&(s=y.unhangRange(t,s,{voids:d})),l&&P.isRange(s)){if(P.isCollapsed(s)&&y.leaf(t,s.anchor)[0].text.length>0)return;var m=y.rangeRef(t,s,{affinity:"inward"}),[g,C]=P.edges(s),v=c==="lowest"?"lowest":"highest",h=y.isEnd(t,C,C.path);$.splitNodes(t,{at:C,match:o,mode:v,voids:d,always:!h});var E=y.isStart(t,g,g.path);$.splitNodes(t,{at:g,match:o,mode:v,voids:d,always:!E}),s=m.unref(),r.at==null&&$.select(t,s)}a||(a=(F,H)=>F!==H);for(var[b,w]of y.nodes(t,{at:s,match:o,mode:c,voids:d})){var D={},x={};if(w.length!==0){var I=!1;for(var O in n)O==="children"||O==="text"||a(n[O],b[O])&&(I=!0,b.hasOwnProperty(O)&&(D[O]=b[O]),i?n[O]!=null&&(x[O]=i(b[O],n[O])):n[O]!=null&&(x[O]=n[O]));I&&t.apply({type:"set_node",path:w,properties:D,newProperties:x})}}}})},iw=(e,t)=>{if(P.isCollapsed(t))return t.anchor;var[,n]=P.edges(t),r=y.pointRef(e,n);return $.delete(e,{at:t}),r.unref()},uw=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};y.withoutNormalizing(t,()=>{var{mode:r="lowest",voids:o=!1}=n,{match:s,at:a=t.selection,height:i=0,always:u=!1}=n;if(s==null&&(s=L=>ue.isElement(L)&&y.isBlock(t,L)),P.isRange(a)&&(a=iw(t,a)),S.isPath(a)){var c=a,l=y.point(t,c),[d]=y.parent(t,c);s=L=>L===d,i=l.path.length-c.length+1,a=l,u=!0}if(a){var m=y.pointRef(t,a,{affinity:"backward"}),g;try{var[C]=y.nodes(t,{at:a,match:s,mode:r,voids:o});if(!C)return;var v=y.void(t,{at:a,mode:"highest"}),h=0;if(!o&&v){var[E,b]=v;if(ue.isElement(E)&&t.isInline(E)){var w=y.after(t,b);if(!w){var D={text:""},x=S.next(b);$.insertNodes(t,D,{at:x,voids:o}),w=y.point(t,x)}a=w,u=!0}var I=a.path.length-b.length;i=I+1,u=!0}g=y.pointRef(t,a);var O=a.path.length-i,[,F]=C,H=a.path.slice(0,O),N=i===0?a.offset:a.path[O]+h;for(var[j,B]of y.levels(t,{at:H,reverse:!0,voids:o})){var k=!1;if(B.length<F.length||B.length===0||!o&&ue.isElement(j)&&y.isVoid(t,j))break;var M=m.current,W=y.isEnd(t,M,B);if(u||!m||!y.isEdge(t,M,B)){k=!0;var re=J.extractProps(j);t.apply({type:"split_node",path:B,position:N,properties:re})}N=B[B.length-1]+(k||W?1:0)}if(n.at==null){var Y=g.current||y.end(t,[]);$.select(t,Y)}}finally{var ee;m.unref(),(ee=g)===null||ee===void 0||ee.unref()}}})},cw=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Array.isArray(n)||(n=[n]);var o={};for(var s of n)o[s]=null;$.setNodes(t,o,r)},lw=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};y.withoutNormalizing(t,()=>{var{mode:r="lowest",split:o=!1,voids:s=!1}=n,{at:a=t.selection,match:i}=n;if(a){i==null&&(i=S.isPath(a)?_r(t,a):g=>ue.isElement(g)&&y.isBlock(t,g)),S.isPath(a)&&(a=y.range(t,a));var u=P.isRange(a)?y.rangeRef(t,a):null,c=y.nodes(t,{at:a,match:i,mode:r,voids:s}),l=Array.from(c,g=>{var[,C]=g;return y.pathRef(t,C)}).reverse(),d=function(){var C=m.unref(),[v]=y.node(t,C),h=y.range(t,C);o&&u&&(h=P.intersection(u.current,h)),$.liftNodes(t,{at:h,match:E=>ue.isAncestor(v)&&v.children.includes(E),voids:s})};for(var m of l)d();u&&u.unref()}})};function Nl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function kl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Nl(Object(n),!0).forEach(function(r){rt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Nl(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var fw=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};y.withoutNormalizing(t,()=>{var{mode:o="lowest",split:s=!1,voids:a=!1}=r,{match:i,at:u=t.selection}=r;if(u){if(i==null&&(S.isPath(u)?i=_r(t,u):t.isInline(n)?i=h=>ue.isElement(h)&&y.isInline(t,h)||ce.isText(h):i=h=>ue.isElement(h)&&y.isBlock(t,h)),s&&P.isRange(u)){var[c,l]=P.edges(u),d=y.rangeRef(t,u,{affinity:"inward"});$.splitNodes(t,{at:l,match:i,voids:a}),$.splitNodes(t,{at:c,match:i,voids:a}),u=d.unref(),r.at==null&&$.select(t,u)}var m=Array.from(y.nodes(t,{at:u,match:t.isInline(n)?h=>ue.isElement(h)&&y.isBlock(t,h):h=>y.isEditor(h),mode:"lowest",voids:a})),g=function(){var E=P.isRange(u)?P.intersection(u,y.range(t,v)):u;if(!E)return 0;var b=Array.from(y.nodes(t,{at:E,match:i,mode:o,voids:a}));if(b.length>0){var[w]=b,D=b[b.length-1],[,x]=w,[,I]=D;if(x.length===0&&I.length===0)return 0;var O=S.equals(x,I)?S.parent(x):S.common(x,I),F=y.range(t,x,I),H=y.node(t,O),[N]=H,j=O.length+1,B=S.next(I.slice(0,j)),k=kl(kl({},n),{},{children:[]});$.insertNodes(t,k,{at:B,voids:a}),$.moveNodes(t,{at:F,match:M=>ue.isAncestor(N)&&N.children.includes(M),to:B.concat(0),voids:a})}},C;for(var[,v]of m)C=g()}})},Oh=()=>{var e={children:[],operations:[],selection:null,marks:null,isElementReadOnly:()=>!1,isInline:()=>!1,isSelectable:()=>!0,isVoid:()=>!1,markableVoid:()=>!1,onChange:()=>{},apply:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return _E(e,...r)},addMark:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return WE(e,...r)},deleteBackward:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return KE(e,...r)},deleteForward:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return qE(e,...r)},deleteFragment:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return GE(e,...r)},getFragment:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return LE(e,...r)},insertBreak:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return sD(e,...r)},insertSoftBreak:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return iD(e,...r)},insertFragment:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return KD(e,...r)},insertNode:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return aD(e,...r)},insertText:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return Ah(e,...r)},normalizeNode:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return $E(e,...r)},removeMark:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return jD(e,...r)},getDirtyPaths:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return jE(e,...r)},shouldNormalize:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return UE(e,...r)},above:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return HE(e,...r)},after:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return zE(e,...r)},before:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return VE(e,...r)},collapse:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return qD(e,...r)},delete:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return VD(e,...r)},deselect:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return GD(e,...r)},edges:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return YE(e,...r)},elementReadOnly:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return XE(e,...r)},end:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return ZE(e,...r)},first:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return JE(e,...r)},fragment:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return QE(e,...r)},getMarks:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return bD(e,...r)},hasBlocks:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return tD(e,...r)},hasInlines:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return nD(e,...r)},hasPath:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return rD(e,...r)},hasTexts:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return oD(e,...r)},insertNodes:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return QD(e,...r)},isBlock:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return cD(e,...r)},isEdge:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return lD(e,...r)},isEmpty:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return fD(e,...r)},isEnd:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return dD(e,...r)},isNormalizing:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return hD(e,...r)},isStart:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return pD(e,...r)},last:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return mD(e,...r)},leaf:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return vD(e,...r)},levels:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return gD(e,...r)},liftNodes:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return ew(e,...r)},mergeNodes:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return rw(e,...r)},move:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return YD(e,...r)},moveNodes:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return ow(e,...r)},next:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return ED(e,...r)},node:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return DD(e,...r)},nodes:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return wD(e,...r)},normalize:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return AD(e,...r)},parent:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return xD(e,...r)},path:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return TD(e,...r)},pathRef:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return OD(e,...r)},pathRefs:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return SD(e,...r)},point:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return BD(e,...r)},pointRef:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return RD(e,...r)},pointRefs:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return ID(e,...r)},positions:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return FD(e,...r)},previous:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return PD(e,...r)},range:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return MD(e,...r)},rangeRef:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return ND(e,...r)},rangeRefs:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return kD(e,...r)},removeNodes:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return sw(e,...r)},select:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return XD(e,...r)},setNodes:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return aw(e,...r)},setNormalizing:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return LD(e,...r)},setPoint:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return ZD(e,...r)},setSelection:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return JD(e,...r)},splitNodes:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return uw(e,...r)},start:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return $D(e,...r)},string:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return UD(e,...r)},unhangRange:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return HD(e,...r)},unsetNodes:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return cw(e,...r)},unwrapNodes:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return lw(e,...r)},void:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return eD(e,...r)},withoutNormalizing:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return WD(e,...r)},wrapNodes:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return fw(e,...r)},shouldMergeNodesRemovePrevNode:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return zD(e,...r)}};return e};function co(e,t,n={}){const{filterVoids:r}=n,o=y.before(e,t,{unit:"character",voids:r});if(o){const s=y.range(e,o,P.isRange(t)?P.start(t):t),a=y.string(e,s);return{range:s,text:a,void:a.length===0}}}function bu(e,t,n={}){const{filterVoids:r}=n,o=y.after(e,t,{unit:"character",voids:r});if(o){const s=y.range(e,o,P.isRange(t)?P.end(t):t),a=y.string(e,s);return{range:s,text:a,void:a.length===0}}}const dw=/\s/;function Ss(e){return e?dw.test(e):!1}const Ml={direction:"before",allowConsecutiveWhitespace:!0};function Sh(e,t,n=[" "],r=Ml){const{include:o,direction:s,ignoreTerminator:a,allowConsecutiveWhitespace:i}={...Ml,...r};let[u,c]=P.edges(t),l=u,d=!1;function m(g){const C=g==="after"?y.after(e,l,{unit:"character"}):y.before(e,l,{unit:"character"});if(!C||S.compare(C.path,l.path)!==0)return!1;const v=C&&y.string(e,g==="after"?{anchor:l,focus:C}:{anchor:C,focus:l}),h=v&&v[g==="after"?0:v.length-1];if(!i&&d&&Ss(h))return!1;if(C&&h&&(!n.includes(h)||a?.(h,C,g))){if(d=Ss(h),l=C,l.offset===0)return!1}else return!1;return!0}if(s!=="before"){for(l=c;m("after"););c=l}if(s!=="after"){for(l=u;m("before"););u=l}return o?{anchor:s==="before"||s==="both"?y.before(e,u,{unit:"offset"})??u:u,focus:s==="after"||s==="both"?y.after(e,c,{unit:"offset"})??c:c}:{anchor:u,focus:c}}function Sr(e){return!e.trim()}const wn="@";function hw(e){const{selection:t}=e;if(!t||!P.isCollapsed(t))return;const n=Sh(e,t,["@"],{include:!0,allowConsecutiveWhitespace:!1,ignoreTerminator:(o,s)=>{const a=co(e,s);return!!(a&&!Ss(a.text))}});if(!n)return;const r=y.string(e,n);if(!(!r.startsWith(wn)||r.length>1&&Ss(r[1])))return{range:n,text:r.substring(1)}}function qr(e){return ue.isElement(e)&&e.type==="mention"}function pw(e,t){const n={type:"mention",id:t,children:[{text:""}]};$.insertNodes(e,n),$.move(e);const r=e.selection?bu(e,e.selection):void 0;!r||r.void?$.insertText(e," "):Sr(r.text)&&$.move(e)}function mw(e){if(!e.selection)return;const t=co(e,e.selection,{filterVoids:!0}),n=bu(e,e.selection,{filterVoids:!0}),r=t&&!Sr(t.text),o=n&&!Sr(n.text);if(P.isCollapsed(e.selection)){const s=(r?" ":"")+wn;e.insertText(s,{at:P.start(e.selection)}),o&&e.insertText(" ",{at:P.end(e.selection)}),$.collapse(e,{edge:"end"})}else{const s=(r?" ":"")+wn+(o?" ":"");e.insertText(s),o&&$.move(e,{distance:1,unit:"character",reverse:!0})}}function vw(e){const{isInline:t,isVoid:n,markableVoid:r,deleteBackward:o}=e;return e.isInline=s=>qr(s)||t(s),e.isVoid=s=>qr(s)||n(s),e.markableVoid=s=>qr(s)||r(s),e.deleteBackward=s=>{const{selection:a}=e;if(a&&P.isCollapsed(a)){const[i]=y.nodes(e,{at:s==="character"?y.before(e,a,{unit:"character"}):a,match:qr});o(s),i&&$.insertText(e,wn)}else o(s)},e}function gw(e){return!("type"in e)&&"text"in e&&typeof e.text=="string"}function Th(e){return"type"in e&&e.type==="mention"}function Rh(e){return"type"in e&&e.type==="link"}function Ih(e){if(e.startsWith("http://")||e.startsWith("https://"))return e;if(e.startsWith("www."))return"https://"+e}const Bh=f.forwardRef(({children:e,asChild:t,...n},r)=>{const o=t?Ne:"span";return p.jsx(o,{...n,ref:r,children:e})}),Fh=f.forwardRef(({children:e,asChild:t,...n},r)=>{const o=t?Ne:"a";return p.jsx(o,{target:"_blank",rel:"noopener noreferrer nofollow",...n,ref:r,children:e})}),Cw={Mention:({userId:e})=>p.jsxs(Bh,{children:[wn,e]}),Link:({href:e,children:t})=>p.jsx(Fh,{href:e,children:t})},Ph=f.forwardRef(({body:e,components:t,style:n,asChild:r,...o},s)=>{const a=r?Ne:"div",{Mention:i,Link:u}=f.useMemo(()=>({...Cw,...t}),[t]);return!e||!e?.content?null:p.jsx(a,{...o,style:{whiteSpace:"break-spaces",...n},ref:s,children:e.content.map((c,l)=>{switch(c.type){case"paragraph":return p.jsx("p",{style:{minHeight:"1lh"},children:c.children.map((d,m)=>{if(Th(d))return d.id?p.jsx(i,{userId:d.id},m):null;if(Rh(d)){const C=Ih(d.url)??d.url;return p.jsx(u,{href:C,children:d.text??d.url},m)}let g=d.text;return d.bold&&(g=p.jsx("strong",{children:g},m)),d.italic&&(g=p.jsx("em",{children:g},m)),d.strikethrough&&(g=p.jsx("s",{children:g},m)),d.code&&(g=p.jsx("code",{children:g},m)),p.jsx("span",{children:g},m)})},l);default:return null}})})});var yw={isHistory(e){return ze(e)&&Array.isArray(e.redos)&&Array.isArray(e.undos)&&(e.redos.length===0||yn.isOperationList(e.redos[0].operations))&&(e.undos.length===0||yn.isOperationList(e.undos[0].operations))}},Ma=new WeakMap,Nn=new WeakMap,qo=new WeakMap,Ut={isHistoryEditor(e){return yw.isHistory(e.history)&&y.isEditor(e)},isMerging(e){return Nn.get(e)},isSplittingOnce(e){return qo.get(e)},setSplittingOnce(e,t){qo.set(e,t)},isSaving(e){return Ma.get(e)},redo(e){e.redo()},undo(e){e.undo()},withMerging(e,t){var n=Ut.isMerging(e);Nn.set(e,!0),t(),Nn.set(e,n)},withNewBatch(e,t){var n=Ut.isMerging(e);Nn.set(e,!0),qo.set(e,!0),t(),Nn.set(e,n),qo.delete(e)},withoutMerging(e,t){var n=Ut.isMerging(e);Nn.set(e,!1),t(),Nn.set(e,n)},withoutSaving(e,t){var n=Ut.isSaving(e);Ma.set(e,!1),t(),Ma.set(e,n)}},bw=e=>{var t=e,{apply:n}=t;return t.history={undos:[],redos:[]},t.redo=()=>{var{history:r}=t,{redos:o}=r;if(o.length>0){var s=o[o.length-1];s.selectionBefore&&$.setSelection(t,s.selectionBefore),Ut.withoutSaving(t,()=>{y.withoutNormalizing(t,()=>{for(var a of s.operations)t.apply(a)})}),r.redos.pop(),t.writeHistory("undos",s)}},t.undo=()=>{var{history:r}=t,{undos:o}=r;if(o.length>0){var s=o[o.length-1];Ut.withoutSaving(t,()=>{y.withoutNormalizing(t,()=>{var a=s.operations.map(yn.inverse).reverse();for(var i of a)t.apply(i);s.selectionBefore&&$.setSelection(t,s.selectionBefore)})}),t.writeHistory("redos",s),r.undos.pop()}},t.apply=r=>{var{operations:o,history:s}=t,{undos:a}=s,i=a[a.length-1],u=i&&i.operations[i.operations.length-1],c=Ut.isSaving(t),l=Ut.isMerging(t);if(c==null&&(c=Dw(r)),c){if(l==null&&(i==null?l=!1:o.length!==0?l=!0:l=Ew(r,u)),Ut.isSplittingOnce(t)&&(l=!1,Ut.setSplittingOnce(t,void 0)),i&&l)i.operations.push(r);else{var d={operations:[r],selectionBefore:t.selection};t.writeHistory("undos",d)}for(;a.length>100;)a.shift();s.redos=[]}n(r)},t.writeHistory=(r,o)=>{t.history[r].push(o)},t},Ew=(e,t)=>!!(t&&e.type==="insert_text"&&t.type==="insert_text"&&e.offset===t.offset+t.text.length&&S.equals(e.path,t.path)||t&&e.type==="remove_text"&&t.type==="remove_text"&&e.offset+e.text.length===t.offset&&S.equals(e.path,t.path)),Dw=(e,t)=>e.type!=="set_selection",_a,_l;function ww(){if(_l)return _a;_l=1,_a=o;var e="֑-߿יִ-﷽ﹰ-ﻼ",t="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",n=new RegExp("^[^"+t+"]*["+e+"]"),r=new RegExp("^[^"+e+"]*["+t+"]");function o(s){return s=String(s||""),n.test(s)?"rtl":r.test(s)?"ltr":"neutral"}return _a}var Aw=ww();const Nh=Vg(Aw);var ja=function(){return qg.Date.now()},xw="Expected a function",Ow=Math.max,Sw=Math.min;function kh(e,t,n){var r,o,s,a,i,u,c=0,l=!1,d=!1,m=!0;if(typeof e!="function")throw new TypeError(xw);t=Ec(t)||0,Ed(n)&&(l=!!n.leading,d="maxWait"in n,s=d?Ow(Ec(n.maxWait)||0,t):s,m="trailing"in n?!!n.trailing:m);function g(I){var O=r,F=o;return r=o=void 0,c=I,a=e.apply(F,O),a}function C(I){return c=I,i=setTimeout(E,t),l?g(I):a}function v(I){var O=I-u,F=I-c,H=t-O;return d?Sw(H,s-F):H}function h(I){var O=I-u,F=I-c;return u===void 0||O>=t||O<0||d&&F>=s}function E(){var I=ja();if(h(I))return b(I);i=setTimeout(E,v(I))}function b(I){return i=void 0,m&&r?g(I):(r=o=void 0,a)}function w(){i!==void 0&&clearTimeout(i),c=0,r=u=o=i=void 0}function D(){return i===void 0?a:b(ja())}function x(){var I=ja(),O=h(I);if(r=arguments,o=this,u=I,O){if(i===void 0)return C(u);if(d)return clearTimeout(i),i=setTimeout(E,t),g(u)}return i===void 0&&(i=setTimeout(E,t)),a}return x.cancel=w,x.flush=D,x}var Tw="Expected a function";function Rw(e,t,n){var r=!0,o=!0;if(typeof e!="function")throw new TypeError(Tw);return Ed(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),kh(e,t,{leading:r,maxWait:t,trailing:o})}const jl=e=>typeof e=="object"&&e!=null&&e.nodeType===1,Ll=(e,t)=>(!t||e!=="hidden")&&e!=="visible"&&e!=="clip",La=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){const n=getComputedStyle(e,null);return Ll(n.overflowY,t)||Ll(n.overflowX,t)||(r=>{const o=(s=>{if(!s.ownerDocument||!s.ownerDocument.defaultView)return null;try{return s.ownerDocument.defaultView.frameElement}catch{return null}})(r);return!!o&&(o.clientHeight<r.scrollHeight||o.clientWidth<r.scrollWidth)})(e)}return!1},Go=(e,t,n,r,o,s,a,i)=>s<e&&a>t||s>e&&a<t?0:s<=e&&i<=n||a>=t&&i>=n?s-e-r:a>t&&i<n||s<e&&i>n?a-t+o:0,Iw=e=>{const t=e.parentElement;return t??(e.getRootNode().host||null)},$l=(e,t)=>{var n,r,o,s;if(typeof document>"u")return[];const{scrollMode:a,block:i,inline:u,boundary:c,skipOverflowHiddenElements:l}=t,d=typeof c=="function"?c:re=>re!==c;if(!jl(e))throw new TypeError("Invalid target");const m=document.scrollingElement||document.documentElement,g=[];let C=e;for(;jl(C)&&d(C);){if(C=Iw(C),C===m){g.push(C);break}C!=null&&C===document.body&&La(C)&&!La(document.documentElement)||C!=null&&La(C,l)&&g.push(C)}const v=(r=(n=window.visualViewport)==null?void 0:n.width)!=null?r:innerWidth,h=(s=(o=window.visualViewport)==null?void 0:o.height)!=null?s:innerHeight,{scrollX:E,scrollY:b}=window,{height:w,width:D,top:x,right:I,bottom:O,left:F}=e.getBoundingClientRect(),{top:H,right:N,bottom:j,left:B}=(re=>{const Y=window.getComputedStyle(re);return{top:parseFloat(Y.scrollMarginTop)||0,right:parseFloat(Y.scrollMarginRight)||0,bottom:parseFloat(Y.scrollMarginBottom)||0,left:parseFloat(Y.scrollMarginLeft)||0}})(e);let k=i==="start"||i==="nearest"?x-H:i==="end"?O+j:x+w/2-H+j,M=u==="center"?F+D/2-B+N:u==="end"?I+N:F-B;const W=[];for(let re=0;re<g.length;re++){const Y=g[re],{height:ee,width:L,top:Q,right:V,bottom:te,left:se}=Y.getBoundingClientRect();if(a==="if-needed"&&x>=0&&F>=0&&O<=h&&I<=v&&x>=Q&&O<=te&&F>=se&&I<=V)return W;const de=getComputedStyle(Y),G=parseInt(de.borderLeftWidth,10),R=parseInt(de.borderTopWidth,10),_=parseInt(de.borderRightWidth,10),U=parseInt(de.borderBottomWidth,10);let X=0,fe=0;const le="offsetWidth"in Y?Y.offsetWidth-Y.clientWidth-G-_:0,T="offsetHeight"in Y?Y.offsetHeight-Y.clientHeight-R-U:0,q="offsetWidth"in Y?Y.offsetWidth===0?0:L/Y.offsetWidth:0,ne="offsetHeight"in Y?Y.offsetHeight===0?0:ee/Y.offsetHeight:0;if(m===Y)X=i==="start"?k:i==="end"?k-h:i==="nearest"?Go(b,b+h,h,R,U,b+k,b+k+w,w):k-h/2,fe=u==="start"?M:u==="center"?M-v/2:u==="end"?M-v:Go(E,E+v,v,G,_,E+M,E+M+D,D),X=Math.max(0,X+b),fe=Math.max(0,fe+E);else{X=i==="start"?k-Q-R:i==="end"?k-te+U+T:i==="nearest"?Go(Q,te,ee,R,U+T,k,k+w,w):k-(Q+ee/2)+T/2,fe=u==="start"?M-se-G:u==="center"?M-(se+L/2)+le/2:u==="end"?M-V+_+le:Go(se,V,L,G,_+le,M,M+D,D);const{scrollLeft:ie,scrollTop:we}=Y;X=ne===0?0:Math.max(0,Math.min(we+X/ne,Y.scrollHeight-ee/ne+T)),fe=q===0?0:Math.max(0,Math.min(ie+fe/q,Y.scrollWidth-L/q+le)),k+=we-X,M+=ie-fe}W.push({el:Y,top:X,left:fe})}return W},Bw=e=>e===!1?{block:"end",inline:"nearest"}:(t=>t===Object(t)&&Object.keys(t).length!==0)(e)?e:{block:"start",inline:"nearest"};function Fw(e,t){if(!e.isConnected||!(o=>{let s=o;for(;s&&s.parentNode;){if(s.parentNode===document)return!0;s=s.parentNode instanceof ShadowRoot?s.parentNode.host:s.parentNode}return!1})(e))return;const n=(o=>{const s=window.getComputedStyle(o);return{top:parseFloat(s.scrollMarginTop)||0,right:parseFloat(s.scrollMarginRight)||0,bottom:parseFloat(s.scrollMarginBottom)||0,left:parseFloat(s.scrollMarginLeft)||0}})(e);if((o=>typeof o=="object"&&typeof o.behavior=="function")(t))return t.behavior($l(e,t));const r=typeof t=="boolean"||t==null?void 0:t.behavior;for(const{el:o,top:s,left:a}of $l(e,Bw(t))){const i=s-n.top+n.bottom,u=a-n.left+n.right;o.scroll({top:i,left:u,behavior:r})}}var Un=[],Pw=function(){return Un.some(function(e){return e.activeTargets.length>0})},Nw=function(){return Un.some(function(e){return e.skippedTargets.length>0})},Ul="ResizeObserver loop completed with undelivered notifications.",kw=function(){var e;typeof ErrorEvent=="function"?e=new ErrorEvent("error",{message:Ul}):(e=document.createEvent("Event"),e.initEvent("error",!1,!1),e.message=Ul),window.dispatchEvent(e)},lo;(function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(lo||(lo={}));var Hn=function(e){return Object.freeze(e)},Mw=function(){function e(t,n){this.inlineSize=t,this.blockSize=n,Hn(this)}return e}(),Mh=function(){function e(t,n,r,o){return this.x=t,this.y=n,this.width=r,this.height=o,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Hn(this)}return e.prototype.toJSON=function(){var t=this,n=t.x,r=t.y,o=t.top,s=t.right,a=t.bottom,i=t.left,u=t.width,c=t.height;return{x:n,y:r,top:o,right:s,bottom:a,left:i,width:u,height:c}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),Eu=function(e){return e instanceof SVGElement&&"getBBox"in e},_h=function(e){if(Eu(e)){var t=e.getBBox(),n=t.width,r=t.height;return!n&&!r}var o=e,s=o.offsetWidth,a=o.offsetHeight;return!(s||a||e.getClientRects().length)},Hl=function(e){var t;if(e instanceof Element)return!0;var n=(t=e?.ownerDocument)===null||t===void 0?void 0:t.defaultView;return!!(n&&e instanceof n.Element)},_w=function(e){switch(e.tagName){case"INPUT":if(e.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},Wn=typeof window<"u"?window:{},Yo=new WeakMap,Wl=/auto|scroll/,jw=/^tb|vertical/,Lw=/msie|trident/i.test(Wn.navigator&&Wn.navigator.userAgent),jt=function(e){return parseFloat(e||"0")},yr=function(e,t,n){return e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=!1),new Mw((n?t:e)||0,(n?e:t)||0)},zl=Hn({devicePixelContentBoxSize:yr(),borderBoxSize:yr(),contentBoxSize:yr(),contentRect:new Mh(0,0,0,0)}),jh=function(e,t){if(t===void 0&&(t=!1),Yo.has(e)&&!t)return Yo.get(e);if(_h(e))return Yo.set(e,zl),zl;var n=getComputedStyle(e),r=Eu(e)&&e.ownerSVGElement&&e.getBBox(),o=!Lw&&n.boxSizing==="border-box",s=jw.test(n.writingMode||""),a=!r&&Wl.test(n.overflowY||""),i=!r&&Wl.test(n.overflowX||""),u=r?0:jt(n.paddingTop),c=r?0:jt(n.paddingRight),l=r?0:jt(n.paddingBottom),d=r?0:jt(n.paddingLeft),m=r?0:jt(n.borderTopWidth),g=r?0:jt(n.borderRightWidth),C=r?0:jt(n.borderBottomWidth),v=r?0:jt(n.borderLeftWidth),h=d+c,E=u+l,b=v+g,w=m+C,D=i?e.offsetHeight-w-e.clientHeight:0,x=a?e.offsetWidth-b-e.clientWidth:0,I=o?h+b:0,O=o?E+w:0,F=r?r.width:jt(n.width)-I-x,H=r?r.height:jt(n.height)-O-D,N=F+h+x+b,j=H+E+D+w,B=Hn({devicePixelContentBoxSize:yr(Math.round(F*devicePixelRatio),Math.round(H*devicePixelRatio),s),borderBoxSize:yr(N,j,s),contentBoxSize:yr(F,H,s),contentRect:new Mh(d,u,F,H)});return Yo.set(e,B),B},Lh=function(e,t,n){var r=jh(e,n),o=r.borderBoxSize,s=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(t){case lo.DEVICE_PIXEL_CONTENT_BOX:return a;case lo.BORDER_BOX:return o;default:return s}},$w=function(){function e(t){var n=jh(t);this.target=t,this.contentRect=n.contentRect,this.borderBoxSize=Hn([n.borderBoxSize]),this.contentBoxSize=Hn([n.contentBoxSize]),this.devicePixelContentBoxSize=Hn([n.devicePixelContentBoxSize])}return e}(),$h=function(e){if(_h(e))return 1/0;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},Uw=function(){var e=1/0,t=[];Un.forEach(function(a){if(a.activeTargets.length!==0){var i=[];a.activeTargets.forEach(function(c){var l=new $w(c.target),d=$h(c.target);i.push(l),c.lastReportedSize=Lh(c.target,c.observedBox),d<e&&(e=d)}),t.push(function(){a.callback.call(a.observer,i,a.observer)}),a.activeTargets.splice(0,a.activeTargets.length)}});for(var n=0,r=t;n<r.length;n++){var o=r[n];o()}return e},Vl=function(e){Un.forEach(function(n){n.activeTargets.splice(0,n.activeTargets.length),n.skippedTargets.splice(0,n.skippedTargets.length),n.observationTargets.forEach(function(o){o.isActive()&&($h(o.target)>e?n.activeTargets.push(o):n.skippedTargets.push(o))})})},Hw=function(){var e=0;for(Vl(e);Pw();)e=Uw(),Vl(e);return Nw()&&kw(),e>0},$a,Uh=[],Ww=function(){return Uh.splice(0).forEach(function(e){return e()})},zw=function(e){if(!$a){var t=0,n=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return Ww()}).observe(n,r),$a=function(){n.textContent="".concat(t?t--:t++)}}Uh.push(e),$a()},Vw=function(e){zw(function(){requestAnimationFrame(e)})},us=0,Kw=function(){return!!us},qw=250,Gw={attributes:!0,characterData:!0,childList:!0,subtree:!0},Kl=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],ql=function(e){return e===void 0&&(e=0),Date.now()+e},Ua=!1,Yw=function(){function e(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return e.prototype.run=function(t){var n=this;if(t===void 0&&(t=qw),!Ua){Ua=!0;var r=ql(t);Vw(function(){var o=!1;try{o=Hw()}finally{if(Ua=!1,t=r-ql(),!Kw())return;o?n.run(1e3):t>0?n.run(t):n.start()}})}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var t=this,n=function(){return t.observer&&t.observer.observe(document.body,Gw)};document.body?n():Wn.addEventListener("DOMContentLoaded",n)},e.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Kl.forEach(function(n){return Wn.addEventListener(n,t.listener,!0)}))},e.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),Kl.forEach(function(n){return Wn.removeEventListener(n,t.listener,!0)}),this.stopped=!0)},e}(),xi=new Yw,Gl=function(e){!us&&e>0&&xi.start(),us+=e,!us&&xi.stop()},Xw=function(e){return!Eu(e)&&!_w(e)&&getComputedStyle(e).display==="inline"},Zw=function(){function e(t,n){this.target=t,this.observedBox=n||lo.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var t=Lh(this.target,this.observedBox,!0);return Xw(this.target)&&(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e}(),Jw=function(){function e(t,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=n}return e}(),Xo=new WeakMap,Yl=function(e,t){for(var n=0;n<e.length;n+=1)if(e[n].target===t)return n;return-1},Zo=function(){function e(){}return e.connect=function(t,n){var r=new Jw(t,n);Xo.set(t,r)},e.observe=function(t,n,r){var o=Xo.get(t),s=o.observationTargets.length===0;Yl(o.observationTargets,n)<0&&(s&&Un.push(o),o.observationTargets.push(new Zw(n,r&&r.box)),Gl(1),xi.schedule())},e.unobserve=function(t,n){var r=Xo.get(t),o=Yl(r.observationTargets,n),s=r.observationTargets.length===1;o>=0&&(s&&Un.splice(Un.indexOf(r),1),r.observationTargets.splice(o,1),Gl(-1))},e.disconnect=function(t){var n=this,r=Xo.get(t);r.observationTargets.slice().forEach(function(o){return n.unobserve(t,o.target)}),r.activeTargets.splice(0,r.activeTargets.length)},e}(),Qw=function(){function e(t){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof t!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Zo.connect(this,t)}return e.prototype.observe=function(t,n){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Hl(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Zo.observe(this,t,n)},e.prototype.unobserve=function(t){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Hl(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Zo.unobserve(this,t)},e.prototype.disconnect=function(){Zo.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}(),St={},Xl;function eA(){if(Xl)return St;Xl=1,Object.defineProperty(St,"__esModule",{value:!0});for(var e=typeof window<"u"&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),t={alt:"altKey",control:"ctrlKey",meta:"metaKey",shift:"shiftKey"},n={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:e?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},r={backspace:8,tab:9,enter:13,shift:16,control:17,alt:18,pause:19,capslock:20,escape:27," ":32,pageup:33,pagedown:34,end:35,home:36,arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,insert:45,delete:46,meta:91,numlock:144,scrolllock:145,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},o=1;o<20;o++)r["f"+o]=111+o;function s(m,g,C){g&&!("byKey"in g)&&(C=g,g=null),Array.isArray(m)||(m=[m]);var v=m.map(function(b){return u(b,g)}),h=function(w){return v.some(function(D){return c(D,w)})},E=C==null?h:h(C);return E}function a(m,g){return s(m,g)}function i(m,g){return s(m,{byKey:!0},g)}function u(m,g){var C=g&&g.byKey,v={};m=m.replace("++","+add");var h=m.split("+"),E=h.length;for(var b in t)v[t[b]]=!1;var w=!0,D=!1,x=void 0;try{for(var I=h[Symbol.iterator](),O;!(w=(O=I.next()).done);w=!0){var F=O.value,H=F.endsWith("?")&&F.length>1;H&&(F=F.slice(0,-1));var N=d(F),j=t[N];if(F.length>1&&!j&&!n[F]&&!r[N])throw new TypeError('Unknown modifier: "'+F+'"');(E===1||!j)&&(C?v.key=N:v.which=l(F)),j&&(v[j]=H?null:!0)}}catch(B){D=!0,x=B}finally{try{!w&&I.return&&I.return()}finally{if(D)throw x}}return v}function c(m,g){for(var C in m){var v=m[C],h=void 0;if(v!=null&&(C==="key"&&g.key!=null?h=g.key.toLowerCase():C==="which"?h=v===91&&g.which===93?91:g.which:h=g[C],!(h==null&&v===!1)&&h!==v))return!1}return!0}function l(m){m=d(m);var g=r[m]||m.toUpperCase().charCodeAt(0);return g}function d(m){return m=m.toLowerCase(),m=n[m]||m,m}return St.default=s,St.isHotkey=s,St.isCodeHotkey=a,St.isKeyHotkey=i,St.parseHotkey=u,St.compareHotkey=c,St.toKeyCode=l,St.toKeyName=d,St}var Ha=eA();function tA(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,s;for(s=0;s<r.length;s++)o=r[s],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function Tr(e,t){if(e==null)return{};var n=tA(e,t),r,o;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(o=0;o<s.length;o++)r=s[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function fo(e){"@babel/helpers - typeof";return fo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fo(e)}function nA(e,t){if(fo(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(fo(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function rA(e){var t=nA(e,"string");return fo(t)==="symbol"?t:String(t)}function At(e,t,n){return t=rA(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Du=f.createContext(null),Gt=()=>{var e=f.useContext(Du);if(!e)throw new Error("The `useSlateStatic` hook must be used inside the <Slate> component's context.");return e},Wa,za,Hh=parseInt(me.version.split(".")[0],10),Wh=typeof navigator<"u"&&typeof window<"u"&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Zl=typeof navigator<"u"&&/Mac OS X/.test(navigator.userAgent),nt=typeof navigator<"u"&&/Android/.test(navigator.userAgent),mr=typeof navigator<"u"&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Mn=typeof navigator<"u"&&/AppleWebKit(?!.*Chrome)/i.test(navigator.userAgent),oA=typeof navigator<"u"&&/Edge?\/(?:[0-6][0-9]|[0-7][0-8])(?:\.)/i.test(navigator.userAgent),zh=typeof navigator<"u"&&/Chrome/i.test(navigator.userAgent),sA=typeof navigator<"u"&&/Chrome?\/(?:[0-7][0-5]|[0-6][0-9])(?:\.)/i.test(navigator.userAgent),aA=nt&&typeof navigator<"u"&&/Chrome?\/(?:[0-5]?\d)(?:\.)/i.test(navigator.userAgent),iA=typeof navigator<"u"&&/^(?!.*Seamonkey)(?=.*Firefox\/(?:[0-7][0-9]|[0-8][0-6])(?:\.)).*/i.test(navigator.userAgent),uA=typeof navigator<"u"&&/.*UCBrowser/.test(navigator.userAgent),cA=typeof navigator<"u"&&/.*Wechat/.test(navigator.userAgent)&&!/.*MacWechat/.test(navigator.userAgent),cs=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&/Version\/(\d+)/.test(navigator.userAgent)&&((Wa=navigator.userAgent.match(/Version\/(\d+)/))!==null&&Wa!==void 0&&Wa[1]&&parseInt((za=navigator.userAgent.match(/Version\/(\d+)/))===null||za===void 0?void 0:za[1],10)<17);var dn=(!sA||!aA)&&!oA&&typeof globalThis<"u"&&globalThis.InputEvent&&typeof globalThis.InputEvent.prototype.getTargetRanges=="function",br=new WeakMap,wu=new WeakMap,Au=new WeakMap,Vh=new WeakMap,ls=new WeakMap,Oi=new WeakMap,ho=new WeakMap,zn=new WeakMap,Ts=new WeakMap,Js=new WeakMap,Si=new WeakMap,bn=new WeakMap,jn=new WeakMap,to=new WeakMap,Ti=new WeakMap,xu=new WeakMap,Ft=new WeakMap,Qt=new WeakMap,st=new WeakMap,mn=new WeakMap,vn=new WeakMap,Kh=new WeakMap,Rr=Symbol("placeholder"),qh=Symbol("mark-placeholder"),Gh=globalThis.Node,lA=globalThis.Text,Ou=e=>e&&e.ownerDocument&&e.ownerDocument.defaultView||null,fA=e=>An(e)&&e.nodeType===8,Et=e=>An(e)&&e.nodeType===1,An=e=>{var t=Ou(e);return!!t&&e instanceof t.Node},Ri=e=>{var t=e&&e.anchorNode&&Ou(e.anchorNode);return!!t&&e instanceof t.Selection},Yh=e=>An(e)&&e.nodeType===3,dA=e=>e.clipboardData&&e.clipboardData.getData("text/plain")!==""&&e.clipboardData.types.length===1,hA=e=>{var[t,n]=e;if(Et(t)&&t.childNodes.length){var r=n===t.childNodes.length,o=r?n-1:n;for([t,o]=Xh(t,o,r?"backward":"forward"),r=o<n;Et(t)&&t.childNodes.length;){var s=r?t.childNodes.length-1:0;t=mA(t,s,r?"backward":"forward")}n=r&&t.textContent!=null?t.textContent.length:0}return[t,n]},pA=e=>{for(var t=e&&e.parentNode;t;){if(t.toString()==="[object ShadowRoot]")return!0;t=t.parentNode}return!1},Xh=(e,t,n)=>{for(var{childNodes:r}=e,o=r[t],s=t,a=!1,i=!1;(fA(o)||Et(o)&&o.childNodes.length===0||Et(o)&&o.getAttribute("contenteditable")==="false")&&!(a&&i);){if(s>=r.length){a=!0,s=t-1,n="backward";continue}if(s<0){i=!0,s=t+1,n="forward";continue}o=r[s],t=s,s+=n==="forward"?1:-1}return[o,t]},mA=(e,t,n)=>{var[r]=Xh(e,t,n);return r},Zh=e=>{var t="";if(Yh(e)&&e.nodeValue)return e.nodeValue;if(Et(e)){for(var n of Array.from(e.childNodes))t+=Zh(n);var r=getComputedStyle(e).getPropertyValue("display");(r==="block"||r==="list"||e.tagName==="BR")&&(t+=`
4
4
  `)}return t},vA=/data-slate-fragment="(.+?)"/m,gA=e=>{var t=e.getData("text/html"),[,n]=t.match(vA)||[];return n},no=e=>e.getSelection!=null?e.getSelection():document.getSelection(),Su=(e,t,n)=>{var{target:r}=t;if(Et(r)&&r.matches('[contentEditable="false"]'))return!1;var{document:o}=z.getWindow(e);if(o.contains(r))return z.hasDOMNode(e,r,{editable:!0});var s=n.find(a=>{var{addedNodes:i,removedNodes:u}=a;for(var c of i)if(c===r||c.contains(r))return!0;for(var l of u)if(l===r||l.contains(r))return!0});return!s||s===t?!1:Su(e,s,n)},CA=()=>{for(var e=document.activeElement;(t=e)!==null&&t!==void 0&&t.shadowRoot&&(n=e.shadowRoot)!==null&&n!==void 0&&n.activeElement;){var t,n,r;e=(r=e)===null||r===void 0||(r=r.shadowRoot)===null||r===void 0?void 0:r.activeElement}return e},Jl=(e,t)=>!!(e.compareDocumentPosition(t)&Gh.DOCUMENT_POSITION_PRECEDING),yA=(e,t)=>!!(e.compareDocumentPosition(t)&Gh.DOCUMENT_POSITION_FOLLOWING),bA=0;class EA{constructor(){At(this,"id",void 0),this.id="".concat(bA++)}}var z={androidPendingDiffs:e=>st.get(e),androidScheduleFlush:e=>{var t;(t=xu.get(e))===null||t===void 0||t()},blur:e=>{var t=z.toDOMNode(e,e),n=z.findDocumentOrShadowRoot(e);bn.set(e,!1),n.activeElement===t&&t.blur()},deselect:e=>{var{selection:t}=e,n=z.findDocumentOrShadowRoot(e),r=no(n);r&&r.rangeCount>0&&r.removeAllRanges(),t&&$.deselect(e)},findDocumentOrShadowRoot:e=>{var t=z.toDOMNode(e,e),n=t.getRootNode();return n instanceof Document||n instanceof ShadowRoot?n:t.ownerDocument},findEventRange:(e,t)=>{"nativeEvent"in t&&(t=t.nativeEvent);var{clientX:n,clientY:r,target:o}=t;if(n==null||r==null)throw new Error("Cannot resolve a Slate range from a DOM event: ".concat(t));var s=z.toSlateNode(e,t.target),a=z.findPath(e,s);if(ue.isElement(s)&&y.isVoid(e,s)){var i=o.getBoundingClientRect(),u=e.isInline(s)?n-i.left<i.left+i.width-n:r-i.top<i.top+i.height-r,c=y.point(e,a,{edge:u?"start":"end"}),l=u?y.before(e,c):y.after(e,c);if(l){var d=y.range(e,l);return d}}var m,{document:g}=z.getWindow(e);if(g.caretRangeFromPoint)m=g.caretRangeFromPoint(n,r);else{var C=g.caretPositionFromPoint(n,r);C&&(m=g.createRange(),m.setStart(C.offsetNode,C.offset),m.setEnd(C.offsetNode,C.offset))}if(!m)throw new Error("Cannot resolve a Slate range from a DOM event: ".concat(t));var v=z.toSlateRange(e,m,{exactMatch:!1,suppressThrow:!1});return v},findKey:(e,t)=>{var n=Ts.get(t);return n||(n=new EA,Ts.set(t,n)),n},findPath:(e,t)=>{for(var n=[],r=t;;){var o=Au.get(r);if(o==null){if(y.isEditor(r))return n;break}var s=wu.get(r);if(s==null)break;n.unshift(s),r=o}throw new Error("Unable to find the path for Slate node: ".concat(Ve.stringify(t)))},focus:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{retries:5};if(!bn.get(t)){if(n.retries<=0)throw new Error("Could not set focus, editor seems stuck with pending operations");if(t.operations.length>0){setTimeout(()=>{z.focus(t,{retries:n.retries-1})},10);return}var r=z.toDOMNode(t,t),o=z.findDocumentOrShadowRoot(t);if(o.activeElement!==r){if(t.selection&&o instanceof Document){var s=no(o),a=z.toDOMRange(t,t.selection);s?.removeAllRanges(),s?.addRange(a)}t.selection||$.select(t,y.start(t,[])),bn.set(t,!0),r.focus({preventScroll:!0})}}},getWindow:e=>{var t=Vh.get(e);if(!t)throw new Error("Unable to find a host window element for this editor");return t},hasDOMNode:function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{editable:o=!1}=r,s=z.toDOMNode(t,t),a;try{a=Et(n)?n:n.parentElement}catch(i){if(i instanceof Error&&!i.message.includes('Permission denied to access property "nodeType"'))throw i}return a?a.closest("[data-slate-editor]")===s&&(!o||a.isContentEditable?!0:typeof a.isContentEditable=="boolean"&&a.closest('[contenteditable="false"]')===s||!!a.getAttribute("data-slate-zero-width")):!1},hasEditableTarget:(e,t)=>An(t)&&z.hasDOMNode(e,t,{editable:!0}),hasRange:(e,t)=>{var{anchor:n,focus:r}=t;return y.hasPath(e,n.path)&&y.hasPath(e,r.path)},hasSelectableTarget:(e,t)=>z.hasEditableTarget(e,t)||z.isTargetInsideNonReadonlyVoid(e,t),hasTarget:(e,t)=>An(t)&&z.hasDOMNode(e,t),insertData:(e,t)=>{e.insertData(t)},insertFragmentData:(e,t)=>e.insertFragmentData(t),insertTextData:(e,t)=>e.insertTextData(t),isComposing:e=>!!jn.get(e),isFocused:e=>!!bn.get(e),isReadOnly:e=>!!Si.get(e),isTargetInsideNonReadonlyVoid:(e,t)=>{if(Si.get(e))return!1;var n=z.hasTarget(e,t)&&z.toSlateNode(e,t);return ue.isElement(n)&&y.isVoid(e,n)},setFragmentData:(e,t,n)=>e.setFragmentData(t,n),toDOMNode:(e,t)=>{var n=Js.get(e),r=y.isEditor(t)?ls.get(e):n?.get(z.findKey(e,t));if(!r)throw new Error("Cannot resolve a DOM node from Slate node: ".concat(Ve.stringify(t)));return r},toDOMPoint:(e,t)=>{var[n]=y.node(e,t.path),r=z.toDOMNode(e,n),o;y.void(e,{at:t})&&(t={path:t.path,offset:0});for(var s="[data-slate-string], [data-slate-zero-width]",a=Array.from(r.querySelectorAll(s)),i=0,u=0;u<a.length;u++){var c=a[u],l=c.childNodes[0];if(!(l==null||l.textContent==null)){var{length:d}=l.textContent,m=c.getAttribute("data-slate-length"),g=m==null?d:parseInt(m,10),C=i+g,v=a[u+1];if(t.offset===C&&v!==null&&v!==void 0&&v.hasAttribute("data-slate-mark-placeholder")){var h,E=v.childNodes[0];o=[E instanceof lA?E:v,(h=v.textContent)!==null&&h!==void 0&&h.startsWith("\uFEFF")?1:0];break}if(t.offset<=C){var b=Math.min(d,Math.max(0,t.offset-i));o=[l,b];break}i=C}}if(!o)throw new Error("Cannot resolve a DOM point from Slate point: ".concat(Ve.stringify(t)));return o},toDOMRange:(e,t)=>{var{anchor:n,focus:r}=t,o=P.isBackward(t),s=z.toDOMPoint(e,n),a=P.isCollapsed(t)?s:z.toDOMPoint(e,r),i=z.getWindow(e),u=i.document.createRange(),[c,l]=o?a:s,[d,m]=o?s:a,g=Et(c)?c:c.parentElement,C=!!g.getAttribute("data-slate-zero-width"),v=Et(d)?d:d.parentElement,h=!!v.getAttribute("data-slate-zero-width");return u.setStart(c,C?1:l),u.setEnd(d,h?1:m),u},toSlateNode:(e,t)=>{var n=Et(t)?t:t.parentElement;n&&!n.hasAttribute("data-slate-node")&&(n=n.closest("[data-slate-node]"));var r=n?ho.get(n):null;if(!r)throw new Error("Cannot resolve a Slate node from DOM node: ".concat(n));return r},toSlatePoint:(e,t,n)=>{var{exactMatch:r,suppressThrow:o,searchDirection:s="backward"}=n,[a,i]=r?t:hA(t),u=a.parentNode,c=null,l=0;if(u){var d,m,g=z.toDOMNode(e,e),C=u.closest('[data-slate-void="true"]'),v=C&&g.contains(C)?C:null,h=u.closest('[contenteditable="false"]'),E=h&&g.contains(h)?h:null,b=u.closest("[data-slate-leaf]"),w=null;if(b){if(c=b.closest('[data-slate-node="text"]'),c){var D=z.getWindow(e),x=D.document.createRange();x.setStart(c,0),x.setEnd(a,i);var I=x.cloneContents(),O=[...Array.prototype.slice.call(I.querySelectorAll("[data-slate-zero-width]")),...Array.prototype.slice.call(I.querySelectorAll("[contenteditable=false]"))];O.forEach(se=>{if(nt&&!r&&se.hasAttribute("data-slate-zero-width")&&se.textContent.length>0&&se.textContext!=="\uFEFF"){se.textContent.startsWith("\uFEFF")&&(se.textContent=se.textContent.slice(1));return}se.parentNode.removeChild(se)}),l=I.textContent.length,w=c}}else if(v){for(var F=v.querySelectorAll("[data-slate-leaf]"),H=0;H<F.length;H++){var N=F[H];if(z.hasDOMNode(e,N)){b=N;break}}b?(c=b.closest('[data-slate-node="text"]'),w=b,l=w.textContent.length,w.querySelectorAll("[data-slate-zero-width]").forEach(se=>{l-=se.textContent.length})):l=1}else if(E){var j=se=>se?se.querySelectorAll("[data-slate-leaf]:not(:scope [data-slate-editor] [data-slate-leaf])"):[],B=E.closest('[data-slate-node="element"]');if(s==="forward"){var k,M=[...j(B),...j(B?.nextElementSibling)];b=(k=M.find(se=>yA(E,se)))!==null&&k!==void 0?k:null}else{var W,re=[...j(B?.previousElementSibling),...j(B)];b=(W=re.findLast(se=>Jl(E,se)))!==null&&W!==void 0?W:null}b&&(c=b.closest('[data-slate-node="text"]'),w=b,s==="forward"?l=0:(l=w.textContent.length,w.querySelectorAll("[data-slate-zero-width]").forEach(se=>{l-=se.textContent.length})))}w&&l===w.textContent.length&&nt&&w.getAttribute("data-slate-zero-width")==="z"&&(d=w.textContent)!==null&&d!==void 0&&d.startsWith("\uFEFF")&&(u.hasAttribute("data-slate-zero-width")||mr&&(m=w.textContent)!==null&&m!==void 0&&m.endsWith(`