@zeniai/web-cockpit-ui 1.14.88-prod → 1.14.89-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 (232) hide show
  1. package/dist/assets/{ACHDetailsPage-BBq7KpbY-DF9mhOLo.js → ACHDetailsPage-BBq7KpbY-DmD51smT.js} +1 -1
  2. package/dist/assets/{AIPerformancePage-Djq6mgKa-D2-ZMcc5.js → AIPerformancePage-Djq6mgKa-C2iGvIUP.js} +11 -11
  3. package/dist/assets/{AccountInfoPage-CxWBk_t_-B6N9dho0.js → AccountInfoPage-CxWBk_t_-BI9wbnyE.js} +1 -1
  4. package/dist/assets/{AccountInfoPageContent-DO6aVqBW-D2G7pMZi.js → AccountInfoPageContent-DO6aVqBW-6U18ww_h.js} +1 -1
  5. package/dist/assets/{AccountLockedInfoModal-DVvzKHJQ-BusmcQJv.js → AccountLockedInfoModal-DVvzKHJQ-BlItIAEt.js} +1 -1
  6. package/dist/assets/{AccountReconDetailsDrawerPage-DEKzSPCP-BYDoTrOZ.js → AccountReconDetailsDrawerPage-DEKzSPCP-DohPnhDC.js} +14 -14
  7. package/dist/assets/{AccountRow-Ck53DDbT-pVq02fp8.js → AccountRow-Ck53DDbT-BeebPIea.js} +21 -21
  8. package/dist/assets/{AccountsPromoCardStack-BYjuB-4I-Hx7dozh-.js → AccountsPromoCardStack-BYjuB-4I-DMxflS-k.js} +8 -8
  9. package/dist/assets/{AddAddressForCardDrawer-e8qbO2Y5-nX0udyvd.js → AddAddressForCardDrawer-e8qbO2Y5-CvQDLLw2.js} +1 -1
  10. package/dist/assets/{AddToWalletPage-DA6AmuaY-qriIpnYe.js → AddToWalletPage-DA6AmuaY-e01eq7ol.js} +5 -5
  11. package/dist/assets/{AgingReportsPage-B_Hhl_Is-g-SRao1T.js → AgingReportsPage-B_Hhl_Is-4sV-u-EE.js} +5 -5
  12. package/dist/assets/{AllUserItems-BV22Ibpn-CEp8prrW.js → AllUserItems-BV22Ibpn-WegHhloq.js} +1 -1
  13. package/dist/assets/{ApAgingDetailPage-DqV1vOVH-CNER43iu.js → ApAgingDetailPage-DqV1vOVH-DDYGtIes.js} +1 -1
  14. package/dist/assets/{AppBasePage-LrgCcvIv-pzRDvRIV.js → AppBasePage-LrgCcvIv-CPbTcwwM.js} +4 -4
  15. package/dist/assets/{AppDrawerContent-aZG5Qc_X-HF__9zgn.js → AppDrawerContent-aZG5Qc_X-0oLi5_ah.js} +1 -1
  16. package/dist/assets/ApprovalRulesSettingsPage-DQQw30S5-BEsS6TL7.js +47 -0
  17. package/dist/assets/{ArAgingChart-Am7LTkqG-E4lvgjGa.js → ArAgingChart-Am7LTkqG-CEoxIo8X.js} +4 -4
  18. package/dist/assets/{ArAgingDetailPage-BEKsyA9Q-CPaZNWaY.js → ArAgingDetailPage-BEKsyA9Q-DyjljPZX.js} +1 -1
  19. package/dist/assets/{AttachmentView-Bujbmx1d-BpqKAITM.js → AttachmentView-Bujbmx1d-B9I0wNAl.js} +1 -1
  20. package/dist/assets/{BankAccountSection-C5rYUW3V-BCOrI2zz.js → BankAccountSection-C5rYUW3V-B24i3wVy.js} +3 -3
  21. package/dist/assets/{BankAccountWarningSection-DakysSbk-BrOBdVlr.js → BankAccountWarningSection-DakysSbk-CfJ3ZIAx.js} +1 -1
  22. package/dist/assets/{BankConnectionsSettingsPage-BjZDNgZG-BqTLt_Xy.js → BankConnectionsSettingsPage-BjZDNgZG-CWXR52fl.js} +7 -7
  23. package/dist/assets/{BillDetailPage-DYc_nZRU-9SJltYSx.js → BillDetailPage-DYc_nZRU-BRz45yqn.js} +2 -2
  24. package/dist/assets/{BillPayApprovalRuleDetailPage-ppU1Epmy-DvxlAPhL.js → BillPayApprovalRuleDetailPage-ppU1Epmy-CKu9yeh6.js} +1 -1
  25. package/dist/assets/{BillPayApprovalRulesPage-UblNi2mR-DWfMi9Ia.js → BillPayApprovalRulesPage-UblNi2mR-DDdlB9l6.js} +1 -1
  26. package/dist/assets/{BillPayPromoPage-BK2J56U5-CXL9s4dw.js → BillPayPromoPage-BK2J56U5-BV_HtQh9.js} +5 -5
  27. package/dist/assets/{BillPaySetUpPage-Jic5E25q-CMtH3BoF.js → BillPaySetUpPage-Jic5E25q-B-iLCf2O.js} +2 -2
  28. package/dist/assets/{BillingSettingsPage-CKZVChEm-CQVpThSa.js → BillingSettingsPage-CKZVChEm-D4ayDBSH.js} +4 -4
  29. package/dist/assets/{BillsBulkReviewDrawerPage-C4Ra5e82-CQ4D75c-.js → BillsBulkReviewDrawerPage-C4Ra5e82-Ci4V1_TC.js} +1 -1
  30. package/dist/assets/{BoxItem-8PfNfaHq-6bFTfHVl.js → BoxItem-8PfNfaHq-CqIGaIYz.js} +1 -1
  31. package/dist/assets/{BusinessVerificationPage-JGge-Iiw-IDjENT0s.js → BusinessVerificationPage-JGge-Iiw-DkN8E6Gl.js} +5 -5
  32. package/dist/assets/{CardNumberSubText-W81SQ4GF-Bt4a5S33.js → CardNumberSubText-W81SQ4GF-D5AG2b-c.js} +1 -1
  33. package/dist/assets/{CashbackDetailPage-DnOcmx2i-CN8nuDt2.js → CashbackDetailPage-DnOcmx2i-DuXs2k0a.js} +7 -7
  34. package/dist/assets/{ChargeCardDetailPage-DNVMsxzE-CvKk_X-x.js → ChargeCardDetailPage-DNVMsxzE-W83HRYcY.js} +1 -1
  35. package/dist/assets/{ChargeCardListPage-Dgj-WWWI-CWkcKwWI.js → ChargeCardListPage-Dgj-WWWI-C1jII8Vl.js} +14 -14
  36. package/dist/assets/{ChargeCardListTable-uJZKWoh7-C3lLpElH.js → ChargeCardListTable-uJZKWoh7-DGMj8Kk8.js} +16 -16
  37. package/dist/assets/{ChargeCardPromoPage-uqT96W3_-XA2uFoR4.js → ChargeCardPromoPage-uqT96W3_-DGpf3zxD.js} +1 -1
  38. package/dist/assets/{ChargeCardSetupPage-BDbJU-vm-BIb3iQQG.js → ChargeCardSetupPage-BDbJU-vm-DZJfRa0I.js} +1 -1
  39. package/dist/assets/{ChargeCardStatementsPage-DImRqpH1-3qgtBy5g.js → ChargeCardStatementsPage-DImRqpH1-BlCyBAS3.js} +1 -1
  40. package/dist/assets/{CheckDepositDrawerPage-BVtOOPoa-Bq-u7DD4.js → CheckDepositDrawerPage-BVtOOPoa-CKWcHjV6.js} +6 -6
  41. package/dist/assets/{CollapsableReportTable-Crihcv_z-JDVTRjtF.js → CollapsableReportTable-Crihcv_z-B6sIoSI3.js} +1 -1
  42. package/dist/assets/{CompanyOfficerDetailsSection-CNxtAkKM-CFmiXK6n.js → CompanyOfficerDetailsSection-CNxtAkKM-D2joEvpM.js} +8 -8
  43. package/dist/assets/{CompanyPassportCard-DMRQkRPb-CQZMGO1o.js → CompanyPassportCard-DMRQkRPb-BLaDLsxp.js} +1 -1
  44. package/dist/assets/{CompanyPassportPage-D3XvbSF_-gJDrPWNT.js → CompanyPassportPage-D3XvbSF_-BPFOIUV0.js} +16 -16
  45. package/dist/assets/{CompleteProfile-BqjXO5ze-724nDXDc.js → CompleteProfile-BqjXO5ze-fJjklbCs.js} +1 -1
  46. package/dist/assets/{ConfettiBurst-DtwLo4WZ-BQ9rTQt1.js → ConfettiBurst-DtwLo4WZ-DhNKCJ7F.js} +1 -1
  47. package/dist/assets/{CreateOrEditVendorPage-FrGRJxMy-B6tzs6XZ.js → CreateOrEditVendorPage-FrGRJxMy-lyDeY9QD.js} +1 -1
  48. package/dist/assets/{CreditCardPaymentDrawerPage-BvifQpD3-DUnP1Hl9.js → CreditCardPaymentDrawerPage-BvifQpD3-CJD0XzyN.js} +6 -6
  49. package/dist/assets/{CurrencySelectField-ClOg6nnS-CXTbcHfQ.js → CurrencySelectField-ClOg6nnS-wUZ5kAZB.js} +1 -1
  50. package/dist/assets/{CustomerOnboardingActivationPage-Du-zzeL2-Cmigo4pK.js → CustomerOnboardingActivationPage-Du-zzeL2-DGgRqDAq.js} +1 -1
  51. package/dist/assets/CustomerOnboardingContainerPage-DMZOvVMM-ly2XWpHL.js +1 -0
  52. package/dist/assets/{CustomerOnboardingDetailPageSkeleton-BgY95XeU-CH2FPWha.js → CustomerOnboardingDetailPageSkeleton-BgY95XeU-Dah0hLGQ.js} +1 -1
  53. package/dist/assets/{CustomerOnboardingNoStepsPage-BsKoqUta-BSSSviGT.js → CustomerOnboardingNoStepsPage-BsKoqUta-D3bS1mcO.js} +1 -1
  54. package/dist/assets/{CustomerOnboardingPage-DUMQKVfM-BQ_3ahBW.js → CustomerOnboardingPage-DUMQKVfM-C7dz_0GY.js} +1 -1
  55. package/dist/assets/{CustomerOnboardingProductSuitePage-DGVV8Tkk-CXq_43y8.js → CustomerOnboardingProductSuitePage-DGVV8Tkk-CiyIz1Ai.js} +5 -5
  56. package/dist/assets/{Dashboard-CdYlvep--BOQlMB6O.js → Dashboard-CdYlvep--B2Vkh5DQ.js} +1 -1
  57. package/dist/assets/{DashboardReportPage-c6q027Qp-CEv30LzY.js → DashboardReportPage-c6q027Qp-B9wSLZAf.js} +16 -16
  58. package/dist/assets/{DashboardSidebarBackgroundAnimation-BdDVYK19-CIZN44Ie.js → DashboardSidebarBackgroundAnimation-BdDVYK19-COjDYEak.js} +1 -1
  59. package/dist/assets/{DepositAccTransactionItem-D8kL8enp-DsKpkg7T.js → DepositAccTransactionItem-D8kL8enp-J-22cTZM.js} +1 -1
  60. package/dist/assets/{DepositAccTransactionListPage-BS-OReem-B9dYkMDH.js → DepositAccTransactionListPage-BS-OReem-Daf8x2X1.js} +1 -1
  61. package/dist/assets/{DomesticWireDetailsPage-CjM1DXnn-CE0TmGGK.js → DomesticWireDetailsPage-CjM1DXnn-ByLr_bfJ.js} +1 -1
  62. package/dist/assets/{DownloadOverlay-Dr4uLNpZ-IlzYnrMA.js → DownloadOverlay-Dr4uLNpZ-PWDmhVak.js} +38 -38
  63. package/dist/assets/{DrawerPage-CbKBsc7w-C-goZ7Of.js → DrawerPage-CbKBsc7w-BANqCEyN.js} +1 -1
  64. package/dist/assets/{EditPeoplePage-BgsR09q8-DKcwe5Om.js → EditPeoplePage-BgsR09q8-DQro3ypx.js} +3 -3
  65. package/dist/assets/{EditReimbursementDetailPage-BTrwOX_s-CPvDWqQm.js → EditReimbursementDetailPage-BTrwOX_s-Bpc20RR2.js} +25 -25
  66. package/dist/assets/{EntityDetailPage-Cvd4MG0F-nlXXz9VB.js → EntityDetailPage-Cvd4MG0F-Uu1ExrMV.js} +1 -1
  67. package/dist/assets/{EntitySummarySection-BIV9aAq2-0J_nJAr8.js → EntitySummarySection-BIV9aAq2-CUHksODf.js} +1 -1
  68. package/dist/assets/{ExpenseAutomationOverviewPage-B5MtjO2p-Vj6NPROh.js → ExpenseAutomationOverviewPage-B5MtjO2p-B5sSDEu8.js} +1 -1
  69. package/dist/assets/{ExpenseAutomationPage-DW6Pxoah-CB3Tfm3S.js → ExpenseAutomationPage-DW6Pxoah-DpT-FAIA.js} +62 -62
  70. package/dist/assets/{ExpressPayPage-DnpQuDmt-BosPEUCq.js → ExpressPayPage-DnpQuDmt-CY033VTz.js} +5 -5
  71. package/dist/assets/{FeaturePreviewPage-BmwBZ7ZP-DSVKcIYC.js → FeaturePreviewPage-BmwBZ7ZP-kerQig1g.js} +1 -1
  72. package/dist/assets/{FollowStepsSection-B2I9SddL-J1soan6Z.js → FollowStepsSection-B2I9SddL-BxrnE678.js} +1 -1
  73. package/dist/assets/{GlobalReviewListPage-D3GCP5Xd-CGt9cYLb.js → GlobalReviewListPage-D3GCP5Xd-Bht9J0K_.js} +6 -6
  74. package/dist/assets/{InformationCardStack-mEhasBqu-BANEJOaT.js → InformationCardStack-mEhasBqu-BZ_Gox0K.js} +1 -1
  75. package/dist/assets/{InsightsCardStack-Mj7QcQnH-ZGIADW1_.js → InsightsCardStack-Mj7QcQnH-CT4vpE1x.js} +1 -1
  76. package/dist/assets/{InsightsSection-B3xD0SZ9-8NqkLzS9.js → InsightsSection-B3xD0SZ9-CKtY4Hiz.js} +1 -1
  77. package/dist/assets/{IntegrationsSettingsPage-CsI_agJB-DpD5mnNa.js → IntegrationsSettingsPage-CsI_agJB-CclnkA74.js} +1 -1
  78. package/dist/assets/{InternationalWireSwiftDetailsPage-Dszmi69h-Dfu9jHvI.js → InternationalWireSwiftDetailsPage-Dszmi69h-BjjhlMpG.js} +1 -1
  79. package/dist/assets/{InternationalWireVerificationPage-DG9Enrpo-DWaY5PDJ.js → InternationalWireVerificationPage-DG9Enrpo-DEQAkYYx.js} +11 -11
  80. package/dist/assets/{InviteFormPage-DK6X9Zwi-BQ256tgK.js → InviteFormPage-DK6X9Zwi-DR66hPVd.js} +1 -1
  81. package/dist/assets/{InvitePageListView-CwKbcKlM-I7Ohbwjv.js → InvitePageListView-CwKbcKlM-BOO2EOMw.js} +32 -32
  82. package/dist/assets/{InvitePeoplePage-BqzJOjVI-BLUo4Jmn.js → InvitePeoplePage-BqzJOjVI-hAq8wZOI.js} +1 -1
  83. package/dist/assets/{InvoiceUploadSection-CokNNkKu-Dv9862-R.js → InvoiceUploadSection-CokNNkKu-CL4OwcxH.js} +1 -1
  84. package/dist/assets/{IssueChargeCardPage-CRtJDmrZ-BNG_ehsF.js → IssueChargeCardPage-CRtJDmrZ-CFmNSL2f.js} +1 -1
  85. package/dist/assets/{LabeledAddressValue-BhwrrtZX-NBqZDzVl.js → LabeledAddressValue-BhwrrtZX-BVe1F8jA.js} +1 -1
  86. package/dist/assets/{LabeledAddressValueField-DzmwP7hP-BsQFVdWX.js → LabeledAddressValueField-DzmwP7hP-7gvUeBGH.js} +1 -1
  87. package/dist/assets/{LabeledControlledCheckBoxField-B6ndrF2e-k3wZsE8I.js → LabeledControlledCheckBoxField-B6ndrF2e-LWUc8yBI.js} +1 -1
  88. package/dist/assets/{LabeledCreatableSingleSelectField-CfzLlkho-D0dzeF5z.js → LabeledCreatableSingleSelectField-CfzLlkho-CxZaZJZN.js} +1 -1
  89. package/dist/assets/{LabeledDocumentField-p3pI5qLu-BapUynJg.js → LabeledDocumentField-p3pI5qLu-I9C3lX6x.js} +1 -1
  90. package/dist/assets/{LabeledDropDownFormattedTextField-oQX33Fim-Dqqs8MYf.js → LabeledDropDownFormattedTextField-oQX33Fim-Bbplhays.js} +1 -1
  91. package/dist/assets/{LabeledText-Db46hFZY-J41ZQ_mQ.js → LabeledText-Db46hFZY-CvrCjgF_.js} +1 -1
  92. package/dist/assets/{LabeledUserSingleSelectWithSubtitlesField-B9Xx3bxn-BymSRQN9.js → LabeledUserSingleSelectWithSubtitlesField-B9Xx3bxn-f0PElM5i.js} +1 -1
  93. package/dist/assets/{LabeledZeniRolesDropDownField-Docjgj8Y-BRH41KM8.js → LabeledZeniRolesDropDownField-Docjgj8Y-C6xxx7IQ.js} +11 -11
  94. package/dist/assets/{LinkJETransactionPage-BZSRaZqY-BIj3-LRc.js → LinkJETransactionPage-BZSRaZqY-9NIG46T3.js} +6 -6
  95. package/dist/assets/{LockCardPage-KTyESoXL-CynH1u5U.js → LockCardPage-KTyESoXL-C_hGUeR9.js} +12 -12
  96. package/dist/assets/{LowBalancePopup-B0BDCEui-lDZBZxzO.js → LowBalancePopup-B0BDCEui-BMVW4mzF.js} +4 -4
  97. package/dist/assets/MagicLinkACHDetailsPage-DwFvuGwG-C2ShsQ5E.js +1 -0
  98. package/dist/assets/{MagicLinkDomesticWireDetailsPage-CDB2igue-C6hTpHgJ.js → MagicLinkDomesticWireDetailsPage-CDB2igue-CMZ17cvq.js} +1 -1
  99. package/dist/assets/{MagicLinkInternationalWireDetailsPage-C2kxncrD-CjSbvmVH.js → MagicLinkInternationalWireDetailsPage-C2kxncrD-DZt4WyHf.js} +1 -1
  100. package/dist/assets/{MagicLinkSuccessPage-DNVe2qMu-jvVb0tmX.js → MagicLinkSuccessPage-DNVe2qMu-BMSr-yiU.js} +1 -1
  101. package/dist/assets/{MagicLinkTitleSection-CWw516D8-CfrqLlUk.js → MagicLinkTitleSection-CWw516D8-CjWjg4GW.js} +1 -1
  102. package/dist/assets/{MailingDetailsSection-CugAM90r-CXu3j2VQ.js → MailingDetailsSection-CugAM90r-CMuXq6mA.js} +1 -1
  103. package/dist/assets/{Menu-CGN2qO6T-B9QNiLm_.js → Menu-CGN2qO6T-CKP1jX2H.js} +1 -1
  104. package/dist/assets/{MyBankConnectionsSettingsPage-CQUfVa0r-D8KvFo_x.js → MyBankConnectionsSettingsPage-CQUfVa0r-9xTXMtPS.js} +1 -1
  105. package/dist/assets/{MyPendingActivationChargeCardListPage-TOQWRGjp-DjE457A_.js → MyPendingActivationChargeCardListPage-TOQWRGjp-DCcWmjzI.js} +1 -1
  106. package/dist/assets/{MyProfileSettingsPage-lCG03Uoh-Cjm9P5Re.js → MyProfileSettingsPage-lCG03Uoh-DnrGHNt2.js} +1 -1
  107. package/dist/assets/{NavBarWithPicker-DLLvivn4-WaKxMQjP.js → NavBarWithPicker-DLLvivn4-6K-3U9T7.js} +1 -1
  108. package/dist/assets/{NavigationArrow-B4j2t8Qu-D6OO4KlW.js → NavigationArrow-B4j2t8Qu-C8IxiTof.js} +1 -1
  109. package/dist/assets/{NavigationDots-DyMqwpgy-DNLVSzMW.js → NavigationDots-DyMqwpgy-DXf5bt3G.js} +1 -1
  110. package/dist/assets/{NewGlobalMerchantPage-Bx7iBsCP-IP0KNY_t.js → NewGlobalMerchantPage-Bx7iBsCP-DGrKqfpE.js} +1 -1
  111. package/dist/assets/{NoDataChart-Ce1_TZ5w-5hIzERi0.js → NoDataChart-Ce1_TZ5w-BfNH_4T8.js} +1 -1
  112. package/dist/assets/{NoDataTable-l2T5Hw3t-B0z8hv-n.js → NoDataTable-l2T5Hw3t-Bh_N31mD.js} +1 -1
  113. package/dist/assets/{NotFoundPage-msdN-Eu6-DQAQsO37.js → NotFoundPage-msdN-Eu6-BKPOdh9t.js} +1 -1
  114. package/dist/assets/{NotificationSettingsPage-_ovcjr8E-DrJTkLSs.js → NotificationSettingsPage-_ovcjr8E-Bj-DE2Dk.js} +15 -15
  115. package/dist/assets/{NotificationsListConfig-BJm7A9Mz-BeqhPVEF.js → NotificationsListConfig-BJm7A9Mz-Dg3_VsE9.js} +1 -1
  116. package/dist/assets/{NotificationsPage-Ddxb5kE0-CwY6pmpP.js → NotificationsPage-Ddxb5kE0-DzIBWdK5.js} +13 -13
  117. package/dist/assets/{OpExByVendorPage-BLAHey0l-xcBa1Yeo.js → OpExByVendorPage-BLAHey0l-neBDRa7k.js} +4 -4
  118. package/dist/assets/{OverlayContainerPage-CrZuT2Jj-D_iBtRRr.js → OverlayContainerPage-CrZuT2Jj-DMNYxA7f.js} +1 -1
  119. package/dist/assets/{PandLWithForecastPage-B7Z73Sq--BhUvjEFj.js → PandLWithForecastPage-B7Z73Sq--BDluLKs7.js} +5 -5
  120. package/dist/assets/{PaymentAccountSetupBillingAddressSection-pL7omrJk-DYJ63jM7.js → PaymentAccountSetupBillingAddressSection-pL7omrJk-Cgju1Qqc.js} +1 -1
  121. package/dist/assets/{PeoplePage-BHRFiM0D-CFVJOOEe.js → PeoplePage-BHRFiM0D-FOmgjcav.js} +1 -1
  122. package/dist/assets/{ProductsCarousel-D2bf_6Gb-BAq59KMZ.js → ProductsCarousel-D2bf_6Gb-NT7Dhd8p.js} +1 -1
  123. package/dist/assets/{PromoBaseCards-CI7UOpeY-Ux3ixF8F.js → PromoBaseCards-CI7UOpeY-DI52WXKx.js} +3 -3
  124. package/dist/assets/{QBOConnectionDialog-D7MeKn1t-DvScIKzD.js → QBOConnectionDialog-D7MeKn1t-DelTIGIf.js} +4 -4
  125. package/dist/assets/{QBOSetupSection-DWhfA4Xv-DJQNsbuL.js → QBOSetupSection-DWhfA4Xv-kSdJytyB.js} +7 -7
  126. package/dist/assets/{ReimbursementApprovalRuleDetailPage-C_dTOk5P-BzneGv9j.js → ReimbursementApprovalRuleDetailPage-C_dTOk5P-Dc_LvsYr.js} +1 -1
  127. package/dist/assets/{ReimbursementApprovalRulesPage-B5lca4qx-opdeKE45.js → ReimbursementApprovalRulesPage-B5lca4qx-DAjvVIOI.js} +1 -1
  128. package/dist/assets/{ReimbursementDetailPage-COIRwy7i-BUmCrQMr.js → ReimbursementDetailPage-COIRwy7i-W0eUs7nE.js} +1 -1
  129. package/dist/assets/{ReimbursementPromoPage-Bjm0UHcm-rsVpHrAZ.js → ReimbursementPromoPage-Bjm0UHcm-Crjakfj5.js} +8 -8
  130. package/dist/assets/{ReimbursementSetUpPage-CMYR8CcH-Bc_PR4Gk.js → ReimbursementSetUpPage-CMYR8CcH-B6Pjnu_N.js} +4 -4
  131. package/dist/assets/{ReimbursementsBulkReviewDrawerPage-BDdhVfaz-Dz0KzTvk.js → ReimbursementsBulkReviewDrawerPage-BDdhVfaz-Qu76KNt7.js} +1 -1
  132. package/dist/assets/{ReloadCard-B2sJR97f-BIaVdWBP.js → ReloadCard-B2sJR97f-4aiyry-A.js} +1 -1
  133. package/dist/assets/{ReportTableViewSelector-_IO343vS-Bd9be2IV.js → ReportTableViewSelector-_IO343vS-DFegVWwX.js} +1 -1
  134. package/dist/assets/{ReportsPage-C-aQ1bdd-BbBsZ9pq.js → ReportsPage-C-aQ1bdd-DQkYUdHM.js} +5 -5
  135. package/dist/assets/{RevenueChart-Bgq6My4J-BiDvlJvs.js → RevenueChart-Bgq6My4J-Bd7qmjtO.js} +1 -1
  136. package/dist/assets/{ReviewDetailsPage-COx9R71r-BZZC_0cP.js → ReviewDetailsPage-COx9R71r-BNEXmQ6j.js} +1 -1
  137. package/dist/assets/{ReviewOverlay-CPU7RPiJ-Bs2eF6px.js → ReviewOverlay-CPU7RPiJ-LkDgAnlD.js} +1 -1
  138. package/dist/assets/{RoleWithToolTip-DSSGBzvw-w9nfatYk.js → RoleWithToolTip-DSSGBzvw-1jeqwzcs.js} +2 -2
  139. package/dist/assets/{ScheduleDetailsFixedAssetsPage-DKGBfhAM-Cgt85on9.js → ScheduleDetailsFixedAssetsPage-DKGBfhAM-DIiqwEOV.js} +3 -3
  140. package/dist/assets/{ScheduleDetailsPage-B-fKJ7Ct-Cn0um4-b.js → ScheduleDetailsPage-B-fKJ7Ct-DSkiCN2O.js} +3 -3
  141. package/dist/assets/{ScheduleSequenceTable-Dh_aT47H-DNxHXj-E.js → ScheduleSequenceTable-Dh_aT47H-BHM_c04w.js} +15 -15
  142. package/dist/assets/{ScreenRoutes-v_76HEQb.js → ScreenRoutes-DuXEW70Q.js} +48 -48
  143. package/dist/assets/{SetUpAccountSection-DrMCC1IY-DUMtEDGs.js → SetUpAccountSection-DrMCC1IY-D33epaX0.js} +4 -4
  144. package/dist/assets/{SignIn-Ij6tlYI5-Df2WXZVd.js → SignIn-Ij6tlYI5-DeE6t8Fq.js} +7 -7
  145. package/dist/assets/{SignInScreen-C4ZK30De.js → SignInScreen-LCpnq8M3.js} +1 -1
  146. package/dist/assets/{SpendManagementListViewPage-AI676Urw-EYS2bzVL.js → SpendManagementListViewPage-AI676Urw-DJru7ByR.js} +13 -13
  147. package/dist/assets/{SpendManagementPerTabPage-D79c3Xqh-B-bFDlPr.js → SpendManagementPerTabPage-D79c3Xqh-D8DfakVn.js} +1 -1
  148. package/dist/assets/{SpendManagementSection-BqWbsmBW-DKtanA-9.js → SpendManagementSection-BqWbsmBW-BhpclPa8.js} +7 -7
  149. package/dist/assets/{StatementItem-Aal79YaO-BQZc18ts.js → StatementItem-Aal79YaO-3cBWg-5i.js} +1 -1
  150. package/dist/assets/{StatementsPage-BG_pNQzc-CzvxwtLg.js → StatementsPage-BG_pNQzc-C7UMTTVJ.js} +1 -1
  151. package/dist/assets/{StatusSwitcher-DYRXaLvx-AQ5F23zs.js → StatusSwitcher-DYRXaLvx-GT20DbHu.js} +1 -1
  152. package/dist/assets/{SubTabSwitcher-C75XU1EG-C5X1b7VC.js → SubTabSwitcher-C75XU1EG-BZOngUzL.js} +1 -1
  153. package/dist/assets/{SummaryCard-DEnzgi31-DU7b1H9O.js → SummaryCard-DEnzgi31-BhOErS-o.js} +1 -1
  154. package/dist/assets/{TaskManagementPage-BacWm0wS-CxwBoTNG.js → TaskManagementPage-BacWm0wS-tQV5bDZ1.js} +12 -12
  155. package/dist/assets/{TimeRangeSwitcher-BOzR-0O6-EGXiDQ0Z.js → TimeRangeSwitcher-BOzR-0O6-8myc4JmX.js} +1 -1
  156. package/dist/assets/{TimeframeSwitcher-BVgI_VZw-BXU7EPFq.js → TimeframeSwitcher-BVgI_VZw-Re-kZX07.js} +1 -1
  157. package/dist/assets/{TimeframeSwitcherWithToggle-CPVSAvFa-CHmXrP90.js → TimeframeSwitcherWithToggle-CPVSAvFa-Bg7OmG92.js} +1 -1
  158. package/dist/assets/{TopExCard-ImUx-vXr-CCfEzo-r.js → TopExCard-ImUx-vXr--haKJkNG.js} +1 -1
  159. package/dist/assets/{TopExDetailPage-Dg_8DQk8-ByzYxzfA.js → TopExDetailPage-Dg_8DQk8-4TF178rD.js} +2 -2
  160. package/dist/assets/{TransactionDetailPage-BzaDB50S-CcgKIVvo.js → TransactionDetailPage-BzaDB50S-CJmLmWoQ.js} +31 -31
  161. package/dist/assets/{TransactionList-DMd3dgoK-jIPFWuzK.js → TransactionList-DMd3dgoK-DFvlE42h.js} +5 -5
  162. package/dist/assets/{TransactionListBig-BxHqh8u6-Cd7KnFj9.js → TransactionListBig-BxHqh8u6-eMcF_DZh.js} +1 -1
  163. package/dist/assets/{TransactionListPage-CN9fZznd-k0wJ66Rn.js → TransactionListPage-CN9fZznd-DZJjs91-.js} +1 -1
  164. package/dist/assets/{TransactionVendorDetailPage-CykcquSh-X7txd8Uw.js → TransactionVendorDetailPage-CykcquSh-UwSp0CrJ.js} +1 -1
  165. package/dist/assets/{TransferDrawerPage-oV7ickRP-DK8yvBjK.js → TransferDrawerPage-oV7ickRP-yOers3_6.js} +1 -1
  166. package/dist/assets/{TreasuryOverviewPage-CECDKjNn-B51H5BQA.js → TreasuryOverviewPage-CECDKjNn-HTBJsJ5M.js} +1 -1
  167. package/dist/assets/{TreasuryPromoPage-Bgt7uGAE-BvHndp-i.js → TreasuryPromoPage-Bgt7uGAE-oIwaWu5X.js} +6 -6
  168. package/dist/assets/{TreasuryStatementsPage-QyWxshsI-vvKelSCQ.js → TreasuryStatementsPage-QyWxshsI-BxKUXQKE.js} +1 -1
  169. package/dist/assets/{TreasuryTaxLetterPage-BLmfU0VD-Bk_hdnHl.js → TreasuryTaxLetterPage-BLmfU0VD-CZkFVEWV.js} +1 -1
  170. package/dist/assets/{TrendChart-C_6ob-SX-m0EmlBC5.js → TrendChart-C_6ob-SX-BWR7UfmP.js} +2 -2
  171. package/dist/assets/{TrendWithTransactions-lMD2sZ-C-XUwPuFCO.js → TrendWithTransactions-lMD2sZ-C-B_BL8w82.js} +1 -1
  172. package/dist/assets/{UncategorizedAccountsMappingPage-DEgz17_R-C8HrLzdo.js → UncategorizedAccountsMappingPage-DEgz17_R-CooBTMrf.js} +7 -7
  173. package/dist/assets/{UnitIntegrationPage-D9Pzxqju-C2A5K_Pc.js → UnitIntegrationPage-D9Pzxqju-CvrKT10L.js} +1 -1
  174. package/dist/assets/{UploadAdditionalDocumentOverlay-CJYvOjh0-D58Kj8VW.js → UploadAdditionalDocumentOverlay-CJYvOjh0-D-S1zfGQ.js} +1 -1
  175. package/dist/assets/{Vendor2FAPopup-D-r0NVE--CH70A67b.js → Vendor2FAPopup-D-r0NVE--CwiNcgO0.js} +1 -1
  176. package/dist/assets/{VendorACHDetailsPage-Dv6bTD6Y-EAp4jOT9.js → VendorACHDetailsPage-Dv6bTD6Y-13eGKSpU.js} +1 -1
  177. package/dist/assets/{VendorDetailPage-BhfawsBd-X9ppQyZg.js → VendorDetailPage-BhfawsBd-Caqe1lVz.js} +11 -11
  178. package/dist/assets/{VendorDomesticWireDetailsPage-BjmlrfTQ-B1OQJ-PX.js → VendorDomesticWireDetailsPage-BjmlrfTQ-t6Qb8_Zl.js} +1 -1
  179. package/dist/assets/{VendorFiling1099EditablePage-glvi0GTU-Db8a7MT5.js → VendorFiling1099EditablePage-glvi0GTU-Ctoy4jdk.js} +7 -7
  180. package/dist/assets/{VendorFirstReviewPage-DUuUM8ZT-D91xrJnc.js → VendorFirstReviewPage-DUuUM8ZT-CU9frkxN.js} +23 -23
  181. package/dist/assets/{VendorInternationalWireDetailsPage--Lb-TviQ-YoEXSyjJ.js → VendorInternationalWireDetailsPage--Lb-TviQ-DUgeyPBL.js} +13 -13
  182. package/dist/assets/{VendorInternationalWireSwiftDetailsPage-C6KviV2Z-BZwXuirg.js → VendorInternationalWireSwiftDetailsPage-C6KviV2Z-CuCByIJB.js} +1 -1
  183. package/dist/assets/{VendorsAccountsSection-EmHO3wQ0-Co8ekhdh.js → VendorsAccountsSection-EmHO3wQ0-CSPWzKcg.js} +2 -2
  184. package/dist/assets/{VerifyDevice-DE3UbLEe-CyUiyNY7.js → VerifyDevice-DE3UbLEe-DJm7Kfur.js} +1 -1
  185. package/dist/assets/{VideoPlayer-Gw_PLr8F-B2qovwmK.js → VideoPlayer-Gw_PLr8F-BcD3Qyt1.js} +2 -2
  186. package/dist/assets/{VideoPopup-DPZYhLgy-B-KPrxJA.js → VideoPopup-DPZYhLgy-CJt98Dbq.js} +1 -1
  187. package/dist/assets/{WarningsDrawerPage-CZvToguS-XDiwFZJB.js → WarningsDrawerPage-CZvToguS-Ba7pscqf.js} +1 -1
  188. package/dist/assets/{ZeniAccountDetailPage-CQhqngBz-CENmz8Ua.js → ZeniAccountDetailPage-CQhqngBz-CmRc3epW.js} +6 -6
  189. package/dist/assets/{ZeniAccountListViewPage-CpX8vqYa-CK8_GdHY.js → ZeniAccountListViewPage-CpX8vqYa-CrcimjI_.js} +5 -5
  190. package/dist/assets/{ZeniAccountNavBarPieces-DsUwG15z-Di--PMn-.js → ZeniAccountNavBarPieces-DsUwG15z-DiPlFFTl.js} +1 -1
  191. package/dist/assets/{ZeniAccountPromoPage-DA611IgH-iuu7zQBs.js → ZeniAccountPromoPage-DA611IgH-CipxvQgU.js} +1 -1
  192. package/dist/assets/{ZeniAccountSetupPage-CJv2Fk1i-5fsPz9xO.js → ZeniAccountSetupPage-CJv2Fk1i-BEZSbbPm.js} +3 -3
  193. package/dist/assets/{ZeniCopyright-FFqiWypL-Cm4f2TI5.js → ZeniCopyright-FFqiWypL-DiiU36pR.js} +1 -1
  194. package/dist/assets/{ZeniTransferAmountSlider-DSrBZUbA-BloT7n7Q.js → ZeniTransferAmountSlider-DSrBZUbA-BFqVxMPD.js} +1 -1
  195. package/dist/assets/{analytics-CThNEnNw.js → analytics-XaDXTZcq.js} +1 -1
  196. package/dist/assets/{analyticsHelper-lLrERKZn.js → analyticsHelper-CPNXs_BN.js} +1 -1
  197. package/dist/assets/{analyticsHelper-CczQLvkM-Bib0YVO4.js → analyticsHelper-CczQLvkM-BG3MqU2b.js} +1 -1
  198. package/dist/assets/{chartTypes-CwQl8aoN-BQd1i_cE.js → chartTypes-CwQl8aoN-DVag5uGx.js} +1 -1
  199. package/dist/assets/{commonDimensions-B1u_MhON-NVIOlvy5.js → commonDimensions-B1u_MhON-D3_HfKhE.js} +1 -1
  200. package/dist/assets/{dash.all.min-BUPngCw6.js → dash.all.min-DBAY9LgI.js} +1 -1
  201. package/dist/assets/{detailCommon-nYxvvV_i-DTtGx6HY.js → detailCommon-nYxvvV_i-CatRpXM4.js} +1 -1
  202. package/dist/assets/{downloadPdf-yGlKpV2--BfE42mHv.js → downloadPdf-yGlKpV2--PjZSq5HD.js} +1 -1
  203. package/dist/assets/{epic-Bko4IStj.js → epic-BLwHhkRJ.js} +2 -2
  204. package/dist/assets/{index-KtBRorGi.js → index-CEtuJXY3.js} +1 -1
  205. package/dist/assets/{index-BxXAQ-Kq.js → index-CdTBIE6I.js} +1 -1
  206. package/dist/assets/{index-BP8jc2MZ.js → index-Ci63exms.js} +6 -6
  207. package/dist/assets/{index-BV-YAw0P.js → index-DYDdrdFx.js} +1 -1
  208. package/dist/assets/{index-CwsnnJzI.js → index-DrmeEdvK.js} +1 -1
  209. package/dist/assets/{liveblocks-B3KbWbMM.js → liveblocks-CNYVvsag.js} +1 -1
  210. package/dist/assets/{lottie-CaGAfnTY.js → lottie-22bRan8M.js} +1 -1
  211. package/dist/assets/{mapLoadingInProgressToTreeNode-DIAuL28N-C-4Ag6Dq.js → mapLoadingInProgressToTreeNode-DIAuL28N-uQ9ZpPGq.js} +1 -1
  212. package/dist/assets/{mapSectionWithAcOnlyToTreeNode-DRSmQ56_-CSRhLO-g.js → mapSectionWithAcOnlyToTreeNode-DRSmQ56_-BfuaGrUM.js} +1 -1
  213. package/dist/assets/{mapSpacerToTreeNode-DOEVwUIo-FsL3Wvr0.js → mapSpacerToTreeNode-DOEVwUIo-DiQ0KiMB.js} +1 -1
  214. package/dist/assets/{mapTimeframeBalancesToTreeNode-DbnAvW1M-DM4HsE8s.js → mapTimeframeBalancesToTreeNode-DbnAvW1M-DvZ_ljbo.js} +1 -1
  215. package/dist/assets/{mapTimeframeBalancesToTreeNode-DkrEWOxt-CGsx1h8W.js → mapTimeframeBalancesToTreeNode-DkrEWOxt-u1VbFdjk.js} +1 -1
  216. package/dist/assets/{mapTimeframeHeaderLoadingInProgressToTreeNode-BucoS7vN-CSuR34Jn.js → mapTimeframeHeaderLoadingInProgressToTreeNode-BucoS7vN-DJb78S-u.js} +1 -1
  217. package/dist/assets/{react-C2wGlvWj.js → react-BUQtf2po.js} +2 -2
  218. package/dist/assets/{recharts-CXSQ4XPK.js → recharts-h5iNQbFd.js} +1 -1
  219. package/dist/assets/{sentry-DxvQlcJu.js → sentry-cYFeB6Pw.js} +1 -1
  220. package/dist/assets/{toCOABalancesWithID-rZFEkHuM-CHyvHGmW.js → toCOABalancesWithID-rZFEkHuM-BjqaEj9u.js} +1 -1
  221. package/dist/assets/{toChartData-C-dHC-Oz-C2z1PJfR.js → toChartData-C-dHC-Oz-CLJWjMkx.js} +1 -1
  222. package/dist/assets/{uploadAttachment-D3clfqPu-vNbeEBN-.js → uploadAttachment-D3clfqPu-NbmOED_L.js} +15 -15
  223. package/dist/assets/{uploadReceipts-Bkf_PaOH-DRTWmNKJ.js → uploadReceipts-Bkf_PaOH-DuaAGaHX.js} +1 -1
  224. package/dist/assets/{url-DuX7Wo4B.js → url-B-8T_WZb.js} +1 -1
  225. package/dist/assets/{url-y5lCWhwX.js → url-DPKHmOp_.js} +1 -1
  226. package/dist/assets/{utils-C70QTjQC.js → utils-fBOyu0sO.js} +1 -1
  227. package/dist/assets/{zeni-epic-state-xFtF3OLs.js → zeni-epic-state-BwKvATgd.js} +5 -5
  228. package/dist/index.html +1 -1
  229. package/package.json +3 -3
  230. package/dist/assets/ApprovalRulesSettingsPage-DQQw30S5-p4f66PTl.js +0 -47
  231. package/dist/assets/CustomerOnboardingContainerPage-DMZOvVMM-BzRvblFe.js +0 -1
  232. package/dist/assets/MagicLinkACHDetailsPage-DwFvuGwG-DX8NF4Kz.js +0 -1
@@ -1 +1 @@
1
- import{g as f}from"./core-3dlyNYRL.js";import{r as a}from"./index-BxXAQ-Kq.js";function p(t,i){for(var o=0;o<i.length;o++){const e=i[o];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const s=Object.getOwnPropertyDescriptor(e,r);s&&Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var n=a();const c=f(n),l=p({__proto__:null,default:c},[n]);export{l as i};
1
+ import{g as f}from"./core-3dlyNYRL.js";import{r as a}from"./index-CdTBIE6I.js";function p(t,i){for(var o=0;o<i.length;o++){const e=i[o];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const s=Object.getOwnPropertyDescriptor(e,r);s&&Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var n=a();const c=f(n),l=p({__proto__:null,default:c},[n]);export{l as i};
@@ -1 +1 @@
1
- import{e as _}from"./core-3dlyNYRL.js";import{A as H,B as T}from"./zeni-epic-state-xFtF3OLs.js";import{J as X,D as z,K,L as V,M as W,N as j,O as Y,P as D}from"./utils-C70QTjQC.js";import{r as $}from"./url-y5lCWhwX.js";var C={},w={exports:{}},E={},P;function B(){return P||(P=1,function(u){u.fetch=m(_.fetch)&&m(_.ReadableStream),u.writableStream=m(_.WritableStream),u.abortController=m(_.AbortController);var i;function v(){if(i!==void 0)return i;if(_.XMLHttpRequest){i=new _.XMLHttpRequest;try{i.open("GET",_.XDomainRequest?"/":"https://example.com")}catch{i=null}}else i=null;return i}function d(f){var o=v();if(!o)return!1;try{return o.responseType=f,o.responseType===f}catch{}return!1}u.arraybuffer=u.fetch||d("arraybuffer"),u.msstream=!u.fetch&&d("ms-stream"),u.mozchunkedarraybuffer=!u.fetch&&d("moz-chunked-arraybuffer"),u.overrideMimeType=u.fetch||(v()?m(v().overrideMimeType):!1);function m(f){return typeof f=="function"}i=null}(E)),E}var R={},g={exports:{}},M;function F(){return M||(M=1,function(u,i){i=u.exports=X(),i.Stream=i,i.Readable=i,i.Writable=z(),i.Duplex=K(),i.Transform=V(),i.PassThrough=W(),i.finished=j(),i.pipeline=Y()}(g,g.exports)),g.exports}var N;function G(){if(N)return R;N=1;var u=B(),i=D(),v=F(),d=R.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},m=R.IncomingMessage=function(f,o,n,l){var t=this;if(v.Readable.call(t),t._mode=n,t.headers={},t.rawHeaders=[],t.trailers={},t.rawTrailers=[],t.on("end",function(){H.nextTick(function(){t.emit("close")})}),n==="fetch"){let b=function(){r.read().then(function(c){if(!t._destroyed){if(l(c.done),c.done){t.push(null);return}t.push(T.from(c.value)),b()}}).catch(function(c){l(!0),t._destroyed||t.emit("error",c)})};if(t._fetchResponse=o,t.url=o.url,t.statusCode=o.status,t.statusMessage=o.statusText,o.headers.forEach(function(c,s){t.headers[s.toLowerCase()]=c,t.rawHeaders.push(s,c)}),u.writableStream){var e=new WritableStream({write:function(c){return l(!1),new Promise(function(s,p){t._destroyed?p():t.push(T.from(c))?s():t._resumeFetch=s})},close:function(){l(!0),t._destroyed||t.push(null)},abort:function(c){l(!0),t._destroyed||t.emit("error",c)}});try{o.body.pipeTo(e).catch(function(c){l(!0),t._destroyed||t.emit("error",c)});return}catch{}}var r=o.body.getReader();b()}else{t._xhr=f,t._pos=0,t.url=f.responseURL,t.statusCode=f.status,t.statusMessage=f.statusText;var a=f.getAllResponseHeaders().split(/\r?\n/);if(a.forEach(function(b){var c=b.match(/^([^:]+):\s*(.*)/);if(c){var s=c[1].toLowerCase();s==="set-cookie"?(t.headers[s]===void 0&&(t.headers[s]=[]),t.headers[s].push(c[2])):t.headers[s]!==void 0?t.headers[s]+=", "+c[2]:t.headers[s]=c[2],t.rawHeaders.push(c[1],c[2])}}),t._charset="x-user-defined",!u.overrideMimeType){var h=t.rawHeaders["mime-type"];if(h){var y=h.match(/;\s*charset=([^;])(;|$)/);y&&(t._charset=y[1].toLowerCase())}t._charset||(t._charset="utf-8")}}};return i(m,v.Readable),m.prototype._read=function(){var f=this,o=f._resumeFetch;o&&(f._resumeFetch=null,o())},m.prototype._onXHRProgress=function(f){var o=this,n=o._xhr,l=null;switch(o._mode){case"text":if(l=n.responseText,l.length>o._pos){var t=l.substr(o._pos);if(o._charset==="x-user-defined"){for(var e=T.alloc(t.length),r=0;r<t.length;r++)e[r]=t.charCodeAt(r)&255;o.push(e)}else o.push(t,o._charset);o._pos=l.length}break;case"arraybuffer":if(n.readyState!==d.DONE||!n.response)break;l=n.response,o.push(T.from(new Uint8Array(l)));break;case"moz-chunked-arraybuffer":if(l=n.response,n.readyState!==d.LOADING||!l)break;o.push(T.from(new Uint8Array(l)));break;case"ms-stream":if(l=n.response,n.readyState!==d.LOADING)break;var a=new _.MSStreamReader;a.onprogress=function(){a.result.byteLength>o._pos&&(o.push(T.from(new Uint8Array(a.result.slice(o._pos)))),o._pos=a.result.byteLength)},a.onload=function(){f(!0),o.push(null)},a.readAsArrayBuffer(l);break}o._xhr.readyState===d.DONE&&o._mode!=="ms-stream"&&(f(!0),o.push(null))},R}var L;function J(){if(L)return w.exports;L=1;var u=B(),i=D(),v=G(),d=F(),m=v.IncomingMessage,f=v.readyStates;function o(e,r){return u.fetch&&r?"fetch":u.mozchunkedarraybuffer?"moz-chunked-arraybuffer":u.msstream?"ms-stream":u.arraybuffer&&e?"arraybuffer":"text"}var n=w.exports=function(e){var r=this;d.Writable.call(r),r._opts=e,r._body=[],r._headers={},e.auth&&r.setHeader("Authorization","Basic "+T.from(e.auth).toString("base64")),Object.keys(e.headers).forEach(function(y){r.setHeader(y,e.headers[y])});var a,h=!0;if(e.mode==="disable-fetch"||"requestTimeout"in e&&!u.abortController)h=!1,a=!0;else if(e.mode==="prefer-streaming")a=!1;else if(e.mode==="allow-wrong-content-type")a=!u.overrideMimeType;else if(!e.mode||e.mode==="default"||e.mode==="prefer-fast")a=!0;else throw new Error("Invalid value for opts.mode");r._mode=o(a,h),r._fetchTimer=null,r._socketTimeout=null,r._socketTimer=null,r.on("finish",function(){r._onFinish()})};i(n,d.Writable),n.prototype.setHeader=function(e,r){var a=this,h=e.toLowerCase();t.indexOf(h)===-1&&(a._headers[h]={name:e,value:r})},n.prototype.getHeader=function(e){var r=this._headers[e.toLowerCase()];return r?r.value:null},n.prototype.removeHeader=function(e){var r=this;delete r._headers[e.toLowerCase()]},n.prototype._onFinish=function(){var e=this;if(!e._destroyed){var r=e._opts;"timeout"in r&&r.timeout!==0&&e.setTimeout(r.timeout);var a=e._headers,h=null;r.method!=="GET"&&r.method!=="HEAD"&&(h=new Blob(e._body,{type:(a["content-type"]||{}).value||""}));var y=[];if(Object.keys(a).forEach(function(p){var O=a[p].name,q=a[p].value;Array.isArray(q)?q.forEach(function(x){y.push([O,x])}):y.push([O,q])}),e._mode==="fetch"){var b=null;if(u.abortController){var c=new AbortController;b=c.signal,e._fetchAbortController=c,"requestTimeout"in r&&r.requestTimeout!==0&&(e._fetchTimer=_.setTimeout(function(){e.emit("requestTimeout"),e._fetchAbortController&&e._fetchAbortController.abort()},r.requestTimeout))}_.fetch(e._opts.url,{method:e._opts.method,headers:y,body:h||void 0,mode:"cors",credentials:r.withCredentials?"include":"same-origin",signal:b}).then(function(p){e._fetchResponse=p,e._resetTimers(!1),e._connect()},function(p){e._resetTimers(!0),e._destroyed||e.emit("error",p)})}else{var s=e._xhr=new _.XMLHttpRequest;try{s.open(e._opts.method,e._opts.url,!0)}catch(p){H.nextTick(function(){e.emit("error",p)});return}"responseType"in s&&(s.responseType=e._mode),"withCredentials"in s&&(s.withCredentials=!!r.withCredentials),e._mode==="text"&&"overrideMimeType"in s&&s.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in r&&(s.timeout=r.requestTimeout,s.ontimeout=function(){e.emit("requestTimeout")}),y.forEach(function(p){s.setRequestHeader(p[0],p[1])}),e._response=null,s.onreadystatechange=function(){switch(s.readyState){case f.LOADING:case f.DONE:e._onXHRProgress();break}},e._mode==="moz-chunked-arraybuffer"&&(s.onprogress=function(){e._onXHRProgress()}),s.onerror=function(){e._destroyed||(e._resetTimers(!0),e.emit("error",new Error("XHR error")))};try{s.send(h)}catch(p){H.nextTick(function(){e.emit("error",p)});return}}}};function l(e){try{var r=e.status;return r!==null&&r!==0}catch{return!1}}n.prototype._onXHRProgress=function(){var e=this;e._resetTimers(!1),!(!l(e._xhr)||e._destroyed)&&(e._response||e._connect(),e._response._onXHRProgress(e._resetTimers.bind(e)))},n.prototype._connect=function(){var e=this;e._destroyed||(e._response=new m(e._xhr,e._fetchResponse,e._mode,e._resetTimers.bind(e)),e._response.on("error",function(r){e.emit("error",r)}),e.emit("response",e._response))},n.prototype._write=function(e,r,a){var h=this;h._body.push(e),a()},n.prototype._resetTimers=function(e){var r=this;_.clearTimeout(r._socketTimer),r._socketTimer=null,e?(_.clearTimeout(r._fetchTimer),r._fetchTimer=null):r._socketTimeout&&(r._socketTimer=_.setTimeout(function(){r.emit("timeout")},r._socketTimeout))},n.prototype.abort=n.prototype.destroy=function(e){var r=this;r._destroyed=!0,r._resetTimers(!0),r._response&&(r._response._destroyed=!0),r._xhr?r._xhr.abort():r._fetchAbortController&&r._fetchAbortController.abort(),e&&r.emit("error",e)},n.prototype.end=function(e,r,a){var h=this;typeof e=="function"&&(a=e,e=void 0),d.Writable.prototype.end.call(h,e,r,a)},n.prototype.setTimeout=function(e,r){var a=this;r&&a.once("timeout",r),a._socketTimeout=e,a._resetTimers(!1)},n.prototype.flushHeaders=function(){},n.prototype.setNoDelay=function(){},n.prototype.setSocketKeepAlive=function(){};var t=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"];return w.exports}var S,I;function Q(){if(I)return S;I=1,S=i;var u=Object.prototype.hasOwnProperty;function i(){for(var v={},d=0;d<arguments.length;d++){var m=arguments[d];for(var f in m)u.call(m,f)&&(v[f]=m[f])}return v}return S}var A,k;function Z(){return k||(k=1,A={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}),A}var U;function ne(){return U||(U=1,function(u){var i=J(),v=G(),d=Q(),m=Z(),f=$(),o=u;o.request=function(n,l){typeof n=="string"?n=f.parse(n):n=d(n);var t=_.location.protocol.search(/^https?:$/)===-1?"http:":"",e=n.protocol||t,r=n.hostname||n.host,a=n.port,h=n.path||"/";r&&r.indexOf(":")!==-1&&(r="["+r+"]"),n.url=(r?e+"//"+r:"")+(a?":"+a:"")+h,n.method=(n.method||"GET").toUpperCase(),n.headers=n.headers||{};var y=new i(n);return l&&y.on("response",l),y},o.get=function(l,t){var e=o.request(l,t);return e.end(),e},o.ClientRequest=i,o.IncomingMessage=v.IncomingMessage,o.Agent=function(){},o.Agent.defaultMaxSockets=4,o.globalAgent=new o.Agent,o.STATUS_CODES=m,o.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}(C)),C}export{ne as a,F as r};
1
+ import{e as _}from"./core-3dlyNYRL.js";import{A as H,B as T}from"./zeni-epic-state-BwKvATgd.js";import{J as X,D as z,K,L as V,M as W,N as j,O as Y,P as D}from"./utils-fBOyu0sO.js";import{r as $}from"./url-DPKHmOp_.js";var C={},w={exports:{}},E={},P;function B(){return P||(P=1,function(u){u.fetch=m(_.fetch)&&m(_.ReadableStream),u.writableStream=m(_.WritableStream),u.abortController=m(_.AbortController);var i;function v(){if(i!==void 0)return i;if(_.XMLHttpRequest){i=new _.XMLHttpRequest;try{i.open("GET",_.XDomainRequest?"/":"https://example.com")}catch{i=null}}else i=null;return i}function d(f){var o=v();if(!o)return!1;try{return o.responseType=f,o.responseType===f}catch{}return!1}u.arraybuffer=u.fetch||d("arraybuffer"),u.msstream=!u.fetch&&d("ms-stream"),u.mozchunkedarraybuffer=!u.fetch&&d("moz-chunked-arraybuffer"),u.overrideMimeType=u.fetch||(v()?m(v().overrideMimeType):!1);function m(f){return typeof f=="function"}i=null}(E)),E}var R={},g={exports:{}},M;function F(){return M||(M=1,function(u,i){i=u.exports=X(),i.Stream=i,i.Readable=i,i.Writable=z(),i.Duplex=K(),i.Transform=V(),i.PassThrough=W(),i.finished=j(),i.pipeline=Y()}(g,g.exports)),g.exports}var N;function G(){if(N)return R;N=1;var u=B(),i=D(),v=F(),d=R.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},m=R.IncomingMessage=function(f,o,n,l){var t=this;if(v.Readable.call(t),t._mode=n,t.headers={},t.rawHeaders=[],t.trailers={},t.rawTrailers=[],t.on("end",function(){H.nextTick(function(){t.emit("close")})}),n==="fetch"){let b=function(){r.read().then(function(c){if(!t._destroyed){if(l(c.done),c.done){t.push(null);return}t.push(T.from(c.value)),b()}}).catch(function(c){l(!0),t._destroyed||t.emit("error",c)})};if(t._fetchResponse=o,t.url=o.url,t.statusCode=o.status,t.statusMessage=o.statusText,o.headers.forEach(function(c,s){t.headers[s.toLowerCase()]=c,t.rawHeaders.push(s,c)}),u.writableStream){var e=new WritableStream({write:function(c){return l(!1),new Promise(function(s,p){t._destroyed?p():t.push(T.from(c))?s():t._resumeFetch=s})},close:function(){l(!0),t._destroyed||t.push(null)},abort:function(c){l(!0),t._destroyed||t.emit("error",c)}});try{o.body.pipeTo(e).catch(function(c){l(!0),t._destroyed||t.emit("error",c)});return}catch{}}var r=o.body.getReader();b()}else{t._xhr=f,t._pos=0,t.url=f.responseURL,t.statusCode=f.status,t.statusMessage=f.statusText;var a=f.getAllResponseHeaders().split(/\r?\n/);if(a.forEach(function(b){var c=b.match(/^([^:]+):\s*(.*)/);if(c){var s=c[1].toLowerCase();s==="set-cookie"?(t.headers[s]===void 0&&(t.headers[s]=[]),t.headers[s].push(c[2])):t.headers[s]!==void 0?t.headers[s]+=", "+c[2]:t.headers[s]=c[2],t.rawHeaders.push(c[1],c[2])}}),t._charset="x-user-defined",!u.overrideMimeType){var h=t.rawHeaders["mime-type"];if(h){var y=h.match(/;\s*charset=([^;])(;|$)/);y&&(t._charset=y[1].toLowerCase())}t._charset||(t._charset="utf-8")}}};return i(m,v.Readable),m.prototype._read=function(){var f=this,o=f._resumeFetch;o&&(f._resumeFetch=null,o())},m.prototype._onXHRProgress=function(f){var o=this,n=o._xhr,l=null;switch(o._mode){case"text":if(l=n.responseText,l.length>o._pos){var t=l.substr(o._pos);if(o._charset==="x-user-defined"){for(var e=T.alloc(t.length),r=0;r<t.length;r++)e[r]=t.charCodeAt(r)&255;o.push(e)}else o.push(t,o._charset);o._pos=l.length}break;case"arraybuffer":if(n.readyState!==d.DONE||!n.response)break;l=n.response,o.push(T.from(new Uint8Array(l)));break;case"moz-chunked-arraybuffer":if(l=n.response,n.readyState!==d.LOADING||!l)break;o.push(T.from(new Uint8Array(l)));break;case"ms-stream":if(l=n.response,n.readyState!==d.LOADING)break;var a=new _.MSStreamReader;a.onprogress=function(){a.result.byteLength>o._pos&&(o.push(T.from(new Uint8Array(a.result.slice(o._pos)))),o._pos=a.result.byteLength)},a.onload=function(){f(!0),o.push(null)},a.readAsArrayBuffer(l);break}o._xhr.readyState===d.DONE&&o._mode!=="ms-stream"&&(f(!0),o.push(null))},R}var L;function J(){if(L)return w.exports;L=1;var u=B(),i=D(),v=G(),d=F(),m=v.IncomingMessage,f=v.readyStates;function o(e,r){return u.fetch&&r?"fetch":u.mozchunkedarraybuffer?"moz-chunked-arraybuffer":u.msstream?"ms-stream":u.arraybuffer&&e?"arraybuffer":"text"}var n=w.exports=function(e){var r=this;d.Writable.call(r),r._opts=e,r._body=[],r._headers={},e.auth&&r.setHeader("Authorization","Basic "+T.from(e.auth).toString("base64")),Object.keys(e.headers).forEach(function(y){r.setHeader(y,e.headers[y])});var a,h=!0;if(e.mode==="disable-fetch"||"requestTimeout"in e&&!u.abortController)h=!1,a=!0;else if(e.mode==="prefer-streaming")a=!1;else if(e.mode==="allow-wrong-content-type")a=!u.overrideMimeType;else if(!e.mode||e.mode==="default"||e.mode==="prefer-fast")a=!0;else throw new Error("Invalid value for opts.mode");r._mode=o(a,h),r._fetchTimer=null,r._socketTimeout=null,r._socketTimer=null,r.on("finish",function(){r._onFinish()})};i(n,d.Writable),n.prototype.setHeader=function(e,r){var a=this,h=e.toLowerCase();t.indexOf(h)===-1&&(a._headers[h]={name:e,value:r})},n.prototype.getHeader=function(e){var r=this._headers[e.toLowerCase()];return r?r.value:null},n.prototype.removeHeader=function(e){var r=this;delete r._headers[e.toLowerCase()]},n.prototype._onFinish=function(){var e=this;if(!e._destroyed){var r=e._opts;"timeout"in r&&r.timeout!==0&&e.setTimeout(r.timeout);var a=e._headers,h=null;r.method!=="GET"&&r.method!=="HEAD"&&(h=new Blob(e._body,{type:(a["content-type"]||{}).value||""}));var y=[];if(Object.keys(a).forEach(function(p){var O=a[p].name,q=a[p].value;Array.isArray(q)?q.forEach(function(x){y.push([O,x])}):y.push([O,q])}),e._mode==="fetch"){var b=null;if(u.abortController){var c=new AbortController;b=c.signal,e._fetchAbortController=c,"requestTimeout"in r&&r.requestTimeout!==0&&(e._fetchTimer=_.setTimeout(function(){e.emit("requestTimeout"),e._fetchAbortController&&e._fetchAbortController.abort()},r.requestTimeout))}_.fetch(e._opts.url,{method:e._opts.method,headers:y,body:h||void 0,mode:"cors",credentials:r.withCredentials?"include":"same-origin",signal:b}).then(function(p){e._fetchResponse=p,e._resetTimers(!1),e._connect()},function(p){e._resetTimers(!0),e._destroyed||e.emit("error",p)})}else{var s=e._xhr=new _.XMLHttpRequest;try{s.open(e._opts.method,e._opts.url,!0)}catch(p){H.nextTick(function(){e.emit("error",p)});return}"responseType"in s&&(s.responseType=e._mode),"withCredentials"in s&&(s.withCredentials=!!r.withCredentials),e._mode==="text"&&"overrideMimeType"in s&&s.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in r&&(s.timeout=r.requestTimeout,s.ontimeout=function(){e.emit("requestTimeout")}),y.forEach(function(p){s.setRequestHeader(p[0],p[1])}),e._response=null,s.onreadystatechange=function(){switch(s.readyState){case f.LOADING:case f.DONE:e._onXHRProgress();break}},e._mode==="moz-chunked-arraybuffer"&&(s.onprogress=function(){e._onXHRProgress()}),s.onerror=function(){e._destroyed||(e._resetTimers(!0),e.emit("error",new Error("XHR error")))};try{s.send(h)}catch(p){H.nextTick(function(){e.emit("error",p)});return}}}};function l(e){try{var r=e.status;return r!==null&&r!==0}catch{return!1}}n.prototype._onXHRProgress=function(){var e=this;e._resetTimers(!1),!(!l(e._xhr)||e._destroyed)&&(e._response||e._connect(),e._response._onXHRProgress(e._resetTimers.bind(e)))},n.prototype._connect=function(){var e=this;e._destroyed||(e._response=new m(e._xhr,e._fetchResponse,e._mode,e._resetTimers.bind(e)),e._response.on("error",function(r){e.emit("error",r)}),e.emit("response",e._response))},n.prototype._write=function(e,r,a){var h=this;h._body.push(e),a()},n.prototype._resetTimers=function(e){var r=this;_.clearTimeout(r._socketTimer),r._socketTimer=null,e?(_.clearTimeout(r._fetchTimer),r._fetchTimer=null):r._socketTimeout&&(r._socketTimer=_.setTimeout(function(){r.emit("timeout")},r._socketTimeout))},n.prototype.abort=n.prototype.destroy=function(e){var r=this;r._destroyed=!0,r._resetTimers(!0),r._response&&(r._response._destroyed=!0),r._xhr?r._xhr.abort():r._fetchAbortController&&r._fetchAbortController.abort(),e&&r.emit("error",e)},n.prototype.end=function(e,r,a){var h=this;typeof e=="function"&&(a=e,e=void 0),d.Writable.prototype.end.call(h,e,r,a)},n.prototype.setTimeout=function(e,r){var a=this;r&&a.once("timeout",r),a._socketTimeout=e,a._resetTimers(!1)},n.prototype.flushHeaders=function(){},n.prototype.setNoDelay=function(){},n.prototype.setSocketKeepAlive=function(){};var t=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"];return w.exports}var S,I;function Q(){if(I)return S;I=1,S=i;var u=Object.prototype.hasOwnProperty;function i(){for(var v={},d=0;d<arguments.length;d++){var m=arguments[d];for(var f in m)u.call(m,f)&&(v[f]=m[f])}return v}return S}var A,k;function Z(){return k||(k=1,A={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}),A}var U;function ne(){return U||(U=1,function(u){var i=J(),v=G(),d=Q(),m=Z(),f=$(),o=u;o.request=function(n,l){typeof n=="string"?n=f.parse(n):n=d(n);var t=_.location.protocol.search(/^https?:$/)===-1?"http:":"",e=n.protocol||t,r=n.hostname||n.host,a=n.port,h=n.path||"/";r&&r.indexOf(":")!==-1&&(r="["+r+"]"),n.url=(r?e+"//"+r:"")+(a?":"+a:"")+h,n.method=(n.method||"GET").toUpperCase(),n.headers=n.headers||{};var y=new i(n);return l&&y.on("response",l),y},o.get=function(l,t){var e=o.request(l,t);return e.end(),e},o.ClientRequest=i,o.IncomingMessage=v.IncomingMessage,o.Agent=function(){},o.Agent.defaultMaxSockets=4,o.globalAgent=new o.Agent,o.STATUS_CODES=m,o.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}(C)),C}export{ne as a,F as r};
@@ -1,4 +1,4 @@
1
- import{j as h,g as oi}from"./mui-bYXq4XMS.js";import{a as f,c as _s,g as Mg,w as me,Y as pd,R as jg}from"./core-3dlyNYRL.js";import{t as _g,d as Lg}from"./utils-C70QTjQC.js";var $g="@liveblocks/react",Ug="2.23.0",Hg="esm";function yF(e){const[t,n]=f.useState(!1);return f.useEffect(()=>{n(!0)},[]),h.jsx(f.Suspense,{fallback:e.fallback,children:t?typeof e.children=="function"?e.children():e.children:e.fallback})}var Wg=Object.defineProperty,zg=(e,t)=>{for(var n in t)Wg(e,n,{get:t[n],enumerable:!0})},Vg="@liveblocks/core",qi="2.23.0",Kg="esm",Lo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof oi<"u"?oi:{},qg="https://liveblocks.io/docs/errors/dupes",Gg=" ";function Yg(e){console.error(e)}function Gi(e,t,n){const r=Symbol.for(e),o=`${t} (${n})`;if(!Lo[r])Lo[r]=o;else if(Lo[r]!==o){const s=[`Multiple copies of Liveblocks are being loaded in your project. This will cause issues! See ${qg+Gg}`,"","Conflicts:",`- ${e} ${Lo[r]} (already loaded)`,`- ${e} ${o} (trying to load this now)`].join(`
1
+ import{j as h,g as oi}from"./mui-bYXq4XMS.js";import{a as f,c as _s,g as Mg,w as me,Y as pd,R as jg}from"./core-3dlyNYRL.js";import{t as _g,d as Lg}from"./utils-fBOyu0sO.js";var $g="@liveblocks/react",Ug="2.23.0",Hg="esm";function yF(e){const[t,n]=f.useState(!1);return f.useEffect(()=>{n(!0)},[]),h.jsx(f.Suspense,{fallback:e.fallback,children:t?typeof e.children=="function"?e.children():e.children:e.fallback})}var Wg=Object.defineProperty,zg=(e,t)=>{for(var n in t)Wg(e,n,{get:t[n],enumerable:!0})},Vg="@liveblocks/core",qi="2.23.0",Kg="esm",Lo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof oi<"u"?oi:{},qg="https://liveblocks.io/docs/errors/dupes",Gg=" ";function Yg(e){console.error(e)}function Gi(e,t,n){const r=Symbol.for(e),o=`${t} (${n})`;if(!Lo[r])Lo[r]=o;else if(Lo[r]!==o){const s=[`Multiple copies of Liveblocks are being loaded in your project. This will cause issues! See ${qg+Gg}`,"","Conflicts:",`- ${e} ${Lo[r]} (already loaded)`,`- ${e} ${o} (trying to load this now)`].join(`
2
2
  `);Yg(s)}}function si(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=>si(o));return{...e,createdAt:t,updatedAt:n,comments:r}}function Xg(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 wa(e){const t=new Date(e.deletedAt);return{...e,deletedAt:t}}function Aa(e){const t=new Date(e.deletedAt);return{...e,deletedAt:t}}var Cn={};zg(Cn,{error:()=>wo,errorWithTitle:()=>Cd,warn:()=>ft,warnWithTitle:()=>Jg});var md="background:#0e0d12;border-radius:9999px;color:#fff;padding:3px 7px;font-family:sans-serif;font-weight:600;",Zg="font-weight:600";function vd(e){return typeof window>"u"?console[e]:(t,...n)=>console[e]("%cLiveblocks",md,t,...n)}var ft=vd("warn"),wo=vd("error");function gd(e){return typeof window>"u"?console[e]:(t,n,...r)=>console[e](`%cLiveblocks%c ${t}`,md,Zg,n,...r)}var Jg=gd("warn"),Cd=gd("error");function nn(e){return e!==null&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"}function ai(e){return nn(e)&&typeof e.startsWith=="string"}function wt(e){throw new Error(e)}function Yi(e){return Object.entries(e)}function Qg(e){return Object.keys(e)}function e0(e,t){return typeof t<"u"?Object.create(e,t):Object.create(e)}function Ls(e){try{return JSON.parse(e)}catch{return}}function ro(e){return JSON.parse(JSON.stringify(e))}function t0(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 ii(e){return e.filter(t=>t!=null)}function Ao(e){const t={...e};return Object.keys(e).forEach(n=>{const r=n;t[r]===void 0&&delete t[r]}),t}function n0(e){return new Promise(t=>setTimeout(t,e))}async function Cc(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 yc(e){let t=null;return()=>(t===null&&(t=e().catch(n=>{throw setTimeout(()=>{t=null},5e3),n})),t)}var Ar=class yd 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?Ls(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 yd(s,t,i)}get status(){return this.response.status}},r0=e=>e instanceof Ar&&e.status>=400&&e.status<500;async function Yr(e,t,n,r=r0){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 n0(a)}}function bd(){let e,t;return[new Promise((r,o)=>{e=r,t=o}),e,t]}function Ed(){const[e,t,n]=bd();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 o0(){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"),vs=Symbol("kTrigger"),fr=null,jn=null;function ct(e){if(fr!==null){e();return}fr=new Set;try{e()}finally{for(const t of fr)t[vs]();fr=null}}function Xi(e){fr||wt("Expected to be in an active batch"),fr.add(e)}function Dd(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 Zi=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}[vs](){this.#e.notify();for(const e of this[Bn])Xi(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 Zi{#e;constructor(e,t){super(t),this.#e=En(e)}[Symbol.dispose](){super[Symbol.dispose](),this.#e="(disposed)"}get(){return jn?.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(),Xi(this))})}},s0=class extends zt{constructor(e){super(En(Ao(e)))}set(){throw new Error("Don't call .set() directly, use .patch()")}patch(e){super.set(t=>Dd(t,e))}},a0=Symbol(),Xe=class ui extends Zi{#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 ui(t,o,r)}else{const r=n;return new ui(t,r)}}constructor(t,n,r){super(r),this.#t=!0,this.#e=a0,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=jn;let n;jn=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 jn)this.#n.add(o),r.delete(o);for(const o of r)o.removeSink(this);for(const o of this.#n)o.addSink(this);jn=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(),jn?.add(this),this.#e}[vs](){if(!this.hasWatchers)return;this.#o()&&super[vs]()}},Xn=class extends Zi{#e;constructor(e){super(),this.#e=e}[Symbol.dispose](){super[Symbol.dispose](),this.#e="(disposed)"}get(){return jn?.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(),Xi(this))})}};function i0(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 zn(e){return JSON.stringify(e,i0)}function tn(e){try{return JSON.stringify(e)}catch(t){throw console.error(`Could not stringify: ${t.message}`),console.error(e),t}}var u0=50,c0=class{input;resolve;reject;promise;constructor(e){this.input=e;const{promise:t,resolve:n,reject:r}=Ed();this.promise=t,this.resolve=n,this.reject=r}},Xr=class{#e=[];#t;#n;#r;#s;error=!1;constructor(e,t){this.#t=e,this.#n=t.size??u0,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=>zn(r.input)===zn(e));if(t)return t.promise;const n=new c0(e);return this.#e.push(n),this.#i(),n.promise}clear(){this.#e=[],this.error=!1,this.#o()}};function ci(e){const t=new Xn(new Map);function n(u){return zn(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 l0(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 Pr=(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?"_":"-",""),f0="th",d0="cm",h0="at";function Ji(e){return`${e}_${Pr()}`}function wd(){return Ji(f0)}function gs(){return Ji(d0)}function Ad(){return Ji(h0)}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}}},p0=/^[a-zA-Z_][a-zA-Z0-9_]*$/;function bc(e){let t=[];const n=Object.entries(e),r=[],o=[],s=[];return n.forEach(([a,i])=>{if(!p0.test(a))throw new Error("Key must only contain letters, numbers, _");wc(i)?r.push([a,i]):nn(i)&&(ai(i)?o.push([a,i]):s.push([a,i]))}),t=[...Ec(r),...Dc(o)],s.forEach(([a,i])=>{const u=Object.entries(i),c=[],l=[];u.forEach(([d,m])=>{if(m0(d))throw new Error("Key cannot be empty");wc(m)?c.push([Ac(a,d),m]):ai(m)&&l.push([Ac(a,d),m])}),t=[...t,...Ec(c),...Dc(l)]}),t.map(({key:a,operator:i,value:u})=>`${a}${i}${xd(u)}`).join(" ")}var Ec=e=>{const t=[];return e.forEach(([n,r])=>{t.push({key:n,operator:":",value:r})}),t},Dc=e=>{const t=[];return e.forEach(([n,r])=>{"startsWith"in r&&typeof r.startsWith=="string"&&t.push({key:n,operator:"^",value:r.startsWith})}),t},wc=e=>typeof e=="string"||typeof e=="number"||typeof e=="boolean"||e===null,Ac=(e,t)=>t?`${e}[${xd(t)}]`:e,m0=e=>!e||e.toString().trim()==="";function xd(e){const t=JSON.stringify(e);return typeof e!="string"||t.includes("'")?t:`'${t.slice(1,-1).replace(/\\"/g,'"')}'`}function v0(e){const t=new URLSearchParams;for(const[n,r]of Object.entries(e))r!=null&&t.set(n,r.toString());return t}function g0(e,t,n){const r=new URL(t,e);return n!==void 0&&(r.search=(n instanceof URLSearchParams?n:v0(n)).toString()),r.toString()}function be(e,...t){return e.reduce((n,r,o)=>n+encodeURIComponent(t[o-1]??"")+r)}function C0({baseUrl:e,authManager:t,fetchPolyfill:n}){const r=new y0(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(wa)},inboxNotifications:{updated:q.inboxNotifications.map(In),deleted:q.deletedInboxNotifications.map(Aa)},requestedAt:new Date(q.meta.requestedAt),permissionHints:q.meta.permissionHints}}async function s(T){let q;T.query&&(q=bc(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 Ar&&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??gs(),ne=T.threadId??wd(),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??gs(),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 si(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 si(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 Xg(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 p(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 Ar&&Ce.status===413)throw Ce;return!1},ae=5*1024*1024,Te=10,_e=[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 Yr(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,_e,xe);{let Ce;const ke=[],Pe=await Yr(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,_e,xe);try{Ce=Pe.uploadId;const ye=he(ie.file);if(ne?.aborted)throw we;const Ee=l0(ye,5);for(const $e of Ee){const qe=[];for(const{part:yt,partNumber:Je}of $e)qe.push(Yr(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,_e,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 Xr(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 ci(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 S=new It(T=>new Xr(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 k(T){return S.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 P(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 _(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 N(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(Aa)},threads:{updated:q.threads.map(fn),deleted:q.deletedThreads.map(wa)},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 Xr(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 j(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=bc(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(wa)},inboxNotifications:{updated:q.inboxNotifications.map(In),deleted:q.deletedInboxNotifications.map(Aa)},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:p,markRoomInboxNotificationAsRead:k,getNotificationSettings:x,updateNotificationSettings:I,createTextMention:H,deleteTextMention:P,getTextVersion:_,createTextVersion:B,reportTextEditor:N,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:j,getUserNotificationSettings:U,updateUserNotificationSettings:X,getUserThreads_experimental:fe,getUserThreadsSince_experimental:le,executeContextualPrompt:M}}function Od(e){return e.type==="public"?e.publicApiKey:e.token.raw}var y0=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=g0(this.#e,e,r);return await this.#t(o,{...n,headers:{"Content-Type":"application/json; charset=utf-8",...n?.headers,Authorization:`Bearer ${Od(t)}`,"X-LB-Client":qi}})}async#r(e,t,n,r){const o=await this.#n(e,t,n,r);if(!o.ok)throw await Ar.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 b0(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 E0(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 D0=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}},w0=1,Sd=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=w0++,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 D0(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=E0(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]=b0(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 xc(e){return e===4999||e>=4e3&&e<4100}function A0(e){return e>=4100&&e<4200}function Oc(e){return e===1013||e>=4200&&e<4300}function x0(e){return e==="initial"||e==="disconnected"}function Td(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 Rd=[250,500,1e3,2e3,4e3,8e3,1e4],$o=Rd[0]-1,O0=[2e3,3e4,6e4,3e5],S0=3e4,T0=2e3,R0=1e4,I0=1e4,Ln=class extends Error{constructor(e){super(e)}};function Id(e,t){return t.find(n=>n>e)??t[t.length-1]}function rr(e){e.patch({backoffDelay:Id(e.backoffDelay,Rd)})}function Sc(e){e.patch({backoffDelay:Id(e.backoffDelay,O0)})}function Tc(e){e.patch({successCount:0})}function cr(e,t){const n=e===2?wo:e===1?ft:()=>{};return()=>{n(t)}}function Rc(e){const t="Connection to Liveblocks websocket server";return n=>{e instanceof Error?ft(`${t} could not be established. ${String(e)}`):ft(Bd(e)?`${t} closed prematurely (code: ${e.code}). Retrying in ${n.backoffDelay}ms.`:`${t} could not be established.`)}}function xa(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 B0=cr(1,"Connection to WebSocket closed permanently. Won't retry.");function Bd(e){return!(e instanceof Error)&&e.type==="close"}function F0(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 P0(e){const t=Ie(),n=Ie(),r=Ie();let o=null;const s=e.events.didEnterState.subscribe(()=>{const a=Td(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 Uo=e=>t=>t.patch(e);function N0(e,t){const n=o0();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:$o},a=new Sd(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:[rr,Tc]},DISCONNECT:"@idle.initial"}),a.onEnter("@idle.*",Tc).addTransitions("@idle.*",{CONNECT:(b,w)=>w.authValue!==null?"@connecting.busy":"@auth.busy"}),a.addTransitions("@auth.backoff",{NAVIGATOR_ONLINE:{target:"@auth.busy",effect:Uo({backoffDelay:$o})}}).addTimedTransition("@auth.backoff",b=>b.backoffDelay,"@auth.busy").onEnterAsync("@auth.busy",()=>Cc(e.authenticate(),R0,"Timed out during auth"),b=>({target:"@connecting.busy",effect:Uo({authValue:b.data})}),b=>b.reason instanceof Ln?{target:"@idle.failed",effect:[cr(2,b.reason.message),o(b.reason.message,-1)]}:{target:"@auth.backoff",effect:[rr,cr(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:Uo({backoffDelay:$o})}}).addTimedTransition("@connecting.backoff",b=>b.backoffDelay,"@connecting.busy").onEnterAsync("@connecting.busy",async(b,w)=>{let D=null,x=null;const I=new Promise((S,k)=>{if(b.authValue===null)throw new Error("No auth authValue");const H=e.createSocket(b.authValue);x=H;function P(M){D=M,H.removeEventListener("message",c),k(M)}const[_,B]=bd();t.waitForActorId||B();function N(M){Ls(M.data)?.type===104&&B()}H.addEventListener("message",c),t.waitForActorId&&H.addEventListener("message",N),H.addEventListener("error",P),H.addEventListener("close",P),H.addEventListener("open",()=>{H.addEventListener("error",i),H.addEventListener("close",u);const M=()=>{H.removeEventListener("error",P),H.removeEventListener("close",P),H.removeEventListener("message",N)};_.then(()=>{S([H,M])})})});return Cc(I,I0,"Timed out during websocket connection").then(([S,k])=>{if(k(),w.aborted)throw new Error("Aborted");if(D)throw D;return S}).catch(S=>{throw l(x),S})},b=>({target:"@ok.connected",effect:Uo({socket:b.data,backoffDelay:$o})}),b=>{const w=b.reason;if(w instanceof Ln)return{target:"@idle.failed",effect:[cr(2,w.message),o(w.message,-1)]};if(Bd(w)){if(w.code===4109)return"@auth.busy";if(Oc(w.code))return{target:"@connecting.backoff",effect:[Sc,Rc(w)]};if(xc(w.code))return{target:"@idle.failed",effect:[cr(2,w.reason),o(w.reason,w.code)]}}return{target:"@auth.backoff",effect:[rr,Rc(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",S0,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",T0,{target:"@connecting.busy",effect:cr(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:rr},EXPLICIT_SOCKET_CLOSE:b=>xc(b.event.code)?{target:"@idle.failed",effect:[B0,o(b.event.reason,b.event.code)]}:A0(b.event.code)?b.event.code===4109?"@auth.busy":{target:"@auth.backoff",effect:[rr,xa(b.event)]}:Oc(b.event.code)?{target:"@connecting.backoff",effect:[Sc,xa(b.event)]}:{target:"@connecting.backoff",effect:[rr,xa(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 S(){a.send({type:"NAVIGATOR_ONLINE"})}function k(){b?.visibilityState==="visible"&&a.send({type:"WINDOW_GOT_FOCUS"})}return w?.addEventListener("online",S),w?.addEventListener("offline",I),D?.addEventListener("visibilitychange",k),()=>{D?.removeEventListener("visibilitychange",k),w?.removeEventListener("online",S),w?.removeEventListener("offline",I),l(x.socket)}})}const g=[],{statusDidChange:C,didConnect:v,didDisconnect:p,unsubscribe:E}=P0(a);return g.push(E),t.enableDebugLogging&&g.push(F0(a)),a.start(),{machine:a,cleanups:g,events:{statusDidChange:C,didConnect:v,didDisconnect:p,onMessage:n.observable,onConnectionError:r.observable}}}var k0=class{#e;#t;events;constructor(e,t=!1,n=!0){const{machine:r,events:o,cleanups:s}=N0(e,{waitForActorId:n,enableDebugLogging:t});this.#e=r,this.events=o,this.#t=s}getStatus(){try{return Td(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)}},li=(e=>(e.Read="room:read",e.Write="room:write",e.PresenceWrite="room:presence:write",e.CommentsWrite="comments:write",e.CommentsRead="comments:read",e))(li||{});function fi(e){return e.includes("room:write")}function Fd(e){return e.includes("comments:write")||e.includes("room:write")}function M0(e){return nn(e)&&(e.k==="acc"||e.k==="id"||e.k==="sec-legacy")}function Ic(e){const t=e.split(".");if(t.length!==3)throw new Error("Authentication error: invalid JWT token");const n=Ls(t0(t[1]));if(!(n&&M0(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 j0(e,t){const n=_0(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 L0(g,n.url,{room:m.roomId}),v=Ic(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=Ic(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 _0(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 L0(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 $0="https://api.liveblocks.io",Oe=Symbol(),U0=Ie();U0.observable;var Zr=Symbol("user-notification-settings-plain");function Cs(e){const t=["email","slack","teams","webPush"],n={[Zr]:{value:e,enumerable:!1}};for(const r of t)n[r]={enumerable:!0,get(){const o=this[Zr][r];return typeof o>"u"?(wo(`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 e0(null,n)}function H0(e,t){const n=Cs({...e[Zr]});for(const r of Qg(t)){const o=t[r];if(o!==void 0){const s=Object.fromEntries(Yi(o).filter(([,a])=>a!==void 0));n[Zr][r]={...n[Zr][r],...s}}}return n}var Pt=32,Dn=126,W0=Dn-Pt+1,Qi=eu(0),$s=eu(1),z0=Qi+eu(-1);function eu(e){const t=Pt+(e<0?W0+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?q0(e,t):e!==void 0?K0(e):t!==void 0?V0(t):$s}function V0(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)+z0:e.substring(0,n)+String.fromCharCode(r-1):e.substring(0,n+1)}return $s}function K0(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+$s}function q0(e,t){if(e<t)return di(e,t);if(e>t)return di(t,e);throw new Error("Cannot compute value between two equal positions")}function di(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+=Qi.repeat(i-u.length));const c=e.substring(i);return u+di(c,"")}else return G0(e,n)+String.fromCharCode(a+s>>1)}}function G0(e,t){return t<e.length?e.substring(0,t):e+Qi.repeat(t-e.length)}var Y0=Pt+1;function X0(e){if(e==="")return!1;const t=e.length-1,n=e.charCodeAt(t);if(n<Y0||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 Z0(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):$s}function oo(e){return X0(e)?e:Z0(e)}function J0(e){return e.type===5&&e.id==="ACK"}function Q0(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 Bc(e,t,n=oo(t)){return Object.freeze({type:"HasParent",node:e,key:t,pos:n})}var Fc=Object.freeze({type:"NoParent"});function eC(e,t=oo(e)){return Object.freeze({type:"Orphaned",oldKey:e,oldPos:t})}var Us=class{#e;#t;#n=Fc;_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=Bc(e,t);return;case"Orphaned":case"NoParent":{this.#n=Bc(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=eC(this.parent.key,this.parent.pos);break}case"NoParent":{this.#n=Fc;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 tC(e){return e.type===0&&!nC(e)}function nC(e){return e.parentId!==void 0&&e.parentKey!==void 0}var Sn=class Pd extends Us{#e;constructor(t){super(),this.#e=t}get data(){return this.#e}static _deserialize([t,n],r,o){const s=new Pd(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??Pr(),key:t,payload:this.#e}}_toImmutable(){return this.#e}clone(){return ro(this.data)}};function rC(e,t){const n=e._parentPos,r=t._parentPos;return n===r?0:n<r?-1:1}var Nr=class hi extends Us{#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=mr(r);s._setParentLink(this,o),this.#e.push(s),n=o}}static _deserialize([t],n,r){const o=new hi([]);o._attach(t,r);const s=n.get(t);if(s===void 0)return o;for(const[a,i]of s){const u=Md([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=Wo(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(rC),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=zr(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,[or(a,o)]),reverse:[]};{this.#t.add(i),this.#e[a]=o;const u=[or(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(jt(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(Ho(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?jt(u,i):or(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?jt(c,u):or(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=oo(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,[jt(s,o)]),reverse:[]}}#a(t){const n=this.#e.find(s=>s._id===t.id),r=oo(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,[jt(a,s)]),reverse:[]}}else{o!==-1&&this.#u(o,r);const{newItem:a,newIndex:i}=this.#c(t,r);return{modified:Fe(this,[jt(i,a)]),reverse:[]}}}}#l(t){const{id:n,parentKey:r}=t,o=zr(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,[jt(i,o)]),reverse:[{type:5,id:n}]}}#d(t){const{id:n,parentKey:r}=t,o=zr(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=Wo(i._toOps(pe(this._id),r,this._pool),t.id),c=[or(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,[jt(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,[Ho(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,[jt(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=mr(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,[jt(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,[Ho(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(Ho(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=mr(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,[or(t,a)]));const c=Wo(a._toOps(this._id,o,this._pool),s);this.#n.set(o,pe(c[0].opId));const l=Wo(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 oC(this.#e)}#c(t,n){const r=zr(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??Pr(),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 hi(this.#e.map(t=>t.clone()))}},oC=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 or(e,t){return{index:e,type:"set",item:t instanceof Sn?t.data:t}}function Ho(e,t){return{type:"delete",index:e,deletedItem:t instanceof Sn?t.data:t}}function jt(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 Wo(e,t){return e.map((n,r)=>r===0?{...n,intent:"set",deletedId:t}:n)}var kr=class pi extends Us{#e;#t;constructor(t){if(super(),this.#t=new Map,t){const n=[];for(const[r,o]of t){const s=mr(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 pi;s._attach(t,o);const a=r.get(t);if(a===void 0)return s;for(const[i,u]of a){const c=Md([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=zr(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=mr(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??Pr(),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 pi(Array.from(this.#e).map(([t,n])=>[t,n.clone()]))}},Zn=class Wr extends Us{#e;#t;static#n(t){const n=new Map;let r=null;for(const[o,s]of t)if(tC(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]=Wr.#n(t);return Wr._deserialize(r,o,n)}constructor(t={}){super(),this.#t=new Map;const n=Ao(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 Wr(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=sC([s,a],n,r);dr(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=Nd(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(),dr(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??Pr();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]=dr(r)?r.toImmutable():r;return t}clone(){return new Wr(Object.fromEntries(Array.from(this.#e).map(([t,n])=>[t,dr(n)?n.clone():ro(n)])))}};function zr(e){return mr(Nd(e))}function Nd(e){switch(e.type){case 8:return e.data;case 4:return new Zn(e.data);case 7:return new kr;case 2:return new Nr([]);default:return lt(e,"Unknown creation Op")}}function kd(e,t){return e===t?!0:e.parent.type==="HasParent"?kd(e.parent.node,t):!1}function Md([e,t],n,r){switch(t.type){case 0:return Zn._deserialize([e,t],n,r);case 1:return Nr._deserialize([e,t],n,r);case 2:return kr._deserialize([e,t],n,r);case 3:return Sn._deserialize([e,t],n,r);default:throw new Error("Unexpected CRDT type")}}function sC([e,t],n,r){switch(t.type){case 0:return Zn._deserialize([e,t],n,r);case 1:return Nr._deserialize([e,t],n,r);case 2:return kr._deserialize([e,t],n,r);case 3:return t.data;default:throw new Error("Unexpected CRDT type")}}function dr(e){return jd(e)||aC(e)||iC(e)}function We(e){return dr(e)||uC(e)}function jd(e){return e instanceof Nr}function aC(e){return e instanceof kr}function iC(e){return e instanceof Zn}function uC(e){return e instanceof Sn}function cC(e){return e===void 0?void 0:dr(e)?e.clone():ro(e)}function $n(e){return e instanceof Sn?e.data:e instanceof Nr||e instanceof kr||e instanceof Zn?e:lt(e,"Unknown AbstractCrdt")}function mr(e){return e instanceof Zn||e instanceof kr||e instanceof Nr?e:new Sn(e)}function lC(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 fC(e,t){const n=e.updates;for(const[r,o]of Yi(t.updates))n[r]=o;return{...t,updates:n}}function dC(e,t){const n=e.updates;for(const[r,o]of Yi(t.updates))n[r]=o;return{...t,updates:n}}function hC(e,t){const n=e.updates;return{...t,updates:n.concat(t.updates)}}function Oa(e,t){return e===void 0?t:e.type==="LiveObject"&&t.type==="LiveObject"?fC(e,t):e.type==="LiveMap"&&t.type==="LiveMap"?dC(e,t):e.type==="LiveList"&&t.type==="LiveList"?hC(e,t):t}var Sa=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 pC(e){return e===null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function _d(e){return Array.isArray(e)}function mC(e){return!pC(e)&&!_d(e)}function vC(e,t){const{connectionId:n,id:r,info:o}=e,s=fi(e.scopes);return En(Ao({connectionId:n,id:r,info:o,canWrite:s,canComment:Fd(e.scopes),isReadOnly:!s,presence:t}))}var gC=class{#e;#t;signal;constructor(){this.#e=new Xn({connections:new Map,presences:new Map}),this.signal=Xe.from(this.#e,e=>ii(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 vC(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(Ao(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=Dd(r,t);return r===o?!1:(n.presences.set(e,En(o)),this.#r(e))})}},Ld=class $d 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 $d(CC(t),t,n)}};function CC(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 Pc=1024*1024-512;function yC(e){let t=0;return()=>`${e}:${t++}`}function Nc(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 bC(){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 EC(e,t){const n=t.roomId,r=e.initialPresence,o=e.initialStorage,s=t.roomHttpClient,[a,i]=bC(),u={...t.delegates,canZombie(){return t.backgroundKeepAliveTimeout!==void 0&&a.current!==null&&Date.now()>a.current+t.backgroundKeepAliveTimeout&&Mo()!=="synchronizing"}},c=new k0(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 s0(r),others:new gC,initialStorage:o,idFactory:null,yjsProvider:void 0,yjsProviderDidChange:Ie(),pool:Q0(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=Od(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 p(){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(_e),c.events.statusDidChange.subscribe(m),c.events.statusDidChange.subscribe(v),c.events.didConnect.subscribe(p),c.events.didDisconnect.subscribe(E),c.events.onConnectionError.subscribe(({message:A,code:K})=>{const Z="ROOM_CONNECTION_ERROR",oe=new Ld(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,Oa(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?fi(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 S(A,K){await s.reportTextEditor({roomId:n,type:A,rootKey:K})}async function k(){return s.listTextVersions({roomId:n})}async function H(A){return s.listTextVersionsSince({roomId:n,since:A.since,signal:A.signal})}async function P(A){return s.getTextVersion({roomId:n,versionId:A})}async function _(){return s.createTextVersion({roomId:n})}async function B(A){return s.executeContextualPrompt({roomId:n,...A})}function*N(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*N(Qe):yield Rn}}function*M(A){if(A.length<2)if(A[0].type===201){yield*N(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<Pc?!1:new TextEncoder().encode(A).length>=Pc}function re(A){const K=t.largeMessageStrategy??"default",Z=tn(A);if(!W(Z))return c.send(Z);switch(K){case"default":{wo("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=fi(K.scopes);return{connectionId:K.actor,id:A.userId,info:A.userInfo,presence:Z,canWrite:oe,canComment:Fd(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?Nc("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=Zn._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,cC(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=lC(K,new Map(A)),oe=j(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 j(A,K){const Z={reverse:new Sa,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),Oa(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(J0(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"&&jd(Z.parent.node)?Z.parent.node._setChildKey(oo(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=yC(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 mC(A)?A:null}function ae(A){const K=Ls(A);return K===void 0?null:_d(K)?ii(K.map(Z=>xe(Z))):ii([xe(K)])}function Te(A){if(A.size===0)return;const K=[],Z=Array.from(A.values()),oe=j(Z,!0);K.push({type:201,ops:oe.ops}),G(oe.updates),re(K)}function _e(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=j(oe.ops,!1);for(const[Re,Mt]of Se.updates.storageUpdates)Z.storageUpdates.set(Re,Oa(Z.storageUpdates.get(Re),Mt));break}case 299:{Cd("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 nr(){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 va(){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=j(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 ga(){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=j(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 Ca(){l.undoStack.length=0,l.redoStack.length=0}function ya(A){if(l.activeBatch)return A();let K;l.activeBatch={ops:[],updates:{storageUpdates:new Map,presence:!1,others:[]},reverseOps:new Sa};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 ba(){l.pausedHistory===null&&(l.pausedHistory=new Sa)}function Ea(){const A=l.pausedHistory;l.pausedHistory=null,A!==null&&A.length>0&&se(Array.from(A))}const hc=t.createSyncSource();function Mo(){return l.root===void 0?Ee===null?"not-loaded":"loading":l.unacknowledgedOps.size===0?"synchronized":"synchronizing"}let pc=Mo();function jo(){const A=Mo();pc!==A&&(pc=A,D.storageStatus.notify(A)),hc.setSyncStatus(A==="synchronizing"?"synchronizing":"synchronized")}function mc(){return Y.get()!==null}async function pg(){for(;!mc();){const{promise:A,resolve:K}=Ed(),Z=_o.self.subscribeOnce(K),oe=_o.status.subscribeOnce(K);await A,Z(),oe()}}function vc(){return nr()!==null}async function mg(){for(;!vc();)await cn()}const vg=Xe.from(l.others.signal,A=>A.map((K,Z)=>Nc(`Other ${Z}`,K))),_o={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 gg(A){return s.getThreadsSince({roomId:n,since:A.since,signal:A.signal})}async function Cg(A){return s.getThreads({roomId:n,query:A?.query,cursor:A?.cursor})}async function yg(A){return s.getThread({roomId:n,threadId:A})}async function bg(A){return s.createThread({roomId:n,threadId:A.threadId,commentId:A.commentId,metadata:A.metadata,body:A.body,attachmentIds:A.attachmentIds})}async function Eg(A){return s.deleteThread({roomId:n,threadId:A})}async function Dg({metadata:A,threadId:K}){return s.editThreadMetadata({roomId:n,threadId:K,metadata:A})}async function wg(A){return s.markThreadAsResolved({roomId:n,threadId:A})}async function Ag(A){return s.markThreadAsUnresolved({roomId:n,threadId:A})}async function xg(A){return s.createComment({roomId:n,threadId:A.threadId,commentId:A.commentId,body:A.body,attachmentIds:A.attachmentIds})}async function Og(A){return s.editComment({roomId:n,threadId:A.threadId,commentId:A.commentId,body:A.body,attachmentIds:A.attachmentIds})}async function Sg({threadId:A,commentId:K}){return s.deleteComment({roomId:n,threadId:A,commentId:K})}async function Tg({threadId:A,commentId:K,emoji:Z}){return s.addReaction({roomId:n,threadId:A,commentId:K,emoji:Z})}async function Rg({threadId:A,commentId:K,emoji:Z}){return await s.removeReaction({roomId:n,threadId:A,commentId:K,emoji:Z})}function Ig(A){return{type:"localAttachment",status:"idle",id:Ad(),name:A.name,size:A.size,mimeType:A.type,file:A}}async function Bg(A,K={}){return s.uploadAttachment({roomId:n,attachment:A,signal:K.signal})}function Fg(A){return s.getAttachmentUrl({roomId:n,attachmentId:A})}function Pg(A){return s.getNotificationSettings({roomId:n,signal:A?.signal})}function Ng(A){return s.updateNotificationSettings({roomId:n,settings:A})}async function kg(A){await s.markRoomInboxNotificationAsRead({roomId:n,inboxNotificationId:A})}const gc=t.createSyncSource();function Da(A){return gc.setSyncStatus(A==="synchronizing"?"synchronizing":"synchronized")}return Object.defineProperty({[Oe]:{get presenceBuffer(){return ro(l.buffer.presenceUpdates?.data??null)},get undoStack(){return ro(l.undoStack)},get nodeCount(){return l.pool.nodes.size},getYjsProvider(){return l.yjsProvider},setYjsProvider(A){l.yjsProvider?.off("status",Da),l.yjsProvider=A,A?.on("status",Da),l.yjsProviderDidChange.notify()},yjsProviderDidChange:l.yjsProviderDidChange.observable,reportTextEditor:S,createTextMention:x,deleteTextMention:I,listTextVersions:k,listTextVersionsSince:H,getTextVersion:P,createTextVersion:_,executeContextualPrompt:B,getSelf_forDevTools:()=>Q.get(),getOthers_forDevTools:()=>vg.get(),simulate:{explicitClose:A=>c._privateSendMachineEvent({type:"EXPLICIT_SOCKET_CLOSE",event:A}),rawSend:A=>c.send(A)},attachmentUrlsStore:s.getOrCreateAttachmentUrlsStore(n)},id:n,subscribe:DC(n,_o,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",Da),hc.destroy(),gc.destroy(),i(),c.destroy(),A[Symbol.dispose]()},updatePresence:X,updateYDoc:ke,broadcastEvent:Pe,batch:ya,history:{undo:va,redo:ga,canUndo:q,canRedo:ne,clear:Ca,pause:ba,resume:Ea},fetchYDoc:ln,getStorage:cn,getStorageSnapshot:nr,getStorageStatus:Mo,isPresenceReady:mc,isStorageReady:vc,waitUntilPresenceReady:yc(pg),waitUntilStorageReady:yc(mg),events:_o,getStatus:()=>c.getStatus(),getSelf:()=>Y.get(),getPresence:()=>l.myPresence.get(),getOthers:()=>l.others.get(),getThreads:Cg,getThreadsSince:gg,getThread:yg,createThread:bg,deleteThread:Eg,editThreadMetadata:Dg,markThreadAsResolved:wg,markThreadAsUnresolved:Ag,createComment:xg,editComment:Og,deleteComment:Sg,addReaction:Tg,removeReaction:Rg,prepareAttachment:Ig,uploadAttachment:Bg,getAttachmentUrl:Fg,getNotificationSettings:Pg,updateNotificationSettings:Ng,markInboxNotificationAsRead:kg},Oe,{enumerable:!1})}function DC(e,t,n){function r(a,i){return t.storageBatch.subscribe(u=>{const c=u.filter(l=>kd(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"&&wC(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 wC(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 AC(e,t){return async()=>t.getAuthValue({requestedScope:"room:read",roomId:e})}function xC(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",qi),new o(s.toString())}}var OC=16,SC=1e3,TC=100,RC=15e3,IC=200,BC=1e3,FC=3e4,PC=5e3,NC=50,kC=50;function MC(e){return typeof e=="string"&&e.startsWith("http")?e:$0}function jC(e){const t=e,n=LC(t.throttle??TC),r=$C(t.lostConnectionTimeout??PC),o=_C(t.backgroundKeepAliveTimeout),s=MC(t.baseUrl),a=new zt(void 0),i=j0(e,V=>{const te=V.k==="sec-legacy"?V.id:V.uid;a.set(()=>te)}),u=t.polyfills?.fetch||globalThis.fetch?.bind(globalThis),c=C0({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)??{},j=EC({initialPresence:G,initialStorage:R},{roomId:V,throttleDelay:n,lostConnectionTimeout:r,backgroundKeepAliveTimeout:o,polyfills:t.polyfills,delegates:t.mockedDelegates??{createSocket:xC(V,s,t.polyfills?.WebSocket),authenticate:AC(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:j,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");oi.atob=t.polyfills.atob}j.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())x0(V.getStatus())||V.reconnect()}const p=t.resolveUsers,E=kc(()=>!p,"Set the resolveUsers option in createClient to specify user info."),b=new Xr(async V=>{const te=V.flat(),se=await p?.({userIds:te});return E(),se??te.map(()=>{})},{delay:NC}),w=ci(b);function D(V){w.invalidate(V)}const x=t.resolveRoomsInfo,I=kc(()=>!x,"Set the resolveRoomsInfo option in createClient to specify room info."),S=new Xr(async V=>{const te=V.flat(),se=await x?.({roomIds:te});return I(),se??te.map(()=>{})},{delay:kC}),k=ci(S);function H(V){k.invalidate(V)}const P=new Map;function _(){P.clear()}const B=[],N=new zt("synchronized"),M=Ie();function W(){const V=N.get();return V==="synchronizing"?V:"synchronized"}function re(){N.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&&N.get()!=="synchronized"&&se.preventDefault()};(typeof window<"u"?window:void 0)?.addEventListener("beforeunload",V)}async function ee(V){const te=await c.getUserNotificationSettings(V);return Cs(te)}async function L(V){const te=await c.updateUserNotificationSettings(V);return Cs(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:_},getSyncStatus:W,events:{error:M,syncStatus:N},[Oe]:{currentUserId:a,mentionSuggestionsCache:P,resolveMentionSuggestions:t.resolveMentionSuggestions,usersStore:w,roomsInfoStore:k,getRoomIds(){return Array.from(l.keys())},httpClient:c,as:()=>Q,createSyncSource:Y,emitError:(V,te)=>{const se=Ld.from(V,te);M.notify(se)||wo(se.message)}}},Oe,{enumerable:!1});return Q}function tu(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 _C(e){if(e!==void 0)return tu("backgroundKeepAliveTimeout",e,RC)}function LC(e){return tu("throttle",e,OC,SC)}function $C(e){return tu("lostConnectionTimeout",e,IC,FC,BC)}function kc(e,...t){return()=>{}}function UC(e){return"type"in e&&e.type==="paragraph"}function HC(e){return!("type"in e)&&"text"in e&&typeof e.text=="string"}function WC(e){return"type"in e&&e.type==="mention"}function zC(e){return"type"in e&&e.type==="link"}var VC={paragraph:UC,text:HC,link:zC,mention:WC};function KC(e,t,n){if(!e||!e?.content)return;const o=VC[t],s=n;for(const a of e.content)for(const i of a.children)o(i)&&s?.(i)}function qC(e){const t=new Set;return KC(e,"mention",n=>t.add(n.id)),Array.from(t)}var GC={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};new RegExp(Object.keys(GC).map(e=>`\\${e}`).join("|"),"g");var YC={_:"\\_","*":"\\*","#":"\\#","`":"\\`","~":"\\~","!":"\\!","|":"\\|","(":"\\(",")":"\\)","{":"\\{","}":"\\}","[":"\\[","]":"\\]"};new RegExp(Object.keys(YC).map(e=>`\\${e}`).join("|"),"g");var Ta=[1e3,2e3,4e3,8e3,1e4];function vr(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 Sd({}).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(p,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=Ta.find(p=>p>i.backoff)??Ta[Ta.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(p){i.inForeground=p,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 XC(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 ZC(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:XC(e,t):ZC(e,t)}function JC(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 Mc=class ss{#e;#t;constructor(t,n){this.#t=n,this.#e=t}static from(t,n){const r=new ss([],n);for(const o of t)r.add(o);return r}static fromAlreadySorted(t,n){return new ss(t,n)}clone(){return new ss(this.#e.slice(),this.#t)}add(t){const n=JC(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]()}};Gi(Vg,qi,Kg);var QC="@liveblocks/client",ey="2.23.0",ty="esm";Gi(QC,ey,ty);var Ud=f.createContext(null);function ny(){return f.useContext(Ud)}function ry(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}function Hs(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(ry(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 oy=e=>e;function Jn(e,t,n){return Hs(e.subscribe,e.get,e.get,t??oy,n)}var lr=1e3,Pn=60*lr,bt={NOTIFICATIONS_POLL_INTERVAL:1*Pn,NOTIFICATIONS_MAX_STALE_TIME:5*lr,ROOM_THREADS_POLL_INTERVAL:5*Pn,ROOM_THREADS_MAX_STALE_TIME:5*lr,USER_THREADS_POLL_INTERVAL:1*Pn,USER_THREADS_MAX_STALE_TIME:30*lr,HISTORY_VERSIONS_POLL_INTERVAL:1*Pn,HISTORY_VERSIONS_MAX_STALE_TIME:5*lr,NOTIFICATION_SETTINGS_POLL_INTERVAL:1*Pn,NOTIFICATION_SETTINGS_MAX_STALE_TIME:5*lr,USER_NOTIFICATION_SETTINGS_INTERVAL:5*Pn,USER_NOTIFICATION_SETTINGS_MAX_STALE_TIME:1*Pn},ys=Object.freeze({isLoading:!0}),Hd=e=>Object.freeze({isLoading:!1,error:e});function gr(e,t){return arguments.length===1?Object.freeze({isLoading:!1,data:e}):Object.freeze({isLoading:!1,[e]:t})}function sy(e,t){for(const n of e)if(t(n))return n}function ay(e){const t=f.useRef(e);return f.useEffect(()=>{t.current=e},[e]),t}var iy=e=>e;function ut(e){return f.useReducer(iy,e)[0]}function zo(e){const t=ut(e);if(typeof t=="function"){const n=ay(e);return f.useCallback((...r)=>n.current(...r),[n])}else return t}function nu(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 jc(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 uy(e){return t=>cy(t,e)&&ly(t,e)}function cy(e,t){return t.resolved===void 0||e.resolved===t.resolved}function ly(e,t){const n=e.metadata;return t.metadata===void 0||Object.entries(t.metadata).every(([r,o])=>o===void 0||fy(n[r],o))}function fy(e,t){return t===null?e===void 0:ai(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 hy=class Wd{#e;#t;#n;signal;constructor(){this.#t=Mc.from([],(t,n)=>{const r=t.createdAt,o=n.createdAt;return r<o?!0:r===o?t.id<n.id:!1}),this.#n=Mc.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 Xn(this)}clone(){const t=new Wd;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(uy(n)),Array.from(o.filter(a=>s.every(i=>i(a))))}};function py(e,t){return zn([e,t??{}])}function my(e){return zn(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 vy=Promise.resolve(),Ra=class{#e;signal;#t;#n;constructor(e){this.#e=new zt(ys),this.#t=e,this.#n=null,this.signal=this.#e.asReadonly(),nu(this)}get(){return this.#e.get()}#r(e){const t=this.#e.get();t.data!==void 0&&this.#e.set(gr({...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):vy}#o=null;waitUntilLoaded(){if(this.#o)return this.#o;const e=Yr(()=>this.#t(void 0),5,[5e3,5e3,1e4,15e3]),t=zd(e);return t.then(n=>{this.#e.set(gr({cursor:n,hasFetchedAll:n===null,isFetchingMore:!1,fetchMoreError:void 0,fetchMore:this.fetchMore}))},n=>{this.#e.set(Hd(n)),setTimeout(()=>{this.#o=null,this.#e.set(ys)},5e3)}),this.#o=t,this.#o}},Ia=class{#e;signal;#t;constructor(e){this.#e=new zt(ys),this.signal=this.#e.asReadonly(),this.#t=e,nu(this)}get(){return this.#e.get()}#n=null;waitUntilLoaded(){if(this.#n)return this.#n;const e=Yr(()=>this.#t(),5,[5e3,5e3,1e4,15e3]),t=zd(e);return t.then(()=>{this.#e.set(gr(void 0))},n=>{this.#e.set(Hd(n)),setTimeout(()=>{this.#n=null,this.#e.set(ys)},5e3)}),this.#n=t,t}};function gy(){const e=new Xn(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&&Sy(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=sy(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 Cy(e){const t=new Xn(new Map);function n(r,o){t.mutate(s=>{s.set(r,o)})}return{signal:Xe.from(t,e,(r,o)=>xy(r,o)),update:n}}function yy(){const e=new Xn(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 by(){const e=new Xn(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 Ey(e){const t=new zt(Cs({}));function n(r){t.set(r)}return{signal:Xe.from(t,e,(r,o)=>Oy(r,o)),update:n}}function Dy(e){const t=new zt([]),n=e[Oe].createSyncSource();t.subscribe(()=>n.setSyncStatus(t.get().length>0?"synchronizing":"synchronized"));function r(s){const a=Pr(),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 wy=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=Dy(this.#e),this.permissionHints=by(),this.#n=new Ra(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=Ey(this.optimisticUpdates.signal),this.#i=new Ia(t),this.threads=new hy,this.notifications=gy(),this.roomNotificationSettings=Cy(this.optimisticUpdates.signal),this.historyVersions=yy();const n=Xe.from(this.threads.signal,this.notifications.signal,this.optimisticUpdates.signal,(d,m,g)=>Ay(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 Ra(async v=>{const p=await this.#e[Oe].httpClient.getUserThreads_experimental({cursor:v,query:m});return this.updateThreadifications(p.threads,p.inboxNotifications),this.permissionHints.update(p.permissionHints),this.#s===null&&(this.#s=p.requestedAt),p.nextCursor});return{signal:Xe.from(()=>{const v=g.get();if(v.isLoading||v.error)return v;const p=this.outputs.threads.get().findMany(void 0,m??{},"desc"),E=v.data;return{isLoading:!1,threads:p,hasFetchedAll:E.hasFetchedAll,isFetchingMore:E.isFetchingMore,fetchMoreError:E.fetchMoreError,fetchMore:E.fetchMore}},jc),waitUntilLoaded:g.waitUntilLoaded}}),a=new It(d=>{const[m,g]=JSON.parse(d),C=new Ra(async p=>{const E=await this.#e[Oe].httpClient.getThreads({roomId:m,cursor:p,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 p=C.get();if(p.isLoading||p.error)return p;const E=this.outputs.threads.get().findMany(m,g??{},"asc"),b=p.data;return{isLoading:!1,threads:E,hasFetchedAll:b.hasFetchedAll,isFetchingMore:b.isFetchingMore,fetchMoreError:b.fetchMoreError,fetchMore:b.fetchMore}},jc),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 Ia(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:gr("settings",pe(this.roomNotificationSettings.signal.get()[d]))},Bt),waitUntilLoaded:m.waitUntilLoaded}}),c=new It(d=>{const m=new Ia(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 p=this.#o.get(d);(p===void 0||p>v.requestedAt)&&this.#o.set(d,v.requestedAt)});return{signal:Xe.from(()=>{const C=m.get();return C.isLoading||C.error?C:gr("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:gr("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},nu(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,...Ao(n)}),r)}addReaction(e,t,n,r,o){this.#a(e,t,s=>Kd(s,n,r),o)}removeReaction(e,t,n,r,o,s){this.#a(e,t,a=>qd(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(bs(n,e)),this.notifications.updateAssociatedNotification(e))})}editComment(e,t,n){return this.#a(e,t,r=>bs(r,n))}deleteComment(e,t,n,r){return this.#a(e,t,o=>Vd(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 Ay(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(bs(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(bs(i,a.comment));break}case"delete-comment":{const i=r.get(a.threadId);if(i===void 0)break;r.upsert(Vd(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(Kd(i,a.commentId,a.reaction));break}case"remove-reaction":{const i=r.get(a.threadId);if(i===void 0)break;r.upsert(qd(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 xy(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 Oy(e,t){let n=e;for(const r of t)r.type==="update-user-notification-settings"&&(n=H0(n,r.settings));return n}function Sy(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 bs(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 Vd(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 Kd(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:Ty(s.reactions,n)}:s);return{...e,updatedAt:new Date(Math.max(n.createdAt.getTime(),e.updatedAt.getTime())),comments:o}}function qd(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 Ty(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 Gd=f.createContext(null);function Yd(e){return new Error(`resolveUsers didn't return anything for user '${e}'`)}function Ry(e){return new Error(`resolveRoomsInfo didn't return anything for room '${e}'`)}function Iy(e){return e}var _c=new WeakMap,Lc=new WeakMap;function By(e,t){return e===void 0||e?.isLoading?e??{isLoading:!0}:e.error?e:e.data?{isLoading:!1,user:e.data}:{isLoading:!1,error:Yd(t)}}function Fy(e,t){return e===void 0||e?.isLoading?e??{isLoading:!0}:e.error?e:e.data?{isLoading:!1,info:e.data}:{isLoading:!1,error:Ry(t)}}function Xd(e){let t=_c.get(e);return t||(t=new wy(e),_c.set(e,t)),t}function xo(e){let t=Lc.get(e);return t||(t=Py(e),Lc.set(e,t)),t}function Py(e){const t=Xd(e),n=vr(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=vr(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=vr(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 Ny(e,t,n){const{store:r,notificationsPoller:o}=xo(e);return f.useEffect(()=>void r.outputs.loadingNotifications.waitUntilLoaded()),f.useEffect(()=>(o.inc(),o.pollNowIfStale(),()=>{o.dec()}),[o]),Jn(r.outputs.loadingNotifications.signal,t,n)}function ky(e){return f.useCallback(t=>{const{store:n}=xo(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 My(e){return f.useCallback(t=>{const{store:n}=xo(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 jy(e,t){const{store:n}=xo(e);return Jn(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 _y(e,t){const n=e[Oe].usersStore,r=f.useCallback(()=>n.getItemState(t),[n,t]),o=f.useCallback(a=>By(a,t),[t]),s=Hs(n.subscribe,r,r,o,Bt);return f.useEffect(()=>void n.enqueue(t)),s}function Ly(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 Yd(t);const s=f.useSyncExternalStore(n.subscribe,r,r);return s.isLoading,s.error,{isLoading:!1,user:s.data,error:void 0}}function $y(e,t){const n=e[Oe].roomsInfoStore,r=f.useCallback(()=>n.getItemState(t),[n,t]),o=f.useCallback(a=>Fy(a,t),[t]),s=Hs(n.subscribe,r,r,o,Bt);return f.useEffect(()=>void n.enqueue(t)),s}function Uy(e){const t=ru();if(!e?.allowNesting&&t!==null)throw new Error("You cannot nest multiple LiveblocksProvider instances in the same React tree.")}function ru(){return f.useContext(Gd)}function Be(){return ru()??wt("LiveblocksProvider is missing from the React tree.")}function Hy(e){return Uy(e),h.jsx(Gd.Provider,{value:e.client,children:e.children})}function bF(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:zo(n.authEndpoint),resolveMentionSuggestions:zo(n.resolveMentionSuggestions),resolveUsers:zo(n.resolveUsers),resolveRoomsInfo:zo(n.resolveRoomsInfo),baseUrl:ut(n.baseUrl),enableDebugLogging:ut(n.enableDebugLogging)},o=f.useMemo(()=>jC(r),[]);return h.jsx(Hy,{client:o,children:t})}function Wy(e={}){const t=Be(),{store:n,userThreadsPoller:r}=xo(t),o=my(e.query);return f.useEffect(()=>void n.outputs.loadingUserThreads.getOrCreate(o).waitUntilLoaded()),f.useEffect(()=>(r.inc(),r.pollNowIfStale(),()=>{r.dec()}),[r]),Jn(n.outputs.loadingUserThreads.getOrCreate(o).signal)}function EF(){return Ny(Be(),Iy,Bt)}function zy(e){return jy(Be(),e)}function Vy(){return ky(Be())}function Ky(){return My(Be())}function qy(e){const t=Be();return _y(t,e)}function Gy(e){const t=Be();return Ly(t,e)}function ou(e){return $y(Be(),e)}var Yy=zy,Zd=qy,DF=Gy,wF=Wy;function Xy(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 Zy(e,t){f.useEffect(()=>{Xy(e,t)},[t.isLoading])}function Ws(e){const t=e[Oe].currentUserId.get();return t===void 0?"anonymous":t}var $c=new WeakMap;function vt(e){let t=$c.get(e);return t||(t=Jy(e),$c.set(e,t)),t}function Jy(e){const t=Xd(e);function n(a,i,u){if(t.optimisticUpdates.remove(a),u instanceof Ar){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=>vr(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=>vr(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=>vr(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 Qy(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 h.jsx(eb,{...e,stableEnterRoom:r})}function eb(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]),h.jsx(Ud.Provider,{value:s,children:e.children})}function su(e){const t=ny();if(t===null&&!e?.allowOutsideRoom)throw new Error("RoomProvider is missing from the React tree.");return t}function au(){return Be()[Oe].resolveMentionSuggestions}function tb(){return Be()[Oe].mentionSuggestionsCache}function nb(e={}){const{scrollOnLoad:t=!0}=e,n=Be(),r=su(),{store:o,getOrCreateThreadsPollerForRoomId:s}=vt(n),a=py(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=Jn(o.outputs.loadingRoomThreads.getOrCreate(a).signal);return Zy(t,u),u}function rb(){return Jd(su().id)}function Jd(e){const t=Be();return f.useCallback(n=>{const r=n.body,o=n.metadata??{},s=n.attachments,a=wd(),i=gs(),u=new Date,c={id:i,threadId:a,roomId:e,createdAt:u,type:"comment",userId:Ws(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 ob(e){const t=Be();return f.useCallback(({threadId:n,body:r,attachments:o})=>{const s=gs(),i={id:s,threadId:n,roomId:e,type:"comment",createdAt:new Date,userId:Ws(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 Qd(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 sb(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 eh(e){const t=Be();return f.useCallback(({threadId:n,commentId:r,emoji:o})=>{const s=new Date,a=Ws(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 th(e){const t=Be();return f.useCallback(({threadId:n,commentId:r,emoji:o})=>{const s=Ws(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 ab(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 ib(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 ub(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 cb(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 Jn(r,o,Bt)}function lb(e){return e===void 0||e?.isLoading?e??{isLoading:!0}:e.error?e:(e.data,{isLoading:!1,url:e.data})}function zs(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]),Hs(r.subscribe,o,o,lb,Bt)}var fb=new Set;function db(e){const t=Be(),n=vt(t).store;return Jn(n.permissionHints.signal,r=>r.get(e)??fb)}var AF=Qy,nh=su,xF=rb,OF=nb;Gi($g,Ug,Hg);var Vt=typeof window<"u"?f.useLayoutEffect:f.useEffect,Uc=500;function hb(e,t){const[n,r]=f.useState(),o=f.useRef(),s=au(),a=tb();return f.useEffect(()=>{if(t===void 0||!s)return;const i={text:t,roomId:e},u=zn(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)>Uc?d():c=window.setTimeout(()=>{d()},Uc),()=>{l=!0,window.clearTimeout(c)}},[t,e,s,a]),n}function pb(){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 Oo({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=mb({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 mb({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 vb(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Vs(...e){return t=>e.forEach(n=>vb(n,t))}function Ke(...e){return f.useCallback(Vs(...e),e)}var Ne=f.forwardRef((e,t)=>{const{children:n,...r}=e,o=f.Children.toArray(n),s=o.find(gb);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 h.jsx(mi,{...r,ref:t,children:f.isValidElement(a)?f.cloneElement(a,void 0,i):null})}return h.jsx(mi,{...r,ref:t,children:n})});Ne.displayName="Slot";var mi=f.forwardRef((e,t)=>{const{children:n,...r}=e;if(f.isValidElement(n)){const o=yb(n);return f.cloneElement(n,{...Cb(r,n.props),ref:t?Vs(t,o):o})}return f.Children.count(n)>1?f.Children.only(null):null});mi.displayName="SlotClone";var iu=({children:e})=>h.jsx(h.Fragment,{children:e});function gb(e){return f.isValidElement(e)&&e.type===iu}function Cb(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 yb(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 bb=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],He=bb.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),h.jsx(i,{...a,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function rh(e,t){e&&_s.flushSync(()=>e.dispatchEvent(t))}var Eb="Toggle",oh=f.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r=!1,onPressedChange:o,...s}=e,[a=!1,i]=Oo({prop:n,onChange:o,defaultProp:r});return h.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)})})});oh.displayName=Eb;var uu=oh;function Ae(...e){return e.filter(t=>typeof t=="string"||typeof t=="number").join(" ")}const Hc=20,Wc=20;function Ue({children:e,className:t,...n}){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:Hc,height:Wc,viewBox:`0 0 ${Hc} ${Wc}`,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",role:"presentation",className:Ae("lb-icon",t),...n,children:e})}function sh(e){return h.jsx(Ue,{...e,children:h.jsx("path",{d:"M16 6L8 14L4 10"})})}function cu(e){return h.jsxs(Ue,{...e,children:[h.jsx("path",{d:"M15 5L5 15"}),h.jsx("path",{d:"M5 5L15 15"})]})}function ah(e){return h.jsx(Ue,{...e,children:h.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 Db(e){return h.jsx(Ue,{...e,children:h.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 ih(e){return h.jsxs(Ue,{fill:"currentColor",...e,children:[h.jsx("circle",{cx:5,cy:10,r:.75}),h.jsx("circle",{cx:10,cy:10,r:.75}),h.jsx("circle",{cx:15,cy:10,r:.75})]})}function zc(e){return h.jsxs(Ue,{...e,children:[h.jsx("path",{d:"M11 3.07A7 7 0 1 0 16.93 9"}),h.jsx("path",{d:"M7.5 11.5S8.25 13 10 13s2.5-1.5 2.5-1.5M8 8h0"}),h.jsx("path",{d:"M12 8h0"}),h.jsx("path",{d:"M13 5h4m-2-2v4"}),h.jsx("circle",{cx:"8",cy:"8",r:".25"}),h.jsx("circle",{cx:"12",cy:"8",r:".25"})]})}const So=6,Ks=10,wb="'Apple Color Emoji', 'Noto Color Emoji', 'Twemoji Mozilla', 'Android Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', EmojiSymbols, sans-serif",Ab=f.forwardRef(({emoji:e,style:t,asChild:n,...r},o)=>{const s=n?Ne:"span";return h.jsx(s,{role:"img","aria-label":e,"data-emoji":e,style:{...t,fontFamily:wb,display:"inline-flex",alignItems:"center",justifyContent:"center",width:"1em",whiteSpace:"nowrap"},...r,ref:o,children:e})}),lu=f.forwardRef(({className:e,...t},n)=>h.jsx(Ab,{className:Ae("lb-emoji",e),...t,ref:n}));function Ba(e,t,n){return e===1?t:n??`${t}s`}const xb={locale:"en",dir:"ltr",USER_SELF:"you",USER_UNKNOWN:"Anonymous",LIST_REMAINING:e=>`${e} more`,LIST_REMAINING_USERS:e=>`${e} ${Ba(e,"other")}`,LIST_REMAINING_COMMENTS:e=>`${e} more ${Ba(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)=>h.jsxs(h.Fragment,{children:[e," reacted with ",h.jsx(lu,{emoji:t})]}),COMMENT_REACTION_DESCRIPTION:(e,t)=>`${t} ${Ba(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)=>h.jsxs(h.Fragment,{children:[e," commented",t?h.jsxs(h.Fragment,{children:[" in ",t]}):h.jsx(h.Fragment,{children:" in a thread"})]}),INBOX_NOTIFICATION_THREAD_MENTION:(e,t)=>h.jsxs(h.Fragment,{children:[e," mentioned you",t?h.jsxs(h.Fragment,{children:[" in ",t]}):null]}),INBOX_NOTIFICATION_TEXT_MENTION:(e,t)=>h.jsxs(h.Fragment,{children:[e," mentioned you",t?h.jsxs(h.Fragment,{children:[" in ",t]}):null]}),HISTORY_VERSION_PREVIEW_AUTHORS_LIST:e=>h.jsxs(h.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."},Ob=f.createContext(void 0);function Ze(e){const t=f.useContext(Ob);return f.useMemo(()=>({...xb,...t,...e}),[t,e])}/*!
4
4
  * is-plain-object <https://github.com/jonschlinkert/is-plain-object>