@semiont/cli 0.5.9 → 0.5.11
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.
- package/README.md +1 -0
- package/dist/cli.mjs +720 -447
- package/dist/dashboard/dashboard.css +1 -1
- package/dist/dashboard/dashboard.css.map +2 -2
- package/dist/frontend/dist/assets/{ArrowsRightLeftIcon-C7eE1lVN.js → ArrowsRightLeftIcon-BAptRmrb.js} +2 -2
- package/dist/frontend/dist/assets/{ArrowsRightLeftIcon-C7eE1lVN.js.map → ArrowsRightLeftIcon-BAptRmrb.js.map} +1 -1
- package/dist/frontend/dist/assets/{ChevronLeftIcon-BItMAxjy.js → ChevronLeftIcon-AP4JA3_n.js} +2 -2
- package/dist/frontend/dist/assets/{ChevronLeftIcon-BItMAxjy.js.map → ChevronLeftIcon-AP4JA3_n.js.map} +1 -1
- package/dist/frontend/dist/assets/{CommandLineIcon-BxjxKXBi.js → CommandLineIcon-DkeF_y-i.js} +2 -2
- package/dist/frontend/dist/assets/{CommandLineIcon-BxjxKXBi.js.map → CommandLineIcon-DkeF_y-i.js.map} +1 -1
- package/dist/frontend/dist/assets/CookiePreferences-DulRn1Ad.js +2 -0
- package/dist/frontend/dist/assets/{CookiePreferences-CwQNSYq4.js.map → CookiePreferences-DulRn1Ad.js.map} +1 -1
- package/dist/frontend/dist/assets/KeyboardShortcutsContext-_SYsNsgM.js +2 -0
- package/dist/frontend/dist/assets/{KeyboardShortcutsContext-CfYRiurd.js.map → KeyboardShortcutsContext-_SYsNsgM.js.map} +1 -1
- package/dist/frontend/dist/assets/PdfAnnotationCanvas.client-KWQ7XDWT-_iZ0YQWT.js +2 -0
- package/dist/frontend/dist/assets/PdfAnnotationCanvas.client-KWQ7XDWT-_iZ0YQWT.js.map +1 -0
- package/dist/frontend/dist/assets/ToolbarPanels-CJP-kOex.js +2 -0
- package/dist/frontend/dist/assets/{ToolbarPanels-DhP2342d.js.map → ToolbarPanels-CJP-kOex.js.map} +1 -1
- package/dist/frontend/dist/assets/{XMarkIcon-D1vU4NLc.js → XMarkIcon-BUKaQwJf.js} +2 -2
- package/dist/frontend/dist/assets/{XMarkIcon-D1vU4NLc.js.map → XMarkIcon-BUKaQwJf.js.map} +1 -1
- package/dist/frontend/dist/assets/ar-ZHKO4XDR-CdT7gRuA.js +2 -0
- package/dist/frontend/dist/assets/ar-ZHKO4XDR-CdT7gRuA.js.map +1 -0
- package/dist/frontend/dist/assets/bn-3BUDKAK5-CO5rYx_K.js +2 -0
- package/dist/frontend/dist/assets/bn-3BUDKAK5-CO5rYx_K.js.map +1 -0
- package/dist/frontend/dist/assets/client-BrDEpGKw.js +2 -0
- package/dist/frontend/dist/assets/{client-3m7lyOF-.js.map → client-BrDEpGKw.js.map} +1 -1
- package/dist/frontend/dist/assets/client-C7bo_8D-.js +2 -0
- package/dist/frontend/dist/assets/{client-sNRwAXfy.js.map → client-C7bo_8D-.js.map} +1 -1
- package/dist/frontend/dist/assets/client-DwyJWkCL.js +2 -0
- package/dist/frontend/dist/assets/{client-CSwC62BQ.js.map → client-DwyJWkCL.js.map} +1 -1
- package/dist/frontend/dist/assets/client-szDQ4r9k.js +2 -0
- package/dist/frontend/dist/assets/{client-B-MhGs0Z.js.map → client-szDQ4r9k.js.map} +1 -1
- package/dist/frontend/dist/assets/cs-2EFEUKTW-DeAOIf_-.js +2 -0
- package/dist/frontend/dist/assets/cs-2EFEUKTW-DeAOIf_-.js.map +1 -0
- package/dist/frontend/dist/assets/da-SUD3Q44Q-CgozsbCb.js +2 -0
- package/dist/frontend/dist/assets/da-SUD3Q44Q-CgozsbCb.js.map +1 -0
- package/dist/frontend/dist/assets/de-6IC5QRX7-BE7EFdCc.js +2 -0
- package/dist/frontend/dist/assets/de-6IC5QRX7-BE7EFdCc.js.map +1 -0
- package/dist/frontend/dist/assets/el-Q4NAXFRC-CnSVRzx3.js +2 -0
- package/dist/frontend/dist/assets/el-Q4NAXFRC-CnSVRzx3.js.map +1 -0
- package/dist/frontend/dist/assets/en-P2L4X27N-CUjpZEjK.js +1 -0
- package/dist/frontend/dist/assets/es-YUKZBD4W-CTA9ZbHB.js +2 -0
- package/dist/frontend/dist/assets/es-YUKZBD4W-CTA9ZbHB.js.map +1 -0
- package/dist/frontend/dist/assets/fa-OJ47LILE-DtZ-ddud.js +2 -0
- package/dist/frontend/dist/assets/fa-OJ47LILE-DtZ-ddud.js.map +1 -0
- package/dist/frontend/dist/assets/fi-QFFL5CUB-B_0Fy5E9.js +2 -0
- package/dist/frontend/dist/assets/fi-QFFL5CUB-B_0Fy5E9.js.map +1 -0
- package/dist/frontend/dist/assets/fr-BOQZZWP4-CLy3hDFG.js +2 -0
- package/dist/frontend/dist/assets/fr-BOQZZWP4-CLy3hDFG.js.map +1 -0
- package/dist/frontend/dist/assets/he-LXDY3TFA-BlHmt4OT.js +2 -0
- package/dist/frontend/dist/assets/he-LXDY3TFA-BlHmt4OT.js.map +1 -0
- package/dist/frontend/dist/assets/hi-HOJER77V-D5UtSE45.js +2 -0
- package/dist/frontend/dist/assets/hi-HOJER77V-D5UtSE45.js.map +1 -0
- package/dist/frontend/dist/assets/i18n-C4Z9Yn3V.js +2 -0
- package/dist/frontend/dist/assets/i18n-C4Z9Yn3V.js.map +1 -0
- package/dist/frontend/dist/assets/id-I5WQ6EWD-C1QdlWFh.js +2 -0
- package/dist/frontend/dist/assets/id-I5WQ6EWD-C1QdlWFh.js.map +1 -0
- package/dist/frontend/dist/assets/index-Db2g3DPc.css +1 -0
- package/dist/frontend/dist/assets/index-qVNtMzC0.js +140 -0
- package/dist/frontend/dist/assets/index-qVNtMzC0.js.map +1 -0
- package/dist/frontend/dist/assets/it-UYH642IJ-CP5ZdyLJ.js +2 -0
- package/dist/frontend/dist/assets/it-UYH642IJ-CP5ZdyLJ.js.map +1 -0
- package/dist/frontend/dist/assets/ja-JTVWAC4L-BJZThfyQ.js +2 -0
- package/dist/frontend/dist/assets/ja-JTVWAC4L-BJZThfyQ.js.map +1 -0
- package/dist/frontend/dist/assets/ko-IHXFMOIZ-j1xQCX4o.js +2 -0
- package/dist/frontend/dist/assets/ko-IHXFMOIZ-j1xQCX4o.js.map +1 -0
- package/dist/frontend/dist/assets/layout-DTmqSMaD.js +2 -0
- package/dist/frontend/dist/assets/{layout-CIBMGRGg.js.map → layout-DTmqSMaD.js.map} +1 -1
- package/dist/frontend/dist/assets/layout-Du8P32Vd.js +2 -0
- package/dist/frontend/dist/assets/{layout-DTOSfecO.js.map → layout-Du8P32Vd.js.map} +1 -1
- package/dist/frontend/dist/assets/layout-bfsd3hAb.js +2 -0
- package/dist/frontend/dist/assets/{layout--kttJwjx.js.map → layout-bfsd3hAb.js.map} +1 -1
- package/dist/frontend/dist/assets/layout-vhDZbfjy.js +2 -0
- package/dist/frontend/dist/assets/{layout-ChjT2XMf.js.map → layout-vhDZbfjy.js.map} +1 -1
- package/dist/frontend/dist/assets/ms-JH25VFLO-CBxXu_23.js +2 -0
- package/dist/frontend/dist/assets/ms-JH25VFLO-CBxXu_23.js.map +1 -0
- package/dist/frontend/dist/assets/nl-SURXW7IQ-Di1Uwfgv.js +2 -0
- package/dist/frontend/dist/assets/nl-SURXW7IQ-Di1Uwfgv.js.map +1 -0
- package/dist/frontend/dist/assets/no-HXIKQFDZ-BaYnZrFs.js +2 -0
- package/dist/frontend/dist/assets/no-HXIKQFDZ-BaYnZrFs.js.map +1 -0
- package/dist/frontend/dist/assets/{not-found-CkW7yXCZ.js → not-found-Bvki2-z5.js} +2 -2
- package/dist/frontend/dist/assets/{not-found-CkW7yXCZ.js.map → not-found-Bvki2-z5.js.map} +1 -1
- package/dist/frontend/dist/assets/page-B2mIxjOM.js +2 -0
- package/dist/frontend/dist/assets/{page-ByOTWnuA.js.map → page-B2mIxjOM.js.map} +1 -1
- package/dist/frontend/dist/assets/{page-ps7dwO8y.js → page-B5mEdf46.js} +2 -2
- package/dist/frontend/dist/assets/{page-ps7dwO8y.js.map → page-B5mEdf46.js.map} +1 -1
- package/dist/frontend/dist/assets/page-BJR7WHXg.js +2 -0
- package/dist/frontend/dist/assets/{page-CW6-9F9w.js.map → page-BJR7WHXg.js.map} +1 -1
- package/dist/frontend/dist/assets/page-Baj4wmy7.js +2 -0
- package/dist/frontend/dist/assets/{page-CNQxEyNO.js.map → page-Baj4wmy7.js.map} +1 -1
- package/dist/frontend/dist/assets/page-BbIr9jHP.js +2 -0
- package/dist/frontend/dist/assets/{page-CVsMMJ4D.js.map → page-BbIr9jHP.js.map} +1 -1
- package/dist/frontend/dist/assets/page-Bc9V6mf9.js +8 -0
- package/dist/frontend/dist/assets/{page-DE5OCneW.js.map → page-Bc9V6mf9.js.map} +1 -1
- package/dist/frontend/dist/assets/page-C-3mAlWS.js +2 -0
- package/dist/frontend/dist/assets/{page-BkM7uTwY.js.map → page-C-3mAlWS.js.map} +1 -1
- package/dist/frontend/dist/assets/{page-BSoOqqDp2.js → page-CECOHOJV2.js} +2 -2
- package/dist/frontend/dist/assets/{page-BSoOqqDp2.js.map → page-CECOHOJV2.js.map} +1 -1
- package/dist/frontend/dist/assets/page-CFCQC-1H.js +2 -0
- package/dist/frontend/dist/assets/{page-CQvf9PwP.js.map → page-CFCQC-1H.js.map} +1 -1
- package/dist/frontend/dist/assets/page-CW-IRz2J.js +2 -0
- package/dist/frontend/dist/assets/{page-CC4n7boQ.js.map → page-CW-IRz2J.js.map} +1 -1
- package/dist/frontend/dist/assets/page-ChXxpqyF.js +2 -0
- package/dist/frontend/dist/assets/{page-10-2WEh9.js.map → page-ChXxpqyF.js.map} +1 -1
- package/dist/frontend/dist/assets/{page-BnjWmDsM.js → page-CwVdaXSz.js} +2 -2
- package/dist/frontend/dist/assets/{page-BnjWmDsM.js.map → page-CwVdaXSz.js.map} +1 -1
- package/dist/frontend/dist/assets/page-D3S88nw6.js +2 -0
- package/dist/frontend/dist/assets/{page-B2YCNfqB.js.map → page-D3S88nw6.js.map} +1 -1
- package/dist/frontend/dist/assets/page-DA_80CZf.js +2 -0
- package/dist/frontend/dist/assets/{page-Bn2RYSD3.js.map → page-DA_80CZf.js.map} +1 -1
- package/dist/frontend/dist/assets/page-DrjzWWIE.js +2 -0
- package/dist/frontend/dist/assets/{page-aP22HQnz.js.map → page-DrjzWWIE.js.map} +1 -1
- package/dist/frontend/dist/assets/page-DtiXtJ-l.js +2 -0
- package/dist/frontend/dist/assets/{page-D4PdxwPW.js.map → page-DtiXtJ-l.js.map} +1 -1
- package/dist/frontend/dist/assets/page-RGbKfKB9.js +2 -0
- package/dist/frontend/dist/assets/{page-BmB9iWba.js.map → page-RGbKfKB9.js.map} +1 -1
- package/dist/frontend/dist/assets/page-lMAxop92.js +2 -0
- package/dist/frontend/dist/assets/{page-Bk28sWf5.js.map → page-lMAxop92.js.map} +1 -1
- package/dist/frontend/dist/assets/pdf-KENrED1p.js +55 -0
- package/dist/frontend/dist/assets/pdf-KENrED1p.js.map +1 -0
- package/dist/frontend/dist/assets/pdf.worker.min-DEtVeC4l.mjs +29 -0
- package/dist/frontend/dist/assets/pl-7A4KU6XK-DQA3xkbx.js +2 -0
- package/dist/frontend/dist/assets/pl-7A4KU6XK-DQA3xkbx.js.map +1 -0
- package/dist/frontend/dist/assets/pt-6MGYP7Q5-_7GIrTdD.js +2 -0
- package/dist/frontend/dist/assets/pt-6MGYP7Q5-_7GIrTdD.js.map +1 -0
- package/dist/frontend/dist/assets/ro-IROCHNIA-Dj_II2yF.js +2 -0
- package/dist/frontend/dist/assets/ro-IROCHNIA-Dj_II2yF.js.map +1 -0
- package/dist/frontend/dist/assets/rolldown-runtime-QTnfLwEv.js +1 -0
- package/dist/frontend/dist/assets/routing-DWK3zAt3.js +2 -0
- package/dist/frontend/dist/assets/{routing-GE3qy379.js.map → routing-DWK3zAt3.js.map} +1 -1
- package/dist/frontend/dist/assets/{routing-D3tVcFuL.js → routing-aCi3P9yE.js} +2 -2
- package/dist/frontend/dist/assets/{routing-D3tVcFuL.js.map → routing-aCi3P9yE.js.map} +1 -1
- package/dist/frontend/dist/assets/sv-WDJD75CV-BCL-G7dj.js +2 -0
- package/dist/frontend/dist/assets/sv-WDJD75CV-BCL-G7dj.js.map +1 -0
- package/dist/frontend/dist/assets/th-RIO2E6B3-I2dubvbq.js +2 -0
- package/dist/frontend/dist/assets/th-RIO2E6B3-I2dubvbq.js.map +1 -0
- package/dist/frontend/dist/assets/tr-TZ7ERCIN-BQ2FKoLo.js +2 -0
- package/dist/frontend/dist/assets/tr-TZ7ERCIN-BQ2FKoLo.js.map +1 -0
- package/dist/frontend/dist/assets/uk-ZFWDKLUE-BD2ECP6k.js +2 -0
- package/dist/frontend/dist/assets/uk-ZFWDKLUE-BD2ECP6k.js.map +1 -0
- package/dist/frontend/dist/assets/{vendor-Bd-5Ya9C.js → vendor-6KmH4nv9.js} +2 -2
- package/dist/frontend/dist/assets/{vendor-Bd-5Ya9C.js.map → vendor-6KmH4nv9.js.map} +1 -1
- package/dist/frontend/dist/assets/vi-UIOSP2JG-DreqKb1C.js +2 -0
- package/dist/frontend/dist/assets/vi-UIOSP2JG-DreqKb1C.js.map +1 -0
- package/dist/frontend/dist/assets/web-BE6xPuyf.js +2 -0
- package/dist/frontend/dist/assets/web-BE6xPuyf.js.map +1 -0
- package/dist/frontend/dist/assets/zh-6R6YUY46-C3GMKbzw.js +2 -0
- package/dist/frontend/dist/assets/zh-6R6YUY46-C3GMKbzw.js.map +1 -0
- package/dist/frontend/dist/index.html +5 -5
- package/dist/frontend/dist/messages/ar.json +41 -2
- package/dist/frontend/dist/messages/bn.json +41 -2
- package/dist/frontend/dist/messages/cs.json +41 -2
- package/dist/frontend/dist/messages/da.json +41 -2
- package/dist/frontend/dist/messages/de.json +41 -2
- package/dist/frontend/dist/messages/el.json +41 -2
- package/dist/frontend/dist/messages/en.json +39 -0
- package/dist/frontend/dist/messages/es.json +41 -2
- package/dist/frontend/dist/messages/fa.json +41 -2
- package/dist/frontend/dist/messages/fi.json +41 -2
- package/dist/frontend/dist/messages/fr.json +41 -2
- package/dist/frontend/dist/messages/he.json +41 -2
- package/dist/frontend/dist/messages/hi.json +41 -2
- package/dist/frontend/dist/messages/id.json +41 -2
- package/dist/frontend/dist/messages/it.json +41 -2
- package/dist/frontend/dist/messages/ja.json +41 -2
- package/dist/frontend/dist/messages/ko.json +41 -2
- package/dist/frontend/dist/messages/ms.json +41 -2
- package/dist/frontend/dist/messages/nl.json +41 -2
- package/dist/frontend/dist/messages/no.json +41 -2
- package/dist/frontend/dist/messages/pl.json +41 -2
- package/dist/frontend/dist/messages/pt.json +41 -2
- package/dist/frontend/dist/messages/ro.json +41 -2
- package/dist/frontend/dist/messages/sv.json +41 -2
- package/dist/frontend/dist/messages/th.json +41 -2
- package/dist/frontend/dist/messages/tr.json +41 -2
- package/dist/frontend/dist/messages/uk.json +41 -2
- package/dist/frontend/dist/messages/vi.json +41 -2
- package/dist/frontend/dist/messages/zh.json +41 -2
- package/dist/frontend/package.json +1 -1
- package/package.json +25 -25
- package/dist/frontend/dist/assets/CookiePreferences-CwQNSYq4.js +0 -2
- package/dist/frontend/dist/assets/KeyboardShortcutsContext-CfYRiurd.js +0 -2
- package/dist/frontend/dist/assets/PdfAnnotationCanvas.client-U4EVBZEV-hNsmZuyz.js +0 -2
- package/dist/frontend/dist/assets/PdfAnnotationCanvas.client-U4EVBZEV-hNsmZuyz.js.map +0 -1
- package/dist/frontend/dist/assets/ToolbarPanels-DhP2342d.js +0 -2
- package/dist/frontend/dist/assets/ar-WA47UUWA-Bg_g0nKu.js +0 -2
- package/dist/frontend/dist/assets/ar-WA47UUWA-Bg_g0nKu.js.map +0 -1
- package/dist/frontend/dist/assets/bn-5ANDRIU6-D3W-5Rrq.js +0 -2
- package/dist/frontend/dist/assets/bn-5ANDRIU6-D3W-5Rrq.js.map +0 -1
- package/dist/frontend/dist/assets/client-3m7lyOF-.js +0 -2
- package/dist/frontend/dist/assets/client-B-MhGs0Z.js +0 -2
- package/dist/frontend/dist/assets/client-CSwC62BQ.js +0 -2
- package/dist/frontend/dist/assets/client-sNRwAXfy.js +0 -2
- package/dist/frontend/dist/assets/cs-3RU7F4JX-2LzMsUs5.js +0 -2
- package/dist/frontend/dist/assets/cs-3RU7F4JX-2LzMsUs5.js.map +0 -1
- package/dist/frontend/dist/assets/da-GSW5P5HG-DyKRptR2.js +0 -2
- package/dist/frontend/dist/assets/da-GSW5P5HG-DyKRptR2.js.map +0 -1
- package/dist/frontend/dist/assets/de-JUAUYF4Z-DuEZ0oQs.js +0 -2
- package/dist/frontend/dist/assets/de-JUAUYF4Z-DuEZ0oQs.js.map +0 -1
- package/dist/frontend/dist/assets/el-JNLWCKEC-BfaVdiXe.js +0 -2
- package/dist/frontend/dist/assets/el-JNLWCKEC-BfaVdiXe.js.map +0 -1
- package/dist/frontend/dist/assets/en-RBN2GUHF-Bbg1LCI1.js +0 -1
- package/dist/frontend/dist/assets/es-WPOX225H-BOyWYGWS.js +0 -2
- package/dist/frontend/dist/assets/es-WPOX225H-BOyWYGWS.js.map +0 -1
- package/dist/frontend/dist/assets/fa-TAEP6N77-D2lXkg8T.js +0 -2
- package/dist/frontend/dist/assets/fa-TAEP6N77-D2lXkg8T.js.map +0 -1
- package/dist/frontend/dist/assets/fi-ZVZHANSP-cxycD0z_.js +0 -2
- package/dist/frontend/dist/assets/fi-ZVZHANSP-cxycD0z_.js.map +0 -1
- package/dist/frontend/dist/assets/fr-VLZW7M4N-BAn0-4x3.js +0 -2
- package/dist/frontend/dist/assets/fr-VLZW7M4N-BAn0-4x3.js.map +0 -1
- package/dist/frontend/dist/assets/he-QFAFYA77-CO99w2C-.js +0 -2
- package/dist/frontend/dist/assets/he-QFAFYA77-CO99w2C-.js.map +0 -1
- package/dist/frontend/dist/assets/hi-AO3DQPCV-B-glDmjd.js +0 -2
- package/dist/frontend/dist/assets/hi-AO3DQPCV-B-glDmjd.js.map +0 -1
- package/dist/frontend/dist/assets/i18n-X0oNIUcF.js +0 -2
- package/dist/frontend/dist/assets/i18n-X0oNIUcF.js.map +0 -1
- package/dist/frontend/dist/assets/id-GTXF42WM-pIWqz5D1.js +0 -2
- package/dist/frontend/dist/assets/id-GTXF42WM-pIWqz5D1.js.map +0 -1
- package/dist/frontend/dist/assets/index-Cx0aNta6.css +0 -1
- package/dist/frontend/dist/assets/index-D2LrA6v6.js +0 -141
- package/dist/frontend/dist/assets/index-D2LrA6v6.js.map +0 -1
- package/dist/frontend/dist/assets/it-AS5GM232-BIVnRKJx.js +0 -2
- package/dist/frontend/dist/assets/it-AS5GM232-BIVnRKJx.js.map +0 -1
- package/dist/frontend/dist/assets/ja-GZ4HLUOF-C8mqh5If.js +0 -2
- package/dist/frontend/dist/assets/ja-GZ4HLUOF-C8mqh5If.js.map +0 -1
- package/dist/frontend/dist/assets/ko-A4XUXFGJ-GlrkT0k0.js +0 -2
- package/dist/frontend/dist/assets/ko-A4XUXFGJ-GlrkT0k0.js.map +0 -1
- package/dist/frontend/dist/assets/layout--kttJwjx.js +0 -2
- package/dist/frontend/dist/assets/layout-CIBMGRGg.js +0 -2
- package/dist/frontend/dist/assets/layout-ChjT2XMf.js +0 -2
- package/dist/frontend/dist/assets/layout-DTOSfecO.js +0 -2
- package/dist/frontend/dist/assets/ms-YBAO3S6K-CgcHbUoC.js +0 -2
- package/dist/frontend/dist/assets/ms-YBAO3S6K-CgcHbUoC.js.map +0 -1
- package/dist/frontend/dist/assets/nl-3TJGIIIU-DCK_99k9.js +0 -2
- package/dist/frontend/dist/assets/nl-3TJGIIIU-DCK_99k9.js.map +0 -1
- package/dist/frontend/dist/assets/no-4AXIQPRQ-DAsTyX8P.js +0 -2
- package/dist/frontend/dist/assets/no-4AXIQPRQ-DAsTyX8P.js.map +0 -1
- package/dist/frontend/dist/assets/page-10-2WEh9.js +0 -2
- package/dist/frontend/dist/assets/page-B2YCNfqB.js +0 -2
- package/dist/frontend/dist/assets/page-Bk28sWf5.js +0 -2
- package/dist/frontend/dist/assets/page-BkM7uTwY.js +0 -2
- package/dist/frontend/dist/assets/page-BmB9iWba.js +0 -2
- package/dist/frontend/dist/assets/page-Bn2RYSD3.js +0 -2
- package/dist/frontend/dist/assets/page-ByOTWnuA.js +0 -2
- package/dist/frontend/dist/assets/page-CC4n7boQ.js +0 -2
- package/dist/frontend/dist/assets/page-CNQxEyNO.js +0 -2
- package/dist/frontend/dist/assets/page-CQvf9PwP.js +0 -2
- package/dist/frontend/dist/assets/page-CVsMMJ4D.js +0 -2
- package/dist/frontend/dist/assets/page-CW6-9F9w.js +0 -2
- package/dist/frontend/dist/assets/page-D4PdxwPW.js +0 -2
- package/dist/frontend/dist/assets/page-DE5OCneW.js +0 -8
- package/dist/frontend/dist/assets/page-aP22HQnz.js +0 -2
- package/dist/frontend/dist/assets/pdf-CHHhr2g_.js +0 -55
- package/dist/frontend/dist/assets/pdf-CHHhr2g_.js.map +0 -1
- package/dist/frontend/dist/assets/pdf.worker.min-CrMmvqMo.mjs +0 -29
- package/dist/frontend/dist/assets/pl-5GP6GKXO-CMMCajpA.js +0 -2
- package/dist/frontend/dist/assets/pl-5GP6GKXO-CMMCajpA.js.map +0 -1
- package/dist/frontend/dist/assets/pt-26Y6JFG5-69xFHtfx.js +0 -2
- package/dist/frontend/dist/assets/pt-26Y6JFG5-69xFHtfx.js.map +0 -1
- package/dist/frontend/dist/assets/ro-C7UXFRWJ-DMzHGaHE.js +0 -2
- package/dist/frontend/dist/assets/ro-C7UXFRWJ-DMzHGaHE.js.map +0 -1
- package/dist/frontend/dist/assets/rolldown-runtime-Bh1tDfsg.js +0 -1
- package/dist/frontend/dist/assets/routing-GE3qy379.js +0 -2
- package/dist/frontend/dist/assets/sv-44DVD76T-BLvpn4fZ.js +0 -2
- package/dist/frontend/dist/assets/sv-44DVD76T-BLvpn4fZ.js.map +0 -1
- package/dist/frontend/dist/assets/th-GIQRTBOY-Bgb4bUeg.js +0 -2
- package/dist/frontend/dist/assets/th-GIQRTBOY-Bgb4bUeg.js.map +0 -1
- package/dist/frontend/dist/assets/tr-WMQWO4D6-DfAWOqqm.js +0 -2
- package/dist/frontend/dist/assets/tr-WMQWO4D6-DfAWOqqm.js.map +0 -1
- package/dist/frontend/dist/assets/uk-I7ML6RGG-Cr0S5UE-.js +0 -2
- package/dist/frontend/dist/assets/uk-I7ML6RGG-Cr0S5UE-.js.map +0 -1
- package/dist/frontend/dist/assets/vi-FGWECASQ-CLx4LvVe.js +0 -2
- package/dist/frontend/dist/assets/vi-FGWECASQ-CLx4LvVe.js.map +0 -1
- package/dist/frontend/dist/assets/web-k3l0Woeo.js +0 -2
- package/dist/frontend/dist/assets/web-k3l0Woeo.js.map +0 -1
- package/dist/frontend/dist/assets/zh-L5FN73XC-BpcLGXRm.js +0 -2
- package/dist/frontend/dist/assets/zh-L5FN73XC-BpcLGXRm.js.map +0 -1
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PdfAnnotationCanvas.client-KWQ7XDWT-_iZ0YQWT.js","assets/rolldown-runtime-QTnfLwEv.js","assets/i18n-C4Z9Yn3V.js","assets/vendor-6KmH4nv9.js","assets/layout-DTmqSMaD.js","assets/KeyboardShortcutsContext-_SYsNsgM.js","assets/routing-DWK3zAt3.js","assets/page-CW-IRz2J.js","assets/page-Bc9V6mf9.js","assets/CookiePreferences-DulRn1Ad.js","assets/XMarkIcon-BUKaQwJf.js","assets/routing-aCi3P9yE.js","assets/page-CwVdaXSz.js","assets/page-CECOHOJV2.js","assets/page-D3S88nw6.js","assets/page-CFCQC-1H.js","assets/page-C-3mAlWS.js","assets/page-DtiXtJ-l.js","assets/layout-Du8P32Vd.js","assets/ToolbarPanels-CJP-kOex.js","assets/ChevronLeftIcon-AP4JA3_n.js","assets/page-BbIr9jHP.js","assets/page-DA_80CZf.js","assets/page-RGbKfKB9.js","assets/page-B5mEdf46.js","assets/layout-vhDZbfjy.js","assets/ArrowsRightLeftIcon-BAptRmrb.js","assets/CommandLineIcon-DkeF_y-i.js","assets/page-BJR7WHXg.js","assets/client-DwyJWkCL.js","assets/client-C7bo_8D-.js","assets/client-BrDEpGKw.js","assets/page-ChXxpqyF.js","assets/layout-bfsd3hAb.js","assets/page-B2mIxjOM.js","assets/page-Baj4wmy7.js","assets/page-DrjzWWIE.js","assets/page-lMAxop92.js","assets/client-szDQ4r9k.js","assets/not-found-Bvki2-z5.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{n as e,r as t,t as n}from"./rolldown-runtime-QTnfLwEv.js";import{i as r,n as i,r as a,t as o}from"./i18n-C4Z9Yn3V.js";import{n as s,r as c,t as l}from"./vendor-6KmH4nv9.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=t(r(),1),d=t(s()),f=`modulepreload`,p=function(e){return`/`+e},m={},h=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,new URL(`../../../src/node/plugins/importAnalysisBuild.ts`,import.meta.url)).href}r=o(t.map(t=>{if(t=p(t,n),t=s(t),t in m)return;m[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:f,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},g=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,_=/^[\\/]{2}/;function v(e,t){return t+e.replace(/\\/g,`/`)}var y=`popstate`;function b(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function x(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return E(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:D(t)}return k(t,n,null,e)}function S(e,t){if(e===!1||e==null)throw Error(t)}function C(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function w(){return Math.random().toString(36).substring(2,10)}function T(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function E(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?O(t):t,state:n,key:t&&t.key||r||w(),mask:i}}function D({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function O(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function k(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=b(e)?e:E(h.location,e,t);n&&n(r,e),l=u()+1;let d=T(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=b(e)?e:E(h.location,e,t);n&&n(r,e),l=u();let i=T(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return A(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(y,d),c=e,()=>{i.removeEventListener(y,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function A(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),S(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:D(t);return i=i.replace(/ $/,`%20`),!n&&_.test(i)&&(i=r+i),new URL(i,r)}function j(e,t,n=`/`){return ee(e,t,n,!1)}function ee(e,t,n,r,i){let a=_e((typeof t==`string`?O(t):t).pathname||`/`,n);if(a==null)return null;let o=i??N(e),s=null,c=ge(a);for(let e=0;s==null&&e<o.length;++e)s=fe(o[e],c,r);return s}function M(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function N(e){let t=te(e);return re(t),t}function te(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;S(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=Te([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(S(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),te(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:ue(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=he(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of ne(e.path))a(e,t,!0,n)}),t}function ne(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=ne(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function re(e){e.sort((e,t)=>e.score===t.score?de(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var ie=/^:[\w-]+$/,ae=3,oe=2,se=1,ce=10,P=-2,le=e=>e===`*`;function ue(e,t){let n=e.split(`/`),r=n.length;return n.some(le)&&(r+=P),t&&(r+=oe),n.filter(e=>!le(e)).reduce((e,t)=>e+(ie.test(t)?ae:t===``?se:ce),r)}function de(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function fe(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?me(u,l,s.matcher,s.compiledParams):pe(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=pe({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:Te([a,d.pathname]),pathnameBase:De(Te([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=Te([a,d.pathnameBase]))}return o}function pe(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=he(e.path,e.caseSensitive,e.end);return me(e,t,n,r)}function me(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function he(e,t=!1,n=!0){C(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function ge(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return C(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function _e(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function ve(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?O(e):e,a;return n?(n=we(n),a=n.startsWith(`/`)?ye(n.substring(1),`/`):ye(n,t)):a=t,{pathname:a,search:Oe(r),hash:ke(i)}}function ye(e,t){let n=Ee(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function be(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function xe(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Se(e){let t=xe(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function Ce(e,t,n,r=!1){let i;typeof e==`string`?i=O(e):(i={...e},S(!i.pathname||!i.pathname.includes(`?`),be(`?`,`pathname`,`search`,i)),S(!i.pathname||!i.pathname.includes(`#`),be(`#`,`pathname`,`hash`,i)),S(!i.search||!i.search.includes(`#`),be(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=ve(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var we=e=>e.replace(/[\\/]{2,}/g,`/`),Te=e=>we(e.join(`/`)),Ee=e=>e.replace(/\/+$/,``),De=e=>Ee(e).replace(/^\/*/,`/`),Oe=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,ke=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Ae=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function je(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Me(e){return Te(e.map(e=>e.route.path).filter(Boolean))||`/`}var Ne=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Pe(e,t){let n=e;if(typeof n!=`string`||!g.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Ne)try{let e=new URL(window.location.href),r=_.test(n)?new URL(v(n,e.protocol)):new URL(n),a=_e(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{C(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Fe=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(Fe);var Ie=[`GET`,...Fe];new Set(Ie);var Le=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Re(e){try{return Le.includes(new URL(e).protocol)}catch{return!1}}var ze=u.createContext(null);ze.displayName=`DataRouter`;var Be=u.createContext(null);Be.displayName=`DataRouterState`;var Ve=u.createContext(!1);function He(){return u.useContext(Ve)}var Ue=u.createContext({isTransitioning:!1});Ue.displayName=`ViewTransition`;var We=u.createContext(new Map);We.displayName=`Fetchers`;var Ge=u.createContext(null);Ge.displayName=`Await`;var Ke=u.createContext(null);Ke.displayName=`Navigation`;var qe=u.createContext(null);qe.displayName=`Location`;var Je=u.createContext({outlet:null,matches:[],isDataRoute:!1});Je.displayName=`Route`;var Ye=u.createContext(null);Ye.displayName=`RouteError`;var Xe=`REACT_ROUTER_ERROR`,Ze=`REDIRECT`,Qe=`ROUTE_ERROR_RESPONSE`;function $e(e){if(e.startsWith(`${Xe}:${Ze}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function et(e){if(e.startsWith(`${Xe}:${Qe}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new Ae(t.status,t.statusText,t.data)}catch{}}function tt(e,{relative:t}={}){S(nt(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=u.useContext(Ke),{hash:i,pathname:a,search:o}=dt(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:Te([n,a])),r.createHref({pathname:s,search:o,hash:i})}function nt(){return u.useContext(qe)!=null}function rt(){return S(nt(),`useLocation() may be used only in the context of a <Router> component.`),u.useContext(qe).location}var it=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function at(e){u.useContext(Ke).static||u.useLayoutEffect(e)}function ot(){let{isDataRoute:e}=u.useContext(Je);return e?At():st()}function st(){S(nt(),`useNavigate() may be used only in the context of a <Router> component.`);let e=u.useContext(ze),{basename:t,navigator:n}=u.useContext(Ke),{matches:r}=u.useContext(Je),{pathname:i}=rt(),a=JSON.stringify(Se(r)),o=u.useRef(!1);return at(()=>{o.current=!0}),u.useCallback((r,s={})=>{if(C(o.current,it),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=Ce(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:Te([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var ct=u.createContext(null);function lt(e){let t=u.useContext(Je).outlet;return u.useMemo(()=>t&&u.createElement(ct.Provider,{value:e},t),[t,e])}function ut(){let{matches:e}=u.useContext(Je);return e[e.length-1]?.params??{}}function dt(e,{relative:t}={}){let{matches:n}=u.useContext(Je),{pathname:r}=rt(),i=JSON.stringify(Se(n));return u.useMemo(()=>Ce(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function ft(e,t){return pt(e,t)}function pt(e,t,n){S(nt(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=u.useContext(Ke),{matches:i}=u.useContext(Je),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;Mt(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
3
|
+
|
|
4
|
+
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let d=rt(),f;if(t){let e=typeof t==`string`?O(t):t;S(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),f=e}else f=d;let p=f.pathname||`/`,m=p;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);m=`/`+p.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let h=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):j(e,{pathname:m});C(l||h!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),C(h==null||h[h.length-1].route.element!==void 0||h[h.length-1].route.Component!==void 0||h[h.length-1].route.lazy!==void 0,`Matched leaf route at location "${f.pathname}${f.search}${f.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let g=bt(h&&h.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:Te([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:Te([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&g?u.createElement(qe.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...f},navigationType:`POP`}},g):g}function mt(){let e=kt(),t=je(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=u.createElement(u.Fragment,null,u.createElement(`p`,null,`💿 Hey developer 👋`),u.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,u.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,u.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),u.createElement(u.Fragment,null,u.createElement(`h2`,null,`Unexpected Application Error!`),u.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?u.createElement(`pre`,{style:i},n):null,o)}var ht=u.createElement(mt,null),gt=class extends u.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=et(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:u.createElement(Je.Provider,{value:this.props.routeContext},u.createElement(Ye.Provider,{value:e,children:this.props.component}));return this.context?u.createElement(vt,{error:e},t):t}};gt.contextType=Ve;var _t=new WeakMap;function vt({children:e,error:t}){let{basename:n}=u.useContext(Ke);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=$e(t.digest);if(e){let r=_t.get(t);if(r)throw r;let i=Pe(e.location,n),a=i.absoluteURL||i.to;if(Re(a))throw Error(`Invalid redirect location`);if(Ne&&!_t.get(t))if(i.isExternal||e.reloadDocument)window.location.href=a;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw _t.set(t,n),n}return u.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${a}`})}}return e}function yt({routeContext:e,match:t,children:n}){let r=u.useContext(ze);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),u.createElement(Je.Provider,{value:e},n)}function bt(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);S(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:Me(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let d,f=!1,p=null,m=null;r&&(d=a&&n.route.id?a[n.route.id]:void 0,p=n.route.errorElement||ht,o&&(s<0&&c===0?(Mt(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),f=!0,m=null):s===c&&(f=!0,m=n.route.hydrateFallbackElement||null)));let h=t.concat(i.slice(0,c+1)),g=()=>{let t;return t=d?p:f?m:n.route.Component?u.createElement(n.route.Component,null):n.route.element?n.route.element:e,u.createElement(yt,{match:n,routeContext:{outlet:e,matches:h,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?u.createElement(gt,{location:r.location,revalidation:r.revalidation,component:p,error:d,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0},onError:l}):g()},null)}function xt(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function St(e){let t=u.useContext(ze);return S(t,xt(e)),t}function Ct(e){let t=u.useContext(Be);return S(t,xt(e)),t}function wt(e){let t=u.useContext(Je);return S(t,xt(e)),t}function Tt(e){let t=wt(e),n=t.matches[t.matches.length-1];return S(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Et(){return Tt(`useRouteId`)}function Dt(){let e=Ct(`useNavigation`);return u.useMemo(()=>{let{matches:t,historyAction:n,...r}=e.navigation;return r},[e.navigation])}function Ot(){let{matches:e,loaderData:t}=Ct(`useMatches`);return u.useMemo(()=>e.map(e=>M(e,t)),[e,t])}function kt(){let e=u.useContext(Ye),t=Ct(`useRouteError`),n=Tt(`useRouteError`);return e===void 0?t.errors?.[n]:e}function At(){let{router:e}=St(`useNavigate`),t=Tt(`useNavigate`),n=u.useRef(!1);return at(()=>{n.current=!0}),u.useCallback(async(r,i={})=>{C(n.current,it),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var jt={};function Mt(e,t,n){!t&&!jt[e]&&(jt[e]=!0,C(!1,n))}u.memo(Nt);function Nt({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return pt(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function Pt({to:e,replace:t,state:n,relative:r}){S(nt(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i}=u.useContext(Ke);C(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:a}=u.useContext(Je),{pathname:o}=rt(),s=ot(),c=Ce(e,Se(a),o,r===`path`),l=JSON.stringify(c);return u.useEffect(()=>{s(JSON.parse(l),{replace:t,state:n,relative:r})},[s,l,r,t,n]),null}function Ft(e){return lt(e.context)}function It(e){S(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function Lt({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){S(!nt(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=u.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=O(n));let{pathname:l=`/`,search:d=``,hash:f=``,state:p=null,key:m=`default`,mask:h}=n,g=u.useMemo(()=>{let e=_e(l,s);return e==null?null:{location:{pathname:e,search:d,hash:f,state:p,key:m,mask:h},navigationType:r}},[s,l,d,f,p,m,r,h]);return C(g!=null,`<Router basename="${s}"> is not able to match the URL "${l}${d}${f}" because it does not start with the basename, so the <Router> won't render anything.`),g==null?null:u.createElement(Ke.Provider,{value:c},u.createElement(qe.Provider,{children:t,value:g}))}function Rt({children:e,location:t}){return ft(zt(e),t)}u.Component;function zt(e,t=[]){let n=[];return u.Children.forEach(e,(e,r)=>{if(!u.isValidElement(e))return;let i=[...t,r];if(e.type===u.Fragment){n.push.apply(n,zt(e.props.children,i));return}S(e.type===It,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),S(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=zt(e.props.children,i)),n.push(a)}),n}var Bt=`get`,Vt=`application/x-www-form-urlencoded`;function Ht(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Ut(e){return Ht(e)&&e.tagName.toLowerCase()===`button`}function Wt(e){return Ht(e)&&e.tagName.toLowerCase()===`form`}function Gt(e){return Ht(e)&&e.tagName.toLowerCase()===`input`}function Kt(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function qt(e,t){return e.button===0&&(!t||t===`_self`)&&!Kt(e)}function Jt(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function Yt(e,t){let n=Jt(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var Xt=null;function Zt(){if(Xt===null)try{new FormData(document.createElement(`form`),0),Xt=!1}catch{Xt=!0}return Xt}var Qt=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function $t(e){return e!=null&&!Qt.has(e)?(C(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Vt}"`),null):e}function en(e,t){let n,r,i,a,o;if(Wt(e)){let o=e.getAttribute(`action`);r=o?_e(o,t):null,n=e.getAttribute(`method`)||Bt,i=$t(e.getAttribute(`enctype`))||Vt,a=new FormData(e)}else if(Ut(e)||Gt(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?_e(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||Bt,i=$t(e.getAttribute(`formenctype`))||$t(o.getAttribute(`enctype`))||Vt,a=new FormData(o,e),!Zt()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(Ht(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=Bt,r=null,i=Vt,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var tn={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},nn=/[&><\u2028\u2029]/g;function rn(e){return e.replace(nn,e=>tn[e])}function an(e,t){if(e===!1||e==null)throw Error(t)}function on(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&_e(i.pathname,t)===`/`?i.pathname=`${Ee(t)}/_root.${r}`:i.pathname=`${Ee(i.pathname)}.${r}`,i}async function sn(e,t){if(e.id in t)return t[e.id];try{let n=await h(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function cn(e){return e!=null&&typeof e.page==`string`}function ln(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function un(e,t,n){return hn((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await sn(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(ln).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function dn(e,t,n,r,i,a){let o=(e,t)=>n[t]?e.route.id!==n[t].route.id:!0,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function fn(e,t,{includeHydrateFallback:n}={}){return pn(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function pn(e){return[...new Set(e)]}function mn(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function hn(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!cn(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(mn(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function gn(){let e=u.useContext(ze);return an(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function _n(){let e=u.useContext(Be);return an(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var vn=u.createContext(void 0);vn.displayName=`FrameworkContext`;function yn(){let e=u.useContext(vn);return an(e,`You must render this element inside a <HydratedRouter> element`),e}function bn(e,t){let n=u.useContext(vn),[r,i]=u.useState(!1),[a,o]=u.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:d,onTouchStart:f}=t,p=u.useRef(null);u.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return p.current&&e.observe(p.current),()=>{e.disconnect()}}},[e]),u.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let m=()=>{i(!0)},h=()=>{i(!1),o(!1)};return n?e===`intent`?[a,p,{onFocus:xn(s,m),onBlur:xn(c,h),onMouseEnter:xn(l,m),onMouseLeave:xn(d,h),onTouchStart:xn(f,m)}]:[a,p,{}]:[!1,p,{}]}function xn(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Sn({page:e,...t}){let n=He(),{nonce:r}=yn(),{router:i}=gn(),a=u.useMemo(()=>j(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?u.createElement(wn,{page:e,matches:a,...t}):u.createElement(Tn,{page:e,matches:a,...t})):null}function Cn(e){let{manifest:t,routeModules:n}=yn(),[r,i]=u.useState([]);return u.useEffect(()=>{let r=!1;return un(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function wn({page:e,matches:t,...n}){let r=rt(),{future:i}=yn(),{basename:a}=gn(),o=u.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=on(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return u.createElement(u.Fragment,null,o.map(e=>u.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function Tn({page:e,matches:t,...n}){let r=rt(),{future:i,manifest:a,routeModules:o}=yn(),{basename:s}=gn(),{loaderData:c,matches:l}=_n(),d=u.useMemo(()=>dn(e,t,l,a,r,`data`),[e,t,l,a,r]),f=u.useMemo(()=>dn(e,t,l,a,r,`assets`),[e,t,l,a,r]),p=u.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!d.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let u=on(e,s,i.v8_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&u.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[u.pathname+u.search]},[s,i.v8_trailingSlashAwareDataRequests,c,r,a,d,t,e,o]),m=u.useMemo(()=>fn(f,a),[f,a]),h=Cn(f);return u.createElement(u.Fragment,null,p.map(e=>u.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),m.map(e=>u.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),h.map(({key:e,link:t})=>u.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function En(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}u.Component;var Dn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Dn&&(window.__reactRouterVersion=`7.18.1`)}catch{}function On({basename:e,children:t,useTransitions:n,window:r}){let i=u.useRef();i.current??=x({window:r,v5Compat:!0});let a=i.current,[o,s]=u.useState({action:a.action,location:a.location}),c=u.useCallback(e=>{n===!1?s(e):u.startTransition(()=>s(e))},[n]);return u.useLayoutEffect(()=>a.listen(c),[a,c]),u.createElement(Lt,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}function kn({basename:e,children:t,history:n,useTransitions:r}){let[i,a]=u.useState({action:n.action,location:n.location}),o=u.useCallback(e=>{r===!1?a(e):u.startTransition(()=>a(e))},[r]);return u.useLayoutEffect(()=>n.listen(o),[n,o]),u.createElement(Lt,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,useTransitions:r})}kn.displayName=`unstable_HistoryRouter`;var An=u.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:p,...m},h){let{basename:_,navigator:v,useTransitions:y}=u.useContext(Ke),b=typeof l==`string`&&g.test(l),x=Pe(l,_);l=x.to;let S=tt(l,{relative:r}),C=rt(),w=null;if(o){let e=Ce(o,[],C.mask?C.mask.pathname:`/`,!0);_!==`/`&&(e.pathname=e.pathname===`/`?_:Te([_,e.pathname])),w=v.createHref(e)}let[T,E,D]=bn(n,m),O=Ln(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:d,relative:r,viewTransition:f,defaultShouldRevalidate:p,useTransitions:y});function k(t){e&&e(t),t.defaultPrevented||O(t)}let A=!(x.isExternal||i),j=u.createElement(`a`,{...m,...D,href:(A?w:void 0)||x.absoluteURL||S,onClick:A?k:e,ref:En(h,E),target:c,"data-discover":!b&&t===`render`?`true`:void 0});return T&&!b?u.createElement(u.Fragment,null,j,u.createElement(Sn,{page:S})):j});An.displayName=`Link`;var jn=u.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let d=dt(a,{relative:c.relative}),f=rt(),p=u.useContext(Be),{navigator:m,basename:h}=u.useContext(Ke),g=p!=null&&Jn(d)&&o===!0,_=m.encodeLocation?m.encodeLocation(d).pathname:d.pathname,v=f.pathname,y=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;t||(v=v.toLowerCase(),y=y?y.toLowerCase():null,_=_.toLowerCase()),y&&h&&(y=_e(y,h)||y);let b=_!==`/`&&_.endsWith(`/`)?_.length-1:_.length,x=v===_||!r&&v.startsWith(_)&&v.charAt(b)===`/`,S=y!=null&&(y===_||!r&&y.startsWith(_)&&y.charAt(_.length)===`/`),C={isActive:x,isPending:S,isTransitioning:g},w=x?e:void 0,T;T=typeof n==`function`?n(C):[n,x?`active`:null,S?`pending`:null,g?`transitioning`:null].filter(Boolean).join(` `);let E=typeof i==`function`?i(C):i;return u.createElement(An,{...c,"aria-current":w,className:T,ref:l,style:E,to:a,viewTransition:o},typeof s==`function`?s(C):s)});jn.displayName=`NavLink`;var Mn=u.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=Bt,action:s,onSubmit:c,relative:l,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:p,...m},h)=>{let{useTransitions:_}=u.useContext(Ke),v=Vn(),y=Hn(s,{relative:l}),b=o.toLowerCase()===`get`?`get`:`post`,x=typeof s==`string`&&g.test(s);return u.createElement(`form`,{ref:h,method:b,action:y,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,m=()=>v(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:p});_&&n!==!1?u.startTransition(()=>m()):m()},...m,"data-discover":!x&&e===`render`?`true`:void 0})});Mn.displayName=`Form`;function Nn({getKey:e,storageKey:t,...n}){let r=u.useContext(vn),{basename:i}=u.useContext(Ke),a=rt(),o=Ot();Kn({getKey:e,storageKey:t});let s=u.useMemo(()=>{if(!r||!e)return null;let t=Gn(a,o,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let c=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return n.nonce==null&&r?.nonce&&(n.nonce=r.nonce),u.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${rn(JSON.stringify(t||Un))}, ${rn(JSON.stringify(s))})`}})}Nn.displayName=`ScrollRestoration`;function Pn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Fn(e){let t=u.useContext(ze);return S(t,Pn(e)),t}function In(e){let t=u.useContext(Be);return S(t,Pn(e)),t}function Ln(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let d=ot(),f=rt(),p=dt(e,{relative:o});return u.useCallback(m=>{if(qt(m,t)){m.preventDefault();let t=n===void 0?D(f)===D(p):n,h=()=>d(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?u.startTransition(()=>h()):h()}},[f,d,p,n,r,i,t,e,a,o,s,c,l])}function Rn(e){C(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=u.useRef(Jt(e)),n=u.useRef(!1),r=rt(),i=u.useMemo(()=>Yt(r.search,n.current?null:t.current),[r.search]),a=ot();return[i,u.useCallback((e,t)=>{let r=Jt(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var zn=0,Bn=()=>`__${String(++zn)}__`;function Vn(){let{router:e}=Fn(`useSubmit`),{basename:t}=u.useContext(Ke),n=Et(),r=e.fetch,i=e.navigate;return u.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=en(e,t);a.navigate===!1?await r(a.fetcherKey||Bn(),n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync}):await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function Hn(e,{relative:t}={}){let{basename:n}=u.useContext(Ke),r=u.useContext(Je);S(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...dt(e||`.`,{relative:t})},o=rt();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:Te([n,a.pathname])),D(a)}var Un=`react-router-scroll-positions`,Wn={};function Gn(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:_e(e.pathname,n)||e.pathname},t)),i??=e.key,i}function Kn({getKey:e,storageKey:t}={}){let{router:n}=Fn(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=In(`useScrollRestoration`),{basename:a}=u.useContext(Ke),o=rt(),s=Ot(),c=Dt();u.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),qn(u.useCallback(()=>{if(c.state===`idle`){let t=Gn(o,s,a,e);Wn[t]=window.scrollY}try{sessionStorage.setItem(t||Un,JSON.stringify(Wn))}catch(e){C(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[c.state,e,a,o,s,t])),typeof document<`u`&&(u.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||Un);e&&(Wn=JSON.parse(e))}catch{}},[t]),u.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(Wn,()=>window.scrollY,e?(t,n)=>Gn(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),u.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(o.hash){let e=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{C(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[o,r,i]))}function qn(e,t){let{capture:n}=t||{};u.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function Jn(e,{relative:t}={}){let n=u.useContext(Ue);S(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Fn(`useViewTransitionState`),i=dt(e,{relative:t});if(!n.isTransitioning)return!1;let a=_e(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=_e(n.nextLocation.pathname,r)||n.nextLocation.pathname;return pe(i.pathname,o)!=null||pe(i.pathname,a)!=null}var Yn=[];Yn.forEach,Yn.slice;var Xn=[`__proto__`,`constructor`,`prototype`];function Zn(e){return!(typeof e!=`string`||e.length===0||e.length>128||Xn.indexOf(e)>-1||e.indexOf(`..`)>-1||e.indexOf(`\\`)>-1||/[?#%\s@]/.test(e)||/[\x00-\x1F\x7F]/.test(e))}function Qn(e){return!(!Zn(e)||e.indexOf(`/`)>-1)}function $n(e){return Zn(e)}var er={lng:Qn,ns:$n};function tr(e){return typeof e==`string`?e.replace(/[\r\n\x00-\x1F\x7F]/g,` `):e}function nr(e){if(typeof e!=`string`||e.length===0)return e;try{let t=new URL(e);return t.username||t.password?(t.username=``,t.password=``,t.toString()):e}catch{return e.replace(/(\/\/)[^/@\s]+@/g,`$1`)}}function rr(){return typeof XMLHttpRequest==`function`||typeof XMLHttpRequest==`object`}function ir(e){return!!e&&typeof e.then==`function`}function ar(e){return ir(e)?e:Promise.resolve(e)}var or=/\{\{(.+?)\}\}/g;function sr(e,t){let n=!1,r=e.replace(or,(e,r)=>{let i=r.trim();if(Xn.indexOf(i)>-1)return e;let a=t[i];if(a==null)return e;let o=er[i]||Qn,s=String(a).split(`+`);for(let t of s)if(!o(t))return n=!0,e;return s.join(`+`)});return n?null:r}var cr=typeof globalThis<`u`?globalThis:typeof global<`u`?global:typeof window<`u`?window:void 0,lr;typeof fetch==`function`?lr=fetch:cr&&typeof cr.fetch==`function`&&(lr=cr.fetch);var ur=rr()&&cr?cr.XMLHttpRequest:void 0,dr=typeof ActiveXObject==`function`&&cr?cr.ActiveXObject:void 0,fr=[`__proto__`,`constructor`,`prototype`],pr=(e,t)=>{if(t&&typeof t==`object`){let n=``;for(let e of Object.keys(t))fr.indexOf(e)>-1||(n+=`&`+encodeURIComponent(e)+`=`+encodeURIComponent(t[e]));if(!n)return e;e=e+(e.indexOf(`?`)===-1?`?`:`&`)+n.slice(1)}return e},mr=(e,t,n,r)=>{let i=e=>{if(!e.ok)return n(e.statusText||`Error`,{status:e.status});e.text().then(t=>{n(null,{status:e.status,data:t})}).catch(n)};if(r){let a=r(e,t);if(a instanceof Promise){a.then(i).catch(n);return}}typeof fetch==`function`?fetch(e,t).then(i).catch(n):lr(e,t).then(i).catch(n)},hr=(e,t,n,r)=>{e.queryStringParams&&(t=pr(t,e.queryStringParams));let i={...typeof e.customHeaders==`function`?e.customHeaders():e.customHeaders};typeof window>`u`&&typeof global<`u`&&global.process!==void 0&&global.process.versions&&global.process.versions.node&&(i[`User-Agent`]=`i18next-http-backend (node/${global.process.version}; ${global.process.platform} ${global.process.arch})`),n&&(i[`Content-Type`]=`application/json`);let a=typeof e.requestOptions==`function`?e.requestOptions(n):e.requestOptions,o={method:n?`POST`:`GET`,body:n?e.stringify(n):void 0,headers:i,...e._omitFetchOptions?{}:a},s=typeof e.alternateFetch==`function`&&e.alternateFetch.length>=1?e.alternateFetch:void 0;try{mr(t,o,r,s)}catch(n){if(!a||Object.keys(a).length===0||!n.message||n.message.indexOf(`not implemented`)<0)return r(n);try{Object.keys(a).forEach(e=>{delete o[e]}),mr(t,o,r,s),e._omitFetchOptions=!0}catch(e){r(e)}}},gr=(e,t,n,r)=>{n&&typeof n==`object`&&(n=pr(``,n).slice(1)),e.queryStringParams&&(t=pr(t,e.queryStringParams));try{let i=ur?new ur:new dr(`MSXML2.XMLHTTP.3.0`);i.open(n?`POST`:`GET`,t,1),e.crossDomain||i.setRequestHeader(`X-Requested-With`,`XMLHttpRequest`),i.withCredentials=!!e.withCredentials,n&&i.setRequestHeader(`Content-Type`,`application/x-www-form-urlencoded`),i.overrideMimeType&&i.overrideMimeType(`application/json`);let a=e.customHeaders;if(a=typeof a==`function`?a():a,a)for(let e of Object.keys(a))fr.indexOf(e)>-1||i.setRequestHeader(e,a[e]);i.onreadystatechange=()=>{i.readyState>3&&r(i.status>=400?i.statusText:null,{status:i.status,data:i.responseText})},i.send(n)}catch(e){console&&console.log(e)}},_r=(e,t,n,r)=>{if(typeof n==`function`&&(r=n,n=void 0),r||=(()=>{}),lr&&t.indexOf(`file:`)!==0)return hr(e,t,n,r);if(rr()||typeof ActiveXObject==`function`)return gr(e,t,n,r);r(Error(`No fetch and no xhr implementation found!`))},vr=()=>({loadPath:`/locales/{{lng}}/{{ns}}.json`,addPath:`/locales/add/{{lng}}/{{ns}}`,parse:e=>JSON.parse(e),stringify:JSON.stringify,parsePayload:(e,t,n)=>({[t]:n||``}),parseLoadPayload:(e,t)=>void 0,request:_r,reloadInterval:typeof window<`u`?!1:3600*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:`cors`,credentials:`same-origin`,cache:`default`}}),yr=class{constructor(e,t={},n={}){this.services=e,this.options=t,this.allOptions=n,this.type=`backend`,this.init(e,t,n)}init(e,t={},n={}){if(this.services=e,this.options={...vr(),...this.options||{},...t},this.allOptions=n,this.services&&this.options.reloadInterval){let e=setInterval(()=>this.reload(),this.options.reloadInterval);typeof e==`object`&&typeof e.unref==`function`&&e.unref()}}readMulti(e,t,n){this._readAny(e,e,t,t,n)}read(e,t,n){this._readAny([e],e,[t],t,n)}_readAny(e,t,n,r,i){let a=this.options.loadPath;typeof this.options.loadPath==`function`&&(a=this.options.loadPath(e,n)),a=ar(a),a.then(a=>{if(!a)return i(null,{});let o=sr(a,{lng:e.join(`+`),ns:n.join(`+`)});if(o==null){let t=e.map(tr).join(`, `),r=n.map(tr).join(`, `);return i(Error(`i18next-http-backend: unsafe lng/ns value — refusing to build request URL for languages=[`+t+`] namespaces=[`+r+`]`),!1)}this.loadUrl(o,i,t,r)})}loadUrl(e,t,n,r){let i=typeof n==`string`?[n]:n,a=typeof r==`string`?[r]:r,o=this.options.parseLoadPayload(i,a),s=tr(nr(e));this.options.request(this.options,e,o,(e,i)=>{if(i&&(i.status>=500&&i.status<600||!i.status))return t(`failed loading `+s+`; status code: `+i.status,!0);if(i&&i.status>=400&&i.status<500)return t(`failed loading `+s+`; status code: `+i.status,!1);if(!i&&e&&e.message){let n=e.message.toLowerCase();if([`failed`,`fetch`,`network`,`load`].find(e=>n.indexOf(e)>-1))return t(`failed loading `+s+`: `+tr(e.message),!0)}if(e)return t(e,!1);let a,o;try{a=typeof i.data==`string`?this.options.parse(i.data,n,r):i.data}catch{o=`failed parsing `+s+` to json`}if(o)return t(o,!1);t(null,a)})}create(e,t,n,r,i){if(!this.options.addPath)return;typeof e==`string`&&(e=[e]);let a=this.options.parsePayload(t,n,r),o=0,s=[],c=[];e.forEach(n=>{let r=this.options.addPath;typeof this.options.addPath==`function`&&(r=this.options.addPath(n,t));let l=sr(r,{lng:n,ns:t});if(l==null){o+=1,i&&o===e.length&&i(s,c);return}this.options.request(this.options,l,a,(t,n)=>{o+=1,s.push(t),c.push(n),o===e.length&&typeof i==`function`&&i(s,c)})})}reload(){let{backendConnector:e,languageUtils:t,logger:n}=this.services,r=e.language;if(r&&r.toLowerCase()===`cimode`)return;let i=[],a=e=>{t.toResolveHierarchy(e).forEach(e=>{i.indexOf(e)<0&&i.push(e)})};a(r),this.allOptions.preload&&this.allOptions.preload.forEach(e=>a(e)),i.forEach(t=>{this.allOptions.ns.forEach(r=>{e.read(t,r,`read`,null,null,(i,a)=>{i&&n.warn(`loading namespace ${r} for language ${t} failed`,i),!i&&a&&n.log(`loaded namespace ${r} for language ${t}`,a),e.loaded(`${t}|${r}`,i,a)})})})}};yr.type=`backend`;var br=`ar.bn.cs.da.de.el.en.es.fa.fi.fr.he.hi.id.it.ja.ko.ms.nl.no.pl.pt.ro.sv.th.tr.uk.vi.zh`.split(`.`);function xr(e){return br.includes(e)}o.use(yr).use(a).init({ns:[`translation`],defaultNS:`translation`,fallbackLng:`en`,supportedLngs:[...br],backend:{loadPath:`/messages/{{lng}}.json`},interpolation:{escapeValue:!1},initAsync:!1});var F=l(),Sr;function Cr(e){Sr=e}var wr;async function Tr(){return wr||=h(()=>import(`./pdf-KENrED1p.js`).then(e=>(Sr&&(e.GlobalWorkerOptions.workerSrc=Sr),e)),[]),wr}async function Er(e){return(await Tr()).getDocument({url:e}).promise}async function Dr(e,t=1){let n=e.getViewport({scale:t}),r=document.createElement(`canvas`);return r.width=n.width,r.height=n.height,await e.render({canvas:r,viewport:n}).promise,{dataUrl:r.toDataURL(`image/png`),width:n.width,height:n.height}}var Or={annotations:`Annotations`,history:`History`,resourceInfo:`Resource Info`,collaboration:`Collaboration`,userAccount:`User Account`,settings:`Settings`,knowledgeBase:`Knowledge Base`},kr={title:`Resource Info`,locale:`Locale`,notSpecified:`Not specified`,entityTypeTags:`Entity Type Tags`,representation:`Representation`,mediaType:`Media Type`,byteSize:`Size`,storageUri:`Storage`,clone:`Clone`,cloneDescription:`Generate a shareable clone link for this resource`,generate:`Generate`,generateDescription:`Generate a new resource from this one's context`,archive:`Archive`,archiveDescription:`Move this resource to archived status`,unarchive:`Unarchive`,unarchiveDescription:`Restore this resource to active status`,provenance:`Provenance`,createdAt:`Created`,modifiedAt:`Modified`,attributedTo:`Attributed to`,derivedFrom:`Derived from`},Ar={title:`Collaboration`,connectionStatus:`Connection Status`,live:`Live`,disconnected:`Disconnected`,events:`{{count}} events`,lastSync:`Last sync:`,noActivity:`No activity yet`,justNow:`Just now`,secondsAgo:`{{count}} seconds ago`,minuteAgo:`1 minute ago`,minutesAgo:`{{count}} minutes ago`,hourAgo:`1 hour ago`,hoursAgo:`{{count}} hours ago`,realtimeActive:`Real-time updates are active`,reconnecting:`Reconnecting to server...`,sharing:`Sharing`,collaborationComingSoon:`Collaboration features coming soon`},jr={history:`History`,loading:`Loading...`,user:`User`,viewOriginal:`View original`,viewAnnotation:`View annotation: {{content}}`,resourceCreated:`Created Resource`,resourceCloned:`Cloned`,resourceArchived:`Archived`,resourceUnarchived:`Unarchived`,highlightAdded:`Highlight Added`,highlightRemoved:`Highlight Removed`,referenceCreated:`Reference Created`,referenceResolved:`Reference Resolved`,referenceDeleted:`Reference Deleted`,entitytagAdded:`Tag Added`,entitytagRemoved:`Tag Removed`,assessmentAdded:`Assessment Added`,assessmentRemoved:`Assessment Removed`,annotationAdded:`Annotation Added`,annotationRemoved:`Annotation Removed`,annotationBodyUpdated:`Annotation Updated`,jobEvent:`Job Event`,embeddingComputed:`Embedding Computed`,justNow:`just now`,minutesAgo:`{{count}}m ago`,hoursAgo:`{{count}}h ago`,daysAgo:`{{count}}d ago`},Mr={title:`Comments`,noComments:`No comments yet. Select text and click Comment to add one.`,commentPlaceholder:`Type your comment here...`,save:`Save`,cancel:`Cancel`,edit:`Edit`,annotateComments:`Annotate Comments`,instructions:`Instructions`,optional:`(optional)`,instructionsPlaceholder:`e.g., Focus on technical terminology...`,annotate:`Annotate`,annotating:`Annotating...`,toneLabel:`Tone`,toneOptional:`(optional)`,toneScholarly:`Scholarly`,toneExplanatory:`Explanatory`,toneConversational:`Conversational`,toneTechnical:`Technical`,densityLabel:`Density`,densitySparse:`Sparse`,densityDense:`Dense`,fragmentSelected:`Fragment selected`,imageRegionSelected:`Image region selected`,closeProgress:`Close`},Nr={title:`Highlights`,noHighlights:`No highlights yet. Use AI annotation to find important passages.`,annotateHighlights:`Annotate Highlights`,instructions:`Instructions`,optional:`(optional)`,instructionsPlaceholder:`e.g., Focus on key technical concepts...`,annotate:`Annotate`,annotating:`Annotating...`,cancel:`Cancel`,densityLabel:`Density`,densitySparse:`Sparse`,densityDense:`Dense`,closeProgress:`Close`},Pr={title:`Assessments`,noAssessments:`No assessments yet. Use AI annotation to evaluate passages.`,assessmentPlaceholder:`Type your assessment here...`,save:`Save`,cancel:`Cancel`,annotateAssessments:`Annotate Assessments`,instructions:`Instructions`,optional:`(optional)`,instructionsPlaceholder:`e.g., Evaluate claims for accuracy and evidence...`,annotate:`Annotate`,annotating:`Annotating...`,toneLabel:`Tone`,toneOptional:`(optional)`,toneAnalytical:`Analytical`,toneCritical:`Critical`,toneBalanced:`Balanced`,toneConstructive:`Constructive`,densityLabel:`Density`,densitySparse:`Sparse`,densityDense:`Dense`,fragmentSelected:`Fragment selected`,imageRegionSelected:`Image region selected`,closeProgress:`Close`},Fr={title:`Tags`,noTags:`No tags yet. Use AI annotation to identify structural roles.`,noSchemas:"No tag schemas registered for this knowledge base. A KB administrator must register at least one structural-analysis schema (e.g. via the `register-tag-schemas` skill) before tagging can be used.",annotateTags:`Annotate Tags`,selectSchema:`Select Framework`,selectCategories:`Select Categories`,annotate:`Annotate`,annotating:`Annotating...`,cancel:`Cancel`,selectAll:`Select All`,deselectAll:`Deselect All`,categoriesSelected:`{count, plural, =0 {No categories selected} =1 {1 category selected} other {# categories selected}}`,createTagForSelection:`Create Tag for Selection`,selectCategory:`Select Category`,chooseCategory:`Choose a category...`,fragmentSelected:`Fragment selected`,imageRegionSelected:`Image region selected`},Ir={title:`Annotations`,statistics:`Statistics`,highlight:`Highlights`,reference:`References`,assessment:`Assessments`,comment:`Comments`,tag:`Tags`},Lr={title:`Statistics`,highlights:`Highlights`,comments:`Comments`,assessments:`Assessments`,tags:`Tags`,references:`References`,stub:`Stub`,resolved:`Resolved`,entityTypes:`Entity Types`},Rr={title:`References`,noReferences:`No references yet. Select text to create references to other resources.`,outgoingReferences:`Outgoing References`,incomingReferences:`Incoming References`,noIncomingReferences:`No incoming references`,stub:`Stub reference (not linked)`,resolved:`Resolved reference (linked)`,open:`Open`,unlink:`Unlink`,resolve:`Resolve Reference`,cancel:`Cancel`,createReference:`Create Reference`,entityTypesOptional:`Entity Types (Optional)`,fragmentSelected:`Fragment selected`,imageRegionSelected:`Image region selected`,annotateReferences:`Annotate References`,selectEntityTypes:`Entity types:`,select:`Select`,deselect:`Deselect`,noEntityTypes:`No entity types available`,typesSelected:`{count, plural, =1 {1 type selected} other {# types selected}}`,annotate:`Annotate`,annotating:`Annotating...`,includeDescriptiveReferences:`Include descriptive references`,descriptiveReferencesTooltip:`Also find phrases like 'the CEO', 'the tech giant', 'the physicist' (in addition to names)`,annotationProgressTitle:`Annotating Entity References`,cancelAnnotation:`Cancel annotation`,found:`{{count}} found`,complete:`Annotation complete!`,failed:`Annotation failed`,current:`Current: {{entityType}}`,closeProgress:`Close`,loading:`loading...`,loadingEllipsis:`Loading...`,untitledResource:`Untitled Resource`,noText:`No text`},zr={title:`Keyboard Shortcuts`,closeDialog:`Close dialog`,or:`or`,navigationTitle:`Navigation`,navOpenSearch:`Open global search`,navOpenSearchAlt:`Open global search (alternative)`,navCreateResource:`Create new resource`,navCloseOverlays:`Close all overlays (double press)`,navShowHelp:`Show keyboard shortcuts help`,sidebarTitle:`Knowledge Sidebar`,sidebarCollapse:`Collapse sidebar`,sidebarExpand:`Expand sidebar`,sidebarPickup:`Pick up resource tab (when focused)`,sidebarMove:`Move resource tab (when dragging)`,sidebarDrop:`Drop resource tab (when dragging)`,sidebarCancel:`Cancel drag operation`,annotationsTitle:`Resource Annotations`,annotHighlight:`Create highlight from annotation (direct)`,annotReference:`Open reference popup for annotation`,annotDelete:`Delete focused annotation`,annotNavigate:`Navigate through annotations`,annotNavigateBack:`Navigate annotations backward`,listsTitle:`Lists & Grids`,listsFilterNav:`Navigate entity type filters`,listsGridNav:`Navigate resource grid`,listsJumpFirst:`Jump to first item`,listsJumpLast:`Jump to last item`,searchModalTitle:`In Search Modal`,searchNav:`Navigate search results`,searchSelect:`Select result`,searchClose:`Close search`,modalTitle:`Modal Controls`,modalClose:`Close active modal`,modalNavForward:`Navigate forward through buttons`,modalNavBackward:`Navigate backward through buttons`,modalActivate:`Activate focused button`,accessibilityTitle:`Accessibility`,a11ySkipLinks:`Navigate to skip links (when at page start)`,a11yFollowLink:`Follow skip link`,macNote:`Using Mac keyboard shortcuts. ⌘ is the Command key.`,windowsNote:`Using Windows/Linux keyboard shortcuts. Ctrl is the Control key.`,footerHint:`Press {{key}} anytime to show this help`,close:`Close`},Br={modeGroup:`Mode`,browse:`Browse`,annotate:`Annotate`,selectionGroup:`Motivation`,clickGroup:`Click`,shapeGroup:`Shape`,none:`None`,linking:`Reference`,highlighting:`Highlight`,assessing:`Assess`,commenting:`Comment`,tagging:`Tag`,detail:`Detail`,follow:`Follow`,deleting:`Delete`,jsonld:`JSON-LD`,rectangle:`Rectangle`,circle:`Circle`,polygon:`Polygon`},Vr={title:`Navigation`,collapseSidebar:`Collapse sidebar`,expandSidebar:`Expand sidebar`,dragToReorder:`Drag to reorder`,dragToReorderDoc:`Drag to reorder {{name}}`,closeResource:`Close resource`,dragInstructions:`To reorder resources: Use Tab to navigate to a resource. Press Alt+Up arrow to move up or Alt+Down arrow to move down. For drag and drop: Press space bar to pick up the item. Use arrow keys to move it. Press space bar again to drop.`},Hr={deleteConfirmationTitle:`Delete Annotation`,deleteConfirmationMessage:`Are you sure you want to delete this annotation? This action cannot be undone.`,deleteConfirmationCancel:`Cancel`,deleteConfirmationDelete:`Delete`},Ur={title:`Settings`,lineNumbers:`Line Numbers`,lineNumbersVisible:`Visible`,lineNumbersHidden:`Hidden`,theme:`Theme`,themeLight:`Light`,themeDark:`Dark`,themeSystem:`System`,themeSystemActive:`System ({{mode}})`,themeModeActive:`Using {{mode}} mode`,language:`Language`,languageHint:`Change language in the main navigation`,languageChanging:`Changing language...`,hoverDelay:`Hover Delay`,hoverDelayFast:`Fast`,hoverDelaySlow:`Slow`,hoverDelayDescription:`{{delay}}ms delay before hover effects appear`},Wr={},Gr={gatherTitle:`Configure Gather`,reviewTitle:`Review Context`,configureTitle:`Configure Generation`,next:`Next`,back:`Back`,cancel:`Cancel`,gatherIntro:`Choose what to include in the gathered context.`,includeContent:`Include resource content`,includeSummary:`Include summary`,gatherDepth:`Depth`,gatherMaxResources:`Max resources`,gatherButton:`Gather`,excludeLabel:`Exclude from recall`,loadingContext:`Gathering context...`,failedContext:`Failed to gather context`,sourceContextLabel:`Resource`,connectionsLabel:`Connections`,citedByLabel:`Cited by`,resourceTitle:`New resource title`,resourceTitlePlaceholder:`Title for the generated resource...`,additionalInstructions:`Additional Instructions`,additionalInstructionsPlaceholder:`Optional guidance for the generation...`,language:`Language`,languageHelp:`Language for the generated resource`,creativity:`Creativity`,creativityFocused:`Focused`,creativityCreative:`Creative`,maxLength:`Max Length`,maxLengthHelp:`Maximum number of tokens`,generate:`Generate`,progressTitle:`Generating Resource`,progressCancel:`Cancel generation`,progressInProgress:`Generating…`,progressComplete:`Generation complete!`,progressFailed:`Generation failed`},Kr={gatherTitle:`Gathered Context`,configureGenerationTitle:`Configure Generation`,configureSearchTitle:`Configure Search`,searchResultsTitle:`Search Results`,sourceContextLabel:`Annotation context in resource`,connectionsLabel:`Peer Annotations`,citedByLabel:`Resource Cited By`,userHintLabel:`Hint`,userHintPlaceholder:`Describe what this annotation refers to...`,loadingContext:`Gathering context...`,failedContext:`Failed to gather context`,cancel:`Cancel`,generate:`Generate`,compose:`Compose`,resolutionStrategyLabel:`Resolution Strategy`,back:`Back`,link:`Link`,score:`Score`,noResults:`No results found`,resourceTitle:`Resource Title`,resourceTitlePlaceholder:`Enter resource title...`,additionalInstructions:`Additional Instructions`,additionalInstructionsPlaceholder:`Enter additional instructions...`,language:`Language`,languageHelp:`Language for generated content`,creativity:`Creativity`,creativityFocused:`Focused`,creativityCreative:`Creative`,maxLength:`Max Length`,maxLengthHelp:`Maximum number of tokens`,maxResults:`Max Results`,semanticScoring:`Semantic Scoring`,semanticScoringHelp:`Use AI to score results by semantic relevance`,searching:`Searching...`,search:`Search`},qr={Toolbar:Or,ResourceInfoPanel:kr,CollaborationPanel:Ar,AnnotationHistory:jr,CommentsPanel:Mr,HighlightPanel:Nr,AssessmentPanel:Pr,TaggingPanel:Fr,UnifiedAnnotationsPanel:Ir,StatisticsPanel:Lr,ReferencesPanel:Rr,KeyboardShortcuts:zr,AnnotateToolbar:Br,CollapsibleResourceNavigation:Vr,ResourceViewer:Hr,Settings:Ur,AnnotateView:Wr,ResourceGenerate:Gr,ReferenceWizard:Kr},Jr=Object.create,Yr=Object.defineProperty,Xr=Object.getOwnPropertyDescriptor,Zr=Object.getOwnPropertyNames,Qr=Object.getPrototypeOf,$r=Object.prototype.hasOwnProperty,ei=e=>t=>{var n=e[t];if(n)return n();throw Error(`Module not found in bundle: `+t)},I=(e,t)=>function(){try{return t||(0,e[Zr(e)[0]])((t={exports:{}}).exports,t),t.exports}catch(e){throw t=0,e}},ti=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of Zr(t))!$r.call(e,i)&&i!==n&&Yr(e,i,{get:()=>t[i],enumerable:!(r=Xr(t,i))||r.enumerable});return e},ni=(e,t,n)=>(n=e==null?{}:Jr(Qr(e)),ti(t||!e||!e.__esModule?Yr(n,`default`,{value:e,enumerable:!0}):n,e)),ri=function(e,t){return ri=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},ri(e,t)};function ii(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Class extends value `+String(t)+` is not a constructor or null`);ri(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function ai(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function oi(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o=Object.create((typeof Iterator==`function`?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),typeof Symbol==`function`&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(s){if(r)throw TypeError(`Generator is already executing.`);for(;o&&(o=0,s[0]&&(n=0)),n;)try{if(r=1,i&&(a=s[0]&2?i.return:s[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,s[1])).done)return a;switch(i=0,a&&(s=[s[0]&2,a.value]),s[0]){case 0:case 1:a=s;break;case 4:return n.label++,{value:s[1],done:!1};case 5:n.label++,i=s[1],s=[0];continue;case 7:s=n.ops.pop(),n.trys.pop();continue;default:if((a=n.trys,!(a=a.length>0&&a[a.length-1]))&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){n.label=s[1];break}if(s[0]===6&&n.label<a[1]){n.label=a[1],a=s;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(s);break}a[2]&&n.ops.pop(),n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e],i=0}finally{r=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}function si(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)}function ci(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function li(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}function ui(e){return this instanceof ui?(this.v=e,this):new ui(e)}function di(e,t,n){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var r=n.apply(e,t||[]),i,a=[];return i=Object.create((typeof AsyncIterator==`function`?AsyncIterator:Object).prototype),s(`next`),s(`throw`),s(`return`,o),i[Symbol.asyncIterator]=function(){return this},i;function o(e){return function(t){return Promise.resolve(t).then(e,d)}}function s(e,t){r[e]&&(i[e]=function(t){return new Promise(function(n,r){a.push([e,t,n,r])>1||c(e,t)})},t&&(i[e]=t(i[e])))}function c(e,t){try{l(r[e](t))}catch(e){f(a[0][3],e)}}function l(e){e.value instanceof ui?Promise.resolve(e.value.v).then(u,d):f(a[0][2],e)}function u(e){c(`next`,e)}function d(e){c(`throw`,e)}function f(e,t){e(t),a.shift(),a.length&&c(a[0][0],a[0][1])}}function fi(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof si==`function`?si(e):e[Symbol.iterator](),n={},r(`next`),r(`throw`),r(`return`),n[Symbol.asyncIterator]=function(){return this},n);function r(t){n[t]=e[t]&&function(n){return new Promise(function(r,a){n=e[t](n),i(r,a,n.done,n.value)})}}function i(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}}function pi(e){return typeof e==`function`}function mi(e){var t=e(function(e){Error.call(e),e.stack=Error().stack});return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var hi=mi(function(e){return function(t){e(this),this.message=t?t.length+` errors occurred during unsubscription:
|
|
5
|
+
`+t.map(function(e,t){return t+1+`) `+e.toString()}).join(`
|
|
6
|
+
`):``,this.name=`UnsubscriptionError`,this.errors=t}});function gi(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var _i=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var e,t,n,r,i;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var o=si(a),s=o.next();!s.done;s=o.next())s.value.remove(this)}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}else a.remove(this);var c=this.initialTeardown;if(pi(c))try{c()}catch(e){i=e instanceof hi?e.errors:[e]}var l=this._finalizers;if(l){this._finalizers=null;try{for(var u=si(l),d=u.next();!d.done;d=u.next()){var f=d.value;try{bi(f)}catch(e){i??=[],e instanceof hi?i=li(li([],ci(i)),ci(e.errors)):i.push(e)}}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}if(i)throw new hi(i)}},e.prototype.add=function(t){if(t&&t!==this)if(this.closed)bi(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=this._finalizers??[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&gi(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&gi(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e}(),vi=_i.EMPTY;function yi(e){return e instanceof _i||e&&`closed`in e&&pi(e.remove)&&pi(e.add)&&pi(e.unsubscribe)}function bi(e){pi(e)?e():e.unsubscribe()}var xi={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Si={setTimeout:function(e,t){var n=[...arguments].slice(2),r=Si.delegate;return r?.setTimeout?r.setTimeout.apply(r,li([e,t],ci(n))):setTimeout.apply(void 0,li([e,t],ci(n)))},clearTimeout:function(e){return(Si.delegate?.clearTimeout||clearTimeout)(e)},delegate:void 0};function Ci(e){Si.setTimeout(function(){var t=xi.onUnhandledError;if(t)t(e);else throw e})}function wi(){}var Ti=(function(){return Oi(`C`,void 0,void 0)})();function Ei(e){return Oi(`E`,void 0,e)}function Di(e){return Oi(`N`,e,void 0)}function Oi(e,t,n){return{kind:e,value:t,error:n}}var ki=null;function Ai(e){if(xi.useDeprecatedSynchronousErrorHandling){var t=!ki;if(t&&(ki={errorThrown:!1,error:null}),e(),t){var n=ki,r=n.errorThrown,i=n.error;if(ki=null,r)throw i}}else e()}function ji(e){xi.useDeprecatedSynchronousErrorHandling&&ki&&(ki.errorThrown=!0,ki.error=e)}var Mi=function(e){ii(t,e);function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,yi(t)&&t.add(n)):n.destination=Bi,n}return t.create=function(e,t,n){return new Ii(e,t,n)},t.prototype.next=function(e){this.isStopped?zi(Di(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?zi(Ei(e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?zi(Ti,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(_i),Ni=Function.prototype.bind;function Pi(e,t){return Ni.call(e,t)}var Fi=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){Li(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){Li(e)}else Li(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){Li(e)}},e}(),Ii=function(e){ii(t,e);function t(t,n,r){var i=e.call(this)||this,a;if(pi(t)||!t)a={next:t??void 0,error:n??void 0,complete:r??void 0};else{var o;i&&xi.useDeprecatedNextContext?(o=Object.create(t),o.unsubscribe=function(){return i.unsubscribe()},a={next:t.next&&Pi(t.next,o),error:t.error&&Pi(t.error,o),complete:t.complete&&Pi(t.complete,o)}):a=t}return i.destination=new Fi(a),i}return t}(Mi);function Li(e){xi.useDeprecatedSynchronousErrorHandling?ji(e):Ci(e)}function Ri(e){throw e}function zi(e,t){var n=xi.onStoppedNotification;n&&Si.setTimeout(function(){return n(e,t)})}var Bi={closed:!0,next:wi,error:Ri,complete:wi},Vi=(function(){return typeof Symbol==`function`&&Symbol.observable||`@@observable`})();function Hi(e){return e}function Ui(e){return e.length===0?Hi:e.length===1?e[0]:function(t){return e.reduce(function(e,t){return t(e)},t)}}var Wi=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r=this,i=qi(e)?e:new Ii(e,t,n);return Ai(function(){var e=r,t=e.operator,n=e.source;i.add(t?t.call(i,n):n?r._subscribe(i):r._trySubscribe(i))}),i},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return t=Gi(t),new t(function(t,r){var i=new Ii({next:function(t){try{e(t)}catch(e){r(e),i.unsubscribe()}},error:r,complete:t});n.subscribe(i)})},e.prototype._subscribe=function(e){return this.source?.subscribe(e)},e.prototype[Vi]=function(){return this},e.prototype.pipe=function(){return Ui([...arguments])(this)},e.prototype.toPromise=function(e){var t=this;return e=Gi(e),new e(function(e,n){var r;t.subscribe(function(e){return r=e},function(e){return n(e)},function(){return e(r)})})},e.create=function(t){return new e(t)},e}();function Gi(e){return e??xi.Promise??Promise}function Ki(e){return e&&pi(e.next)&&pi(e.error)&&pi(e.complete)}function qi(e){return e&&e instanceof Mi||Ki(e)&&yi(e)}var Ji=mi(function(e){return function(){e(this),this.name=`ObjectUnsubscribedError`,this.message=`object unsubscribed`}}),Yi=function(e){ii(t,e);function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return t.prototype.lift=function(e){var t=new Xi(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new Ji},t.prototype.next=function(e){var t=this;Ai(function(){var n,r;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||=Array.from(t.observers);try{for(var i=si(t.currentObservers),a=i.next();!a.done;a=i.next())a.value.next(e)}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}})},t.prototype.error=function(e){var t=this;Ai(function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var n=t.observers;n.length;)n.shift().error(e)}})},t.prototype.complete=function(){var e=this;Ai(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){return this.observers?.length>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,n=this,r=n.hasError,i=n.isStopped,a=n.observers;return r||i?vi:(this.currentObservers=null,a.push(e),new _i(function(){t.currentObservers=null,gi(a,e)}))},t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t.thrownError,i=t.isStopped;n?e.error(r):i&&e.complete()},t.prototype.asObservable=function(){var e=new Wi;return e.source=this,e},t.create=function(e,t){return new Xi(e,t)},t}(Wi),Xi=function(e){ii(t,e);function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return t.prototype.next=function(e){var t,n;(n=(t=this.destination)?.next)==null||n.call(t,e)},t.prototype.error=function(e){var t,n;(n=(t=this.destination)?.error)==null||n.call(t,e)},t.prototype.complete=function(){var e,t;(t=(e=this.destination)?.complete)==null||t.call(e)},t.prototype._subscribe=function(e){return this.source?.subscribe(e)??vi},t}(Yi),Zi=function(e){ii(t,e);function t(t){var n=e.call(this)||this;return n._value=t,n}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(t){var n=e.prototype._subscribe.call(this,t);return!n.closed&&t.next(this._value),n},t.prototype.getValue=function(){var e=this,t=e.hasError,n=e.thrownError,r=e._value;if(t)throw n;return this._throwIfClosed(),r},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(Yi),Qi=mi(function(e){return function(){e(this),this.name=`EmptyError`,this.message=`no elements in sequence`}});function $i(e,t){var n=typeof t==`object`;return new Promise(function(r,i){var a=!1,o;e.subscribe({next:function(e){o=e,a=!0},error:i,complete:function(){a?r(o):n?r(t.defaultValue):i(new Qi)}})})}function ea(e,t){var n=typeof t==`object`;return new Promise(function(r,i){var a=new Ii({next:function(e){r(e),a.unsubscribe()},error:i,complete:function(){n?r(t.defaultValue):i(new Qi)}});e.subscribe(a)})}var ta=function(e){ii(t,e);function t(t,n){return e.call(this)||this}return t.prototype.schedule=function(e,t){return t===void 0&&(t=0),this},t}(_i),na={setInterval:function(e,t){var n=[...arguments].slice(2),r=na.delegate;return r?.setInterval?r.setInterval.apply(r,li([e,t],ci(n))):setInterval.apply(void 0,li([e,t],ci(n)))},clearInterval:function(e){return(na.delegate?.clearInterval||clearInterval)(e)},delegate:void 0},ra=function(e){ii(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r.pending=!1,r}return t.prototype.schedule=function(e,t){if(t===void 0&&(t=0),this.closed)return this;this.state=e;var n=this.id,r=this.scheduler;return n!=null&&(this.id=this.recycleAsyncId(r,n,t)),this.pending=!0,this.delay=t,this.id=this.id??this.requestAsyncId(r,this.id,t),this},t.prototype.requestAsyncId=function(e,t,n){return n===void 0&&(n=0),na.setInterval(e.flush.bind(e,this),n)},t.prototype.recycleAsyncId=function(e,t,n){if(n===void 0&&(n=0),n!=null&&this.delay===n&&this.pending===!1)return t;t!=null&&na.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return Error(`executing a cancelled action`);this.pending=!1;var n=this._execute(e,t);if(n)return n;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var n=!1,r;try{this.work(e)}catch(e){n=!0,r=e||Error(`Scheduled action threw falsy error`)}if(n)return this.unsubscribe(),r},t.prototype.unsubscribe=function(){if(!this.closed){var t=this,n=t.id,r=t.scheduler,i=r.actions;this.work=this.state=this.scheduler=null,this.pending=!1,gi(i,this),n!=null&&(this.id=this.recycleAsyncId(r,n,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(ta),ia={now:function(){return(ia.delegate||Date).now()},delegate:void 0},aa=function(){function e(t,n){n===void 0&&(n=e.now),this.schedulerActionCtor=t,this.now=n}return e.prototype.schedule=function(e,t,n){return t===void 0&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},e.now=ia.now,e}(),oa=new(function(e){ii(t,e);function t(t,n){n===void 0&&(n=aa.now);var r=e.call(this,t,n)||this;return r.actions=[],r._active=!1,r}return t.prototype.flush=function(e){var t=this.actions;if(this._active){t.push(e);return}var n;this._active=!0;do if(n=e.execute(e.state,e.delay))break;while(e=t.shift());if(this._active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}},t}(aa))(ra);function sa(e){return e instanceof Date&&!isNaN(e)}function ca(e){return pi(e?.lift)}function la(e){return function(t){if(ca(t))return t.lift(function(t){try{return e(t,this)}catch(e){this.error(e)}});throw TypeError(`Unable to lift unknown Observable type`)}}var ua=(function(e){return e&&typeof e.length==`number`&&typeof e!=`function`});function da(e){return pi(e?.then)}function fa(e){return pi(e[Vi])}function pa(e){return Symbol.asyncIterator&&pi(e?.[Symbol.asyncIterator])}function ma(e){return TypeError(`You provided `+(typeof e==`object`&&e?`an invalid object`:`'`+e+`'`)+` where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}function ha(){return typeof Symbol!=`function`||!Symbol.iterator?`@@iterator`:Symbol.iterator}var ga=ha();function _a(e){return pi(e?.[ga])}function va(e){return di(this,arguments,function(){var t,n,r,i;return oi(this,function(a){switch(a.label){case 0:t=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,ui(t.read())];case 3:return n=a.sent(),r=n.value,i=n.done,i?[4,ui(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,ui(r)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function ya(e){return pi(e?.getReader)}function ba(e){if(e instanceof Wi)return e;if(e!=null){if(fa(e))return xa(e);if(ua(e))return Sa(e);if(da(e))return Ca(e);if(pa(e))return Ta(e);if(_a(e))return wa(e);if(ya(e))return Ea(e)}throw ma(e)}function xa(e){return new Wi(function(t){var n=e[Vi]();if(pi(n.subscribe))return n.subscribe(t);throw TypeError(`Provided object does not correctly implement Symbol.observable`)})}function Sa(e){return new Wi(function(t){for(var n=0;n<e.length&&!t.closed;n++)t.next(e[n]);t.complete()})}function Ca(e){return new Wi(function(t){e.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,Ci)})}function wa(e){return new Wi(function(t){var n,r;try{for(var i=si(e),a=i.next();!a.done;a=i.next()){var o=a.value;if(t.next(o),t.closed)return}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}t.complete()})}function Ta(e){return new Wi(function(t){Da(e,t).catch(function(e){return t.error(e)})})}function Ea(e){return Ta(va(e))}function Da(e,t){var n,r,i,a;return ai(this,void 0,void 0,function(){var o,s;return oi(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),n=fi(e),c.label=1;case 1:return[4,n.next()];case 2:if(r=c.sent(),r.done)return[3,4];if(o=r.value,t.next(o),t.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=c.sent(),i={error:s},[3,11];case 6:return c.trys.push([6,,9,10]),r&&!r.done&&(a=n.return)?[4,a.call(n)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function Oa(e,t,n,r,i){return new ka(e,t,n,r,i)}var ka=function(e){ii(t,e);function t(t,n,r,i,a,o){var s=e.call(this,t)||this;return s.onFinalize=a,s.shouldUnsubscribe=o,s._next=n?function(e){try{n(e)}catch(e){t.error(e)}}:e.prototype._next,s._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,s._complete=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,s}return t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((t=this.onFinalize)==null||t.call(this))}},t}(Mi);function Aa(e,t,n,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var a=t.schedule(function(){n(),i?e.add(this.schedule(null,r)):this.unsubscribe()},r);if(e.add(a),!i)return a}var ja=mi(function(e){return function(t){t===void 0&&(t=null),e(this),this.message=`Timeout has occurred`,this.name=`TimeoutError`,this.info=t}});function Ma(e,t){var n=sa(e)?{first:e}:typeof e==`number`?{each:e}:e,r=n.first,i=n.each,a=n.with,o=a===void 0?Na:a,s=n.scheduler,c=s===void 0?t??oa:s,l=n.meta,u=l===void 0?null:l;if(r==null&&i==null)throw TypeError(`No timeout provided.`);return la(function(e,t){var n,a,s=null,l=0,d=function(e){a=Aa(t,c,function(){try{n.unsubscribe(),ba(o({meta:u,lastValue:s,seen:l})).subscribe(t)}catch(e){t.error(e)}},e)};n=e.subscribe(Oa(t,function(e){a?.unsubscribe(),l++,t.next(s=e),i>0&&d(i)},void 0,void 0,function(){a?.closed||a?.unsubscribe(),s=null})),!l&&d(r==null?i:typeof r==`number`?r:+r-c.now())})}function Na(e){throw new ja(e)}function Pa(e){return new Wi(function(t){ba(e()).subscribe(t)})}function Fa(e,t){return la(function(n,r){var i=0;n.subscribe(Oa(r,function(n){r.next(e.call(t,n,i++))}))})}function Ia(e,t,n,r,i,a,o,s){var c=[],l=0,u=0,d=!1,f=function(){d&&!c.length&&!l&&t.complete()},p=function(e){return l<r?m(e):c.push(e)},m=function(e){a&&t.next(e),l++;var s=!1;ba(n(e,u++)).subscribe(Oa(t,function(e){i?.(e),a?p(e):t.next(e)},function(){s=!0},void 0,function(){if(s)try{l--;for(var e=function(){var e=c.shift();o?Aa(t,o,function(){return m(e)}):m(e)};c.length&&l<r;)e();f()}catch(e){t.error(e)}}))};return e.subscribe(Oa(t,p,function(){d=!0,f()})),function(){s?.()}}function La(e,t,n){return n===void 0&&(n=1/0),pi(t)?La(function(n,r){return Fa(function(e,i){return t(n,e,r,i)})(ba(e(n,r)))},n):(typeof t==`number`&&(n=t),la(function(t,r){return Ia(t,r,e,n)}))}function Ra(e){return e===void 0&&(e=1/0),La(Hi,e)}var za=new Wi(function(e){return e.complete()});function Ba(e){return e&&pi(e.schedule)}function Va(e){return e[e.length-1]}function Ha(e){return Ba(Va(e))?e.pop():void 0}function Ua(e,t){return typeof Va(e)==`number`?e.pop():t}function Wa(e,t){return t===void 0&&(t=0),la(function(n,r){n.subscribe(Oa(r,function(n){return Aa(r,e,function(){return r.next(n)},t)},function(){return Aa(r,e,function(){return r.complete()},t)},function(n){return Aa(r,e,function(){return r.error(n)},t)}))})}function Ga(e,t){return t===void 0&&(t=0),la(function(n,r){r.add(e.schedule(function(){return n.subscribe(r)},t))})}function Ka(e,t){return ba(e).pipe(Ga(t),Wa(t))}function qa(e,t){return ba(e).pipe(Ga(t),Wa(t))}function Ja(e,t){return new Wi(function(n){var r=0;return t.schedule(function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())})})}function Ya(e,t){return new Wi(function(n){var r;return Aa(n,t,function(){r=e[ga](),Aa(n,t,function(){var e,t,i;try{e=r.next(),t=e.value,i=e.done}catch(e){n.error(e);return}i?n.complete():n.next(t)},0,!0)}),function(){return pi(r?.return)&&r.return()}})}function Xa(e,t){if(!e)throw Error(`Iterable cannot be null`);return new Wi(function(n){Aa(n,t,function(){var r=e[Symbol.asyncIterator]();Aa(n,t,function(){r.next().then(function(e){e.done?n.complete():n.next(e.value)})},0,!0)})})}function Za(e,t){return Xa(va(e),t)}function Qa(e,t){if(e!=null){if(fa(e))return Ka(e,t);if(ua(e))return Ja(e,t);if(da(e))return qa(e,t);if(pa(e))return Xa(e,t);if(_a(e))return Ya(e,t);if(ya(e))return Za(e,t)}throw ma(e)}function $a(e,t){return t?Qa(e,t):ba(e)}function eo(){var e=[...arguments],t=Ha(e),n=Ua(e,1/0),r=e;return r.length?r.length===1?ba(r[0]):Ra(n)($a(r,t)):za}function to(){var e=[...arguments];return $a(e,Ha(e))}function no(e,t){var n=pi(e)?e:function(){return e},r=function(e){return e.error(n())};return new Wi(t?function(e){return t.schedule(r,0,e)}:r)}function ro(e,t){return t===void 0&&(t=Hi),e??=io,la(function(n,r){var i,a=!0;n.subscribe(Oa(r,function(n){var o=t(n);(a||!e(i,o))&&(a=!1,i=o,r.next(n))}))})}function io(e,t){return e===t}function ao(e,t){return la(function(n,r){var i=0;n.subscribe(Oa(r,function(n){return e.call(t,n,i++)&&r.next(n)}))})}function oo(e){return la(function(t,n){var r=null,i=!1,a;r=t.subscribe(Oa(n,void 0,void 0,function(o){a=ba(e(o,oo(e)(t))),r?(r.unsubscribe(),r=null,a.subscribe(n)):i=!0})),i&&(r.unsubscribe(),r=null,a.subscribe(n))})}function so(e,t){return t===void 0&&(t=oa),la(function(n,r){var i=null,a=null,o=null,s=function(){if(i){i.unsubscribe(),i=null;var e=a;a=null,r.next(e)}};function c(){var n=o+e,a=t.now();if(a<n){i=this.schedule(void 0,n-a),r.add(i);return}s()}n.subscribe(Oa(r,function(n){a=n,o=t.now(),i||(i=t.schedule(c,e),r.add(i))},function(){s(),r.complete()},void 0,function(){a=i=null}))})}function co(e){return la(function(t,n){var r=!1;t.subscribe(Oa(n,function(e){r=!0,n.next(e)},function(){r||n.next(e),n.complete()}))})}function lo(e){e===void 0&&(e={});var t=e.connector,n=t===void 0?function(){return new Yi}:t,r=e.resetOnError,i=r===void 0?!0:r,a=e.resetOnComplete,o=a===void 0?!0:a,s=e.resetOnRefCountZero,c=s===void 0?!0:s;return function(e){var t,r,a,s=0,l=!1,u=!1,d=function(){r?.unsubscribe(),r=void 0},f=function(){d(),t=a=void 0,l=u=!1},p=function(){var e=t;f(),e?.unsubscribe()};return la(function(e,m){s++,!u&&!l&&d();var h=a??=n();m.add(function(){s--,s===0&&!u&&!l&&(r=uo(p,c))}),h.subscribe(m),!t&&s>0&&(t=new Ii({next:function(e){return h.next(e)},error:function(e){u=!0,d(),r=uo(f,i,e),h.error(e)},complete:function(){l=!0,d(),r=uo(f,o),h.complete()}}),ba(e).subscribe(t))})(e)}}function uo(e,t){var n=[...arguments].slice(2);if(t===!0){e();return}if(t!==!1){var r=new Ii({next:function(){r.unsubscribe(),e()}});return ba(t.apply(void 0,li([],ci(n)))).subscribe(r)}}function fo(){return Ra(1)}function po(){var e=[...arguments];return fo()($a(e,Ha(e)))}function mo(){var e=[...arguments],t=Ha(e);return la(function(n,r){(t?po(e,n,t):po(e,n)).subscribe(r)})}function ho(e,t){return la(function(n,r){var i=null,a=0,o=!1,s=function(){return o&&!i&&r.complete()};n.subscribe(Oa(r,function(n){i?.unsubscribe();var o=0,c=a++;ba(e(n,c)).subscribe(i=Oa(r,function(e){return r.next(t?t(n,e,c,o++):e)},function(){i=null,s()}))},function(){o=!0,s()}))})}function go(e){return e<=0?function(){return za}:la(function(t,n){var r=0;t.subscribe(Oa(n,function(t){++r<=e&&(n.next(t),e<=r&&n.complete())}))})}function _o(e){return la(function(t,n){ba(e).subscribe(Oa(n,function(){return n.complete()},wi)),!n.closed&&t.subscribe(n)})}function vo(e){return e}function yo(e){return e}function bo(e){return e}function xo(e){return e}function So(e){return e}function Co(e){return e}function wo(e){return e}function To(e){if(e.includes(`/`))throw TypeError(`Expected ResourceId, got URI: ${e}`);return e}function Eo(e){if(e.includes(`/`))throw TypeError(`Expected AnnotationId, got URI: ${e}`);return e}var Do=[`yield:created`,`yield:cloned`,`yield:updated`,`yield:moved`,`yield:representation-added`,`yield:representation-removed`,`mark:added`,`mark:removed`,`mark:body-updated`,`mark:archived`,`mark:unarchived`,`mark:entity-tag-added`,`mark:entity-tag-removed`,`frame:entity-type-added`,`frame:tag-schema-added`,`job:started`,`job:progress`,`job:completed`,`job:failed`],Oo=[];function ko(e){let t=e.payload;if(e.type===`mark:added`)return t?.annotation?.id||null;if((e.type===`mark:removed`||e.type===`mark:body-updated`)&&t?.annotationId&&e.resourceId)try{let n=e.resourceId;return`${n.substring(0,n.lastIndexOf(`/resources/`))}/annotations/${t.annotationId}`}catch{return null}return null}var Ao={"bind:update-body":{result:`bind:body-updated`,failure:`bind:body-update-failed`},"browse:resource-requested":{result:`browse:resource-result`,failure:`browse:resource-failed`},"browse:resources-requested":{result:`browse:resources-result`,failure:`browse:resources-failed`},"browse:annotation-requested":{result:`browse:annotation-result`,failure:`browse:annotation-failed`},"browse:annotations-requested":{result:`browse:annotations-result`,failure:`browse:annotations-failed`},"browse:annotation-history-requested":{result:`browse:annotation-history-result`,failure:`browse:annotation-history-failed`},"browse:events-requested":{result:`browse:events-result`,failure:`browse:events-failed`},"browse:referenced-by-requested":{result:`browse:referenced-by-result`,failure:`browse:referenced-by-failed`},"browse:entity-types-requested":{result:`browse:entity-types-result`,failure:`browse:entity-types-failed`},"browse:tag-schemas-requested":{result:`browse:tag-schemas-result`,failure:`browse:tag-schemas-failed`},"browse:agents-requested":{result:`browse:agents-result`,failure:`browse:agents-failed`},"browse:directory-requested":{result:`browse:directory-result`,failure:`browse:directory-failed`},"browse:annotation-context-requested":{result:`browse:annotation-context-result`,failure:`browse:annotation-context-failed`},"frame:add-entity-type":{result:`frame:entity-type-add-ok`,failure:`frame:entity-type-add-failed`},"frame:add-tag-schema":{result:`frame:tag-schema-add-ok`,failure:`frame:tag-schema-add-failed`},"gather:requested":{result:`gather:complete`,failure:`gather:failed`,progress:`gather:annotation-progress`},"gather:resource-requested":{result:`gather:resource-complete`,failure:`gather:resource-failed`},"gather:summary-requested":{result:`gather:summary-result`,failure:`gather:summary-failed`},"job:create":{result:`job:created`,failure:`job:create-failed`},"job:status-requested":{result:`job:status-result`,failure:`job:status-failed`},"job:cancel-requested":{result:`job:cancel-ok`,failure:`job:cancel-failed`},"job:claim":{result:`job:claimed`,failure:`job:claim-failed`},"mark:create-request":{result:`mark:create-ok`,failure:`mark:create-failed`},"mark:delete":{result:`mark:delete-ok`,failure:`mark:delete-failed`},"mark:archive":{result:`mark:archive-ok`,failure:`mark:archive-failed`},"mark:unarchive":{result:`mark:unarchive-ok`,failure:`mark:unarchive-failed`},"mark:update-entity-types":{result:`mark:update-entity-types-ok`,failure:`mark:update-entity-types-failed`},"match:search-requested":{result:`match:search-results`,failure:`match:search-failed`},"yield:create":{result:`yield:create-ok`,failure:`yield:create-failed`},"yield:update":{result:`yield:update-ok`,failure:`yield:update-failed`},"yield:clone-create":{result:`yield:clone-created`,failure:`yield:clone-create-failed`},"yield:clone-resource-requested":{result:`yield:clone-resource-result`,failure:`yield:clone-resource-failed`},"yield:clone-token-requested":{result:`yield:clone-token-generated`,failure:`yield:clone-token-failed`}},jo=[`job:report-progress`,`job:complete`,`job:fail`,`frame:entity-type-added`,`frame:tag-schema-added`,`beckon:focus`,`beckon:sparkle`,`bus:resume-gap`],Mo=[...Object.keys(Ao).flatMap(e=>{let t=Ao[e];return`progress`in t?[t.result,t.failure,t.progress]:[t.result,t.failure]}),...jo],No=typeof process<`u`&&!!{}.SEMIONT_BUS_LOG,Po=typeof process<`u`&&!!process.versions?.node;function Fo(){return globalThis.__SEMIONT_BUS_LOG__?!0:No}var Io;function Lo(e){Io=e}function Ro(e,t,n,r){if(!Fo())return;let i=n?.correlationId,a=typeof i==`string`?i.slice(0,8):void 0,o;if(Io)try{o=Io()}catch{}let s=`[bus ${e}] ${t}`+(r?` scope=${r}`:``)+(a?` cid=${a}`:``)+(o?` trace=${o.slice(0,8)}`:``);console.debug(s,n)}function zo(){return Po}var Bo=new Set;function Vo(e,t,n){if(n>0)return;let r=t?.correlationId;typeof r!=`string`||r.length===0||Mo.includes(e)||Bo.has(e)||(Bo.add(e),console.warn(`[bus DROP] ${e} cid=${r.slice(0,8)} emitted with 0 subscribers and not in BRIDGED_CHANNELS \u2014 a correlation reply with no forwarder is dropped, so the awaiting client times out (no error). Bridge it by declaring its operation in BUS_OPERATIONS (packages/core/src/bus-operations.ts) \u2014 or, if it is a non-reply broadcast, add it to BRIDGED_BROADCASTS (packages/core/src/bridged-channels.ts) \u2014 so transports subscribe to it.`))}var Ho=class{subjects;isDestroyed;constructor(){this.subjects=new Map,this.isDestroyed=!1}get(e){if(this.isDestroyed)throw Error(`Cannot access event '${String(e)}' on destroyed bus`);if(!this.subjects.has(e)){let t=new Yi,n=Fo(),r=zo();if(n||r){let i=t,a=t.next.bind(t);t.next=t=>{n&&Ro(`EMIT`,String(e),t),r&&Vo(String(e),t,i.observers.length),a(t)}}this.subjects.set(e,t)}return this.subjects.get(e)}getDomainEvent(e){return this.get(e)}destroy(){if(!this.isDestroyed){for(let e of this.subjects.values())e.complete();this.subjects.clear(),this.isDestroyed=!0}}get destroyed(){return this.isDestroyed}scope(e){return new Uo(this,e)}},Uo=class e{constructor(e,t){this.parent=e,this.scopePrefix=t}parent;scopePrefix;get(e){let t=`${this.scopePrefix}:${e}`,n=this.parent.subjects;return n.has(t)||n.set(t,new Yi),n.get(t)}getDomainEvent(e){return this.get(e)}scope(t){return new e(this.parent,`${this.scopePrefix}:${t}`)}};function Wo(e){if(!e)return null;let t=(Array.isArray(e)?e:[e]).find(e=>e.type===`TextPositionSelector`);return t&&t.type===`TextPositionSelector`?t:null}function Go(e){if(!e)return null;let t=(Array.isArray(e)?e:[e]).find(e=>e.type===`SvgSelector`);return t&&t.type===`SvgSelector`?t:null}function Ko(e){if(!e)return null;let t=(Array.isArray(e)?e:[e]).find(e=>e.type===`FragmentSelector`);return t&&t.type===`FragmentSelector`?t:null}function qo(e){if(Array.isArray(e)){for(let t of e)if(typeof t==`object`&&t&&`type`in t&&`source`in t){let e=t.type,n=t.source;if(e===`SpecificResource`&&typeof n==`string`)return n}return null}if(typeof e==`object`&&e&&`type`in e&&`source`in e){let t=e.type,n=e.source;if(t===`SpecificResource`&&typeof n==`string`)return n}return null}function Jo(e){return qo(e)!==null}function Yo(e){if(typeof e!=`string`)return e.selector}function Xo(e){return e.motivation===`highlighting`}function Zo(e){return e.motivation===`linking`}function Qo(e){return e.motivation===`assessing`}function $o(e){return e.motivation===`commenting`}function es(e){return e.motivation===`tagging`}function ts(e){if(!$o(e))return;let t=Array.isArray(e.body)?e.body[0]:e.body;if(t&&`value`in t)return t.value}function ns(e){return Zo(e)&&Jo(e.body)}function rs(e){if(!e)return``;let t=(Array.isArray(e)?e:[e]).find(e=>e.type===`TextQuoteSelector`);return t?t.exact:``}function is(e){return rs(Yo(e.target))}function as(e){let t=(Array.isArray(e)?e:[e]).find(e=>e.type===`TextQuoteSelector`);return t&&t.type===`TextQuoteSelector`?t:null}function os(e){return`page=${e.page}&viewrect=${e.x},${e.y},${e.width},${e.height}`}function ss(e){let t=e.match(/page=(\d+)/);if(!t)return null;let n=e.match(/viewrect=(-?\d+(?:\.\d+)?),(-?\d+(?:\.\d+)?),(-?\d+(?:\.\d+)?),(-?\d+(?:\.\d+)?)/);return n?{page:parseInt(t[1],10),x:parseFloat(n[1]),y:parseFloat(n[2]),width:parseFloat(n[3]),height:parseFloat(n[4])}:null}function cs(e){let t=e.match(/page=(\d+)/);return t?parseInt(t[1],10):null}function ls(e){if(e)return e[`@id`]||void 0}function us(e){if(e?.representations)return(Array.isArray(e.representations)?e.representations:[e.representations])[0]}function ds(e){return us(e)?.mediaType}function fs(e){return us(e)?.language}var ps=class extends Error{constructor(e,t,n){super(e),this.code=t,this.details=n,this.name=`SemiontError`,Error.captureStackTrace(this,this.constructor)}code;details},ms=class extends ps{constructor(e,t,n){super(e,t,n),this.name=`BusRequestError`}};async function hs(e,t,n,r=3e4){let i=crypto.randomUUID(),a={...n,correlationId:i},{result:o,failure:s}=Ao[t],c=ea(eo(e.stream(o).pipe(ao(e=>e.correlationId===i),Fa(e=>({ok:!0,response:e.response}))),e.stream(s).pipe(ao(e=>e.correlationId===i),Fa(e=>({ok:!1,error:new ms(e.message??`Bus request rejected`,`bus.rejected`,{channel:s,correlationId:i,payload:e})})))).pipe(go(1),Ma(r),oo(e=>e instanceof ja?no(()=>new ms(`Bus request timed out after ${r}ms on ${o}`,`bus.timeout`,{channel:t,resultChannel:o,correlationId:i,timeoutMs:r})):no(()=>e)),co({ok:!1,error:new ms(`Bus closed before a reply on ${o}`,`bus.closed`,{channel:t,resultChannel:o,correlationId:i})})));try{await e.emit(t,a)}catch(e){throw c.catch(()=>{}),e}let l=await c;if(!l.ok)throw l.error;return l.response}var gs=1024;function _s(e,t){let{position:n,quote:r}=t;if(!r||!r.exact)return!n||n.start<0||n.end>e.length||n.start>=n.end?null:{start:n.start,end:n.end,strategy:`position-fallback`,confidence:`low`};let{exact:i,prefix:a,suffix:o}=r;if(n){let t=n.start+i.length;if(n.start>=0&&t<=e.length&&e.substring(n.start,t)===i)return{start:n.start,end:t,strategy:`fast-path`,confidence:`high`}}let s=vs(e,i);if(s.length===1){let e=s[0];return{start:e,end:e+i.length,strategy:`unique-occurrence`,confidence:`high`}}return s.length>1?xs(e,s,i,a,o,n?.start):n&&n.start>=0&&n.end<=e.length&&n.start<n.end?{start:n.start,end:n.end,strategy:`position-fallback`,confidence:`low`}:null}function vs(e,t){let n=[],r=e.indexOf(t);for(;r!==-1;)n.push(r),r=e.indexOf(t,r+1);return n}function ys(e,t,n,r,i){let a=0,o=!0,s=!0;if(r){let n=e.substring(Math.max(0,t-r.length),t);n.endsWith(r)?(a+=10,o=!0):(n.includes(r.trim())&&r.trim().length>0&&(a+=5),o=!1)}if(i){let r=e.substring(t+n.length,Math.min(e.length,t+n.length+i.length));r.startsWith(i)?(a+=10,s=!0):(r.includes(i.trim())&&i.trim().length>0&&(a+=5),s=!1)}return{score:a,full:(r===void 0||o)&&(i===void 0||s)&&(r!==void 0||i!==void 0)}}function bs(e,t){if(t===void 0)return 0;let n=Math.abs(e-t);return n>=1024?0:5*(1-n/gs)}function xs(e,t,n,r,i,a){let o=t[0],s=-1,c=!1,l=!1,u=!1;for(let d of t){let t=ys(e,d,n,r,i),f=bs(d,a),p=t.score+f;p>s&&(s=p,o=d,c=t.full,l=t.score>0,u=f>0)}let d,f;return c?(d=`context-disambiguated`,f=`high`):l&&!u?(d=`context-disambiguated`,f=`medium`):l&&u||u?(d=`position-tiebreaker`,f=`medium`):(d=`position-tiebreaker`,f=`low`),{start:o,end:o+n.length,strategy:d,confidence:f}}var Ss=[{code:`ar`,nativeName:`العربية`,englishName:`Arabic`},{code:`bn`,nativeName:`বাংলা`,englishName:`Bengali`},{code:`cs`,nativeName:`Čeština`,englishName:`Czech`},{code:`da`,nativeName:`Dansk`,englishName:`Danish`},{code:`de`,nativeName:`Deutsch`,englishName:`German`},{code:`el`,nativeName:`Ελληνικά`,englishName:`Greek`},{code:`en`,nativeName:`English`,englishName:`English`},{code:`es`,nativeName:`Español`,englishName:`Spanish`},{code:`fa`,nativeName:`فارسی`,englishName:`Persian`},{code:`fi`,nativeName:`Suomi`,englishName:`Finnish`},{code:`fr`,nativeName:`Français`,englishName:`French`},{code:`he`,nativeName:`עברית`,englishName:`Hebrew`},{code:`hi`,nativeName:`हिन्दी`,englishName:`Hindi`},{code:`id`,nativeName:`Bahasa Indonesia`,englishName:`Indonesian`},{code:`it`,nativeName:`Italiano`,englishName:`Italian`},{code:`ja`,nativeName:`日本語`,englishName:`Japanese`},{code:`ko`,nativeName:`한국어`,englishName:`Korean`},{code:`ms`,nativeName:`Bahasa Melayu`,englishName:`Malay`},{code:`nl`,nativeName:`Nederlands`,englishName:`Dutch`},{code:`no`,nativeName:`Norsk`,englishName:`Norwegian`},{code:`pl`,nativeName:`Polski`,englishName:`Polish`},{code:`pt`,nativeName:`Português`,englishName:`Portuguese`},{code:`ro`,nativeName:`Română`,englishName:`Romanian`},{code:`sv`,nativeName:`Svenska`,englishName:`Swedish`},{code:`th`,nativeName:`ไทย`,englishName:`Thai`},{code:`tr`,nativeName:`Türkçe`,englishName:`Turkish`},{code:`uk`,nativeName:`Українська`,englishName:`Ukrainian`},{code:`vi`,nativeName:`Tiếng Việt`,englishName:`Vietnamese`},{code:`zh`,nativeName:`中文`,englishName:`Chinese`}],Cs=new Map(Ss.map(e=>[e.code.toLowerCase(),e]));function ws(e){if(e)return Cs.get(e.toLowerCase())}function Ts(e){if(!e)return;let t=ws(e);return t?`${t.nativeName} (${e.toLowerCase()})`:e}function Es(e,t){return`<svg xmlns="http://www.w3.org/2000/svg"><rect x="${Math.min(e.x,t.x)}" y="${Math.min(e.y,t.y)}" width="${Math.abs(t.x-e.x)}" height="${Math.abs(t.y-e.y)}"/></svg>`}function Ds(e){if(e.length<3)throw Error(`Polygon requires at least 3 points`);return`<svg xmlns="http://www.w3.org/2000/svg"><polygon points="${e.map(e=>`${e.x},${e.y}`).join(` `)}"/></svg>`}function Os(e,t){if(t<=0)throw Error(`Circle radius must be positive`);return`<svg xmlns="http://www.w3.org/2000/svg"><circle cx="${e.x}" cy="${e.y}" r="${t}"/></svg>`}function ks(e){let t=e.match(/<rect\s+([^>]+)\/>/);if(t&&t[1]){let e=t[1];return{type:`rect`,data:{x:parseFloat(e.match(/x="([^"]+)"/)?.[1]||`0`),y:parseFloat(e.match(/y="([^"]+)"/)?.[1]||`0`),width:parseFloat(e.match(/width="([^"]+)"/)?.[1]||`0`),height:parseFloat(e.match(/height="([^"]+)"/)?.[1]||`0`)}}}let n=e.match(/<polygon\s+points="([^"]+)"/);if(n&&n[1])return{type:`polygon`,data:{points:n[1].split(/\s+/).map(e=>{let[t,n]=e.split(`,`).map(parseFloat);return{x:t,y:n}})}};let r=e.match(/<circle\s+([^>]+)\/>/);if(r&&r[1]){let e=r[1];return{type:`circle`,data:{cx:parseFloat(e.match(/cx="([^"]+)"/)?.[1]||`0`),cy:parseFloat(e.match(/cy="([^"]+)"/)?.[1]||`0`),r:parseFloat(e.match(/r="([^"]+)"/)?.[1]||`0`)}}}return null}function As(e,t,n,r,i){let a=ks(e);if(!a)return e;let o=r/t,s=i/n;switch(a.type){case`rect`:{let{x:e,y:t,width:n,height:r}=a.data;return Es({x:e*o,y:t*s},{x:(e+n)*o,y:(t+r)*s})}case`circle`:{let{cx:e,cy:t,r:n}=a.data;return Os({x:e*o,y:t*s},n*Math.min(o,s))}case`polygon`:return Ds(a.data.points.map(e=>({x:e.x*o,y:e.y*s})))}return e}var js=64,Ms=32;function Ns(e,t,n){let r={};if(t>0){let n=Math.max(0,t-js),i=0;for(;n>0&&i<Ms;){let t=e[n-1];if(!t||/[\s.,;:!?'"()\[\]{}<>\/\\]/.test(t))break;n--,i++}r.prefix=e.substring(n,t)}if(n<e.length){let t=Math.min(e.length,n+js),i=0;for(;t<e.length&&i<Ms;){let n=e[t];if(!n||/[\s.,;:!?'"()\[\]{}<>\/\\]/.test(n))break;t++,i++}r.suffix=e.substring(n,t)}return r}function Ps(e){return(e.match(/charset=([^\s;]+)/i)?.[1]||`utf-8`).toLowerCase()}function Fs(e,t){let n=Ps(t);return new TextDecoder(n).decode(e)}var Is=(e,t)=>({extension:e,label:t,render:`none`,anchoring:`none`,extractText:`none`,authorable:!1,uploadable:!0}),Ls=(e,t)=>({...Is(e,t),extractText:`decode`}),Rs={"text/markdown":{extension:`.md`,label:`Markdown`,render:`text`,anchoring:`text-selector`,extractText:`decode`,authorable:!0,uploadable:!0},"text/plain":{extension:`.txt`,label:`Plain Text`,render:`text`,anchoring:`text-selector`,extractText:`decode`,authorable:!0,uploadable:!0},"text/html":{extension:`.html`,label:`HTML`,render:`text`,anchoring:`text-selector`,extractText:`decode`,authorable:!0,uploadable:!0},"application/json":{extension:`.json`,label:`JSON`,render:`text`,anchoring:`text-selector`,extractText:`decode`,authorable:!1,uploadable:!0},"image/png":{extension:`.png`,label:`PNG image`,render:`image`,anchoring:`spatial`,extractText:`none`,authorable:!1,uploadable:!0},"image/jpeg":{extension:`.jpg`,label:`JPEG image`,render:`image`,anchoring:`spatial`,extractText:`none`,authorable:!1,uploadable:!0},"application/pdf":{extension:`.pdf`,label:`PDF`,render:`pdf`,anchoring:`spatial`,extractText:`pdf-text-layer`,authorable:!1,uploadable:!0},"text/css":Ls(`.css`,`CSS`),"text/csv":Ls(`.csv`,`CSV`),"text/xml":Ls(`.xml`,`XML`),"application/xml":Ls(`.xml`,`XML`),"application/yaml":Ls(`.yaml`,`YAML`),"application/x-yaml":Ls(`.yaml`,`YAML`),"text/javascript":Ls(`.js`,`JavaScript`),"application/javascript":Ls(`.js`,`JavaScript`),"text/x-typescript":Ls(`.ts`,`TypeScript`),"application/typescript":Ls(`.ts`,`TypeScript`),"text/x-python":Ls(`.py`,`Python source`),"text/x-java":Ls(`.java`,`Java source`),"text/x-c":Ls(`.c`,`C source`),"text/x-c++":Ls(`.cpp`,`C++ source`),"text/x-csharp":Ls(`.cs`,`C# source`),"text/x-go":Ls(`.go`,`Go source`),"text/x-rust":Ls(`.rs`,`Rust source`),"text/x-ruby":Ls(`.rb`,`Ruby source`),"text/x-php":Ls(`.php`,`PHP source`),"text/x-swift":Ls(`.swift`,`Swift source`),"text/x-kotlin":Ls(`.kt`,`Kotlin source`),"text/x-shell":Ls(`.sh`,`Shell script`),"application/msword":Is(`.doc`,`Word document (legacy)`),"application/vnd.openxmlformats-officedocument.wordprocessingml.document":Is(`.docx`,`Word document`),"application/vnd.ms-excel":Is(`.xls`,`Excel spreadsheet (legacy)`),"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":Is(`.xlsx`,`Excel spreadsheet`),"application/vnd.ms-powerpoint":Is(`.ppt`,`PowerPoint presentation (legacy)`),"application/vnd.openxmlformats-officedocument.presentationml.presentation":Is(`.pptx`,`PowerPoint presentation`),"application/zip":Is(`.zip`,`ZIP archive`),"application/gzip":Is(`.gz`,`Gzip archive`),"application/x-tar":Is(`.tar`,`TAR archive`),"application/x-7z-compressed":Is(`.7z`,`7z archive`),"application/octet-stream":Is(`.bin`,`Binary`),"application/wasm":Is(`.wasm`,`WebAssembly module`),"image/gif":Is(`.gif`,`GIF image`),"image/webp":Is(`.webp`,`WebP image`),"image/svg+xml":Is(`.svg`,`SVG image`),"image/bmp":Is(`.bmp`,`BMP image`),"image/tiff":Is(`.tiff`,`TIFF image`),"image/x-icon":Is(`.ico`,`Icon`),"video/mp4":Is(`.mp4`,`MP4 video`),"video/mpeg":Is(`.mpeg`,`MPEG video`),"video/webm":Is(`.webm`,`WebM video`),"video/ogg":Is(`.ogv`,`Ogg video`),"video/quicktime":Is(`.mov`,`QuickTime video`),"video/x-msvideo":Is(`.avi`,`AVI video`),"audio/mpeg":Is(`.mp3`,`MP3 audio`),"audio/wav":Is(`.wav`,`WAV audio`),"audio/ogg":Is(`.ogg`,`Ogg audio`),"audio/webm":Is(`.webm`,`WebM audio`),"audio/aac":Is(`.aac`,`AAC audio`),"audio/flac":Is(`.flac`,`FLAC audio`),"font/woff":Is(`.woff`,`WOFF font`),"font/woff2":Is(`.woff2`,`WOFF2 font`),"font/ttf":Is(`.ttf`,`TrueType font`),"font/otf":Is(`.otf`,`OpenType font`)},zs=Rs;function Bs(e){return e.split(`;`)[0].trim().toLowerCase()}function Vs(e){return Object.hasOwn(Rs,e)}function Hs(e){return zs[Bs(e)]}function Us(e){return Hs(e)?.extension??`.dat`}var Ws=(()=>{let e=new Map;for(let t of Object.keys(Rs)){let n=Rs[t].extension;e.has(n)||e.set(n,t)}return e})(),Gs={".markdown":`.md`,".htm":`.html`,".jpeg":`.jpg`,".yml":`.yaml`};function Ks(e){let t=e.trim().toLowerCase(),n=t.startsWith(`.`)?t:`.${t}`;return Ws.get(Gs[n]??n)}function qs(e){let t=Hs(e);return t?t.extractText:Bs(e).startsWith(`text/`)?`decode`:`none`}var Js=Object.keys(Rs),Ys=Js.filter(e=>Rs[e].authorable);Js.filter(e=>Rs[e].extractText!==`none`);function Xs(e,t,n){let r=new Map(e.nodes.map(e=>[e.id,e])),i=[],a=[];for(let n of e.edges)if(n.type===`citation`){if(n.target!==t)continue;let e=r.get(n.source);a.push({resourceId:n.source,resourceName:e?.label??n.source})}else if(n.source===t){let e=r.get(n.target);i.push({resourceId:n.target,resourceName:e?.label??n.target,entityTypes:e?.entityTypes??[],bidirectional:n.bidirectional??!1})}let o=new Set;for(let t of e.nodes)if(t.type===`annotation`&&t.id!==n)for(let e of t.entityTypes??[])o.add(e);return{connections:i,citedBy:a,citedByCount:a.length,siblingEntityTypes:Array.from(o)}}var Zs=class extends Error{name=`KyError`;get isKyError(){return!0}},Qs=class extends Zs{name=`HTTPError`;response;request;options;data;constructor(e,t,n){let r=`${e.status||e.status===0?e.status:``} ${e.statusText??``}`.trim(),i=r?`status code ${r}`:`an unknown error`;super(`Request failed with ${i}: ${t.method} ${t.url}`),this.response=e,this.request=t,this.options=n}},$s=class extends Zs{name=`NetworkError`;request;constructor(e,t){super(`Request failed due to a network error: ${e.method} ${e.url}`,t),this.request=e}},ec=class extends Error{name=`NonError`;value;constructor(e){let t=`Non-error value was thrown`;try{typeof e==`string`?t=e:e&&typeof e==`object`&&`message`in e&&typeof e.message==`string`&&(t=e.message)}catch{}super(t),this.value=e}},tc=class extends Zs{name=`ForceRetryError`;customDelay;code;customRequest;constructor(e){let t=e?.cause?e.cause instanceof Error?e.cause:new ec(e.cause):void 0;super(e?.code?`Forced retry: ${e.code}`:`Forced retry`,t?{cause:t}:void 0),this.customDelay=e?.delay,this.code=e?.code,this.customRequest=e?.request}},nc=class extends Error{name=`SchemaValidationError`;issues;constructor(e){super(`Response schema validation failed`),this.issues=e}},rc=class extends Zs{name=`TimeoutError`;request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.request=e}},ic=(()=>{let e=!1,t=!1,n=typeof globalThis.ReadableStream==`function`,r=typeof globalThis.Request==`function`;if(n&&r)try{t=new globalThis.Request(`https://empty.invalid`,{body:new globalThis.ReadableStream,method:`POST`,get duplex(){return e=!0,`half`}}).headers.has(`Content-Type`)}catch(e){if(e instanceof Error&&e.message===`unsupported BodyInit type`)return!1;throw e}return e&&!t})(),ac=typeof globalThis.AbortController==`function`,oc=typeof globalThis.AbortSignal==`function`&&typeof globalThis.AbortSignal.any==`function`,sc=typeof globalThis.ReadableStream==`function`,cc=typeof globalThis.FormData==`function`,lc=[`get`,`post`,`put`,`patch`,`head`,`delete`],uc={json:`application/json`,text:`text/*`,formData:`multipart/form-data`,arrayBuffer:`*/*`,blob:`*/*`,bytes:`*/*`},dc=2147483647,fc=Symbol(`stop`),pc=class{options;constructor(e){this.options=e}},mc=e=>new pc(e),hc={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,baseUrl:!0,prefix:!0,retry:!0,timeout:!0,totalTimeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},gc={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0},_c=new TextEncoder,vc=e=>{if(!e)return 0;if(e instanceof FormData){let t=0;for(let[n,r]of e)t+=40,t+=_c.encode(`Content-Disposition: form-data; name="${n}"`).byteLength,t+=typeof r==`string`?_c.encode(r).byteLength:r.size;return t}return e instanceof Blob?e.size:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:typeof e==`string`?_c.encode(e).byteLength:e instanceof URLSearchParams?_c.encode(e.toString()).byteLength:0},yc=(e,t,n)=>{let r,i=0;return e.pipeThrough(new TransformStream({transform(e,a){if(a.enqueue(e),r){i+=r.byteLength;let e=t===0?0:i/t;e>=1&&(e=1-2**-52),n?.({percent:e,totalBytes:Math.max(t,i),transferredBytes:i},r)}r=e},flush(){r&&(i+=r.byteLength,n?.({percent:1,totalBytes:Math.max(t,i),transferredBytes:i},r))}}))},bc=(e,t)=>{if(!e.body)return e;let n={status:e.status,statusText:e.statusText,headers:e.headers};if(e.status===204)return new Response(null,n);let r=Math.max(0,Number(e.headers.get(`content-length`))||0);return new Response(yc(e.body,r,t),n)},xc=(e,t,n)=>{if(!e.body)return e;let r=vc(n??e.body);return new Request(e,{duplex:`half`,body:yc(e.body,r,t)})},Sc=e=>typeof e==`object`&&!!e,Cc=Symbol(`replaceOption`),wc=e=>Sc(e)&&e[Cc]===!0?{isReplace:!0,value:e.value}:{isReplace:!1,value:e},Tc=(...e)=>{for(let t of e)if((!Sc(t)||Array.isArray(t))&&t!==void 0)throw TypeError("The `options` argument must be an object");return Fc({},...e)},Ec=(e={},t={})=>{let n=new globalThis.Headers(e),r=t instanceof globalThis.Headers,i=new globalThis.Headers(t);for(let[e,t]of i.entries())r&&t===`undefined`||t===void 0?n.delete(e):n.set(e,t);return n},Dc=e=>{if(!Sc(e)||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},Oc=e=>{if(e instanceof URLSearchParams){let t=new URLSearchParams(e),n=e[Nc];return n&&(t[Nc]=new Set(n)),t}return e instanceof globalThis.Headers?new globalThis.Headers(e):Array.isArray(e)?[...e]:Dc(e)?{...e}:e},kc=e=>Object.fromEntries(Object.entries(e).filter(e=>e[1]!==void 0)),Ac=(e,t)=>Dc(e)&&Dc(t)?kc({...e,...t}):Ec(e,t);function jc(e,t,n){return Object.hasOwn(t,n)&&t[n]===void 0?[]:Fc(e[n]??[],t[n]??[])}var Mc=(e={},t={})=>({init:jc(e,t,`init`),beforeRequest:jc(e,t,`beforeRequest`),beforeRetry:jc(e,t,`beforeRetry`),beforeError:jc(e,t,`beforeError`),afterResponse:jc(e,t,`afterResponse`)}),Nc=Symbol(`deletedParameters`),Pc=(e,t)=>{let n=new URLSearchParams,r=new Set;for(let i of[e,t])if(i!==void 0)if(i instanceof URLSearchParams){for(let[e,t]of i.entries())n.append(e,t),r.delete(e);let e=i[Nc];if(e)for(let t of e)n.delete(t),r.add(t)}else if(Array.isArray(i))for(let e of i){if(!Array.isArray(e)||e.length!==2)throw TypeError(`Array search parameters must be provided in [[key, value], ...] format`);n.append(String(e[0]),String(e[1])),r.delete(String(e[0]))}else if(Sc(i))for(let[e,t]of Object.entries(i))t===void 0?(n.delete(e),r.add(e)):(n.append(e,String(t)),r.delete(e));else{let e=new URLSearchParams(i);for(let[t,i]of e.entries())n.append(t,i),r.delete(t)}return r.size>0&&(n[Nc]=r),n},Fc=(...e)=>{let t={},n={},r={},i,a=[];for(let o of e)if(Array.isArray(o))Array.isArray(t)||(t=[]),t=[...t,...o];else if(Sc(o)){for(let[e,n]of Object.entries(o)){if(e===`signal`&&n instanceof globalThis.AbortSignal){a.push(n);continue}let r=wc(n),{isReplace:o}=r;if(n=r.value,e===`context`){if(n!=null&&(!Sc(n)||Array.isArray(n)))throw TypeError("The `context` option must be an object");t={...t,context:n==null?{}:o?{...n}:{...t.context,...n}};continue}if(e===`searchParams`){i=n==null?void 0:o||i===void 0?n:Pc(i,n);continue}Sc(n)&&!o&&e in t&&(n=Fc(t[e],n)),t={...t,[e]:n}}if(Sc(o.hooks)){let{value:e,isReplace:n}=wc(o.hooks);r=Mc(n?{}:r,e),t.hooks=r}if(Sc(o.headers)){let{value:e,isReplace:r}=wc(o.headers);n=r?Oc(e):Ac(n,e),t.headers=n}}return i!==void 0&&(t.searchParams=i),a.length>0&&(a.length===1?t.signal=a[0]:oc?t.signal=AbortSignal.any(a):t.signal=a.at(-1)),t},Ic=e=>lc.includes(e)?e.toUpperCase():e,Lc={limit:2,methods:[`get`,`put`,`head`,`delete`,`options`,`trace`],statusCodes:[408,413,429,500,502,503,504],afterStatusCodes:[413,429,503],maxRetryAfter:1/0,backoffLimit:1/0,delay:e=>.3*2**(e-1)*1e3,jitter:void 0,retryOnTimeout:!1},Rc=(e={})=>{if(typeof e==`number`)return{...Lc,limit:e};if(e.methods&&!Array.isArray(e.methods))throw Error(`retry.methods must be an array`);if(e.statusCodes&&!Array.isArray(e.statusCodes))throw Error(`retry.statusCodes must be an array`);let t=Object.fromEntries(Object.entries({...e,methods:e.methods?.map(e=>e.toLowerCase())}).filter(([,e])=>e!==void 0));return{...Lc,...t}};async function zc(e,t,n,r){return new Promise((i,a)=>{let o=setTimeout(()=>{n&&n.abort(),a(new rc(e))},r.timeout);r.fetch(e,t).then(i).catch(a).then(()=>{clearTimeout(o)})})}async function Bc(e,{signal:t}){return new Promise((n,r)=>{t&&(t.throwIfAborted(),t.addEventListener(`abort`,i,{once:!0}));function i(){clearTimeout(a),r(t.reason)}let a=setTimeout(()=>{t?.removeEventListener(`abort`,i),n()},e)})}var Vc=e=>{let t={};for(let n in e)Object.hasOwn(e,n)&&!(n in gc)&&!(n in hc)&&(t[n]=e[n]);return t},Hc=e=>e===void 0?!1:Array.isArray(e)?e.length>0:e instanceof URLSearchParams?e.size>0||!!e[Nc]?.size:typeof e==`object`?Object.keys(e).length>0:typeof e==`string`?e.trim().length>0:!!e,Uc=Object.prototype.toString,Wc=e=>Uc.call(e)===`[object Error]`,Gc=new Set([`network error`,`NetworkError when attempting to fetch resource.`,`The Internet connection appears to be offline.`,`Network request failed`,`fetch failed`,`terminated`,` A network error occurred.`,`Network connection lost`]);function Kc(e){if(!(e&&Wc(e)&&e.name===`TypeError`&&typeof e.message==`string`))return!1;let{message:t,stack:n}=e;return t===`Load failed`?n===void 0||`__sentry_captured__`in e:t.startsWith(`error sending request for url`)||t===`Failed to fetch`||t.startsWith(`Failed to fetch (`)&&t.endsWith(`)`)?!0:Gc.has(t)}var qc=(e,t)=>e instanceof t||e?.name===t.name;function Jc(e){return qc(e,Qs)}function Yc(e){return qc(e,$s)}function Xc(e){return qc(e,rc)}var Zc=10*1024*1024,Qc="The `prefixUrl` option has been renamed `prefix` in v2 and enhanced to allow slashes in input. See also the new `baseUrl` option for improved flexibility with standard URL resolution: https://github.com/sindresorhus/ky#baseurl",$c=Symbol(`timedOutResponseData`),el=e=>{let t=/;\s*charset\s*=\s*(?:"([^"]+)"|([^;,\s]+))/i.exec(e),n=t?.[1]??t?.[2];if(n)try{return new TextDecoder(n)}catch{}return new TextDecoder},tl="The `schema` argument must follow the Standard Schema specification",nl=e=>typeof e==`object`?{...e,...e.methods&&{methods:[...e.methods]},...e.statusCodes&&{statusCodes:[...e.statusCodes]},...e.afterStatusCodes&&{afterStatusCodes:[...e.afterStatusCodes]}}:e,rl=Object.prototype.toString,il=e=>e instanceof globalThis.Request||rl.call(e)===`[object Request]`,al=e=>e instanceof globalThis.Response||rl.call(e)===`[object Response]`,ol=e=>Array.isArray(e)?e.map(e=>[...e]):Oc(e);function sl(e){let t={...e,json:Oc(e.json),context:Oc(e.context),headers:Oc(e.headers),searchParams:ol(e.searchParams)};return e.retry!==void 0&&(t.retry=nl(e.retry)),t}var cl=async(e,t)=>{if(typeof t!=`object`&&typeof t!=`function`||t===null)throw TypeError(tl);let n=t[`~standard`];if(typeof n!=`object`||!n||typeof n.validate!=`function`)throw TypeError(tl);let r=await n.validate(e);if(r.issues)throw new nc(r.issues);return r.value},ll=class e{static create(t,n){let r=n.hooks?.init??[],i=r.length>0?sl(n):n;for(let e of r)e(i);let a=new e(t,i),o=async()=>{if(typeof a.#i.timeout==`number`&&a.#i.timeout>2147483647)throw RangeError(`The \`timeout\` option cannot be greater than ${dc}`);if(typeof a.#i.totalTimeout==`number`&&a.#i.totalTimeout>2147483647)throw RangeError(`The \`totalTimeout\` option cannot be greater than ${dc}`);await Promise.resolve();let e=await a.#w(),t=e??await a.#E(async()=>a.#k()),n=e!==void 0||a.#O();for(;;){if(t===void 0)return t;if(al(t))try{t=await a.#T(t)}catch(e){if(!(e instanceof tc))throw e;let r=await a.#D(e,async()=>a.#k());if(r===void 0)return r;t=r,n=a.#O();continue}let e=t;if(!e.ok&&e.type!==`opaque`&&(typeof a.#i.throwHttpErrors==`function`?a.#i.throwHttpErrors(e.status):a.#i.throwHttpErrors)){let r=new Qs(e,a.#P(e),a.#M()),i=r;if(r.data=await a.#h(e),n)throw i;let o=await a.#D(r,async()=>a.#k());if(o===void 0)return o;t=o,n=a.#O();continue}break}if(!al(t))return t;if(a.#m(t),a.#i.onDownloadProgress){if(typeof a.#i.onDownloadProgress!=`function`)throw TypeError("The `onDownloadProgress` option must be a function");if(!sc)throw Error("Streams are not supported in your environment. `ReadableStream` is missing.");let e=t.clone();return a.#x(t),bc(e,a.#i.onDownloadProgress)}return t},s=(async()=>{try{return await o()}catch(e){if(!(e instanceof Error)||a.#s.has(e))throw e;let t=e;for(let e of a.#i.hooks.beforeError){let n=await e({request:a.request,options:a.#M(),error:t,retryCount:a.#n});n instanceof Error&&(t=n)}throw t}finally{let e=a.#a;a.#b(e?.body??void 0),a.request!==e&&a.#b(a.request.body??void 0)}})();for(let[e,t]of Object.entries(uc))e===`bytes`&&typeof globalThis.Response?.prototype?.bytes!=`function`||(s[e]=async n=>{a.request.headers.set(`accept`,a.request.headers.get(`accept`)||t);let r=await s;if(e!==`json`)return r[e]();let o=await r.text();if(o===``)return n===void 0?JSON.parse(o):cl(void 0,n);let c=i.parseJson?await i.parseJson(o,{request:a.#P(r),response:r}):JSON.parse(o);return n===void 0?c:cl(c,n)});return s}static#e(e){return e&&typeof e==`object`&&!Array.isArray(e)&&!(e instanceof URLSearchParams)?Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0)):e}request;#t;#n=0;#r;#i;#a;#o;#s=new WeakSet;#c;#l;#u=!1;#d=new WeakMap;constructor(t,n={}){if(this.#r=t,Object.hasOwn(n,`prefixUrl`))throw Error(Qc);if(this.#i={...n,headers:Ec(this.#r.headers,n.headers),hooks:Mc({},n.hooks),method:Ic(n.method??this.#r.method??`GET`),prefix:String(n.prefix||``),retry:Rc(n.retry),throwHttpErrors:n.throwHttpErrors??!0,timeout:n.timeout??1e4,totalTimeout:n.totalTimeout??!1,fetch:n.fetch??globalThis.fetch.bind(globalThis),context:n.context??{}},typeof this.#r!=`string`&&!(this.#r instanceof URL||this.#r instanceof globalThis.Request))throw TypeError("`input` must be a string, URL, or Request");if(typeof this.#r==`string`){if(this.#i.prefix){let e=this.#i.prefix.replace(/\/+$/,``),t=this.#r.replace(/^\/+/,``);this.#r=`${e}/${t}`}if(this.#i.baseUrl){let e;try{e=new URL(this.#r)}catch{}e||(this.#r=new URL(this.#r,new Request(this.#i.baseUrl).url))}}ac&&oc&&(this.#o=this.#i.signal??this.#r.signal,this.#t=new globalThis.AbortController,this.#i.signal=this.#S()),ic&&(this.#i.duplex=`half`),this.#i.json!==void 0&&(this.#i.body=this.#i.stringifyJson?.(this.#i.json)??JSON.stringify(this.#i.json),this.#i.headers.set(`content-type`,this.#i.headers.get(`content-type`)??`application/json`));let r=n.headers&&new globalThis.Headers(n.headers).has(`content-type`);if(this.#r instanceof globalThis.Request&&(cc&&this.#i.body instanceof globalThis.FormData||this.#i.body instanceof URLSearchParams)&&!r&&this.#i.headers.delete(`content-type`),this.request=new globalThis.Request(this.#r,this.#i),Hc(this.#i.searchParams)){let t=new URL(this.request.url),n=this.#i.searchParams?.[Nc];if(n)for(let e of n)t.searchParams.delete(e);if(typeof this.#i.searchParams==`string`){let e=this.#i.searchParams.replace(/^\?/,``);e!==``&&(t.search=t.search?`${t.search}&${e}`:`?${e}`)}else{let n=new URLSearchParams(e.#e(this.#i.searchParams));for(let[e,r]of n.entries())t.searchParams.append(e,r)}if(this.#i.searchParams&&typeof this.#i.searchParams==`object`&&!Array.isArray(this.#i.searchParams)&&!(this.#i.searchParams instanceof URLSearchParams))for(let[e,n]of Object.entries(this.#i.searchParams))n===void 0&&t.searchParams.delete(e);this.request=new globalThis.Request(t,this.#i)}if(this.#i.onUploadProgress&&typeof this.#i.onUploadProgress!=`function`)throw TypeError("The `onUploadProgress` option must be a function");this.#l=typeof this.#i.totalTimeout==`number`?this.#j():void 0}#f(){let e=this.#i.retry.delay(this.#n+1),t=e;return this.#i.retry.jitter===!0?t=Math.random()*e:typeof this.#i.retry.jitter==`function`&&(t=this.#i.retry.jitter(e),(!Number.isFinite(t)||t<0)&&(t=e)),Math.min(this.#i.retry.backoffLimit,t)}async#p(e){if(this.#n>=this.#i.retry.limit)throw e;let t=e instanceof Error?e:new ec(e);if(t instanceof tc)return t.customDelay??this.#f();if(!this.#i.retry.methods.includes(this.request.method.toLowerCase()))throw e;if(this.#i.retry.shouldRetry!==void 0){let n=await this.#i.retry.shouldRetry({error:t,retryCount:this.#n+1});if(n===!1)throw e;if(n===!0)return this.#f()}if(Xc(e)){if(!this.#i.retry.retryOnTimeout)throw e;return this.#f()}if(Jc(e)){if(!this.#i.retry.statusCodes.includes(e.response.status))throw e;let t=e.response.headers.get(`Retry-After`)??e.response.headers.get(`RateLimit-Reset`)??e.response.headers.get(`X-RateLimit-Retry-After`)??e.response.headers.get(`X-RateLimit-Reset`)??e.response.headers.get(`X-Rate-Limit-Reset`);if(t&&this.#i.retry.afterStatusCodes.includes(e.response.status)){let e=Number(t)*1e3;return Number.isNaN(e)?e=Date.parse(t)-Date.now():e>=Date.parse(`2024-01-01`)&&(e-=Date.now()),Number.isFinite(e)?(e=Math.max(0,e),Math.min(this.#i.retry.maxRetryAfter,e)):Math.min(this.#i.retry.maxRetryAfter,this.#f())}if(e.response.status===413)throw e;return this.#f()}if(!Yc(e))throw e;return this.#f()}#m(e){let t=this.#P(e);return this.#i.parseJson&&(e.json=async()=>{let n=await e.text();return n===``?JSON.parse(n):this.#i.parseJson(n,{request:t,response:e})}),e}async#h(e){let t=await this.#v(e,this.#g());if(t===$c){this.#C();return}if(!t)return;if(!this.#_(e.headers.get(`content-type`)??``))return t;let n=await this.#y(t,e,this.#g(),this.#P(e));if(n===$c){this.#C();return}return n}#g(){let e=this.#i.timeout===!1?1e4:this.#i.timeout,t=this.#A();if(t===void 0)return e;if(t<=0)throw new rc(this.request);return Math.min(e,t)}#_(e){let t=(e.split(`;`,1)[0]??``).trim().toLowerCase();return/\/(?:.*[.+-])?json$/.test(t)}async#v(e,t){let{body:n}=e;if(!n)try{return await e.text()}catch{return}let r;try{r=n.getReader()}catch{return}let i=el(e.headers.get(`content-type`)??``),a=[],o=0,s=(async()=>{try{for(;;){let{done:e,value:t}=await r.read();if(e)break;if(o+=t.byteLength,o>Zc){r.cancel().catch(()=>void 0);return}a.push(i.decode(t,{stream:!0}))}}catch{return}return a.push(i.decode()),a.join(``)})(),c=new Promise(e=>{let n=setTimeout(()=>{e($c)},t);s.finally(()=>{clearTimeout(n)})}),l=await Promise.race([s,c]);return l===$c&&r.cancel().catch(()=>void 0),l}async#y(e,t,n,r){let i;try{return await Promise.race([Promise.resolve().then(()=>this.#i.parseJson?this.#i.parseJson(e,{request:r,response:t}):JSON.parse(e)),new Promise(e=>{i=setTimeout(()=>{e($c)},n)})])}catch{return}finally{clearTimeout(i)}}#b(e){e&&e.cancel().catch(()=>void 0)}#x(e){this.#b(e.body??void 0)}#S(){return this.#o?AbortSignal.any([this.#o,this.#t.signal]):this.#t.signal}#C(){let e=this.#A();if(e!==void 0&&e<=0)throw new rc(this.request)}async#w(){for(let e of this.#i.hooks.beforeRequest){let t=await e({request:this.request,options:this.#M(),retryCount:0});if(il(t))this.#N(t);else if(al(t))return t}}async#T(e){let t=this.#P(e);for(let n of this.#i.hooks.afterResponse){let r=this.#F(e.clone(),t);this.#m(r);let i;try{i=await n({request:this.request,options:this.#M(),response:r,retryCount:this.#n})}catch(t){throw r!==e&&this.#x(r),this.#x(e),t}if(i instanceof pc)throw r!==e&&this.#x(r),this.#x(e),new tc(i.options);let a=al(i)?this.#F(i,t):e;r!==e&&r!==a&&r.body!==a.body&&this.#x(r),e!==a&&e.body!==a.body&&this.#x(e),e=a}return e}async#E(e){try{return await e()}catch(t){return this.#D(t,e)}}async#D(e,t){this.#u=!1;let n=Math.min(await this.#p(e),dc),r={signal:this.#o},i=this.#A();if(i!==void 0){if(i<=0)throw new rc(this.request);if(n>=i)throw await Bc(i,r),new rc(this.request)}if(await Bc(n,r),this.#C(),e instanceof tc&&e.customRequest){let t=new globalThis.Request(e.customRequest,this.#i.signal?{signal:this.#i.signal}:void 0);this.#N(t)}for(let t of this.#i.hooks.beforeRetry){let n;try{n=await t({request:this.request,options:this.#M(),error:e,retryCount:this.#n+1})}catch(t){throw t instanceof Error&&t!==e&&this.#s.add(t),t}if(il(n)){this.#N(n);break}if(al(n))return this.#u=!0,this.#n++,n;if(n===fc)return}return this.#C(),this.#n++,this.#E(t)}#O(){let e=this.#u;return this.#u=!1,e}async#k(){this.#t?.signal.aborted&&(this.#t=new globalThis.AbortController,this.#i.signal=this.#S(),this.request=new globalThis.Request(this.request,{signal:this.#i.signal}));let e=Vc(this.#i),t=this.#i.retry.limit>0?this.request.clone():void 0,n=this.#I(this.request,this.#i.body??void 0);this.#a=n,t&&(this.request=t);try{let t=this.#A();if(t!==void 0&&t<=0)throw new rc(this.request);let r=this.#i.timeout===!1?t:t===void 0?this.#i.timeout:Math.min(this.#i.timeout,t),i=r===void 0?await this.#i.fetch(n,e):await zc(n,e,this.#t,{timeout:r,fetch:this.#i.fetch});return this.#F(i,n)}catch(e){throw Kc(e)?new $s(this.request,{cause:e}):e}}#A(){if(this.#l===void 0)return;let e=this.#j()-this.#l;return Math.max(0,this.#i.totalTimeout-e)}#j(){return globalThis.performance?.now()??Date.now()}#M(){if(!this.#c){let{hooks:e,json:t,parseJson:n,stringifyJson:r,searchParams:i,timeout:a,totalTimeout:o,throwHttpErrors:s,fetch:c,...l}=this.#i;this.#c=Object.freeze(l)}return this.#c}#N(e){this.#c=void 0,this.request=e}#P(e){return this.#d.get(e)??this.request}#F(e,t){return this.#d.set(e,t),e}#I(e,t){return!this.#i.onUploadProgress||!e.body||!ic?e:xc(e,this.#i.onUploadProgress,t??this.#i.body??void 0)}},ul=e=>{let t=(t,n)=>ll.create(t,Tc(e,n));for(let n of lc)t[n]=(t,r)=>ll.create(t,Tc(e,r,{method:n}));return t.create=e=>ul(Tc(e)),t.extend=t=>(typeof t==`function`&&(t=t(e??{})),ul(Tc(e,t))),t.stop=fc,t.retry=mc,t},dl=ul(),fl=`1.9.1`,pl=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function ml(e){let t=new Set([e]),n=new Set,r=e.match(pl);if(!r)return()=>!1;let i={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};if(i.prerelease!=null)return function(t){return t===e};function a(e){return n.add(e),!1}function o(e){return t.add(e),!0}return function(e){if(t.has(e))return!0;if(n.has(e))return!1;let r=e.match(pl);if(!r)return a(e);let s={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};return s.prerelease!=null||i.major!==s.major?a(e):i.major===0?i.minor===s.minor&&i.patch<=s.patch?o(e):a(e):i.minor<=s.minor?o(e):a(e)}}var hl=ml(fl),gl=fl.split(`.`)[0],_l=Symbol.for(`opentelemetry.js.api.${gl}`),vl=typeof globalThis==`object`?globalThis:typeof self==`object`?self:typeof window==`object`?window:typeof global==`object`?global:{};function yl(e,t,n,r=!1){let i=vl[_l]=vl[_l]??{version:fl};if(!r&&i[e]){let t=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`);return n.error(t.stack||t.message),!1}if(i.version!==`1.9.1`){let t=Error(`@opentelemetry/api: Registration of version v${i.version} for ${e} does not match previously registered API v${fl}`);return n.error(t.stack||t.message),!1}return i[e]=t,n.debug(`@opentelemetry/api: Registered a global for ${e} v${fl}.`),!0}function bl(e){let t=vl[_l]?.version;if(!(!t||!hl(t)))return vl[_l]?.[e]}function xl(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${fl}.`);let n=vl[_l];n&&delete n[e]}var Sl=class{constructor(e){this._namespace=e.namespace||`DiagComponentLogger`}debug(...e){return Cl(`debug`,this._namespace,e)}error(...e){return Cl(`error`,this._namespace,e)}info(...e){return Cl(`info`,this._namespace,e)}warn(...e){return Cl(`warn`,this._namespace,e)}verbose(...e){return Cl(`verbose`,this._namespace,e)}};function Cl(e,t,n){let r=bl(`diag`);if(r)return r[e](t,...n)}var wl;(function(e){e[e.NONE=0]=`NONE`,e[e.ERROR=30]=`ERROR`,e[e.WARN=50]=`WARN`,e[e.INFO=60]=`INFO`,e[e.DEBUG=70]=`DEBUG`,e[e.VERBOSE=80]=`VERBOSE`,e[e.ALL=9999]=`ALL`})(wl||={});function Tl(e,t){e<wl.NONE?e=wl.NONE:e>wl.ALL&&(e=wl.ALL),t||={};function n(n,r){let i=t[n];return typeof i==`function`&&e>=r?i.bind(t):function(){}}return{error:n(`error`,wl.ERROR),warn:n(`warn`,wl.WARN),info:n(`info`,wl.INFO),debug:n(`debug`,wl.DEBUG),verbose:n(`verbose`,wl.VERBOSE)}}var El=`diag`,Dl=class e{static instance(){return this._instance||=new e,this._instance}constructor(){function e(e){return function(...t){let n=bl(`diag`);if(n)return n[e](...t)}}let t=this;t.setLogger=(e,n={logLevel:wl.INFO})=>{if(e===t){let e=Error(`Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation`);return t.error(e.stack??e.message),!1}typeof n==`number`&&(n={logLevel:n});let r=bl(`diag`),i=Tl(n.logLevel??wl.INFO,e);if(r&&!n.suppressOverrideMessage){let e=Error().stack??`<failed to generate stacktrace>`;r.warn(`Current logger will be overwritten from ${e}`),i.warn(`Current logger will overwrite one already registered from ${e}`)}return yl(`diag`,i,t,!0)},t.disable=()=>{xl(El,t)},t.createComponentLogger=e=>new Sl(e),t.verbose=e(`verbose`),t.debug=e(`debug`),t.info=e(`info`),t.warn=e(`warn`),t.error=e(`error`)}},Ol=class e{constructor(e){this._entries=e?new Map(e):new Map}getEntry(e){let t=this._entries.get(e);if(t)return Object.assign({},t)}getAllEntries(){return Array.from(this._entries.entries())}setEntry(t,n){let r=new e(this._entries);return r._entries.set(t,n),r}removeEntry(t){let n=new e(this._entries);return n._entries.delete(t),n}removeEntries(...t){let n=new e(this._entries);for(let e of t)n._entries.delete(e);return n}clear(){return new e}},kl=Symbol(`BaggageEntryMetadata`),Al=Dl.instance();function jl(e={}){return new Ol(new Map(Object.entries(e)))}function Ml(e){return typeof e!=`string`&&(Al.error(`Cannot create baggage metadata from unknown type: ${typeof e}`),e=``),{__TYPE__:kl,toString(){return e}}}function Nl(e){return Symbol.for(e)}var Pl=new class e{constructor(t){let n=this;n._currentContext=t?new Map(t):new Map,n.getValue=e=>n._currentContext.get(e),n.setValue=(t,r)=>{let i=new e(n._currentContext);return i._currentContext.set(t,r),i},n.deleteValue=t=>{let r=new e(n._currentContext);return r._currentContext.delete(t),r}}},Fl=class{constructor(){}createGauge(e,t){return ql}createHistogram(e,t){return Jl}createCounter(e,t){return Kl}createUpDownCounter(e,t){return Yl}createObservableGauge(e,t){return Zl}createObservableCounter(e,t){return Xl}createObservableUpDownCounter(e,t){return Ql}addBatchObservableCallback(e,t){}removeBatchObservableCallback(e){}},Il=class{},Ll=class extends Il{add(e,t){}},Rl=class extends Il{add(e,t){}},zl=class extends Il{record(e,t){}},Bl=class extends Il{record(e,t){}},Vl=class{addCallback(e){}removeCallback(e){}},Hl=class extends Vl{},Ul=class extends Vl{},Wl=class extends Vl{},Gl=new Fl,Kl=new Ll,ql=new zl,Jl=new Bl,Yl=new Rl,Xl=new Hl,Zl=new Ul,Ql=new Wl;function $l(){return Gl}var eu={get(e,t){if(e!=null)return e[t]},keys(e){return e==null?[]:Object.keys(e)}},tu={set(e,t,n){e!=null&&(e[t]=n)}},nu=class{active(){return Pl}with(e,t,n,...r){return t.call(n,...r)}bind(e,t){return t}enable(){return this}disable(){return this}},ru=`context`,iu=new nu,au=class e{constructor(){}static getInstance(){return this._instance||=new e,this._instance}setGlobalContextManager(e){return yl(ru,e,Dl.instance())}active(){return this._getContextManager().active()}with(e,t,n,...r){return this._getContextManager().with(e,t,n,...r)}bind(e,t){return this._getContextManager().bind(e,t)}_getContextManager(){return bl(ru)||iu}disable(){this._getContextManager().disable(),xl(ru,Dl.instance())}},ou;(function(e){e[e.NONE=0]=`NONE`,e[e.SAMPLED=1]=`SAMPLED`})(ou||={});var su={traceId:`00000000000000000000000000000000`,spanId:`0000000000000000`,traceFlags:ou.NONE},cu=class{constructor(e=su){this._spanContext=e}spanContext(){return this._spanContext}setAttribute(e,t){return this}setAttributes(e){return this}addEvent(e,t){return this}addLink(e){return this}addLinks(e){return this}setStatus(e){return this}updateName(e){return this}end(e){}isRecording(){return!1}recordException(e,t){}},lu=Nl(`OpenTelemetry Context Key SPAN`);function uu(e){return e.getValue(lu)||void 0}function du(){return uu(au.getInstance().active())}function fu(e,t){return e.setValue(lu,t)}function pu(e){return e.deleteValue(lu)}function mu(e,t){return fu(e,new cu(t))}function hu(e){return uu(e)?.spanContext()}var gu=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1]);function _u(e,t){if(typeof e!=`string`||e.length!==t)return!1;let n=0;for(let t=0;t<e.length;t+=4)n+=(gu[e.charCodeAt(t)]|0)+(gu[e.charCodeAt(t+1)]|0)+(gu[e.charCodeAt(t+2)]|0)+(gu[e.charCodeAt(t+3)]|0);return n===t}function vu(e){return _u(e,32)&&e!==`00000000000000000000000000000000`}function yu(e){return _u(e,16)&&e!==`0000000000000000`}function bu(e){return vu(e.traceId)&&yu(e.spanId)}function xu(e){return new cu(e)}var Su=au.getInstance(),Cu=class{startSpan(e,t,n=Su.active()){if(t?.root)return new cu;let r=n&&hu(n);return wu(r)&&bu(r)?new cu(r):new cu}startActiveSpan(e,t,n,r){let i,a,o;if(arguments.length<2)return;arguments.length===2?o=t:arguments.length===3?(i=t,o=n):(i=t,a=n,o=r);let s=a??Su.active(),c=this.startSpan(e,i,s),l=fu(s,c);return Su.with(l,o,void 0,c)}};function wu(e){return typeof e==`object`&&!!e&&`spanId`in e&&typeof e.spanId==`string`&&`traceId`in e&&typeof e.traceId==`string`&&`traceFlags`in e&&typeof e.traceFlags==`number`}var Tu=new Cu,Eu=class{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}startSpan(e,t,n){return this._getTracer().startSpan(e,t,n)}startActiveSpan(e,t,n,r){let i=this._getTracer();return Reflect.apply(i.startActiveSpan,i,arguments)}_getTracer(){if(this._delegate)return this._delegate;let e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):Tu}},Du=new class{getTracer(e,t,n){return new Cu}},Ou=class{getTracer(e,t,n){return this.getDelegateTracer(e,t,n)??new Eu(this,e,t,n)}getDelegate(){return this._delegate??Du}setDelegate(e){this._delegate=e}getDelegateTracer(e,t,n){return this._delegate?.getTracer(e,t,n)}},ku;(function(e){e[e.INTERNAL=0]=`INTERNAL`,e[e.SERVER=1]=`SERVER`,e[e.CLIENT=2]=`CLIENT`,e[e.PRODUCER=3]=`PRODUCER`,e[e.CONSUMER=4]=`CONSUMER`})(ku||={});var Au;(function(e){e[e.UNSET=0]=`UNSET`,e[e.OK=1]=`OK`,e[e.ERROR=2]=`ERROR`})(Au||={});var ju=au.getInstance(),Mu=new class{getMeter(e,t,n){return Gl}},Nu=`metrics`,Pu=class e{constructor(){}static getInstance(){return this._instance||=new e,this._instance}setGlobalMeterProvider(e){return yl(Nu,e,Dl.instance())}getMeterProvider(){return bl(Nu)||Mu}getMeter(e,t,n){return this.getMeterProvider().getMeter(e,t,n)}disable(){xl(Nu,Dl.instance())}}.getInstance(),Fu=class{inject(e,t){}extract(e,t){return e}fields(){return[]}},Iu=Nl(`OpenTelemetry Baggage Key`);function Lu(e){return e.getValue(Iu)||void 0}function Ru(){return Lu(au.getInstance().active())}function zu(e,t){return e.setValue(Iu,t)}function Bu(e){return e.deleteValue(Iu)}var Vu=`propagation`,Hu=new Fu,Uu=class e{constructor(){this.createBaggage=jl,this.getBaggage=Lu,this.getActiveBaggage=Ru,this.setBaggage=zu,this.deleteBaggage=Bu}static getInstance(){return this._instance||=new e,this._instance}setGlobalPropagator(e){return yl(Vu,e,Dl.instance())}inject(e,t,n=tu){return this._getGlobalPropagator().inject(e,t,n)}extract(e,t,n=eu){return this._getGlobalPropagator().extract(e,t,n)}fields(){return this._getGlobalPropagator().fields()}disable(){xl(Vu,Dl.instance())}_getGlobalPropagator(){return bl(Vu)||Hu}}.getInstance(),Wu=`trace`,Gu=class e{constructor(){this._proxyTracerProvider=new Ou,this.wrapSpanContext=xu,this.isSpanContextValid=bu,this.deleteSpan=pu,this.getSpan=uu,this.getActiveSpan=du,this.getSpanContext=hu,this.setSpan=fu,this.setSpanContext=mu}static getInstance(){return this._instance||=new e,this._instance}setGlobalTracerProvider(e){let t=yl(Wu,this._proxyTracerProvider,Dl.instance());return t&&this._proxyTracerProvider.setDelegate(e),t}getTracerProvider(){return bl(Wu)||this._proxyTracerProvider}getTracer(e,t){return this.getTracerProvider().getTracer(e,t)}disable(){xl(Wu,Dl.instance()),this._proxyTracerProvider=new Ou}}.getInstance();Lo(()=>{let e=Gu.getActiveSpan();if(!e)return;let t=e.spanContext();if(bu(t))return t.traceId});var Ku=`semiont`,qu=()=>Gu.getTracer(Ku);async function Ju(e,t,n){let r=qu().startSpan(e,{kind:n?.kind??ku.INTERNAL,...n?.attrs?{attributes:n.attrs}:{}});try{return await ju.with(Gu.setSpan(ju.active(),r),()=>t(r))}catch(e){throw r.recordException(e),r.setStatus({code:Au.ERROR,message:e instanceof Error?e.message:String(e)}),e}finally{r.end()}}var Yu=`_trace`;function Xu(){let e={};Uu.inject(ju.active(),e);let t=e.traceparent;if(t)return e.tracestate?{traceparent:t,tracestate:e.tracestate}:{traceparent:t}}function Zu(e){let t=e[Yu];if(t!==void 0&&delete e[Yu],!(!t||typeof t.traceparent!=`string`))return t}function Qu(e,t){if(!e)return t();let n={traceparent:e.traceparent};e.tracestate&&(n.tracestate=e.tracestate);let r=Uu.extract(ju.active(),n);return ju.with(r,t)}var $u=`semiont`,ed=()=>Pu.getMeter($u),td;function nd(){return td||=ed().createCounter(`semiont.bus.emit`,{description:`Bus emits by channel and scope`}),td}function rd(e,t){nd().add(1,{"bus.channel":e,...t?{"bus.scope":t}:{}})}var id=3e3,ad=1e3,od={initial:[`connecting`,`closed`],connecting:[`open`,`reconnecting`,`closed`],open:[`reconnecting`,`closed`],reconnecting:[`connecting`,`degraded`,`closed`],degraded:[`connecting`,`reconnecting`,`closed`],closed:[]};function sd(e){let{baseUrl:t,token:n,channels:r,scope:i,reconnectMs:a=5e3}=e,o=typeof n==`function`?n:()=>n,s=new Set(r),c=new Set,l=i,u=new Yi,d=new Zi(`initial`),f=`initial`,p=null,m=e=>{if(f===e)return;if(!od[f].includes(e)){console.warn(`[actor] ignoring invalid connection state transition: ${f} \u2192 ${e}`);return}let t=f;f=e,e===`reconnecting`&&t!==`reconnecting`&&(p&&clearTimeout(p),p=setTimeout(()=>{f===`reconnecting`&&m(`degraded`)},id)),t===`reconnecting`&&e!==`reconnecting`&&(p&&=(clearTimeout(p),null)),d.next(e)},h=!1,g=new Set,_=null,v=new WeakSet,y=new Set,b=null,x=new Set,S=e=>{if(x.add(e),x.size>512){let e=x.values().next().value;e!==void 0&&x.delete(e)}},C=u.pipe(lo()),w=()=>{for(let e of g)try{e.abort()}catch{}g.clear(),_&&=(clearTimeout(_),null);for(let e of y)clearTimeout(e);y.clear()},T=async(e=!1)=>{m(`connecting`);let n=[...g];if(!e){for(let e of n)try{e.abort()}catch{}g.clear()}let r=new URLSearchParams;for(let e of s)r.append(`channel`,e);if(l&&c.size>0){r.append(`scope`,l);for(let e of c)r.append(`scoped`,e)}let i=`${t}/bus/subscribe?${r.toString()}`,d=new AbortController;g.add(d);try{let t={Authorization:`Bearer ${o()}`};b&&(t[`Last-Event-ID`]=b);let r=await fetch(i,{headers:t,signal:d.signal});if(!r.ok||!r.body)throw Error(`SSE connect failed: ${r.status}`);if(!h)return;if(e){for(let e of n)v.add(e);let e=setTimeout(()=>{y.delete(e);for(let e of n){try{e.abort()}catch{}g.delete(e)}},ad);y.add(e)}m(`open`);let a=r.body.getReader(),s=new TextDecoder,c=``,l=``,f=``,p;for(;h&&g.has(d);){let{done:e,value:t}=await a.read();if(e)break;c+=s.decode(t,{stream:!0});let n=c.split(`
|
|
7
|
+
`);c=n.pop()??``;for(let e of n)if(e.startsWith(`event: `))l=e.slice(7);else if(e.startsWith(`data: `))f=e.slice(6);else if(e.startsWith(`id: `))p=e.slice(4);else if(e===``){let e=p!==void 0&&x.has(p);if(l===`bus-event`&&f&&!e){p!==void 0&&(b=p,S(p));let e=JSON.parse(f);Ro(`RECV`,e.channel,e.payload,e.scope),Fo()&&v.has(d)&&console.debug(`[bus LINGER] ${e.channel} delivered on superseded connection`),await Qu(Zu(e.payload),()=>Ju(`bus.recv:${e.channel}`,()=>{u.next(e)},{kind:ku.CONSUMER,attrs:{"bus.channel":e.channel,...e.scope?{"bus.scope":e.scope}:{}}}))}l=``,f=``,p=void 0}}}catch(e){if(e.name===`AbortError`)return}finally{g.delete(d)}h&&!v.has(d)&&(m(`reconnecting`),_=setTimeout(()=>{h&&T()},a))},E=()=>{h&&((f===`open`||f===`connecting`||f===`degraded`)&&m(`reconnecting`),_&&=(clearTimeout(_),null),T(!0))},D=null,O=()=>{D&&clearTimeout(D),D=setTimeout(()=>{D=null,E()},100)};return{on$(e){return C.pipe(ao(t=>t.channel===e),Fa(e=>e.payload))},emit:async(e,n,r)=>{let i={channel:e,payload:n};r&&(i.scope=r);let a={"Content-Type":`application/json`,Authorization:`Bearer ${o()}`},s=Xu();s&&(a.traceparent=s.traceparent,s.tracestate&&(a.tracestate=s.tracestate)),await fetch(`${t}/bus/emit`,{method:`POST`,headers:a,body:JSON.stringify(i)})},state$:d.asObservable(),addChannels:(e,t)=>{let n=!1;if(t!==void 0){for(let t of e)c.has(t)||(c.add(t),n=!0);t!==l&&(l=t,n=!0)}else for(let t of e)s.has(t)||(s.add(t),n=!0);n&&O()},removeChannels:e=>{let t=!1;for(let n of e)c.delete(n)&&(t=!0),s.delete(n)&&(t=!0);c.size===0&&(l=void 0),t&&O()},start:()=>{h||(h=!0,T())},stop:()=>{h=!1,f!==`closed`&&m(`closed`),D&&=(clearTimeout(D),null),p&&=(clearTimeout(p),null),w()},dispose:()=>{h=!1,f!==`closed`&&m(`closed`),D&&=(clearTimeout(D),null),p&&=(clearTimeout(p),null),w(),u.complete(),d.complete()}}}var cd=[...Do.filter(e=>!Mo.includes(e)),...Oo];function ld(e){let t=e.headers.get(`Content-Type`)??`application/octet-stream`,n=e.headers.get(`Content-Disposition`)?.match(/filename="(.+?)"/)?.[1];return{stream:e.body,contentType:t,...n?{filename:n}:{}}}function ud(e){return e===400?`bad-request`:e===401?`unauthorized`:e===403?`forbidden`:e===404?`not-found`:e===409?`conflict`:e>=500?`unavailable`:`error`}var dd=class extends ps{status;statusText;constructor(e,t,n,r){super(e,ud(t),{status:t,statusText:n,body:r}),this.name=`APIError`,this.status=t,this.statusText=n}},fd=class{baseUrl;http;token$;logger;errorsSubject=new Yi;errors$=this.errorsSubject.asObservable();_actor=null;_actorStarted=!1;disposed=!1;activeResource=null;bridges=[];constructor(e){let{baseUrl:t,timeout:n=3e4,retry:r=2,logger:i,tokenRefresher:a}=e;this.baseUrl=t.endsWith(`/`)?t.slice(0,-1):t,this.token$=e.token$??new Zi(null),this.logger=i;let o=a?{limit:1,methods:[`get`,`post`,`put`,`patch`,`delete`,`head`,`options`],statusCodes:[401,408,413,429,500,502,503,504]}:r;this.http=dl.create({timeout:n,retry:o,hooks:{beforeRequest:[({request:e})=>{this.logger&&this.logger.debug(`HTTP Request`,{type:`http_request`,url:e.url,method:e.method,timestamp:Date.now(),hasAuth:e.headers.has(`Authorization`)})}],beforeRetry:a?[async({request:e,error:t})=>{if(!(!(t instanceof Qs)||t.response.status!==401))try{let t=await a();if(!t)return dl.stop;e.headers.set(`Authorization`,`Bearer ${t}`);return}catch{return dl.stop}}]:[],afterResponse:[({request:e,response:t})=>(this.logger&&this.logger.debug(`HTTP Response`,{type:`http_response`,url:e.url,method:e.method,status:t.status,statusText:t.statusText}),t)],beforeError:[async({request:e,error:t})=>{let n=t instanceof Qs?t.response:void 0;if(n){let t=await n.json().catch(()=>({}));this.logger&&this.logger.error(`HTTP Request Failed`,{type:`http_error`,url:e.url,method:e.method,status:n.status,statusText:n.statusText,error:t.message||`HTTP ${n.status}: ${n.statusText}`});let r=new dd(t.message||`HTTP ${n.status}: ${n.statusText}`,n.status,n.statusText,t);throw this.errorsSubject.next(r),r}return t}]}}),this.token$.subscribe(e=>{e&&!this._actorStarted&&!this.disposed&&(this._actorStarted=!0,this.actor.start())})}get actor(){if(!this._actor){this._actor=sd({baseUrl:this.baseUrl,token:()=>this.token$.getValue()??``,channels:[...Mo]});for(let e of Mo)this._actor.on$(e).subscribe(t=>{for(let n of this.bridges)n.get(e).next(t)})}return this._actor}async emit(e,t,n){Ro(`EMIT`,e,t,n),rd(e,n),await Ju(`bus.emit:${e}`,async()=>{n===void 0?await this.actor.emit(e,t):await this.actor.emit(e,t,n)},{kind:ku.PRODUCER,attrs:{"bus.channel":e,...n?{"bus.scope":n}:{}}})}on(e,t){let n=this.actor.on$(e).subscribe(t);return()=>n.unsubscribe()}stream(e){return this.actor.on$(e)}bridgeInto(e){this.bridges.push(e)}subscribeToResource(e){if(this.activeResource){if(this.activeResource.resourceId!==e)throw Error(`HttpTransport already subscribed to resource ${this.activeResource.resourceId}; call the unsubscribe returned from the previous subscribeToResource before subscribing to ${e}.`);return this.activeResource.refCount++,this.makeUnsubscriber()}this.actor.addChannels([...cd],e);let t=[];for(let e of cd)t.push(this.actor.on$(e).subscribe(t=>{for(let n of this.bridges)n.get(e).next(t)}));return this.activeResource={resourceId:e,refCount:1,bridgeSubs:t},this.makeUnsubscriber()}makeUnsubscriber(){let e=!1;return()=>{if(!e&&(e=!0,this.activeResource&&(this.activeResource.refCount--,!(this.activeResource.refCount>0)))){for(let e of this.activeResource.bridgeSubs)e.unsubscribe();this.actor.removeChannels([...cd]),this.activeResource=null}}}get state$(){return this.actor.state$}dispose(){if(!this.disposed){if(this.disposed=!0,this.activeResource){for(let e of this.activeResource.bridgeSubs)e.unsubscribe();this.activeResource=null}this._actor&&=(this._actor.dispose(),null),this.errorsSubject.complete()}}pushError(e){this.disposed||this.errorsSubject.next(e)}authHeaders(){let e=this.token$.getValue()??void 0;return e?{Authorization:`Bearer ${e}`}:{}}async authenticatePassword(e,t){return this.http.post(`${this.baseUrl}/api/tokens/password`,{json:{email:e,password:t},headers:this.authHeaders()}).json()}async authenticateGoogle(e){return this.http.post(`${this.baseUrl}/api/tokens/google`,{json:{credential:e},headers:this.authHeaders()}).json()}async refreshAccessToken(e){return this.http.post(`${this.baseUrl}/api/tokens/refresh`,{json:{refreshToken:e},headers:this.authHeaders()}).json()}async logout(){await this.http.post(`${this.baseUrl}/api/users/logout`,{headers:this.authHeaders()}).json()}async acceptTerms(){await this.http.post(`${this.baseUrl}/api/users/accept-terms`,{headers:this.authHeaders()}).json()}async getCurrentUser(){return this.http.get(`${this.baseUrl}/api/users/me`,{headers:this.authHeaders()}).json()}async getMediaToken(e){return this.http.post(`${this.baseUrl}/api/tokens/media`,{json:{resourceId:e},headers:this.authHeaders()}).json()}async listUsers(){return this.http.get(`${this.baseUrl}/api/admin/users`,{headers:this.authHeaders()}).json()}async getUserStats(){return this.http.get(`${this.baseUrl}/api/admin/users/stats`,{headers:this.authHeaders()}).json()}async updateUser(e,t){return this.http.patch(`${this.baseUrl}/api/admin/users/${e}`,{json:t,headers:this.authHeaders()}).json()}async getOAuthConfig(){return this.http.get(`${this.baseUrl}/api/admin/oauth/config`,{headers:this.authHeaders()}).json()}async backupKnowledgeBase(){return ld(await this.http.post(`${this.baseUrl}/api/admin/exchange/backup`,{headers:this.authHeaders()}))}restoreKnowledgeBase(e){return this.sseProgressStream(`${this.baseUrl}/api/admin/exchange/restore`,e)}async exportKnowledgeBase(e){let t=e?.includeArchived?new URLSearchParams({includeArchived:`true`}):void 0;return ld(await this.http.post(`${this.baseUrl}/api/moderate/exchange/export`,{headers:this.authHeaders(),...t?{searchParams:t}:{}}))}importKnowledgeBase(e){return this.sseProgressStream(`${this.baseUrl}/api/moderate/exchange/import`,e)}sseProgressStream(e,t){return new Wi(n=>{let r=new AbortController,i=new FormData;return i.append(`file`,t),(async()=>{try{let t=(await this.http.post(e,{body:i,headers:this.authHeaders(),signal:r.signal})).body.getReader(),a=new TextDecoder,o=``;for(;!n.closed;){let{done:e,value:r}=await t.read();if(e)break;o+=a.decode(r,{stream:!0});let i=o.split(`
|
|
8
|
+
`);o=i.pop();for(let e of i)if(e.startsWith(`data: `)){let t=JSON.parse(e.slice(6));n.next(t)}}n.complete()}catch(e){n.closed||n.error(e)}})(),()=>r.abort()})}async healthCheck(){return this.http.get(`${this.baseUrl}/api/health`,{headers:this.authHeaders()}).json()}async getStatus(){return this.http.get(`${this.baseUrl}/api/status`,{headers:this.authHeaders()}).json()}get rawHttp(){return this.http}getToken(){return this.token$.getValue()??void 0}},pd=class{constructor(e){this.transport=e}transport;async putBinary(e,t){let n=e.file instanceof File?e.file.size:e.file.length;return Ro(`PUT`,`content`,{name:e.name,format:e.format,storageUri:e.storageUri,sizeBytes:n}),Ju(`content.put`,async()=>{let n=md(e),r=this.requestHeaders(t?.auth);return typeof XMLHttpRequest<`u`&&(t?.onProgress||t?.signal)?hd({url:`${this.transport.baseUrl}/resources`,formData:n,headers:r,onProgress:t.onProgress,signal:t.signal,onApiError:e=>this.transport.pushError(e)}):{resourceId:(await this.transport.rawHttp.post(`${this.transport.baseUrl}/resources`,{body:n,headers:r}).json()).resourceId}},{kind:ku.CLIENT,attrs:{"content.format":e.format,"content.size_bytes":n}})}async getBinary(e,t){return Ro(`GET`,`content`,{resourceId:e}),Ju(`content.get`,async()=>{let n=await this.transport.rawHttp.get(`${this.transport.baseUrl}/resources/${e}`,{headers:this.requestHeaders(t?.auth)}),r=n.headers.get(`content-type`)||`application/octet-stream`;return{data:await n.arrayBuffer(),contentType:r}},{kind:ku.CLIENT,attrs:{"resource.id":e}})}async getBinaryStream(e,t){return Ro(`GET`,`content`,{resourceId:e,stream:!0}),Ju(`content.get`,async()=>{let n=await this.transport.rawHttp.get(`${this.transport.baseUrl}/resources/${e}`,{headers:this.requestHeaders(t?.auth)}),r=n.headers.get(`content-type`)||`application/octet-stream`;if(!n.body)throw Error(`Response body is null - cannot create stream`);return{stream:n.body,contentType:r}},{kind:ku.CLIENT,attrs:{"resource.id":e,"content.stream":!0}})}async getResourceGraph(e,t){return Ro(`GET`,`content`,{resourceId:e,graph:!0}),Ju(`content.get_graph`,()=>this.transport.rawHttp.get(`${this.transport.baseUrl}/resources/${e}/jsonld`,{headers:this.requestHeaders(t?.auth)}).json(),{kind:ku.CLIENT,attrs:{"resource.id":e,"content.graph":!0}})}dispose(){}requestHeaders(e){let t=e??this.transport.getToken(),n=t?{Authorization:`Bearer ${t}`}:{},r=Xu();return r&&(n.traceparent=r.traceparent,r.tracestate&&(n.tracestate=r.tracestate)),n}};function md(e){let t=new FormData;if(t.append(`name`,e.name),t.append(`format`,e.format),t.append(`storageUri`,e.storageUri),e.file instanceof File)t.append(`file`,e.file);else if(typeof Buffer<`u`&&Buffer.isBuffer(e.file)){let n=new Blob([new Uint8Array(e.file)],{type:e.format});t.append(`file`,n,e.name)}else throw Error(`file must be a File or Buffer`);return e.entityTypes&&e.entityTypes.length>0&&t.append(`entityTypes`,JSON.stringify(e.entityTypes)),e.language&&t.append(`language`,e.language),e.sourceAnnotationId&&t.append(`sourceAnnotationId`,String(e.sourceAnnotationId)),e.sourceResourceId&&t.append(`sourceResourceId`,String(e.sourceResourceId)),e.generationPrompt&&t.append(`generationPrompt`,e.generationPrompt),e.generator&&t.append(`generator`,JSON.stringify(e.generator)),e.isDraft!==void 0&&t.append(`isDraft`,String(e.isDraft)),t}function hd(e){let{url:t,formData:n,headers:r,onProgress:i,signal:a,onApiError:o}=e;return new Promise((e,s)=>{let c=new XMLHttpRequest;if(a?.aborted){let e=new dd(`Upload aborted`,0,`aborted`);o(e),s(e);return}c.open(`POST`,t);for(let[e,t]of Object.entries(r))c.setRequestHeader(e,t);i&&(c.upload.onprogress=e=>{let t=e.lengthComputable?e.total:0;i({bytesUploaded:e.loaded,totalBytes:t})}),c.onload=()=>{if(c.status>=200&&c.status<300){try{e({resourceId:JSON.parse(c.responseText).resourceId})}catch(e){let t=new dd(`Upload succeeded but response was not valid JSON: ${e.message}`,c.status,c.statusText,c.responseText);o(t),s(t)}return}let t=c.responseText;try{t=JSON.parse(c.responseText)}catch{}let n=new dd(t&&typeof t==`object`&&`message`in t&&typeof t.message==`string`?t.message:`HTTP ${c.status}: ${c.statusText}`,c.status,c.statusText,t);o(n),s(n)},c.onerror=()=>{let e=new dd(`Network error during upload`,0,`network-error`);o(e),s(e)},c.ontimeout=()=>{let e=new dd(`Upload timed out`,0,`timeout`);o(e),s(e)},c.onabort=()=>{let e=new dd(`Upload aborted`,0,`aborted`);o(e),s(e)},a&&a.addEventListener(`abort`,()=>c.abort(),{once:!0}),c.send(n)})}var gd=class e extends Wi{then(e,t){return $i(this).then(e,t)}run(e){return new Promise((t,n)=>{let r,i=!1;this.subscribe({next:t=>{i=!0,r=t,e(t)},error:n,complete:()=>{i?t(r):n(new Qi)}})})}static from(t){return new e(e=>t.subscribe(e))}},_d=class e extends Wi{fetchFresh;then(e,t){return this.fetchFresh?this.fetchFresh().then(e,t):ea(this.pipe(ao(e=>e!==void 0))).then(e,t)}static from(t,n){let r=vd.get(t);return r||(r=new e(e=>t.subscribe(e)),r.fetchFresh=n,vd.set(t,r)),r}},vd=new WeakMap,yd=class extends Wi{then(e,t){return $i(this).then(t=>{if(t.phase!==`finished`)throw Error(`UploadObservable resolved on a non-finished event: ${t.phase}`);let n={resourceId:t.resourceId};return e?e(n):n},t)}run(e){return new Promise((t,n)=>{let r;this.subscribe({next:t=>{r=t,e(t)},error:n,complete:()=>{r?.phase===`finished`?t({resourceId:r.resourceId}):n(Error(`UploadObservable completed on a non-finished event: ${r?.phase??`<none>`}`))}})})}};function bd(e){let t=new Zi(new Map),n=new Map,r=new Map,i=!1,a=new Map,o=new Yi,s=e=>e instanceof Error?e:Error(String(e)),c=r=>{let i=n.get(r);if(i)return i;let o;return o=(async()=>{try{let n=await e(r);a.delete(r);let i=new Map(t.value);return i.set(r,n),t.next(i),n}finally{n.get(r)===o&&n.delete(r)}})(),n.set(r,o),o},l=e=>{i||c(e).catch(n=>{i||(console.warn(`[cache RETRY] SWR fetch failed for key ${String(e)}; re-issuing once (B14):`,n instanceof Error?n.message:n),c(e).catch(n=>{if(!i&&(console.warn(`[cache IDLE] retry also failed for key ${String(e)}; going idle until the next observe()/invalidate() (B14):`,n instanceof Error?n.message:n),!t.value.has(e))){let t=s(n);a.set(e,t),o.next({key:e,error:t})}}))})};return{observe(e){i||(a.has(e)?(a.delete(e),l(e)):!t.value.has(e)&&!n.has(e)&&l(e));let s=r.get(e);return s||(s=eo(t.pipe(Fa(t=>t.get(e)),ro()),o.pipe(ao(t=>t.key===e),Fa(e=>{throw e.error})),Pa(()=>{let t=a.get(e);return t?no(()=>t):za})),r.set(e,s)),s},fetch(e){return i?Promise.reject(Error(`Cache disposed`)):c(e)},get(e){return t.value.get(e)},keys(){return[...t.value.keys()]},invalidate(e){i||(n.delete(e),a.delete(e),l(e))},remove(e){if(i)return;let r=new Map(t.value);r.delete(e),t.next(r),n.delete(e),a.delete(e)},set(e,n){if(i)return;a.delete(e);let r=new Map(t.value);r.set(e,n),t.next(r)},invalidateAll(){if(!i)for(let e of t.value.keys())n.delete(e),l(e)},dispose(){i||(i=!0,t.complete(),o.complete(),a.clear(),r.clear(),n.clear())}}}var xd=`_`,Sd=`_`,Cd=`_`,wd=class{constructor(e,t,n,r){this.transport=e,this.bus=t,this.content=n,this.busTimeoutMs=r?.busTimeoutMs,this.resourceCache=bd(async e=>(await hs(this.transport,`browse:resource-requested`,{resourceId:e},this.busTimeoutMs)).resource),this.resourceListCache=bd(async e=>{let t=this.resourceListFilters.get(e)??{},n=t.search?Co(t.search):void 0;return(await hs(this.transport,`browse:resources-requested`,{search:n,archived:t.archived,entityType:t.entityType,limit:t.limit??100,offset:0},this.busTimeoutMs)).resources}),this.annotationListCache=bd(async e=>hs(this.transport,`browse:annotations-requested`,{resourceId:e},this.busTimeoutMs)),this.annotationDetailCache=bd(async e=>{let t=this.annotationResources.get(e);if(!t)throw Error(`Cannot fetch annotation ${e}: no resourceId known`);return(await hs(this.transport,`browse:annotation-requested`,{resourceId:t,annotationId:e},this.busTimeoutMs)).annotation}),this.entityTypesCache=bd(async()=>(await hs(this.transport,`browse:entity-types-requested`,{},this.busTimeoutMs)).entityTypes),this.tagSchemasCache=bd(async()=>(await hs(this.transport,`browse:tag-schemas-requested`,{},this.busTimeoutMs)).tagSchemas),this.agentsCache=bd(async()=>(await hs(this.transport,`browse:agents-requested`,{},this.busTimeoutMs)).agents),this.referencedByCache=bd(async e=>(await hs(this.transport,`browse:referenced-by-requested`,{resourceId:e},this.busTimeoutMs)).referencedBy),this.resourceEventsCache=bd(async e=>(await hs(this.transport,`browse:events-requested`,{resourceId:e},this.busTimeoutMs)).events),this.subscribeToEvents()}transport;bus;content;resourceCache;resourceListCache;annotationListCache;annotationDetailCache;annotationResources=new Map;entityTypesCache;tagSchemasCache;agentsCache;referencedByCache;resourceEventsCache;resourceListFilters=new Map;annotationListObs=new Map;scopedSources=new WeakMap;busTimeoutMs;busSubs=[];withScope(e,t){let n=this.scopedSources.get(t);return n||(n=new Wi(n=>{let r=null;try{r=this.transport.subscribeToResource(e)}catch{this.degradedScopeWarned.has(e)||(this.degradedScopeWarned.add(e),console.warn(`[browse DEGRADED] scope contention: observing ${e} unscoped \u2014 its live per-resource invalidations are paused until the scope frees (re-subscribe re-attempts; real fix: .plans/MULTI-RESOURCE-SCOPE.md).`))}let i=t.subscribe(n);return()=>{i.unsubscribe(),r?.()}}),this.scopedSources.set(t,n)),n}degradedScopeWarned=new Set;resource(e){return _d.from(this.withScope(e,this.resourceCache.observe(e)),()=>this.resourceCache.fetch(e))}resources(e){let t=JSON.stringify(e??{});return this.resourceListFilters.set(t,e??{}),_d.from(this.resourceListCache.observe(t),()=>this.resourceListCache.fetch(t))}annotations(e){let t=this.annotationListObs.get(e);return t||(t=this.annotationListCache.observe(e).pipe(Fa(e=>e?.annotations)),this.annotationListObs.set(e,t)),_d.from(this.withScope(e,t),()=>this.annotationListCache.fetch(e).then(e=>e.annotations))}annotation(e,t){return this.annotationResources.set(t,e),_d.from(this.withScope(e,this.annotationDetailCache.observe(t)),()=>this.annotationDetailCache.fetch(t))}entityTypes(){return _d.from(this.entityTypesCache.observe(xd),()=>this.entityTypesCache.fetch(xd))}tagSchemas(){return _d.from(this.tagSchemasCache.observe(Sd),()=>this.tagSchemasCache.fetch(Sd))}agents(){return _d.from(this.agentsCache.observe(Cd),()=>this.agentsCache.fetch(Cd))}referencedBy(e){return _d.from(this.withScope(e,this.referencedByCache.observe(e)),()=>this.referencedByCache.fetch(e))}events(e){return _d.from(this.withScope(e,this.resourceEventsCache.observe(e)),()=>this.resourceEventsCache.fetch(e))}async resourceContent(e){let t=await this.content.getBinary(e);return Fs(t.data,t.contentType)}async resourceGraph(e){return this.content.getResourceGraph(e)}async resourceRepresentation(e){return this.content.getBinary(e)}async resourceRepresentationStream(e){return this.content.getBinaryStream(e)}async resourceEvents(e){return(await hs(this.transport,`browse:events-requested`,{resourceId:e},this.busTimeoutMs)).events}async annotationHistory(e,t){return hs(this.transport,`browse:annotation-history-requested`,{resourceId:e,annotationId:t},this.busTimeoutMs)}async connections(e){throw Error(`Not implemented: connections endpoint does not exist yet`)}async backlinks(e){throw Error(`Not implemented: backlinks endpoint does not exist yet`)}async resourcesByName(e,t){throw Error(`Not implemented: resourcesByName endpoint does not exist yet`)}async files(e,t){return hs(this.transport,`browse:directory-requested`,{path:e??`.`,sort:t??`name`},this.busTimeoutMs)}click(e,t){this.bus.get(`browse:click`).next({annotationId:e,motivation:t})}navigateReference(e){this.bus.get(`browse:reference-navigate`).next({resourceId:e})}invalidateAnnotationList(e){this.annotationListCache.invalidate(e)}removeAnnotationDetail(e){this.annotationDetailCache.remove(e),this.annotationResources.delete(e)}invalidateResourceDetail(e){this.resourceCache.invalidate(e)}invalidateResourceLists(){this.resourceListCache.invalidateAll()}invalidateEntityTypes(){this.entityTypesCache.invalidate(xd)}invalidateTagSchemas(){this.tagSchemasCache.invalidate(Sd)}invalidateAgents(){this.agentsCache.invalidate(Cd)}invalidateReferencedBy(e){this.referencedByCache.invalidate(e)}invalidateResourceEvents(e){this.resourceEventsCache.invalidate(e)}updateAnnotationInPlace(e,t){let n=this.annotationListCache.get(e);if(n){let r=n.annotations.findIndex(e=>e.id===t.id),i=r>=0?n.annotations.map((e,n)=>n===r?t:e):[...n.annotations,t];this.annotationListCache.set(e,{...n,annotations:i})}let r=Eo(t.id);this.annotationResources.set(r,e),this.annotationDetailCache.set(r,t)}on(e,t){this.busSubs.push(this.bus.get(e).subscribe(t))}dispose(){for(let e of this.busSubs)e.unsubscribe();this.busSubs.length=0,this.resourceCache.dispose(),this.resourceListCache.dispose(),this.annotationListCache.dispose(),this.annotationDetailCache.dispose(),this.entityTypesCache.dispose(),this.tagSchemasCache.dispose(),this.agentsCache.dispose(),this.referencedByCache.dispose(),this.resourceEventsCache.dispose(),this.annotationResources.clear(),this.resourceListFilters.clear(),this.annotationListObs.clear()}onEntityTagChanged=e=>{e.resourceId&&(this.invalidateAnnotationList(e.resourceId),this.invalidateResourceDetail(e.resourceId),this.invalidateResourceEvents(e.resourceId))};onArchiveToggled=e=>{e.resourceId&&(this.invalidateResourceDetail(e.resourceId),this.invalidateResourceLists())};invalidateMutatedResource=e=>{let t=To(e);this.invalidateResourceDetail(t),this.invalidateResourceLists()};subscribeToEvents(){this.on(`bus:resume-gap`,e=>{let t=e.scope;if(t){let e=t;this.invalidateAnnotationList(e),this.invalidateResourceDetail(e),this.invalidateResourceEvents(e),this.invalidateReferencedBy(e)}else{this.invalidateResourceLists();for(let e of this.annotationListCache.keys())this.invalidateAnnotationList(e);for(let e of this.resourceCache.keys())this.invalidateResourceDetail(e);for(let e of this.resourceEventsCache.keys())this.invalidateResourceEvents(e);for(let e of this.referencedByCache.keys())this.invalidateReferencedBy(e)}this.invalidateEntityTypes(),this.invalidateTagSchemas(),this.invalidateAgents()}),this.on(`mark:delete-ok`,e=>{this.removeAnnotationDetail(Eo(e.response.annotationId))}),this.on(`mark:added`,e=>{e.resourceId&&(this.invalidateAnnotationList(e.resourceId),this.invalidateResourceEvents(e.resourceId))}),this.on(`mark:removed`,e=>{e.resourceId&&(this.invalidateAnnotationList(e.resourceId),this.invalidateResourceEvents(e.resourceId)),this.removeAnnotationDetail(Eo(e.payload.annotationId))}),this.on(`mark:body-updated`,e=>{let t=e;!t.resourceId||!t.annotation||(this.updateAnnotationInPlace(t.resourceId,t.annotation),this.invalidateResourceEvents(t.resourceId))}),this.on(`mark:entity-tag-added`,this.onEntityTagChanged),this.on(`mark:entity-tag-removed`,this.onEntityTagChanged),this.on(`replay-window-exceeded`,e=>{e.resourceId&&this.invalidateAnnotationList(e.resourceId)}),this.on(`yield:create-ok`,e=>this.invalidateMutatedResource(e.response.resourceId)),this.on(`yield:update-ok`,e=>this.invalidateMutatedResource(e.response.resourceId)),this.on(`mark:archived`,this.onArchiveToggled),this.on(`mark:unarchived`,this.onArchiveToggled),this.on(`frame:entity-type-added`,()=>this.invalidateEntityTypes()),this.on(`frame:tag-schema-added`,()=>this.invalidateTagSchemas())}},Td=class{constructor(e,t){this.transport=e,this.bus=t}transport;bus;async annotation(e){let t=To(e.target.source);return{annotationId:Eo((await hs(this.transport,`mark:create-request`,{resourceId:t,request:e})).annotationId)}}async delete(e,t){await hs(this.transport,`mark:delete`,{annotationId:t,resourceId:e})}async archive(e){await hs(this.transport,`mark:archive`,{resourceId:e})}async unarchive(e){await hs(this.transport,`mark:unarchive`,{resourceId:e})}async updateEntityTypes(e,t,n){await hs(this.transport,`mark:update-entity-types`,{resourceId:e,currentEntityTypes:t,updatedEntityTypes:n})}assist(e,t,n){return new gd(r=>{let i=!1,a=null,o=null,s=()=>{i=!0,a&&=(clearTimeout(a),null),o&&=(clearInterval(o),null)},c=t=>{a&&clearTimeout(a),o&&=(clearInterval(o),null),a=setTimeout(()=>{i||(o=setInterval(()=>{i||hs(this.transport,`job:status-requested`,{jobId:t}).then(n=>{i||(n.status===`complete`?(s(),r.next({kind:`complete`,data:{jobId:t,jobType:n.type??`annotation`,resourceId:e,result:n.result}}),r.complete()):n.status===`failed`&&(s(),r.error(Error(n.error??`Job failed`))))}).catch(()=>{})},5e3))},1e4)},l=null,u=this.bus.get(`job:report-progress`).pipe(ao(e=>e.jobId===l)),d=this.bus.get(`job:complete`).pipe(ao(e=>e.jobId===l)),f=this.bus.get(`job:fail`).pipe(ao(e=>e.jobId===l)),p=u.pipe(_o(eo(d,f))).subscribe(e=>{e.progress&&r.next({kind:`progress`,data:e.progress}),l&&c(l)}),m=d.subscribe(e=>{s(),r.next({kind:`complete`,data:e}),r.complete()}),h=f.subscribe(e=>{s(),r.error(Error(e.error))});return this.dispatchAssist(e,t,n).then(({jobId:e})=>{e&&!i&&(l=e,c(e))}).catch(e=>{i||(s(),r.error(e))}),()=>{s(),p.unsubscribe(),m.unsubscribe(),h.unsubscribe()}})}request(e,t,n){this.bus.get(`mark:requested`).next({source:e,selector:t,motivation:n})}requestAssist(e,t,n){this.bus.get(`mark:assist-request`).next({motivation:e,options:t,...n?{correlationId:n}:{}})}submit(e){this.bus.get(`mark:submit`).next(e)}cancelPending(){this.bus.get(`mark:cancel-pending`).next(void 0)}dismissProgress(){this.bus.get(`mark:progress-dismiss`).next(void 0)}async dispatchAssist(e,t,n){let r={tagging:`tag-annotation`,linking:`reference-annotation`,highlighting:`highlight-annotation`,assessing:`assessment-annotation`,commenting:`comment-annotation`}[t];if(!r)throw Error(`Unsupported motivation: ${t}`);if(t===`tagging`){if(!n.schemaId)throw Error(`mark.assist with motivation "tagging" requires options.schemaId`);if(!n.categories?.length)throw Error(`mark.assist with motivation "tagging" requires a non-empty options.categories array`)}else if(t===`linking`&&!n.entityTypes?.length)throw Error(`mark.assist with motivation "linking" requires a non-empty entityTypes array`);let i={};return n.entityTypes&&(i.entityTypes=n.entityTypes),n.includeDescriptiveReferences!==void 0&&(i.includeDescriptiveReferences=n.includeDescriptiveReferences),n.instructions!==void 0&&(i.instructions=n.instructions),n.density!==void 0&&(i.density=n.density),n.tone!==void 0&&(i.tone=n.tone),n.language!==void 0&&(i.language=n.language),n.sourceLanguage!==void 0&&(i.sourceLanguage=n.sourceLanguage),n.schemaId!==void 0&&(i.schemaId=n.schemaId),n.categories!==void 0&&(i.categories=n.categories),hs(this.transport,`job:create`,{jobType:r,resourceId:e,params:i})}},Ed=class{constructor(e,t){this.transport=e,this.bus=t}transport;bus;async body(e,t,n){await hs(this.transport,`bind:update-body`,{annotationId:t,resourceId:e,operations:n})}initiate(e){this.bus.get(`bind:initiate`).next(e)}},Dd=class{constructor(e,t){this.transport=e,this.bus=t}transport;bus;annotation(e,t,n){return new gd(r=>{let i=crypto.randomUUID(),a=this.bus.get(`gather:complete`).pipe(ao(e=>e.correlationId===i)),o=this.bus.get(`gather:failed`).pipe(ao(e=>e.correlationId===i)),s=eo(this.bus.get(`gather:annotation-progress`).pipe(ao(e=>e.annotationId===t),Fa(e=>e)),a.pipe(Fa(e=>e))).pipe(_o(eo(a,o))).subscribe({next:e=>r.next(e),error:e=>r.error(e)}),c=a.subscribe(e=>{r.next(e),r.complete()}),l=o.subscribe(e=>{r.error(Error(e.message))});return this.transport.emit(`gather:requested`,{correlationId:i,annotationId:t,resourceId:e,options:{contextWindow:n?.contextWindow??2e3}}).catch(e=>{r.closed||r.error(e)}),()=>{s.unsubscribe(),c.unsubscribe(),l.unsubscribe()}})}resource(e,t){return hs(this.transport,`gather:resource-requested`,{resourceId:e,options:{depth:t?.depth??2,maxResources:t?.maxResources??10,includeContent:t?.includeContent??!0,includeSummary:t?.includeSummary??!1,...t?.excludeEntityTypes?.length?{excludeEntityTypes:t.excludeEntityTypes}:{}}})}},Od=class{constructor(e,t){this.transport=e,this.bus=t}transport;bus;requestSearch(e){this.bus.get(`match:search-requested`).next(e)}search(e,t,n,r){return new gd(i=>{let a=crypto.randomUUID(),o=this.bus.get(`match:search-results`).pipe(ao(e=>e.correlationId===a)),s=this.bus.get(`match:search-failed`).pipe(ao(e=>e.correlationId===a)),c=o.subscribe(e=>{i.next(e),i.complete()}),l=s.subscribe(e=>{i.error(Error(e.error))});return this.transport.emit(`match:search-requested`,{correlationId:a,resourceId:e,referenceId:t,context:n,limit:r?.limit??10,useSemanticScoring:r?.useSemanticScoring??!0}).catch(e=>{i.closed||i.error(e)}),()=>{c.unsubscribe(),l.unsubscribe()}})}},kd=class{constructor(e,t,n){this.transport=e,this.bus=t,this.content=n}transport;bus;content;resource(e){let t=typeof Buffer<`u`&&e.file instanceof Buffer?e.file.length:e.file.size;return new yd(n=>{n.next({phase:`started`,totalBytes:t});let r=!1,i=new AbortController;return this.content.putBinary({name:e.name,file:e.file,format:e.format,storageUri:e.storageUri,...e.entityTypes?{entityTypes:e.entityTypes}:{},...e.language?{language:e.language}:{},...e.sourceAnnotationId?{sourceAnnotationId:e.sourceAnnotationId}:{},...e.sourceResourceId?{sourceResourceId:e.sourceResourceId}:{},...e.generationPrompt?{generationPrompt:e.generationPrompt}:{},...e.generator?{generator:e.generator}:{},...e.isDraft===void 0?{}:{isDraft:e.isDraft}},{onProgress:({bytesUploaded:e,totalBytes:i})=>{if(r)return;let a=i>0?i:t;n.next({phase:`progress`,bytesUploaded:e,totalBytes:a})},signal:i.signal}).then(e=>{r||(n.next({phase:`finished`,resourceId:To(e.resourceId)}),n.complete())}).catch(e=>{r||n.error(e)}),()=>{r=!0,i.abort()}})}fromAnnotation(e,t,n){return this.runGeneration(e,{referenceId:t,title:n.title,prompt:n.prompt,entityTypes:n.entityTypes,language:n.language,sourceLanguage:n.sourceLanguage,temperature:n.temperature,maxTokens:n.maxTokens,storageUri:n.storageUri,outputMediaType:n.outputMediaType,task:n.task,structure:n.structure,cite:n.cite,context:n.context})}fromResource(e,t){return this.runGeneration(e,{title:t.title,prompt:t.prompt,entityTypes:t.entityTypes,language:t.language,sourceLanguage:t.sourceLanguage,temperature:t.temperature,maxTokens:t.maxTokens,storageUri:t.storageUri,outputMediaType:t.outputMediaType,task:t.task,structure:t.structure,cite:t.cite,context:t.context})}runGeneration(e,t){return new gd(n=>{let r=!1,i=null,a=null,o=()=>{r=!0,i&&=(clearTimeout(i),null),a&&=(clearInterval(a),null)},s=t=>{i&&clearTimeout(i),a&&=(clearInterval(a),null),i=setTimeout(()=>{r||(a=setInterval(()=>{r||hs(this.transport,`job:status-requested`,{jobId:t}).then(i=>{r||(i.status===`complete`?(o(),n.next({kind:`complete`,data:{jobId:t,jobType:i.type??`generation`,resourceId:e,result:i.result}}),n.complete()):i.status===`failed`&&(o(),n.error(Error(i.error??`Generation failed`))))}).catch(()=>{})},5e3))},1e4)},c=null,l=this.bus.get(`job:report-progress`).pipe(ao(e=>e.jobId===c)),u=this.bus.get(`job:complete`).pipe(ao(e=>e.jobId===c)),d=this.bus.get(`job:fail`).pipe(ao(e=>e.jobId===c)),f=l.pipe(_o(eo(u,d))).subscribe(e=>{e.progress&&n.next({kind:`progress`,data:e.progress}),c&&s(c)}),p=u.subscribe(e=>{o(),n.next({kind:`complete`,data:e}),n.complete()}),m=d.subscribe(e=>{o(),n.error(Error(e.error))});return hs(this.transport,`job:create`,{jobType:`generation`,resourceId:e,params:t}).then(({jobId:e})=>{e&&!r&&(c=e,s(e))}).catch(e=>{r||(o(),n.error(e))}),()=>{o(),f.unsubscribe(),p.unsubscribe(),m.unsubscribe()}})}async cloneToken(e){return hs(this.transport,`yield:clone-token-requested`,{resourceId:e})}async fromToken(e){return(await hs(this.transport,`yield:clone-resource-requested`,{token:e})).sourceResource}async createFromToken(e){return{resourceId:To((await hs(this.transport,`yield:clone-create`,e)).resourceId)}}clone(){this.bus.get(`yield:clone`).next(void 0)}},Ad=class{constructor(e,t){this.transport=e,this.bus=t}transport;bus;attention(e,t){this.transport.emit(`beckon:focus`,{annotationId:t,resourceId:e})}hover(e){this.bus.get(`beckon:hover`).next({annotationId:e})}sparkle(e){this.bus.get(`beckon:sparkle`).next({annotationId:e})}},jd=class{constructor(e){this.transport=e}transport;async addEntityType(e){await hs(this.transport,`frame:add-entity-type`,{tag:e})}async addEntityTypes(e){for(let t of e)await hs(this.transport,`frame:add-entity-type`,{tag:t})}async addTagSchema(e){await hs(this.transport,`frame:add-tag-schema`,{schema:e})}},Md=class{constructor(e,t){this.transport=e,this.bus=t}transport;bus;get queued$(){return this.bus.get(`job:queued`)}get progress$(){return this.bus.get(`job:report-progress`)}get complete$(){return this.bus.get(`job:complete`)}get fail$(){return this.bus.get(`job:fail`)}async status(e){return hs(this.transport,`job:status-requested`,{jobId:e})}async pollUntilComplete(e,t){let n=t?.interval??1e3,r=t?.timeout??6e4,i=Date.now();for(;;){let a=await this.status(e);if(t?.onProgress&&t.onProgress(a),a.status===`complete`||a.status===`failed`||a.status===`cancelled`)return a;if(Date.now()-i>r)throw Error(`Job polling timeout after ${r}ms`);await new Promise(e=>setTimeout(e,n))}}async cancelByType(e){let{cancelled:t}=await hs(this.transport,`job:cancel-requested`,{jobType:e});return t}cancelRequest(e){this.bus.get(`job:cancel-requested`).next({jobType:e})}},Nd=class{constructor(e){this.backend=e}backend;async password(e,t){return this.backend.authenticatePassword(vo(e),t)}async google(e){return this.backend.authenticateGoogle(yo(e))}async refresh(e){return this.backend.refreshAccessToken(xo(e))}async logout(){await this.backend.logout()}async me(){return this.backend.getCurrentUser()}async acceptTerms(){await this.backend.acceptTerms()}async mediaToken(e){return this.backend.getMediaToken(e)}},Pd=class{constructor(e){this.backend=e}backend;async users(){return(await this.backend.listUsers()).users}async userStats(){return this.backend.getUserStats()}async updateUser(e,t){return(await this.backend.updateUser(e,t)).user}async oauthConfig(){return this.backend.getOAuthConfig()}async healthCheck(){return this.backend.healthCheck()}async status(){return this.backend.getStatus()}async backup(){return this.backend.backupKnowledgeBase()}restore(e){return Fd(this.backend.restoreKnowledgeBase(e))}async exportKnowledgeBase(e){return this.backend.exportKnowledgeBase(e)}importKnowledgeBase(e){return Fd(this.backend.importKnowledgeBase(e))}};function Fd(e){return new gd(t=>{let n=e.subscribe({next:e=>t.next(e),error:e=>t.error(e),complete:()=>t.complete()});return()=>n.unsubscribe()})}var Id=class e{transport;content;bus;baseUrl;frame;browse;mark;bind;gather;match;yield;beckon;job;auth;admin;constructor(e,t,n){this.transport=e,this.content=t,this.baseUrl=e.baseUrl,this.bus=new Ho,this.transport.bridgeInto(this.bus),this.frame=new jd(this.transport),this.browse=new wd(this.transport,this.bus,this.content),this.mark=new Td(this.transport,this.bus),this.bind=new Ed(this.transport,this.bus),this.gather=new Dd(this.transport,this.bus),this.match=new Od(this.transport,this.bus),this.yield=new kd(this.transport,this.bus,this.content),this.beckon=new Ad(this.transport,this.bus),this.job=new Md(this.transport,this.bus),this.auth=n?new Nd(n):void 0,this.admin=n?new Pd(n):void 0}get state$(){return this.transport.state$}dispose(){this.browse.dispose(),this.transport.dispose(),this.content.dispose(),this.bus.destroy()}static fromHttp(t){let n=new fd({baseUrl:typeof t.baseUrl==`string`?wo(t.baseUrl):t.baseUrl,token$:new Zi(t.token==null?null:typeof t.token==`string`?bo(t.token):t.token)});return new e(n,new pd(n),n)}static async signInHttp(t){let n=typeof t.baseUrl==`string`?wo(t.baseUrl):t.baseUrl,r=new Zi(null),i=new fd({baseUrl:n,token$:r}),a=new e(i,new pd(i),i);try{let e=await a.auth.password(t.email,t.password);return r.next(bo(e.token)),a}catch(e){throw a.dispose(),e}}},Ld=`semiont.session.`,Rd=`semiont.knowledgeBases`,zd=`semiont.activeKnowledgeBaseId`,Bd=300*1e3;function Vd(e){return`${Ld}${e}`}function Hd(e,t){let n=e.get(Vd(t));if(!n)return null;try{let e=JSON.parse(n);if(e&&typeof e.access==`string`&&typeof e.refresh==`string`)return{access:e.access,refresh:e.refresh}}catch{}return null}function Ud(e,t,n){e.set(Vd(t),JSON.stringify(n))}function Wd(e,t){e.delete(Vd(t))}function Gd(e){try{let t=e.split(`.`);if(t.length!==3||!t[1])return null;let n=JSON.parse(atob(t[1]));return n.exp?new Date(n.exp*1e3):null}catch{return null}}function Kd(e){let t=Gd(e);return t?t.getTime()<Date.now():!0}function qd(e){if(!e||typeof e!=`object`)return!1;let t=e;if(typeof t.id!=`string`||typeof t.label!=`string`||typeof t.email!=`string`)return!1;let n=t.endpoint;return!n||typeof n!=`object`?!1:n.kind===`http`?typeof n.host==`string`&&typeof n.port==`number`&&(n.protocol===`http`||n.protocol===`https`):n.kind===`local`?typeof n.kbId==`string`:!1}function Jd(e){try{let t=e.get(Rd);return t?JSON.parse(t).filter(qd):[]}catch{return[]}}function Yd(e,t){e.set(Rd,JSON.stringify(t))}function Xd(e){return e===`localhost`||e===`127.0.0.1`?`http`:`https`}var Zd=/^(([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)*[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?|localhost|\d{1,3}(\.\d{1,3}){3})$/;function Qd(e){return Zd.test(e)}function $d(e){if(!Qd(e.host))throw Error(`Invalid KB hostname: "${e.host}"`);let t=new URL(`http://x`);return t.protocol=e.protocol+`:`,t.hostname=e.host,t.port=String(e.port),`${e.protocol}://${t.hostname}:${e.port}`}function ef(){return crypto.randomUUID()}var tf=class extends ps{kbId;constructor(e,t,n=null){super(t,e,{kbId:n}),this.name=`SemiontSessionError`,this.kbId=n}},nf=class e{kb;client;token$;user$;streamState$;errors$;ready;storage;doRefresh;doValidate;onAuthFailed;onError;refreshTimer=null;unsubscribeStorage=null;disposed=!1;constructor(e){this.kb=e.kb,this.storage=e.storage,this.doRefresh=e.refresh,this.doValidate=e.validate,this.onAuthFailed=e.onAuthFailed??(()=>{}),this.onError=e.onError??(()=>{}),this.client=e.client,this.token$=e.token$,this.user$=new Zi(null),this.errors$=this.client.transport.errors$;let t=Hd(this.storage,this.kb.id);t&&!Kd(t.access)&&this.token$.getValue()===null&&this.token$.next(bo(t.access));let n=this.token$.getValue();this.streamState$=this.client.state$,n&&this.scheduleProactiveRefresh(n),this.unsubscribeStorage=this.storage.subscribe?.((e,t)=>{this.handleStorageChange(e,t)})??null,this.ready=this.validate(t)}async validate(e){if(!e)return;let t=Kd(e.access)?this.doRefresh?await this.doRefresh():null:e.access;if(!t){Kd(e.access)&&Wd(this.storage,this.kb.id);return}if(t!==e.access&&(this.token$.next(bo(t)),this.scheduleProactiveRefresh(t)),!this.doValidate)return;let n=async e=>{if(!this.disposed)try{let t=await this.doValidate(bo(e));if(this.disposed)return;this.user$.next(t)}catch(e){if(this.disposed)return;if(e instanceof dd&&e.status===401){let e=this.doRefresh?await this.doRefresh():null;if(this.disposed)return;if(e){this.token$.next(bo(e)),this.scheduleProactiveRefresh(e),await n(e);return}Wd(this.storage,this.kb.id),this.token$.next(null),this.onAuthFailed(`Your session has expired. Please sign in again.`)}else this.onError(new tf(`session.auth-failed`,e instanceof Error?e.message:String(e),this.kb.id))}};await n(t)}async refresh(){if(this.disposed||!this.doRefresh)return null;let e=await this.doRefresh();if(this.disposed)return null;if(e){let t=bo(e);return this.token$.next(t),this.scheduleProactiveRefresh(e),t}return this.token$.next(null),Wd(this.storage,this.kb.id),this.onAuthFailed(`Your session has expired. Please sign in again.`),this.onError(new tf(`session.refresh-exhausted`,`Token refresh failed`,this.kb.id)),null}scheduleProactiveRefresh(e){this.clearRefreshTimer();let t=Gd(e);if(!t)return;let n=t.getTime()-Bd,r=Math.max(0,n-Date.now());this.refreshTimer=setTimeout(()=>{this.refreshTimer=null,this.disposed||this.refresh()},r)}clearRefreshTimer(){this.refreshTimer&&=(clearTimeout(this.refreshTimer),null)}handleStorageChange(e,t){if(!this.disposed&&e===Vd(this.kb.id)){if(!t){this.token$.next(null),this.user$.next(null),this.clearRefreshTimer();return}try{let e=JSON.parse(t);typeof e.access==`string`&&(this.token$.next(bo(e.access)),this.scheduleProactiveRefresh(e.access))}catch{}}}get expiresAt(){let e=this.token$.getValue();return e?Gd(e):null}subscribe(e,t){let n=this.client.bus.get(e).subscribe(t);return()=>n.unsubscribe()}async dispose(){this.disposed||(this.disposed=!0,this.clearRefreshTimer(),this.unsubscribeStorage&&=(this.unsubscribeStorage(),null),this.client.dispose(),this.token$.complete(),this.user$.complete())}static fromHttp(t){let n=typeof t.baseUrl==`string`?wo(t.baseUrl):t.baseUrl,r=new Zi(t.token==null?null:typeof t.token==`string`?bo(t.token):t.token),i=new fd({baseUrl:n,token$:r}),a=new Id(i,new pd(i),i),o={kb:t.kb,storage:t.storage,client:a,token$:r};return t.refresh&&(o.refresh=t.refresh),t.validate&&(o.validate=t.validate),t.onAuthFailed&&(o.onAuthFailed=t.onAuthFailed),t.onError&&(o.onError=t.onError),new e(o)}static async signInHttp(t){let n=typeof t.baseUrl==`string`?wo(t.baseUrl):t.baseUrl,r=new Zi(null),i=new fd({baseUrl:n,token$:r}),a=new Id(i,new pd(i),i),o;try{o=await a.auth.password(t.email,t.password)}catch(e){throw a.dispose(),e}Ud(t.storage,t.kb.id,{access:o.token,refresh:o.refreshToken}),r.next(bo(o.token));let s={kb:t.kb,storage:t.storage,client:a,token$:r,refresh:async()=>{let e=Hd(t.storage,t.kb.id);if(!e)return null;try{return(await a.auth.refresh(e.refresh)).access_token}catch{return null}}};t.validate&&(s.validate=t.validate),t.onAuthFailed&&(s.onAuthFailed=t.onAuthFailed),t.onError&&(s.onError=t.onError);let c=new e(s);return await c.ready,c}},rf=class{sessionExpiredAt$;sessionExpiredMessage$;permissionDeniedAt$;permissionDeniedMessage$;constructor(){this.sessionExpiredAt$=new Zi(null),this.sessionExpiredMessage$=new Zi(null),this.permissionDeniedAt$=new Zi(null),this.permissionDeniedMessage$=new Zi(null)}notifySessionExpired(e){this.sessionExpiredMessage$.next(e??`Your session has expired. Please sign in again.`),this.sessionExpiredAt$.next(Date.now())}notifyPermissionDenied(e){this.permissionDeniedMessage$.next(e??`You do not have permission to perform this action.`),this.permissionDeniedAt$.next(Date.now())}acknowledgeSessionExpired(){this.sessionExpiredAt$.next(null),this.sessionExpiredMessage$.next(null)}acknowledgePermissionDenied(){this.permissionDeniedAt$.next(null),this.permissionDeniedMessage$.next(null)}dispose(){this.sessionExpiredAt$.complete(),this.sessionExpiredMessage$.complete(),this.permissionDeniedAt$.complete(),this.permissionDeniedMessage$.complete()}},af=`openDocuments`;function of(e){return[...e].sort((e,t)=>e.order!==void 0&&t.order!==void 0?e.order-t.order:e.openedAt-t.openedAt)}function sf(e){try{let t=e.get(af);if(t)return of(JSON.parse(t))}catch{}return[]}var cf=class{kbs$;activeKbId$;activeSession$;activeSignals$;sessionActivating$;openResources$;error$;identityToken$;storage;sessionFactory;eventBus=new Ho;unsubscribeStorage=null;disposed=!1;activating=null;constructor(e){this.storage=e.storage,this.sessionFactory=e.sessionFactory;let t=Jd(this.storage),n=this.storage.get(zd),r=n&&t.some(e=>e.id===n)?n:t[0]?.id??null;this.kbs$=new Zi(t),this.activeKbId$=new Zi(r),this.activeSession$=new Zi(null),this.activeSignals$=new Zi(null),this.sessionActivating$=new Zi(!1),this.openResources$=new Zi(sf(this.storage)),this.error$=new Yi,this.identityToken$=new Zi(null),this.kbs$.subscribe(e=>Yd(this.storage,e)),this.activeKbId$.subscribe(e=>{e?this.storage.set(zd,e):this.storage.delete(zd)}),this.openResources$.subscribe(e=>{this.storage.set(af,JSON.stringify(e))}),this.unsubscribeStorage=this.storage.subscribe?.((e,t)=>{if(!(e!==af||!t))try{this.openResources$.next(of(JSON.parse(t)))}catch{}})??null,r&&this.setActiveKb(r)}emit(e,t){this.disposed||this.eventBus.get(e).next(t)}on(e,t){let n=this.eventBus.get(e).subscribe(t);return()=>n.unsubscribe()}stream(e){return this.eventBus.get(e).asObservable()}setIdentityToken(e){this.disposed||this.identityToken$.next(e)}addKb(e,t,n){let r={id:ef(),...e};return Ud(this.storage,r.id,{access:t,refresh:n}),this.kbs$.next([...this.kbs$.getValue(),r]),this.setActiveKb(r.id),r}removeKb(e){Wd(this.storage,e);let t=this.kbs$.getValue().filter(t=>t.id!==e);this.kbs$.next(t),this.activeKbId$.getValue()===e&&this.setActiveKb(t[0]?.id??null)}updateKb(e,t){this.kbs$.next(this.kbs$.getValue().map(n=>n.id===e?{...n,...t}:n))}getKbSessionStatus(e){let t=Hd(this.storage,e);return t?Kd(t.access)?`expired`:`authenticated`:`signed-out`}async setActiveKb(e){if(this.disposed)return;let t=this.activeKbId$.getValue(),n=this.activeSession$.getValue();if(e===t&&n)return;for(t!==e&&this.activeKbId$.next(e),n&&(this.activeSession$.next(null),this.activeSignals$.next(null));this.activating;)if(await this.activating,this.disposed||this.activeKbId$.getValue()!==e)return;let r=(async()=>{let t=this.activeSession$.getValue(),n=this.activeSignals$.getValue();if(t&&(this.activeSession$.next(null),this.activeSignals$.next(null),await t.dispose(),n?.dispose()),!e)return;let r=this.kbs$.getValue().find(t=>t.id===e);if(!r)return;let i=new rf,a;try{a=this.sessionFactory({kb:r,storage:this.storage,signals:i,onError:e=>this.error$.next(e)})}catch(t){this.error$.next(t instanceof tf?t:new tf(`session.construct-failed`,t instanceof Error?t.message:String(t),e)),i.dispose();return}a.errors$.subscribe(e=>{e.code===`unauthorized`?i.notifySessionExpired(e.message):e.code===`forbidden`&&i.notifyPermissionDenied(e.message)});try{await a.ready}catch(t){this.error$.next(new tf(`session.construct-failed`,t instanceof Error?t.message:String(t),e)),await a.dispose(),i.dispose();return}if(this.disposed||this.activeKbId$.getValue()!==e){await a.dispose(),i.dispose();return}this.activeSession$.next(a),this.activeSignals$.next(i)})();this.activating=r,this.sessionActivating$.next(!0);try{await r}finally{this.activating===r&&(this.activating=null,this.sessionActivating$.next(!1))}}async signIn(e,t,n){if(!this.disposed){if(Ud(this.storage,e,{access:t,refresh:n}),this.activeKbId$.getValue()===e){let t=this.activeSession$.getValue(),n=this.activeSignals$.getValue();this.activeSession$.next(null),this.activeSignals$.next(null),t&&await t.dispose(),n?.dispose(),await this.setActiveKb(e);return}await this.setActiveKb(e)}}async signOut(e){if(!this.disposed&&(Wd(this.storage,e),this.kbs$.next([...this.kbs$.getValue()]),this.activeKbId$.getValue()===e)){let e=this.activeSession$.getValue(),t=this.activeSignals$.getValue();this.activeSession$.next(null),this.activeSignals$.next(null),e&&await e.dispose(),t?.dispose()}}addOpenResource(e,t,n,r){let i=this.openResources$.getValue(),a=i.findIndex(t=>t.id===e);if(a>=0){let e={...i[a],name:t,...n===void 0?{}:{mediaType:n},...r===void 0?{}:{storageUri:r}},o=[...i];o[a]=e,this.openResources$.next(o);return}let o={id:e,name:t,openedAt:Date.now(),order:i.length,...n===void 0?{}:{mediaType:n},...r===void 0?{}:{storageUri:r}};this.openResources$.next([...i,o])}removeOpenResource(e){this.openResources$.next(this.openResources$.getValue().filter(t=>t.id!==e))}updateOpenResourceName(e,t){this.openResources$.next(this.openResources$.getValue().map(n=>n.id===e?{...n,name:t}:n))}reorderOpenResources(e,t){let n=[...this.openResources$.getValue()];if(e<0||e>=n.length||t<0||t>=n.length)return;let[r]=n.splice(e,1);r&&n.splice(t,0,r),this.openResources$.next(n)}async dispose(){if(this.disposed)return;this.disposed=!0,this.unsubscribeStorage&&=(this.unsubscribeStorage(),null);let e=this.activeSession$.getValue(),t=this.activeSignals$.getValue();this.activeSession$.next(null),this.activeSignals$.next(null),e&&await e.dispose(),t?.dispose(),this.kbs$.complete(),this.activeKbId$.complete(),this.activeSession$.complete(),this.activeSignals$.complete(),this.openResources$.complete(),this.error$.complete(),this.identityToken$.complete(),this.eventBus.destroy()}};function lf(){let e=new Map;return t=>{let{kb:n,storage:r,signals:i,onError:a}=t;if(n.endpoint.kind!==`http`)throw new tf(`session.construct-failed`,`HTTP session factory cannot construct a session for endpoint kind "${n.endpoint.kind}"`,n.id);let o=n.endpoint,s=async()=>{let t=e.get(n.id);if(t)return t;let i=(async()=>{let e=Hd(r,n.id);if(!e)return null;let t=new fd({baseUrl:wo($d(o))}),i=new Id(t,new pd(t),t);try{let t=(await i.auth.refresh(e.refresh)).access_token;return t?(Ud(r,n.id,{access:t,refresh:e.refresh}),t):null}catch{return null}finally{i.dispose()}})();e.set(n.id,i);try{return await i}finally{e.delete(n.id)}},c=async e=>{let t=new Zi(e),n=new fd({baseUrl:wo($d(o)),token$:t}),r=new Id(n,new pd(n),n);try{return await r.auth.me()}finally{r.dispose(),t.complete()}},l=new Zi(null),u,d=new fd({baseUrl:wo($d(o)),token$:l,tokenRefresher:()=>u.refresh().then(e=>e??null)});return u=new nf({kb:n,storage:r,client:new Id(d,new pd(d),d),token$:l,refresh:s,validate:c,onAuthFailed:e=>i.notifySessionExpired(e),onError:a}),u}}var uf=null;function df(e){return uf||=new cf({storage:e.storage,sessionFactory:e.sessionFactory}),uf}function ff(){let e=new _i;return{add:t=>e.add(typeof t==`function`?t:()=>t.dispose()),dispose:()=>e.unsubscribe()}}function pf(e,t={}){let n=t.debounceMs??250,r=t.initialQuery??``,i=new Yi;return{query$:i.pipe(mo(r)),state$:i.pipe(mo(r),so(n),ro(),ho(t=>{let n=t.trim();return n?e(n).pipe(Fa(e=>({results:e??[],isSearching:e===void 0})),mo({results:[],isSearching:!0})):to({results:[],isSearching:!1})})),setQuery:e=>i.next(e),dispose:()=>i.complete()}}function mf(e){let t=[],n=new Zi(null);return t.push(e.bus.get(`beckon:hover`).subscribe(({annotationId:t})=>{n.next(t),t&&e.bus.get(`beckon:sparkle`).next({annotationId:t})})),t.push(e.bus.get(`browse:click`).subscribe(({annotationId:t})=>{e.bus.get(`beckon:focus`).next({annotationId:t})})),{hoveredAnnotationId$:n.asObservable(),hover:t=>e.bus.get(`beckon:hover`).next({annotationId:t}),focus:t=>e.bus.get(`beckon:focus`).next({annotationId:t}),sparkle:t=>e.bus.get(`beckon:sparkle`).next({annotationId:t}),dispose(){t.forEach(e=>e.unsubscribe()),n.complete()}}}function hf(e,t){let n=null,r=null,i=()=>{r!==null&&(clearTimeout(r),r=null)};return{handleMouseEnter:a=>{n!==a&&(i(),r=setTimeout(()=>{r=null,n=a,e(a)},t))},handleMouseLeave:()=>{i(),n!==null&&(n=null,e(null))},cleanup:i}}function gf(e,t){let n=[],r=new Zi(null),i=new Zi(!1),a=new Zi(null),o=new Zi(null);return n.push(e.bus.get(`gather:requested`).subscribe(s=>{i.next(!0),a.next(null),r.next(null),o.next(Eo(s.annotationId));let c=e.gather.annotation(t,Eo(s.annotationId),{contextWindow:s.options?.contextWindow??2e3}).pipe(Ma(6e4)).subscribe({next:e=>{`response`in e&&e.response&&(r.next(e.response??null),i.next(!1))},error:e=>{a.next(e instanceof Error?e:Error(String(e))),i.next(!1)},complete:()=>{i.next(!1)}});n.push(c)})),{context$:r.asObservable(),loading$:i.asObservable(),error$:a.asObservable(),annotationId$:o.asObservable(),dispose(){n.forEach(e=>e.unsubscribe()),r.complete(),i.complete(),a.complete(),o.complete()}}}function _f(e,t){let n=[];return n.push(e.bus.get(`match:search-requested`).subscribe(t=>{let r=e.match.search(To(t.resourceId),Eo(t.referenceId),t.context,{limit:t.limit,useSemanticScoring:t.useSemanticScoring}).pipe(Ma(6e4)).subscribe({next:t=>e.bus.get(`match:search-results`).next(t),error:n=>e.bus.get(`match:search-failed`).next({correlationId:t.correlationId,referenceId:t.referenceId,error:n instanceof Error?n.message:String(n)})});n.push(r)})),{dispose(){n.forEach(e=>e.unsubscribe())}}}function vf(e,t,n){let r=[],i=new Zi(!1),a=new Zi(null),o=null,s=e=>{let t=e.pipe(Ma({each:3e5})).subscribe({next:e=>{e.kind===`progress`&&(a.next(e.data),i.next(!0))},complete:()=>{i.next(!1),o&&clearTimeout(o),o=setTimeout(()=>{a.next(null),o=null},2e3)},error:()=>{a.next(null),i.next(!1)}});r.push(t)};return{isGenerating$:i.asObservable(),progress$:a.asObservable(),generate:(r,i)=>{s(e.yield.fromAnnotation(To(t),Eo(r),{...i,language:i.language||n}))},generateFromResource:r=>{s(e.yield.fromResource(To(t),{...r,language:r.language||n}))},dispose(){r.forEach(e=>e.unsubscribe()),o&&clearTimeout(o),i.complete(),a.complete()}}}function yf(e){if(e.svgSelector)return{type:`SvgSelector`,value:e.svgSelector};if(e.fragmentSelector){let t=[{type:`FragmentSelector`,value:e.fragmentSelector,...e.conformsTo&&{conformsTo:e.conformsTo}}];return e.exact&&t.push({type:`TextQuoteSelector`,exact:e.exact,...e.prefix&&{prefix:e.prefix},...e.suffix&&{suffix:e.suffix}}),t}return{type:`TextQuoteSelector`,exact:e.exact,...e.prefix&&{prefix:e.prefix},...e.suffix&&{suffix:e.suffix}}}function bf(e,t){let n=[],r=new Zi(null),i=new Zi(null),a=new Zi(null),o=null,s=()=>{o&&=(clearTimeout(o),null)},c=e=>{r.next(e)};return n.push(e.bus.get(`mark:requested`).subscribe(e=>{e.source===t&&c({selector:e.selector,motivation:e.motivation})})),n.push(e.bus.get(`mark:select-comment`).subscribe(e=>c({selector:yf(e),motivation:`commenting`}))),n.push(e.bus.get(`mark:select-tag`).subscribe(e=>c({selector:yf(e),motivation:`tagging`}))),n.push(e.bus.get(`mark:select-assessment`).subscribe(e=>c({selector:yf(e),motivation:`assessing`}))),n.push(e.bus.get(`mark:select-reference`).subscribe(e=>c({selector:yf(e),motivation:`linking`}))),n.push(e.bus.get(`mark:cancel-pending`).subscribe(()=>r.next(null))),n.push(e.bus.get(`mark:create-ok`).subscribe(()=>r.next(null))),n.push(e.bus.get(`mark:submit`).subscribe(async n=>{if(n.source===t)try{let r=await e.mark.annotation({motivation:n.motivation,target:{source:t,selector:n.selector},body:n.body});e.bus.get(`mark:create-ok`).next({response:{annotationId:r.annotationId}})}catch(t){e.bus.get(`mark:create-failed`).next({message:t instanceof Error?t.message:String(t)})}})),n.push(e.bus.get(`mark:delete`).subscribe(async n=>{try{await e.mark.delete(t,n.annotationId),e.bus.get(`mark:delete-ok`).next({response:{annotationId:n.annotationId}})}catch(t){e.bus.get(`mark:delete-failed`).next({message:t instanceof Error?t.message:String(t)})}})),n.push(e.bus.get(`mark:assist-request`).subscribe(r=>{s(),i.next(r.motivation),a.next(null);let c=e.mark.assist(t,r.motivation,r.options).pipe(Ma({each:18e4})).subscribe({next:e=>{e.kind===`progress`&&a.next(e.data)},complete:()=>{i.next(null),s(),o=setTimeout(()=>{a.next(null),o=null},5e3)},error:()=>{s(),i.next(null),a.next(null)}});n.push(c)})),n.push(e.bus.get(`mark:progress-dismiss`).subscribe(()=>{s(),a.next(null)})),{pendingAnnotation$:r.asObservable(),assistingMotivation$:i.asObservable(),progress$:a.asObservable(),dispose(){n.forEach(e=>e.unsubscribe()),s(),r.complete(),i.complete(),a.complete()}}}var xf=c(),Sf=I({"../../node_modules/rxjs/dist/cjs/internal/util/isFunction.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isFunction=void 0;function t(e){return typeof e==`function`}e.isFunction=t}}),Cf=I({"../../node_modules/rxjs/dist/cjs/internal/util/createErrorClass.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createErrorClass=void 0;function t(e){var t=e(function(e){Error.call(e),e.stack=Error().stack});return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}e.createErrorClass=t}}),wf=I({"../../node_modules/rxjs/dist/cjs/internal/util/UnsubscriptionError.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.UnsubscriptionError=void 0,e.UnsubscriptionError=Cf().createErrorClass(function(e){return function(t){e(this),this.message=t?t.length+` errors occurred during unsubscription:
|
|
9
|
+
`+t.map(function(e,t){return t+1+`) `+e.toString()}).join(`
|
|
10
|
+
`):``,this.name=`UnsubscriptionError`,this.errors=t}})}}),Tf=I({"../../node_modules/rxjs/dist/cjs/internal/util/arrRemove.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.arrRemove=void 0;function t(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}e.arrRemove=t}}),Ef=I({"../../node_modules/rxjs/dist/cjs/internal/Subscription.js"(e){var t=e&&e.__values||function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},n=e&&e.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},r=e&&e.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(e,"__esModule",{value:!0}),e.isSubscription=e.EMPTY_SUBSCRIPTION=e.Subscription=void 0;var i=Sf(),a=wf(),o=Tf(),s=(function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var e,o,s,c,u;if(!this.closed){this.closed=!0;var d=this._parentage;if(d)if(this._parentage=null,Array.isArray(d))try{for(var f=t(d),p=f.next();!p.done;p=f.next())p.value.remove(this)}catch(t){e={error:t}}finally{try{p&&!p.done&&(o=f.return)&&o.call(f)}finally{if(e)throw e.error}}else d.remove(this);var m=this.initialTeardown;if(i.isFunction(m))try{m()}catch(e){u=e instanceof a.UnsubscriptionError?e.errors:[e]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var g=t(h),_=g.next();!_.done;_=g.next()){var v=_.value;try{l(v)}catch(e){u??=[],e instanceof a.UnsubscriptionError?u=r(r([],n(u)),n(e.errors)):u.push(e)}}}catch(e){s={error:e}}finally{try{_&&!_.done&&(c=g.return)&&c.call(g)}finally{if(s)throw s.error}}}if(u)throw new a.UnsubscriptionError(u)}},e.prototype.add=function(t){if(t&&t!==this)if(this.closed)l(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=this._finalizers??[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&o.arrRemove(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&o.arrRemove(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e})();e.Subscription=s,e.EMPTY_SUBSCRIPTION=s.EMPTY;function c(e){return e instanceof s||e&&`closed`in e&&i.isFunction(e.remove)&&i.isFunction(e.add)&&i.isFunction(e.unsubscribe)}e.isSubscription=c;function l(e){i.isFunction(e)?e():e.unsubscribe()}}}),Df=I({"../../node_modules/rxjs/dist/cjs/internal/config.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.config=void 0,e.config={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1}}}),Of=I({"../../node_modules/rxjs/dist/cjs/internal/scheduler/timeoutProvider.js"(e){var t=e&&e.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},n=e&&e.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(e,"__esModule",{value:!0}),e.timeoutProvider=void 0,e.timeoutProvider={setTimeout:function(r,i){var a=[...arguments].slice(2),o=e.timeoutProvider.delegate;return o?.setTimeout?o.setTimeout.apply(o,n([r,i],t(a))):setTimeout.apply(void 0,n([r,i],t(a)))},clearTimeout:function(t){return(e.timeoutProvider.delegate?.clearTimeout||clearTimeout)(t)},delegate:void 0}}}),kf=I({"../../node_modules/rxjs/dist/cjs/internal/util/reportUnhandledError.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.reportUnhandledError=void 0;var t=Df(),n=Of();function r(e){n.timeoutProvider.setTimeout(function(){var n=t.config.onUnhandledError;if(n)n(e);else throw e})}e.reportUnhandledError=r}}),Af=I({"../../node_modules/rxjs/dist/cjs/internal/util/noop.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.noop=void 0;function t(){}e.noop=t}}),jf=I({"../../node_modules/rxjs/dist/cjs/internal/NotificationFactories.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createNotification=e.nextNotification=e.errorNotification=e.COMPLETE_NOTIFICATION=void 0,e.COMPLETE_NOTIFICATION=(function(){return r(`C`,void 0,void 0)})();function t(e){return r(`E`,void 0,e)}e.errorNotification=t;function n(e){return r(`N`,e,void 0)}e.nextNotification=n;function r(e,t,n){return{kind:e,value:t,error:n}}e.createNotification=r}}),Mf=I({"../../node_modules/rxjs/dist/cjs/internal/util/errorContext.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.captureError=e.errorContext=void 0;var t=Df(),n=null;function r(e){if(t.config.useDeprecatedSynchronousErrorHandling){var r=!n;if(r&&(n={errorThrown:!1,error:null}),e(),r){var i=n,a=i.errorThrown,o=i.error;if(n=null,a)throw o}}else e()}e.errorContext=r;function i(e){t.config.useDeprecatedSynchronousErrorHandling&&n&&(n.errorThrown=!0,n.error=e)}e.captureError=i}}),Nf=I({"../../node_modules/rxjs/dist/cjs/internal/Subscriber.js"(e){var t=e&&e.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(e,"__esModule",{value:!0}),e.EMPTY_OBSERVER=e.SafeSubscriber=e.Subscriber=void 0;var n=Sf(),r=Ef(),i=Df(),a=kf(),o=Af(),s=jf(),c=Of(),l=Mf(),u=(function(n){t(i,n);function i(t){var i=n.call(this)||this;return i.isStopped=!1,t?(i.destination=t,r.isSubscription(t)&&t.add(i)):i.destination=e.EMPTY_OBSERVER,i}return i.create=function(e,t,n){return new m(e,t,n)},i.prototype.next=function(e){this.isStopped?_(s.nextNotification(e),this):this._next(e)},i.prototype.error=function(e){this.isStopped?_(s.errorNotification(e),this):(this.isStopped=!0,this._error(e))},i.prototype.complete=function(){this.isStopped?_(s.COMPLETE_NOTIFICATION,this):(this.isStopped=!0,this._complete())},i.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,n.prototype.unsubscribe.call(this),this.destination=null)},i.prototype._next=function(e){this.destination.next(e)},i.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},i.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},i})(r.Subscription);e.Subscriber=u;var d=Function.prototype.bind;function f(e,t){return d.call(e,t)}var p=(function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){h(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){h(e)}else h(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){h(e)}},e})(),m=(function(e){t(r,e);function r(t,r,a){var o=e.call(this)||this,s;if(n.isFunction(t)||!t)s={next:t??void 0,error:r??void 0,complete:a??void 0};else{var c;o&&i.config.useDeprecatedNextContext?(c=Object.create(t),c.unsubscribe=function(){return o.unsubscribe()},s={next:t.next&&f(t.next,c),error:t.error&&f(t.error,c),complete:t.complete&&f(t.complete,c)}):s=t}return o.destination=new p(s),o}return r})(u);e.SafeSubscriber=m;function h(e){i.config.useDeprecatedSynchronousErrorHandling?l.captureError(e):a.reportUnhandledError(e)}function g(e){throw e}function _(e,t){var n=i.config.onStoppedNotification;n&&c.timeoutProvider.setTimeout(function(){return n(e,t)})}e.EMPTY_OBSERVER={closed:!0,next:o.noop,error:g,complete:o.noop}}}),Pf=I({"../../node_modules/rxjs/dist/cjs/internal/symbol/observable.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.observable=void 0,e.observable=(function(){return typeof Symbol==`function`&&Symbol.observable||`@@observable`})()}}),Ff=I({"../../node_modules/rxjs/dist/cjs/internal/util/identity.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.identity=void 0;function t(e){return e}e.identity=t}}),If=I({"../../node_modules/rxjs/dist/cjs/internal/util/pipe.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.pipeFromArray=e.pipe=void 0;var t=Ff();function n(){return r([...arguments])}e.pipe=n;function r(e){return e.length===0?t.identity:e.length===1?e[0]:function(t){return e.reduce(function(e,t){return t(e)},t)}}e.pipeFromArray=r}}),Lf=I({"../../node_modules/rxjs/dist/cjs/internal/Observable.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Observable=void 0;var t=Nf(),n=Ef(),r=Pf(),i=If(),a=Df(),o=Sf(),s=Mf();e.Observable=(function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,n,r){var i=this,a=u(e)?e:new t.SafeSubscriber(e,n,r);return s.errorContext(function(){var e=i,t=e.operator,n=e.source;a.add(t?t.call(a,n):n?i._subscribe(a):i._trySubscribe(a))}),a},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,n){var r=this;return n=c(n),new n(function(n,i){var a=new t.SafeSubscriber({next:function(t){try{e(t)}catch(e){i(e),a.unsubscribe()}},error:i,complete:n});r.subscribe(a)})},e.prototype._subscribe=function(e){return this.source?.subscribe(e)},e.prototype[r.observable]=function(){return this},e.prototype.pipe=function(){var e=[...arguments];return i.pipeFromArray(e)(this)},e.prototype.toPromise=function(e){var t=this;return e=c(e),new e(function(e,n){var r;t.subscribe(function(e){return r=e},function(e){return n(e)},function(){return e(r)})})},e.create=function(t){return new e(t)},e})();function c(e){return e??a.config.Promise??Promise}function l(e){return e&&o.isFunction(e.next)&&o.isFunction(e.error)&&o.isFunction(e.complete)}function u(e){return e&&e instanceof t.Subscriber||l(e)&&n.isSubscription(e)}}}),L=I({"../../node_modules/rxjs/dist/cjs/internal/util/lift.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.operate=e.hasLift=void 0;var t=Sf();function n(e){return t.isFunction(e?.lift)}e.hasLift=n;function r(e){return function(t){if(n(t))return t.lift(function(t){try{return e(t,this)}catch(e){this.error(e)}});throw TypeError(`Unable to lift unknown Observable type`)}}e.operate=r}}),R=I({"../../node_modules/rxjs/dist/cjs/internal/operators/OperatorSubscriber.js"(e){var t=e&&e.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(e,"__esModule",{value:!0}),e.OperatorSubscriber=e.createOperatorSubscriber=void 0;var n=Nf();function r(e,t,n,r,a){return new i(e,t,n,r,a)}e.createOperatorSubscriber=r;var i=(function(e){t(n,e);function n(t,n,r,i,a,o){var s=e.call(this,t)||this;return s.onFinalize=a,s.shouldUnsubscribe=o,s._next=n?function(e){try{n(e)}catch(e){t.error(e)}}:e.prototype._next,s._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,s._complete=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,s}return n.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((t=this.onFinalize)==null||t.call(this))}},n})(n.Subscriber);e.OperatorSubscriber=i}}),Rf=I({"../../node_modules/rxjs/dist/cjs/internal/operators/refCount.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.refCount=void 0;var t=L(),n=R();function r(){return t.operate(function(e,t){var r=null;e._refCount++;var i=n.createOperatorSubscriber(t,void 0,void 0,void 0,function(){if(!e||e._refCount<=0||0<--e._refCount){r=null;return}var n=e._connection,i=r;r=null,n&&(!i||n===i)&&n.unsubscribe(),t.unsubscribe()});e.subscribe(i),i.closed||(r=e.connect())})}e.refCount=r}}),zf=I({"../../node_modules/rxjs/dist/cjs/internal/observable/ConnectableObservable.js"(e){var t=e&&e.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(e,"__esModule",{value:!0}),e.ConnectableObservable=void 0;var n=Lf(),r=Ef(),i=Rf(),a=R(),o=L();e.ConnectableObservable=(function(e){t(n,e);function n(t,n){var r=e.call(this)||this;return r.source=t,r.subjectFactory=n,r._subject=null,r._refCount=0,r._connection=null,o.hasLift(t)&&(r.lift=t.lift),r}return n.prototype._subscribe=function(e){return this.getSubject().subscribe(e)},n.prototype.getSubject=function(){var e=this._subject;return(!e||e.isStopped)&&(this._subject=this.subjectFactory()),this._subject},n.prototype._teardown=function(){this._refCount=0;var e=this._connection;this._subject=this._connection=null,e?.unsubscribe()},n.prototype.connect=function(){var e=this,t=this._connection;if(!t){t=this._connection=new r.Subscription;var n=this.getSubject();t.add(this.source.subscribe(a.createOperatorSubscriber(n,void 0,function(){e._teardown(),n.complete()},function(t){e._teardown(),n.error(t)},function(){return e._teardown()}))),t.closed&&(this._connection=null,t=r.Subscription.EMPTY)}return t},n.prototype.refCount=function(){return i.refCount()(this)},n})(n.Observable)}}),Bf=I({"../../node_modules/rxjs/dist/cjs/internal/scheduler/performanceTimestampProvider.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.performanceTimestampProvider=void 0,e.performanceTimestampProvider={now:function(){return(e.performanceTimestampProvider.delegate||performance).now()},delegate:void 0}}}),Vf=I({"../../node_modules/rxjs/dist/cjs/internal/scheduler/animationFrameProvider.js"(e){var t=e&&e.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},n=e&&e.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(e,"__esModule",{value:!0}),e.animationFrameProvider=void 0;var r=Ef();e.animationFrameProvider={schedule:function(t){var n=requestAnimationFrame,i=cancelAnimationFrame,a=e.animationFrameProvider.delegate;a&&(n=a.requestAnimationFrame,i=a.cancelAnimationFrame);var o=n(function(e){i=void 0,t(e)});return new r.Subscription(function(){return i?.(o)})},requestAnimationFrame:function(){var r=[...arguments];return(e.animationFrameProvider.delegate?.requestAnimationFrame||requestAnimationFrame).apply(void 0,n([],t(r)))},cancelAnimationFrame:function(){var r=[...arguments];return(e.animationFrameProvider.delegate?.cancelAnimationFrame||cancelAnimationFrame).apply(void 0,n([],t(r)))},delegate:void 0}}}),Hf=I({"../../node_modules/rxjs/dist/cjs/internal/observable/dom/animationFrames.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.animationFrames=void 0;var t=Lf(),n=Bf(),r=Vf();function i(e){return e?a(e):o}e.animationFrames=i;function a(e){return new t.Observable(function(t){var i=e||n.performanceTimestampProvider,a=i.now(),o=0,s=function(){t.closed||(o=r.animationFrameProvider.requestAnimationFrame(function(n){o=0;var r=i.now();t.next({timestamp:e?r:n,elapsed:r-a}),s()}))};return s(),function(){o&&r.animationFrameProvider.cancelAnimationFrame(o)}})}var o=a()}}),Uf=I({"../../node_modules/rxjs/dist/cjs/internal/util/ObjectUnsubscribedError.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ObjectUnsubscribedError=void 0,e.ObjectUnsubscribedError=Cf().createErrorClass(function(e){return function(){e(this),this.name=`ObjectUnsubscribedError`,this.message=`object unsubscribed`}})}}),Wf=I({"../../node_modules/rxjs/dist/cjs/internal/Subject.js"(e){var t=e&&e.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),n=e&&e.__values||function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)};Object.defineProperty(e,"__esModule",{value:!0}),e.AnonymousSubject=e.Subject=void 0;var r=Lf(),i=Ef(),a=Uf(),o=Tf(),s=Mf(),c=(function(e){t(c,e);function c(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return c.prototype.lift=function(e){var t=new l(this,this);return t.operator=e,t},c.prototype._throwIfClosed=function(){if(this.closed)throw new a.ObjectUnsubscribedError},c.prototype.next=function(e){var t=this;s.errorContext(function(){var r,i;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||=Array.from(t.observers);try{for(var a=n(t.currentObservers),o=a.next();!o.done;o=a.next())o.value.next(e)}catch(e){r={error:e}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}}})},c.prototype.error=function(e){var t=this;s.errorContext(function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var n=t.observers;n.length;)n.shift().error(e)}})},c.prototype.complete=function(){var e=this;s.errorContext(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}})},c.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(c.prototype,"observed",{get:function(){return this.observers?.length>0},enumerable:!1,configurable:!0}),c.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},c.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},c.prototype._innerSubscribe=function(e){var t=this,n=this,r=n.hasError,a=n.isStopped,s=n.observers;return r||a?i.EMPTY_SUBSCRIPTION:(this.currentObservers=null,s.push(e),new i.Subscription(function(){t.currentObservers=null,o.arrRemove(s,e)}))},c.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t.thrownError,i=t.isStopped;n?e.error(r):i&&e.complete()},c.prototype.asObservable=function(){var e=new r.Observable;return e.source=this,e},c.create=function(e,t){return new l(e,t)},c})(r.Observable);e.Subject=c;var l=(function(e){t(n,e);function n(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return n.prototype.next=function(e){var t,n;(n=(t=this.destination)?.next)==null||n.call(t,e)},n.prototype.error=function(e){var t,n;(n=(t=this.destination)?.error)==null||n.call(t,e)},n.prototype.complete=function(){var e,t;(t=(e=this.destination)?.complete)==null||t.call(e)},n.prototype._subscribe=function(e){return this.source?.subscribe(e)??i.EMPTY_SUBSCRIPTION},n})(c);e.AnonymousSubject=l}}),Gf=I({"../../node_modules/rxjs/dist/cjs/internal/BehaviorSubject.js"(e){var t=e&&e.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(e,"__esModule",{value:!0}),e.BehaviorSubject=void 0,e.BehaviorSubject=(function(e){t(n,e);function n(t){var n=e.call(this)||this;return n._value=t,n}return Object.defineProperty(n.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),n.prototype._subscribe=function(t){var n=e.prototype._subscribe.call(this,t);return!n.closed&&t.next(this._value),n},n.prototype.getValue=function(){var e=this,t=e.hasError,n=e.thrownError,r=e._value;if(t)throw n;return this._throwIfClosed(),r},n.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},n})(Wf().Subject)}}),Kf=I({"../../node_modules/rxjs/dist/cjs/internal/scheduler/dateTimestampProvider.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.dateTimestampProvider=void 0,e.dateTimestampProvider={now:function(){return(e.dateTimestampProvider.delegate||Date).now()},delegate:void 0}}}),qf=I({"../../node_modules/rxjs/dist/cjs/internal/ReplaySubject.js"(e){var t=e&&e.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(e,"__esModule",{value:!0}),e.ReplaySubject=void 0;var n=Wf(),r=Kf();e.ReplaySubject=(function(e){t(n,e);function n(t,n,i){t===void 0&&(t=1/0),n===void 0&&(n=1/0),i===void 0&&(i=r.dateTimestampProvider);var a=e.call(this)||this;return a._bufferSize=t,a._windowTime=n,a._timestampProvider=i,a._buffer=[],a._infiniteTimeWindow=!0,a._infiniteTimeWindow=n===1/0,a._bufferSize=Math.max(1,t),a._windowTime=Math.max(1,n),a}return n.prototype.next=function(t){var n=this,r=n.isStopped,i=n._buffer,a=n._infiniteTimeWindow,o=n._timestampProvider,s=n._windowTime;r||(i.push(t),!a&&i.push(o.now()+s)),this._trimBuffer(),e.prototype.next.call(this,t)},n.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),n=this,r=n._infiniteTimeWindow,i=n._buffer.slice(),a=0;a<i.length&&!e.closed;a+=r?1:2)e.next(i[a]);return this._checkFinalizedStatuses(e),t},n.prototype._trimBuffer=function(){var e=this,t=e._bufferSize,n=e._timestampProvider,r=e._buffer,i=e._infiniteTimeWindow,a=(i?1:2)*t;if(t<1/0&&a<r.length&&r.splice(0,r.length-a),!i){for(var o=n.now(),s=0,c=1;c<r.length&&r[c]<=o;c+=2)s=c;s&&r.splice(0,s+1)}},n})(n.Subject)}}),Jf=I({"../../node_modules/rxjs/dist/cjs/internal/AsyncSubject.js"(e){var t=e&&e.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(e,"__esModule",{value:!0}),e.AsyncSubject=void 0,e.AsyncSubject=(function(e){t(n,e);function n(){var t=e!==null&&e.apply(this,arguments)||this;return t._value=null,t._hasValue=!1,t._isComplete=!1,t}return n.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t._hasValue,i=t._value,a=t.thrownError,o=t.isStopped,s=t._isComplete;n?e.error(a):(o||s)&&(r&&e.next(i),e.complete())},n.prototype.next=function(e){this.isStopped||(this._value=e,this._hasValue=!0)},n.prototype.complete=function(){var t=this,n=t._hasValue,r=t._value;t._isComplete||(this._isComplete=!0,n&&e.prototype.next.call(this,r),e.prototype.complete.call(this))},n})(Wf().Subject)}}),Yf=I({"../../node_modules/rxjs/dist/cjs/internal/scheduler/Action.js"(e){var t=e&&e.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(e,"__esModule",{value:!0}),e.Action=void 0,e.Action=(function(e){t(n,e);function n(t,n){return e.call(this)||this}return n.prototype.schedule=function(e,t){return t===void 0&&(t=0),this},n})(Ef().Subscription)}}),Xf=I({"../../node_modules/rxjs/dist/cjs/internal/scheduler/intervalProvider.js"(e){var t=e&&e.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},n=e&&e.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(e,"__esModule",{value:!0}),e.intervalProvider=void 0,e.intervalProvider={setInterval:function(r,i){var a=[...arguments].slice(2),o=e.intervalProvider.delegate;return o?.setInterval?o.setInterval.apply(o,n([r,i],t(a))):setInterval.apply(void 0,n([r,i],t(a)))},clearInterval:function(t){return(e.intervalProvider.delegate?.clearInterval||clearInterval)(t)},delegate:void 0}}}),Zf=I({"../../node_modules/rxjs/dist/cjs/internal/scheduler/AsyncAction.js"(e){var t=e&&e.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(e,"__esModule",{value:!0}),e.AsyncAction=void 0;var n=Yf(),r=Xf(),i=Tf();e.AsyncAction=(function(e){t(n,e);function n(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r.pending=!1,r}return n.prototype.schedule=function(e,t){if(t===void 0&&(t=0),this.closed)return this;this.state=e;var n=this.id,r=this.scheduler;return n!=null&&(this.id=this.recycleAsyncId(r,n,t)),this.pending=!0,this.delay=t,this.id=this.id??this.requestAsyncId(r,this.id,t),this},n.prototype.requestAsyncId=function(e,t,n){return n===void 0&&(n=0),r.intervalProvider.setInterval(e.flush.bind(e,this),n)},n.prototype.recycleAsyncId=function(e,t,n){if(n===void 0&&(n=0),n!=null&&this.delay===n&&this.pending===!1)return t;t!=null&&r.intervalProvider.clearInterval(t)},n.prototype.execute=function(e,t){if(this.closed)return Error(`executing a cancelled action`);this.pending=!1;var n=this._execute(e,t);if(n)return n;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},n.prototype._execute=function(e,t){var n=!1,r;try{this.work(e)}catch(e){n=!0,r=e||Error(`Scheduled action threw falsy error`)}if(n)return this.unsubscribe(),r},n.prototype.unsubscribe=function(){if(!this.closed){var t=this,n=t.id,r=t.scheduler,a=r.actions;this.work=this.state=this.scheduler=null,this.pending=!1,i.arrRemove(a,this),n!=null&&(this.id=this.recycleAsyncId(r,n,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},n})(n.Action)}}),Qf=I({"../../node_modules/rxjs/dist/cjs/internal/util/Immediate.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TestTools=e.Immediate=void 0;var t=1,n,r={};function i(e){return e in r?(delete r[e],!0):!1}e.Immediate={setImmediate:function(e){var a=t++;return r[a]=!0,n||=Promise.resolve(),n.then(function(){return i(a)&&e()}),a},clearImmediate:function(e){i(e)}},e.TestTools={pending:function(){return Object.keys(r).length}}}}),$f=I({"../../node_modules/rxjs/dist/cjs/internal/scheduler/immediateProvider.js"(e){var t=e&&e.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},n=e&&e.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(e,"__esModule",{value:!0}),e.immediateProvider=void 0;var r=Qf(),i=r.Immediate.setImmediate,a=r.Immediate.clearImmediate;e.immediateProvider={setImmediate:function(){var r=[...arguments];return(e.immediateProvider.delegate?.setImmediate||i).apply(void 0,n([],t(r)))},clearImmediate:function(t){return(e.immediateProvider.delegate?.clearImmediate||a)(t)},delegate:void 0}}}),ep=I({"../../node_modules/rxjs/dist/cjs/internal/scheduler/AsapAction.js"(e){var t=e&&e.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(e,"__esModule",{value:!0}),e.AsapAction=void 0;var n=Zf(),r=$f();e.AsapAction=(function(e){t(n,e);function n(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return n.prototype.requestAsyncId=function(t,n,i){return i===void 0&&(i=0),i!==null&&i>0?e.prototype.requestAsyncId.call(this,t,n,i):(t.actions.push(this),t._scheduled||=r.immediateProvider.setImmediate(t.flush.bind(t,void 0)))},n.prototype.recycleAsyncId=function(t,n,i){if(i===void 0&&(i=0),i==null?this.delay>0:i>0)return e.prototype.recycleAsyncId.call(this,t,n,i);var a=t.actions;n!=null&&a[a.length-1]?.id!==n&&(r.immediateProvider.clearImmediate(n),t._scheduled===n&&(t._scheduled=void 0))},n})(n.AsyncAction)}}),tp=I({"../../node_modules/rxjs/dist/cjs/internal/Scheduler.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Scheduler=void 0;var t=Kf();e.Scheduler=(function(){function e(t,n){n===void 0&&(n=e.now),this.schedulerActionCtor=t,this.now=n}return e.prototype.schedule=function(e,t,n){return t===void 0&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},e.now=t.dateTimestampProvider.now,e})()}}),np=I({"../../node_modules/rxjs/dist/cjs/internal/scheduler/AsyncScheduler.js"(e){var t=e&&e.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(e,"__esModule",{value:!0}),e.AsyncScheduler=void 0;var n=tp();e.AsyncScheduler=(function(e){t(r,e);function r(t,r){r===void 0&&(r=n.Scheduler.now);var i=e.call(this,t,r)||this;return i.actions=[],i._active=!1,i}return r.prototype.flush=function(e){var t=this.actions;if(this._active){t.push(e);return}var n;this._active=!0;do if(n=e.execute(e.state,e.delay))break;while(e=t.shift());if(this._active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}},r})(n.Scheduler)}}),rp=I({"../../node_modules/rxjs/dist/cjs/internal/scheduler/AsapScheduler.js"(e){var t=e&&e.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(e,"__esModule",{value:!0}),e.AsapScheduler=void 0,e.AsapScheduler=(function(e){t(n,e);function n(){return e!==null&&e.apply(this,arguments)||this}return n.prototype.flush=function(e){this._active=!0;var t=this._scheduled;this._scheduled=void 0;var n=this.actions,r;e||=n.shift();do if(r=e.execute(e.state,e.delay))break;while((e=n[0])&&e.id===t&&n.shift());if(this._active=!1,r){for(;(e=n[0])&&e.id===t&&n.shift();)e.unsubscribe();throw r}},n})(np().AsyncScheduler)}}),ip=I({"../../node_modules/rxjs/dist/cjs/internal/scheduler/asap.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.asap=e.asapScheduler=void 0;var t=ep();e.asapScheduler=new(rp()).AsapScheduler(t.AsapAction),e.asap=e.asapScheduler}}),ap=I({"../../node_modules/rxjs/dist/cjs/internal/scheduler/async.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.async=e.asyncScheduler=void 0;var t=Zf();e.asyncScheduler=new(np()).AsyncScheduler(t.AsyncAction),e.async=e.asyncScheduler}}),op=I({"../../node_modules/rxjs/dist/cjs/internal/scheduler/QueueAction.js"(e){var t=e&&e.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(e,"__esModule",{value:!0}),e.QueueAction=void 0,e.QueueAction=(function(e){t(n,e);function n(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return n.prototype.schedule=function(t,n){return n===void 0&&(n=0),n>0?e.prototype.schedule.call(this,t,n):(this.delay=n,this.state=t,this.scheduler.flush(this),this)},n.prototype.execute=function(t,n){return n>0||this.closed?e.prototype.execute.call(this,t,n):this._execute(t,n)},n.prototype.requestAsyncId=function(t,n,r){return r===void 0&&(r=0),r!=null&&r>0||r==null&&this.delay>0?e.prototype.requestAsyncId.call(this,t,n,r):(t.flush(this),0)},n})(Zf().AsyncAction)}}),sp=I({"../../node_modules/rxjs/dist/cjs/internal/scheduler/QueueScheduler.js"(e){var t=e&&e.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(e,"__esModule",{value:!0}),e.QueueScheduler=void 0,e.QueueScheduler=(function(e){t(n,e);function n(){return e!==null&&e.apply(this,arguments)||this}return n})(np().AsyncScheduler)}}),cp=I({"../../node_modules/rxjs/dist/cjs/internal/scheduler/queue.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.queue=e.queueScheduler=void 0;var t=op();e.queueScheduler=new(sp()).QueueScheduler(t.QueueAction),e.queue=e.queueScheduler}}),lp=I({"../../node_modules/rxjs/dist/cjs/internal/scheduler/AnimationFrameAction.js"(e){var t=e&&e.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(e,"__esModule",{value:!0}),e.AnimationFrameAction=void 0;var n=Zf(),r=Vf();e.AnimationFrameAction=(function(e){t(n,e);function n(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return n.prototype.requestAsyncId=function(t,n,i){return i===void 0&&(i=0),i!==null&&i>0?e.prototype.requestAsyncId.call(this,t,n,i):(t.actions.push(this),t._scheduled||=r.animationFrameProvider.requestAnimationFrame(function(){return t.flush(void 0)}))},n.prototype.recycleAsyncId=function(t,n,i){if(i===void 0&&(i=0),i==null?this.delay>0:i>0)return e.prototype.recycleAsyncId.call(this,t,n,i);var a=t.actions;n!=null&&n===t._scheduled&&a[a.length-1]?.id!==n&&(r.animationFrameProvider.cancelAnimationFrame(n),t._scheduled=void 0)},n})(n.AsyncAction)}}),up=I({"../../node_modules/rxjs/dist/cjs/internal/scheduler/AnimationFrameScheduler.js"(e){var t=e&&e.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(e,"__esModule",{value:!0}),e.AnimationFrameScheduler=void 0,e.AnimationFrameScheduler=(function(e){t(n,e);function n(){return e!==null&&e.apply(this,arguments)||this}return n.prototype.flush=function(e){this._active=!0;var t;e?t=e.id:(t=this._scheduled,this._scheduled=void 0);var n=this.actions,r;e||=n.shift();do if(r=e.execute(e.state,e.delay))break;while((e=n[0])&&e.id===t&&n.shift());if(this._active=!1,r){for(;(e=n[0])&&e.id===t&&n.shift();)e.unsubscribe();throw r}},n})(np().AsyncScheduler)}}),dp=I({"../../node_modules/rxjs/dist/cjs/internal/scheduler/animationFrame.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.animationFrame=e.animationFrameScheduler=void 0;var t=lp();e.animationFrameScheduler=new(up()).AnimationFrameScheduler(t.AnimationFrameAction),e.animationFrame=e.animationFrameScheduler}}),fp=I({"../../node_modules/rxjs/dist/cjs/internal/scheduler/VirtualTimeScheduler.js"(e){var t=e&&e.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(e,"__esModule",{value:!0}),e.VirtualAction=e.VirtualTimeScheduler=void 0;var n=Zf(),r=Ef();e.VirtualTimeScheduler=(function(e){t(n,e);function n(t,n){t===void 0&&(t=i),n===void 0&&(n=1/0);var r=e.call(this,t,function(){return r.frame})||this;return r.maxFrames=n,r.frame=0,r.index=-1,r}return n.prototype.flush=function(){for(var e=this,t=e.actions,n=e.maxFrames,r,i;(i=t[0])&&i.delay<=n&&(t.shift(),this.frame=i.delay,!(r=i.execute(i.state,i.delay))););if(r){for(;i=t.shift();)i.unsubscribe();throw r}},n.frameTimeFactor=10,n})(np().AsyncScheduler);var i=(function(e){t(n,e);function n(t,n,r){r===void 0&&(r=t.index+=1);var i=e.call(this,t,n)||this;return i.scheduler=t,i.work=n,i.index=r,i.active=!0,i.index=t.index=r,i}return n.prototype.schedule=function(t,i){if(i===void 0&&(i=0),Number.isFinite(i)){if(!this.id)return e.prototype.schedule.call(this,t,i);this.active=!1;var a=new n(this.scheduler,this.work);return this.add(a),a.schedule(t,i)}else return r.Subscription.EMPTY},n.prototype.requestAsyncId=function(e,t,r){r===void 0&&(r=0),this.delay=e.frame+r;var i=e.actions;return i.push(this),i.sort(n.sortActions),1},n.prototype.recycleAsyncId=function(e,t,n){n===void 0&&(n=0)},n.prototype._execute=function(t,n){if(this.active===!0)return e.prototype._execute.call(this,t,n)},n.sortActions=function(e,t){return e.delay===t.delay?e.index===t.index?0:e.index>t.index?1:-1:e.delay>t.delay?1:-1},n})(n.AsyncAction);e.VirtualAction=i}}),pp=I({"../../node_modules/rxjs/dist/cjs/internal/observable/empty.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.empty=e.EMPTY=void 0;var t=Lf();e.EMPTY=new t.Observable(function(e){return e.complete()});function n(t){return t?r(t):e.EMPTY}e.empty=n;function r(e){return new t.Observable(function(t){return e.schedule(function(){return t.complete()})})}}}),mp=I({"../../node_modules/rxjs/dist/cjs/internal/util/isScheduler.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isScheduler=void 0;var t=Sf();function n(e){return e&&t.isFunction(e.schedule)}e.isScheduler=n}}),hp=I({"../../node_modules/rxjs/dist/cjs/internal/util/args.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.popNumber=e.popScheduler=e.popResultSelector=void 0;var t=Sf(),n=mp();function r(e){return e[e.length-1]}function i(e){return t.isFunction(r(e))?e.pop():void 0}e.popResultSelector=i;function a(e){return n.isScheduler(r(e))?e.pop():void 0}e.popScheduler=a;function o(e,t){return typeof r(e)==`number`?e.pop():t}e.popNumber=o}}),gp=I({"../../node_modules/rxjs/dist/cjs/internal/util/isArrayLike.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isArrayLike=void 0,e.isArrayLike=(function(e){return e&&typeof e.length==`number`&&typeof e!=`function`})}}),_p=I({"../../node_modules/rxjs/dist/cjs/internal/util/isPromise.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isPromise=void 0;var t=Sf();function n(e){return t.isFunction(e?.then)}e.isPromise=n}}),vp=I({"../../node_modules/rxjs/dist/cjs/internal/util/isInteropObservable.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isInteropObservable=void 0;var t=Pf(),n=Sf();function r(e){return n.isFunction(e[t.observable])}e.isInteropObservable=r}}),yp=I({"../../node_modules/rxjs/dist/cjs/internal/util/isAsyncIterable.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isAsyncIterable=void 0;var t=Sf();function n(e){return Symbol.asyncIterator&&t.isFunction(e?.[Symbol.asyncIterator])}e.isAsyncIterable=n}}),bp=I({"../../node_modules/rxjs/dist/cjs/internal/util/throwUnobservableError.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createInvalidObservableTypeError=void 0;function t(e){return TypeError(`You provided `+(typeof e==`object`&&e?`an invalid object`:`'`+e+`'`)+` where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}e.createInvalidObservableTypeError=t}}),xp=I({"../../node_modules/rxjs/dist/cjs/internal/symbol/iterator.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.iterator=e.getSymbolIterator=void 0;function t(){return typeof Symbol!=`function`||!Symbol.iterator?`@@iterator`:Symbol.iterator}e.getSymbolIterator=t,e.iterator=t()}}),Sp=I({"../../node_modules/rxjs/dist/cjs/internal/util/isIterable.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isIterable=void 0;var t=xp(),n=Sf();function r(e){return n.isFunction(e?.[t.iterator])}e.isIterable=r}}),Cp=I({"../../node_modules/rxjs/dist/cjs/internal/util/isReadableStreamLike.js"(e){var t=e&&e.__generator||function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(o){if(r)throw TypeError(`Generator is already executing.`);for(;n;)try{if(r=1,i&&(a=o[0]&2?i.return:o[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,o[1])).done)return a;switch(i=0,a&&(o=[o[0]&2,a.value]),o[0]){case 0:case 1:a=o;break;case 4:return n.label++,{value:o[1],done:!1};case 5:n.label++,i=o[1],o=[0];continue;case 7:o=n.ops.pop(),n.trys.pop();continue;default:if((a=n.trys,!(a=a.length>0&&a[a.length-1]))&&(o[0]===6||o[0]===2)){n=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){n.label=o[1];break}if(o[0]===6&&n.label<a[1]){n.label=a[1],a=o;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(o);break}a[2]&&n.ops.pop(),n.trys.pop();continue}o=t.call(e,n)}catch(e){o=[6,e],i=0}finally{r=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}},n=e&&e.__await||function(e){return this instanceof n?(this.v=e,this):new n(e)},r=e&&e.__asyncGenerator||function(e,t,r){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var i=r.apply(e,t||[]),a,o=[];return a={},s(`next`),s(`throw`),s(`return`),a[Symbol.asyncIterator]=function(){return this},a;function s(e){i[e]&&(a[e]=function(t){return new Promise(function(n,r){o.push([e,t,n,r])>1||c(e,t)})})}function c(e,t){try{l(i[e](t))}catch(e){f(o[0][3],e)}}function l(e){e.value instanceof n?Promise.resolve(e.value.v).then(u,d):f(o[0][2],e)}function u(e){c(`next`,e)}function d(e){c(`throw`,e)}function f(e,t){e(t),o.shift(),o.length&&c(o[0][0],o[0][1])}};Object.defineProperty(e,"__esModule",{value:!0}),e.isReadableStreamLike=e.readableStreamLikeToAsyncGenerator=void 0;var i=Sf();function a(e){return r(this,arguments,function(){var r,i,a,o;return t(this,function(t){switch(t.label){case 0:r=e.getReader(),t.label=1;case 1:t.trys.push([1,,9,10]),t.label=2;case 2:return[4,n(r.read())];case 3:return i=t.sent(),a=i.value,o=i.done,o?[4,n(void 0)]:[3,5];case 4:return[2,t.sent()];case 5:return[4,n(a)];case 6:return[4,t.sent()];case 7:return t.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}e.readableStreamLikeToAsyncGenerator=a;function o(e){return i.isFunction(e?.getReader)}e.isReadableStreamLike=o}}),z=I({"../../node_modules/rxjs/dist/cjs/internal/observable/innerFrom.js"(e){var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},n=e&&e.__generator||function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(o){if(r)throw TypeError(`Generator is already executing.`);for(;n;)try{if(r=1,i&&(a=o[0]&2?i.return:o[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,o[1])).done)return a;switch(i=0,a&&(o=[o[0]&2,a.value]),o[0]){case 0:case 1:a=o;break;case 4:return n.label++,{value:o[1],done:!1};case 5:n.label++,i=o[1],o=[0];continue;case 7:o=n.ops.pop(),n.trys.pop();continue;default:if((a=n.trys,!(a=a.length>0&&a[a.length-1]))&&(o[0]===6||o[0]===2)){n=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){n.label=o[1];break}if(o[0]===6&&n.label<a[1]){n.label=a[1],a=o;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(o);break}a[2]&&n.ops.pop(),n.trys.pop();continue}o=t.call(e,n)}catch(e){o=[6,e],i=0}finally{r=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}},r=e&&e.__asyncValues||function(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof i==`function`?i(e):e[Symbol.iterator](),n={},r(`next`),r(`throw`),r(`return`),n[Symbol.asyncIterator]=function(){return this},n);function r(t){n[t]=e[t]&&function(n){return new Promise(function(r,i){n=e[t](n),a(r,i,n.done,n.value)})}}function a(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}},i=e&&e.__values||function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)};Object.defineProperty(e,"__esModule",{value:!0}),e.fromReadableStreamLike=e.fromAsyncIterable=e.fromIterable=e.fromPromise=e.fromArrayLike=e.fromInteropObservable=e.innerFrom=void 0;var a=gp(),o=_p(),s=Lf(),c=vp(),l=yp(),u=bp(),d=Sp(),f=Cp(),p=Sf(),m=kf(),h=Pf();function g(e){if(e instanceof s.Observable)return e;if(e!=null){if(c.isInteropObservable(e))return _(e);if(a.isArrayLike(e))return v(e);if(o.isPromise(e))return y(e);if(l.isAsyncIterable(e))return x(e);if(d.isIterable(e))return b(e);if(f.isReadableStreamLike(e))return S(e)}throw u.createInvalidObservableTypeError(e)}e.innerFrom=g;function _(e){return new s.Observable(function(t){var n=e[h.observable]();if(p.isFunction(n.subscribe))return n.subscribe(t);throw TypeError(`Provided object does not correctly implement Symbol.observable`)})}e.fromInteropObservable=_;function v(e){return new s.Observable(function(t){for(var n=0;n<e.length&&!t.closed;n++)t.next(e[n]);t.complete()})}e.fromArrayLike=v;function y(e){return new s.Observable(function(t){e.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,m.reportUnhandledError)})}e.fromPromise=y;function b(e){return new s.Observable(function(t){var n,r;try{for(var a=i(e),o=a.next();!o.done;o=a.next()){var s=o.value;if(t.next(s),t.closed)return}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}t.complete()})}e.fromIterable=b;function x(e){return new s.Observable(function(t){C(e,t).catch(function(e){return t.error(e)})})}e.fromAsyncIterable=x;function S(e){return x(f.readableStreamLikeToAsyncGenerator(e))}e.fromReadableStreamLike=S;function C(e,i){var a,o,s,c;return t(this,void 0,void 0,function(){var t,l;return n(this,function(n){switch(n.label){case 0:n.trys.push([0,5,6,11]),a=r(e),n.label=1;case 1:return[4,a.next()];case 2:if(o=n.sent(),o.done)return[3,4];if(t=o.value,i.next(t),i.closed)return[2];n.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return l=n.sent(),s={error:l},[3,11];case 6:return n.trys.push([6,,9,10]),o&&!o.done&&(c=a.return)?[4,c.call(a)]:[3,8];case 7:n.sent(),n.label=8;case 8:return[3,10];case 9:if(s)throw s.error;return[7];case 10:return[7];case 11:return i.complete(),[2]}})})}}}),wp=I({"../../node_modules/rxjs/dist/cjs/internal/util/executeSchedule.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.executeSchedule=void 0;function t(e,t,n,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var a=t.schedule(function(){n(),i?e.add(this.schedule(null,r)):this.unsubscribe()},r);if(e.add(a),!i)return a}e.executeSchedule=t}}),Tp=I({"../../node_modules/rxjs/dist/cjs/internal/operators/observeOn.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.observeOn=void 0;var t=wp(),n=L(),r=R();function i(e,i){return i===void 0&&(i=0),n.operate(function(n,a){n.subscribe(r.createOperatorSubscriber(a,function(n){return t.executeSchedule(a,e,function(){return a.next(n)},i)},function(){return t.executeSchedule(a,e,function(){return a.complete()},i)},function(n){return t.executeSchedule(a,e,function(){return a.error(n)},i)}))})}e.observeOn=i}}),Ep=I({"../../node_modules/rxjs/dist/cjs/internal/operators/subscribeOn.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.subscribeOn=void 0;var t=L();function n(e,n){return n===void 0&&(n=0),t.operate(function(t,r){r.add(e.schedule(function(){return t.subscribe(r)},n))})}e.subscribeOn=n}}),Dp=I({"../../node_modules/rxjs/dist/cjs/internal/scheduled/scheduleObservable.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.scheduleObservable=void 0;var t=z(),n=Tp(),r=Ep();function i(e,i){return t.innerFrom(e).pipe(r.subscribeOn(i),n.observeOn(i))}e.scheduleObservable=i}}),Op=I({"../../node_modules/rxjs/dist/cjs/internal/scheduled/schedulePromise.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.schedulePromise=void 0;var t=z(),n=Tp(),r=Ep();function i(e,i){return t.innerFrom(e).pipe(r.subscribeOn(i),n.observeOn(i))}e.schedulePromise=i}}),kp=I({"../../node_modules/rxjs/dist/cjs/internal/scheduled/scheduleArray.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.scheduleArray=void 0;var t=Lf();function n(e,n){return new t.Observable(function(t){var r=0;return n.schedule(function(){r===e.length?t.complete():(t.next(e[r++]),t.closed||this.schedule())})})}e.scheduleArray=n}}),Ap=I({"../../node_modules/rxjs/dist/cjs/internal/scheduled/scheduleIterable.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.scheduleIterable=void 0;var t=Lf(),n=xp(),r=Sf(),i=wp();function a(e,a){return new t.Observable(function(t){var o;return i.executeSchedule(t,a,function(){o=e[n.iterator](),i.executeSchedule(t,a,function(){var e,n,r;try{e=o.next(),n=e.value,r=e.done}catch(e){t.error(e);return}r?t.complete():t.next(n)},0,!0)}),function(){return r.isFunction(o?.return)&&o.return()}})}e.scheduleIterable=a}}),jp=I({"../../node_modules/rxjs/dist/cjs/internal/scheduled/scheduleAsyncIterable.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.scheduleAsyncIterable=void 0;var t=Lf(),n=wp();function r(e,r){if(!e)throw Error(`Iterable cannot be null`);return new t.Observable(function(t){n.executeSchedule(t,r,function(){var i=e[Symbol.asyncIterator]();n.executeSchedule(t,r,function(){i.next().then(function(e){e.done?t.complete():t.next(e.value)})},0,!0)})})}e.scheduleAsyncIterable=r}}),Mp=I({"../../node_modules/rxjs/dist/cjs/internal/scheduled/scheduleReadableStreamLike.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.scheduleReadableStreamLike=void 0;var t=jp(),n=Cp();function r(e,r){return t.scheduleAsyncIterable(n.readableStreamLikeToAsyncGenerator(e),r)}e.scheduleReadableStreamLike=r}}),Np=I({"../../node_modules/rxjs/dist/cjs/internal/scheduled/scheduled.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.scheduled=void 0;var t=Dp(),n=Op(),r=kp(),i=Ap(),a=jp(),o=vp(),s=_p(),c=gp(),l=Sp(),u=yp(),d=bp(),f=Cp(),p=Mp();function m(e,m){if(e!=null){if(o.isInteropObservable(e))return t.scheduleObservable(e,m);if(c.isArrayLike(e))return r.scheduleArray(e,m);if(s.isPromise(e))return n.schedulePromise(e,m);if(u.isAsyncIterable(e))return a.scheduleAsyncIterable(e,m);if(l.isIterable(e))return i.scheduleIterable(e,m);if(f.isReadableStreamLike(e))return p.scheduleReadableStreamLike(e,m)}throw d.createInvalidObservableTypeError(e)}e.scheduled=m}}),Pp=I({"../../node_modules/rxjs/dist/cjs/internal/observable/from.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.from=void 0;var t=Np(),n=z();function r(e,r){return r?t.scheduled(e,r):n.innerFrom(e)}e.from=r}}),Fp=I({"../../node_modules/rxjs/dist/cjs/internal/observable/of.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.of=void 0;var t=hp(),n=Pp();function r(){var e=[...arguments],r=t.popScheduler(e);return n.from(e,r)}e.of=r}}),Ip=I({"../../node_modules/rxjs/dist/cjs/internal/observable/throwError.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.throwError=void 0;var t=Lf(),n=Sf();function r(e,r){var i=n.isFunction(e)?e:function(){return e},a=function(e){return e.error(i())};return new t.Observable(r?function(e){return r.schedule(a,0,e)}:a)}e.throwError=r}}),Lp=I({"../../node_modules/rxjs/dist/cjs/internal/Notification.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.observeNotification=e.Notification=e.NotificationKind=void 0;var t=pp(),n=Fp(),r=Ip(),i=Sf();(function(e){e.NEXT=`N`,e.ERROR=`E`,e.COMPLETE=`C`})(e.NotificationKind||={}),e.Notification=(function(){function e(e,t,n){this.kind=e,this.value=t,this.error=n,this.hasValue=e===`N`}return e.prototype.observe=function(e){return a(this,e)},e.prototype.do=function(e,t,n){var r=this,i=r.kind,a=r.value,o=r.error;return i===`N`?e?.(a):i===`E`?t?.(o):n?.()},e.prototype.accept=function(e,t,n){return i.isFunction(e?.next)?this.observe(e):this.do(e,t,n)},e.prototype.toObservable=function(){var e=this,i=e.kind,a=e.value,o=e.error,s=i===`N`?n.of(a):i===`E`?r.throwError(function(){return o}):i===`C`?t.EMPTY:0;if(!s)throw TypeError(`Unexpected notification kind `+i);return s},e.createNext=function(t){return new e(`N`,t)},e.createError=function(t){return new e(`E`,void 0,t)},e.createComplete=function(){return e.completeNotification},e.completeNotification=new e(`C`),e})();function a(e,t){var n,r,i,a=e,o=a.kind,s=a.value,c=a.error;if(typeof o!=`string`)throw TypeError(`Invalid notification, missing "kind"`);o===`N`?(n=t.next)==null||n.call(t,s):o===`E`?(r=t.error)==null||r.call(t,c):(i=t.complete)==null||i.call(t)}e.observeNotification=a}}),Rp=I({"../../node_modules/rxjs/dist/cjs/internal/util/isObservable.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isObservable=void 0;var t=Lf(),n=Sf();function r(e){return!!e&&(e instanceof t.Observable||n.isFunction(e.lift)&&n.isFunction(e.subscribe))}e.isObservable=r}}),zp=I({"../../node_modules/rxjs/dist/cjs/internal/util/EmptyError.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.EmptyError=void 0,e.EmptyError=Cf().createErrorClass(function(e){return function(){e(this),this.name=`EmptyError`,this.message=`no elements in sequence`}})}}),Bp=I({"../../node_modules/rxjs/dist/cjs/internal/lastValueFrom.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.lastValueFrom=void 0;var t=zp();function n(e,n){var r=typeof n==`object`;return new Promise(function(i,a){var o=!1,s;e.subscribe({next:function(e){s=e,o=!0},error:a,complete:function(){o?i(s):r?i(n.defaultValue):a(new t.EmptyError)}})})}e.lastValueFrom=n}}),Vp=I({"../../node_modules/rxjs/dist/cjs/internal/firstValueFrom.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.firstValueFrom=void 0;var t=zp(),n=Nf();function r(e,r){var i=typeof r==`object`;return new Promise(function(a,o){var s=new n.SafeSubscriber({next:function(e){a(e),s.unsubscribe()},error:o,complete:function(){i?a(r.defaultValue):o(new t.EmptyError)}});e.subscribe(s)})}e.firstValueFrom=r}}),Hp=I({"../../node_modules/rxjs/dist/cjs/internal/util/ArgumentOutOfRangeError.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ArgumentOutOfRangeError=void 0,e.ArgumentOutOfRangeError=Cf().createErrorClass(function(e){return function(){e(this),this.name=`ArgumentOutOfRangeError`,this.message=`argument out of range`}})}}),Up=I({"../../node_modules/rxjs/dist/cjs/internal/util/NotFoundError.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.NotFoundError=void 0,e.NotFoundError=Cf().createErrorClass(function(e){return function(t){e(this),this.name=`NotFoundError`,this.message=t}})}}),Wp=I({"../../node_modules/rxjs/dist/cjs/internal/util/SequenceError.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SequenceError=void 0,e.SequenceError=Cf().createErrorClass(function(e){return function(t){e(this),this.name=`SequenceError`,this.message=t}})}}),Gp=I({"../../node_modules/rxjs/dist/cjs/internal/util/isDate.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isValidDate=void 0;function t(e){return e instanceof Date&&!isNaN(e)}e.isValidDate=t}}),Kp=I({"../../node_modules/rxjs/dist/cjs/internal/operators/timeout.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.timeout=e.TimeoutError=void 0;var t=ap(),n=Gp(),r=L(),i=z(),a=Cf(),o=R(),s=wp();e.TimeoutError=a.createErrorClass(function(e){return function(t){t===void 0&&(t=null),e(this),this.message=`Timeout has occurred`,this.name=`TimeoutError`,this.info=t}});function c(e,a){var c=n.isValidDate(e)?{first:e}:typeof e==`number`?{each:e}:e,u=c.first,d=c.each,f=c.with,p=f===void 0?l:f,m=c.scheduler,h=m===void 0?a??t.asyncScheduler:m,g=c.meta,_=g===void 0?null:g;if(u==null&&d==null)throw TypeError(`No timeout provided.`);return r.operate(function(e,t){var n,r,a=null,c=0,l=function(e){r=s.executeSchedule(t,h,function(){try{n.unsubscribe(),i.innerFrom(p({meta:_,lastValue:a,seen:c})).subscribe(t)}catch(e){t.error(e)}},e)};n=e.subscribe(o.createOperatorSubscriber(t,function(e){r?.unsubscribe(),c++,t.next(a=e),d>0&&l(d)},void 0,void 0,function(){r?.closed||r?.unsubscribe(),a=null})),!c&&l(u==null?d:typeof u==`number`?u:+u-h.now())})}e.timeout=c;function l(t){throw new e.TimeoutError(t)}}}),qp=I({"../../node_modules/rxjs/dist/cjs/internal/operators/map.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.map=void 0;var t=L(),n=R();function r(e,r){return t.operate(function(t,i){var a=0;t.subscribe(n.createOperatorSubscriber(i,function(t){i.next(e.call(r,t,a++))}))})}e.map=r}}),Jp=I({"../../node_modules/rxjs/dist/cjs/internal/util/mapOneOrManyArgs.js"(e){var t=e&&e.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},n=e&&e.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(e,"__esModule",{value:!0}),e.mapOneOrManyArgs=void 0;var r=qp(),i=Array.isArray;function a(e,r){return i(r)?e.apply(void 0,n([],t(r))):e(r)}function o(e){return r.map(function(t){return a(e,t)})}e.mapOneOrManyArgs=o}}),Yp=I({"../../node_modules/rxjs/dist/cjs/internal/observable/bindCallbackInternals.js"(e){var t=e&&e.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},n=e&&e.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(e,"__esModule",{value:!0}),e.bindCallbackInternals=void 0;var r=mp(),i=Lf(),a=Ep(),o=Jp(),s=Tp(),c=Jf();function l(e,u,d,f){if(d)if(r.isScheduler(d))f=d;else return function(){var t=[...arguments];return l(e,u,f).apply(this,t).pipe(o.mapOneOrManyArgs(d))};return f?function(){var t=[...arguments];return l(e,u).apply(this,t).pipe(a.subscribeOn(f),s.observeOn(f))}:function(){for(var r=this,a=[],o=0;o<arguments.length;o++)a[o]=arguments[o];var s=new c.AsyncSubject,l=!0;return new i.Observable(function(i){var o=s.subscribe(i);if(l){l=!1;var c=!1,d=!1;u.apply(r,n(n([],t(a)),[function(){var t=[...arguments];if(e){var n=t.shift();if(n!=null){s.error(n);return}}s.next(1<t.length?t:t[0]),d=!0,c&&s.complete()}])),d&&s.complete(),c=!0}return o})}}e.bindCallbackInternals=l}}),Xp=I({"../../node_modules/rxjs/dist/cjs/internal/observable/bindCallback.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.bindCallback=void 0;var t=Yp();function n(e,n,r){return t.bindCallbackInternals(!1,e,n,r)}e.bindCallback=n}}),Zp=I({"../../node_modules/rxjs/dist/cjs/internal/observable/bindNodeCallback.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.bindNodeCallback=void 0;var t=Yp();function n(e,n,r){return t.bindCallbackInternals(!0,e,n,r)}e.bindNodeCallback=n}}),Qp=I({"../../node_modules/rxjs/dist/cjs/internal/util/argsArgArrayOrObject.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.argsArgArrayOrObject=void 0;var t=Array.isArray,n=Object.getPrototypeOf,r=Object.prototype,i=Object.keys;function a(e){if(e.length===1){var n=e[0];if(t(n))return{args:n,keys:null};if(o(n)){var r=i(n);return{args:r.map(function(e){return n[e]}),keys:r}}}return{args:e,keys:null}}e.argsArgArrayOrObject=a;function o(e){return e&&typeof e==`object`&&n(e)===r}}}),$p=I({"../../node_modules/rxjs/dist/cjs/internal/util/createObject.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createObject=void 0;function t(e,t){return e.reduce(function(e,n,r){return e[n]=t[r],e},{})}e.createObject=t}}),em=I({"../../node_modules/rxjs/dist/cjs/internal/observable/combineLatest.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.combineLatestInit=e.combineLatest=void 0;var t=Lf(),n=Qp(),r=Pp(),i=Ff(),a=Jp(),o=hp(),s=$p(),c=R(),l=wp();function u(){var e=[...arguments],c=o.popScheduler(e),l=o.popResultSelector(e),u=n.argsArgArrayOrObject(e),f=u.args,p=u.keys;if(f.length===0)return r.from([],c);var m=new t.Observable(d(f,c,p?function(e){return s.createObject(p,e)}:i.identity));return l?m.pipe(a.mapOneOrManyArgs(l)):m}e.combineLatest=u;function d(e,t,n){return n===void 0&&(n=i.identity),function(i){f(t,function(){for(var a=e.length,o=Array(a),s=a,l=a,u=function(a){f(t,function(){var u=r.from(e[a],t),d=!1;u.subscribe(c.createOperatorSubscriber(i,function(e){o[a]=e,d||(d=!0,l--),l||i.next(n(o.slice()))},function(){--s||i.complete()}))},i)},d=0;d<a;d++)u(d)},i)}}e.combineLatestInit=d;function f(e,t,n){e?l.executeSchedule(n,e,t):t()}}}),tm=I({"../../node_modules/rxjs/dist/cjs/internal/operators/mergeInternals.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.mergeInternals=void 0;var t=z(),n=wp(),r=R();function i(e,i,a,o,s,c,l,u){var d=[],f=0,p=0,m=!1,h=function(){m&&!d.length&&!f&&i.complete()},g=function(e){return f<o?_(e):d.push(e)},_=function(e){c&&i.next(e),f++;var u=!1;t.innerFrom(a(e,p++)).subscribe(r.createOperatorSubscriber(i,function(e){s?.(e),c?g(e):i.next(e)},function(){u=!0},void 0,function(){if(u)try{f--;for(var e=function(){var e=d.shift();l?n.executeSchedule(i,l,function(){return _(e)}):_(e)};d.length&&f<o;)e();h()}catch(e){i.error(e)}}))};return e.subscribe(r.createOperatorSubscriber(i,g,function(){m=!0,h()})),function(){u?.()}}e.mergeInternals=i}}),nm=I({"../../node_modules/rxjs/dist/cjs/internal/operators/mergeMap.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.mergeMap=void 0;var t=qp(),n=z(),r=L(),i=tm(),a=Sf();function o(e,s,c){return c===void 0&&(c=1/0),a.isFunction(s)?o(function(r,i){return t.map(function(e,t){return s(r,e,i,t)})(n.innerFrom(e(r,i)))},c):(typeof s==`number`&&(c=s),r.operate(function(t,n){return i.mergeInternals(t,n,e,c)}))}e.mergeMap=o}}),rm=I({"../../node_modules/rxjs/dist/cjs/internal/operators/mergeAll.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.mergeAll=void 0;var t=nm(),n=Ff();function r(e){return e===void 0&&(e=1/0),t.mergeMap(n.identity,e)}e.mergeAll=r}}),im=I({"../../node_modules/rxjs/dist/cjs/internal/operators/concatAll.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.concatAll=void 0;var t=rm();function n(){return t.mergeAll(1)}e.concatAll=n}}),am=I({"../../node_modules/rxjs/dist/cjs/internal/observable/concat.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.concat=void 0;var t=im(),n=hp(),r=Pp();function i(){var e=[...arguments];return t.concatAll()(r.from(e,n.popScheduler(e)))}e.concat=i}}),om=I({"../../node_modules/rxjs/dist/cjs/internal/observable/defer.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.defer=void 0;var t=Lf(),n=z();function r(e){return new t.Observable(function(t){n.innerFrom(e()).subscribe(t)})}e.defer=r}}),sm=I({"../../node_modules/rxjs/dist/cjs/internal/observable/connectable.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.connectable=void 0;var t=Wf(),n=Lf(),r=om(),i={connector:function(){return new t.Subject},resetOnDisconnect:!0};function a(e,t){t===void 0&&(t=i);var a=null,o=t.connector,s=t.resetOnDisconnect,c=s===void 0?!0:s,l=o(),u=new n.Observable(function(e){return l.subscribe(e)});return u.connect=function(){return(!a||a.closed)&&(a=r.defer(function(){return e}).subscribe(l),c&&a.add(function(){return l=o()})),a},u}e.connectable=a}}),cm=I({"../../node_modules/rxjs/dist/cjs/internal/observable/forkJoin.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.forkJoin=void 0;var t=Lf(),n=Qp(),r=z(),i=hp(),a=R(),o=Jp(),s=$p();function c(){var e=[...arguments],c=i.popResultSelector(e),l=n.argsArgArrayOrObject(e),u=l.args,d=l.keys,f=new t.Observable(function(e){var t=u.length;if(!t){e.complete();return}for(var n=Array(t),i=t,o=t,c=function(t){var c=!1;r.innerFrom(u[t]).subscribe(a.createOperatorSubscriber(e,function(e){c||(c=!0,o--),n[t]=e},function(){return i--},void 0,function(){(!i||!c)&&(o||e.next(d?s.createObject(d,n):n),e.complete())}))},l=0;l<t;l++)c(l)});return c?f.pipe(o.mapOneOrManyArgs(c)):f}e.forkJoin=c}}),lm=I({"../../node_modules/rxjs/dist/cjs/internal/observable/fromEvent.js"(e){var t=e&&e.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a};Object.defineProperty(e,"__esModule",{value:!0}),e.fromEvent=void 0;var n=z(),r=Lf(),i=nm(),a=gp(),o=Sf(),s=Jp(),c=[`addListener`,`removeListener`],l=[`addEventListener`,`removeEventListener`],u=[`on`,`off`];function d(e,g,_,v){if(o.isFunction(_)&&(v=_,_=void 0),v)return d(e,g,_).pipe(s.mapOneOrManyArgs(v));var y=t(h(e)?l.map(function(t){return function(n){return e[t](g,n,_)}}):p(e)?c.map(f(e,g)):m(e)?u.map(f(e,g)):[],2),b=y[0],x=y[1];if(!b&&a.isArrayLike(e))return i.mergeMap(function(e){return d(e,g,_)})(n.innerFrom(e));if(!b)throw TypeError(`Invalid event target`);return new r.Observable(function(e){var t=function(){var t=[...arguments];return e.next(1<t.length?t:t[0])};return b(t),function(){return x(t)}})}e.fromEvent=d;function f(e,t){return function(n){return function(r){return e[n](t,r)}}}function p(e){return o.isFunction(e.addListener)&&o.isFunction(e.removeListener)}function m(e){return o.isFunction(e.on)&&o.isFunction(e.off)}function h(e){return o.isFunction(e.addEventListener)&&o.isFunction(e.removeEventListener)}}}),um=I({"../../node_modules/rxjs/dist/cjs/internal/observable/fromEventPattern.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.fromEventPattern=void 0;var t=Lf(),n=Sf(),r=Jp();function i(e,a,o){return o?i(e,a).pipe(r.mapOneOrManyArgs(o)):new t.Observable(function(t){var r=function(){var e=[...arguments];return t.next(e.length===1?e[0]:e)},i=e(r);return n.isFunction(a)?function(){return a(r,i)}:void 0})}e.fromEventPattern=i}}),dm=I({"../../node_modules/rxjs/dist/cjs/internal/observable/generate.js"(e){var t=e&&e.__generator||function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(o){if(r)throw TypeError(`Generator is already executing.`);for(;n;)try{if(r=1,i&&(a=o[0]&2?i.return:o[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,o[1])).done)return a;switch(i=0,a&&(o=[o[0]&2,a.value]),o[0]){case 0:case 1:a=o;break;case 4:return n.label++,{value:o[1],done:!1};case 5:n.label++,i=o[1],o=[0];continue;case 7:o=n.ops.pop(),n.trys.pop();continue;default:if((a=n.trys,!(a=a.length>0&&a[a.length-1]))&&(o[0]===6||o[0]===2)){n=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){n.label=o[1];break}if(o[0]===6&&n.label<a[1]){n.label=a[1],a=o;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(o);break}a[2]&&n.ops.pop(),n.trys.pop();continue}o=t.call(e,n)}catch(e){o=[6,e],i=0}finally{r=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}};Object.defineProperty(e,"__esModule",{value:!0}),e.generate=void 0;var n=Ff(),r=mp(),i=om(),a=Ap();function o(e,o,s,c,l){var u,d,f,p;arguments.length===1?(u=e,p=u.initialState,o=u.condition,s=u.iterate,d=u.resultSelector,f=d===void 0?n.identity:d,l=u.scheduler):(p=e,!c||r.isScheduler(c)?(f=n.identity,l=c):f=c);function m(){var e;return t(this,function(t){switch(t.label){case 0:e=p,t.label=1;case 1:return!o||o(e)?[4,f(e)]:[3,4];case 2:t.sent(),t.label=3;case 3:return e=s(e),[3,1];case 4:return[2]}})}return i.defer(l?function(){return a.scheduleIterable(m(),l)}:m)}e.generate=o}}),fm=I({"../../node_modules/rxjs/dist/cjs/internal/observable/iif.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.iif=void 0;var t=om();function n(e,n,r){return t.defer(function(){return e()?n:r})}e.iif=n}}),pm=I({"../../node_modules/rxjs/dist/cjs/internal/observable/timer.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.timer=void 0;var t=Lf(),n=ap(),r=mp(),i=Gp();function a(e,a,o){e===void 0&&(e=0),o===void 0&&(o=n.async);var s=-1;return a!=null&&(r.isScheduler(a)?o=a:s=a),new t.Observable(function(t){var n=i.isValidDate(e)?+e-o.now():e;n<0&&(n=0);var r=0;return o.schedule(function(){t.closed||(t.next(r++),0<=s?this.schedule(void 0,s):t.complete())},n)})}e.timer=a}}),mm=I({"../../node_modules/rxjs/dist/cjs/internal/observable/interval.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.interval=void 0;var t=ap(),n=pm();function r(e,r){return e===void 0&&(e=0),r===void 0&&(r=t.asyncScheduler),e<0&&(e=0),n.timer(e,e,r)}e.interval=r}}),hm=I({"../../node_modules/rxjs/dist/cjs/internal/observable/merge.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.merge=void 0;var t=rm(),n=z(),r=pp(),i=hp(),a=Pp();function o(){var e=[...arguments],o=i.popScheduler(e),s=i.popNumber(e,1/0),c=e;return c.length?c.length===1?n.innerFrom(c[0]):t.mergeAll(s)(a.from(c,o)):r.EMPTY}e.merge=o}}),gm=I({"../../node_modules/rxjs/dist/cjs/internal/observable/never.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.never=e.NEVER=void 0;var t=Lf(),n=Af();e.NEVER=new t.Observable(n.noop);function r(){return e.NEVER}e.never=r}}),_m=I({"../../node_modules/rxjs/dist/cjs/internal/util/argsOrArgArray.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.argsOrArgArray=void 0;var t=Array.isArray;function n(e){return e.length===1&&t(e[0])?e[0]:e}e.argsOrArgArray=n}}),vm=I({"../../node_modules/rxjs/dist/cjs/internal/observable/onErrorResumeNext.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.onErrorResumeNext=void 0;var t=Lf(),n=_m(),r=R(),i=Af(),a=z();function o(){var e=[...arguments],o=n.argsOrArgArray(e);return new t.Observable(function(e){var t=0,n=function(){if(t<o.length){var s=void 0;try{s=a.innerFrom(o[t++])}catch{n();return}var c=new r.OperatorSubscriber(e,void 0,i.noop,i.noop);s.subscribe(c),c.add(n)}else e.complete()};n()})}e.onErrorResumeNext=o}}),ym=I({"../../node_modules/rxjs/dist/cjs/internal/observable/pairs.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.pairs=void 0;var t=Pp();function n(e,n){return t.from(Object.entries(e),n)}e.pairs=n}}),bm=I({"../../node_modules/rxjs/dist/cjs/internal/util/not.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.not=void 0;function t(e,t){return function(n,r){return!e.call(t,n,r)}}e.not=t}}),xm=I({"../../node_modules/rxjs/dist/cjs/internal/operators/filter.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.filter=void 0;var t=L(),n=R();function r(e,r){return t.operate(function(t,i){var a=0;t.subscribe(n.createOperatorSubscriber(i,function(t){return e.call(r,t,a++)&&i.next(t)}))})}e.filter=r}}),Sm=I({"../../node_modules/rxjs/dist/cjs/internal/observable/partition.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.partition=void 0;var t=bm(),n=xm(),r=z();function i(e,i,a){return[n.filter(i,a)(r.innerFrom(e)),n.filter(t.not(i,a))(r.innerFrom(e))]}e.partition=i}}),Cm=I({"../../node_modules/rxjs/dist/cjs/internal/observable/race.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.raceInit=e.race=void 0;var t=Lf(),n=z(),r=_m(),i=R();function a(){var e=[...arguments];return e=r.argsOrArgArray(e),e.length===1?n.innerFrom(e[0]):new t.Observable(o(e))}e.race=a;function o(e){return function(t){for(var r=[],a=function(a){r.push(n.innerFrom(e[a]).subscribe(i.createOperatorSubscriber(t,function(e){if(r){for(var n=0;n<r.length;n++)n!==a&&r[n].unsubscribe();r=null}t.next(e)})))},o=0;r&&!t.closed&&o<e.length;o++)a(o)}}e.raceInit=o}}),wm=I({"../../node_modules/rxjs/dist/cjs/internal/observable/range.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.range=void 0;var t=Lf(),n=pp();function r(e,r,i){if(r??(r=e,e=0),r<=0)return n.EMPTY;var a=r+e;return new t.Observable(i?function(t){var n=e;return i.schedule(function(){n<a?(t.next(n++),this.schedule()):t.complete()})}:function(t){for(var n=e;n<a&&!t.closed;)t.next(n++);t.complete()})}e.range=r}}),Tm=I({"../../node_modules/rxjs/dist/cjs/internal/observable/using.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.using=void 0;var t=Lf(),n=z(),r=pp();function i(e,i){return new t.Observable(function(t){var a=e(),o=i(a);return(o?n.innerFrom(o):r.EMPTY).subscribe(t),function(){a&&a.unsubscribe()}})}e.using=i}}),Em=I({"../../node_modules/rxjs/dist/cjs/internal/observable/zip.js"(e){var t=e&&e.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},n=e&&e.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(e,"__esModule",{value:!0}),e.zip=void 0;var r=Lf(),i=z(),a=_m(),o=pp(),s=R(),c=hp();function l(){var e=[...arguments],l=c.popResultSelector(e),u=a.argsOrArgArray(e);return u.length?new r.Observable(function(e){var r=u.map(function(){return[]}),a=u.map(function(){return!1});e.add(function(){r=a=null});for(var o=function(o){i.innerFrom(u[o]).subscribe(s.createOperatorSubscriber(e,function(i){if(r[o].push(i),r.every(function(e){return e.length})){var s=r.map(function(e){return e.shift()});e.next(l?l.apply(void 0,n([],t(s))):s),r.some(function(e,t){return!e.length&&a[t]})&&e.complete()}},function(){a[o]=!0,!r[o].length&&e.complete()}))},c=0;!e.closed&&c<u.length;c++)o(c);return function(){r=a=null}}):o.EMPTY}e.zip=l}}),Dm=I({"../../node_modules/rxjs/dist/cjs/internal/types.js"(e){Object.defineProperty(e,"__esModule",{value:!0})}}),Om=I({"../../node_modules/rxjs/dist/cjs/internal/operators/audit.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.audit=void 0;var t=L(),n=z(),r=R();function i(e){return t.operate(function(t,i){var a=!1,o=null,s=null,c=!1,l=function(){if(s?.unsubscribe(),s=null,a){a=!1;var e=o;o=null,i.next(e)}c&&i.complete()},u=function(){s=null,c&&i.complete()};t.subscribe(r.createOperatorSubscriber(i,function(t){a=!0,o=t,s||n.innerFrom(e(t)).subscribe(s=r.createOperatorSubscriber(i,l,u))},function(){c=!0,(!a||!s||s.closed)&&i.complete()}))})}e.audit=i}}),km=I({"../../node_modules/rxjs/dist/cjs/internal/operators/auditTime.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.auditTime=void 0;var t=ap(),n=Om(),r=pm();function i(e,i){return i===void 0&&(i=t.asyncScheduler),n.audit(function(){return r.timer(e,i)})}e.auditTime=i}}),Am=I({"../../node_modules/rxjs/dist/cjs/internal/operators/buffer.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.buffer=void 0;var t=L(),n=Af(),r=R(),i=z();function a(e){return t.operate(function(t,a){var o=[];return t.subscribe(r.createOperatorSubscriber(a,function(e){return o.push(e)},function(){a.next(o),a.complete()})),i.innerFrom(e).subscribe(r.createOperatorSubscriber(a,function(){var e=o;o=[],a.next(e)},n.noop)),function(){o=null}})}e.buffer=a}}),jm=I({"../../node_modules/rxjs/dist/cjs/internal/operators/bufferCount.js"(e){var t=e&&e.__values||function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)};Object.defineProperty(e,"__esModule",{value:!0}),e.bufferCount=void 0;var n=L(),r=R(),i=Tf();function a(e,a){return a===void 0&&(a=null),a??=e,n.operate(function(n,o){var s=[],c=0;n.subscribe(r.createOperatorSubscriber(o,function(n){var r,l,u,d,f=null;c++%a===0&&s.push([]);try{for(var p=t(s),m=p.next();!m.done;m=p.next()){var h=m.value;h.push(n),e<=h.length&&(f??=[],f.push(h))}}catch(e){r={error:e}}finally{try{m&&!m.done&&(l=p.return)&&l.call(p)}finally{if(r)throw r.error}}if(f)try{for(var g=t(f),_=g.next();!_.done;_=g.next()){var h=_.value;i.arrRemove(s,h),o.next(h)}}catch(e){u={error:e}}finally{try{_&&!_.done&&(d=g.return)&&d.call(g)}finally{if(u)throw u.error}}},function(){var e,n;try{for(var r=t(s),i=r.next();!i.done;i=r.next()){var a=i.value;o.next(a)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}o.complete()},void 0,function(){s=null}))})}e.bufferCount=a}}),Mm=I({"../../node_modules/rxjs/dist/cjs/internal/operators/bufferTime.js"(e){var t=e&&e.__values||function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)};Object.defineProperty(e,"__esModule",{value:!0}),e.bufferTime=void 0;var n=Ef(),r=L(),i=R(),a=Tf(),o=ap(),s=hp(),c=wp();function l(e){var l=[...arguments].slice(1),u=s.popScheduler(l)??o.asyncScheduler,d=l[0]??null,f=l[1]||1/0;return r.operate(function(r,o){var s=[],l=!1,p=function(e){var t=e.buffer;e.subs.unsubscribe(),a.arrRemove(s,e),o.next(t),l&&m()},m=function(){if(s){var t=new n.Subscription;o.add(t);var r={buffer:[],subs:t};s.push(r),c.executeSchedule(t,u,function(){return p(r)},e)}};d!==null&&d>=0?c.executeSchedule(o,u,m,d,!0):l=!0,m();var h=i.createOperatorSubscriber(o,function(e){var n,r,i=s.slice();try{for(var a=t(i),o=a.next();!o.done;o=a.next()){var c=o.value,l=c.buffer;l.push(e),f<=l.length&&p(c)}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}},function(){for(;s?.length;)o.next(s.shift().buffer);h?.unsubscribe(),o.complete(),o.unsubscribe()},void 0,function(){return s=null});r.subscribe(h)})}e.bufferTime=l}}),Nm=I({"../../node_modules/rxjs/dist/cjs/internal/operators/bufferToggle.js"(e){var t=e&&e.__values||function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)};Object.defineProperty(e,"__esModule",{value:!0}),e.bufferToggle=void 0;var n=Ef(),r=L(),i=z(),a=R(),o=Af(),s=Tf();function c(e,c){return r.operate(function(r,l){var u=[];i.innerFrom(e).subscribe(a.createOperatorSubscriber(l,function(e){var t=[];u.push(t);var r=new n.Subscription;r.add(i.innerFrom(c(e)).subscribe(a.createOperatorSubscriber(l,function(){s.arrRemove(u,t),l.next(t),r.unsubscribe()},o.noop)))},o.noop)),r.subscribe(a.createOperatorSubscriber(l,function(e){var n,r;try{for(var i=t(u),a=i.next();!a.done;a=i.next())a.value.push(e)}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},function(){for(;u.length>0;)l.next(u.shift());l.complete()}))})}e.bufferToggle=c}}),Pm=I({"../../node_modules/rxjs/dist/cjs/internal/operators/bufferWhen.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.bufferWhen=void 0;var t=L(),n=Af(),r=R(),i=z();function a(e){return t.operate(function(t,a){var o=null,s=null,c=function(){s?.unsubscribe();var t=o;o=[],t&&a.next(t),i.innerFrom(e()).subscribe(s=r.createOperatorSubscriber(a,c,n.noop))};c(),t.subscribe(r.createOperatorSubscriber(a,function(e){return o?.push(e)},function(){o&&a.next(o),a.complete()},void 0,function(){return o=s=null}))})}e.bufferWhen=a}}),Fm=I({"../../node_modules/rxjs/dist/cjs/internal/operators/catchError.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.catchError=void 0;var t=z(),n=R(),r=L();function i(e){return r.operate(function(r,a){var o=null,s=!1,c;o=r.subscribe(n.createOperatorSubscriber(a,void 0,void 0,function(n){c=t.innerFrom(e(n,i(e)(r))),o?(o.unsubscribe(),o=null,c.subscribe(a)):s=!0})),s&&(o.unsubscribe(),o=null,c.subscribe(a))})}e.catchError=i}}),Im=I({"../../node_modules/rxjs/dist/cjs/internal/operators/scanInternals.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.scanInternals=void 0;var t=R();function n(e,n,r,i,a){return function(o,s){var c=r,l=n,u=0;o.subscribe(t.createOperatorSubscriber(s,function(t){var n=u++;l=c?e(l,t,n):(c=!0,t),i&&s.next(l)},a&&(function(){c&&s.next(l),s.complete()})))}}e.scanInternals=n}}),Lm=I({"../../node_modules/rxjs/dist/cjs/internal/operators/reduce.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.reduce=void 0;var t=Im(),n=L();function r(e,r){return n.operate(t.scanInternals(e,r,arguments.length>=2,!1,!0))}e.reduce=r}}),Rm=I({"../../node_modules/rxjs/dist/cjs/internal/operators/toArray.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.toArray=void 0;var t=Lm(),n=L(),r=function(e,t){return e.push(t),e};function i(){return n.operate(function(e,n){t.reduce(r,[])(e).subscribe(n)})}e.toArray=i}}),zm=I({"../../node_modules/rxjs/dist/cjs/internal/operators/joinAllInternals.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.joinAllInternals=void 0;var t=Ff(),n=Jp(),r=If(),i=nm(),a=Rm();function o(e,o){return r.pipe(a.toArray(),i.mergeMap(function(t){return e(t)}),o?n.mapOneOrManyArgs(o):t.identity)}e.joinAllInternals=o}}),Bm=I({"../../node_modules/rxjs/dist/cjs/internal/operators/combineLatestAll.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.combineLatestAll=void 0;var t=em(),n=zm();function r(e){return n.joinAllInternals(t.combineLatest,e)}e.combineLatestAll=r}}),Vm=I({"../../node_modules/rxjs/dist/cjs/internal/operators/combineAll.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.combineAll=void 0,e.combineAll=Bm().combineLatestAll}}),Hm=I({"../../node_modules/rxjs/dist/cjs/internal/operators/combineLatest.js"(e){var t=e&&e.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},n=e&&e.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(e,"__esModule",{value:!0}),e.combineLatest=void 0;var r=em(),i=L(),a=_m(),o=Jp(),s=If(),c=hp();function l(){var e=[...arguments],u=c.popResultSelector(e);return u?s.pipe(l.apply(void 0,n([],t(e))),o.mapOneOrManyArgs(u)):i.operate(function(i,o){r.combineLatestInit(n([i],t(a.argsOrArgArray(e))))(o)})}e.combineLatest=l}}),Um=I({"../../node_modules/rxjs/dist/cjs/internal/operators/combineLatestWith.js"(e){var t=e&&e.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},n=e&&e.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(e,"__esModule",{value:!0}),e.combineLatestWith=void 0;var r=Hm();function i(){var e=[...arguments];return r.combineLatest.apply(void 0,n([],t(e)))}e.combineLatestWith=i}}),Wm=I({"../../node_modules/rxjs/dist/cjs/internal/operators/concatMap.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.concatMap=void 0;var t=nm(),n=Sf();function r(e,r){return n.isFunction(r)?t.mergeMap(e,r,1):t.mergeMap(e,1)}e.concatMap=r}}),Gm=I({"../../node_modules/rxjs/dist/cjs/internal/operators/concatMapTo.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.concatMapTo=void 0;var t=Wm(),n=Sf();function r(e,r){return n.isFunction(r)?t.concatMap(function(){return e},r):t.concatMap(function(){return e})}e.concatMapTo=r}}),Km=I({"../../node_modules/rxjs/dist/cjs/internal/operators/concat.js"(e){var t=e&&e.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},n=e&&e.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(e,"__esModule",{value:!0}),e.concat=void 0;var r=L(),i=im(),a=hp(),o=Pp();function s(){var e=[...arguments],s=a.popScheduler(e);return r.operate(function(r,a){i.concatAll()(o.from(n([r],t(e)),s)).subscribe(a)})}e.concat=s}}),qm=I({"../../node_modules/rxjs/dist/cjs/internal/operators/concatWith.js"(e){var t=e&&e.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},n=e&&e.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(e,"__esModule",{value:!0}),e.concatWith=void 0;var r=Km();function i(){var e=[...arguments];return r.concat.apply(void 0,n([],t(e)))}e.concatWith=i}}),Jm=I({"../../node_modules/rxjs/dist/cjs/internal/observable/fromSubscribable.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.fromSubscribable=void 0;var t=Lf();function n(e){return new t.Observable(function(t){return e.subscribe(t)})}e.fromSubscribable=n}}),Ym=I({"../../node_modules/rxjs/dist/cjs/internal/operators/connect.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.connect=void 0;var t=Wf(),n=z(),r=L(),i=Jm(),a={connector:function(){return new t.Subject}};function o(e,t){t===void 0&&(t=a);var o=t.connector;return r.operate(function(t,r){var a=o();n.innerFrom(e(i.fromSubscribable(a))).subscribe(r),r.add(t.subscribe(a))})}e.connect=o}}),Xm=I({"../../node_modules/rxjs/dist/cjs/internal/operators/count.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.count=void 0;var t=Lm();function n(e){return t.reduce(function(t,n,r){return!e||e(n,r)?t+1:t},0)}e.count=n}}),Zm=I({"../../node_modules/rxjs/dist/cjs/internal/operators/debounce.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.debounce=void 0;var t=L(),n=Af(),r=R(),i=z();function a(e){return t.operate(function(t,a){var o=!1,s=null,c=null,l=function(){if(c?.unsubscribe(),c=null,o){o=!1;var e=s;s=null,a.next(e)}};t.subscribe(r.createOperatorSubscriber(a,function(t){c?.unsubscribe(),o=!0,s=t,c=r.createOperatorSubscriber(a,l,n.noop),i.innerFrom(e(t)).subscribe(c)},function(){l(),a.complete()},void 0,function(){s=c=null}))})}e.debounce=a}}),Qm=I({"../../node_modules/rxjs/dist/cjs/internal/operators/debounceTime.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.debounceTime=void 0;var t=ap(),n=L(),r=R();function i(e,i){return i===void 0&&(i=t.asyncScheduler),n.operate(function(t,n){var a=null,o=null,s=null,c=function(){if(a){a.unsubscribe(),a=null;var e=o;o=null,n.next(e)}};function l(){var t=s+e,r=i.now();if(r<t){a=this.schedule(void 0,t-r),n.add(a);return}c()}t.subscribe(r.createOperatorSubscriber(n,function(t){o=t,s=i.now(),a||(a=i.schedule(l,e),n.add(a))},function(){c(),n.complete()},void 0,function(){o=a=null}))})}e.debounceTime=i}}),$m=I({"../../node_modules/rxjs/dist/cjs/internal/operators/defaultIfEmpty.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.defaultIfEmpty=void 0;var t=L(),n=R();function r(e){return t.operate(function(t,r){var i=!1;t.subscribe(n.createOperatorSubscriber(r,function(e){i=!0,r.next(e)},function(){i||r.next(e),r.complete()}))})}e.defaultIfEmpty=r}}),eh=I({"../../node_modules/rxjs/dist/cjs/internal/operators/take.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.take=void 0;var t=pp(),n=L(),r=R();function i(e){return e<=0?function(){return t.EMPTY}:n.operate(function(t,n){var i=0;t.subscribe(r.createOperatorSubscriber(n,function(t){++i<=e&&(n.next(t),e<=i&&n.complete())}))})}e.take=i}}),th=I({"../../node_modules/rxjs/dist/cjs/internal/operators/ignoreElements.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ignoreElements=void 0;var t=L(),n=R(),r=Af();function i(){return t.operate(function(e,t){e.subscribe(n.createOperatorSubscriber(t,r.noop))})}e.ignoreElements=i}}),nh=I({"../../node_modules/rxjs/dist/cjs/internal/operators/mapTo.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.mapTo=void 0;var t=qp();function n(e){return t.map(function(){return e})}e.mapTo=n}}),rh=I({"../../node_modules/rxjs/dist/cjs/internal/operators/delayWhen.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.delayWhen=void 0;var t=am(),n=eh(),r=th(),i=nh(),a=nm(),o=z();function s(e,c){return c?function(i){return t.concat(c.pipe(n.take(1),r.ignoreElements()),i.pipe(s(e)))}:a.mergeMap(function(t,r){return o.innerFrom(e(t,r)).pipe(n.take(1),i.mapTo(t))})}e.delayWhen=s}}),ih=I({"../../node_modules/rxjs/dist/cjs/internal/operators/delay.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.delay=void 0;var t=ap(),n=rh(),r=pm();function i(e,i){i===void 0&&(i=t.asyncScheduler);var a=r.timer(e,i);return n.delayWhen(function(){return a})}e.delay=i}}),ah=I({"../../node_modules/rxjs/dist/cjs/internal/operators/dematerialize.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.dematerialize=void 0;var t=Lp(),n=L(),r=R();function i(){return n.operate(function(e,n){e.subscribe(r.createOperatorSubscriber(n,function(e){return t.observeNotification(e,n)}))})}e.dematerialize=i}}),oh=I({"../../node_modules/rxjs/dist/cjs/internal/operators/distinct.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.distinct=void 0;var t=L(),n=R(),r=Af(),i=z();function a(e,a){return t.operate(function(t,o){var s=new Set;t.subscribe(n.createOperatorSubscriber(o,function(t){var n=e?e(t):t;s.has(n)||(s.add(n),o.next(t))})),a&&i.innerFrom(a).subscribe(n.createOperatorSubscriber(o,function(){return s.clear()},r.noop))})}e.distinct=a}}),sh=I({"../../node_modules/rxjs/dist/cjs/internal/operators/distinctUntilChanged.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.distinctUntilChanged=void 0;var t=Ff(),n=L(),r=R();function i(e,i){return i===void 0&&(i=t.identity),e??=a,n.operate(function(t,n){var a,o=!0;t.subscribe(r.createOperatorSubscriber(n,function(t){var r=i(t);(o||!e(a,r))&&(o=!1,a=r,n.next(t))}))})}e.distinctUntilChanged=i;function a(e,t){return e===t}}}),ch=I({"../../node_modules/rxjs/dist/cjs/internal/operators/distinctUntilKeyChanged.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.distinctUntilKeyChanged=void 0;var t=sh();function n(e,n){return t.distinctUntilChanged(function(t,r){return n?n(t[e],r[e]):t[e]===r[e]})}e.distinctUntilKeyChanged=n}}),lh=I({"../../node_modules/rxjs/dist/cjs/internal/operators/throwIfEmpty.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.throwIfEmpty=void 0;var t=zp(),n=L(),r=R();function i(e){return e===void 0&&(e=a),n.operate(function(t,n){var i=!1;t.subscribe(r.createOperatorSubscriber(n,function(e){i=!0,n.next(e)},function(){return i?n.complete():n.error(e())}))})}e.throwIfEmpty=i;function a(){return new t.EmptyError}}}),uh=I({"../../node_modules/rxjs/dist/cjs/internal/operators/elementAt.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.elementAt=void 0;var t=Hp(),n=xm(),r=lh(),i=$m(),a=eh();function o(e,o){if(e<0)throw new t.ArgumentOutOfRangeError;var s=arguments.length>=2;return function(c){return c.pipe(n.filter(function(t,n){return n===e}),a.take(1),s?i.defaultIfEmpty(o):r.throwIfEmpty(function(){return new t.ArgumentOutOfRangeError}))}}e.elementAt=o}}),dh=I({"../../node_modules/rxjs/dist/cjs/internal/operators/endWith.js"(e){var t=e&&e.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},n=e&&e.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(e,"__esModule",{value:!0}),e.endWith=void 0;var r=am(),i=Fp();function a(){var e=[...arguments];return function(a){return r.concat(a,i.of.apply(void 0,n([],t(e))))}}e.endWith=a}}),fh=I({"../../node_modules/rxjs/dist/cjs/internal/operators/every.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.every=void 0;var t=L(),n=R();function r(e,r){return t.operate(function(t,i){var a=0;t.subscribe(n.createOperatorSubscriber(i,function(n){e.call(r,n,a++,t)||(i.next(!1),i.complete())},function(){i.next(!0),i.complete()}))})}e.every=r}}),ph=I({"../../node_modules/rxjs/dist/cjs/internal/operators/exhaustMap.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.exhaustMap=void 0;var t=qp(),n=z(),r=L(),i=R();function a(e,o){return o?function(r){return r.pipe(a(function(r,i){return n.innerFrom(e(r,i)).pipe(t.map(function(e,t){return o(r,e,i,t)}))}))}:r.operate(function(t,r){var a=0,o=null,s=!1;t.subscribe(i.createOperatorSubscriber(r,function(t){o||(o=i.createOperatorSubscriber(r,void 0,function(){o=null,s&&r.complete()}),n.innerFrom(e(t,a++)).subscribe(o))},function(){s=!0,!o&&r.complete()}))})}e.exhaustMap=a}}),mh=I({"../../node_modules/rxjs/dist/cjs/internal/operators/exhaustAll.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.exhaustAll=void 0;var t=ph(),n=Ff();function r(){return t.exhaustMap(n.identity)}e.exhaustAll=r}}),hh=I({"../../node_modules/rxjs/dist/cjs/internal/operators/exhaust.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.exhaust=void 0,e.exhaust=mh().exhaustAll}}),gh=I({"../../node_modules/rxjs/dist/cjs/internal/operators/expand.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.expand=void 0;var t=L(),n=tm();function r(e,r,i){return r===void 0&&(r=1/0),r=(r||0)<1?1/0:r,t.operate(function(t,a){return n.mergeInternals(t,a,e,r,void 0,!0,i)})}e.expand=r}}),_h=I({"../../node_modules/rxjs/dist/cjs/internal/operators/finalize.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.finalize=void 0;var t=L();function n(e){return t.operate(function(t,n){try{t.subscribe(n)}finally{n.add(e)}})}e.finalize=n}}),vh=I({"../../node_modules/rxjs/dist/cjs/internal/operators/find.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createFind=e.find=void 0;var t=L(),n=R();function r(e,n){return t.operate(i(e,n,`value`))}e.find=r;function i(e,t,r){var i=r===`index`;return function(r,a){var o=0;r.subscribe(n.createOperatorSubscriber(a,function(n){var s=o++;e.call(t,n,s,r)&&(a.next(i?s:n),a.complete())},function(){a.next(i?-1:void 0),a.complete()}))}}e.createFind=i}}),yh=I({"../../node_modules/rxjs/dist/cjs/internal/operators/findIndex.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.findIndex=void 0;var t=L(),n=vh();function r(e,r){return t.operate(n.createFind(e,r,`index`))}e.findIndex=r}}),bh=I({"../../node_modules/rxjs/dist/cjs/internal/operators/first.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.first=void 0;var t=zp(),n=xm(),r=eh(),i=$m(),a=lh(),o=Ff();function s(e,s){var c=arguments.length>=2;return function(l){return l.pipe(e?n.filter(function(t,n){return e(t,n,l)}):o.identity,r.take(1),c?i.defaultIfEmpty(s):a.throwIfEmpty(function(){return new t.EmptyError}))}}e.first=s}}),xh=I({"../../node_modules/rxjs/dist/cjs/internal/operators/groupBy.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.groupBy=void 0;var t=Lf(),n=z(),r=Wf(),i=L(),a=R();function o(e,o,s,c){return i.operate(function(i,l){var u;!o||typeof o==`function`?u=o:(s=o.duration,u=o.element,c=o.connector);var d=new Map,f=function(e){d.forEach(e),e(l)},p=function(e){return f(function(t){return t.error(e)})},m=0,h=!1,g=new a.OperatorSubscriber(l,function(t){try{var i=e(t),o=d.get(i);if(!o){d.set(i,o=c?c():new r.Subject);var f=_(i,o);if(l.next(f),s){var m=a.createOperatorSubscriber(o,function(){o.complete(),m?.unsubscribe()},void 0,void 0,function(){return d.delete(i)});g.add(n.innerFrom(s(f)).subscribe(m))}}o.next(u?u(t):t)}catch(e){p(e)}},function(){return f(function(e){return e.complete()})},p,function(){return d.clear()},function(){return h=!0,m===0});i.subscribe(g);function _(e,n){var r=new t.Observable(function(e){m++;var t=n.subscribe(e);return function(){t.unsubscribe(),--m===0&&h&&g.unsubscribe()}});return r.key=e,r}})}e.groupBy=o}}),Sh=I({"../../node_modules/rxjs/dist/cjs/internal/operators/isEmpty.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isEmpty=void 0;var t=L(),n=R();function r(){return t.operate(function(e,t){e.subscribe(n.createOperatorSubscriber(t,function(){t.next(!1),t.complete()},function(){t.next(!0),t.complete()}))})}e.isEmpty=r}}),Ch=I({"../../node_modules/rxjs/dist/cjs/internal/operators/takeLast.js"(e){var t=e&&e.__values||function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)};Object.defineProperty(e,"__esModule",{value:!0}),e.takeLast=void 0;var n=pp(),r=L(),i=R();function a(e){return e<=0?function(){return n.EMPTY}:r.operate(function(n,r){var a=[];n.subscribe(i.createOperatorSubscriber(r,function(t){a.push(t),e<a.length&&a.shift()},function(){var e,n;try{for(var i=t(a),o=i.next();!o.done;o=i.next()){var s=o.value;r.next(s)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}r.complete()},void 0,function(){a=null}))})}e.takeLast=a}}),wh=I({"../../node_modules/rxjs/dist/cjs/internal/operators/last.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.last=void 0;var t=zp(),n=xm(),r=Ch(),i=lh(),a=$m(),o=Ff();function s(e,s){var c=arguments.length>=2;return function(l){return l.pipe(e?n.filter(function(t,n){return e(t,n,l)}):o.identity,r.takeLast(1),c?a.defaultIfEmpty(s):i.throwIfEmpty(function(){return new t.EmptyError}))}}e.last=s}}),Th=I({"../../node_modules/rxjs/dist/cjs/internal/operators/materialize.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.materialize=void 0;var t=Lp(),n=L(),r=R();function i(){return n.operate(function(e,n){e.subscribe(r.createOperatorSubscriber(n,function(e){n.next(t.Notification.createNext(e))},function(){n.next(t.Notification.createComplete()),n.complete()},function(e){n.next(t.Notification.createError(e)),n.complete()}))})}e.materialize=i}}),Eh=I({"../../node_modules/rxjs/dist/cjs/internal/operators/max.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.max=void 0;var t=Lm(),n=Sf();function r(e){return t.reduce(n.isFunction(e)?function(t,n){return e(t,n)>0?t:n}:function(e,t){return e>t?e:t})}e.max=r}}),Dh=I({"../../node_modules/rxjs/dist/cjs/internal/operators/flatMap.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.flatMap=void 0,e.flatMap=nm().mergeMap}}),Oh=I({"../../node_modules/rxjs/dist/cjs/internal/operators/mergeMapTo.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.mergeMapTo=void 0;var t=nm(),n=Sf();function r(e,r,i){return i===void 0&&(i=1/0),n.isFunction(r)?t.mergeMap(function(){return e},r,i):(typeof r==`number`&&(i=r),t.mergeMap(function(){return e},i))}e.mergeMapTo=r}}),kh=I({"../../node_modules/rxjs/dist/cjs/internal/operators/mergeScan.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.mergeScan=void 0;var t=L(),n=tm();function r(e,r,i){return i===void 0&&(i=1/0),t.operate(function(t,a){var o=r;return n.mergeInternals(t,a,function(t,n){return e(o,t,n)},i,function(e){o=e},!1,void 0,function(){return o=null})})}e.mergeScan=r}}),Ah=I({"../../node_modules/rxjs/dist/cjs/internal/operators/merge.js"(e){var t=e&&e.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},n=e&&e.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(e,"__esModule",{value:!0}),e.merge=void 0;var r=L(),i=rm(),a=hp(),o=Pp();function s(){var e=[...arguments],s=a.popScheduler(e),c=a.popNumber(e,1/0);return r.operate(function(r,a){i.mergeAll(c)(o.from(n([r],t(e)),s)).subscribe(a)})}e.merge=s}}),jh=I({"../../node_modules/rxjs/dist/cjs/internal/operators/mergeWith.js"(e){var t=e&&e.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},n=e&&e.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(e,"__esModule",{value:!0}),e.mergeWith=void 0;var r=Ah();function i(){var e=[...arguments];return r.merge.apply(void 0,n([],t(e)))}e.mergeWith=i}}),Mh=I({"../../node_modules/rxjs/dist/cjs/internal/operators/min.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.min=void 0;var t=Lm(),n=Sf();function r(e){return t.reduce(n.isFunction(e)?function(t,n){return e(t,n)<0?t:n}:function(e,t){return e<t?e:t})}e.min=r}}),Nh=I({"../../node_modules/rxjs/dist/cjs/internal/operators/multicast.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.multicast=void 0;var t=zf(),n=Sf(),r=Ym();function i(e,i){var a=n.isFunction(e)?e:function(){return e};return n.isFunction(i)?r.connect(i,{connector:a}):function(e){return new t.ConnectableObservable(e,a)}}e.multicast=i}}),Ph=I({"../../node_modules/rxjs/dist/cjs/internal/operators/onErrorResumeNextWith.js"(e){var t=e&&e.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},n=e&&e.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(e,"__esModule",{value:!0}),e.onErrorResumeNext=e.onErrorResumeNextWith=void 0;var r=_m(),i=vm();function a(){var e=[...arguments],a=r.argsOrArgArray(e);return function(e){return i.onErrorResumeNext.apply(void 0,n([e],t(a)))}}e.onErrorResumeNextWith=a,e.onErrorResumeNext=a}}),Fh=I({"../../node_modules/rxjs/dist/cjs/internal/operators/pairwise.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.pairwise=void 0;var t=L(),n=R();function r(){return t.operate(function(e,t){var r,i=!1;e.subscribe(n.createOperatorSubscriber(t,function(e){var n=r;r=e,i&&t.next([n,e]),i=!0}))})}e.pairwise=r}}),Ih=I({"../../node_modules/rxjs/dist/cjs/internal/operators/pluck.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.pluck=void 0;var t=qp();function n(){var e=[...arguments],n=e.length;if(n===0)throw Error(`list of properties cannot be empty.`);return t.map(function(t){for(var r=t,i=0;i<n;i++){var a=r?.[e[i]];if(a!==void 0)r=a;else return}return r})}e.pluck=n}}),Lh=I({"../../node_modules/rxjs/dist/cjs/internal/operators/publish.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.publish=void 0;var t=Wf(),n=Nh(),r=Ym();function i(e){return e?function(t){return r.connect(e)(t)}:function(e){return n.multicast(new t.Subject)(e)}}e.publish=i}}),Rh=I({"../../node_modules/rxjs/dist/cjs/internal/operators/publishBehavior.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.publishBehavior=void 0;var t=Gf(),n=zf();function r(e){return function(r){var i=new t.BehaviorSubject(e);return new n.ConnectableObservable(r,function(){return i})}}e.publishBehavior=r}}),zh=I({"../../node_modules/rxjs/dist/cjs/internal/operators/publishLast.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.publishLast=void 0;var t=Jf(),n=zf();function r(){return function(e){var r=new t.AsyncSubject;return new n.ConnectableObservable(e,function(){return r})}}e.publishLast=r}}),Bh=I({"../../node_modules/rxjs/dist/cjs/internal/operators/publishReplay.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.publishReplay=void 0;var t=qf(),n=Nh(),r=Sf();function i(e,i,a,o){a&&!r.isFunction(a)&&(o=a);var s=r.isFunction(a)?a:void 0;return function(r){return n.multicast(new t.ReplaySubject(e,i,o),s)(r)}}e.publishReplay=i}}),Vh=I({"../../node_modules/rxjs/dist/cjs/internal/operators/raceWith.js"(e){var t=e&&e.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},n=e&&e.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(e,"__esModule",{value:!0}),e.raceWith=void 0;var r=Cm(),i=L(),a=Ff();function o(){var e=[...arguments];return e.length?i.operate(function(i,a){r.raceInit(n([i],t(e)))(a)}):a.identity}e.raceWith=o}}),Hh=I({"../../node_modules/rxjs/dist/cjs/internal/operators/repeat.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.repeat=void 0;var t=pp(),n=L(),r=R(),i=z(),a=pm();function o(e){var o,s=1/0,c;return e!=null&&(typeof e==`object`?(o=e.count,s=o===void 0?1/0:o,c=e.delay):s=e),s<=0?function(){return t.EMPTY}:n.operate(function(e,t){var n=0,o,l=function(){if(o?.unsubscribe(),o=null,c!=null){var e=typeof c==`number`?a.timer(c):i.innerFrom(c(n)),s=r.createOperatorSubscriber(t,function(){s.unsubscribe(),u()});e.subscribe(s)}else u()},u=function(){var i=!1;o=e.subscribe(r.createOperatorSubscriber(t,void 0,function(){++n<s?o?l():i=!0:t.complete()})),i&&l()};u()})}e.repeat=o}}),Uh=I({"../../node_modules/rxjs/dist/cjs/internal/operators/repeatWhen.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.repeatWhen=void 0;var t=z(),n=Wf(),r=L(),i=R();function a(e){return r.operate(function(r,a){var o,s=!1,c,l=!1,u=!1,d=function(){return u&&l&&(a.complete(),!0)},f=function(){return c||(c=new n.Subject,t.innerFrom(e(c)).subscribe(i.createOperatorSubscriber(a,function(){o?p():s=!0},function(){l=!0,d()}))),c},p=function(){u=!1,o=r.subscribe(i.createOperatorSubscriber(a,void 0,function(){u=!0,!d()&&f().next()})),s&&(o.unsubscribe(),o=null,s=!1,p())};p()})}e.repeatWhen=a}}),Wh=I({"../../node_modules/rxjs/dist/cjs/internal/operators/retry.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.retry=void 0;var t=L(),n=R(),r=Ff(),i=pm(),a=z();function o(e){e===void 0&&(e=1/0);var o=e&&typeof e==`object`?e:{count:e},s=o.count,c=s===void 0?1/0:s,l=o.delay,u=o.resetOnSuccess,d=u===void 0?!1:u;return c<=0?r.identity:t.operate(function(e,t){var r=0,o,s=function(){var u=!1;o=e.subscribe(n.createOperatorSubscriber(t,function(e){d&&(r=0),t.next(e)},void 0,function(e){if(r++<c){var d=function(){o?(o.unsubscribe(),o=null,s()):u=!0};if(l!=null){var f=typeof l==`number`?i.timer(l):a.innerFrom(l(e,r)),p=n.createOperatorSubscriber(t,function(){p.unsubscribe(),d()},function(){t.complete()});f.subscribe(p)}else d()}else t.error(e)})),u&&(o.unsubscribe(),o=null,s())};s()})}e.retry=o}}),Gh=I({"../../node_modules/rxjs/dist/cjs/internal/operators/retryWhen.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.retryWhen=void 0;var t=z(),n=Wf(),r=L(),i=R();function a(e){return r.operate(function(r,a){var o,s=!1,c,l=function(){o=r.subscribe(i.createOperatorSubscriber(a,void 0,void 0,function(r){c||(c=new n.Subject,t.innerFrom(e(c)).subscribe(i.createOperatorSubscriber(a,function(){return o?l():s=!0}))),c&&c.next(r)})),s&&(o.unsubscribe(),o=null,s=!1,l())};l()})}e.retryWhen=a}}),Kh=I({"../../node_modules/rxjs/dist/cjs/internal/operators/sample.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.sample=void 0;var t=z(),n=L(),r=Af(),i=R();function a(e){return n.operate(function(n,a){var o=!1,s=null;n.subscribe(i.createOperatorSubscriber(a,function(e){o=!0,s=e})),t.innerFrom(e).subscribe(i.createOperatorSubscriber(a,function(){if(o){o=!1;var e=s;s=null,a.next(e)}},r.noop))})}e.sample=a}}),qh=I({"../../node_modules/rxjs/dist/cjs/internal/operators/sampleTime.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.sampleTime=void 0;var t=ap(),n=Kh(),r=mm();function i(e,i){return i===void 0&&(i=t.asyncScheduler),n.sample(r.interval(e,i))}e.sampleTime=i}}),Jh=I({"../../node_modules/rxjs/dist/cjs/internal/operators/scan.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.scan=void 0;var t=L(),n=Im();function r(e,r){return t.operate(n.scanInternals(e,r,arguments.length>=2,!0))}e.scan=r}}),Yh=I({"../../node_modules/rxjs/dist/cjs/internal/operators/sequenceEqual.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.sequenceEqual=void 0;var t=L(),n=R(),r=z();function i(e,i){return i===void 0&&(i=function(e,t){return e===t}),t.operate(function(t,o){var s=a(),c=a(),l=function(e){o.next(e),o.complete()},u=function(e,t){var r=n.createOperatorSubscriber(o,function(n){var r=t.buffer,a=t.complete;r.length===0?a?l(!1):e.buffer.push(n):!i(n,r.shift())&&l(!1)},function(){e.complete=!0;var n=t.complete,i=t.buffer;n&&l(i.length===0),r?.unsubscribe()});return r};t.subscribe(u(s,c)),r.innerFrom(e).subscribe(u(c,s))})}e.sequenceEqual=i;function a(){return{buffer:[],complete:!1}}}}),Xh=I({"../../node_modules/rxjs/dist/cjs/internal/operators/share.js"(e){var t=e&&e.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},n=e&&e.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(e,"__esModule",{value:!0}),e.share=void 0;var r=z(),i=Wf(),a=Nf(),o=L();function s(e){e===void 0&&(e={});var t=e.connector,n=t===void 0?function(){return new i.Subject}:t,s=e.resetOnError,l=s===void 0?!0:s,u=e.resetOnComplete,d=u===void 0?!0:u,f=e.resetOnRefCountZero,p=f===void 0?!0:f;return function(e){var t,i,s,u=0,f=!1,m=!1,h=function(){i?.unsubscribe(),i=void 0},g=function(){h(),t=s=void 0,f=m=!1},_=function(){var e=t;g(),e?.unsubscribe()};return o.operate(function(e,o){u++,!m&&!f&&h();var v=s??=n();o.add(function(){u--,u===0&&!m&&!f&&(i=c(_,p))}),v.subscribe(o),!t&&u>0&&(t=new a.SafeSubscriber({next:function(e){return v.next(e)},error:function(e){m=!0,h(),i=c(g,l,e),v.error(e)},complete:function(){f=!0,h(),i=c(g,d),v.complete()}}),r.innerFrom(e).subscribe(t))})(e)}}e.share=s;function c(e,i){var o=[...arguments].slice(2);if(i===!0){e();return}if(i!==!1){var s=new a.SafeSubscriber({next:function(){s.unsubscribe(),e()}});return r.innerFrom(i.apply(void 0,n([],t(o)))).subscribe(s)}}}}),Zh=I({"../../node_modules/rxjs/dist/cjs/internal/operators/shareReplay.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.shareReplay=void 0;var t=qf(),n=Xh();function r(e,r,i){var a,o,s,c,l=!1;return e&&typeof e==`object`?(a=e.bufferSize,c=a===void 0?1/0:a,o=e.windowTime,r=o===void 0?1/0:o,s=e.refCount,l=s===void 0?!1:s,i=e.scheduler):c=e??1/0,n.share({connector:function(){return new t.ReplaySubject(c,r,i)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:l})}e.shareReplay=r}}),Qh=I({"../../node_modules/rxjs/dist/cjs/internal/operators/single.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.single=void 0;var t=zp(),n=Wp(),r=Up(),i=L(),a=R();function o(e){return i.operate(function(i,o){var s=!1,c,l=!1,u=0;i.subscribe(a.createOperatorSubscriber(o,function(t){l=!0,(!e||e(t,u++,i))&&(s&&o.error(new n.SequenceError(`Too many matching values`)),s=!0,c=t)},function(){s?(o.next(c),o.complete()):o.error(l?new r.NotFoundError(`No matching values`):new t.EmptyError)}))})}e.single=o}}),$h=I({"../../node_modules/rxjs/dist/cjs/internal/operators/skip.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.skip=void 0;var t=xm();function n(e){return t.filter(function(t,n){return e<=n})}e.skip=n}}),eg=I({"../../node_modules/rxjs/dist/cjs/internal/operators/skipLast.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.skipLast=void 0;var t=Ff(),n=L(),r=R();function i(e){return e<=0?t.identity:n.operate(function(t,n){var i=Array(e),a=0;return t.subscribe(r.createOperatorSubscriber(n,function(t){var r=a++;if(r<e)i[r]=t;else{var o=r%e,s=i[o];i[o]=t,n.next(s)}})),function(){i=null}})}e.skipLast=i}}),tg=I({"../../node_modules/rxjs/dist/cjs/internal/operators/skipUntil.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.skipUntil=void 0;var t=L(),n=R(),r=z(),i=Af();function a(e){return t.operate(function(t,a){var o=!1,s=n.createOperatorSubscriber(a,function(){s?.unsubscribe(),o=!0},i.noop);r.innerFrom(e).subscribe(s),t.subscribe(n.createOperatorSubscriber(a,function(e){return o&&a.next(e)}))})}e.skipUntil=a}}),ng=I({"../../node_modules/rxjs/dist/cjs/internal/operators/skipWhile.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.skipWhile=void 0;var t=L(),n=R();function r(e){return t.operate(function(t,r){var i=!1,a=0;t.subscribe(n.createOperatorSubscriber(r,function(t){return(i||=!e(t,a++))&&r.next(t)}))})}e.skipWhile=r}}),rg=I({"../../node_modules/rxjs/dist/cjs/internal/operators/startWith.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.startWith=void 0;var t=am(),n=hp(),r=L();function i(){var e=[...arguments],i=n.popScheduler(e);return r.operate(function(n,r){(i?t.concat(e,n,i):t.concat(e,n)).subscribe(r)})}e.startWith=i}}),ig=I({"../../node_modules/rxjs/dist/cjs/internal/operators/switchMap.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.switchMap=void 0;var t=z(),n=L(),r=R();function i(e,i){return n.operate(function(n,a){var o=null,s=0,c=!1,l=function(){return c&&!o&&a.complete()};n.subscribe(r.createOperatorSubscriber(a,function(n){o?.unsubscribe();var c=0,u=s++;t.innerFrom(e(n,u)).subscribe(o=r.createOperatorSubscriber(a,function(e){return a.next(i?i(n,e,u,c++):e)},function(){o=null,l()}))},function(){c=!0,l()}))})}e.switchMap=i}}),ag=I({"../../node_modules/rxjs/dist/cjs/internal/operators/switchAll.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.switchAll=void 0;var t=ig(),n=Ff();function r(){return t.switchMap(n.identity)}e.switchAll=r}}),og=I({"../../node_modules/rxjs/dist/cjs/internal/operators/switchMapTo.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.switchMapTo=void 0;var t=ig(),n=Sf();function r(e,r){return n.isFunction(r)?t.switchMap(function(){return e},r):t.switchMap(function(){return e})}e.switchMapTo=r}}),sg=I({"../../node_modules/rxjs/dist/cjs/internal/operators/switchScan.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.switchScan=void 0;var t=ig(),n=L();function r(e,r){return n.operate(function(n,i){var a=r;return t.switchMap(function(t,n){return e(a,t,n)},function(e,t){return a=t,t})(n).subscribe(i),function(){a=null}})}e.switchScan=r}}),cg=I({"../../node_modules/rxjs/dist/cjs/internal/operators/takeUntil.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.takeUntil=void 0;var t=L(),n=R(),r=z(),i=Af();function a(e){return t.operate(function(t,a){r.innerFrom(e).subscribe(n.createOperatorSubscriber(a,function(){return a.complete()},i.noop)),!a.closed&&t.subscribe(a)})}e.takeUntil=a}}),lg=I({"../../node_modules/rxjs/dist/cjs/internal/operators/takeWhile.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.takeWhile=void 0;var t=L(),n=R();function r(e,r){return r===void 0&&(r=!1),t.operate(function(t,i){var a=0;t.subscribe(n.createOperatorSubscriber(i,function(t){var n=e(t,a++);(n||r)&&i.next(t),!n&&i.complete()}))})}e.takeWhile=r}}),ug=I({"../../node_modules/rxjs/dist/cjs/internal/operators/tap.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.tap=void 0;var t=Sf(),n=L(),r=R(),i=Ff();function a(e,a,o){var s=t.isFunction(e)||a||o?{next:e,error:a,complete:o}:e;return s?n.operate(function(e,t){var n;(n=s.subscribe)==null||n.call(s);var i=!0;e.subscribe(r.createOperatorSubscriber(t,function(e){var n;(n=s.next)==null||n.call(s,e),t.next(e)},function(){var e;i=!1,(e=s.complete)==null||e.call(s),t.complete()},function(e){var n;i=!1,(n=s.error)==null||n.call(s,e),t.error(e)},function(){var e,t;i&&((e=s.unsubscribe)==null||e.call(s)),(t=s.finalize)==null||t.call(s)}))}):i.identity}e.tap=a}}),dg=I({"../../node_modules/rxjs/dist/cjs/internal/operators/throttle.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.throttle=void 0;var t=L(),n=R(),r=z();function i(e,i){return t.operate(function(t,a){var o=i??{},s=o.leading,c=s===void 0?!0:s,l=o.trailing,u=l===void 0?!1:l,d=!1,f=null,p=null,m=!1,h=function(){p?.unsubscribe(),p=null,u&&(v(),m&&a.complete())},g=function(){p=null,m&&a.complete()},_=function(t){return p=r.innerFrom(e(t)).subscribe(n.createOperatorSubscriber(a,h,g))},v=function(){if(d){d=!1;var e=f;f=null,a.next(e),!m&&_(e)}};t.subscribe(n.createOperatorSubscriber(a,function(e){d=!0,f=e,!(p&&!p.closed)&&(c?v():_(e))},function(){m=!0,!(u&&d&&p&&!p.closed)&&a.complete()}))})}e.throttle=i}}),fg=I({"../../node_modules/rxjs/dist/cjs/internal/operators/throttleTime.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.throttleTime=void 0;var t=ap(),n=dg(),r=pm();function i(e,i,a){i===void 0&&(i=t.asyncScheduler);var o=r.timer(e,i);return n.throttle(function(){return o},a)}e.throttleTime=i}}),pg=I({"../../node_modules/rxjs/dist/cjs/internal/operators/timeInterval.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TimeInterval=e.timeInterval=void 0;var t=ap(),n=L(),r=R();function i(e){return e===void 0&&(e=t.asyncScheduler),n.operate(function(t,n){var i=e.now();t.subscribe(r.createOperatorSubscriber(n,function(t){var r=e.now(),o=r-i;i=r,n.next(new a(t,o))}))})}e.timeInterval=i;var a=(function(){function e(e,t){this.value=e,this.interval=t}return e})();e.TimeInterval=a}}),mg=I({"../../node_modules/rxjs/dist/cjs/internal/operators/timeoutWith.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.timeoutWith=void 0;var t=ap(),n=Gp(),r=Kp();function i(e,i,a){var o,s,c;if(a??=t.async,n.isValidDate(e)?o=e:typeof e==`number`&&(s=e),i)c=function(){return i};else throw TypeError(`No observable provided to switch to`);if(o==null&&s==null)throw TypeError(`No timeout provided.`);return r.timeout({first:o,each:s,scheduler:a,with:c})}e.timeoutWith=i}}),hg=I({"../../node_modules/rxjs/dist/cjs/internal/operators/timestamp.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.timestamp=void 0;var t=Kf(),n=qp();function r(e){return e===void 0&&(e=t.dateTimestampProvider),n.map(function(t){return{value:t,timestamp:e.now()}})}e.timestamp=r}}),gg=I({"../../node_modules/rxjs/dist/cjs/internal/operators/window.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.window=void 0;var t=Wf(),n=L(),r=R(),i=Af(),a=z();function o(e){return n.operate(function(n,o){var s=new t.Subject;o.next(s.asObservable());var c=function(e){s.error(e),o.error(e)};return n.subscribe(r.createOperatorSubscriber(o,function(e){return s?.next(e)},function(){s.complete(),o.complete()},c)),a.innerFrom(e).subscribe(r.createOperatorSubscriber(o,function(){s.complete(),o.next(s=new t.Subject)},i.noop,c)),function(){s?.unsubscribe(),s=null}})}e.window=o}}),_g=I({"../../node_modules/rxjs/dist/cjs/internal/operators/windowCount.js"(e){var t=e&&e.__values||function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)};Object.defineProperty(e,"__esModule",{value:!0}),e.windowCount=void 0;var n=Wf(),r=L(),i=R();function a(e,a){a===void 0&&(a=0);var o=a>0?a:e;return r.operate(function(r,a){var s=[new n.Subject],c=0;a.next(s[0].asObservable()),r.subscribe(i.createOperatorSubscriber(a,function(r){var i,l;try{for(var u=t(s),d=u.next();!d.done;d=u.next())d.value.next(r)}catch(e){i={error:e}}finally{try{d&&!d.done&&(l=u.return)&&l.call(u)}finally{if(i)throw i.error}}var f=c-e+1;if(f>=0&&f%o===0&&s.shift().complete(),++c%o===0){var p=new n.Subject;s.push(p),a.next(p.asObservable())}},function(){for(;s.length>0;)s.shift().complete();a.complete()},function(e){for(;s.length>0;)s.shift().error(e);a.error(e)},function(){s=null}))})}e.windowCount=a}}),vg=I({"../../node_modules/rxjs/dist/cjs/internal/operators/windowTime.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.windowTime=void 0;var t=Wf(),n=ap(),r=Ef(),i=L(),a=R(),o=Tf(),s=hp(),c=wp();function l(e){var l=[...arguments].slice(1),u=s.popScheduler(l)??n.asyncScheduler,d=l[0]??null,f=l[1]||1/0;return i.operate(function(n,i){var s=[],l=!1,p=function(e){var t=e.window,n=e.subs;t.complete(),n.unsubscribe(),o.arrRemove(s,e),l&&m()},m=function(){if(s){var n=new r.Subscription;i.add(n);var a=new t.Subject,o={window:a,subs:n,seen:0};s.push(o),i.next(a.asObservable()),c.executeSchedule(n,u,function(){return p(o)},e)}};d!==null&&d>=0?c.executeSchedule(i,u,m,d,!0):l=!0,m();var h=function(e){return s.slice().forEach(e)},g=function(e){h(function(t){var n=t.window;return e(n)}),e(i),i.unsubscribe()};return n.subscribe(a.createOperatorSubscriber(i,function(e){h(function(t){t.window.next(e),f<=++t.seen&&p(t)})},function(){return g(function(e){return e.complete()})},function(e){return g(function(t){return t.error(e)})})),function(){s=null}})}e.windowTime=l}}),yg=I({"../../node_modules/rxjs/dist/cjs/internal/operators/windowToggle.js"(e){var t=e&&e.__values||function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)};Object.defineProperty(e,"__esModule",{value:!0}),e.windowToggle=void 0;var n=Wf(),r=Ef(),i=L(),a=z(),o=R(),s=Af(),c=Tf();function l(e,l){return i.operate(function(i,u){var d=[],f=function(e){for(;0<d.length;)d.shift().error(e);u.error(e)};a.innerFrom(e).subscribe(o.createOperatorSubscriber(u,function(e){var t=new n.Subject;d.push(t);var i=new r.Subscription,p=function(){c.arrRemove(d,t),t.complete(),i.unsubscribe()},m;try{m=a.innerFrom(l(e))}catch(e){f(e);return}u.next(t.asObservable()),i.add(m.subscribe(o.createOperatorSubscriber(u,p,s.noop,f)))},s.noop)),i.subscribe(o.createOperatorSubscriber(u,function(e){var n,r,i=d.slice();try{for(var a=t(i),o=a.next();!o.done;o=a.next())o.value.next(e)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}},function(){for(;0<d.length;)d.shift().complete();u.complete()},f,function(){for(;0<d.length;)d.shift().unsubscribe()}))})}e.windowToggle=l}}),bg=I({"../../node_modules/rxjs/dist/cjs/internal/operators/windowWhen.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.windowWhen=void 0;var t=Wf(),n=L(),r=R(),i=z();function a(e){return n.operate(function(n,a){var o,s,c=function(e){o.error(e),a.error(e)},l=function(){s?.unsubscribe(),o?.complete(),o=new t.Subject,a.next(o.asObservable());var n;try{n=i.innerFrom(e())}catch(e){c(e);return}n.subscribe(s=r.createOperatorSubscriber(a,l,l,c))};l(),n.subscribe(r.createOperatorSubscriber(a,function(e){return o.next(e)},function(){o.complete(),a.complete()},c,function(){s?.unsubscribe(),o=null}))})}e.windowWhen=a}}),xg=I({"../../node_modules/rxjs/dist/cjs/internal/operators/withLatestFrom.js"(e){var t=e&&e.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},n=e&&e.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(e,"__esModule",{value:!0}),e.withLatestFrom=void 0;var r=L(),i=R(),a=z(),o=Ff(),s=Af(),c=hp();function l(){var e=[...arguments],l=c.popResultSelector(e);return r.operate(function(r,c){for(var u=e.length,d=Array(u),f=e.map(function(){return!1}),p=!1,m=function(t){a.innerFrom(e[t]).subscribe(i.createOperatorSubscriber(c,function(e){d[t]=e,!p&&!f[t]&&(f[t]=!0,(p=f.every(o.identity))&&(f=null))},s.noop))},h=0;h<u;h++)m(h);r.subscribe(i.createOperatorSubscriber(c,function(e){if(p){var r=n([e],t(d));c.next(l?l.apply(void 0,n([],t(r))):r)}}))})}e.withLatestFrom=l}}),Sg=I({"../../node_modules/rxjs/dist/cjs/internal/operators/zipAll.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.zipAll=void 0;var t=Em(),n=zm();function r(e){return n.joinAllInternals(t.zip,e)}e.zipAll=r}}),Cg=I({"../../node_modules/rxjs/dist/cjs/internal/operators/zip.js"(e){var t=e&&e.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},n=e&&e.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(e,"__esModule",{value:!0}),e.zip=void 0;var r=Em(),i=L();function a(){var e=[...arguments];return i.operate(function(i,a){r.zip.apply(void 0,n([i],t(e))).subscribe(a)})}e.zip=a}}),wg=I({"../../node_modules/rxjs/dist/cjs/internal/operators/zipWith.js"(e){var t=e&&e.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},n=e&&e.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(e,"__esModule",{value:!0}),e.zipWith=void 0;var r=Cg();function i(){var e=[...arguments];return r.zip.apply(void 0,n([],t(e)))}e.zipWith=i}}),Tg=I({"../../node_modules/rxjs/dist/cjs/index.js"(e){var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.interval=e.iif=e.generate=e.fromEventPattern=e.fromEvent=e.from=e.forkJoin=e.empty=e.defer=e.connectable=e.concat=e.combineLatest=e.bindNodeCallback=e.bindCallback=e.UnsubscriptionError=e.TimeoutError=e.SequenceError=e.ObjectUnsubscribedError=e.NotFoundError=e.EmptyError=e.ArgumentOutOfRangeError=e.firstValueFrom=e.lastValueFrom=e.isObservable=e.identity=e.noop=e.pipe=e.NotificationKind=e.Notification=e.Subscriber=e.Subscription=e.Scheduler=e.VirtualAction=e.VirtualTimeScheduler=e.animationFrameScheduler=e.animationFrame=e.queueScheduler=e.queue=e.asyncScheduler=e.async=e.asapScheduler=e.asap=e.AsyncSubject=e.ReplaySubject=e.BehaviorSubject=e.Subject=e.animationFrames=e.observable=e.ConnectableObservable=e.Observable=void 0,e.filter=e.expand=e.exhaustMap=e.exhaustAll=e.exhaust=e.every=e.endWith=e.elementAt=e.distinctUntilKeyChanged=e.distinctUntilChanged=e.distinct=e.dematerialize=e.delayWhen=e.delay=e.defaultIfEmpty=e.debounceTime=e.debounce=e.count=e.connect=e.concatWith=e.concatMapTo=e.concatMap=e.concatAll=e.combineLatestWith=e.combineLatestAll=e.combineAll=e.catchError=e.bufferWhen=e.bufferToggle=e.bufferTime=e.bufferCount=e.buffer=e.auditTime=e.audit=e.config=e.NEVER=e.EMPTY=e.scheduled=e.zip=e.using=e.timer=e.throwError=e.range=e.race=e.partition=e.pairs=e.onErrorResumeNext=e.of=e.never=e.merge=void 0,e.switchMap=e.switchAll=e.subscribeOn=e.startWith=e.skipWhile=e.skipUntil=e.skipLast=e.skip=e.single=e.shareReplay=e.share=e.sequenceEqual=e.scan=e.sampleTime=e.sample=e.refCount=e.retryWhen=e.retry=e.repeatWhen=e.repeat=e.reduce=e.raceWith=e.publishReplay=e.publishLast=e.publishBehavior=e.publish=e.pluck=e.pairwise=e.onErrorResumeNextWith=e.observeOn=e.multicast=e.min=e.mergeWith=e.mergeScan=e.mergeMapTo=e.mergeMap=e.flatMap=e.mergeAll=e.max=e.materialize=e.mapTo=e.map=e.last=e.isEmpty=e.ignoreElements=e.groupBy=e.first=e.findIndex=e.find=e.finalize=void 0,e.zipWith=e.zipAll=e.withLatestFrom=e.windowWhen=e.windowToggle=e.windowTime=e.windowCount=e.window=e.toArray=e.timestamp=e.timeoutWith=e.timeout=e.timeInterval=e.throwIfEmpty=e.throttleTime=e.throttle=e.tap=e.takeWhile=e.takeUntil=e.takeLast=e.take=e.switchScan=e.switchMapTo=void 0;var r=Lf();Object.defineProperty(e,"Observable",{enumerable:!0,get:function(){return r.Observable}});var i=zf();Object.defineProperty(e,"ConnectableObservable",{enumerable:!0,get:function(){return i.ConnectableObservable}});var a=Pf();Object.defineProperty(e,"observable",{enumerable:!0,get:function(){return a.observable}});var o=Hf();Object.defineProperty(e,"animationFrames",{enumerable:!0,get:function(){return o.animationFrames}});var s=Wf();Object.defineProperty(e,"Subject",{enumerable:!0,get:function(){return s.Subject}});var c=Gf();Object.defineProperty(e,"BehaviorSubject",{enumerable:!0,get:function(){return c.BehaviorSubject}});var l=qf();Object.defineProperty(e,"ReplaySubject",{enumerable:!0,get:function(){return l.ReplaySubject}});var u=Jf();Object.defineProperty(e,"AsyncSubject",{enumerable:!0,get:function(){return u.AsyncSubject}});var d=ip();Object.defineProperty(e,"asap",{enumerable:!0,get:function(){return d.asap}}),Object.defineProperty(e,"asapScheduler",{enumerable:!0,get:function(){return d.asapScheduler}});var f=ap();Object.defineProperty(e,"async",{enumerable:!0,get:function(){return f.async}}),Object.defineProperty(e,"asyncScheduler",{enumerable:!0,get:function(){return f.asyncScheduler}});var p=cp();Object.defineProperty(e,"queue",{enumerable:!0,get:function(){return p.queue}}),Object.defineProperty(e,"queueScheduler",{enumerable:!0,get:function(){return p.queueScheduler}});var m=dp();Object.defineProperty(e,"animationFrame",{enumerable:!0,get:function(){return m.animationFrame}}),Object.defineProperty(e,"animationFrameScheduler",{enumerable:!0,get:function(){return m.animationFrameScheduler}});var h=fp();Object.defineProperty(e,"VirtualTimeScheduler",{enumerable:!0,get:function(){return h.VirtualTimeScheduler}}),Object.defineProperty(e,"VirtualAction",{enumerable:!0,get:function(){return h.VirtualAction}});var g=tp();Object.defineProperty(e,"Scheduler",{enumerable:!0,get:function(){return g.Scheduler}});var _=Ef();Object.defineProperty(e,"Subscription",{enumerable:!0,get:function(){return _.Subscription}});var v=Nf();Object.defineProperty(e,"Subscriber",{enumerable:!0,get:function(){return v.Subscriber}});var y=Lp();Object.defineProperty(e,"Notification",{enumerable:!0,get:function(){return y.Notification}}),Object.defineProperty(e,"NotificationKind",{enumerable:!0,get:function(){return y.NotificationKind}});var b=If();Object.defineProperty(e,"pipe",{enumerable:!0,get:function(){return b.pipe}});var x=Af();Object.defineProperty(e,"noop",{enumerable:!0,get:function(){return x.noop}});var S=Ff();Object.defineProperty(e,"identity",{enumerable:!0,get:function(){return S.identity}});var C=Rp();Object.defineProperty(e,"isObservable",{enumerable:!0,get:function(){return C.isObservable}});var w=Bp();Object.defineProperty(e,"lastValueFrom",{enumerable:!0,get:function(){return w.lastValueFrom}});var T=Vp();Object.defineProperty(e,"firstValueFrom",{enumerable:!0,get:function(){return T.firstValueFrom}});var E=Hp();Object.defineProperty(e,"ArgumentOutOfRangeError",{enumerable:!0,get:function(){return E.ArgumentOutOfRangeError}});var D=zp();Object.defineProperty(e,"EmptyError",{enumerable:!0,get:function(){return D.EmptyError}});var O=Up();Object.defineProperty(e,"NotFoundError",{enumerable:!0,get:function(){return O.NotFoundError}});var k=Uf();Object.defineProperty(e,"ObjectUnsubscribedError",{enumerable:!0,get:function(){return k.ObjectUnsubscribedError}});var A=Wp();Object.defineProperty(e,"SequenceError",{enumerable:!0,get:function(){return A.SequenceError}});var j=Kp();Object.defineProperty(e,"TimeoutError",{enumerable:!0,get:function(){return j.TimeoutError}});var ee=wf();Object.defineProperty(e,"UnsubscriptionError",{enumerable:!0,get:function(){return ee.UnsubscriptionError}});var M=Xp();Object.defineProperty(e,"bindCallback",{enumerable:!0,get:function(){return M.bindCallback}});var N=Zp();Object.defineProperty(e,"bindNodeCallback",{enumerable:!0,get:function(){return N.bindNodeCallback}});var te=em();Object.defineProperty(e,"combineLatest",{enumerable:!0,get:function(){return te.combineLatest}});var ne=am();Object.defineProperty(e,"concat",{enumerable:!0,get:function(){return ne.concat}});var re=sm();Object.defineProperty(e,"connectable",{enumerable:!0,get:function(){return re.connectable}});var ie=om();Object.defineProperty(e,"defer",{enumerable:!0,get:function(){return ie.defer}});var ae=pp();Object.defineProperty(e,"empty",{enumerable:!0,get:function(){return ae.empty}});var oe=cm();Object.defineProperty(e,"forkJoin",{enumerable:!0,get:function(){return oe.forkJoin}});var se=Pp();Object.defineProperty(e,"from",{enumerable:!0,get:function(){return se.from}});var ce=lm();Object.defineProperty(e,"fromEvent",{enumerable:!0,get:function(){return ce.fromEvent}});var P=um();Object.defineProperty(e,"fromEventPattern",{enumerable:!0,get:function(){return P.fromEventPattern}});var le=dm();Object.defineProperty(e,"generate",{enumerable:!0,get:function(){return le.generate}});var ue=fm();Object.defineProperty(e,"iif",{enumerable:!0,get:function(){return ue.iif}});var de=mm();Object.defineProperty(e,"interval",{enumerable:!0,get:function(){return de.interval}});var fe=hm();Object.defineProperty(e,"merge",{enumerable:!0,get:function(){return fe.merge}});var pe=gm();Object.defineProperty(e,"never",{enumerable:!0,get:function(){return pe.never}});var me=Fp();Object.defineProperty(e,"of",{enumerable:!0,get:function(){return me.of}});var he=vm();Object.defineProperty(e,"onErrorResumeNext",{enumerable:!0,get:function(){return he.onErrorResumeNext}});var ge=ym();Object.defineProperty(e,"pairs",{enumerable:!0,get:function(){return ge.pairs}});var _e=Sm();Object.defineProperty(e,"partition",{enumerable:!0,get:function(){return _e.partition}});var ve=Cm();Object.defineProperty(e,"race",{enumerable:!0,get:function(){return ve.race}});var ye=wm();Object.defineProperty(e,"range",{enumerable:!0,get:function(){return ye.range}});var be=Ip();Object.defineProperty(e,"throwError",{enumerable:!0,get:function(){return be.throwError}});var xe=pm();Object.defineProperty(e,"timer",{enumerable:!0,get:function(){return xe.timer}});var Se=Tm();Object.defineProperty(e,"using",{enumerable:!0,get:function(){return Se.using}});var Ce=Em();Object.defineProperty(e,"zip",{enumerable:!0,get:function(){return Ce.zip}});var we=Np();Object.defineProperty(e,"scheduled",{enumerable:!0,get:function(){return we.scheduled}});var Te=pp();Object.defineProperty(e,"EMPTY",{enumerable:!0,get:function(){return Te.EMPTY}});var Ee=gm();Object.defineProperty(e,"NEVER",{enumerable:!0,get:function(){return Ee.NEVER}}),n(Dm(),e);var De=Df();Object.defineProperty(e,"config",{enumerable:!0,get:function(){return De.config}});var Oe=Om();Object.defineProperty(e,"audit",{enumerable:!0,get:function(){return Oe.audit}});var ke=km();Object.defineProperty(e,"auditTime",{enumerable:!0,get:function(){return ke.auditTime}});var Ae=Am();Object.defineProperty(e,"buffer",{enumerable:!0,get:function(){return Ae.buffer}});var je=jm();Object.defineProperty(e,"bufferCount",{enumerable:!0,get:function(){return je.bufferCount}});var Me=Mm();Object.defineProperty(e,"bufferTime",{enumerable:!0,get:function(){return Me.bufferTime}});var Ne=Nm();Object.defineProperty(e,"bufferToggle",{enumerable:!0,get:function(){return Ne.bufferToggle}});var Pe=Pm();Object.defineProperty(e,"bufferWhen",{enumerable:!0,get:function(){return Pe.bufferWhen}});var Fe=Fm();Object.defineProperty(e,"catchError",{enumerable:!0,get:function(){return Fe.catchError}});var Ie=Vm();Object.defineProperty(e,"combineAll",{enumerable:!0,get:function(){return Ie.combineAll}});var Le=Bm();Object.defineProperty(e,"combineLatestAll",{enumerable:!0,get:function(){return Le.combineLatestAll}});var Re=Um();Object.defineProperty(e,"combineLatestWith",{enumerable:!0,get:function(){return Re.combineLatestWith}});var ze=im();Object.defineProperty(e,"concatAll",{enumerable:!0,get:function(){return ze.concatAll}});var Be=Wm();Object.defineProperty(e,"concatMap",{enumerable:!0,get:function(){return Be.concatMap}});var Ve=Gm();Object.defineProperty(e,"concatMapTo",{enumerable:!0,get:function(){return Ve.concatMapTo}});var He=qm();Object.defineProperty(e,"concatWith",{enumerable:!0,get:function(){return He.concatWith}});var Ue=Ym();Object.defineProperty(e,"connect",{enumerable:!0,get:function(){return Ue.connect}});var We=Xm();Object.defineProperty(e,"count",{enumerable:!0,get:function(){return We.count}});var Ge=Zm();Object.defineProperty(e,"debounce",{enumerable:!0,get:function(){return Ge.debounce}});var Ke=Qm();Object.defineProperty(e,"debounceTime",{enumerable:!0,get:function(){return Ke.debounceTime}});var qe=$m();Object.defineProperty(e,"defaultIfEmpty",{enumerable:!0,get:function(){return qe.defaultIfEmpty}});var Je=ih();Object.defineProperty(e,"delay",{enumerable:!0,get:function(){return Je.delay}});var Ye=rh();Object.defineProperty(e,"delayWhen",{enumerable:!0,get:function(){return Ye.delayWhen}});var Xe=ah();Object.defineProperty(e,"dematerialize",{enumerable:!0,get:function(){return Xe.dematerialize}});var Ze=oh();Object.defineProperty(e,"distinct",{enumerable:!0,get:function(){return Ze.distinct}});var Qe=sh();Object.defineProperty(e,"distinctUntilChanged",{enumerable:!0,get:function(){return Qe.distinctUntilChanged}});var $e=ch();Object.defineProperty(e,"distinctUntilKeyChanged",{enumerable:!0,get:function(){return $e.distinctUntilKeyChanged}});var et=uh();Object.defineProperty(e,"elementAt",{enumerable:!0,get:function(){return et.elementAt}});var tt=dh();Object.defineProperty(e,"endWith",{enumerable:!0,get:function(){return tt.endWith}});var nt=fh();Object.defineProperty(e,"every",{enumerable:!0,get:function(){return nt.every}});var rt=hh();Object.defineProperty(e,"exhaust",{enumerable:!0,get:function(){return rt.exhaust}});var it=mh();Object.defineProperty(e,"exhaustAll",{enumerable:!0,get:function(){return it.exhaustAll}});var at=ph();Object.defineProperty(e,"exhaustMap",{enumerable:!0,get:function(){return at.exhaustMap}});var ot=gh();Object.defineProperty(e,"expand",{enumerable:!0,get:function(){return ot.expand}});var st=xm();Object.defineProperty(e,"filter",{enumerable:!0,get:function(){return st.filter}});var ct=_h();Object.defineProperty(e,"finalize",{enumerable:!0,get:function(){return ct.finalize}});var lt=vh();Object.defineProperty(e,"find",{enumerable:!0,get:function(){return lt.find}});var ut=yh();Object.defineProperty(e,"findIndex",{enumerable:!0,get:function(){return ut.findIndex}});var dt=bh();Object.defineProperty(e,"first",{enumerable:!0,get:function(){return dt.first}});var ft=xh();Object.defineProperty(e,"groupBy",{enumerable:!0,get:function(){return ft.groupBy}});var pt=th();Object.defineProperty(e,"ignoreElements",{enumerable:!0,get:function(){return pt.ignoreElements}});var mt=Sh();Object.defineProperty(e,"isEmpty",{enumerable:!0,get:function(){return mt.isEmpty}});var ht=wh();Object.defineProperty(e,"last",{enumerable:!0,get:function(){return ht.last}});var gt=qp();Object.defineProperty(e,"map",{enumerable:!0,get:function(){return gt.map}});var _t=nh();Object.defineProperty(e,"mapTo",{enumerable:!0,get:function(){return _t.mapTo}});var vt=Th();Object.defineProperty(e,"materialize",{enumerable:!0,get:function(){return vt.materialize}});var yt=Eh();Object.defineProperty(e,"max",{enumerable:!0,get:function(){return yt.max}});var bt=rm();Object.defineProperty(e,"mergeAll",{enumerable:!0,get:function(){return bt.mergeAll}});var xt=Dh();Object.defineProperty(e,"flatMap",{enumerable:!0,get:function(){return xt.flatMap}});var St=nm();Object.defineProperty(e,"mergeMap",{enumerable:!0,get:function(){return St.mergeMap}});var Ct=Oh();Object.defineProperty(e,"mergeMapTo",{enumerable:!0,get:function(){return Ct.mergeMapTo}});var wt=kh();Object.defineProperty(e,"mergeScan",{enumerable:!0,get:function(){return wt.mergeScan}});var Tt=jh();Object.defineProperty(e,"mergeWith",{enumerable:!0,get:function(){return Tt.mergeWith}});var Et=Mh();Object.defineProperty(e,"min",{enumerable:!0,get:function(){return Et.min}});var Dt=Nh();Object.defineProperty(e,"multicast",{enumerable:!0,get:function(){return Dt.multicast}});var Ot=Tp();Object.defineProperty(e,"observeOn",{enumerable:!0,get:function(){return Ot.observeOn}});var kt=Ph();Object.defineProperty(e,"onErrorResumeNextWith",{enumerable:!0,get:function(){return kt.onErrorResumeNextWith}});var At=Fh();Object.defineProperty(e,"pairwise",{enumerable:!0,get:function(){return At.pairwise}});var jt=Ih();Object.defineProperty(e,"pluck",{enumerable:!0,get:function(){return jt.pluck}});var Mt=Lh();Object.defineProperty(e,"publish",{enumerable:!0,get:function(){return Mt.publish}});var Nt=Rh();Object.defineProperty(e,"publishBehavior",{enumerable:!0,get:function(){return Nt.publishBehavior}});var Pt=zh();Object.defineProperty(e,"publishLast",{enumerable:!0,get:function(){return Pt.publishLast}});var Ft=Bh();Object.defineProperty(e,"publishReplay",{enumerable:!0,get:function(){return Ft.publishReplay}});var It=Vh();Object.defineProperty(e,"raceWith",{enumerable:!0,get:function(){return It.raceWith}});var Lt=Lm();Object.defineProperty(e,"reduce",{enumerable:!0,get:function(){return Lt.reduce}});var Rt=Hh();Object.defineProperty(e,"repeat",{enumerable:!0,get:function(){return Rt.repeat}});var zt=Uh();Object.defineProperty(e,"repeatWhen",{enumerable:!0,get:function(){return zt.repeatWhen}});var Bt=Wh();Object.defineProperty(e,"retry",{enumerable:!0,get:function(){return Bt.retry}});var Vt=Gh();Object.defineProperty(e,"retryWhen",{enumerable:!0,get:function(){return Vt.retryWhen}});var Ht=Rf();Object.defineProperty(e,"refCount",{enumerable:!0,get:function(){return Ht.refCount}});var Ut=Kh();Object.defineProperty(e,"sample",{enumerable:!0,get:function(){return Ut.sample}});var Wt=qh();Object.defineProperty(e,"sampleTime",{enumerable:!0,get:function(){return Wt.sampleTime}});var Gt=Jh();Object.defineProperty(e,"scan",{enumerable:!0,get:function(){return Gt.scan}});var Kt=Yh();Object.defineProperty(e,"sequenceEqual",{enumerable:!0,get:function(){return Kt.sequenceEqual}});var qt=Xh();Object.defineProperty(e,"share",{enumerable:!0,get:function(){return qt.share}});var Jt=Zh();Object.defineProperty(e,"shareReplay",{enumerable:!0,get:function(){return Jt.shareReplay}});var Yt=Qh();Object.defineProperty(e,"single",{enumerable:!0,get:function(){return Yt.single}});var Xt=$h();Object.defineProperty(e,"skip",{enumerable:!0,get:function(){return Xt.skip}});var Zt=eg();Object.defineProperty(e,"skipLast",{enumerable:!0,get:function(){return Zt.skipLast}});var Qt=tg();Object.defineProperty(e,"skipUntil",{enumerable:!0,get:function(){return Qt.skipUntil}});var $t=ng();Object.defineProperty(e,"skipWhile",{enumerable:!0,get:function(){return $t.skipWhile}});var en=rg();Object.defineProperty(e,"startWith",{enumerable:!0,get:function(){return en.startWith}});var tn=Ep();Object.defineProperty(e,"subscribeOn",{enumerable:!0,get:function(){return tn.subscribeOn}});var nn=ag();Object.defineProperty(e,"switchAll",{enumerable:!0,get:function(){return nn.switchAll}});var rn=ig();Object.defineProperty(e,"switchMap",{enumerable:!0,get:function(){return rn.switchMap}});var an=og();Object.defineProperty(e,"switchMapTo",{enumerable:!0,get:function(){return an.switchMapTo}});var on=sg();Object.defineProperty(e,"switchScan",{enumerable:!0,get:function(){return on.switchScan}});var sn=eh();Object.defineProperty(e,"take",{enumerable:!0,get:function(){return sn.take}});var cn=Ch();Object.defineProperty(e,"takeLast",{enumerable:!0,get:function(){return cn.takeLast}});var ln=cg();Object.defineProperty(e,"takeUntil",{enumerable:!0,get:function(){return ln.takeUntil}});var un=lg();Object.defineProperty(e,"takeWhile",{enumerable:!0,get:function(){return un.takeWhile}});var dn=ug();Object.defineProperty(e,"tap",{enumerable:!0,get:function(){return dn.tap}});var fn=dg();Object.defineProperty(e,"throttle",{enumerable:!0,get:function(){return fn.throttle}});var pn=fg();Object.defineProperty(e,"throttleTime",{enumerable:!0,get:function(){return pn.throttleTime}});var mn=lh();Object.defineProperty(e,"throwIfEmpty",{enumerable:!0,get:function(){return mn.throwIfEmpty}});var hn=pg();Object.defineProperty(e,"timeInterval",{enumerable:!0,get:function(){return hn.timeInterval}});var gn=Kp();Object.defineProperty(e,"timeout",{enumerable:!0,get:function(){return gn.timeout}});var _n=mg();Object.defineProperty(e,"timeoutWith",{enumerable:!0,get:function(){return _n.timeoutWith}});var vn=hg();Object.defineProperty(e,"timestamp",{enumerable:!0,get:function(){return vn.timestamp}});var yn=Rm();Object.defineProperty(e,"toArray",{enumerable:!0,get:function(){return yn.toArray}});var bn=gg();Object.defineProperty(e,"window",{enumerable:!0,get:function(){return bn.window}});var xn=_g();Object.defineProperty(e,"windowCount",{enumerable:!0,get:function(){return xn.windowCount}});var Sn=vg();Object.defineProperty(e,"windowTime",{enumerable:!0,get:function(){return Sn.windowTime}});var Cn=yg();Object.defineProperty(e,"windowToggle",{enumerable:!0,get:function(){return Cn.windowToggle}});var wn=bg();Object.defineProperty(e,"windowWhen",{enumerable:!0,get:function(){return wn.windowWhen}});var Tn=xg();Object.defineProperty(e,"withLatestFrom",{enumerable:!0,get:function(){return Tn.withLatestFrom}});var En=Sg();Object.defineProperty(e,"zipAll",{enumerable:!0,get:function(){return En.zipAll}});var Dn=wg();Object.defineProperty(e,"zipWith",{enumerable:!0,get:function(){return Dn.zipWith}})}}),Eg=class{constructor(){if(typeof window>`u`)throw Error(`WebBrowserStorage is client-only. It must not be constructed on the server — a single process-wide instance would leak tokens between HTTP requests. Wrap any code path that constructs this in "use client".`)}get(e){return localStorage.getItem(e)}set(e,t){localStorage.setItem(e,t)}delete(e){localStorage.removeItem(e)}subscribe(e){let t=t=>{t.key!==null&&e(t.key,t.newValue)};return window.addEventListener(`storage`,t),()=>{window.removeEventListener(`storage`,t)}}},Dg=(0,u.createContext)(null);function Og({browser:e,storage:t,sessionFactory:n,children:r}){let i=(0,u.useMemo)(()=>e??df({storage:t??new Eg,sessionFactory:n??lf()}),[e,t,n]);return(0,F.jsx)(Dg.Provider,{value:i,children:r})}function kg(){let e=(0,u.useContext)(Dg);if(!e)throw Error(`useSemiont must be used within a <SemiontProvider>`);return e}var Ag=ei({"../../translations/ar.json":()=>h(()=>import(`./ar-ZHKO4XDR-CdT7gRuA.js`),[]),"../../translations/bn.json":()=>h(()=>import(`./bn-3BUDKAK5-CO5rYx_K.js`),[]),"../../translations/cs.json":()=>h(()=>import(`./cs-2EFEUKTW-DeAOIf_-.js`),[]),"../../translations/da.json":()=>h(()=>import(`./da-SUD3Q44Q-CgozsbCb.js`),[]),"../../translations/de.json":()=>h(()=>import(`./de-6IC5QRX7-BE7EFdCc.js`),[]),"../../translations/el.json":()=>h(()=>import(`./el-Q4NAXFRC-CnSVRzx3.js`),[]),"../../translations/en.json":()=>h(()=>import(`./en-P2L4X27N-CUjpZEjK.js`),[]),"../../translations/es.json":()=>h(()=>import(`./es-YUKZBD4W-CTA9ZbHB.js`),[]),"../../translations/fa.json":()=>h(()=>import(`./fa-OJ47LILE-DtZ-ddud.js`),[]),"../../translations/fi.json":()=>h(()=>import(`./fi-QFFL5CUB-B_0Fy5E9.js`),[]),"../../translations/fr.json":()=>h(()=>import(`./fr-BOQZZWP4-CLy3hDFG.js`),[]),"../../translations/he.json":()=>h(()=>import(`./he-LXDY3TFA-BlHmt4OT.js`),[]),"../../translations/hi.json":()=>h(()=>import(`./hi-HOJER77V-D5UtSE45.js`),[]),"../../translations/id.json":()=>h(()=>import(`./id-I5WQ6EWD-C1QdlWFh.js`),[]),"../../translations/it.json":()=>h(()=>import(`./it-UYH642IJ-CP5ZdyLJ.js`),[]),"../../translations/ja.json":()=>h(()=>import(`./ja-JTVWAC4L-BJZThfyQ.js`),[]),"../../translations/ko.json":()=>h(()=>import(`./ko-IHXFMOIZ-j1xQCX4o.js`),[]),"../../translations/ms.json":()=>h(()=>import(`./ms-JH25VFLO-CBxXu_23.js`),[]),"../../translations/nl.json":()=>h(()=>import(`./nl-SURXW7IQ-Di1Uwfgv.js`),[]),"../../translations/no.json":()=>h(()=>import(`./no-HXIKQFDZ-BaYnZrFs.js`),[]),"../../translations/pl.json":()=>h(()=>import(`./pl-7A4KU6XK-DQA3xkbx.js`),[]),"../../translations/pt.json":()=>h(()=>import(`./pt-6MGYP7Q5-_7GIrTdD.js`),[]),"../../translations/ro.json":()=>h(()=>import(`./ro-IROCHNIA-Dj_II2yF.js`),[]),"../../translations/sv.json":()=>h(()=>import(`./sv-WDJD75CV-BCL-G7dj.js`),[]),"../../translations/th.json":()=>h(()=>import(`./th-RIO2E6B3-I2dubvbq.js`),[]),"../../translations/tr.json":()=>h(()=>import(`./tr-TZ7ERCIN-BQ2FKoLo.js`),[]),"../../translations/uk.json":()=>h(()=>import(`./uk-ZFWDKLUE-BD2ECP6k.js`),[]),"../../translations/vi.json":()=>h(()=>import(`./vi-UIOSP2JG-DreqKb1C.js`),[]),"../../translations/zh.json":()=>h(()=>import(`./zh-6R6YUY46-C3GMKbzw.js`),[])}),jg=(0,u.createContext)(null),Mg=new Map;function Ng(e,t){let n=e.match(/\{(\w+),\s*plural,\s*/);if(!n)return e;let r=t[n[1]];if(r===void 0)return e;let i=n[0].length,a=1,o=i;for(let t=i;t<e.length;t++)if(e[t]===`{`)a++;else if(e[t]===`}`&&(a--,a===0)){o=t;break}let s=e.substring(i,o),c={},l=/(?:=(\d+)|(\w+))\s*\{([^}]+)\}/g,u;for(;(u=l.exec(s))!==null;){let[,e,t,n]=u,r=e===void 0?t:`=${e}`;c[r]=n}let d=c[`=${r}`];if(d!==void 0){let t=d.replace(/#/g,String(r));return e.substring(0,n.index)+t+e.substring(o+1)}let f=c.other;if(f!==void 0){let t=f.replace(/#/g,String(r));return e.substring(0,n.index)+t+e.substring(o+1)}return e}async function Pg(e){if(Mg.has(e))return Mg.get(e);if(e===`en`)return Mg.set(`en`,qr),qr;try{let t=await Ag(`../../translations/${e}.json`),n=t.default||t;return Mg.set(e,n),n}catch(t){return console.error(`Failed to load translations for locale: ${e}`,t),qr}}var Fg={t:(e,t,n)=>{let r=qr[e]?.[t];if(!r)return console.warn(`Translation not found for ${e}.${t}`),`${e}.${t}`;if(n&&typeof r==`string`){let e=r;return e=Ng(e,n),Object.entries(n).forEach(([t,n])=>{e=e.replace(RegExp(`\\{\\{${t}\\}\\}`,`g`),String(n))}),e}return r}};function Ig({translationManager:e,locale:t,loadingComponent:n=null,children:r}){let[i,a]=(0,u.useState)(null),[o,s]=(0,u.useState)(!1);(0,u.useEffect)(()=>{t&&!e&&(s(!0),Pg(t).then(e=>{a(e),s(!1)}).catch(e=>{console.error(`Failed to load translations:`,e),a(qr),s(!1)}))},[t,e]);let c=(0,u.useMemo)(()=>i?{t:(e,n,r)=>{let a=i[e]?.[n];if(!a)return console.warn(`Translation not found for ${e}.${n} in locale ${t}`),`${e}.${n}`;if(r&&typeof a==`string`){let e=a;return e=Ng(e,r),Object.entries(r).forEach(([t,n])=>{e=e.replace(RegExp(`\\{\\{${t}\\}\\}`,`g`),String(n))}),e}return a}}:null,[i,t]);return e?(0,F.jsx)(jg.Provider,{value:e,children:r}):t&&o?(0,F.jsx)(F.Fragment,{children:n}):t&&c?(0,F.jsx)(jg.Provider,{value:c,children:r}):(0,F.jsx)(jg.Provider,{value:Fg,children:r})}function Lg(e){let t=(0,u.useContext)(jg);return t?(n,r)=>t.t(e,n,r):(t,n)=>{let r=qr[e]?.[t];if(!r)return console.warn(`Translation not found for ${e}.${t}`),`${e}.${t}`;if(n&&typeof r==`string`){let e=r;return e=Ng(e,n),Object.entries(n).forEach(([t,n])=>{e=e.replace(RegExp(`\\{\\{${t}\\}\\}`,`g`),String(n))}),e}return r}}var Rg={success:(0,F.jsx)(`svg`,{className:`semiont-toast-icon`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,F.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M5 13l4 4L19 7`})}),error:(0,F.jsx)(`svg`,{className:`semiont-toast-icon`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,F.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M6 18L18 6M6 6l12 12`})}),warning:(0,F.jsx)(`svg`,{className:`semiont-toast-icon`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,F.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z`})}),info:(0,F.jsx)(`svg`,{className:`semiont-toast-icon`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,F.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z`})})};function zg({toast:e,onClose:t}){return(0,u.useEffect)(()=>{let n=setTimeout(()=>{t(e.id)},e.duration||3e3);return()=>clearTimeout(n)},[e,t]),(0,F.jsxs)(`div`,{className:`semiont-toast`,"data-variant":e.type,role:`alert`,children:[(0,F.jsx)(`div`,{className:`semiont-toast-icon-wrapper`,children:Rg[e.type]}),(0,F.jsx)(`p`,{className:`semiont-toast-message`,children:e.message}),(0,F.jsx)(`button`,{onClick:()=>t(e.id),className:`semiont-toast-close`,"aria-label":`Close`,children:(0,F.jsx)(`svg`,{className:`semiont-toast-close-icon`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,F.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M6 18L18 6M6 6l12 12`})})})]})}function Bg({toasts:e,onClose:t}){let[n,r]=(0,u.useState)(!1);return(0,u.useEffect)(()=>(r(!0),()=>r(!1)),[]),n?(0,xf.createPortal)((0,F.jsx)(`div`,{className:`semiont-toast-container`,children:e.map(e=>(0,F.jsx)(zg,{toast:e,onClose:t},e.id))}),document.body):null}var Vg=u.createContext(void 0);function Hg({children:e}){let[t,n]=(0,u.useState)([]),r=u.useCallback((e,t=`info`,r)=>{let i=Date.now().toString(),a=r===void 0?{id:i,message:e,type:t}:{id:i,message:e,type:t,duration:r};n(e=>[...e,a])},[]),i=u.useCallback((e,t)=>r(e,`success`,t),[r]),a=u.useCallback((e,t)=>r(e,`error`,t),[r]),o=u.useCallback((e,t)=>r(e,`warning`,t),[r]),s=u.useCallback((e,t)=>r(e,`info`,t),[r]),c=u.useCallback(e=>{n(t=>t.filter(t=>t.id!==e))},[]),l=u.useMemo(()=>({showToast:r,showSuccess:i,showError:a,showWarning:o,showInfo:s}),[r,i,a,o,s]);return(0,F.jsxs)(Vg.Provider,{value:l,children:[e,(0,F.jsx)(Bg,{toasts:t,onClose:c})]})}function Ug(){let e=u.useContext(Vg);if(e===void 0)throw Error(`useToast must be used within a ToastProvider`);return e}var Wg={colors:{primary:{50:`#eff6ff`,100:`#dbeafe`,200:`#bfdbfe`,300:`#93c5fd`,400:`#60a5fa`,500:`#0080ff`,600:`#0066cc`,700:`#0052a3`,800:`#1e40af`,900:`#1e3a8a`},secondary:{50:`#f0fffe`,100:`#e0fffd`,200:`#b3fffa`,300:`#66fff6`,400:`#1afff1`,500:`#00ffff`,600:`#00cccc`,700:`#00a3a3`,800:`#007a7a`,900:`#005252`},semantic:{error:`#ef4444`,errorLight:`#fca5a5`,errorDark:`#b91c1c`,warning:`#f59e0b`,warningLight:`#fcd34d`,warningDark:`#d97706`,success:`#10b981`,successLight:`#6ee7b7`,successDark:`#047857`,info:`#3b82f6`,infoLight:`#93c5fd`,infoDark:`#1d4ed8`},neutral:{0:`#ffffff`,50:`#f9fafb`,100:`#f3f4f6`,200:`#e5e7eb`,300:`#d1d5db`,400:`#9ca3af`,500:`#6b7280`,600:`#4b5563`,700:`#374151`,800:`#1f2937`,900:`#111827`,950:`#030712`,1e3:`#000000`},background:{primary:`#ffffff`,secondary:`#f9fafb`,tertiary:`#f3f4f6`,inverse:`#111827`},text:{primary:`#111827`,secondary:`#4b5563`,tertiary:`#6b7280`,disabled:`#9ca3af`,inverse:`#ffffff`}},spacing:{0:`0`,xs:`0.25rem`,sm:`0.5rem`,md:`1rem`,lg:`1.5rem`,xl:`2rem`,"2xl":`2.5rem`,"3xl":`3rem`,"4xl":`4rem`,"5xl":`5rem`},typography:{fontFamily:{sans:`Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif`,mono:`JetBrains Mono, "SF Mono", Monaco, Consolas, "Liberation Mono", "Courier New", monospace`},fontSize:{xs:`0.75rem`,sm:`0.875rem`,base:`1rem`,lg:`1.125rem`,xl:`1.25rem`,"2xl":`1.5rem`,"3xl":`1.875rem`,"4xl":`2.25rem`,"5xl":`3rem`},fontWeight:{thin:100,light:300,normal:400,medium:500,semibold:600,bold:700,black:900},lineHeight:{none:1,tight:1.25,snug:1.375,normal:1.5,relaxed:1.625,loose:2}},borderRadius:{none:`0`,sm:`0.125rem`,base:`0.25rem`,md:`0.375rem`,lg:`0.5rem`,xl:`0.75rem`,"2xl":`1rem`,"3xl":`1.5rem`,full:`9999px`},shadows:{none:`none`,xs:`0 1px 2px 0 rgb(0 0 0 / 0.05)`,sm:`0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)`,base:`0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)`,md:`0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)`,lg:`0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)`,xl:`0 25px 50px -12px rgb(0 0 0 / 0.25)`,inner:`inset 0 2px 4px 0 rgb(0 0 0 / 0.05)`},transitions:{duration:{fast:`150ms`,base:`250ms`,slow:`350ms`,slower:`500ms`},timing:{linear:`linear`,ease:`cubic-bezier(0.4, 0, 0.2, 1)`,easeIn:`cubic-bezier(0.4, 0, 1, 1)`,easeOut:`cubic-bezier(0, 0, 0.2, 1)`,easeInOut:`cubic-bezier(0.4, 0, 0.2, 1)`}},breakpoints:{sm:`640px`,md:`768px`,lg:`1024px`,xl:`1280px`,"2xl":`1536px`}};function Gg(){let e=[`:root {`];return Object.entries(Wg.colors.primary).forEach(([t,n])=>{e.push(` --semiont-color-primary-${t}: ${n};`)}),Object.entries(Wg.colors.secondary).forEach(([t,n])=>{e.push(` --semiont-color-secondary-${t}: ${n};`)}),Object.entries(Wg.colors.semantic).forEach(([t,n])=>{e.push(` --semiont-color-${t.toLowerCase().replace(/([A-Z])/g,`-$1`).toLowerCase()}: ${n};`)}),Object.entries(Wg.colors.neutral).forEach(([t,n])=>{e.push(` --semiont-color-neutral-${t}: ${n};`)}),Object.entries(Wg.spacing).forEach(([t,n])=>{e.push(` --semiont-spacing-${t}: ${n};`)}),Object.entries(Wg.typography.fontSize).forEach(([t,n])=>{e.push(` --semiont-text-${t}: ${n};`)}),Object.entries(Wg.typography.fontWeight).forEach(([t,n])=>{e.push(` --semiont-font-${t}: ${n};`)}),e.push(` --semiont-font-sans: ${Wg.typography.fontFamily.sans};`),e.push(` --semiont-font-mono: ${Wg.typography.fontFamily.mono};`),Object.entries(Wg.borderRadius).forEach(([t,n])=>{e.push(` --semiont-radius-${t}: ${n};`)}),Object.entries(Wg.shadows).forEach(([t,n])=>{e.push(` --semiont-shadow-${t}: ${n};`)}),Object.entries(Wg.transitions.duration).forEach(([t,n])=>{e.push(` --semiont-duration-${t}: ${n};`)}),e.push(`}`),e.join(`
|
|
11
|
+
`)}Gg();var Kg=(0,u.createContext)(null),qg={didCatch:!1,error:null},Jg=class extends u.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=qg}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(...e){let{error:t}=this.state;t!==null&&(this.props.onReset?.({args:e,reason:`imperative-api`}),this.setState(qg))}componentDidCatch(e,t){this.props.onError?.(e,t)}componentDidUpdate(e,t){let{didCatch:n}=this.state,{resetKeys:r}=this.props;n&&t.error!==null&&Yg(e.resetKeys,r)&&(this.props.onReset?.({next:r,prev:e.resetKeys,reason:`keys`}),this.setState(qg))}render(){let{children:e,fallbackRender:t,FallbackComponent:n,fallback:r}=this.props,{didCatch:i,error:a}=this.state,o=e;if(i){let e={error:a,resetErrorBoundary:this.resetErrorBoundary};if(typeof t==`function`)o=t(e);else if(n)o=(0,u.createElement)(n,e);else if(r!==void 0)o=r;else throw a}return(0,u.createElement)(Kg.Provider,{value:{didCatch:i,error:a,resetErrorBoundary:this.resetErrorBoundary}},o)}};function Yg(e=[],t=[]){return e.length!==t.length||e.some((e,n)=>!Object.is(e,t[n]))}var Xg=n((e=>{var t=r();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:n,a=t.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),Zg=n(((e,t)=>{t.exports=Xg()}));function Qg(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var $g=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,e_=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,t_={};function n_(e,t){return((t||t_).jsx?e_:$g).test(e)}var r_=/[ \t\n\f\r]/g;function i_(e){return typeof e==`object`?e.type===`text`?a_(e.value):!1:a_(e)}function a_(e){return e.replace(r_,``)===``}var o_=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};o_.prototype.normal={},o_.prototype.property={},o_.prototype.space=void 0;function s_(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new o_(n,r,t)}function c_(e){return e.toLowerCase()}var l_=class{constructor(e,t){this.attribute=t,this.property=e}};l_.prototype.attribute=``,l_.prototype.booleanish=!1,l_.prototype.boolean=!1,l_.prototype.commaOrSpaceSeparated=!1,l_.prototype.commaSeparated=!1,l_.prototype.defined=!1,l_.prototype.mustUseProperty=!1,l_.prototype.number=!1,l_.prototype.overloadedBoolean=!1,l_.prototype.property=``,l_.prototype.spaceSeparated=!1,l_.prototype.space=void 0;var u_=e({boolean:()=>B,booleanish:()=>f_,commaOrSpaceSeparated:()=>g_,commaSeparated:()=>h_,number:()=>V,overloadedBoolean:()=>p_,spaceSeparated:()=>m_}),d_=0,B=__(),f_=__(),p_=__(),V=__(),m_=__(),h_=__(),g_=__();function __(){return 2**++d_}var v_=Object.keys(u_),y_=class extends l_{constructor(e,t,n,r){let i=-1;if(super(e,t),b_(this,`space`,r),typeof n==`number`)for(;++i<v_.length;){let e=v_[i];b_(this,v_[i],(n&u_[e])===u_[e])}}};y_.prototype.defined=!0;function b_(e,t,n){n&&(e[t]=n)}function x_(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new y_(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[c_(r)]=r,n[c_(a.attribute)]=r}return new o_(t,n,e.space)}var S_=x_({properties:{ariaActiveDescendant:null,ariaAtomic:f_,ariaAutoComplete:null,ariaBusy:f_,ariaChecked:f_,ariaColCount:V,ariaColIndex:V,ariaColSpan:V,ariaControls:m_,ariaCurrent:null,ariaDescribedBy:m_,ariaDetails:null,ariaDisabled:f_,ariaDropEffect:m_,ariaErrorMessage:null,ariaExpanded:f_,ariaFlowTo:m_,ariaGrabbed:f_,ariaHasPopup:null,ariaHidden:f_,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:m_,ariaLevel:V,ariaLive:null,ariaModal:f_,ariaMultiLine:f_,ariaMultiSelectable:f_,ariaOrientation:null,ariaOwns:m_,ariaPlaceholder:null,ariaPosInSet:V,ariaPressed:f_,ariaReadOnly:f_,ariaRelevant:null,ariaRequired:f_,ariaRoleDescription:m_,ariaRowCount:V,ariaRowIndex:V,ariaRowSpan:V,ariaSelected:f_,ariaSetSize:V,ariaSort:null,ariaValueMax:V,ariaValueMin:V,ariaValueNow:V,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function C_(e,t){return t in e?e[t]:t}function w_(e,t){return C_(e,t.toLowerCase())}var T_=x_({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:h_,acceptCharset:m_,accessKey:m_,action:null,allow:null,allowFullScreen:B,allowPaymentRequest:B,allowUserMedia:B,alpha:B,alt:null,as:null,async:B,autoCapitalize:null,autoComplete:m_,autoFocus:B,autoPlay:B,blocking:m_,capture:null,charSet:null,checked:B,cite:null,className:m_,closedBy:null,colorSpace:null,cols:V,colSpan:V,command:null,commandFor:null,content:null,contentEditable:f_,controls:B,controlsList:m_,coords:V|h_,crossOrigin:null,data:null,dateTime:null,decoding:null,default:B,defer:B,dir:null,dirName:null,disabled:B,download:p_,draggable:f_,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:B,formTarget:null,headers:m_,height:V,hidden:p_,high:V,href:null,hrefLang:null,htmlFor:m_,httpEquiv:m_,id:null,imageSizes:null,imageSrcSet:null,inert:B,inputMode:null,integrity:null,is:null,isMap:B,itemId:null,itemProp:m_,itemRef:m_,itemScope:B,itemType:m_,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:B,low:V,manifest:null,max:null,maxLength:V,media:null,method:null,min:null,minLength:V,multiple:B,muted:B,name:null,nonce:null,noModule:B,noValidate:B,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:B,optimum:V,pattern:null,ping:m_,placeholder:null,playsInline:B,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:B,referrerPolicy:null,rel:m_,required:B,reversed:B,rows:V,rowSpan:V,sandbox:m_,scope:null,scoped:B,seamless:B,selected:B,shadowRootClonable:B,shadowRootCustomElementRegistry:B,shadowRootDelegatesFocus:B,shadowRootMode:null,shadowRootSerializable:B,shape:null,size:V,sizes:null,slot:null,span:V,spellCheck:f_,src:null,srcDoc:null,srcLang:null,srcSet:null,start:V,step:null,style:null,tabIndex:V,target:null,title:null,translate:null,type:null,typeMustMatch:B,useMap:null,value:f_,width:V,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:m_,axis:null,background:null,bgColor:null,border:V,borderColor:null,bottomMargin:V,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:B,declare:B,event:null,face:null,frame:null,frameBorder:null,hSpace:V,leftMargin:V,link:null,longDesc:null,lowSrc:null,marginHeight:V,marginWidth:V,noResize:B,noHref:B,noShade:B,noWrap:B,object:null,profile:null,prompt:null,rev:null,rightMargin:V,rules:null,scheme:null,scrolling:f_,standby:null,summary:null,text:null,topMargin:V,valueType:null,version:null,vAlign:null,vLink:null,vSpace:V,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:B,disablePictureInPicture:B,disableRemotePlayback:B,exportParts:h_,part:m_,prefix:null,property:null,results:V,security:null,unselectable:null},space:`html`,transform:w_}),E_=x_({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:g_,accentHeight:V,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:V,amplitude:V,arabicForm:null,ascent:V,attributeName:null,attributeType:null,azimuth:V,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:V,by:null,calcMode:null,capHeight:V,className:m_,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:V,diffuseConstant:V,direction:null,display:null,dur:null,divisor:V,dominantBaseline:null,download:B,dx:null,dy:null,edgeMode:null,editable:null,elevation:V,enableBackground:null,end:null,event:null,exponent:V,externalResourcesRequired:null,fill:null,fillOpacity:V,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:h_,g2:h_,glyphName:h_,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:V,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:V,horizOriginX:V,horizOriginY:V,id:null,ideographic:V,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:V,k:V,k1:V,k2:V,k3:V,k4:V,kernelMatrix:g_,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:V,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:V,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:V,overlineThickness:V,paintOrder:null,panose1:null,path:null,pathLength:V,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:m_,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:V,pointsAtY:V,pointsAtZ:V,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:g_,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:g_,rev:g_,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:g_,requiredFeatures:g_,requiredFonts:g_,requiredFormats:g_,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:V,specularExponent:V,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:V,strikethroughThickness:V,string:null,stroke:null,strokeDashArray:g_,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:V,strokeOpacity:V,strokeWidth:null,style:null,surfaceScale:V,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:g_,tabIndex:V,tableValues:null,target:null,targetX:V,targetY:V,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:g_,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:V,underlineThickness:V,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:V,values:null,vAlphabetic:V,vMathematical:V,vectorEffect:null,vHanging:V,vIdeographic:V,version:null,vertAdvY:V,vertOriginX:V,vertOriginY:V,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:V,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:C_}),D_=x_({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),O_=x_({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:w_}),k_=x_({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),A_={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},j_=/[A-Z]/g,M_=/-[a-z]/g,N_=/^data[-\w.:]+$/i;function P_(e,t){let n=c_(t),r=t,i=l_;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&N_.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(M_,I_);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!M_.test(e)){let n=e.replace(j_,F_);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=y_}return new i(r,t)}function F_(e){return`-`+e.toLowerCase()}function I_(e){return e.charAt(1).toUpperCase()}var L_=s_([S_,T_,D_,O_,k_],`html`),R_=s_([S_,E_,D_,O_,k_],`svg`);function z_(e){return e.join(` `).trim()}var B_=n(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g,u=`/`,d=`*`,f=``;function p(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,p=1;function h(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
|
|
12
|
+
`);p=~n?e.length-n:p+e.length}function g(){var e={line:l,column:p};return function(t){return t.position=new _(e),b(),t}}function _(e){this.start=e,this.end={line:l,column:p},this.source=t.source}_.prototype.content=e;function v(n){var r=Error(t.source+`:`+l+`:`+p+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=p,r.source=e,!t.silent)throw r}function y(t){var n=t.exec(e);if(n){var r=n[0];return h(r),e=e.slice(r.length),n}}function b(){y(i)}function x(e){var t;for(e||=[];t=S();)t!==!1&&e.push(t);return e}function S(){var t=g();if(!(u!=e.charAt(0)||d!=e.charAt(1))){for(var n=2;f!=e.charAt(n)&&(d!=e.charAt(n)||u!=e.charAt(n+1));)++n;if(n+=2,f===e.charAt(n-1))return v(`End of comment missing`);var r=e.slice(2,n-2);return p+=2,h(r),e=e.slice(n),p+=2,t({type:`comment`,comment:r})}}function C(){var e=g(),t=y(a);if(t){if(S(),!y(o))return v(`property missing ':'`);var r=y(s),i=e({type:`declaration`,property:m(t[0].replace(n,f)),value:r?m(r[0].replace(n,f)):f});return y(c),i}}function w(){var e=[];x(e);for(var t;t=C();)t!==!1&&(e.push(t),x(e));return e}return b(),w()}function m(e){return e?e.replace(l,f):f}t.exports=p})),V_=n((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var n=t(B_());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),H_=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),U_=n(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(V_()),r=H_();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),W_=K_(`end`),G_=K_(`start`);function K_(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function q_(e){let t=G_(e),n=W_(e);if(t&&n)return{start:t,end:n}}function J_(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?X_(e.position):`start`in e||`end`in e?X_(e):`line`in e||`column`in e?Y_(e):``}function Y_(e){return Z_(e&&e.line)+`:`+Z_(e&&e.column)}function X_(e){return Y_(e&&e.start)+`-`+Y_(e&&e.end)}function Z_(e){return e&&typeof e==`number`?e:1}var Q_=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=J_(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};Q_.prototype.file=``,Q_.prototype.name=``,Q_.prototype.reason=``,Q_.prototype.message=``,Q_.prototype.stack=``,Q_.prototype.column=void 0,Q_.prototype.line=void 0,Q_.prototype.ancestors=void 0,Q_.prototype.cause=void 0,Q_.prototype.fatal=void 0,Q_.prototype.place=void 0,Q_.prototype.ruleId=void 0,Q_.prototype.source=void 0;var $_=t(U_(),1),ev={}.hasOwnProperty,tv=new Map,nv=/[A-Z]/g,rv=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),iv=new Set([`td`,`th`]);function av(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=gv(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=hv(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?R_:L_,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=ov(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function ov(e,t,n){if(t.type===`element`)return sv(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return cv(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return uv(e,t,n);if(t.type===`mdxjsEsm`)return lv(e,t);if(t.type===`root`)return dv(e,t,n);if(t.type===`text`)return fv(e,t)}function sv(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=R_,e.schema=i),e.ancestors.push(t);let a=Sv(e,t.tagName,!1),o=_v(e,t),s=yv(e,t);return rv.has(t.tagName)&&(s=s.filter(function(e){return typeof e==`string`?!i_(e):!0})),pv(e,o,a,t),mv(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function cv(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Cv(e,t.position)}function lv(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Cv(e,t.position)}function uv(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=R_,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:Sv(e,t.name,!0),o=vv(e,t),s=yv(e,t);return pv(e,o,a,t),mv(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function dv(e,t,n){let r={};return mv(r,yv(e,t)),e.create(t,e.Fragment,r,n)}function fv(e,t){return t.value}function pv(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function mv(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function hv(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function gv(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=G_(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function _v(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&ev.call(t.properties,i)){let a=bv(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&iv.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function vv(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`)if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Cv(e,t.position);else{let i=r.name,a;if(r.value&&typeof r.value==`object`)if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else Cv(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function yv(e,t){let n=[],r=-1,i=e.passKeys?new Map:tv;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=ov(e,a,o);s!==void 0&&n.push(s)}return n}function bv(e,t,n){let r=P_(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Qg(n):z_(n)),r.property===`style`){let t=typeof n==`object`?n:xv(e,String(n));return e.stylePropertyNameCase===`css`&&(t=wv(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?A_[r.property]||r.property:r.attribute,n]}}function xv(e,t){try{return(0,$_.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new Q_("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=`https://github.com/syntax-tree/hast-util-to-jsx-runtime#cannot-parse-style-attribute`,r}}function Sv(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=n_(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=n_(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return ev.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);Cv(e)}function Cv(e,t){let n=new Q_("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=`https://github.com/syntax-tree/hast-util-to-jsx-runtime#cannot-handle-mdx-estrees-without-createevaluater`,n}function wv(e){let t={},n;for(n in e)ev.call(e,n)&&(t[Tv(n)]=e[n]);return t}function Tv(e){let t=e.replace(nv,Ev);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function Ev(e){return`-`+e.toLowerCase()}var Dv={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},Ov={};function kv(e,t){let n=t||Ov;return Av(e,typeof n.includeImageAlt==`boolean`?n.includeImageAlt:!0,typeof n.includeHtml==`boolean`?n.includeHtml:!0)}function Av(e,t,n){if(Mv(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return jv(e.children,t,n)}return Array.isArray(e)?jv(e,t,n):``}function jv(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=Av(e[i],t,n);return r.join(``)}function Mv(e){return!!(e&&typeof e==`object`)}function Nv(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function Pv(e,t){return e.length>0?(Nv(e,e.length,0,t),e):t}var Fv={}.hasOwnProperty;function Iv(e){let t={},n=-1;for(;++n<e.length;)Lv(t,e[n]);return t}function Lv(e,t){let n;for(n in t){let r=(Fv.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){Fv.call(r,a)||(r[a]=[]);let e=i[a];Rv(r[a],Array.isArray(e)?e:e?[e]:[])}}}function Rv(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);Nv(e,0,0,r)}var zv=Yv(/[A-Za-z]/),Bv=Yv(/[\dA-Za-z]/),Vv=Yv(/[#-'*+\--9=?A-Z^-~]/);function Hv(e){return e!==null&&(e<32||e===127)}var Uv=Yv(/\d/),Wv=Yv(/[\dA-Fa-f]/),Gv=Yv(/[!-/:-@[-`{-~]/);function H(e){return e!==null&&e<-2}function Kv(e){return e!==null&&(e<0||e===32)}function U(e){return e===-2||e===-1||e===32}var qv=Yv(/\p{P}|\p{S}/u),Jv=Yv(/\s/);function Yv(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Xv(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return U(r)?(e.enter(n),s(r)):t(r)}function s(r){return U(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var Zv={tokenize:Qv};function Qv(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Xv(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return H(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var $v={tokenize:ty},ey={tokenize:ny};function ty(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return Nv(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(ey,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(ey,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return H(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;Nv(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function ny(e,t,n){return Xv(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function ry(e){if(e===null||Kv(e)||Jv(e))return 1;if(qv(e))return 2}function iy(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var ay={name:`attention`,resolveAll:oy,tokenize:sy};function oy(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};cy(d,-c),cy(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=Pv(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=Pv(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=Pv(l,iy(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=Pv(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=Pv(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,Nv(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function sy(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=ry(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=ry(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function cy(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var ly={name:`autolink`,tokenize:uy};function uy(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return zv(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||Bv(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||Bv(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||Hv(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):Vv(t)?(e.consume(t),l):n(t)}function u(e){return Bv(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||Bv(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var dy={partial:!0,tokenize:fy};function fy(e,t,n){return r;function r(t){return U(t)?Xv(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||H(e)?t(e):n(e)}}var py={continuation:{tokenize:hy},exit:gy,name:`blockQuote`,tokenize:my};function my(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return U(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function hy(e,t,n){let r=this;return i;function i(t){return U(t)?Xv(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(py,t,n)(r)}}function gy(e){e.exit(`blockQuote`)}var _y={name:`characterEscape`,tokenize:vy};function vy(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return Gv(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var yy=document.createElement(`i`);function by(e){let t=`&`+e+`;`;yy.innerHTML=t;let n=yy.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`||n===t?!1:n}var xy={name:`characterReference`,tokenize:Sy};function Sy(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=Bv,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=Wv,u):(e.enter(`characterReferenceValue`),a=7,o=Uv,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===Bv&&!by(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var Cy={partial:!0,tokenize:Ey},wy={concrete:!0,name:`codeFenced`,tokenize:Ty};function Ty(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),U(t)?Xv(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||H(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(Cy,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||H(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):U(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),Xv(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||H(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||H(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&U(t)?Xv(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||H(t)?e.check(Cy,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||H(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),U(t)?Xv(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),U(t)?Xv(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||H(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function Ey(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var Dy={name:`codeIndented`,tokenize:ky},Oy={partial:!0,tokenize:Ay};function ky(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),Xv(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):H(t)?e.attempt(Oy,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||H(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function Ay(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):H(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):Xv(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):H(e)?i(e):n(e)}}var jy={name:`codeText`,previous:Ny,resolve:My,tokenize:Py};function My(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Ny(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function Py(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):H(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||H(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var Fy=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&Iy(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),Iy(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Iy(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){let t=this.left.splice(e,1/0);Iy(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);Iy(this.left,t.reverse())}}};function Iy(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Ly(e){let t={},n=-1,r,i,a,o,s,c,l,u=new Fy(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,Ry(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(!(o[1].type===`linePrefix`||o[1].type===`listItemIndent`))break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return Nv(e,0,1/0,u.slice(0)),!l}function Ry(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var zy={resolve:Vy,tokenize:Hy},By={partial:!0,tokenize:Uy};function Vy(e){return Ly(e),e}function Hy(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):H(t)?e.check(By,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function Uy(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Xv(e,a,`linePrefix`)}function a(i){if(i===null||H(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function Wy(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||Hv(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||H(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||Kv(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||Hv(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function Gy(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):H(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||H(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!U(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function Ky(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):H(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Xv(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||H(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function qy(e,t){let n;return r;function r(i){return H(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):U(i)?Xv(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}function Jy(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var Yy={name:`definition`,tokenize:Zy},Xy={partial:!0,tokenize:Qy};function Zy(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return Gy.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=Jy(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return Kv(t)?qy(e,l)(t):l(t)}function l(t){return Wy(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(Xy,d,d)(t)}function d(t){return U(t)?Xv(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||H(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function Qy(e,t,n){return r;function r(t){return Kv(t)?qy(e,i)(t):n(t)}function i(t){return Ky(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return U(t)?Xv(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||H(e)?t(e):n(e)}}var $y={name:`hardBreakEscape`,tokenize:eb};function eb(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return H(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var tb={name:`headingAtx`,resolve:nb,tokenize:rb};function nb(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},Nv(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function rb(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||Kv(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||H(n)?(e.exit(`atxHeading`),t(n)):U(n)?Xv(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||Kv(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var ib=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),ab=[`pre`,`script`,`style`,`textarea`],ob={concrete:!0,name:`htmlFlow`,resolveTo:lb,tokenize:ub},sb={partial:!0,tokenize:fb},cb={partial:!0,tokenize:db};function lb(e){let t=e.length;for(;t--&&!(e[t][0]===`enter`&&e[t][1].type===`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function ub(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:ne):zv(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):zv(a)?(e.consume(a),i=4,r.interrupt?t:ne):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:ne):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return zv(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||Kv(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&ab.includes(l)?(i=1,r.interrupt?t(s):O(s)):ib.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||Bv(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return U(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||zv(t)?(e.consume(t),b):U(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||Bv(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):U(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):U(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||H(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||Kv(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||U(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||H(t)?O(t):U(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),ee):t===60&&i===1?(e.consume(t),M):t===62&&i===4?(e.consume(t),re):t===63&&i===3?(e.consume(t),ne):t===93&&i===5?(e.consume(t),te):H(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(sb,ie,k)(t)):t===null||H(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(cb,A,ie)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||H(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function ee(t){return t===45?(e.consume(t),ne):O(t)}function M(t){return t===47?(e.consume(t),o=``,N):O(t)}function N(t){if(t===62){let n=o.toLowerCase();return ab.includes(n)?(e.consume(t),re):O(t)}return zv(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),N):O(t)}function te(t){return t===93?(e.consume(t),ne):O(t)}function ne(t){return t===62?(e.consume(t),re):t===45&&i===2?(e.consume(t),ne):O(t)}function re(t){return t===null||H(t)?(e.exit(`htmlFlowData`),ie(t)):(e.consume(t),re)}function ie(n){return e.exit(`htmlFlow`),t(n)}}function db(e,t,n){let r=this;return i;function i(t){return H(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function fb(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(dy,t,n)}}var pb={name:`htmlText`,tokenize:mb};function mb(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):zv(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):zv(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):H(t)?(o=d,M(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?ee(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):H(t)?(o=h,M(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?ee(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?ee(t):H(t)?(o=v,M(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):H(t)?(o=y,M(t)):(e.consume(t),y)}function b(e){return e===62?ee(e):y(e)}function x(t){return zv(t)?(e.consume(t),S):n(t)}function S(t){return t===45||Bv(t)?(e.consume(t),S):C(t)}function C(t){return H(t)?(o=C,M(t)):U(t)?(e.consume(t),C):ee(t)}function w(t){return t===45||Bv(t)?(e.consume(t),w):t===47||t===62||Kv(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),ee):t===58||t===95||zv(t)?(e.consume(t),E):H(t)?(o=T,M(t)):U(t)?(e.consume(t),T):ee(t)}function E(t){return t===45||t===46||t===58||t===95||Bv(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):H(t)?(o=D,M(t)):U(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):H(t)?(o=O,M(t)):U(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):H(t)?(o=k,M(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||Kv(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||Kv(e)?T(e):n(e)}function ee(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function M(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),N}function N(t){return U(t)?Xv(e,te,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):te(t)}function te(t){return e.enter(`htmlTextData`),o(t)}}var hb={name:`labelEnd`,resolveAll:yb,resolveTo:bb,tokenize:xb},gb={tokenize:Sb},_b={tokenize:Cb},vb={tokenize:wb};function yb(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&Nv(e,0,e.length,n),e}function bb(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=Pv(s,e.slice(a+1,a+r+3)),s=Pv(s,[[`enter`,u,t]]),s=Pv(s,iy(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=Pv(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=Pv(s,e.slice(o+1)),s=Pv(s,[[`exit`,c,t]]),Nv(e,a,e.length,s),e}function xb(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(Jy(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(gb,u,o?u:d)(t):t===91?e.attempt(_b,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(vb,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function Sb(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return Kv(t)?qy(e,a)(t):a(t)}function a(t){return t===41?u(t):Wy(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return Kv(t)?qy(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?Ky(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return Kv(t)?qy(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function Cb(e,t,n){let r=this;return i;function i(t){return Gy.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(Jy(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function wb(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var Tb={name:`labelStartImage`,resolveAll:hb.resolveAll,tokenize:Eb};function Eb(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var Db={name:`labelStartLink`,resolveAll:hb.resolveAll,tokenize:Ob};function Ob(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var kb={name:`lineEnding`,tokenize:Ab};function Ab(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Xv(e,t,`linePrefix`)}}var jb={name:`thematicBreak`,tokenize:Mb};function Mb(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||H(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),U(t)?Xv(e,s,`whitespace`)(t):s(t))}}var Nb={continuation:{tokenize:Lb},exit:zb,name:`list`,tokenize:Ib},Pb={partial:!0,tokenize:Bb},Fb={partial:!0,tokenize:Rb};function Ib(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:Uv(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(jb,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return Uv(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(dy,r.interrupt?n:u,e.attempt(Pb,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return U(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function Lb(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(dy,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Xv(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!U(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Fb,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Xv(e,e.attempt(Nb,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function Rb(e,t,n){let r=this;return Xv(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function zb(e){e.exit(this.containerState.type)}function Bb(e,t,n){let r=this;return Xv(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!U(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var Vb={name:`setextUnderline`,resolveTo:Hb,tokenize:Ub};function Hb(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function Ub(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),U(t)?Xv(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||H(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var Wb={tokenize:Gb};function Gb(e){let t=this,n=e.attempt(dy,r,e.attempt(this.parser.constructs.flowInitial,i,Xv(e,e.attempt(this.parser.constructs.flow,i,e.attempt(zy,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var Kb={resolveAll:Xb()},qb=Yb(`string`),Jb=Yb(`text`);function Yb(e){return{resolveAll:Xb(e===`text`?Zb:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function Xb(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function Zb(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var Qb=e({attentionMarkers:()=>ox,contentInitial:()=>ex,disable:()=>sx,document:()=>$b,flow:()=>nx,flowInitial:()=>tx,insideSpan:()=>ax,string:()=>rx,text:()=>ix}),$b={42:Nb,43:Nb,45:Nb,48:Nb,49:Nb,50:Nb,51:Nb,52:Nb,53:Nb,54:Nb,55:Nb,56:Nb,57:Nb,62:py},ex={91:Yy},tx={[-2]:Dy,[-1]:Dy,32:Dy},nx={35:tb,42:jb,45:[Vb,jb],60:ob,61:Vb,95:jb,96:wy,126:wy},rx={38:xy,92:_y},ix={[-5]:kb,[-4]:kb,[-3]:kb,33:Tb,38:xy,42:ay,60:[ly,pb],91:Db,92:[$y,_y],93:hb,95:ay,96:jy},ax={null:[ay,Kb]},ox={null:[42,95]},sx={null:[]};function cx(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=Pv(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=iy(a,l.events,l),l.events):[]}function f(e,t){return ux(p(e),t)}function p(e){return lx(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){H(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&Nv(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function lx(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function ux(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
|
|
13
|
+
`;break;case-3:o=`\r
|
|
14
|
+
`;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function dx(e){let t={constructs:Iv([Qb,...(e||{}).extensions||[]]),content:n(Zv),defined:[],document:n($v),flow:n(Wb),lazy:{},string:n(qb),text:n(Jb)};return t;function n(e){return n;function n(n){return cx(t,e,n)}}}function fx(e){for(;!Ly(e););return e}var px=/[\0\t\n\r]/g;function mx(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(px.lastIndex=u,c=px.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}function hx(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}var gx=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function _x(e){return e.replace(gx,vx)}function vx(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return hx(n.slice(t?2:1),t?16:10)}return by(n)||e}var yx={}.hasOwnProperty;function bx(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),xx(n)(fx(dx(n).document().write(mx()(e,t,!0))))}function xx(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(be),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(ge),blockQuote:a(de),characterEscape:T,characterReference:T,codeFenced:a(fe),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(fe,o),codeText:a(pe,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(me),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(he),hardBreakEscape:a(_e),hardBreakTrailing:a(_e),htmlFlow:a(ve,o),htmlFlowData:T,htmlText:a(ve,o),htmlTextData:T,image:a(ye),label:o,link:a(be),listItem:a(Se),listItemValue:f,listOrdered:a(xe,d),listUnordered:a(xe),paragraph:a(Ce),reference:ae,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(ge),strong:a(we),thematicBreak:a(Ee)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:ue,autolinkProtocol:le,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:se,characterReferenceMarkerNumeric:se,characterReferenceValue:ce,characterReference:P,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(j),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(A),htmlTextData:E,image:c(M),label:te,labelText:N,lineEnding:D,link:c(ee),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:oe,resourceDestinationString:ne,resourceTitleString:re,resource:ie,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};Cx(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];yx.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||Tx).call(a,void 0,e[0])}for(r.position={start:Sx(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:Sx(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(!(t[1].type===`linePrefix`||t[1].type===`blockQuotePrefix`||t[1].type===`blockQuotePrefixWhitespace`||t[1].type===`blockQuoteMarker`||t[1].type===`listItemIndent`))break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:Sx(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||Tx).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+J_({start:e.start,end:e.end})+`): it’s not open`);n.position.end=Sx(e.end)}function u(){return kv(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Jy(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=Te(),n.position={start:Sx(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=Sx(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=Sx(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ee(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function M(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function N(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=_x(t),n.identifier=Jy(t).toLowerCase()}function te(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function ne(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function re(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function ie(){this.data.inReference=void 0}function ae(){this.data.referenceType=`collapsed`}function oe(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Jy(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function se(e){this.data.characterReferenceType=e.type}function ce(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=hx(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=by(t);let i=this.stack[this.stack.length-1];i.value+=r}function P(e){let t=this.stack.pop();t.position.end=Sx(e.end)}function le(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function ue(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function de(){return{type:`blockquote`,children:[]}}function fe(){return{type:`code`,lang:null,meta:null,value:``}}function pe(){return{type:`inlineCode`,value:``}}function me(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function he(){return{type:`emphasis`,children:[]}}function ge(){return{type:`heading`,depth:0,children:[]}}function _e(){return{type:`break`}}function ve(){return{type:`html`,value:``}}function ye(){return{type:`image`,title:null,url:``,alt:null}}function be(){return{type:`link`,title:null,url:``,children:[]}}function xe(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function Se(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function Ce(){return{type:`paragraph`,children:[]}}function we(){return{type:`strong`,children:[]}}function Te(){return{type:`text`,value:``}}function Ee(){return{type:`thematicBreak`}}}function Sx(e){return{line:e.line,column:e.column,offset:e.offset}}function Cx(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?Cx(e,r):wx(e,r)}}function wx(e,t){let n;for(n in t)if(yx.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function Tx(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+J_({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+J_({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+J_({start:t.start,end:t.end})+`) is still open`)}function Ex(e){let t=this;t.parser=n;function n(n){return bx(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}var Dx=typeof self==`object`?self:globalThis,Ox=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new Dx[e](t)},kx=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(Ox(e,t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(Ox(a,o),i)};return r},Ax=e=>kx(new Map,e)(0),jx=``,{toString:Mx}={},{keys:Nx}=Object,Px=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=Mx.call(e).slice(8,-1);switch(n){case`Array`:return[1,jx];case`Object`:return[2,jx];case`Date`:return[3,jx];case`RegExp`:return[4,jx];case`Map`:return[5,jx];case`Set`:return[6,jx];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:n.includes(`Error`)?[7,n]:[2,n]},Fx=([e,t])=>e===0&&(t===`function`||t===`symbol`),Ix=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=Px(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of Nx(r))(e||!Fx(Px(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(Fx(Px(n))||Fx(Px(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!Fx(Px(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},Lx=(e,{json:t,lossy:n}={})=>{let r=[];return Ix(!(t||n),!!t,new Map,r)(e),r},Rx=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?Ax(Lx(e,t)):structuredClone(e):(e,t)=>Ax(Lx(e,t));function zx(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&Bv(e.charCodeAt(n+1))&&Bv(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function Bx(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function Vx(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function Hx(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||Bx,r=e.options.footnoteBackLabel||Vx,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=zx(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...Rx(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
|
|
15
|
+
`},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
|
|
16
|
+
`}]}}var Ux=(function(e){if(e==null)return Jx;if(typeof e==`function`)return qx(e);if(typeof e==`object`)return Array.isArray(e)?Wx(e):Gx(e);if(typeof e==`string`)return Kx(e);throw Error(`Expected function, string, or object as test`)});function Wx(e){let t=[],n=-1;for(;++n<e.length;)t[n]=Ux(e[n]);return qx(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function Gx(e){let t=e;return qx(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function Kx(e){return qx(t);function t(t){return t&&t.type===e}}function qx(e){return t;function t(t,n,r){return!!(Yx(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function Jx(){return!0}function Yx(e){return typeof e==`object`&&!!e&&`type`in e}function Xx(e){return e}var Zx=[];function Qx(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=Ux(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+Xx(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=Zx,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=$x(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function $x(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?Zx:[e]}function eS(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),Qx(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}function tS(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function nS(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
17
|
+
`}]}function rS(e,t){let n=t.value?t.value+`
|
|
18
|
+
`:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function iS(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function aS(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function oS(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=zx(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function sS(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function cS(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function lS(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function uS(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return lS(e,t);let i={src:zx(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function dS(e,t){let n={src:zx(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function fS(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function pS(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return lS(e,t);let i={href:zx(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function mS(e,t){let n={href:zx(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function hS(e,t,n){let r=e.all(t),i=n?gS(n):_S(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
19
|
+
`}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
20
|
+
`});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function gS(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=_S(n[r])}return t}function _S(e){return e.spread??e.children.length>1}function vS(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function yS(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function bS(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function xS(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function SS(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=G_(t.children[1]),o=W_(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function CS(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function wS(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var TS=9,ES=32;function DS(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(OS(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(OS(t.slice(i),i>0,!1)),a.join(``)}function OS(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===TS||t===ES;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===TS||t===ES;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function kS(e,t){let n={type:`text`,value:DS(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function AS(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var jS={blockquote:tS,break:nS,code:rS,delete:iS,emphasis:aS,footnoteReference:oS,heading:sS,html:cS,imageReference:uS,image:dS,inlineCode:fS,linkReference:pS,link:mS,listItem:hS,list:vS,paragraph:yS,root:bS,strong:xS,table:SS,tableCell:wS,tableRow:CS,text:kS,thematicBreak:AS,toml:MS,yaml:MS,definition:MS,footnoteDefinition:MS};function MS(){}var NS={}.hasOwnProperty,PS={};function FS(e,t){let n=t||PS,r=new Map,i=new Map,a={all:s,applyData:LS,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...jS,...n.handlers},one:o,options:n,patch:IS,wrap:zS};return eS(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(NS.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=Rx(n);return r.children=a.all(e),r}return Rx(e)}return(a.options.unknownHandler||RS)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=BS(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=BS(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function IS(e,t){e.position&&(t.position=q_(e))}function LS(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,Rx(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function RS(e,t){let n=t.data||{},r=`value`in t&&!(NS.call(n,`hProperties`)||NS.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function zS(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
|
|
21
|
+
`});++r<e.length;)r&&n.push({type:`text`,value:`
|
|
22
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
|
|
23
|
+
`}),n}function BS(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function VS(e,t){let n=FS(e,t),r=n.one(e,void 0),i=Hx(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
|
|
24
|
+
`},i)),a}function HS(e,t){return e&&`run`in e?async function(n,r){let i=VS(n,{file:r,...t});await e.run(i,r)}:function(n,r){return VS(n,{file:r,...e||t})}}function US(e){if(e)throw e}var WS=n(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function GS(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function KS(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?qS(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function qS(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var JS={basename:YS,dirname:XS,extname:ZS,join:QS,sep:`/`};function YS(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);tC(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function XS(e){if(tC(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function ZS(e){tC(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function QS(...e){let t=-1,n;for(;++t<e.length;)tC(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:$S(n)}function $S(e){tC(e);let t=e.codePointAt(0)===47,n=eC(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function eC(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(!(i===o-1||a===1))if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function tC(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var nC={cwd:rC};function rC(){return`/`}function iC(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function aC(e){if(typeof e==`string`)e=new URL(e);else if(!iC(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return oC(e)}function oC(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var sC=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],cC=class{constructor(e){let t;t=e?iC(e)?{path:e}:typeof e==`string`||fC(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:nC.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<sC.length;){let e=sC[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)sC.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?JS.basename(this.path):void 0}set basename(e){uC(e,`basename`),lC(e,`basename`),this.path=JS.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?JS.dirname(this.path):void 0}set dirname(e){dC(this.basename,`dirname`),this.path=JS.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?JS.extname(this.path):void 0}set extname(e){if(lC(e,`extname`),dC(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=JS.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){iC(e)&&(e=aC(e)),uC(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?JS.basename(this.path,this.extname):void 0}set stem(e){uC(e,`stem`),lC(e,`stem`),this.path=JS.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new Q_(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function lC(e,t){if(e&&e.includes(JS.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+JS.sep+"`")}function uC(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function dC(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function fC(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var pC=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),mC=t(WS(),1),hC={}.hasOwnProperty,gC=new class e extends pC{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=KS()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,mC.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(yC(`data`,this.frozen),this.namespace[e]=t,this):hC.call(this.namespace,e)&&this.namespace[e]||void 0:e?(yC(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=SC(e),n=this.parser||this.Parser;return _C(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),_C(`process`,this.parser||this.Parser),vC(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=SC(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);wC(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),_C(`processSync`,this.parser||this.Parser),vC(`processSync`,this.compiler||this.Compiler),this.process(e,r),xC(`processSync`,`process`,t),n;function r(e,r){t=!0,US(e),n=r}}run(e,t,n){bC(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=SC(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),xC(`runSync`,`run`,n),r;function i(e,t){US(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=SC(t),r=this.compiler||this.Compiler;return vC(`stringify`,r),bC(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(yC(`use`,this.frozen),e!=null)if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`)if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e);else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,mC.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null)if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];GS(o)&&GS(r)&&(r=(0,mC.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function _C(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function vC(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function yC(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function bC(e){if(!GS(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function xC(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function SC(e){return CC(e)?e:new cC(e)}function CC(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function wC(e){return typeof e==`string`||TC(e)}function TC(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var EC=[],DC={allowDangerousHtml:!0},OC=/^(https?|ircs?|mailto|xmpp)$/i,kC=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function AC(e){let t=jC(e),n=MC(e);return NC(t.runSync(t.parse(n),n),e)}function jC(e){let t=e.rehypePlugins||EC,n=e.remarkPlugins||EC,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...DC}:DC;return gC().use(Ex).use(n).use(HS,r).use(t)}function MC(e){let t=e.children||``,n=new cC;return typeof t==`string`?n.value=t:``+t,n}function NC(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||PC;for(let e of kC)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return eS(e,l),av(e,{Fragment:F.Fragment,components:i,ignoreInvalidStyle:!0,jsx:F.jsx,jsxs:F.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in Dv)if(Object.hasOwn(Dv,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=Dv[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function PC(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||OC.test(e.slice(0,t))?e:``}function FC(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function IC(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function LC(e,t,n){let r=Ux((n||{}).ignore||[]),i=RC(t),a=-1;for(;++a<i.length;)Qx(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function RC(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([zC(e[0]),BC(e[1])])}return t}function zC(e){return typeof e==`string`?new RegExp(IC(e),`g`):e}function BC(e){return typeof e==`function`?e:function(){return e}}var VC=`phrasing`,HC=[`autolink`,`link`,`image`,`label`];function UC(){return{transforms:[ZC],enter:{literalAutolink:GC,literalAutolinkEmail:KC,literalAutolinkHttp:KC,literalAutolinkWww:KC},exit:{literalAutolink:XC,literalAutolinkEmail:YC,literalAutolinkHttp:qC,literalAutolinkWww:JC}}}function WC(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:VC,notInConstruct:HC},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:VC,notInConstruct:HC},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:VC,notInConstruct:HC}]}}function GC(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function KC(e){this.config.enter.autolinkProtocol.call(this,e)}function qC(e){this.config.exit.autolinkProtocol.call(this,e)}function JC(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function YC(e){this.config.exit.autolinkEmail.call(this,e)}function XC(e){this.exit(e)}function ZC(e){LC(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,QC],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,$C]],{ignore:[`link`,`linkReference`]})}function QC(e,t,n,r,i){let a=``;if(!nw(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!ew(n)))return!1;let o=tw(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function $C(e,t,n,r){return!nw(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function ew(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function tw(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=FC(e,`(`),a=FC(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function nw(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||Jv(n)||qv(n))&&(!t||n!==47)}fw.peek=dw;function rw(){this.buffer()}function iw(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function aw(){this.buffer()}function ow(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function sw(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Jy(this.sliceSerialize(e)).toLowerCase(),n.label=t}function cw(e){this.exit(e)}function lw(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Jy(this.sliceSerialize(e)).toLowerCase(),n.label=t}function uw(e){this.exit(e)}function dw(){return`[`}function fw(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function pw(){return{enter:{gfmFootnoteCallString:rw,gfmFootnoteCall:iw,gfmFootnoteDefinitionLabelString:aw,gfmFootnoteDefinition:ow},exit:{gfmFootnoteCallString:sw,gfmFootnoteCall:cw,gfmFootnoteDefinitionLabelString:lw,gfmFootnoteDefinition:uw}}}function mw(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:fw},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
|
|
25
|
+
`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?gw:hw))),s(),o}}function hw(e,t,n){return t===0?e:gw(e,t,n)}function gw(e,t,n){return(n?``:` `)+e}var _w=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];Sw.peek=Cw;function vw(){return{canContainEols:[`delete`],enter:{strikethrough:bw},exit:{strikethrough:xw}}}function yw(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:_w}],handlers:{delete:Sw}}}function bw(e){this.enter({type:`delete`,children:[]},e)}function xw(e){this.exit(e)}function Sw(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function Cw(){return`~`}function ww(e){return e.length}function Tw(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||ww,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=Ew(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=Dw(r[d]);else{let e=Dw(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&!(n.alignDelimiters===!1&&i===``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
|
|
26
|
+
`)}function Ew(e){return e==null?``:String(e)}function Dw(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function Ow(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),kw);return i(),o}function kw(e,t,n){return`>`+(n?``:` `)+e}function Aw(e,t){return jw(e,t.inConstruct,!0)&&!jw(e,t.notInConstruct,!1)}function jw(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Mw(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
27
|
+
`&&Aw(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
|
|
28
|
+
`}function Nw(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function Pw(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function Fw(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Iw(e,t,n,r){let i=Fw(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(Pw(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,Lw);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(Nw(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
|
|
29
|
+
`,encode:["`"],...s.current()})),t()}return u+=s.move(`
|
|
30
|
+
`),a&&(u+=s.move(a+`
|
|
31
|
+
`)),u+=s.move(c),l(),u}function Lw(e,t,n){return(n?``:` `)+e}function Rw(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function zw(e,t,n,r){let i=Rw(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
|
|
32
|
+
`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function Bw(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Vw(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function Hw(e,t,n){let r=ry(e),i=ry(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Uw.peek=Ww;function Uw(e,t,n,r){let i=Bw(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=Hw(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=Vw(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=Hw(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+Vw(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Ww(e,t,n){return n.options.emphasis||`*`}function Gw(e,t){let n=!1;return eS(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&kv(e)&&(t.options.setext||n))}function Kw(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(Gw(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
|
|
33
|
+
`,after:`
|
|
34
|
+
`});return r(),t(),o+`
|
|
35
|
+
`+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
|
|
36
|
+
`))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
|
|
37
|
+
`,...a.current()});return/^[\t ]/.test(l)&&(l=Vw(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}qw.peek=Jw;function qw(e){return e.value||``}function Jw(){return`<`}Yw.peek=Xw;function Yw(e,t,n,r){let i=Rw(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function Xw(){return`!`}Zw.peek=Qw;function Zw(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function Qw(){return`!`}$w.peek=eT;function $w(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function eT(){return"`"}function tT(e,t){let n=kv(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type===`text`&&(n===e.url||`mailto:`+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}nT.peek=rT;function nT(e,t,n,r){let i=Rw(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(tT(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function rT(e,t,n){return tT(e,n)?`<`:`[`}iT.peek=aT;function iT(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function aT(){return`[`}function oT(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function sT(e){let t=oT(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function cT(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function lT(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function uT(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?cT(n):oT(n),s=e.ordered?o===`.`?`)`:`.`:sT(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),lT(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function dT(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function fT(e,t,n,r){let i=dT(n),a=n.bulletCurrent||oT(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function pT(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var mT=Ux([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function hT(e,t,n,r){return(e.children.some(function(e){return mT(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function gT(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}_T.peek=vT;function _T(e,t,n,r){let i=gT(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=Hw(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=Vw(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=Hw(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+Vw(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function vT(e,t,n){return n.options.strong||`*`}function yT(e,t,n,r){return n.safe(e.value,r)}function bT(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function xT(e,t,n){let r=(lT(n)+(n.options.ruleSpaces?` `:``)).repeat(bT(n));return n.options.ruleSpaces?r.slice(0,-1):r}var ST={blockquote:Ow,break:Mw,code:Iw,definition:zw,emphasis:Uw,hardBreak:Mw,heading:Kw,html:qw,image:Yw,imageReference:Zw,inlineCode:$w,link:nT,linkReference:iT,list:uT,listItem:fT,paragraph:pT,root:hT,strong:_T,text:yT,thematicBreak:xT};function CT(){return{enter:{table:wT,tableData:OT,tableHeader:OT,tableRow:ET},exit:{codeText:kT,table:TT,tableData:DT,tableHeader:DT,tableRow:DT}}}function wT(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function TT(e){this.exit(e),this.data.inTable=void 0}function ET(e){this.enter({type:`tableRow`,children:[]},e)}function DT(e){this.exit(e)}function OT(e){this.enter({type:`tableCell`,children:[]},e)}function kT(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,AT));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function AT(e,t){return t===`|`?t:e}function jT(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
|
|
38
|
+
`,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
|
|
39
|
+
`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return Tw(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=ST.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function MT(){return{exit:{taskListCheckValueChecked:PT,taskListCheckValueUnchecked:PT,paragraph:FT}}}function NT(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:IT}}}function PT(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function FT(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function IT(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=ST.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function LT(){return[UC(),pw(),vw(),CT(),MT()]}function RT(e){return{extensions:[WC(),mw(e),yw(),jT(e),NT()]}}var zT={tokenize:$T,partial:!0},BT={tokenize:eE,partial:!0},VT={tokenize:tE,partial:!0},HT={tokenize:nE,partial:!0},UT={tokenize:rE,partial:!0},WT={name:`wwwAutolink`,tokenize:ZT,previous:iE},GT={name:`protocolAutolink`,tokenize:QT,previous:aE},KT={name:`emailAutolink`,tokenize:XT,previous:oE},qT={};function JT(){return{text:qT}}for(var YT=48;YT<123;)qT[YT]=KT,YT++,YT===58?YT=65:YT===91&&(YT=97);qT[43]=KT,qT[45]=KT,qT[46]=KT,qT[95]=KT,qT[72]=[KT,GT],qT[104]=[KT,GT],qT[87]=[KT,WT],qT[119]=[KT,WT];function XT(e,t,n){let r=this,i,a;return o;function o(t){return!sE(t)||!oE.call(r,r.previous)||cE(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return sE(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(UT,u,l)(t):t===45||t===95||Bv(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&zv(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function ZT(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!iE.call(r,r.previous)||cE(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(zT,e.attempt(BT,e.attempt(VT,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function QT(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&aE.call(r,r.previous)&&!cE(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(zv(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||Hv(t)||Kv(t)||Jv(t)||qv(t)?n(t):e.attempt(BT,e.attempt(VT,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function $T(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function eE(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(HT,c,s)(t):t===null||Kv(t)||Jv(t)||t!==45&&qv(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function tE(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(HT,t,a)(o):o===null||Kv(o)||Jv(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function nE(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||Kv(o)||Jv(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||Kv(e)||Jv(e)?t(e):r(e)}function a(e){return zv(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):zv(t)?(e.consume(t),o):n(t)}}function rE(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return Bv(e)?n(e):t(e)}}function iE(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Kv(e)}function aE(e){return!zv(e)}function oE(e){return!(e===47||sE(e))}function sE(e){return e===43||e===45||e===46||e===95||Bv(e)}function cE(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var lE={tokenize:_E,partial:!0};function uE(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:mE,continuation:{tokenize:hE},exit:gE}},text:{91:{name:`gfmFootnoteCall`,tokenize:pE},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:dE,resolveTo:fE}}}}function dE(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=Jy(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function fE(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function pE(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||Kv(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(Jy(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return Kv(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function mE(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||Kv(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=Jy(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return Kv(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),Xv(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function hE(e,t,n){return e.check(dy,t,e.attempt(lE,t,n))}function gE(e){e.exit(`gfmFootnoteDefinition`)}function _E(e,t,n){let r=this;return Xv(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function vE(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&Nv(o,o.length,0,iy(s,e.slice(r+1,n),t)),Nv(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),Nv(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=ry(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=ry(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var yE=class{constructor(){this.map=[]}add(e,t,n){bE(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function bE(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function xE(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function SE(){return{flow:{null:{name:`table`,tokenize:CE,resolveAll:wE}}}}function CE(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):H(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):U(t)?Xv(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||Kv(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,U(t)?Xv(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return U(t)?Xv(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||H(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return U(t)?Xv(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||H(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||H(n)?(e.exit(`tableRow`),t(n)):U(n)?Xv(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||Kv(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function wE(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new yE;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(EE(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=TE(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=TE(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=TE(f,t,o,i,n,d)):(o[0]=o[1],d=TE(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&EE(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=xE(t.events,n))}return e}function TE(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},DE(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=DE(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=DE(t.events,n[2]),a=DE(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},DE(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function EE(e,t,n,r,i){let a=[],o=DE(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function DE(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var OE={name:`tasklistCheck`,tokenize:AE};function kE(){return{text:{91:OE}}}function AE(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return Kv(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return H(r)?t(r):U(r)?e.check({tokenize:jE},t,n)(r):n(r)}}function jE(e,t,n){return Xv(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function ME(e){return Iv([JT(),uE(),vE(e),SE(),kE()])}var NE={};function PE(e){let t=this,n=e||NE,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(ME(n)),a.push(LT()),o.push(RT(n))}var FE=Zg(),IE=I({"../../node_modules/rxjs/dist/cjs/internal/operators/partition.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.partition=void 0;var t=bm(),n=xm();function r(e,r){return function(i){return[n.filter(e,r)(i),n.filter(t.not(e,r))(i)]}}e.partition=r}}),LE=I({"../../node_modules/rxjs/dist/cjs/internal/operators/race.js"(e){var t=e&&e.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},n=e&&e.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(e,"__esModule",{value:!0}),e.race=void 0;var r=_m(),i=Vh();function a(){var e=[...arguments];return i.raceWith.apply(void 0,n([],t(r.argsOrArgArray(e))))}e.race=a}}),RE=I({"../../node_modules/rxjs/dist/cjs/operators/index.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.mergeAll=e.merge=e.max=e.materialize=e.mapTo=e.map=e.last=e.isEmpty=e.ignoreElements=e.groupBy=e.first=e.findIndex=e.find=e.finalize=e.filter=e.expand=e.exhaustMap=e.exhaustAll=e.exhaust=e.every=e.endWith=e.elementAt=e.distinctUntilKeyChanged=e.distinctUntilChanged=e.distinct=e.dematerialize=e.delayWhen=e.delay=e.defaultIfEmpty=e.debounceTime=e.debounce=e.count=e.connect=e.concatWith=e.concatMapTo=e.concatMap=e.concatAll=e.concat=e.combineLatestWith=e.combineLatest=e.combineLatestAll=e.combineAll=e.catchError=e.bufferWhen=e.bufferToggle=e.bufferTime=e.bufferCount=e.buffer=e.auditTime=e.audit=void 0,e.timeInterval=e.throwIfEmpty=e.throttleTime=e.throttle=e.tap=e.takeWhile=e.takeUntil=e.takeLast=e.take=e.switchScan=e.switchMapTo=e.switchMap=e.switchAll=e.subscribeOn=e.startWith=e.skipWhile=e.skipUntil=e.skipLast=e.skip=e.single=e.shareReplay=e.share=e.sequenceEqual=e.scan=e.sampleTime=e.sample=e.refCount=e.retryWhen=e.retry=e.repeatWhen=e.repeat=e.reduce=e.raceWith=e.race=e.publishReplay=e.publishLast=e.publishBehavior=e.publish=e.pluck=e.partition=e.pairwise=e.onErrorResumeNext=e.observeOn=e.multicast=e.min=e.mergeWith=e.mergeScan=e.mergeMapTo=e.mergeMap=e.flatMap=void 0,e.zipWith=e.zipAll=e.zip=e.withLatestFrom=e.windowWhen=e.windowToggle=e.windowTime=e.windowCount=e.window=e.toArray=e.timestamp=e.timeoutWith=e.timeout=void 0;var t=Om();Object.defineProperty(e,"audit",{enumerable:!0,get:function(){return t.audit}});var n=km();Object.defineProperty(e,"auditTime",{enumerable:!0,get:function(){return n.auditTime}});var r=Am();Object.defineProperty(e,"buffer",{enumerable:!0,get:function(){return r.buffer}});var i=jm();Object.defineProperty(e,"bufferCount",{enumerable:!0,get:function(){return i.bufferCount}});var a=Mm();Object.defineProperty(e,"bufferTime",{enumerable:!0,get:function(){return a.bufferTime}});var o=Nm();Object.defineProperty(e,"bufferToggle",{enumerable:!0,get:function(){return o.bufferToggle}});var s=Pm();Object.defineProperty(e,"bufferWhen",{enumerable:!0,get:function(){return s.bufferWhen}});var c=Fm();Object.defineProperty(e,"catchError",{enumerable:!0,get:function(){return c.catchError}});var l=Vm();Object.defineProperty(e,"combineAll",{enumerable:!0,get:function(){return l.combineAll}});var u=Bm();Object.defineProperty(e,"combineLatestAll",{enumerable:!0,get:function(){return u.combineLatestAll}});var d=Hm();Object.defineProperty(e,"combineLatest",{enumerable:!0,get:function(){return d.combineLatest}});var f=Um();Object.defineProperty(e,"combineLatestWith",{enumerable:!0,get:function(){return f.combineLatestWith}});var p=Km();Object.defineProperty(e,"concat",{enumerable:!0,get:function(){return p.concat}});var m=im();Object.defineProperty(e,"concatAll",{enumerable:!0,get:function(){return m.concatAll}});var h=Wm();Object.defineProperty(e,"concatMap",{enumerable:!0,get:function(){return h.concatMap}});var g=Gm();Object.defineProperty(e,"concatMapTo",{enumerable:!0,get:function(){return g.concatMapTo}});var _=qm();Object.defineProperty(e,"concatWith",{enumerable:!0,get:function(){return _.concatWith}});var v=Ym();Object.defineProperty(e,"connect",{enumerable:!0,get:function(){return v.connect}});var y=Xm();Object.defineProperty(e,"count",{enumerable:!0,get:function(){return y.count}});var b=Zm();Object.defineProperty(e,"debounce",{enumerable:!0,get:function(){return b.debounce}});var x=Qm();Object.defineProperty(e,"debounceTime",{enumerable:!0,get:function(){return x.debounceTime}});var S=$m();Object.defineProperty(e,"defaultIfEmpty",{enumerable:!0,get:function(){return S.defaultIfEmpty}});var C=ih();Object.defineProperty(e,"delay",{enumerable:!0,get:function(){return C.delay}});var w=rh();Object.defineProperty(e,"delayWhen",{enumerable:!0,get:function(){return w.delayWhen}});var T=ah();Object.defineProperty(e,"dematerialize",{enumerable:!0,get:function(){return T.dematerialize}});var E=oh();Object.defineProperty(e,"distinct",{enumerable:!0,get:function(){return E.distinct}});var D=sh();Object.defineProperty(e,"distinctUntilChanged",{enumerable:!0,get:function(){return D.distinctUntilChanged}});var O=ch();Object.defineProperty(e,"distinctUntilKeyChanged",{enumerable:!0,get:function(){return O.distinctUntilKeyChanged}});var k=uh();Object.defineProperty(e,"elementAt",{enumerable:!0,get:function(){return k.elementAt}});var A=dh();Object.defineProperty(e,"endWith",{enumerable:!0,get:function(){return A.endWith}});var j=fh();Object.defineProperty(e,"every",{enumerable:!0,get:function(){return j.every}});var ee=hh();Object.defineProperty(e,"exhaust",{enumerable:!0,get:function(){return ee.exhaust}});var M=mh();Object.defineProperty(e,"exhaustAll",{enumerable:!0,get:function(){return M.exhaustAll}});var N=ph();Object.defineProperty(e,"exhaustMap",{enumerable:!0,get:function(){return N.exhaustMap}});var te=gh();Object.defineProperty(e,"expand",{enumerable:!0,get:function(){return te.expand}});var ne=xm();Object.defineProperty(e,"filter",{enumerable:!0,get:function(){return ne.filter}});var re=_h();Object.defineProperty(e,"finalize",{enumerable:!0,get:function(){return re.finalize}});var ie=vh();Object.defineProperty(e,"find",{enumerable:!0,get:function(){return ie.find}});var ae=yh();Object.defineProperty(e,"findIndex",{enumerable:!0,get:function(){return ae.findIndex}});var oe=bh();Object.defineProperty(e,"first",{enumerable:!0,get:function(){return oe.first}});var se=xh();Object.defineProperty(e,"groupBy",{enumerable:!0,get:function(){return se.groupBy}});var ce=th();Object.defineProperty(e,"ignoreElements",{enumerable:!0,get:function(){return ce.ignoreElements}});var P=Sh();Object.defineProperty(e,"isEmpty",{enumerable:!0,get:function(){return P.isEmpty}});var le=wh();Object.defineProperty(e,"last",{enumerable:!0,get:function(){return le.last}});var ue=qp();Object.defineProperty(e,"map",{enumerable:!0,get:function(){return ue.map}});var de=nh();Object.defineProperty(e,"mapTo",{enumerable:!0,get:function(){return de.mapTo}});var fe=Th();Object.defineProperty(e,"materialize",{enumerable:!0,get:function(){return fe.materialize}});var pe=Eh();Object.defineProperty(e,"max",{enumerable:!0,get:function(){return pe.max}});var me=Ah();Object.defineProperty(e,"merge",{enumerable:!0,get:function(){return me.merge}});var he=rm();Object.defineProperty(e,"mergeAll",{enumerable:!0,get:function(){return he.mergeAll}});var ge=Dh();Object.defineProperty(e,"flatMap",{enumerable:!0,get:function(){return ge.flatMap}});var _e=nm();Object.defineProperty(e,"mergeMap",{enumerable:!0,get:function(){return _e.mergeMap}});var ve=Oh();Object.defineProperty(e,"mergeMapTo",{enumerable:!0,get:function(){return ve.mergeMapTo}});var ye=kh();Object.defineProperty(e,"mergeScan",{enumerable:!0,get:function(){return ye.mergeScan}});var be=jh();Object.defineProperty(e,"mergeWith",{enumerable:!0,get:function(){return be.mergeWith}});var xe=Mh();Object.defineProperty(e,"min",{enumerable:!0,get:function(){return xe.min}});var Se=Nh();Object.defineProperty(e,"multicast",{enumerable:!0,get:function(){return Se.multicast}});var Ce=Tp();Object.defineProperty(e,"observeOn",{enumerable:!0,get:function(){return Ce.observeOn}});var we=Ph();Object.defineProperty(e,"onErrorResumeNext",{enumerable:!0,get:function(){return we.onErrorResumeNext}});var Te=Fh();Object.defineProperty(e,"pairwise",{enumerable:!0,get:function(){return Te.pairwise}});var Ee=IE();Object.defineProperty(e,"partition",{enumerable:!0,get:function(){return Ee.partition}});var De=Ih();Object.defineProperty(e,"pluck",{enumerable:!0,get:function(){return De.pluck}});var Oe=Lh();Object.defineProperty(e,"publish",{enumerable:!0,get:function(){return Oe.publish}});var ke=Rh();Object.defineProperty(e,"publishBehavior",{enumerable:!0,get:function(){return ke.publishBehavior}});var Ae=zh();Object.defineProperty(e,"publishLast",{enumerable:!0,get:function(){return Ae.publishLast}});var je=Bh();Object.defineProperty(e,"publishReplay",{enumerable:!0,get:function(){return je.publishReplay}});var Me=LE();Object.defineProperty(e,"race",{enumerable:!0,get:function(){return Me.race}});var Ne=Vh();Object.defineProperty(e,"raceWith",{enumerable:!0,get:function(){return Ne.raceWith}});var Pe=Lm();Object.defineProperty(e,"reduce",{enumerable:!0,get:function(){return Pe.reduce}});var Fe=Hh();Object.defineProperty(e,"repeat",{enumerable:!0,get:function(){return Fe.repeat}});var Ie=Uh();Object.defineProperty(e,"repeatWhen",{enumerable:!0,get:function(){return Ie.repeatWhen}});var Le=Wh();Object.defineProperty(e,"retry",{enumerable:!0,get:function(){return Le.retry}});var Re=Gh();Object.defineProperty(e,"retryWhen",{enumerable:!0,get:function(){return Re.retryWhen}});var ze=Rf();Object.defineProperty(e,"refCount",{enumerable:!0,get:function(){return ze.refCount}});var Be=Kh();Object.defineProperty(e,"sample",{enumerable:!0,get:function(){return Be.sample}});var Ve=qh();Object.defineProperty(e,"sampleTime",{enumerable:!0,get:function(){return Ve.sampleTime}});var He=Jh();Object.defineProperty(e,"scan",{enumerable:!0,get:function(){return He.scan}});var Ue=Yh();Object.defineProperty(e,"sequenceEqual",{enumerable:!0,get:function(){return Ue.sequenceEqual}});var We=Xh();Object.defineProperty(e,"share",{enumerable:!0,get:function(){return We.share}});var Ge=Zh();Object.defineProperty(e,"shareReplay",{enumerable:!0,get:function(){return Ge.shareReplay}});var Ke=Qh();Object.defineProperty(e,"single",{enumerable:!0,get:function(){return Ke.single}});var qe=$h();Object.defineProperty(e,"skip",{enumerable:!0,get:function(){return qe.skip}});var Je=eg();Object.defineProperty(e,"skipLast",{enumerable:!0,get:function(){return Je.skipLast}});var Ye=tg();Object.defineProperty(e,"skipUntil",{enumerable:!0,get:function(){return Ye.skipUntil}});var Xe=ng();Object.defineProperty(e,"skipWhile",{enumerable:!0,get:function(){return Xe.skipWhile}});var Ze=rg();Object.defineProperty(e,"startWith",{enumerable:!0,get:function(){return Ze.startWith}});var Qe=Ep();Object.defineProperty(e,"subscribeOn",{enumerable:!0,get:function(){return Qe.subscribeOn}});var $e=ag();Object.defineProperty(e,"switchAll",{enumerable:!0,get:function(){return $e.switchAll}});var et=ig();Object.defineProperty(e,"switchMap",{enumerable:!0,get:function(){return et.switchMap}});var tt=og();Object.defineProperty(e,"switchMapTo",{enumerable:!0,get:function(){return tt.switchMapTo}});var nt=sg();Object.defineProperty(e,"switchScan",{enumerable:!0,get:function(){return nt.switchScan}});var rt=eh();Object.defineProperty(e,"take",{enumerable:!0,get:function(){return rt.take}});var it=Ch();Object.defineProperty(e,"takeLast",{enumerable:!0,get:function(){return it.takeLast}});var at=cg();Object.defineProperty(e,"takeUntil",{enumerable:!0,get:function(){return at.takeUntil}});var ot=lg();Object.defineProperty(e,"takeWhile",{enumerable:!0,get:function(){return ot.takeWhile}});var st=ug();Object.defineProperty(e,"tap",{enumerable:!0,get:function(){return st.tap}});var ct=dg();Object.defineProperty(e,"throttle",{enumerable:!0,get:function(){return ct.throttle}});var lt=fg();Object.defineProperty(e,"throttleTime",{enumerable:!0,get:function(){return lt.throttleTime}});var ut=lh();Object.defineProperty(e,"throwIfEmpty",{enumerable:!0,get:function(){return ut.throwIfEmpty}});var dt=pg();Object.defineProperty(e,"timeInterval",{enumerable:!0,get:function(){return dt.timeInterval}});var ft=Kp();Object.defineProperty(e,"timeout",{enumerable:!0,get:function(){return ft.timeout}});var pt=mg();Object.defineProperty(e,"timeoutWith",{enumerable:!0,get:function(){return pt.timeoutWith}});var mt=hg();Object.defineProperty(e,"timestamp",{enumerable:!0,get:function(){return mt.timestamp}});var ht=Rm();Object.defineProperty(e,"toArray",{enumerable:!0,get:function(){return ht.toArray}});var gt=gg();Object.defineProperty(e,"window",{enumerable:!0,get:function(){return gt.window}});var _t=_g();Object.defineProperty(e,"windowCount",{enumerable:!0,get:function(){return _t.windowCount}});var vt=vg();Object.defineProperty(e,"windowTime",{enumerable:!0,get:function(){return vt.windowTime}});var yt=yg();Object.defineProperty(e,"windowToggle",{enumerable:!0,get:function(){return yt.windowToggle}});var bt=bg();Object.defineProperty(e,"windowWhen",{enumerable:!0,get:function(){return bt.windowWhen}});var xt=xg();Object.defineProperty(e,"withLatestFrom",{enumerable:!0,get:function(){return xt.withLatestFrom}});var St=Cg();Object.defineProperty(e,"zip",{enumerable:!0,get:function(){return St.zip}});var Ct=Sg();Object.defineProperty(e,"zipAll",{enumerable:!0,get:function(){return Ct.zipAll}});var wt=wg();Object.defineProperty(e,"zipWith",{enumerable:!0,get:function(){return wt.zipWith}})}}),zE={highlight:{motivation:`highlighting`,internalType:`highlight`,displayName:`Highlight`,description:`Mark text for attention`,className:`annotation-highlight`,iconEmoji:`🟡`,isClickable:!0,hasHoverInteraction:!0,hasSidePanel:!0,matchesAnnotation:e=>Xo(e),announceOnCreate:`Highlight created`,create:{bodyBuilder:`empty`,refetchAfter:!1},detection:{sseMethod:`detectHighlights`,countField:`createdCount`,displayNamePlural:`highlights`,displayNameSingular:`highlight`,formatRequestParams:e=>{let t=[];return typeof e[0]==`string`&&e[0]&&t.push({label:`Instructions`,value:e[0]}),typeof e[2]==`number`&&t.push({label:`Density`,value:`${e[2]} per 2000 words`}),t}}},comment:{motivation:`commenting`,internalType:`comment`,displayName:`Comment`,description:`Add a comment about the text`,className:`annotation-comment`,iconEmoji:`💬`,isClickable:!0,hasHoverInteraction:!0,hasSidePanel:!0,matchesAnnotation:e=>$o(e),announceOnCreate:`Comment created`,create:{bodyBuilder:`text`,refetchAfter:!1},detection:{sseMethod:`detectComments`,countField:`createdCount`,displayNamePlural:`comments`,displayNameSingular:`comment`,formatRequestParams:e=>{let t=[];return typeof e[0]==`string`&&e[0]&&t.push({label:`Instructions`,value:e[0]}),typeof e[1]==`string`&&e[1]&&t.push({label:`Tone`,value:e[1]}),typeof e[2]==`number`&&t.push({label:`Density`,value:`${e[2]} per 2000 words`}),t}}},assessment:{motivation:`assessing`,internalType:`assessment`,displayName:`Assessment`,description:`Provide evaluation or assessment`,className:`annotation-assessment`,iconEmoji:`🔴`,isClickable:!0,hasHoverInteraction:!0,hasSidePanel:!0,matchesAnnotation:e=>e.motivation===`assessing`,announceOnCreate:`Assessment created`,create:{bodyBuilder:`text`,refetchAfter:!1},detection:{sseMethod:`detectAssessments`,countField:`createdCount`,displayNamePlural:`assessments`,displayNameSingular:`assessment`,formatRequestParams:e=>{let t=[];return typeof e[0]==`string`&&e[0]&&t.push({label:`Instructions`,value:e[0]}),typeof e[1]==`string`&&e[1]&&t.push({label:`Tone`,value:e[1]}),typeof e[2]==`number`&&t.push({label:`Density`,value:`${e[2]} per 2000 words`}),t}}},reference:{motivation:`linking`,internalType:`reference`,displayName:`Reference`,description:`Link to another resource`,className:`annotation-reference`,iconEmoji:`🔵`,isClickable:!0,hasHoverInteraction:!0,hasSidePanel:!0,matchesAnnotation:e=>Zo(e),announceOnCreate:`Reference created`,create:{bodyBuilder:`entityTag`,refetchAfter:!0},detection:{sseMethod:`detectReferences`,countField:`foundCount`,displayNamePlural:`entity references`,displayNameSingular:`entity reference`,formatRequestParams:e=>{let t=[],n=e[0];return Array.isArray(n)&&n.length>0&&t.push({label:`Entity Types`,value:n.join(`, `)}),e[1]===!0&&t.push({label:`Include Descriptive References`,value:`Yes`}),t}}},tag:{motivation:`tagging`,internalType:`tag`,displayName:`Tag`,description:`Structural role annotation`,className:`annotation-tag`,iconEmoji:`🏷️`,isClickable:!0,hasHoverInteraction:!0,hasSidePanel:!0,matchesAnnotation:e=>es(e),announceOnCreate:`Tag created`,create:{bodyBuilder:`dualTag`,refetchAfter:!1,successMessage:`Tag "{value}" created`},detection:{sseMethod:`detectTags`,countField:`tagsCreated`,displayNamePlural:`tags`,displayNameSingular:`tag`,formatRequestParams:e=>{let t=[];typeof e[0]==`string`&&e[0]&&t.push({label:`Schema`,value:{"legal-irac":`Legal (IRAC)`,"scientific-imrad":`Scientific (IMRAD)`,"argument-toulmin":`Argument (Toulmin)`}[e[0]]||e[0]});let n=e[1];return Array.isArray(n)&&n.length>0&&t.push({label:`Categories`,value:n.join(`, `)}),t}}}},BE={primary:{base:`semiont-button semiont-button--primary`,large:`semiont-button semiont-button--primary semiont-button--large`},secondary:{base:`semiont-button semiont-button--secondary`,withScale:`semiont-button semiont-button--secondary semiont-button--scale`},tertiary:{base:`semiont-button semiont-button--tertiary`},danger:{base:`semiont-button semiont-button--danger`},warning:{base:`semiont-button semiont-button--warning`},combine:(...e)=>e.filter(Boolean).join(` `)},VE=[],HE=[];(()=>{let e=`lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o`.split(`,`).map(e=>e?parseInt(e,36):1);for(let t=0,n=0;t<e.length;t++)(t%2?HE:VE).push(n+=e[t])})();function UE(e){if(e<768)return!1;for(let t=0,n=VE.length;;){let r=t+n>>1;if(e<VE[r])n=r;else if(e>=HE[r])t=r+1;else return!0;if(t==n)return!1}}function WE(e){return e>=127462&&e<=127487}var GE=8205;function KE(e,t,n=!0,r=!0){return(n?qE:JE)(e,t,r)}function qE(e,t,n){if(t==e.length)return t;t&&XE(e.charCodeAt(t))&&ZE(e.charCodeAt(t-1))&&t--;let r=YE(e,t);for(t+=QE(r);t<e.length;){let i=YE(e,t);if(r==GE||i==GE||n&&UE(i))t+=QE(i),r=i;else if(WE(i)){let n=0,r=t-2;for(;r>=0&&WE(YE(e,r));)n++,r-=2;if(n%2==0)break;t+=2}else break}return t}function JE(e,t,n){for(;t>0;){let r=qE(e,t-2,n);if(r<t)return r;t--}return 0}function YE(e,t){let n=e.charCodeAt(t);if(!ZE(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return XE(r)?(n-55296<<10)+(r-56320)+65536:n}function XE(e){return e>=56320&&e<57344}function ZE(e){return e>=55296&&e<56320}function QE(e){return e<65536?1:2}var $E=class e{lineAt(e){if(e<0||e>this.length)throw RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=lD(this,e,t);let r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(t,this.length,r,1),tD.from(r,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=lD(this,e,t);let n=[];return this.decompose(e,t,n,0),tD.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),r=new aD(this),i=new aD(e);for(let e=t,a=t;;){if(r.next(e),i.next(e),e=0,r.lineBreak!=i.lineBreak||r.done!=i.done||r.value!=i.value)return!1;if(a+=r.value.length,r.done||a>=n)return!0}}iter(e=1){return new aD(this,e)}iterRange(e,t=this.length){return new oD(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t??=this.lines+1;let r=this.line(e).from;n=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new sD(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(t){if(t.length==0)throw RangeError(`A document must have at least one line`);return t.length==1&&!t[0]?e.empty:t.length<=32?new eD(t):tD.from(eD.split(t,[]))}},eD=class e extends $E{constructor(e,t=nD(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,r){for(let i=0;;i++){let a=this.text[i],o=r+a.length;if((t?n:o)>=e)return new cD(r,o,n,a);r=o+1,n++}}decompose(t,n,r,i){let a=t<=0&&n>=this.length?this:new e(iD(this.text,t,n),Math.min(n,this.length)-Math.max(0,t));if(i&1){let t=r.pop(),n=rD(a.text,t.text.slice(),0,a.length);if(n.length<=32)r.push(new e(n,t.length+a.length));else{let t=n.length>>1;r.push(new e(n.slice(0,t)),new e(n.slice(t)))}}else r.push(a)}replace(t,n,r){if(!(r instanceof e))return super.replace(t,n,r);[t,n]=lD(this,t,n);let i=rD(this.text,rD(r.text,iD(this.text,0,t)),n),a=this.length+r.length-(n-t);return i.length<=32?new e(i,a):tD.from(e.split(i,[]),a)}sliceString(e,t=this.length,n=`
|
|
40
|
+
`){[e,t]=lD(this,e,t);let r=``;for(let i=0,a=0;i<=t&&a<this.text.length;a++){let o=this.text[a],s=i+o.length;i>e&&a&&(r+=n),e<s&&t>i&&(r+=o.slice(Math.max(0,e-i),t-i)),i=s+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(t,n){let r=[],i=-1;for(let a of t)r.push(a),i+=a.length+1,r.length==32&&(n.push(new e(r,i)),r=[],i=-1);return i>-1&&n.push(new e(r,i)),n}},tD=class e extends $E{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let t of e)this.lines+=t.lines}lineInner(e,t,n,r){for(let i=0;;i++){let a=this.children[i],o=r+a.length,s=n+a.lines-1;if((t?s:o)>=e)return a.lineInner(e,t,n,r);r=o+1,n=s+1}}decompose(e,t,n,r){for(let i=0,a=0;a<=t&&i<this.children.length;i++){let o=this.children[i],s=a+o.length;if(e<=s&&t>=a){let i=r&(a<=e|(s>=t?2:0));a>=e&&s<=t&&!i?n.push(o):o.decompose(e-a,t-a,n,i)}a=s+1}}replace(t,n,r){if([t,n]=lD(this,t,n),r.lines<this.lines)for(let i=0,a=0;i<this.children.length;i++){let o=this.children[i],s=a+o.length;if(t>=a&&n<=s){let c=o.replace(t-a,n-a,r),l=this.lines-o.lines+c.lines;if(c.lines<l>>4&&c.lines>l>>6){let a=this.children.slice();return a[i]=c,new e(a,this.length-(n-t)+r.length)}return super.replace(a,s,c)}a=s+1}return super.replace(t,n,r)}sliceString(e,t=this.length,n=`
|
|
41
|
+
`){[e,t]=lD(this,e,t);let r=``;for(let i=0,a=0;i<this.children.length&&a<=t;i++){let o=this.children[i],s=a+o.length;a>e&&i&&(r+=n),e<s&&t>a&&(r+=o.sliceString(e-a,t-a,n)),a=s+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(t,n){if(!(t instanceof e))return 0;let r=0,[i,a,o,s]=n>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;i+=n,a+=n){if(i==o||a==s)return r;let e=this.children[i],c=t.children[a];if(e!=c)return r+e.scanIdentical(c,n);r+=e.length+1}}static from(t,n=t.reduce((e,t)=>e+t.length+1,-1)){let r=0;for(let e of t)r+=e.lines;if(r<32){let e=[];for(let n of t)n.flatten(e);return new eD(e,n)}let i=Math.max(32,r>>5),a=i<<1,o=i>>1,s=[],c=0,l=-1,u=[];function d(t){let n;if(t.lines>a&&t instanceof e)for(let e of t.children)d(e);else t.lines>o&&(c>o||!c)?(f(),s.push(t)):t instanceof eD&&c&&(n=u[u.length-1])instanceof eD&&t.lines+n.lines<=32?(c+=t.lines,l+=t.length+1,u[u.length-1]=new eD(n.text.concat(t.text),n.length+1+t.length)):(c+t.lines>i&&f(),c+=t.lines,l+=t.length+1,u.push(t))}function f(){c!=0&&(s.push(u.length==1?u[0]:e.from(u,l)),l=-1,c=u.length=0)}for(let e of t)d(e);return f(),s.length==1?s[0]:new e(s,n)}};$E.empty=new eD([``],0);function nD(e){let t=-1;for(let n of e)t+=n.length+1;return t}function rD(e,t,n=0,r=1e9){for(let i=0,a=0,o=!0;a<e.length&&i<=r;a++){let s=e[a],c=i+s.length;c>=n&&(c>r&&(s=s.slice(0,r-i)),i<n&&(s=s.slice(n-i)),o?(t[t.length-1]+=s,o=!1):t.push(s)),i=c+1}return t}function iD(e,t,n){return rD(e,[``],t,n)}var aD=class{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value=``,this.nodes=[e],this.offsets=[t>0?1:(e instanceof eD?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,r=this.nodes[n],i=this.offsets[n],a=i>>1,o=r instanceof eD?r.text.length:r.children.length;if(a==(t>0?o:0)){if(n==0)return this.done=!0,this.value=``,this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((i&1)==(t>0?0:1)){if(this.offsets[n]+=t,e==0)return this.lineBreak=!0,this.value=`
|
|
42
|
+
`,this;e--}else if(r instanceof eD){let i=r.text[a+(t<0?-1:0)];if(this.offsets[n]+=t,i.length>Math.max(0,e))return this.value=e==0?i:t>0?i.slice(e):i.slice(0,i.length-e),this;e-=i.length}else{let i=r.children[a+(t<0?-1:0)];e>i.length?(e-=i.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(i),this.offsets.push(t>0?1:(i instanceof eD?i.text.length:i.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}},oD=class{constructor(e,t,n){this.value=``,this.done=!1,this.cursor=new aD(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value=``,this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=n?r:t<0?r.slice(r.length-n):r.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=``}},sD=class{constructor(e){this.inner=e,this.afterBreak=!0,this.value=``,this.done=!1}next(e=0){let{done:t,lineBreak:n,value:r}=this.inner.next(e);return t&&this.afterBreak?(this.value=``,this.afterBreak=!1):t?(this.done=!0,this.value=``):n?this.afterBreak?this.value=``:(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}};typeof Symbol<`u`&&($E.prototype[Symbol.iterator]=function(){return this.iter()},aD.prototype[Symbol.iterator]=oD.prototype[Symbol.iterator]=sD.prototype[Symbol.iterator]=function(){return this});var cD=class{constructor(e,t,n,r){this.from=e,this.to=t,this.number=n,this.text=r}get length(){return this.to-this.from}};function lD(e,t,n){return t=Math.max(0,Math.min(e.length,t)),[t,Math.max(t,Math.min(e.length,n))]}function uD(e,t,n=!0,r=!0){return KE(e,t,n,r)}function dD(e){return e>=56320&&e<57344}function fD(e){return e>=55296&&e<56320}function pD(e,t){let n=e.charCodeAt(t);if(!fD(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return dD(r)?(n-55296<<10)+(r-56320)+65536:n}function mD(e){return e<65536?1:2}var hD=/\r\n?|\n/,gD=(function(e){return e[e.Simple=0]=`Simple`,e[e.TrackDel=1]=`TrackDel`,e[e.TrackBefore=2]=`TrackBefore`,e[e.TrackAfter=3]=`TrackAfter`,e})(gD||={}),_D=class e{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t+1];e+=n<0?this.sections[t]:n}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,n=0,r=0;t<this.sections.length;){let i=this.sections[t++],a=this.sections[t++];a<0?(e(n,r,i),r+=i):r+=a,n+=i}}iterChangedRanges(e,t=!1){xD(this,e,t)}get invertedDesc(){let t=[];for(let e=0;e<this.sections.length;){let n=this.sections[e++],r=this.sections[e++];r<0?t.push(n,r):t.push(r,n)}return new e(t)}composeDesc(e){return this.empty?e:e.empty?this:CD(this,e)}mapDesc(e,t=!1){return e.empty?this:SD(this,e,t)}mapPos(e,t=-1,n=gD.Simple){let r=0,i=0;for(let a=0;a<this.sections.length;){let o=this.sections[a++],s=this.sections[a++],c=r+o;if(s<0){if(c>e)return i+(e-r);i+=o}else{if(n!=gD.Simple&&c>=e&&(n==gD.TrackDel&&r<e&&c>e||n==gD.TrackBefore&&r<e||n==gD.TrackAfter&&c>e))return null;if(c>e||c==e&&t<0&&!o)return e==r||t<0?i:i+s;i+=s}r=c}if(e>r)throw RangeError(`Position ${e} is out of range for changeset of length ${r}`);return i}touchesRange(e,t=e){for(let n=0,r=0;n<this.sections.length&&r<=t;){let i=this.sections[n++],a=this.sections[n++],o=r+i;if(a>=0&&r<=t&&o>=e)return r<e&&o>t?`cover`:!0;r=o}return!1}toString(){let e=``;for(let t=0;t<this.sections.length;){let n=this.sections[t++],r=this.sections[t++];e+=(e?` `:``)+n+(r>=0?`:`+r:``)}return e}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(e=>typeof e!=`number`))throw RangeError(`Invalid JSON representation of ChangeDesc`);return new e(t)}static create(t){return new e(t)}},vD=class e extends _D{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw RangeError(`Applying change set to a document with the wrong length`);return xD(this,(t,n,r,i,a)=>e=e.replace(r,r+(n-t),a),!1),e}mapDesc(e,t=!1){return SD(this,e,t,!0)}invert(t){let n=this.sections.slice(),r=[];for(let e=0,i=0;e<n.length;e+=2){let a=n[e],o=n[e+1];if(o>=0){n[e]=o,n[e+1]=a;let s=e>>1;for(;r.length<s;)r.push($E.empty);r.push(a?t.slice(i,i+a):$E.empty)}i+=a}return new e(n,r)}compose(e){return this.empty?e:e.empty?this:CD(this,e,!0)}map(e,t=!1){return e.empty?this:SD(this,e,t,!0)}iterChanges(e,t=!1){xD(this,e,t)}get desc(){return _D.create(this.sections)}filter(t){let n=[],r=[],i=[],a=new wD(this);done:for(let e=0,o=0;;){let s=e==t.length?1e9:t[e++];for(;o<s||o==s&&a.len==0;){if(a.done)break done;let e=Math.min(a.len,s-o);yD(i,e,-1);let t=a.ins==-1?-1:a.off==0?a.ins:0;yD(n,e,t),t>0&&bD(r,n,a.text),a.forward(e),o+=e}let c=t[e++];for(;o<c;){if(a.done)break done;let e=Math.min(a.len,c-o);yD(n,e,-1),yD(i,e,a.ins==-1?-1:a.off==0?a.ins:0),a.forward(e),o+=e}}return{changes:new e(n,r),filtered:_D.create(i)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t],r=this.sections[t+1];r<0?e.push(n):r==0?e.push([n]):e.push([n].concat(this.inserted[t>>1].toJSON()))}return e}static of(t,n,r){let i=[],a=[],o=0,s=null;function c(t=!1){if(!t&&!i.length)return;o<n&&yD(i,n-o,-1);let r=new e(i,a);s=s?s.compose(r.map(s)):r,i=[],a=[],o=0}function l(t){if(Array.isArray(t))for(let e of t)l(e);else if(t instanceof e){if(t.length!=n)throw RangeError(`Mismatched change set length (got ${t.length}, expected ${n})`);c(),s=s?s.compose(t.map(s)):t}else{let{from:e,to:s=e,insert:l}=t;if(e>s||e<0||s>n)throw RangeError(`Invalid change range ${e} to ${s} (in doc of length ${n})`);let u=l?typeof l==`string`?$E.of(l.split(r||hD)):l:$E.empty,d=u.length;if(e==s&&d==0)return;e<o&&c(),e>o&&yD(i,e-o,-1),yD(i,s-e,d),bD(a,i,u),o=s}}return l(t),c(!s),s}static empty(t){return new e(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw RangeError(`Invalid JSON representation of ChangeSet`);let n=[],r=[];for(let e=0;e<t.length;e++){let i=t[e];if(typeof i==`number`)n.push(i,-1);else if(!Array.isArray(i)||typeof i[0]!=`number`||i.some((e,t)=>t&&typeof e!=`string`))throw RangeError(`Invalid JSON representation of ChangeSet`);else if(i.length==1)n.push(i[0],0);else{for(;r.length<e;)r.push($E.empty);r[e]=$E.of(i.slice(1)),n.push(i[0],r[e].length)}}return new e(n,r)}static createSet(t,n){return new e(t,n)}};function yD(e,t,n,r=!1){if(t==0&&n<=0)return;let i=e.length-2;i>=0&&n<=0&&n==e[i+1]?e[i]+=t:i>=0&&t==0&&e[i]==0?e[i+1]+=n:r?(e[i]+=t,e[i+1]+=n):e.push(t,n)}function bD(e,t,n){if(n.length==0)return;let r=t.length-2>>1;if(r<e.length)e[e.length-1]=e[e.length-1].append(n);else{for(;e.length<r;)e.push($E.empty);e.push(n)}}function xD(e,t,n){let r=e.inserted;for(let i=0,a=0,o=0;o<e.sections.length;){let s=e.sections[o++],c=e.sections[o++];if(c<0)i+=s,a+=s;else{let l=i,u=a,d=$E.empty;for(;l+=s,u+=c,c&&r&&(d=d.append(r[o-2>>1])),!(n||o==e.sections.length||e.sections[o+1]<0);)s=e.sections[o++],c=e.sections[o++];t(i,l,a,u,d),i=l,a=u}}}function SD(e,t,n,r=!1){let i=[],a=r?[]:null,o=new wD(e),s=new wD(t);for(let e=-1;;)if(o.done&&s.len||s.done&&o.len)throw Error(`Mismatched change set lengths`);else if(o.ins==-1&&s.ins==-1){let e=Math.min(o.len,s.len);yD(i,e,-1),o.forward(e),s.forward(e)}else if(s.ins>=0&&(o.ins<0||e==o.i||o.off==0&&(s.len<o.len||s.len==o.len&&!n))){let t=s.len;for(yD(i,s.ins,-1);t;){let n=Math.min(o.len,t);o.ins>=0&&e<o.i&&o.len<=n&&(yD(i,0,o.ins),a&&bD(a,i,o.text),e=o.i),o.forward(n),t-=n}s.next()}else if(o.ins>=0){let t=0,n=o.len;for(;n;)if(s.ins==-1){let e=Math.min(n,s.len);t+=e,n-=e,s.forward(e)}else if(s.ins==0&&s.len<n)n-=s.len,s.next();else break;yD(i,t,e<o.i?o.ins:0),a&&e<o.i&&bD(a,i,o.text),e=o.i,o.forward(o.len-n)}else if(o.done&&s.done)return a?vD.createSet(i,a):_D.create(i);else throw Error(`Mismatched change set lengths`)}function CD(e,t,n=!1){let r=[],i=n?[]:null,a=new wD(e),o=new wD(t);for(let e=!1;;)if(a.done&&o.done)return i?vD.createSet(r,i):_D.create(r);else if(a.ins==0)yD(r,a.len,0,e),a.next();else if(o.len==0&&!o.done)yD(r,0,o.ins,e),i&&bD(i,r,o.text),o.next();else if(a.done||o.done)throw Error(`Mismatched change set lengths`);else{let t=Math.min(a.len2,o.len),n=r.length;if(a.ins==-1){let n=o.ins==-1?-1:o.off?0:o.ins;yD(r,t,n,e),i&&n&&bD(i,r,o.text)}else o.ins==-1?(yD(r,a.off?0:a.len,t,e),i&&bD(i,r,a.textBit(t))):(yD(r,a.off?0:a.len,o.off?0:o.ins,e),i&&!o.off&&bD(i,r,o.text));e=(a.ins>t||o.ins>=0&&o.len>t)&&(e||r.length>n),a.forward2(t),o.forward(t)}}var wD=class{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?$E.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?$E.empty:t[n].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}},TD=class e{constructor(e,t,n,r){this.from=e,this.to=t,this.flags=n,this.goalColumn=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get undirectional(){return(this.flags&64)>0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}map(t,n=-1){let r,i;return this.empty?r=i=t.mapPos(this.from,n):(r=t.mapPos(this.from,1),i=t.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new e(r,i,this.flags,this.goalColumn)}extend(e,t=e,n=0){if(e<=this.anchor&&t>=this.anchor)return W.range(e,t,void 0,void 0,n);let r=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return W.range(this.anchor,r,void 0,void 0,n)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!=`number`||typeof e.head!=`number`)throw RangeError(`Invalid JSON representation for SelectionRange`);return W.range(e.anchor,e.head)}static create(t,n,r,i){return new e(t,n,r,i)}},W=class e{constructor(e,t){this.ranges=e,this.mainIndex=t}map(t,n=-1){return t.empty?this:e.create(this.ranges.map(e=>e.map(t,n)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;n<this.ranges.length;n++)if(!this.ranges[n].eq(e.ranges[n],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new e([this.main],0)}addRange(t,n=!0){return e.create([t].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(t,n=this.mainIndex){let r=this.ranges.slice();return r[n]=t,e.create(r,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||typeof t.main!=`number`||t.main>=t.ranges.length)throw RangeError(`Invalid JSON representation for EditorSelection`);return new e(t.ranges.map(e=>TD.fromJSON(e)),t.main)}static single(t,n=t){return new e([e.range(t,n)],0)}static create(t,n=0){if(t.length==0)throw RangeError(`A selection needs at least one range`);for(let r=0,i=0;i<t.length;i++){let a=t[i];if(a.empty?a.from<=r:a.from<r)return e.normalized(t.slice(),n);r=a.to}return new e(t,n)}static cursor(e,t=0,n,r){return TD.create(e,e,(t==0?0:t<0?8:16)|(n==null?7:Math.min(6,n)),r)}static range(e,t,n,r,i){let a=r==null?7:Math.min(6,r);return!i&&e!=t&&(i=t<e?1:-1),i&&(a|=i<0?8:16),t<e?TD.create(t,e,a|32,n):TD.create(e,t,a,n)}static undirectionalRange(e,t){return TD.create(e,t,64,void 0)}static normalized(t,n=0){let r=t[n];t.sort((e,t)=>e.from-t.from),n=t.indexOf(r);for(let r=1;r<t.length;r++){let i=t[r],a=t[r-1];if(i.empty?i.from<=a.to:i.from<a.to){let o=a.from,s=Math.max(i.to,a.to);r<=n&&n--,t.splice(--r,2,i.anchor>i.head?e.range(s,o):e.range(o,s))}}return new e(t,n)}};function ED(e,t){for(let n of e.ranges)if(n.to>t)throw RangeError(`Selection points outside of document`)}var DD=0,G=class e{constructor(e,t,n,r,i){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=r,this.id=DD++,this.default=e([]),this.extensions=typeof i==`function`?i(this):i}get reader(){return this}static define(t={}){return new e(t.combine||(e=>e),t.compareInput||((e,t)=>e===t),t.compare||(t.combine?(e,t)=>e===t:OD),!!t.static,t.enables)}of(e){return new kD([],this,0,e)}compute(e,t){if(this.isStatic)throw Error(`Can't compute a static facet`);return new kD(e,this,1,t)}computeN(e,t){if(this.isStatic)throw Error(`Can't compute a static facet`);return new kD(e,this,2,t)}from(e,t){return t||=e=>e,this.compute([e],n=>t(n.field(e)))}};function OD(e,t){return e==t||e.length==t.length&&e.every((e,n)=>e===t[n])}var kD=class{constructor(e,t,n,r){this.dependencies=e,this.facet=t,this.type=n,this.value=r,this.id=DD++}dynamicSlot(e){let t=this.value,n=this.facet.compareInput,r=this.id,i=e[r]>>1,a=this.type==2,o=!1,s=!1,c=[];for(let t of this.dependencies)t==`doc`?o=!0:t==`selection`?s=!0:(e[t.id]??1)&1||c.push(e[t.id]);return{create(e){return e.values[i]=t(e),1},update(e,r){if(o&&r.docChanged||s&&(r.docChanged||r.selection)||jD(e,c)){let r=t(e);if(a?!AD(r,e.values[i],n):!n(r,e.values[i]))return e.values[i]=r,1}return 0},reconfigure:(e,o)=>{let s,c=o.config.address[r];if(c!=null){let r=WD(o,c);if(this.dependencies.every(t=>t instanceof G?o.facet(t)===e.facet(t):t instanceof PD?o.field(t,!1)==e.field(t,!1):!0)||(a?AD(s=t(e),r,n):n(s=t(e),r)))return e.values[i]=r,0}else s=t(e);return e.values[i]=s,1}}}};function AD(e,t,n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!n(e[r],t[r]))return!1;return!0}function jD(e,t){let n=!1;for(let r of t)UD(e,r)&1&&(n=!0);return n}function MD(e,t,n){let r=n.map(t=>e[t.id]),i=n.map(e=>e.type),a=r.filter(e=>!(e&1)),o=e[t.id]>>1;function s(e){let n=[];for(let t=0;t<r.length;t++){let a=WD(e,r[t]);if(i[t]==2)for(let e of a)n.push(e);else n.push(a)}return t.combine(n)}return{create(e){for(let t of r)UD(e,t);return e.values[o]=s(e),1},update(e,n){if(!jD(e,a))return 0;let r=s(e);return t.compare(r,e.values[o])?0:(e.values[o]=r,1)},reconfigure(e,i){let a=jD(e,r),c=i.config.facets[t.id],l=i.facet(t);if(c&&!a&&OD(n,c))return e.values[o]=l,0;let u=s(e);return t.compare(u,l)?(e.values[o]=l,0):(e.values[o]=u,1)}}}var ND=G.define({static:!0}),PD=class e{constructor(e,t,n,r,i){this.id=e,this.createF=t,this.updateF=n,this.compareF=r,this.spec=i,this.provides=void 0}static define(t){let n=new e(DD++,t.create,t.update,t.compare||((e,t)=>e===t),t);return t.provide&&(n.provides=t.provide(n)),n}create(e){return(e.facet(ND).find(e=>e.field==this)?.create||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:e=>(e.values[t]=this.create(e),1),update:(e,n)=>{let r=e.values[t],i=this.updateF(r,n);return this.compareF(r,i)?0:(e.values[t]=i,1)},reconfigure:(e,n)=>{let r=e.facet(ND),i=n.facet(ND),a;return(a=r.find(e=>e.field==this))&&a!=i.find(e=>e.field==this)?(e.values[t]=a.create(e),1):n.config.address[this.id]==null?(e.values[t]=this.create(e),1):(e.values[t]=n.field(this),0)}}}init(e){return[this,ND.of({field:this,create:e})]}get extension(){return this}},FD={lowest:4,low:3,default:2,high:1,highest:0};function ID(e){return t=>new RD(t,e)}var LD={highest:ID(FD.highest),high:ID(FD.high),default:ID(FD.default),low:ID(FD.low),lowest:ID(FD.lowest)},RD=class{constructor(e,t){this.inner=e,this.prec=t}},zD=class e{of(e){return new BD(this,e)}reconfigure(t){return e.reconfigure.of({compartment:this,extension:t})}get(e){return e.config.compartments.get(this)}},BD=class{constructor(e,t){this.compartment=e,this.inner=t}},VD=class e{constructor(e,t,n,r,i,a){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=r,this.staticValues=i,this.facets=a,this.statusTemplate=[];this.statusTemplate.length<n.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(t,n,r){let i=[],a=Object.create(null),o=new Map;for(let e of HD(t,n,o))e instanceof PD?i.push(e):(a[e.facet.id]||(a[e.facet.id]=[])).push(e);let s=Object.create(null),c=[],l=[];for(let e of i)s[e.id]=l.length<<1,l.push(t=>e.slot(t));let u=r?.config.facets;for(let e in a){let t=a[e],n=t[0].facet,i=u&&u[e]||[];if(t.every(e=>e.type==0))if(s[n.id]=c.length<<1|1,OD(i,t))c.push(r.facet(n));else{let e=n.combine(t.map(e=>e.value));c.push(r&&n.compare(e,r.facet(n))?r.facet(n):e)}else{for(let e of t)e.type==0?(s[e.id]=c.length<<1|1,c.push(e.value)):(s[e.id]=l.length<<1,l.push(t=>e.dynamicSlot(t)));s[n.id]=l.length<<1,l.push(e=>MD(e,n,t))}}return new e(t,o,l.map(e=>e(s)),s,c,a)}};function HD(e,t,n){let r=[[],[],[],[],[]],i=new Map;function a(e,o){let s=i.get(e);if(s!=null){if(s<=o)return;let t=r[s].indexOf(e);t>-1&&r[s].splice(t,1),e instanceof BD&&n.delete(e.compartment)}if(i.set(e,o),Array.isArray(e))for(let t of e)a(t,o);else if(e instanceof BD){if(n.has(e.compartment))throw RangeError(`Duplicate use of compartment in extensions`);let r=t.get(e.compartment)||e.inner;n.set(e.compartment,r),a(r,o)}else if(e instanceof RD)a(e.inner,e.prec);else if(e instanceof PD)r[o].push(e),e.provides&&a(e.provides,o);else if(e instanceof kD)r[o].push(e),e.facet.extensions&&a(e.facet.extensions,FD.default);else{let t=e.extension;if(!t)throw Error(`Unrecognized extension value in extension set (${e}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);a(t,o)}}return a(e,FD.default),r.reduce((e,t)=>e.concat(t))}function UD(e,t){if(t&1)return 2;let n=t>>1,r=e.status[n];if(r==4)throw Error(`Cyclic dependency between fields and/or facets`);if(r&2)return r;e.status[n]=4;let i=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|i}function WD(e,t){return t&1?e.config.staticValues[t>>1]:e.values[t>>1]}var GD=G.define(),KD=G.define({combine:e=>e.some(e=>e),static:!0}),qD=G.define({combine:e=>e.length?e[0]:void 0,static:!0}),JD=G.define(),YD=G.define(),XD=G.define(),ZD=G.define({combine:e=>e.length?e[0]:!1}),QD=class{constructor(e,t){this.type=e,this.value=t}static define(){return new $D}},$D=class{of(e){return new QD(this,e)}},eO=class{constructor(e){this.map=e}of(e){return new tO(this,e)}},tO=class e{constructor(e,t){this.type=e,this.value=t}map(t){let n=this.type.map(this.value,t);return n===void 0?void 0:n==this.value?this:new e(this.type,n)}is(e){return this.type==e}static define(e={}){return new eO(e.map||(e=>e))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let r of e){let e=r.map(t);e&&n.push(e)}return n}};tO.reconfigure=tO.define(),tO.appendConfig=tO.define();var nO=class e{constructor(t,n,r,i,a,o){this.startState=t,this.changes=n,this.selection=r,this.effects=i,this.annotations=a,this.scrollIntoView=o,this._doc=null,this._state=null,r&&ED(r,n.newLength),a.some(t=>t.type==e.time)||(this.annotations=a.concat(e.time.of(Date.now())))}static create(t,n,r,i,a,o){return new e(t,n,r,i,a,o)}get newDoc(){return this._doc||=this.changes.apply(this.startState.doc)}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let n=this.annotation(e.userEvent);return!!(n&&(n==t||n.length>t.length&&n.slice(0,t.length)==t&&n[t.length]==`.`))}};nO.time=QD.define(),nO.userEvent=QD.define(),nO.addToHistory=QD.define(),nO.remote=QD.define();function rO(e,t){let n=[];for(let r=0,i=0;;){let a,o;if(r<e.length&&(i==t.length||t[i]>=e[r]))a=e[r++],o=e[r++];else if(i<t.length)a=t[i++],o=t[i++];else return n;!n.length||n[n.length-1]<a?n.push(a,o):n[n.length-1]<o&&(n[n.length-1]=o)}}function iO(e,t,n){let r,i,a;return n?(r=t.changes,i=vD.empty(t.changes.length),a=e.changes.compose(t.changes)):(r=t.changes.map(e.changes),i=e.changes.mapDesc(t.changes,!0),a=e.changes.compose(r)),{changes:a,selection:t.selection?t.selection.map(i):e.selection?.map(r),effects:tO.mapEffects(e.effects,r).concat(tO.mapEffects(t.effects,i)),annotations:e.annotations.length?e.annotations.concat(t.annotations):t.annotations,scrollIntoView:e.scrollIntoView||t.scrollIntoView}}function aO(e,t,n){let r=t.selection,i=uO(t.annotations);return t.userEvent&&(i=i.concat(nO.userEvent.of(t.userEvent))),{changes:t.changes instanceof vD?t.changes:vD.of(t.changes||[],n,e.facet(qD)),selection:r&&(r instanceof W?r:W.single(r.anchor,r.head)),effects:uO(t.effects),annotations:i,scrollIntoView:!!t.scrollIntoView}}function oO(e,t,n){let r=aO(e,t.length?t[0]:{},e.doc.length);t.length&&t[0].filter===!1&&(n=!1);for(let i=1;i<t.length;i++){t[i].filter===!1&&(n=!1);let a=!!t[i].sequential;r=iO(r,aO(e,t[i],a?r.changes.newLength:e.doc.length),a)}let i=nO.create(e,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return cO(n?sO(i):i)}function sO(e){let t=e.startState,n=!0;for(let r of t.facet(JD)){let t=r(e);if(t===!1){n=!1;break}Array.isArray(t)&&(n=n===!0?t:rO(n,t))}if(n!==!0){let r,i;if(n===!1)i=e.changes.invertedDesc,r=vD.empty(t.doc.length);else{let t=e.changes.filter(n);r=t.changes,i=t.filtered.mapDesc(t.changes).invertedDesc}e=nO.create(t,r,e.selection&&e.selection.map(i),tO.mapEffects(e.effects,i),e.annotations,e.scrollIntoView)}let r=t.facet(YD);for(let n=r.length-1;n>=0;n--){let i=r[n](e);e=i instanceof nO?i:Array.isArray(i)&&i.length==1&&i[0]instanceof nO?i[0]:oO(t,uO(i),!1)}return e}function cO(e){let t=e.startState,n=t.facet(XD),r=e;for(let i=n.length-1;i>=0;i--){let a=n[i](e);a&&Object.keys(a).length&&(r=iO(r,aO(t,a,e.changes.newLength),!0))}return r==e?e:nO.create(t,e.changes,e.selection,r.effects,r.annotations,r.scrollIntoView)}var lO=[];function uO(e){return e==null?lO:Array.isArray(e)?e:[e]}var dO=(function(e){return e[e.Word=0]=`Word`,e[e.Space=1]=`Space`,e[e.Other=2]=`Other`,e})(dO||={}),fO=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,pO;try{pO=RegExp(`[\\p{Alphabetic}\\p{Number}_]`,`u`)}catch{}function mO(e){if(pO)return pO.test(e);for(let t=0;t<e.length;t++){let n=e[t];if(/\w/.test(n)||n>``&&(n.toUpperCase()!=n.toLowerCase()||fO.test(n)))return!0}return!1}function hO(e){return t=>{if(!/\S/.test(t))return dO.Space;if(mO(t))return dO.Word;for(let n=0;n<e.length;n++)if(t.indexOf(e[n])>-1)return dO.Word;return dO.Other}}var gO=class e{constructor(e,t,n,r,i,a){this.config=e,this.doc=t,this.selection=n,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=i,a&&(a._state=this);for(let e=0;e<this.config.dynamicSlots.length;e++)UD(this,e<<1);this.computeSlot=null}field(e,t=!0){let n=this.config.address[e.id];if(n==null){if(t)throw RangeError(`Field is not present in this state`);return}return UD(this,n),WD(this,n)}update(...e){return oO(this,e,!0)}applyTransaction(t){let n=this.config,{base:r,compartments:i}=n;for(let e of t.effects)e.is(zD.reconfigure)?(n&&=(i=new Map,n.compartments.forEach((e,t)=>i.set(t,e)),null),i.set(e.value.compartment,e.value.extension)):e.is(tO.reconfigure)?(n=null,r=e.value):e.is(tO.appendConfig)&&(n=null,r=uO(r).concat(e.value));let a;n?a=t.startState.values.slice():(n=VD.resolve(r,i,this),a=new e(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(e,t)=>t.reconfigure(e,this),null).values);let o=t.startState.facet(KD)?t.newSelection:t.newSelection.asSingle();new e(n,t.newDoc,o,a,(e,n)=>n.update(e,t),t)}replaceSelection(e){return typeof e==`string`&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:W.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),r=this.changes(n.changes),i=[n.range],a=uO(n.effects);for(let n=1;n<t.ranges.length;n++){let o=e(t.ranges[n]),s=this.changes(o.changes),c=s.map(r);for(let e=0;e<n;e++)i[e]=i[e].map(c);let l=r.mapDesc(s,!0);i.push(o.range.map(l)),r=r.compose(c),a=tO.mapEffects(a,c).concat(tO.mapEffects(uO(o.effects),l))}return{changes:r,selection:W.create(i,t.mainIndex),effects:a}}changes(t=[]){return t instanceof vD?t:vD.of(t,this.doc.length,this.facet(e.lineSeparator))}toText(t){return $E.of(t.split(this.facet(e.lineSeparator)||hD))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:(UD(this,t),WD(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let n in e){let r=e[n];r instanceof PD&&this.config.address[r.id]!=null&&(t[n]=r.spec.toJSON(this.field(e[n]),this))}return t}static fromJSON(t,n={},r){if(!t||typeof t.doc!=`string`)throw RangeError(`Invalid JSON representation for EditorState`);let i=[];if(r){for(let e in r)if(Object.prototype.hasOwnProperty.call(t,e)){let n=r[e],a=t[e];i.push(n.init(e=>n.spec.fromJSON(a,e)))}}return e.create({doc:t.doc,selection:W.fromJSON(t.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(t={}){let n=VD.resolve(t.extensions||[],new Map),r=t.doc instanceof $E?t.doc:$E.of((t.doc||``).split(n.staticFacet(e.lineSeparator)||hD)),i=t.selection?t.selection instanceof W?t.selection:W.single(t.selection.anchor,t.selection.head):W.single(0);return ED(i,r.length),n.staticFacet(KD)||(i=i.asSingle()),new e(n,r,i,n.dynamicSlots.map(()=>null),(e,t)=>t.create(e),null)}get tabSize(){return this.facet(e.tabSize)}get lineBreak(){return this.facet(e.lineSeparator)||`
|
|
43
|
+
`}get readOnly(){return this.facet(ZD)}phrase(t,...n){for(let n of this.facet(e.phrases))if(Object.prototype.hasOwnProperty.call(n,t)){t=n[t];break}return n.length&&(t=t.replace(/\$(\$|\d*)/g,(e,t)=>{if(t==`$`)return`$`;let r=+(t||1);return!r||r>n.length?e:n[r-1]})),t}languageDataAt(e,t,n=-1){let r=[];for(let i of this.facet(GD))for(let a of i(this,t,n))Object.prototype.hasOwnProperty.call(a,e)&&r.push(a[e]);return r}charCategorizer(e){let t=this.languageDataAt(`wordChars`,e);return hO(t.length?t[0]:``)}wordAt(e){let{text:t,from:n,length:r}=this.doc.lineAt(e),i=this.charCategorizer(e),a=e-n,o=e-n;for(;a>0;){let e=uD(t,a,!1);if(i(t.slice(e,a))!=dO.Word)break;a=e}for(;o<r;){let e=uD(t,o);if(i(t.slice(o,e))!=dO.Word)break;o=e}return a==o?null:W.range(a+n,o+n)}};gO.allowMultipleSelections=KD,gO.tabSize=G.define({combine:e=>e.length?e[0]:4}),gO.lineSeparator=qD,gO.readOnly=ZD,gO.phrases=G.define({compare(e,t){let n=Object.keys(e),r=Object.keys(t);return n.length==r.length&&n.every(n=>e[n]==t[n])}}),gO.languageData=GD,gO.changeFilter=JD,gO.transactionFilter=YD,gO.transactionExtender=XD,zD.reconfigure=tO.define();function _O(e,t,n={}){let r={};for(let t of e)for(let e of Object.keys(t)){let i=t[e],a=r[e];if(a===void 0)r[e]=i;else if(!(a===i||i===void 0))if(Object.hasOwnProperty.call(n,e))r[e]=n[e](a,i);else throw Error(`Config merge conflict for field `+e)}for(let e in t)r[e]===void 0&&(r[e]=t[e]);return r}var vO=class{eq(e){return this==e}range(e,t=e){return bO.create(e,t,this)}};vO.prototype.startSide=vO.prototype.endSide=0,vO.prototype.point=!1,vO.prototype.mapMode=gD.TrackDel;function yO(e,t){return e==t||e.constructor==t.constructor&&e.eq(t)}var bO=class e{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(t,n,r){return new e(t,n,r)}};function xO(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}var SO=class e{constructor(e,t,n,r){this.from=e,this.to=t,this.value=n,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,r=0){let i=n?this.to:this.from;for(let a=r,o=i.length;;){if(a==o)return a;let r=a+o>>1,s=i[r]-e||(n?this.value[r].endSide:this.value[r].startSide)-t;if(r==a)return s>=0?a:o;s>=0?o=r:a=r+1}}between(e,t,n,r){for(let i=this.findIndex(t,-1e9,!0),a=this.findIndex(n,1e9,!1,i);i<a;i++)if(r(this.from[i]+e,this.to[i]+e,this.value[i])===!1)return!1}map(t,n){let r=[],i=[],a=[],o=-1,s=-1;for(let e=0;e<this.value.length;e++){let c=this.value[e],l=this.from[e]+t,u=this.to[e]+t,d,f;if(l==u){let e=n.mapPos(l,c.startSide,c.mapMode);if(e==null||(d=f=e,c.startSide!=c.endSide&&(f=n.mapPos(l,c.endSide),f<d)))continue}else if(d=n.mapPos(l,c.startSide),f=n.mapPos(u,c.endSide),d>f||d==f&&c.startSide>0&&c.endSide<=0)continue;(f-d||c.endSide-c.startSide)<0||(o<0&&(o=d),c.point&&(s=Math.max(s,f-d)),r.push(c),i.push(d-o),a.push(f-o))}return{mapped:r.length?new e(i,a,r,s):null,pos:o}}},CO=class e{constructor(e,t,n,r){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=r}static create(t,n,r,i){return new e(t,n,r,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(t){let{add:n=[],sort:r=!1,filterFrom:i=0,filterTo:a=this.length}=t,o=t.filter;if(n.length==0&&!o)return this;if(r&&(n=n.slice().sort(xO)),this.isEmpty)return n.length?e.of(n):this;let s=new DO(this,null,-1).goto(0),c=0,l=[],u=new TO;for(;s.value||c<n.length;)if(c<n.length&&(s.from-n[c].from||s.startSide-n[c].value.startSide)>=0){let e=n[c++];u.addInner(e.from,e.to,e.value)||l.push(e)}else s.rangeIndex==1&&s.chunkIndex<this.chunk.length&&(c==n.length||this.chunkEnd(s.chunkIndex)<n[c].from)&&(!o||i>this.chunkEnd(s.chunkIndex)||a<this.chunkPos[s.chunkIndex])&&u.addChunk(this.chunkPos[s.chunkIndex],this.chunk[s.chunkIndex])?s.nextChunk():((!o||i>s.to||a<s.from||o(s.from,s.to,s.value))&&(u.addInner(s.from,s.to,s.value)||l.push(bO.create(s.from,s.to,s.value))),s.next());return u.finishInner(this.nextLayer.isEmpty&&!l.length?e.empty:this.nextLayer.update({add:l,filter:o,filterFrom:i,filterTo:a}))}map(t){if(t.empty||this.isEmpty)return this;let n=[],r=[],i=-1;for(let e=0;e<this.chunk.length;e++){let a=this.chunkPos[e],o=this.chunk[e],s=t.touchesRange(a,a+o.length);if(s===!1)i=Math.max(i,o.maxPoint),n.push(o),r.push(t.mapPos(a));else if(s===!0){let{mapped:e,pos:s}=o.map(a,t);e&&(i=Math.max(i,e.maxPoint),n.push(e),r.push(s))}}let a=this.nextLayer.map(t);return n.length==0?a:new e(r,n,a||e.empty,i)}between(e,t,n){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let i=this.chunkPos[r],a=this.chunk[r];if(t>=i&&e<=i+a.length&&a.between(i,e-i,t-i,n)===!1)return}this.nextLayer.between(e,t,n)}}iter(e=0){return OO.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return OO.from(e).goto(t)}static compare(e,t,n,r,i=-1){let a=e.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i),o=t.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i),s=EO(a,o,n),c=new AO(a,s,i),l=new AO(o,s,i);n.iterGaps((e,t,n)=>jO(c,e,l,t,n,r)),n.empty&&n.length==0&&jO(c,0,l,0,0,r)}static eq(e,t,n=0,r){r??=999999999;let i=e.filter(e=>!e.isEmpty&&t.indexOf(e)<0),a=t.filter(t=>!t.isEmpty&&e.indexOf(t)<0);if(i.length!=a.length)return!1;if(!i.length)return!0;let o=EO(i,a),s=new AO(i,o,0).goto(n),c=new AO(a,o,0).goto(n);for(;;){if(s.to!=c.to||!MO(s.active,c.active)||s.point&&(!c.point||!yO(s.point,c.point)))return!1;if(s.to>r)return!0;s.next(),c.next()}}static spans(e,t,n,r,i=-1){let a=new AO(e,null,i).goto(t),o=t,s=a.openStart;for(;;){let e=Math.min(a.to,n);if(a.point){let n=a.activeForPoint(a.to),i=a.pointFrom<t?n.length+1:a.point.startSide<0?n.length:Math.min(n.length,s);r.point(o,e,a.point,n,i,a.pointRank),s=Math.min(a.openEnd(e),n.length)}else e>o&&(r.span(o,e,a.active,s),s=a.openEnd(e));if(a.to>n)return s+(a.point&&a.to>n?1:0);o=a.to,a.next()}}static of(e,t=!1){let n=new TO;for(let r of e instanceof bO?[e]:t?wO(e):e)n.add(r.from,r.to,r.value);return n.finish()}static join(t){if(!t.length)return e.empty;let n=t[t.length-1];for(let r=t.length-2;r>=0;r--)for(let i=t[r];i!=e.empty;i=i.nextLayer)n=new e(i.chunkPos,i.chunk,n,Math.max(i.maxPoint,n.maxPoint));return n}};CO.empty=new CO([],[],null,-1);function wO(e){if(e.length>1)for(let t=e[0],n=1;n<e.length;n++){let r=e[n];if(xO(t,r)>0)return e.slice().sort(xO);t=r}return e}CO.empty.nextLayer=CO.empty;var TO=class e{finishChunk(e){this.chunks.push(new SO(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(t,n,r){this.addInner(t,n,r)||(this.nextLayer||=new e).add(t,n,r)}addInner(e,t,n){let r=e-this.lastTo||n.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw Error("Ranges must be added sorted by `from` position and `startSide`");return r<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(CO.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=CO.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}};function EO(e,t,n){let r=new Map;for(let t of e)for(let e=0;e<t.chunk.length;e++)t.chunk[e].maxPoint<=0&&r.set(t.chunk[e],t.chunkPos[e]);let i=new Set;for(let e of t)for(let t=0;t<e.chunk.length;t++){let a=r.get(e.chunk[t]);a!=null&&(n?n.mapPos(a):a)==e.chunkPos[t]&&!n?.touchesRange(a,a+e.chunk[t].length)&&i.add(e.chunk[t])}return i}var DO=class{constructor(e,t,n,r=0){this.layer=e,this.skip=t,this.minPoint=n,this.rank=r}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,n){for(;this.chunkIndex<this.layer.chunk.length;){let t=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(t)||this.layer.chunkEnd(this.chunkIndex)<e||t.maxPoint<this.minPoint))break;this.chunkIndex++,n=!1}if(this.chunkIndex<this.layer.chunk.length){let r=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!n||this.rangeIndex<r)&&this.setRangeIndex(r)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],n=e+t.from[this.rangeIndex];if(this.from=n,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}},OO=class e{constructor(e){this.heap=e}static from(t,n=null,r=-1){let i=[];for(let e=0;e<t.length;e++)for(let a=t[e];!a.isEmpty;a=a.nextLayer)a.maxPoint>=r&&i.push(new DO(a,n,r,e));return i.length==1?i[0]:new e(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let e=this.heap.length>>1;e>=0;e--)kO(this.heap,e);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let e=this.heap.length>>1;e>=0;e--)kO(this.heap,e);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),kO(this.heap,0)}}};function kO(e,t){for(let n=e[t];;){let r=(t<<1)+1;if(r>=e.length)break;let i=e[r];if(r+1<e.length&&i.compare(e[r+1])>=0&&(i=e[r+1],r++),n.compare(i)<0)break;e[r]=n,e[t]=i,t=r}}var AO=class{constructor(e,t,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=OO.from(e,t,n)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){NO(this.active,e),NO(this.activeTo,e),NO(this.activeRank,e),this.minActive=FO(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:r,rank:i}=this.cursor;for(;t<this.activeRank.length&&(i-this.activeRank[t]||r-this.activeTo[t])>0;)t++;PO(this.active,t,n),PO(this.activeTo,t,r),PO(this.activeRank,t,i),e&&PO(e,t,this.cursor.from),this.minActive=FO(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),n&&NO(n,r)}else if(!this.cursor.value){this.to=this.endSide=1e9;break}else if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let e=this.cursor.value;if(!e.point)this.addActive(n),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=e,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=e.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}}if(n){this.openStart=0;for(let t=n.length-1;t>=0&&n[t]<e;t--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let n=this.active.length-1;n>=0&&!(this.activeRank[n]<this.pointRank);n--)(this.activeTo[n]>e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}};function jO(e,t,n,r,i,a){e.goto(t),n.goto(r);let o=r+i,s=r,c=r-t,l=!!a.boundChange;for(let t=!1;;){let r=e.to+c-n.to,i=r||e.endSide-n.endSide,u=i<0?e.to+c:n.to,d=Math.min(u,o);if(e.point||n.point?(e.point&&n.point&&yO(e.point,n.point)&&MO(e.activeForPoint(e.to),n.activeForPoint(n.to))||a.comparePoint(s,d,e.point,n.point),t=!1):(t&&a.boundChange(s),d>s&&!MO(e.active,n.active)&&a.compareRange(s,d,e.active,n.active),l&&d<o&&(r||e.openEnd(u)!=n.openEnd(u))&&(t=!0)),u>o)break;s=u,i<=0&&e.next(),i>=0&&n.next()}}function MO(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n]&&!yO(e[n],t[n]))return!1;return!0}function NO(e,t){for(let n=t,r=e.length-1;n<r;n++)e[n]=e[n+1];e.pop()}function PO(e,t,n){for(let n=e.length-1;n>=t;n--)e[n+1]=e[n];e[t]=n}function FO(e,t){let n=-1,r=1e9;for(let i=0;i<t.length;i++)(t[i]-r||e[i].endSide-e[n].endSide)<0&&(n=i,r=t[i]);return n}function IO(e,t,n=e.length){let r=0;for(let i=0;i<n&&i<e.length;)e.charCodeAt(i)==9?(r+=t-r%t,i++):(r++,i=uD(e,i));return r}function LO(e,t,n,r){for(let r=0,i=0;;){if(i>=t)return r;if(r==e.length)break;i+=e.charCodeAt(r)==9?n-i%n:1,r=uD(e,r)}return r===!0?-1:e.length}var RO=`ͼ`,zO=typeof Symbol>`u`?`__`+RO:Symbol.for(RO),BO=typeof Symbol>`u`?`__styleSet`+Math.floor(Math.random()*1e8):Symbol(`styleSet`),VO=typeof globalThis<`u`?globalThis:typeof window<`u`?window:{},HO=class{constructor(e,t){this.rules=[];let{finish:n}=t||{};function r(e){return/^@/.test(e)?[e]:e.split(/,\s*/)}function i(e,t,a,o){let s=[],c=/^@(\w+)\b/.exec(e[0]),l=c&&c[1]==`keyframes`;if(c&&t==null)return a.push(e[0]+`;`);for(let n in t){let o=t[n];if(/&/.test(n))i(n.split(/,\s*/).map(t=>e.map(e=>t.replace(/&/,e))).reduce((e,t)=>e.concat(t)),o,a);else if(o&&typeof o==`object`){if(!c)throw RangeError(`The value of a property (`+n+`) should be a primitive value.`);i(r(n),o,s,l)}else o!=null&&s.push(n.replace(/_.*/,``).replace(/[A-Z]/g,e=>`-`+e.toLowerCase())+`: `+o+`;`)}(s.length||l)&&a.push((n&&!c&&!o?e.map(n):e).join(`, `)+` {`+s.join(` `)+`}`)}for(let t in e)i(r(t),e[t],this.rules)}getRules(){return this.rules.join(`
|
|
44
|
+
`)}static newName(){let e=VO[zO]||1;return VO[zO]=e+1,RO+e.toString(36)}static mount(e,t,n){let r=e[BO],i=n&&n.nonce;r?i&&r.setNonce(i):r=new WO(e,i),r.mount(Array.isArray(t)?t:[t],e)}},UO=new Map,WO=class{constructor(e,t){let n=e.ownerDocument||e,r=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let t=UO.get(n);if(t)return e[BO]=t;this.sheet=new r.CSSStyleSheet,UO.set(n,this)}else this.styleTag=n.createElement(`style`),t&&this.styleTag.setAttribute(`nonce`,t);this.modules=[],e[BO]=this}mount(e,t){let n=this.sheet,r=0,i=0;for(let t=0;t<e.length;t++){let a=e[t],o=this.modules.indexOf(a);if(o<i&&o>-1&&(this.modules.splice(o,1),i--,o=-1),o==-1){if(this.modules.splice(i++,0,a),n)for(let e=0;e<a.rules.length;e++)n.insertRule(a.rules[e],r++)}else{for(;i<o;)r+=this.modules[i++].rules.length;r+=a.rules.length,i++}}if(n)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let e=``;for(let t=0;t<this.modules.length;t++)e+=this.modules[t].getRules()+`
|
|
45
|
+
`;this.styleTag.textContent=e;let n=t.head||t;this.styleTag.parentNode!=n&&n.insertBefore(this.styleTag,n.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute(`nonce`)!=e&&this.styleTag.setAttribute(`nonce`,e)}},GO={8:`Backspace`,9:`Tab`,10:`Enter`,12:`NumLock`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,44:`PrintScreen`,45:`Insert`,46:`Delete`,59:`;`,61:`=`,91:`Meta`,92:`Meta`,106:`*`,107:`+`,108:`,`,109:`-`,110:`.`,111:`/`,144:`NumLock`,145:`ScrollLock`,160:`Shift`,161:`Shift`,162:`Control`,163:`Control`,164:`Alt`,165:`Alt`,173:`-`,186:`;`,187:`=`,188:`,`,189:`-`,190:`.`,191:`/`,192:"`",219:`[`,220:`\\`,221:`]`,222:`'`},KO={48:`)`,49:`!`,50:`@`,51:`#`,52:`$`,53:`%`,54:`^`,55:`&`,56:`*`,57:`(`,59:`:`,61:`+`,173:`_`,186:`:`,187:`+`,188:`<`,189:`_`,190:`>`,191:`?`,192:`~`,219:`{`,220:`|`,221:`}`,222:`"`},qO=typeof navigator<`u`&&/Mac/.test(navigator.platform),JO=typeof navigator<`u`&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(YO=0;YO<10;YO++)GO[48+YO]=GO[96+YO]=String(YO);var YO;for(YO=1;YO<=24;YO++)GO[YO+111]=`F`+YO;var YO;for(YO=65;YO<=90;YO++)GO[YO]=String.fromCharCode(YO+32),KO[YO]=String.fromCharCode(YO);var YO;for(XO in GO)KO.hasOwnProperty(XO)||(KO[XO]=GO[XO]);var XO;function ZO(e){var t=!(qO&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||JO&&e.shiftKey&&e.key&&e.key.length==1||e.key==`Unidentified`)&&e.key||(e.shiftKey?KO:GO)[e.keyCode]||e.key||`Unidentified`;return t==`Esc`&&(t=`Escape`),t==`Del`&&(t=`Delete`),t==`Left`&&(t=`ArrowLeft`),t==`Up`&&(t=`ArrowUp`),t==`Right`&&(t=`ArrowRight`),t==`Down`&&(t=`ArrowDown`),t}var QO=typeof navigator<`u`?navigator:{userAgent:``,vendor:``,platform:``},$O=typeof document<`u`?document:{documentElement:{style:{}}},ek=/Edge\/(\d+)/.exec(QO.userAgent),tk=/MSIE \d/.test(QO.userAgent),nk=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(QO.userAgent),rk=!!(tk||nk||ek),ik=!rk&&/gecko\/(\d+)/i.test(QO.userAgent),ak=!rk&&/Chrome\/(\d+)/.exec(QO.userAgent),ok=`webkitFontSmoothing`in $O.documentElement.style,sk=!rk&&/Apple Computer/.test(QO.vendor),ck=sk&&(/Mobile\/\w+/.test(QO.userAgent)||QO.maxTouchPoints>2),K={mac:ck||/Mac/.test(QO.platform),windows:/Win/.test(QO.platform),linux:/Linux|X11/.test(QO.platform),ie:rk,ie_version:tk?$O.documentMode||6:nk?+nk[1]:ek?+ek[1]:0,gecko:ik,gecko_version:ik?+(/Firefox\/(\d+)/.exec(QO.userAgent)||[0,0])[1]:0,chrome:!!ak,chrome_version:ak?+ak[1]:0,ios:ck,android:/Android\b/.test(QO.userAgent),webkit:ok,webkit_version:ok?+(/\bAppleWebKit\/(\d+)/.exec(QO.userAgent)||[0,0])[1]:0,safari:sk,safari_version:sk?+(/\bVersion\/(\d+(\.\d+)?)/.exec(QO.userAgent)||[0,0])[1]:0,tabSize:$O.documentElement.style.tabSize==null?`-moz-tab-size`:`tab-size`};function lk(e,t){for(let n in e)n==`class`&&t.class?t.class+=` `+e.class:n==`style`&&t.style?t.style+=`;`+e.style:t[n]=e[n];return t}var uk=Object.create(null);function dk(e,t,n){if(e==t)return!0;e||=uk,t||=uk;let r=Object.keys(e),i=Object.keys(t);if(r.length-(n&&r.indexOf(n)>-1?1:0)!=i.length-(n&&i.indexOf(n)>-1?1:0))return!1;for(let a of r)if(a!=n&&(i.indexOf(a)==-1||e[a]!==t[a]))return!1;return!0}function fk(e,t){for(let n=e.attributes.length-1;n>=0;n--){let r=e.attributes[n].name;t[r]??e.removeAttribute(r)}for(let n in t){let r=t[n];n==`style`?e.style.cssText=r:e.getAttribute(n)!=r&&e.setAttribute(n,r)}}function pk(e,t,n){let r=!1;if(t)for(let i in t)n&&i in n||(r=!0,i==`style`?e.style.cssText=``:e.removeAttribute(i));if(n)for(let i in n)t&&t[i]==n[i]||(r=!0,i==`style`?e.style.cssText=n[i]:e.setAttribute(i,n[i]));return r}function mk(e){let t=Object.create(null);for(let n=0;n<e.attributes.length;n++){let r=e.attributes[n];t[r.name]=r.value}return t}var hk=class{eq(e){return!1}updateDOM(e,t,n){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,n){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}},gk=(function(e){return e[e.Text=0]=`Text`,e[e.WidgetBefore=1]=`WidgetBefore`,e[e.WidgetAfter=2]=`WidgetAfter`,e[e.WidgetRange=3]=`WidgetRange`,e})(gk||={}),_k=class extends vO{constructor(e,t,n,r){super(),this.startSide=e,this.endSide=t,this.widget=n,this.spec=r}get heightRelevant(){return!1}static mark(e){return new vk(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),n=!!e.block;return t+=n&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new bk(e,t,t,n,e.widget||null,!1)}static replace(e){let t=!!e.block,n,r;if(e.isBlockGap)n=-5e8,r=4e8;else{let{start:i,end:a}=xk(e,t);n=(i?t?-3e8:-1:5e8)-1,r=(a?t?2e8:1:-6e8)+1}return new bk(e,n,r,t,e.widget||null,!0)}static line(e){return new yk(e)}static set(e,t=!1){return CO.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}};_k.none=CO.empty;var vk=class e extends _k{constructor(e){let{start:t,end:n}=xk(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||`span`,this.attrs=e.class&&e.attributes?lk(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||uk}eq(t){return this==t||t instanceof e&&this.tagName==t.tagName&&dk(this.attrs,t.attrs)}range(e,t=e){if(e>=t)throw RangeError(`Mark decorations may not be empty`);return super.range(e,t)}};vk.prototype.point=!1;var yk=class e extends _k{constructor(e){super(-2e8,-2e8,null,e)}eq(t){return t instanceof e&&this.spec.class==t.spec.class&&dk(this.spec.attributes,t.spec.attributes)}range(e,t=e){if(t!=e)throw RangeError(`Line decoration ranges must be zero-length`);return super.range(e,t)}};yk.prototype.mapMode=gD.TrackBefore,yk.prototype.point=!0;var bk=class e extends _k{constructor(e,t,n,r,i,a){super(t,n,i,e),this.block=r,this.isReplace=a,this.mapMode=r?t<=0?gD.TrackBefore:gD.TrackAfter:gD.TrackDel}get type(){return this.startSide==this.endSide?this.startSide<=0?gk.WidgetBefore:gk.WidgetAfter:gk.WidgetRange}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof e&&Sk(this.widget,t.widget)&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw RangeError(`Invalid range for replacement decoration`);if(!this.isReplace&&t!=e)throw RangeError(`Widget decorations can only have zero-length ranges`);return super.range(e,t)}};bk.prototype.point=!0;function xk(e,t=!1){let{inclusiveStart:n,inclusiveEnd:r}=e;return n??=e.inclusive,r??=e.inclusive,{start:n??t,end:r??t}}function Sk(e,t){return e==t||!!(e&&t&&e.compare(t))}function Ck(e,t,n,r=0){let i=n.length-1;i>=0&&n[i]+r>=e?n[i]=Math.max(n[i],t):n.push(e,t)}var wk=class e extends vO{constructor(e,t,n){super(),this.tagName=e,this.attributes=t,this.rank=n}eq(t){return t==this||t instanceof e&&this.tagName==t.tagName&&dk(this.attributes,t.attributes)}static create(t){return new e(t.tagName,t.attributes||uk,t.rank==null?50:Math.max(0,Math.min(t.rank,100)))}static set(e,t=!1){return CO.of(e,t)}};wk.prototype.startSide=wk.prototype.endSide=-1;function Tk(e){let t;return t=e.nodeType==11?e.getSelection?e:e.ownerDocument:e,t.getSelection()}function Ek(e,t){return t?e==t||e.contains(t.nodeType==1?t:t.parentNode):!1}function Dk(e,t){if(!t.anchorNode)return!1;try{return Ek(e,t.anchorNode)}catch{return!1}}function Ok(e){return e.nodeType==3?Uk(e,0,e.nodeValue.length).getClientRects():e.nodeType==1?e.getClientRects():[]}function kk(e,t,n,r){return n?Mk(e,t,n,r,-1)||Mk(e,t,n,r,1):!1}function Ak(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t}function jk(e){return e.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function Mk(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:Nk(e))){if(e.nodeName==`DIV`)return!1;let n=e.parentNode;if(!n||n.nodeType!=1)return!1;t=Ak(e)+(i<0?0:1),e=n}else if(e.nodeType==1){if(e=e.childNodes[t+(i<0?-1:0)],e.nodeType==1&&e.contentEditable==`false`)return!1;t=i<0?Nk(e):0}else return!1}}function Nk(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Pk(e,t){let n=t?e.left:e.right;return{left:n,right:n,top:e.top,bottom:e.bottom}}function Fk(e){let t=e.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}function Ik(e,t){let n=t.width/e.offsetWidth,r=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(t.width-e.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(t.height-e.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function Lk(e,t,n,r,i,a,o,s){let c=e.ownerDocument,l=c.defaultView||window;for(let u=e,d=!1;u&&!d;)if(u.nodeType==1){let e,f=u==c.body,p=1,m=1;if(f)e=Fk(l);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(d=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let t=u.getBoundingClientRect();({scaleX:p,scaleY:m}=Ik(u,t)),e={left:t.left,right:t.left+u.clientWidth*p,top:t.top,bottom:t.top+u.clientHeight*m}}let h=0,g=0;if(i==`nearest`)t.top<e.top+o?(g=t.top-(e.top+o),n>0&&t.bottom>e.bottom+g&&(g=t.bottom-e.bottom+o)):t.bottom>e.bottom-o&&(g=t.bottom-e.bottom+o,n<0&&t.top-g<e.top&&(g=t.top-(e.top+o)));else{let r=t.bottom-t.top,a=e.bottom-e.top;g=(i==`center`&&r<=a?t.top+r/2-a/2:i==`start`||i==`center`&&n<0?t.top-o:t.bottom-a+o)-e.top}if(r==`nearest`?t.left<e.left+a?(h=t.left-(e.left+a),n>0&&t.right>e.right+h&&(h=t.right-e.right+a)):t.right>e.right-a&&(h=t.right-e.right+a,n<0&&t.left<e.left+h&&(h=t.left-(e.left+a))):h=(r==`center`?t.left+(t.right-t.left)/2-(e.right-e.left)/2:r==`start`==s?t.left-a:t.right-(e.right-e.left)+a)-e.left,h||g)if(f)l.scrollBy(h,g);else{let e=0,n=0;if(g){let e=u.scrollTop;u.scrollTop+=g/m,n=(u.scrollTop-e)*m}if(h){let t=u.scrollLeft;u.scrollLeft+=h/p,e=(u.scrollLeft-t)*p}t={left:t.left-e,top:t.top-n,right:t.right-e,bottom:t.bottom-n},e&&Math.abs(e-h)<1&&(r=`nearest`),n&&Math.abs(n-g)<1&&(i=`nearest`)}if(f)break;(t.top<e.top||t.bottom>e.bottom||t.left<e.left||t.right>e.right)&&(t={left:Math.max(t.left,e.left),right:Math.min(t.right,e.right),top:Math.max(t.top,e.top),bottom:Math.min(t.bottom,e.bottom)}),u=u.assignedSlot||u.parentNode}else if(u.nodeType==11)u=u.host;else break}function Rk(e,t=!0){let n=e.ownerDocument,r=null,i=null;for(let a=e.parentNode;a&&!(a==n.body||(!t||r)&&i);)if(a.nodeType==1)!i&&a.scrollHeight>a.clientHeight&&(i=a),t&&!r&&a.scrollWidth>a.clientWidth&&(r=a),a=a.assignedSlot||a.parentNode;else if(a.nodeType==11)a=a.host;else break;return{x:r,y:i}}var zk=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:n}=e;this.set(t,Math.min(e.anchorOffset,t?Nk(t):0),n,Math.min(e.focusOffset,n?Nk(n):0))}set(e,t,n,r){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=r}},Bk=null;K.safari&&K.safari_version>=26&&(Bk=!1);function Vk(e){if(e.setActive)return e.setActive();if(Bk)return e.focus(Bk);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(Bk==null?{get preventScroll(){return Bk={preventScroll:!0},!0}}:void 0),!Bk){Bk=!1;for(let e=0;e<t.length;){let n=t[e++],r=t[e++],i=t[e++];n.scrollTop!=r&&(n.scrollTop=r),n.scrollLeft!=i&&(n.scrollLeft=i)}}}var Hk;function Uk(e,t,n=t){let r=Hk||=document.createRange();return r.setEnd(e,n),r.setStart(e,t),r}function Wk(e,t,n,r){let i={key:t,code:t,keyCode:n,which:n,cancelable:!0};r&&({altKey:i.altKey,ctrlKey:i.ctrlKey,shiftKey:i.shiftKey,metaKey:i.metaKey}=r);let a=new KeyboardEvent(`keydown`,i);a.synthetic=!0,e.dispatchEvent(a);let o=new KeyboardEvent(`keyup`,i);return o.synthetic=!0,e.dispatchEvent(o),a.defaultPrevented||o.defaultPrevented}function Gk(e){for(;e;){if(e&&(e.nodeType==9||e.nodeType==11&&e.host))return e;e=e.assignedSlot||e.parentNode}return null}function Kk(e,t){let n=t.focusNode,r=t.focusOffset;if(!n||t.anchorNode!=n||t.anchorOffset!=r)return!1;for(r=Math.min(r,Nk(n));;)if(r){if(n.nodeType!=1)return!1;let e=n.childNodes[r-1];e.contentEditable==`false`?r--:(n=e,r=Nk(n))}else if(n==e)return!0;else r=Ak(n),n=n.parentNode}function qk(e){return e instanceof Window?e.pageYOffset>Math.max(0,e.document.documentElement.scrollHeight-e.innerHeight-4):e.scrollTop>Math.max(1,e.scrollHeight-e.clientHeight-4)}function Jk(e,t){for(let n=e,r=t;;)if(n.nodeType==3&&r>0)return{node:n,offset:r};else if(n.nodeType==1&&r>0){if(n.contentEditable==`false`)return null;n=n.childNodes[r-1],r=Nk(n)}else if(n.parentNode&&!jk(n))r=Ak(n),n=n.parentNode;else return null}function Yk(e,t){for(let n=e,r=t;;)if(n.nodeType==3&&r<n.nodeValue.length)return{node:n,offset:r};else if(n.nodeType==1&&r<n.childNodes.length){if(n.contentEditable==`false`)return null;n=n.childNodes[r],r=0}else if(n.parentNode&&!jk(n))r=Ak(n)+1,n=n.parentNode;else return null}var Xk=class e{constructor(e,t,n=!0){this.node=e,this.offset=t,this.precise=n}static before(t,n){return new e(t.parentNode,Ak(t),n)}static after(t,n){return new e(t.parentNode,Ak(t)+1,n)}},Zk=(function(e){return e[e.LTR=0]=`LTR`,e[e.RTL=1]=`RTL`,e})(Zk||={}),Qk=Zk.LTR,$k=Zk.RTL;function eA(e){let t=[];for(let n=0;n<e.length;n++)t.push(1<<e[n]);return t}var tA=eA(`88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008`),nA=eA(`4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333`),rA=Object.create(null),iA=[];for(let e of[`()`,`[]`,`{}`]){let t=e.charCodeAt(0),n=e.charCodeAt(1);rA[t]=n,rA[n]=-t}function aA(e){return e<=247?tA[e]:1424<=e&&e<=1524?2:1536<=e&&e<=1785?nA[e-1536]:1774<=e&&e<=2220?4:8192<=e&&e<=8204?256:64336<=e&&e<=65023?4:1}var oA=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/,sA=class{get dir(){return this.level%2?$k:Qk}constructor(e,t,n){this.from=e,this.to=t,this.level=n}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,n,r){let i=-1;for(let a=0;a<e.length;a++){let o=e[a];if(o.from<=t&&o.to>=t){if(o.level==n)return a;(i<0||(r==0?e[i].level>o.level:r<0?o.from<t:o.to>t))&&(i=a)}}if(i<0)throw RangeError(`Index out of range`);return i}};function cA(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.from!=i.from||r.to!=i.to||r.direction!=i.direction||!cA(r.inner,i.inner))return!1}return!0}var lA=[];function uA(e,t,n,r,i){for(let a=0;a<=r.length;a++){let o=a?r[a-1].to:t,s=a<r.length?r[a].from:n,c=a?256:i;for(let t=o,n=c,r=c;t<s;t++){let i=aA(e.charCodeAt(t));i==512?i=n:i==8&&r==4&&(i=16),lA[t]=i==4?2:i,i&7&&(r=i),n=i}for(let e=o,t=c,r=c;e<s;e++){let i=lA[e];if(i==128)e<s-1&&t==lA[e+1]&&t&24?i=lA[e]=t:lA[e]=256;else if(i==64){let i=e+1;for(;i<s&&lA[i]==64;)i++;let a=e&&t==8||i<n&&lA[i]==8?r==1?1:8:256;for(let t=e;t<i;t++)lA[t]=a;e=i-1}else i==8&&r==1&&(lA[e]=1);t=i,i&7&&(r=i)}}}function dA(e,t,n,r,i){let a=i==1?2:1;for(let o=0,s=0,c=0;o<=r.length;o++){let l=o?r[o-1].to:t,u=o<r.length?r[o].from:n;for(let t=l,n,r,o;t<u;t++)if(r=rA[n=e.charCodeAt(t)])if(r<0){for(let e=s-3;e>=0;e-=3)if(iA[e+1]==-r){let n=iA[e+2],r=n&2?i:n&4?n&1?a:i:0;r&&(lA[t]=lA[iA[e]]=r),s=e;break}}else if(iA.length==189)break;else iA[s++]=t,iA[s++]=n,iA[s++]=c;else if((o=lA[t])==2||o==1){let e=o==i;c=+!e;for(let t=s-3;t>=0;t-=3){let n=iA[t+2];if(n&2)break;if(e)iA[t+2]|=2;else{if(n&4)break;iA[t+2]|=4}}}}}function fA(e,t,n,r){for(let i=0,a=r;i<=n.length;i++){let o=i?n[i-1].to:e,s=i<n.length?n[i].from:t;for(let c=o;c<s;){let o=lA[c];if(o==256){let o=c+1;for(;;)if(o==s){if(i==n.length)break;o=n[i++].to,s=i<n.length?n[i].from:t}else if(lA[o]==256)o++;else break;let l=a==1,u=l==((o<t?lA[o]:r)==1)?l?1:2:r;for(let t=o,r=i,a=r?n[r-1].to:e;t>c;)t==a&&(t=n[--r].from,a=r?n[r-1].to:e),lA[--t]=u;c=o}else a=o,c++}}}function pA(e,t,n,r,i,a,o){let s=r%2?2:1;if(r%2==i%2)for(let c=t,l=0;c<n;){let t=!0,u=!1;if(l==a.length||c<a[l].from){let e=lA[c];e!=s&&(t=!1,u=e==16)}let d=!t&&s==1?[]:null,f=t?r:r+1,p=c;run:for(;;)if(l<a.length&&p==a[l].from){if(u)break run;let m=a[l];if(!t)for(let e=m.to,t=l+1;;){if(e==n)break run;if(t<a.length&&a[t].from==e)e=a[t++].to;else if(lA[e]==s)break run;else break}l++,d?d.push(m):(m.from>c&&o.push(new sA(c,m.from,f)),mA(e,m.direction==Qk==!(f%2)?r:r+1,i,m.inner,m.from,m.to,o),c=m.to),p=m.to}else if(p==n||(t?lA[p]!=s:lA[p]==s))break;else p++;d?pA(e,c,p,r+1,i,d,o):c<p&&o.push(new sA(c,p,f)),c=p}else for(let c=n,l=a.length;c>t;){let n=!0,u=!1;if(!l||c>a[l-1].to){let e=lA[c-1];e!=s&&(n=!1,u=e==16)}let d=!n&&s==1?[]:null,f=n?r:r+1,p=c;run:for(;;)if(l&&p==a[l-1].to){if(u)break run;let m=a[--l];if(!n)for(let e=m.from,n=l;;){if(e==t)break run;if(n&&a[n-1].to==e)e=a[--n].from;else if(lA[e-1]==s)break run;else break}d?d.push(m):(m.to<c&&o.push(new sA(m.to,c,f)),mA(e,m.direction==Qk==!(f%2)?r:r+1,i,m.inner,m.from,m.to,o),c=m.from),p=m.from}else if(p==t||(n?lA[p-1]!=s:lA[p-1]==s))break;else p--;d?pA(e,p,c,r+1,i,d,o):p<c&&o.push(new sA(p,c,f)),c=p}}function mA(e,t,n,r,i,a,o){let s=t%2?2:1;uA(e,i,a,r,s),dA(e,i,a,r,s),fA(i,a,r,s),pA(e,i,a,t,n,r,o)}function hA(e,t,n){if(!e)return[new sA(0,0,+(t==$k))];if(t==Qk&&!n.length&&!oA.test(e))return gA(e.length);if(n.length)for(;e.length>lA.length;)lA[lA.length]=256;let r=[],i=t==Qk?0:1;return mA(e,i,i,n,0,e.length,r),r}function gA(e){return[new sA(0,e,0)]}var _A=``;function vA(e,t,n,r,i){let a=r.head-e.from,o=sA.find(t,a,r.bidiLevel??-1,r.assoc),s=t[o],c=s.side(i,n);if(a==c){let e=o+=i?1:-1;if(e<0||e>=t.length)return null;s=t[o=e],a=s.side(!i,n),c=s.side(i,n)}let l=uD(e.text,a,s.forward(i,n));(l<s.from||l>s.to)&&(l=c),_A=e.text.slice(Math.min(a,l),Math.max(a,l));let u=o==(i?t.length-1:0)?null:t[o+(i?1:-1)];return u&&l==c&&u.level+ +!i<s.level?W.cursor(u.side(!i,n)+e.from,u.forward(i,n)?1:-1,u.level):W.cursor(l+e.from,s.forward(i,n)?-1:1,s.level)}function yA(e,t,n){for(let r=t;r<n;r++){let t=aA(e.charCodeAt(r));if(t==1)return Qk;if(t==2||t==4)return $k}return Qk}var bA=G.define(),xA=G.define(),SA=G.define(),CA=G.define(),wA=G.define(),TA=G.define(),EA=G.define(),DA=G.define(),OA=G.define(),kA=G.define({combine:e=>e.some(e=>e)}),AA=G.define({combine:e=>e.some(e=>e)}),jA=G.define(),MA=class e{constructor(e,t,n,r,i,a=!1){this.range=e,this.y=t,this.x=n,this.yMargin=r,this.xMargin=i,this.isSnapshot=a}map(t){return t.empty?this:new e(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(t){return this.range.to<=t.doc.length?this:new e(W.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}},NA=tO.define({map:(e,t)=>e.map(t)}),PA=tO.define();function FA(e,t,n){let r=e.facet(CA);r.length?r[0](t):window.onerror&&window.onerror(String(t),n,void 0,void 0,t)||(n?console.error(n+`:`,t):console.error(t))}var IA=G.define({combine:e=>e.length?e[0]:!0}),LA=0,RA=G.define({combine(e){return e.filter((t,n)=>{for(let r=0;r<n;r++)if(e[r].plugin==t.plugin)return!1;return!0})}}),zA=class e{constructor(e,t,n,r,i){this.id=e,this.create=t,this.domEventHandlers=n,this.domEventObservers=r,this.baseExtensions=i(this),this.extension=this.baseExtensions.concat(RA.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(RA.of({plugin:this,arg:e}))}static define(t,n){let{eventHandlers:r,eventObservers:i,provide:a,decorations:o}=n||{};return new e(LA++,t,r,i,e=>{let t=[];return o&&t.push(UA.of(t=>{let n=t.plugin(e);return n?o(n):_k.none})),a&&t.push(a(e)),t})}static fromClass(t,n){return e.define((e,n)=>new t(e,n),n)}},BA=class{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(!this.value){if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(t){FA(e.state,t,`CodeMirror plugin crashed`),this.deactivate()}}else if(this.mustUpdate){let e=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(e)}catch(t){if(FA(e.state,t,`CodeMirror plugin crashed`),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}return this}destroy(e){if(this.value?.destroy)try{this.value.destroy()}catch(t){FA(e.state,t,`CodeMirror plugin crashed`)}}deactivate(){this.spec=this.value=null}},VA=G.define(),HA=G.define(),UA=G.define(),WA=G.define(),GA=G.define(),KA=G.define(),qA=G.define();function JA(e,t){let n=e.state.facet(qA);if(!n.length)return n;let r=n.map(t=>t instanceof Function?t(e):t),i=[];return CO.spans(r,t.from,t.to,{point(){},span(e,n,r,a){let o=e-t.from,s=n-t.from,c=i;for(let e=r.length-1;e>=0;e--,a--){let n=r[e].spec.bidiIsolate,i;if(n??=yA(t.text,o,s),a>0&&c.length&&(i=c[c.length-1]).to==o&&i.direction==n)i.to=s,c=i.inner;else{let e={from:o,to:s,direction:n,inner:[]};c.push(e),c=e.inner}}}}),i}var YA=G.define();function XA(e){let t=0,n=0,r=0,i=0;for(let a of e.state.facet(YA)){let o=a(e);o&&(o.left!=null&&(t=Math.max(t,o.left)),o.right!=null&&(n=Math.max(n,o.right)),o.top!=null&&(r=Math.max(r,o.top)),o.bottom!=null&&(i=Math.max(i,o.bottom)))}return{left:t,right:n,top:r,bottom:i}}var ZA=G.define(),QA=class e{constructor(e,t,n,r){this.fromA=e,this.toA=t,this.fromB=n,this.toB=r}join(t){return new e(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(e){let t=e.length,n=this;for(;t>0;t--){let r=e[t-1];if(!(r.fromA>n.toA)){if(r.toA<n.fromA)break;n=n.join(r),e.splice(t-1,1)}}return e.splice(t,0,n),e}static extendWithRanges(t,n){if(n.length==0)return t;let r=[];for(let i=0,a=0,o=0;;){let s=i<t.length?t[i].fromB:1e9,c=a<n.length?n[a]:1e9,l=Math.min(s,c);if(l==1e9)break;let u=l+o,d=l,f=u;for(;;)if(a<n.length&&n[a]<=d){let e=n[a+1];a+=2,d=Math.max(d,e);for(let e=i;e<t.length&&t[e].fromB<=d;e++)o=t[e].toA-t[e].toB;f=Math.max(f,e+o)}else if(i<t.length&&t[i].fromB<=d){let e=t[i++];d=Math.max(d,e.toB),f=Math.max(f,e.toA),o=e.toA-e.toB}else break;r.push(new e(u,f,l,d))}return r}},$A=class e{constructor(e,t,n){this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=vD.empty(this.startState.doc.length);for(let e of n)this.changes=this.changes.compose(e.changes);let r=[];this.changes.iterChangedRanges((e,t,n,i)=>r.push(new QA(e,t,n,i))),this.changedRanges=r}static create(t,n,r){return new e(t,n,r)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}},ej=[],tj=class{constructor(e,t,n=0){this.dom=e,this.length=t,this.flags=n,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return ej}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let e=this.domAttrs;e&&fk(this.dom,e)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:``)+(this.breakAfter?`#`:``)}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,t=this.posAtStart){let n=t;for(let t of this.children){if(t==e)return n;n+=t.length+t.breakAfter}throw RangeError(`Invalid child in posBefore`)}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,t){return null}domPosFor(e,t){let n=Ak(this.dom),r=this.length?e>0:t>0;return new Xk(this.parent.dom,n+ +!!r,e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof ij)return e;return null}static get(e){return e.cmTile}},nj=class extends tj{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let t=this.dom,n=null,r,i=e?.node==t?e:null,a=0;for(let o of this.children){if(o.sync(e),a+=o.length+o.breakAfter,r=n?n.nextSibling:t.firstChild,i&&r!=o.dom&&(i.written=!0),o.dom.parentNode==t)for(;r&&r!=o.dom;)r=rj(r);else t.insertBefore(o.dom,r);n=o.dom}for(r=n?n.nextSibling:t.firstChild,i&&r&&(i.written=!0);r;)r=rj(r);this.length=a}};function rj(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}var ij=class extends nj{constructor(e,t){super(t),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let t=tj.get(e);if(t&&this.owns(t))return t;e=e.parentNode}}blockTiles(e){for(let t=[],n=this,r=0,i=0;;)if(r==n.children.length){if(!t.length)return;n=n.parent,n.breakAfter&&i++,r=t.pop()}else{let a=n.children[r++];if(a instanceof aj)t.push(r),n=a,r=0;else{let t=i+a.length,n=e(a,i);if(n!==void 0)return n;i=t+a.breakAfter}}}resolveBlock(e,t){let n,r=-1,i,a=-1;if(this.blockTiles((o,s)=>{let c=s+o.length;if(e>=s&&e<=c){if(o.isWidget()&&t>=-1&&t<=1){if(o.flags&32)return!0;o.flags&16&&(n=void 0)}(s<e||e==c&&(t<-1?o.length:o.covers(1)))&&(!n||!o.isWidget()&&n.isWidget())&&(n=o,r=e-s),(c>e||e==s&&(t>1?o.length:o.covers(-1)))&&(!i||!o.isWidget()&&i.isWidget())&&(i=o,a=e-s)}}),!n&&!i)throw Error(`No tile at position `+e);return n&&t<0||!i?{tile:n,offset:r}:{tile:i,offset:a}}},aj=class e extends nj{constructor(e,t){super(e),this.wrapper=t}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(t,n){let r=new e(n||document.createElement(t.tagName),t);return n||(r.flags|=4),r}},oj=class e extends nj{constructor(e,t){super(e),this.attrs=t}isLine(){return!0}static start(t,n,r){let i=new e(n||document.createElement(`div`),t);return(!n||!r)&&(i.flags|=4),i}get domAttrs(){return this.attrs}resolveInline(e,t,n){let r=null,i=-1,a=null,o=-1;function s(e,c){for(let l=0,u=0;l<e.children.length&&u<=c;l++){let d=e.children[l],f=u+d.length;f>=c&&(d.isComposite()?s(d,c-u):(!a||a.isHidden&&(t>0||n&&cj(a,d)))&&(f>c||d.flags&32)?(a=d,o=c-u):(u<c||d.flags&16&&!d.isHidden)&&(r=d,i=c-u)),u=f}}s(this,e);let c=(t<0?r:a)||r||a;return c?{tile:c,offset:c==r?i:o}:null}coordsIn(e,t){let n=this.resolveInline(e,t,!0);return n?n.tile.coordsIn(Math.max(0,n.offset),t):sj(this)}domIn(e,t){let n=this.resolveInline(e,t);if(n){let{tile:e,offset:r}=n;if(this.dom.contains(e.dom))return e.isText()?new Xk(e.dom,Math.min(e.dom.nodeValue.length,r)):e.domPosFor(r,e.flags&16?1:e.flags&32?-1:t);let i=n.tile.parent,a=!1;for(let e of i.children){if(a)return new Xk(e.dom,0);e==n.tile&&(a=!0)}}return new Xk(this.dom,0)}};function sj(e){let t=e.dom.lastChild;if(!t)return e.dom.getBoundingClientRect();let n=Ok(t);return n[n.length-1]||null}function cj(e,t){let n=e.coordsIn(0,1),r=t.coordsIn(0,1);return n&&r&&r.top<n.bottom}var lj=class e extends nj{constructor(e,t){super(e),this.mark=t}get domAttrs(){return this.mark.attrs}static of(t,n){let r=new e(n||document.createElement(t.tagName),t);return n||(r.flags|=4),r}},uj=class e extends tj{constructor(e,t){super(e,t.length),this.text=t}sync(e){this.flags&2||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,t){let n=this.dom.nodeValue.length;e>n&&(e=n);let r=e,i=e,a=0;e==0&&t<0||e==n&&t>=0?K.chrome||K.gecko||(e?(r--,a=1):i<n&&(i++,a=-1)):t<0?r--:i<n&&i++;let o=Uk(this.dom,r,i).getClientRects();if(!o.length)return null;let s=o[(a?a<0:t>=0)?0:o.length-1];return K.safari&&!a&&s.width==0&&(s=Array.prototype.find.call(o,e=>e.width)||s),a?Pk(s,a<0):s||null}static of(t,n){let r=new e(n||document.createTextNode(t),t);return n||(r.flags|=2),r}},dj=class e extends tj{constructor(e,t,n,r){super(e,t,r),this.widget=n}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,t){return this.coordsInWidget(e,t,!1)}coordsInWidget(e,t,n){let r=this.widget.coordsAt(this.dom,e,t);if(r)return r;if(n)return Pk(this.dom.getBoundingClientRect(),this.length?e==0:t<=0);{let t=this.dom.getClientRects(),n=null;if(!t.length)return null;let r=this.flags&16?!0:this.flags&32?!1:e>0;for(let i=r?t.length-1:0;n=t[i],!(e>0?i==0:i==t.length-1||n.top<n.bottom);i+=r?-1:1);return Pk(n,!r)}}get overrideDOMText(){if(!this.length)return $E.empty;let{root:e}=this;if(!e)return $E.empty;let t=this.posAtStart;return e.view.state.doc.slice(t,t+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(t,n,r,i,a){return a||(a=t.toDOM(n),t.editable||(a.contentEditable=`false`)),new e(a,r,t,i)}},fj=class extends tj{constructor(e){let t=document.createElement(`img`);t.className=`cm-widgetBuffer`,t.setAttribute(`aria-hidden`,`true`),super(t,0,e)}get isHidden(){return!0}get overrideDOMText(){return $E.empty}coordsIn(e){return this.dom.getBoundingClientRect()}},pj=class{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,t,n){let{tile:r,index:i,beforeBreak:a,parents:o}=this;for(;e||t>0;)if(!r.isComposite())if(i==r.length)a=!!r.breakAfter,{tile:r,index:i}=o.pop(),i++;else if(e){let t=Math.min(e,r.length-i);n&&n.skip(r,i,i+t),e-=t,i+=t}else break;else if(a){if(!e)break;n&&n.break(),e--,a=!1}else if(i==r.children.length){if(!e&&!o.length)break;n&&n.leave(r),a=!!r.breakAfter,{tile:r,index:i}=o.pop(),i++}else{let s=r.children[i],c=s.breakAfter;(t>0?s.length<=e:s.length<e)&&(!n||n.skip(s,0,s.length)!==!1||!s.isComposite)?(a=!!c,i++,e-=s.length):(o.push({tile:r,index:i}),r=s,i=0,n&&s.isComposite()&&n.enter(s))}return this.tile=r,this.index=i,this.beforeBreak=a,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}},mj=class{constructor(e,t,n,r){this.from=e,this.to=t,this.wrapper=n,this.rank=r}},hj=class{constructor(e,t,n){this.cache=e,this.root=t,this.blockWrappers=n,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,t,n,r){this.flushBuffer();let i=this.ensureMarks(t,n),a=i.lastChild;if(a&&a.isText()&&!(a.flags&8)&&a.length+e.length<512){this.cache.reused.set(a,2);let t=i.children[i.children.length-1]=new uj(a.dom,a.text+e);t.parent=i}else i.append(r||uj.of(e,this.cache.find(uj)?.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,t){let n=this.curLine;n.dom!=t.line.dom&&(n.setDOM(this.cache.reused.has(t.line)?Tj(t.line.dom):t.line.dom),this.cache.reused.set(t.line,2));let r=n;for(let e=t.marks.length-1;e>=0;e--){let n=t.marks[e],i=r.lastChild;if(i instanceof lj&&i.mark.eq(n.mark))i.dom!=n.dom&&i.setDOM(Tj(n.dom)),r=i;else{if(this.cache.reused.get(n)){let e=tj.get(n.dom);e&&e.setDOM(Tj(n.dom))}let e=lj.of(n.mark,n.dom);r.append(e),r=e}this.cache.reused.set(n,2)}let i=tj.get(e.text);i&&this.cache.reused.set(i,2);let a=new uj(e.text,e.text.nodeValue);a.flags|=8,this.pos=e.range.toB,r.append(a)}addInlineWidget(e,t,n){let r=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);r||this.flushBuffer();let i=this.ensureMarks(t,n);!r&&!(e.flags&16)&&i.append(this.getBuffer(1)),i.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,t,n){this.flushBuffer(),this.ensureMarks(t,n).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let t=this.afterWidget||this.lastBlock;t.length+=e,this.pos+=e}addLineStart(e,t){e||=Sj;let n=oj.start(e,t||this.cache.find(oj)?.dom,!!t);this.getBlockPos().append(this.lastBlock=this.curLine=n)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,t){let n=this.curLine;for(let r=e.length-1;r>=0;r--){let i=e[r],a;if(t>0&&(a=n.lastChild)&&a instanceof lj&&a.mark.eq(i))n=a,t--;else{let e=lj.of(i,this.cache.find(lj,e=>e.mark.eq(i))?.dom);n.append(e),n=e,t=0}}return n}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!bj(this.curLine,!1)||e.dom.nodeName!=`BR`&&e.isWidget()&&!(K.ios&&bj(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(Dj,0,32)||new dj(Dj.toDOM(),0,Dj,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let t=e.rank*102+e.value.rank,n=new mj(e.from,e.to,e.value,t),r=this.wrappers.length;for(;r>0&&(this.wrappers[r-1].rank-n.rank||this.wrappers[r-1].to-n.to)<0;)r--;this.wrappers.splice(r,0,n)}this.wrapperPos=this.pos}getBlockPos(){this.updateBlockWrappers();let e=this.root;for(let t of this.wrappers){let n=e.lastChild;if(t.from<this.pos&&n instanceof aj&&n.wrapper.eq(t.wrapper))e=n;else{let n=aj.of(t.wrapper,this.cache.find(aj,e=>e.wrapper.eq(t.wrapper))?.dom);e.append(n),e=n}}return e}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let t=2|(e<0?16:32),n=this.cache.find(fj,void 0,1);return n&&(n.flags=t),n||new fj(t)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}},gj=class{constructor(e){this.skipCount=0,this.text=``,this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text=``,this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:t,lineBreak:n,done:r}=this.cursor.next(this.skipCount);if(this.skipCount=0,r)throw Error(`Ran out of text content when drawing inline views`);this.text=t;let i=this.textOff=Math.min(e,t.length);return n?null:t.slice(0,i)}let t=Math.min(this.text.length,this.textOff+e),n=this.text.slice(this.textOff,t);return this.textOff=t,n}},_j=[dj,oj,uj,lj,fj,aj,ij];for(let e=0;e<_j.length;e++)_j[e].bucket=e;var vj=class{constructor(e){this.view=e,this.buckets=_j.map(()=>[]),this.index=_j.map(()=>0),this.reused=new Map}add(e){let t=e.constructor.bucket,n=this.buckets[t];n.length<6?n.push(e):n[this.index[t]=(this.index[t]+1)%6]=e}find(e,t,n=2){let r=e.bucket,i=this.buckets[r],a=this.index[r];for(let e=i.length-1;e>=0;e--){let o=(e+a)%i.length,s=i[o];if((!t||t(s))&&!this.reused.has(s))return i.splice(o,1),o<a&&this.index[r]--,this.reused.set(s,n),s}return null}findWidget(e,t,n){let r=this.buckets[0];if(r.length)for(let i=0,a=0;;i++){if(i==r.length){if(a)return null;a=1,i=0}let o=r[i];if(!this.reused.has(o)&&(a==0?o.widget.compare(e):o.widget.constructor==e.constructor&&e.updateDOM(o.dom,this.view,o.widget)))return r.splice(i,1),i<this.index[0]&&this.index[0]--,o.widget==e&&o.length==t&&(o.flags&497)==n?(this.reused.set(o,1),o):(this.reused.set(o,2),new dj(o.dom,t,e,o.flags&-498|n))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,t=2){if(!this.reused.has(e))return this.reused.set(e,t),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}},yj=class{constructor(e,t,n,r,i){this.view=e,this.decorations=r,this.disallowBlockEffectsFor=i,this.openWidget=!1,this.openMarks=0,this.cache=new vj(e),this.text=new gj(e.state.doc),this.builder=new hj(this.cache,new ij(e,e.contentDOM),CO.iter(n)),this.cache.reused.set(t,2),this.old=new pj(t),this.reuseWalker={skip:(e,t,n)=>{if(this.cache.add(e),e.isComposite())return!1},enter:e=>this.cache.add(e),leave:()=>{},break:()=>{}}}run(e,t){let n=t&&this.getCompositionContext(t.text);for(let r=0,i=0,a=0;;){let o=a<e.length?e[a++]:null,s=o?o.fromA:this.old.root.length;if(s>r){let e=s-r;this.preserve(e,!a,!o),r=s,i+=e}if(!o)break;t&&o.fromA<=t.range.fromA&&o.toA>=t.range.toA?(this.forward(o.fromA,t.range.fromA,t.range.fromA<t.range.toA?1:-1),this.emit(i,t.range.fromB),this.builder.flushBuffer(),this.cache.clear(),this.builder.addComposition(t,n),this.text.skip(t.range.toB-t.range.fromB),this.forward(t.range.fromA,o.toA),this.emit(t.range.toB,o.toB)):(this.forward(o.fromA,o.toA),this.emit(i,o.toB)),i=o.toB,r=o.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,t,n){let r=wj(this.old),i=this.openMarks;this.old.advance(e,n?1:-1,{skip:(e,t,n)=>{if(e.isWidget())if(this.openWidget)this.builder.continueWidget(n-t);else{let a=n>0||t<e.length?dj.of(e.widget,this.view,n-t,e.flags&496,this.cache.maybeReuse(e)):this.cache.reuse(e);a.flags&256?(a.flags&=-2,this.builder.addBlockWidget(a)):(this.builder.ensureLine(null),this.builder.addInlineWidget(a,r,i),i=r.length)}else if(e.isText())this.builder.ensureLine(null),!t&&n==e.length&&!this.cache.reused.has(e)?this.builder.addText(e.text,r,i,this.cache.reuse(e)):(this.cache.add(e),this.builder.addText(e.text.slice(t,n),r,i)),i=r.length;else if(e.isLine())e.flags&=-2,this.cache.reused.set(e,1),this.builder.addLine(e);else if(e instanceof fj)this.cache.add(e);else if(e instanceof lj)this.builder.ensureLine(null),this.builder.addMark(e,r,i),this.cache.reused.set(e,1),i=r.length;else return!1;this.openWidget=!1},enter:e=>{e.isLine()?this.builder.addLineStart(e.attrs,this.cache.maybeReuse(e)):(this.cache.add(e),e instanceof lj&&r.unshift(e.mark)),this.openWidget=!1},leave:e=>{e.isLine()?r.length&&=i=0:e instanceof lj&&(r.shift(),i=Math.min(i,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,t){let n=null,r=this.builder,i=0,a=CO.spans(this.decorations,e,t,{point:(e,t,a,o,s,c)=>{if(a instanceof bk){if(this.disallowBlockEffectsFor[c]){if(a.block)throw RangeError(`Block decorations may not be specified via plugins`);if(t>this.view.state.doc.lineAt(e).to)throw RangeError(`Decorations that replace line breaks may not be specified via plugins`)}if(i=o.length,s>o.length)r.continueWidget(t-e);else{let i=a.widget||(a.block?Ej.block:Ej.inline),c=xj(a),l=this.cache.findWidget(i,t-e,c)||dj.of(i,this.view,t-e,c);a.block?(a.startSide>0&&r.addLineStartIfNotCovered(n),r.addBlockWidget(l)):(r.ensureLine(n),r.addInlineWidget(l,o,s))}n=null}else n=Cj(n,a);t>e&&this.text.skip(t-e)},span:(e,t,a,o)=>{for(let i=e;i<t;){let s=this.text.next(Math.min(512,t-i));s==null?(r.addLineStartIfNotCovered(n),r.addBreak(),i++):(r.ensureLine(n),r.addText(s,a,i==e?o:a.length),i+=s.length),n=null}i=a.length}});this.openWidget=a>i,this.openWidget||r.addLineStartIfNotCovered(n),this.openMarks=a}forward(e,t,n=1){t-e<=10?this.old.advance(t-e,n,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(t-e-10,-1),this.old.advance(5,n,this.reuseWalker))}getCompositionContext(e){let t=[],n=null;for(let r=e.parentNode;;r=r.parentNode){let e=tj.get(r);if(r==this.view.contentDOM)break;e instanceof lj?t.push(e):e?.isLine()?n=e:e instanceof aj||(r.nodeName==`DIV`&&!n&&r!=this.view.contentDOM?n=new oj(r,Sj):n||t.push(lj.of(new vk({tagName:r.nodeName.toLowerCase(),attributes:mk(r)}),r)))}return{line:n,marks:t}}};function bj(e,t){let n=e=>{for(let r of e.children)if((t?r.isText():r.length)||n(r))return!0;return!1};return n(e)}function xj(e){let t=e.isReplace?(e.startSide<0?64:0)|(e.endSide>0?128:0):e.startSide>0?32:16;return e.block&&(t|=256),t}var Sj={class:`cm-line`};function Cj(e,t){let n=t.spec.attributes,r=t.spec.class;return!n&&!r?e:(e||={class:`cm-line`},n&&lk(n,e),r&&(e.class+=` `+r),e)}function wj(e){let t=[];for(let n=e.parents.length;n>1;n--){let r=n==e.parents.length?e.tile:e.parents[n].tile;r instanceof lj&&t.push(r.mark)}return t}function Tj(e){let t=tj.get(e);return t&&t.setDOM(e.cloneNode()),e}var Ej=class extends hk{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}};Ej.inline=new Ej(`span`),Ej.block=new Ej(`div`);var Dj=new class extends hk{toDOM(){return document.createElement(`br`)}get isHidden(){return!0}get editable(){return!0}},Oj=class{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=_k.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new ij(e,e.contentDOM),this.updateInner([new QA(0,0,0,e.state.doc.length)],null)}update(e){let t=e.changedRanges;this.minWidth>0&&t.length&&(t.every(({fromA:e,toA:t})=>t<this.minWidthFrom||e>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let n=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(this.domChanged?.newSel?n=this.domChanged.newSel.head:!zj(e.changes,this.hasComposition)&&!e.selectionSet&&(n=e.state.selection.main.head));let r=n>-1?Mj(this.view,e.changes,n):null;if(this.domChanged=null,this.hasComposition){let{from:n,to:r}=this.hasComposition;t=new QA(n,r,e.changes.mapPos(n,-1),e.changes.mapPos(r,1)).addToSet(t.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(K.ie||K.chrome)&&!r&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let i=this.decorations,a=this.blockWrappers;this.updateDeco();let o=Fj(i,this.decorations,e.changes);o.length&&(t=QA.extendWithRanges(t,o));let s=Lj(a,this.blockWrappers,e.changes);return s.length&&(t=QA.extendWithRanges(t,s)),r&&!t.some(e=>e.fromA<=r.range.fromA&&e.toA>=r.range.toA)&&(t=r.range.addToSet(t.slice())),this.tile.flags&2&&t.length==0?!1:(this.updateInner(t,r),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t){this.view.viewState.mustMeasureContent=!0;let{observer:n}=this.view;n.ignore(()=>{if(t||e.length){let n=this.tile,r=new yj(this.view,n,this.blockWrappers,this.decorations,this.dynamicDecorationMap);t&&tj.get(t.text)&&r.cache.reused.set(tj.get(t.text),2),this.tile=r.run(e,t),kj(n,r.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+`px`,this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+`px`:``;let r=K.chrome||K.ios?{node:n.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(r),r&&(r.written||n.selectionRange.focusNode!=r.node||!this.tile.dom.contains(r.node))&&(this.forceSelection=!0),this.tile.dom.style.height=``});let r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let e of this.tile.children)e.isWidget()&&e.widget instanceof Bj&&r.push(e.dom);n.updateGaps(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let e of t.effects)e.is(PA)&&(this.editContextFormatting=e.value)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:n}=this.tile,r=this.view.root.activeElement,i=r==n,a=!i&&!(this.view.state.facet(IA)||n.tabIndex>-1)&&Dk(n,this.view.observer.selectionRange)&&!(r&&n.contains(r));if(!(i||t||a))return;let o=this.forceSelection;this.forceSelection=!1;let s=this.view.state.selection.main,c,l;if(s.empty?l=c=this.inlineDOMNearPos(s.anchor,s.assoc||1):(l=this.inlineDOMNearPos(s.head,s.head==s.from?1:-1),c=this.inlineDOMNearPos(s.anchor,s.anchor==s.from?1:-1)),K.gecko&&s.empty&&!this.hasComposition&&Aj(c)){let e=document.createTextNode(``);this.view.observer.ignore(()=>c.node.insertBefore(e,c.node.childNodes[c.offset]||null)),c=l=new Xk(e,0),o=!0}let u=this.view.observer.selectionRange;(o||!u.focusNode||(!kk(c.node,c.offset,u.anchorNode,u.anchorOffset)||!kk(l.node,l.offset,u.focusNode,u.focusOffset))&&!this.suppressWidgetCursorChange(u,s))&&(this.view.observer.ignore(()=>{K.android&&K.chrome&&n.contains(u.focusNode)&&Rj(u.focusNode,n)&&(n.blur(),n.focus({preventScroll:!0}));let e=Tk(this.view.root);if(e)if(s.empty){if(K.gecko){let e=Nj(c.node,c.offset);if(e&&e!=3){let t=(e==1?Jk:Yk)(c.node,c.offset);t&&(c=new Xk(t.node,t.offset))}}e.collapse(c.node,c.offset),s.bidiLevel!=null&&e.caretBidiLevel!==void 0&&(e.caretBidiLevel=s.bidiLevel)}else if(e.extend){e.collapse(c.node,c.offset);try{e.extend(l.node,l.offset)}catch{}}else{let t=document.createRange();s.anchor>s.head&&([c,l]=[l,c]),t.setEnd(l.node,l.offset),t.setStart(c.node,c.offset),e.removeAllRanges(),e.addRange(t)}a&&this.view.root.activeElement==n&&(n.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(c,l)),this.impreciseAnchor=c.precise?null:new Xk(u.anchorNode,u.anchorOffset),this.impreciseHead=l.precise?null:new Xk(u.focusNode,u.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&kk(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,n=Tk(e.root),{anchorNode:r,anchorOffset:i}=e.observer.selectionRange;if(!n||!t.empty||!t.assoc||!n.modify)return;let a=this.lineAt(t.head,t.assoc);if(!a)return;let o=a.posAtStart;if(t.head==o||t.head==o+a.length)return;let s=this.coordsAt(t.head,-1),c=this.coordsAt(t.head,1);if(!s||!c||s.bottom>c.top)return;let l=this.domAtPos(t.head+t.assoc,t.assoc);n.collapse(l.node,l.offset),n.modify(`move`,t.assoc<0?`forward`:`backward`,`lineboundary`),e.observer.readSelectionRange();let u=e.observer.selectionRange;e.docView.posFromDOM(u.anchorNode,u.anchorOffset)!=t.from&&n.collapse(r,i)}posFromDOM(e,t){let n=this.tile.nearest(e);if(!n)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let r=n.posAtStart;if(n.isComposite()){let i;if(e==n.dom)i=n.dom.childNodes[t];else{let r=Nk(e)==0?0:t==0?-1:1;for(;;){let t=e.parentNode;if(t==n.dom)break;r==0&&t.firstChild!=t.lastChild&&(r=e==t.firstChild?-1:1),e=t}i=r<0?e:e.nextSibling}if(i==n.dom.firstChild)return r;for(;i&&!tj.get(i);)i=i.nextSibling;if(!i)return r+n.length;for(let e=0,t=r;;e++){let r=n.children[e];if(r.dom==i)return t;t+=r.length+r.breakAfter}}else if(n.isText())return e==n.dom?r+t:r+(t?n.length:0);else return r}domAtPos(e,t){let{tile:n,offset:r}=this.tile.resolveBlock(e,t);return n.isWidget()?n.domPosFor(e,t):n.domIn(r,t)}inlineDOMNearPos(e,t){let n,r=-1,i=!1,a,o=-1,s=!1;return this.tile.blockTiles((t,c)=>{if(t.isWidget()){if(t.flags&32&&c>=e)return!0;t.flags&16&&(i=!0)}else{let l=c+t.length;if(c<=e&&(n=t,r=e-c,i=l<e),l>=e&&!a&&(a=t,o=e-c,s=c>e),c>e&&a)return!0}}),!n&&!a?this.domAtPos(e,t):(i&&a?n=null:s&&n&&(a=null),n&&t<0||!a?n.domIn(r,t):a.domIn(o,t))}coordsAt(e,t){let{tile:n,offset:r}=this.tile.resolveBlock(e,t);return n.isWidget()?n.widget instanceof Bj?null:n.coordsInWidget(r,t,!0):n.coordsIn(r,t)}lineAt(e,t){let{tile:n}=this.tile.resolveBlock(e,t);return n.isLine()?n:null}coordsForChar(e){let{tile:t,offset:n}=this.tile.resolveBlock(e,1);if(!t.isLine())return null;function r(e,t){if(e.isComposite())for(let n of e.children){if(n.length>=t){let e=r(n,t);if(e)return e}if(t-=n.length,t<0)break}else if(e.isText()&&t<e.length){let n=uD(e.text,t);if(n==t)return null;let r=Uk(e.dom,t,n).getClientRects();for(let e=0;e<r.length;e++){let t=r[e];if(e==r.length-1||t.top<t.bottom&&t.left<t.right)return t}}return null}return r(t,n)}measureVisibleLineHeights(e){let t=[],{from:n,to:r}=e,i=this.view.contentDOM.clientWidth,a=i>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,o=-1,s=this.view.textDirection==Zk.LTR,c=0,l=(e,u,d)=>{for(let f=0;f<e.children.length&&!(u>r);f++){let r=e.children[f],p=u+r.length,m=r.dom.getBoundingClientRect(),{height:h}=m;if(d&&!f&&(c+=m.top-d.top),r instanceof aj)p>n&&l(r,u,m);else if(u>=n&&(c>0&&t.push(-c),t.push(h+c),c=0,a)){let e=r.dom.lastChild,t=e?Ok(e):[];if(t.length){let e=t[t.length-1],n=s?e.right-m.left:m.right-e.left;n>o&&(o=n,this.minWidth=i,this.minWidthFrom=u,this.minWidthTo=p)}}d&&f==e.children.length-1&&(c+=d.bottom-m.bottom),u=p+r.breakAfter}};return l(this.tile,0,null),t}textDirectionAt(e){let{tile:t}=this.tile.resolveBlock(e,1);return getComputedStyle(t.dom).direction==`rtl`?Zk.RTL:Zk.LTR}measureTextSize(){let e=this.tile.blockTiles(e=>{if(e.isLine()&&e.children.length&&e.length<=20){let t=0,n;for(let r of e.children){if(!r.isText()||/[^ -~]/.test(r.text))return;let e=Ok(r.dom);if(e.length!=1)return;t+=e[0].width,n=e[0].height}if(t)return{lineHeight:e.dom.getBoundingClientRect().height,charWidth:t/e.length,textHeight:n}}});if(e)return e;let t=document.createElement(`div`),n,r,i;return t.className=`cm-line`,t.style.width=`99999px`,t.style.position=`absolute`,t.textContent=`abc def ghi jkl mno pqr stu`,this.view.observer.ignore(()=>{this.tile.dom.appendChild(t);let e=Ok(t.firstChild)[0];n=t.getBoundingClientRect().height,r=e&&e.width?e.width/27:7,i=e&&e.height?e.height:n,t.remove()}),{lineHeight:n,charWidth:r,textHeight:i}}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,r=0;;r++){let i=r==t.viewports.length?null:t.viewports[r],a=i?i.from-1:this.view.state.doc.length;if(a>n){let r=(t.lineBlockAt(a).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push(_k.replace({widget:new Bj(r),block:!0,inclusive:!0,isBlockGap:!0}).range(n,a))}if(!i)break;n=i.to+1}return _k.set(e)}updateDeco(){let e=1,t=this.view.state.facet(UA).map(t=>(this.dynamicDecorationMap[e++]=typeof t==`function`)?t(this.view):t),n=!1,r=this.view.state.facet(GA).map((e,t)=>{let r=typeof e==`function`;return r&&(n=!0),r?e(this.view):e});for(r.length&&(this.dynamicDecorationMap[e++]=n,t.push(CO.join(r))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(WA).map(e=>typeof e==`function`?e(this.view):e)}scrollIntoView(e){if(e.isSnapshot){let t=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=t.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let t of this.view.state.facet(jA))try{if(t(this.view,e.range,e))return!0}catch(e){FA(this.view.state,e,`scroll handler`)}let{range:t}=e,n=this.coordsAt(t.head,t.assoc??(t.empty?0:t.head>t.anchor?-1:1)),r;if(!n)return;!t.empty&&(r=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(n={left:Math.min(n.left,r.left),top:Math.min(n.top,r.top),right:Math.max(n.right,r.right),bottom:Math.max(n.bottom,r.bottom)});let i=XA(this.view),a={left:n.left-i.left,top:n.top-i.top,right:n.right+i.right,bottom:n.bottom+i.bottom},{offsetWidth:o,offsetHeight:s}=this.view.scrollDOM;if(Lk(this.view.scrollDOM,a,t.head<t.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,o),-o),Math.max(Math.min(e.yMargin,s),-s),this.view.textDirection==Zk.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(n.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||n.bottom<window.pageYOffset+window.visualViewport.offsetTop)){let e=this.view.docView.lineAt(t.head,1);e&&e.dom.scrollIntoView({block:`nearest`})}}lineHasWidget(e){let t=e=>e.isWidget()||e.children.some(t);return t(this.tile.resolveBlock(e,1).tile)}destroy(){kj(this.tile)}};function kj(e,t){let n=t?.get(e);if(n!=1){n??e.destroy();for(let n of e.children)kj(n,t)}}function Aj(e){return e.node.nodeType==1&&e.node.firstChild&&(e.offset==0||e.node.childNodes[e.offset-1].contentEditable==`false`)&&(e.offset==e.node.childNodes.length||e.node.childNodes[e.offset].contentEditable==`false`)}function jj(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let r=Jk(n.focusNode,n.focusOffset),i=Yk(n.focusNode,n.focusOffset),a=r||i;if(i&&r&&i.node!=r.node){let t=tj.get(i.node);if(!t||t.isText()&&t.text!=i.node.nodeValue)a=i;else if(e.docView.lastCompositionAfterCursor){let e=tj.get(r.node);!e||e.isText()&&e.text!=r.node.nodeValue||(a=i)}}if(e.docView.lastCompositionAfterCursor=a!=r,!a)return null;let o=t-a.offset;return{from:o,to:o+a.node.nodeValue.length,node:a.node}}function Mj(e,t,n){let r=jj(e,n);if(!r)return null;let{node:i,from:a,to:o}=r,s=i.nodeValue;if(/[\n\r]/.test(s)||e.state.doc.sliceString(r.from,r.to)!=s)return null;let c=t.invertedDesc;return{range:new QA(c.mapPos(a),c.mapPos(o),a,o),text:i}}function Nj(e,t){return e.nodeType==1?(t&&e.childNodes[t-1].contentEditable==`false`?1:0)|(t<e.childNodes.length&&e.childNodes[t].contentEditable==`false`?2:0):0}var Pj=class{constructor(){this.changes=[]}compareRange(e,t){Ck(e,t,this.changes)}comparePoint(e,t){Ck(e,t,this.changes)}boundChange(e){Ck(e,e,this.changes)}};function Fj(e,t,n){let r=new Pj;return CO.compare(e,t,n,r),r.changes}var Ij=class{constructor(){this.changes=[]}compareRange(e,t){Ck(e,t,this.changes)}comparePoint(){}boundChange(e){Ck(e,e,this.changes)}};function Lj(e,t,n){let r=new Ij;return CO.compare(e,t,n,r),r.changes}function Rj(e,t){for(let n=e;n&&n!=t;n=n.assignedSlot||n.parentNode)if(n.nodeType==1&&n.contentEditable==`false`)return!0;return!1}function zj(e,t){let n=!1;return t&&e.iterChangedRanges((e,r)=>{e<t.to&&r>t.from&&(n=!0)}),n}var Bj=class extends hk{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement(`div`);return e.className=`cm-gap`,this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+`px`,!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}};function Vj(e,t,n=1){let r=e.charCategorizer(t),i=e.doc.lineAt(t),a=t-i.from;if(i.length==0)return W.cursor(t);a==0?n=1:a==i.length&&(n=-1);let o=a,s=a;n<0?o=uD(i.text,a,!1):s=uD(i.text,a);let c=r(i.text.slice(o,s));for(;o>0;){let e=uD(i.text,o,!1);if(r(i.text.slice(e,o))!=c)break;o=e}for(;s<i.length;){let e=uD(i.text,s);if(r(i.text.slice(s,e))!=c)break;s=e}return W.undirectionalRange(o+i.from,s+i.from)}function Hj(e,t,n,r,i){let a=Math.round((r-t.left)*e.defaultCharacterWidth);if(e.lineWrapping&&n.height>e.defaultLineHeight*1.5){let t=e.viewState.heightOracle.textHeight,r=Math.floor((i-n.top-(e.defaultLineHeight-t)*.5)/t);a+=r*e.viewState.heightOracle.lineLength}let o=e.state.sliceDoc(n.from,n.to);return n.from+LO(o,a,e.state.tabSize)}function Uj(e,t,n){let r=e.lineBlockAt(t);if(Array.isArray(r.type)){let e;for(let i of r.type){if(i.from>t)break;if(!(i.to<t)){if(i.from<t&&i.to>t)return i;(!e||i.type==gk.Text&&(e.type!=i.type||(n<0?i.from<t:i.to>t)))&&(e=i)}}return e||r}return r}function Wj(e,t,n,r){let i=Uj(e,t.head,t.assoc||-1),a=!r||i.type!=gk.Text||!(e.lineWrapping||i.widgetLineBreaks)?null:e.coordsAtPos(t.assoc<0&&t.head>i.from?t.head-1:t.head);if(a){let t=e.dom.getBoundingClientRect(),r=e.textDirectionAt(i.from),o=e.posAtCoords({x:n==(r==Zk.LTR)?t.right-1:t.left+1,y:(a.top+a.bottom)/2});if(o!=null)return W.cursor(o,n?-1:1)}return W.cursor(n?i.to:i.from,n?-1:1)}function Gj(e,t,n,r){let i=e.state.doc.lineAt(t.head),a=e.bidiSpans(i),o=e.textDirectionAt(i.from);for(let s=t,c=null;;){let t=vA(i,a,o,s,n),l=_A;if(!t){if(i.number==(n?e.state.doc.lines:1))return s;l=`
|
|
46
|
+
`,i=e.state.doc.line(i.number+(n?1:-1)),a=e.bidiSpans(i),t=e.visualLineSide(i,!n)}if(!c){if(!r)return t;c=r(l)}else if(!c(l))return s;s=t}}function Kj(e,t,n){let r=e.state.charCategorizer(t),i=r(n);return e=>{let t=r(e);return i==dO.Space&&(i=t),i==t}}function qj(e,t,n,r){let i=t.head,a=n?1:-1;if(i==(n?e.state.doc.length:0))return W.cursor(i,t.assoc);let o=t.goalColumn,s,c=e.contentDOM.getBoundingClientRect(),l=e.coordsAtPos(i,t.assoc||((t.empty?n:t.head==t.from)?1:-1)),u=e.documentTop;if(l)o??=l.left-c.left,s=a<0?l.top:l.bottom;else{let t=e.viewState.lineBlockAt(i);o??=Math.min(c.right-c.left,e.defaultCharacterWidth*(i-t.from)),s=(a<0?t.top:t.bottom)+u}let d=c.left+o,f=e.viewState.heightOracle.textHeight>>1,p=r??f;for(let t=0;;t+=f){let r=s+(p+t)*a,i=Qj(e,{x:d,y:r},!1,a);if(n?r>c.bottom:r<c.top)return W.cursor(i.pos,i.assoc);let l=e.coordsAtPos(i.pos,i.assoc),u=l?(l.top+l.bottom)/2:0;if(!l||(n?u>s:u<s))return W.cursor(i.pos,i.assoc,void 0,o)}}function Jj(e,t,n){for(;;){let r=0;for(let i of e)i.between(t-1,t+1,(e,i,a)=>{if(t>e&&t<i){let a=r||n||(t-e<i-t?-1:1);t=a<0?e:i,r=a}});if(!r)return t}}function Yj(e,t){let n=null;for(let r=0;r<t.ranges.length;r++){let i=t.ranges[r],a=null;if(i.empty){let t=Jj(e,i.from,0);t!=i.from&&(a=W.cursor(t,-1))}else{let t=Jj(e,i.from,-1),n=Jj(e,i.to,1);(t!=i.from||n!=i.to)&&(a=i.undirectional?W.undirectionalRange(i.from,i.to):W.range(i.from==i.anchor?t:n,i.from==i.head?t:n))}a&&(n||=t.ranges.slice(),n[r]=a)}return n?W.create(n,t.mainIndex):t}function Xj(e,t,n){let r=Jj(e.state.facet(KA).map(t=>t(e)),n.from,t.head>n.from?-1:1);return r==n.from?n:W.cursor(r,r<n.from?1:-1)}var Zj=class{constructor(e,t){this.pos=e,this.assoc=t}};function Qj(e,t,n,r){let i=e.contentDOM.getBoundingClientRect(),a=i.top+e.viewState.paddingTop,{x:o,y:s}=t,c=s-a,l;for(;;){if(c<0)return new Zj(0,1);if(c>e.viewState.docHeight)return new Zj(e.state.doc.length,-1);if(l=e.elementAtHeight(c),r==null)break;if(l.type==gk.Text){if(r<0?l.to<e.viewport.from:l.from>e.viewport.to)break;let t=e.docView.coordsAt(r<0?l.from:l.to,r>0?-1:1);if(t&&(r<0?t.top<=c+a:t.bottom>=c+a))break}let t=e.viewState.heightOracle.textHeight/2;c=r>0?l.bottom+t:l.top-t}if(e.viewport.from>=l.to||e.viewport.to<=l.from){if(n)return null;if(l.type==gk.Text){let t=Hj(e,i,l,o,s);return new Zj(t,t==l.from?1:-1)}}if(l.type!=gk.Text)return c<(l.top+l.bottom)/2?new Zj(l.from,1):new Zj(l.to,-1);let u=e.docView.lineAt(l.from,2);return(!u||u.length!=l.length)&&(u=e.docView.lineAt(l.from,-2)),new $j(e,o,s,e.textDirectionAt(l.from)).scanTile(u,l.from)}var $j=class{constructor(e,t,n,r){this.view=e,this.x=t,this.y=n,this.baseDir=r,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,t){let{line:n,spans:r}=this.bidiSpansAt(e);return r[sA.find(r,e-n.from,-1,t)].level==this.baseDir}dirAt(e,t){let{line:n,spans:r}=this.bidiSpansAt(e);return r[sA.find(r,e-n.from,-1,t)].dir}bidiIn(e,t){let{spans:n,line:r}=this.bidiSpansAt(e);return n.length>1||n.length&&(n[0].level!=this.baseDir||n[0].to+r.from<t)}scan(e,t,n=!1){let r=0,i=e.length-1,a=new Set,o=this.bidiIn(e[0],e[i]),s,c,l=-1,u=1e9,d;search:for(;r<i;){let n=i-r,f=r+i>>1;adjust:if(a.has(f)){let e=r+Math.floor(Math.random()*n);for(let t=0;t<n;t++){if(!a.has(e)){f=e;break adjust}e++,e==i&&(e=r)}break search}a.add(f);let p=t(f);if(p)for(let t=0;t<p.length;t++){let n=p[t],a=0;if(!(n.width==0&&p.length>1)){if(n.bottom<this.y)(!s||s.bottom<n.bottom)&&(s=n),a=1;else if(n.top>this.y)(!c||c.top>n.top)&&(c=n),a=-1;else{let e=n.left>this.x?this.x-n.left:n.right<this.x?this.x-n.right:0,t=Math.abs(e);t<u&&(l=f,u=t,d=n),e&&(a=e<0==(this.baseDir==Zk.LTR)?-1:1)}a==-1&&(!o||this.baseDirAt(e[f],1))?i=f:a==1&&(!o||this.baseDirAt(e[f+1],-1))&&(r=f+1)}}}if(!d){if(!c&&!s)return{i:e[0],after:!1};let n=s&&(!c||this.y-s.bottom<c.top-this.y)?s:c;return this.y=(n.top+n.bottom)/2,this.scan(e,t,!0)}if(u&&!n){let{top:n,bottom:r}=d;if(s&&s.bottom>(n+n+r)/3)return this.y=s.bottom-1,this.scan(e,t,!0);if(c&&c.top<(n+r+r)/3)return this.y=c.top+1,this.scan(e,t,!0)}let f=(o?this.dirAt(e[l],1):this.baseDir)==Zk.LTR;return{i:l,after:this.x>(d.left+d.right)/2==f}}scanText(e,t){let n=[];for(let r=0;r<e.length;r=uD(e.text,r))n.push(t+r);n.push(t+e.length);let r=this.scan(n,r=>{let i=n[r]-t,a=n[r+1]-t;return Uk(e.dom,i,a).getClientRects()});return r.after?new Zj(n[r.i+1],-1):new Zj(n[r.i],1)}scanTile(e,t){if(!e.length)return new Zj(t,1);if(e.children.length==1){let n=e.children[0];if(n.isText())return this.scanText(n,t);if(n.isComposite())return this.scanTile(n,t)}let n=[t];for(let r=0,i=t;r<e.children.length;r++)n.push(i+=e.children[r].length);let r=this.scan(n,t=>{let n=e.children[t];return n.flags&48?null:(n.dom.nodeType==1?n.dom:Uk(n.dom,0,n.length)).getClientRects()}),i=e.children[r.i],a=n[r.i];return i.isText()?this.scanText(i,a):i.isComposite()?this.scanTile(i,a):r.after?new Zj(n[r.i+1],-1):new Zj(a,1)}},eM=``,tM=class{constructor(e,t){this.points=e,this.view=t,this.text=``,this.lineSeparator=t.state.facet(gO.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=eM}readRange(e,t){if(!e)return this;let n=e.parentNode;for(let r=e;;){this.findPointBefore(n,r);let e=this.text.length;this.readNode(r);let i=tj.get(r),a=r.nextSibling;if(a==t){i?.breakAfter&&!a&&n!=this.view.contentDOM&&this.lineBreak();break}let o=tj.get(a);(i&&o?i.breakAfter:(i?i.breakAfter:jk(r))||jk(a)&&(r.nodeName!=`BR`||i?.isWidget())&&this.text.length>e)&&!rM(a,t)&&this.lineBreak(),r=a}return this.findPointBefore(n,t),this}readTextNode(e){let t=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,t.length));for(let n=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let i=-1,a=1,o;if(this.lineSeparator?(i=t.indexOf(this.lineSeparator,n),a=this.lineSeparator.length):(o=r.exec(t))&&(i=o.index,a=o[0].length),this.append(t.slice(n,i<0?t.length:i)),i<0)break;if(this.lineBreak(),a>1)for(let t of this.points)t.node==e&&t.pos>this.text.length&&(t.pos-=a-1);n=i+a}}readNode(e){let t=tj.get(e),n=t&&t.overrideDOMText;if(n!=null){this.findPointInside(e,n.length);for(let e=n.iter();!e.next().done;)e.lineBreak?this.lineBreak():this.append(e.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName==`BR`?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==t&&(n.pos=this.text.length)}findPointInside(e,t){for(let n of this.points)(e.nodeType==3?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(nM(e,n.node,n.offset)?t:0))}};function nM(e,t,n){for(;;){if(!t||n<Nk(t))return!1;if(t==e)return!0;n=Ak(t)+1,t=t.parentNode}}function rM(e,t){let n;for(;!(e==t||!e);e=e.nextSibling){let t=tj.get(e);if(!t?.isWidget())return!1;t&&(n||=[]).push(t)}if(n){for(let e of n)if(e.overrideDOMText?.length)return!1}return!0}var iM=class{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}},aM=class{constructor(e,t,n,r){this.typeOver=r,this.bounds=null,this.text=``,this.domChanged=t>-1;let{impreciseHead:i,impreciseAnchor:a}=e.docView,o=e.state.selection;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=oM(e.docView.tile,t,n,0))){let t=i||a?[]:dM(e),n=new tM(t,e);n.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=n.text,this.newSel=fM(t,this.bounds.from)}else{let t=e.observer.selectionRange,n=i&&i.node==t.focusNode&&i.offset==t.focusOffset||!Ek(e.contentDOM,t.focusNode)?o.main.head:e.docView.posFromDOM(t.focusNode,t.focusOffset),r=a&&a.node==t.anchorNode&&a.offset==t.anchorOffset||!Ek(e.contentDOM,t.anchorNode)?o.main.anchor:e.docView.posFromDOM(t.anchorNode,t.anchorOffset),s=e.viewport;if((K.ios||K.chrome)&&n!=r&&Math.min(n,r)<=o.main.from&&Math.max(n,r)>=o.main.to&&(s.from>0||s.to<e.state.doc.length)){let t=Math.min(n,r),i=Math.max(n,r),a=s.from-t,o=s.to-i;(a==0||a==1||t==0)&&(o==0||o==-1||i==e.state.doc.length)&&(n=0,r=e.state.doc.length)}if(e.inputState.composing>-1&&o.ranges.length>1)this.newSel=o.replaceRange(W.range(r,n));else if(e.lineWrapping&&r==n&&!(o.main.empty&&o.main.head==n)&&e.inputState.lastTouchTime>Date.now()-100){let t=e.coordsAtPos(n,-1),r=0;t&&(r=e.inputState.lastTouchY<=t.bottom?-1:1),this.newSel=W.create([W.cursor(n,r)])}else this.newSel=W.single(r,n)}}};function oM(e,t,n,r){if(e.isComposite()){let i=-1,a=-1,o=-1,s=-1;for(let c=0,l=r,u=r;c<e.children.length;c++){let r=e.children[c],d=l+r.length;if(l<t&&d>n)return oM(r,t,n,l);if(d>=t&&i==-1&&(i=c,a=l),l>n&&r.dom.parentNode==e.dom){o=c,s=u;break}u=d,l=d+r.breakAfter}return{from:a,to:s<0?r+e.length:s,startDOM:(i?e.children[i-1].dom.nextSibling:null)||e.dom.firstChild,endDOM:o<e.children.length&&o>=0?e.children[o].dom:null}}else if(e.isText())return{from:r,to:r+e.length,startDOM:e.dom,endDOM:e.dom.nextSibling};else return null}function sM(e,t){let n,{newSel:r}=t,{state:i}=e,a=i.selection.main,o=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:e,to:r}=t.bounds,s=a.from,c=null;(o===8||K.android&&t.text.length<r-e)&&(s=a.to,c=`end`);let l=i.doc.sliceString(e,r,eM),u,d;!a.empty&&a.from>=e&&a.to<=r&&(t.typeOver||l!=t.text)&&l.slice(0,a.from-e)==t.text.slice(0,a.from-e)&&l.slice(a.to-e)==t.text.slice(u=t.text.length-(l.length-(a.to-e)))?n={from:a.from,to:a.to,insert:$E.of(t.text.slice(a.from-e,u).split(eM))}:(d=uM(l,t.text,s-e,c))&&(K.chrome&&o==13&&d.toB==d.from+2&&t.text.slice(d.from,d.toB)==eM+eM&&d.toB--,n={from:e+d.from,to:e+d.toA,insert:$E.of(t.text.slice(d.from,d.toB).split(eM))})}else r&&(!e.hasFocus&&i.facet(IA)||pM(r,a))&&(r=null);if(!n&&!r)return!1;if((K.mac||K.android)&&n&&n.from==n.to&&n.from==a.head-1&&/^\. ?$/.test(n.insert.toString())&&e.contentDOM.getAttribute(`autocorrect`)==`off`?(r&&n.insert.length==2&&(r=W.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:$E.of([n.insert.toString().replace(`.`,` `)])}):i.doc.lineAt(a.from).to<a.to&&e.docView.lineHasWidget(a.to)&&e.inputState.insertingTextAt>Date.now()-50?n={from:a.from,to:a.to,insert:i.toText(e.inputState.insertingText)}:K.chrome&&n&&n.from==n.to&&n.from==a.head&&n.insert.toString()==`
|
|
47
|
+
`&&e.lineWrapping&&(r&&=W.single(r.main.anchor-1,r.main.head-1),n={from:a.from,to:a.to,insert:$E.of([` `])}),n)return cM(e,n,r,o);if(r&&!pM(r,a)){let t=!1,n=`select`;return e.inputState.lastSelectionTime>Date.now()-50&&(e.inputState.lastSelectionOrigin==`select`&&(t=!0),n=e.inputState.lastSelectionOrigin,n==`select.pointer`&&(r=Yj(i.facet(KA).map(t=>t(e)),r))),e.dispatch({selection:r,scrollIntoView:t,userEvent:n}),!0}else return!1}function cM(e,t,n,r=-1){if(K.ios&&e.inputState.flushIOSKey(t))return!0;let i=e.state.selection.main;if(K.android&&(t.to==i.to&&(t.from==i.from||t.from==i.from-1&&e.state.sliceDoc(t.from,i.from)==` `)&&t.insert.length==1&&t.insert.lines==2&&Wk(e.contentDOM,`Enter`,13)||(t.from==i.from-1&&t.to==i.to&&t.insert.length==0||r==8&&t.insert.length<t.to-t.from&&t.to>i.head)&&Wk(e.contentDOM,`Backspace`,8)||t.from==i.from&&t.to==i.to+1&&t.insert.length==0&&Wk(e.contentDOM,`Delete`,46)))return!0;let a=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let o,s=()=>o||=lM(e,t,n);return e.state.facet(TA).some(n=>n(e,t.from,t.to,a,s))||e.dispatch(s()),!0}function lM(e,t,n){let r,i=e.state,a=i.selection.main,o=-1;if(t.from==t.to&&t.from<a.from||t.from>a.to){let n=t.from<a.from?-1:1,r=n<0?a.from:a.to,s=Jj(i.facet(KA).map(t=>t(e)),r,n);t.from==s&&(o=s)}if(o>-1)r={changes:t,selection:W.cursor(t.from+t.insert.length,-1)};else if(t.from>=a.from&&t.to<=a.to&&t.to-t.from>=(a.to-a.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let n=a.from<t.from?i.sliceDoc(a.from,t.from):``,o=a.to>t.to?i.sliceDoc(t.to,a.to):``;r=i.replaceSelection(e.state.toText(n+t.insert.sliceString(0,void 0,e.state.lineBreak)+o))}else{let o=i.changes(t),s=n&&n.main.to<=o.newLength?n.main:void 0;if(i.selection.ranges.length>1&&(e.inputState.composing>=0||e.inputState.compositionPendingChange)&&t.to<=a.to+10&&t.to>=a.to-10){let c=e.state.sliceDoc(t.from,t.to),l,u=n&&jj(e,n.main.head);if(u){let e=t.insert.length-(t.to-t.from);l={from:u.from,to:u.to-e}}else l=e.state.doc.lineAt(a.head);let d=a.to-t.to;r=i.changeByRange(n=>{if(n.from==a.from&&n.to==a.to)return{changes:o,range:s||n.map(o)};let r=n.to-d,u=r-c.length;if(e.state.sliceDoc(u,r)!=c||r>=l.from&&u<=l.to)return{range:n};let f=i.changes({from:u,to:r,insert:t.insert}),p=n.to-a.to;return{changes:f,range:s?W.range(Math.max(0,s.anchor+p),Math.max(0,s.head+p)):n.map(f)}})}else r={changes:o,selection:s&&i.selection.replaceRange(s)}}let s=`input.type`;return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,s+=`.compose`,e.inputState.compositionFirstChange&&(s+=`.start`,e.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:s,scrollIntoView:!0})}function uM(e,t,n,r){let i=Math.min(e.length,t.length),a=0;for(;a<i&&e.charCodeAt(a)==t.charCodeAt(a);)a++;if(a==i&&e.length==t.length)return null;let o=e.length,s=t.length;for(;o>0&&s>0&&e.charCodeAt(o-1)==t.charCodeAt(s-1);)o--,s--;if(r==`end`){let e=Math.max(0,a-Math.min(o,s));n-=o+e-a}if(o<a&&e.length<t.length){let e=n<=a&&n>=o?a-n:0;a-=e,s=a+(s-o),o=a}else if(s<a){let e=n<=a&&n>=s?a-n:0;a-=e,o=a+(o-s),s=a}return{from:a,toA:o,toB:s}}function dM(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}=e.observer.selectionRange;return n&&(t.push(new iM(n,r)),(i!=n||a!=r)&&t.push(new iM(i,a))),t}function fM(e,t){if(e.length==0)return null;let n=e[0].pos,r=e.length==2?e[1].pos:n;return n>-1&&r>-1?W.single(n+t,r+t):null}function pM(e,t){return t.head==e.main.head&&t.anchor==e.main.anchor}var mM=class{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText=``,this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,K.safari&&e.contentDOM.addEventListener(`input`,()=>null),K.gecko&&ZM(e.contentDOM.ownerDocument)}handleEvent(e){!OM(this.view,e)||this.ignoreDuringComposition(e)||e.type==`keydown`&&this.keydown(e)||(this.view.updateState==0?this.runHandlers(e.type,e):Promise.resolve().then(()=>this.runHandlers(e.type,e)))}runHandlers(e,t){let n=this.handlers[e];if(n){for(let e of n.observers)e(this.view,t);for(let e of n.handlers){if(t.defaultPrevented)break;if(e(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=_M(e),n=this.handlers,r=this.view.contentDOM;for(let e in t)if(e!=`scroll`){let i=!t[e].handlers.length,a=n[e];a&&i!=!a.handlers.length&&(r.removeEventListener(e,this.handleEvent),a=null),a||r.addEventListener(e,this.handleEvent,{passive:i})}for(let e in n)e!=`scroll`&&!t[e]&&r.removeEventListener(e,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&bM.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),K.android&&K.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;if(K.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&(vM.some(t=>t.keyCode==e.keyCode)&&!e.ctrlKey||yM.indexOf(e.key)>-1&&e.ctrlKey)){let t={ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey,shiftKey:e.shiftKey};return t.shiftKey&&K.ios&&!/^(off|none)$/.test(this.view.contentDOM.autocapitalize)&&hM(this.view.win)&&(t.shiftKey=!1),this.pendingIOSKey={key:e.key,keyCode:e.keyCode,mods:t},setTimeout(()=>this.flushIOSKey(),250),!0}return e.keyCode!=229&&this.view.observer.forceFlush(),!1}flushIOSKey(e){let t=this.pendingIOSKey;return!t||t.key==`Enter`&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,Wk(this.view.contentDOM,t.key,t.keyCode,t.mods))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:K.safari&&!K.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}};function hM(e){return e.visualViewport?e.visualViewport.height*e.visualViewport.scale/e.document.documentElement.clientHeight<.85:!1}function gM(e,t){return(n,r)=>{try{return t.call(e,r,n)}catch(e){FA(n.state,e)}}}function _M(e){let t=Object.create(null);function n(e){return t[e]||(t[e]={observers:[],handlers:[]})}for(let t of e){let e=t.spec,r=e&&e.plugin.domEventHandlers,i=e&&e.plugin.domEventObservers;if(r)for(let e in r){let i=r[e];i&&n(e).handlers.push(gM(t.value,i))}if(i)for(let e in i){let r=i[e];r&&n(e).observers.push(gM(t.value,r))}}for(let e in kM)n(e).handlers.push(kM[e]);for(let e in AM)n(e).observers.push(AM[e]);return t}var vM=[{key:`Backspace`,keyCode:8,inputType:`deleteContentBackward`},{key:`Enter`,keyCode:13,inputType:`insertParagraph`},{key:`Enter`,keyCode:13,inputType:`insertLineBreak`},{key:`Delete`,keyCode:46,inputType:`deleteContentForward`}],yM=`dthko`,bM=[16,17,18,20,91,92,224,225],xM=6;function SM(e){return Math.max(0,e)*.7+8}function CM(e,t){return Math.max(Math.abs(e.clientX-t.clientX),Math.abs(e.clientY-t.clientY))}var wM=class{constructor(e,t,n,r){this.view=e,this.startEvent=t,this.style=n,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=Rk(e.contentDOM),this.atoms=e.state.facet(KA).map(t=>t(e));let i=e.contentDOM.ownerDocument;i.addEventListener(`mousemove`,this.move=this.move.bind(this)),i.addEventListener(`mouseup`,this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(gO.allowMultipleSelections)&&TM(e,t),this.dragging=DM(e,t)&&BM(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&CM(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,n=0,r=0,i=0,a=this.view.win.innerWidth,o=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:a}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:i,bottom:o}=this.scrollParents.y.getBoundingClientRect());let s=XA(this.view);e.clientX-s.left<=r+xM?t=-SM(r-e.clientX):e.clientX+s.right>=a-xM&&(t=SM(e.clientX-a)),e.clientY-s.top<=i+xM?n=-SM(i-e.clientY):e.clientY+s.bottom>=o-xM&&(n=SM(e.clientY-o)),this.setScrollSpeed(t,n)}up(e){this.dragging??this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener(`mousemove`,this.move),e.removeEventListener(`mouseup`,this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:t}=this,n=Yj(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!n.eq(t.state.selection,this.dragging===!1))&&this.view.dispatch({selection:n,userEvent:`select.pointer`}),this.mustSelect=!1}update(e){e.transactions.some(e=>e.isUserEvent(`input.type`))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}};function TM(e,t){let n=e.state.facet(bA);return n.length?n[0](t):K.mac?t.metaKey:t.ctrlKey}function EM(e,t){let n=e.state.facet(xA);return n.length?n[0](t):K.mac?!t.altKey:!t.ctrlKey}function DM(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let r=Tk(e.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let e=0;e<i.length;e++){let n=i[e];if(n.left<=t.clientX&&n.right>=t.clientX&&n.top<=t.clientY&&n.bottom>=t.clientY)return!0}return!1}function OM(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target,r;n!=e.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=tj.get(n))&&r.isWidget()&&!r.isHidden&&r.widget.ignoreEvent(t))return!1;return!0}var kM=Object.create(null),AM=Object.create(null),jM=K.ie&&K.ie_version<15||K.ios&&K.webkit_version<604;function MM(e){let t=e.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement(`textarea`));n.style.cssText=`position: fixed; left: -10000px; top: 10px`,n.focus(),setTimeout(()=>{e.focus(),n.remove(),PM(e,n.value)},50)}function NM(e,t,n){for(let r of e.facet(t))n=r(n,e);return n}function PM(e,t){t=NM(e.state,DA,t);let{state:n}=e,r,i=1,a=n.toText(t),o=a.lines==n.selection.ranges.length;if(KM!=null&&n.selection.ranges.every(e=>e.empty)&&KM==a.toString()){let e=-1;r=n.changeByRange(r=>{let s=n.doc.lineAt(r.from);if(s.from==e)return{range:r};e=s.from;let c=n.toText((o?a.line(i++).text:t)+n.lineBreak);return{changes:{from:s.from,insert:c},range:W.cursor(r.from+c.length)}})}else r=o?n.changeByRange(e=>{let t=a.line(i++);return{changes:{from:e.from,to:e.to,insert:t.text},range:W.cursor(e.from+t.length)}}):n.replaceSelection(a);e.dispatch(r,{userEvent:`input.paste`,scrollIntoView:!0})}AM.scroll=e=>{e.inputState.lastScrollTop=e.scrollDOM.scrollTop,e.inputState.lastScrollLeft=e.scrollDOM.scrollLeft},AM.wheel=AM.mousewheel=e=>{e.inputState.lastWheelEvent=Date.now()},kM.keydown=(e,t)=>(e.inputState.setSelectionOrigin(`select`),t.keyCode==27&&e.inputState.tabFocusMode!=0&&(e.inputState.tabFocusMode=Date.now()+2e3),!1),AM.touchstart=(e,t)=>{let n=e.inputState,r=t.targetTouches[0];n.lastTouchTime=Date.now(),r&&(n.lastTouchX=r.clientX,n.lastTouchY=r.clientY),n.setSelectionOrigin(`select.pointer`)},AM.touchmove=e=>{e.inputState.setSelectionOrigin(`select.pointer`)},kM.mousedown=(e,t)=>{if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of e.state.facet(SA))if(n=r(e,t),n)break;if(!n&&t.button==0&&(n=VM(e,t)),n){let r=!e.hasFocus;e.inputState.startMouseSelection(new wM(e,t,n,r)),r&&e.observer.ignore(()=>{Vk(e.contentDOM);let t=e.root.activeElement;t&&!t.contains(e.contentDOM)&&t.blur()});let i=e.inputState.mouseSelection;if(i)return i.start(t),i.dragging===!1}else e.inputState.setSelectionOrigin(`select.pointer`);return!1};function FM(e,t,n,r){if(r==1)return W.cursor(t,n);if(r==2)return Vj(e.state,t,n);{let r=e.docView.lineAt(t,n),i=e.state.doc.lineAt(r?r.posAtEnd:t),a=r?r.posAtStart:i.from,o=r?r.posAtEnd:i.to;return o<e.state.doc.length&&o==i.to&&o++,W.undirectionalRange(a,o)}}var IM=K.ie&&K.ie_version<=11,LM=null,RM=0,zM=0;function BM(e){if(!IM)return e.detail;let t=LM,n=zM;return LM=e,zM=Date.now(),RM=!t||n>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(RM+1)%3:1}function VM(e,t){let n=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),r=BM(t),i=e.state.selection;return{update(e){e.docChanged&&(n.pos=e.changes.mapPos(n.pos),i=i.map(e.changes))},get(t,a,o){let s=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),c,l=FM(e,s.pos,s.assoc,r);if(n.pos!=s.pos&&!a){let t=FM(e,n.pos,n.assoc,r),i=Math.min(t.from,l.from),a=Math.max(t.to,l.to);l=i<l.from?W.range(i,a,l.assoc):W.range(a,i,l.assoc)}return a?i.replaceRange(i.main.extend(l.from,l.to,l.assoc)):o&&r==1&&i.ranges.length>1&&(c=HM(i,s.pos))?c:o?i.addRange(l):W.create([l])}}}function HM(e,t){for(let n=0;n<e.ranges.length;n++){let{from:r,to:i}=e.ranges[n];if(r<=t&&i>=t)return W.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-+(e.mainIndex>n))}return null}kM.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let r=e.docView.tile.nearest(t.target);if(r&&r.isWidget()){let e=r.posAtStart,t=e+r.length;(e>=n.to||t<=n.from)&&(n=W.undirectionalRange(e,t))}}let{inputState:r}=e;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData(`Text`,NM(e.state,OA,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed=`copyMove`),!1},kM.dragend=e=>(e.inputState.draggedContent=null,!1);function UM(e,t,n,r){if(n=NM(e.state,DA,n),!n)return;let i=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:a}=e.inputState,o=r&&a&&EM(e,t)?{from:a.from,to:a.to}:null,s={from:i,insert:n},c=e.state.changes(o?[o,s]:s);e.focus(),e.dispatch({changes:c,selection:{anchor:c.mapPos(i,-1),head:c.mapPos(i,1)},userEvent:o?`move.drop`:`input.drop`}),e.inputState.draggedContent=null}kM.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let n=t.dataTransfer.files;if(n&&n.length){let r=Array(n.length),i=0,a=()=>{++i==n.length&&UM(e,t,r.filter(e=>e!=null).join(e.state.lineBreak),!1)};for(let e=0;e<n.length;e++){let t=new FileReader;t.onerror=a,t.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(t.result)||(r[e]=t.result),a()},t.readAsText(n[e])}return!0}else{let n=t.dataTransfer.getData(`Text`);if(n)return UM(e,t,n,!0),!0}return!1},kM.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=jM?null:t.clipboardData;return n?(PM(e,n.getData(`text/plain`)||n.getData(`text/uri-list`)),!0):(MM(e),!1)};function WM(e,t){let n=e.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement(`textarea`));r.style.cssText=`position: fixed; left: -10000px; top: 10px`,r.value=t,r.focus(),r.selectionEnd=t.length,r.selectionStart=0,setTimeout(()=>{r.remove(),e.focus()},50)}function GM(e){let t=[],n=[],r=!1;for(let r of e.selection.ranges)r.empty||(t.push(e.sliceDoc(r.from,r.to)),n.push(r));if(!t.length){let i=-1;for(let{from:r}of e.selection.ranges){let a=e.doc.lineAt(r);a.number>i&&(t.push(a.text),n.push({from:a.from,to:Math.min(e.doc.length,a.to+1)})),i=a.number}r=!0}return{text:NM(e,OA,t.join(e.lineBreak)),ranges:n,linewise:r}}var KM=null;kM.copy=kM.cut=(e,t)=>{if(!Dk(e.contentDOM,e.observer.selectionRange))return!1;let{text:n,ranges:r,linewise:i}=GM(e.state);if(!n&&!i)return!1;KM=i?n:null,t.type==`cut`&&!e.state.readOnly&&e.dispatch({changes:r,scrollIntoView:!0,userEvent:`delete.cut`});let a=jM?null:t.clipboardData;return a?(a.clearData(),a.setData(`text/plain`,n),!0):(WM(e,n),!1)};var qM=QD.define();function JM(e,t){let n=[];for(let r of e.facet(EA)){let i=r(e,t);i&&n.push(i)}return n.length?e.update({effects:n,annotations:qM.of(!0)}):null}function YM(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=JM(e.state,t);n?e.dispatch(n):e.update([])}},10)}AM.focus=e=>{e.inputState.lastFocusTime=Date.now(),!e.scrollDOM.scrollTop&&(e.inputState.lastScrollTop||e.inputState.lastScrollLeft)&&(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),YM(e)},AM.blur=e=>{e.observer.clearSelectionRange(),YM(e)},AM.compositionstart=AM.compositionupdate=e=>{e.observer.editContext||(e.inputState.compositionFirstChange??(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))},AM.compositionend=e=>{e.observer.editContext||(e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,K.chrome&&K.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50))},AM.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()},kM.beforeinput=(e,t)=>{if((t.inputType==`insertText`||t.inputType==`insertCompositionText`)&&(e.inputState.insertingText=t.data,e.inputState.insertingTextAt=Date.now()),t.inputType==`insertReplacementText`&&e.observer.editContext){let n=t.dataTransfer?.getData(`text/plain`),r=t.getTargetRanges();if(n&&r.length){let t=r[0];return cM(e,{from:e.posAtDOM(t.startContainer,t.startOffset),to:e.posAtDOM(t.endContainer,t.endOffset),insert:e.state.toText(n)},null),!0}}let n;if(K.chrome&&K.android&&(n=vM.find(e=>e.inputType==t.inputType))&&(e.observer.delayAndroidKey(n.key,n.keyCode),n.key==`Backspace`||n.key==`Delete`)){let t=window.visualViewport?.height||0;setTimeout(()=>{(window.visualViewport?.height||0)>t+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())},100)}return K.ios&&t.inputType==`deleteContentForward`&&e.observer.flushSoon(),K.safari&&t.inputType==`insertText`&&e.inputState.composing>=0&&setTimeout(()=>AM.compositionend(e,t),20),!1};var XM=new Set;function ZM(e){XM.has(e)||(XM.add(e),e.addEventListener(`copy`,()=>{}),e.addEventListener(`cut`,()=>{}))}var QM=[`pre-wrap`,`normal`,`pre-line`,`break-spaces`],$M=!1;function eN(){$M=!1}var tN=class{constructor(e){this.lineWrapping=e,this.doc=$E.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return QM.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];r<0?n++:this.heightSamples[Math.floor(r*10)]||(t=!0,this.heightSamples[Math.floor(r*10)]=!0)}return t}refresh(e,t,n,r,i,a){let o=QM.indexOf(e)>-1,s=Math.abs(t-this.lineHeight)>.3||this.lineWrapping!=o;if(this.lineWrapping=o,this.lineHeight=t,this.charWidth=n,this.textHeight=r,this.lineLength=i,s){this.heightSamples={};for(let e=0;e<a.length;e++){let t=a[e];t<0?e++:this.heightSamples[Math.floor(t*10)]=!0}}return s}},nN=class{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}},rN=class e{constructor(e,t,n,r,i){this.from=e,this.length=t,this.top=n,this.height=r,this._content=i}get type(){return typeof this._content==`number`?gk.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof bk?this._content.widget:null}get widgetLineBreaks(){return typeof this._content==`number`?this._content:0}join(t){let n=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(t._content)?t._content:[t]);return new e(this.from,this.length+t.length,this.top,this.height+t.height,n)}},iN=(function(e){return e[e.ByPos=0]=`ByPos`,e[e.ByHeight=1]=`ByHeight`,e[e.ByPosNoHeight=2]=`ByPosNoHeight`,e})(iN||={}),aN=.001,oN=class e{constructor(e,t,n=2){this.length=e,this.height=t,this.flags=n}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>aN&&($M=!0),this.height=e)}replace(t,n,r){return e.of(r)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,r){let i=this,a=n.doc;for(let o=r.length-1;o>=0;o--){let{fromA:s,toA:c,fromB:l,toB:u}=r[o],d=i.lineAt(s,iN.ByPosNoHeight,n.setDoc(t),0,0),f=d.to>=c?d:i.lineAt(c,iN.ByPosNoHeight,n,0,0);for(u+=f.to-c,c=f.to;o>0&&d.from<=r[o-1].toA;)s=r[o-1].fromA,l=r[o-1].fromB,o--,s<d.from&&(d=i.lineAt(s,iN.ByPosNoHeight,n,0,0));l+=d.from-s,s=d.from;let p=hN.build(n.setDoc(a),e,l,u);i=sN(i,i.replace(s,c,p))}return i.updateHeight(n,0)}static empty(){return new uN(0,0,0)}static of(t){if(t.length==1)return t[0];let n=0,r=t.length,i=0,a=0;for(;;)if(n==r)if(i>a*2){let e=t[n-1];e.break?t.splice(--n,1,e.left,null,e.right):t.splice(--n,1,e.left,e.right),r+=1+e.break,i-=e.size}else if(a>i*2){let e=t[r];e.break?t.splice(r,1,e.left,null,e.right):t.splice(r,1,e.left,e.right),r+=2+e.break,a-=e.size}else break;else if(i<a){let e=t[n++];e&&(i+=e.size)}else{let e=t[--r];e&&(a+=e.size)}let o=0;return t[n-1]==null?(o=1,n--):t[n]??(o=1,r++),new fN(e.of(t.slice(0,n)),o,e.of(t.slice(r)))}};function sN(e,t){return e==t?e:(e.constructor!=t.constructor&&($M=!0),t)}oN.prototype.size=1;var cN=_k.replace({}),lN=class extends oN{constructor(e,t,n){super(e,t),this.deco=n,this.spaceAbove=0}mainBlock(e,t){return new rN(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,t,n,r){return this.spaceAbove&&e<n+this.spaceAbove?new rN(r,0,n,this.spaceAbove,cN):this.mainBlock(n,r)}lineAt(e,t,n,r,i){let a=this.mainBlock(r,i);return this.spaceAbove?this.blockAt(0,n,r,i).join(a):a}forEachLine(e,t,n,r,i,a){e<=i+this.length&&t>=i&&a(this.lineAt(0,iN.ByPos,n,r,i))}setMeasuredHeight(e){let t=e.heights[e.index++];t<0?(this.spaceAbove=-t,t=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(t)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}},uN=class e extends lN{constructor(e,t,n){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=n}mainBlock(e,t){return new rN(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(t,n,r){let i=r[0];return r.length==1&&(i instanceof e||i instanceof dN&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof dN?i=new e(i.length,this.height,this.spaceAbove):i.height=this.height,this.outdated||(i.outdated=!1),i):oN.of(r)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more?this.setMeasuredHeight(r):(n||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:``}${this.widgetHeight?`:`+this.widgetHeight:``})`}},dN=class e extends oN{constructor(e){super(e,0)}heightMetrics(e,t){let n=e.doc.lineAt(t).number,r=e.doc.lineAt(t+this.length).number,i=r-n+1,a,o=0;if(e.lineWrapping){let t=Math.min(this.height,e.lineHeight*i);a=t/i,this.length>i+1&&(o=(this.height-t)/(this.length-i-1))}else a=this.height/i;return{firstLine:n,lastLine:r,perLine:a,perChar:o}}blockAt(e,t,n,r){let{firstLine:i,lastLine:a,perLine:o,perChar:s}=this.heightMetrics(t,r);if(t.lineWrapping){let i=r+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-n)/this.height))*this.length)),a=t.doc.lineAt(i),c=o+a.length*s,l=Math.max(n,e-c/2);return new rN(a.from,a.length,l,c,0)}else{let r=Math.max(0,Math.min(a-i,Math.floor((e-n)/o))),{from:s,length:c}=t.doc.line(i+r);return new rN(s,c,n+o*r,o,0)}}lineAt(e,t,n,r,i){if(t==iN.ByHeight)return this.blockAt(e,n,r,i);if(t==iN.ByPosNoHeight){let{from:t,to:r}=n.doc.lineAt(e);return new rN(t,r-t,0,0,0)}let{firstLine:a,perLine:o,perChar:s}=this.heightMetrics(n,i),c=n.doc.lineAt(e),l=o+c.length*s,u=c.number-a,d=r+o*u+s*(c.from-i-u);return new rN(c.from,c.length,Math.max(r,Math.min(d,r+this.height-l)),l,0)}forEachLine(e,t,n,r,i,a){e=Math.max(e,i),t=Math.min(t,i+this.length);let{firstLine:o,perLine:s,perChar:c}=this.heightMetrics(n,i);for(let l=e,u=r;l<=t;){let t=n.doc.lineAt(l);if(l==e){let n=t.number-o;u+=s*n+c*(e-i-n)}let r=s+c*t.length;a(new rN(t.from,t.length,u,r,0)),u+=r,l=t.to+1}}replace(t,n,r){let i=this.length-n;if(i>0){let t=r[r.length-1];t instanceof e?r[r.length-1]=new e(t.length+i):r.push(null,new e(i-1))}if(t>0){let n=r[0];n instanceof e?r[0]=new e(t+n.length):r.unshift(new e(t-1),null)}return oN.of(r)}decomposeLeft(t,n){n.push(new e(t-1),null)}decomposeRight(t,n){n.push(null,new e(this.length-t-1))}updateHeight(t,n=0,r=!1,i){let a=n+this.length;if(i&&i.from<=n+this.length&&i.more){let r=[],o=Math.max(n,i.from),s=-1;for(i.from>n&&r.push(new e(i.from-n-1).updateHeight(t,n));o<=a&&i.more;){let e=t.doc.lineAt(o).length;r.length&&r.push(null);let n=i.heights[i.index++],a=0;n<0&&(a=-n,n=i.heights[i.index++]),s==-1?s=n:Math.abs(n-s)>=aN&&(s=-2);let c=new uN(e,n,a);c.outdated=!1,r.push(c),o+=e+1}o<=a&&r.push(null,new e(a-o).updateHeight(t,o));let c=oN.of(r);return(s<0||Math.abs(c.height-this.height)>=aN||Math.abs(s-this.heightMetrics(t,n).perLine)>=aN)&&($M=!0),sN(this,c)}else(r||this.outdated)&&(this.setHeight(t.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}},fN=class extends oN{constructor(e,t,n){super(e.length+t+n.length,e.height+n.height,t|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return this.flags&1}blockAt(e,t,n,r){let i=n+this.left.height;return e<i?this.left.blockAt(e,t,n,r):this.right.blockAt(e,t,i,r+this.left.length+this.break)}lineAt(e,t,n,r,i){let a=r+this.left.height,o=i+this.left.length+this.break,s=t==iN.ByHeight?e<a:e<o,c=s?this.left.lineAt(e,t,n,r,i):this.right.lineAt(e,t,n,a,o);if(this.break||(s?c.to<o:c.from>o))return c;let l=t==iN.ByPosNoHeight?iN.ByPosNoHeight:iN.ByPos;return s?c.join(this.right.lineAt(o,l,n,a,o)):this.left.lineAt(o,l,n,r,i).join(c)}forEachLine(e,t,n,r,i,a){let o=r+this.left.height,s=i+this.left.length+this.break;if(this.break)e<s&&this.left.forEachLine(e,t,n,r,i,a),t>=s&&this.right.forEachLine(e,t,n,o,s,a);else{let c=this.lineAt(s,iN.ByPos,n,r,i);e<c.from&&this.left.forEachLine(e,c.from-1,n,r,i,a),c.to>=e&&c.from<=t&&a(c),t>c.to&&this.right.forEachLine(c.to+1,t,n,o,s,a)}}replace(e,t,n){let r=this.left.length+this.break;if(t<r)return this.balanced(this.left.replace(e,t,n),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-r,t-r,n));let i=[];e>0&&this.decomposeLeft(e,i);let a=i.length;for(let e of n)i.push(e);if(e>0&&pN(i,a-1),t<this.length){let e=i.length;this.decomposeRight(t,i),pN(i,e)}return oN.of(i)}decomposeLeft(e,t){let n=this.left.length;if(e<=n)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(n++,e>=n&&t.push(null)),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,r=n+this.break;if(e>=r)return this.right.decomposeRight(e-r,t);e<n&&this.left.decomposeRight(e,t),this.break&&e<r&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?oN.of(this.break?[e,null,t]:[e,t]):(this.left=sN(this.left,e),this.right=sN(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,n=!1,r){let{left:i,right:a}=this,o=t+i.length+this.break,s=null;return r&&r.from<=t+i.length&&r.more?s=i=i.updateHeight(e,t,n,r):i.updateHeight(e,t,n),r&&r.from<=o+a.length&&r.more?s=a=a.updateHeight(e,o,n,r):a.updateHeight(e,o,n),s?this.balanced(i,a):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?` `:`-`)+this.right}};function pN(e,t){let n,r;e[t]==null&&(n=e[t-1])instanceof dN&&(r=e[t+1])instanceof dN&&e.splice(t-1,3,new dN(n.length+1+r.length))}var mN=5,hN=class e{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let e=Math.min(t,this.lineEnd),n=this.nodes[this.nodes.length-1];n instanceof uN?n.length+=e-this.pos:(e>this.pos||!this.isCovered)&&this.nodes.push(new uN(e-this.pos,-1,0)),this.writtenTo=e,t>e&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,n){if(e<t||n.heightRelevant){let r=n.widget?n.widget.estimatedHeight:0,i=n.widget?n.widget.lineBreaks:0;r<0&&(r=this.oracle.lineHeight);let a=t-e;n.block?this.addBlock(new lN(a,r,n)):(a||i||r>=mN)&&this.addLineDeco(r,i,a)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new uN(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,t){let n=new dN(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof uN)return e;let t=new uN(0,-1,0);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos+=e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,n){let r=this.ensureLine();r.length+=n,r.collapsed+=n,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=t,this.writtenTo=this.pos+=n}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof uN)&&!this.isCovered?this.nodes.push(new uN(0,-1,0)):(this.writtenTo<this.pos||t==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let n=e;for(let e of this.nodes)e instanceof uN&&e.updateHeight(this.oracle,n),n+=e?e.length:1;return this.nodes}static build(t,n,r,i){let a=new e(r,t);return CO.spans(n,r,i,a,0),a.finish(r)}};function gN(e,t,n){let r=new _N;return CO.compare(e,t,n,r,0),r.changes}var _N=class{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,n,r){(e<t||n&&n.heightRelevant||r&&r.heightRelevant)&&Ck(e,t,this.changes,5)}};function vN(e,t){let n=e.getBoundingClientRect(),r=e.ownerDocument,i=r.defaultView||window,a=Math.max(0,n.left),o=Math.min(i.innerWidth,n.right),s=Math.max(0,n.top),c=Math.min(i.innerHeight,n.bottom);for(let t=e.parentNode;t&&t!=r.body;)if(t.nodeType==1){let n=t,r=window.getComputedStyle(n);if((n.scrollHeight>n.clientHeight||n.scrollWidth>n.clientWidth)&&r.overflow!=`visible`){let r=n.getBoundingClientRect();a=Math.max(a,r.left),o=Math.min(o,r.right),s=Math.max(s,r.top),c=Math.min(t==e.parentNode?i.innerHeight:c,r.bottom)}t=r.position==`absolute`||r.position==`fixed`?n.offsetParent:n.parentNode}else if(t.nodeType==11)t=t.host;else break;return{left:a-n.left,right:Math.max(a,o)-n.left,top:s-(n.top+t),bottom:Math.max(s,c)-(n.top+t)}}function yN(e){let t=e.getBoundingClientRect(),n=e.ownerDocument.defaultView||window;return t.left<n.innerWidth&&t.right>0&&t.top<n.innerHeight&&t.bottom>0}function bN(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}var xN=class{constructor(e,t,n,r){this.from=e,this.to=t,this.size=n,this.displaySize=r}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.from!=i.from||r.to!=i.to||r.size!=i.size)return!1}return!0}draw(e,t){return _k.replace({widget:new SN(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}},SN=class extends hk{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement(`div`);return this.vertical?e.style.height=this.size+`px`:(e.style.width=this.size+`px`,e.style.height=`2px`,e.style.display=`inline-block`),e}get estimatedHeight(){return this.vertical?this.size:-1}},CN=class{constructor(e,t){this.view=e,this.state=t,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=kN,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=Zk.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let n=t.facet(HA).some(e=>typeof e!=`function`&&e.class==`cm-lineWrapping`);this.heightOracle=new tN(n),this.stateDeco=AN(t),this.heightMap=oN.empty().applyChanges(this.stateDeco,$E.empty,this.heightOracle.setDoc(t.doc),[new QA(0,0,0,t.doc.length)]);for(let e=0;e<2&&(this.viewport=this.getViewport(0,null),this.updateForViewport());e++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=_k.set(this.lineGaps.map(e=>e.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let n=0;n<=1;n++){let r=n?t.head:t.anchor;if(!e.some(({from:e,to:t})=>r>=e&&r<=t)){let{from:t,to:n}=this.lineBlockAt(r);e.push(new wN(t,n))}}return this.viewports=e.sort((e,t)=>e.from-t.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?kN:new jN(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(MN(e,this.scaler))})}update(e,t=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=AN(this.state);let r=e.changedRanges,i=QA.extendWithRanges(r,gN(n,this.stateDeco,e?e.changes:vD.empty(this.state.doc.length))),a=this.heightMap.height,o=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);eN(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),i),(this.heightMap.height!=a||$M)&&(e.flags|=2),o?(this.scrollAnchorPos=e.changes.mapPos(o.from,-1),this.scrollAnchorHeight=o.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=a);let s=i.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<s.from||t.range.head>s.to)||!this.viewportIsAppropriate(s))&&(s=this.getViewport(0,t));let c=s.from!=this.viewport.from||s.to!=this.viewport.to;this.viewport=s,e.flags|=this.updateForViewport(),(c||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(AA)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,t=e.contentDOM,n=window.getComputedStyle(t),r=this.heightOracle,i=n.whiteSpace;this.defaultTextDirection=n.direction==`rtl`?Zk.RTL:Zk.LTR;let a=this.heightOracle.mustRefreshForWrapping(i)||this.mustMeasureContent===`refresh`,o=t.getBoundingClientRect(),s=a||this.mustMeasureContent||this.contentDOMHeight!=o.height;this.contentDOMHeight=o.height,this.mustMeasureContent=!1;let c=0,l=0;if(o.width&&o.height){let{scaleX:e,scaleY:n}=Ik(t,o);(e>.005&&Math.abs(this.scaleX-e)>.005||n>.005&&Math.abs(this.scaleY-n)>.005)&&(this.scaleX=e,this.scaleY=n,c|=16,a=s=!0)}let u=(parseInt(n.paddingTop)||0)*this.scaleY,d=(parseInt(n.paddingBottom)||0)*this.scaleY;(this.paddingTop!=u||this.paddingBottom!=d)&&(this.paddingTop=u,this.paddingBottom=d,c|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(s=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=16);let f=Rk(this.view.contentDOM,!1).y;f!=this.scrollParent&&(this.scrollParent=f,this.scrollAnchorHeight=-1,this.scrollOffset=0);let p=this.getScrollOffset();this.scrollOffset!=p&&(this.scrollAnchorHeight=-1,this.scrollOffset=p),this.scrolledToBottom=qk(this.scrollParent||e.win);let m=(this.printing?bN:vN)(t,this.paddingTop),h=m.top-this.pixelViewport.top,g=m.bottom-this.pixelViewport.bottom;this.pixelViewport=m;let _=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(_!=this.inView&&(this.inView=_,_&&(s=!0)),!this.inView&&!this.scrollTarget&&!yN(e.dom))return 0;let v=o.width;if((this.contentDOMWidth!=v||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=o.width,this.editorHeight=e.scrollDOM.clientHeight,c|=16),s){let t=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(t)&&(a=!0),a||r.lineWrapping&&Math.abs(v-this.contentDOMWidth)>r.charWidth){let{lineHeight:n,charWidth:o,textHeight:s}=e.docView.measureTextSize();a=n>0&&r.refresh(i,n,o,s,Math.max(5,v/o),t),a&&(e.docView.minWidth=0,c|=16)}h>0&&g>0?l=Math.max(h,g):h<0&&g<0&&(l=Math.min(h,g)),eN();for(let n of this.viewports){let i=n.from==this.viewport.from?t:e.docView.measureVisibleLineHeights(n);this.heightMap=(a?oN.empty().applyChanges(this.stateDeco,$E.empty,this.heightOracle,[new QA(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,a,new nN(n.from,i))}$M&&(c|=2)}let y=!this.viewportIsAppropriate(this.viewport,l)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return y&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(l,this.scrollTarget),c|=this.updateForViewport()),(c&2||y)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(a?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,i=this.heightOracle,{visibleTop:a,visibleBottom:o}=this,s=new wN(r.lineAt(a-n*1e3,iN.ByHeight,i,0,0).from,r.lineAt(o+(1-n)*1e3,iN.ByHeight,i,0,0).to);if(t){let{head:e}=t.range;if(e<s.from||e>s.to){let n=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),a=r.lineAt(e,iN.ByPos,i,0,0),o;o=t.y==`center`?(a.top+a.bottom)/2-n/2:t.y==`start`||t.y==`nearest`&&e<s.from?a.top:a.bottom-n,s=new wN(r.lineAt(o-1e3/2,iN.ByHeight,i,0,0).from,r.lineAt(o+n+1e3/2,iN.ByHeight,i,0,0).to)}}return s}mapViewport(e,t){let n=t.mapPos(e.from,-1),r=t.mapPos(e.to,1);return new wN(this.heightMap.lineAt(n,iN.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(r,iN.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},n=0){if(!this.inView)return!0;let{top:r}=this.heightMap.lineAt(e,iN.ByPos,this.heightOracle,0,0),{bottom:i}=this.heightMap.lineAt(t,iN.ByPos,this.heightOracle,0,0),{visibleTop:a,visibleBottom:o}=this;return(e==0||r<=a-Math.max(10,Math.min(-n,250)))&&(t==this.state.doc.length||i>=o+Math.max(10,Math.min(n,250)))&&r>a-2*1e3&&i<o+2*1e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let n=[];for(let r of e)t.touchesRange(r.from,r.to)||n.push(new xN(t.mapPos(r.from),t.mapPos(r.to),r.size,r.displaySize));return n}ensureLineGaps(e,t){let n=this.heightOracle.lineWrapping,r=n?1e4:2e3,i=r>>1,a=r<<1;if(this.defaultTextDirection!=Zk.LTR&&!n)return[];let o=[],s=(r,a,c,l)=>{if(a-r<i)return;let u=this.state.selection.main,d=[u.from];u.empty||d.push(u.to);for(let e of d)if(e>r&&e<a){s(r,e-10,c,l),s(e+10,a,c,l);return}let f=ON(e,e=>e.from>=c.from&&e.to<=c.to&&Math.abs(e.from-r)<i&&Math.abs(e.to-a)<i&&!d.some(t=>e.from<t&&e.to>t));if(!f){if(a<c.to&&t&&n&&t.visibleRanges.some(e=>e.from<=a&&e.to>=a)){let e=t.moveToLineBoundary(W.cursor(a),!1,!0).head;e>r&&(a=e)}let e=this.gapSize(c,r,a,l);f=new xN(r,a,e,n||e<2e6?e:2e6)}o.push(f)},c=t=>{if(t.length<a||t.type!=gk.Text)return;let i=TN(t.from,t.to,this.stateDeco);if(i.total<a)return;let o=this.scrollTarget?this.scrollTarget.range.head:null,c,l;if(n){let e=r/this.heightOracle.lineLength*this.heightOracle.lineHeight,n,a;if(o!=null){let r=DN(i,o),s=((this.visibleBottom-this.visibleTop)/2+e)/t.height;n=r-s,a=r+s}else n=(this.visibleTop-t.top-e)/t.height,a=(this.visibleBottom-t.top+e)/t.height;c=EN(i,n),l=EN(i,a)}else{let n=i.total*this.heightOracle.charWidth,a=r*this.heightOracle.charWidth,s=0;if(n>2e6)for(let n of e)n.from>=t.from&&n.from<t.to&&n.size!=n.displaySize&&n.from*this.heightOracle.charWidth+s<this.pixelViewport.left&&(s=n.size-n.displaySize);let u=this.pixelViewport.left+s,d=this.pixelViewport.right+s,f,p;if(o!=null){let e=DN(i,o),t=((d-u)/2+a)/n;f=e-t,p=e+t}else f=(u-a)/n,p=(d+a)/n;c=EN(i,f),l=EN(i,p)}c>t.from&&s(t.from,c,t,i),l<t.to&&s(l,t.to,t,i)};for(let e of this.viewportLines)Array.isArray(e.type)?e.type.forEach(c):c(e);return o}gapSize(e,t,n,r){let i=DN(r,n)-DN(r,t);return this.heightOracle.lineWrapping?e.height*i:r.total*this.heightOracle.charWidth*i}updateLineGaps(e){xN.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=_k.set(e.map(e=>e.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let n=[];CO.spans(t,this.viewport.from,this.viewport.to,{span(e,t){n.push({from:e,to:t})},point(){}},20);let r=0;if(n.length!=this.visibleRanges.length)r=12;else for(let t=0;t<n.length&&!(r&8);t++){let i=this.visibleRanges[t],a=n[t];(i.from!=a.from||i.to!=a.to)&&(r|=4,e&&e.mapPos(i.from,-1)==a.from&&e.mapPos(i.to,1)==a.to||(r|=8))}return this.visibleRanges=n,r}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||MN(this.heightMap.lineAt(e,iN.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||MN(this.heightMap.lineAt(this.scaler.fromDOM(e),iN.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return MN(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}},wN=class{constructor(e,t){this.from=e,this.to=t}};function TN(e,t,n){let r=[],i=e,a=0;return CO.spans(n,e,t,{span(){},point(e,t){e>i&&(r.push({from:i,to:e}),a+=e-i),i=t}},20),i<t&&(r.push({from:i,to:t}),a+=t-i),{total:a,ranges:r}}function EN({total:e,ranges:t},n){if(n<=0)return t[0].from;if(n>=1)return t[t.length-1].to;let r=Math.floor(e*n);for(let e=0;;e++){let{from:n,to:i}=t[e],a=i-n;if(r<=a)return n+r;r-=a}}function DN(e,t){let n=0;for(let{from:r,to:i}of e.ranges){if(t<=i){n+=t-r;break}n+=i-r}return n/e.total}function ON(e,t){for(let n of e)if(t(n))return n}var kN={toDOM(e){return e},fromDOM(e){return e},scale:1,eq(e){return e==this}};function AN(e){let t=e.facet(UA).filter(e=>typeof e!=`function`),n=e.facet(GA).filter(e=>typeof e!=`function`);return n.length&&t.push(CO.join(n)),t}var jN=class e{constructor(e,t,n){let r=0,i=0,a=0;this.viewports=n.map(({from:n,to:i})=>{let a=t.lineAt(n,iN.ByPos,e,0,0).top,o=t.lineAt(i,iN.ByPos,e,0,0).bottom;return r+=o-a,{from:n,to:i,top:a,bottom:o,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(t.height-r);for(let e of this.viewports)e.domTop=a+(e.top-i)*this.scale,a=e.domBottom=e.domTop+(e.bottom-e.top),i=e.bottom}toDOM(e){for(let t=0,n=0,r=0;;t++){let i=t<this.viewports.length?this.viewports[t]:null;if(!i||e<i.top)return r+(e-n)*this.scale;if(e<=i.bottom)return i.domTop+(e-i.top);n=i.bottom,r=i.domBottom}}fromDOM(e){for(let t=0,n=0,r=0;;t++){let i=t<this.viewports.length?this.viewports[t]:null;if(!i||e<i.domTop)return n+(e-r)/this.scale;if(e<=i.domBottom)return i.top+(e-i.domTop);n=i.bottom,r=i.domBottom}}eq(t){return t instanceof e?this.scale==t.scale&&this.viewports.length==t.viewports.length&&this.viewports.every((e,n)=>e.from==t.viewports[n].from&&e.to==t.viewports[n].to):!1}};function MN(e,t){if(t.scale==1)return e;let n=t.toDOM(e.top),r=t.toDOM(e.bottom);return new rN(e.from,e.length,n,r-n,Array.isArray(e._content)?e._content.map(e=>MN(e,t)):e._content)}var NN=G.define({combine:e=>e.join(` `)}),PN=G.define({combine:e=>e.indexOf(!0)>-1}),FN=HO.newName(),IN=HO.newName(),LN=HO.newName(),RN={"&light":`.`+IN,"&dark":`.`+LN};function zN(e,t,n){return new HO(t,{finish(t){return/&/.test(t)?t.replace(/&\w*/,t=>{if(t==`&`)return e;if(!n||!n[t])throw RangeError(`Unsupported selector: ${t}`);return n[t]}):e+` `+t}})}var BN=zN(`.`+FN,{"&":{position:`relative !important`,boxSizing:`border-box`,"&.cm-focused":{outline:`1px dotted #212121`},display:`flex !important`,flexDirection:`column`},".cm-scroller":{display:`flex !important`,alignItems:`flex-start !important`,fontFamily:`monospace`,lineHeight:1.4,height:`100%`,overflowX:`auto`,position:`relative`,zIndex:0,overflowAnchor:`none`},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:`block`,whiteSpace:`pre`,wordWrap:`normal`,boxSizing:`border-box`,minHeight:`100%`,padding:`4px 0`,outline:`none`,"&[contenteditable=true]":{WebkitUserModify:`read-write-plaintext-only`}},".cm-lineWrapping":{whiteSpace_fallback:`pre-wrap`,whiteSpace:`break-spaces`,wordBreak:`break-word`,overflowWrap:`anywhere`,flexShrink:1},"&light .cm-content":{caretColor:`black`},"&dark .cm-content":{caretColor:`white`},".cm-line":{display:`block`,padding:`0 2px 0 6px`},".cm-layer":{userSelect:`none`,position:`absolute`,left:0,top:0,contain:`size style`,"& > *":{position:`absolute`}},"&light .cm-selectionBackground":{background:`#d9d9d9`},"&dark .cm-selectionBackground":{background:`#222`},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:`#d7d4f0`},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:`#233`},".cm-cursorLayer":{pointerEvents:`none`},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:`steps(1) cm-blink 1.2s infinite`},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:`1.2px solid black`,marginLeft:`-0.6px`,pointerEvents:`none`},".cm-cursor":{display:`none`},"&dark .cm-cursor":{borderLeftColor:`#ddd`},".cm-selectionHandle":{backgroundColor:`currentColor`,width:`1.5px`},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:`""`,backgroundColor:`inherit`,borderRadius:`50%`,width:`8px`,height:`8px`,position:`absolute`,left:`-3.25px`},".cm-selectionHandle-start::before":{top:`-8px`},".cm-selectionHandle-end::before":{bottom:`-8px`},".cm-dropCursor":{position:`absolute`},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:`block`},".cm-iso":{unicodeBidi:`isolate`},".cm-announced":{position:`fixed`,top:`-10000px`},"@media print":{".cm-announced":{display:`none`}},"&light .cm-activeLine":{backgroundColor:`#cceeff44`},"&dark .cm-activeLine":{backgroundColor:`#99eeff33`},"&light .cm-specialChar":{color:`red`},"&dark .cm-specialChar":{color:`#f78`},".cm-gutters":{flexShrink:0,display:`flex`,height:`100%`,boxSizing:`border-box`,zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:`#f5f5f5`,color:`#6c6c6c`,border:`0px solid #ddd`,"&.cm-gutters-before":{borderRightWidth:`1px`},"&.cm-gutters-after":{borderLeftWidth:`1px`}},"&dark .cm-gutters":{backgroundColor:`#333338`,color:`#ccc`},".cm-gutter":{display:`flex !important`,flexDirection:`column`,flexShrink:0,boxSizing:`border-box`,minHeight:`100%`,overflow:`hidden`},".cm-gutterElement":{boxSizing:`border-box`},".cm-lineNumbers .cm-gutterElement":{padding:`0 3px 0 5px`,minWidth:`20px`,textAlign:`right`,whiteSpace:`nowrap`},"&light .cm-activeLineGutter":{backgroundColor:`#e2f2ff`},"&dark .cm-activeLineGutter":{backgroundColor:`#222227`},".cm-panels":{boxSizing:`border-box`,position:`sticky`,left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:`#f5f5f5`,color:`black`},"&light .cm-panels-top":{borderBottom:`1px solid #ddd`},"&light .cm-panels-bottom":{borderTop:`1px solid #ddd`},"&dark .cm-panels":{backgroundColor:`#333338`,color:`white`},".cm-dialog":{padding:`2px 19px 4px 6px`,position:`relative`,"& label":{fontSize:`80%`}},".cm-dialog-close":{position:`absolute`,top:`3px`,right:`4px`,backgroundColor:`inherit`,border:`none`,font:`inherit`,fontSize:`14px`,padding:`0`},".cm-tab":{display:`inline-block`,overflow:`hidden`,verticalAlign:`bottom`},".cm-widgetBuffer":{verticalAlign:`text-top`,height:`1em`,width:0,display:`inline`},".cm-placeholder":{color:`#888`,display:`inline-block`,verticalAlign:`top`,userSelect:`none`},".cm-highlightSpace":{backgroundImage:`radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)`,backgroundPosition:`center`},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:`auto 100%`,backgroundPosition:`right 90%`,backgroundRepeat:`no-repeat`},".cm-trailingSpace":{backgroundColor:`#ff332255`},".cm-button":{verticalAlign:`middle`,color:`inherit`,fontSize:`70%`,padding:`.2em 1em`,borderRadius:`1px`},"&light .cm-button":{backgroundImage:`linear-gradient(#eff1f5, #d9d9df)`,border:`1px solid #888`,"&:active":{backgroundImage:`linear-gradient(#b4b4b4, #d0d3d6)`}},"&dark .cm-button":{backgroundImage:`linear-gradient(#393939, #111)`,border:`1px solid #888`,"&:active":{backgroundImage:`linear-gradient(#111, #333)`}},".cm-textfield":{verticalAlign:`middle`,color:`inherit`,fontSize:`70%`,border:`1px solid silver`,padding:`.2em .5em`},"&light .cm-textfield":{backgroundColor:`white`},"&dark .cm-textfield":{border:`1px solid #555`,backgroundColor:`inherit`}},RN),VN={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},HN=K.ie&&K.ie_version<=11,UN=class{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new zk,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let e of t)this.queue.push(e);(K.ie&&K.ie_version<=11||K.ios&&e.composing)&&t.some(e=>e.type==`childList`&&e.removedNodes.length||e.type==`characterData`&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&K.android&&e.constructor.EDIT_CONTEXT!==!1&&!(K.chrome&&K.chrome_version<126)&&(this.editContext=new qN(e),e.state.facet(IA)&&(e.contentDOM.editContext=this.editContext.editContext)),HN&&(this.onCharData=e=>{this.queue.push({target:e.target,type:`characterData`,oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia(`print`)),typeof ResizeObserver==`function`&&(this.resizeScroll=new ResizeObserver(()=>{this.view.docView?.lastUpdate<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver==`function`&&(this.intersection=new IntersectionObserver(e=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),e.length>0&&e[e.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent(`Event`)))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(e=>{e.length>0&&e[e.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent(`Event`))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers(`scroll`,e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type==`change`||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,n)=>t!=e[n]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:n}=this,r=this.selectionRange;if(n.state.facet(IA)?n.root.activeElement!=this.dom:!Dk(this.dom,r))return;let i=r.anchorNode&&n.docView.tile.nearest(r.anchorNode);if(i&&i.isWidget()&&i.widget.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(K.ie&&K.ie_version<=11||K.android&&K.chrome)&&!n.state.selection.main.empty&&r.focusNode&&kk(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=Tk(e.root);if(!t)return!1;let n=K.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&KN(this.view,t)||t;if(!n||this.selectionRange.eq(n))return!1;let r=Dk(this.dom,n);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&Kk(this.dom,n)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(n),r&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let n=this.dom;n;)if(n.nodeType==1)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==n?e++:t||=this.scrollTargets.slice(0,e),t&&t.push(n),n=n.assignedSlot||n.parentNode;else if(n.nodeType==11)n=n.host;else break;if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let e of this.scrollTargets)e.removeEventListener(`scroll`,this.onScroll);for(let e of this.scrollTargets=t)e.addEventListener(`scroll`,this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||=(this.observer.observe(this.dom,VN),HN&&this.dom.addEventListener(`DOMCharacterDataModified`,this.onCharData),!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),HN&&this.dom.removeEventListener(`DOMCharacterDataModified`,this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){if(!this.delayedAndroidKey){let e=()=>{let e=this.delayedAndroidKey;e&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=e.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&e.force&&Wk(this.dom,e.key,e.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(e)}(!this.delayedAndroidKey||e==`Enter`)&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!this.delayedAndroidKey?.force})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,n=-1,r=!1;for(let i of e){let e=this.readMutation(i);e&&(e.typeOver&&(r=!0),t==-1?{from:t,to:n}=e:(t=Math.min(e.from,t),n=Math.max(e.to,n)))}return{from:t,to:n,typeOver:r}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),r=this.selectionChanged&&Dk(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let i=new aM(this.view,e,t,n);return this.view.docView.domChanged={newSel:i.newSel?i.newSel.main:null},i}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let n=this.view.state,r=sM(this.view,t);return this.view.state==n&&(t.domChanged||t.newSel&&!pM(this.view.state.selection,t.newSel.main))&&this.view.update([]),r}readMutation(e){let t=this.view.docView.tile.nearest(e.target);if(!t||t.isWidget())return null;if(t.markDirty(e.type==`attributes`),e.type==`childList`){let n=WN(t,e.previousSibling||e.target.previousSibling,-1),r=WN(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:r?t.posBefore(r):t.posAtEnd,typeOver:!1}}else if(e.type==`characterData`)return{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue};else return null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener(`resize`,this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener(`change`,this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener(`beforeprint`,this.onPrint),e.addEventListener(`scroll`,this.onScroll),e.document.addEventListener(`selectionchange`,this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener(`scroll`,this.onScroll),e.removeEventListener(`resize`,this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener(`change`,this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener(`beforeprint`,this.onPrint),e.document.removeEventListener(`selectionchange`,this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(IA)!=e.state.facet(IA)&&(e.view.contentDOM.editContext=e.state.facet(IA)?this.editContext.editContext:null))}destroy(){var e,t,n;this.stop(),(e=this.intersection)==null||e.disconnect(),(t=this.gapIntersection)==null||t.disconnect(),(n=this.resizeScroll)==null||n.disconnect();for(let e of this.scrollTargets)e.removeEventListener(`scroll`,this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}};function WN(e,t,n){for(;t;){let r=tj.get(t);if(r&&r.parent==e)return r;let i=t.parentNode;t=i==e.dom?n>0?t.nextSibling:t.previousSibling:i}return null}function GN(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,a=t.endOffset,o=e.docView.domAtPos(e.state.selection.main.anchor,1);return kk(o.node,o.offset,i,a)&&([n,r,i,a]=[i,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}}function KN(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return GN(e,n)}let n=null;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.contentDOM.addEventListener(`beforeinput`,r,!0),e.dom.ownerDocument.execCommand(`indent`),e.contentDOM.removeEventListener(`beforeinput`,r,!0),n?GN(e,n):null}var qN=class{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=n=>{let r=e.state.selection.main,{anchor:i,head:a}=r,o=this.toEditorPos(n.updateRangeStart),s=this.toEditorPos(n.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:n.updateRangeStart,editorBase:o,drifted:!1});let c=s-o>n.text.length;o==this.from&&i<this.from?o=i:s==this.to&&i>this.to&&(s=i);let l=uM(e.state.sliceDoc(o,s),n.text,(c?r.from:r.to)-o,c?`end`:null);if(!l){let t=W.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd));pM(t,r)||e.dispatch({selection:t,userEvent:`select`});return}let u={from:l.from+o,to:l.toA+o,insert:$E.of(n.text.slice(l.from,l.toB).split(`
|
|
48
|
+
`))};if((K.mac||K.android)&&u.from==a-1&&/^\. ?$/.test(n.text)&&e.contentDOM.getAttribute(`autocorrect`)==`off`&&(u={from:o,to:s,insert:$E.of([n.text.replace(`.`,` `)])}),this.pendingContextChange=u,!e.state.readOnly){let t=this.to-this.from+(u.to-u.from+u.insert.length);cM(e,u,W.single(this.toEditorPos(n.selectionStart,t),this.toEditorPos(n.selectionEnd,t)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),u.from<u.to&&!u.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,n.updateRangeStart-1),Math.min(t.text.length,n.updateRangeStart+1)))&&this.handlers.compositionend(n)},this.handlers.characterboundsupdate=n=>{let r=[],i=null;for(let t=this.toEditorPos(n.rangeStart),a=this.toEditorPos(n.rangeEnd);t<a;t++){let n=e.coordsForChar(t);i=n&&new DOMRect(n.left,n.top,n.right-n.left,n.bottom-n.top)||i||new DOMRect,r.push(i)}t.updateCharacterBounds(n.rangeStart,r)},this.handlers.textformatupdate=t=>{let n=[];for(let e of t.getTextFormats()){let t=e.underlineStyle,r=e.underlineThickness;if(!/none/i.test(t)&&!/none/i.test(r)){let i=this.toEditorPos(e.rangeStart),a=this.toEditorPos(e.rangeEnd);if(i<a){let e=`text-decoration: underline ${/^[a-z]/.test(t)?t+` `:t==`Dashed`?`dashed `:t==`Squiggle`?`wavy `:``}${/thin/i.test(r)?1:2}px`;n.push(_k.mark({attributes:{style:e}}).range(i,a))}}}e.dispatch({effects:PA.of(_k.set(n))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:t}=this.composing;this.composing=null,t&&this.reset(e.state)}};for(let e in this.handlers)t.addEventListener(e,this.handlers[e]);this.measureReq={read:e=>{let t=Tk(e.root);t&&t.rangeCount&&this.editContext.updateSelectionBounds(t.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,n=!1,r=this.pendingContextChange;return e.changes.iterChanges((i,a,o,s,c)=>{if(n)return;let l=c.length-(a-i);if(r&&a>=r.to)if(r.from==i&&r.to==a&&r.insert.eq(c)){r=this.pendingContextChange=null,t+=l,this.to+=l;return}else r=null,this.revertPending(e.state);if(i+=t,a+=t,a<=this.from)this.from+=l,this.to+=l;else if(i<this.to){if(i<this.from||a>this.to||this.to-this.from+c.length>3e4){n=!0;return}this.editContext.updateText(this.toContextPos(i),this.toContextPos(a),c.toString()),this.to+=l}t+=l}),r&&!n&&this.revertPending(e.state),!n}update(e){let t=this.pendingContextChange,n=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(n.from,n.to)&&e.transactions.some(e=>!e.isUserEvent(`input.type`)&&e.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),r=this.toContextPos(t.head);(this.editContext.selectionStart!=n||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(n,r)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let n=this.composing;return n&&n.drifted?n.editorBase+(e-n.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}},q=class e{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement(`div`),this.scrollDOM=document.createElement(`div`),this.scrollDOM.tabIndex=-1,this.scrollDOM.className=`cm-scroller`,this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement(`div`),this.announceDOM.className=`cm-announced`,this.announceDOM.setAttribute(`aria-live`,`polite`),this.dom=document.createElement(`div`),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:t}=e;this.dispatchTransactions=e.dispatchTransactions||t&&(e=>e.forEach(e=>t(e,this)))||(e=>this.update(e)),this.dispatch=this.dispatch.bind(this),this._root=e.root||Gk(e.parent)||document,this.viewState=new CN(this,e.state||gO.create(e)),e.scrollTo&&e.scrollTo.is(NA)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(RA).map(e=>new BA(e));for(let e of this.plugins)e.update(this);this.observer=new UN(this),this.inputState=new mM(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Oj(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),document.fonts?.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent=`refresh`,this.requestMeasure()})}dispatch(...e){let t=e.length==1&&e[0]instanceof nO?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(t){if(this.updateState!=0)throw Error(`Calls to EditorView.update are not allowed while an update is in progress`);let n=!1,r=!1,i,a=this.state;for(let e of t){if(e.startState!=a)throw RangeError(`Trying to update state with a transaction that doesn't start from the previous state.`);a=e.state}if(this.destroyed){this.viewState.state=a;return}let o=this.hasFocus,s=0,c=null;t.some(e=>e.annotation(qM))?(this.inputState.notifiedFocused=o,s=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,c=JM(a,o),c||(s=1));let l=this.observer.delayedAndroidKey,u=null;if(l?(this.observer.clearDelayedAndroidKey(),u=this.observer.readChange(),(u&&!this.state.doc.eq(a.doc)||!this.state.selection.eq(a.selection))&&(u=null)):this.observer.clear(),a.facet(gO.phrases)!=this.state.facet(gO.phrases))return this.setState(a);i=$A.create(this,a,t),i.flags|=s;let d=this.viewState.scrollTarget;try{this.updateState=2;for(let n of t){if(d&&=d.map(n.changes),n.scrollIntoView){let{main:t}=n.state.selection,{x:r,y:i}=this.state.facet(e.cursorScrollMargin);d=new MA(t.empty?t:W.cursor(t.head,t.head>t.anchor?-1:1),`nearest`,`nearest`,i,r)}for(let e of n.effects)e.is(NA)&&(d=e.value.clip(this.state))}this.viewState.update(i,d),this.bidiCache=XN.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),n=this.docView.update(i),this.state.facet(ZA)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(t),this.docView.updateSelection(n,t.some(e=>e.isUserEvent(`select.pointer`)))}finally{this.updateState=0}if(i.startState.facet(NN)!=i.state.facet(NN)&&(this.viewState.mustMeasureContent=!0),(n||r||d||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!i.empty)for(let e of this.state.facet(wA))try{e(i)}catch(e){FA(this.state,e,`update listener`)}(c||u)&&Promise.resolve().then(()=>{c&&this.state==c.startState&&this.dispatch(c),u&&!sM(this,u)&&l.force&&Wk(this.contentDOM,l.key,l.keyCode)})}setState(e){if(this.updateState!=0)throw Error(`Calls to EditorView.setState are not allowed while an update is in progress`);if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let e of this.plugins)e.destroy(this);this.viewState=new CN(this,e),this.plugins=e.facet(RA).map(e=>new BA(e)),this.pluginMap.clear();for(let e of this.plugins)e.update(this);this.docView.destroy(),this.docView=new Oj(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(RA),n=e.state.facet(RA);if(t!=n){let r=[];for(let i of n){let n=t.indexOf(i);if(n<0)r.push(new BA(i));else{let t=this.plugins[n];t.mustUpdate=e,r.push(t)}}for(let t of this.plugins)t.mustUpdate!=e&&t.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let t of this.plugins)t.mustUpdate=e;for(let e=0;e<this.plugins.length;e++)this.plugins[e].update(this);t!=n&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(e){FA(this.state,e,`doc view update listener`)}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,n=this.viewState.scrollParent,r=this.viewState.getScrollOffset(),{scrollAnchorPos:i,scrollAnchorHeight:a}=this.viewState;Math.abs(r-this.viewState.scrollOffset)>1&&(a=-1),this.viewState.scrollAnchorHeight=-1;try{for(let e=0;;e++){if(a<0)if(qk(n||this.win))i=-1,a=this.viewState.heightMap.height;else{let e=this.viewState.scrollAnchorAt(r);i=e.from,a=e.top}this.updateState=1;let o=this.viewState.measure();if(!o&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(e>5){console.warn(this.measureRequests.length?`Measure loop restarted more than 5 times`:`Viewport failed to stabilize`);break}let s=[];o&4||([this.measureRequests,s]=[s,this.measureRequests]);let c=s.map(e=>{try{return e.read(this)}catch(e){return FA(this.state,e),YN}}),l=$A.create(this,this.state,[]),u=!1;l.flags|=o,t?t.flags|=o:t=l,this.updateState=2,l.empty||(this.updatePlugins(l),this.inputState.update(l),this.updateAttrs(),u=this.docView.update(l),u&&this.docViewUpdate());for(let e=0;e<s.length;e++)if(c[e]!=YN)try{let t=s[e];t.write&&t.write(c[e],this)}catch(e){FA(this.state,e)}if(u&&this.docView.updateSelection(!0),!l.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,a=-1;continue}else{let e=((i<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(i).top)-a)/this.scaleY;if((e>1||e<-1)&&(n==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){r+=e,n?n.scrollTop+=e:this.win.scrollBy(0,e),a=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let e of this.state.facet(wA))e(t)}get themeClasses(){return FN+` `+(this.state.facet(PN)?LN:IN)+` `+this.state.facet(NN)}updateAttrs(){let e=ZN(this,VA,{class:`cm-editor`+(this.hasFocus?` cm-focused `:` `)+this.themeClasses}),t={spellcheck:`false`,autocorrect:`off`,autocapitalize:`off`,writingsuggestions:`false`,translate:`no`,contenteditable:this.state.facet(IA)?`true`:`false`,class:`cm-content`,style:`${K.tabSize}: ${this.state.tabSize}`,role:`textbox`,"aria-multiline":`true`};this.state.readOnly&&(t[`aria-readonly`]=`true`),ZN(this,HA,t);let n=this.observer.ignore(()=>{let n=pk(this.contentDOM,this.contentAttrs,t),r=pk(this.dom,this.editorAttrs,e);return n||r});return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(t){let n=!0;for(let r of t)for(let t of r.effects)if(t.is(e.announce)){n&&(this.announceDOM.textContent=``),n=!1;let e=this.announceDOM.appendChild(document.createElement(`div`));e.textContent=t.value}}mountStyles(){this.styleModules=this.state.facet(ZA);let t=this.state.facet(e.cspNonce);HO.mount(this.root,this.styleModules.concat(BN).reverse(),t?{nonce:t}:void 0)}readMeasured(){if(this.updateState==2)throw Error(`Reading the editor layout isn't allowed during an update`);this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key){this.measureRequests[t]=e;return}}this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(t===void 0||t&&t.plugin!=e)&&this.pluginMap.set(e,t=this.plugins.find(t=>t.plugin==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,n){return Xj(this,e,Gj(this,e,t,n))}moveByGroup(e,t){return Xj(this,e,Gj(this,e,t,t=>Kj(this,e.head,t)))}visualLineSide(e,t){let n=this.bidiSpans(e),r=this.textDirectionAt(e.from),i=n[t?n.length-1:0];return W.cursor(i.side(t,r)+e.from,i.forward(!t,r)?1:-1)}moveToLineBoundary(e,t,n=!0){return Wj(this,e,t,n)}moveVertically(e,t,n){return Xj(this,e,qj(this,e,t,n))}domAtPos(e,t=1){return this.docView.domAtPos(e,t)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){this.readMeasured();let n=Qj(this,e,t);return n&&n.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),Qj(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let n=this.docView.coordsAt(e,t);if(!n||n.left==n.right)return n;let r=this.state.doc.lineAt(e),i=this.bidiSpans(r),a=i[sA.find(i,e-r.from,-1,t)];return Pk(n,a.dir==Zk.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(kA)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>JN)return gA(e.length);let t=this.textDirectionAt(e.from),n;for(let r of this.bidiCache)if(r.from==e.from&&r.dir==t&&(r.fresh||cA(r.isolates,n=JA(this,e))))return r.order;n||=JA(this,e);let r=hA(e.text,t,n);return this.bidiCache.push(new XN(e.from,e.to,t,n,!0,r)),r}get hasFocus(){return(this.dom.ownerDocument.hasFocus()||K.safari&&this.inputState?.lastContextMenu>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Vk(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return NA.of(new MA(typeof e==`number`?W.cursor(e):e,t.y??`nearest`,t.x??`nearest`,t.yMargin??5,t.xMargin??5))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return NA.of(new MA(W.cursor(n.from),`start`,`start`,n.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e==`boolean`?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return zA.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return zA.define(()=>({}),{eventObservers:e})}static theme(e,t){let n=HO.newName(),r=[NN.of(n),ZA.of(zN(`.${n}`,e))];return t&&t.dark&&r.push(PN.of(!0)),r}static baseTheme(e){return LD.lowest(ZA.of(zN(`.`+FN,e,RN)))}static findFromDOM(e){let t=e.querySelector(`.cm-content`);return(t&&tj.get(t)||tj.get(e))?.root?.view||null}};q.styleModule=ZA,q.inputHandler=TA,q.clipboardInputFilter=DA,q.clipboardOutputFilter=OA,q.scrollHandler=jA,q.focusChangeEffect=EA,q.perLineTextDirection=kA,q.exceptionSink=CA,q.updateListener=wA,q.editable=IA,q.mouseSelectionStyle=SA,q.dragMovesSelection=xA,q.clickAddsSelectionRange=bA,q.decorations=UA,q.blockWrappers=WA,q.outerDecorations=GA,q.atomicRanges=KA,q.bidiIsolatedRanges=qA,q.cursorScrollMargin=G.define({combine:e=>{let t=5,n=5;for(let r of e)typeof r==`number`?t=n=r:{x:t,y:n}=r;return{x:t,y:n}}}),q.scrollMargins=YA,q.darkTheme=PN,q.cspNonce=G.define({combine:e=>e.length?e[0]:``}),q.contentAttributes=HA,q.editorAttributes=VA,q.lineWrapping=q.contentAttributes.of({class:`cm-lineWrapping`}),q.announce=tO.define();var JN=4096,YN={},XN=class e{constructor(e,t,n,r,i,a){this.from=e,this.to=t,this.dir=n,this.isolates=r,this.fresh=i,this.order=a}static update(t,n){if(n.empty&&!t.some(e=>e.fresh))return t;let r=[],i=t.length?t[t.length-1].dir:Zk.LTR;for(let a=Math.max(0,t.length-10);a<t.length;a++){let o=t[a];o.dir==i&&!n.touchesRange(o.from,o.to)&&r.push(new e(n.mapPos(o.from,1),n.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return r}};function ZN(e,t,n){for(let r=e.state.facet(t),i=r.length-1;i>=0;i--){let t=r[i],a=typeof t==`function`?t(e):t;a&&lk(a,n)}return n}var QN=K.mac?`mac`:K.windows?`win`:K.linux?`linux`:`key`;function $N(e,t){let n=e.split(/-(?!$)/),r=n[n.length-1];r==`Space`&&(r=` `);let i,a,o,s;for(let e=0;e<n.length-1;++e){let r=n[e];if(/^(cmd|meta|m)$/i.test(r))s=!0;else if(/^a(lt)?$/i.test(r))i=!0;else if(/^(c|ctrl|control)$/i.test(r))a=!0;else if(/^s(hift)?$/i.test(r))o=!0;else if(/^mod$/i.test(r))t==`mac`?s=!0:a=!0;else throw Error(`Unrecognized modifier name: `+r)}return i&&(r=`Alt-`+r),a&&(r=`Ctrl-`+r),s&&(r=`Meta-`+r),o&&(r=`Shift-`+r),r}function eP(e,t,n){return t.altKey&&(e=`Alt-`+e),t.ctrlKey&&(e=`Ctrl-`+e),t.metaKey&&(e=`Meta-`+e),n!==!1&&t.shiftKey&&(e=`Shift-`+e),e}var tP=LD.default(q.domEventHandlers({keydown(e,t){return lP(iP(t.state),e,t,`editor`)}})),nP=G.define({enables:tP}),rP=new WeakMap;function iP(e){let t=e.facet(nP),n=rP.get(t);return n||rP.set(t,n=sP(t.reduce((e,t)=>e.concat(t),[]))),n}var aP=null,oP=4e3;function sP(e,t=QN){let n=Object.create(null),r=Object.create(null),i=(e,t)=>{let n=r[e];if(n==null)r[e]=t;else if(n!=t)throw Error(`Key binding `+e+` is used both as a regular binding and as a multi-stroke prefix`)},a=(e,r,a,o,s)=>{let c=n[e]||(n[e]=Object.create(null)),l=r.split(/ (?!$)/).map(e=>$N(e,t));for(let t=1;t<l.length;t++){let n=l.slice(0,t).join(` `);i(n,!0),c[n]||(c[n]={preventDefault:!0,stopPropagation:!1,run:[t=>{let r=aP={view:t,prefix:n,scope:e};return setTimeout(()=>{aP==r&&(aP=null)},oP),!0}]})}let u=l.join(` `);i(u,!1);let d=c[u]||(c[u]={preventDefault:!1,stopPropagation:!1,run:(c._any?.run)?.slice()||[]});a&&d.run.push(a),o&&(d.preventDefault=!0),s&&(d.stopPropagation=!0)};for(let r of e){let e=r.scope?r.scope.split(` `):[`editor`];if(r.any)for(let t of e){let e=n[t]||(n[t]=Object.create(null));e._any||={preventDefault:!1,stopPropagation:!1,run:[]};let{any:i}=r;for(let t in e)e[t].run.push(e=>i(e,cP))}let i=r[t]||r.key;if(i)for(let t of e)a(t,i,r.run,r.preventDefault,r.stopPropagation),r.shift&&a(t,`Shift-`+i,r.shift,r.preventDefault,r.stopPropagation)}return n}var cP=null;function lP(e,t,n,r){cP=t;let i=ZO(t),a=mD(pD(i,0))==i.length&&i!=` `,o=``,s=!1,c=!1,l=!1;aP&&aP.view==n&&aP.scope==r&&(o=aP.prefix+` `,bM.indexOf(t.keyCode)<0&&(c=!0,aP=null));let u=new Set,d=e=>{if(e){for(let t of e.run)if(!u.has(t)&&(u.add(t),t(n)))return e.stopPropagation&&(l=!0),!0;e.preventDefault&&(e.stopPropagation&&(l=!0),c=!0)}return!1},f=e[r],p,m;return f&&(d(f[o+eP(i,t,!a)])?s=!0:a&&(t.altKey||t.metaKey||t.ctrlKey)&&!(K.windows&&t.ctrlKey&&t.altKey)&&!(K.mac&&t.altKey&&!(t.ctrlKey||t.metaKey))&&(p=GO[t.keyCode])&&p!=i?(d(f[o+eP(p,t,!0)])||t.shiftKey&&(m=KO[t.keyCode])!=i&&m!=p&&d(f[o+eP(m,t,!1)]))&&(s=!0):a&&t.shiftKey&&d(f[o+eP(i,t,!0)])&&(s=!0),!s&&d(f._any)&&(s=!0)),c&&(s=!0),s&&l&&t.stopPropagation(),cP=null,s}/x/.unicode;var uP=class extends vO{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}};uP.prototype.elementClass=``,uP.prototype.toDOM=void 0,uP.prototype.mapMode=gD.TrackBefore,uP.prototype.startSide=uP.prototype.endSide=-1,uP.prototype.point=!0;var dP=G.define(),fP=G.define(),pP=G.define(),mP=G.define({combine:e=>e.some(e=>e)});function hP(e){let t=[gP];return e&&e.fixed===!1&&t.push(mP.of(!0)),t}var gP=zA.fromClass(class{constructor(e){this.view=e,this.domAfter=null,this.prevViewport=e.viewport,this.dom=document.createElement(`div`),this.dom.className=`cm-gutters cm-gutters-before`,this.dom.setAttribute(`aria-hidden`,`true`),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+`px`,this.gutters=e.state.facet(pP).map(t=>new bP(e,t)),this.fixed=!e.state.facet(mP);for(let e of this.gutters)e.config.side==`after`?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position=`sticky`),this.syncGutters(!1),e.scrollDOM.insertBefore(this.dom,e.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement(`div`),this.domAfter.className=`cm-gutters cm-gutters-after`,this.domAfter.setAttribute(`aria-hidden`,`true`),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+`px`,this.domAfter.style.position=this.fixed?`sticky`:``,this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(e){if(this.updateGutters(e)){let t=this.prevViewport,n=e.view.viewport,r=Math.min(t.to,n.to)-Math.max(t.from,n.from);this.syncGutters(r<(n.to-n.from)*.8)}if(e.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+`px`;this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(mP)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?`sticky`:``,this.domAfter&&(this.domAfter.style.position=this.fixed?`sticky`:``)),this.prevViewport=e.view.viewport}syncGutters(e){let t=this.dom.nextSibling;e&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=CO.iter(this.view.state.facet(dP),this.view.viewport.from),r=[],i=this.gutters.map(e=>new yP(e,this.view.viewport,-this.view.documentPadding.top));for(let e of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(e.type)){let t=!0;for(let a of e.type)if(a.type==gk.Text&&t){vP(n,r,a.from);for(let e of i)e.line(this.view,a,r);t=!1}else if(a.widget)for(let e of i)e.widget(this.view,a)}else if(e.type==gk.Text){vP(n,r,e.from);for(let t of i)t.line(this.view,e,r)}else if(e.widget)for(let t of i)t.widget(this.view,e);for(let e of i)e.finish();e&&(this.view.scrollDOM.insertBefore(this.dom,t),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(e){let t=e.startState.facet(pP),n=e.state.facet(pP),r=e.docChanged||e.heightChanged||e.viewportChanged||!CO.eq(e.startState.facet(dP),e.state.facet(dP),e.view.viewport.from,e.view.viewport.to);if(t==n)for(let t of this.gutters)t.update(e)&&(r=!0);else{r=!0;let i=[];for(let r of n){let n=t.indexOf(r);n<0?i.push(new bP(this.view,r)):(this.gutters[n].update(e),i.push(this.gutters[n]))}for(let e of this.gutters)e.dom.remove(),i.indexOf(e)<0&&e.destroy();for(let e of i)e.config.side==`after`?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.gutters=i}return r}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:e=>q.scrollMargins.of(t=>{let n=t.plugin(e);if(!n||n.gutters.length==0||!n.fixed)return null;let r=n.dom.offsetWidth*t.scaleX,i=n.domAfter?n.domAfter.offsetWidth*t.scaleX:0;return t.textDirection==Zk.LTR?{left:r,right:i}:{right:r,left:i}})});function _P(e){return Array.isArray(e)?e:[e]}function vP(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}var yP=class{constructor(e,t,n){this.gutter=e,this.height=n,this.i=0,this.cursor=CO.iter(e.markers,t.from)}addElement(e,t,n){let{gutter:r}=this,i=(t.top-this.height)/e.scaleY,a=t.height/e.scaleY;if(this.i==r.elements.length){let t=new xP(e,a,i,n);r.elements.push(t),r.dom.appendChild(t.dom)}else r.elements[this.i].update(e,a,i,n);this.height=t.bottom,this.i++}line(e,t,n){let r=[];vP(this.cursor,r,t.from),n.length&&(r=r.concat(n));let i=this.gutter.config.lineMarker(e,t,r);i&&r.unshift(i);let a=this.gutter;r.length==0&&!a.config.renderEmptyElements||this.addElement(e,t,r)}widget(e,t){let n=this.gutter.config.widgetMarker(e,t.widget,t),r=n?[n]:null;for(let n of e.state.facet(fP)){let i=n(e,t.widget,t);i&&(r||=[]).push(i)}r&&this.addElement(e,t,r)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}},bP=class{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement(`div`),this.dom.className=`cm-gutter`+(this.config.class?` `+this.config.class:``);for(let n in t.domEventHandlers)this.dom.addEventListener(n,r=>{let i=r.target,a;if(i!=this.dom&&this.dom.contains(i)){for(;i.parentNode!=this.dom;)i=i.parentNode;let e=i.getBoundingClientRect();a=(e.top+e.bottom)/2}else a=r.clientY;let o=e.lineBlockAtHeight(a-e.documentTop);t.domEventHandlers[n](e,o,r)&&r.preventDefault()});this.markers=_P(t.markers(e)),t.initialSpacer&&(this.spacer=new xP(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+=`visibility: hidden; pointer-events: none`)}update(e){let t=this.markers;if(this.markers=_P(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let t=this.config.updateSpacer(this.spacer.markers[0],e);t!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[t])}let n=e.view.viewport;return!CO.eq(this.markers,t,n.from,n.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}},xP=class{constructor(e,t,n,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement(`div`),this.dom.className=`cm-gutterElement`,this.update(e,t,n,r)}update(e,t,n,r){this.height!=t&&(this.height=t,this.dom.style.height=t+`px`),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+`px`:``),SP(this.markers,r)||this.setMarkers(e,r)}setMarkers(e,t){let n=`cm-gutterElement`,r=this.dom.firstChild;for(let i=0,a=0;;){let o=a,s=i<t.length?t[i++]:null,c=!1;if(s){let e=s.elementClass;e&&(n+=` `+e);for(let e=a;e<this.markers.length;e++)if(this.markers[e].compare(s)){o=e,c=!0;break}}else o=this.markers.length;for(;a<o;){let e=this.markers[a++];if(e.toDOM){e.destroy(r);let t=r.nextSibling;r.remove(),r=t}}if(!s)break;s.toDOM&&(c?r=r.nextSibling:this.dom.insertBefore(s.toDOM(e),r)),c&&a++}this.dom.className=n,this.markers=t}destroy(){this.setMarkers(null,[])}};function SP(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].compare(t[n]))return!1;return!0}var CP=G.define(),wP=G.define(),TP=G.define({combine(e){return _O(e,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let n=Object.assign({},e);for(let e in t){let r=n[e],i=t[e];n[e]=r?(e,t,n)=>r(e,t,n)||i(e,t,n):i}return n}})}}),EP=class extends uP{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}};function DP(e,t){return e.state.facet(TP).formatNumber(t,e.state)}var OP=pP.compute([TP],e=>({class:`cm-lineNumbers`,renderEmptyElements:!1,markers(e){return e.state.facet(CP)},lineMarker(e,t,n){return n.some(e=>e.toDOM)?null:new EP(DP(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,n)=>{for(let r of e.state.facet(wP)){let i=r(e,t,n);if(i)return i}return null},lineMarkerChange:e=>e.startState.facet(TP)!=e.state.facet(TP),initialSpacer(e){return new EP(DP(e,AP(e.state.doc.lines)))},updateSpacer(e,t){let n=DP(t.view,AP(t.view.state.doc.lines));return n==e.number?e:new EP(n)},domEventHandlers:e.facet(TP).domEventHandlers,side:`before`}));function kP(e={}){return[TP.of(e),hP(),OP]}function AP(e){let t=9;for(;t<e;)t=t*10+9;return t}var jP=1024,MP=0,NP=class{constructor(e,t){this.from=e,this.to=t}},J=class{constructor(e={}){this.id=MP++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw Error(`This node type doesn't define a deserialize function`)}),this.combine=e.combine||null}add(e){if(this.perNode)throw RangeError(`Can't add per-node props to node types`);return typeof e!=`function`&&(e=IP.match(e)),t=>{let n=e(t);return n===void 0?null:[this,n]}}};J.closedBy=new J({deserialize:e=>e.split(` `)}),J.openedBy=new J({deserialize:e=>e.split(` `)}),J.group=new J({deserialize:e=>e.split(` `)}),J.isolate=new J({deserialize:e=>{if(e&&e!=`rtl`&&e!=`ltr`&&e!=`auto`)throw RangeError(`Invalid value for isolate: `+e);return e||`auto`}}),J.contextHash=new J({perNode:!0}),J.lookAhead=new J({perNode:!0}),J.mounted=new J({perNode:!0});var PP=class{constructor(e,t,n,r=!1){this.tree=e,this.overlay=t,this.parser=n,this.bracketed=r}static get(e){return e&&e.props&&e.props[J.mounted.id]}},FP=Object.create(null),IP=class e{constructor(e,t,n,r=0){this.name=e,this.props=t,this.id=n,this.flags=r}static define(t){let n=t.props&&t.props.length?Object.create(null):FP,r=!!t.top|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),i=new e(t.name||``,n,t.id,r);if(t.props){for(let e of t.props)if(Array.isArray(e)||(e=e(i)),e){if(e[0].perNode)throw RangeError(`Can't store a per-node prop on a node type`);n[e[0].id]=e[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e==`string`){if(this.name==e)return!0;let t=this.prop(J.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let r of n.split(` `))t[r]=e[n];return e=>{for(let n=e.prop(J.group),r=-1;r<(n?n.length:0);r++){let i=t[r<0?e.name:n[r]];if(i)return i}}}};IP.none=new IP(``,Object.create(null),0,8);var LP=class e{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw RangeError(`Node type ids should correspond to array positions when creating a node set`)}extend(...t){let n=[];for(let e of this.types){let r=null;for(let n of t){let t=n(e);if(t){r||=Object.assign({},e.props);let n=t[1],i=t[0];i.combine&&i.id in r&&(n=i.combine(r[i.id],n)),r[i.id]=n}}n.push(r?new IP(e.name,r,e.id,e.flags):e)}return new e(n)}},RP=new WeakMap,zP=new WeakMap,BP;(function(e){e[e.ExcludeBuffers=1]=`ExcludeBuffers`,e[e.IncludeAnonymous=2]=`IncludeAnonymous`,e[e.IgnoreMounts=4]=`IgnoreMounts`,e[e.IgnoreOverlays=8]=`IgnoreOverlays`,e[e.EnterBracketed=16]=`EnterBracketed`})(BP||={});var VP=class e{constructor(e,t,n,r,i){if(this.type=e,this.children=t,this.positions=n,this.length=r,this.props=null,i&&i.length){this.props=Object.create(null);for(let[e,t]of i)this.props[typeof e==`number`?e:e.id]=t}}toString(){let e=PP.get(this);if(e&&!e.overlay)return e.tree.toString();let t=``;for(let e of this.children){let n=e.toString();n&&(t&&(t+=`,`),t+=n)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?`(`+t+`)`:``):t}cursor(e=0){return new tF(this.topNode,e)}cursorAt(e,t=0,n=0){let r=new tF(RP.get(this)||this.topNode);return r.moveTo(e,t),RP.set(this,r._tree),r}get topNode(){return new qP(this,0,0,null)}resolve(e,t=0){let n=GP(RP.get(this)||this.topNode,e,t,!1);return RP.set(this,n),n}resolveInner(e,t=0){let n=GP(zP.get(this)||this.topNode,e,t,!0);return zP.set(this,n),n}resolveStack(e,t=0){return eF(this,e,t)}iterate(e){let{enter:t,leave:n,from:r=0,to:i=this.length}=e,a=e.mode||0,o=(a&BP.IncludeAnonymous)>0;for(let e=this.cursor(a|BP.IncludeAnonymous);;){let a=!1;if(e.from<=i&&e.to>=r&&(!o&&e.type.isAnonymous||t(e)!==!1)){if(e.firstChild())continue;a=!0}for(;a&&n&&(o||!e.type.isAnonymous)&&n(e),!e.nextSibling();){if(!e.parent())return;a=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(t={}){return this.children.length<=8?this:oF(IP.none,this.children,this.positions,0,this.children.length,0,this.length,(t,n,r)=>new e(this.type,t,n,r,this.propValues),t.makeTree||((t,n,r)=>new e(IP.none,t,n,r)))}static build(e){return rF(e)}};VP.empty=new VP(IP.none,[],[],0);var HP=class e{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new e(this.buffer,this.index)}},UP=class e{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return IP.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(`,`)}childString(e){let t=this.buffer[e],n=this.buffer[e+3],r=this.set.types[t],i=r.name;if(/\W/.test(i)&&!r.isError&&(i=JSON.stringify(i)),e+=4,n==e)return i;let a=[];for(;e<n;)a.push(this.childString(e)),e=this.buffer[e+3];return i+`(`+a.join(`,`)+`)`}findChild(e,t,n,r,i){let{buffer:a}=this,o=-1;for(let s=e;s!=t&&!(WP(i,r,a[s+1],a[s+2])&&(o=s,n>0));s=a[s+3]);return o}slice(t,n,r){let i=this.buffer,a=new Uint16Array(n-t),o=0;for(let e=t,s=0;e<n;){a[s++]=i[e++],a[s++]=i[e++]-r;let n=a[s++]=i[e++]-r;a[s++]=i[e++]-t,o=Math.max(o,n)}return new e(a,o,this.set)}};function WP(e,t,n,r){switch(e){case-2:return n<t;case-1:return r>=t&&n<t;case 0:return n<t&&r>t;case 1:return n<=t&&r>t;case 2:return r>t;case 4:return!0}}function GP(e,t,n,r){for(;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to<t);){let t=!r&&e instanceof qP&&e.index<0?null:e.parent;if(!t)return e;e=t}let i=r?0:BP.IgnoreOverlays;if(r)for(let r=e,a=r.parent;a;r=a,a=r.parent)r instanceof qP&&r.index<0&&a.enter(t,n,i)?.from!=r.from&&(e=a);for(;;){let r=e.enter(t,n,i);if(!r)return e;e=r}}var KP=class{cursor(e=0){return new tF(this,e)}getChild(e,t=null,n=null){let r=JP(this,e,t,n);return r.length?r[0]:null}getChildren(e,t=null,n=null){return JP(this,e,t,n)}resolve(e,t=0){return GP(this,e,t,!1)}resolveInner(e,t=0){return GP(this,e,t,!0)}matchContext(e){return YP(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),n=this;for(;t;){let e=t.lastChild;if(!e||e.to!=t.to)break;e.type.isError&&e.from==e.to?(n=t,t=e.prevSibling):t=e}return n}get node(){return this}get next(){return this.parent}},qP=class e extends KP{constructor(e,t,n,r){super(),this._tree=e,this.from=t,this.index=n,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(t,n,r,i,a=0){for(let o=this;;){for(let{children:s,positions:c}=o._tree,l=n>0?s.length:-1;t!=l;t+=n){let l=s[t],u=c[t]+o.from,d;if(!(!(a&BP.EnterBracketed&&l instanceof VP&&(d=PP.get(l))&&!d.overlay&&d.bracketed&&r>=u&&r<=u+l.length)&&!WP(i,r,u,u+l.length))){if(l instanceof UP){if(a&BP.ExcludeBuffers)continue;let e=l.findChild(0,l.buffer.length,n,r-u,i);if(e>-1)return new ZP(new XP(o,l,t,u),null,e)}else if(a&BP.IncludeAnonymous||!l.type.isAnonymous||nF(l)){let s;if(!(a&BP.IgnoreMounts)&&(s=PP.get(l))&&!s.overlay)return new e(s.tree,u,t,o);let c=new e(l,u,t,o);return a&BP.IncludeAnonymous||!c.type.isAnonymous?c:c.nextChild(n<0?l.children.length-1:0,n,r,i,a)}}}if(a&BP.IncludeAnonymous||!o.type.isAnonymous||(t=o.index>=0?o.index+n:n<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(t,n,r=0){let i;if(!(r&BP.IgnoreOverlays)&&(i=PP.get(this._tree))&&i.overlay){let a=t-this.from,o=r&BP.EnterBracketed&&i.bracketed;for(let{from:t,to:r}of i.overlay)if((n>0||o?t<=a:t<a)&&(n<0||o?r>=a:r>a))return new e(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}};function JP(e,t,n,r){let i=e.cursor(),a=[];if(!i.firstChild())return a;if(n!=null){for(let e=!1;!e;)if(e=i.type.is(n),!i.nextSibling())return a}for(;;){if(r!=null&&i.type.is(r))return a;if(i.type.is(t)&&a.push(i.node),!i.nextSibling())return r==null?a:[]}}function YP(e,t,n=t.length-1){for(let r=e;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(t[n]&&t[n]!=r.name)return!1;n--}}return!0}var XP=class{constructor(e,t,n,r){this.parent=e,this.buffer=t,this.index=n,this.start=r}},ZP=class e extends KP{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(t,n,r){let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],t,n-this.context.start,r);return a<0?null:new e(this.context,this,a)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(t,n,r=0){if(r&BP.ExcludeBuffers)return null;let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,t-this.context.start,n);return a<0?null:new e(this.context,this,a)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:t}=this.context,n=t.buffer[this.index+3];return n<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new e(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new e(this.context,this._parent,t.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,r=this.index+4,i=n.buffer[this.index+3];if(i>r){let a=n.buffer[this.index+1];e.push(n.slice(r,i,a)),t.push(0)}return new VP(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}};function QP(e){if(!e.length)return null;let t=0,n=e[0];for(let r=1;r<e.length;r++){let i=e[r];(i.from>n.from||i.to<n.to)&&(n=i,t=r)}let r=n instanceof qP&&n.index<0?null:n.parent,i=e.slice();return r?i[t]=r:i.splice(t,1),new $P(i,n)}var $P=class{constructor(e,t){this.heads=e,this.node=t}get next(){return QP(this.heads)}};function eF(e,t,n){let r=e.resolveInner(t,n),i=null;for(let e=r instanceof qP?r:r.context.parent;e;e=e.parent)if(e.index<0){let a=e.parent;(i||=[r]).push(a.resolve(t,n)),e=a}else{let a=PP.get(e.tree);if(a&&a.overlay&&a.overlay[0].from<=t&&a.overlay[a.overlay.length-1].to>=t){let o=new qP(a.tree,a.overlay[0].from+e.from,-1,e);(i||=[r]).push(GP(o,t,n,!1))}}return i?QP(i):r}var tF=class{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~BP.EnterBracketed,e instanceof qP)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let t=e._parent;t;t=t._parent)this.stack.unshift(t.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:n,buffer:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=n+r.buffer[e+1],this.to=n+r.buffer[e+2],!0}yield(e){return e?e instanceof qP?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:r}=this.buffer,i=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,n);return i<0?!1:(this.stack.push(this.index),this.yieldBuf(i))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?n&BP.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&BP.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&BP.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let e=n<0?0:this.stack[n]+4;if(this.index!=e)return this.yieldBuf(t.findChild(e,this.index,-1,0,4))}else{let e=t.buffer[this.index+3];if(e<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(e)}return n<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let e=0;e<this.index;e++)if(r.buffer.buffer[e+3]<this.index)return!1;({index:t,parent:n}=r)}else({index:t,_parent:n}=this._tree);for(;n;{index:t,_parent:n}=n)if(t>-1)for(let r=t+e,i=e<0?-1:n._tree.children.length;r!=i;r+=e){let e=n._tree.children[r];if(this.mode&BP.IncludeAnonymous||e instanceof UP||!e.type.isAnonymous||nF(e))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,n=0;if(e&&e.context==this.buffer)scan:for(let r=this.index,i=this.stack.length;i>=0;){for(let a=e;a;a=a._parent)if(a.index==r){if(r==this.index)return a;t=a,n=i+1;break scan}r=this.stack[--i]}for(let e=n;e<this.stack.length;e++)t=new ZP(this.buffer,t,this.stack[e]);return this.bufferNode=new ZP(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let n=0;;){let r=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){n++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&t&&t(this),r=this.type.isAnonymous,!n)return;if(this.nextSibling())break;this.parent(),n--,r=!0}}}matchContext(e){if(!this.buffer)return YP(this.node.parent,e);let{buffer:t}=this.buffer,{types:n}=t.set;for(let r=e.length-1,i=this.stack.length-1;r>=0;i--){if(i<0)return YP(this._tree,e,r);let a=n[t.buffer[this.stack[i]]];if(!a.isAnonymous){if(e[r]&&e[r]!=a.name)return!1;r--}}return!0}};function nF(e){return e.children.some(e=>e instanceof UP||!e.type.isAnonymous||nF(e))}function rF(e){let{buffer:t,nodeSet:n,maxBufferLength:r=jP,reused:i=[],minRepeatType:a=n.types.length}=e,o=Array.isArray(t)?new HP(t,t.length):t,s=n.types,c=0,l=0;function u(e,t,_,v,y,b){let{id:x,start:S,end:C,size:w}=o,T=l,E=c;if(w<0)if(o.next(),w==-1){let t=i[x];_.push(t),v.push(S-e);return}else if(w==-3){c=x;return}else if(w==-4){l=x;return}else throw RangeError(`Unrecognized record size: ${w}`);let D=s[x],O,k,A=S-e;if(C-S<=r&&(k=h(o.pos-t,y))){let t=new Uint16Array(k.size-k.skip),r=o.pos-k.size,i=t.length;for(;o.pos>r;)i=g(k.start,t,i);O=new UP(t,C-k.start,n),A=k.start-e}else{let e=o.pos-w;o.next();let t=[],n=[],i=x>=a?x:-1,s=0,c=C;for(;o.pos>e;)i>=0&&o.id==i&&o.size>=0?(o.end<=c-r&&(p(t,n,S,s,o.end,c,i,T,E),s=t.length,c=o.end),o.next()):b>2500?d(S,e,t,n):u(S,e,t,n,i,b+1);if(i>=0&&s>0&&s<t.length&&p(t,n,S,s,S,c,i,T,E),t.reverse(),n.reverse(),i>-1&&s>0){let e=f(D,E);O=oF(D,t,n,0,t.length,0,C-S,e,e)}else O=m(D,t,n,C-S,T-C,E)}_.push(O),v.push(A)}function d(e,t,i,a){let s=[],c=0,l=-1;for(;o.pos>t;){let{id:e,start:t,end:n,size:i}=o;if(i>4)o.next();else if(l>-1&&t<l)break;else l<0&&(l=n-r),s.push(e,t,n),c++,o.next()}if(c){let t=new Uint16Array(c*4),r=s[s.length-2];for(let e=s.length-3,n=0;e>=0;e-=3)t[n++]=s[e],t[n++]=s[e+1]-r,t[n++]=s[e+2]-r,t[n++]=n;i.push(new UP(t,s[2]-r,n)),a.push(r-e)}}function f(e,t){return(n,r,i)=>{let a=0,o=n.length-1,s,c;if(o>=0&&(s=n[o])instanceof VP){if(!o&&s.type==e&&s.length==i)return s;(c=s.prop(J.lookAhead))&&(a=r[o]+s.length+c)}return m(e,n,r,i,a,t)}}function p(e,t,r,i,a,o,s,c,l){let u=[],d=[];for(;e.length>i;)u.push(e.pop()),d.push(t.pop()+r-a);e.push(m(n.types[s],u,d,o-a,c-o,l)),t.push(a-r)}function m(e,t,n,r,i,a,o){if(a){let e=[J.contextHash,a];o=o?[e].concat(o):[e]}if(i>25){let e=[J.lookAhead,i];o=o?[e].concat(o):[e]}return new VP(e,t,n,r,o)}function h(e,t){let n=o.fork(),i=0,s=0,c=0,l=n.end-r,u={size:0,start:0,skip:0};scan:for(let r=n.pos-e;n.pos>r;){let e=n.size;if(n.id==t&&e>=0){u.size=i,u.start=s,u.skip=c,c+=4,i+=4,n.next();continue}let o=n.pos-e;if(e<0||o<r||n.start<l)break;let d=n.id>=a?4:0,f=n.start;for(n.next();n.pos>o;){if(n.size<0)if(n.size==-3||n.size==-4)d+=4;else break scan;else n.id>=a&&(d+=4);n.next()}s=f,i+=e,c+=d}return(t<0||i==e)&&(u.size=i,u.start=s,u.skip=c),u.size>4?u:void 0}function g(e,t,n){let{id:r,start:i,end:s,size:u}=o;if(o.next(),u>=0&&r<a){let a=n;if(u>4){let r=o.pos-(u-4);for(;o.pos>r;)n=g(e,t,n)}t[--n]=a,t[--n]=s-e,t[--n]=i-e,t[--n]=r}else u==-3?c=r:u==-4&&(l=r);return n}let _=[],v=[];for(;o.pos>0;)u(e.start||0,e.bufferStart||0,_,v,-1,0);let y=e.length??(_.length?v[0]+_[0].length:0);return new VP(s[e.topID],_.reverse(),v.reverse(),y)}var iF=new WeakMap;function aF(e,t){if(!e.isAnonymous||t instanceof UP||t.type!=e)return 1;let n=iF.get(t);if(n==null){n=1;for(let r of t.children){if(r.type!=e||!(r instanceof VP)){n=1;break}n+=aF(e,r)}iF.set(t,n)}return n}function oF(e,t,n,r,i,a,o,s,c){let l=0;for(let n=r;n<i;n++)l+=aF(e,t[n]);let u=Math.ceil(l*1.5/8),d=[],f=[];function p(t,n,r,i,o){for(let s=r;s<i;){let r=s,l=n[s],m=aF(e,t[s]);for(s++;s<i;s++){let n=aF(e,t[s]);if(m+n>=u)break;m+=n}if(s==r+1){if(m>u){let e=t[r];p(e.children,e.positions,0,e.children.length,n[r]+o);continue}d.push(t[r])}else{let i=n[s-1]+t[s-1].length-l;d.push(oF(e,t,n,r,s,l,i,null,c))}f.push(l+o-a)}}return p(t,n,r,i,0),(s||c)(d,f,o)}var sF=class{constructor(){this.map=new WeakMap}setBuffer(e,t,n){let r=this.map.get(e);r||this.map.set(e,r=new Map),r.set(t,n)}getBuffer(e,t){let n=this.map.get(e);return n&&n.get(t)}set(e,t){e instanceof ZP?this.setBuffer(e.context.buffer,e.index,t):e instanceof qP&&this.map.set(e.tree,t)}get(e){return e instanceof ZP?this.getBuffer(e.context.buffer,e.index):e instanceof qP?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}},cF=class e{constructor(e,t,n,r,i=!1,a=!1){this.from=e,this.to=t,this.tree=n,this.offset=r,this.open=!!i|(a?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,n=[],r=!1){let i=[new e(0,t.length,t,0,!1,r)];for(let e of n)e.to>t.length&&i.push(e);return i}static applyChanges(t,n,r=128){if(!n.length)return t;let i=[],a=1,o=t.length?t[0]:null;for(let s=0,c=0,l=0;;s++){let u=s<n.length?n[s]:null,d=u?u.fromA:1e9;if(d-c>=r)for(;o&&o.from<d;){let n=o;if(c>=n.from||d<=n.to||l){let t=Math.max(n.from,c)-l,r=Math.min(n.to,d)-l;n=t>=r?null:new e(t,r,n.tree,n.offset+l,s>0,!!u)}if(n&&i.push(n),o.to>d)break;o=a<t.length?t[a++]:null}if(!u)break;c=u.toA,l=u.toA-u.toB}return i}},lF=class{startParse(e,t,n){return typeof e==`string`&&(e=new uF(e)),n=n?n.length?n.map(e=>new NP(e.from,e.to)):[new NP(0,0)]:[new NP(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let r=this.startParse(e,t,n);for(;;){let e=r.advance();if(e)return e}}},uF=class{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}};function dF(e){return(t,n,r,i)=>new gF(t,e,n,r,i)}var fF=class{constructor(e,t,n,r,i,a){this.parser=e,this.parse=t,this.overlay=n,this.bracketed=r,this.target=i,this.from=a}};function pF(e){if(!e.length||e.some(e=>e.from>=e.to))throw RangeError(`Invalid inner parse ranges given: `+JSON.stringify(e))}var mF=class{constructor(e,t,n,r,i,a,o,s){this.parser=e,this.predicate=t,this.mounts=n,this.index=r,this.start=i,this.bracketed=a,this.target=o,this.prev=s,this.depth=0,this.ranges=[]}},hF=new J({perNode:!0}),gF=class{constructor(e,t,n,r,i){this.nest=t,this.input=n,this.fragments=r,this.ranges=i,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let e=this.baseParse.advance();if(!e)return null;if(this.baseParse=null,this.baseTree=e,this.startInner(),this.stoppedAt!=null)for(let e of this.inner)e.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let e=this.baseTree;return this.stoppedAt!=null&&(e=new VP(e.type,e.children,e.positions,e.length,e.propValues.concat([[hF,this.stoppedAt]]))),e}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let n=Object.assign(Object.create(null),e.target.props);n[J.mounted.id]=new PP(t,e.overlay,e.parser,e.bracketed),e.target.props=n}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;t<this.inner.length;t++)this.inner[t].from<e&&(e=Math.min(e,this.inner[t].parse.parsedPos));return e}stopAt(e){if(this.stoppedAt=e,this.baseParse)this.baseParse.stopAt(e);else for(let t=this.innerDone;t<this.inner.length;t++)this.inner[t].parse.stopAt(e)}startInner(){let e=new xF(this.fragments),t=null,n=null,r=new tF(new qP(this.baseTree,this.ranges[0].from,0,null),BP.IncludeAnonymous|BP.IgnoreMounts);scan:for(let i,a;;){let o=!0,s;if(this.stoppedAt!=null&&r.from>=this.stoppedAt)o=!1;else if(e.hasNode(r)){if(t){let e=t.mounts.find(e=>e.frag.from<=r.from&&e.frag.to>=r.to&&e.mount.overlay);if(e)for(let n of e.mount.overlay){let i=n.from+e.pos,a=n.to+e.pos;i>=r.from&&a<=r.to&&!t.ranges.some(e=>e.from<a&&e.to>i)&&t.ranges.push({from:i,to:a})}}o=!1}else if(n&&(a=_F(n.ranges,r.from,r.to)))o=a!=2;else if(!r.type.isAnonymous&&(i=this.nest(r,this.input))&&(r.from<r.to||!i.overlay)){r.tree||(yF(r),t&&t.depth++,n&&n.depth++);let a=e.findMounts(r.from,i.parser);if(typeof i.overlay==`function`)t=new mF(i.parser,i.overlay,a,this.inner.length,r.from,!!i.bracketed,r.tree,t);else{let e=SF(this.ranges,i.overlay||(r.from<r.to?[new NP(r.from,r.to)]:[]));e.length&&pF(e),(e.length||!i.overlay)&&this.inner.push(new fF(i.parser,e.length?i.parser.startParse(this.input,wF(a,e),e):i.parser.startParse(``),i.overlay?i.overlay.map(e=>new NP(e.from-r.from,e.to-r.from)):null,!!i.bracketed,r.tree,e.length?e[0].from:r.from)),i.overlay?e.length&&(n={ranges:e,depth:0,prev:n}):o=!1}}else if(t&&(s=t.predicate(r))&&(s===!0&&(s=new NP(r.from,r.to)),s.from<s.to)){let e=t.ranges.length-1;e>=0&&t.ranges[e].to==s.from?t.ranges[e]={from:t.ranges[e].from,to:s.to}:t.ranges.push(s)}if(o&&r.firstChild())t&&t.depth++,n&&n.depth++;else for(;!r.nextSibling();){if(!r.parent())break scan;if(t&&!--t.depth){let e=SF(this.ranges,t.ranges);e.length&&(pF(e),this.inner.splice(t.index,0,new fF(t.parser,t.parser.startParse(this.input,wF(t.mounts,e),e),t.ranges.map(e=>new NP(e.from-t.start,e.to-t.start)),t.bracketed,t.target,e[0].from))),t=t.prev}n&&!--n.depth&&(n=n.prev)}}}};function _F(e,t,n){for(let r of e){if(r.from>=n)break;if(r.to>t)return r.from<=t&&r.to>=n?2:1}return 0}function vF(e,t,n,r,i,a){if(t<n){let o=e.buffer[t+1];r.push(e.slice(t,n,o)),i.push(o-a)}}function yF(e){let{node:t}=e,n=[],r=t.context.buffer;do n.push(e.index),e.parent();while(!e.tree);let i=e.tree,a=i.children.indexOf(r),o=i.children[a],s=o.buffer,c=[a];function l(e,r,i,a,u,d){let f=n[d],p=[],m=[];vF(o,e,f,p,m,a);let h=s[f+1],g=s[f+2];c.push(p.length);let _=d?l(f+4,s[f+3],o.set.types[s[f]],h,g-h,d-1):t.toTree();return p.push(_),m.push(h-a),vF(o,s[f+3],r,p,m,a),new VP(i,p,m,u)}i.children[a]=l(0,s.length,IP.none,0,o.length,n.length-1);for(let t of c){let n=e.tree.children[t],r=e.tree.positions[t];e.yield(new qP(n,r+e.from,t,e._tree))}}var bF=class{constructor(e,t){this.offset=t,this.done=!1,this.cursor=e.cursor(BP.IncludeAnonymous|BP.IgnoreMounts)}moveTo(e){let{cursor:t}=this,n=e-this.offset;for(;!this.done&&t.from<n;)if(!(t.to>=e&&t.enter(n,1,BP.IgnoreOverlays|BP.ExcludeBuffers)))if(t.to<=e)t.next(!1)||(this.done=!0);else break}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof VP)t=t.children[0];else break}return!1}},xF=class{constructor(e){if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let t=this.curFrag=e[0];this.curTo=t.tree.prop(hF)??t.to,this.inner=new bF(t.tree,-t.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let e=this.curFrag=this.fragments[this.fragI];this.curTo=e.tree.prop(hF)??e.to,this.inner=new bF(e.tree,-e.offset)}}findMounts(e,t){let n=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let e=this.inner.cursor.node;e;e=e.parent){let r=e.tree?.prop(J.mounted);if(r&&r.parser==t)for(let t=this.fragI;t<this.fragments.length;t++){let i=this.fragments[t];if(i.from>=e.to)break;i.tree==this.curFrag.tree&&n.push({frag:i,pos:e.from-i.offset,mount:r})}}}return n}};function SF(e,t){let n=null,r=t;for(let i=1,a=0;i<e.length;i++){let o=e[i-1].to,s=e[i].from;for(;a<r.length;a++){let e=r[a];if(e.from>=s)break;e.to<=o||(n||(r=n=t.slice()),e.from<o?(n[a]=new NP(e.from,o),e.to>s&&n.splice(a+1,0,new NP(s,e.to))):e.to>s?n[a--]=new NP(s,e.to):n.splice(a--,1))}}return r}function CF(e,t,n,r){let i=0,a=0,o=!1,s=!1,c=-1e9,l=[];for(;;){let u=i==e.length?1e9:o?e[i].to:e[i].from,d=a==t.length?1e9:s?t[a].to:t[a].from;if(o!=s){let e=Math.max(c,n),t=Math.min(u,d,r);e<t&&l.push(new NP(e,t))}if(c=Math.min(u,d),c==1e9)break;u==c&&(o?(o=!1,i++):o=!0),d==c&&(s?(s=!1,a++):s=!0)}return l}function wF(e,t){let n=[];for(let{pos:r,mount:i,frag:a}of e){let e=r+(i.overlay?i.overlay[0].from:0),o=e+i.tree.length,s=Math.max(a.from,e),c=Math.min(a.to,o);if(i.overlay){let o=CF(t,i.overlay.map(e=>new NP(e.from+r,e.to+r)),s,c);for(let t=0,r=s;;t++){let s=t==o.length,l=s?c:o[t].from;if(l>r&&n.push(new cF(r,l,i.tree,-e,a.from>=r||a.openStart,a.to<=l||a.openEnd)),s)break;r=o[t].to}}else n.push(new cF(s,c,i.tree,-e,a.from>=e||a.openStart,a.to<=o||a.openEnd))}return n}var TF=0,EF=class e{constructor(e,t,n,r){this.name=e,this.set=t,this.base=n,this.modified=r,this.id=TF++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(t,n){let r=typeof t==`string`?t:`?`;if(t instanceof e&&(n=t),n?.base)throw Error(`Can not derive from a modified tag`);let i=new e(r,[],null,[]);if(i.set.push(i),n)for(let e of n.set)i.set.push(e);return i}static defineModifier(e){let t=new OF(e);return e=>e.modified.indexOf(t)>-1?e:OF.get(e.base||e,e.modified.concat(t).sort((e,t)=>e.id-t.id))}},DF=0,OF=class e{constructor(e){this.name=e,this.instances=[],this.id=DF++}static get(t,n){if(!n.length)return t;let r=n[0].instances.find(e=>e.base==t&&kF(n,e.modified));if(r)return r;let i=[],a=new EF(t.name,i,t,n);for(let e of n)e.instances.push(a);let o=AF(n);for(let n of t.set)if(!n.modified.length)for(let t of o)i.push(e.get(n,t));return a}};function kF(e,t){return e.length==t.length&&e.every((e,n)=>e==t[n])}function AF(e){let t=[[]];for(let n=0;n<e.length;n++)for(let r=0,i=t.length;r<i;r++)t.push(t[r].concat(e[n]));return t.sort((e,t)=>t.length-e.length)}function jF(e){let t=Object.create(null);for(let n in e){let r=e[n];Array.isArray(r)||(r=[r]);for(let e of n.split(` `))if(e){let n=[],i=2,a=e;for(let t=0;;){if(a==`...`&&t>0&&t+3==e.length){i=1;break}let r=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!r)throw RangeError(`Invalid path: `+e);if(n.push(r[0]==`*`?``:r[0][0]==`"`?JSON.parse(r[0]):r[0]),t+=r[0].length,t==e.length)break;let o=e[t++];if(t==e.length&&o==`!`){i=0;break}if(o!=`/`)throw RangeError(`Invalid path: `+e);a=e.slice(t)}let o=n.length-1,s=n[o];if(!s)throw RangeError(`Invalid path: `+e);t[s]=new NF(r,i,o>0?n.slice(0,o):null).sort(t[s])}}return MF.add(t)}var MF=new J({combine(e,t){let n,r,i;for(;e||t;){if(!e||t&&e.depth>=t.depth?(i=t,t=t.next):(i=e,e=e.next),n&&n.mode==i.mode&&!i.context&&!n.context)continue;let a=new NF(i.tags,i.mode,i.context);n?n.next=a:r=a,n=a}return r}}),NF=class{constructor(e,t,n,r){this.tags=e,this.mode=t,this.context=n,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}};NF.empty=new NF([],2,null);function PF(e,t){let n=Object.create(null);for(let t of e)if(!Array.isArray(t.tag))n[t.tag.id]=t.class;else for(let e of t.tag)n[e.id]=t.class;let{scope:r,all:i=null}=t||{};return{style:e=>{let t=i;for(let r of e)for(let e of r.set){let r=n[e.id];if(r){t=t?t+` `+r:r;break}}return t},scope:r}}function FF(e,t){let n=null;for(let r of e){let e=r.style(t);e&&(n=n?n+` `+e:e)}return n}function IF(e,t,n,r=0,i=e.length){let a=new LF(r,Array.isArray(t)?t:[t],n);a.highlightRange(e.cursor(),r,i,``,a.highlighters),a.flush(i)}var LF=class{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,this.class=``}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,r,i){let{type:a,from:o,to:s}=e;if(o>=n||s<=t)return;a.isTop&&(i=this.highlighters.filter(e=>!e.scope||e.scope(a)));let c=r,l=RF(e)||NF.empty,u=FF(i,l.tags);if(u&&(c&&(c+=` `),c+=u,l.mode==1&&(r+=(r?` `:``)+u)),this.startSpan(Math.max(t,o),c),l.opaque)return;let d=e.tree&&e.tree.prop(J.mounted);if(d&&d.overlay){let a=e.node.enter(d.overlay[0].from+o,1),l=this.highlighters.filter(e=>!e.scope||e.scope(d.tree.type)),u=e.firstChild();for(let f=0,p=o;;f++){let m=f<d.overlay.length?d.overlay[f]:null,h=m?m.from+o:s,g=Math.max(t,p),_=Math.min(n,h);if(g<_&&u)for(;e.from<_&&(this.highlightRange(e,g,_,r,i),this.startSpan(Math.min(_,e.to),c),!(e.to>=h||!e.nextSibling())););if(!m||h>n)break;p=m.to+o,p>t&&(this.highlightRange(a.cursor(),Math.max(t,m.from+o),Math.min(n,p),``,l),this.startSpan(Math.min(n,p),c))}u&&e.parent()}else if(e.firstChild()){d&&(r=``);do{if(e.to<=t)continue;if(e.from>=n)break;this.highlightRange(e,t,n,r,i),this.startSpan(Math.min(n,e.to),c)}while(e.nextSibling());e.parent()}}};function RF(e){let t=e.type.prop(MF);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}var Y=EF.define,zF=Y(),BF=Y(),VF=Y(BF),HF=Y(BF),UF=Y(),WF=Y(UF),GF=Y(UF),KF=Y(),qF=Y(KF),JF=Y(),YF=Y(),XF=Y(),ZF=Y(XF),QF=Y(),X={comment:zF,lineComment:Y(zF),blockComment:Y(zF),docComment:Y(zF),name:BF,variableName:Y(BF),typeName:VF,tagName:Y(VF),propertyName:HF,attributeName:Y(HF),className:Y(BF),labelName:Y(BF),namespace:Y(BF),macroName:Y(BF),literal:UF,string:WF,docString:Y(WF),character:Y(WF),attributeValue:Y(WF),number:GF,integer:Y(GF),float:Y(GF),bool:Y(UF),regexp:Y(UF),escape:Y(UF),color:Y(UF),url:Y(UF),keyword:JF,self:Y(JF),null:Y(JF),atom:Y(JF),unit:Y(JF),modifier:Y(JF),operatorKeyword:Y(JF),controlKeyword:Y(JF),definitionKeyword:Y(JF),moduleKeyword:Y(JF),operator:YF,derefOperator:Y(YF),arithmeticOperator:Y(YF),logicOperator:Y(YF),bitwiseOperator:Y(YF),compareOperator:Y(YF),updateOperator:Y(YF),definitionOperator:Y(YF),typeOperator:Y(YF),controlOperator:Y(YF),punctuation:XF,separator:Y(XF),bracket:ZF,angleBracket:Y(ZF),squareBracket:Y(ZF),paren:Y(ZF),brace:Y(ZF),content:KF,heading:qF,heading1:Y(qF),heading2:Y(qF),heading3:Y(qF),heading4:Y(qF),heading5:Y(qF),heading6:Y(qF),contentSeparator:Y(KF),list:Y(KF),quote:Y(KF),emphasis:Y(KF),strong:Y(KF),link:Y(KF),monospace:Y(KF),strikethrough:Y(KF),inserted:Y(),deleted:Y(),changed:Y(),invalid:Y(),meta:QF,documentMeta:Y(QF),annotation:Y(QF),processingInstruction:Y(QF),definition:EF.defineModifier(`definition`),constant:EF.defineModifier(`constant`),function:EF.defineModifier(`function`),standard:EF.defineModifier(`standard`),local:EF.defineModifier(`local`),special:EF.defineModifier(`special`)};for(let e in X){let t=X[e];t instanceof EF&&(t.name=e)}PF([{tag:X.link,class:`tok-link`},{tag:X.heading,class:`tok-heading`},{tag:X.emphasis,class:`tok-emphasis`},{tag:X.strong,class:`tok-strong`},{tag:X.keyword,class:`tok-keyword`},{tag:X.atom,class:`tok-atom`},{tag:X.bool,class:`tok-bool`},{tag:X.url,class:`tok-url`},{tag:X.labelName,class:`tok-labelName`},{tag:X.inserted,class:`tok-inserted`},{tag:X.deleted,class:`tok-deleted`},{tag:X.literal,class:`tok-literal`},{tag:X.string,class:`tok-string`},{tag:X.number,class:`tok-number`},{tag:[X.regexp,X.escape,X.special(X.string)],class:`tok-string2`},{tag:X.variableName,class:`tok-variableName`},{tag:X.local(X.variableName),class:`tok-variableName tok-local`},{tag:X.definition(X.variableName),class:`tok-variableName tok-definition`},{tag:X.special(X.variableName),class:`tok-variableName2`},{tag:X.definition(X.propertyName),class:`tok-propertyName tok-definition`},{tag:X.typeName,class:`tok-typeName`},{tag:X.namespace,class:`tok-namespace`},{tag:X.className,class:`tok-className`},{tag:X.macroName,class:`tok-macroName`},{tag:X.propertyName,class:`tok-propertyName`},{tag:X.operator,class:`tok-operator`},{tag:X.comment,class:`tok-comment`},{tag:X.meta,class:`tok-meta`},{tag:X.invalid,class:`tok-invalid`},{tag:X.punctuation,class:`tok-punctuation`}]);var $F=new J;function eI(e){return G.define({combine:e?t=>t.concat(e):void 0})}var tI=new J,nI=class{constructor(e,t,n=[],r=``){this.data=e,this.name=r,gO.prototype.hasOwnProperty(`tree`)||Object.defineProperty(gO.prototype,"tree",{get(){return aI(this)}}),this.parser=t,this.extension=[mI.of(this),gO.languageData.of((e,t,n)=>{let r=rI(e,t,n),i=r.type.prop($F);if(!i)return[];let a=e.facet(i),o=r.type.prop(tI);if(o){let i=r.resolve(t-r.from,n);for(let t of o)if(t.test(i,e)){let n=e.facet(t.facet);return t.type==`replace`?n:n.concat(a)}}return a})].concat(n)}isActiveAt(e,t,n=-1){return rI(e,t,n).type.prop($F)==this.data}findRegions(e){let t=e.facet(mI);if(t?.data==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],r=(e,t)=>{if(e.prop($F)==this.data){n.push({from:t,to:t+e.length});return}let i=e.prop(J.mounted);if(i){if(i.tree.prop($F)==this.data){if(i.overlay)for(let e of i.overlay)n.push({from:e.from+t,to:e.to+t});else n.push({from:t,to:t+e.length});return}else if(i.overlay){let e=n.length;if(r(i.tree,i.overlay[0].from+t),n.length>e)return}}for(let n=0;n<e.children.length;n++){let i=e.children[n];i instanceof VP&&r(i,e.positions[n]+t)}};return r(aI(e),0),n}get allowsNesting(){return!0}};nI.setState=tO.define();function rI(e,t,n){let r=e.facet(mI),i=aI(e).topNode;if(!r||r.allowsNesting)for(let e=i;e;e=e.enter(t,n,BP.ExcludeBuffers|BP.EnterBracketed))e.type.isTop&&(i=e);return i}var iI=class e extends nI{constructor(e,t,n){super(e,t,[],n),this.parser=t}static define(t){let n=eI(t.languageData);return new e(n,t.parser.configure({props:[$F.add(e=>e.isTop?n:void 0)]}),t.name)}configure(t,n){return new e(this.data,this.parser.configure(t),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}};function aI(e){let t=e.field(nI.state,!1);return t?t.tree:VP.empty}var oI=class{constructor(e){this.doc=e,this.cursorPos=0,this.string=``,this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let n=this.cursorPos-this.string.length;return e<n||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}},sI=null,cI=class e{constructor(e,t,n=[],r,i,a,o,s){this.parser=e,this.state=t,this.fragments=n,this.tree=r,this.treeLen=i,this.viewport=a,this.skipped=o,this.scheduleOn=s,this.parse=null,this.tempSkipped=[]}static create(t,n,r){return new e(t,n,[],VP.empty,0,r,[],null)}startParse(){return this.parser.startParse(new oI(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=VP.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{if(typeof e==`number`){let t=Date.now()+e;e=()=>Date.now()>t}for(this.parse||=this.startParse(),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let n=this.parse.advance();if(n)if(this.fragments=this.withoutTempSkipped(cF.addTree(n,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=this.parse.stoppedAt??this.state.doc.length,this.tree=n,this.parse=null,this.treeLen<(t??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(cF.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=sI;sI=this;try{return e()}finally{sI=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=lI(e,t.from,t.to);return e}changes(t,n){let{fragments:r,tree:i,treeLen:a,viewport:o,skipped:s}=this;if(this.takeTree(),!t.empty){let e=[];if(t.iterChangedRanges((t,n,r,i)=>e.push({fromA:t,toA:n,fromB:r,toB:i})),r=cF.applyChanges(r,e),i=VP.empty,a=0,o={from:t.mapPos(o.from,-1),to:t.mapPos(o.to,1)},this.skipped.length){s=[];for(let e of this.skipped){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);n<r&&s.push({from:n,to:r})}}}return new e(this.parser,n,r,i,a,o,s,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let t=0;t<this.skipped.length;t++){let{from:n,to:r}=this.skipped[t];n<e.to&&r>e.from&&(this.fragments=lI(this.fragments,n,r),this.skipped.splice(t--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&=(this.takeTree(),null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends lF{createParse(t,n,r){let i=r[0].from,a=r[r.length-1].to;return{parsedPos:i,advance(){let t=sI;if(t){for(let e of r)t.tempSkipped.push(e);e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=a,new VP(IP.none,[],[],a-i)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return sI}};function lI(e,t,n){return cF.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}var uI=class e{constructor(e){this.context=e,this.tree=e.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(t.changes,t.state),r=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new e(n)}static init(t){let n=Math.min(3e3,t.doc.length),r=cI.create(t.facet(mI).parser,t,{from:0,to:n});return r.work(20,n)||r.takeTree(),new e(r)}};nI.state=PD.define({create:uI.init,update(e,t){for(let e of t.effects)if(e.is(nI.setState))return e.value;return t.startState.facet(mI)==t.state.facet(mI)?e.apply(t):uI.init(t.state)}});var dI=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<`u`&&(dI=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});var fI=typeof navigator<`u`&&navigator.scheduling?.isInputPending?()=>navigator.scheduling.isInputPending():null,pI=zA.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(nI.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(nI.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=dI(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:n,viewport:{to:r}}=this.view,i=n.field(nI.state);if(i.tree==i.context.tree&&i.context.isDone(r+1e5))return;let a=Date.now()+Math.min(this.chunkBudget,100,e&&!fI?Math.max(25,e.timeRemaining()-5):1e9),o=i.context.treeLen<r&&n.doc.length>r+1e3,s=i.context.work(()=>fI&&fI()||Date.now()>a,r+(o?0:1e5));this.chunkBudget-=Date.now()-t,(s||this.chunkBudget<=0)&&(i.context.takeTree(),this.view.dispatch({effects:nI.setState.of(new uI(i.context))})),this.chunkBudget>0&&!(s&&!o)&&this.scheduleWork(),this.checkAsyncSchedule(i.context)}checkAsyncSchedule(e){e.scheduleOn&&=(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(e=>FA(this.view.state,e)).then(()=>this.workScheduled--),null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),mI=G.define({combine(e){return e.length?e[0]:null},enables:e=>[nI.state,pI,q.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]}),hI=class{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}},gI=class e{constructor(e,t,n,r,i,a=void 0){this.name=e,this.alias=t,this.extensions=n,this.filename=r,this.loadFunc=i,this.support=a,this.loading=null}load(){return this.loading||=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e})}static of(t){let{load:n,support:r}=t;if(!n){if(!r)throw RangeError(`Must pass either 'load' or 'support' to LanguageDescription.of`);n=()=>Promise.resolve(r)}return new e(t.name,(t.alias||[]).concat(t.name).map(e=>e.toLowerCase()),t.extensions||[],t.filename,n,r)}static matchFilename(e,t){for(let n of e)if(n.filename&&n.filename.test(t))return n;let n=/\.([^.]+)$/.exec(t);if(n){for(let t of e)if(t.extensions.indexOf(n[1])>-1)return t}return null}static matchLanguageName(e,t,n=!0){t=t.toLowerCase();for(let n of e)if(n.alias.some(e=>e==t))return n;if(n)for(let n of e)for(let e of n.alias){let r=t.indexOf(e);if(r>-1&&(e.length>2||!/\w/.test(t[r-1])&&!/\w/.test(t[r+e.length])))return n}return null}},_I=G.define({combine:e=>{if(!e.length)return` `;let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some(e=>e!=t[0]))throw Error(`Invalid indent unit: `+JSON.stringify(e[0]));return t}}),vI=new J;function yI(e){let t=e.node,n=t.childAfter(t.from),r=t.lastChild;if(!n)return null;let i=e.options.simulateBreak,a=e.state.doc.lineAt(n.from),o=i==null||i<=a.from?a.to:Math.min(a.to,i);for(let e=n.to;;){let i=t.childAfter(e);if(!i||i==r)return null;if(!i.type.isSkipped){if(i.from>=o)return null;let e=/^ */.exec(a.text.slice(n.to-a.from))[0].length;return{from:n.from,to:n.to+e}}e=i.to}}function bI({closing:e,align:t=!0,units:n=1}){return r=>xI(r,t,n,e)}function xI(e,t,n,r,i){let a=e.textAfter,o=a.match(/^\s*/)[0].length,s=r&&a.slice(o,o+r.length)==r||i==e.pos+o,c=t?yI(e):null;return c?s?e.column(c.from):e.column(c.to):e.baseIndent+(s?0:e.unit*n)}var SI=e=>e.baseIndent;function CI({except:e,units:t=1}={}){return n=>{let r=e&&e.test(n.textAfter);return n.baseIndent+(r?0:t*n.unit)}}var wI=G.define(),TI=new J;function EI(e){let t=e.firstChild,n=e.lastChild;return t&&t.to<n.from?{from:t.to,to:n.type.isError?e.to:n.from}:null}var DI=class e{constructor(e,t){this.specs=e;let n;function r(e){let t=HO.newName();return(n||=Object.create(null))[`.`+t]=e,t}let i=typeof t.all==`string`?t.all:t.all?r(t.all):void 0,a=t.scope;this.scope=a instanceof nI?e=>e.prop($F)==a.data:a?e=>e==a:void 0,this.style=PF(e.map(e=>({tag:e.tag,class:e.class||r(Object.assign({},e,{tag:null}))})),{all:i}).style,this.module=n?new HO(n):null,this.themeType=t.themeType}static define(t,n){return new e(t,n||{})}},OI=G.define(),kI=G.define({combine(e){return e.length?[e[0]]:null}});function AI(e){let t=e.facet(OI);return t.length?t:e.facet(kI)}function jI(e,t){let n=[NI],r;return e instanceof DI&&(e.module&&n.push(q.styleModule.of(e.module)),r=e.themeType),t?.fallback?n.push(kI.of(e)):r?n.push(OI.computeN([q.darkTheme],t=>t.facet(q.darkTheme)==(r==`dark`)?[e]:[])):n.push(OI.of(e)),n}var MI=class{constructor(e){this.markCache=Object.create(null),this.tree=aI(e.state),this.decorations=this.buildDeco(e,AI(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=aI(e.state),n=AI(e.state),r=n!=AI(e.startState),{viewport:i}=e.view,a=e.changes.mapPos(this.decoratedTo,1);t.length<i.to&&!r&&t.type==this.tree.type&&a>=i.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=a):(t!=this.tree||e.viewportChanged||r)&&(this.tree=t,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=i.to)}buildDeco(e,t){if(!t||!this.tree.length)return _k.none;let n=new TO;for(let{from:r,to:i}of e.visibleRanges)IF(this.tree,t,(e,t,r)=>{n.add(e,t,this.markCache[r]||(this.markCache[r]=_k.mark({class:r})))},r,i);return n.finish()}},NI=LD.high(zA.fromClass(MI,{decorations:e=>e.decorations}));X.meta,X.link,X.heading,X.emphasis,X.strong,X.strikethrough,X.keyword,X.atom,X.bool,X.url,X.contentSeparator,X.labelName,X.literal,X.inserted,X.string,X.deleted,X.regexp,X.escape,X.string,X.variableName,X.variableName,X.typeName,X.namespace,X.className,X.variableName,X.macroName,X.propertyName,X.comment,X.invalid;var PI=new J,FI=Object.create(null),II=[IP.none],LI=[],RI=Object.create(null),zI=Object.create(null);for(let[e,t]of[[`variable`,`variableName`],[`variable-2`,`variableName.special`],[`string-2`,`string.special`],[`def`,`variableName.definition`],[`tag`,`tagName`],[`attribute`,`attributeName`],[`type`,`typeName`],[`builtin`,`variableName.standard`],[`qualifier`,`modifier`],[`error`,`invalid`],[`header`,`heading`],[`property`,`propertyName`]])zI[e]=VI(FI,t);function BI(e,t){LI.indexOf(e)>-1||(LI.push(e),console.warn(t))}function VI(e,t){let n=[];for(let r of t.split(` `)){let t=[];for(let n of r.split(`.`)){let r=e[n]||X[n];r?typeof r==`function`?t.length?t=t.map(r):BI(n,`Modifier ${n} used at start of tag`):t.length?BI(n,`Tag ${n} used as modifier`):t=Array.isArray(r)?r:[r]:BI(n,`Unknown highlighting tag ${n}`)}for(let e of t)n.push(e)}if(!n.length)return 0;let r=t.replace(/ /g,`_`),i=r+` `+n.map(e=>e.id),a=RI[i];if(a)return a.id;let o=RI[i]=IP.define({id:II.length,name:r,props:[jF({[r]:n})]});return II.push(o),o.id}Zk.RTL,Zk.LTR;var HI=q.theme({"&":{backgroundColor:`#ffffff`,color:`#24292e`},".cm-content":{caretColor:`#0550ae`},".cm-cursor, .cm-dropCursor":{borderLeftColor:`#0550ae`},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:`#b3d7ff`},".cm-gutters":{backgroundColor:`#f6f8fa`,color:`#57606a`,border:`none`}},{dark:!1}),UI=DI.define([{tag:X.string,color:`#0a3069`},{tag:X.number,color:`#0550ae`},{tag:X.bool,color:`#8250df`},{tag:X.null,color:`#cf222e`},{tag:X.keyword,color:`#cf222e`},{tag:X.propertyName,color:`#116329`},{tag:X.punctuation,color:`#57606a`},{tag:X.bracket,color:`#6e7781`}]),WI=class extends hk{constructor(e,t,n){super(),this.annotation=e,this.targetDocumentName=t,this.isGenerating=n}annotation;targetDocumentName;isGenerating;eq(e){let t=qo(this.annotation.body),n=qo(e.annotation.body);return e.annotation.id===this.annotation.id&&n===t&&e.targetDocumentName===this.targetDocumentName&&e.isGenerating===this.isGenerating}toDOM(){let e=document.createElement(`span`);e.className=`reference-preview-widget`,e.style.cssText=`
|
|
49
|
+
display: inline-flex;
|
|
50
|
+
align-items: center;
|
|
51
|
+
margin-left: 4px;
|
|
52
|
+
position: relative;
|
|
53
|
+
`;let t=ns(this.annotation),n=qo(this.annotation.body);e.dataset.widgetAnnotationId=this.annotation.id,e.dataset.widgetMotivation=this.annotation.motivation,e.dataset.widgetResolved=t?`true`:`false`,n&&(e.dataset.widgetBodySource=n),this.targetDocumentName&&(e.dataset.widgetTargetName=this.targetDocumentName),this.isGenerating&&(e.dataset.widgetGenerating=`true`);let r=document.createElement(`button`);if(r.className=`reference-indicator`,r.type=`button`,t)r.innerHTML=`<span aria-hidden="true">🔗</span>`,r.setAttribute(`aria-label`,this.targetDocumentName?`Reference link to ${this.targetDocumentName}`:`Reference link to document`),r.title=this.targetDocumentName?`Links to: ${this.targetDocumentName}`:`Links to document`,r.style.cssText=`
|
|
54
|
+
font-size: 10px;
|
|
55
|
+
cursor: pointer;
|
|
56
|
+
opacity: 0.6;
|
|
57
|
+
transition: opacity 0.2s ease;
|
|
58
|
+
background: none;
|
|
59
|
+
border: none;
|
|
60
|
+
padding: 0;
|
|
61
|
+
margin: 0;
|
|
62
|
+
vertical-align: baseline;
|
|
63
|
+
`;else if(this.isGenerating){if(r.innerHTML=`
|
|
64
|
+
<span style="position: relative; display: inline-flex; align-items: center; justify-content: center;" aria-hidden="true">
|
|
65
|
+
<span style="position: absolute; inset: 0; border-radius: 9999px; background: rgb(250, 204, 21); opacity: 0.75; animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;"></span>
|
|
66
|
+
<span style="position: relative; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 9999px; background: white; box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); border: 2px solid rgb(250, 204, 21);">
|
|
67
|
+
<span style="font-size: 14px;">✨</span>
|
|
68
|
+
</span>
|
|
69
|
+
</span>
|
|
70
|
+
`,r.setAttribute(`aria-label`,`Generating document`),r.setAttribute(`aria-busy`,`true`),r.title=`Generating document...`,r.disabled=!0,r.style.cssText=`
|
|
71
|
+
cursor: default;
|
|
72
|
+
display: inline-flex;
|
|
73
|
+
vertical-align: middle;
|
|
74
|
+
background: none;
|
|
75
|
+
border: none;
|
|
76
|
+
padding: 0;
|
|
77
|
+
margin: 0;
|
|
78
|
+
`,document.documentElement.classList.contains(`dark`)){let e=r.querySelector(`span > span:last-child`);e&&(e.style.background=`rgb(31, 41, 55)`,e.style.borderColor=`rgb(234, 179, 8)`);let t=r.querySelector(`span > span:first-child`);t&&(t.style.background=`rgb(234, 179, 8)`)}}else r.innerHTML=`<span aria-hidden="true">❓</span>`,r.setAttribute(`aria-label`,`Stub reference - click to resolve`),r.title=`Stub reference. Click to resolve.`,r.style.cssText=`
|
|
79
|
+
font-size: 10px;
|
|
80
|
+
cursor: pointer;
|
|
81
|
+
opacity: 0.6;
|
|
82
|
+
transition: opacity 0.2s ease;
|
|
83
|
+
background: none;
|
|
84
|
+
border: none;
|
|
85
|
+
padding: 0;
|
|
86
|
+
margin: 0;
|
|
87
|
+
vertical-align: baseline;
|
|
88
|
+
`;return e.appendChild(r),e}ignoreEvent(e){return e.type===`click`}};function GI(e,t){if(!t||t.trim()===``)return;let n=document.createElement(`div`);n.className=`reference-tooltip`,n.textContent=`\u2192 ${t}`,n.style.cssText=`
|
|
89
|
+
position: absolute;
|
|
90
|
+
bottom: 100%;
|
|
91
|
+
left: 50%;
|
|
92
|
+
transform: translateX(-50%) translateY(-4px);
|
|
93
|
+
padding: 4px 8px;
|
|
94
|
+
background: rgba(0, 0, 0, 0.8);
|
|
95
|
+
color: white;
|
|
96
|
+
border-radius: 4px;
|
|
97
|
+
font-size: 11px;
|
|
98
|
+
white-space: nowrap;
|
|
99
|
+
pointer-events: none;
|
|
100
|
+
z-index: 1000;
|
|
101
|
+
animation: fadeIn 0.2s ease;
|
|
102
|
+
`,e.appendChild(n)}function KI(e){let t=e.querySelector(`.reference-tooltip`);t&&t.remove()}function qI(e){return e?Hs(e)?.render===`pdf`?[`rectangle`]:e.startsWith(`image/`)?[`rectangle`,`circle`,`polygon`]:[]:[]}function JI(e){return e?Hs(e)?.render===`pdf`?`fragment`:e.startsWith(`image/`)?`svg`:`text`:`text`}function YI(e){if(e===`fragment`||e===`text`)return`rectangle`;if(typeof window<`u`){let e=localStorage.getItem(`semiont-toolbar-shape-svg`);if(e&&[`rectangle`,`circle`,`polygon`].includes(e))return e}return`rectangle`}function XI(e,t){e===`svg`&&typeof window<`u`&&localStorage.setItem(`semiont-toolbar-shape-svg`,t)}function ZI(e,t){let n=document.createTreeWalker(t,NodeFilter.SHOW_TEXT),r=``;for(;n.nextNode();)r+=n.currentNode.textContent??``;let i=new Map,a=0,o=0;for(;o<e.length&&a<r.length;)e[o]===r[a]?(i.set(o,a),a++,o++):o++;for(;o<e.length;)i.set(o,a),o++;return i}function QI(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),r=0;for(;n.nextNode();){let e=n.currentNode,i=e.textContent?.length??0;t.push({node:e,start:r,end:r+i}),r+=i}return t}function $I(e,t){let n=0,r=e.length-1;for(;n<=r;){let i=n+r>>>1,a=e[i];if(t<a.start)r=i-1;else if(t>=a.end)n=i+1;else return{node:a.node,localOffset:t-a.start}}return null}function eL(e,t,n){let r=new Map;for(let i of e){let e=t.get(i.offset),a=t.get(i.offset+i.length-1);if(e===void 0||a===void 0)continue;let o=$I(n,e),s=$I(n,a+1);if(!o||!s)continue;let c=document.createRange();c.setStart(o.node,o.localOffset),c.setEnd(s.node,s.localOffset),r.set(i.id,{range:c,annotation:i})}return r}function tL(e){for(let[t,{range:n,annotation:r}]of e){let e=`annotation-${r.type}`;if(n.startContainer===n.endContainer){let i=document.createElement(`span`);i.className=e,i.dataset.annotationId=t,i.dataset.annotationType=r.type;try{n.surroundContents(i)}catch{nL(n,t,r)}continue}nL(n,t,r)}}function nL(e,t,n){let r=`annotation-${n.type}`,i=document.createTreeWalker(e.commonAncestorContainer,NodeFilter.SHOW_TEXT),a=[];for(;i.nextNode();){let t=i.currentNode;e.intersectsNode(t)&&a.push(t)}for(let i of a){let a=document.createRange();a.selectNodeContents(i),i===e.startContainer&&a.setStart(i,e.startOffset),i===e.endContainer&&a.setEnd(i,e.endOffset);let o=document.createElement(`span`);o.className=r,o.dataset.annotationId=t,o.dataset.annotationType=n.type;try{a.surroundContents(o)}catch{}}}function rL(e){let t=e.querySelectorAll(`[data-annotation-id]`);for(let e of t){let t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e),t.normalize()}}}function iL(e){return e.map(e=>{let t=Yo(e.target),n=Wo(t),r=n?.start??0,i=n?.end??0,a=Object.values(zE).find(t=>t.matchesAnnotation(e))?.internalType||`highlight`;return{id:e.id,exact:rs(t),offset:r,length:i-r,type:a,source:qo(e.body)}})}function aL(e){if(!e)return`📄`;let t=Bs(e);if(t.startsWith(`image/`))return`🖼️`;switch(t){case`text/markdown`:return`📝`;case`text/html`:return`🌐`;default:return`📄`}}var oL={parse(e){if(typeof e!=`string`)throw Error(`URL must be a string`);let t;try{t=new URL(e)}catch{throw Error(`Invalid image URL`)}if(t.hostname!==`localhost`&&t.protocol!==`https:`)throw Error(`External images must use HTTPS`);let n=[`javascript:`,`data:text/html`,`<script`,`onerror=`,`onload=`,`onclick=`],r=e.toLowerCase();if(n.some(e=>r.includes(e)))throw Error(`Invalid or potentially unsafe image URL`);let i=[`.jpg`,`.jpeg`,`.png`,`.gif`,`.webp`,`.svg`,`.ico`].some(e=>r.includes(e)),a=r.includes(`googleusercontent.com`)||r.includes(`avatars.githubusercontent.com`);if(!i&&!a)throw Error(`URL must point to an image file`);return e},safeParse(e){try{return{success:!0,data:this.parse(e)}}catch(e){return{success:!1,error:e instanceof Error?e.message:`Invalid image URL`}}}};function sL(e){try{let t=oL.safeParse(e);if(!t.success)return console.warn(`Invalid image URL:`,t.error),null;let n=new URL(e);return`${n.protocol}//${n.hostname}${n.pathname}${n.search}`}catch(e){return console.error(`Error sanitizing image URL:`,e),null}}function cL(e){let[t]=(0,u.useState)(e);return(0,u.useEffect)(()=>()=>t.dispose(),[t]),t}function lL(e){if(!e||e<=0)return null;let t=Math.floor(e/36e5),n=Math.floor(e%36e5/6e4),r=Math.floor(e%6e4/1e3);return t>0?`${t}h ${n}m`:n>0?`${n}m`:r>30?`1m`:`Less than 1m`}var uL=typeof window<`u`&&navigator.platform.toUpperCase().indexOf(`MAC`)>=0;function dL(e){let t=(0,u.useRef)(e);t.current=e;let n=(0,u.useCallback)(e=>{if(!e.key)return;let n=e.target;if(n.tagName===`INPUT`||n.tagName===`TEXTAREA`||n.contentEditable===`true`)return;let r=t.current.filter(e=>e.enabled!==!1);for(let t of r){if(e.key.toLowerCase()!==t.key.toLowerCase())continue;let n=uL?e.metaKey:e.ctrlKey;if(!(t.ctrlOrCmd&&!n)&&!(!t.ctrlOrCmd&&n)&&!(t.shift&&!e.shiftKey)&&!(!t.shift&&e.shiftKey)&&!(t.alt&&!e.altKey)&&!(!t.alt&&e.altKey)){e.preventDefault(),e.stopPropagation(),t.handler(e);break}}},[]);(0,u.useEffect)(()=>(window.addEventListener(`keydown`,n),()=>{window.removeEventListener(`keydown`,n)}),[n])}function fL(e,t,n=300){let r=(0,u.useRef)(0),i=(0,u.useRef)(t);i.current=t;let a=(0,u.useCallback)(t=>{if(t.key!==e)return;let a=Date.now();a-r.current<n?(i.current(),r.current=0):r.current=a},[e,n]);(0,u.useEffect)(()=>(window.addEventListener(`keydown`,a),()=>{window.removeEventListener(`keydown`,a)}),[a])}function pL(){let[e,t]=(0,u.useState)(()=>typeof window<`u`?localStorage.getItem(`showLineNumbers`)===`true`:!1);return{showLineNumbers:e,toggleLineNumbers:(0,u.useCallback)(()=>{let n=!e;t(n),typeof window<`u`&&localStorage.setItem(`showLineNumbers`,n.toString())},[e])}}function Z(e){let[t,n]=(0,u.useState)(()=>{if(!e)return;let t=e.getValue;return typeof t==`function`?t.call(e):void 0});return(0,u.useEffect)(()=>{if(!e)return;let t=e.subscribe(n);return()=>t.unsubscribe()},[e]),t}function mL(e,t=150){let n=Z(kg().activeSession$),r=(0,u.useRef)(null),i=(0,u.useRef)(null),a=(0,u.useCallback)(()=>{r.current!==e&&(i.current!==null&&clearTimeout(i.current),i.current=setTimeout(()=>{i.current=null,r.current=e,n?.client.beckon.hover(e)},t))},[e,t,n]),o=(0,u.useCallback)(()=>{i.current!==null&&(clearTimeout(i.current),i.current=null),r.current!==null&&(r.current=null,n?.client.beckon.hover(null))},[n]);return(0,u.useEffect)(()=>()=>{i.current!==null&&(clearTimeout(i.current),i.current=null)},[]),{onMouseEnter:a,onMouseLeave:o}}function hL(){let[e,t]=(0,u.useState)(()=>{if(typeof window<`u`){let e=localStorage.getItem(`hoverDelayMs`);return e?Number(e):150}return 150});return{hoverDelayMs:e,setHoverDelayMs:(0,u.useCallback)(e=>{t(e),typeof window<`u`&&localStorage.setItem(`hoverDelayMs`,e.toString())},[])}}function gL(){let e=kg();return(0,u.useCallback)((t,n)=>{let r=setTimeout(()=>{console.warn(`[Observable Navigation] No handler cancelled nav:external fallback. Falling back to window.location.href. For better UX, subscribe to this event in your app, call cancelFallback(), and use client-side routing.`),window.location.href=t},10);e.emit(`nav:external`,{url:t,resourceId:n?.resourceId,cancelFallback:()=>clearTimeout(r)})},[e])}function _L({defaultWidth:e=384,minWidth:t=256,maxWidth:n=800,storageKey:r=`semiont-panel-width`}={}){let[i,a]=(0,u.useState)(e),o=(0,u.useRef)(!1);return(0,u.useEffect)(()=>{if(typeof window>`u`)return;let e=localStorage.getItem(r);e&&a(Math.max(t,Math.min(n,parseInt(e,10))))},[]),(0,u.useEffect)(()=>{o.current&&localStorage.setItem(r,i.toString())},[i,r]),{width:i,setWidth:e=>{let r=Math.max(t,Math.min(n,e));o.current=!0,a(r)},minWidth:t,maxWidth:n}}function vL(e,t={}){let{orientation:n=`horizontal`,loop:r=!0,cols:i=1}=t,a=(0,u.useRef)(null),o=(0,u.useRef)(0),s=(0,u.useCallback)(()=>a.current?Array.from(a.current.querySelectorAll(`[role="button"]:not([disabled]), button:not([disabled]), [tabindex]:not([tabindex="-1"])`)):[],[]),c=(0,u.useCallback)(e=>{let t=s();if(t.length===0)return;let n=e;n=r?(e%t.length+t.length)%t.length:Math.max(0,Math.min(e,t.length-1)),t.forEach((e,t)=>{e.setAttribute(`tabindex`,t===n?`0`:`-1`)}),t[n]?.focus(),o.current=n},[s,r]),l=(0,u.useCallback)(e=>{let t=s();if(t.length===0)return;let r=o.current,a=r;switch(e.key){case`ArrowRight`:(n===`horizontal`||n===`grid`)&&(e.preventDefault(),a=r+1);break;case`ArrowLeft`:(n===`horizontal`||n===`grid`)&&(e.preventDefault(),a=r-1);break;case`ArrowDown`:n===`vertical`?(e.preventDefault(),a=r+1):n===`grid`&&(e.preventDefault(),a=r+i);break;case`ArrowUp`:n===`vertical`?(e.preventDefault(),a=r-1):n===`grid`&&(e.preventDefault(),a=r-i);break;case`Home`:e.preventDefault(),a=0;break;case`End`:e.preventDefault(),a=t.length-1;break;default:return}c(a)},[n,i,s,c]);return(0,u.useEffect)(()=>{let e=s();if(e.length===0)return;e.forEach((e,t)=>{e.setAttribute(`tabindex`,t===0?`0`:`-1`)});let t=e=>()=>{o.current=e,s().forEach((t,n)=>{t.setAttribute(`tabindex`,n===e?`0`:`-1`)})},n=e.map((e,n)=>{let r=t(n);return e.addEventListener(`click`,r),r});return()=>{e.forEach((e,t)=>{let r=n[t];r&&e.removeEventListener(`click`,r)})}},[e,s]),{containerRef:a,handleKeyDown:l,focusItem:c}}function yL(){let e=Z(kg().activeSession$);Z(e?.token$);let t=e?.expiresAt??null,[n,r]=(0,u.useState)(null),[i,a]=(0,u.useState)(!1);return(0,u.useEffect)(()=>{if(!t){r(null),a(!1);return}let e=()=>{let e=t.getTime()-Date.now();r(e>0?e:0),a(e<300*1e3&&e>0)};e();let n=setInterval(e,1e3);return()=>clearInterval(n)},[t]),{timeRemaining:n,isExpiringSoon:i}}var bL=(0,u.createContext)(null);function xL({children:e}){let[t,n]=(0,u.useState)(()=>typeof window<`u`&&localStorage.getItem(`theme`)||`system`),[r,i]=(0,u.useState)(()=>typeof window<`u`&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`),a=t===`system`?r:t;return(0,u.useEffect)(()=>{window.document.documentElement.setAttribute(`data-theme`,a)},[a]),(0,u.useEffect)(()=>{let e=window.matchMedia(`(prefers-color-scheme: dark)`),t=e=>{i(e.matches?`dark`:`light`)};return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]),(0,F.jsx)(bL.Provider,{value:{theme:t,setTheme:e=>{n(e),typeof window<`u`&&localStorage.setItem(`theme`,e)},resolvedTheme:a,systemTheme:r},children:e})}function SL(){let e=(0,u.useContext)(bL);if(!e)throw Error(`useTheme must be used within a ThemeProvider`);return e}function CL(){let[e,t]=(0,u.useState)(!1),n=(0,u.useRef)(null),r=(0,u.useCallback)(()=>{t(e=>!e)},[]),i=(0,u.useCallback)(()=>{t(!0)},[]),a=(0,u.useCallback)(()=>{t(!1)},[]);return(0,u.useEffect)(()=>{function t(e){n.current&&!n.current.contains(e.target)&&a()}if(e)return document.addEventListener(`mousedown`,t),()=>document.removeEventListener(`mousedown`,t)},[e,a]),(0,u.useEffect)(()=>{function t(e){e.key===`Escape`&&a()}if(e)return document.addEventListener(`keydown`,t),()=>document.removeEventListener(`keydown`,t)},[e,a]),{isOpen:e,toggle:r,open:i,close:a,dropdownRef:n}}function wL(e,t,n,r=!0){let i=r?ds(n)||`text/plain`:``,[a,o]=(0,u.useState)(``),[s,c]=(0,u.useState)(!1),[l,d]=(0,u.useState)(null);return(0,u.useEffect)(()=>{if(!e||!r||!i)return;let n=!1;return c(!0),d(null),e.browse.resourceRepresentation(t).then(({data:e,contentType:t})=>{n||(o(Fs(e,t)),c(!1))}).catch(e=>{n||(d(e instanceof Error?e:Error(String(e))),c(!1))}),()=>{n=!0}},[e,t,i,r]),{content:a,loading:s,error:l}}function TL(){let e=Z(kg().activeSession$)?.client,[t,n]=(0,u.useState)(null),[r,i]=(0,u.useState)(!1),[a,o]=(0,u.useState)(null);return{context:t,loading:r,error:a,gather:(0,u.useCallback)(async(t,r)=>{if(e){i(!0),o(null);try{n(await e.gather.resource(To(t),r))}catch(e){o(e instanceof Error?e:Error(String(e)))}finally{i(!1)}}},[e]),reset:(0,u.useCallback)(()=>{n(null),o(null),i(!1)},[])}}function EL(e){let t={highlights:[],references:[],assessments:[],comments:[],tags:[]};for(let n of e)Xo(n)?t.highlights.push(n):$o(n)?t.comments.push(n):Qo(n)?t.assessments.push(n):Zo(n)?t.references.push(n):es(n)&&t.tags.push(n);return t}function DL(e,t){let[n,r]=(0,u.useState)(void 0),[i,a]=(0,u.useState)(!0);return(0,u.useEffect)(()=>{if(!e||!t){a(!1);return}let n=!1;a(!0),e.auth.mediaToken(t).then(({token:e})=>{n||(r(e),a(!1))}).catch(()=>{n||a(!1)});let i=setInterval(()=>{e.auth.mediaToken(t).then(({token:e})=>{n||r(e)}).catch(()=>{})},240*1e3);return()=>{n=!0,clearInterval(i)}},[e,t]),{token:n,loading:i}}function OL(e,t){let n=(0,u.useRef)(t);(0,u.useEffect)(()=>{n.current=t});let r=(0,u.useMemo)(()=>Object.keys(t).sort(),[Object.keys(t).sort().join(`,`)]);(0,u.useEffect)(()=>{if(!e)return;let t=[];for(let i of r){let r=i;t.push(e.subscribe(r,e=>{let t=n.current[r];t&&t(e)}))}return()=>{for(let e of t)e()}},[r,e])}var kL=`annotateMode`,AL=`semiont-toolbar-click`,jL=`semiont-toolbar-selection`;function ML(e=`text`){let[t,n]=(0,u.useState)(()=>typeof window<`u`?localStorage.getItem(kL)===`true`:!1),r=(0,u.useCallback)(e=>{n(e),typeof window<`u`&&localStorage.setItem(kL,e.toString())},[]),[i,a]=(0,u.useState)(()=>{if(typeof window<`u`){let e=localStorage.getItem(AL);if(e&&[`detail`,`follow`,`jsonld`,`deleting`].includes(e))return e}return`detail`}),o=(0,u.useCallback)(e=>{a(e),typeof window<`u`&&localStorage.setItem(AL,e)},[]),[s,c]=(0,u.useState)(()=>{if(typeof window<`u`){let e=localStorage.getItem(jL);if(e===`null`)return null;if(e&&[`linking`,`highlighting`,`assessing`,`commenting`,`tagging`].includes(e))return e}return`linking`}),l=(0,u.useCallback)(e=>{c(e),typeof window<`u`&&localStorage.setItem(jL,e===null?`null`:e)},[]),[d,f]=(0,u.useState)(()=>YI(e));return(0,u.useEffect)(()=>{f(YI(e))},[e]),{annotateMode:t,setAnnotateMode:r,clickAction:i,setClickAction:o,selectionMotivation:s,setSelectionMotivation:l,shape:d,setShape:(0,u.useCallback)(t=>{f(t),XI(e,t)},[e])}}(0,u.createContext)(void 0);function NL(e,t){let n=kg(),r=Z(n.activeSession$),i=(0,u.useRef)(t);(0,u.useEffect)(()=>{i.current=t}),(0,u.useEffect)(()=>{let t=[];return t.push(n.on(e,e=>i.current(e))),r&&t.push(r.subscribe(e,e=>i.current(e))),()=>{for(let e of t)e()}},[e,n,r])}function PL(e){let t=kg(),n=Z(t.activeSession$),r=(0,u.useRef)(e);(0,u.useEffect)(()=>{r.current=e});let i=(0,u.useMemo)(()=>Object.keys(e).sort(),[Object.keys(e).sort().join(`,`)]);(0,u.useEffect)(()=>{let e=[];for(let a of i){let i=a,o=e=>{let t=r.current[i];t&&t(e)};e.push(t.on(i,o)),n&&e.push(n.subscribe(i,o))}return()=>{for(let t of e)t()}},[i,t,n])}var FL=(0,u.createContext)(null);function IL(){return(0,u.useContext)(FL)||{announce:()=>{}}}function LL({children:e}){let[t,n]=(0,u.useState)(``),[r,i]=(0,u.useState)(``),a=(0,u.useCallback)((e,t=`polite`)=>{t===`assertive`?(i(e),setTimeout(()=>i(``),1e3)):(n(e),setTimeout(()=>n(``),1e3))},[]);return(0,F.jsxs)(FL.Provider,{value:{announce:a},children:[e,(0,F.jsx)(`div`,{role:`status`,"aria-live":`polite`,"aria-atomic":`true`,className:`semiont-sr-only`,children:t}),(0,F.jsx)(`div`,{role:`alert`,"aria-live":`assertive`,"aria-atomic":`true`,className:`semiont-sr-only`,children:r})]})}function RL(){let{announce:e}=IL();return{announceResourceLoading:(0,u.useCallback)(t=>{e(t?`Loading ${t}...`:`Loading resource...`,`polite`)},[e]),announceResourceLoaded:(0,u.useCallback)(t=>{e(`${t} loaded successfully`,`polite`)},[e]),announceResourceLoadError:(0,u.useCallback)(t=>{e(t?`Failed to load ${t}`:`Failed to load resource`,`assertive`)},[e]),announceResourceUpdating:(0,u.useCallback)(t=>{e(`Updating ${t}...`,`polite`)},[e])}}function zL(){let{announce:e}=IL();return{announceFormSubmitting:(0,u.useCallback)(()=>{e(`Submitting form...`,`polite`)},[e]),announceFormSuccess:(0,u.useCallback)(t=>{e(t||`Form submitted successfully`,`polite`)},[e]),announceFormError:(0,u.useCallback)(t=>{e(t||`Form submission failed. Please check your entries and try again.`,`assertive`)},[e]),announceFormValidationError:(0,u.useCallback)(t=>{e(t===1?`There is 1 field with an error`:`There are ${t} fields with errors`,`assertive`)},[e])}}function BL(){let{announce:e}=IL();return{announceLanguageChanging:(0,u.useCallback)(t=>{e(`Changing language to ${t}...`,`polite`)},[e]),announceLanguageChanged:(0,u.useCallback)(t=>{e(`Language changed to ${t}`,`polite`)},[e])}}var VL=(0,u.createContext)(void 0);function HL({children:e}){let[t,n]=(0,u.useState)(new Set),{announce:r}=IL(),i=Z(kg().activeSession$)?.client,a=(0,u.useCallback)(async(e,t,a,o=[])=>{if(!i)throw Error(`Not authenticated`);try{let s={motivation:t,target:{source:e,selector:a},body:o},c=await i.mark.annotation(s);return c.annotationId&&(n(e=>new Set(e).add(c.annotationId)),setTimeout(()=>{n(e=>{let t=new Set(e);return t.delete(c.annotationId),t})},6e3),r(`Annotation created`,`polite`)),c.annotationId}catch(e){throw console.error(`Failed to create annotation:`,e),r(`Failed to create annotation`,`assertive`),e}},[i,r]),o=(0,u.useCallback)(e=>{n(t=>{let n=new Set(t);return n.delete(e),n})},[]),s=(0,u.useCallback)(e=>{n(t=>new Set(t).add(e)),setTimeout(()=>{n(t=>{let n=new Set(t);return n.delete(e),n})},6e3)},[]),c=(0,u.useMemo)(()=>({newAnnotationIds:t,markAnnotation:a,clearNewAnnotationId:o,triggerSparkleAnimation:s}),[t,a,o,s]);return(0,F.jsx)(VL.Provider,{value:c,children:e})}function UL(){let e=(0,u.useContext)(VL);if(!e)throw Error(`useResourceAnnotations must be used within ResourceAnnotationsProvider`);return e}var WL=class{constructor(e,t,n,r){this.state=e,this.pos=t,this.explicit=n,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=aI(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),r=t.text.slice(n-t.from,this.pos-t.from),i=r.search(YL(e,!1));return i<0?null:{from:n+i,to:this.pos,text:r.slice(i)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,n){e==`abort`&&this.abortListeners&&(this.abortListeners.push(t),n&&n.onDocChange&&(this.abortOnDocChange=!0))}};function GL(e){let t=Object.keys(e).join(``),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,``)),`[${n?`\\w`:``}${t.replace(/[^\w\s]/g,`\\$&`)}]`}function KL(e){let t=Object.create(null),n=Object.create(null);for(let{label:r}of e){t[r[0]]=!0;for(let e=1;e<r.length;e++)n[r[e]]=!0}let r=GL(t)+GL(n)+`*$`;return[RegExp(`^`+r),new RegExp(r)]}function qL(e){let t=e.map(e=>typeof e==`string`?{label:e}:e),[n,r]=t.every(e=>/^\w+$/.test(e.label))?[/\w*$/,/\w+$/]:KL(t);return e=>{let i=e.matchBefore(r);return i||e.explicit?{from:i?i.from:e.pos,options:t,validFor:n}:null}}function JL(e,t){return n=>{for(let t=aI(n.state).resolveInner(n.pos,-1);t;t=t.parent){if(e.indexOf(t.name)>-1)return null;if(t.type.isTop)break}return t(n)}}function YL(e,t){let{source:n}=e,r=t&&n[0]!=`^`,i=n[n.length-1]!=`$`;return!r&&!i?e:RegExp(`${r?`^`:``}(?:${n})${i?`$`:``}`,e.flags??(e.ignoreCase?`i`:``))}var XL=QD.define();typeof navigator==`object`&&navigator.platform;var ZL=q.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:`monospace`,whiteSpace:`nowrap`,overflow:`hidden auto`,maxWidth_fallback:`700px`,maxWidth:`min(700px, 95vw)`,minWidth:`250px`,maxHeight:`10em`,height:`100%`,listStyle:`none`,margin:0,padding:0,"& > li, & > completion-section":{padding:`1px 3px`,lineHeight:1.2},"& > li":{overflowX:`hidden`,textOverflow:`ellipsis`,cursor:`pointer`},"& > completion-section":{display:`list-item`,borderBottom:`1px solid silver`,paddingLeft:`0.5em`,opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:`#17c`,color:`white`},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:`#777`},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:`#347`,color:`white`},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:`#444`},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:`"···"`,opacity:.5,display:`block`,textAlign:`center`,cursor:`pointer`},".cm-tooltip.cm-completionInfo":{position:`absolute`,padding:`3px 9px`,width:`max-content`,maxWidth:`400px`,boxSizing:`border-box`,whiteSpace:`pre-line`},".cm-completionInfo.cm-completionInfo-left":{right:`100%`},".cm-completionInfo.cm-completionInfo-right":{left:`100%`},".cm-completionInfo.cm-completionInfo-left-narrow":{right:`30px`},".cm-completionInfo.cm-completionInfo-right-narrow":{left:`30px`},"&light .cm-snippetField":{backgroundColor:`#00000022`},"&dark .cm-snippetField":{backgroundColor:`#ffffff22`},".cm-snippetFieldPosition":{verticalAlign:`text-top`,width:0,height:`1.15em`,display:`inline-block`,margin:`0 -0.7px -.7em`,borderLeft:`1.4px dotted #888`},".cm-completionMatchedText":{textDecoration:`underline`},".cm-completionDetail":{marginLeft:`0.5em`,fontStyle:`italic`},".cm-completionIcon":{fontSize:`90%`,width:`.8em`,display:`inline-block`,textAlign:`center`,paddingRight:`.6em`,opacity:`0.6`,boxSizing:`content-box`},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:`'ƒ'`}},".cm-completionIcon-class":{"&:after":{content:`'○'`}},".cm-completionIcon-interface":{"&:after":{content:`'◌'`}},".cm-completionIcon-variable":{"&:after":{content:`'𝑥'`}},".cm-completionIcon-constant":{"&:after":{content:`'𝐶'`}},".cm-completionIcon-type":{"&:after":{content:`'𝑡'`}},".cm-completionIcon-enum":{"&:after":{content:`'∪'`}},".cm-completionIcon-property":{"&:after":{content:`'□'`}},".cm-completionIcon-keyword":{"&:after":{content:`'🔑︎'`}},".cm-completionIcon-namespace":{"&:after":{content:`'▢'`}},".cm-completionIcon-text":{"&:after":{content:`'abc'`,fontSize:`50%`,verticalAlign:`middle`}}}),QL=class{constructor(e,t,n,r){this.field=e,this.line=t,this.from=n,this.to=r}},$L=class e{constructor(e,t,n){this.field=e,this.from=t,this.to=n}map(t){let n=t.mapPos(this.from,-1,gD.TrackDel),r=t.mapPos(this.to,1,gD.TrackDel);return n==null||r==null?null:new e(this.field,n,r)}},eR=class e{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let n=[],r=[t],i=e.doc.lineAt(t),a=/^\s*/.exec(i.text)[0];for(let i of this.lines){if(n.length){let n=a,o=/^\t*/.exec(i)[0].length;for(let t=0;t<o;t++)n+=e.facet(_I);r.push(t+n.length-o),i=n+i.slice(o)}n.push(i),t+=i.length+1}return{text:n,ranges:this.fieldPositions.map(e=>new $L(e.field,r[e.line]+e.from,r[e.line]+e.to))}}static parse(t){let n=[],r=[],i=[],a;for(let e of t.split(/\r\n?|\n/)){for(;a=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(e);){let t=a[1]?+a[1]:null,o=a[2]||a[3]||``,s=-1;t===0&&(t=1e9);let c=o.replace(/\\[{}]/g,e=>e[1]);for(let e=0;e<n.length;e++)(t==null?c&&n[e].name==c:n[e].seq==t)&&(s=e);if(s<0){let e=0;for(;e<n.length&&(t==null||n[e].seq!=null&&n[e].seq<t);)e++;n.splice(e,0,{seq:t,name:c}),s=e;for(let e of i)e.field>=s&&e.field++}for(let e of i)if(e.line==r.length&&e.from>a.index){let t=a[2]?3+(a[1]||``).length:2;e.from-=t,e.to-=t}i.push(new QL(s,r.length,a.index,a.index+c.length)),e=e.slice(0,a.index)+o+e.slice(a.index+a[0].length)}e=e.replace(/\\([{}])/g,(e,t,n)=>{for(let e of i)e.line==r.length&&e.from>n&&(e.from--,e.to--);return t}),r.push(e)}return new e(r,i)}},tR=_k.widget({widget:new class extends hk{toDOM(){let e=document.createElement(`span`);return e.className=`cm-snippetFieldPosition`,e}ignoreEvent(){return!1}}}),nR=_k.mark({class:`cm-snippetField`}),rR=class e{constructor(e,t){this.ranges=e,this.active=t,this.deco=_k.set(e.map(e=>(e.from==e.to?tR:nR).range(e.from,e.to)),!0)}map(t){let n=[];for(let e of this.ranges){let r=e.map(t);if(!r)return null;n.push(r)}return new e(n,this.active)}selectionInsideField(e){return e.ranges.every(e=>this.ranges.some(t=>t.field==this.active&&t.from<=e.from&&t.to>=e.to))}},iR=tO.define({map(e,t){return e&&e.map(t)}}),aR=tO.define(),oR=PD.define({create(){return null},update(e,t){for(let n of t.effects){if(n.is(iR))return n.value;if(n.is(aR)&&e)return new rR(e.ranges,n.value)}return e&&t.docChanged&&(e=e.map(t.changes)),e&&t.selection&&!e.selectionInsideField(t.selection)&&(e=null),e},provide:e=>q.decorations.from(e,e=>e?e.deco:_k.none)});function sR(e,t){return W.create(e.filter(e=>e.field==t).map(e=>W.range(e.from,e.to)))}function cR(e){let t=eR.parse(e);return(e,n,r,i)=>{let{text:a,ranges:o}=t.instantiate(e.state,r),{main:s}=e.state.selection,c={changes:{from:r,to:i==s.from?s.to:i,insert:$E.of(a)},scrollIntoView:!0,annotations:n?[XL.of(n),nO.userEvent.of(`input.complete`)]:void 0};if(o.length&&(c.selection=sR(o,0)),o.some(e=>e.field>0)){let t=new rR(o,0),n=c.effects=[iR.of(t)];e.state.field(oR,!1)===void 0&&n.push(tO.appendConfig.of([oR,fR,mR,ZL]))}e.dispatch(e.state.update(c))}}function lR(e){return({state:t,dispatch:n})=>{let r=t.field(oR,!1);if(!r||e<0&&r.active==0)return!1;let i=r.active+e,a=e>0&&!r.ranges.some(t=>t.field==i+e);return n(t.update({selection:sR(r.ranges,i),effects:iR.of(a?null:new rR(r.ranges,i)),scrollIntoView:!0})),!0}}var uR=[{key:`Tab`,run:lR(1),shift:lR(-1)},{key:`Escape`,run:({state:e,dispatch:t})=>e.field(oR,!1)?(t(e.update({effects:iR.of(null)})),!0):!1}],dR=G.define({combine(e){return e.length?e[0]:uR}}),fR=LD.highest(nP.compute([dR],e=>e.facet(dR)));function pR(e,t){return{...t,apply:cR(e)}}var mR=q.domEventHandlers({mousedown(e,t){let n=t.state.field(oR,!1),r;if(!n||(r=t.posAtCoords({x:e.clientX,y:e.clientY}))==null)return!1;let i=n.ranges.find(e=>e.from<=r&&e.to>=r);return!i||i.field==n.active?!1:(t.dispatch({selection:sR(n.ranges,i.field),effects:iR.of(n.ranges.some(e=>e.field>i.field)?new rR(n.ranges,i.field):null),scrollIntoView:!0}),!0)}}),hR=new class extends vO{};hR.startSide=1,hR.endSide=-1,typeof navigator==`object`&&navigator.userAgent;var gR=class e{static create(t,n,r,i,a){return new e(t,n,r,i+(i<<8)+t+(n<<4)|0,a,[],[])}constructor(e,t,n,r,i,a,o){this.type=e,this.value=t,this.from=n,this.hash=r,this.end=i,this.children=a,this.positions=o,this.hashProp=[[J.contextHash,r]]}addChild(e,t){e.prop(J.contextHash)!=this.hash&&(e=new VP(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(t)}toTree(e,t=this.end){let n=this.children.length-1;return n>=0&&(t=Math.max(t,this.positions[n]+this.children[n].length+this.from)),new VP(e.types[this.type],this.children,this.positions,t-this.from).balance({makeTree:(e,t,n)=>new VP(IP.none,e,t,n,this.hashProp)})}},Q;(function(e){e[e.Document=1]=`Document`,e[e.CodeBlock=2]=`CodeBlock`,e[e.FencedCode=3]=`FencedCode`,e[e.Blockquote=4]=`Blockquote`,e[e.HorizontalRule=5]=`HorizontalRule`,e[e.BulletList=6]=`BulletList`,e[e.OrderedList=7]=`OrderedList`,e[e.ListItem=8]=`ListItem`,e[e.ATXHeading1=9]=`ATXHeading1`,e[e.ATXHeading2=10]=`ATXHeading2`,e[e.ATXHeading3=11]=`ATXHeading3`,e[e.ATXHeading4=12]=`ATXHeading4`,e[e.ATXHeading5=13]=`ATXHeading5`,e[e.ATXHeading6=14]=`ATXHeading6`,e[e.SetextHeading1=15]=`SetextHeading1`,e[e.SetextHeading2=16]=`SetextHeading2`,e[e.HTMLBlock=17]=`HTMLBlock`,e[e.LinkReference=18]=`LinkReference`,e[e.Paragraph=19]=`Paragraph`,e[e.CommentBlock=20]=`CommentBlock`,e[e.ProcessingInstructionBlock=21]=`ProcessingInstructionBlock`,e[e.Escape=22]=`Escape`,e[e.Entity=23]=`Entity`,e[e.HardBreak=24]=`HardBreak`,e[e.Emphasis=25]=`Emphasis`,e[e.StrongEmphasis=26]=`StrongEmphasis`,e[e.Link=27]=`Link`,e[e.Image=28]=`Image`,e[e.InlineCode=29]=`InlineCode`,e[e.HTMLTag=30]=`HTMLTag`,e[e.Comment=31]=`Comment`,e[e.ProcessingInstruction=32]=`ProcessingInstruction`,e[e.Autolink=33]=`Autolink`,e[e.HeaderMark=34]=`HeaderMark`,e[e.QuoteMark=35]=`QuoteMark`,e[e.ListMark=36]=`ListMark`,e[e.LinkMark=37]=`LinkMark`,e[e.EmphasisMark=38]=`EmphasisMark`,e[e.CodeMark=39]=`CodeMark`,e[e.CodeText=40]=`CodeText`,e[e.CodeInfo=41]=`CodeInfo`,e[e.LinkTitle=42]=`LinkTitle`,e[e.LinkLabel=43]=`LinkLabel`,e[e.URL=44]=`URL`})(Q||={});var _R=class{constructor(e,t){this.start=e,this.content=t,this.marks=[],this.parsers=[]}},vR=class{constructor(){this.text=``,this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return SR(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,t=0,n=0){for(let r=t;r<e;r++)n+=this.text.charCodeAt(r)==9?4-n%4:1;return n}findColumn(e){let t=0;for(let n=0;t<this.text.length&&n<e;t++)n+=this.text.charCodeAt(t)==9?4-n%4:1;return t}scrub(){if(!this.baseIndent)return this.text;let e=``;for(let t=0;t<this.basePos;t++)e+=` `;return e+this.text.slice(this.basePos)}};function yR(e,t,n){if(n.pos==n.text.length||e!=t.block&&n.indent>=t.stack[n.depth+1].value+n.baseIndent)return!0;if(n.indent>=n.baseIndent+4)return!1;let r=(e.type==Q.OrderedList?kR:OR)(n,t,!1);return r>0&&(e.type!=Q.BulletList||ER(n,t,!1)<0)&&n.text.charCodeAt(n.pos+r-1)==e.value}var bR={[Q.Blockquote](e,t,n){return n.next==62?(n.markers.push(rz(Q.QuoteMark,t.lineStart+n.pos,t.lineStart+n.pos+1)),n.moveBase(n.pos+(xR(n.text.charCodeAt(n.pos+1))?2:1)),e.end=t.lineStart+n.text.length,!0):!1},[Q.ListItem](e,t,n){return n.indent<n.baseIndent+e.value&&n.next>-1?!1:(n.moveBaseColumn(n.baseIndent+e.value),!0)},[Q.OrderedList]:yR,[Q.BulletList]:yR,[Q.Document](){return!0}};function xR(e){return e==32||e==9||e==10||e==13}function SR(e,t=0){for(;t<e.length&&xR(e.charCodeAt(t));)t++;return t}function CR(e,t,n){for(;t>n&&xR(e.charCodeAt(t-1));)t--;return t}function wR(e){if(e.next!=96&&e.next!=126)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;if(t<e.pos+3)return-1;if(e.next==96){for(let n=t;n<e.text.length;n++)if(e.text.charCodeAt(n)==96)return-1}return t}function TR(e){return e.next==62?e.text.charCodeAt(e.pos+1)==32?2:1:-1}function ER(e,t,n){if(e.next!=42&&e.next!=45&&e.next!=95)return-1;let r=1;for(let t=e.pos+1;t<e.text.length;t++){let n=e.text.charCodeAt(t);if(n==e.next)r++;else if(!xR(n))return-1}return n&&e.next==45&&jR(e)>-1&&e.depth==t.stack.length&&t.parser.leafBlockParsers.indexOf(UR.SetextHeading)>-1||r<3?-1:1}function DR(e,t){for(let n=e.stack.length-1;n>=0;n--)if(e.stack[n].type==t)return!0;return!1}function OR(e,t,n){return(e.next==45||e.next==43||e.next==42)&&(e.pos==e.text.length-1||xR(e.text.charCodeAt(e.pos+1)))&&(!n||DR(t,Q.BulletList)||e.skipSpace(e.pos+2)<e.text.length)?1:-1}function kR(e,t,n){let r=e.pos,i=e.next;for(;i>=48&&i<=57;){if(r++,r==e.text.length)return-1;i=e.text.charCodeAt(r)}return r==e.pos||r>e.pos+9||i!=46&&i!=41||r<e.text.length-1&&!xR(e.text.charCodeAt(r+1))||n&&!DR(t,Q.OrderedList)&&(e.skipSpace(r+1)==e.text.length||r>e.pos+1||e.next!=49)?-1:r+1-e.pos}function AR(e){if(e.next!=35)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==35;)t++;if(t<e.text.length&&e.text.charCodeAt(t)!=32)return-1;let n=t-e.pos;return n>6?-1:n}function jR(e){if(e.next!=45&&e.next!=61||e.indent>=e.baseIndent+4)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;let n=t;for(;t<e.text.length&&xR(e.text.charCodeAt(t));)t++;return t==e.text.length?n:-1}var MR=/^[ \t]*$/,NR=/-->/,PR=/\?>/,FR=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,NR],[/^\s*<\?/,PR],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,MR],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,MR]];function IR(e,t,n){if(e.next!=60)return-1;let r=e.text.slice(e.pos);for(let e=0,t=FR.length-+!!n;e<t;e++)if(FR[e][0].test(r))return e;return-1}function LR(e,t){let n=e.countIndent(t,e.pos,e.indent),r=e.countIndent(e.skipSpace(t),t,n);return r>=n+5?n+1:r}function RR(e,t,n){let r=e.length-1;r>=0&&e[r].to==t&&e[r].type==Q.CodeText?e[r].to=n:e.push(rz(Q.CodeText,t,n))}var zR={LinkReference:void 0,IndentedCode(e,t){let n=t.baseIndent+4;if(t.indent<n)return!1;let r=t.findColumn(n),i=e.lineStart+r,a=e.lineStart+t.text.length,o=[],s=[];for(RR(o,i,a);e.nextLine()&&t.depth>=e.stack.length;)if(t.pos==t.text.length){RR(s,e.lineStart-1,e.lineStart);for(let e of t.markers)s.push(e)}else if(t.indent<n)break;else{if(s.length){for(let e of s)e.type==Q.CodeText?RR(o,e.from,e.to):o.push(e);s=[]}RR(o,e.lineStart-1,e.lineStart);for(let e of t.markers)o.push(e);a=e.lineStart+t.text.length;let n=e.lineStart+t.findColumn(t.baseIndent+4);n<a&&RR(o,n,a)}return s.length&&(s=s.filter(e=>e.type!=Q.CodeText),s.length&&(t.markers=s.concat(t.markers))),e.addNode(e.buffer.writeElements(o,-i).finish(Q.CodeBlock,a-i),i),!0},FencedCode(e,t){let n=wR(t);if(n<0)return!1;let r=e.lineStart+t.pos,i=t.next,a=n-t.pos,o=t.skipSpace(n),s=CR(t.text,t.text.length,o),c=[rz(Q.CodeMark,r,r+a)];o<s&&c.push(rz(Q.CodeInfo,e.lineStart+o,e.lineStart+s));for(let n=!0,r=!0,o=!1;e.nextLine()&&t.depth>=e.stack.length;n=!1){let s=t.pos;if(t.indent-t.baseIndent<4)for(;s<t.text.length&&t.text.charCodeAt(s)==i;)s++;if(s-t.pos>=a&&t.skipSpace(s)==t.text.length){for(let e of t.markers)c.push(e);r&&o&&RR(c,e.lineStart-1,e.lineStart),c.push(rz(Q.CodeMark,e.lineStart+t.pos,e.lineStart+s)),e.nextLine();break}else{o=!0,n||(RR(c,e.lineStart-1,e.lineStart),r=!1);for(let e of t.markers)c.push(e);let i=e.lineStart+t.basePos,a=e.lineStart+t.text.length;i<a&&(RR(c,i,a),r=!1)}}return e.addNode(e.buffer.writeElements(c,-r).finish(Q.FencedCode,e.prevLineEnd()-r),r),!0},Blockquote(e,t){let n=TR(t);return n<0?!1:(e.startContext(Q.Blockquote,t.pos),e.addNode(Q.QuoteMark,e.lineStart+t.pos,e.lineStart+t.pos+1),t.moveBase(t.pos+n),null)},HorizontalRule(e,t){if(ER(t,e,!1)<0)return!1;let n=e.lineStart+t.pos;return e.nextLine(),e.addNode(Q.HorizontalRule,n),!0},BulletList(e,t){let n=OR(t,e,!1);if(n<0)return!1;e.block.type!=Q.BulletList&&e.startContext(Q.BulletList,t.basePos,t.next);let r=LR(t,t.pos+1);return e.startContext(Q.ListItem,t.basePos,r-t.baseIndent),e.addNode(Q.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),null},OrderedList(e,t){let n=kR(t,e,!1);if(n<0)return!1;e.block.type!=Q.OrderedList&&e.startContext(Q.OrderedList,t.basePos,t.text.charCodeAt(t.pos+n-1));let r=LR(t,t.pos+n);return e.startContext(Q.ListItem,t.basePos,r-t.baseIndent),e.addNode(Q.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),null},ATXHeading(e,t){let n=AR(t);if(n<0)return!1;let r=t.pos,i=e.lineStart+r,a=CR(t.text,t.text.length,r),o=a;for(;o>r&&t.text.charCodeAt(o-1)==t.next;)o--;(o==a||o==r||!xR(t.text.charCodeAt(o-1)))&&(o=t.text.length);let s=e.buffer.write(Q.HeaderMark,0,n).writeElements(e.parser.parseInline(t.text.slice(r+n+1,o),i+n+1),-i);o<t.text.length&&s.write(Q.HeaderMark,o-r,a-r);let c=s.finish(Q.ATXHeading1-1+n,t.text.length-r);return e.nextLine(),e.addNode(c,i),!0},HTMLBlock(e,t){let n=IR(t,e,!1);if(n<0)return!1;let r=e.lineStart+t.pos,i=FR[n][1],a=[],o=i!=MR;for(;!i.test(t.text)&&e.nextLine();){if(t.depth<e.stack.length){o=!1;break}for(let e of t.markers)a.push(e)}o&&e.nextLine();let s=i==NR?Q.CommentBlock:i==PR?Q.ProcessingInstructionBlock:Q.HTMLBlock,c=e.prevLineEnd();return e.addNode(e.buffer.writeElements(a,-r).finish(s,c-r),r),!0},SetextHeading:void 0},BR=class{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,t,n){if(this.stage==-1)return!1;let r=n.content+`
|
|
103
|
+
`+t.scrub(),i=this.advance(r);return i>-1&&i<r.length?this.complete(e,n,i):!1}finish(e,t){return(this.stage==2||this.stage==3)&&SR(t.content,this.pos)==t.content.length?this.complete(e,t,t.content.length):!1}complete(e,t,n){return e.addLeafElement(t,rz(Q.LinkReference,this.start,this.start+n,this.elts)),!0}nextStage(e){return e?(this.pos=e.to-this.start,this.elts.push(e),this.stage++,!0):(e===!1&&(this.stage=-1),!1)}advance(e){for(;;)if(this.stage==-1)return-1;else if(this.stage==0){if(!this.nextStage(hz(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(rz(Q.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(pz(e,SR(e,this.pos),this.start)))return-1}else if(this.stage==2){let t=SR(e,this.pos),n=0;if(t>this.pos){let r=mz(e,t,this.start);if(r){let t=VR(e,r.to-this.start);t>0&&(this.nextStage(r),n=t)}}return n||=VR(e,this.pos),n>0&&n<e.length?n:-1}else return VR(e,this.pos)}};function VR(e,t){for(;t<e.length;t++){let n=e.charCodeAt(t);if(n==10)break;if(!xR(n))return-1}return t}var HR=class{nextLine(e,t,n){let r=t.depth<e.stack.length?-1:jR(t),i=t.next;if(r<0)return!1;let a=rz(Q.HeaderMark,e.lineStart+t.pos,e.lineStart+r);return e.nextLine(),e.addLeafElement(n,rz(i==61?Q.SetextHeading1:Q.SetextHeading2,n.start,e.prevLineEnd(),[...e.parser.parseInline(n.content,n.start),a])),!0}finish(){return!1}},UR={LinkReference(e,t){return t.content.charCodeAt(0)==91?new BR(t):null},SetextHeading(){return new HR}},WR=[(e,t)=>AR(t)>=0,(e,t)=>wR(t)>=0,(e,t)=>TR(t)>=0,(e,t)=>OR(t,e,!0)>=0,(e,t)=>kR(t,e,!0)>=0,(e,t)=>ER(t,e,!0)>=0,(e,t)=>IR(t,e,!0)>=0],GR={text:``,end:0},KR=class{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,this.line=new vR,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=r[r.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=r[0].from,this.block=gR.create(Q.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=n.length?new yz(n,t):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(this.stoppedAt!=null&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:e}=this;for(;;){for(let t=0;;){let n=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;t<e.markers.length&&(!n||e.markers[t].from<n.end);){let n=e.markers[t++];this.addNode(n.type,n.from,n.to)}if(!n)break;this.finishContext()}if(e.pos<e.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(e.basePos))return null;start:for(;;){for(let t of this.parser.blockParsers)if(t){let n=t(this,e);if(n!=0){if(n==1)return null;e.forward();continue start}}break}let t=new _R(this.lineStart+e.pos,e.text.slice(e.pos));for(let e of this.parser.leafBlockParsers)if(e){let n=e(this,t);n&&t.parsers.push(n)}lines:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4){for(let n of this.parser.endLeafBlock)if(n(this,e,t))break lines}for(let n of t.parsers)if(n.nextLine(this,e,t))return null;t.content+=`
|
|
104
|
+
`+e.scrub();for(let n of e.markers)t.marks.push(n)}return this.finishLeaf(t),null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw RangeError(`Can't move stoppedAt forward`);this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let t=this.fragments.takeNodes(this);return t?(this.absoluteLineStart+=t,this.lineStart=bz(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0):!1}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}peekLine(){return this.scanLine(this.absoluteLineEnd+1).text}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let t=GR;if(t.end=e,e>=this.to)t.text=``;else if(t.text=this.lineChunkAt(e),t.end+=t.text.length,this.ranges.length>1){let e=this.absoluteLineStart,n=this.rangeI;for(;this.ranges[n].to<t.end;){n++;let r=this.ranges[n].from,i=this.lineChunkAt(r);t.end=r+i.length,t.text=t.text.slice(0,this.ranges[n-1].to-e)+i,e=t.end-t.text.length}}return t}readLine(){let{line:e}=this,{text:t,end:n}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=n,e.reset(t);e.depth<this.stack.length;e.depth++){let t=this.stack[e.depth],n=this.parser.skipContextMarkup[t.type];if(!n)throw Error(`Unhandled block context `+Q[t.type]);let r=this.line.markers.length;if(!n(t,this,e)){this.line.markers.length>r&&(t.end=this.line.markers[this.line.markers.length-1].to),e.forward();break}e.forward()}}lineChunkAt(e){let t=this.input.chunk(e),n;if(this.input.lineChunks)n=t==`
|
|
105
|
+
`?``:t;else{let e=t.indexOf(`
|
|
106
|
+
`);n=e<0?t:t.slice(0,e)}return e+n.length>this.to?n.slice(0,this.to-e):n}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,t,n=0){this.block=gR.create(e,n,this.lineStart+t,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,t,n=0){this.startContext(this.parser.getNodeType(e),t,n)}addNode(e,t,n){typeof e==`number`&&(e=new VP(this.parser.nodeSet.types[e],$R,$R,(n??this.prevLineEnd())-t)),this.block.addChild(e,t-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,t){this.addNode(this.buffer.writeElements(_z(t.children,e.marks),-t.from).finish(t.type,t.to-t.from),t.from)}finishContext(){let e=this.stack.pop(),t=this.stack[this.stack.length-1];t.addChild(e.toTree(this.parser.nodeSet),e.from-t.from),this.block=t}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length>1?qR(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let t of e.parsers)if(t.finish(this,e))return;let t=_z(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(t,-e.start).finish(Q.Paragraph,e.content.length),e.start)}elt(e,t,n,r){return typeof e==`string`?rz(this.parser.getNodeType(e),t,n,r):new nz(e,t)}get buffer(){return new ez(this.parser.nodeSet)}};function qR(e,t,n,r,i){let a=e[t].to,o=[],s=[],c=n.from+r;function l(n,i){for(;i?n>=a:n>a;){let i=e[t+1].from-a;r+=i,n+=i,t++,a=e[t].to}}for(let u=n.firstChild;u;u=u.nextSibling){l(u.from+r,!0);let n=u.from+r,d,f=i.get(u.tree);f?d=f:u.to+r>a?(d=qR(e,t,u,r,i),l(u.to+r,!1)):d=u.toTree(),o.push(d),s.push(n-c)}return l(n.to+r,!1),new VP(n.type,o,s,n.to+r-c,n.tree?n.tree.propValues:void 0)}var JR=class e extends lF{constructor(e,t,n,r,i,a,o,s,c){super(),this.nodeSet=e,this.blockParsers=t,this.leafBlockParsers=n,this.blockNames=r,this.endLeafBlock=i,this.skipContextMarkup=a,this.inlineParsers=o,this.inlineNames=s,this.wrappers=c,this.nodeTypes=Object.create(null);for(let t of e.types)this.nodeTypes[t.name]=t.id}createParse(e,t,n){let r=new KR(this,e,t,n);for(let i of this.wrappers)r=i(r,e,t,n);return r}configure(t){let n=XR(t);if(!n)return this;let{nodeSet:r,skipContextMarkup:i}=this,a=this.blockParsers.slice(),o=this.leafBlockParsers.slice(),s=this.blockNames.slice(),c=this.inlineParsers.slice(),l=this.inlineNames.slice(),u=this.endLeafBlock.slice(),d=this.wrappers;if(YR(n.defineNodes)){i=Object.assign({},i);let e=r.types.slice(),t;for(let r of n.defineNodes){let{name:n,block:a,composite:o,style:s}=typeof r==`string`?{name:r}:r;if(e.some(e=>e.name==n))continue;o&&(i[e.length]=(e,t,n)=>o(t,n,e.value));let c=e.length,l=o?[`Block`,`BlockContext`]:a?c>=Q.ATXHeading1&&c<=Q.SetextHeading2?[`Block`,`LeafBlock`,`Heading`]:[`Block`,`LeafBlock`]:void 0;e.push(IP.define({id:c,name:n,props:l&&[[J.group,l]]})),s&&(t||={},Array.isArray(s)||s instanceof EF?t[n]=s:Object.assign(t,s))}r=new LP(e),t&&(r=r.extend(jF(t)))}if(YR(n.props)&&(r=r.extend(...n.props)),YR(n.remove))for(let e of n.remove){let t=this.blockNames.indexOf(e),n=this.inlineNames.indexOf(e);t>-1&&(a[t]=o[t]=void 0),n>-1&&(c[n]=void 0)}if(YR(n.parseBlock))for(let e of n.parseBlock){let t=s.indexOf(e.name);if(t>-1)a[t]=e.parse,o[t]=e.leaf;else{let t=e.before?ZR(s,e.before):e.after?ZR(s,e.after)+1:s.length-1;a.splice(t,0,e.parse),o.splice(t,0,e.leaf),s.splice(t,0,e.name)}e.endLeaf&&u.push(e.endLeaf)}if(YR(n.parseInline))for(let e of n.parseInline){let t=l.indexOf(e.name);if(t>-1)c[t]=e.parse;else{let t=e.before?ZR(l,e.before):e.after?ZR(l,e.after)+1:l.length-1;c.splice(t,0,e.parse),l.splice(t,0,e.name)}}return n.wrap&&(d=d.concat(n.wrap)),new e(r,a,o,s,u,i,c,l,d)}getNodeType(e){let t=this.nodeTypes[e];if(t==null)throw RangeError(`Unknown node type '${e}'`);return t}parseInline(e,t){let n=new gz(this,e,t);outer:for(let e=t;e<n.end;){let t=n.char(e);for(let r of this.inlineParsers)if(r){let i=r(n,t,e);if(i>=0){e=i;continue outer}}e++}return n.resolveMarkers(0)}};function YR(e){return e!=null&&e.length>0}function XR(e){if(!Array.isArray(e))return e;if(e.length==0)return null;let t=XR(e[0]);if(e.length==1)return t;let n=XR(e.slice(1));if(!n||!t)return t||n;let r=(e,t)=>(e||$R).concat(t||$R),i=t.wrap,a=n.wrap;return{props:r(t.props,n.props),defineNodes:r(t.defineNodes,n.defineNodes),parseBlock:r(t.parseBlock,n.parseBlock),parseInline:r(t.parseInline,n.parseInline),remove:r(t.remove,n.remove),wrap:i?a?(e,t,n,r)=>i(a(e,t,n,r),t,n,r):i:a}}function ZR(e,t){let n=e.indexOf(t);if(n<0)throw RangeError(`Position specified relative to unknown parser ${t}`);return n}var QR=[IP.none];for(let e=1,t;t=Q[e];e++)QR[e]=IP.define({id:e,name:t,props:e>=Q.Escape?[]:[[J.group,e in bR?[`Block`,`BlockContext`]:[`Block`,`LeafBlock`]]],top:t==`Document`});var $R=[],ez=class{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e,t,n,r=0){return this.content.push(e,t,n,4+r*4),this}writeElements(e,t=0){for(let n of e)n.writeTo(this,t);return this}finish(e,t){return VP.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:e,length:t})}},tz=class{constructor(e,t,n,r=$R){this.type=e,this.from=t,this.to=n,this.children=r}writeTo(e,t){let n=e.content.length;e.writeElements(this.children,t),e.content.push(this.type,this.from+t,this.to+t,e.content.length+4-n)}toTree(e){return new ez(e).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}},nz=class{constructor(e,t){this.tree=e,this.from=t}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return $R}writeTo(e,t){e.nodes.push(this.tree),e.content.push(e.nodes.length-1,this.from+t,this.to+t,-1)}toTree(){return this.tree}};function rz(e,t,n,r){return new tz(e,t,n,r)}var iz={resolve:`Emphasis`,mark:`EmphasisMark`},az={resolve:`Emphasis`,mark:`EmphasisMark`},oz={},sz={},cz=class{constructor(e,t,n,r){this.type=e,this.from=t,this.to=n,this.side=r}},lz=`!"#$%&'()*+,-./:;<=>?@[\\]^_\`{|}~`,uz=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{uz=RegExp(`[\\p{S}|\\p{P}]`,`u`)}catch{}var dz={Escape(e,t,n){if(t!=92||n==e.end-1)return-1;let r=e.char(n+1);for(let t=0;t<lz.length;t++)if(lz.charCodeAt(t)==r)return e.append(rz(Q.Escape,n,n+2));return-1},Entity(e,t,n){if(t!=38)return-1;let r=/^(?:#\d+|#x[a-f\d]+|\w+);/i.exec(e.slice(n+1,n+31));return r?e.append(rz(Q.Entity,n,n+1+r[0].length)):-1},InlineCode(e,t,n){if(t!=96||n&&e.char(n-1)==96)return-1;let r=n+1;for(;r<e.end&&e.char(r)==96;)r++;let i=r-n,a=0;for(;r<e.end;r++)if(e.char(r)==96){if(a++,a==i&&e.char(r+1)!=96)return e.append(rz(Q.InlineCode,n,r+1,[rz(Q.CodeMark,n,n+i),rz(Q.CodeMark,r+1-i,r+1)]))}else a=0;return-1},HTMLTag(e,t,n){if(t!=60||n==e.end-1)return-1;let r=e.slice(n+1,e.end),i=/^(?:[a-z][-\w+.]+:[^\s>]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(r);if(i)return e.append(rz(Q.Autolink,n,n+1+i[0].length,[rz(Q.LinkMark,n,n+1),rz(Q.URL,n+1,n+i[0].length),rz(Q.LinkMark,n+i[0].length,n+1+i[0].length)]));let a=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(r);if(a)return e.append(rz(Q.Comment,n,n+1+a[0].length));let o=/^\?[^]*?\?>/.exec(r);if(o)return e.append(rz(Q.ProcessingInstruction,n,n+1+o[0].length));let s=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(r);return s?e.append(rz(Q.HTMLTag,n,n+1+s[0].length)):-1},Emphasis(e,t,n){if(t!=95&&t!=42)return-1;let r=n+1;for(;e.char(r)==t;)r++;let i=e.slice(n-1,n),a=e.slice(r,r+1),o=uz.test(i),s=uz.test(a),c=/\s|^$/.test(i),l=/\s|^$/.test(a),u=!l&&(!s||c||o),d=!c&&(!o||l||s),f=u&&(t==42||!d||o),p=d&&(t==42||!u||s);return e.append(new cz(t==95?iz:az,n,r,!!f|(p?2:0)))},HardBreak(e,t,n){if(t==92&&e.char(n+1)==10)return e.append(rz(Q.HardBreak,n,n+2));if(t==32){let t=n+1;for(;e.char(t)==32;)t++;if(e.char(t)==10&&t>=n+2)return e.append(rz(Q.HardBreak,n,t+1))}return-1},Link(e,t,n){return t==91?e.append(new cz(oz,n,n+1,1)):-1},Image(e,t,n){return t==33&&e.char(n+1)==91?e.append(new cz(sz,n,n+2,1)):-1},LinkEnd(e,t,n){if(t!=93)return-1;for(let t=e.parts.length-1;t>=0;t--){let r=e.parts[t];if(r instanceof cz&&(r.type==oz||r.type==sz)){if(!r.side||e.skipSpace(r.to)==n&&!/[(\[]/.test(e.slice(n+1,n+2)))return e.parts[t]=null,-1;let i=e.takeContent(t),a=e.parts[t]=fz(e,i,r.type==oz?Q.Link:Q.Image,r.from,n+1);if(r.type==oz)for(let n=0;n<t;n++){let t=e.parts[n];t instanceof cz&&t.type==oz&&(t.side=0)}return a.to}}return-1}};function fz(e,t,n,r,i){let{text:a}=e,o=e.char(i),s=i;if(t.unshift(rz(Q.LinkMark,r,r+(n==Q.Image?2:1))),t.push(rz(Q.LinkMark,i-1,i)),o==40){let n=e.skipSpace(i+1),r=pz(a,n-e.offset,e.offset),o;r&&(n=e.skipSpace(r.to),n!=r.to&&(o=mz(a,n-e.offset,e.offset),o&&(n=e.skipSpace(o.to)))),e.char(n)==41&&(t.push(rz(Q.LinkMark,i,i+1)),s=n+1,r&&t.push(r),o&&t.push(o),t.push(rz(Q.LinkMark,n,s)))}else if(o==91){let n=hz(a,i-e.offset,e.offset,!1);n&&(t.push(n),s=n.to)}return rz(n,r,s,t)}function pz(e,t,n){if(e.charCodeAt(t)==60){for(let r=t+1;r<e.length;r++){let i=e.charCodeAt(r);if(i==62)return rz(Q.URL,t+n,r+1+n);if(i==60||i==10)return!1}return null}else{let r=0,i=t;for(let t=!1;i<e.length;i++){let n=e.charCodeAt(i);if(xR(n))break;if(t)t=!1;else if(n==40)r++;else if(n==41){if(!r)break;r--}else n==92&&(t=!0)}return i>t?rz(Q.URL,t+n,i+n):i==e.length?null:!1}}function mz(e,t,n){let r=e.charCodeAt(t);if(r!=39&&r!=34&&r!=40)return!1;let i=r==40?41:r;for(let r=t+1,a=!1;r<e.length;r++){let o=e.charCodeAt(r);if(a)a=!1;else if(o==i)return rz(Q.LinkTitle,t+n,r+1+n);else o==92&&(a=!0)}return null}function hz(e,t,n,r){for(let i=!1,a=t+1,o=Math.min(e.length,a+999);a<o;a++){let o=e.charCodeAt(a);if(i)i=!1;else if(o==93)return r?!1:rz(Q.LinkLabel,t+n,a+1+n);else{if(r&&!xR(o)&&(r=!1),o==91)return!1;o==92&&(i=!0)}}return null}var gz=class{constructor(e,t,n){this.parser=e,this.text=t,this.offset=n,this.parts=[]}char(e){return e>=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,t){return this.text.slice(e-this.offset,t-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,t,n,r,i){return this.append(new cz(e,t,n,!!r|(i?2:0)))}get hasOpenLink(){for(let e=this.parts.length-1;e>=0;e--){let t=this.parts[e];if(t instanceof cz&&(t.type==oz||t.type==sz))return!0}return!1}addElement(e){return this.append(e)}resolveMarkers(e){for(let t=e;t<this.parts.length;t++){let n=this.parts[t];if(!(n instanceof cz&&n.type.resolve&&n.side&2))continue;let r=n.type==iz||n.type==az,i=n.to-n.from,a,o=t-1;for(;o>=e;o--){let e=this.parts[o];if(e instanceof cz&&e.side&1&&e.type==n.type&&!(r&&(n.side&1||e.side&2)&&(e.to-e.from+i)%3==0&&((e.to-e.from)%3||i%3))){a=e;break}}if(!a)continue;let s=n.type.resolve,c=[],l=a.from,u=n.to;if(r){let e=Math.min(2,a.to-a.from,i);l=a.to-e,u=n.from+e,s=e==1?`Emphasis`:`StrongEmphasis`}a.type.mark&&c.push(this.elt(a.type.mark,l,a.to));for(let e=o+1;e<t;e++)this.parts[e]instanceof tz&&c.push(this.parts[e]),this.parts[e]=null;n.type.mark&&c.push(this.elt(n.type.mark,n.from,u));let d=this.elt(s,l,u,c);this.parts[o]=r&&a.from!=l?new cz(a.type,a.from,l,a.side):null,(this.parts[t]=r&&n.to!=u?new cz(n.type,u,n.to,n.side):null)?this.parts.splice(t,0,d):this.parts[t]=d}let t=[];for(let n=e;n<this.parts.length;n++){let e=this.parts[n];e instanceof tz&&t.push(e)}return t}findOpeningDelimiter(e){for(let t=this.parts.length-1;t>=0;t--){let n=this.parts[t];if(n instanceof cz&&n.type==e&&n.side&1)return t}return null}takeContent(e){let t=this.resolveMarkers(e);return this.parts.length=e,t}getDelimiterAt(e){let t=this.parts[e];return t instanceof cz?t:null}skipSpace(e){return SR(this.text,e-this.offset)+this.offset}elt(e,t,n,r){return typeof e==`string`?rz(this.parser.getNodeType(e),t,n,r):new nz(e,t)}};gz.linkStart=oz,gz.imageStart=sz;function _z(e,t){if(!t.length)return e;if(!e.length)return t;let n=e.slice(),r=0;for(let e of t){for(;r<n.length&&n[r].to<e.to;)r++;if(r<n.length&&n[r].from<e.from){let t=n[r];t instanceof tz&&(n[r]=new tz(t.type,t.from,t.to,_z(t.children,[e])))}else n.splice(r++,0,e)}return n}var vz=[Q.CodeBlock,Q.ListItem,Q.OrderedList,Q.BulletList],yz=class{constructor(e,t){this.fragments=e,this.input=t,this.i=0,this.fragment=null,this.fragmentEnd=-1,this.cursor=null,e.length&&(this.fragment=e[this.i++])}nextFragment(){this.fragment=this.i<this.fragments.length?this.fragments[this.i++]:null,this.cursor=null,this.fragmentEnd=-1}moveTo(e,t){for(;this.fragment&&this.fragment.to<=e;)this.nextFragment();if(!this.fragment||this.fragment.from>(e?e-1:0))return!1;if(this.fragmentEnd<0){let e=this.fragment.to;for(;e>0&&this.input.read(e-1,e)!=`
|
|
107
|
+
`;)e--;this.fragmentEnd=e?e-1:0}let n=this.cursor;n||(n=this.cursor=this.fragment.tree.cursor(),n.firstChild());let r=e+this.fragment.offset;for(;n.to<=r;)if(!n.parent())return!1;for(;;){if(n.from>=r)return this.fragment.from<=t;if(!n.childAfter(r))return!1}}matches(e){let t=this.cursor.tree;return t&&t.prop(J.contextHash)==e}takeNodes(e){let t=this.cursor,n=this.fragment.offset,r=this.fragmentEnd-+!!this.fragment.openEnd,i=e.absoluteLineStart,a=i,o=e.block.children.length,s=a,c=o;for(;;){if(t.to-n>r){if(t.type.isAnonymous&&t.firstChild())continue;break}let i=bz(t.from-n,e.ranges);if(t.to-n<=e.ranges[e.rangeI].to)e.addNode(t.tree,i);else{let n=new VP(e.parser.nodeSet.types[Q.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(n,t.tree),e.addNode(n,i)}if(t.type.is(`Block`)&&(vz.indexOf(t.type.id)<0?(a=t.to-n,o=e.block.children.length):(a=s,o=c),s=t.to-n,c=e.block.children.length),!t.nextSibling())break}for(;e.block.children.length>o;)e.block.children.pop(),e.block.positions.pop();return a-i}};function bz(e,t){let n=e;for(let r=1;r<t.length;r++){let i=t[r-1].to,a=t[r].from;i<e&&(n-=a-i)}return n}var xz=jF({"Blockquote/...":X.quote,HorizontalRule:X.contentSeparator,"ATXHeading1/... SetextHeading1/...":X.heading1,"ATXHeading2/... SetextHeading2/...":X.heading2,"ATXHeading3/...":X.heading3,"ATXHeading4/...":X.heading4,"ATXHeading5/...":X.heading5,"ATXHeading6/...":X.heading6,"Comment CommentBlock":X.comment,Escape:X.escape,Entity:X.character,"Emphasis/...":X.emphasis,"StrongEmphasis/...":X.strong,"Link/... Image/...":X.link,"OrderedList/... BulletList/...":X.list,"BlockQuote/...":X.quote,"InlineCode CodeText":X.monospace,"URL Autolink":X.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":X.processingInstruction,"CodeInfo LinkLabel":X.labelName,LinkTitle:X.string,Paragraph:X.content}),Sz=new JR(new LP(QR).extend(xz),Object.keys(zR).map(e=>zR[e]),Object.keys(zR).map(e=>UR[e]),Object.keys(zR),WR,bR,Object.keys(dz).map(e=>dz[e]),Object.keys(dz),[]);function Cz(e,t,n){let r=[];for(let i=e.firstChild,a=t;;i=i.nextSibling){let e=i?i.from:n;if(e>a&&r.push({from:a,to:e}),!i)break;a=i.to}return r}function wz(e){let{codeParser:t,htmlParser:n}=e;return{wrap:dF((e,r)=>{let i=e.type.id;if(t&&(i==Q.CodeBlock||i==Q.FencedCode)){let n=``;if(i==Q.FencedCode){let t=e.node.getChild(Q.CodeInfo);t&&(n=r.read(t.from,t.to))}let a=t(n);if(a)return{parser:a,overlay:e=>e.type.id==Q.CodeText,bracketed:i==Q.FencedCode}}else if(n&&(i==Q.HTMLBlock||i==Q.HTMLTag||i==Q.CommentBlock))return{parser:n,overlay:Cz(e.node,e.from,e.to)};return null})}}var Tz={resolve:`Strikethrough`,mark:`StrikethroughMark`},Ez={defineNodes:[{name:`Strikethrough`,style:{"Strikethrough/...":X.strikethrough}},{name:`StrikethroughMark`,style:X.processingInstruction}],parseInline:[{name:`Strikethrough`,parse(e,t,n){if(t!=126||e.char(n+1)!=126||e.char(n+2)==126)return-1;let r=e.slice(n-1,n),i=e.slice(n+2,n+3),a=/\s|^$/.test(r),o=/\s|^$/.test(i),s=uz.test(r),c=uz.test(i);return e.addDelimiter(Tz,n,n+2,!o&&(!c||a||s),!a&&(!s||o||c))},after:`Emphasis`}]};function Dz(e,t,n=0,r,i=0){let a=0,o=!0,s=-1,c=-1,l=!1,u=()=>{r.push(e.elt(`TableCell`,i+s,i+c,e.parser.parseInline(t.slice(s,c),i+s)))};for(let d=n;d<t.length;d++){let n=t.charCodeAt(d);n==124&&!l?((!o||s>-1)&&a++,o=!1,r&&(s>-1&&u(),r.push(e.elt(`TableDelimiter`,d+i,d+i+1))),s=c=-1):(l||n!=32&&n!=9)&&(s<0&&(s=d),c=d+1),l=!l&&n==92}return s>-1&&(a++,r&&u()),a}function Oz(e,t){for(let n=t;n<e.length;n++){let t=e.charCodeAt(n);if(t==124)return!0;t==92&&n++}return!1}var kz=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/,Az=class{constructor(){this.rows=null}nextLine(e,t,n){if(this.rows==null){this.rows=!1;let r;if((t.next==45||t.next==58||t.next==124)&&kz.test(r=t.text.slice(t.pos))){let i=[];Dz(e,n.content,0,i,n.start)==Dz(e,r,0)&&(this.rows=[e.elt(`TableHeader`,n.start,n.start+n.content.length,i),e.elt(`TableDelimiter`,e.lineStart+t.pos,e.lineStart+t.text.length)])}}else if(this.rows){let n=[];Dz(e,t.text,t.pos,n,e.lineStart),this.rows.push(e.elt(`TableRow`,e.lineStart+t.pos,e.lineStart+t.text.length,n))}return!1}finish(e,t){return this.rows?(e.addLeafElement(t,e.elt(`Table`,t.start,t.start+t.content.length,this.rows)),!0):!1}},jz={defineNodes:[{name:`Table`,block:!0},{name:`TableHeader`,style:{"TableHeader/...":X.heading}},`TableRow`,{name:`TableCell`,style:X.content},{name:`TableDelimiter`,style:X.processingInstruction}],parseBlock:[{name:`Table`,leaf(e,t){return Oz(t.content,0)?new Az:null},endLeaf(e,t,n){if(n.parsers.some(e=>e instanceof Az)||!Oz(t.text,t.basePos))return!1;let r=e.peekLine();return kz.test(r)&&Dz(e,t.text,t.basePos)==Dz(e,r,t.basePos)},before:`SetextHeading`}]},Mz=class{nextLine(){return!1}finish(e,t){return e.addLeafElement(t,e.elt(`Task`,t.start,t.start+t.content.length,[e.elt(`TaskMarker`,t.start,t.start+3),...e.parser.parseInline(t.content.slice(3),t.start+3)])),!0}},Nz={defineNodes:[{name:`Task`,block:!0,style:X.list},{name:`TaskMarker`,style:X.atom}],parseBlock:[{name:`TaskList`,leaf(e,t){return/^\[[ xX]\][ \t]/.test(t.content)&&e.parentType().name==`ListItem`?new Mz:null},after:`SetextHeading`}]},Pz=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,Fz=/[\w-]+(\.[\w-]+)+(:\d+)?(\/[^\s<]*)?/gy,Iz=/[\w-]+\.[\w-]+($|[/:])/,Lz=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,Rz=/\/[a-zA-Z\d@.]+/gy;function zz(e,t,n,r){let i=0;for(let a=t;a<n;a++)e[a]==r&&i++;return i}function Bz(e,t){Fz.lastIndex=t;let n=Fz.exec(e);if(!n||Iz.exec(n[0])[0].indexOf(`_`)>-1)return-1;let r=t+n[0].length;for(;;){let n=e[r-1],i;if(/[?!.,:*_~]/.test(n)||n==`)`&&zz(e,t,r,`)`)>zz(e,t,r,`(`))r--;else if(n==`;`&&(i=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(e.slice(t,r))))r=t+i.index;else break}return r}function Vz(e,t){Lz.lastIndex=t;let n=Lz.exec(e);if(!n)return-1;let r=n[0][n[0].length-1];return r==`_`||r==`-`?-1:t+n[0].length-+(r==`.`)}var Hz=[jz,Nz,Ez,{parseInline:[{name:`Autolink`,parse(e,t,n){let r=n-e.offset;if(r&&/\w/.test(e.text[r-1]))return-1;Pz.lastIndex=r;let i=Pz.exec(e.text),a=-1;return!i||(i[1]||i[2]?(a=Bz(e.text,r+i[0].length),a>-1&&e.hasOpenLink&&(a=r+/([^\[\]]|\[[^\]]*\])*/.exec(e.text.slice(r,a))[0].length)):i[3]?a=Vz(e.text,r):(a=Vz(e.text,r+i[0].length),a>-1&&i[0]==`xmpp:`&&(Rz.lastIndex=a,i=Rz.exec(e.text),i&&(a=i.index+i[0].length))),a<0)?-1:(e.addElement(e.elt(`URL`,n,a+e.offset)),a+e.offset)}}]}];function Uz(e,t,n){return(r,i,a)=>{if(i!=e||r.char(a+1)==e)return-1;let o=[r.elt(n,a,a+1)];for(let i=a+1;i<r.end;i++){let s=r.char(i);if(s==e)return r.addElement(r.elt(t,a,i+1,o.concat(r.elt(n,i,i+1))));if(s==92&&o.push(r.elt(`Escape`,i,i+++2)),xR(s))break}return-1}}var Wz={defineNodes:[{name:`Superscript`,style:X.special(X.content)},{name:`SuperscriptMark`,style:X.processingInstruction}],parseInline:[{name:`Superscript`,parse:Uz(94,`Superscript`,`SuperscriptMark`)}]},Gz={defineNodes:[{name:`Subscript`,style:X.special(X.content)},{name:`SubscriptMark`,style:X.processingInstruction}],parseInline:[{name:`Subscript`,parse:Uz(126,`Subscript`,`SubscriptMark`)}]},Kz={defineNodes:[{name:`Emoji`,style:X.character}],parseInline:[{name:`Emoji`,parse(e,t,n){let r;return t!=58||!(r=/^[a-zA-Z_0-9]+:/.exec(e.slice(n+1,e.end)))?-1:e.addElement(e.elt(`Emoji`,n,n+1+r[0].length))}}]},qz=class e{constructor(e,t,n,r,i,a,o,s,c,l=0,u){this.p=e,this.stack=t,this.state=n,this.reducePos=r,this.pos=i,this.score=a,this.buffer=o,this.bufferBase=s,this.curContext=c,this.lookAhead=l,this.parent=u}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?`!`+this.score:``}`}static start(t,n,r=0){let i=t.parser.context;return new e(t,[],n,r,r,0,[],0,i?new Jz(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){let t=e>>19,n=e&65535,{parser:r}=this.p,i=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),a=r.dynamicPrecedence(n);if(a&&(this.score+=a),t==0){n<r.minRepeatTerm&&this.reducePos<this.pos&&(this.reducePos=this.pos),this.pushState(r.getGoto(this.state,n,!0),this.reducePos),n<r.minRepeatTerm&&this.storeNode(n,this.reducePos,this.reducePos,i?8:4,!0),this.reduceContext(n,this.reducePos);return}let o=this.stack.length-(t-1)*3-(e&262144?6:0),s=o?this.stack[o-2]:this.p.ranges[0].from;n<r.minRepeatTerm&&s==this.reducePos&&this.reducePos<this.pos&&(this.reducePos=this.pos);let c=this.reducePos-s;c>=2e3&&!this.p.parser.nodeSet.types[n]?.isAnonymous&&(s==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSize<c&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=s,this.p.lastBigReductionSize=c));let l=o?this.stack[o-1]:0,u=this.bufferBase+this.buffer.length-l;if(n<r.minRepeatTerm||e&131072){let e=r.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(n,s,e,u+4,!0)}if(e&262144)this.state=this.stack[o];else{let e=this.stack[o-3];this.state=r.getGoto(e,n,!0)}for(;this.stack.length>o;)this.stack.pop();this.reduceContext(n,s)}storeNode(e,t,n,r=4,i=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let e=this.buffer.length;if(e>0&&this.buffer[e-4]==0&&this.buffer[e-1]>-1){if(t==n)return;if(this.buffer[e-2]>=t){this.buffer[e-2]=n;return}}}if(!i||this.pos==n)this.buffer.push(e,t,n,r);else{let i=this.buffer.length;if(i>0&&(this.buffer[i-4]!=0||this.buffer[i-1]<0)){let e=!1;for(let t=i;t>0&&this.buffer[t-2]>n;t-=4)if(this.buffer[t-1]>=0){e=!0;break}if(e)for(;i>0&&this.buffer[i-2]>n;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4)}this.buffer[i]=e,this.buffer[i+1]=t,this.buffer[i+2]=n,this.buffer[i+3]=r}}shift(e,t,n,r){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=r,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,r,4);else{let i=e,{parser:a}=this.p;this.pos=r;let o=a.stateFlag(i,1);!o&&(r>n||t<=a.maxNode)&&(this.reducePos=r),this.pushState(i,o?n:Math.min(n,this.reducePos)),this.shiftContext(t,n),t<=a.maxNode&&this.buffer.push(t,n,r,4)}}apply(e,t,n,r){e&65536?this.reduce(e):this.shift(e,t,n,r)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(n,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let t=this,n=t.buffer.length;for(n&&t.buffer[n-4]==0&&(n-=4);n>0&&t.buffer[n-2]>t.reducePos;)n-=4;let r=t.buffer.slice(n),i=t.bufferBase+n;for(;t&&i==t.bufferBase;)t=t.parent;return new e(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,t)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new Yz(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(n==0)return!1;if(!(n&65536))return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let n=[];for(let r=0,i;r<t.length;r+=2)(i=t[r+1])!=this.state&&this.p.parser.hasAction(i,e)&&n.push(t[r],i);if(this.stack.length<120)for(let e=0;n.length<8&&e<t.length;e+=2){let r=t[e+1];n.some((e,t)=>t&1&&e==r)||n.push(t[e],r)}t=n}let n=[];for(let e=0;e<t.length&&n.length<4;e+=2){let r=t[e+1];if(r==this.state)continue;let i=this.split();i.pushState(r,this.pos),i.storeNode(0,i.pos,i.pos,4,!0),i.shiftContext(t[e],this.pos),i.reducePos=this.pos,i.score-=200,n.push(i)}return n}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if(!(t&65536))return!1;if(!e.validAction(this.state,t)){let n=t>>19,r=t&65535,i=this.stack.length-n*3;if(i<0||e.getGoto(this.stack[i],r,!1)<0){let e=this.findForcedReduction();if(e==null)return!1;t=e}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(r,i)=>{if(!t.includes(r))return t.push(r),e.allActions(r,t=>{if(!(t&393216))if(t&65536){let n=(t>>19)-i;if(n>1){let r=t&65535,i=this.stack.length-n*3;if(i>=0&&e.getGoto(this.stack[i],r,!1)>=0)return n<<19|65536|r}}else{let e=n(t,i+1);if(e!=null)return e}})};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new Jz(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){return e<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}},Jz=class{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}},Yz=class{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,n=e>>19;n==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(n-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}},Xz=class e{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(t,n=t.bufferBase+t.buffer.length){return new e(t,n,n-t.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new e(this.stack,this.pos,this.index)}};function Zz(e,t=Uint16Array){if(typeof e!=`string`)return e;let n=null;for(let r=0,i=0;r<e.length;){let a=0;for(;;){let t=e.charCodeAt(r++),n=!1;if(t==126){a=65535;break}t>=92&&t--,t>=34&&t--;let i=t-32;if(i>=46&&(i-=46,n=!0),a+=i,n)break;a*=46}n?n[i++]=a:n=new t(a)}return n}var Qz=class{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}},$z=new Qz,eB=class{constructor(e,t){this.input=e,this.ranges=t,this.chunk=``,this.chunkOff=0,this.chunk2=``,this.chunk2Pos=0,this.next=-1,this.token=$z,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,r=this.rangeIndex,i=this.pos+e;for(;i<n.from;){if(!r)return null;let e=this.ranges[--r];i-=n.from-e.to,n=e}for(;t<0?i>n.to:i>=n.to;){if(r==this.ranges.length-1)return null;let e=this.ranges[++r];i+=e.from-n.to,n=e}return i}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,r;if(t>=0&&t<this.chunk.length)n=this.pos+e,r=this.chunk.charCodeAt(t);else{let t=this.resolveOffset(e,1);if(t==null)return-1;if(n=t,n>=this.chunk2Pos&&n<this.chunk2Pos+this.chunk2.length)r=this.chunk2.charCodeAt(n-this.chunk2Pos);else{let e=this.rangeIndex,t=this.range;for(;t.to<=n;)t=this.ranges[++e];this.chunk2=this.input.chunk(this.chunk2Pos=n),n+this.chunk2.length>t.to&&(this.chunk2=this.chunk2.slice(0,t.to-n)),r=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),r}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(n==null||n<this.token.start)throw RangeError(`Token end out of bounds`);this.token.value=e,this.token.end=n}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk=``,this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=$z,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk=``,this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n=``;for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(n+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return n}},tB=class{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;iB(this.data,e,t,this.id,n.data,n.tokenPrecTable)}};tB.prototype.contextual=tB.prototype.fallback=tB.prototype.extend=!1;var nB=class{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data=typeof e==`string`?Zz(e):e}token(e,t){let n=e.pos,r=0;for(;;){let n=e.next<0,i=e.resolveOffset(1,1);if(iB(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(n||r++,i==null)break;e.reset(i,e.token)}r&&(e.reset(n,e.token),e.acceptToken(this.elseToken,r))}};nB.prototype.contextual=tB.prototype.fallback=tB.prototype.extend=!1;var rB=class{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}};function iB(e,t,n,r,i,a){let o=0,s=1<<r,{dialect:c}=n.p.parser;scan:for(;(s&e[o])!=0;){let n=e[o+1];for(let r=o+3;r<n;r+=2)if((e[r+1]&s)>0){let n=e[r];if(c.allows(n)&&(t.token.value==-1||t.token.value==n||oB(n,t.token.value,i,a))){t.acceptToken(n);break}}let r=t.next,l=0,u=e[o+2];if(t.next<0&&u>l&&e[n+u*3-3]==65535){o=e[n+u*3-1];continue scan}for(;l<u;){let i=l+u>>1,a=n+i+(i<<1),s=e[a],c=e[a+1]||65536;if(r<s)u=i;else if(r>=c)l=i+1;else{o=e[a+2],t.advance();continue scan}}break}}function aB(e,t,n){for(let r=t,i;(i=e[r])!=65535;r++)if(i==n)return r-t;return-1}function oB(e,t,n,r){let i=aB(n,r,t);return i<0||aB(n,r,e)<i}var sB=typeof process<`u`&&/\bparse\b/.test({}.LOG),cB=null;function lB(e,t,n){let r=e.cursor(BP.IncludeAnonymous);for(r.moveTo(t);;)if(!(n<0?r.childBefore(t):r.childAfter(t)))for(;;){if((n<0?r.to<t:r.from>t)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,t-25)):Math.min(e.length,Math.max(r.from+1,t+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:e.length}}var uB=class{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?lB(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?lB(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let n=this.trees[t],r=this.index[t];if(r==n.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let i=n.children[r],a=this.start[t]+n.positions[r];if(a>e)return this.nextStart=a,null;if(i instanceof VP){if(a==e){if(a<this.safeFrom)return null;let e=a+i.length;if(e<=this.safeTo){let t=i.prop(J.lookAhead);if(!t||e+t<this.fragment.to)return i}}this.index[t]++,a+i.length>=Math.max(this.safeFrom,e)&&(this.trees.push(i),this.start.push(a),this.index.push(0))}else this.index[t]++,this.nextStart=a+i.length}}},dB=class{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(e=>new Qz)}getActions(e){let t=0,n=null,{parser:r}=e.p,{tokenizers:i}=r,a=r.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,s=0;for(let r=0;r<i.length;r++){if(!(1<<r&a))continue;let c=i[r],l=this.tokens[r];if(!(n&&!c.fallback)&&((c.contextual||l.start!=e.pos||l.mask!=a||l.context!=o)&&(this.updateCachedToken(l,c,e),l.mask=a,l.context=o),l.lookAhead>l.end+25&&(s=Math.max(l.lookAhead,s)),l.value!=0)){let r=t;if(l.extended>-1&&(t=this.addActions(e,l.extended,l.end,t)),t=this.addActions(e,l.value,l.end,t),!c.extend&&(n=l,t>r))break}}for(;this.actions.length>t;)this.actions.pop();return s&&e.setLookAhead(s),!n&&e.pos==this.stream.end&&(n=new Qz,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new Qz,{pos:n,p:r}=e;return t.start=n,t.end=Math.min(n+1,r.stream.end),t.value=n==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,n){let r=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(r,e),n),e.value>-1){let{parser:t}=n.p;for(let r=0;r<t.specialized.length;r++)if(t.specialized[r]==e.value){let i=t.specializers[r](this.stream.read(e.start,e.end),n);if(i>=0&&n.p.parser.dialect.allows(i>>1)){i&1?e.extended=i>>1:e.value=i>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,n,r){for(let t=0;t<r;t+=3)if(this.actions[t]==e)return r;return this.actions[r++]=e,this.actions[r++]=t,this.actions[r++]=n,r}addActions(e,t,n,r){let{state:i}=e,{parser:a}=e.p,{data:o}=a;for(let e=0;e<2;e++)for(let s=a.stateSlot(i,e?2:1);;s+=3){if(o[s]==65535)if(o[s+1]==1)s=vB(o,s+2);else{r==0&&o[s+1]==2&&(r=this.putAction(vB(o,s+2),t,n,r));break}o[s]==t&&(r=this.putAction(vB(o,s+1),t,n,r))}return r}},fB=class{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new eB(t,r),this.tokens=new dB(e,this.stream),this.topTerm=e.top[1];let{from:i}=r[0];this.stacks=[qz.start(this,e.top[0],i)],this.fragments=n.length&&this.stream.end-i>e.bufferLength*4?new uB(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,n=this.stacks=[],r,i;if(this.bigReductionCount>300&&e.length==1){let[t]=e;for(;t.forceReduce()&&t.stack.length&&t.stack[t.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let a=0;a<e.length;a++){let o=e[a];for(;;){if(this.tokens.mainToken=null,o.pos>t)n.push(o);else if(this.advanceStack(o,n,e))continue;else{r||(r=[],i=[]),r.push(o);let e=this.tokens.getMainToken(o);i.push(e.value,e.end)}break}}if(!n.length){let e=r&&yB(r);if(e)return sB&&console.log(`Finish with `+this.stackID(e)),this.stackToTree(e);if(this.parser.strict)throw sB&&r&&console.log(`Stuck with token `+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):`none`)),SyntaxError(`No parse at `+t);this.recovering||=5}if(this.recovering&&r){let e=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,i,n);if(e)return sB&&console.log(`Force-finish `+this.stackID(e)),this.stackToTree(e.forceAll())}if(this.recovering){let e=this.recovering==1?1:this.recovering*3;if(n.length>e)for(n.sort((e,t)=>t.score-e.score);n.length>e;)n.pop();n.some(e=>e.reducePos>t)&&this.recovering--}else if(n.length>1){outer:for(let e=0;e<n.length-1;e++){let t=n[e];for(let r=e+1;r<n.length;r++){let i=n[r];if(t.sameState(i)||t.buffer.length>500&&i.buffer.length>500)if((t.score-i.score||t.buffer.length-i.buffer.length)>0)n.splice(r--,1);else{n.splice(e--,1);continue outer}}}n.length>12&&(n.sort((e,t)=>t.score-e.score),n.splice(12,n.length-12))}this.minStackPos=n[0].pos;for(let e=1;e<n.length;e++)n[e].pos<this.minStackPos&&(this.minStackPos=n[e].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw RangeError(`Can't move stoppedAt forward`);this.stoppedAt=e}advanceStack(e,t,n){let r=e.pos,{parser:i}=this,a=sB?this.stackID(e)+` -> `:``;if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let t=e.curContext&&e.curContext.tracker.strict,n=t?e.curContext.hash:0;for(let o=this.fragments.nodeAt(r);o;){let r=this.parser.nodeSet.types[o.type.id]==o.type?i.getGoto(e.state,o.type.id):-1;if(r>-1&&o.length&&(!t||(o.prop(J.contextHash)||0)==n))return e.useNode(o,r),sB&&console.log(a+this.stackID(e)+` (via reuse of ${i.getName(o.type.id)})`),!0;if(!(o instanceof VP)||o.children.length==0||o.positions[0]>0)break;let s=o.children[0];if(s instanceof VP&&o.positions[0]==0)o=s;else break}}let o=i.stateSlot(e.state,4);if(o>0)return e.reduce(o),sB&&console.log(a+this.stackID(e)+` (via always-reduce ${i.getName(o&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let s=this.tokens.getActions(e);for(let o=0;o<s.length;){let c=s[o++],l=s[o++],u=s[o++],d=o==s.length||!n,f=d?e:e.split(),p=this.tokens.mainToken;if(f.apply(c,l,p?p.start:f.pos,u),sB&&console.log(a+this.stackID(f)+` (via ${c&65536?`reduce of ${i.getName(c&65535)}`:`shift`} for ${i.getName(l)} @ ${r}${f==e?``:`, split`})`),d)return!0;f.pos>r?t.push(f):n.push(f)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return pB(e,t),!0}}runRecovery(e,t,n){let r=null,i=!1;for(let a=0;a<e.length;a++){let o=e[a],s=t[a<<1],c=t[(a<<1)+1],l=sB?this.stackID(o)+` -> `:``;if(o.deadEnd&&(i||(i=!0,o.restart(),sB&&console.log(l+this.stackID(o)+` (restarted)`),this.advanceFully(o,n))))continue;let u=o.split(),d=l;for(let e=0;e<10&&u.forceReduce()&&(sB&&console.log(d+this.stackID(u)+` (via force-reduce)`),!this.advanceFully(u,n));e++)sB&&(d=this.stackID(u)+` -> `);for(let e of o.recoverByInsert(s))sB&&console.log(l+this.stackID(e)+` (via recover-insert)`),this.advanceFully(e,n);this.stream.end>o.pos?(c==o.pos&&(c++,s=0),o.recoverByDelete(s,c),sB&&console.log(l+this.stackID(o)+` (via recover-delete ${this.parser.getName(s)})`),pB(o,n)):(!r||r.score<u.score)&&(r=u)}return r}stackToTree(e){return e.close(),VP.build({buffer:Xz.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(cB||=new WeakMap).get(e);return t||cB.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}};function pB(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(r.pos==e.pos&&r.sameState(e)){t[n].score<e.score&&(t[n]=e);return}}t.push(e)}var mB=class{constructor(e,t,n){this.source=e,this.flags=t,this.disabled=n}allows(e){return!this.disabled||this.disabled[e]==0}},hB=e=>e,gB=class{constructor(e){this.start=e.start,this.shift=e.shift||hB,this.reduce=e.reduce||hB,this.reuse=e.reuse||hB,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}},_B=class e extends lF{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(` `);this.minRepeatTerm=t.length;for(let n=0;n<e.repeatNodeCount;n++)t.push(``);let n=Object.keys(e.topRules).map(t=>e.topRules[t][1]),r=[];for(let e=0;e<t.length;e++)r.push([]);function i(e,t,n){r[e].push([t,t.deserialize(String(n))])}if(e.nodeProps)for(let t of e.nodeProps){let e=t[0];typeof e==`string`&&(e=J[e]);for(let n=1;n<t.length;){let r=t[n++];if(r>=0)i(r,e,t[n++]);else{let a=t[n+-r];for(let o=-r;o>0;o--)i(t[n++],e,a);n++}}}this.nodeSet=new LP(t.map((t,i)=>IP.define({name:i>=this.minRepeatTerm?void 0:t,id:i,props:r[i],top:n.indexOf(i)>-1,error:i==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(i)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=jP;let a=Zz(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let e=0;e<this.specializerSpecs.length;e++)this.specialized[e]=this.specializerSpecs[e].term;this.specializers=this.specializerSpecs.map(bB),this.states=Zz(e.states,Uint32Array),this.data=Zz(e.stateData),this.goto=Zz(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(e=>typeof e==`number`?new tB(a,e):e),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let r=new fB(this,e,t,n);for(let i of this.wrappers)r=i(r,e,t,n);return r}getGoto(e,t,n=!1){let r=this.goto;if(t>=r[0])return-1;for(let i=r[t+1];;){let t=r[i++],a=t&1,o=r[i++];if(a&&n)return o;for(let n=i+(t>>1);i<n;i++)if(r[i]==e)return o;if(a)return-1}}hasAction(e,t){let n=this.data;for(let r=0;r<2;r++)for(let i=this.stateSlot(e,r?2:1),a;;i+=3){if((a=n[i])==65535)if(n[i+1]==1)a=n[i=vB(n,i+2)];else if(n[i+1]==2)return vB(n,i+2);else break;if(a==t||a==0)return vB(n,i+1)}return 0}stateSlot(e,t){return this.states[e*6+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,e=>e==t?!0:null)}allActions(e,t){let n=this.stateSlot(e,4),r=n?t(n):void 0;for(let n=this.stateSlot(e,1);r==null;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=vB(this.data,n+2);else break;r=t(vB(this.data,n+1))}return r}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=vB(this.data,n+2);else break;if(!(this.data[n+2]&1)){let e=this.data[n+1];t.some((t,n)=>n&1&&t==e)||t.push(this.data[n],e)}}return t}configure(t){let n=Object.assign(Object.create(e.prototype),this);if(t.props&&(n.nodeSet=this.nodeSet.extend(...t.props)),t.top){let e=this.topRules[t.top];if(!e)throw RangeError(`Invalid top rule name ${t.top}`);n.top=e}return t.tokenizers&&(n.tokenizers=this.tokenizers.map(e=>{let n=t.tokenizers.find(t=>t.from==e);return n?n.to:e})),t.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((e,r)=>{let i=t.specializers.find(t=>t.from==e.external);if(!i)return e;let a=Object.assign(Object.assign({},e),{external:i.to});return n.specializers[r]=bB(a),a})),t.contextTracker&&(n.context=t.contextTracker),t.dialect&&(n.dialect=this.parseDialect(t.dialect)),t.strict!=null&&(n.strict=t.strict),t.wrap&&(n.wrappers=n.wrappers.concat(t.wrap)),t.bufferLength!=null&&(n.bufferLength=t.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let r of e.split(` `)){let e=t.indexOf(r);e>=0&&(n[e]=!0)}let r=null;for(let e=0;e<t.length;e++)if(!n[e])for(let n=this.dialects[t[e]],i;(i=this.data[n++])!=65535;)(r||=new Uint8Array(this.maxTerm+1))[i]=1;return new mB(e,n,r)}static deserialize(t){return new e(t)}};function vB(e,t){return e[t]|e[t+1]<<16}function yB(e){let t=null;for(let n of e){let e=n.p.stoppedAt;(n.pos==n.p.stream.end||e!=null&&n.pos>e)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.score<n.score)&&(t=n)}return t}function bB(e){if(e.external){let t=+!!e.extend;return(n,r)=>e.external(n,r)<<1|t}return e.get}var xB=55,SB=1,CB=56,wB=2,TB=57,EB=3,DB=4,OB=5,kB=6,AB=7,jB=8,MB=9,NB=10,PB=11,FB=12,IB=13,LB=58,RB=14,zB=15,BB=59,VB=21,HB=23,UB=24,WB=25,GB=27,KB=28,qB=29,JB=32,YB=35,XB=37,ZB=38,QB=0,$B=1,eV={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},tV={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},nV={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function rV(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}var iV=null,aV=null,oV=0;function sV(e,t){let n=e.pos+t;if(oV==n&&aV==e)return iV;let r=e.peek(t),i=``;for(;rV(r);)i+=String.fromCharCode(r),r=e.peek(++t);return aV=e,oV=n,iV=i?i.toLowerCase():r==dV||r==fV?void 0:null}var cV=60,lV=62,uV=47,dV=63,fV=33,pV=45;function mV(e,t){this.name=e,this.parent=t}var hV=[kB,NB,AB,jB,MB],gV=new gB({start:null,shift(e,t,n,r){return hV.indexOf(t)>-1?new mV(sV(r,1)||``,e):e},reduce(e,t){return t==VB&&e?e.parent:e},reuse(e,t,n,r){let i=t.type.id;return i==kB||i==XB?new mV(sV(r,1)||``,e):e},strict:!1}),_V=new rB((e,t)=>{if(e.next!=cV){e.next<0&&t.context&&e.acceptToken(LB);return}e.advance();let n=e.next==uV;n&&e.advance();let r=sV(e,0);if(r===void 0)return;if(!r)return e.acceptToken(n?zB:RB);let i=t.context?t.context.name:null;if(n){if(r==i)return e.acceptToken(PB);if(i&&tV[i])return e.acceptToken(LB,-2);if(t.dialectEnabled(QB))return e.acceptToken(FB);for(let e=t.context;e;e=e.parent)if(e.name==r)return;e.acceptToken(IB)}else{if(r==`script`)return e.acceptToken(AB);if(r==`style`)return e.acceptToken(jB);if(r==`textarea`)return e.acceptToken(MB);if(eV.hasOwnProperty(r))return e.acceptToken(NB);i&&nV[i]&&nV[i][r]?e.acceptToken(LB,-1):e.acceptToken(kB)}},{contextual:!0}),vV=new rB(e=>{for(let t=0,n=0;;n++){if(e.next<0){n&&e.acceptToken(BB);break}if(e.next==pV)t++;else if(e.next==lV&&t>=2){n>=3&&e.acceptToken(BB,-2);break}else t=0;e.advance()}});function yV(e){for(;e;e=e.parent)if(e.name==`svg`||e.name==`math`)return!0;return!1}var bV=new rB((e,t)=>{if(e.next==uV&&e.peek(1)==lV){let n=t.dialectEnabled($B)||yV(t.context);e.acceptToken(n?OB:DB,2)}else e.next==lV&&e.acceptToken(DB,1)});function xV(e,t,n){let r=2+e.length;return new rB(i=>{for(let a=0,o=0,s=0;;s++){if(i.next<0){s&&i.acceptToken(t);break}if(a==0&&i.next==cV||a==1&&i.next==uV||a>=2&&a<r&&i.next==e.charCodeAt(a-2))a++,o++;else if(a==r&&i.next==lV){s>o?i.acceptToken(t,-o):i.acceptToken(n,-(o-2));break}else if((i.next==10||i.next==13)&&s){i.acceptToken(t,1);break}else a=o=0;i.advance()}})}var SV=xV(`script`,xB,SB),CV=xV(`style`,CB,wB),wV=xV(`textarea`,TB,EB),TV=jF({"Text RawText IncompleteTag IncompleteCloseTag":X.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":X.angleBracket,TagName:X.tagName,"MismatchedCloseTag/TagName":[X.tagName,X.invalid],AttributeName:X.attributeName,"AttributeValue UnquotedAttributeValue":X.attributeValue,Is:X.definitionOperator,"EntityReference CharacterReference":X.character,Comment:X.blockComment,ProcessingInst:X.processingInstruction,DoctypeDecl:X.documentMeta}),EV=_B.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G/ROOOb1G/R1G/RO)OQ&rO1G/UOOOd1G/U1G/UO)ZQ&rO1G/XOOO`1G/X1G/XO)fQ&rO1G/ZOOOa-E7]-E7]O)qQ#tO'#CzOOO`1G.w1G.wOOOb-E7^-E7^O)vQ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q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:`⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl`,maxTerm:68,context:gV,nodeProps:[[`closedBy`,-10,1,2,3,7,8,9,10,11,12,13,`EndTag`,6,`EndTag SelfClosingEndTag`,-4,22,31,34,37,`CloseTag`],[`openedBy`,4,`StartTag StartCloseTag`,5,`StartTag`,-4,30,33,36,38,`OpenTag`],[`group`,-10,14,15,18,19,20,21,40,41,42,43,`Entity`,17,`Entity TextContent`,-3,29,32,35,`TextContent Entity`],[`isolate`,-11,22,30,31,33,34,36,37,38,39,42,43,`ltr`,-3,27,28,40,``]],propSources:[TV],skippedNodes:[0],repeatNodeCount:9,tokenData:"!<p!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,Q^p$qpq,Qqr-_rs3_sv-_vw3}wxHYx}-_}!OH{!O!P-_!P!Q$q!Q![-_![!]Mz!]!^-_!^!_!$S!_!`!;x!`!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f%W-_%W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!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!<TXjSaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X",tokenizers:[SV,CV,wV,bV,_V,vV,0,1,2,3,4,5],topRules:{Document:[0,16]},dialects:{noMatch:0,selfClosing:515},tokenPrec:517});function DV(e,t){let n=Object.create(null);for(let r of e.getChildren(UB)){let e=r.getChild(WB),i=r.getChild(GB)||r.getChild(KB);e&&(n[t.read(e.from,e.to)]=i?i.type.id==GB?t.read(i.from+1,i.to-1):t.read(i.from,i.to):``)}return n}function OV(e,t){let n=e.getChild(HB);return n?t.read(n.from,n.to):` `}function kV(e,t,n){let r;for(let i of n)if(!i.attrs||i.attrs(r||=DV(e.node.parent.firstChild,t)))return{parser:i.parser,bracketed:!0};return null}function AV(e=[],t=[]){let n=[],r=[],i=[],a=[];for(let t of e)(t.tag==`script`?n:t.tag==`style`?r:t.tag==`textarea`?i:a).push(t);let o=t.length?Object.create(null):null;for(let e of t)(o[e.name]||(o[e.name]=[])).push(e);return dF((e,t)=>{let s=e.type.id;if(s==qB)return kV(e,t,n);if(s==JB)return kV(e,t,r);if(s==YB)return kV(e,t,i);if(s==VB&&a.length){let n=e.node,r=n.firstChild,i=r&&OV(r,t),o;if(i){for(let e of a)if(e.tag==i&&(!e.attrs||e.attrs(o||=DV(r,t)))){let t=n.lastChild,i=t.type.id==ZB?t.from:n.to;if(i>r.to)return{parser:e.parser,overlay:[{from:r.to,to:i}]}}}}if(o&&s==UB){let n=e.node,r;if(r=n.firstChild){let e=o[t.read(r.from,r.to)];if(e)for(let r of e){if(r.tagName&&r.tagName!=OV(n.parent,t))continue;let e=n.lastChild;if(e.type.id==GB){let t=e.from+1,n=e.lastChild,i=e.to-(n&&n.isError?0:1);if(i>t)return{parser:r.parser,overlay:[{from:t,to:i}],bracketed:!0}}else if(e.type.id==KB)return{parser:r.parser,overlay:[{from:e.from,to:e.to}]}}}}return null})}var jV=135,MV=1,NV=136,PV=137,FV=2,IV=138,LV=3,RV=4,zV=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],BV=58,VV=40,HV=95,UV=91,WV=45,GV=46,KV=35,qV=37,JV=38,YV=92,XV=10,ZV=42;function QV(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function $V(e){return e>=48&&e<=57}function eH(e){return $V(e)||e>=97&&e<=102||e>=65&&e<=70}var tH=(e,t,n)=>(r,i)=>{for(let a=!1,o=0,s=0;;s++){let{next:c}=r;if(QV(c)||c==WV||c==HV||a&&$V(c))!a&&(c!=WV||s>0)&&(a=!0),o===s&&c==WV&&o++,r.advance();else if(c==YV&&r.peek(1)!=XV){if(r.advance(),eH(r.next)){do r.advance();while(eH(r.next));r.next==32&&r.advance()}else r.next>-1&&r.advance();a=!0}else{a&&r.acceptToken(o==2&&i.canShift(FV)?t:c==VV?n:e);break}}},nH=new rB(tH(NV,FV,PV),{contextual:!0}),rH=new rB(tH(IV,LV,RV),{contextual:!0}),iH=new rB(e=>{if(zV.includes(e.peek(-1))){let{next:t}=e;(QV(t)||t==HV||t==KV||t==GV||t==ZV||t==UV||t==BV&&QV(e.peek(1))||t==WV||t==JV)&&e.acceptToken(jV)}}),aH=new rB(e=>{if(!zV.includes(e.peek(-1))){let{next:t}=e;if(t==qV&&(e.advance(),e.acceptToken(MV)),QV(t)){do e.advance();while(QV(e.next)||$V(e.next));e.acceptToken(MV)}}}),oH=jF({"AtKeyword import charset namespace keyframes media supports font-feature-values":X.definitionKeyword,"from to selector scope MatchFlag":X.keyword,NamespaceName:X.namespace,KeyframeName:X.labelName,KeyframeRangeName:X.operatorKeyword,TagName:X.tagName,ClassName:X.className,PseudoClassName:X.constant(X.className),IdName:X.labelName,"FeatureName PropertyName":X.propertyName,AttributeName:X.attributeName,NumberLiteral:X.number,KeywordQuery:X.keyword,UnaryQueryOp:X.operatorKeyword,"CallTag ValueName FontName":X.atom,VariableName:X.variableName,Callee:X.operatorKeyword,Unit:X.unit,"UniversalSelector NestingSelector":X.definitionOperator,"MatchOp CompareOp":X.compareOperator,"ChildOp SiblingOp, LogicOp":X.logicOperator,BinOp:X.arithmeticOperator,Important:X.modifier,Comment:X.blockComment,ColorLiteral:X.color,"ParenthesizedContent StringLiteral":X.string,":":X.punctuation,"PseudoOp #":X.derefOperator,"; , |":X.separator,"( )":X.paren,"[ ]":X.squareBracket,"{ }":X.brace}),sH={__proto__:null,lang:44,"nth-child":44,"nth-last-child":44,"nth-of-type":44,"nth-last-of-type":44,dir:44,"host-context":44,if:90,url:132,"url-prefix":132,domain:132,regexp:132},cH={__proto__:null,or:104,and:104,not:112,only:112,layer:186},lH={__proto__:null,selector:118,layer:182},uH={__proto__:null,"@import":178,"@media":190,"@charset":194,"@namespace":198,"@keyframes":204,"@supports":216,"@scope":220,"@font-feature-values":226},dH={__proto__:null,to:223},fH=_B.deserialize({version:14,states:"IpQYQdOOO#}QdOOP$UO`OOO%OQaO'#CfOOQP'#Ce'#CeO%VQdO'#CgO%[Q`O'#CgO%aQaO'#FdO&XQdO'#CkO&xQaO'#CcO'SQdO'#CnO'_QdO'#DtO'dQdO'#DvO'oQdO'#D}O'oQdO'#EQOOQP'#Fd'#FdO)OQhO'#EsOOQS'#Fc'#FcOOQS'#Ev'#EvQYQdOOO)VQdO'#EWO*cQhO'#E^O)VQdO'#E`O*jQdO'#EbO*uQdO'#EeO)zQhO'#EkO*}QdO'#EmO+YQdO'#EpO+_QaO'#CfO+fQ`O'#ETO+kQ`O'#FnO+vQdO'#FnQOQ`OOP,QO&jO'#CaPOOO)CAR)CAROOQP'#Ci'#CiOOQP,59R,59RO%VQdO,59ROOQP'#Cm'#CmOOQP,59V,59VO&XQdO,59VO,]QdO,59YO'_QdO,5:`O'dQdO,5:bO'oQdO,5:iO'oQdO,5:kO'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&f'U'^'sQ&f%_Q'U&aQ'^&kR's'kQ$Y!mQ$[!nQ$^!oV%j$Y$[$^Q%t$gR&t%tQ&j%gS']&j'lR'l'^Q&b%ZR'V&bQ&^%WR'T&^Q!QXR#l!QQ&W$yR'O&WQ#[nS%O#[%PR%P#]Q'`&nR'n'`Q$k!xR%x$kQ&P$pR&z&PQ&x&OR'g&xQ#WkR$w#WQ$O!dR%d$O_bOPco!R#Z$}^XOPco!R#Z$}Q!`]Q!a^Q#h|Q#i}Q#j!OQ#k!PQ$s#RQ%W#oR'S&]R%[#pQ!qdQ!zf[$V!m!n!o$Y$[$^Q$y#Yd%Y#p%Z%_&a&f&k'U'^'k'sQ%^#uQ%n$aS&U$y&WQ&[%UQ&}&VR'b&p]$X!m!n!o$Y$[$^Q!d`U!xe!q$eQ#QiQ#x!cS#{!d$OQ$Q!eQ%b#|Q%c#}Q%g$RS%r$g%tQ%w$jR'Z&iQ#z!cQ&h%`R'j'YR%i$RR%X#oQpPR#n!RQ!yeQ$d!qR%q$e",nodeNames:`⚠ Unit VariableName VariableName QueryCallee Comment StyleSheet RuleSet UniversalSelector TagSelector TagName NamespacedTagSelector NamespaceName TagName NestingSelector ClassSelector . ClassName PseudoClassSelector : :: PseudoClassName PseudoClassName ) ( ArgList ValueName ParenthesizedValue AtKeyword # ; ] [ BracketedValue } { BracedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp CallExpression Callee IfExpression if ArgList IfBranch KeywordQuery FeatureQuery FeatureName BinaryQuery LogicOp ComparisonQuery CompareOp UnaryQuery UnaryQueryOp ParenthesizedQuery SelectorQuery selector ParenthesizedSelector CallQuery ArgList , PseudoQuery CallLiteral CallTag ParenthesizedContent PseudoClassName ArgList IdSelector IdName AttributeSelector AttributeName NamespacedAttribute NamespaceName AttributeName MatchOp MatchFlag ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp Block Declaration PropertyName Important ImportStatement import Layer layer LayerName layer MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports ScopeStatement scope to FontFeatureStatement font-feature-values FontName AtRule Styles`,maxTerm:159,nodeProps:[[`isolate`,-2,5,39,``],[`openedBy`,23,`(`,31,`[`,34,`{`],[`closedBy`,24,`)`,32,`]`,35,`}`]],propSources:[oH],skippedNodes:[0,5,117],repeatNodeCount:17,tokenData:"K`~R!bOX%ZX^&R^p%Zpq&Rqr)ers)vst+jtu2Xuv%Zvw3Rwx3dxy5Ryz5dz{5i{|6S|}:u}!O;W!O!P;u!P!Q<^!Q![=V![!]>Q!]!^>|!^!_?_!_!`@Z!`!a@n!a!b%Z!b!cAo!c!k%Z!k!lC|!l!u%Z!u!vC|!v!}%Z!}#OD_#O#P%Z#P#QDp#Q#R2X#R#]%Z#]#^ER#^#g%Z#g#hC|#h#o%Z#o#pIf#p#qIw#q#rJ`#r#sJq#s#y%Z#y#z&R#z$f%Z$f$g&R$g#BY%Z#BY#BZ&R#BZ$IS%Z$IS$I_&R$I_$I|%Z$I|$JO&R$JO$JT%Z$JT$JU&R$JU$KV%Z$KV$KW&R$KW&FU%Z&FU&FV&R&FV;'S%Z;'S;=`KY<%lO%Z`%^SOy%jz;'S%j;'S;=`%{<%lO%j`%oS!e`Oy%jz;'S%j;'S;=`%{<%lO%j`&OP;=`<%l%j~&Wh$Q~OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$JT%j$JT$JU'r$JU$KV%j$KV$KW'r$KW&FU%j&FU&FV'r&FV;'S%j;'S;=`%{<%lO%j~'yh$Q~!e`OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$JT%j$JT$JU'r$JU$KV%j$KV$KW'r$KW&FU%j&FU&FV'r&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term:137,get:e=>sH[e]||-1},{term:138,get:e=>cH[e]||-1},{term:4,get:e=>lH[e]||-1},{term:28,get:e=>uH[e]||-1},{term:136,get:e=>dH[e]||-1}],tokenPrec:2256}),pH=null;function mH(){if(!pH&&typeof document==`object`&&document.body){let{style:e}=document.body,t=[],n=new Set;for(let r in e)r!=`cssText`&&r!=`cssFloat`&&typeof e[r]==`string`&&(/[A-Z]/.test(r)&&(r=r.replace(/[A-Z]/g,e=>`-`+e.toLowerCase())),n.has(r)||(t.push(r),n.add(r)));pH=t.sort().map(e=>({type:`property`,label:e,apply:e+`: `}))}return pH||[]}var hH=`active.after.any-link.autofill.backdrop.before.checked.cue.default.defined.disabled.empty.enabled.file-selector-button.first.first-child.first-letter.first-line.first-of-type.focus.focus-visible.focus-within.fullscreen.has.host.host-context.hover.in-range.indeterminate.invalid.is.lang.last-child.last-of-type.left.link.marker.modal.not.nth-child.nth-last-child.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.part.placeholder.placeholder-shown.read-only.read-write.required.right.root.scope.selection.slotted.target.target-text.valid.visited.where`.split(`.`).map(e=>({type:`class`,label:e})),gH=`above.absolute.activeborder.additive.activecaption.after-white-space.ahead.alias.all.all-scroll.alphabetic.alternate.always.antialiased.appworkspace.asterisks.attr.auto.auto-flow.avoid.avoid-column.avoid-page.avoid-region.axis-pan.background.backwards.baseline.below.bidi-override.blink.block.block-axis.bold.bolder.border.border-box.both.bottom.break.break-all.break-word.bullets.button.button-bevel.buttonface.buttonhighlight.buttonshadow.buttontext.calc.capitalize.caps-lock-indicator.caption.captiontext.caret.cell.center.checkbox.circle.cjk-decimal.clear.clip.close-quote.col-resize.collapse.color.color-burn.color-dodge.column.column-reverse.compact.condensed.contain.content.contents.content-box.context-menu.continuous.copy.counter.counters.cover.crop.cross.crosshair.currentcolor.cursive.cyclic.darken.dashed.decimal.decimal-leading-zero.default.default-button.dense.destination-atop.destination-in.destination-out.destination-over.difference.disc.discard.disclosure-closed.disclosure-open.document.dot-dash.dot-dot-dash.dotted.double.down.e-resize.ease.ease-in.ease-in-out.ease-out.element.ellipse.ellipsis.embed.end.ethiopic-abegede-gez.ethiopic-halehame-aa-er.ethiopic-halehame-gez.ew-resize.exclusion.expanded.extends.extra-condensed.extra-expanded.fantasy.fast.fill.fill-box.fixed.flat.flex.flex-end.flex-start.footnotes.forwards.from.geometricPrecision.graytext.grid.groove.hand.hard-light.help.hidden.hide.higher.highlight.highlighttext.horizontal.hsl.hsla.hue.icon.ignore.inactiveborder.inactivecaption.inactivecaptiontext.infinite.infobackground.infotext.inherit.initial.inline.inline-axis.inline-block.inline-flex.inline-grid.inline-table.inset.inside.intrinsic.invert.italic.justify.keep-all.landscape.large.larger.left.level.lighter.lighten.line-through.linear.linear-gradient.lines.list-item.listbox.listitem.local.logical.loud.lower.lower-hexadecimal.lower-latin.lower-norwegian.lowercase.ltr.luminosity.manipulation.match.matrix.matrix3d.medium.menu.menutext.message-box.middle.min-intrinsic.mix.monospace.move.multiple.multiple_mask_images.multiply.n-resize.narrower.ne-resize.nesw-resize.no-close-quote.no-drop.no-open-quote.no-repeat.none.normal.not-allowed.nowrap.ns-resize.numbers.numeric.nw-resize.nwse-resize.oblique.opacity.open-quote.optimizeLegibility.optimizeSpeed.outset.outside.outside-shape.overlay.overline.padding.padding-box.painted.page.paused.perspective.pinch-zoom.plus-darker.plus-lighter.pointer.polygon.portrait.pre.pre-line.pre-wrap.preserve-3d.progress.push-button.radial-gradient.radio.read-only.read-write.read-write-plaintext-only.rectangle.region.relative.repeat.repeating-linear-gradient.repeating-radial-gradient.repeat-x.repeat-y.reset.reverse.rgb.rgba.ridge.right.rotate.rotate3d.rotateX.rotateY.rotateZ.round.row.row-resize.row-reverse.rtl.run-in.running.s-resize.sans-serif.saturation.scale.scale3d.scaleX.scaleY.scaleZ.screen.scroll.scrollbar.scroll-position.se-resize.self-start.self-end.semi-condensed.semi-expanded.separate.serif.show.single.skew.skewX.skewY.skip-white-space.slide.slider-horizontal.slider-vertical.sliderthumb-horizontal.sliderthumb-vertical.slow.small.small-caps.small-caption.smaller.soft-light.solid.source-atop.source-in.source-out.source-over.space.space-around.space-between.space-evenly.spell-out.square.start.static.status-bar.stretch.stroke.stroke-box.sub.subpixel-antialiased.svg_masks.super.sw-resize.symbolic.symbols.system-ui.table.table-caption.table-cell.table-column.table-column-group.table-footer-group.table-header-group.table-row.table-row-group.text.text-bottom.text-top.textarea.textfield.thick.thin.threeddarkshadow.threedface.threedhighlight.threedlightshadow.threedshadow.to.top.transform.translate.translate3d.translateX.translateY.translateZ.transparent.ultra-condensed.ultra-expanded.underline.unidirectional-pan.unset.up.upper-latin.uppercase.url.var.vertical.vertical-text.view-box.visible.visibleFill.visiblePainted.visibleStroke.visual.w-resize.wait.wave.wider.window.windowframe.windowtext.words.wrap.wrap-reverse.x-large.x-small.xor.xx-large.xx-small`.split(`.`).map(e=>({type:`keyword`,label:e})).concat(`aliceblue.antiquewhite.aqua.aquamarine.azure.beige.bisque.black.blanchedalmond.blue.blueviolet.brown.burlywood.cadetblue.chartreuse.chocolate.coral.cornflowerblue.cornsilk.crimson.cyan.darkblue.darkcyan.darkgoldenrod.darkgray.darkgreen.darkkhaki.darkmagenta.darkolivegreen.darkorange.darkorchid.darkred.darksalmon.darkseagreen.darkslateblue.darkslategray.darkturquoise.darkviolet.deeppink.deepskyblue.dimgray.dodgerblue.firebrick.floralwhite.forestgreen.fuchsia.gainsboro.ghostwhite.gold.goldenrod.gray.grey.green.greenyellow.honeydew.hotpink.indianred.indigo.ivory.khaki.lavender.lavenderblush.lawngreen.lemonchiffon.lightblue.lightcoral.lightcyan.lightgoldenrodyellow.lightgray.lightgreen.lightpink.lightsalmon.lightseagreen.lightskyblue.lightslategray.lightsteelblue.lightyellow.lime.limegreen.linen.magenta.maroon.mediumaquamarine.mediumblue.mediumorchid.mediumpurple.mediumseagreen.mediumslateblue.mediumspringgreen.mediumturquoise.mediumvioletred.midnightblue.mintcream.mistyrose.moccasin.navajowhite.navy.oldlace.olive.olivedrab.orange.orangered.orchid.palegoldenrod.palegreen.paleturquoise.palevioletred.papayawhip.peachpuff.peru.pink.plum.powderblue.purple.rebeccapurple.red.rosybrown.royalblue.saddlebrown.salmon.sandybrown.seagreen.seashell.sienna.silver.skyblue.slateblue.slategray.snow.springgreen.steelblue.tan.teal.thistle.tomato.turquoise.violet.wheat.white.whitesmoke.yellow.yellowgreen`.split(`.`).map(e=>({type:`constant`,label:e}))),_H=`a.abbr.address.article.aside.b.bdi.bdo.blockquote.body.br.button.canvas.caption.cite.code.col.colgroup.dd.del.details.dfn.dialog.div.dl.dt.em.figcaption.figure.footer.form.header.hgroup.h1.h2.h3.h4.h5.h6.hr.html.i.iframe.img.input.ins.kbd.label.legend.li.main.meter.nav.ol.output.p.pre.ruby.section.select.small.source.span.strong.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.tr.u.ul`.split(`.`).map(e=>({type:`type`,label:e})),vH=[`@charset`,`@color-profile`,`@container`,`@counter-style`,`@font-face`,`@font-feature-values`,`@font-palette-values`,`@import`,`@keyframes`,`@layer`,`@media`,`@namespace`,`@page`,`@position-try`,`@property`,`@scope`,`@starting-style`,`@supports`,`@view-transition`].map(e=>({type:`keyword`,label:e})),yH=/^(\w[\w-]*|-\w[\w-]*|)$/,bH=/^-(-[\w-]*)?$/;function xH(e,t){if((e.name==`(`||e.type.isError)&&(e=e.parent||e),e.name!=`ArgList`)return!1;let n=e.parent?.firstChild;return n?.name==`Callee`?t.sliceString(n.from,n.to)==`var`:!1}var SH=new sF,CH=[`Declaration`];function wH(e){for(let t=e;;){if(t.type.isTop)return t;if(!(t=t.parent))return e}}function TH(e,t,n){if(t.to-t.from>4096){let r=SH.get(t);if(r)return r;let i=[],a=new Set,o=t.cursor(BP.IncludeAnonymous);if(o.firstChild())do for(let t of TH(e,o.node,n))a.has(t.label)||(a.add(t.label),i.push(t));while(o.nextSibling());return SH.set(t,i),i}else{let r=[],i=new Set;return t.cursor().iterate(t=>{if(n(t)&&t.matchContext(CH)&&t.node.nextSibling?.name==`:`){let n=e.sliceString(t.from,t.to);i.has(n)||(i.add(n),r.push({label:n,type:`variable`}))}}),r}}var EH=(e=>t=>{let{state:n,pos:r}=t,i=aI(n).resolveInner(r,-1),a=i.type.isError&&i.from==i.to-1&&n.doc.sliceString(i.from,i.to)==`-`;if(i.name==`PropertyName`||(a||i.name==`TagName`)&&/^(Block|Styles)$/.test(i.resolve(i.to).name))return{from:i.from,options:mH(),validFor:yH};if(i.name==`ValueName`)return{from:i.from,options:gH,validFor:yH};if(i.name==`PseudoClassName`)return{from:i.from,options:hH,validFor:yH};if(e(i)||(t.explicit||a)&&xH(i,n.doc))return{from:e(i)||a?i.from:r,options:TH(n.doc,wH(i),e),validFor:bH};if(i.name==`TagName`){for(let{parent:e}=i;e;e=e.parent)if(e.name==`Block`)return{from:i.from,options:mH(),validFor:yH};return{from:i.from,options:_H,validFor:yH}}if(i.name==`AtKeyword`)return{from:i.from,options:vH,validFor:yH};if(!t.explicit)return null;let o=i.resolve(r),s=o.childBefore(r);return s&&s.name==`:`&&o.name==`PseudoClassSelector`?{from:r,options:hH,validFor:yH}:s&&s.name==`:`&&o.name==`Declaration`||o.name==`ArgList`?{from:r,options:gH,validFor:yH}:o.name==`Block`||o.name==`Styles`?{from:r,options:mH(),validFor:yH}:null})(e=>e.name==`VariableName`),DH=iI.define({name:`css`,parser:fH.configure({props:[vI.add({Declaration:CI()}),TI.add({"Block KeyframeList":EI})]}),languageData:{commentTokens:{block:{open:`/*`,close:`*/`}},indentOnInput:/^\s*\}$/,wordChars:`-`}});function OH(){return new hI(DH,DH.data.of({autocomplete:EH}))}var kH=316,AH=317,jH=1,MH=2,NH=3,PH=4,FH=318,IH=320,LH=321,RH=5,zH=6,BH=0,VH=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],HH=125,UH=59,WH=47,GH=42,KH=43,qH=45,JH=60,YH=44,XH=63,ZH=46,QH=91,$H=new gB({start:!1,shift(e,t){return t==RH||t==zH||t==IH?e:t==LH},strict:!1}),eU=new rB((e,t)=>{let{next:n}=e;(n==HH||n==-1||t.context)&&e.acceptToken(FH)},{contextual:!0,fallback:!0}),tU=new rB((e,t)=>{let{next:n}=e,r;VH.indexOf(n)>-1||n==WH&&((r=e.peek(1))==WH||r==GH)||n!=HH&&n!=UH&&n!=-1&&!t.context&&e.acceptToken(kH)},{contextual:!0}),nU=new rB((e,t)=>{e.next==QH&&!t.context&&e.acceptToken(AH)},{contextual:!0}),rU=new rB((e,t)=>{let{next:n}=e;if(n==KH||n==qH){if(e.advance(),n==e.next){e.advance();let n=!t.context&&t.canShift(jH);e.acceptToken(n?jH:MH)}}else n==XH&&e.peek(1)==ZH&&(e.advance(),e.advance(),(e.next<48||e.next>57)&&e.acceptToken(NH))},{contextual:!0});function iU(e,t){return e>=65&&e<=90||e>=97&&e<=122||e==95||e>=192||!t&&e>=48&&e<=57}var aU=new rB((e,t)=>{if(e.next!=JH||!t.dialectEnabled(BH)||(e.advance(),e.next==WH))return;let n=0;for(;VH.indexOf(e.next)>-1;)e.advance(),n++;if(iU(e.next,!0)){for(e.advance(),n++;iU(e.next,!1);)e.advance(),n++;for(;VH.indexOf(e.next)>-1;)e.advance(),n++;if(e.next==YH)return;for(let t=0;;t++){if(t==7){if(!iU(e.next,!0))return;break}if(e.next!=`extends`.charCodeAt(t))break;e.advance(),n++}}e.acceptToken(PH,-n)}),oU=jF({"get set async static":X.modifier,"for while do if else switch try catch finally return throw break continue default case defer":X.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":X.operatorKeyword,"let var const using function class extends":X.definitionKeyword,"import export from":X.moduleKeyword,"with debugger new":X.keyword,TemplateString:X.special(X.string),super:X.atom,BooleanLiteral:X.bool,this:X.self,null:X.null,Star:X.modifier,VariableName:X.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":X.function(X.variableName),VariableDefinition:X.definition(X.variableName),Label:X.labelName,PropertyName:X.propertyName,PrivatePropertyName:X.special(X.propertyName),"CallExpression/MemberExpression/PropertyName":X.function(X.propertyName),"FunctionDeclaration/VariableDefinition":X.function(X.definition(X.variableName)),"ClassDeclaration/VariableDefinition":X.definition(X.className),"NewExpression/VariableName":X.className,PropertyDefinition:X.definition(X.propertyName),PrivatePropertyDefinition:X.definition(X.special(X.propertyName)),UpdateOp:X.updateOperator,"LineComment Hashbang":X.lineComment,BlockComment:X.blockComment,Number:X.number,String:X.string,Escape:X.escape,ArithOp:X.arithmeticOperator,LogicOp:X.logicOperator,BitOp:X.bitwiseOperator,CompareOp:X.compareOperator,RegExp:X.regexp,Equals:X.definitionOperator,Arrow:X.function(X.punctuation),": Spread":X.punctuation,"( )":X.paren,"[ ]":X.squareBracket,"{ }":X.brace,"InterpolationStart InterpolationEnd":X.special(X.brace),".":X.derefOperator,", ;":X.separator,"@":X.meta,TypeName:X.typeName,TypeDefinition:X.definition(X.typeName),"type enum interface implements namespace module declare":X.definitionKeyword,"abstract global Privacy readonly override":X.modifier,"is keyof unique infer asserts":X.operatorKeyword,JSXAttributeValue:X.attributeValue,JSXText:X.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":X.angleBracket,"JSXIdentifier JSXNameSpacedName":X.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":X.attributeName,"JSXBuiltin/JSXIdentifier":X.standard(X.tagName)}),sU={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,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&U|S+}&V&WR1^,OR+s&PT&p!W&sT&q!W&sT2^,x2_",nodeNames:`⚠ ArithOp ArithOp ?. JSXStartTag LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem`,maxTerm:380,context:$H,nodeProps:[[`isolate`,-8,5,6,14,37,39,51,53,55,``],[`group`,-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,`Statement`,-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,`Expression`,-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,`Type`,-3,88,103,109,`ClassItem`],[`openedBy`,23,`<`,38,`InterpolationStart`,56,`[`,60,`{`,73,`(`,160,`JSXStartCloseTag`],[`closedBy`,-2,24,168,`>`,40,`InterpolationEnd`,50,`]`,61,`}`,74,`)`,165,`JSXEndTag`]],propSources:[oU],skippedNodes:[0,5,6,278],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$<r#p#q$=h#q#r$>x#r#s$@U#s$f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!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr07[$D|k$i&j(Wp(Z!b'}0/l$]#t(T,2j(e$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[tU,nU,rU,aU,2,3,4,5,6,7,8,9,10,11,12,13,14,eU,new nB("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(c~~",141,340),new nB(`j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~`,25,323)],topRules:{Script:[0,7],SingleExpression:[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:327,get:e=>sU[e]||-1},{term:343,get:e=>cU[e]||-1},{term:95,get:e=>lU[e]||-1}],tokenPrec:15201}),dU=[pR("function ${name}(${params}) {\n ${}\n}",{label:`function`,detail:`definition`,type:`keyword`}),pR("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:`for`,detail:`loop`,type:`keyword`}),pR("for (let ${name} of ${collection}) {\n ${}\n}",{label:`for`,detail:`of loop`,type:`keyword`}),pR(`do {
|
|
108
|
+
\${}
|
|
109
|
+
} while (\${})`,{label:`do`,detail:`loop`,type:`keyword`}),pR(`while (\${}) {
|
|
110
|
+
\${}
|
|
111
|
+
}`,{label:`while`,detail:`loop`,type:`keyword`}),pR(`try {
|
|
112
|
+
\${}
|
|
113
|
+
} catch (\${error}) {
|
|
114
|
+
\${}
|
|
115
|
+
}`,{label:`try`,detail:`/ catch block`,type:`keyword`}),pR(`if (\${}) {
|
|
116
|
+
\${}
|
|
117
|
+
}`,{label:`if`,detail:`block`,type:`keyword`}),pR(`if (\${}) {
|
|
118
|
+
\${}
|
|
119
|
+
} else {
|
|
120
|
+
\${}
|
|
121
|
+
}`,{label:`if`,detail:`/ else block`,type:`keyword`}),pR(`class \${name} {
|
|
122
|
+
constructor(\${params}) {
|
|
123
|
+
\${}
|
|
124
|
+
}
|
|
125
|
+
}`,{label:`class`,detail:`definition`,type:`keyword`}),pR('import {${names}} from "${module}"\n${}',{label:`import`,detail:`named`,type:`keyword`}),pR('import ${name} from "${module}"\n${}',{label:`import`,detail:`default`,type:`keyword`})],fU=dU.concat([pR(`interface \${name} {
|
|
126
|
+
\${}
|
|
127
|
+
}`,{label:`interface`,detail:`definition`,type:`keyword`}),pR("type ${name} = ${type}",{label:`type`,detail:`definition`,type:`keyword`}),pR(`enum \${name} {
|
|
128
|
+
\${}
|
|
129
|
+
}`,{label:`enum`,detail:`definition`,type:`keyword`})]),pU=new sF,mU=new Set([`Script`,`Block`,`FunctionExpression`,`FunctionDeclaration`,`ArrowFunction`,`MethodDeclaration`,`ForStatement`]);function hU(e){return(t,n)=>{let r=t.node.getChild(`VariableDefinition`);return r&&n(r,e),!0}}var gU=[`FunctionDeclaration`],_U={FunctionDeclaration:hU(`function`),ClassDeclaration:hU(`class`),ClassExpression:()=>!0,EnumDeclaration:hU(`constant`),TypeAliasDeclaration:hU(`type`),NamespaceDeclaration:hU(`namespace`),VariableDefinition(e,t){e.matchContext(gU)||t(e,`variable`)},TypeDefinition(e,t){t(e,`type`)},__proto__:null};function vU(e,t){let n=pU.get(t);if(n)return n;let r=[],i=!0;function a(t,n){let i=e.sliceString(t.from,t.to);r.push({label:i,type:n})}return t.cursor(BP.IncludeAnonymous).iterate(t=>{if(i)i=!1;else if(t.name){let e=_U[t.name];if(e&&e(t,a)||mU.has(t.name))return!1}else if(t.to-t.from>8192){for(let n of vU(e,t.node))r.push(n);return!1}}),pU.set(t,r),r}var yU=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,bU=[`TemplateString`,`String`,`RegExp`,`LineComment`,`BlockComment`,`VariableDefinition`,`TypeDefinition`,`Label`,`PropertyDefinition`,`PropertyName`,`PrivatePropertyDefinition`,`PrivatePropertyName`,`JSXText`,`JSXAttributeValue`,`JSXOpenTag`,`JSXCloseTag`,`JSXSelfClosingTag`,`.`,`?.`];function xU(e){let t=aI(e.state).resolveInner(e.pos,-1);if(bU.indexOf(t.name)>-1)return null;let n=t.name==`VariableName`||t.to-t.from<20&&yU.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let r=[];for(let n=t;n;n=n.parent)mU.has(n.name)&&(r=r.concat(vU(e.state.doc,n)));return{options:r,from:n?t.from:e.pos,validFor:yU}}var SU=iI.define({name:`javascript`,parser:uU.configure({props:[vI.add({IfStatement:CI({except:/^\s*({|else\b)/}),TryStatement:CI({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:SI,SwitchBody:e=>{let t=e.textAfter,n=/^\s*\}/.test(t),r=/^\s*(case|default)\b/.test(t);return e.baseIndent+(n?0:r?1:2)*e.unit},Block:bI({closing:`}`}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":CI({except:/^\s*{/}),JSXElement(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},JSXEscape(e){let t=/\s*\}/.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"JSXOpenTag JSXSelfClosingTag"(e){return e.column(e.node.from)+e.unit}}),TI.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":EI,BlockComment(e){return{from:e.from+2,to:e.to-2}},JSXElement(e){let t=e.firstChild;if(!t||t.name==`JSXSelfClosingTag`)return null;let n=e.lastChild;return{from:t.to,to:n.type.isError?e.to:n.from}},"JSXSelfClosingTag JSXOpenTag"(e){let t=e.firstChild?.nextSibling,n=e.lastChild;return!t||t.type.isError?null:{from:t.to,to:n.type.isError?e.to:n.from}}})]}),languageData:{closeBrackets:{brackets:[`(`,`[`,`{`,`'`,`"`,"`"]},commentTokens:{line:`//`,block:{open:`/*`,close:`*/`}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:`$`}}),CU={test:e=>/^JSX/.test(e.name),facet:eI({commentTokens:{block:{open:`{/*`,close:`*/}`}}})},wU=SU.configure({dialect:`ts`},`typescript`),TU=SU.configure({dialect:`jsx`,props:[tI.add(e=>e.isTop?[CU]:void 0)]}),EU=SU.configure({dialect:`jsx ts`,props:[tI.add(e=>e.isTop?[CU]:void 0)]},`typescript`),DU=e=>({label:e,type:`keyword`}),OU=`break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield`.split(` `).map(DU),kU=OU.concat([`declare`,`implements`,`private`,`protected`,`public`].map(DU));function AU(e={}){let t=e.jsx?e.typescript?EU:TU:e.typescript?wU:SU,n=e.typescript?fU.concat(kU):dU.concat(OU);return new hI(t,[SU.data.of({autocomplete:JL(bU,qL(n))}),SU.data.of({autocomplete:xU}),e.jsx?PU:[]])}function jU(e){for(;;){if(e.name==`JSXOpenTag`||e.name==`JSXSelfClosingTag`||e.name==`JSXFragmentTag`)return e;if(e.name==`JSXEscape`||!e.parent)return null;e=e.parent}}function MU(e,t,n=e.length){for(let r=t?.firstChild;r;r=r.nextSibling)if(r.name==`JSXIdentifier`||r.name==`JSXBuiltin`||r.name==`JSXNamespacedName`||r.name==`JSXMemberExpression`)return e.sliceString(r.from,Math.min(r.to,n));return``}var NU=typeof navigator==`object`&&/Android\b/.test(navigator.userAgent),PU=q.inputHandler.of((e,t,n,r,i)=>{if((NU?e.composing:e.compositionStarted)||e.state.readOnly||t!=n||r!=`>`&&r!=`/`||!SU.isActiveAt(e.state,t,-1))return!1;let a=i(),{state:o}=a,s=o.changeByRange(e=>{let{head:t}=e,n=aI(o).resolveInner(t-1,-1),i;if(n.name==`JSXStartTag`&&(n=n.parent),!(o.doc.sliceString(t-1,t)!=r||n.name==`JSXAttributeValue`&&n.to>t)){if(r==`>`&&n.name==`JSXFragmentTag`)return{range:e,changes:{from:t,insert:`</>`}};if(r==`/`&&n.name==`JSXStartCloseTag`){let e=n.parent,r=e.parent;if(r&&e.from==t-2&&((i=MU(o.doc,r.firstChild,t))||r.firstChild?.name==`JSXFragmentTag`)){let e=`${i}>`;return{range:W.cursor(t+e.length,-1),changes:{from:t,insert:e}}}}else if(r==`>`){let r=jU(n);if(r&&r.name==`JSXOpenTag`&&!/^\/?>|^<\//.test(o.doc.sliceString(t,t+2))&&(i=MU(o.doc,r,t)))return{range:e,changes:{from:t,insert:`</${i}>`}}}}return{range:e}});return s.changes.empty?!1:(e.dispatch([a,o.update(s,{userEvent:`input.complete`,scrollIntoView:!0})]),!0)}),FU=[`_blank`,`_self`,`_top`,`_parent`],IU=[`ascii`,`utf-8`,`utf-16`,`latin1`,`latin1`],LU=[`get`,`post`,`put`,`delete`],RU=[`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`],zU=[`true`,`false`],$={},BU={a:{attrs:{href:null,ping:null,type:null,media:null,target:FU,hreflang:null}},abbr:$,address:$,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:[`default`,`rect`,`circle`,`poly`]}},article:$,aside:$,audio:{attrs:{src:null,mediagroup:null,crossorigin:[`anonymous`,`use-credentials`],preload:[`none`,`metadata`,`auto`],autoplay:[`autoplay`],loop:[`loop`],controls:[`controls`]}},b:$,base:{attrs:{href:null,target:FU}},bdi:$,bdo:$,blockquote:{attrs:{cite:null}},body:$,br:$,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:[`autofocus`],disabled:[`autofocus`],formenctype:RU,formmethod:LU,formnovalidate:[`novalidate`],formtarget:FU,type:[`submit`,`reset`,`button`]}},canvas:{attrs:{width:null,height:null}},caption:$,center:$,cite:$,code:$,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:[`command`,`checkbox`,`radio`],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:[`disabled`],checked:[`checked`]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:[`disabled`],multiple:[`multiple`]}},datalist:{attrs:{data:null}},dd:$,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:[`open`]}},dfn:$,div:$,dl:$,dt:$,em:$,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:[`disabled`],form:null,name:null}},figcaption:$,figure:$,footer:$,form:{attrs:{action:null,name:null,"accept-charset":IU,autocomplete:[`on`,`off`],enctype:RU,method:LU,novalidate:[`novalidate`],target:FU}},h1:$,h2:$,h3:$,h4:$,h5:$,h6:$,head:{children:[`title`,`base`,`link`,`style`,`meta`,`script`,`noscript`,`command`]},header:$,hgroup:$,hr:$,html:{attrs:{manifest:null}},i:$,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:[`allow-top-navigation`,`allow-same-origin`,`allow-forms`,`allow-scripts`],seamless:[`seamless`]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:[`anonymous`,`use-credentials`]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:[`audio/*`,`video/*`,`image/*`],autocomplete:[`on`,`off`],autofocus:[`autofocus`],checked:[`checked`],disabled:[`disabled`],formenctype:RU,formmethod:LU,formnovalidate:[`novalidate`],formtarget:FU,multiple:[`multiple`],readonly:[`readonly`],required:[`required`],type:[`hidden`,`text`,`search`,`tel`,`url`,`email`,`password`,`datetime`,`date`,`month`,`week`,`time`,`datetime-local`,`number`,`range`,`color`,`checkbox`,`radio`,`file`,`submit`,`image`,`reset`,`button`]}},ins:{attrs:{cite:null,datetime:null}},kbd:$,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:[`autofocus`],disabled:[`disabled`],keytype:[`RSA`]}},label:{attrs:{for:null,form:null}},legend:$,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:[`all`,`16x16`,`16x16 32x32`,`16x16 32x32 64x64`]}},map:{attrs:{name:null}},mark:$,menu:{attrs:{label:null,type:[`list`,`context`,`toolbar`]}},meta:{attrs:{content:null,charset:IU,name:[`viewport`,`application-name`,`author`,`description`,`generator`,`keywords`],"http-equiv":[`content-language`,`content-type`,`default-style`,`refresh`]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:$,noscript:$,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:[`typemustmatch`]}},ol:{attrs:{reversed:[`reversed`],start:null,type:[`1`,`a`,`A`,`i`,`I`]},children:[`li`,`script`,`template`,`ul`,`ol`]},optgroup:{attrs:{disabled:[`disabled`],label:null}},option:{attrs:{disabled:[`disabled`],label:null,selected:[`selected`],value:null}},output:{attrs:{for:null,form:null,name:null}},p:$,param:{attrs:{name:null,value:null}},pre:$,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:$,rt:$,ruby:$,samp:$,script:{attrs:{type:[`text/javascript`],src:null,async:[`async`],defer:[`defer`],charset:IU}},section:$,select:{attrs:{form:null,name:null,size:null,autofocus:[`autofocus`],disabled:[`disabled`],multiple:[`multiple`]}},slot:{attrs:{name:null}},small:$,source:{attrs:{src:null,type:null,media:null}},span:$,strong:$,style:{attrs:{type:[`text/css`],media:null,scoped:null}},sub:$,summary:$,sup:$,table:$,tbody:$,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:$,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:[`autofocus`],disabled:[`disabled`],readonly:[`readonly`],required:[`required`],wrap:[`soft`,`hard`]}},tfoot:$,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:[`row`,`col`,`rowgroup`,`colgroup`]}},thead:$,time:{attrs:{datetime:null}},title:$,tr:$,track:{attrs:{src:null,label:null,default:null,kind:[`subtitles`,`captions`,`descriptions`,`chapters`,`metadata`],srclang:null}},ul:{children:[`li`,`script`,`template`,`ul`,`ol`]},var:$,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:[`anonymous`,`use-credentials`],preload:[`auto`,`metadata`,`none`],autoplay:[`autoplay`],mediagroup:[`movie`],muted:[`muted`],controls:[`controls`]}},wbr:$},VU={accesskey:null,class:null,contenteditable:zU,contextmenu:null,dir:[`ltr`,`rtl`,`auto`],draggable:[`true`,`false`,`auto`],dropzone:[`copy`,`move`,`link`,`string:`,`file:`],hidden:[`hidden`],id:null,inert:[`inert`],itemid:null,itemprop:null,itemref:null,itemscope:[`itemscope`],itemtype:null,lang:[`ar`,`bn`,`de`,`en-GB`,`en-US`,`es`,`fr`,`hi`,`id`,`ja`,`pa`,`pt`,`ru`,`tr`,`zh`],spellcheck:zU,autocorrect:zU,autocapitalize:zU,style:null,tabindex:null,title:null,translate:[`yes`,`no`],rel:[`stylesheet`,`alternate`,`author`,`bookmark`,`help`,`license`,`next`,`nofollow`,`noreferrer`,`prefetch`,`prev`,`search`,`tag`],role:`alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer`.split(` `),"aria-activedescendant":null,"aria-atomic":zU,"aria-autocomplete":[`inline`,`list`,`both`,`none`],"aria-busy":zU,"aria-checked":[`true`,`false`,`mixed`,`undefined`],"aria-controls":null,"aria-describedby":null,"aria-disabled":zU,"aria-dropeffect":null,"aria-expanded":[`true`,`false`,`undefined`],"aria-flowto":null,"aria-grabbed":[`true`,`false`,`undefined`],"aria-haspopup":zU,"aria-hidden":zU,"aria-invalid":[`true`,`false`,`grammar`,`spelling`],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":[`off`,`polite`,`assertive`],"aria-multiline":zU,"aria-multiselectable":zU,"aria-owns":null,"aria-posinset":null,"aria-pressed":[`true`,`false`,`mixed`,`undefined`],"aria-readonly":zU,"aria-relevant":null,"aria-required":zU,"aria-selected":[`true`,`false`,`undefined`],"aria-setsize":null,"aria-sort":[`ascending`,`descending`,`none`,`other`],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},HU=`beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload`.split(` `).map(e=>`on`+e);for(let e of HU)VU[e]=null;var UU=class{constructor(e,t){this.tags={...BU,...e},this.globalAttrs={...VU,...t},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}};UU.default=new UU;function WU(e,t,n=e.length){if(!t)return``;let r=t.firstChild,i=r&&r.getChild(`TagName`);return i?e.sliceString(i.from,Math.min(i.to,n)):``}function GU(e,t=!1){for(;e;e=e.parent)if(e.name==`Element`)if(t)t=!1;else return e;return null}function KU(e,t,n){return n.tags[WU(e,GU(t))]?.children||n.allTags}function qU(e,t){let n=[];for(let r=GU(t);r&&!r.type.isTop;r=GU(r.parent)){let i=WU(e,r);if(i&&r.lastChild.name==`CloseTag`)break;i&&n.indexOf(i)<0&&(t.name==`EndTag`||t.from>=r.firstChild.to)&&n.push(i)}return n}var JU=/^[:\-\.\w\u00b7-\uffff]*$/;function YU(e,t,n,r,i){let a=/\s*>/.test(e.sliceDoc(i,i+5))?``:`>`,o=GU(n,n.name==`StartTag`||n.name==`TagName`);return{from:r,to:i,options:KU(e.doc,o,t).map(e=>({label:e,type:`type`})).concat(qU(e.doc,n).map((e,t)=>({label:`/`+e,apply:`/`+e+a,type:`type`,boost:99-t}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function XU(e,t,n,r){let i=/\s*>/.test(e.sliceDoc(r,r+5))?``:`>`;return{from:n,to:r,options:qU(e.doc,t).map((e,t)=>({label:e,apply:e+i,type:`type`,boost:99-t})),validFor:JU}}function ZU(e,t,n,r){let i=[],a=0;for(let r of KU(e.doc,n,t))i.push({label:`<`+r,type:`type`});for(let t of qU(e.doc,n))i.push({label:`</`+t+`>`,type:`type`,boost:99-a++});return{from:r,to:r,options:i,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function QU(e,t,n,r,i){let a=GU(n),o=a?t.tags[WU(e.doc,a)]:null,s=o&&o.attrs?Object.keys(o.attrs):[];return{from:r,to:i,options:(o&&o.globalAttrs===!1?s:s.length?s.concat(t.globalAttrNames):t.globalAttrNames).map(e=>({label:e,type:`property`})),validFor:JU}}function $U(e,t,n,r,i){let a=n.parent?.getChild(`AttributeName`),o=[],s;if(a){let c=e.sliceDoc(a.from,a.to),l=t.globalAttrs[c];if(!l){let r=GU(n),i=r?t.tags[WU(e.doc,r)]:null;l=i?.attrs&&i.attrs[c]}if(l){let t=e.sliceDoc(r,i).toLowerCase(),n=`"`,a=`"`;/^['"]/.test(t)?(s=t[0]==`"`?/^[^"]*$/:/^[^']*$/,n=``,a=e.sliceDoc(i,i+1)==t[0]?``:t[0],t=t.slice(1),r++):s=/^[^\s<>='"]*$/;for(let e of l)o.push({label:e,apply:n+e+a,type:`constant`})}}return{from:r,to:i,options:o,validFor:s}}function eW(e,t){let{state:n,pos:r}=t,i=aI(n).resolveInner(r,-1),a=i.resolve(r);for(let e=r,t;a==i&&(t=i.childBefore(e));){let n=t.lastChild;if(!n||!n.type.isError||n.from<n.to)break;a=i=t,e=n.from}return i.name==`TagName`?i.parent&&/CloseTag$/.test(i.parent.name)?XU(n,i,i.from,r):YU(n,e,i,i.from,r):i.name==`StartTag`||i.name==`IncompleteTag`?YU(n,e,i,r,r):i.name==`StartCloseTag`||i.name==`IncompleteCloseTag`?XU(n,i,r,r):i.name==`OpenTag`||i.name==`SelfClosingTag`||i.name==`AttributeName`?QU(n,e,i,i.name==`AttributeName`?i.from:r,r):i.name==`Is`||i.name==`AttributeValue`||i.name==`UnquotedAttributeValue`?$U(n,e,i,i.name==`Is`?r:i.from,r):t.explicit&&(a.name==`Element`||a.name==`Text`||a.name==`Document`)?ZU(n,e,i,r):null}function tW(e){return eW(UU.default,e)}function nW(e){let{extraTags:t,extraGlobalAttributes:n}=e,r=n||t?new UU(t,n):UU.default;return e=>eW(r,e)}var rW=SU.parser.configure({top:`SingleExpression`}),iW=[{tag:`script`,attrs:e=>e.type==`text/typescript`||e.lang==`ts`,parser:wU.parser},{tag:`script`,attrs:e=>e.type==`text/babel`||e.type==`text/jsx`,parser:TU.parser},{tag:`script`,attrs:e=>e.type==`text/typescript-jsx`,parser:EU.parser},{tag:`script`,attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:rW},{tag:`script`,attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:SU.parser},{tag:`style`,attrs(e){return(!e.lang||e.lang==`css`)&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:DH.parser}],aW=[{name:`style`,parser:DH.parser.configure({top:`Styles`})}].concat(HU.map(e=>({name:e,parser:SU.parser}))),oW=iI.define({name:`html`,parser:EV.configure({props:[vI.add({Element(e){let t=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+t[0].length?e.continue():e.lineIndent(e.node.from)+(t[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].length<e.node.to)return e.continue();let t=null,n;for(let n=e.node;;){let e=n.lastChild;if(!e||e.name!=`Element`||e.to!=n.to)break;t=n=e}return t&&!((n=t.lastChild)&&(n.name==`CloseTag`||n.name==`SelfClosingTag`))?e.lineIndent(t.from)+e.unit:null}}),TI.add({Element(e){let t=e.firstChild,n=e.lastChild;return!t||t.name!=`OpenTag`?null:{from:t.to,to:n.name==`CloseTag`?n.from:e.to}}}),PI.add({"OpenTag CloseTag":e=>e.getChild(`TagName`)})]}),languageData:{commentTokens:{block:{open:`<!--`,close:`-->`}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:`-_`}}),sW=oW.configure({wrap:AV(iW,aW)});function cW(e={}){let t=``,n;return e.matchClosingTags===!1&&(t=`noMatch`),e.selfClosingTags===!0&&(t=(t?t+` `:``)+`selfClosing`),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(n=AV((e.nestedLanguages||[]).concat(iW),(e.nestedAttributes||[]).concat(aW))),new hI(n?oW.configure({wrap:n,dialect:t}):t?sW.configure({dialect:t}):sW,[sW.data.of({autocomplete:nW(e)}),e.autoCloseTags===!1?[]:uW,AU().support,OH().support])}var lW=new Set(`area base br col command embed frame hr img input keygen link meta param source track wbr menuitem`.split(` `)),uW=q.inputHandler.of((e,t,n,r,i)=>{if(e.composing||e.state.readOnly||t!=n||r!=`>`&&r!=`/`||!sW.isActiveAt(e.state,t,-1))return!1;let a=i(),{state:o}=a,s=o.changeByRange(e=>{let t=o.doc.sliceString(e.from-1,e.to)==r,{head:n}=e,i=aI(o).resolveInner(n,-1),a;if(t&&r==`>`&&i.name==`EndTag`){let t=i.parent;if(t.parent?.lastChild?.name!=`CloseTag`&&(a=WU(o.doc,t.parent,n))&&!lW.has(a))return{range:e,changes:{from:n,to:n+ +(o.doc.sliceString(n,n+1)===`>`),insert:`</${a}>`}}}else if(t&&r==`/`&&i.name==`IncompleteCloseTag`){let e=i.parent;if(i.from==n-2&&e.lastChild?.name!=`CloseTag`&&(a=WU(o.doc,e,n))&&!lW.has(a)){let e=n+ +(o.doc.sliceString(n,n+1)===`>`),t=`${a}>`;return{range:W.cursor(n+t.length,-1),changes:{from:n,to:e,insert:t}}}}return{range:e}});return s.changes.empty?!1:(e.dispatch([a,o.update(s,{userEvent:`input.complete`,scrollIntoView:!0})]),!0)}),dW=eI({commentTokens:{block:{open:`<!--`,close:`-->`}}}),fW=new J,pW=Sz.configure({props:[TI.add(e=>!e.is(`Block`)||e.is(`Document`)||mW(e)!=null||hW(e)?void 0:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})),fW.add(mW),vI.add({Document:()=>null}),$F.add({Document:dW})]});function mW(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function hW(e){return e.name==`OrderedList`||e.name==`BulletList`}function gW(e,t){let n=e;for(;;){let e=n.nextSibling,r;if(!e||(r=mW(e.type))!=null&&r<=t)break;n=e}return n.to}var _W=wI.of((e,t,n)=>{for(let r=aI(e).resolveInner(n,-1);r&&!(r.from<t);r=r.parent){let e=r.type.prop(fW);if(e==null)continue;let t=gW(r,e);if(t>n)return{from:n,to:t}}return null});function vW(e){return new nI(dW,e,[],`markdown`)}var yW=vW(pW),bW=vW(pW.configure([Hz,Gz,Wz,Kz,{props:[TI.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]));function xW(e,t){return n=>{if(n&&e){let t=null;if(n=/\S*/.exec(n)[0],t=typeof e==`function`?e(n):gI.matchLanguageName(e,n,!0),t instanceof gI)return t.support?t.support.language.parser:cI.getSkippingParser(t.load());if(t)return t.parser}return t?t.parser:null}}var SW=class{constructor(e,t,n,r,i,a,o){this.node=e,this.from=t,this.to=n,this.spaceBefore=r,this.spaceAfter=i,this.type=a,this.item=o}blank(e,t=!0){let n=this.spaceBefore+(this.node.name==`Blockquote`?`>`:``);if(e!=null){for(;n.length<e;)n+=` `;return n}else{for(let e=this.to-this.from-n.length-this.spaceAfter.length;e>0;e--)n+=` `;return n+(t?this.spaceAfter:``)}}marker(e,t){let n=this.node.name==`OrderedList`?String(+wW(this.item,e)[2]+t):``;return this.spaceBefore+n+this.type+this.spaceAfter}};function CW(e,t){let n=[],r=[];for(let t=e;t;t=t.parent){if(t.name==`FencedCode`)return r;(t.name==`ListItem`||t.name==`Blockquote`)&&n.push(t)}for(let e=n.length-1;e>=0;e--){let i=n[e],a,o=t.lineAt(i.from),s=i.from-o.from;if(i.name==`Blockquote`&&(a=/^ *>( ?)/.exec(o.text.slice(s))))r.push(new SW(i,s,s+a[0].length,``,a[1],`>`,null));else if(i.name==`ListItem`&&i.parent.name==`OrderedList`&&(a=/^( *)\d+([.)])( *)/.exec(o.text.slice(s)))){let e=a[3],t=a[0].length;e.length>=4&&(e=e.slice(0,e.length-4),t-=4),r.push(new SW(i.parent,s,s+t,a[1],e,a[2],i))}else if(i.name==`ListItem`&&i.parent.name==`BulletList`&&(a=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(o.text.slice(s)))){let e=a[4],t=a[0].length;e.length>4&&(e=e.slice(0,e.length-4),t-=4);let n=a[2];a[3]&&(n+=a[3].replace(/[xX]/,` `)),r.push(new SW(i.parent,s,s+t,a[1],e,n,i))}}return r}function wW(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function TW(e,t,n,r=0){for(let i=-1,a=e;;){if(a.name==`ListItem`){let e=wW(a,t),o=+e[2];if(i>=0){if(o!=i+1)return;n.push({from:a.from+e[1].length,to:a.from+e[0].length,insert:String(i+2+r)})}i=o}let e=a.nextSibling;if(!e)break;a=e}}function EW(e,t){let n=/^[ \t]*/.exec(e)[0].length;if(!n||t.facet(_I)!=` `)return e;let r=IO(e,4,n),i=``;for(let e=r;e>0;)e>=4?(i+=` `,e-=4):(i+=` `,e--);return i+e.slice(n)}var DW=((e={})=>({state:t,dispatch:n})=>{let r=aI(t),{doc:i}=t,a=null,o=t.changeByRange(n=>{if(!n.empty||!bW.isActiveAt(t,n.from,-1)&&!bW.isActiveAt(t,n.from,1))return a={range:n};let o=n.from,s=i.lineAt(o),c=CW(r.resolveInner(o,-1),i);for(;c.length&&c[c.length-1].from>o-s.from;)c.pop();if(!c.length)return a={range:n};let l=c[c.length-1];if(l.to-l.spaceAfter.length>o-s.from)return a={range:n};let u=o>=l.to-l.spaceAfter.length&&!/\S/.test(s.text.slice(l.to));if(l.item&&u){let n=l.node.firstChild,r=l.node.getChild(`ListItem`,`ListItem`);if(n.to>=o||r&&r.to<o||s.from>0&&!/[^\s>]/.test(i.lineAt(s.from-1).text)||e.nonTightLists===!1){let e=c.length>1?c[c.length-2]:null,t,n=``;e&&e.item?(t=s.from+e.from,n=e.marker(i,1)):t=s.from+(e?e.to:0);let r=[{from:t,to:o,insert:n}];return l.node.name==`OrderedList`&&TW(l.item,i,r,-2),e&&e.node.name==`OrderedList`&&TW(e.item,i,r),{range:W.cursor(t+n.length),changes:r}}else{let e=AW(c,t,s);return{range:W.cursor(o+e.length+1),changes:{from:s.from,insert:e+t.lineBreak}}}}if(l.node.name==`Blockquote`&&u&&s.from){let e=i.lineAt(s.from-1),r=/>\s*$/.exec(e.text);if(r&&r.index==l.from){let i=t.changes([{from:e.from+r.index,to:e.to},{from:s.from+l.from,to:s.to}]);return{range:n.map(i),changes:i}}}let d=[];l.node.name==`OrderedList`&&TW(l.item,i,d);let f=l.item&&l.item.from<s.from,p=``;if(!f||/^[\s\d.)\-+*>]*/.exec(s.text)[0].length>=l.to)for(let e=0,t=c.length-1;e<=t;e++)p+=e==t&&!f?c[e].marker(i,1):c[e].blank(e<t?IO(s.text,4,c[e+1].from)-p.length:null);let m=o;for(;m>s.from&&/\s/.test(s.text.charAt(m-s.from-1));)m--;return p=EW(p,t),kW(l.node,t.doc)&&(p=AW(c,t,s)+t.lineBreak+p),d.push({from:m,to:o,insert:t.lineBreak+p}),{range:W.cursor(m+p.length+1),changes:d}});return a?!1:(n(t.update(o,{scrollIntoView:!0,userEvent:`input`})),!0)})();function OW(e){return e.name==`QuoteMark`||e.name==`ListMark`}function kW(e,t){if(e.name!=`OrderedList`&&e.name!=`BulletList`)return!1;let n=e.firstChild,r=e.getChild(`ListItem`,`ListItem`);if(!r)return!1;let i=t.lineAt(n.to),a=t.lineAt(r.from),o=/^[\s>]*$/.test(i.text);return i.number+ +!o<a.number}function AW(e,t,n){let r=``;for(let t=0,i=e.length-2;t<=i;t++)r+=e[t].blank(t<i?IO(n.text,4,e[t+1].from)-r.length:null,t<i);return EW(r,t)}function jW(e,t){let n=e.resolveInner(t,-1),r=t;OW(n)&&(r=n.from,n=n.parent);for(let e;e=n.childBefore(r);)if(OW(e))r=e.from;else if(e.name==`OrderedList`||e.name==`BulletList`)n=e.lastChild,r=n.to;else break;return n}var MW=[{key:`Enter`,run:DW},{key:`Backspace`,run:({state:e,dispatch:t})=>{let n=aI(e),r=null,i=e.changeByRange(t=>{let i=t.from,{doc:a}=e;if(t.empty&&bW.isActiveAt(e,t.from)){let t=a.lineAt(i),r=CW(jW(n,i),a);if(r.length){let n=r[r.length-1],a=n.to-n.spaceAfter.length+ +!!n.spaceAfter;if(i-t.from>a&&!/\S/.test(t.text.slice(a,i-t.from)))return{range:W.cursor(t.from+a),changes:{from:t.from+a,to:i}};if(i-t.from==a&&(!n.item||t.from<=n.item.from||!/\S/.test(t.text.slice(0,n.to)))){let r=t.from+n.from;if(n.item&&n.node.from<n.item.from&&/\S/.test(t.text.slice(n.from,n.to))){let i=n.blank(IO(t.text,4,n.to)-IO(t.text,4,n.from));return r==t.from&&(i=EW(i,e)),{range:W.cursor(r+i.length),changes:{from:r,to:t.from+n.to,insert:i}}}if(r<i)return{range:W.cursor(r),changes:{from:r,to:i}}}}}return r={range:t}});return r?!1:(t(e.update(i,{scrollIntoView:!0,userEvent:`delete`})),!0)}}],NW=cW({matchClosingTags:!1});function PW(e={}){let{codeLanguages:t,defaultCodeLanguage:n,addKeymap:r=!0,base:{parser:i}=yW,completeHTMLTags:a=!0,pasteURLAsLink:o=!0,htmlTagLanguage:s=NW}=e;if(!(i instanceof JR))throw RangeError("Base parser provided to `markdown` should be a Markdown parser");let c=e.extensions?[e.extensions]:[],l=[s.support,_W],u;o&&l.push(zW),n instanceof hI?(l.push(n.support),u=n.language):n&&(u=n);let d=t||u?xW(t,u):void 0;c.push(wz({codeParser:d,htmlParser:s.language.parser})),r&&l.push(LD.high(nP.of(MW)));let f=vW(i.configure(c));return a&&l.push(f.data.of({autocomplete:FW})),new hI(f,l)}function FW(e){let{state:t,pos:n}=e,r=/<[:\-\.\w\u00b7-\uffff]*$/.exec(t.sliceDoc(n-25,n));if(!r)return null;let i=aI(t).resolveInner(n,-1);for(;i&&!i.type.isTop;){if(i.name==`CodeBlock`||i.name==`FencedCode`||i.name==`ProcessingInstructionBlock`||i.name==`CommentBlock`||i.name==`Link`||i.name==`Image`)return null;i=i.parent}return{from:n-r[0].length,to:n,options:LW(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}var IW=null;function LW(){if(IW)return IW;let e=tW(new WL(gO.create({extensions:NW}),0,!0));return IW=e?e.options:[]}var RW=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,zW=q.domEventHandlers({paste:(e,t)=>{let{main:n}=t.state.selection;if(n.empty)return!1;let r=e.clipboardData?.getData(`text/plain`);if(!r||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(r)||(/^www\./.test(r)&&(r=`https://`+r),!bW.isActiveAt(t.state,n.from,1)))return!1;let i=aI(t.state),a=!1;return i.iterate({from:n.from,to:n.to,enter:e=>{(e.from>n.from||RW.test(e.name))&&(a=!0)},leave:e=>{e.to<n.to&&(a=!0)}}),a?!1:(t.dispatch({changes:[{from:n.from,insert:`[`},{from:n.to,insert:`](${r})`}],userEvent:`input.paste`,scrollIntoView:!0}),!0)}});function BW(e,t,n={}){if(!e)return!1;let{pulse:r=!1,behavior:i=`smooth`}=n,a=t.querySelector(`[data-annotation-id="${CSS.escape(e)}"]`);if(!a)return!1;let o=a.closest(`.semiont-browse-view__content`)||a.closest(`.semiont-annotate-view__content`)||a.closest(`.semiont-document-viewer__scrollable-body`);if(o){let e=a.getBoundingClientRect(),t=o.getBoundingClientRect();if(!(e.top>=t.top&&e.bottom<=t.bottom)){let e=a.offsetTop,t=o.clientHeight,n=a.offsetHeight,r=e-t/2+n/2;o.scrollTo({top:r,behavior:i})}}return r&&(a.classList.add(`annotation-pulse`),setTimeout(()=>{a.classList.remove(`annotation-pulse`)},2e3)),!0}function VW(e,t){if(!t.includes(`\r
|
|
130
|
+
`))return e;let n=[];for(let e=0;e<t.length-1;e++)t[e]===`\r`&&t[e+1]===`
|
|
131
|
+
`&&n.push(e);let r=e=>{let t=0,r=n.length;for(;t<r;){let i=t+r>>>1;n[i]<e?t=i+1:r=i}return e-t};return e.map(e=>({...e,start:r(e.start),end:r(e.end)}))}function HW(e){let t=$o(e),n=Xo(e),r=Qo(e),i=es(e),a=Zo(e),o=ns(e);return t?`Comment`:n?`Highlight`:r?`Assessment`:i?`Tag`:o?`Resolved Reference`:a?`Unresolved Reference`:`Annotation`}function UW(e,t,n){let r=Object.values(zE).find(t=>t.matchesAnnotation(e))?.className||`annotation-highlight`,i=n?.confidence&&n.confidence!==`high`?` annotation-low-confidence`:``,a=`${r}${t?` annotation-sparkle`:``}${i}`,o=Xo(e),s=Zo(e),c=$o(e),l=Qo(e),u=es(e),d=`highlight`;c?d=`comment`:s?d=`reference`:l?d=`assessment`:u?d=`tag`:o&&(d=`highlight`);let f=HW(e),p=n?.strategy&&n.strategy!==`fast-path`&&n.strategy!==`unique-occurrence`?`${f} (anchored: ${n.strategy})`:f;return{className:a,annotationType:d,annotationId:e.id,tooltip:p,...n?.strategy===void 0?{}:{strategy:n.strategy},...n?.confidence===void 0?{}:{confidence:n.confidence}}}function WW(e,t){return e.filter(e=>e.annotation).sort((e,t)=>e.start-t.start).map(e=>{let n=e.annotation,r=t?.has(n.id)||!1;return{start:e.start,end:e.end,meta:UW(n,r,{...e.strategy===void 0?{}:{strategy:e.strategy},...e.confidence===void 0?{}:{confidence:e.confidence}})}})}function GW(e,t,n){return e.filter(e=>e.annotation&&Zo(e.annotation)).sort((e,t)=>e.end-t.end).map(e=>{let r=e.annotation,i=qo(r.body),a=i?n?.(i):void 0,o=t?r.id===t:!1;return{annotationId:r.id,position:e.end,targetName:a,isGenerating:o,bodySource:i??void 0}})}function KW(e,t,n){let r=e.closest(`[data-annotation-id]`)?.getAttribute(`data-annotation-id`);if(!r)return!1;let i=t.get(r);return i?.annotation?(n.client.browse.click(Eo(r),i.annotation.motivation),!0):!1}function qW(e){let t=e.closest(`.reference-preview-widget`);if(!t||t.dataset.widgetGenerating===`true`)return{handled:!1};let n=t.dataset.widgetAnnotationId,r=t.dataset.widgetBodySource,i=t.dataset.widgetResolved===`true`;return n?i&&r?{handled:!0,action:`navigate`,resourceId:r,annotationId:n}:{handled:!0,action:`browse-click`,annotationId:n,motivation:t.dataset.widgetMotivation||`linking`}:{handled:!1}}function JW(e,t){e.handled&&(e.action===`navigate`&&e.resourceId?t.client.browse.navigateReference(To(e.resourceId)):e.action===`browse-click`&&e.annotationId&&t.client.browse.click(Eo(e.annotationId),e.motivation||`linking`))}function YW(e){let t=e.closest(`.reference-preview-widget`);if(!t||t.dataset.widgetGenerating===`true`)return{showPreview:!1,widget:null};let n=t.querySelector(`.reference-indicator`);return n&&(n.style.opacity=`1`),t.dataset.widgetResolved===`true`&&t.dataset.widgetTargetName?{showPreview:!0,targetName:t.dataset.widgetTargetName,widget:t}:{showPreview:!1,widget:t}}function XW(e){let t=e.closest(`.reference-preview-widget`);if(!t)return{hidePreview:!1,widget:null};let n=t.querySelector(`.reference-indicator`);return n&&(n.style.opacity=`0.6`),t.dataset.widgetResolved===`true`?{hidePreview:!0,widget:t}:{hidePreview:!1,widget:t}}var ZW=tO.define(),QW=tO.define();function $W(e,t){let n=new TO,r=WW(e,t);for(let{start:e,end:t,meta:i}of r){let r=_k.mark({class:i.className,attributes:{"data-annotation-id":i.annotationId,"data-annotation-type":i.annotationType,...i.strategy?{"data-anchor-strategy":i.strategy}:{},...i.confidence?{"data-anchor-confidence":i.confidence}:{},title:i.tooltip}});n.add(e,t,r)}return n.finish()}function eG(){return PD.define({create(){return _k.none},update(e,t){e=e.map(t.changes);for(let n of t.effects)n.is(ZW)&&(e=$W(n.value.segments,n.value.newAnnotationIds));return e},provide:e=>q.decorations.from(e)})}function tG(e,t,n,r){let i=new TO,a=GW(t,n,r),o=new Map;for(let e of t)e.annotation&&Zo(e.annotation)&&o.set(e.end,e);for(let e of a){let t=o.get(e.position);if(!t?.annotation)continue;let n=new WI(t.annotation,e.targetName,e.isGenerating);i.add(e.position,e.position,_k.widget({widget:n,side:1}))}return i.finish()}var nG=PD.define({create(){return _k.none},update(e,t){e=e.map(t.changes);for(let n of t.effects)n.is(QW)&&(e=tG(n.value.content,n.value.segments,n.value.generatingReferenceId,n.value.getTargetResourceName));return e},provide:e=>q.decorations.from(e)});function rG({content:e,segments:t=[],onChange:n,editable:r=!1,newAnnotationIds:i,hoveredAnnotationId:a,scrollToAnnotationId:o,sourceView:s=!1,showLineNumbers:c=!1,enableWidgets:l=!1,session:d,getTargetResourceName:f,generatingReferenceId:p,hoverDelayMs:m}){let h=(0,u.useRef)(null),g=(0,u.useRef)(null),_=(0,u.useRef)(e),v=VW(t,e),y=(0,u.useRef)(v),b=(0,u.useRef)(new Map),x=(0,u.useRef)(new zD),S=(0,u.useRef)(d),C=(0,u.useRef)(f);y.current=t;let w=new Map;for(let e of t)e.annotation&&w.set(e.annotation.id,e);return b.current=w,S.current=d,C.current=f,(0,u.useEffect)(()=>{if(!h.current||g.current)return;let t=eG(),i=new q({state:gO.create({doc:e,extensions:[PW(),x.current.of(c?kP():[]),q.editable.of(r),q.lineWrapping,t,l?nG:[],q.updateListener.of(e=>{if(e.docChanged&&n){let t=e.state.doc.toString();_.current=t,n(t)}}),q.domEventHandlers({click:(e,t)=>{let n=e.target;return S.current&&KW(n,b.current,S.current)?(e.preventDefault(),!0):!1}}),q.baseTheme({"&.cm-editor":{height:`100%`,outline:`none`},"&.cm-editor.cm-focused":{outline:`none`},".cm-scroller":{overflow:`visible !important`,height:`auto !important`},".cm-content, .cm-gutters":{minHeight:`0 !important`},".cm-content":{padding:s?`1rem`:`0`,fontFamily:s?`ui-monospace, monospace`:`inherit`,fontSize:s?`0.875rem`:`inherit`,lineHeight:`1.6`,whiteSpace:s?`pre-wrap`:`pre`,caretColor:`var(--cm-cursor-color, #000000)`},".cm-line":{padding:`0`,wordBreak:s?`break-word`:`normal`},".cm-gutters":{backgroundColor:`transparent`,border:`none`,paddingRight:`0.5rem`},".cm-lineNumbers .cm-gutterElement":{minWidth:`2rem`,color:`rgb(156, 163, 175)`,opacity:`0.7`}})]}),parent:h.current});g.current=i,_.current=e,h.current.__cmView=i;let a=i.dom,{handleMouseEnter:o,handleMouseLeave:u,cleanup:d}=hf(e=>S.current?.client.beckon.hover(e),m),f=e=>{let t=e.target.closest(`[data-annotation-id]`)?.getAttribute(`data-annotation-id`);t&&o(Eo(t))},p=e=>{e.target.closest(`[data-annotation-id]`)&&u()},v=e=>{let t=e.target,n=qW(t);n.handled&&(e.preventDefault(),e.stopPropagation(),S.current&&JW(n,S.current))},y=e=>{let t=e.target,n=YW(t);n.showPreview&&n.targetName&&n.widget&&GI(n.widget,n.targetName)},C=e=>{let t=e.target,n=XW(t);n.hidePreview&&n.widget&&KI(n.widget)};return a.addEventListener(`mouseover`,f),a.addEventListener(`mouseout`,p),a.addEventListener(`click`,v),a.addEventListener(`mouseenter`,y,!0),a.addEventListener(`mouseleave`,C,!0),()=>{a.removeEventListener(`mouseover`,f),a.removeEventListener(`mouseout`,p),a.removeEventListener(`click`,v),a.removeEventListener(`mouseenter`,y,!0),a.removeEventListener(`mouseleave`,C,!0),d(),i.destroy(),g.current=null}},[m]),(0,u.useEffect)(()=>{if(!g.current||e===g.current.state.doc.toString())return;let t=g.current.state.selection.main;g.current.dispatch({changes:{from:0,to:g.current.state.doc.length,insert:e},selection:t.from<=e.length?t:void 0}),_.current=e},[e]),(0,u.useEffect)(()=>{g.current&&g.current.dispatch({effects:x.current.reconfigure(c?kP():[])})},[c]),(0,u.useEffect)(()=>{g.current&&g.current.dispatch({effects:ZW.of({segments:v,...i&&{newAnnotationIds:i}})})},[v,i]),(0,u.useEffect)(()=>{!g.current||!l||g.current.dispatch({effects:QW.of({content:e,segments:v,generatingReferenceId:p,getTargetResourceName:C.current})})},[e,v,l,p]),(0,u.useEffect)(()=>{if(!g.current||!a)return;let e=g.current.contentDOM.querySelector(`[data-annotation-id="${CSS.escape(a)}"]`);if(!e)return;let t=e.closest(`.semiont-annotate-view__content`)||e.closest(`.semiont-document-viewer__scrollable-body`);if(t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect();if(!(n.top>=r.top&&n.bottom<=r.bottom)){let n=e.offsetTop,r=t.clientHeight,i=e.offsetHeight,a=n-r/2+i/2;t.scrollTo({top:a,behavior:`smooth`})}}let n=setTimeout(()=>{e.classList.add(`annotation-pulse`)},100);return()=>{clearTimeout(n),e.classList.remove(`annotation-pulse`)}},[a]),(0,u.useEffect)(()=>{!g.current||!o||BW(o,g.current.contentDOM)},[o]),(0,F.jsx)(`div`,{ref:h,className:s?`semiont-codemirror semiont-codemirror--source`:`semiont-codemirror`,"data-markdown-container":!0})}function iG({progress:e,annotationType:t=`reference`,cancelJobType:n,translations:r}){let i=Z(kg().activeSession$);return e?(0,F.jsxs)(`div`,{className:`semiont-annotation-progress`,"data-status":e.stage,"data-type":t,children:[(0,F.jsxs)(`div`,{className:`semiont-annotation-header`,children:[(0,F.jsxs)(`h3`,{className:`semiont-annotation-title`,children:[(0,F.jsx)(`span`,{className:`semiont-annotation-sparkle`,children:`✨`}),r.title]}),e.stage!==`complete`&&(0,F.jsx)(`button`,{onClick:()=>{i?.client.job.cancelRequest(n)},className:`semiont-annotation-cancel`,title:r.cancel,children:`✕`})]}),e.requestParams&&e.requestParams.length>0&&(0,F.jsxs)(`div`,{className:`semiont-annotation-progress__params`,children:[(0,F.jsx)(`div`,{className:`semiont-annotation-progress__params-title`,children:`Request Parameters:`}),e.requestParams.map((e,t)=>(0,F.jsxs)(`div`,{className:`semiont-annotation-progress__param`,children:[(0,F.jsxs)(`span`,{className:`semiont-annotation-progress__param-label`,children:[e.label,`:`]}),` `,e.value]},t))]}),r.found&&e.completedEntityTypes&&e.completedEntityTypes.length>0&&(0,F.jsx)(`div`,{className:`semiont-annotation-log`,children:e.completedEntityTypes.map((e,t)=>(0,F.jsxs)(`div`,{className:`semiont-annotation-log-item`,children:[(0,F.jsx)(`span`,{className:`semiont-annotation-check`,children:`✓`}),(0,F.jsxs)(`span`,{className:`semiont-annotation-entity-type`,children:[e.entityType,`:`]}),(0,F.jsx)(`span`,{children:r.found?.(e.foundCount)})]},t))}),(0,F.jsxs)(`div`,{className:`semiont-annotation-progress__status`,children:[e.stage===`complete`?(0,F.jsxs)(`div`,{className:`semiont-annotation-progress__message`,children:[(0,F.jsx)(`span`,{className:`semiont-annotation-progress__icon`,children:`✅`}),(0,F.jsx)(`span`,{children:r.complete})]}):e.stage===`error`?(0,F.jsxs)(`div`,{className:`semiont-annotation-progress__message`,children:[(0,F.jsx)(`span`,{className:`semiont-annotation-progress__icon`,children:`❌`}),(0,F.jsx)(`span`,{children:e.message||r.failed})]}):(0,F.jsxs)(`div`,{className:`semiont-annotation-progress__message`,children:[(0,F.jsx)(`span`,{className:`semiont-annotation-progress__icon`,children:`✨`}),(0,F.jsx)(`span`,{children:e.message||(e.currentEntityType&&r.current?r.current(e.currentEntityType):r.inProgress)})]}),e.currentEntityType&&e.stage!==`complete`&&e.stage!==`error`&&(0,F.jsxs)(`div`,{className:`semiont-annotation-progress__details`,children:[`Processing: `,e.currentEntityType]})]})]}):null}var aG=class extends u.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){this.props.onError&&this.props.onError(e,t)}handleReset=()=>{this.setState({hasError:!1,error:null})};render(){return this.state.hasError&&this.state.error?this.props.fallback?this.props.fallback(this.state.error,this.handleReset):(0,F.jsx)(oG,{error:this.state.error,reset:this.handleReset}):this.props.children}};function oG({error:e,reset:t}){return(0,F.jsx)(`div`,{className:`semiont-error-boundary-container`,children:(0,F.jsxs)(`div`,{className:`semiont-error-boundary-content`,children:[(0,F.jsxs)(`div`,{className:`semiont-error-boundary-header`,children:[(0,F.jsx)(`h2`,{className:`semiont-error-boundary-title`,children:`Oops! Something went wrong`}),(0,F.jsx)(`p`,{className:`semiont-error-boundary-message`,children:`We encountered an unexpected error. Please try again.`})]}),!1,(0,F.jsxs)(`div`,{className:`semiont-error-boundary-actions`,children:[(0,F.jsx)(`button`,{onClick:t,className:`semiont-button`,"data-variant":`primary`,children:`Try Again`}),(0,F.jsx)(`button`,{onClick:()=>window.location.href=`/`,className:`semiont-button`,"data-variant":`secondary`,children:`Go Home`})]})]})})}function sG({children:e,resetKeys:t}){return(0,F.jsx)(Jg,{FallbackComponent:cG,onError:(e,t)=>{},...t&&{resetKeys:t},children:e})}function cG({error:e,resetErrorBoundary:t}){return e instanceof Error&&e.message,e instanceof Error&&e.stack,(0,F.jsx)(`div`,{className:`semiont-protected-error-boundary-container`,children:(0,F.jsxs)(`div`,{className:`semiont-protected-error-boundary-card`,children:[(0,F.jsxs)(`div`,{className:`semiont-protected-error-boundary-header`,children:[(0,F.jsx)(`div`,{className:`semiont-protected-error-boundary-icon-wrapper`,children:(0,F.jsx)(`svg`,{className:`semiont-protected-error-boundary-icon`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,F.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z`})})}),(0,F.jsx)(`h2`,{className:`semiont-protected-error-boundary-title`,children:`Something went wrong`})]}),(0,F.jsx)(`p`,{className:`semiont-protected-error-boundary-message`,children:`An unexpected error occurred. Try again, or refresh the page.`}),!1,(0,F.jsxs)(`div`,{className:`semiont-protected-error-boundary-actions`,children:[(0,F.jsx)(`button`,{onClick:t,className:`semiont-button`,"data-variant":`secondary`,"data-size":`md`,children:`Try Again`}),(0,F.jsx)(`button`,{onClick:()=>window.location.reload(),className:`semiont-button`,"data-variant":`primary`,"data-size":`md`,children:`Refresh Page`})]})]})})}function lG({onResize:e,minWidth:t,maxWidth:n,position:r=`left`,ariaLabel:i=`Resize panel`}){let[a,o]=(0,u.useState)(!1),s=(0,u.useRef)(0),c=(0,u.useRef)(0),l=(0,u.useRef)(e);(0,u.useEffect)(()=>{l.current=e});let d=(0,u.useCallback)(e=>{e.preventDefault(),o(!0),s.current=e.clientX;let t=e.target.parentElement;t&&(c.current=t.offsetWidth)},[]),f=(0,u.useCallback)(e=>{if(!a)return;let i=e.clientX-s.current,o=r===`left`?-i:i,u=c.current+o,d=Math.max(t,Math.min(n,u));l.current(d)},[a,t,n,r]),p=(0,u.useCallback)(()=>{o(!1)},[]),m=(0,u.useCallback)(e=>{let i=e.target.parentElement;if(!i)return;let a=i.offsetWidth,o=e.shiftKey?50:10,s=a;if(r===`left`?e.key===`ArrowLeft`?(s=a+o,e.preventDefault()):e.key===`ArrowRight`&&(s=a-o,e.preventDefault()):e.key===`ArrowRight`?(s=a+o,e.preventDefault()):e.key===`ArrowLeft`&&(s=a-o,e.preventDefault()),s!==a){let e=Math.max(t,Math.min(n,s));l.current(e)}},[t,n,r]);return(0,u.useEffect)(()=>{if(a)return document.addEventListener(`mousemove`,f),document.addEventListener(`mouseup`,p),document.body.style.userSelect=`none`,document.body.style.cursor=`col-resize`,()=>{document.removeEventListener(`mousemove`,f),document.removeEventListener(`mouseup`,p),document.body.style.userSelect=``,document.body.style.cursor=``}},[a,f,p]),(0,F.jsx)(`button`,{type:`button`,className:`semiont-resize-handle semiont-resize-handle--${r} ${a?`semiont-resize-handle--dragging`:``}`,onMouseDown:d,onKeyDown:m,"aria-label":i,role:`separator`,"aria-orientation":`vertical`,tabIndex:0})}function uG({context:e,activePanel:t,isArchived:n=!1}){let r=Lg(`Toolbar`),i=kg(),a=e=>{i.emit(`panel:toggle`,{panel:e})};return(0,F.jsxs)(`div`,{className:`semiont-toolbar`,"data-context":e,children:[e===`document`&&(0,F.jsxs)(F.Fragment,{children:[!n&&(0,F.jsx)(`button`,{onClick:()=>a(`annotations`),className:`semiont-toolbar-button`,"data-active":t===`annotations`,"data-panel":`annotations`,"aria-label":r(`annotations`),"aria-pressed":t===`annotations`,title:r(`annotations`),children:(0,F.jsx)(`span`,{className:`semiont-toolbar-icon semiont-toolbar-icon-large`,"aria-hidden":`true`,children:`A`})}),(0,F.jsx)(`button`,{onClick:()=>a(`info`),className:`semiont-toolbar-button`,"data-active":t===`info`,"data-panel":`info`,"aria-label":r(`resourceInfo`),"aria-pressed":t===`info`,title:r(`resourceInfo`),children:(0,F.jsx)(`span`,{className:`semiont-toolbar-icon`,"aria-hidden":`true`,children:`ℹ️`})}),(0,F.jsx)(`button`,{onClick:()=>a(`history`),className:`semiont-toolbar-button`,"data-active":t===`history`,"data-panel":`history`,"aria-label":r(`history`),"aria-pressed":t===`history`,title:r(`history`),children:(0,F.jsx)(`span`,{className:`semiont-toolbar-icon`,"aria-hidden":`true`,children:`📒`})}),(0,F.jsx)(`button`,{onClick:()=>a(`jsonld`),className:`semiont-toolbar-button`,"data-active":t===`jsonld`,"data-panel":`jsonld`,"aria-label":`JSON-LD`,"aria-pressed":t===`jsonld`,title:`JSON-LD`,children:(0,F.jsx)(`span`,{className:`semiont-toolbar-icon`,"aria-hidden":`true`,children:`🌐`})}),(0,F.jsx)(`button`,{onClick:()=>a(`collaboration`),className:`semiont-toolbar-button`,"data-active":t===`collaboration`,"data-panel":`collaboration`,"aria-label":r(`collaboration`),"aria-pressed":t===`collaboration`,title:r(`collaboration`),children:(0,F.jsx)(`span`,{className:`semiont-toolbar-icon`,"aria-hidden":`true`,children:`👥`})})]}),(0,F.jsx)(`button`,{onClick:()=>a(`knowledge-base`),className:`semiont-toolbar-button`,"data-active":t===`knowledge-base`,"data-panel":`knowledge-base`,"aria-label":r(`knowledgeBase`),"aria-pressed":t===`knowledge-base`,title:r(`knowledgeBase`),children:(0,F.jsx)(`svg`,{className:`semiont-toolbar-icon`,"aria-hidden":`true`,xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,width:`20`,height:`20`,children:(0,F.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M20.25 6.375c0 2.278-3.694 4.125-8.25 4.125S3.75 8.653 3.75 6.375m16.5 0c0-2.278-3.694-4.125-8.25-4.125S3.75 4.097 3.75 6.375m16.5 0v11.25c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125V6.375m16.5 5.625c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125`})})}),(0,F.jsx)(`button`,{onClick:()=>a(`user`),className:`semiont-toolbar-button`,"data-active":t===`user`,"data-panel":`user`,"aria-label":r(`userAccount`),"aria-pressed":t===`user`,title:r(`userAccount`),children:(0,F.jsx)(`span`,{className:`semiont-toolbar-icon`,"aria-hidden":`true`,children:`👤`})}),(0,F.jsx)(`button`,{onClick:()=>a(`settings`),className:`semiont-toolbar-button`,"data-active":t===`settings`,"data-panel":`settings`,"aria-label":r(`settings`),"aria-pressed":t===`settings`,title:r(`settings`),children:(0,F.jsx)(`span`,{className:`semiont-toolbar-icon`,"aria-hidden":`true`,children:`⚙️`})})]})}function dG({showLineNumbers:e,theme:t,locale:n,isPendingLocaleChange:r=!1,hoverDelayMs:i}){let a=Lg(`Settings`),o=kg(),{announceLanguageChanging:s,announceLanguageChanged:c}=BL(),[l,d]=u.useState(n),f=e=>{s(Ss.find(t=>t.code===e)?.nativeName||e),o.emit(`settings:locale-changed`,{locale:e})};return(0,u.useEffect)(()=>{n!==l&&!r&&(c(Ss.find(e=>e.code===n)?.nativeName||n),d(n))},[n,l,r]),(0,F.jsxs)(`div`,{className:`semiont-settings-panel`,children:[(0,F.jsx)(`h3`,{className:`semiont-settings-panel__title`,children:a(`title`)}),(0,F.jsxs)(`div`,{className:`semiont-settings-panel__content`,children:[(0,F.jsxs)(`div`,{className:`semiont-settings-panel__field`,children:[(0,F.jsxs)(`label`,{className:`semiont-toggle-label`,children:[(0,F.jsx)(`span`,{className:`semiont-toggle-label__text`,children:a(`lineNumbers`)}),(0,F.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":e,onClick:()=>o.emit(`settings:line-numbers-toggled`,void 0),className:`semiont-toggle ${e?`semiont-toggle--active`:``}`,children:(0,F.jsx)(`span`,{className:`semiont-toggle__slider ${e?`semiont-toggle__slider--active`:``}`})})]}),(0,F.jsx)(`p`,{className:`semiont-form__help`,children:a(e?`lineNumbersVisible`:`lineNumbersHidden`)})]}),(0,F.jsxs)(`div`,{className:`semiont-settings-panel__field`,children:[(0,F.jsx)(`label`,{className:`semiont-form__label`,children:a(`theme`)}),(0,F.jsxs)(`div`,{className:`semiont-settings-panel__button-group`,children:[(0,F.jsxs)(`button`,{onClick:()=>o.emit(`settings:theme-changed`,{theme:`light`}),className:`semiont-panel-button ${t===`light`?`semiont-panel-button-active`:``}`,"aria-pressed":t===`light`,children:[`☀️ `,a(`themeLight`)]}),(0,F.jsxs)(`button`,{onClick:()=>o.emit(`settings:theme-changed`,{theme:`dark`}),className:`semiont-panel-button ${t===`dark`?`semiont-panel-button-active`:``}`,"aria-pressed":t===`dark`,children:[`🌙 `,a(`themeDark`)]}),(0,F.jsxs)(`button`,{onClick:()=>o.emit(`settings:theme-changed`,{theme:`system`}),className:`semiont-panel-button ${t===`system`?`semiont-panel-button-active`:``}`,"aria-pressed":t===`system`,children:[`💻 `,a(`themeSystem`)]})]}),(0,F.jsx)(`p`,{className:`semiont-form__help`,"aria-live":`polite`,children:t===`system`?a(`themeSystemActive`):a(`themeModeActive`,{mode:t.charAt(0).toUpperCase()+t.slice(1)})})]}),(0,F.jsxs)(`div`,{className:`semiont-settings-panel__field`,children:[(0,F.jsx)(`label`,{htmlFor:`language-select`,className:`semiont-form__label`,children:a(`language`)}),(0,F.jsx)(`select`,{id:`language-select`,value:n,onChange:e=>f(e.target.value),disabled:r,className:`semiont-select`,"aria-busy":r,"aria-describedby":`language-hint`,children:Ss.map(e=>(0,F.jsx)(`option`,{value:e.code,children:e.nativeName},e.code))}),(0,F.jsx)(`p`,{id:`language-hint`,className:`semiont-form__help`,children:a(`languageHint`)}),r&&(0,F.jsx)(`p`,{className:`semiont-settings-panel__loading`,role:`status`,"aria-live":`polite`,children:a(`languageChanging`)})]}),(0,F.jsxs)(`div`,{className:`semiont-settings-panel__field`,children:[(0,F.jsx)(`label`,{htmlFor:`hover-delay-slider`,className:`semiont-form__label`,children:a(`hoverDelay`)}),(0,F.jsx)(`input`,{id:`hover-delay-slider`,type:`range`,min:`0`,max:`500`,step:`50`,value:i,onChange:e=>o.emit(`settings:hover-delay-changed`,{hoverDelayMs:Number(e.target.value)}),className:`semiont-slider`,"aria-describedby":`hover-delay-description`}),(0,F.jsxs)(`div`,{className:`semiont-slider__labels`,children:[(0,F.jsx)(`span`,{children:a(`hoverDelayFast`)}),(0,F.jsx)(`span`,{children:a(`hoverDelaySlow`)})]}),(0,F.jsx)(`p`,{id:`hover-delay-description`,className:`semiont-form__help`,children:a(`hoverDelayDescription`,{delay:i})})]})]})]})}function fG({label:e,collapsedContent:t,expandedContent:n,isExpanded:r,onHoverChange:i,onPin:a,containerRef:o}){let s=(0,u.useRef)(null);return(0,F.jsxs)(`div`,{className:`semiont-dropdown-group`,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),children:[(0,F.jsx)(`div`,{ref:o,role:`button`,tabIndex:0,"aria-haspopup":`true`,"aria-expanded":r,"aria-label":e,className:`semiont-dropdown-trigger`,onClick:a,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),a())},children:t}),r&&(0,F.jsx)(`div`,{ref:s,role:`menu`,"aria-orientation":`vertical`,className:`semiont-dropdown-menu`,children:(0,F.jsxs)(`div`,{className:`semiont-dropdown-content`,children:[(0,F.jsx)(`div`,{className:`semiont-dropdown-header`,children:e}),n]})})]})}function pG({selectedMotivation:e,selectedClick:t,showDeleteButton:n=!0,selectedShape:r=`rectangle`,mediaType:i,annotateMode:a=!1,annotators:o,parts:s=[`clickAction`,`mode`,`selection`,`shape`],onModeChange:c,onClickActionChange:l,onSelectionChange:d,onShapeChange:f,compact:p=!1}){let m=Lg(`AnnotateToolbar`),h=e=>Object.values(o).find(t=>t.motivation===e)?.iconEmoji||`❓`,[g,_]=(0,u.useState)(!1),[v,y]=(0,u.useState)(!1),[b,x]=(0,u.useState)(!1),[S,C]=(0,u.useState)(!1),[w,T]=(0,u.useState)(!1),[E,D]=(0,u.useState)(!1),[O,k]=(0,u.useState)(!1),[A,j]=(0,u.useState)(!1),ee=(0,u.useRef)(null),M=(0,u.useRef)(null),N=(0,u.useRef)(null),te=(0,u.useRef)(null),ne=g||v,re=b||S,ie=w||E,ae=O||A;(0,u.useEffect)(()=>{let e=e=>{v&&ee.current&&!ee.current.contains(e.target)&&y(!1),S&&M.current&&!M.current.contains(e.target)&&C(!1),E&&N.current&&!N.current.contains(e.target)&&D(!1),A&&te.current&&!te.current.contains(e.target)&&j(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[v,S,E,A]),(0,u.useEffect)(()=>{let e=e=>{e.key===`Escape`&&(y(!1),C(!1),D(!1),j(!1))};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[]);let oe=t=>{d?.(t===null||e===t?null:t),D(!1),T(!1)},se=e=>{l?.(e),C(!1),x(!1)},ce=e=>{f?.(e),j(!1),k(!1)},P=()=>{c?.(!a),y(!1),_(!1)},le=()=>{a&&P()},ue=()=>{a||P()},de=(e,t,n,r,i=!1)=>(0,F.jsxs)(`button`,{role:`menuitem`,onClick:e=>{e.stopPropagation(),r()},className:`semiont-toolbar-menu-button`,"data-selected":n,"data-delete":i,"aria-pressed":n,"aria-label":t,children:[(0,F.jsx)(`span`,{className:`semiont-toolbar-menu-icon`,"aria-hidden":`true`,children:e}),(0,F.jsx)(`span`,{className:`semiont-toolbar-menu-label`,children:t})]}),fe=[{action:`detail`,icon:`🔍`,label:m(`detail`)},{action:`follow`,icon:`➡️`,label:m(`follow`)},{action:`jsonld`,icon:`🌐`,label:m(`jsonld`)}];n&&fe.push({action:`deleting`,icon:`🗑️`,label:m(`deleting`),isDelete:!0});let pe=[{motivation:`linking`,label:m(`linking`)},{motivation:`highlighting`,label:m(`highlighting`)},{motivation:`assessing`,label:m(`assessing`)},{motivation:`commenting`,label:m(`commenting`)},{motivation:`tagging`,label:m(`tagging`)}],me=[{shape:`rectangle`,icon:`▭`,label:m(`rectangle`)},{shape:`circle`,icon:`○`,label:m(`circle`)},{shape:`polygon`,icon:`⬡`,label:m(`polygon`)}],he=qI(i),ge=me.filter(e=>he.includes(e.shape)),_e=s.includes(`clickAction`),ve=s.includes(`mode`),ye=s.includes(`selection`),be=s.includes(`shape`)&&ge.length>0;return(0,F.jsxs)(`div`,{className:`semiont-annotate-toolbar${p?` semiont-annotate-toolbar--compact`:``}`,children:[_e&&(0,F.jsx)(fG,{label:m(`clickGroup`),isExpanded:re,onHoverChange:x,onPin:()=>C(!S),containerRef:M,collapsedContent:(0,F.jsxs)(`div`,{className:`semiont-dropdown-display`,"data-delete":fe.find(e=>e.action===t)?.isDelete?`true`:`false`,children:[(0,F.jsx)(`span`,{className:`semiont-dropdown-icon`,children:fe.find(e=>e.action===t)?.icon}),(0,F.jsx)(`span`,{className:`semiont-dropdown-label`,children:fe.find(e=>e.action===t)?.label})]}),expandedContent:(0,F.jsx)(F.Fragment,{children:fe.map(({action:e,icon:n,label:r,isDelete:i})=>(0,F.jsx)(u.Fragment,{children:de(n,r,t===e,()=>se(e),i)},e))})}),ve&&_e&&(0,F.jsx)(`div`,{className:`semiont-toolbar-separator`}),ve&&(0,F.jsx)(fG,{label:m(`modeGroup`),isExpanded:ne,onHoverChange:_,onPin:()=>y(!v),containerRef:ee,collapsedContent:(0,F.jsxs)(`div`,{className:`semiont-dropdown-display`,children:[(0,F.jsx)(`span`,{className:`semiont-dropdown-icon`,children:a?`✏️`:`📖`}),(0,F.jsx)(`span`,{className:`semiont-dropdown-label`,children:m(a?`annotate`:`browse`)})]}),expandedContent:(0,F.jsxs)(F.Fragment,{children:[de(`📖`,m(`browse`),!a,le),de(`✏️`,m(`annotate`),a,ue)]})}),ye&&(_e||ve)&&(0,F.jsx)(`div`,{className:`semiont-toolbar-separator`}),ye&&(0,F.jsx)(fG,{label:m(`selectionGroup`),isExpanded:ie,onHoverChange:T,onPin:()=>D(!E),containerRef:N,collapsedContent:(0,F.jsxs)(`div`,{className:`semiont-dropdown-display`,children:[(0,F.jsx)(`span`,{className:`semiont-dropdown-icon`,children:e?h(e):`—`}),(0,F.jsx)(`span`,{className:`semiont-dropdown-label`,children:e?pe.find(t=>t.motivation===e)?.label:m(`none`)})]}),expandedContent:(0,F.jsxs)(F.Fragment,{children:[de(`—`,m(`none`),e===null,()=>oe(null)),pe.map(({motivation:t,label:n})=>(0,F.jsx)(u.Fragment,{children:de(h(t),n,e===t,()=>oe(t))},t))]})}),be&&(_e||ve||ye)&&(0,F.jsx)(`div`,{className:`semiont-toolbar-separator`}),be&&(0,F.jsx)(fG,{label:m(`shapeGroup`),isExpanded:ae,onHoverChange:k,onPin:()=>j(!A),containerRef:te,collapsedContent:(0,F.jsxs)(`div`,{className:`semiont-dropdown-display`,children:[(0,F.jsx)(`span`,{className:`semiont-dropdown-icon`,children:ge.find(e=>e.shape===r)?.icon}),(0,F.jsx)(`span`,{className:`semiont-dropdown-label`,children:ge.find(e=>e.shape===r)?.label})]}),expandedContent:(0,F.jsx)(F.Fragment,{children:ge.map(({shape:e,icon:t,label:n})=>(0,F.jsx)(u.Fragment,{children:de(t,n,r===e,()=>ce(e))},e))})})]})}var mG=jF({String:X.string,Number:X.number,"True False":X.bool,PropertyName:X.propertyName,Null:X.null,", :":X.separator,"[ ]":X.squareBracket,"{ }":X.brace}),hG=_B.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:`#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O`,goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:`⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array`,maxTerm:25,nodeProps:[[`isolate`,-2,6,11,``],[`openedBy`,7,`{`,14,`[`],[`closedBy`,8,`}`,15,`]`]],propSources:[mG],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),gG=iI.define({name:`json`,parser:hG.configure({props:[vI.add({Object:CI({except:/^\s*\}/}),Array:CI({except:/^\s*\]/})}),TI.add({"Object Array":EI})]}),languageData:{closeBrackets:{brackets:[`[`,`{`,`"`]},indentOnInput:/^\s*[\}\]]$/}});function _G(){return new hI(gG)}var vG=`#e5c07b`,yG=`#e06c75`,bG=`#56b6c2`,xG=`#ffffff`,SG=`#abb2bf`,CG=`#7d8799`,wG=`#61afef`,TG=`#98c379`,EG=`#d19a66`,DG=`#c678dd`,OG=`#21252b`,kG=`#2c313a`,AG=`#282c34`,jG=`#353a42`,MG=`#3E4451`,NG=`#528bff`,PG=[q.theme({"&":{color:SG,backgroundColor:AG},".cm-content":{caretColor:NG},".cm-cursor, .cm-dropCursor":{borderLeftColor:NG},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:MG},".cm-panels":{backgroundColor:OG,color:SG},".cm-panels.cm-panels-top":{borderBottom:`2px solid black`},".cm-panels.cm-panels-bottom":{borderTop:`2px solid black`},".cm-searchMatch":{backgroundColor:`#72a1ff59`,outline:`1px solid #457dff`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:`#6199ff2f`},".cm-activeLine":{backgroundColor:`#6699ff0b`},".cm-selectionMatch":{backgroundColor:`#aafe661a`},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:`#bad0f847`},".cm-gutters":{backgroundColor:AG,color:CG,border:`none`},".cm-activeLineGutter":{backgroundColor:kG},".cm-foldPlaceholder":{backgroundColor:`transparent`,border:`none`,color:`#ddd`},".cm-tooltip":{border:`none`,backgroundColor:jG},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:jG,borderBottomColor:jG},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:kG,color:SG}}},{dark:!0}),jI(DI.define([{tag:X.keyword,color:DG},{tag:[X.name,X.deleted,X.character,X.propertyName,X.macroName],color:yG},{tag:[X.function(X.variableName),X.labelName],color:wG},{tag:[X.color,X.constant(X.name),X.standard(X.name)],color:EG},{tag:[X.definition(X.name),X.separator],color:SG},{tag:[X.typeName,X.className,X.number,X.changed,X.annotation,X.modifier,X.self,X.namespace],color:vG},{tag:[X.operator,X.operatorKeyword,X.url,X.escape,X.regexp,X.link,X.special(X.string)],color:bG},{tag:[X.meta,X.comment],color:CG},{tag:X.strong,fontWeight:`bold`},{tag:X.emphasis,fontStyle:`italic`},{tag:X.strikethrough,textDecoration:`line-through`},{tag:X.link,color:CG,textDecoration:`underline`},{tag:X.heading,fontWeight:`bold`,color:yG},{tag:[X.atom,X.bool,X.special(X.variableName)],color:EG},{tag:[X.processingInstruction,X.string,X.inserted],color:TG},{tag:X.invalid,color:xG}]))];function FG({annotation:e,onBack:t}){let n=(0,u.useRef)(null),r=(0,u.useRef)(null),{showLineNumbers:i}=pL(),a=(0,u.useRef)(t);return(0,u.useEffect)(()=>{a.current=t}),(0,u.useEffect)(()=>{let e=e=>{e.key===`Escape`&&a.current()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,u.useEffect)(()=>{if(!n.current)return;let t=document.documentElement.classList.contains(`dark`),a=JSON.stringify(e,null,2),o=[_G(),q.editable.of(!1),gO.readOnly.of(!0)];i&&o.push(kP()),t?o.push(PG):(o.push(HI),o.push(jI(UI)));let s=new q({state:gO.create({doc:a,extensions:o}),parent:n.current});return r.current=s,()=>{s.destroy(),r.current=null}},[e,i]),(0,F.jsxs)(`div`,{className:`semiont-jsonld-view`,children:[(0,F.jsxs)(`div`,{className:`semiont-jsonld-view__header`,children:[(0,F.jsx)(`button`,{onClick:t,className:`semiont-jsonld-view__back-button`,title:`Go back (Escape)`,children:`<`}),(0,F.jsx)(`h3`,{className:`semiont-jsonld-view__title`,children:`JSON-LD`}),(0,F.jsx)(`button`,{onClick:async()=>{try{await navigator.clipboard.writeText(JSON.stringify(e,null,2))}catch(e){console.error(`Failed to copy JSON-LD:`,e)}},className:`semiont-jsonld-view__copy-button`,title:`Copy to clipboard`,children:`📋 Copy`})]}),(0,F.jsx)(`div`,{ref:n,className:`semiont-jsonld-view__editor`})]})}var IG=Object.defineProperty,LG=(e,t,n)=>t in e?IG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,RG=(e,t,n)=>(LG(e,typeof t==`symbol`?t:t+``,n),n),zG=new class{constructor(){RG(this,`current`,this.detect()),RG(this,`handoffState`,`pending`),RG(this,`currentId`,0)}set(e){this.current!==e&&(this.handoffState=`pending`,this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current===`server`}get isClient(){return this.current===`client`}detect(){return typeof window>`u`||typeof document>`u`?`server`:`client`}handoff(){this.handoffState===`pending`&&(this.handoffState=`complete`)}get isHandoffComplete(){return this.handoffState===`complete`}};function BG(e){return zG.isServer?null:e==null?document:e?.ownerDocument??document}function VG(e){return zG.isServer?null:e==null?document:(e?.getRootNode)?.call(e)??document}function HG(e){return VG(e)?.activeElement??null}function UG(e){return HG(e)===e}function WG(e){typeof queueMicrotask==`function`?queueMicrotask(e):Promise.resolve().then(e).catch(e=>setTimeout(()=>{throw e}))}function GG(){let e=[],t={addEventListener(e,n,r,i){return e.addEventListener(n,r,i),t.add(()=>e.removeEventListener(n,r,i))},requestAnimationFrame(...e){let n=requestAnimationFrame(...e);return t.add(()=>cancelAnimationFrame(n))},nextFrame(...e){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...e))},setTimeout(...e){let n=setTimeout(...e);return t.add(()=>clearTimeout(n))},microTask(...e){let n={current:!0};return WG(()=>{n.current&&e[0]()}),t.add(()=>{n.current=!1})},style(e,t,n){let r=e.style.getPropertyValue(t);return Object.assign(e.style,{[t]:n}),this.add(()=>{Object.assign(e.style,{[t]:r})})},group(e){let t=GG();return e(t),this.add(()=>t.dispose())},add(t){return e.includes(t)||e.push(t),()=>{let n=e.indexOf(t);if(n>=0)for(let t of e.splice(n,1))t()}},dispose(){for(let t of e.splice(0))t()}};return t}function KG(){let[e]=(0,u.useState)(GG);return(0,u.useEffect)(()=>()=>e.dispose(),[e]),e}var qG=(e,t)=>{zG.isServer?(0,u.useEffect)(e,t):(0,u.useLayoutEffect)(e,t)};function JG(e){let t=(0,u.useRef)(e);return qG(()=>{t.current=e},[e]),t}var YG=function(e){let t=JG(e);return u.useCallback((...e)=>t.current(...e),[t])};function XG(e){return(0,u.useMemo)(()=>e,Object.values(e))}var ZG=(0,u.createContext)(void 0);function QG(){return(0,u.useContext)(ZG)}function $G(...e){return Array.from(new Set(e.flatMap(e=>typeof e==`string`?e.split(` `):[]))).filter(Boolean).join(` `)}function eK(e,t,...n){if(e in t){let r=t[e];return typeof r==`function`?r(...n):r}let r=Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(e=>`"${e}"`).join(`, `)}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,eK),r}var tK=(e=>(e[e.None=0]=`None`,e[e.RenderStrategy=1]=`RenderStrategy`,e[e.Static=2]=`Static`,e))(tK||{}),nK=(e=>(e[e.Unmount=0]=`Unmount`,e[e.Hidden=1]=`Hidden`,e))(nK||{});function rK(){let e=oK();return(0,u.useCallback)(t=>iK({mergeRefs:e,...t}),[e])}function iK({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:i,visible:a=!0,name:o,mergeRefs:s}){s??=sK;let c=cK(t,e);if(a)return aK(c,n,r,o,s);let l=i??0;if(l&2){let{static:e=!1,...t}=c;if(e)return aK(t,n,r,o,s)}if(l&1){let{unmount:e=!0,...t}=c;return eK(+!e,{0(){return null},1(){return aK({...t,hidden:!0,style:{display:`none`}},n,r,o,s)}})}return aK(c,n,r,o,s)}function aK(e,t={},n,r,i){let{as:a=n,children:o,refName:s=`ref`,...c}=dK(e,[`unmount`,`static`]),l=e.ref===void 0?{}:{[s]:e.ref},d=typeof o==`function`?o(t):o;d=pK(d),`className`in c&&c.className&&typeof c.className==`function`&&(c.className=c.className(t)),c[`aria-labelledby`]&&c[`aria-labelledby`]===c.id&&(c[`aria-labelledby`]=void 0);let f={};if(t){let e=!1,n=[];for(let[r,i]of Object.entries(t))typeof i==`boolean`&&(e=!0),i===!0&&n.push(r.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`));if(e){f[`data-headlessui-state`]=n.join(` `);for(let e of n)f[`data-${e}`]=``}}if(mK(a)&&(Object.keys(uK(c)).length>0||Object.keys(uK(f)).length>0))if(!(0,u.isValidElement)(d)||Array.isArray(d)&&d.length>1||hK(d)){if(Object.keys(uK(c)).length>0)throw Error([`Passing props on "Fragment"!`,``,`The current component <${r} /> is rendering a "Fragment".`,`However we need to passthrough the following props:`,Object.keys(uK(c)).concat(Object.keys(uK(f))).map(e=>` - ${e}`).join(`
|
|
132
|
+
`),``,`You can apply a few solutions:`,['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',`Render a single element as the child so that we can forward the props onto that element.`].map(e=>` - ${e}`).join(`
|
|
133
|
+
`)].join(`
|
|
134
|
+
`))}else{let e=d.props?.className,t=typeof e==`function`?(...t)=>$G(e(...t),c.className):$G(e,c.className),n=t?{className:t}:{},r=cK(d.props,uK(dK(c,[`ref`])));for(let e in f)e in r&&delete f[e];return(0,u.cloneElement)(d,Object.assign({},r,f,l,{ref:i(fK(d),l.ref)},n))}return(0,u.createElement)(a,Object.assign({},dK(c,[`ref`]),!mK(a)&&l,!mK(a)&&f),d)}function oK(){let e=(0,u.useRef)([]),t=(0,u.useCallback)(t=>{for(let n of e.current)n!=null&&(typeof n==`function`?n(t):n.current=t)},[]);return(...n)=>{if(!n.every(e=>e==null))return e.current=n,t}}function sK(...e){return e.every(e=>e==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n==`function`?n(t):n.current=t)}}function cK(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let e in r)e.startsWith(`on`)&&typeof r[e]==`function`?(n[e]??(n[e]=[]),n[e].push(r[e])):t[e]=r[e];if(t.disabled||t[`aria-disabled`])for(let e in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(e)&&(n[e]=[e=>(e?.preventDefault)?.call(e)]);for(let e in n)Object.assign(t,{[e](t,...r){let i=n[e];for(let e of i){if((t instanceof Event||t?.nativeEvent instanceof Event)&&t.defaultPrevented)return;e(t,...r)}}});return t}function lK(e){return Object.assign((0,u.forwardRef)(e),{displayName:e.displayName??e.name})}function uK(e){let t=Object.assign({},e);for(let e in t)t[e]===void 0&&delete t[e];return t}function dK(e,t=[]){let n=Object.assign({},e);for(let e of t)e in n&&delete n[e];return n}function fK(e){return`19.2.7`.split(`.`)[0]>=`19`?e.props.ref:e.ref}function pK(e){if(e!=null&&e.$$typeof===Symbol.for(`react.lazy`)){let t=e._payload;if(t!=null&&t.status===`fulfilled`)return pK(t.value)}return e}function mK(e){return e===u.Fragment||e===Symbol.for(`react.fragment`)}function hK(e){return mK(e.type)}var gK=`span`,_K=(e=>(e[e.None=1]=`None`,e[e.Focusable=2]=`Focusable`,e[e.Hidden=4]=`Hidden`,e))(_K||{});function vK(e,t){let{features:n=1,...r}=e,i={ref:t,"aria-hidden":(n&2)==2?!0:r[`aria-hidden`]??void 0,hidden:(n&4)==4?!0:void 0,style:{position:`fixed`,top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`,...(n&4)==4&&(n&2)!=2&&{display:`none`}}};return rK()({ourProps:i,theirProps:r,slot:{},defaultTag:gK,name:`Hidden`})}var yK=lK(vK);function bK(e){return typeof e!=`object`||!e?!1:`nodeType`in e}function xK(e){return bK(e)&&`tagName`in e}function SK(e){return xK(e)&&`accessKey`in e}function CK(e){return xK(e)&&`tabIndex`in e}function wK(e){return xK(e)&&`style`in e}function TK(e){return SK(e)&&e.nodeName===`IFRAME`}function EK(e){return SK(e)&&e.nodeName===`INPUT`}var DK=Symbol();function OK(e,t=!0){return Object.assign(e,{[DK]:t})}function kK(...e){let t=(0,u.useRef)(e);(0,u.useEffect)(()=>{t.current=e},[e]);let n=YG(e=>{for(let n of t.current)n!=null&&(typeof n==`function`?n(e):n.current=e)});return e.every(e=>e==null||e?.[DK])?void 0:n}var AK=(0,u.createContext)(null);AK.displayName=`DescriptionContext`;function jK(){let e=(0,u.useContext)(AK);if(e===null){let e=Error(`You used a <Description /> component, but it is not inside a relevant parent.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,jK),e}return e}function MK(){let[e,t]=(0,u.useState)([]);return[e.length>0?e.join(` `):void 0,(0,u.useMemo)(()=>function(e){let n=YG(e=>(t(t=>[...t,e]),()=>t(t=>{let n=t.slice(),r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}))),r=(0,u.useMemo)(()=>({register:n,slot:e.slot,name:e.name,props:e.props,value:e.value}),[n,e.slot,e.name,e.props,e.value]);return u.createElement(AK.Provider,{value:r},e.children)},[t])]}var NK=`p`;function PK(e,t){let n=(0,u.useId)(),r=QG(),{id:i=`headlessui-description-${n}`,...a}=e,o=jK(),s=kK(t);qG(()=>o.register(i),[i,o.register]);let c=XG({...o.slot,disabled:r||!1}),l={ref:s,...o.props,id:i};return rK()({ourProps:l,theirProps:a,slot:c,defaultTag:NK,name:o.name||`Description`})}var FK=lK(PK),IK=Object.assign(FK,{}),LK=(e=>(e.Space=` `,e.Enter=`Enter`,e.Escape=`Escape`,e.Backspace=`Backspace`,e.Delete=`Delete`,e.ArrowLeft=`ArrowLeft`,e.ArrowUp=`ArrowUp`,e.ArrowRight=`ArrowRight`,e.ArrowDown=`ArrowDown`,e.Home=`Home`,e.End=`End`,e.PageUp=`PageUp`,e.PageDown=`PageDown`,e.Tab=`Tab`,e))(LK||{}),RK=(0,u.createContext)(()=>{});function zK({value:e,children:t}){return u.createElement(RK.Provider,{value:e},t)}var BK=class extends Map{constructor(e){super(),this.factory=e}get(e){let t=super.get(e);return t===void 0&&(t=this.factory(e),this.set(e,t)),t}},VK=Object.defineProperty,HK=(e,t,n)=>t in e?VK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,UK=(e,t,n)=>(HK(e,typeof t==`symbol`?t:t+``,n),n),WK=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},GK=(e,t,n)=>(WK(e,t,`read from private field`),n?n.call(e):t.get(e)),KK=(e,t,n)=>{if(t.has(e))throw TypeError(`Cannot add the same private member more than once`);t instanceof WeakSet?t.add(e):t.set(e,n)},qK=(e,t,n,r)=>(WK(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),JK,YK,XK,ZK=class{constructor(e){KK(this,JK,{}),KK(this,YK,new BK(()=>new Set)),KK(this,XK,new Set),UK(this,`disposables`,GG()),qK(this,JK,e),zG.isServer&&this.disposables.microTask(()=>{this.dispose()})}dispose(){this.disposables.dispose()}get state(){return GK(this,JK)}subscribe(e,t){if(zG.isServer)return()=>{};let n={selector:e,callback:t,current:e(GK(this,JK))};return GK(this,XK).add(n),this.disposables.add(()=>{GK(this,XK).delete(n)})}on(e,t){return zG.isServer?()=>{}:(GK(this,YK).get(e).add(t),this.disposables.add(()=>{GK(this,YK).get(e).delete(t)}))}send(e){let t=this.reduce(GK(this,JK),e);if(t!==GK(this,JK)){qK(this,JK,t);for(let e of GK(this,XK)){let t=e.selector(GK(this,JK));QK(e.current,t)||(e.current=t,e.callback(t))}for(let t of GK(this,YK).get(e.type))t(GK(this,JK),e)}}};JK=new WeakMap,YK=new WeakMap,XK=new WeakMap;function QK(e,t){return Object.is(e,t)?!0:typeof e!=`object`||!e||typeof t!=`object`||!t?!1:Array.isArray(e)&&Array.isArray(t)?e.length===t.length?$K(e[Symbol.iterator](),t[Symbol.iterator]()):!1:e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set?e.size===t.size?$K(e.entries(),t.entries()):!1:eq(e)&&eq(t)?$K(Object.entries(e)[Symbol.iterator](),Object.entries(t)[Symbol.iterator]()):!1}function $K(e,t){do{let n=e.next(),r=t.next();if(n.done&&r.done)return!0;if(n.done||r.done||!Object.is(n.value,r.value))return!1}while(!0)}function eq(e){if(Object.prototype.toString.call(e)!==`[object Object]`)return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}var tq=Object.defineProperty,nq=(e,t,n)=>t in e?tq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,rq=(e,t,n)=>(nq(e,typeof t==`symbol`?t:t+``,n),n),iq=(e=>(e[e.Push=0]=`Push`,e[e.Pop=1]=`Pop`,e))(iq||{}),aq={0(e,t){let n=t.id,r=e.stack,i=e.stack.indexOf(n);if(i!==-1){let t=e.stack.slice();return t.splice(i,1),t.push(n),r=t,{...e,stack:r}}return{...e,stack:[...e.stack,n]}},1(e,t){let n=t.id,r=e.stack.indexOf(n);if(r===-1)return e;let i=e.stack.slice();return i.splice(r,1),{...e,stack:i}}},oq=class e extends ZK{constructor(){super(...arguments),rq(this,`actions`,{push:e=>this.send({type:0,id:e}),pop:e=>this.send({type:1,id:e})}),rq(this,`selectors`,{isTop:(e,t)=>e.stack[e.stack.length-1]===t,inStack:(e,t)=>e.stack.includes(t)})}static new(){return new e({stack:[]})}reduce(e,t){return eK(t.type,aq,e,t)}},sq=new BK(()=>oq.new());function cq(e,t,n=QK){return(0,FE.useSyncExternalStoreWithSelector)(YG(t=>e.subscribe(lq,t)),YG(()=>e.state),YG(()=>e.state),YG(t),n)}function lq(e){return e}function uq(e,t){let n=(0,u.useId)(),r=sq.get(t),[i,a]=cq(r,(0,u.useCallback)(e=>[r.selectors.isTop(e,n),r.selectors.inStack(e,n)],[r,n]));return qG(()=>{if(e)return r.actions.push(n),()=>r.actions.pop(n)},[r,e,n]),e?a?i:!0:!1}var dq=new Map,fq=new Map;function pq(e){let t=fq.get(e)??0;return fq.set(e,t+1),t===0?(dq.set(e,{"aria-hidden":e.getAttribute(`aria-hidden`),inert:e.inert}),e.setAttribute(`aria-hidden`,`true`),e.inert=!0,()=>mq(e)):()=>mq(e)}function mq(e){let t=fq.get(e)??1;if(t===1?fq.delete(e):fq.set(e,t-1),t!==1)return;let n=dq.get(e);n&&(n[`aria-hidden`]===null?e.removeAttribute(`aria-hidden`):e.setAttribute(`aria-hidden`,n[`aria-hidden`]),e.inert=n.inert,dq.delete(e))}function hq(e,{allowed:t,disallowed:n}={}){let r=uq(e,`inert-others`);qG(()=>{if(!r)return;let e=GG();for(let t of n?.()??[])t&&e.add(pq(t));let i=t?.()??[];for(let t of i){if(!t)continue;let n=BG(t);if(!n)continue;let r=t.parentElement;for(;r&&r!==n.body;){for(let t of r.children)i.some(e=>t.contains(e))||e.add(pq(t));r=r.parentElement}}return e.dispose},[r,t,n])}function gq(e,t,n){let r=JG(e=>{let t=e.getBoundingClientRect();t.x===0&&t.y===0&&t.width===0&&t.height===0&&n()});(0,u.useEffect)(()=>{if(!e)return;let n=t===null?null:SK(t)?t:t.current;if(!n)return;let i=GG();if(typeof ResizeObserver<`u`){let e=new ResizeObserver(()=>r.current(n));e.observe(n),i.add(()=>e.disconnect())}if(typeof IntersectionObserver<`u`){let e=new IntersectionObserver(()=>r.current(n));e.observe(n),i.add(()=>e.disconnect())}return()=>i.dispose()},[t,r,e])}var _q=[`[contentEditable=true]`,`[tabindex]`,`a[href]`,`area[href]`,`button:not([disabled])`,`iframe`,`input:not([disabled])`,`select:not([disabled])`,`details>summary`,`textarea:not([disabled])`].map(e=>`${e}:not([tabindex='-1'])`).join(`,`),vq=[`[data-autofocus]`].map(e=>`${e}:not([tabindex='-1'])`).join(`,`),yq=(e=>(e[e.First=1]=`First`,e[e.Previous=2]=`Previous`,e[e.Next=4]=`Next`,e[e.Last=8]=`Last`,e[e.WrapAround=16]=`WrapAround`,e[e.NoScroll=32]=`NoScroll`,e[e.AutoFocus=64]=`AutoFocus`,e))(yq||{}),bq=(e=>(e[e.Error=0]=`Error`,e[e.Overflow=1]=`Overflow`,e[e.Success=2]=`Success`,e[e.Underflow=3]=`Underflow`,e))(bq||{}),xq=(e=>(e[e.Previous=-1]=`Previous`,e[e.Next=1]=`Next`,e))(xq||{});function Sq(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(_q)).sort((e,t)=>Math.sign((e.tabIndex||2**53-1)-(t.tabIndex||2**53-1)))}function Cq(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(vq)).sort((e,t)=>Math.sign((e.tabIndex||2**53-1)-(t.tabIndex||2**53-1)))}var wq=(e=>(e[e.Strict=0]=`Strict`,e[e.Loose=1]=`Loose`,e))(wq||{});function Tq(e,t=0){return e===BG(e)?.body?!1:eK(t,{0(){return e.matches(_q)},1(){let t=e;for(;t!==null;){if(t.matches(_q))return!0;t=t.parentElement}return!1}})}var Eq=(e=>(e[e.Keyboard=0]=`Keyboard`,e[e.Mouse=1]=`Mouse`,e))(Eq||{});typeof window<`u`&&typeof document<`u`&&(document.addEventListener(`keydown`,e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible=``)},!0),document.addEventListener(`click`,e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible=``)},!0));function Dq(e){e?.focus({preventScroll:!0})}var Oq=[`textarea`,`input`].join(`,`);function kq(e){return(e?.matches)?.call(e,Oq)??!1}function Aq(e,t=e=>e){return e.slice().sort((e,n)=>{let r=t(e),i=t(n);if(r===null||i===null)return 0;let a=r.compareDocumentPosition(i);return a&Node.DOCUMENT_POSITION_FOLLOWING?-1:a&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function jq(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:i=[]}={}){let a=Array.isArray(e)?e.length>0?VG(e[0]):document:VG(e),o=Array.isArray(e)?n?Aq(e):e:t&64?Cq(e):Sq(e);i.length>0&&o.length>1&&(o=o.filter(e=>!i.some(t=>t!=null&&`current`in t?t?.current===e:t===e))),r??=a?.activeElement;let s=(()=>{if(t&5)return 1;if(t&10)return-1;throw Error(`Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last`)})(),c=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,o.indexOf(r))-1;if(t&4)return Math.max(0,o.indexOf(r))+1;if(t&8)return o.length-1;throw Error(`Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last`)})(),l=t&32?{preventScroll:!0}:{},u=0,d=o.length,f;do{if(u>=d||u+d<=0)return 0;let e=c+u;if(t&16)e=(e+d)%d;else{if(e<0)return 3;if(e>=d)return 1}f=o[e],f?.focus(l),u+=s}while(f!==HG(f));return t&6&&kq(f)&&f.select(),2}function Mq(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function Nq(){return/Android/gi.test(window.navigator.userAgent)}function Pq(){return Mq()||Nq()}function Fq(e,t,n,r){let i=JG(n);(0,u.useEffect)(()=>{if(!e)return;function n(e){i.current(e)}return document.addEventListener(t,n,r),()=>document.removeEventListener(t,n,r)},[e,t,r])}function Iq(e,t,n,r){let i=JG(n);(0,u.useEffect)(()=>{if(!e)return;function n(e){i.current(e)}return window.addEventListener(t,n,r),()=>window.removeEventListener(t,n,r)},[e,t,r])}var Lq=30;function Rq(e,t,n){let r=JG(n),i=(0,u.useCallback)(function(e,n){if(e.defaultPrevented)return;let i=n(e);if(i===null||!i.getRootNode().contains(i)||!i.isConnected)return;let a=(function e(t){return typeof t==`function`?e(t()):Array.isArray(t)||t instanceof Set?t:[t]})(t);for(let t of a)if(t!==null&&(t.contains(i)||e.composed&&e.composedPath().includes(t)))return;return!Tq(i,wq.Loose)&&i.tabIndex!==-1&&e.preventDefault(),r.current(e,i)},[r,t]),a=(0,u.useRef)(null);Fq(e,`pointerdown`,e=>{Pq()||(a.current=e.composedPath?.call(e)?.[0]||e.target)},!0),Fq(e,`pointerup`,e=>{if(Pq()||!a.current)return;let t=a.current;return a.current=null,i(e,()=>t)},!0);let o=(0,u.useRef)({x:0,y:0});Fq(e,`touchstart`,e=>{o.current.x=e.touches[0].clientX,o.current.y=e.touches[0].clientY},!0),Fq(e,`touchend`,e=>{let t={x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY};if(!(Math.abs(t.x-o.current.x)>=Lq||Math.abs(t.y-o.current.y)>=Lq))return i(e,()=>CK(e.target)?e.target:null)},!0),Iq(e,`blur`,e=>i(e,()=>TK(window.document.activeElement)?window.document.activeElement:null),!0)}function zq(...e){return(0,u.useMemo)(()=>BG(...e),[...e])}function Bq(e,t,n,r){let i=JG(n);(0,u.useEffect)(()=>{e??=window;function n(e){i.current(e)}return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)},[e,t,r])}function Vq(e){return(0,u.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot)}function Hq(e,t){let n=e(),r=new Set;return{getSnapshot(){return n},subscribe(e){return r.add(e),()=>r.delete(e)},dispatch(e,...i){let a=t[e].call(n,...i);a&&(n=a,r.forEach(e=>e()))}}}function Uq(){let e;return{before({doc:t}){let n=t.documentElement,r=t.defaultView??window;e=Math.max(0,r.innerWidth-n.clientWidth)},after({doc:t,d:n}){let r=t.documentElement,i=Math.max(0,r.clientWidth-r.offsetWidth),a=Math.max(0,e-i);n.style(r,`paddingRight`,`${a}px`)}}}function Wq(){return Mq()?{before({doc:e,d:t,meta:n}){function r(e){for(let t of n().containers)for(let n of t())if(n.contains(e))return!0;return!1}t.microTask(()=>{if(window.getComputedStyle(e.documentElement).scrollBehavior!==`auto`){let n=GG();n.style(e.documentElement,`scrollBehavior`,`auto`),t.add(()=>t.microTask(()=>n.dispose()))}let n=window.scrollY??window.pageYOffset,i=null;t.addEventListener(e,`click`,t=>{if(CK(t.target))try{let n=t.target.closest(`a`);if(!n)return;let{hash:a}=new URL(n.href),o=e.querySelector(a);CK(o)&&!r(o)&&(i=o)}catch{}},!0),t.group(n=>{t.addEventListener(e,`touchstart`,e=>{if(n.dispose(),CK(e.target)&&wK(e.target))if(r(e.target)){let t=e.target;for(;t.parentElement&&r(t.parentElement);)t=t.parentElement;n.style(t,`overscrollBehavior`,`contain`)}else n.style(e.target,`touchAction`,`none`)})}),t.addEventListener(e,`touchmove`,e=>{if(CK(e.target)){if(EK(e.target))return;if(r(e.target)){let t=e.target;for(;t.parentElement&&t.dataset.headlessuiPortal!==``&&!(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth);)t=t.parentElement;t.dataset.headlessuiPortal===``&&e.preventDefault()}else e.preventDefault()}},{passive:!1}),t.add(()=>{n!==(window.scrollY??window.pageYOffset)&&window.scrollTo(0,n),i&&i.isConnected&&(i.scrollIntoView({block:`nearest`}),i=null)})})}}:{}}function Gq(){return{before({doc:e,d:t}){t.style(e.documentElement,`overflow`,`hidden`)}}}function Kq(e){let t={};for(let n of e)Object.assign(t,n(t));return t}var qq=Hq(()=>new Map,{PUSH(e,t){let n=this.get(e)??{doc:e,count:0,d:GG(),meta:new Set,computedMeta:{}};return n.count++,n.meta.add(t),n.computedMeta=Kq(n.meta),this.set(e,n),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t),n.computedMeta=Kq(n.meta)),this},SCROLL_PREVENT(e){let t={doc:e.doc,d:e.d,meta(){return e.computedMeta}},n=[Wq(),Uq(),Gq()];n.forEach(({before:e})=>e?.(t)),n.forEach(({after:e})=>e?.(t))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});qq.subscribe(()=>{let e=qq.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let e=t.get(n.doc)===`hidden`,r=n.count!==0;(r&&!e||!r&&e)&&qq.dispatch(n.count>0?`SCROLL_PREVENT`:`SCROLL_ALLOW`,n),n.count===0&&qq.dispatch(`TEARDOWN`,n)}});function Jq(e,t,n=()=>({containers:[]})){let r=Vq(qq),i=t?r.get(t):void 0,a=i?i.count>0:!1;return qG(()=>{if(!(!t||!e))return qq.dispatch(`PUSH`,t,n),()=>qq.dispatch(`POP`,t,n)},[e,t]),a}function Yq(e,t,n=()=>[document.body]){Jq(uq(e,`scroll-lock`),t,e=>({containers:[...e.containers??[],n]}))}function Xq(e=0){let[t,n]=(0,u.useState)(e);return{flags:t,setFlag:(0,u.useCallback)(e=>n(e),[]),addFlag:(0,u.useCallback)(e=>n(t=>t|e),[]),hasFlag:(0,u.useCallback)(e=>(t&e)===e,[t]),removeFlag:(0,u.useCallback)(e=>n(t=>t&~e),[]),toggleFlag:(0,u.useCallback)(e=>n(t=>t^e),[])}}typeof process<`u`&&typeof globalThis<`u`&&typeof Element<`u`&&(process==null?void 0:{})?.NODE_ENV===`test`&&(Element==null?void 0:Element.prototype)?.getAnimations===void 0&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.",``,`Example usage:`,"```js",`import { mockAnimationsApi } from 'jsdom-testing-mocks'`,`mockAnimationsApi()`,"```"].join(`
|
|
135
|
+
`)),[]});var Zq=(e=>(e[e.None=0]=`None`,e[e.Closed=1]=`Closed`,e[e.Enter=2]=`Enter`,e[e.Leave=4]=`Leave`,e))(Zq||{});function Qq(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]=``);return t}function $q(e,t,n,r){let[i,a]=(0,u.useState)(n),{hasFlag:o,addFlag:s,removeFlag:c}=Xq(e&&i?3:0),l=(0,u.useRef)(!1),d=(0,u.useRef)(!1);return qG(()=>{var i;if(e){if(n&&a(!0),!t){n&&s(3);return}return(i=r?.start)==null||i.call(r,n),eJ(t,{inFlight:l,prepare(){d.current?d.current=!1:d.current=l.current,l.current=!0,!d.current&&(n?(s(3),c(4)):(s(4),c(2)))},run(){d.current?n?(c(3),s(4)):(c(4),s(3)):n?c(1):s(1)},done(){var e;d.current&&rJ(t)||(l.current=!1,c(7),n||a(!1),(e=r?.end)==null||e.call(r,n))}})}},[e,n,t,KG()]),e?[i,{closed:o(1),enter:o(2),leave:o(4),transition:o(2)||o(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function eJ(e,{prepare:t,run:n,done:r,inFlight:i}){let a=GG();return nJ(e,{prepare:t,inFlight:i}),a.nextFrame(()=>{n(),a.requestAnimationFrame(()=>{a.add(tJ(e,r))})}),a.dispose}function tJ(e,t){let n=GG();if(!e)return n.dispose;let r=!1;n.add(()=>{r=!0});let i=e.getAnimations?.call(e).filter(e=>e instanceof CSSTransition)??[];return i.length===0?(t(),n.dispose):(Promise.allSettled(i.map(e=>e.finished)).then(()=>{r||t()}),n.dispose)}function nJ(e,{inFlight:t,prepare:n}){if(t!=null&&t.current){n();return}let r=e.style.transition;e.style.transition=`none`,n(),e.offsetHeight,e.style.transition=r}function rJ(e){return(e.getAnimations?.call(e)??[]).some(e=>e instanceof CSSTransition&&e.playState!==`finished`)}function iJ(e,t){let n=(0,u.useRef)([]),r=YG(e);(0,u.useEffect)(()=>{let e=[...n.current];for(let[i,a]of t.entries())if(n.current[i]!==a){let i=r(t,e);return n.current=t,i}},[r,...t])}var aJ=(0,u.createContext)(null);aJ.displayName=`OpenClosedContext`;var oJ=(e=>(e[e.Open=1]=`Open`,e[e.Closed=2]=`Closed`,e[e.Closing=4]=`Closing`,e[e.Opening=8]=`Opening`,e))(oJ||{});function sJ(){return(0,u.useContext)(aJ)}function cJ({value:e,children:t}){return u.createElement(aJ.Provider,{value:e},t)}function lJ({children:e}){return u.createElement(aJ.Provider,{value:null},e)}function uJ(e){function t(){document.readyState!==`loading`&&(e(),document.removeEventListener(`DOMContentLoaded`,t))}typeof window<`u`&&typeof document<`u`&&(document.addEventListener(`DOMContentLoaded`,t),t())}var dJ=[];uJ(()=>{function e(e){if(!CK(e.target)||e.target===document.body||dJ[0]===e.target)return;let t=e.target;t=t.closest(_q),dJ.unshift(t??e.target),dJ=dJ.filter(e=>e!=null&&e.isConnected),dJ.splice(10)}window.addEventListener(`click`,e,{capture:!0}),window.addEventListener(`mousedown`,e,{capture:!0}),window.addEventListener(`focus`,e,{capture:!0}),document.body.addEventListener(`click`,e,{capture:!0}),document.body.addEventListener(`mousedown`,e,{capture:!0}),document.body.addEventListener(`focus`,e,{capture:!0})});function fJ(e){let t=YG(e),n=(0,u.useRef)(!1);(0,u.useEffect)(()=>(n.current=!1,()=>{n.current=!0,WG(()=>{n.current&&t()})}),[t])}function pJ(){let e=typeof document>`u`;return`useSyncExternalStore`in u?(e=>e.useSyncExternalStore)(u)(()=>()=>{},()=>!1,()=>!e):!1}function mJ(){let e=pJ(),[t,n]=u.useState(zG.isHandoffComplete);return t&&zG.isHandoffComplete===!1&&n(!1),u.useEffect(()=>{t!==!0&&n(!0)},[t]),u.useEffect(()=>zG.handoff(),[]),e?!1:t}var hJ=(0,u.createContext)(!1);function gJ(){return(0,u.useContext)(hJ)}function _J(e){return u.createElement(hJ.Provider,{value:e.force},e.children)}function vJ(e){let t=gJ(),n=(0,u.useContext)(CJ),[r,i]=(0,u.useState)(()=>{if(!t&&n!==null)return n.current??null;if(zG.isServer)return null;let r=e?.getElementById(`headlessui-portal-root`);if(r)return r;if(e===null)return null;let i=e.createElement(`div`);return i.setAttribute(`id`,`headlessui-portal-root`),e.body.appendChild(i)});return(0,u.useEffect)(()=>{r!==null&&(e!=null&&e.body.contains(r)||e==null||e.body.appendChild(r))},[r,e]),(0,u.useEffect)(()=>{t||n!==null&&i(n.current)},[n,i,t]),r}var yJ=u.Fragment,bJ=lK(function(e,t){let{ownerDocument:n=null,...r}=e,i=(0,u.useRef)(null),a=kK(OK(e=>{i.current=e}),t),o=zq(i.current),s=vJ(n??o),c=(0,u.useContext)(TJ),l=KG(),d=mJ(),f=rK();return fJ(()=>{var e;s&&s.childNodes.length<=0&&((e=s.parentElement)==null||e.removeChild(s))}),!s||!d?null:(0,xf.createPortal)(u.createElement(`div`,{"data-headlessui-portal":``,ref:e=>{l.dispose(),c&&e&&l.add(c.register(e))}},f({ourProps:{ref:a},theirProps:r,slot:{},defaultTag:yJ,name:`Portal`})),s)});function xJ(e,t){let n=kK(t),{enabled:r=!0,ownerDocument:i,...a}=e,o=rK();return r?u.createElement(bJ,{...a,ownerDocument:i,ref:n}):o({ourProps:{ref:n},theirProps:a,slot:{},defaultTag:yJ,name:`Portal`})}var SJ=u.Fragment,CJ=(0,u.createContext)(null);function wJ(e,t){let{target:n,...r}=e,i={ref:kK(t)},a=rK();return u.createElement(CJ.Provider,{value:n},a({ourProps:i,theirProps:r,defaultTag:SJ,name:`Popover.Group`}))}var TJ=(0,u.createContext)(null);function EJ(){let e=(0,u.useContext)(TJ),t=(0,u.useRef)([]),n=YG(n=>(t.current.push(n),e&&e.register(n),()=>r(n))),r=YG(n=>{let r=t.current.indexOf(n);r!==-1&&t.current.splice(r,1),e&&e.unregister(n)}),i=(0,u.useMemo)(()=>({register:n,unregister:r,portals:t}),[n,r,t]);return[t,(0,u.useMemo)(()=>function({children:e}){return u.createElement(TJ.Provider,{value:i},e)},[i])]}var DJ=lK(xJ),OJ=lK(wJ),kJ=Object.assign(DJ,{Group:OJ});function AJ(e,t=typeof document<`u`?document.defaultView:null,n){let r=uq(e,`escape`);Bq(t,`keydown`,e=>{r&&(e.defaultPrevented||e.key===LK.Escape&&n(e))})}function jJ(){let[e]=(0,u.useState)(()=>typeof window<`u`&&typeof window.matchMedia==`function`?window.matchMedia(`(pointer: coarse)`):null),[t,n]=(0,u.useState)(e?.matches??!1);return qG(()=>{if(!e)return;function t(e){n(e.matches)}return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[e]),t}function MJ({defaultContainers:e=[],portals:t,mainTreeNode:n}={}){let r=YG(()=>{let r=BG(n),i=[];for(let t of e)t!==null&&(xK(t)?i.push(t):`current`in t&&xK(t.current)&&i.push(t.current));if(t!=null&&t.current)for(let e of t.current)i.push(e);for(let e of r?.querySelectorAll(`html > *, body > *`)??[])e!==document.body&&e!==document.head&&xK(e)&&e.id!==`headlessui-portal-root`&&(n&&(e.contains(n)||e.contains(n?.getRootNode()?.host))||i.some(t=>e.contains(t))||i.push(e));return i});return{resolveContainers:r,contains:YG(e=>r().some(t=>t.contains(e)))}}var NJ=(0,u.createContext)(null);function PJ({children:e,node:t}){let[n,r]=(0,u.useState)(null),i=FJ(t??n);return u.createElement(NJ.Provider,{value:i},e,i===null&&u.createElement(yK,{features:_K.Hidden,ref:e=>{if(e){for(let t of BG(e)?.querySelectorAll(`html > *, body > *`)??[])if(t!==document.body&&t!==document.head&&xK(t)&&t!=null&&t.contains(e)){r(t);break}}}}))}function FJ(e=null){return(0,u.useContext)(NJ)??e}function IJ(){let e=(0,u.useRef)(!1);return qG(()=>(e.current=!0,()=>{e.current=!1}),[]),e}var LJ=(e=>(e[e.Forwards=0]=`Forwards`,e[e.Backwards=1]=`Backwards`,e))(LJ||{});function RJ(){let e=(0,u.useRef)(0);return Iq(!0,`keydown`,t=>{t.key===`Tab`&&(e.current=+!!t.shiftKey)},!0),e}function zJ(e){if(!e)return new Set;if(typeof e==`function`)return new Set(e());let t=new Set;for(let n of e.current)xK(n.current)&&t.add(n.current);return t}var BJ=`div`,VJ=(e=>(e[e.None=0]=`None`,e[e.InitialFocus=1]=`InitialFocus`,e[e.TabLock=2]=`TabLock`,e[e.FocusLock=4]=`FocusLock`,e[e.RestoreFocus=8]=`RestoreFocus`,e[e.AutoFocus=16]=`AutoFocus`,e))(VJ||{});function HJ(e,t){let n=(0,u.useRef)(null),r=kK(n,t),{initialFocus:i,initialFocusFallback:a,containers:o,features:s=15,...c}=e;mJ()||(s=0);let l=zq(n.current);KJ(s,{ownerDocument:l});let d=qJ(s,{ownerDocument:l,container:n,initialFocus:i,initialFocusFallback:a});JJ(s,{ownerDocument:l,container:n,containers:o,previousActiveElement:d});let f=RJ(),p=YG(e=>{if(!SK(n.current))return;let t=n.current;(e=>e())(()=>{eK(f.current,{[LJ.Forwards]:()=>{jq(t,yq.First,{skipElements:[e.relatedTarget,a]})},[LJ.Backwards]:()=>{jq(t,yq.Last,{skipElements:[e.relatedTarget,a]})}})})}),m=uq(!!(s&2),`focus-trap#tab-lock`),h=KG(),g=(0,u.useRef)(!1),_={ref:r,onKeyDown(e){e.key==`Tab`&&(g.current=!0,h.requestAnimationFrame(()=>{g.current=!1}))},onBlur(e){if(!(s&4))return;let t=zJ(o);SK(n.current)&&t.add(n.current);let r=e.relatedTarget;CK(r)&&r.dataset.headlessuiFocusGuard!==`true`&&(YJ(t,r)||(g.current?jq(n.current,eK(f.current,{[LJ.Forwards]:()=>yq.Next,[LJ.Backwards]:()=>yq.Previous})|yq.WrapAround,{relativeTo:e.target}):CK(e.target)&&Dq(e.target)))}},v=rK();return u.createElement(u.Fragment,null,m&&u.createElement(yK,{as:`button`,type:`button`,"data-headlessui-focus-guard":!0,onFocus:p,features:_K.Focusable}),v({ourProps:_,theirProps:c,defaultTag:BJ,name:`FocusTrap`}),m&&u.createElement(yK,{as:`button`,type:`button`,"data-headlessui-focus-guard":!0,onFocus:p,features:_K.Focusable}))}var UJ=lK(HJ),WJ=Object.assign(UJ,{features:VJ});function GJ(e=!0){let t=(0,u.useRef)(dJ.slice());return iJ(([e],[n])=>{n===!0&&e===!1&&WG(()=>{t.current.splice(0)}),n===!1&&e===!0&&(t.current=dJ.slice())},[e,dJ,t]),YG(()=>t.current.find(e=>e!=null&&e.isConnected)??null)}function KJ(e,{ownerDocument:t}){let n=!!(e&8),r=GJ(n);iJ(()=>{n||UG(t?.body)&&Dq(r())},[n]),fJ(()=>{n&&Dq(r())})}function qJ(e,{ownerDocument:t,container:n,initialFocus:r,initialFocusFallback:i}){let a=(0,u.useRef)(null),o=uq(!!(e&1),`focus-trap#initial-focus`),s=IJ();return iJ(()=>{if(e===0)return;if(!o){i!=null&&i.current&&Dq(i.current);return}let c=n.current;c&&WG(()=>{if(!s.current)return;let n=t?.activeElement;if(r!=null&&r.current){if(r?.current===n){a.current=n;return}}else if(c.contains(n)){a.current=n;return}if(r!=null&&r.current)Dq(r.current);else{if(e&16){if(jq(c,yq.First|yq.AutoFocus)!==bq.Error)return}else if(jq(c,yq.First)!==bq.Error)return;if(i!=null&&i.current&&(Dq(i.current),t?.activeElement===i.current))return;console.warn(`There are no focusable elements inside the <FocusTrap />`)}a.current=t?.activeElement})},[i,o,e]),a}function JJ(e,{ownerDocument:t,container:n,containers:r,previousActiveElement:i}){let a=IJ(),o=!!(e&4);Bq(t?.defaultView,`focus`,e=>{if(!o||!a.current)return;let t=zJ(r);SK(n.current)&&t.add(n.current);let s=i.current;if(!s)return;let c=e.target;SK(c)?YJ(t,c)?(i.current=c,Dq(c)):(e.preventDefault(),e.stopPropagation(),Dq(s)):Dq(i.current)},!0)}function YJ(e,t){for(let n of e)if(n.contains(t))return!0;return!1}function XJ(e){return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||!mK(e.as??iY)||u.Children.count(e.children)===1}var ZJ=(0,u.createContext)(null);ZJ.displayName=`TransitionContext`;var QJ=(e=>(e.Visible=`visible`,e.Hidden=`hidden`,e))(QJ||{});function $J(){let e=(0,u.useContext)(ZJ);if(e===null)throw Error(`A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.`);return e}function eY(){let e=(0,u.useContext)(tY);if(e===null)throw Error(`A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.`);return e}var tY=(0,u.createContext)(null);tY.displayName=`NestingContext`;function nY(e){return`children`in e?nY(e.children):e.current.filter(({el:e})=>e.current!==null).filter(({state:e})=>e===`visible`).length>0}function rY(e,t){let n=JG(e),r=(0,u.useRef)([]),i=IJ(),a=KG(),o=YG((e,t=nK.Hidden)=>{let o=r.current.findIndex(({el:t})=>t===e);o!==-1&&(eK(t,{[nK.Unmount](){r.current.splice(o,1)},[nK.Hidden](){r.current[o].state=`hidden`}}),a.microTask(()=>{var e;!nY(r)&&i.current&&((e=n.current)==null||e.call(n))}))}),s=YG(e=>{let t=r.current.find(({el:t})=>t===e);return t?t.state!==`visible`&&(t.state=`visible`):r.current.push({el:e,state:`visible`}),()=>o(e,nK.Unmount)}),c=(0,u.useRef)([]),l=(0,u.useRef)(Promise.resolve()),d=(0,u.useRef)({enter:[],leave:[]}),f=YG((e,n,r)=>{c.current.splice(0),t&&(t.chains.current[n]=t.chains.current[n].filter(([t])=>t!==e)),t?.chains.current[n].push([e,new Promise(e=>{c.current.push(e)})]),t?.chains.current[n].push([e,new Promise(e=>{Promise.all(d.current[n].map(([e,t])=>t)).then(()=>e())})]),n===`enter`?l.current=l.current.then(()=>t?.wait.current).then(()=>r(n)):r(n)}),p=YG((e,t,n)=>{Promise.all(d.current[t].splice(0).map(([e,t])=>t)).then(()=>{var e;(e=c.current.shift())==null||e()}).then(()=>n(t))});return(0,u.useMemo)(()=>({children:r,register:s,unregister:o,onStart:f,onStop:p,wait:l,chains:d}),[s,o,r,f,p,d,l])}var iY=u.Fragment,aY=tK.RenderStrategy;function oY(e,t){var n;let{transition:r=!0,beforeEnter:i,afterEnter:a,beforeLeave:o,afterLeave:s,enter:c,enterFrom:l,enterTo:d,entered:f,leave:p,leaveFrom:m,leaveTo:h,...g}=e,[_,v]=(0,u.useState)(null),y=(0,u.useRef)(null),b=XJ(e),x=kK(...b?[y,t,v]:t===null?[]:[t]),S=(n=g.unmount)==null||n?nK.Unmount:nK.Hidden,{show:C,appear:w,initial:T}=$J(),[E,D]=(0,u.useState)(C?`visible`:`hidden`),O=eY(),{register:k,unregister:A}=O;qG(()=>k(y),[k,y]),qG(()=>{if(S===nK.Hidden&&y.current){if(C&&E!==`visible`){D(`visible`);return}return eK(E,{hidden:()=>A(y),visible:()=>k(y)})}},[E,y,k,A,C,S]);let j=mJ();qG(()=>{if(b&&j&&E===`visible`&&y.current===null)throw Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[y,E,j,b]);let ee=T&&!w,M=w&&C&&T,N=(0,u.useRef)(!1),te=rY(()=>{N.current||(D(`hidden`),A(y))},O),ne=YG(e=>{N.current=!0;let t=e?`enter`:`leave`;te.onStart(y,t,e=>{e===`enter`?i?.():e===`leave`&&o?.()})}),re=YG(e=>{let t=e?`enter`:`leave`;N.current=!1,te.onStop(y,t,e=>{e===`enter`?a?.():e===`leave`&&s?.()}),t===`leave`&&!nY(te)&&(D(`hidden`),A(y))});(0,u.useEffect)(()=>{b&&r||(ne(C),re(C))},[C,b,r]);let[,ie]=$q(!(!r||!b||!j||ee),_,C,{start:ne,end:re}),ae=uK({ref:x,className:$G(g.className,M&&c,M&&l,ie.enter&&c,ie.enter&&ie.closed&&l,ie.enter&&!ie.closed&&d,ie.leave&&p,ie.leave&&!ie.closed&&m,ie.leave&&ie.closed&&h,!ie.transition&&C&&f)?.trim()||void 0,...Qq(ie)}),oe=0;E===`visible`&&(oe|=oJ.Open),E===`hidden`&&(oe|=oJ.Closed),C&&E===`hidden`&&(oe|=oJ.Opening),!C&&E===`visible`&&(oe|=oJ.Closing);let se=rK();return u.createElement(tY.Provider,{value:te},u.createElement(cJ,{value:oe},se({ourProps:ae,theirProps:g,defaultTag:iY,features:aY,visible:E===`visible`,name:`Transition.Child`})))}function sY(e,t){let{show:n,appear:r=!1,unmount:i=!0,...a}=e,o=(0,u.useRef)(null),s=kK(...XJ(e)?[o,t]:t===null?[]:[t]);mJ();let c=sJ();if(n===void 0&&c!==null&&(n=(c&oJ.Open)===oJ.Open),n===void 0)throw Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[l,d]=(0,u.useState)(n?`visible`:`hidden`),f=rY(()=>{n||d(`hidden`)}),[p,m]=(0,u.useState)(!0),h=(0,u.useRef)([n]);qG(()=>{p!==!1&&h.current[h.current.length-1]!==n&&(h.current.push(n),m(!1))},[h,n]);let g=(0,u.useMemo)(()=>({show:n,appear:r,initial:p}),[n,r,p]);qG(()=>{n?d(`visible`):!nY(f)&&o.current!==null&&d(`hidden`)},[n,f]);let _={unmount:i},v=YG(()=>{var t;p&&m(!1),(t=e.beforeEnter)==null||t.call(e)}),y=YG(()=>{var t;p&&m(!1),(t=e.beforeLeave)==null||t.call(e)}),b=rK();return u.createElement(tY.Provider,{value:f},u.createElement(ZJ.Provider,{value:g},b({ourProps:{..._,as:u.Fragment,children:u.createElement(uY,{ref:s,..._,...a,beforeEnter:v,beforeLeave:y})},theirProps:{},defaultTag:u.Fragment,features:aY,visible:l===`visible`,name:`Transition`})))}function cY(e,t){let n=(0,u.useContext)(ZJ)!==null,r=sJ()!==null;return u.createElement(u.Fragment,null,!n&&r?u.createElement(lY,{ref:t,...e}):u.createElement(uY,{ref:t,...e}))}var lY=lK(sY),uY=lK(oY),dY=lK(cY),fY=Object.assign(lY,{Child:dY,Root:lY}),pY=(e=>(e[e.Open=0]=`Open`,e[e.Closed=1]=`Closed`,e))(pY||{}),mY=(e=>(e[e.SetTitleId=0]=`SetTitleId`,e))(mY||{}),hY={0(e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},gY=(0,u.createContext)(null);gY.displayName=`DialogContext`;function _Y(e){let t=(0,u.useContext)(gY);if(t===null){let t=Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,_Y),t}return t}function vY(e,t){return eK(t.type,hY,e,t)}var yY=lK(function(e,t){let n=(0,u.useId)(),{id:r=`headlessui-dialog-${n}`,open:i,onClose:a,initialFocus:o,role:s=`dialog`,autoFocus:c=!0,__demoMode:l=!1,unmount:d=!1,...f}=e,p=(0,u.useRef)(!1);s=(function(){return s===`dialog`||s===`alertdialog`?s:(p.current||(p.current=!0,console.warn(`Invalid role [${s}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),`dialog`)})();let m=sJ();i===void 0&&m!==null&&(i=(m&oJ.Open)===oJ.Open);let h=(0,u.useRef)(null),g=kK(h,t),_=zq(h.current),v=+!i,[y,b]=(0,u.useReducer)(vY,{titleId:null,descriptionId:null,panelRef:(0,u.createRef)()}),x=YG(()=>a(!1)),S=YG(e=>b({type:0,id:e})),C=mJ()?v===0:!1,[w,T]=EJ(),E={get current(){return y.panelRef.current??h.current}},D=FJ(),{resolveContainers:O}=MJ({mainTreeNode:D,portals:w,defaultContainers:[E]}),k=m===null?!1:(m&oJ.Closing)===oJ.Closing;hq(l||k?!1:C,{allowed:YG(()=>[h.current?.closest(`[data-headlessui-portal]`)??null]),disallowed:YG(()=>[D?.closest(`body > *:not(#headlessui-portal-root)`)??null])});let A=sq.get(null);qG(()=>{if(C)return A.actions.push(r),()=>A.actions.pop(r)},[A,r,C]);let j=cq(A,(0,u.useCallback)(e=>A.selectors.isTop(e,r),[A,r]));Rq(j,O,e=>{e.preventDefault(),x()}),AJ(j,_?.defaultView,e=>{e.preventDefault(),e.stopPropagation(),document.activeElement&&`blur`in document.activeElement&&typeof document.activeElement.blur==`function`&&document.activeElement.blur(),x()}),Yq(l||k?!1:C,_,O),gq(C,h,x);let[ee,M]=MK(),N=(0,u.useMemo)(()=>[{dialogState:v,close:x,setTitleId:S,unmount:d},y],[v,x,S,d,y]),te=XG({open:v===0}),ne={ref:g,id:r,role:s,tabIndex:-1,"aria-modal":l?void 0:v===0?!0:void 0,"aria-labelledby":y.titleId,"aria-describedby":ee,unmount:d},re=!jJ(),ie=VJ.None;C&&!l&&(ie|=VJ.RestoreFocus,ie|=VJ.TabLock,c&&(ie|=VJ.AutoFocus),re&&(ie|=VJ.InitialFocus));let ae=rK();return u.createElement(lJ,null,u.createElement(_J,{force:!0},u.createElement(kJ,null,u.createElement(gY.Provider,{value:N},u.createElement(OJ,{target:h},u.createElement(_J,{force:!1},u.createElement(M,{slot:te},u.createElement(T,null,u.createElement(WJ,{initialFocus:o,initialFocusFallback:h,containers:O,features:ie},u.createElement(zK,{value:x},ae({ourProps:ne,theirProps:f,slot:te,defaultTag:bY,features:xY,visible:v===0,name:`Dialog`})))))))))))}),bY=`div`,xY=tK.RenderStrategy|tK.Static;function SY(e,t){let{transition:n=!1,open:r,...i}=e,a=sJ(),o=e.hasOwnProperty(`open`)||a!==null,s=e.hasOwnProperty(`onClose`);if(!o&&!s)throw Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!o)throw Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!s)throw Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(!a&&typeof e.open!=`boolean`)throw Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${e.open}`);if(typeof e.onClose!=`function`)throw Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${e.onClose}`);return(r!==void 0||n)&&!i.static?u.createElement(PJ,null,u.createElement(fY,{show:r,transition:n,unmount:i.unmount},u.createElement(yY,{ref:t,...i}))):u.createElement(PJ,null,u.createElement(yY,{ref:t,open:r,...i}))}var CY=`div`;function wY(e,t){let n=(0,u.useId)(),{id:r=`headlessui-dialog-panel-${n}`,transition:i=!1,...a}=e,[{dialogState:o,unmount:s},c]=_Y(`Dialog.Panel`),l=kK(t,c.panelRef),d=XG({open:o===0}),f={ref:l,id:r,onClick:YG(e=>{e.stopPropagation()})},p=i?dY:u.Fragment,m=i?{unmount:s}:{},h=rK();return u.createElement(p,{...m},h({ourProps:f,theirProps:a,slot:d,defaultTag:CY,name:`Dialog.Panel`}))}var TY=`div`;function EY(e,t){let{transition:n=!1,...r}=e,[{dialogState:i,unmount:a}]=_Y(`Dialog.Backdrop`),o=XG({open:i===0}),s={ref:t,"aria-hidden":!0},c=n?dY:u.Fragment,l=n?{unmount:a}:{},d=rK();return u.createElement(c,{...l},d({ourProps:s,theirProps:r,slot:o,defaultTag:TY,name:`Dialog.Backdrop`}))}var DY=`h2`;function OY(e,t){let n=(0,u.useId)(),{id:r=`headlessui-dialog-title-${n}`,...i}=e,[{dialogState:a,setTitleId:o}]=_Y(`Dialog.Title`),s=kK(t);(0,u.useEffect)(()=>(o(r),()=>o(null)),[r,o]);let c=XG({open:a===0}),l={ref:s,id:r};return rK()({ourProps:l,theirProps:i,slot:c,defaultTag:DY,name:`Dialog.Title`})}var kY=lK(SY),AY=lK(wY);lK(EY);var jY=lK(OY),MY=Object.assign(kY,{Panel:AY,Title:jY,Description:IK});function NY({children:e,position:t,onClose:n,isOpen:r,wide:i=!1}){let a=i?800:400,o=i?700:500,s={position:`fixed`,left:`${Math.min(t.x,typeof window<`u`?window.innerWidth-a:t.x)}px`,top:`${Math.min(t.y,typeof window<`u`?window.innerHeight-o:t.y)}px`};return(0,F.jsx)(fY,{appear:!0,show:r,children:(0,F.jsxs)(MY,{as:`div`,className:`semiont-popup-overlay`,onClose:n,children:[(0,F.jsx)(dY,{enter:`ease-out duration-200`,enterFrom:`opacity-0`,enterTo:`opacity-100`,leave:`ease-in duration-150`,leaveFrom:`opacity-100`,leaveTo:`opacity-0`,children:(0,F.jsx)(`div`,{className:`semiont-popup-backdrop`})}),(0,F.jsx)(`div`,{className:`semiont-popup-container`,children:(0,F.jsx)(dY,{enter:`ease-out duration-200`,enterFrom:`opacity-0 scale-95`,enterTo:`opacity-100 scale-100`,leave:`ease-in duration-150`,leaveFrom:`opacity-100 scale-100`,leaveTo:`opacity-0 scale-95`,children:(0,F.jsx)(AY,{className:`semiont-popup-panel`,style:s,"data-annotation-ui":!0,"data-wide":i?`true`:`false`,children:(0,F.jsx)(F.Fragment,{children:e})})})})]})})}function PY(e){return Xo(e)?{stroke:`rgb(250, 204, 21)`,fill:`rgba(250, 204, 21, 0.2)`}:Zo(e)?{stroke:`rgb(59, 130, 246)`,fill:`rgba(59, 130, 246, 0.2)`}:Qo(e)?{stroke:`rgb(239, 68, 68)`,fill:`rgba(239, 68, 68, 0.2)`}:$o(e)?{stroke:`rgb(255, 255, 255)`,fill:`rgba(255, 255, 255, 0.2)`}:es(e)?{stroke:`rgb(234, 88, 12)`,fill:`rgba(234, 88, 12, 0.2)`}:{stroke:`rgb(156, 163, 175)`,fill:`rgba(156, 163, 175, 0.2)`}}function FY(e){return $o(e)?`Comment`:Xo(e)?`Highlight`:Qo(e)?`Assessment`:es(e)?`Tag`:ns(e)?`Resolved Reference`:Zo(e)?`Unresolved Reference`:`Annotation`}function IY({annotations:e,imageWidth:t,imageHeight:n,displayWidth:r,displayHeight:i,session:a,hoveredAnnotationId:o,selectedAnnotationId:s,hoverDelayMs:c}){let l=r/t,d=i/n,{handleMouseEnter:f,handleMouseLeave:p}=(0,u.useMemo)(()=>hf(e=>a?.client.beckon.hover(e),c),[a,c]);return(0,F.jsx)(`svg`,{className:`semiont-annotation-overlay`,style:{width:r,height:i},children:e.map(e=>{if(typeof e.target==`string`)return null;let t=Go(e.target.selector);if(!t)return null;let n=ks(t.value);if(!n)return null;let r=e.id===o,i=e.id===s,c=PY(e),u=Zo(e),m=u&&Jo(e.body),h=u?m?`🔗`:`❓`:null;switch(n.type){case`rect`:{let{x:t,y:o,width:s,height:u}=n.data,m=(t+s)*l+8,g=(o+u)*d+4;return(0,F.jsxs)(`g`,{children:[(0,F.jsx)(`title`,{children:FY(e)}),(0,F.jsx)(`rect`,{x:t*l,y:o*d,width:s*l,height:u*d,fill:r||i?c.fill:`transparent`,stroke:c.stroke,strokeWidth:r||i?3:2,opacity:r||i?1:.7,className:`semiont-annotation-overlay__shape`,"data-hovered":r?`true`:`false`,"data-selected":i?`true`:`false`,onClick:()=>a?.client.browse.click(e.id,e.motivation),onMouseEnter:()=>f(e.id),onMouseLeave:p}),h&&(0,F.jsx)(`text`,{x:m,y:g,fontSize:`16`,className:`semiont-annotation-overlay__status-indicator`,style:{userSelect:`none`},onClick:t=>{t.stopPropagation(),a?.client.browse.click(e.id,e.motivation)},onMouseEnter:()=>f(e.id),onMouseLeave:p,children:h})]},e.id)}case`circle`:{let{cx:t,cy:o,r:s}=n.data,u=s*Math.min(l,d),m=Math.PI/4,g=t*l+u*Math.cos(m)+8,_=o*d+u*Math.sin(m)+4;return(0,F.jsxs)(`g`,{children:[(0,F.jsx)(`title`,{children:FY(e)}),(0,F.jsx)(`circle`,{cx:t*l,cy:o*d,r:u,fill:r||i?c.fill:`transparent`,stroke:c.stroke,strokeWidth:r||i?3:2,opacity:r||i?1:.7,className:`semiont-annotation-overlay__shape`,"data-hovered":r?`true`:`false`,"data-selected":i?`true`:`false`,onClick:()=>a?.client.browse.click(e.id,e.motivation),onMouseEnter:()=>f(e.id),onMouseLeave:p}),h&&(0,F.jsx)(`text`,{x:g,y:_,fontSize:`16`,className:`semiont-annotation-overlay__status-indicator`,style:{userSelect:`none`},onClick:t=>{t.stopPropagation(),a?.client.browse.click(e.id,e.motivation)},onMouseEnter:()=>f(e.id),onMouseLeave:p,children:h})]},e.id)}case`polygon`:{let t=n.data.points.map(e=>`${e.x*l},${e.y*d}`).join(` `),o=[...n.data.points.map(e=>({x:e.x*l,y:e.y*d,sum:e.x*l+e.y*d}))].sort((e,t)=>t.sum-e.sum),s=o[0],u=o[1],m=(s.x+u.x)/2+8,g=(s.y+u.y)/2+4;return(0,F.jsxs)(`g`,{children:[(0,F.jsx)(`title`,{children:FY(e)}),(0,F.jsx)(`polygon`,{points:t,fill:r||i?c.fill:`transparent`,stroke:c.stroke,strokeWidth:r||i?3:2,opacity:r||i?1:.7,className:`semiont-annotation-overlay__shape`,"data-hovered":r?`true`:`false`,"data-selected":i?`true`:`false`,onClick:()=>a?.client.browse.click(e.id,e.motivation),onMouseEnter:()=>f(e.id),onMouseLeave:p}),h&&(0,F.jsx)(`text`,{x:m,y:g,fontSize:`16`,className:`semiont-annotation-overlay__status-indicator`,style:{userSelect:`none`},onClick:t=>{t.stopPropagation(),a?.client.browse.click(e.id,e.motivation)},onMouseEnter:()=>f(e.id),onMouseLeave:p,children:h})]},e.id)}default:return null}})})}function LY(e){if(!e)return{stroke:`rgb(156, 163, 175)`,fill:`rgba(156, 163, 175, 0.2)`};switch(e){case`highlighting`:return{stroke:`rgb(250, 204, 21)`,fill:`rgba(250, 204, 21, 0.2)`};case`linking`:return{stroke:`rgb(59, 130, 246)`,fill:`rgba(59, 130, 246, 0.2)`};case`assessing`:return{stroke:`rgb(239, 68, 68)`,fill:`rgba(239, 68, 68, 0.2)`};case`commenting`:return{stroke:`rgb(255, 255, 255)`,fill:`rgba(255, 255, 255, 0.2)`};default:return{stroke:`rgb(156, 163, 175)`,fill:`rgba(156, 163, 175, 0.2)`}}}function RY({imageUrl:e,resourceUri:t,existingAnnotations:n=[],drawingMode:r,selectedMotivation:i,session:a,hoveredAnnotationId:o,selectedAnnotationId:s}){let{hoverDelayMs:c}=hL(),l=(0,u.useRef)(null),d=(0,u.useRef)(null),[f,p]=(0,u.useState)(null),[m,h]=(0,u.useState)(null),[g,_]=(0,u.useState)(!1),[v,y]=(0,u.useState)(null),[b,x]=(0,u.useState)(null);(0,u.useEffect)(()=>{let t=new Image;t.onload=()=>{p({width:t.naturalWidth,height:t.naturalHeight})},t.src=e},[e]),(0,u.useEffect)(()=>{let e=()=>{d.current&&h({width:d.current.clientWidth,height:d.current.clientHeight})};e();let t=null;try{t=new ResizeObserver(e),d.current&&t.observe(d.current)}catch{console.warn(`ResizeObserver not supported, falling back to window resize listener`),window.addEventListener(`resize`,e)}return()=>{t?t.disconnect():window.removeEventListener(`resize`,e)}},[]);let S=(0,u.useCallback)(e=>{if(!d.current)return null;let t=d.current.getBoundingClientRect();return{x:e.clientX-t.left,y:e.clientY-t.top}},[]);return(0,F.jsxs)(`div`,{ref:l,className:`semiont-svg-drawing-canvas`,onMouseDown:(0,u.useCallback)(e=>{if(!r)return;let t=S(e);t&&(_(!0),y(t),x(t))},[r,S]),onMouseMove:(0,u.useCallback)(e=>{if(!g||!v)return;let t=S(e);t&&x(t)},[g,v,S]),onMouseUp:(0,u.useCallback)(e=>{if(!g||!v||!r)return;let o=S(e);if(!o||!m||!f)return;if(Math.sqrt((o.x-v.x)**2+(o.y-v.y)**2)<10){if(n.length>0){let e=n.find(e=>{if(typeof e.target==`string`)return!1;let t=e.target.selector;if(!t)return!1;let n=(Array.isArray(t)?t:[t]).find(e=>e.type===`SvgSelector`);if(!n||n.type!==`SvgSelector`)return!1;let r=ks(n.value);if(!r)return!1;let i=m.width/f.width,a=m.height/f.height;if(r.type===`rect`){let{x:e,y:t,width:n,height:s}=r.data,c=e*i,l=t*a,u=n*i,d=s*a;return o.x>=c&&o.x<=c+u&&o.y>=l&&o.y<=l+d}return!1});if(e){a?.client.browse.click(e.id,e.motivation),_(!1),y(null),x(null);return}}_(!1),y(null),x(null);return}let s;switch(r){case`circle`:s=Os(v,Math.sqrt((o.x-v.x)**2+(o.y-v.y)**2));break;case`polygon`:{let e=(v.x+o.x)/2,t=(v.y+o.y)/2,n=Math.abs(o.x-v.x)/2,r=Math.abs(o.y-v.y)/2;s=Ds([{x:e,y:t-r},{x:e+n,y:t},{x:e,y:t+r},{x:e-n,y:t}]);break}default:s=Es(v,o);break}let c=As(s,m.width,m.height,f.width,f.height);a&&i&&a.client.mark.request(To(t),{type:`SvgSelector`,value:c},i),_(!1),y(null),x(null)},[g,v,r,m,f,S,i,n]),onMouseLeave:(0,u.useCallback)(()=>{g&&(_(!1),y(null),x(null))},[g]),"data-drawing-mode":r||`none`,children:[(0,F.jsx)(`img`,{ref:d,src:e,alt:`Annotatable content`,className:`semiont-svg-drawing-canvas__image`,draggable:!1}),m&&f&&(0,F.jsx)(`div`,{className:`semiont-svg-drawing-canvas__overlay-container`,children:(0,F.jsxs)(`div`,{className:`semiont-svg-drawing-canvas__overlay`,style:{width:m.width,height:m.height},children:[(0,F.jsx)(IY,{annotations:n,imageWidth:f.width,imageHeight:f.height,displayWidth:m.width,displayHeight:m.height,hoverDelayMs:c,...a&&{session:a},...o!==void 0&&{hoveredAnnotationId:o},...s!==void 0&&{selectedAnnotationId:s}}),g&&v&&b&&(()=>{let e=LY(i||null);return(0,F.jsxs)(`svg`,{className:`semiont-svg-drawing-canvas__preview`,style:{width:m.width,height:m.height},children:[r===`circle`&&(()=>{let t=Math.sqrt((b.x-v.x)**2+(b.y-v.y)**2);return(0,F.jsx)(`circle`,{cx:v.x,cy:v.y,r:t,fill:e.fill,stroke:e.stroke,strokeWidth:`2`,strokeDasharray:`5,5`})})(),r===`polygon`&&(()=>{let t=(v.x+b.x)/2,n=(v.y+b.y)/2,r=Math.abs(b.x-v.x)/2,i=Math.abs(b.y-v.y)/2;return(0,F.jsx)(`polygon`,{points:[{x:t,y:n-i},{x:t+r,y:n},{x:t,y:n+i},{x:t-r,y:n}].map(e=>`${e.x},${e.y}`).join(` `),fill:e.fill,stroke:e.stroke,strokeWidth:`2`,strokeDasharray:`5,5`})})(),r===`rectangle`&&(0,F.jsx)(`rect`,{x:Math.min(v.x,b.x),y:Math.min(v.y,b.y),width:Math.abs(b.x-v.x),height:Math.abs(b.y-v.y),fill:e.fill,stroke:e.stroke,strokeWidth:`2`,strokeDasharray:`5,5`})]})})()]})})]})}var zY=[{titleKey:`navigationTitle`,shortcuts:[{keys:[`⌘K`,`Ctrl K`],descriptionKey:`navOpenSearch`},{keys:[`/`],descriptionKey:`navOpenSearchAlt`},{keys:[`⌘N`,`Ctrl N`],descriptionKey:`navCreateResource`},{keys:[`Esc Esc`],descriptionKey:`navCloseOverlays`},{keys:[`?`],descriptionKey:`navShowHelp`}]},{titleKey:`sidebarTitle`,shortcuts:[{keys:[`Click <`],descriptionKey:`sidebarCollapse`},{keys:[`Click ☰`],descriptionKey:`sidebarExpand`},{keys:[`Space`],descriptionKey:`sidebarPickup`},{keys:[`↑`,`↓`],descriptionKey:`sidebarMove`},{keys:[`Space`],descriptionKey:`sidebarDrop`},{keys:[`Esc`],descriptionKey:`sidebarCancel`}]},{titleKey:`annotationsTitle`,shortcuts:[{keys:[`H`],descriptionKey:`annotHighlight`},{keys:[`R`],descriptionKey:`annotReference`},{keys:[`Delete`],descriptionKey:`annotDelete`},{keys:[`Tab`],descriptionKey:`annotNavigate`},{keys:[`Shift Tab`],descriptionKey:`annotNavigateBack`}]},{titleKey:`listsTitle`,shortcuts:[{keys:[`←`,`→`],descriptionKey:`listsFilterNav`},{keys:[`↑`,`↓`,`←`,`→`],descriptionKey:`listsGridNav`},{keys:[`Home`],descriptionKey:`listsJumpFirst`},{keys:[`End`],descriptionKey:`listsJumpLast`}]},{titleKey:`searchModalTitle`,shortcuts:[{keys:[`↑`,`↓`],descriptionKey:`searchNav`},{keys:[`Enter`],descriptionKey:`searchSelect`},{keys:[`Esc`],descriptionKey:`searchClose`}]},{titleKey:`modalTitle`,shortcuts:[{keys:[`Esc`],descriptionKey:`modalClose`},{keys:[`Tab`],descriptionKey:`modalNavForward`},{keys:[`Shift Tab`],descriptionKey:`modalNavBackward`},{keys:[`Enter`],descriptionKey:`modalActivate`},{keys:[`Space`],descriptionKey:`modalActivate`}]},{titleKey:`accessibilityTitle`,shortcuts:[{keys:[`Tab`],descriptionKey:`a11ySkipLinks`},{keys:[`Enter`],descriptionKey:`a11yFollowLink`}]}];function BY({isOpen:e,onClose:t}){let n=Lg(`KeyboardShortcuts`),r=typeof window<`u`&&navigator.platform.toUpperCase().indexOf(`MAC`)>=0;return(0,F.jsx)(fY,{appear:!0,show:e,children:(0,F.jsxs)(MY,{as:`div`,className:`semiont-modal`,onClose:t,children:[(0,F.jsx)(dY,{enter:`ease-out duration-200`,enterFrom:`opacity-0`,enterTo:`opacity-100`,leave:`ease-in duration-150`,leaveFrom:`opacity-100`,leaveTo:`opacity-0`,children:(0,F.jsx)(`div`,{className:`semiont-modal__backdrop`})}),(0,F.jsx)(`div`,{className:`semiont-modal__container`,children:(0,F.jsx)(`div`,{className:`semiont-modal__wrapper`,children:(0,F.jsx)(dY,{enter:`ease-out duration-200`,enterFrom:`opacity-0 scale-95`,enterTo:`opacity-100 scale-100`,leave:`ease-in duration-150`,leaveFrom:`opacity-100 scale-100`,leaveTo:`opacity-0 scale-95`,children:(0,F.jsxs)(AY,{className:`semiont-modal__panel semiont-modal__panel--large`,children:[(0,F.jsx)(`div`,{className:`semiont-modal__header`,children:(0,F.jsxs)(`div`,{className:`semiont-modal__header-content`,children:[(0,F.jsx)(jY,{className:`semiont-modal__title`,children:n(`title`)}),(0,F.jsx)(`button`,{onClick:t,"aria-label":n(`closeDialog`),className:`semiont-modal__close`,children:(0,F.jsx)(`svg`,{className:`semiont-modal__close-icon`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,"aria-hidden":`true`,children:(0,F.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M6 18L18 6M6 6l12 12`})})})]})}),(0,F.jsxs)(`div`,{className:`semiont-modal__body`,children:[(0,F.jsx)(`div`,{className:`semiont-shortcuts`,children:zY.map(e=>(0,F.jsxs)(`div`,{className:`semiont-shortcuts__group`,children:[(0,F.jsx)(`h3`,{className:`semiont-shortcuts__group-title`,children:n(e.titleKey)}),(0,F.jsx)(`div`,{className:`semiont-shortcuts__list`,children:e.shortcuts.map((e,t)=>(0,F.jsxs)(`div`,{className:`semiont-shortcuts__item`,children:[(0,F.jsx)(`span`,{className:`semiont-shortcuts__description`,children:n(e.descriptionKey)}),(0,F.jsx)(`div`,{className:`semiont-shortcuts__keys`,children:e.keys.map((e,t)=>e.includes(`⌘`)&&!r||e.includes(`Ctrl`)&&r?null:(0,F.jsxs)(u.Fragment,{children:[t>0&&!e.includes(`⌘`)&&!e.includes(`Ctrl`)&&(0,F.jsx)(`span`,{className:`semiont-shortcuts__separator`,children:n(`or`)}),(0,F.jsx)(`kbd`,{className:`semiont-shortcuts__key`,children:e})]},t))})]},t))})]},e.titleKey))}),(0,F.jsx)(`div`,{className:`semiont-shortcuts__note`,children:(0,F.jsx)(`p`,{className:`semiont-shortcuts__note-text`,children:n(r?`macNote`:`windowsNote`)})})]}),(0,F.jsx)(`div`,{className:`semiont-modal__footer`,children:(0,F.jsxs)(`div`,{className:`semiont-modal__footer-content`,children:[(0,F.jsx)(`div`,{className:`semiont-modal__hint`,children:n(`footerHint`,{key:`?`}).split(`?`).map((e,t,n)=>(0,F.jsxs)(u.Fragment,{children:[e,t<n.length-1&&(0,F.jsx)(`kbd`,{className:`semiont-modal__hint-key`,children:`?`})]},t))}),(0,F.jsx)(`button`,{onClick:t,className:`semiont-button semiont-button--secondary`,children:n(`close`)})]})})]})})})})]})})}function VY(){let e=Z(kg().activeSignals$),t=Z(e?.permissionDeniedAt$)??null,n=Z(e?.permissionDeniedMessage$)??null,r=()=>e?.acknowledgePermissionDenied(),i=t!==null,a=n??`You do not have permission to perform this action.`,o=()=>{r(),window.history.back()};return(0,F.jsx)(fY,{appear:!0,show:i,children:(0,F.jsxs)(MY,{as:`div`,className:`semiont-modal`,onClose:o,children:[(0,F.jsx)(dY,{enter:`ease-out duration-200`,enterFrom:`opacity-0`,enterTo:`opacity-100`,leave:`ease-in duration-150`,leaveFrom:`opacity-100`,leaveTo:`opacity-0`,children:(0,F.jsx)(`div`,{className:`semiont-modal__backdrop`})}),(0,F.jsx)(`div`,{className:`semiont-modal__container`,children:(0,F.jsx)(`div`,{className:`semiont-modal__wrapper`,children:(0,F.jsx)(dY,{enter:`ease-out duration-200`,enterFrom:`opacity-0 scale-95`,enterTo:`opacity-100 scale-100`,leave:`ease-in duration-150`,leaveFrom:`opacity-100 scale-100`,leaveTo:`opacity-0 scale-95`,children:(0,F.jsxs)(AY,{className:`semiont-modal__panel semiont-modal__panel--medium`,children:[(0,F.jsx)(`div`,{className:`semiont-modal__icon-wrapper`,children:(0,F.jsx)(`div`,{className:`semiont-modal__icon`,children:(0,F.jsx)(`svg`,{style:{width:`1.5rem`,height:`1.5rem`,color:`var(--semiont-color-amber-600, #d97706)`},fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,children:(0,F.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z`})})})}),(0,F.jsxs)(`div`,{className:`semiont-modal__content`,children:[(0,F.jsx)(jY,{className:`semiont-modal__title semiont-modal__title--centered`,children:`Access Denied`}),(0,F.jsx)(`p`,{className:`semiont-modal__description`,children:a})]}),(0,F.jsxs)(`div`,{style:{padding:`0.75rem`,backgroundColor:`var(--semiont-bg-secondary)`,borderRadius:`var(--semiont-radius-md, 0.375rem)`,border:`1px solid var(--semiont-border-primary)`,fontSize:`var(--semiont-text-sm, 0.875rem)`,marginBottom:`1rem`},children:[(0,F.jsx)(`p`,{style:{color:`var(--semiont-text-secondary)`,marginBottom:`0.5rem`},children:`This could be because:`}),(0,F.jsxs)(`ul`,{style:{listStyle:`disc`,listStylePosition:`inside`,color:`var(--semiont-text-tertiary)`,display:`flex`,flexDirection:`column`,gap:`0.25rem`},children:[(0,F.jsx)(`li`,{children:`You don't have the required permissions`}),(0,F.jsx)(`li`,{children:`The resource is restricted to specific users or teams`}),(0,F.jsx)(`li`,{children:`Your account type doesn't include this feature`})]})]}),(0,F.jsxs)(`div`,{className:`semiont-modal__actions`,children:[(0,F.jsx)(`button`,{type:`button`,onClick:o,className:`semiont-button--primary semiont-button--flex`,children:`Go Back`}),(0,F.jsx)(`button`,{type:`button`,onClick:()=>{r(),window.location.href=`/`},className:`semiont-button--secondary semiont-button--flex`,children:`Go to Home`})]}),(0,F.jsx)(`div`,{className:`semiont-modal__actions`,style:{marginTop:`0.5rem`,paddingTop:`0.5rem`,borderTop:`1px solid var(--semiont-border-primary)`},children:(0,F.jsx)(`button`,{type:`button`,onClick:()=>{r(),window.location.href=`/auth/connect?callbackUrl=${encodeURIComponent(window.location.pathname)}`},className:`semiont-button--secondary semiont-button--flex`,style:{fontSize:`var(--semiont-text-sm, 0.875rem)`},children:`Switch Account`})})]})})})})]})})}function HY(){let e=Z(kg().activeSignals$),t=Z(e?.sessionExpiredAt$)??null,n=Z(e?.sessionExpiredMessage$)??null,r=()=>e?.acknowledgeSessionExpired(),i=t!==null,a=()=>{r(),window.location.href=`/auth/connect?callbackUrl=${encodeURIComponent(window.location.pathname)}`},o=()=>{r(),window.location.href=`/`};return(0,F.jsx)(fY,{appear:!0,show:i,children:(0,F.jsxs)(MY,{as:`div`,className:`semiont-modal`,onClose:o,children:[(0,F.jsx)(dY,{enter:`ease-out duration-200`,enterFrom:`opacity-0`,enterTo:`opacity-100`,leave:`ease-in duration-150`,leaveFrom:`opacity-100`,leaveTo:`opacity-0`,children:(0,F.jsx)(`div`,{className:`semiont-modal__backdrop`})}),(0,F.jsx)(`div`,{className:`semiont-modal__container`,children:(0,F.jsx)(`div`,{className:`semiont-modal__wrapper`,children:(0,F.jsx)(dY,{enter:`ease-out duration-200`,enterFrom:`opacity-0 scale-95`,enterTo:`opacity-100 scale-100`,leave:`ease-in duration-150`,leaveFrom:`opacity-100 scale-100`,leaveTo:`opacity-0 scale-95`,children:(0,F.jsxs)(AY,{className:`semiont-modal__panel semiont-modal__panel--medium`,children:[(0,F.jsx)(`div`,{className:`semiont-modal__icon-wrapper`,children:(0,F.jsx)(`div`,{className:`semiont-modal__icon`,style:{background:`linear-gradient(to bottom right, var(--semiont-color-red-100, #fee2e2), var(--semiont-color-red-300, #fca5a5))`},children:(0,F.jsx)(`svg`,{style:{width:`1.5rem`,height:`1.5rem`,color:`var(--semiont-color-red-600, #dc2626)`},fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,children:(0,F.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z`})})})}),(0,F.jsxs)(`div`,{className:`semiont-modal__content`,children:[(0,F.jsx)(jY,{className:`semiont-modal__title semiont-modal__title--centered`,children:`Session Expired`}),(0,F.jsx)(`p`,{className:`semiont-modal__description`,children:n??`Your session has expired for security reasons. Please sign in again to continue working.`})]}),(0,F.jsxs)(`div`,{className:`semiont-modal__actions`,children:[(0,F.jsx)(`button`,{type:`button`,onClick:o,className:`semiont-button--secondary semiont-button--flex`,children:`Go to Home`}),(0,F.jsx)(`button`,{type:`button`,onClick:a,className:`semiont-button--primary semiont-button--flex`,children:`Sign In Again`})]})]})})})})]})})}var UY=new Set;function WY(e,t){if(!e)return[{exact:``,start:0,end:0}];let n=t.map(t=>{let n=Yo(t.target),r=Wo(n),i=n?as(n):null,a=_s(e,{...r?{position:{start:r.start,end:r.end}}:{},...i?{quote:{exact:i.exact,...i.prefix===void 0?{}:{prefix:i.prefix},...i.suffix===void 0?{}:{suffix:i.suffix}}}:{}});return a&&a.confidence!==`high`&&GY(t.id,a.strategy,a.confidence),{annotation:t,start:a?.start??0,end:a?.end??0,...a?.strategy?{strategy:a.strategy}:{},...a?.confidence?{confidence:a.confidence}:{}}}).filter(t=>t.start>=0&&t.end<=e.length&&t.start<t.end).sort((e,t)=>e.start-t.start);if(n.length===0)return[{exact:e,start:0,end:e.length}];let r=[],i=0;for(let{annotation:t,start:a,end:o,strategy:s,confidence:c}of n)a<i||(a>i&&r.push({exact:e.slice(i,a),start:i,end:a}),r.push({exact:e.slice(a,o),annotation:t,start:a,end:o,...s?{strategy:s}:{},...c?{confidence:c}:{}}),i=o);return i<e.length&&r.push({exact:e.slice(i),start:i,end:e.length}),r}function GY(e,t,n){UY.has(e)||(UY.add(e),console.warn(`[segmentTextWithAnnotations] annotation anchored via degraded strategy`,{annotationId:e,strategy:t,confidence:n}))}function KY(e,t,n,r){if(!t||n<0||r<=n||r>e.length)return null;let i=Ns(e,n,r);return[{type:`TextPositionSelector`,start:n,end:r},{type:`TextQuoteSelector`,exact:t,...i.prefix&&{prefix:i.prefix},...i.suffix&&{suffix:i.suffix}}]}function qY(e,t){let n=e.indexOf(t);return n===-1?null:{start:n,end:n+t.length}}var JY=(0,u.lazy)(()=>h(()=>import(`./PdfAnnotationCanvas.client-KWQ7XDWT-_iZ0YQWT.js`).then(e=>({default:e.PdfAnnotationCanvas})),__vite__mapDeps([0,1,2,3])));function YY({content:e,mimeType:t=`text/plain`,resourceUri:n,annotations:r,uiState:i,onUIStateChange:a,enableWidgets:o=!1,getTargetResourceName:s,generatingReferenceId:c,showLineNumbers:l=!1,hoverDelayMs:d=150,annotateMode:f,session:p,newAnnotationIds:m,onModeChange:h,showToolbar:g=!0}){let _=(0,u.useRef)(null),v=Hs(t)?.render??`none`,{highlights:y,references:b,assessments:x,comments:S,tags:C}=r,w=[...y,...b,...x,...S,...C],T=WY(e,w),{selectedMotivation:E,selectedClick:D,selectedShape:O,hoveredAnnotationId:k,scrollToAnnotationId:A}=i,j=(0,u.useRef)(a);j.current=a;let ee=(0,u.useCallback)(e=>{j.current?.({selectedMotivation:e})},[]),M=(0,u.useCallback)(e=>{j.current?.({selectedClick:e})},[]),N=(0,u.useCallback)(e=>{j.current?.({selectedShape:e})},[]);switch(OL(p,{"beckon:hover":(0,u.useCallback)(({annotationId:e})=>{j.current?.({hoveredAnnotationId:e})},[])}),(0,u.useEffect)(()=>{let t=_.current;if(!t)return;let r=!1,i=e=>{let t=e.target;r=!!t.closest(`[data-annotation-id]`),t.closest(`[data-annotation-ui]`)},a=i=>{let a=i.target;if(a.closest(`.semiont-pdf-annotation-canvas`)||a.closest(`.semiont-svg-drawing-canvas`))return;let o=window.getSelection();if(!o||o.isCollapsed||!o.toString()){r=!1;return}if(r){r=!1;return}r=!1;let s=o.getRangeAt(0),c=o.toString(),l=t.querySelector(`.codemirror-renderer`)?.__cmView,u,d;if(!l||!l.posAtDOM){let t=qY(e,c);if(!t)return;u=t.start,d=t.end}else u=l.posAtDOM(s.startContainer,s.startOffset),d=u+c.length;if(u>=0&&E){let t=KY(e,c,u,d);if(!t)return;p?.client.mark.request(To(n),t,E),o.removeAllRanges()}};return t.addEventListener(`mouseup`,a),t.addEventListener(`mousedown`,i),()=>{t.removeEventListener(`mouseup`,a),t.removeEventListener(`mousedown`,i)}},[E,e,n]),v){case`text`:return(0,F.jsxs)(`div`,{className:`semiont-annotate-view`,"data-mime-type":`text`,ref:_,children:[g&&(0,F.jsx)(pG,{selectedMotivation:E,selectedClick:D,selectedShape:O,mediaType:t,annotateMode:f,annotators:zE,onModeChange:h,onClickActionChange:M,onSelectionChange:ee,onShapeChange:N}),(0,F.jsx)(`div`,{className:`semiont-annotate-view__content`,children:(0,F.jsx)(rG,{content:e,segments:T,editable:!1,newAnnotationIds:m,...k!==void 0&&{hoveredAnnotationId:k},...A!==void 0&&{scrollToAnnotationId:A},sourceView:!0,showLineNumbers:l,hoverDelayMs:d,enableWidgets:o,session:p,...s&&{getTargetResourceName:s},...c!==void 0&&{generatingReferenceId:c}})})]});case`pdf`:return(0,F.jsxs)(`div`,{className:`semiont-annotate-view`,"data-mime-type":`pdf`,ref:_,children:[g&&(0,F.jsx)(pG,{selectedMotivation:E,selectedClick:D,selectedShape:O,mediaType:t,annotateMode:f,annotators:zE,onModeChange:h,onClickActionChange:M,onSelectionChange:ee,onShapeChange:N}),(0,F.jsx)(`div`,{className:`semiont-annotate-view__content`,children:e&&(0,F.jsx)(u.Suspense,{fallback:(0,F.jsx)(`div`,{className:`semiont-annotate-view__loading`,children:`Loading PDF viewer...`}),children:(0,F.jsx)(JY,{pdfUrl:e,resourceUri:n,existingAnnotations:w,drawingMode:E?O:null,selectedMotivation:E,session:p,hoveredAnnotationId:k||null,hoverDelayMs:d})})})]});case`image`:return(0,F.jsxs)(`div`,{className:`semiont-annotate-view`,"data-mime-type":`image`,ref:_,children:[g&&(0,F.jsx)(pG,{selectedMotivation:E,selectedClick:D,selectedShape:O,mediaType:t,annotateMode:f,annotators:zE,onModeChange:h,onClickActionChange:M,onSelectionChange:ee,onShapeChange:N}),(0,F.jsx)(`div`,{className:`semiont-annotate-view__content`,children:e&&(0,F.jsx)(RY,{imageUrl:e,resourceUri:n,existingAnnotations:w,drawingMode:E?O:null,selectedMotivation:E,session:p,hoveredAnnotationId:k||null,hoverDelayMs:d})})]});default:return(0,F.jsx)(`div`,{ref:_,className:`semiont-annotate-view semiont-annotate-view--unsupported`,"data-mime-type":`unsupported`,children:(0,F.jsxs)(`div`,{className:`semiont-annotate-view__empty`,children:[(0,F.jsxs)(`p`,{className:`semiont-annotate-view__empty-message`,children:[`Annotation not supported for `,t]}),(0,F.jsx)(`a`,{href:`/api/resources/${n}`,download:!0,className:`semiont-button semiont-button--primary`,children:`Download File`})]})})}}function XY(e){if(!e.startsWith(`did:`))return e;let t=e.match(/^did:web:system:(.+)$/);if(t){let e=t[1];return e.charAt(0).toUpperCase()+e.slice(1)}let n=e.match(/^did:web:[^:]+:users:(.+)$/);return n?decodeURIComponent(n[1]):e}function ZY(e,t,n){switch(e){case`yield:created`:return t(`resourceCreated`);case`yield:cloned`:return t(`resourceCloned`);case`mark:archived`:return t(`resourceArchived`);case`mark:unarchived`:return t(`resourceUnarchived`);case`mark:added`:{let e=n?.annotation?.motivation;return t(e===`highlighting`?`highlightAdded`:e===`linking`?`referenceCreated`:e===`assessing`?`assessmentAdded`:`annotationAdded`)}case`mark:removed`:return t(`annotationRemoved`);case`mark:body-updated`:return t(`annotationBodyUpdated`);case`mark:entity-tag-added`:return t(`entitytagAdded`);case`mark:entity-tag-removed`:return t(`entitytagRemoved`);case`job:completed`:case`job:started`:case`job:progress`:case`job:failed`:return t(`jobEvent`);case`yield:representation-added`:case`yield:representation-removed`:return t(`representationEvent`);default:return e}}function QY(e,t){switch(e){case`yield:created`:case`yield:cloned`:case`mark:archived`:case`mark:unarchived`:return`📄`;case`mark:added`:{let e=t?.annotation?.motivation;return e===`highlighting`?zE.highlight.iconEmoji||`📝`:e===`linking`?zE.reference.iconEmoji||`📝`:e===`assessing`&&zE.assessment.iconEmoji||`📝`}case`mark:removed`:return`🗑️`;case`mark:body-updated`:return`✏️`;case`mark:entity-tag-added`:case`mark:entity-tag-removed`:return`🏷️`;case`job:completed`:return`🔗`;case`job:started`:case`job:progress`:return`⚙️`;case`job:failed`:return`❌`;case`yield:representation-added`:case`yield:representation-removed`:return`📄`;default:return`📝`}}function $Y(e,t){let n=new Date(e),r=new Date().getTime()-n.getTime(),i=Math.floor(r/6e4),a=Math.floor(r/36e5),o=Math.floor(r/864e5);return i<1?t(`justNow`):i<60?t(`minutesAgo`,{count:i}):a<24?t(`hoursAgo`,{count:a}):o<7?t(`daysAgo`,{count:o}):n.toLocaleDateString()}function eX(e,t=50){let n=e.trim();return n.length>t?n.substring(0,t)+`...`:n}function tX(e,t,n){let r=e,i=r.payload;switch(r.type){case`yield:created`:case`yield:cloned`:return{exact:i.name,isQuoted:!1,isTag:!1};case`mark:body-updated`:{let e=t.find(e=>e.id.endsWith(`/annotations/${i.annotationId}`));if(e?.target)try{let t=rs(Yo(e.target));if(t)return{exact:eX(t),isQuoted:!0,isTag:!1}}catch{}return null}case`mark:removed`:{let e=n.find(e=>e.type===`mark:added`&&e.payload.annotation.id.endsWith(`/annotations/${i.annotationId}`));if(e&&e.type===`mark:added`)try{let t=e.payload.annotation.target;if(typeof t!=`string`&&t.selector){let e=rs(t.selector);if(e)return{exact:eX(e),isQuoted:!0,isTag:!1}}}catch{}return null}case`mark:added`:try{let e=i.annotation.target;if(typeof e!=`string`&&e.selector){let t=rs(e.selector);if(t)return{exact:eX(t),isQuoted:!0,isTag:!1}}}catch{}return null;case`mark:entity-tag-added`:case`mark:entity-tag-removed`:return{exact:i.entityType,isQuoted:!1,isTag:!0};case`job:completed`:if(i.annotationUri){let e=t.find(e=>e.id===i.annotationUri);if(e?.target)try{let t=rs(Yo(e.target));if(t)return{exact:eX(t),isQuoted:!0,isTag:!1}}catch{}}return null;case`job:started`:case`job:progress`:case`job:failed`:case`yield:representation-added`:case`yield:representation-removed`:return null;default:return null}}function nX(e){let t=e,n=t.payload;if(t.type===`mark:added`){let e=n.annotation.motivation,t=n.annotation.body;if(e===`linking`&&t&&`entityTypes`in t)return t.entityTypes??[]}return[]}function rX(e){let t=e,n=t.payload;return t.type===`yield:created`?{type:`created`,userId:t.userId,metadata:void 0}:t.type===`yield:cloned`?{type:`cloned`,userId:t.userId,sourceDocId:n.parentResourceId,parentResourceId:n.parentResourceId,metadata:void 0}:null}function iX({event:e,annotations:t,allEvents:n,isRelated:r,t:i,Link:a,routes:o,onEventRef:s,onEventClick:c,onEventHover:l}){let d=tX(e,t,n),f=ko(e),p=rX(e),m=nX(e),h=(0,u.useRef)(null),g=(0,u.useRef)(l);(0,u.useEffect)(()=>{g.current=l});let _=(0,u.useCallback)(()=>{!f||!g.current||(h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{g.current?.(f)},300))},[f]),v=(0,u.useCallback)(()=>{h.current&&=(clearTimeout(h.current),null),g.current&&g.current(null)},[]);return(0,F.jsxs)(f?`button`:`div`,{ref:e=>{s&&s(f,e)},...f?{type:`button`,onClick:()=>c?.(f),"aria-label":i(`viewAnnotation`,{content:d?.exact||ZY(e.type,i)}),className:`semiont-history-event`,"data-related":r?`true`:`false`,"data-interactive":`true`}:{className:`semiont-history-event`,"data-related":r?`true`:`false`},children:[(0,F.jsxs)(`div`,{className:`semiont-history-event__content`,children:[(0,F.jsx)(`span`,{className:`semiont-history-event__emoji`,onMouseEnter:_,onMouseLeave:v,children:QY(e.type,e.payload)}),d?d.isTag?(0,F.jsx)(`span`,{className:`semiont-history-event__tag`,children:d.exact}):d.isQuoted?(0,F.jsxs)(`span`,{className:`semiont-history-event__text semiont-history-event__text--quoted`,children:[`“`,d.exact,`”`]}):(0,F.jsx)(`span`,{className:`semiont-history-event__text`,children:d.exact}):(0,F.jsx)(`span`,{className:`semiont-history-event__text`,children:ZY(e.type,i,e.payload)}),e.userId&&(0,F.jsx)(`span`,{className:`semiont-history-event__user`,children:XY(e.userId)}),(0,F.jsx)(`span`,{className:`semiont-history-event__timestamp`,children:$Y(e.timestamp,i)})]}),m.length>0&&(0,F.jsx)(`div`,{className:`semiont-history-event__entity-types`,children:m.map(e=>(0,F.jsx)(`span`,{className:`semiont-tag semiont-tag--small`,"data-variant":`blue`,children:e},e))}),p&&(0,F.jsxs)(`div`,{className:`semiont-history-event__details`,children:[(0,F.jsxs)(`span`,{className:`semiont-history-event__detail`,children:[i(`user`),`: `,(0,F.jsx)(`span`,{className:`semiont-history-event__detail-value`,children:p.userId?XY(p.userId):``})]}),p.type===`cloned`&&p.sourceDocId&&(0,F.jsx)(a,{href:o.resourceDetail(p.sourceDocId),className:`semiont-history-event__link`,onClick:e=>e.stopPropagation(),children:i(`viewOriginal`)})]})]})}function aX({rUri:e,hoveredAnnotationId:t,onEventHover:n,onEventClick:r,Link:i,routes:a}){let o=Lg(`AnnotationHistory`),s=Z(kg().activeSession$)?.client,c=Z(s?.browse.events(e)),l=Z(s?.browse.annotations(e)),d=c===void 0,f=l??[],p=(0,u.useRef)(new Map),m=(0,u.useRef)(null),h=c?c.filter(e=>e.type!==`job:started`&&e.type!==`job:progress`&&e.type!==`job:completed`).sort((e,t)=>e.metadata.sequenceNumber-t.metadata.sequenceNumber):[];return(0,u.useEffect)(()=>{m.current&&h.length>0&&requestAnimationFrame(()=>{m.current&&(m.current.scrollTop=m.current.scrollHeight)})},[h.length]),(0,u.useEffect)(()=>{if(!t)return;let e=p.current.get(t);e&&m.current&&(e.scrollIntoView({behavior:`smooth`,block:`nearest`}),e.classList.add(`bg-blue-100`,`dark:bg-blue-900/30`),setTimeout(()=>{e.classList.remove(`bg-blue-100`,`dark:bg-blue-900/30`)},1500))},[t]),d?(0,F.jsxs)(`div`,{className:`semiont-history-panel`,children:[(0,F.jsx)(`h3`,{className:`semiont-history-panel__title`,children:o(`history`)}),(0,F.jsx)(`div`,{className:`semiont-history-panel__loading`,children:o(`loading`)})]}):h.length===0?null:(0,F.jsxs)(`div`,{className:`semiont-history-panel`,children:[(0,F.jsx)(`h3`,{className:`semiont-history-panel__title`,children:o(`history`)}),(0,F.jsx)(`div`,{ref:m,className:`semiont-history-panel__list`,children:h.map(e=>(0,F.jsx)(iX,{event:e,annotations:f,allEvents:h,isRelated:t?(()=>{let n=ko(e);return n?n===t:!1})():!1,t:o,Link:i,routes:a,onEventRef:(e,t)=>{t&&e?p.current.set(e,t):!t&&e&&p.current.delete(e)},...r&&{onEventClick:r},...n&&{onEventHover:n}},e.id))})]})}function oX({imageUrl:e,alt:t=`Resource image`}){return(0,F.jsx)(`div`,{className:`semiont-image-viewer`,children:(0,F.jsx)(`img`,{src:e,alt:t,className:`semiont-image-viewer__image`,style:{imageRendering:`auto`}})})}var sX=(0,u.lazy)(()=>h(()=>import(`./PdfAnnotationCanvas.client-KWQ7XDWT-_iZ0YQWT.js`).then(e=>({default:e.PdfAnnotationCanvas})),__vite__mapDeps([0,1,2,3]))),cX=(0,u.memo)(function({content:e}){return(0,F.jsx)(AC,{remarkPlugins:[PE],children:e})});function lX({content:e}){return(0,F.jsx)(cX,{content:e})}function uX({content:e,mimeType:t}){return(0,F.jsx)(oX,{imageUrl:e,mimeType:t,alt:`Resource content`})}function dX({content:e,resourceUri:t,annotations:n}){return(0,F.jsx)(u.Suspense,{fallback:(0,F.jsx)(`div`,{className:`semiont-browse-view__loading`,children:`Loading PDF viewer...`}),children:(0,F.jsx)(sX,{pdfUrl:e,resourceUri:t,existingAnnotations:n,drawingMode:null,selectedMotivation:null})})}var fX={text:lX,image:uX,pdf:dX},pX=(0,u.memo)(function({content:e,mimeType:t,resourceUri:n,annotations:r,selectedClick:i=`detail`,onModeChange:a,onClickActionChange:o,showToolbar:s=!0,annotateMode:c,hoverDelayMs:l=150,session:d,newAnnotationIds:f,renderers:p,onLinkClick:m,onReferenceHover:h,inline:g=!1}){let _=(0,u.useRef)(null),v=g?` semiont-browse-view--inline`:``,y=Hs(t)?.render??`none`,{highlights:b,references:x,assessments:S,comments:C,tags:w}=r,T=(0,u.useMemo)(()=>[...b,...x,...S,...C,...w],[b,x,S,C,w]),E=(0,u.useMemo)(()=>iL(T),[T]);(0,u.useEffect)(()=>{if(!_.current||E.length===0)return;let t=_.current;return tL(eL(E,ZI(e,t),QI(t))),()=>rL(t)},[e,E]),(0,u.useEffect)(()=>{if(!_.current||!d)return;let e=_.current,t=e=>{let t=e.target.closest(`[data-annotation-id]`);if(!t)return;let n=t.getAttribute(`data-annotation-id`),r=t.getAttribute(`data-annotation-type`);if(n&&r===`reference`){let e=T.find(e=>e.id===n);e&&d.client.browse.click(e.id,e.motivation)}},n=null,r=null,i=!1,a=e=>{if(!h)return;let t=T.find(t=>t.id===e);if(!t||!ns(t))return;let a=qo(t.body),o=n;!a||!o||(r?.unsubscribe(),r=d.client.browse.resource(To(a)).subscribe({next:e=>{e!==void 0&&(r?.unsubscribe(),r=null,i=!0,h({annotation:t,referent:e,anchorRect:o.getBoundingClientRect()}))},error:()=>{r=null}}))},o=()=>{r?.unsubscribe(),r=null,i&&(i=!1,h?.(null))},{handleMouseEnter:s,handleMouseLeave:c,cleanup:u}=hf(e=>{d.client.beckon.hover(e),e?a(e):o()},l),p=e=>{let t=e.target.closest(`[data-annotation-id]`),r=t?.getAttribute(`data-annotation-id`);r&&(n=t,s(Eo(r)))},m=e=>{e.target.closest(`[data-annotation-id]`)&&c()};return f&&e.querySelectorAll(`[data-annotation-id]`).forEach(e=>{let t=e.getAttribute(`data-annotation-id`);t&&f.has(t)&&e.classList.add(`annotation-sparkle`)}),e.addEventListener(`click`,t),e.addEventListener(`mouseover`,p),e.addEventListener(`mouseout`,m),()=>{e.removeEventListener(`click`,t),e.removeEventListener(`mouseover`,p),e.removeEventListener(`mouseout`,m),u(),r?.unsubscribe()}},[e,T,f,l,d,h]);let D=(0,u.useCallback)((e,t=!1)=>{_.current&&BW(e,_.current,{pulse:t})},[]);OL(d,{"beckon:hover":(0,u.useCallback)(({annotationId:e})=>{D(e)},[D]),"beckon:focus":(0,u.useCallback)(({annotationId:e})=>{D(e??null,!0)},[D])});let O=(0,u.useCallback)(e=>{let t=e.target.closest(`a[href]`);if(!t)return;e.preventDefault();let n=t.getAttribute(`href`);n&&m?.({href:n,event:e})},[m]),k={...fX,...p},A=y===`none`?void 0:k[y];return A?(0,F.jsxs)(`div`,{className:`semiont-browse-view${v}`,"data-mime-type":y,children:[s&&(0,F.jsx)(pG,{selectedMotivation:null,selectedClick:i,parts:[`clickAction`,`mode`],showDeleteButton:!1,annotateMode:c,annotators:zE,onModeChange:a,onClickActionChange:o,compact:g}),(0,F.jsx)(`div`,{ref:_,className:`semiont-browse-view__content`,onClick:O,children:(0,F.jsx)(A,{content:e,mimeType:t,resourceUri:n,annotations:T})})]}):(0,F.jsx)(`div`,{ref:_,className:`semiont-browse-view semiont-browse-view--unsupported${v}`,"data-mime-type":`unsupported`,children:(0,F.jsxs)(`div`,{className:`semiont-browse-view__empty`,children:[(0,F.jsxs)(`p`,{className:`semiont-browse-view__empty-message`,children:[`Preview not available for `,t]}),(0,F.jsx)(`a`,{href:`/api/resources/${n}`,download:!0,className:`semiont-button semiont-button--primary`,children:`Download File`})]})})});function mX({resource:e,annotations:t,session:n,onOpenResource:r,onOpenPanel:i,onLinkClick:a,onReferenceHover:o,inline:s=!1,newAnnotationIds:c,generatingReferenceId:l,showLineNumbers:d=!1,hoverDelayMs:f,hoveredAnnotationId:p,annotateMode:m,onAnnotateModeChange:h,clickAction:g,onClickActionChange:_,selectionMotivation:v,onSelectionMotivationChange:y,shape:b,onShapeChange:x,showToolbar:S=!0}){let C=Lg(`ResourceViewer`),w=(0,u.useRef)(null),{highlights:T,references:E,assessments:D,comments:O,tags:k}=t;if(!e[`@id`])throw Error(`Resource has no @id`);let A=e[`@id`],j=(()=>{let t=e.representations;return Array.isArray(t)&&t.length>0&&t[0]?t[0].mediaType:`text/plain`})(),[ee,M]=(0,u.useState)(!1),N=m??ee,te=(0,u.useCallback)(e=>{m===void 0&&M(e),h?.(e)},[m,h]),ne=N?`annotate`:`browse`,re=n?.client,ie=(0,u.useCallback)(()=>{re?.browse.invalidateAnnotationList(A)},[re,A]),ae=(0,u.useCallback)(()=>{re?.browse.invalidateAnnotationList(A)},[re,A]),oe=(0,u.useCallback)(()=>{re?.browse.invalidateAnnotationList(A)},[re,A]),[se,ce]=(0,u.useState)(`linking`),P=v===void 0?se:v,le=(0,u.useCallback)(e=>{v===void 0&&ce(e),y?.(e)},[v,y]),[ue,de]=(0,u.useState)(`detail`),fe=g??ue,pe=(0,u.useCallback)(e=>{g===void 0&&de(e),_?.(e)},[g,_]),[me,he]=(0,u.useState)(`rectangle`),ge=b??me,_e=(0,u.useCallback)(e=>{b===void 0&&he(e),x?.(e)},[b,x]),[ve,ye]=(0,u.useState)(!1),[be,xe]=(0,u.useState)(null),[Se,Ce]=(0,u.useState)(null),we=p??null,[Te,Ee]=(0,u.useState)(null),[De,Oe]=(0,u.useState)(null),ke=(0,u.useCallback)(e=>{Oe(e),Ee(e),setTimeout(()=>Oe(null),3e3)},[]),Ae=()=>typeof window>`u`?{x:0,y:0}:{x:Math.max(0,(window.innerWidth-800)/2),y:Math.max(0,(window.innerHeight-700)/2)},je=(0,u.useCallback)(e=>{n?.client.mark.delete(A,e)},[n,A]),Me=(0,u.useCallback)((e,t)=>{if(Object.values(zE).find(t=>t.matchesAnnotation(e))?.hasSidePanel){if(fe===`detail`){ke(e.id);return}if(fe!==`deleting`&&fe!==`jsonld`&&fe!==`follow`)return}let n=Xo(e)||Qo(e)||$o(e)||Zo(e)||es(e);if(fe===`follow`&&Zo(e)){let t=qo(e.body);t&&r?.(t);return}if(fe===`jsonld`&&n){xe(e),ye(!0);return}if(N&&fe===`deleting`&&n){Ce({annotation:e,position:t?{x:t.clientX,y:t.clientY+10}:{x:window.innerWidth/2-150,y:window.innerHeight/2-75}});return}},[N,fe,ke,r]);OL(n,{"mark:added":ie,"mark:removed":ae,"mark:body-updated":oe,"browse:click":(0,u.useCallback)(({annotationId:e,motivation:t})=>{if(!Object.values(zE).find(e=>e.matchesAnnotation({motivation:t}))?.hasSidePanel){let t=[...T,...E,...D,...O,...k].find(t=>t.id===e);t&&Me(t);return}if(fe!==`detail`){let t=[...T,...E,...D,...O,...k].find(t=>t.id===e);t&&Me(t);return}i?.({panel:`annotations`,scrollToAnnotationId:e,motivation:t})},[T,E,D,O,k,Me,fe,i])});let Ne=(0,u.useMemo)(()=>({highlights:T,references:E,assessments:D,comments:O,tags:k}),[T,E,D,O,k]),Pe={selectedMotivation:P,selectedClick:fe,selectedShape:ge,hoveredAnnotationId:we,scrollToAnnotationId:Te},Fe=(0,u.useCallback)(e=>{let t=E.find(t=>qo(t.body)===e);return t?rs(Yo(t.target)):void 0},[E]);return(0,F.jsxs)(`div`,{ref:w,className:`semiont-resource-viewer${s?` semiont-resource-viewer--inline`:``}`,children:[ne===`annotate`?(0,F.jsx)(YY,{content:e.content,mimeType:j,resourceUri:e[`@id`],annotations:Ne,uiState:Pe,onUIStateChange:e=>{`selectedMotivation`in e&&le(e.selectedMotivation??null),`selectedClick`in e&&pe(e.selectedClick),`selectedShape`in e&&_e(e.selectedShape)},enableWidgets:!0,getTargetResourceName:Fe,...l!==void 0&&{generatingReferenceId:l},showLineNumbers:d,hoverDelayMs:f,annotateMode:N,onModeChange:te,showToolbar:S,session:n,newAnnotationIds:c}):(0,F.jsx)(pX,{content:e.content,mimeType:j,resourceUri:e[`@id`],annotations:Ne,selectedClick:fe,hoverDelayMs:f,annotateMode:N,onModeChange:te,onClickActionChange:pe,showToolbar:S,session:n,newAnnotationIds:c,onLinkClick:a,onReferenceHover:o,inline:s}),be&&(0,F.jsx)(NY,{isOpen:ve,onClose:()=>ye(!1),position:Ae(),wide:!0,children:(0,F.jsx)(FG,{annotation:be,onBack:()=>{ye(!1),xe(null)}})}),Se&&(()=>{let e=Se.annotation,t=Object.values(zE).find(t=>t.matchesAnnotation(e)),n=rs(Yo(e.target)),r=t?.iconEmoji||`📝`;return(0,F.jsx)(NY,{isOpen:!!Se,onClose:()=>Ce(null),position:Se.position,children:(0,F.jsxs)(`div`,{className:`semiont-delete-confirmation`,children:[(0,F.jsxs)(`div`,{className:`semiont-delete-confirmation__header`,children:[(0,F.jsx)(`span`,{className:`semiont-delete-confirmation__icon`,children:r}),(0,F.jsx)(`h3`,{className:`semiont-delete-confirmation__title`,children:C(`deleteConfirmationTitle`)})]}),n&&(0,F.jsx)(`div`,{className:`semiont-delete-confirmation__quote`,children:(0,F.jsxs)(`p`,{className:`semiont-delete-confirmation__text`,children:[`"`,n.length>100?n.substring(0,100)+`...`:n,`"`]})}),(0,F.jsx)(`p`,{className:`semiont-delete-confirmation__message`,children:C(`deleteConfirmationMessage`)}),(0,F.jsxs)(`div`,{className:`semiont-delete-confirmation__actions`,children:[(0,F.jsx)(`button`,{onClick:()=>Ce(null),className:`semiont-button semiont-button--secondary`,children:C(`deleteConfirmationCancel`)}),(0,F.jsx)(`button`,{onClick:()=>{je(Se.annotation.id),Ce(null)},className:`semiont-button semiont-button--danger`,children:C(`deleteConfirmationDelete`)})]})]})})})()]})}function hX(e){if(e[`@type`]===`Software`){let t=e.provider,n=e.model;if(t&&n)return`${t} ${n}`;if(n)return n;if(t)return t}return e.name||e[`@id`]||`unknown`}function gX(e){let t=new Date(e),n=new Date().getTime()-t.getTime(),r=Math.floor(n/1e3),i=Math.floor(r/60),a=Math.floor(i/60),o=Math.floor(a/24);return r<60?`just now`:i<60?`${i} minute${i>1?`s`:``} ago`:a<24?`${a} hour${a>1?`s`:``} ago`:o<7?`${o} day${o>1?`s`:``} ago`:t.toLocaleDateString()}function _X(e){return typeof e==`object`&&!!e&&`type`in e&&e.type===`TextualBody`&&`value`in e&&typeof e.value==`string`}function vX(e){return e.body?_X(e.body)?e.body.value||null:Array.isArray(e.body)&&e.body.length>0&&e.body.find(_X)?.value||null:null}function yX({assessment:e,isFocused:t,isHovered:n=!1,ref:r}){let i=Z(kg().activeSession$),a=mL(e.id),o=is(e),s=vX(e);return(0,F.jsxs)(`div`,{ref:r,className:`semiont-annotation-entry${n?` semiont-annotation-pulse`:``}`,"data-type":`assessment`,"data-focused":t?`true`:`false`,onClick:()=>{i?.client.browse.click(e.id,e.motivation)},...a,children:[o&&(0,F.jsxs)(`div`,{className:`semiont-annotation-entry__quote`,"data-type":`assessment`,children:[`"`,o.substring(0,100),o.length>100?`...`:``,`"`]}),s&&(0,F.jsx)(`div`,{className:`semiont-annotation-entry__body`,"data-type":`assessment`,children:s}),(0,F.jsxs)(`div`,{className:`semiont-annotation-entry__metadata`,children:[`By `,typeof e.creator==`string`?e.creator:e.creator?.name||`Unknown`,` • `,gX(e.created||new Date().toISOString())]}),e.generator&&(0,F.jsxs)(`div`,{className:`semiont-annotation-entry__metadata`,children:[`Via `,Array.isArray(e.generator)?e.generator.map(hX).join(`, `):hX(e.generator)]})]})}function bX({annotationType:e,isAssisting:t,locale:n,sourceLanguage:r,progress:i}){let a=Lg(e===`highlight`?`HighlightPanel`:e===`assessment`?`AssessmentPanel`:`CommentsPanel`),o=Z(kg().activeSession$),[s,c]=(0,u.useState)(``),[l,d]=(0,u.useState)(``),[f,p]=(0,u.useState)(e===`comment`?5:e===`assessment`?4:5),[m,h]=(0,u.useState)(!0),[g,_]=(0,u.useState)(()=>{if(typeof window>`u`)return!0;let t=localStorage.getItem(`assist-section-expanded-${e}`);return t?t===`true`:!0});(0,u.useEffect)(()=>{typeof window>`u`||localStorage.setItem(`assist-section-expanded-${e}`,String(g))},[g,e]);let v=(0,u.useCallback)(()=>{let t=e===`highlight`?`highlighting`:e===`assessment`?`assessing`:`commenting`;o?.client.mark.requestAssist(t,{instructions:s.trim()||void 0,tone:(e===`comment`||e===`assessment`)&&l?l:void 0,density:(e===`comment`||e===`assessment`||e===`highlight`)&&m?f:void 0,language:e===`comment`||e===`assessment`?n:void 0,sourceLanguage:r}),c(``),d(``)},[e,s,l,m,f,n,r,o]),y=(0,u.useCallback)(()=>{o?.client.mark.dismissProgress()},[o]);return(0,F.jsxs)(`div`,{className:`semiont-panel__section`,children:[(0,F.jsxs)(`button`,{onClick:()=>_(!g),className:`semiont-panel__section-title semiont-panel__section-title--collapsible`,"aria-expanded":g,type:`button`,children:[(0,F.jsx)(`span`,{children:a(e===`highlight`?`annotateHighlights`:e===`assessment`?`annotateAssessments`:`annotateComments`)}),(0,F.jsx)(`span`,{className:`semiont-panel__section-chevron`,"data-expanded":g,children:`›`})]}),g&&(0,F.jsxs)(`div`,{className:`semiont-assist-widget`,"data-assisting":t&&i?`true`:`false`,"data-type":e,children:[!i&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{className:`semiont-form-field`,children:[(0,F.jsxs)(`label`,{className:`semiont-form-field__label`,children:[a(`instructions`),` `,a(`optional`)]}),(0,F.jsx)(`textarea`,{value:s,onChange:e=>c(e.target.value),className:`semiont-textarea`,rows:3,placeholder:a(`instructionsPlaceholder`),maxLength:500}),(0,F.jsxs)(`div`,{className:`semiont-form-field__char-count`,children:[s.length,`/500`]})]}),(e===`comment`||e===`assessment`)&&(0,F.jsxs)(`div`,{className:`semiont-form-field`,children:[(0,F.jsxs)(`label`,{className:`semiont-form-field__label`,children:[a(`toneLabel`),` `,a(`toneOptional`)]}),(0,F.jsxs)(`select`,{value:l,onChange:e=>d(e.target.value),className:`semiont-select`,children:[(0,F.jsx)(`option`,{value:``,children:`Default`}),e===`comment`&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`option`,{value:`scholarly`,children:a(`toneScholarly`)}),(0,F.jsx)(`option`,{value:`explanatory`,children:a(`toneExplanatory`)}),(0,F.jsx)(`option`,{value:`conversational`,children:a(`toneConversational`)}),(0,F.jsx)(`option`,{value:`technical`,children:a(`toneTechnical`)})]}),e===`assessment`&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`option`,{value:`analytical`,children:a(`toneAnalytical`)}),(0,F.jsx)(`option`,{value:`critical`,children:a(`toneCritical`)}),(0,F.jsx)(`option`,{value:`balanced`,children:a(`toneBalanced`)}),(0,F.jsx)(`option`,{value:`constructive`,children:a(`toneConstructive`)})]})]})]}),(e===`comment`||e===`assessment`||e===`highlight`)&&(0,F.jsxs)(`div`,{className:`semiont-form-field`,children:[(0,F.jsxs)(`div`,{className:`semiont-form-field__header`,children:[(0,F.jsxs)(`label`,{className:`semiont-form-field__label semiont-form-field__label--with-checkbox`,children:[(0,F.jsx)(`input`,{type:`checkbox`,checked:m,onChange:e=>h(e.target.checked),className:`semiont-checkbox`,"data-variant":e}),(0,F.jsx)(`span`,{children:a(`densityLabel`)})]}),m&&(0,F.jsxs)(`span`,{className:`semiont-form-field__info`,children:[f,` per 2000 words`]})]}),m&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`input`,{type:`range`,min:e===`comment`?`2`:`1`,max:e===`comment`?`12`:e===`assessment`?`10`:`15`,value:f,onChange:e=>p(Number(e.target.value)),className:`semiont-slider`}),(0,F.jsxs)(`div`,{className:`semiont-slider__labels`,children:[(0,F.jsx)(`span`,{children:a(`densitySparse`)}),(0,F.jsx)(`span`,{children:a(`densityDense`)})]})]})]}),(0,F.jsxs)(`button`,{onClick:v,className:`semiont-button`,"data-variant":`assist`,"data-type":e,children:[(0,F.jsx)(`span`,{className:`semiont-button-icon`,children:`✨`}),(0,F.jsx)(`span`,{children:a(`annotate`)})]})]}),i&&(0,F.jsxs)(`div`,{className:`semiont-annotation-progress`,"data-type":e,children:[i.requestParams&&i.requestParams.length>0&&(0,F.jsxs)(`div`,{className:`semiont-annotation-progress__params`,"data-type":e,children:[(0,F.jsx)(`div`,{className:`semiont-annotation-progress__params-title`,children:`Request Parameters:`}),i.requestParams.map((e,t)=>(0,F.jsxs)(`div`,{className:`semiont-annotation-progress__param`,children:[(0,F.jsxs)(`span`,{className:`semiont-annotation-progress__param-label`,children:[e.label,`:`]}),` `,e.value]},t))]}),(0,F.jsxs)(`div`,{className:`semiont-annotation-progress__status`,children:[(0,F.jsxs)(`div`,{className:`semiont-annotation-progress__message`,children:[(0,F.jsx)(`span`,{className:`semiont-annotation-progress__icon`,children:`✨`}),(0,F.jsx)(`span`,{children:i.message})]}),!t&&(0,F.jsx)(`button`,{onClick:y,className:`semiont-annotation-progress__close`,"aria-label":a(`closeProgress`),title:a(`closeProgress`),type:`button`,children:`×`})]})]})]})]})}function xX({count:e,title:t}){return(0,F.jsx)(`div`,{className:`semiont-panel-header`,children:(0,F.jsxs)(`h2`,{className:`semiont-panel-header__title`,children:[(0,F.jsx)(`span`,{className:`semiont-panel-header__text`,children:t}),(0,F.jsxs)(`span`,{className:`semiont-panel-header__count`,children:[`(`,e,`)`]})]})})}function SX(e){if(Array.isArray(e)){let t=e.find(e=>e.type===`TextQuoteSelector`);if(t&&`exact`in t)return t.exact}else if(e.type===`TextQuoteSelector`&&`exact`in e)return e.exact;return null}function CX({resourceId:e,annotations:t,pendingAnnotation:n,isAssisting:r=!1,progress:i,locale:a,sourceLanguage:o,annotateMode:s=!0,scrollToAnnotationId:c,onScrollCompleted:l,hoveredAnnotationId:d}){let f=Lg(`AssessmentPanel`),p=Z(kg().activeSession$),[m,h]=(0,u.useState)(``),[g,_]=(0,u.useState)(null),v=(0,u.useRef)(null),y=(0,u.useRef)(new Map),b=(0,u.useMemo)(()=>[...t].sort((e,t)=>{let n=Wo(Yo(e.target)),r=Wo(Yo(t.target));return!n||!r?0:n.start-r.start}),[t]),x=(0,u.useCallback)((e,t)=>{t?y.current.set(e,t):y.current.delete(e)},[]);return(0,u.useEffect)(()=>{if(!c)return;let e=y.current.get(c);if(e&&v.current){let t=e.offsetTop,n=v.current.clientHeight,r=e.offsetHeight,i=t-n/2+r/2;v.current.scrollTo({top:i,behavior:`smooth`}),e.classList.remove(`semiont-annotation-pulse`),e.offsetWidth,e.classList.add(`semiont-annotation-pulse`),l&&l()}},[c]),(0,u.useEffect)(()=>{if(!d)return;let e=y.current.get(d);if(!e||!v.current)return;let t=v.current,n=e.getBoundingClientRect(),r=t.getBoundingClientRect();if(!(n.top>=r.top&&n.bottom<=r.bottom)){let n=e.offsetTop,r=t.clientHeight,i=e.offsetHeight,a=n-r/2+i/2;t.scrollTo({top:a,behavior:`smooth`})}},[d]),(0,u.useEffect)(()=>{if(!n)return;let e=e=>{e.key===`Escape`&&(p?.client.mark.cancelPending(),h(``))};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[n,p]),PL({"browse:click":(0,u.useCallback)(({annotationId:e})=>{_(e),setTimeout(()=>_(null),3e3)},[])}),(0,F.jsxs)(`div`,{className:`semiont-panel`,children:[(0,F.jsx)(xX,{annotationType:`assessment`,count:t.length,title:f(`title`)}),n&&n.motivation===`assessing`&&(0,F.jsxs)(`div`,{className:`semiont-annotation-prompt`,"data-type":`assessment`,children:[(0,F.jsx)(`div`,{className:`semiont-annotation-prompt__quote`,children:(()=>{let e=SX(n.selector);return e?`"${e.substring(0,100)}${e.length>100?`...`:``}"`:f(`fragmentSelected`)})()}),(0,F.jsx)(`textarea`,{value:m,onChange:e=>h(e.target.value),className:`semiont-textarea`,rows:3,placeholder:f(`assessmentPlaceholder`),autoFocus:!0,maxLength:2e3}),(0,F.jsxs)(`div`,{className:`semiont-annotation-prompt__footer`,children:[(0,F.jsxs)(`span`,{className:`semiont-annotation-prompt__char-count`,children:[m.length,`/2000`]}),(0,F.jsxs)(`div`,{className:`semiont-annotation-prompt__actions`,children:[(0,F.jsx)(`button`,{onClick:()=>{p?.client.mark.cancelPending(),h(``)},className:`semiont-button semiont-button--secondary`,"data-type":`assessment`,children:f(`cancel`)}),(0,F.jsx)(`button`,{onClick:()=>{if(n){let t=m.trim(),r=t?{type:`TextualBody`,value:t,purpose:`assessing`}:void 0;p?.client.mark.submit({source:e,motivation:`assessing`,selector:n.selector,...r===void 0?{}:{body:r}}),h(``)}},className:`semiont-button semiont-button--primary`,"data-type":`assessment`,children:f(`save`)})]})]})]}),(0,F.jsxs)(`div`,{ref:v,className:`semiont-panel__content`,children:[s&&(0,F.jsx)(bX,{annotationType:`assessment`,isAssisting:r,locale:a,sourceLanguage:o,progress:i}),(0,F.jsx)(`div`,{className:`semiont-panel__list`,children:b.length===0?(0,F.jsx)(`p`,{className:`semiont-panel__empty`,children:f(`noAssessments`)}):b.map(e=>(0,F.jsx)(yX,{assessment:e,isFocused:e.id===g,isHovered:e.id===d,ref:t=>x(e.id,t)},e.id))})]})]})}function wX({state:e,eventCount:t,lastEventTimestamp:n,knowledgeBaseName:r}){let i=Lg(`CollaborationPanel`),a=e===`open`||e===`reconnecting`||e===`initial`||e===`connecting`,o;if(!n)o=i(`noActivity`);else{let e=new Date,t=new Date(n),r=e.getTime()-t.getTime(),a=Math.floor(r/1e3),s=Math.floor(a/60),c=Math.floor(s/60);o=a<10?i(`justNow`):a<60?i(`secondsAgo`,{count:a}):s===1?i(`minuteAgo`):s<60?i(`minutesAgo`,{count:s}):c===1?i(`hourAgo`):c<24?i(`hoursAgo`,{count:c}):t.toLocaleDateString()}return(0,F.jsxs)(`div`,{className:`semiont-collaboration-panel`,children:[(0,F.jsx)(`h3`,{className:`semiont-collaboration-panel__title`,children:i(`title`)}),r&&(0,F.jsx)(`div`,{style:{padding:`0 0.75rem 0.5rem`,fontSize:`0.8rem`,color:`var(--semiont-color-neutral-400)`},children:r}),(0,F.jsxs)(`div`,{className:`semiont-collaboration-panel__section`,children:[(0,F.jsx)(`h3`,{className:`semiont-collaboration-panel__heading`,children:i(`connectionStatus`)}),(0,F.jsxs)(`div`,{className:`semiont-collaboration-panel__status`,children:[(0,F.jsxs)(`span`,{className:`semiont-collaboration-panel__indicator`,children:[(0,F.jsx)(`span`,{className:`semiont-collaboration-panel__dot`,"data-connected":a?`true`:`false`}),(0,F.jsx)(`span`,{className:`semiont-collaboration-panel__status-text`,"data-connected":a?`true`:`false`,children:i(a?`live`:`disconnected`)})]}),a&&t>0&&(0,F.jsxs)(`span`,{className:`semiont-collaboration-panel__event-count`,children:[`(`,i(`events`,{count:t}),`)`]})]}),(0,F.jsxs)(`div`,{className:`semiont-collaboration-panel__details`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`semiont-collaboration-panel__label`,children:i(`lastSync`)}),` `,o]}),(0,F.jsx)(`div`,{children:i(a?`realtimeActive`:`reconnecting`)})]})]}),(0,F.jsxs)(`div`,{className:`semiont-collaboration-panel__section semiont-collaboration-panel__section--bordered`,children:[(0,F.jsx)(`h3`,{className:`semiont-collaboration-panel__heading`,children:i(`sharing`)}),(0,F.jsx)(`p`,{className:`semiont-collaboration-panel__description`,children:i(`collaborationComingSoon`)})]})]})}function TX(e){let t=new Date(e),n=new Date().getTime()-t.getTime(),r=Math.floor(n/1e3),i=Math.floor(r/60),a=Math.floor(i/60),o=Math.floor(a/24);return r<60?`just now`:i<60?`${i} minute${i>1?`s`:``} ago`:a<24?`${a} hour${a>1?`s`:``} ago`:o<7?`${o} day${o>1?`s`:``} ago`:t.toLocaleDateString()}function EX({comment:e,isFocused:t,isHovered:n=!1,annotateMode:r=!0,ref:i}){let a=Lg(`CommentsPanel`),o=Z(kg().activeSession$),s=mL(e.id),[c,l]=(0,u.useState)(!1),[d,f]=(0,u.useState)(``),p=(0,u.useRef)(null);(0,u.useImperativeHandle)(i,()=>p.current);let m=ts(e)||``,h=is(e);(0,u.useEffect)(()=>{t&&p.current&&p.current.scrollIntoView({behavior:`smooth`,block:`center`})},[t]);let g=()=>{f(m),l(!0)},_=()=>{l(!1)},v=()=>{l(!1),f(``)};return(0,F.jsxs)(`div`,{ref:p,className:`semiont-annotation-entry${n?` semiont-annotation-pulse`:``}`,"data-type":`comment`,"data-focused":t?`true`:`false`,onClick:()=>{o?.client.browse.click(e.id,e.motivation)},...s,children:[h&&(0,F.jsxs)(`div`,{className:`semiont-annotation-entry__quote`,"data-type":`comment`,children:[`"`,h.substring(0,100),h.length>100?`...`:``,`"`]}),c?(0,F.jsxs)(`div`,{className:`semiont-annotation-entry__edit`,onClick:e=>e.stopPropagation(),children:[(0,F.jsx)(`textarea`,{value:d,onChange:e=>f(e.target.value),className:`semiont-textarea`,rows:3,autoFocus:!0,maxLength:2e3}),(0,F.jsxs)(`div`,{className:`semiont-annotation-entry__edit-footer`,children:[(0,F.jsxs)(`span`,{className:`semiont-annotation-entry__char-count`,children:[d.length,`/2000`]}),(0,F.jsxs)(`div`,{className:`semiont-annotation-entry__button-group`,children:[(0,F.jsx)(`button`,{onClick:_,className:`semiont-button semiont-button--primary`,"data-type":`comment`,children:a(`save`)}),(0,F.jsx)(`button`,{onClick:v,className:`semiont-button semiont-button--secondary`,children:a(`cancel`)})]})]})]}):(0,F.jsx)(`div`,{className:`semiont-annotation-entry__body`,children:m}),!c&&(0,F.jsxs)(`div`,{className:`semiont-annotation-entry__footer`,children:[(0,F.jsxs)(`div`,{className:`semiont-annotation-entry__metadata`,children:[`By `,typeof e.creator==`string`?e.creator:e.creator?.name||`Unknown`,` • `,TX(e.created||new Date().toISOString())]}),e.generator&&(0,F.jsxs)(`div`,{className:`semiont-annotation-entry__metadata`,children:[`Via `,Array.isArray(e.generator)?e.generator.map(hX).join(`, `):hX(e.generator)]}),r&&(0,F.jsx)(`div`,{className:`semiont-annotation-entry__actions`,onClick:e=>e.stopPropagation(),children:(0,F.jsx)(`button`,{onClick:g,className:`semiont-text-button`,"data-variant":`comment`,children:a(`edit`)})})]})]})}function DX(e){if(Array.isArray(e)){let t=e.find(e=>e.type===`TextQuoteSelector`);if(t&&`exact`in t)return t.exact}else if(e.type===`TextQuoteSelector`&&`exact`in e)return e.exact;return null}function OX({resourceId:e,annotations:t,pendingAnnotation:n,annotateMode:r=!0,isAssisting:i=!1,progress:a,locale:o,sourceLanguage:s,scrollToAnnotationId:c,onScrollCompleted:l,hoveredAnnotationId:d}){let f=Lg(`CommentsPanel`),p=Z(kg().activeSession$),[m,h]=(0,u.useState)(``),[g,_]=(0,u.useState)(null),v=(0,u.useRef)(null),y=(0,u.useRef)(new Map),b=(0,u.useMemo)(()=>[...t].sort((e,t)=>{let n=Wo(Yo(e.target)),r=Wo(Yo(t.target));return!n||!r?0:n.start-r.start}),[t]),x=(0,u.useCallback)((e,t)=>{t?y.current.set(e,t):y.current.delete(e)},[]);return(0,u.useEffect)(()=>{if(!c)return;let e=y.current.get(c);if(e&&v.current){let t=e.offsetTop,n=v.current.clientHeight,r=e.offsetHeight,i=t-n/2+r/2;v.current.scrollTo({top:i,behavior:`smooth`}),e.classList.remove(`semiont-annotation-pulse`),e.offsetWidth,e.classList.add(`semiont-annotation-pulse`),l&&l()}},[c]),(0,u.useEffect)(()=>{if(!d)return;let e=y.current.get(d);if(!e||!v.current)return;let t=v.current,n=e.getBoundingClientRect(),r=t.getBoundingClientRect();if(!(n.top>=r.top&&n.bottom<=r.bottom)){let n=e.offsetTop,r=t.clientHeight,i=e.offsetHeight,a=n-r/2+i/2;t.scrollTo({top:a,behavior:`smooth`})}},[d]),PL({"browse:click":(0,u.useCallback)(({annotationId:e})=>{_(e),setTimeout(()=>_(null),3e3)},[])}),(0,u.useEffect)(()=>{if(!n)return;let e=e=>{e.key===`Escape`&&(p?.client.mark.cancelPending(),h(``))};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[n,p]),(0,F.jsxs)(`div`,{className:`semiont-panel`,children:[(0,F.jsx)(xX,{annotationType:`comment`,count:t.length,title:f(`title`)}),n&&n.motivation===`commenting`&&(0,F.jsxs)(`div`,{className:`semiont-annotation-prompt`,"data-type":`comment`,children:[(0,F.jsx)(`div`,{className:`semiont-annotation-prompt__quote`,children:(()=>{let e=DX(n.selector);return e?`"${e.substring(0,100)}${e.length>100?`...`:``}"`:f(`fragmentSelected`)})()}),(0,F.jsx)(`textarea`,{value:m,onChange:e=>h(e.target.value),className:`semiont-textarea`,rows:3,placeholder:f(`commentPlaceholder`),autoFocus:!0,maxLength:2e3}),(0,F.jsxs)(`div`,{className:`semiont-annotation-prompt__footer`,children:[(0,F.jsxs)(`span`,{className:`semiont-annotation-prompt__char-count`,children:[m.length,`/2000`]}),(0,F.jsxs)(`div`,{className:`semiont-annotation-prompt__actions`,children:[(0,F.jsx)(`button`,{onClick:()=>{p?.client.mark.cancelPending(),h(``)},className:`semiont-button semiont-button--secondary`,"data-type":`comment`,children:f(`cancel`)}),(0,F.jsx)(`button`,{onClick:()=>{m.trim()&&n&&(p?.client.mark.submit({source:e,motivation:`commenting`,selector:n.selector,body:[{type:`TextualBody`,value:m,purpose:`commenting`}]}),h(``))},disabled:!m.trim(),className:`semiont-button semiont-button--primary`,"data-type":`comment`,children:f(`save`)})]})]})]}),(0,F.jsxs)(`div`,{ref:v,className:`semiont-panel__content`,children:[r&&(0,F.jsx)(bX,{annotationType:`comment`,isAssisting:i,locale:o,sourceLanguage:s,progress:a}),(0,F.jsx)(`div`,{className:`semiont-panel__list`,children:b.length===0?(0,F.jsx)(`p`,{className:`semiont-panel__empty`,children:f(`noComments`)}):b.map(e=>(0,F.jsx)(EX,{comment:e,isFocused:e.id===g,isHovered:e.id===d,annotateMode:r,ref:t=>x(e.id,t)},e.id))})]})]})}function kX(e){let t=new Date(e),n=new Date().getTime()-t.getTime(),r=Math.floor(n/1e3),i=Math.floor(r/60),a=Math.floor(i/60),o=Math.floor(a/24);return r<60?`just now`:i<60?`${i} minute${i>1?`s`:``} ago`:a<24?`${a} hour${a>1?`s`:``} ago`:o<7?`${o} day${o>1?`s`:``} ago`:t.toLocaleDateString()}function AX({highlight:e,isFocused:t,isHovered:n=!1,ref:r}){let i=Z(kg().activeSession$),a=mL(e.id),o=is(e);return(0,F.jsxs)(`div`,{ref:r,className:`semiont-annotation-entry${n?` semiont-annotation-pulse`:``}`,"data-type":`highlight`,"data-focused":t?`true`:`false`,onClick:()=>{i?.client.browse.click(e.id,e.motivation)},...a,children:[o&&(0,F.jsxs)(`div`,{className:`semiont-annotation-entry__quote`,"data-type":`highlight`,children:[`"`,o.substring(0,200),o.length>200?`...`:``,`"`]}),(0,F.jsxs)(`div`,{className:`semiont-annotation-entry__metadata`,children:[`By `,typeof e.creator==`string`?e.creator:e.creator?.name||`Unknown`,` • `,kX(e.created||new Date().toISOString())]}),e.generator&&(0,F.jsxs)(`div`,{className:`semiont-annotation-entry__metadata`,children:[`Via `,Array.isArray(e.generator)?e.generator.map(hX).join(`, `):hX(e.generator)]})]})}function jX({resourceId:e,annotations:t,pendingAnnotation:n,isAssisting:r=!1,progress:i,annotateMode:a=!0,scrollToAnnotationId:o,onScrollCompleted:s,hoveredAnnotationId:c,sourceLanguage:l}){let d=Lg(`HighlightPanel`),f=Z(kg().activeSession$),[p,m]=(0,u.useState)(null),h=(0,u.useRef)(null),g=(0,u.useRef)(new Map),_=(0,u.useMemo)(()=>[...t].sort((e,t)=>{let n=Wo(Yo(e.target)),r=Wo(Yo(t.target));return!n||!r?0:n.start-r.start}),[t]),v=(0,u.useCallback)((e,t)=>{t?g.current.set(e,t):g.current.delete(e)},[]);return(0,u.useEffect)(()=>{if(!o)return;let e=g.current.get(o);if(e&&h.current){let t=e.offsetTop,n=h.current.clientHeight,r=e.offsetHeight,i=t-n/2+r/2;h.current.scrollTo({top:i,behavior:`smooth`}),e.classList.remove(`semiont-annotation-pulse`),e.offsetWidth,e.classList.add(`semiont-annotation-pulse`),s&&s()}},[o]),(0,u.useEffect)(()=>{if(!c)return;let e=g.current.get(c);if(!e||!h.current)return;let t=h.current,n=e.getBoundingClientRect(),r=t.getBoundingClientRect();if(!(n.top>=r.top&&n.bottom<=r.bottom)){let n=e.offsetTop,r=t.clientHeight,i=e.offsetHeight,a=n-r/2+i/2;t.scrollTo({top:a,behavior:`smooth`})}},[c]),PL({"browse:click":(0,u.useCallback)(({annotationId:e})=>{m(e),setTimeout(()=>m(null),3e3)},[])}),(0,u.useEffect)(()=>{n&&n.motivation===`highlighting`&&f?.client.mark.submit({source:e,motivation:`highlighting`,selector:n.selector})},[n,f]),(0,F.jsxs)(`div`,{className:`semiont-panel`,children:[(0,F.jsx)(xX,{annotationType:`highlight`,count:t.length,title:d(`title`)}),(0,F.jsxs)(`div`,{ref:h,className:`semiont-panel__content`,children:[a&&(0,F.jsx)(bX,{annotationType:`highlight`,isAssisting:r,progress:i,sourceLanguage:l}),(0,F.jsx)(`div`,{className:`semiont-panel__list`,children:_.length===0?(0,F.jsx)(`p`,{className:`semiont-panel__empty`,children:d(`noHighlights`)}):_.map(e=>(0,F.jsx)(AX,{highlight:e,isFocused:e.id===p,isHovered:e.id===c,ref:t=>v(e.id,t)},e.id))})]})]})}function MX(e){let t=Z(kg().activeSession$)?.client,[n,r]=(0,u.useState)(null),[i,a]=(0,u.useState)(!0),[o,s]=(0,u.useState)(null);return(0,u.useEffect)(()=>{if(!t||!e){a(!1);return}let n=!1;return a(!0),s(null),t.browse.resourceGraph(e).then(e=>{n||(r(e),a(!1))}).catch(e=>{n||(s(e instanceof Error?e:Error(String(e))),a(!1))}),()=>{n=!0}},[t,e]),{graph:n,loading:i,error:o}}function NX({resourceId:e}){let t=(0,u.useRef)(null),n=(0,u.useRef)(null),{showLineNumbers:r}=pL(),{graph:i,loading:a,error:o}=MX(e),s=i?JSON.stringify(i,null,2):``;return(0,u.useEffect)(()=>{if(!t.current||!s)return;let e=document.documentElement?.classList.contains(`dark`)??!1,i=[_G(),q.editable.of(!1),gO.readOnly.of(!0)];r&&i.push(kP()),e?i.push(PG):(i.push(HI),i.push(jI(UI)));let a=new q({state:gO.create({doc:s,extensions:i}),parent:t.current});return n.current=a,()=>{a.destroy(),n.current=null}},[s,r]),(0,F.jsxs)(`div`,{className:`semiont-jsonld-panel`,children:[(0,F.jsxs)(`div`,{className:`semiont-jsonld-panel__header`,children:[(0,F.jsx)(`h3`,{className:`semiont-jsonld-panel__title`,children:`JSON-LD`}),(0,F.jsx)(`button`,{onClick:async()=>{if(s)try{await navigator.clipboard.writeText(s)}catch(e){console.error(`Failed to copy JSON-LD:`,e)}},className:`semiont-button semiont-button--icon`,title:`Copy to clipboard`,disabled:!i,children:`📋 Copy`})]}),a&&(0,F.jsx)(`p`,{className:`semiont-jsonld-panel__status`,role:`status`,children:`Loading JSON-LD…`}),o&&!a&&(0,F.jsx)(`p`,{className:`semiont-jsonld-panel__status semiont-jsonld-panel__status--error`,role:`alert`,children:`Failed to load JSON-LD.`}),(0,F.jsx)(`div`,{ref:t,className:`semiont-jsonld-panel__editor`})]})}function PX(e){if(Array.isArray(e.body)){let t=[];for(let n of e.body)if(typeof n==`object`&&n&&`type`in n&&`value`in n&&`purpose`in n){let e=n.type,r=n.value,i=n.purpose;e===`TextualBody`&&i===`tagging`&&typeof r==`string`&&r.length>0&&t.push(r)}return t}return[]}function FX(e){return e.motivation===`tagging`}function IX(e){if(!FX(e))return;let t=(Array.isArray(e.body)?e.body:[e.body]).find(e=>typeof e==`object`&&!!e&&`purpose`in e&&e.purpose===`tagging`);if(t&&`value`in t)return t.value}function LX(e){if(!FX(e))return;let t=(Array.isArray(e.body)?e.body:[e.body]).find(e=>typeof e==`object`&&!!e&&`purpose`in e&&e.purpose===`classifying`);if(t&&`value`in t)return t.value}function RX({reference:e,isFocused:t,isHovered:n=!1,routes:r,annotateMode:i=!0,isGenerating:a=!1,ref:o}){let s=Lg(`ReferencesPanel`),c=Z(kg().activeSession$),l=c?.client,u=gL(),d=mL(e.id),f=is(e)||``,p=Jo(e.body),m=p?qo(e.body):null,h=PX(e),g=Yo(e.target),_=Ko(g),v=Go(g),y=_?`Fragment annotation`:v?`Image annotation`:`Annotation`,b=e,x=b._resolvedDocumentName,S=b._resolvedDocumentMediaType,C=aL(S),w=()=>{m&&u(r.resourceDetail(m),{resourceId:m})},T=typeof e.target==`object`&&`source`in e.target?e.target.source:``,E=()=>{T&&m&&l&&l.bind.body(To(T),e.id,[{op:`remove`,item:{type:`SpecificResource`,source:m,purpose:`linking`}}]).catch(()=>{})},D=()=>{c?.client.bind.initiate({annotationId:e.id,resourceId:To(T),defaultTitle:f,entityTypes:h})},O=e=>{e.stopPropagation(),p?w():i&&D()},k=p||i;return(0,F.jsxs)(`div`,{ref:o,className:`semiont-annotation-entry${n?` semiont-annotation-pulse`:``}`,"data-type":`reference`,"data-focused":t?`true`:`false`,onClick:()=>{c?.client.browse.click(e.id,e.motivation)},...d,children:[(0,F.jsxs)(`div`,{className:`semiont-annotation-entry__header`,children:[(0,F.jsxs)(`div`,{className:`semiont-reference-icon-group`,children:[(0,F.jsx)(`button`,{className:`semiont-reference-icon${k?` semiont-reference-icon--clickable`:``}`,title:s(p?`open`:i?`resolve`:`stub`),onClick:k?O:void 0,"data-generating":!p&&a?`true`:`false`,tabIndex:k?0:-1,children:p?`🔗`:`❓`}),i&&p&&(0,F.jsx)(`button`,{className:`semiont-reference-unlink`,title:s(`unlink`),onClick:e=>{e.stopPropagation(),E()},children:`⛓️💥`})]}),(0,F.jsxs)(`div`,{className:`semiont-annotation-entry__content`,children:[f&&(0,F.jsxs)(`div`,{className:`semiont-annotation-entry__quote`,"data-type":`reference`,children:[`"`,f.substring(0,100),f.length>100?`...`:``,`"`]}),!f&&(0,F.jsx)(`div`,{className:`semiont-annotation-entry__meta`,children:y}),x&&(0,F.jsx)(`div`,{className:`semiont-reference-link`,children:(0,F.jsxs)(`span`,{children:[`→ `,C,` `,x]})})]})]}),h.length>0&&(0,F.jsx)(`div`,{className:`semiont-annotation-entry__tags`,children:h.map((e,t)=>(0,F.jsx)(`span`,{className:`semiont-tag`,"data-variant":`blue`,children:e},t))}),e.generator&&(0,F.jsxs)(`div`,{className:`semiont-annotation-entry__metadata`,children:[`Via `,Array.isArray(e.generator)?e.generator.map(hX).join(`, `):hX(e.generator)]})]})}function zX(e){if(Array.isArray(e)){let t=e.find(e=>e.type===`TextQuoteSelector`);if(t&&`exact`in t)return t.exact}else if(e.type===`TextQuoteSelector`&&`exact`in e)return e.exact;return null}function BX({resourceId:e,annotations:t=[],isAssisting:n,progress:r,annotateMode:i=!0,Link:a,routes:o,allEntityTypes:s,generatingReferenceId:c,referencedBy:l=[],referencedByLoading:d=!1,pendingAnnotation:f,scrollToAnnotationId:p,onScrollCompleted:m,hoveredAnnotationId:h,locale:g,sourceLanguage:_}){let v=Lg(`ReferencesPanel`),y=Z(kg().activeSession$),[b,x]=(0,u.useState)([]),[S,C]=(0,u.useState)(null),[w,T]=(0,u.useState)([]),[E,D]=(0,u.useState)(!1),[O,k]=(0,u.useState)(null),A=(0,u.useRef)(null),[j,ee]=(0,u.useState)(()=>{if(typeof window>`u`)return!0;let e=localStorage.getItem(`assist-section-expanded-reference`);return e?e===`true`:!0});(0,u.useEffect)(()=>{typeof window>`u`||localStorage.setItem(`assist-section-expanded-reference`,String(j))},[j]);let M=(0,u.useRef)(new Map),N=(0,u.useMemo)(()=>[...t].sort((e,t)=>{let n=Wo(Yo(e.target)),r=Wo(Yo(t.target));return!n||!r?0:n.start-r.start}),[t]),te=(0,u.useCallback)((e,t)=>{t?M.current.set(e,t):M.current.delete(e)},[]);(0,u.useEffect)(()=>{if(!p)return;let e=M.current.get(p);if(e&&A.current){let t=e.offsetTop,n=A.current.clientHeight,r=e.offsetHeight,i=t-n/2+r/2;A.current.scrollTo({top:i,behavior:`smooth`}),e.classList.remove(`semiont-annotation-pulse`),e.offsetWidth,e.classList.add(`semiont-annotation-pulse`),m&&m()}else console.warn(`[ReferencesPanel] Element not found for scrollToAnnotationId:`,p)},[p]),(0,u.useEffect)(()=>{if(!h)return;let e=M.current.get(h);if(!e||!A.current)return;let t=A.current,n=e.getBoundingClientRect(),r=t.getBoundingClientRect();if(!(n.top>=r.top&&n.bottom<=r.bottom)){let n=e.offsetTop,r=t.clientHeight,i=e.offsetHeight,a=n-r/2+i/2;t.scrollTo({top:a,behavior:`smooth`})}},[h]),PL({"browse:click":(0,u.useCallback)(({annotationId:e})=>{k(e),setTimeout(()=>k(null),3e3)},[])});let ne=()=>{C(null),y?.client.mark.requestAssist(`linking`,{entityTypes:b,includeDescriptiveReferences:E,language:g,sourceLanguage:_})},re=(0,u.useRef)(!1);(0,u.useEffect)(()=>{if(n){re.current=!1;return}!re.current&&r?.completedEntityTypes&&(re.current=!0,C(r.completedEntityTypes),x([]))},[n,r?.completedEntityTypes]);let ie=e=>{T(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])};return(0,u.useEffect)(()=>{if(!f)return;let e=e=>{e.key===`Escape`&&(y?.client.mark.cancelPending(),T([]))};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[f,y]),(0,F.jsxs)(`div`,{className:`semiont-panel`,children:[(0,F.jsx)(xX,{annotationType:`reference`,count:t.length,title:v(`title`)}),f&&f.motivation===`linking`&&(0,F.jsxs)(`div`,{className:`semiont-annotation-prompt`,"data-type":`reference`,children:[(0,F.jsx)(`div`,{className:`semiont-annotation-prompt__quote`,children:(()=>{let e=zX(f.selector);return e?`"${e.substring(0,100)}${e.length>100?`...`:``}"`:v(`fragmentSelected`)})()}),s.length>0&&(0,F.jsxs)(`div`,{className:`semiont-form-field`,children:[(0,F.jsx)(`p`,{className:`semiont-form-field__label`,children:v(`entityTypesOptional`)}),(0,F.jsx)(`div`,{className:`semiont-tag-selector`,children:s.map(e=>(0,F.jsx)(`button`,{onClick:()=>ie(e),className:`semiont-tag-selector__item`,"data-selected":w.includes(e)?`true`:`false`,children:e},e))})]}),(0,F.jsx)(`div`,{className:`semiont-annotation-prompt__footer`,children:(0,F.jsxs)(`div`,{className:`semiont-annotation-prompt__actions`,children:[(0,F.jsx)(`button`,{onClick:()=>{y?.client.mark.cancelPending(),T([])},className:`semiont-button semiont-button--secondary`,"data-type":`reference`,children:v(`cancel`)}),(0,F.jsxs)(`button`,{onClick:()=>{if(f){let t=w.join(`,`)||void 0;y?.client.mark.submit({source:e,motivation:`linking`,selector:f.selector,body:t?[{type:`TextualBody`,value:t,purpose:`tagging`}]:[]}),T([])}},className:`semiont-button semiont-button--primary`,"data-type":`reference`,children:[`🔗 `,v(`createReference`)]})]})})]}),(0,F.jsxs)(`div`,{ref:A,className:`semiont-panel__content`,children:[i&&(0,F.jsxs)(`div`,{className:`semiont-panel__section`,children:[(0,F.jsxs)(`button`,{onClick:()=>ee(!j),className:`semiont-panel__section-title semiont-panel__section-title--collapsible`,"aria-expanded":j,type:`button`,children:[(0,F.jsx)(`span`,{children:v(`annotateReferences`)}),(0,F.jsx)(`span`,{className:`semiont-panel__section-chevron`,"data-expanded":j,children:`›`})]}),j&&(0,F.jsxs)(F.Fragment,{children:[!n&&(0,F.jsx)(`div`,{className:`semiont-assist-widget`,"data-type":`reference`,children:(0,F.jsxs)(F.Fragment,{children:[S&&S.length>0&&(0,F.jsx)(`div`,{className:`semiont-assist-widget__log`,children:(0,F.jsx)(`div`,{className:`semiont-assist-widget__log-items`,children:S.map((e,t)=>(0,F.jsxs)(`div`,{className:`semiont-assist-widget__log-item`,children:[(0,F.jsx)(`span`,{className:`semiont-assist-widget__log-check`,children:`✓`}),(0,F.jsxs)(`span`,{className:`semiont-assist-widget__log-type`,children:[e.entityType,`:`]}),(0,F.jsx)(`span`,{children:v(`found`,{count:e.foundCount})})]},t))})}),(0,F.jsxs)(`div`,{className:`semiont-assist-widget__entity-types`,children:[(0,F.jsx)(`p`,{className:`semiont-assist-widget__label`,children:v(`selectEntityTypes`)}),(0,F.jsx)(`div`,{className:`semiont-assist-widget__chips`,children:s.length>0?s.map(e=>(0,F.jsx)(`button`,{onClick:()=>{x(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},"aria-pressed":b.includes(e),"aria-label":`${b.includes(e)?v(`deselect`):v(`select`)} ${e}`,className:`semiont-chip semiont-chip--selectable`,"data-selected":b.includes(e),children:e},e)):(0,F.jsx)(`p`,{className:`semiont-assist-widget__no-types`,children:v(`noEntityTypes`)})})]}),b.length>0&&(0,F.jsx)(`p`,{className:`semiont-assist-widget__count`,children:v(`typesSelected`,{count:b.length})}),(0,F.jsxs)(`div`,{className:`semiont-assist-widget__checkbox-group`,children:[(0,F.jsxs)(`label`,{className:`semiont-assist-widget__checkbox-label`,children:[(0,F.jsx)(`input`,{type:`checkbox`,checked:E,onChange:e=>D(e.target.checked),className:`semiont-assist-widget__checkbox`}),(0,F.jsx)(`span`,{children:v(`includeDescriptiveReferences`)})]}),(0,F.jsx)(`p`,{className:`semiont-assist-widget__checkbox-hint`,children:v(`descriptiveReferencesTooltip`)})]}),(0,F.jsxs)(`button`,{onClick:ne,disabled:b.length===0,title:v(`annotate`),className:`semiont-button`,"data-variant":`assist`,"data-type":`reference`,children:[(0,F.jsx)(`span`,{className:`semiont-button-icon`,children:`✨`}),(0,F.jsx)(`span`,{children:v(`annotate`)})]})]})}),n&&r&&(0,F.jsx)(iG,{progress:r,annotationType:`reference`,cancelJobType:`annotation`,translations:{title:v(`annotationProgressTitle`),cancel:v(`cancelAnnotation`),inProgress:v(`annotating`),complete:v(`complete`),failed:v(`failed`),found:e=>v(`found`,{count:e}),current:e=>v(`current`,{entityType:e})}})]})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`semiont-panel__divider`,children:(0,F.jsxs)(`h3`,{className:`semiont-panel__subtitle`,children:[v(`outgoingReferences`),` (`,N.length,`)`]})}),(0,F.jsx)(`div`,{className:`semiont-panel__list`,children:N.length===0?(0,F.jsx)(`p`,{className:`semiont-panel__empty-message`,children:v(`noReferences`)}):N.map(e=>(0,F.jsx)(RX,{reference:e,isFocused:e.id===O,isHovered:e.id===h,routes:o,annotateMode:i,isGenerating:e.id===c,ref:t=>te(e.id,t)},e.id))})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`semiont-panel__divider`,children:(0,F.jsxs)(`h3`,{className:`semiont-panel__subtitle`,children:[v(`incomingReferences`),` (`,l.length,`)`,d&&(0,F.jsxs)(`span`,{className:`semiont-panel__loading-indicator`,children:[`(`,v(`loading`),`)`]})]})}),l.length>0?(0,F.jsx)(`div`,{className:`semiont-panel__list`,children:l.map(e=>{let t=e.target.source;return(0,F.jsxs)(`div`,{className:`semiont-reference-item semiont-reference-item--incoming`,children:[(0,F.jsxs)(`div`,{className:`semiont-reference-item__header`,children:[(0,F.jsx)(`span`,{className:`semiont-reference-item__title`,children:e.resourceName||v(`untitledResource`)}),(0,F.jsx)(a,{href:o.resourceDetail(t),className:`semiont-reference-item__link`,title:v(`open`),children:`🔗`})]}),(0,F.jsxs)(`span`,{className:`semiont-reference-item__excerpt`,children:[`"`,e.target.selector?.exact||v(`noText`),`"`]})]},e.id)})}):(0,F.jsx)(`p`,{className:`semiont-panel__empty-message semiont-panel__empty-message--small`,children:v(d?`loadingEllipsis`:`noIncomingReferences`)})]})]})]})}function VX({resourceId:e,documentEntityTypes:t,documentLocale:n,primaryMediaType:r,primaryByteSize:i,storageUri:a,isArchived:o=!1,dateCreated:s,dateModified:c,wasAttributedTo:l,wasDerivedFrom:u,generator:d,onGenerate:f}){let p=Lg(`ResourceInfoPanel`),m=Z(kg().activeSession$),h=l?Array.isArray(l)?l:[l]:d?Array.isArray(d)?d:[d]:[];return(0,F.jsxs)(`div`,{className:`semiont-resource-info-panel`,children:[(0,F.jsx)(`h3`,{className:`semiont-resource-info-panel__title`,children:p(`title`)}),(0,F.jsxs)(`div`,{className:`semiont-resource-info-panel__section`,children:[(0,F.jsx)(`h3`,{className:`semiont-resource-info-panel__heading`,children:p(`locale`)}),n?(0,F.jsx)(`div`,{className:`semiont-resource-info-panel__value`,children:Ts(n)}):(0,F.jsx)(`div`,{className:`semiont-resource-info-panel__value semiont-resource-info-panel__value--empty`,children:p(`notSpecified`)})]}),(r||i!==void 0)&&(0,F.jsxs)(`div`,{className:`semiont-resource-info-panel__section`,children:[(0,F.jsx)(`h3`,{className:`semiont-resource-info-panel__heading`,children:p(`representation`)}),(0,F.jsxs)(`div`,{className:`semiont-resource-info-panel__field-group`,children:[r&&(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`semiont-resource-info-panel__label`,children:p(`mediaType`)}),(0,F.jsx)(`span`,{className:`semiont-resource-info-panel__value`,children:r})]}),i!==void 0&&(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`semiont-resource-info-panel__label`,children:p(`byteSize`)}),(0,F.jsxs)(`span`,{className:`semiont-resource-info-panel__value`,children:[i.toLocaleString(),` bytes`]})]}),a&&(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`semiont-resource-info-panel__label`,children:p(`storageUri`)}),(0,F.jsx)(`span`,{className:`semiont-resource-info-panel__value`,children:a})]})]})]}),(s||c||h.length>0||u)&&(0,F.jsxs)(`div`,{className:`semiont-resource-info-panel__section`,children:[(0,F.jsx)(`h3`,{className:`semiont-resource-info-panel__heading`,children:p(`provenance`)}),(0,F.jsxs)(`div`,{className:`semiont-resource-info-panel__field-group`,children:[s&&(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`semiont-resource-info-panel__label`,children:p(`createdAt`)}),(0,F.jsx)(`span`,{className:`semiont-resource-info-panel__value`,children:new Date(s).toLocaleString()})]}),c&&(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`semiont-resource-info-panel__label`,children:p(`modifiedAt`)}),(0,F.jsx)(`span`,{className:`semiont-resource-info-panel__value`,children:new Date(c).toLocaleString()})]}),h.length>0&&(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`semiont-resource-info-panel__label`,children:p(`attributedTo`)}),(0,F.jsx)(`span`,{className:`semiont-resource-info-panel__value`,children:h.map(hX).join(`, `)})]}),u&&(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`semiont-resource-info-panel__label`,children:p(`derivedFrom`)}),(0,F.jsx)(`span`,{className:`semiont-resource-info-panel__value`,children:(Array.isArray(u)?u:[u]).map((e,t)=>(0,F.jsxs)(`button`,{className:`semiont-resource-info-panel__link`,onClick:()=>m?.client.browse.navigateReference(To(e)),children:[t>0&&`, `,e]},e))})]})]})]}),t.length>0&&(0,F.jsxs)(`div`,{className:`semiont-resource-info-panel__section`,children:[(0,F.jsx)(`h3`,{className:`semiont-resource-info-panel__heading`,children:p(`entityTypeTags`)}),(0,F.jsx)(`div`,{className:`semiont-resource-info-panel__tag-list`,children:t.map(e=>(0,F.jsx)(`span`,{className:`semiont-tag`,"data-variant":`blue`,children:e},e))})]}),f&&(0,F.jsxs)(`div`,{className:`semiont-resource-info-panel__action-section`,children:[(0,F.jsxs)(`button`,{onClick:f,className:`semiont-resource-button semiont-resource-button--secondary`,children:[`✨ `,p(`generate`)]}),(0,F.jsx)(`p`,{className:`semiont-resource-info-panel__description`,children:p(`generateDescription`)})]}),(0,F.jsxs)(`div`,{className:`semiont-resource-info-panel__action-section`,children:[(0,F.jsxs)(`button`,{onClick:()=>m?.client.yield.clone(),className:`semiont-resource-button semiont-resource-button--secondary`,children:[`🔗 `,p(`clone`)]}),(0,F.jsx)(`p`,{className:`semiont-resource-info-panel__description`,children:p(`cloneDescription`)})]}),(0,F.jsx)(`div`,{className:`semiont-resource-info-panel__action-section`,children:o?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`button`,{onClick:()=>m?.client.mark.unarchive(To(e)),className:`semiont-resource-button semiont-resource-button--secondary`,children:[`📤 `,p(`unarchive`)]}),(0,F.jsx)(`p`,{className:`semiont-resource-info-panel__description`,children:p(`unarchiveDescription`)})]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`button`,{onClick:()=>m?.client.mark.archive(To(e)),className:`semiont-resource-button semiont-resource-button--archive`,children:[`📦 `,p(`archive`)]}),(0,F.jsx)(`p`,{className:`semiont-resource-info-panel__description`,children:p(`archiveDescription`)})]})})]})}function HX({highlights:e,comments:t,assessments:n,references:r,tags:i}){let a=Lg(`StatisticsPanel`),o=r.filter(e=>!Jo(e.body)).length,s=r.filter(e=>Jo(e.body)).length,c=new Map;r.forEach(e=>{PX(e).forEach(e=>{c.set(e,(c.get(e)||0)+1)})});let l=Array.from(c.entries()).sort((e,t)=>t[1]-e[1]);return(0,F.jsx)(`div`,{className:`semiont-statistics-panel`,children:(0,F.jsxs)(`div`,{className:`semiont-statistics-panel__content`,children:[(0,F.jsx)(`h2`,{className:`semiont-statistics-panel__title`,children:a(`title`)}),(0,F.jsxs)(`div`,{className:`semiont-statistics-panel__list`,children:[(0,F.jsxs)(`div`,{className:`semiont-statistics-panel__item`,children:[(0,F.jsx)(`span`,{className:`semiont-statistics-panel__label`,children:a(`highlights`)}),(0,F.jsx)(`span`,{className:`semiont-statistics-panel__value`,children:e.length})]}),(0,F.jsxs)(`div`,{className:`semiont-statistics-panel__item`,children:[(0,F.jsx)(`span`,{className:`semiont-statistics-panel__label`,children:a(`comments`)}),(0,F.jsx)(`span`,{className:`semiont-statistics-panel__value`,children:t.length})]}),(0,F.jsxs)(`div`,{className:`semiont-statistics-panel__item`,children:[(0,F.jsx)(`span`,{className:`semiont-statistics-panel__label`,children:a(`assessments`)}),(0,F.jsx)(`span`,{className:`semiont-statistics-panel__value`,children:n.length})]}),(0,F.jsxs)(`div`,{className:`semiont-statistics-panel__item`,children:[(0,F.jsx)(`span`,{className:`semiont-statistics-panel__label`,children:a(`tags`)}),(0,F.jsx)(`span`,{className:`semiont-statistics-panel__value`,children:i.length})]}),(0,F.jsxs)(`div`,{className:`semiont-statistics-panel__item`,children:[(0,F.jsx)(`span`,{className:`semiont-statistics-panel__label`,children:a(`references`)}),(0,F.jsx)(`span`,{className:`semiont-statistics-panel__value`,children:r.length}),(0,F.jsxs)(`div`,{className:`semiont-statistics-panel__subitems`,children:[(0,F.jsxs)(`div`,{className:`semiont-statistics-panel__subitem`,children:[(0,F.jsx)(`span`,{className:`semiont-statistics-panel__sublabel`,children:a(`stub`)}),(0,F.jsx)(`span`,{className:`semiont-statistics-panel__subvalue`,children:o})]}),(0,F.jsxs)(`div`,{className:`semiont-statistics-panel__subitem`,children:[(0,F.jsx)(`span`,{className:`semiont-statistics-panel__sublabel`,children:a(`resolved`)}),(0,F.jsx)(`span`,{className:`semiont-statistics-panel__subvalue`,children:s})]})]})]}),l.length>0&&(0,F.jsxs)(`div`,{className:`semiont-statistics-panel__entity-types`,children:[(0,F.jsx)(`span`,{className:`semiont-statistics-panel__label`,children:a(`entityTypes`)}),(0,F.jsx)(`div`,{className:`semiont-statistics-panel__entity-list`,children:l.map(([e,t])=>(0,F.jsxs)(`div`,{className:`semiont-statistics-panel__entity-item`,children:[(0,F.jsx)(`span`,{className:`semiont-statistics-panel__entity-name`,children:e}),(0,F.jsx)(`span`,{className:`semiont-tag`,"data-variant":`blue`,children:t})]},e))})]})]})]})})}function UX({tag:e,isFocused:t,isHovered:n=!1,ref:r}){let i=Z(kg().activeSession$),a=mL(e.id),o=is(e),s=IX(e),c=LX(e),l=Z((0,u.useMemo)(()=>i?.client.browse.tagSchemas()??null,[i])),d=c&&l?l.find(e=>e.id===c)??null:null;return(0,F.jsxs)(`div`,{ref:r,onClick:()=>{i?.client.browse.click(e.id,e.motivation)},...a,className:`semiont-annotation-entry${n?` semiont-annotation-pulse`:``}`,"data-type":`tag`,"data-focused":t?`true`:`false`,children:[(0,F.jsxs)(`div`,{className:`semiont-annotation-entry__header`,children:[(0,F.jsx)(`span`,{className:`semiont-tag-badge`,"data-variant":`tag`,children:s}),d&&(0,F.jsx)(`span`,{className:`semiont-annotation-entry__meta`,children:d.name})]}),(0,F.jsxs)(`div`,{className:`semiont-annotation-entry__quote`,"data-type":`tag`,children:[`"`,o.substring(0,150),o.length>150?`...`:``,`"`]}),e.generator&&(0,F.jsxs)(`div`,{className:`semiont-annotation-entry__metadata`,children:[`Via `,Array.isArray(e.generator)?e.generator.map(hX).join(`, `):hX(e.generator)]})]})}function WX(e){if(Array.isArray(e)){let t=e.find(e=>e.type===`TextQuoteSelector`);if(t&&`exact`in t)return t.exact}else if(e.type===`TextQuoteSelector`&&`exact`in e)return e.exact;return null}function GX({resourceId:e,annotations:t,annotateMode:n=!0,isAssisting:r=!1,progress:i,pendingAnnotation:a,scrollToAnnotationId:o,onScrollCompleted:s,hoveredAnnotationId:c,locale:l,sourceLanguage:d}){let f=Lg(`TaggingPanel`),p=Z(kg().activeSession$),m=Z((0,u.useMemo)(()=>p?.client.browse.tagSchemas()??null,[p])),h=m??[],g=m!==void 0&&m.length===0,[_,v]=(0,u.useState)(``),[y,b]=(0,u.useState)(new Set);(0,u.useEffect)(()=>{!_&&h.length>0&&v(h[0].id)},[h,_]);let[x,S]=(0,u.useState)(null),C=(0,u.useRef)(null),[w,T]=(0,u.useState)(()=>{if(typeof window>`u`)return!0;let e=localStorage.getItem(`assist-section-expanded-tag`);return e?e===`true`:!0});(0,u.useEffect)(()=>{typeof window>`u`||localStorage.setItem(`assist-section-expanded-tag`,String(w))},[w]),PL({"browse:click":(0,u.useCallback)(({annotationId:e})=>{S(e),setTimeout(()=>S(null),3e3)},[])});let E=(0,u.useRef)(new Map),D=(0,u.useMemo)(()=>[...t].sort((e,t)=>{let n=Wo(Yo(e.target)),r=Wo(Yo(t.target));return!n||!r?0:n.start-r.start}),[t]),O=(0,u.useCallback)((e,t)=>{t?E.current.set(e,t):E.current.delete(e)},[]);(0,u.useEffect)(()=>{if(!o)return;let e=E.current.get(o);if(e&&C.current){let t=e.offsetTop,n=C.current.clientHeight,r=e.offsetHeight,i=t-n/2+r/2;C.current.scrollTo({top:i,behavior:`smooth`}),e.classList.remove(`semiont-annotation-pulse`),e.offsetWidth,e.classList.add(`semiont-annotation-pulse`),s&&s()}},[o]),(0,u.useEffect)(()=>{if(!c)return;let e=E.current.get(c);if(!e||!C.current)return;let t=C.current,n=e.getBoundingClientRect(),r=t.getBoundingClientRect();if(!(n.top>=r.top&&n.bottom<=r.bottom)){let n=e.offsetTop,r=t.clientHeight,i=e.offsetHeight,a=n-r/2+i/2;t.scrollTo({top:a,behavior:`smooth`})}},[c]);let k=h.find(e=>e.id===_),A=e=>{v(e),b(new Set)},j=e=>{let t=new Set(y);t.has(e)?t.delete(e):t.add(e),b(t)};return(0,u.useEffect)(()=>{if(!a)return;let e=e=>{e.key===`Escape`&&p?.client.mark.cancelPending()};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a,p]),(0,F.jsxs)(`div`,{className:`semiont-panel`,children:[(0,F.jsx)(xX,{annotationType:`tag`,count:t.length,title:f(`title`)}),(0,F.jsxs)(`div`,{ref:C,className:`semiont-panel__content`,children:[a&&a.motivation===`tagging`&&(0,F.jsxs)(`div`,{className:`semiont-annotation-prompt`,"data-type":`tag`,children:[(0,F.jsx)(`h3`,{className:`semiont-annotation-prompt__title`,children:f(`createTagForSelection`)}),(0,F.jsx)(`div`,{className:`semiont-annotation-prompt__quote`,children:(0,F.jsx)(`p`,{className:`semiont-annotation-prompt__text`,children:(()=>{let e=WX(a.selector);return e?`"${e.substring(0,100)}${e.length>100?`...`:``}"`:f(`fragmentSelected`)})()})}),g&&(0,F.jsx)(`p`,{className:`semiont-form__help`,"data-type":`tag-no-schemas`,children:f(`noSchemas`)}),!g&&(0,F.jsxs)(`div`,{className:`semiont-form-field`,children:[(0,F.jsx)(`label`,{className:`semiont-form-field__label`,children:f(`selectSchema`)}),(0,F.jsx)(`select`,{value:_,onChange:e=>A(e.target.value),className:`semiont-select`,children:h.map(e=>(0,F.jsx)(`option`,{value:e.id,children:e.name},e.id))})]}),k&&(0,F.jsxs)(`div`,{className:`semiont-form-field`,children:[(0,F.jsx)(`label`,{className:`semiont-form-field__label`,children:f(`selectCategory`)}),(0,F.jsxs)(`select`,{className:`semiont-select`,onChange:t=>{t.target.value&&a&&p?.client.mark.submit({source:e,motivation:`tagging`,selector:a.selector,body:[{type:`TextualBody`,value:t.target.value,purpose:`tagging`},{type:`TextualBody`,value:_,purpose:`classifying`}]})},defaultValue:``,children:[(0,F.jsx)(`option`,{value:``,children:f(`chooseCategory`)}),k.tags.map(e=>(0,F.jsx)(`option`,{value:e.name,children:e.name},e.name))]})]}),(0,F.jsx)(`div`,{className:`semiont-annotation-prompt__footer`,children:(0,F.jsx)(`button`,{onClick:()=>p?.client.mark.cancelPending(),className:`semiont-button semiont-button--secondary`,"data-type":`tag`,children:f(`cancel`)})})]}),n&&(0,F.jsxs)(`div`,{className:`semiont-panel__section`,children:[(0,F.jsxs)(`button`,{onClick:()=>T(!w),className:`semiont-panel__section-title semiont-panel__section-title--collapsible`,"aria-expanded":w,type:`button`,children:[(0,F.jsx)(`span`,{children:f(`annotateTags`)}),(0,F.jsx)(`span`,{className:`semiont-panel__section-chevron`,"data-expanded":w,children:`›`})]}),w&&(0,F.jsxs)(`div`,{className:`semiont-assist-widget`,"data-assisting":r&&i?`true`:`false`,"data-type":`tag`,children:[!r&&!i&&(0,F.jsxs)(F.Fragment,{children:[g&&(0,F.jsx)(`p`,{className:`semiont-form__help`,"data-type":`tag-no-schemas`,children:f(`noSchemas`)}),!g&&(0,F.jsxs)(`div`,{className:`semiont-form-field`,children:[(0,F.jsx)(`label`,{className:`semiont-form-field__label`,children:f(`selectSchema`)}),(0,F.jsx)(`select`,{value:_,onChange:e=>A(e.target.value),className:`semiont-select`,children:h.map(e=>(0,F.jsx)(`option`,{value:e.id,children:e.name},e.id))}),k&&(0,F.jsx)(`p`,{className:`semiont-form__help`,children:k.description})]}),k&&(0,F.jsxs)(`div`,{className:`semiont-form-field`,children:[(0,F.jsx)(`label`,{className:`semiont-form-field__label`,children:f(`selectCategories`)}),(0,F.jsxs)(`div`,{style:{display:`flex`,gap:`0.5rem`,marginBottom:`0.75rem`},children:[(0,F.jsx)(`button`,{onClick:()=>{k&&b(new Set(k.tags.map(e=>e.name)))},type:`button`,className:`semiont-button--secondary`,style:{fontSize:`var(--semiont-text-xs)`,padding:`0.25rem 0.5rem`},children:f(`selectAll`)}),(0,F.jsx)(`button`,{onClick:()=>{b(new Set)},type:`button`,className:`semiont-button--secondary`,style:{fontSize:`var(--semiont-text-xs)`,padding:`0.25rem 0.5rem`},children:f(`deselectAll`)})]}),(0,F.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`0.75rem`},children:k.tags.map(e=>(0,F.jsxs)(`div`,{className:`semiont-form__checkbox-field`,children:[(0,F.jsx)(`input`,{type:`checkbox`,id:`category-${e.name.replace(/\s+/g,`-`)}`,checked:y.has(e.name),onChange:()=>j(e.name),className:`semiont-checkbox`}),(0,F.jsxs)(`label`,{htmlFor:`category-${e.name.replace(/\s+/g,`-`)}`,className:`semiont-form__checkbox-label`,style:{display:`flex`,flexDirection:`column`,gap:`0.25rem`},children:[(0,F.jsx)(`span`,{style:{fontWeight:500},children:e.name}),(0,F.jsx)(`span`,{style:{fontSize:`var(--semiont-text-xs)`,color:`var(--semiont-text-secondary)`},children:e.description})]})]},e.name))}),(0,F.jsx)(`p`,{className:`semiont-form__help`,children:f(`categoriesSelected`,{count:y.size})})]})]}),(0,F.jsxs)(`button`,{onClick:()=>{y.size>0&&(p?.client.mark.requestAssist(`tagging`,{schemaId:_,categories:Array.from(y),language:l,sourceLanguage:d}),b(new Set))},disabled:y.size===0||r,className:`semiont-button`,"data-variant":`assist`,"data-type":`tag`,children:[(0,F.jsx)(`span`,{className:`semiont-button-icon`,children:`✨`}),(0,F.jsx)(`span`,{children:f(`annotate`)})]}),r&&i&&(0,F.jsxs)(`div`,{className:`semiont-annotation-progress`,"data-type":`tag`,children:[i.requestParams&&i.requestParams.length>0&&(0,F.jsxs)(`div`,{className:`semiont-annotation-progress__params`,"data-type":`tag`,children:[(0,F.jsx)(`div`,{className:`semiont-annotation-progress__params-title`,children:`Request Parameters:`}),i.requestParams.map((e,t)=>(0,F.jsxs)(`div`,{className:`semiont-annotation-progress__param`,children:[(0,F.jsxs)(`span`,{className:`semiont-annotation-progress__param-label`,children:[e.label,`:`]}),` `,e.value]},t))]}),(0,F.jsxs)(`div`,{className:`semiont-annotation-progress__status`,children:[(0,F.jsxs)(`div`,{className:`semiont-annotation-progress__message`,children:[(0,F.jsx)(`span`,{className:`semiont-annotation-progress__icon`,children:`✨`}),(0,F.jsx)(`span`,{children:i.message})]}),i.currentCategory&&(0,F.jsxs)(`div`,{className:`semiont-annotation-progress__details`,children:[`Processing: `,i.currentCategory,i.processedCategories!==void 0&&i.totalCategories!==void 0&&(0,F.jsxs)(F.Fragment,{children:[` (`,i.processedCategories,`/`,i.totalCategories,`)`]})]})]}),i.percentage!==void 0&&(0,F.jsx)(`div`,{className:`semiont-progress-bar`,children:(0,F.jsx)(`div`,{className:`semiont-progress-bar__fill`,"data-type":`tag`,style:{width:`${i.percentage}%`}})})]})]})]}),(0,F.jsx)(`div`,{className:`semiont-panel__list`,children:D.length===0?(0,F.jsx)(`p`,{className:`semiont-panel__empty`,children:f(`noTags`)}):D.map(e=>(0,F.jsx)(UX,{tag:e,isFocused:e.id===x,isHovered:e.id===c,ref:t=>O(e.id,t)},e.id))})]})]})}var KX=[`statistics`,`reference`,`highlight`,`assessment`,`comment`,`tag`];function qX(e){let t=Lg(`UnifiedAnnotationsPanel`),n={highlight:[],comment:[],assessment:[],reference:[],tag:[]};for(let t of e.annotations){let r=Object.values(e.annotators).find(e=>e.matchesAnnotation(t));r&&(n[r.internalType]||(n[r.internalType]=[]),n[r.internalType].push(t))}let r=n,[i,a]=(0,u.useState)(()=>{if(typeof window>`u`)return e.initialTab||`statistics`;let t=e.resourceId?`annotations-tab-${e.resourceId}`:`annotations-tab-global`,n=localStorage.getItem(t);return n&&KX.includes(n)?n:e.initialTab||`statistics`});(0,u.useEffect)(()=>{if(typeof window>`u`)return;let t=e.resourceId?`annotations-tab-${e.resourceId}`:`annotations-tab-global`;localStorage.setItem(t,i)},[i,e.resourceId]),(0,u.useEffect)(()=>{e.initialTab&&e.initialTabGeneration!==void 0&&a(e.initialTab)},[e.initialTabGeneration]),(0,u.useEffect)(()=>{if(e.pendingAnnotation){let t={linking:`reference`,commenting:`comment`,tagging:`tag`,assessing:`assessment`,highlighting:`highlight`}[e.pendingAnnotation.motivation];t&&a(t)}},[e.pendingAnnotation]);let o=e=>{a(e)},s=e=>`semiont-unified-panel__tab-button${i===e?` semiont-unified-panel__tab-button--active`:``}`;return(0,F.jsxs)(`div`,{className:`semiont-unified-panel`,children:[(0,F.jsx)(`h3`,{className:`semiont-unified-panel__title`,children:t(`title`)}),(0,F.jsx)(`div`,{className:`semiont-unified-panel__tabs`,children:KX.map(n=>{if(n===`statistics`)return(0,F.jsx)(`button`,{onClick:()=>o(n),className:s(n),title:t(n),"aria-pressed":i===n,children:(0,F.jsx)(`span`,{className:`semiont-unified-panel__tab-icon`,children:`📊`})},n);let r=e.annotators[n];return r?(0,F.jsx)(`button`,{onClick:()=>o(n),className:s(n),title:t(n),"aria-pressed":i===n,children:(0,F.jsx)(`span`,{className:`semiont-unified-panel__tab-icon`,children:r.iconEmoji})},n):null})}),(0,F.jsx)(`div`,{className:`semiont-unified-panel__content`,children:(()=>{if(i===`statistics`)return(0,F.jsx)(HX,{highlights:r.highlight||[],comments:r.comment||[],assessments:r.assessment||[],references:r.reference||[],tags:r.tag||[]});let t=e.annotators[i];if(!t)return null;let n=r[i]||[],a=e.assistingMotivation===t.motivation,o=a?e.progress??null:null,s={resourceId:e.resourceId,annotations:n,pendingAnnotation:e.pendingAnnotation,isAssisting:a,progress:o,annotateMode:e.annotateMode,locale:e.locale,sourceLanguage:e.sourceLanguage,scrollToAnnotationId:e.scrollToAnnotationId,onScrollCompleted:e.onScrollCompleted,hoveredAnnotationId:e.hoveredAnnotationId};return i===`highlight`?(0,F.jsx)(jX,{...s}):i===`reference`?(0,F.jsx)(BX,{resourceId:s.resourceId,annotations:s.annotations,pendingAnnotation:s.pendingAnnotation,isAssisting:s.isAssisting,progress:s.progress,annotateMode:s.annotateMode,scrollToAnnotationId:s.scrollToAnnotationId,onScrollCompleted:s.onScrollCompleted,hoveredAnnotationId:s.hoveredAnnotationId,locale:s.locale,sourceLanguage:s.sourceLanguage,allEntityTypes:e.allEntityTypes||[],generatingReferenceId:e.generatingReferenceId,referencedBy:e.referencedBy,referencedByLoading:e.referencedByLoading,Link:e.Link,routes:e.routes}):i===`assessment`?(0,F.jsx)(CX,{...s}):i===`comment`?(0,F.jsx)(OX,{...s}):i===`tag`?(0,F.jsx)(GX,{...s}):null})()})]})}function JX({Link:e,routes:t,t:n,CookiePreferences:r,onOpenKeyboardHelp:i,sourceCodeUrl:a=`https://github.com/The-AI-Alliance/semiont`,showPolicyLinks:o=!0}){let[s,c]=(0,u.useState)(!1);return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`footer`,{role:`contentinfo`,className:`semiont-footer`,children:(0,F.jsx)(`div`,{className:`semiont-footer__container`,children:(0,F.jsxs)(`div`,{className:`semiont-footer__content`,children:[(0,F.jsx)(`div`,{className:`semiont-footer__copyright`,children:n(`copyright`,{year:new Date().getFullYear()})}),(0,F.jsxs)(`div`,{className:`semiont-footer__links`,children:[o&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(e,{href:t.about?.()||`/about`,className:`semiont-footer__link`,children:n(`about`)}),(0,F.jsx)(e,{href:t.privacy?.()||`/privacy`,className:`semiont-footer__link`,children:n(`privacyPolicy`)}),r&&(0,F.jsx)(`button`,{onClick:()=>c(!0),className:`semiont-footer__link`,children:n(`cookiePreferences`)}),(0,F.jsx)(e,{href:t.terms?.()||`/terms`,className:`semiont-footer__link`,children:n(`termsOfService`)})]}),i&&(0,F.jsxs)(`button`,{onClick:i,className:`semiont-footer__link semiont-footer__link--keyboard`,children:[n(`keyboardShortcuts`),(0,F.jsx)(`kbd`,{className:`semiont-footer__kbd`,children:`?`})]}),(0,F.jsx)(`a`,{href:a,target:`_blank`,rel:`noopener noreferrer`,className:`semiont-footer__link`,children:n(`sourceCode`)})]})]})})}),o&&r&&(0,F.jsx)(r,{isOpen:s,onClose:()=>c(!1)})]})}function YX({Link:e,routes:t,t:n,isAdmin:r=!1,isModerator:i=!1,onItemClick:a,className:o=``,currentPath:s}){let c=o?`semiont-navigation-menu ${o}`:`semiont-navigation-menu`,l=e=>s?s===e||s.startsWith(e+`/`):!1;return(0,F.jsxs)(`nav`,{className:c,"aria-label":`Main navigation`,children:[(0,F.jsx)(e,{href:t.knowledge?.()||`/know`,...a&&{onClick:a},className:`semiont-navigation-menu__link`,"aria-current":l(t.knowledge?.()||`/know`)?`page`:void 0,children:n(`know`)}),(i||r)&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`hr`,{className:`semiont-navigation-menu__divider`}),(0,F.jsx)(e,{href:t.moderate?.()||`/moderate`,...a&&{onClick:a},className:`semiont-navigation-menu__link`,"aria-current":l(t.moderate?.()||`/moderate`)?`page`:void 0,children:n(`moderate`)})]}),r&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`hr`,{className:`semiont-navigation-menu__divider`}),(0,F.jsx)(e,{href:t.admin?.()||`/admin`,...a&&{onClick:a},className:`semiont-navigation-menu__link`,"aria-current":l(t.admin?.()||`/admin`)?`page`:void 0,children:n(`administer`)})]})]})}function XX({title:e,items:t,currentPath:n,LinkComponent:r,dropdownContent:i,isCollapsed:a,icons:o,collapseSidebarLabel:s,expandSidebarLabel:c}){let l=o.chevronLeft,d=o.bars,[f,p]=(0,u.useState)(!1),m=(0,u.useRef)(null),h=kg(),g=()=>p(!f),_=()=>p(!1);return(0,u.useEffect)(()=>{let e=e=>{m.current&&!m.current.contains(e.target)&&_()};if(f)return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[f]),(0,F.jsxs)(`div`,{className:`semiont-simple-nav`,children:[(0,F.jsxs)(`div`,{style:{position:`relative`},ref:i?m:void 0,children:[(0,F.jsxs)(`div`,{className:`semiont-nav-section__header`,children:[i?(0,F.jsx)(`button`,{onClick:g,className:`semiont-nav-section__header-button`,"aria-expanded":f,"aria-haspopup":`true`,type:`button`,children:!a&&(0,F.jsx)(`span`,{className:`semiont-nav-section__header-text`,children:e})}):!a&&(0,F.jsx)(`span`,{className:`semiont-nav-section__header-text`,children:e}),(0,F.jsx)(`button`,{onClick:()=>h.emit(`shell:sidebar-toggle`,void 0),className:`semiont-nav-section__header-icon`,title:a?c:s,"aria-label":a?c:s,type:`button`,children:a?(0,F.jsx)(d,{}):(0,F.jsx)(l,{})})]}),f&&i&&!a&&(0,F.jsx)(`div`,{className:`semiont-nav-section__dropdown`,children:i(_)})]}),!a&&(0,F.jsx)(`nav`,{className:`semiont-nav-tabs`,children:t.map(e=>{let t=n===e.href;return(0,F.jsxs)(r,{href:e.href,className:`semiont-nav-tab ${t?`semiont-nav-tab--active`:``}`,title:e.description||e.name,"aria-current":t?`page`:void 0,children:[(0,F.jsx)(e.icon,{className:`semiont-nav-tab__icon`,"aria-hidden":`true`}),(0,F.jsx)(`span`,{className:`semiont-nav-tab__text`,children:e.name})]},e.href)})}),a&&(0,F.jsx)(`nav`,{className:`semiont-nav-tabs`,children:t.map(e=>{let t=n===e.href;return(0,F.jsx)(r,{href:e.href,className:`semiont-nav-tab ${t?`semiont-nav-tab--active`:``}`,title:e.description||e.name,"aria-current":t?`page`:void 0,"aria-label":e.name,children:(0,F.jsx)(e.icon,{className:`semiont-nav-tab__icon`,"aria-hidden":`true`})},e.href)})})]})}function ZX(){var e=[...arguments];return(0,u.useMemo)(()=>t=>{e.forEach(e=>e(t))},e)}var QX=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function $X(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function eZ(e){return`nodeType`in e}function tZ(e){return e?$X(e)?e:eZ(e)?e.ownerDocument?.defaultView??window:window:window}function nZ(e){let{Document:t}=tZ(e);return e instanceof t}function rZ(e){return $X(e)?!1:e instanceof tZ(e).HTMLElement}function iZ(e){return e instanceof tZ(e).SVGElement}function aZ(e){return e?$X(e)?e.document:eZ(e)?nZ(e)?e:rZ(e)||iZ(e)?e.ownerDocument:document:document:document}var oZ=QX?u.useLayoutEffect:u.useEffect;function sZ(e){let t=(0,u.useRef)(e);return oZ(()=>{t.current=e}),(0,u.useCallback)(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function cZ(){let e=(0,u.useRef)(null);return[(0,u.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,u.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}function lZ(e,t){t===void 0&&(t=[e]);let n=(0,u.useRef)(e);return oZ(()=>{n.current!==e&&(n.current=e)},t),n}function uZ(e,t){let n=(0,u.useRef)();return(0,u.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function dZ(e){let t=sZ(e),n=(0,u.useRef)(null);return[n,(0,u.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}function fZ(e){let t=(0,u.useRef)();return(0,u.useEffect)(()=>{t.current=e},[e]),t.current}var pZ={};function mZ(e,t){return(0,u.useMemo)(()=>{if(t)return t;let n=pZ[e]==null?0:pZ[e]+1;return pZ[e]=n,e+`-`+n},[e,t])}function hZ(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>{let r=Object.entries(n);for(let[n,i]of r){let r=t[n];r!=null&&(t[n]=r+e*i)}return t},{...t})}}var gZ=hZ(1),_Z=hZ(-1);function vZ(e){return`clientX`in e&&`clientY`in e}function yZ(e){if(!e)return!1;let{KeyboardEvent:t}=tZ(e.target);return t&&e instanceof t}function bZ(e){if(!e)return!1;let{TouchEvent:t}=tZ(e.target);return t&&e instanceof t}function xZ(e){if(bZ(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return vZ(e)?{x:e.clientX,y:e.clientY}:null}var SZ=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:n}=e;return`translate3d(`+(t?Math.round(t):0)+`px, `+(n?Math.round(n):0)+`px, 0)`}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:n}=e;return`scaleX(`+t+`) scaleY(`+n+`)`}},Transform:{toString(e){if(e)return[SZ.Translate.toString(e),SZ.Scale.toString(e)].join(` `)}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+` `+n+`ms `+r}}}),CZ=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`;function wZ(e){return e.matches(CZ)?e:e.querySelector(CZ)}var TZ={display:`none`};function EZ(e){let{id:t,value:n}=e;return u.createElement(`div`,{id:t,style:TZ},n)}function DZ(e){let{id:t,announcement:n,ariaLiveType:r=`assertive`}=e;return u.createElement(`div`,{id:t,style:{position:`fixed`,top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0 0 0 0)`,clipPath:`inset(100%)`,whiteSpace:`nowrap`},role:`status`,"aria-live":r,"aria-atomic":!0},n)}function OZ(){let[e,t]=(0,u.useState)(``);return{announce:(0,u.useCallback)(e=>{e!=null&&t(e)},[]),announcement:e}}var kZ=(0,u.createContext)(null);function AZ(e){let t=(0,u.useContext)(kZ);(0,u.useEffect)(()=>{if(!t)throw Error(`useDndMonitor must be used within a children of <DndContext>`);return t(e)},[e,t])}function jZ(){let[e]=(0,u.useState)(()=>new Set),t=(0,u.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,u.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>e[n]?.call(e,r))},[e]),t]}var MZ={draggable:`
|
|
136
|
+
To pick up a draggable item, press the space bar.
|
|
137
|
+
While dragging, use the arrow keys to move the item.
|
|
138
|
+
Press space again to drop the item in its new position, or press escape to cancel.
|
|
139
|
+
`},NZ={onDragStart(e){let{active:t}=e;return`Picked up draggable item `+t.id+`.`},onDragOver(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was moved over droppable area `+n.id+`.`:`Draggable item `+t.id+` is no longer over a droppable area.`},onDragEnd(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was dropped over droppable area `+n.id:`Draggable item `+t.id+` was dropped.`},onDragCancel(e){let{active:t}=e;return`Dragging was cancelled. Draggable item `+t.id+` was dropped.`}};function PZ(e){let{announcements:t=NZ,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=MZ}=e,{announce:a,announcement:o}=OZ(),s=mZ(`DndLiveRegion`),[c,l]=(0,u.useState)(!1);if((0,u.useEffect)(()=>{l(!0)},[]),AZ((0,u.useMemo)(()=>({onDragStart(e){let{active:n}=e;a(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&a(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;a(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;a(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;a(t.onDragCancel({active:n,over:r}))}}),[a,t])),!c)return null;let d=u.createElement(u.Fragment,null,u.createElement(EZ,{id:r,value:i.draggable}),u.createElement(DZ,{id:s,announcement:o}));return n?(0,xf.createPortal)(d,n):d}var FZ;(function(e){e.DragStart=`dragStart`,e.DragMove=`dragMove`,e.DragEnd=`dragEnd`,e.DragCancel=`dragCancel`,e.DragOver=`dragOver`,e.RegisterDroppable=`registerDroppable`,e.SetDroppableDisabled=`setDroppableDisabled`,e.UnregisterDroppable=`unregisterDroppable`})(FZ||={});function IZ(){}function LZ(e,t){return(0,u.useMemo)(()=>({sensor:e,options:t??{}}),[e,t])}function RZ(){var e=[...arguments];return(0,u.useMemo)(()=>[...e].filter(e=>e!=null),[...e])}var zZ=Object.freeze({x:0,y:0});function BZ(e,t){return Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2)}function VZ(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function HZ(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function UZ(e){let{left:t,top:n,height:r,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+r},{x:t+i,y:n+r}]}function WZ(e,t){if(!e||e.length===0)return null;let[n]=e;return t?n[t]:n}function GZ(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}var KZ=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=GZ(t,t.left,t.top),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=BZ(GZ(r),i);a.push({id:t,data:{droppableContainer:e,value:n}})}}return a.sort(VZ)},qZ=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=UZ(t),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=UZ(r),o=i.reduce((e,t,r)=>e+BZ(n[r],t),0),s=Number((o/4).toFixed(4));a.push({id:t,data:{droppableContainer:e,value:s}})}}return a.sort(VZ)};function JZ(e,t){let n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),o=i-r,s=a-n;if(r<i&&n<a){let n=t.width*t.height,r=e.width*e.height,i=o*s,a=i/(n+r-i);return Number(a.toFixed(4))}return 0}var YZ=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=[];for(let e of r){let{id:r}=e,a=n.get(r);if(a){let n=JZ(a,t);n>0&&i.push({id:r,data:{droppableContainer:e,value:n}})}}return i.sort(HZ)};function XZ(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function ZZ(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:zZ}function QZ(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}var $Z=QZ(1);function eQ(e){if(e.startsWith(`matrix3d(`)){let t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith(`matrix(`)){let t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function tQ(e,t,n){let r=eQ(t);if(!r)return e;let{scaleX:i,scaleY:a,x:o,y:s}=r,c=e.left-o-(1-i)*parseFloat(n),l=e.top-s-(1-a)*parseFloat(n.slice(n.indexOf(` `)+1)),u=i?e.width/i:e.width,d=a?e.height/a:e.height;return{width:u,height:d,top:l,right:c+u,bottom:l+d,left:c}}var nQ={ignoreTransform:!1};function rQ(e,t){t===void 0&&(t=nQ);let n=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:t,transformOrigin:r}=tZ(e).getComputedStyle(e);t&&(n=tQ(n,t,r))}let{top:r,left:i,width:a,height:o,bottom:s,right:c}=n;return{top:r,left:i,width:a,height:o,bottom:s,right:c}}function iQ(e){return rQ(e,{ignoreTransform:!0})}function aQ(e){let t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function oQ(e,t){return t===void 0&&(t=tZ(e).getComputedStyle(e)),t.position===`fixed`}function sQ(e,t){t===void 0&&(t=tZ(e).getComputedStyle(e));let n=/(auto|scroll|overlay)/;return[`overflow`,`overflowX`,`overflowY`].some(e=>{let r=t[e];return typeof r==`string`?n.test(r):!1})}function cQ(e,t){let n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(nZ(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!rZ(i)||iZ(i)||n.includes(i))return n;let a=tZ(e).getComputedStyle(i);return i!==e&&sQ(i,a)&&n.push(i),oQ(i,a)?n:r(i.parentNode)}return e?r(e):n}function lQ(e){let[t]=cQ(e,1);return t??null}function uQ(e){return!QX||!e?null:$X(e)?e:eZ(e)?nZ(e)||e===aZ(e).scrollingElement?window:rZ(e)?e:null:null}function dQ(e){return $X(e)?e.scrollX:e.scrollLeft}function fQ(e){return $X(e)?e.scrollY:e.scrollTop}function pQ(e){return{x:dQ(e),y:fQ(e)}}var mQ;(function(e){e[e.Forward=1]=`Forward`,e[e.Backward=-1]=`Backward`})(mQ||={});function hQ(e){return!QX||!e?!1:e===document.scrollingElement}function gQ(e){let t={x:0,y:0},n=hQ(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}var _Q={x:.2,y:.2};function vQ(e,t,n,r,i){let{top:a,left:o,right:s,bottom:c}=n;r===void 0&&(r=10),i===void 0&&(i=_Q);let{isTop:l,isBottom:u,isLeft:d,isRight:f}=gQ(e),p={x:0,y:0},m={x:0,y:0},h={height:t.height*i.y,width:t.width*i.x};return!l&&a<=t.top+h.height?(p.y=mQ.Backward,m.y=r*Math.abs((t.top+h.height-a)/h.height)):!u&&c>=t.bottom-h.height&&(p.y=mQ.Forward,m.y=r*Math.abs((t.bottom-h.height-c)/h.height)),!f&&s>=t.right-h.width?(p.x=mQ.Forward,m.x=r*Math.abs((t.right-h.width-s)/h.width)):!d&&o<=t.left+h.width&&(p.x=mQ.Backward,m.x=r*Math.abs((t.left+h.width-o)/h.width)),{direction:p,speed:m}}function yQ(e){if(e===document.scrollingElement){let{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}let{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function bQ(e){return e.reduce((e,t)=>gZ(e,pQ(t)),zZ)}function xQ(e){return e.reduce((e,t)=>e+dQ(t),0)}function SQ(e){return e.reduce((e,t)=>e+fQ(t),0)}function CQ(e,t){if(t===void 0&&(t=rQ),!e)return;let{top:n,left:r,bottom:i,right:a}=t(e);lQ(e)&&(i<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:`center`,inline:`center`})}var wQ=[[`x`,[`left`,`right`],xQ],[`y`,[`top`,`bottom`],SQ]],TQ=class{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;let n=cQ(t),r=bQ(n);this.rect={...e},this.width=e.width,this.height=e.height;for(let[e,t,i]of wQ)for(let a of t)Object.defineProperty(this,a,{get:()=>{let t=i(n),o=r[e]-t;return this.rect[a]+o},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}},EQ=class{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>this.target?.removeEventListener(...e))},this.target=e}add(e,t,n){var r;(r=this.target)==null||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}};function DQ(e){let{EventTarget:t}=tZ(e);return e instanceof t?e:aZ(e)}function OQ(e,t){let n=Math.abs(e.x),r=Math.abs(e.y);return typeof t==`number`?Math.sqrt(n**2+r**2)>t:`x`in t&&`y`in t?n>t.x&&r>t.y:`x`in t?n>t.x:`y`in t?r>t.y:!1}var kQ;(function(e){e.Click=`click`,e.DragStart=`dragstart`,e.Keydown=`keydown`,e.ContextMenu=`contextmenu`,e.Resize=`resize`,e.SelectionChange=`selectionchange`,e.VisibilityChange=`visibilitychange`})(kQ||={});function AQ(e){e.preventDefault()}function jQ(e){e.stopPropagation()}var MQ;(function(e){e.Space=`Space`,e.Down=`ArrowDown`,e.Right=`ArrowRight`,e.Left=`ArrowLeft`,e.Up=`ArrowUp`,e.Esc=`Escape`,e.Enter=`Enter`,e.Tab=`Tab`})(MQ||={});var NQ={start:[MQ.Space,MQ.Enter],cancel:[MQ.Esc],end:[MQ.Space,MQ.Enter,MQ.Tab]},PQ=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case MQ.Right:return{...n,x:n.x+25};case MQ.Left:return{...n,x:n.x-25};case MQ.Down:return{...n,y:n.y+25};case MQ.Up:return{...n,y:n.y-25}}},FQ=class{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;let{event:{target:t}}=e;this.props=e,this.listeners=new EQ(aZ(t)),this.windowListeners=new EQ(tZ(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(kQ.Resize,this.handleCancel),this.windowListeners.add(kQ.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(kQ.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&CQ(n),t(zZ)}handleKeyDown(e){if(yZ(e)){let{active:t,context:n,options:r}=this.props,{keyboardCodes:i=NQ,coordinateGetter:a=PQ,scrollBehavior:o=`smooth`}=r,{code:s}=e;if(i.end.includes(s)){this.handleEnd(e);return}if(i.cancel.includes(s)){this.handleCancel(e);return}let{collisionRect:c}=n.current,l=c?{x:c.left,y:c.top}:zZ;this.referenceCoordinates||=l;let u=a(e,{active:t,context:n.current,currentCoordinates:l});if(u){let t=_Z(u,l),r={x:0,y:0},{scrollableAncestors:i}=n.current;for(let n of i){let i=e.code,{isTop:a,isRight:s,isLeft:c,isBottom:l,maxScroll:d,minScroll:f}=gQ(n),p=yQ(n),m={x:Math.min(i===MQ.Right?p.right-p.width/2:p.right,Math.max(i===MQ.Right?p.left:p.left+p.width/2,u.x)),y:Math.min(i===MQ.Down?p.bottom-p.height/2:p.bottom,Math.max(i===MQ.Down?p.top:p.top+p.height/2,u.y))},h=i===MQ.Right&&!s||i===MQ.Left&&!c,g=i===MQ.Down&&!l||i===MQ.Up&&!a;if(h&&m.x!==u.x){let e=n.scrollLeft+t.x,a=i===MQ.Right&&e<=d.x||i===MQ.Left&&e>=f.x;if(a&&!t.y){n.scrollTo({left:e,behavior:o});return}a?r.x=n.scrollLeft-e:r.x=i===MQ.Right?n.scrollLeft-d.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:o});break}else if(g&&m.y!==u.y){let e=n.scrollTop+t.y,a=i===MQ.Down&&e<=d.y||i===MQ.Up&&e>=f.y;if(a&&!t.x){n.scrollTo({top:e,behavior:o});return}a?r.y=n.scrollTop-e:r.y=i===MQ.Down?n.scrollTop-d.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:o});break}}this.handleMove(e,gZ(_Z(u,this.referenceCoordinates),r))}}}handleMove(e,t){let{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){let{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){let{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}};FQ.activators=[{eventName:`onKeyDown`,handler:(e,t,n)=>{let{keyboardCodes:r=NQ,onActivation:i}=t,{active:a}=n,{code:o}=e.nativeEvent;if(r.start.includes(o)){let t=a.activatorNode.current;return t&&e.target!==t?!1:(e.preventDefault(),i?.({event:e.nativeEvent}),!0)}return!1}}];function IQ(e){return!!(e&&`distance`in e)}function LQ(e){return!!(e&&`delay`in e)}var RQ=class{constructor(e,t,n){n===void 0&&(n=DQ(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;let{event:r}=e,{target:i}=r;this.props=e,this.events=t,this.document=aZ(i),this.documentListeners=new EQ(this.document),this.listeners=new EQ(n),this.windowListeners=new EQ(tZ(i)),this.initialCoordinates=xZ(r)??zZ,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(kQ.Resize,this.handleCancel),this.windowListeners.add(kQ.DragStart,AQ),this.windowListeners.add(kQ.VisibilityChange,this.handleCancel),this.windowListeners.add(kQ.ContextMenu,AQ),this.documentListeners.add(kQ.Keydown,this.handleKeydown),t){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(LQ(t)){this.timeoutId=setTimeout(this.handleStart,t.delay),this.handlePending(t);return}if(IQ(t)){this.handlePending(t);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){let{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){let{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(kQ.Click,jQ,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(kQ.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){let{activated:t,initialCoordinates:n,props:r}=this,{onMove:i,options:{activationConstraint:a}}=r;if(!n)return;let o=xZ(e)??zZ,s=_Z(n,o);if(!t&&a){if(IQ(a)){if(a.tolerance!=null&&OQ(s,a.tolerance))return this.handleCancel();if(OQ(s,a.distance))return this.handleStart()}if(LQ(a)&&OQ(s,a.tolerance))return this.handleCancel();this.handlePending(a,s);return}e.cancelable&&e.preventDefault(),i(o)}handleEnd(){let{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){let{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===MQ.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}},zQ={cancel:{name:`pointercancel`},move:{name:`pointermove`},end:{name:`pointerup`}},BQ=class extends RQ{constructor(e){let{event:t}=e,n=aZ(t.target);super(e,zQ,n)}};BQ.activators=[{eventName:`onPointerDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];var VQ={move:{name:`mousemove`},end:{name:`mouseup`}},HQ;(function(e){e[e.RightClick=2]=`RightClick`})(HQ||={});var UQ=class extends RQ{constructor(e){super(e,VQ,aZ(e.event.target))}};UQ.activators=[{eventName:`onMouseDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===HQ.RightClick?!1:(r?.({event:n}),!0)}}];var WQ={cancel:{name:`touchcancel`},move:{name:`touchmove`},end:{name:`touchend`}},GQ=class extends RQ{constructor(e){super(e,WQ)}static setup(){return window.addEventListener(WQ.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(WQ.move.name,e)};function e(){}}};GQ.activators=[{eventName:`onTouchStart`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t,{touches:i}=n;return i.length>1?!1:(r?.({event:n}),!0)}}];var KQ;(function(e){e[e.Pointer=0]=`Pointer`,e[e.DraggableRect=1]=`DraggableRect`})(KQ||={});var qQ;(function(e){e[e.TreeOrder=0]=`TreeOrder`,e[e.ReversedTreeOrder=1]=`ReversedTreeOrder`})(qQ||={});function JQ(e){let{acceleration:t,activator:n=KQ.Pointer,canScroll:r,draggingRect:i,enabled:a,interval:o=5,order:s=qQ.TreeOrder,pointerCoordinates:c,scrollableAncestors:l,scrollableAncestorRects:d,delta:f,threshold:p}=e,m=XQ({delta:f,disabled:!a}),[h,g]=cZ(),_=(0,u.useRef)({x:0,y:0}),v=(0,u.useRef)({x:0,y:0}),y=(0,u.useMemo)(()=>{switch(n){case KQ.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case KQ.DraggableRect:return i}},[n,i,c]),b=(0,u.useRef)(null),x=(0,u.useCallback)(()=>{let e=b.current;if(!e)return;let t=_.current.x*v.current.x,n=_.current.y*v.current.y;e.scrollBy(t,n)},[]),S=(0,u.useMemo)(()=>s===qQ.TreeOrder?[...l].reverse():l,[s,l]);(0,u.useEffect)(()=>{if(!a||!l.length||!y){g();return}for(let e of S){if(r?.(e)===!1)continue;let n=d[l.indexOf(e)];if(!n)continue;let{direction:i,speed:a}=vQ(e,n,y,t,p);for(let e of[`x`,`y`])m[e][i[e]]||(a[e]=0,i[e]=0);if(a.x>0||a.y>0){g(),b.current=e,h(x,o),_.current=a,v.current=i;return}}_.current={x:0,y:0},v.current={x:0,y:0},g()},[t,x,r,g,a,o,JSON.stringify(y),JSON.stringify(m),h,l,S,d,JSON.stringify(p)])}var YQ={x:{[mQ.Backward]:!1,[mQ.Forward]:!1},y:{[mQ.Backward]:!1,[mQ.Forward]:!1}};function XQ(e){let{delta:t,disabled:n}=e,r=fZ(t);return uZ(e=>{if(n||!r||!e)return YQ;let i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[mQ.Backward]:e.x[mQ.Backward]||i.x===-1,[mQ.Forward]:e.x[mQ.Forward]||i.x===1},y:{[mQ.Backward]:e.y[mQ.Backward]||i.y===-1,[mQ.Forward]:e.y[mQ.Forward]||i.y===1}}},[n,t,r])}function ZQ(e,t){let n=t==null?void 0:e.get(t),r=n?n.node.current:null;return uZ(e=>t==null?null:r??e??null,[r,t])}function QQ(e,t){return(0,u.useMemo)(()=>e.reduce((e,n)=>{let{sensor:r}=n,i=r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}));return[...e,...i]},[]),[e,t])}var $Q;(function(e){e[e.Always=0]=`Always`,e[e.BeforeDragging=1]=`BeforeDragging`,e[e.WhileDragging=2]=`WhileDragging`})($Q||={});var e$;(function(e){e.Optimized=`optimized`})(e$||={});var t$=new Map;function n$(e,t){let{dragging:n,dependencies:r,config:i}=t,[a,o]=(0,u.useState)(null),{frequency:s,measure:c,strategy:l}=i,d=(0,u.useRef)(e),f=_(),p=lZ(f),m=(0,u.useCallback)(function(e){e===void 0&&(e=[]),!p.current&&o(t=>t===null?e:t.concat(e.filter(e=>!t.includes(e))))},[p]),h=(0,u.useRef)(null),g=uZ(t=>{if(f&&!n)return t$;if(!t||t===t$||d.current!==e||a!=null){let t=new Map;for(let n of e){if(!n)continue;if(a&&a.length>0&&!a.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}let e=n.node.current,r=e?new TQ(c(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,a,n,f,c]);return(0,u.useEffect)(()=>{d.current=e},[e]),(0,u.useEffect)(()=>{f||m()},[n,f]),(0,u.useEffect)(()=>{a&&a.length>0&&o(null)},[JSON.stringify(a)]),(0,u.useEffect)(()=>{f||typeof s!=`number`||h.current!==null||(h.current=setTimeout(()=>{m(),h.current=null},s))},[s,f,m,...r]),{droppableRects:g,measureDroppableContainers:m,measuringScheduled:a!=null};function _(){switch(l){case $Q.Always:return!1;case $Q.BeforeDragging:return n;default:return!n}}}function r$(e,t){return uZ(n=>e?n||(typeof t==`function`?t(e):e):null,[t,e])}function i$(e,t){return r$(e,t)}function a$(e){let{callback:t,disabled:n}=e,r=sZ(t),i=(0,u.useMemo)(()=>{if(n||typeof window>`u`||window.MutationObserver===void 0)return;let{MutationObserver:e}=window;return new e(r)},[r,n]);return(0,u.useEffect)(()=>()=>i?.disconnect(),[i]),i}function o$(e){let{callback:t,disabled:n}=e,r=sZ(t),i=(0,u.useMemo)(()=>{if(n||typeof window>`u`||window.ResizeObserver===void 0)return;let{ResizeObserver:e}=window;return new e(r)},[n]);return(0,u.useEffect)(()=>()=>i?.disconnect(),[i]),i}function s$(e){return new TQ(rQ(e),e)}function c$(e,t,n){t===void 0&&(t=s$);let[r,i]=(0,u.useState)(null);function a(){i(r=>{if(!e)return null;if(e.isConnected===!1)return r??n??null;let i=t(e);return JSON.stringify(r)===JSON.stringify(i)?r:i})}let o=a$({callback(t){if(e)for(let n of t){let{type:t,target:r}=n;if(t===`childList`&&r instanceof HTMLElement&&r.contains(e)){a();break}}}}),s=o$({callback:a});return oZ(()=>{a(),e?(s?.observe(e),o?.observe(document.body,{childList:!0,subtree:!0})):(s?.disconnect(),o?.disconnect())},[e]),r}function l$(e){return ZZ(e,r$(e))}var u$=[];function d$(e){let t=(0,u.useRef)(e),n=uZ(n=>e?n&&n!==u$&&e&&t.current&&e.parentNode===t.current.parentNode?n:cQ(e):u$,[e]);return(0,u.useEffect)(()=>{t.current=e},[e]),n}function f$(e){let[t,n]=(0,u.useState)(null),r=(0,u.useRef)(e),i=(0,u.useCallback)(e=>{let t=uQ(e.target);t&&n(e=>e?(e.set(t,pQ(t)),new Map(e)):null)},[]);return(0,u.useEffect)(()=>{let t=r.current;if(e!==t){a(t);let o=e.map(e=>{let t=uQ(e);return t?(t.addEventListener(`scroll`,i,{passive:!0}),[t,pQ(t)]):null}).filter(e=>e!=null);n(o.length?new Map(o):null),r.current=e}return()=>{a(e),a(t)};function a(e){e.forEach(e=>{uQ(e)?.removeEventListener(`scroll`,i)})}},[i,e]),(0,u.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>gZ(e,t),zZ):bQ(e):zZ,[e,t])}function p$(e,t){t===void 0&&(t=[]);let n=(0,u.useRef)(null);return(0,u.useEffect)(()=>{n.current=null},t),(0,u.useEffect)(()=>{let t=e!==zZ;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?_Z(e,n.current):zZ}function m$(e){(0,u.useEffect)(()=>{if(!QX)return;let t=e.map(e=>{let{sensor:t}=e;return t.setup==null?void 0:t.setup()});return()=>{for(let e of t)e?.()}},e.map(e=>{let{sensor:t}=e;return t}))}function h$(e,t){return(0,u.useMemo)(()=>e.reduce((e,n)=>{let{eventName:r,handler:i}=n;return e[r]=e=>{i(e,t)},e},{}),[e,t])}function g$(e){return(0,u.useMemo)(()=>e?aQ(e):null,[e])}var _$=[];function v$(e,t){t===void 0&&(t=rQ);let[n]=e,r=g$(n?tZ(n):null),[i,a]=(0,u.useState)(_$);function o(){a(()=>e.length?e.map(e=>hQ(e)?r:new TQ(t(e),e)):_$)}let s=o$({callback:o});return oZ(()=>{s?.disconnect(),o(),e.forEach(e=>s?.observe(e))},[e]),i}function y$(e){if(!e)return null;if(e.children.length>1)return e;let t=e.children[0];return rZ(t)?t:e}function b$(e){let{measure:t}=e,[n,r]=(0,u.useState)(null),i=o$({callback:(0,u.useCallback)(e=>{for(let{target:n}of e)if(rZ(n)){r(e=>{let r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),[a,o]=dZ((0,u.useCallback)(e=>{let n=y$(e);i?.disconnect(),n&&i?.observe(n),r(n?t(n):null)},[t,i]));return(0,u.useMemo)(()=>({nodeRef:a,rect:n,setRef:o}),[n,a,o])}var x$=[{sensor:BQ,options:{}},{sensor:FQ,options:{}}],S$={current:{}},C$={draggable:{measure:iQ},droppable:{measure:iQ,strategy:$Q.WhileDragging,frequency:e$.Optimized},dragOverlay:{measure:rQ}},w$=class extends Map{get(e){return e==null?void 0:super.get(e)??void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){return this.get(e)?.node.current??void 0}},T$={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new w$,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:IZ},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:C$,measureDroppableContainers:IZ,windowRect:null,measuringScheduled:!1},E$=(0,u.createContext)({activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:``},dispatch:IZ,draggableNodes:new Map,over:null,measureDroppableContainers:IZ}),D$=(0,u.createContext)(T$);function O$(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new w$}}}function k$(e,t){switch(t.type){case FZ.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case FZ.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case FZ.DragEnd:case FZ.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case FZ.RegisterDroppable:{let{element:n}=t,{id:r}=n,i=new w$(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case FZ.SetDroppableDisabled:{let{id:n,key:r,disabled:i}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;let o=new w$(e.droppable.containers);return o.set(n,{...a,disabled:i}),{...e,droppable:{...e.droppable,containers:o}}}case FZ.UnregisterDroppable:{let{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;let a=new w$(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function A$(e){let{disabled:t}=e,{active:n,activatorEvent:r,draggableNodes:i}=(0,u.useContext)(E$),a=fZ(r),o=fZ(n?.id);return(0,u.useEffect)(()=>{if(!t&&!r&&a&&o!=null){if(!yZ(a)||document.activeElement===a.target)return;let e=i.get(o);if(!e)return;let{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(let e of[t.current,n.current]){if(!e)continue;let t=wZ(e);if(t){t.focus();break}}})}},[r,t,i,o,a]),null}function j$(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}function M$(e){return(0,u.useMemo)(()=>({draggable:{...C$.draggable,...e?.draggable},droppable:{...C$.droppable,...e?.droppable},dragOverlay:{...C$.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function N$(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e,a=(0,u.useRef)(!1),{x:o,y:s}=typeof i==`boolean`?{x:i,y:i}:i;oZ(()=>{if(!o&&!s||!t){a.current=!1;return}if(a.current||!r)return;let e=t?.node.current;if(!e||e.isConnected===!1)return;let i=ZZ(n(e),r);if(o||(i.x=0),s||(i.y=0),a.current=!0,Math.abs(i.x)>0||Math.abs(i.y)>0){let t=lQ(e);t&&t.scrollBy({top:i.y,left:i.x})}},[t,o,s,r,n])}var P$=(0,u.createContext)({...zZ,scaleX:1,scaleY:1}),F$;(function(e){e[e.Uninitialized=0]=`Uninitialized`,e[e.Initializing=1]=`Initializing`,e[e.Initialized=2]=`Initialized`})(F$||={});var I$=(0,u.memo)(function(e){let{id:t,accessibility:n,autoScroll:r=!0,children:i,sensors:a=x$,collisionDetection:o=YZ,measuring:s,modifiers:c,...l}=e,[d,f]=(0,u.useReducer)(k$,void 0,O$),[p,m]=jZ(),[h,g]=(0,u.useState)(F$.Uninitialized),_=h===F$.Initialized,{draggable:{active:v,nodes:y,translate:b},droppable:{containers:x}}=d,S=v==null?null:y.get(v),C=(0,u.useRef)({initial:null,translated:null}),w=(0,u.useMemo)(()=>v==null?null:{id:v,data:S?.data??S$,rect:C},[v,S]),T=(0,u.useRef)(null),[E,D]=(0,u.useState)(null),[O,k]=(0,u.useState)(null),A=lZ(l,Object.values(l)),j=mZ(`DndDescribedBy`,t),ee=(0,u.useMemo)(()=>x.getEnabled(),[x]),M=M$(s),{droppableRects:N,measureDroppableContainers:te,measuringScheduled:ne}=n$(ee,{dragging:_,dependencies:[b.x,b.y],config:M.droppable}),re=ZQ(y,v),ie=(0,u.useMemo)(()=>O?xZ(O):null,[O]),ae=Fe(),oe=i$(re,M.draggable.measure);N$({activeNode:v==null?null:y.get(v),config:ae.layoutShiftCompensation,initialRect:oe,measure:M.draggable.measure});let se=c$(re,M.draggable.measure,oe),ce=c$(re?re.parentElement:null),P=(0,u.useRef)({activatorEvent:null,active:null,activeNode:re,collisionRect:null,collisions:null,droppableRects:N,draggableNodes:y,draggingNode:null,draggingNodeRect:null,droppableContainers:x,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),le=x.getNodeFor(P.current.over?.id),ue=b$({measure:M.dragOverlay.measure}),de=ue.nodeRef.current??re,fe=_?ue.rect??se:null,pe=!!(ue.nodeRef.current&&ue.rect),me=l$(pe?null:se),he=g$(de?tZ(de):null),ge=d$(_?le??re:null),_e=v$(ge),ve=j$(c,{transform:{x:b.x-me.x,y:b.y-me.y,scaleX:1,scaleY:1},activatorEvent:O,active:w,activeNodeRect:se,containerNodeRect:ce,draggingNodeRect:fe,over:P.current.over,overlayNodeRect:ue.rect,scrollableAncestors:ge,scrollableAncestorRects:_e,windowRect:he}),ye=ie?gZ(ie,b):null,be=f$(ge),xe=p$(be),Se=p$(be,[se]),Ce=gZ(ve,xe),we=fe?$Z(fe,ve):null,Te=w&&we?o({active:w,collisionRect:we,droppableRects:N,droppableContainers:ee,pointerCoordinates:ye}):null,Ee=WZ(Te,`id`),[De,Oe]=(0,u.useState)(null),ke=XZ(pe?ve:gZ(ve,Se),De?.rect??null,se),Ae=(0,u.useRef)(null),je=(0,u.useCallback)((e,t)=>{let{sensor:n,options:r}=t;if(T.current==null)return;let i=y.get(T.current);if(!i)return;let a=e.nativeEvent;Ae.current=new n({active:T.current,activeNode:i,event:a,options:r,context:P,onAbort(e){if(!y.get(e))return;let{onDragAbort:t}=A.current,n={id:e};t?.(n),p({type:`onDragAbort`,event:n})},onPending(e,t,n,r){if(!y.get(e))return;let{onDragPending:i}=A.current,a={id:e,constraint:t,initialCoordinates:n,offset:r};i?.(a),p({type:`onDragPending`,event:a})},onStart(e){let t=T.current;if(t==null)return;let n=y.get(t);if(!n)return;let{onDragStart:r}=A.current,i={activatorEvent:a,active:{id:t,data:n.data,rect:C}};(0,xf.unstable_batchedUpdates)(()=>{r?.(i),g(F$.Initializing),f({type:FZ.DragStart,initialCoordinates:e,active:t}),p({type:`onDragStart`,event:i}),D(Ae.current),k(a)})},onMove(e){f({type:FZ.DragMove,coordinates:e})},onEnd:o(FZ.DragEnd),onCancel:o(FZ.DragCancel)});function o(e){return async function(){let{active:t,collisions:n,over:r,scrollAdjustedTranslate:i}=P.current,o=null;if(t&&i){let{cancelDrop:s}=A.current;o={activatorEvent:a,active:t,collisions:n,delta:i,over:r},e===FZ.DragEnd&&typeof s==`function`&&await Promise.resolve(s(o))&&(e=FZ.DragCancel)}T.current=null,(0,xf.unstable_batchedUpdates)(()=>{f({type:e}),g(F$.Uninitialized),Oe(null),D(null),k(null),Ae.current=null;let t=e===FZ.DragEnd?`onDragEnd`:`onDragCancel`;if(o){let e=A.current[t];e?.(o),p({type:t,event:o})}})}}},[y]),Me=QQ(a,(0,u.useCallback)((e,t)=>(n,r)=>{let i=n.nativeEvent,a=y.get(r);if(T.current!==null||!a||i.dndKit||i.defaultPrevented)return;let o={active:a};e(n,t.options,o)===!0&&(i.dndKit={capturedBy:t.sensor},T.current=r,je(n,t))},[y,je]));m$(a),oZ(()=>{se&&h===F$.Initializing&&g(F$.Initialized)},[se,h]),(0,u.useEffect)(()=>{let{onDragMove:e}=A.current,{active:t,activatorEvent:n,collisions:r,over:i}=P.current;if(!t||!n)return;let a={active:t,activatorEvent:n,collisions:r,delta:{x:Ce.x,y:Ce.y},over:i};(0,xf.unstable_batchedUpdates)(()=>{e?.(a),p({type:`onDragMove`,event:a})})},[Ce.x,Ce.y]),(0,u.useEffect)(()=>{let{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:i}=P.current;if(!e||T.current==null||!t||!i)return;let{onDragOver:a}=A.current,o=r.get(Ee),s=o&&o.rect.current?{id:o.id,rect:o.rect.current,data:o.data,disabled:o.disabled}:null,c={active:e,activatorEvent:t,collisions:n,delta:{x:i.x,y:i.y},over:s};(0,xf.unstable_batchedUpdates)(()=>{Oe(s),a?.(c),p({type:`onDragOver`,event:c})})},[Ee]),oZ(()=>{P.current={activatorEvent:O,active:w,activeNode:re,collisionRect:we,collisions:Te,droppableRects:N,draggableNodes:y,draggingNode:de,draggingNodeRect:fe,droppableContainers:x,over:De,scrollableAncestors:ge,scrollAdjustedTranslate:Ce},C.current={initial:fe,translated:we}},[w,re,Te,we,y,de,fe,N,x,De,ge,Ce]),JQ({...ae,delta:b,draggingRect:we,pointerCoordinates:ye,scrollableAncestors:ge,scrollableAncestorRects:_e});let Ne=(0,u.useMemo)(()=>({active:w,activeNode:re,activeNodeRect:se,activatorEvent:O,collisions:Te,containerNodeRect:ce,dragOverlay:ue,draggableNodes:y,droppableContainers:x,droppableRects:N,over:De,measureDroppableContainers:te,scrollableAncestors:ge,scrollableAncestorRects:_e,measuringConfiguration:M,measuringScheduled:ne,windowRect:he}),[w,re,se,O,Te,ce,ue,y,x,N,De,te,ge,_e,M,ne,he]),Pe=(0,u.useMemo)(()=>({activatorEvent:O,activators:Me,active:w,activeNodeRect:se,ariaDescribedById:{draggable:j},dispatch:f,draggableNodes:y,over:De,measureDroppableContainers:te}),[O,Me,w,se,f,j,y,De,te]);return u.createElement(kZ.Provider,{value:m},u.createElement(E$.Provider,{value:Pe},u.createElement(D$.Provider,{value:Ne},u.createElement(P$.Provider,{value:ke},i)),u.createElement(A$,{disabled:n?.restoreFocus===!1})),u.createElement(PZ,{...n,hiddenTextDescribedById:j}));function Fe(){let e=E?.autoScrollEnabled===!1,t=typeof r==`object`?r.enabled===!1:r===!1,n=_&&!e&&!t;return typeof r==`object`?{...r,enabled:n}:{enabled:n}}}),L$=(0,u.createContext)(null),R$=`button`,z$=`Draggable`;function B$(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e,a=mZ(z$),{activators:o,activatorEvent:s,active:c,activeNodeRect:l,ariaDescribedById:d,draggableNodes:f,over:p}=(0,u.useContext)(E$),{role:m=R$,roleDescription:h=`draggable`,tabIndex:g=0}=i??{},_=c?.id===t,v=(0,u.useContext)(_?P$:L$),[y,b]=dZ(),[x,S]=dZ(),C=h$(o,t),w=lZ(n);return oZ(()=>(f.set(t,{id:t,key:a,node:y,activatorNode:x,data:w}),()=>{let e=f.get(t);e&&e.key===a&&f.delete(t)}),[f,t]),{active:c,activatorEvent:s,activeNodeRect:l,attributes:(0,u.useMemo)(()=>({role:m,tabIndex:g,"aria-disabled":r,"aria-pressed":_&&m===R$?!0:void 0,"aria-roledescription":h,"aria-describedby":d.draggable}),[r,m,g,_,h,d.draggable]),isDragging:_,listeners:r?void 0:C,node:y,over:p,setNodeRef:b,setActivatorNodeRef:S,transform:v}}function V$(){return(0,u.useContext)(D$)}var H$=`Droppable`,U$={timeout:25};function W$(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e,a=mZ(H$),{active:o,dispatch:s,over:c,measureDroppableContainers:l}=(0,u.useContext)(E$),d=(0,u.useRef)({disabled:n}),f=(0,u.useRef)(!1),p=(0,u.useRef)(null),m=(0,u.useRef)(null),{disabled:h,updateMeasurementsFor:g,timeout:_}={...U$,...i},v=lZ(g??r),y=o$({callback:(0,u.useCallback)(()=>{if(!f.current){f.current=!0;return}m.current!=null&&clearTimeout(m.current),m.current=setTimeout(()=>{l(Array.isArray(v.current)?v.current:[v.current]),m.current=null},_)},[_]),disabled:h||!o}),[b,x]=dZ((0,u.useCallback)((e,t)=>{y&&(t&&(y.unobserve(t),f.current=!1),e&&y.observe(e))},[y])),S=lZ(t);return(0,u.useEffect)(()=>{!y||!b.current||(y.disconnect(),f.current=!1,y.observe(b.current))},[b,y]),(0,u.useEffect)(()=>(s({type:FZ.RegisterDroppable,element:{id:r,key:a,disabled:n,node:b,rect:p,data:S}}),()=>s({type:FZ.UnregisterDroppable,key:a,id:r})),[r]),(0,u.useEffect)(()=>{n!==d.current.disabled&&(s({type:FZ.SetDroppableDisabled,id:r,key:a,disabled:n}),d.current.disabled=n)},[r,a,n,s]),{active:o,rect:p,isOver:c?.id===r,node:b,over:c,setNodeRef:x}}function G$(e,t,n){let r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function K$(e,t){return e.reduce((e,n,r)=>{let i=t.get(n);return i&&(e[r]=i),e},Array(e.length))}function q$(e){return e!==null&&e>=0}function J$(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Y$(e){return typeof e==`boolean`?{draggable:e,droppable:e}:e}var X$=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e,a=G$(t,r,n),o=t[i],s=a[i];return!s||!o?null:{x:s.left-o.left,y:s.top-o.top,scaleX:s.width/o.width,scaleY:s.height/o.height}},Z$={scaleX:1,scaleY:1},Q$=e=>{let{activeIndex:t,activeNodeRect:n,index:r,rects:i,overIndex:a}=e,o=i[t]??n;if(!o)return null;if(r===t){let e=i[a];return e?{x:0,y:t<a?e.top+e.height-(o.top+o.height):e.top-o.top,...Z$}:null}let s=$$(i,r,t);return r>t&&r<=a?{x:0,y:-o.height-s,...Z$}:r<t&&r>=a?{x:0,y:o.height+s,...Z$}:{x:0,y:0,...Z$}};function $$(e,t,n){let r=e[t],i=e[t-1],a=e[t+1];return r?n<t?i?r.top-(i.top+i.height):a?a.top-(r.top+r.height):0:a?a.top-(r.top+r.height):i?r.top-(i.top+i.height):0:0}var e1=`Sortable`,t1=u.createContext({activeIndex:-1,containerId:e1,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:X$,disabled:{draggable:!1,droppable:!1}});function n1(e){let{children:t,id:n,items:r,strategy:i=X$,disabled:a=!1}=e,{active:o,dragOverlay:s,droppableRects:c,over:l,measureDroppableContainers:d}=V$(),f=mZ(e1,n),p=s.rect!==null,m=(0,u.useMemo)(()=>r.map(e=>typeof e==`object`&&`id`in e?e.id:e),[r]),h=o!=null,g=o?m.indexOf(o.id):-1,_=l?m.indexOf(l.id):-1,v=(0,u.useRef)(m),y=!J$(m,v.current),b=_!==-1&&g===-1||y,x=Y$(a);oZ(()=>{y&&h&&d(m)},[y,m,h,d]),(0,u.useEffect)(()=>{v.current=m},[m]);let S=(0,u.useMemo)(()=>({activeIndex:g,containerId:f,disabled:x,disableTransforms:b,items:m,overIndex:_,useDragOverlay:p,sortedRects:K$(m,c),strategy:i}),[g,f,x.draggable,x.droppable,b,m,_,c,p,i]);return u.createElement(t1.Provider,{value:S},t)}var r1=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return G$(n,r,i).indexOf(t)},i1=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:i,items:a,newIndex:o,previousItems:s,previousContainerId:c,transition:l}=e;return!l||!r||s!==a&&i===o?!1:n?!0:o!==i&&t===c},a1={duration:200,easing:`ease`},o1=`transform`,s1=SZ.Transition.toString({property:o1,duration:0,easing:`linear`}),c1={roleDescription:`sortable`};function l1(e){let{disabled:t,index:n,node:r,rect:i}=e,[a,o]=(0,u.useState)(null),s=(0,u.useRef)(n);return oZ(()=>{if(!t&&n!==s.current&&r.current){let e=i.current;if(e){let t=rQ(r.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&o(n)}}n!==s.current&&(s.current=n)},[t,n,r,i]),(0,u.useEffect)(()=>{a&&o(null)},[a]),a}function u1(e){let{animateLayoutChanges:t=i1,attributes:n,disabled:r,data:i,getNewIndex:a=r1,id:o,strategy:s,resizeObserverConfig:c,transition:l=a1}=e,{items:d,containerId:f,activeIndex:p,disabled:m,disableTransforms:h,sortedRects:g,overIndex:_,useDragOverlay:v,strategy:y}=(0,u.useContext)(t1),b=d1(r,m),x=d.indexOf(o),S=(0,u.useMemo)(()=>({sortable:{containerId:f,index:x,items:d},...i}),[f,i,x,d]),C=(0,u.useMemo)(()=>d.slice(d.indexOf(o)),[d,o]),{rect:w,node:T,isOver:E,setNodeRef:D}=W$({id:o,data:S,disabled:b.droppable,resizeObserverConfig:{updateMeasurementsFor:C,...c}}),{active:O,activatorEvent:k,activeNodeRect:A,attributes:j,setNodeRef:ee,listeners:M,isDragging:N,over:te,setActivatorNodeRef:ne,transform:re}=B$({id:o,data:S,attributes:{...c1,...n},disabled:b.draggable}),ie=ZX(D,ee),ae=!!O,oe=ae&&!h&&q$(p)&&q$(_),se=!v&&N,ce=oe?(se&&oe?re:null)??(s??y)({rects:g,activeNodeRect:A,activeIndex:p,overIndex:_,index:x}):null,P=q$(p)&&q$(_)?a({id:o,items:d,activeIndex:p,overIndex:_}):x,le=O?.id,ue=(0,u.useRef)({activeId:le,items:d,newIndex:P,containerId:f}),de=d!==ue.current.items,fe=t({active:O,containerId:f,isDragging:N,isSorting:ae,id:o,index:x,items:d,newIndex:ue.current.newIndex,previousItems:ue.current.items,previousContainerId:ue.current.containerId,transition:l,wasDragging:ue.current.activeId!=null}),pe=l1({disabled:!fe,index:x,node:T,rect:w});return(0,u.useEffect)(()=>{ae&&ue.current.newIndex!==P&&(ue.current.newIndex=P),f!==ue.current.containerId&&(ue.current.containerId=f),d!==ue.current.items&&(ue.current.items=d)},[ae,P,f,d]),(0,u.useEffect)(()=>{if(le===ue.current.activeId)return;if(le!=null&&ue.current.activeId==null){ue.current.activeId=le;return}let e=setTimeout(()=>{ue.current.activeId=le},50);return()=>clearTimeout(e)},[le]),{active:O,activeIndex:p,attributes:j,data:S,rect:w,index:x,newIndex:P,items:d,isOver:E,isSorting:ae,isDragging:N,listeners:M,node:T,overIndex:_,over:te,setNodeRef:ie,setActivatorNodeRef:ne,setDroppableNodeRef:D,setDraggableNodeRef:ee,transform:pe??ce,transition:me()};function me(){if(pe||de&&ue.current.newIndex===x)return s1;if(!(se&&!yZ(k)||!l)&&(ae||fe))return SZ.Transition.toString({...l,property:o1})}}function d1(e,t){return typeof e==`boolean`?{draggable:e,droppable:!1}:{draggable:e?.draggable??t.draggable,droppable:e?.droppable??t.droppable}}function f1(e){if(!e)return!1;let t=e.data.current;return!!(t&&`sortable`in t&&typeof t.sortable==`object`&&`containerId`in t.sortable&&`items`in t.sortable&&`index`in t.sortable)}var p1=[MQ.Down,MQ.Right,MQ.Up,MQ.Left],m1=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:i,droppableContainers:a,over:o,scrollableAncestors:s}}=t;if(p1.includes(e.code)){if(e.preventDefault(),!n||!r)return;let t=[];a.getEnabled().forEach(n=>{if(!n||n!=null&&n.disabled)return;let a=i.get(n.id);if(a)switch(e.code){case MQ.Down:r.top<a.top&&t.push(n);break;case MQ.Up:r.top>a.top&&t.push(n);break;case MQ.Left:r.left>a.left&&t.push(n);break;case MQ.Right:r.left<a.left&&t.push(n);break}});let c=qZ({active:n,collisionRect:r,droppableRects:i,droppableContainers:t,pointerCoordinates:null}),l=WZ(c,`id`);if(l===o?.id&&c.length>1&&(l=c[1].id),l!=null){let e=a.get(n.id),t=a.get(l),o=t?i.get(t.id):null,c=t?.node.current;if(c&&o&&e&&t){let n=cQ(c).some((e,t)=>s[t]!==e),i=h1(e,t),a=g1(e,t),l=n||!i?{x:0,y:0}:{x:a?r.width-o.width:0,y:a?r.height-o.height:0},u={x:o.left,y:o.top};return l.x&&l.y?u:_Z(u,l)}}}};function h1(e,t){return!f1(e)||!f1(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function g1(e,t){return!f1(e)||!f1(t)||!h1(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}function _1({resource:e,isCollapsed:t,isActive:n,href:r,onClose:i,onReorder:a,index:o,totalCount:s,LinkComponent:c,translations:l={},isDragging:d=!1}){let{attributes:f,listeners:p,setNodeRef:m,transform:h,transition:g,isDragging:_}=u1({id:e.id}),v=(0,u.useRef)(a);(0,u.useEffect)(()=>{v.current=a});let y={transform:SZ.Transform.toString(h),transition:g,opacity:_||d?.5:1},b=aL(e.mediaType),x=_||d,S=e.storageUri?e.storageUri.replace(/^file:\/\//,``):e.name,C=(0,u.useCallback)(t=>{v.current&&t.altKey&&(t.key===`ArrowUp`?(t.preventDefault(),v.current(e.id,`up`)):t.key===`ArrowDown`&&(t.preventDefault(),v.current(e.id,`down`)))},[e.id]);return(0,F.jsxs)(`div`,{ref:m,style:y,...f,...p,"aria-selected":n,onKeyDown:C,"aria-label":`${e.name}, position ${o===void 0?``:o+1} of ${s||``}`,className:`semiont-resource-tab ${n?`semiont-resource-tab--active`:``} ${x?`semiont-resource-tab--dragging`:``}`,role:`tab`,children:[(0,F.jsxs)(c,{href:r,className:`semiont-resource-tab__link`,title:S,children:[(0,F.jsx)(`span`,{className:`semiont-resource-tab__icon`,"aria-hidden":`true`,children:b}),!t&&(0,F.jsx)(`span`,{className:`semiont-resource-tab__text`,children:e.name})]}),!t&&(0,F.jsx)(`button`,{onClick:t=>i(e.id,t),className:`semiont-resource-tab__close`,title:l.closeResource||`Close resource`,"aria-label":`Close ${e.name}`,type:`button`,children:(0,F.jsx)(`svg`,{fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,width:`16`,height:`16`,children:(0,F.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M6 18L18 6M6 6l12 12`})})})]})}function v1(){let{announce:e}=IL();return{announceReorder:(0,u.useCallback)(t=>{e(t,`assertive`)},[e]),announcePickup:(0,u.useCallback)((t,n,r)=>{e(`Picked up ${t}. Position ${n} of ${r}. Use arrow keys to move, space to drop.`,`assertive`)},[e]),announceDrop:(0,u.useCallback)((t,n,r)=>{e(`Dropped ${t} at position ${n} of ${r}.`,`assertive`)},[e]),announceMove:(0,u.useCallback)((t,n,r,i)=>{e(`Moved ${t} ${n} to position ${r} of ${i}.`,`polite`)},[e]),announceKeyboardReorder:(0,u.useCallback)((t,n,r,i)=>{e(`${t} moved ${n} to position ${r} of ${i}.`,`assertive`)},[e]),announceCannotMove:(0,u.useCallback)(t=>{e(`Cannot move ${t}. Already at the ${t===`up`?`top`:`bottom`} of the list.`,`polite`)},[e])}}function y1({fixedItems:e,resources:t,isCollapsed:n,currentPath:r,LinkComponent:i,onNavigate:a,getResourceHref:o,className:s=``,translations:c={},icons:l,navigationMenu:d}){let f=l.chevronLeft,p=l.bars,[m,h]=(0,u.useState)(!1),g=(0,u.useRef)(null),{announcePickup:_,announceDrop:v,announceKeyboardReorder:y,announceCannotMove:b}=v1(),x=Lg(`CollapsibleResourceNavigation`),S=kg(),C={title:c?.title||x(`title`),collapseSidebar:c?.collapseSidebar||x(`collapseSidebar`),expandSidebar:c?.expandSidebar||x(`expandSidebar`),dragToReorder:c?.dragToReorder||x(`dragToReorder`),dragToReorderDoc:c?.dragToReorderDoc||x(`dragToReorderDoc`),closeResource:c?.closeResource||x(`closeResource`),dragInstructions:c?.dragInstructions||x(`dragInstructions`)},w=()=>h(!m),T=()=>h(!1);(0,u.useEffect)(()=>{let e=e=>{g.current&&!g.current.contains(e.target)&&T()};if(m)return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[m]);let E=RZ(LZ(BQ,{activationConstraint:{distance:8}}),LZ(FQ,{coordinateGetter:m1})),D=(0,u.useCallback)((e,n)=>{let r=t.findIndex(t=>t.id===e);if(r===-1)return;let i=n===`up`?r-1:r+1;if(i<0||i>=t.length){b(n);return}S.emit(`tabs:reorder`,{oldIndex:r,newIndex:i});let a=t[r];y(a.name,n,i+1,t.length)},[t,S]),O=(t,n)=>{n.preventDefault(),n.stopPropagation(),S.emit(`tabs:close`,{resourceId:t}),r===o(t)&&a&&e.length>0&&a(e[0].href)};return(0,F.jsxs)(`div`,{className:`semiont-collapsible-nav ${s}`,children:[(0,F.jsx)(`div`,{id:`drag-instructions`,className:`sr-only`,"aria-live":`polite`,children:C.dragInstructions}),(0,F.jsx)(`div`,{className:`sr-only`,role:`status`,"aria-atomic":`true`,children:`Resources can be reordered using Alt+Up or Alt+Down arrow keys.`}),(0,F.jsxs)(`div`,{className:`semiont-collapsible-nav__container`,children:[(0,F.jsxs)(`div`,{style:{position:`relative`},ref:d?g:void 0,children:[(0,F.jsxs)(`div`,{className:`semiont-nav-section__header`,children:[!n&&d&&(0,F.jsx)(`button`,{onClick:w,className:`semiont-nav-section__header-text`,"aria-expanded":m,"aria-haspopup":`true`,type:`button`,children:C.title}),!n&&!d&&(0,F.jsx)(`span`,{className:`semiont-nav-section__header-text`,children:C.title}),(0,F.jsx)(`button`,{onClick:()=>S.emit(`shell:sidebar-toggle`,void 0),className:`semiont-nav-section__header-icon`,title:n?C.expandSidebar:C.collapseSidebar,"aria-label":n?C.expandSidebar:C.collapseSidebar,type:`button`,children:n?(0,F.jsx)(p,{}):(0,F.jsx)(f,{})})]}),m&&d&&!n&&(0,F.jsx)(`div`,{className:`semiont-nav-section__dropdown`,children:d(T)})]}),!n&&(0,F.jsx)(`nav`,{className:`semiont-nav-tabs`,children:e.map(e=>{let t=r===e.href;return(0,F.jsxs)(i,{href:e.href,className:`semiont-nav-tab ${t?`semiont-nav-tab--active`:``}`,title:e.description||e.name,"aria-current":t?`page`:void 0,children:[(0,F.jsx)(e.icon,{className:`semiont-nav-tab__icon`,"aria-hidden":`true`}),(0,F.jsx)(`span`,{className:`semiont-nav-tab__text`,children:e.name})]},e.href)})}),n&&(0,F.jsx)(`nav`,{className:`semiont-nav-tabs`,children:e.map(e=>{let t=r===e.href;return(0,F.jsx)(i,{href:e.href,className:`semiont-nav-tab ${t?`semiont-nav-tab--active`:``}`,title:e.description||e.name,"aria-current":t?`page`:void 0,"aria-label":e.name,children:(0,F.jsx)(e.icon,{className:`semiont-nav-tab__icon`,"aria-hidden":`true`})},e.href)})}),(0,F.jsx)(`div`,{className:`semiont-resource-tabs`,role:`tablist`,"aria-label":`Open resources`,children:n?t.map(e=>{let t=o(e.id);return(0,F.jsx)(_1,{resource:e,isCollapsed:n,isActive:r===t,href:t,onClose:O,LinkComponent:i,translations:{dragToReorder:C.dragToReorder,dragToReorderDoc:C.dragToReorderDoc,closeResource:C.closeResource}},e.id)}):(0,F.jsx)(I$,{sensors:E,collisionDetection:KZ,onDragStart:e=>{let{active:n}=e,r=t.find(e=>e.id===n.id);if(r){let e=t.indexOf(r);_(r.name,e+1,t.length)}},onDragEnd:e=>{let{active:n,over:r}=e;if(r&&n.id!==r.id){let e=t.findIndex(e=>e.id===n.id),i=t.findIndex(e=>e.id===r.id);if(e!==-1&&i!==-1){S.emit(`tabs:reorder`,{oldIndex:e,newIndex:i});let n=t[e];v(n.name,i+1,t.length)}}},children:(0,F.jsx)(n1,{items:t.map(e=>e.id),strategy:Q$,children:t.map((e,a)=>{let s=o(e.id);return(0,F.jsx)(_1,{resource:e,isCollapsed:n,isActive:r===s,href:s,onClose:O,onReorder:D,index:a,totalCount:t.length,LinkComponent:i,translations:{dragToReorder:C.dragToReorder,dragToReorderDoc:C.dragToReorderDoc,closeResource:C.closeResource}},e.id)})})})})]})]})}function b1({context:e,translations:t}){let n=e.focus.kind===`annotation`?String(e.focus.sourceResource.id):String(e.focus.resource.id),r=e.focus.kind===`annotation`?e.focus.annotation.id:void 0,{connections:i,citedBy:a,citedByCount:o}=Xs(e.graph,n,r);return(0,F.jsx)(F.Fragment,{children:(i.length>0||o>0)&&(0,F.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`1rem`},children:[i.length>0&&(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{style:{fontSize:`var(--semiont-text-xs)`,fontWeight:700,textTransform:`uppercase`,letterSpacing:`0.06em`,color:`var(--semiont-text-tertiary)`,marginBottom:`0.375rem`},children:t.connectionsLabel}),(0,F.jsx)(`ul`,{style:{display:`flex`,flexDirection:`column`,gap:`0.375rem`,listStyle:`none`,padding:0,margin:0},children:i.map(e=>(0,F.jsxs)(`li`,{style:{display:`flex`,flexWrap:`wrap`,alignItems:`center`,gap:`0.375rem`,fontSize:`var(--semiont-text-sm)`},children:[(0,F.jsx)(`span`,{style:{color:`var(--semiont-text-primary)`,fontWeight:500},children:e.resourceName}),e.bidirectional&&(0,F.jsx)(`span`,{className:`semiont-chip`,style:{fontSize:`var(--semiont-text-xs)`,padding:`0.125rem 0.375rem`},children:`mutual`}),e.entityTypes&&e.entityTypes.map(e=>(0,F.jsx)(`span`,{className:`semiont-chip`,style:{fontSize:`var(--semiont-text-xs)`,padding:`0.125rem 0.375rem`},children:e},e))]},e.resourceId))})]}),o>0&&(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`div`,{style:{fontSize:`var(--semiont-text-xs)`,fontWeight:700,textTransform:`uppercase`,letterSpacing:`0.06em`,color:`var(--semiont-text-tertiary)`,marginBottom:`0.375rem`},children:[t.citedByLabel,` (`,o,`)`]}),a.length>0&&(0,F.jsx)(`ul`,{style:{display:`flex`,flexDirection:`column`,gap:`0.25rem`,listStyle:`none`,padding:0,margin:0},children:a.map(e=>(0,F.jsx)(`li`,{style:{fontSize:`var(--semiont-text-sm)`,color:`var(--semiont-text-primary)`,fontWeight:500},children:e.resourceName},e.resourceId))})]})]})})}function x1({context:e,contextLoading:t,contextError:n,userHint:r=``,onUserHintChange:i,onBind:a,onGenerate:o,onCompose:s,translations:c}){let[l,d]=(0,u.useState)(!1),f=!t&&!n&&!!e,p=e?.focus.kind===`annotation`?e.focus:null,m=e?.focus.kind===`resource`?e.focus:null,h=(0,u.useRef)(null);return(0,u.useEffect)(()=>{h.current&&h.current.scrollIntoView({block:`center`,behavior:`instant`})},[e]),(0,F.jsxs)(`div`,{className:`semiont-gather__outer`,children:[t&&(0,F.jsxs)(`div`,{className:`semiont-gather__loading`,children:[(0,F.jsxs)(`div`,{style:{display:`flex`,gap:`0.5rem`},children:[(0,F.jsx)(`span`,{className:`semiont-gather__loading-dot`}),(0,F.jsx)(`span`,{className:`semiont-gather__loading-dot`}),(0,F.jsx)(`span`,{className:`semiont-gather__loading-dot`})]}),(0,F.jsx)(`span`,{className:`semiont-gather__loading-text`,children:c.loadingContext})]}),!!n&&(0,F.jsx)(`div`,{style:{textAlign:`center`,padding:`1rem 0`,color:`var(--semiont-color-red-600)`},children:c.failedContext}),e&&(0,F.jsxs)(F.Fragment,{children:[p?.selected&&(0,F.jsxs)(`div`,{className:`semiont-gather__source-strip`,children:[(0,F.jsxs)(`label`,{className:`semiont-form__label`,style:{marginBottom:`0.375rem`},children:[c.sourceContextLabel,p.sourceResource.name?` "${p.sourceResource.name}"`:``]}),(0,F.jsxs)(`div`,{className:`semiont-gather__source-box${l?` semiont-gather__source-box--expanded`:``}`,children:[(0,F.jsx)(`div`,{className:`semiont-gather__source-context`,children:(0,F.jsxs)(`div`,{style:{fontSize:`var(--semiont-text-sm)`,fontFamily:`monospace`,whiteSpace:`pre-wrap`,color:`var(--semiont-text-secondary)`},children:[p.selected.before&&(0,F.jsx)(`span`,{children:p.selected.before}),(0,F.jsx)(`span`,{ref:h,style:{backgroundColor:`var(--semiont-color-primary-100)`,padding:`0 0.25rem`,fontWeight:600,color:`var(--semiont-color-primary-900)`},children:p.selected.text}),(e.metadata?.entityTypes??[]).map(e=>(0,F.jsx)(`span`,{className:`semiont-chip`,style:{fontSize:`var(--semiont-text-xs)`,padding:`0.125rem 0.375rem`,fontWeight:400,verticalAlign:`middle`,marginLeft:`0.25rem`},children:e},e)),p.annotation.motivation&&(0,F.jsx)(`span`,{className:`semiont-chip`,style:{fontSize:`var(--semiont-text-xs)`,padding:`0.125rem 0.375rem`,fontWeight:400,verticalAlign:`middle`,marginLeft:`0.25rem`},children:p.annotation.motivation}),p.selected.after&&(0,F.jsx)(`span`,{children:p.selected.after})]})}),(0,F.jsx)(`button`,{type:`button`,className:`semiont-gather__expand-btn`,onClick:()=>d(e=>!e),children:l?`▲ less`:`▼ more`})]})]}),m&&(0,F.jsxs)(`div`,{className:`semiont-gather__source-strip`,children:[(0,F.jsxs)(`label`,{className:`semiont-form__label`,style:{marginBottom:`0.375rem`},children:[c.sourceContextLabel,m.resource.name?` "${m.resource.name}"`:``]}),(m.summary||m.content?.main)&&(0,F.jsxs)(`div`,{className:`semiont-gather__source-box${l?` semiont-gather__source-box--expanded`:``}`,children:[(0,F.jsx)(`div`,{className:`semiont-gather__source-context`,children:(0,F.jsxs)(`div`,{style:{fontSize:`var(--semiont-text-sm)`,whiteSpace:`pre-wrap`,color:`var(--semiont-text-secondary)`},children:[m.summary??m.content?.main,(e.metadata?.entityTypes??[]).map(e=>(0,F.jsx)(`span`,{className:`semiont-chip`,style:{fontSize:`var(--semiont-text-xs)`,padding:`0.125rem 0.375rem`,fontWeight:400,verticalAlign:`middle`,marginLeft:`0.25rem`},children:e},e))]})}),(0,F.jsx)(`button`,{type:`button`,className:`semiont-gather__expand-btn`,onClick:()=>d(e=>!e),children:l?`▲ less`:`▼ more`})]}),m.suggestedReferences&&m.suggestedReferences.length>0&&(0,F.jsx)(`div`,{style:{marginTop:`0.5rem`},children:m.suggestedReferences.map(e=>(0,F.jsx)(`span`,{className:`semiont-chip`,style:{fontSize:`var(--semiont-text-xs)`,padding:`0.125rem 0.375rem`,marginRight:`0.25rem`},children:e},e))})]}),(0,F.jsxs)(`div`,{className:`semiont-gather__body`,children:[(0,F.jsx)(`div`,{className:`semiont-gather__left`,children:(0,F.jsx)(b1,{context:e,translations:c})}),p&&(0,F.jsx)(`div`,{className:`semiont-gather__right`,children:(0,F.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,F.jsx)(`label`,{className:`semiont-form__label`,children:c.userHintLabel}),(0,F.jsx)(`textarea`,{value:r,onChange:e=>i?.(e.target.value),placeholder:c.userHintPlaceholder,className:`semiont-search-modal__search-input semiont-gather__hint-textarea`,style:{resize:`vertical`,fontFamily:`inherit`}})]})})]}),p&&(0,F.jsxs)(`div`,{className:`semiont-gather__footer`,children:[(0,F.jsx)(`div`,{className:`semiont-gather__footer-label`,children:c.resolutionStrategyLabel}),(0,F.jsxs)(`div`,{className:`semiont-gather__actions`,children:[(0,F.jsxs)(`button`,{type:`button`,onClick:a,disabled:!f,className:`semiont-button--primary semiont-button--flex`,children:[`🔍 `,c.search,`…`]}),(0,F.jsxs)(`button`,{type:`button`,onClick:o,disabled:!f,className:`semiont-button--primary semiont-button--flex`,children:[`✨ `,c.generate,`…`]}),(0,F.jsxs)(`button`,{type:`button`,onClick:s,disabled:!f,className:`semiont-button--secondary semiont-button--flex`,children:[`✍️ `,c.compose]})]})]})]})]})}function S1({defaultTitle:e,locale:t,context:n,onBack:r,onCancel:i,onGenerate:a,translations:o}){let[s,c]=(0,u.useState)(e),[l,d]=(0,u.useState)(``),[f,p]=(0,u.useState)(``),[m,h]=(0,u.useState)(t),[g,_]=(0,u.useState)(.7),[v,y]=(0,u.useState)(500);return(0,F.jsxs)(`form`,{onSubmit:e=>{e.preventDefault();let t=f.trim();a({title:s,storagePath:`file://${l}`,...t?{prompt:t}:{},language:m,temperature:g,maxTokens:v,context:n})},className:`semiont-form semiont-form--scrollable`,children:[(0,F.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,F.jsx)(`label`,{htmlFor:`wizard-title`,className:`semiont-form__label`,children:o.resourceTitle}),(0,F.jsx)(`input`,{id:`wizard-title`,type:`text`,value:s,onChange:e=>c(e.target.value),required:!0,className:`semiont-input`,placeholder:o.resourceTitlePlaceholder})]}),(0,F.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,F.jsx)(`label`,{htmlFor:`wizard-storagePath`,className:`semiont-form__label`,children:`Save location`}),(0,F.jsxs)(`div`,{className:`semiont-input-addon`,children:[(0,F.jsx)(`span`,{className:`semiont-input-addon__prefix`,children:`file://`}),(0,F.jsx)(`input`,{id:`wizard-storagePath`,type:`text`,value:l,onChange:e=>d(e.target.value),required:!0,className:`semiont-input semiont-input--addon`,placeholder:`generated/my-resource.md`})]})]}),(0,F.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,F.jsx)(`label`,{htmlFor:`wizard-prompt`,className:`semiont-form__label`,children:o.additionalInstructions}),(0,F.jsx)(`textarea`,{id:`wizard-prompt`,value:f,onChange:e=>p(e.target.value),rows:2,className:`semiont-textarea`,placeholder:o.additionalInstructionsPlaceholder})]}),(0,F.jsxs)(`div`,{className:`semiont-form__inline-row`,children:[(0,F.jsxs)(`div`,{className:`semiont-form__field semiont-form__field--inline`,children:[(0,F.jsx)(`label`,{htmlFor:`wizard-language`,className:`semiont-form__label`,children:o.language}),(0,F.jsx)(`select`,{id:`wizard-language`,value:m,onChange:e=>h(e.target.value),className:`semiont-select`,children:Ss.map(e=>(0,F.jsx)(`option`,{value:e.code,children:e.nativeName},e.code))})]}),(0,F.jsxs)(`div`,{className:`semiont-form__field semiont-form__field--inline semiont-form__field--grow`,children:[(0,F.jsxs)(`label`,{htmlFor:`wizard-temperature`,className:`semiont-form__label`,children:[o.creativity,` (`,g.toFixed(1),`)`]}),(0,F.jsx)(`input`,{id:`wizard-temperature`,type:`range`,min:`0`,max:`1`,step:`0.1`,value:g,onChange:e=>_(parseFloat(e.target.value)),className:`semiont-slider`}),(0,F.jsxs)(`div`,{className:`semiont-slider__labels semiont-slider__labels--small`,children:[(0,F.jsx)(`span`,{children:o.creativityFocused}),(0,F.jsx)(`span`,{children:o.creativityCreative})]})]}),(0,F.jsxs)(`div`,{className:`semiont-form__field semiont-form__field--inline semiont-form__field--narrow`,children:[(0,F.jsx)(`label`,{htmlFor:`wizard-maxTokens`,className:`semiont-form__label`,children:o.maxLength}),(0,F.jsx)(`input`,{id:`wizard-maxTokens`,type:`number`,min:`100`,max:`4000`,step:`100`,value:v,onChange:e=>y(parseInt(e.target.value)),className:`semiont-input`})]})]}),(0,F.jsxs)(`div`,{className:`semiont-modal__actions`,style:{paddingTop:`0.5rem`},children:[(0,F.jsxs)(`button`,{type:`button`,onClick:i,className:`semiont-button--secondary semiont-button--flex`,children:[`✕ `,o.cancel]}),(0,F.jsxs)(`button`,{type:`button`,onClick:r,className:`semiont-button--secondary semiont-button--flex`,children:[`◀ `,o.back]}),(0,F.jsxs)(`button`,{type:`submit`,className:`semiont-button--primary semiont-button--flex`,children:[`✨ `,o.generate]})]})]})}function C1({isSearching:e=!1,onBack:t,onCancel:n,onSearch:r,translations:i}){let[a,o]=(0,u.useState)(10),[s,c]=(0,u.useState)(!0);return(0,F.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),r({limit:a,useSemanticScoring:s})},className:`semiont-form`,children:[(0,F.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,F.jsx)(`label`,{htmlFor:`wizard-limit`,className:`semiont-form__label`,children:i.maxResults}),(0,F.jsxs)(`select`,{id:`wizard-limit`,value:a,onChange:e=>o(parseInt(e.target.value)),className:`semiont-select`,children:[(0,F.jsx)(`option`,{value:1,children:`1`}),(0,F.jsx)(`option`,{value:5,children:`5`}),(0,F.jsx)(`option`,{value:10,children:`10`}),(0,F.jsx)(`option`,{value:20,children:`20`})]})]}),(0,F.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,F.jsxs)(`label`,{className:`semiont-form__label`,style:{display:`flex`,alignItems:`center`,gap:`0.5rem`},children:[(0,F.jsx)(`input`,{type:`checkbox`,checked:s,onChange:e=>c(e.target.checked)}),i.semanticScoring]}),(0,F.jsx)(`p`,{className:`semiont-form__help`,children:i.semanticScoringHelp})]}),(0,F.jsxs)(`div`,{className:`semiont-modal__actions`,style:{paddingTop:`0.5rem`},children:[(0,F.jsxs)(`button`,{type:`button`,onClick:n,className:`semiont-button--secondary semiont-button--flex`,disabled:e,children:[`✕ `,i.cancel]}),(0,F.jsxs)(`button`,{type:`button`,onClick:t,className:`semiont-button--secondary semiont-button--flex`,disabled:e,children:[`◀ `,i.back]}),(0,F.jsx)(`button`,{type:`submit`,className:`semiont-button--primary semiont-button--flex`,disabled:e,"data-generating":e?`true`:`false`,children:e?`\u2728 ${i.searching}`:`\u{1F50D} ${i.search}`})]})]})}function w1({results:e,context:t,onLink:n,onBack:r,onCancel:i,translations:a}){return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{className:`semiont-search-results__two-pane`,children:[(0,F.jsx)(`div`,{className:`semiont-search-results__context-pane`,children:(0,F.jsx)(b1,{context:t,translations:a})}),(0,F.jsx)(`div`,{className:`semiont-search-results__results-pane`,children:e.length===0?(0,F.jsx)(`div`,{className:`semiont-modal__empty-state`,style:{textAlign:`center`,padding:`2rem 0`},children:a.noResults}):e.map(e=>{let t=e[`@id`];return(0,F.jsxs)(`div`,{style:{padding:`0.75rem`,borderBottom:`1px solid var(--semiont-border-primary)`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:`0.75rem`},children:[(0,F.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,F.jsx)(`div`,{style:{fontWeight:500,color:`var(--semiont-text-primary)`},children:e.name}),e.description&&(0,F.jsx)(`div`,{style:{fontSize:`var(--semiont-text-sm)`,color:`var(--semiont-text-secondary)`,marginTop:`0.25rem`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:e.description}),(0,F.jsxs)(`div`,{style:{fontSize:`var(--semiont-text-xs)`,color:`var(--semiont-text-tertiary)`,marginTop:`0.25rem`,display:`flex`,gap:`0.5rem`},children:[e.score!==void 0&&(0,F.jsxs)(`span`,{children:[a.score,`: `,e.score]}),e.matchReason&&(0,F.jsx)(`span`,{children:e.matchReason})]})]}),(0,F.jsxs)(`button`,{type:`button`,onClick:()=>n(t),className:`semiont-button--primary`,style:{flexShrink:0},children:[`🔗 `,a.link]})]},t)})})]}),(0,F.jsxs)(`div`,{className:`semiont-modal__actions`,style:{paddingTop:`0.5rem`},children:[(0,F.jsxs)(`button`,{type:`button`,onClick:i,className:`semiont-button--secondary semiont-button--flex`,children:[`✕ `,a.cancel]}),(0,F.jsxs)(`button`,{type:`button`,onClick:r,className:`semiont-button--secondary semiont-button--flex`,children:[`◀ `,a.back]})]})]})}function T1({isOpen:e,onClose:t,annotationId:n,resourceId:r,defaultTitle:i,entityTypes:a,locale:o,context:s,contextLoading:c,contextError:l,onGenerateSubmit:d,onLinkResource:f,onComposeNavigate:p,translations:m}){let h=Z(kg().activeSession$),[g,_]=(0,u.useState)({step:`gather`}),[v,y]=(0,u.useState)(!1),[b,x]=(0,u.useState)(``);(0,u.useEffect)(()=>{e&&(_({step:`gather`}),y(!1),x(``))},[e]),NL(`match:search-results`,t=>{e&&n&&t.referenceId===n&&(y(!1),_({step:`search-results`,results:t.response}))});let S=(0,u.useCallback)(()=>{_({step:`configure-search`})},[]),C=(0,u.useCallback)(()=>{_({step:`configure-generation`})},[]),w=(0,u.useCallback)(()=>{!s||!n||!r||(p(b?{...s,userHint:b}:s,n,r,i,a),t())},[s,n,r,i,a,p,t,b]),T=(0,u.useCallback)(()=>{_({step:`gather`})},[]),E=(0,u.useCallback)(e=>{if(!n||!s||!r)return;y(!0);let t=b?{...s,userHint:b}:s;h?.client.match.requestSearch({correlationId:crypto.randomUUID(),resourceId:r,referenceId:n,context:t,limit:e.limit,useSemanticScoring:e.useSemanticScoring})},[n,r,s,h,b]),D=(0,u.useCallback)(e=>{n&&(d(n,e),t())},[n,d,t]),O=(0,u.useCallback)(e=>{n&&(f(n,e),t())},[n,f,t]),k=g.step===`gather`?m.gatherTitle:g.step===`configure-generation`?m.configureGenerationTitle:g.step===`configure-search`?m.configureSearchTitle:m.searchResultsTitle;return(0,F.jsx)(fY,{appear:!0,show:e,children:(0,F.jsxs)(MY,{as:`div`,className:`semiont-search-modal`,onClose:t,children:[(0,F.jsx)(dY,{enter:`ease-out duration-200`,enterFrom:`opacity-0`,enterTo:`opacity-100`,leave:`ease-in duration-150`,leaveFrom:`opacity-100`,leaveTo:`opacity-0`,children:(0,F.jsx)(`div`,{className:`semiont-search-modal__backdrop`})}),(0,F.jsx)(`div`,{className:`semiont-search-modal__wrapper`,children:(0,F.jsx)(`div`,{className:`semiont-search-modal__centering semiont-search-modal__centering--center`,children:(0,F.jsx)(dY,{enter:`ease-out duration-200`,enterFrom:`opacity-0 scale-95`,enterTo:`opacity-100 scale-100`,leave:`ease-in duration-150`,leaveFrom:`opacity-100 scale-100`,leaveTo:`opacity-0 scale-95`,children:(0,F.jsxs)(AY,{className:`semiont-search-modal__panel semiont-search-modal__panel--with-border${g.step===`search-results`?` semiont-search-modal__panel--wide`:``}${g.step===`gather`?` semiont-search-modal__panel--gather`:``}`,children:[(0,F.jsxs)(`div`,{className:`semiont-search-modal__header`,children:[(0,F.jsx)(jY,{className:`semiont-search-modal__title`,children:k}),(0,F.jsx)(`button`,{onClick:t,className:`semiont-search-modal__close-button`,"aria-label":`Close`,children:`✕`})]}),g.step===`gather`&&(0,F.jsx)(x1,{context:s,contextLoading:c,contextError:l,userHint:b,onUserHintChange:x,onBind:S,onGenerate:C,onCompose:w,translations:{title:m.gatherTitle,sourceContextLabel:m.sourceContextLabel,connectionsLabel:m.connectionsLabel,citedByLabel:m.citedByLabel,userHintLabel:m.userHintLabel,userHintPlaceholder:m.userHintPlaceholder,loadingContext:m.loadingContext,failedContext:m.failedContext,search:m.search,generate:m.generate,compose:m.compose,resolutionStrategyLabel:m.resolutionStrategyLabel}}),g.step===`configure-generation`&&s&&(0,F.jsx)(S1,{defaultTitle:i,locale:o,context:s,onBack:T,onCancel:t,onGenerate:D,translations:{resourceTitle:m.resourceTitle,resourceTitlePlaceholder:m.resourceTitlePlaceholder,additionalInstructions:m.additionalInstructions,additionalInstructionsPlaceholder:m.additionalInstructionsPlaceholder,language:m.language,languageHelp:m.languageHelp,creativity:m.creativity,creativityFocused:m.creativityFocused,creativityCreative:m.creativityCreative,maxLength:m.maxLength,maxLengthHelp:m.maxLengthHelp,cancel:m.cancel,back:m.back,generate:m.generate}}),g.step===`configure-search`&&(0,F.jsx)(C1,{isSearching:v,onBack:T,onCancel:t,onSearch:E,translations:{maxResults:m.maxResults,semanticScoring:m.semanticScoring,semanticScoringHelp:m.semanticScoringHelp,cancel:m.cancel,back:m.back,search:m.search,searching:m.searching}}),g.step===`search-results`&&s&&(0,F.jsx)(w1,{results:g.results,context:s,onLink:O,onBack:T,onCancel:t,translations:{noResults:m.noResults,link:m.link,back:m.back,cancel:m.cancel,score:m.score,sourceContextLabel:m.sourceContextLabel,connectionsLabel:m.connectionsLabel,citedByLabel:m.citedByLabel,userHintLabel:m.userHintLabel,userHintPlaceholder:m.userHintPlaceholder}})]})})})})]})})}function E1({defaults:e,onGather:t,onCancel:n,translations:r,children:i}){let[a,o]=(0,u.useState)(e?.includeContent??!0),[s,c]=(0,u.useState)(e?.includeSummary??!0),[l,d]=(0,u.useState)(e?.depth??2),[f,p]=(0,u.useState)(e?.maxResources??10);return(0,F.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),t({includeContent:a,includeSummary:s,depth:l,maxResources:f})},className:`semiont-form semiont-form--scrollable`,children:[(0,F.jsx)(`p`,{className:`semiont-form__helper-text`,children:r.intro}),(0,F.jsx)(`div`,{className:`semiont-form__checkbox-field`,children:(0,F.jsxs)(`label`,{className:`semiont-form__checkbox-label`,children:[(0,F.jsx)(`input`,{type:`checkbox`,checked:a,onChange:e=>o(e.target.checked)}),r.includeContent]})}),(0,F.jsx)(`div`,{className:`semiont-form__checkbox-field`,children:(0,F.jsxs)(`label`,{className:`semiont-form__checkbox-label`,children:[(0,F.jsx)(`input`,{type:`checkbox`,checked:s,onChange:e=>c(e.target.checked)}),r.includeSummary]})}),(0,F.jsxs)(`div`,{className:`semiont-form__inline-row`,children:[(0,F.jsxs)(`div`,{className:`semiont-form__field semiont-form__field--inline semiont-form__field--narrow`,children:[(0,F.jsx)(`label`,{htmlFor:`gather-depth`,className:`semiont-form__label`,children:r.depth}),(0,F.jsx)(`input`,{id:`gather-depth`,type:`number`,min:`1`,max:`5`,value:l,onChange:e=>d(parseInt(e.target.value)),className:`semiont-input`})]}),(0,F.jsxs)(`div`,{className:`semiont-form__field semiont-form__field--inline semiont-form__field--narrow`,children:[(0,F.jsx)(`label`,{htmlFor:`gather-max`,className:`semiont-form__label`,children:r.maxResources}),(0,F.jsx)(`input`,{id:`gather-max`,type:`number`,min:`1`,max:`50`,value:f,onChange:e=>p(parseInt(e.target.value)),className:`semiont-input`})]})]}),i,(0,F.jsxs)(`div`,{className:`semiont-modal__actions`,style:{paddingTop:`0.5rem`},children:[(0,F.jsxs)(`button`,{type:`button`,onClick:n,className:`semiont-button--secondary semiont-button--flex`,children:[`✕ `,r.cancel]}),(0,F.jsxs)(`button`,{type:`submit`,className:`semiont-button--primary semiont-button--flex`,children:[`✨ `,r.gather]})]})]})}function D1({isOpen:e,onClose:t,resourceId:n,defaultTitle:r,locale:i,gatherDefaults:a,onGenerateSubmit:o,translations:s}){let[c,l]=(0,u.useState)(`configure-gather`),{context:d,loading:f,error:p,gather:m,reset:h}=TL(),g=Z(kg().activeSession$)?.client,_=Z(g?.browse.entityTypes())??[],[v,y]=(0,u.useState)([]);(0,u.useEffect)(()=>{e&&(l(`configure-gather`),y([]),h())},[e,h]);let b=(0,u.useCallback)(e=>{l(`review`),m(n,{...e,...v.length?{excludeEntityTypes:v}:{}})},[m,n,v]),x=(0,u.useCallback)(e=>{o(n,e),t()},[o,n,t]),S=c===`configure-gather`?s.gatherTitle:c===`review`?s.reviewTitle:s.configureTitle;return(0,F.jsx)(fY,{appear:!0,show:e,children:(0,F.jsxs)(MY,{as:`div`,className:`semiont-search-modal`,onClose:t,children:[(0,F.jsx)(dY,{enter:`ease-out duration-200`,enterFrom:`opacity-0`,enterTo:`opacity-100`,leave:`ease-in duration-150`,leaveFrom:`opacity-100`,leaveTo:`opacity-0`,children:(0,F.jsx)(`div`,{className:`semiont-search-modal__backdrop`})}),(0,F.jsx)(`div`,{className:`semiont-search-modal__wrapper`,children:(0,F.jsx)(`div`,{className:`semiont-search-modal__centering semiont-search-modal__centering--center`,children:(0,F.jsx)(dY,{enter:`ease-out duration-200`,enterFrom:`opacity-0 scale-95`,enterTo:`opacity-100 scale-100`,leave:`ease-in duration-150`,leaveFrom:`opacity-100 scale-100`,leaveTo:`opacity-0 scale-95`,children:(0,F.jsxs)(AY,{className:`semiont-search-modal__panel semiont-search-modal__panel--with-border semiont-search-modal__panel--gather`,children:[(0,F.jsxs)(`div`,{className:`semiont-search-modal__header`,children:[(0,F.jsx)(jY,{className:`semiont-search-modal__title`,children:S}),(0,F.jsx)(`button`,{onClick:t,className:`semiont-search-modal__close-button`,"aria-label":`Close`,children:`✕`})]}),c===`configure-gather`&&(0,F.jsx)(E1,{defaults:a,onGather:b,onCancel:t,translations:{intro:s.gatherIntro,includeContent:s.includeContent,includeSummary:s.includeSummary,depth:s.gatherDepth,maxResources:s.gatherMaxResources,cancel:s.cancel,gather:s.gatherButton},children:_.length>0&&(0,F.jsxs)(`div`,{className:`semiont-form__field semiont-form__entity-types`,children:[(0,F.jsx)(`label`,{className:`semiont-form__label`,children:s.excludeLabel}),(0,F.jsx)(`div`,{className:`semiont-form__entity-type-buttons`,children:_.map(e=>{let t=v.includes(e);return(0,F.jsx)(`button`,{type:`button`,className:`semiont-form__entity-type-button`,"data-selected":t,"aria-pressed":t,onClick:()=>y(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]),children:e},e)})})]})}),c===`review`&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(x1,{context:d,contextLoading:f,contextError:p,translations:{title:``,loadingContext:s.loadingContext,failedContext:s.failedContext,search:``,generate:``,compose:``,resolutionStrategyLabel:``,sourceContextLabel:s.sourceContextLabel,connectionsLabel:s.connectionsLabel,citedByLabel:s.citedByLabel,userHintLabel:``,userHintPlaceholder:``}}),(0,F.jsxs)(`div`,{className:`semiont-modal__actions`,style:{paddingTop:`0.5rem`},children:[(0,F.jsxs)(`button`,{type:`button`,onClick:()=>l(`configure-gather`),className:`semiont-button--secondary semiont-button--flex`,children:[`◀ `,s.back]}),(0,F.jsxs)(`button`,{type:`button`,onClick:()=>l(`configure-generation`),disabled:!d,className:`semiont-button--primary semiont-button--flex`,children:[s.next,` ▶`]})]})]}),c===`configure-generation`&&d&&(0,F.jsx)(S1,{defaultTitle:r,locale:i,context:d,onBack:()=>l(`review`),onCancel:t,onGenerate:x,translations:{resourceTitle:s.resourceTitle,resourceTitlePlaceholder:s.resourceTitlePlaceholder,additionalInstructions:s.additionalInstructions,additionalInstructionsPlaceholder:s.additionalInstructionsPlaceholder,language:s.language,languageHelp:s.languageHelp,creativity:s.creativity,creativityFocused:s.creativityFocused,creativityCreative:s.creativityCreative,maxLength:s.maxLength,maxLengthHelp:s.maxLengthHelp,cancel:s.cancel,back:s.back,generate:s.generate}})]})})})})]})})}var O1=ni(RE(),1);function k1(){let{announce:e}=IL();return{announceSearching:(0,u.useCallback)(()=>{e(`Searching...`,`polite`)},[e]),announceSearchResults:(0,u.useCallback)((t,n)=>{e(t===0?`No results found for ${n}`:t===1?`1 result found for ${n}`:`${t} results found for ${n}`,`polite`)},[e]),announceSelection:(0,u.useCallback)((t,n)=>{e(`Selected ${n}: ${t}. Press Enter to navigate.`,`polite`)},[e]),announceNavigation:(0,u.useCallback)((t,n)=>{e(`Navigating to ${n}: ${t}`,`assertive`)},[e])}}var A1=300,j1=5;function M1({isOpen:e,onClose:t,onNavigate:n,translations:r={}}){let{announceSearchResults:i,announceSearching:a}=k1(),o=Z(kg().activeSession$)?.client,s=(0,u.useRef)(o);s.current=o;let[c,l]=(0,u.useState)(0),d={placeholder:r.placeholder||`Search resources, entities...`,searching:r.searching||`Searching...`,noResults:r.noResults||`No results found for`,startTyping:r.startTyping||`Start typing to search...`,navigate:r.navigate||`Navigate`,select:r.select||`Select`,close:r.close||`Close`,enter:r.enter||`Enter`,esc:r.esc||`ESC`},[f]=(0,u.useState)(()=>pf(e=>s.current.browse.resources({search:e,limit:j1}).pipe((0,O1.map)(e=>{if(e!==void 0)return e.map(e=>{let t=ls(e);return t?{type:`resource`,id:t,name:e.name,content:e.content?.substring(0,150)}:null}).filter(e=>e!==null)})),{debounceMs:A1}));(0,u.useEffect)(()=>()=>f.dispose(),[f]);let p=Z(f.query$)??``,m=Z(f.state$),h=m?.results??[],g=m?.isSearching??!1;(0,u.useEffect)(()=>{e&&(f.setQuery(``),l(0))},[e,f]),(0,u.useEffect)(()=>{l(0)},[h.length]),(0,u.useEffect)(()=>{p.trim()&&(g?a():i(h.length,p))},[g,h.length]);let _=e=>{e.key===`ArrowDown`?(e.preventDefault(),l(e=>(e+1)%Math.max(1,h.length))):e.key===`ArrowUp`?(e.preventDefault(),l(e=>(e-1+Math.max(1,h.length))%Math.max(1,h.length))):e.key===`Enter`&&h[c]&&(e.preventDefault(),v(h[c]))},v=e=>{t(),n(e.type,e.id)};return(0,F.jsx)(fY,{appear:!0,show:e,children:(0,F.jsxs)(MY,{as:`div`,className:`semiont-search-modal`,onClose:t,children:[(0,F.jsx)(dY,{enter:`ease-out duration-200`,enterFrom:`opacity-0`,enterTo:`opacity-100`,leave:`ease-in duration-150`,leaveFrom:`opacity-100`,leaveTo:`opacity-0`,children:(0,F.jsx)(`div`,{className:`semiont-search-modal__backdrop`})}),(0,F.jsx)(`div`,{className:`semiont-search-modal__wrapper`,children:(0,F.jsx)(`div`,{className:`semiont-search-modal__centering`,children:(0,F.jsx)(dY,{enter:`ease-out duration-200`,enterFrom:`opacity-0 scale-95`,enterTo:`opacity-100 scale-100`,leave:`ease-in duration-150`,leaveFrom:`opacity-100 scale-100`,leaveTo:`opacity-0 scale-95`,children:(0,F.jsxs)(AY,{className:`semiont-search-modal__panel`,children:[(0,F.jsxs)(`div`,{className:`semiont-search-modal__input-container`,children:[(0,F.jsx)(`div`,{className:`semiont-search-modal__search-icon-wrapper`,children:(0,F.jsx)(`svg`,{className:`semiont-search-modal__search-icon`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,F.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z`})})}),(0,F.jsx)(`input`,{type:`text`,value:p,onChange:e=>f.setQuery(e.target.value),onKeyDown:_,placeholder:d.placeholder,className:`semiont-search-modal__input`,autoFocus:!0}),(0,F.jsx)(`div`,{className:`semiont-search-modal__esc-wrapper`,children:(0,F.jsx)(`kbd`,{className:`semiont-search-modal__kbd`,children:d.esc})})]}),(0,F.jsxs)(`div`,{className:`semiont-search-modal__results`,children:[g&&(0,F.jsx)(`div`,{className:`semiont-search-modal__empty`,children:d.searching}),!g&&p&&h.length===0&&(0,F.jsxs)(`div`,{className:`semiont-search-modal__empty`,children:[d.noResults,` "`,p,`"`]}),!g&&h.length>0&&(0,F.jsx)(`div`,{className:`semiont-search-modal__results-list`,children:h.map((e,t)=>(0,F.jsxs)(`button`,{onClick:()=>v(e),onMouseEnter:()=>l(t),className:`semiont-search-modal__result ${t===c?`semiont-search-modal__result--selected`:``}`,children:[(0,F.jsx)(`div`,{className:`semiont-search-modal__result-icon-wrapper`,children:e.type===`resource`?(0,F.jsx)(`svg`,{className:`semiont-search-modal__result-icon semiont-search-modal__result-icon--resource`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,F.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z`})}):(0,F.jsx)(`svg`,{className:`semiont-search-modal__result-icon semiont-search-modal__result-icon--entity`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,F.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z`})})}),(0,F.jsxs)(`div`,{className:`semiont-search-modal__result-content`,children:[(0,F.jsxs)(`div`,{className:`semiont-search-modal__result-header`,children:[(0,F.jsx)(`span`,{className:`semiont-search-modal__result-name`,children:e.name}),e.type===`entity`&&e.entityType&&(0,F.jsx)(`span`,{className:`semiont-search-modal__result-badge`,children:e.entityType})]}),e.content&&(0,F.jsx)(`p`,{className:`semiont-search-modal__result-description`,children:e.content})]}),t===c&&(0,F.jsx)(`div`,{className:`semiont-search-modal__result-action`,children:(0,F.jsx)(`kbd`,{className:`semiont-search-modal__kbd`,children:d.enter})})]},`${e.type}-${e.id}`))}),!g&&!p&&(0,F.jsxs)(`div`,{className:`semiont-search-modal__help`,children:[(0,F.jsx)(`div`,{className:`semiont-search-modal__help-text`,children:d.startTyping}),(0,F.jsxs)(`div`,{className:`semiont-search-modal__shortcuts`,children:[(0,F.jsxs)(`div`,{className:`semiont-search-modal__shortcut`,children:[(0,F.jsx)(`kbd`,{className:`semiont-search-modal__kbd semiont-search-modal__kbd--small`,children:`↑↓`}),d.navigate]}),(0,F.jsxs)(`div`,{className:`semiont-search-modal__shortcut`,children:[(0,F.jsx)(`kbd`,{className:`semiont-search-modal__kbd semiont-search-modal__kbd--small`,children:d.enter}),d.select]}),(0,F.jsxs)(`div`,{className:`semiont-search-modal__shortcut`,children:[(0,F.jsx)(`kbd`,{className:`semiont-search-modal__kbd semiont-search-modal__kbd--small`,children:`Esc`}),d.close]})]})]})]})]})})})})]})})}ni(RE(),1);function N1(){return(0,F.jsx)(`div`,{className:`semiont-skip-links`,children:(0,F.jsxs)(`div`,{className:`semiont-skip-links-container`,children:[(0,F.jsx)(`a`,{href:`#main-content`,className:`semiont-skip-link semiont-skip-link-first`,children:`Skip to main content`}),(0,F.jsx)(`a`,{href:`#main-navigation`,className:`semiont-skip-link`,children:`Skip to navigation`}),(0,F.jsx)(`a`,{href:`#search`,className:`semiont-skip-link semiont-skip-link-last`,children:`Skip to search`})]})})}function P1({isFullyAuthenticated:e=!1,isAuthenticated:t=!1,hasValidBackendToken:n=!1}){let r=Z(kg().activeSession$)?.client,[i,a]=(0,u.useState)(null),[o,s]=(0,u.useState)(!0),[c,l]=(0,u.useState)(null);return(0,u.useEffect)(()=>{if(!r){s(!1);return}let e=()=>{r.admin.status().then(e=>{a(e),l(null),s(!1)}).catch(e=>{l(e instanceof Error?e:Error(String(e))),s(!1)})};e();let t=setInterval(e,3e4);return()=>clearInterval(t)},[r]),(0,F.jsxs)(`section`,{className:`semiont-status-display`,"data-status":t&&!n?`warning`:e?i?`success`:o?`loading`:`error`:`info`,role:`status`,"aria-live":`polite`,"aria-label":`System status information`,children:[(0,F.jsxs)(`p`,{className:`semiont-status-message`,children:[(0,F.jsx)(`span`,{className:`sr-only`,children:`System status: `}),(()=>{if(t&&!n)return`🚀 Frontend Status: Ready • Backend: Please sign out and sign in again to reconnect`;if(!e)return`🚀 Frontend Status: Ready • Backend: Authentication required`;if(i)return`\u{1F680} Frontend Status: Ready \u2022 Backend: ${i.status} (v${i.version})`;if(o)return`🚀 Frontend Status: Ready • Backend: Connecting...`;if(c){let e=c.message;return e.includes(`401`)||e.includes(`Unauthorized`)?`🚀 Frontend Status: Ready • Backend: Please sign out and sign in again`:`🚀 Frontend Status: Ready • Backend: Connection failed`}return`🚀 Frontend Status: Ready • Backend: Unknown`})()]}),e?c?(0,F.jsxs)(`p`,{className:`semiont-status-hint semiont-status-error-hint`,role:`alert`,children:[(0,F.jsx)(`span`,{className:`sr-only`,children:`Error: `}),`Check that the backend server is running and accessible`]}):null:(0,F.jsx)(`p`,{className:`semiont-status-hint`,children:`Sign in to view backend status`})]})}function F1({t:e,className:t=``,size:n=`lg`,showTagline:r=!0,animated:i=!0,compactTagline:a=!1}){return(0,F.jsxs)(`div`,{className:`semiont-branding ${t}`,"data-size":n,"data-animated":i,"data-compact-tagline":a,children:[(0,F.jsx)(`h1`,{className:`semiont-branding-title`,children:(0,F.jsx)(`span`,{className:`semiont-branding-text`,children:`Semiont`})}),r&&(0,F.jsx)(`h2`,{className:`semiont-branding-tagline`,children:e(`tagline`)})]})}function I1({Link:e,routes:t,t:n,tHome:r,showBranding:i=!0,brandingLink:a=`/`,variant:o=`standalone`,isAuthenticated:s=!1,isAdmin:c=!1,isModerator:l=!1,currentPath:u}){let{isOpen:d,toggle:f,close:p,dropdownRef:m}=CL();if(o===`floating`&&i)return(0,F.jsxs)(`div`,{className:`semiont-unified-header semiont-unified-header--floating`,"data-variant":`floating`,ref:m,children:[(0,F.jsx)(`button`,{onClick:f,className:`semiont-unified-header__branding-button`,"aria-label":`Navigation menu`,"aria-expanded":d,"aria-controls":`nav-menu-dropdown-1`,"aria-haspopup":`true`,id:`nav-menu-button-1`,children:(0,F.jsx)(F1,{t:r,size:`sm`,showTagline:!0,animated:!1,compactTagline:!0,className:`semiont-unified-header__branding`})}),d&&s&&(0,F.jsx)(`div`,{id:`nav-menu-dropdown-1`,className:`semiont-unified-header__dropdown`,role:`menu`,"aria-orientation":`vertical`,"aria-labelledby":`nav-menu-button-1`,children:(0,F.jsx)(YX,{Link:e,routes:t,t:n,isAdmin:c,isModerator:l,brandingLink:a,onItemClick:p,currentPath:u})})]});let h=(0,F.jsxs)(`div`,{className:`semiont-unified-header__content`,"data-variant":o,children:[i?(0,F.jsxs)(`div`,{className:`semiont-unified-header__branding-wrapper`,ref:m,children:[(0,F.jsx)(`button`,{onClick:f,className:`semiont-unified-header__branding-button`,"aria-label":`Navigation menu`,"aria-expanded":d,"aria-controls":`nav-menu-dropdown-2`,"aria-haspopup":`true`,id:`nav-menu-button-2`,children:(0,F.jsx)(F1,{t:r,size:`sm`,showTagline:!0,animated:!1,compactTagline:!0,className:`semiont-unified-header__branding`})}),d&&s&&(0,F.jsx)(`div`,{id:`nav-menu-dropdown-2`,className:`semiont-unified-header__dropdown`,role:`menu`,"aria-orientation":`vertical`,"aria-labelledby":`nav-menu-button-2`,children:(0,F.jsx)(YX,{Link:e,routes:t,t:n,isAdmin:c,isModerator:l,brandingLink:a,onItemClick:p,currentPath:u})})]}):(0,F.jsx)(`div`,{}),(0,F.jsx)(`div`,{className:`semiont-unified-header__actions`,"data-variant":o})]});return o===`standalone`?(0,F.jsx)(`header`,{className:`semiont-unified-header semiont-unified-header--standalone`,"data-variant":`standalone`,children:(0,F.jsx)(`div`,{className:`semiont-unified-header__container`,children:h})}):h}function L1({Link:e,routes:t,t:n,tHome:r,children:i,brandingLink:a=`/`,collapsible:o=!1,storageKey:s=`leftSidebarCollapsed`,isAdmin:c=!1,isModerator:l=!1,currentPath:d}){let[f,p]=(0,u.useState)(!1),{width:m,setWidth:h,minWidth:g,maxWidth:_}=_L({defaultWidth:256,minWidth:192,maxWidth:400,storageKey:`semiont-left-sidebar-width`});return(0,u.useEffect)(()=>{o&&localStorage.getItem(s)===`true`&&p(!0)},[o,s]),(0,F.jsxs)(`aside`,{className:`semiont-left-sidebar`,"data-collapsed":f,style:f?void 0:{width:`${m}px`,position:`relative`},children:[!f&&(0,F.jsx)(lG,{onResize:h,minWidth:g,maxWidth:_,position:`right`,ariaLabel:`Resize left sidebar`}),(0,F.jsx)(`div`,{className:`semiont-left-sidebar__header`,"data-collapsed":f,children:(0,F.jsx)(e,{href:a,className:`semiont-left-sidebar__branding-button`,"aria-label":`Go to home page`,children:f?(0,F.jsx)(`div`,{className:`semiont-left-sidebar__logo-collapsed`,children:(0,F.jsx)(`span`,{className:`semiont-left-sidebar__logo-text`,children:`S`})}):(0,F.jsx)(F1,{t:r,size:`sm`,showTagline:!1,animated:!1,className:``})})}),(0,F.jsx)(`nav`,{role:`navigation`,"aria-label":`Main navigation`,id:`main-navigation`,className:`semiont-left-sidebar__content`,children:typeof i==`function`?i(f,()=>{if(!o)return;let e=!f;p(e),localStorage.setItem(s,e.toString())},r=>(0,F.jsx)(YX,{Link:e,routes:t,t:n,isAdmin:c,isModerator:l,brandingLink:a,onItemClick:r,currentPath:d})):i})]})}function R1({Link:e,routes:t,t:n,tNav:r,tHome:i,children:a,className:o=``,showAuthLinks:s=!0,CookiePreferences:c,onOpenKeyboardHelp:l}){return(0,F.jsxs)(`div`,{className:`semiont-page-layout`,children:[(0,F.jsx)(N1,{}),(0,F.jsx)(`header`,{role:`banner`,className:`semiont-page-layout__header`,children:(0,F.jsx)(`div`,{className:`semiont-page-layout__header-container`,children:(0,F.jsx)(I1,{Link:e,routes:t,t:r,tHome:i,showAuthLinks:s,brandingLink:`/`,variant:`embedded`})})}),(0,F.jsx)(`main`,{role:`main`,id:`main-content`,tabIndex:-1,className:`semiont-page-layout__main ${o}`,children:a}),(0,F.jsx)(JX,{Link:e,routes:t,t:n,...c&&{CookiePreferences:c},...l&&{onOpenKeyboardHelp:l}})]})}function z1({message:e}){return(0,F.jsx)(`div`,{className:`semiont-loading-state-wrapper`,children:(0,F.jsx)(`div`,{className:`semiont-loading-state semiont-loading-state-compose`,children:(0,F.jsx)(`p`,{className:`semiont-loading-message`,children:e})})})}function B1(){return(0,F.jsx)(`div`,{className:`semiont-loading-state semiont-loading-state-resource`,children:(0,F.jsx)(`p`,{className:`semiont-loading-message`,children:`Loading resource...`})})}function V1({error:e,onRetry:t}){return(0,F.jsxs)(`div`,{className:`semiont-error-state semiont-error-state-resource`,children:[(0,F.jsx)(`p`,{className:`semiont-error-message`,children:e instanceof Error?e.message:`Failed to load resource`}),(0,F.jsx)(`button`,{onClick:t,className:`semiont-button`,"data-variant":`secondary`,children:`Try Again`})]})}function H1({title:e,titleId:t,...n},r){return u.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?u.createElement(`title`,{id:t},e):null,u.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M4.26 10.147a60.438 60.438 0 0 0-.491 6.347A48.62 48.62 0 0 1 12 20.904a48.62 48.62 0 0 1 8.232-4.41 60.46 60.46 0 0 0-.491-6.347m-15.482 0a50.636 50.636 0 0 0-2.658-.813A59.906 59.906 0 0 1 12 3.493a59.903 59.903 0 0 1 10.399 5.84c-.896.248-1.783.52-2.658.814m-15.482 0A50.717 50.717 0 0 1 12 13.489a50.702 50.702 0 0 1 7.74-3.342M6.75 15a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm0 0v-3.675A55.378 55.378 0 0 1 12 8.443m-7.007 11.55A5.981 5.981 0 0 0 6.75 15.75v-1.5`}))}var U1=u.forwardRef(H1);function W1({title:e,titleId:t,...n},r){return u.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?u.createElement(`title`,{id:t},e):null,u.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z`}))}var G1=u.forwardRef(W1);function K1({title:e,titleId:t,...n},r){return u.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?u.createElement(`title`,{id:t},e):null,u.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z`}))}var q1=u.forwardRef(K1);function J1({title:e,titleId:t,...n},r){return u.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?u.createElement(`title`,{id:t},e):null,u.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`m6.75 7.5 3 2.25-3 2.25m4.5 0h3m-9 8.25h13.5A2.25 2.25 0 0 0 21 18V6a2.25 2.25 0 0 0-2.25-2.25H5.25A2.25 2.25 0 0 0 3 6v12a2.25 2.25 0 0 0 2.25 2.25Z`}))}var Y1=u.forwardRef(J1);function X1({title:e,titleId:t,...n},r){return u.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?u.createElement(`title`,{id:t},e):null,u.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 9v3.75m9-.75a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 3.75h.008v.008H12v-.008Z`}))}var Z1=u.forwardRef(X1);function Q1({title:e,titleId:t,...n},r){return u.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?u.createElement(`title`,{id:t},e):null,u.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z`}))}var $1=u.forwardRef(Q1);function e0({title:e,titleId:t,...n},r){return u.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?u.createElement(`title`,{id:t},e):null,u.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 21a9.004 9.004 0 0 0 8.716-6.747M12 21a9.004 9.004 0 0 1-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 0 1 7.843 4.582M12 3a8.997 8.997 0 0 0-7.843 4.582m15.686 0A11.953 11.953 0 0 1 12 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0 1 21 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0 1 12 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 0 1 3 12c0-1.605.42-3.113 1.157-4.418`}))}var t0=u.forwardRef(e0);function n0({title:e,titleId:t,...n},r){return u.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?u.createElement(`title`,{id:t},e):null,u.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z`}))}var r0=u.forwardRef(n0);function i0({title:e,titleId:t,...n},r){return u.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?u.createElement(`title`,{id:t},e):null,u.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 18v-5.25m0 0a6.01 6.01 0 0 0 1.5-.189m-1.5.189a6.01 6.01 0 0 1-1.5-.189m3.75 7.478a12.06 12.06 0 0 1-4.5 0m3.75 2.383a14.406 14.406 0 0 1-3 0M14.25 18v-.192c0-.983.658-1.823 1.508-2.316a7.5 7.5 0 1 0-7.517 0c.85.493 1.509 1.333 1.509 2.316V18`}))}var a0=u.forwardRef(i0);function o0({title:e,titleId:t,...n},r){return u.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?u.createElement(`title`,{id:t},e):null,u.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z`}))}var s0=u.forwardRef(o0);function c0({title:e,titleId:t,...n},r){return u.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?u.createElement(`title`,{id:t},e):null,u.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L6.832 19.82a4.5 4.5 0 0 1-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 0 1 1.13-1.897L16.863 4.487Zm0 0L19.5 7.125`}))}var l0=u.forwardRef(c0);function u0({title:e,titleId:t,...n},r){return u.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?u.createElement(`title`,{id:t},e):null,u.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 4.5v15m7.5-7.5h-15`}))}var d0=u.forwardRef(u0);function f0({title:e,titleId:t,...n},r){return u.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?u.createElement(`title`,{id:t},e):null,u.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 3v17.25m0 0c-1.472 0-2.882.265-4.185.75M12 20.25c1.472 0 2.882.265 4.185.75M18.75 4.97A48.416 48.416 0 0 0 12 4.5c-2.291 0-4.545.16-6.75.47m13.5 0c1.01.143 2.01.317 3 .52m-3-.52 2.62 10.726c.122.499-.106 1.028-.589 1.202a5.988 5.988 0 0 1-2.031.352 5.988 5.988 0 0 1-2.031-.352c-.483-.174-.711-.703-.59-1.202L18.75 4.971Zm-16.5.52c.99-.203 1.99-.377 3-.52m0 0 2.62 10.726c.122.499-.106 1.028-.589 1.202a5.989 5.989 0 0 1-2.031.352 5.989 5.989 0 0 1-2.031-.352c-.483-.174-.711-.703-.59-1.202L5.25 4.971Z`}))}var p0=u.forwardRef(f0);function m0({title:e,titleId:t,...n},r){return u.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?u.createElement(`title`,{id:t},e):null,u.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9 12.75 11.25 15 15 9.75m-3-7.036A11.959 11.959 0 0 1 3.598 6 11.99 11.99 0 0 0 3 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285Z`}))}var h0=u.forwardRef(m0);function g0({title:e,titleId:t,...n},r){return u.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?u.createElement(`title`,{id:t},e):null,u.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9.568 3H5.25A2.25 2.25 0 0 0 3 5.25v4.318c0 .597.237 1.17.659 1.591l9.581 9.581c.699.699 1.78.872 2.607.33a18.095 18.095 0 0 0 5.223-5.223c.542-.827.369-1.908-.33-2.607L11.16 3.66A2.25 2.25 0 0 0 9.568 3Z`}),u.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M6 6h.008v.008H6V6Z`}))}var _0=u.forwardRef(g0);function v0({title:e,titleId:t,...n},r){return u.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?u.createElement(`title`,{id:t},e):null,u.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0`}))}var y0=u.forwardRef(v0);function b0({title:e,titleId:t,...n},r){return u.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?u.createElement(`title`,{id:t},e):null,u.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M17.982 18.725A7.488 7.488 0 0 0 12 15.75a7.488 7.488 0 0 0-5.982 2.975m11.963 0a9 9 0 1 0-11.963 0m11.963 0A8.966 8.966 0 0 1 12 21a8.966 8.966 0 0 1-5.982-2.275M15 9.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z`}))}var x0=u.forwardRef(b0),S0=ni(Tg(),1),C0=[`knowledge-base`,`user`,`settings`],w0={linking:`reference`,commenting:`comment`,tagging:`tag`,highlighting:`highlight`,assessing:`assessment`};function T0(e,t){let n=[],r=new S0.BehaviorSubject(t?.initialPanel??null),i=new S0.BehaviorSubject(null),a=new S0.BehaviorSubject(null),o=0;if(t?.onPanelChange){let e=t.onPanelChange;n.push(r.subscribe(e))}return n.push(e.stream(`panel:toggle`).subscribe(({panel:e})=>{let t=r.getValue();r.next(t===e?null:e)})),n.push(e.stream(`panel:open`).subscribe(({panel:e,scrollToAnnotationId:t,motivation:n})=>{if(t&&i.next(t),n){let e=w0[n]||`highlight`;a.next({tab:e,generation:++o})}r.next(e)})),n.push(e.stream(`panel:close`).subscribe(()=>{r.next(null)})),{activePanel$:r.asObservable(),scrollToAnnotationId$:i.asObservable(),panelInitialTab$:a.asObservable(),openPanel:t=>e.emit(`panel:open`,{panel:t}),closePanel:()=>e.emit(`panel:close`,void 0),togglePanel:t=>e.emit(`panel:toggle`,{panel:t}),onScrollCompleted:()=>i.next(null),dispose(){n.forEach(e=>e.unsubscribe()),r.complete(),i.complete(),a.complete()}}}function E0({suggestedFeatures:e,theme:t,showLineNumbers:n,activePanel:r,translations:i,StatusDisplay:a,ToolbarPanels:o,Toolbar:s}){return(0,F.jsxs)(`div`,{className:`semiont-page${r&&C0.includes(r)?` semiont-page--panel-open`:``}`,children:[(0,F.jsxs)(`div`,{className:`semiont-page__content`,children:[(0,F.jsxs)(`div`,{className:`semiont-page__header`,children:[(0,F.jsx)(`h1`,{className:`semiont-page__title`,children:i.title}),(0,F.jsx)(`p`,{className:`semiont-page__subtitle`,children:i.subtitle})]}),(0,F.jsxs)(`div`,{className:`semiont-admin__section`,children:[(0,F.jsx)(`h2`,{className:`semiont-admin__section-title`,children:i.systemStatus}),(0,F.jsx)(a,{})]}),(0,F.jsxs)(`div`,{className:`semiont-admin__section`,children:[(0,F.jsx)(`h2`,{className:`semiont-admin__section-title`,children:i.cliOperations}),(0,F.jsx)(`p`,{className:`semiont-admin__section-description`,children:i.cliOperationsDescription}),(0,F.jsx)(`div`,{className:`semiont-admin__features-grid`,children:e.map(e=>(0,F.jsx)(`div`,{className:`semiont-devops-feature`,children:(0,F.jsxs)(`div`,{className:`semiont-devops-feature__header`,children:[(0,F.jsx)(`div`,{className:`semiont-devops-feature__icon-box`,children:(0,F.jsx)(e.icon,{className:`semiont-devops-feature__icon`})}),(0,F.jsxs)(`div`,{className:`semiont-devops-feature__content`,children:[(0,F.jsx)(`h3`,{className:`semiont-devops-feature__title`,children:e.title}),(0,F.jsx)(`p`,{className:`semiont-devops-feature__description`,children:e.description}),(0,F.jsx)(`p`,{className:`semiont-devops-feature__available`,children:e.available})]})]})},e.title))})]}),(0,F.jsx)(`div`,{className:`semiont-admin__info-box`,children:(0,F.jsxs)(`div`,{className:`semiont-admin__info-box-content`,children:[(0,F.jsx)(`div`,{className:`semiont-admin__info-box-icon`,children:(0,F.jsx)(Y1,{className:`semiont-icon semiont-icon--info`})}),(0,F.jsxs)(`div`,{className:`semiont-admin__info-box-text`,children:[(0,F.jsx)(`h3`,{className:`semiont-admin__info-box-title`,children:i.cliTitle}),(0,F.jsxs)(`div`,{className:`semiont-admin__info-box-description`,children:[(0,F.jsx)(`p`,{children:i.cliDescription}),(0,F.jsx)(`code`,{className:`semiont-admin__info-box-code`,children:`semiont --help`})]})]})]})})]}),(0,F.jsxs)(`div`,{className:`semiont-page__sidebar`,children:[(0,F.jsx)(o,{activePanel:r,theme:t,showLineNumbers:n}),(0,F.jsx)(s,{context:`simple`,activePanel:r})]})]})}function D0({onExport:e,isExporting:t,translations:n}){return(0,F.jsxs)(`div`,{className:`semiont-admin__card`,children:[(0,F.jsx)(`h2`,{className:`semiont-admin__section-title`,children:n.title}),(0,F.jsx)(`p`,{className:`semiont-admin__section-description`,children:n.description}),(0,F.jsx)(`button`,{className:`semiont-exchange__button semiont-exchange__button--primary`,onClick:e,disabled:t,children:t?n.exporting:n.exportButton})]})}function O0({onFileSelected:e,onImport:t,onCancel:n,selectedFile:r,preview:i,isImporting:a,translations:o}){let s=(0,u.useRef)(null),[c,l]=(0,u.useState)(!1),[d,f]=(0,u.useState)(!1),p=(0,u.useCallback)(e=>{e.preventDefault(),l(!0)},[]),m=(0,u.useCallback)(()=>{l(!1)},[]),h=(0,u.useCallback)(t=>{t.preventDefault(),l(!1),f(!1);let n=t.dataTransfer.files[0];n&&e(n)},[e]),g=(0,u.useCallback)(t=>{f(!1);let n=t.target.files?.[0];n&&e(n)},[e]);return(0,F.jsxs)(`div`,{className:`semiont-admin__card`,children:[(0,F.jsx)(`h2`,{className:`semiont-admin__section-title`,children:o.title}),(0,F.jsx)(`p`,{className:`semiont-admin__section-description`,children:o.description}),(0,F.jsxs)(`div`,{className:`semiont-exchange__dropzone${c?` semiont-exchange__dropzone--active`:``}`,onDragOver:p,onDragLeave:m,onDrop:h,onClick:()=>s.current?.click(),children:[(0,F.jsx)(`p`,{className:`semiont-exchange__dropzone-text`,children:c?o.dropzoneActive:o.dropzoneLabel}),r&&(0,F.jsxs)(`p`,{className:`semiont-exchange__file-info`,children:[r.name,` (`,(r.size/1024).toFixed(1),` KB)`]})]}),(0,F.jsx)(`input`,{ref:s,type:`file`,accept:`.tar.gz,.jsonl,.gz`,onChange:g,style:{display:`none`}}),i&&(0,F.jsxs)(`div`,{className:`semiont-exchange__preview`,children:[(0,F.jsxs)(`div`,{className:`semiont-exchange__preview-row`,children:[(0,F.jsx)(`span`,{className:`semiont-exchange__preview-label`,children:o.detectedFormat}),(0,F.jsxs)(`span`,{className:`semiont-exchange__preview-value`,children:[i.format,` v`,i.version]})]}),i.sourceUrl&&(0,F.jsxs)(`div`,{className:`semiont-exchange__preview-row`,children:[(0,F.jsx)(`span`,{className:`semiont-exchange__preview-label`,children:`Source`}),(0,F.jsx)(`span`,{className:`semiont-exchange__preview-value`,children:i.sourceUrl})]}),Object.keys(i.stats).length>0&&(0,F.jsxs)(`div`,{className:`semiont-exchange__preview-row`,children:[(0,F.jsx)(`span`,{className:`semiont-exchange__preview-label`,children:o.statsPreview}),(0,F.jsx)(`span`,{className:`semiont-exchange__preview-value`,children:Object.entries(i.stats).map(([e,t])=>`${t} ${e}`).join(`, `)})]})]}),d&&(0,F.jsxs)(`div`,{className:`semiont-exchange__confirm`,children:[(0,F.jsx)(`p`,{className:`semiont-exchange__confirm-title`,children:o.importConfirmTitle}),(0,F.jsx)(`p`,{className:`semiont-exchange__confirm-message`,children:o.importConfirmMessage}),(0,F.jsxs)(`div`,{className:`semiont-exchange__confirm-actions`,children:[(0,F.jsx)(`button`,{className:`semiont-exchange__button semiont-exchange__button--primary`,onClick:()=>{f(!1),t()},children:o.confirmImport}),(0,F.jsx)(`button`,{className:`semiont-exchange__button semiont-exchange__button--secondary`,onClick:()=>{f(!1)},children:o.cancelImport})]})]}),!d&&(0,F.jsxs)(`div`,{className:`semiont-exchange__actions`,children:[(0,F.jsx)(`button`,{className:`semiont-exchange__button semiont-exchange__button--primary`,onClick:()=>{f(!0)},disabled:!i||a,children:a?o.importing:o.importButton}),r&&(0,F.jsx)(`button`,{className:`semiont-exchange__button semiont-exchange__button--secondary`,onClick:n,disabled:a,children:o.cancelImport})]})]})}var k0={started:`phaseStarted`,complete:`phaseComplete`,error:`phaseError`},A0={eventsReplayed:`statsEventsReplayed`,resourcesCreated:`statsResourcesCreated`,annotationsCreated:`statsAnnotationsCreated`,entityTypesAdded:`statsEntityTypesAdded`};function j0({phase:e,message:t,result:n,translations:r}){let i=k0[e],a=i?r[i]:e,o=e===`complete`,s=e===`error`,c=n?.stats!=null&&typeof n.stats==`object`?n.stats:void 0,l=c?Object.entries(c).filter(e=>typeof e[1]==`number`):[];return(0,F.jsxs)(`div`,{className:`semiont-exchange__progress`,children:[(0,F.jsx)(`div`,{className:`semiont-exchange__phase-label${s?` semiont-exchange__phase-label--error`:o?` semiont-exchange__phase-label--complete`:``}`,children:a}),t&&!o&&!s&&(0,F.jsx)(`p`,{className:`semiont-exchange__progress-message`,children:t}),o&&l.length>0&&(0,F.jsx)(`div`,{className:`semiont-exchange__result`,children:l.map(([e,t])=>{let n=A0[e];return(0,F.jsxs)(`div`,{className:`semiont-exchange__result-stat`,children:[(0,F.jsx)(`span`,{className:`semiont-exchange__result-value`,children:t}),(0,F.jsx)(`span`,{className:`semiont-exchange__result-label`,children:n?r[n]:e})]},e)})}),s&&t&&(0,F.jsx)(`p`,{className:`semiont-exchange__error-message`,children:t})]})}function M0({onExport:e,isExporting:t,onFileSelected:n,onImport:r,onCancelImport:i,selectedFile:a,preview:o,isImporting:s,importPhase:c,importMessage:l,importResult:u,theme:d,showLineNumbers:f,activePanel:p,translations:m,ToolbarPanels:h,Toolbar:g}){return(0,F.jsxs)(`div`,{className:`semiont-page${p&&C0.includes(p)?` semiont-page--panel-open`:``}`,children:[(0,F.jsxs)(`div`,{className:`semiont-page__content`,children:[(0,F.jsxs)(`div`,{className:`semiont-page__header`,children:[(0,F.jsx)(`h1`,{className:`semiont-page__title`,children:m.title}),(0,F.jsx)(`p`,{className:`semiont-page__subtitle`,children:m.subtitle})]}),(0,F.jsxs)(`div`,{className:`semiont-exchange__cards`,children:[(0,F.jsx)(D0,{onExport:e,isExporting:t,translations:m.export}),(0,F.jsx)(O0,{onFileSelected:n,onImport:r,onCancel:i,selectedFile:a,preview:o,isImporting:s,translations:m.import})]}),c&&(0,F.jsx)(j0,{phase:c,message:l,result:u,translations:m.progress})]}),(0,F.jsxs)(`div`,{className:`semiont-page__sidebar`,children:[(0,F.jsx)(h,{activePanel:p,theme:d,showLineNumbers:f}),(0,F.jsx)(g,{context:`simple`,activePanel:p})]})]})}function N0({providers:e,allowedDomains:t,isLoading:n,theme:r,showLineNumbers:i,activePanel:a,translations:o,ToolbarPanels:s,Toolbar:c}){return(0,F.jsxs)(`div`,{className:`semiont-page${a&&C0.includes(a)?` semiont-page--panel-open`:``}`,children:[(0,F.jsx)(`div`,{className:`semiont-page__content`,children:(0,F.jsxs)(`div`,{className:`semiont-page__sections`,children:[(0,F.jsxs)(`div`,{className:`semiont-page__header`,children:[(0,F.jsx)(`h1`,{className:`semiont-page__title`,children:o.title}),(0,F.jsx)(`p`,{className:`semiont-page__subtitle`,children:o.subtitle})]}),(0,F.jsxs)(`div`,{className:`semiont-admin__card`,children:[(0,F.jsxs)(`div`,{className:`semiont-admin__card-header`,children:[(0,F.jsx)(h0,{className:`semiont-admin__card-icon semiont-admin__card-icon--primary`}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h3`,{className:`semiont-admin__card-title`,children:o.oauthProviders}),(0,F.jsx)(`p`,{className:`semiont-admin__card-description`,children:o.oauthProvidersDescription})]})]}),n?(0,F.jsx)(`div`,{className:`semiont-skeleton-group`,children:(0,F.jsx)(`div`,{className:`semiont-skeleton semiont-skeleton--bar`})}):e.length>0?(0,F.jsx)(`div`,{className:`semiont-provider-list`,children:e.map(e=>(0,F.jsxs)(`div`,{className:`semiont-provider-item`,children:[(0,F.jsxs)(`div`,{className:`semiont-provider-item__info`,children:[(0,F.jsx)(G1,{className:`semiont-provider-item__icon semiont-provider-item__icon--success`}),(0,F.jsx)(`span`,{className:`semiont-provider-item__name`,children:e.name}),e.clientId&&(0,F.jsxs)(`span`,{className:`semiont-provider-item__client-id`,children:[o.clientId,`: `,e.clientId]})]}),(0,F.jsx)(`span`,{className:`semiont-badge semiont-badge--success`,children:o.configured})]},e.name))}):(0,F.jsx)(`div`,{className:`semiont-empty-message`,children:o.noProvidersConfigured})]}),(0,F.jsxs)(`div`,{className:`semiont-admin__card`,children:[(0,F.jsxs)(`div`,{className:`semiont-admin__card-header`,children:[(0,F.jsx)(t0,{className:`semiont-admin__card-icon semiont-admin__card-icon--primary`}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h3`,{className:`semiont-admin__card-title`,children:o.allowedDomains}),(0,F.jsx)(`p`,{className:`semiont-admin__card-description`,children:o.allowedDomainsDescription})]})]}),n?(0,F.jsxs)(`div`,{className:`semiont-skeleton-group`,children:[(0,F.jsx)(`div`,{className:`semiont-skeleton semiont-skeleton--chip`}),(0,F.jsx)(`div`,{className:`semiont-skeleton semiont-skeleton--chip semiont-skeleton--chip-lg`})]}):t.length>0?(0,F.jsx)(`div`,{className:`semiont-domain-list`,children:t.map(e=>(0,F.jsxs)(`div`,{className:`semiont-chip semiont-chip--primary`,children:[`@`,e]},e))}):(0,F.jsx)(`div`,{className:`semiont-empty-message`,children:o.noDomainsConfigured})]}),(0,F.jsx)(`div`,{className:`semiont-admin__info-box`,children:(0,F.jsxs)(`div`,{className:`semiont-info-box__content`,children:[(0,F.jsx)(r0,{className:`semiont-info-box__icon`}),(0,F.jsxs)(`div`,{className:`semiont-info-box__text`,children:[(0,F.jsx)(`p`,{className:`semiont-info-box__title`,children:o.configManagementTitle}),(0,F.jsx)(`p`,{className:`semiont-info-box__description`,children:o.configManagementDescription}),(0,F.jsxs)(`ul`,{className:`semiont-info-box__list`,children:[(0,F.jsx)(`li`,{children:o.configLocalDev}),(0,F.jsxs)(`li`,{children:[o.configCloudDeploy,` `,(0,F.jsx)(`code`,{className:`semiont-code-inline`,children:o.configCloudDeployCommand}),` `,o.configCloudDeployEnd]}),(0,F.jsx)(`li`,{children:o.configAWS})]})]})]})})]})}),(0,F.jsxs)(`div`,{className:`semiont-page__sidebar`,children:[(0,F.jsx)(s,{activePanel:a,theme:r,showLineNumbers:i}),(0,F.jsx)(c,{context:`simple`,activePanel:a})]})]})}function P0({onExport:e,isExporting:t,onFileSelected:n,onImport:r,onCancelImport:i,selectedFile:a,preview:o,isImporting:s,importPhase:c,importMessage:l,importResult:u,theme:d,showLineNumbers:f,activePanel:p,translations:m,ToolbarPanels:h,Toolbar:g}){return(0,F.jsxs)(`div`,{className:`semiont-page${p&&C0.includes(p)?` semiont-page--panel-open`:``}`,children:[(0,F.jsxs)(`div`,{className:`semiont-page__content`,children:[(0,F.jsxs)(`div`,{className:`semiont-page__header`,children:[(0,F.jsx)(`h1`,{className:`semiont-page__title`,children:m.title}),(0,F.jsx)(`p`,{className:`semiont-page__subtitle`,children:m.subtitle})]}),(0,F.jsxs)(`div`,{className:`semiont-exchange__cards`,children:[(0,F.jsx)(D0,{onExport:e,isExporting:t,translations:m.export}),(0,F.jsx)(O0,{onFileSelected:n,onImport:r,onCancel:i,selectedFile:a,preview:o,isImporting:s,translations:m.import})]}),c&&(0,F.jsx)(j0,{phase:c,message:l,result:u,translations:m.progress})]}),(0,F.jsxs)(`div`,{className:`semiont-page__sidebar`,children:[(0,F.jsx)(h,{activePanel:p,theme:d,showLineNumbers:f}),(0,F.jsx)(g,{context:`simple`,activePanel:p})]})]})}function F0({user:e,onUpdate:t,onDelete:n,translations:r}){let i={admin:`semiont-badge semiont-badge--danger`,user:`semiont-badge semiont-badge--default`},a={active:`semiont-badge semiont-badge--success`,inactive:`semiont-badge semiont-badge--default`},o=e.isAdmin?`admin`:`user`,s=e.isActive?`active`:`inactive`;return(0,F.jsxs)(`tr`,{className:`semiont-table__row`,children:[(0,F.jsx)(`td`,{className:`semiont-table__cell`,children:(0,F.jsxs)(`div`,{className:`semiont-user-info`,children:[(0,F.jsx)(x0,{className:`semiont-user-info__avatar`}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`semiont-user-info__name`,children:e.name||r.noName}),(0,F.jsx)(`div`,{className:`semiont-user-info__email`,children:e.email})]})]})}),(0,F.jsx)(`td`,{className:`semiont-table__cell`,children:(0,F.jsxs)(`span`,{className:`semiont-table__text--secondary`,children:[`@`,e.domain]})}),(0,F.jsx)(`td`,{className:`semiont-table__cell`,children:(0,F.jsx)(`span`,{className:i[o],children:r[o]})}),(0,F.jsx)(`td`,{className:`semiont-table__cell`,children:(0,F.jsx)(`span`,{className:a[s],children:r[s]})}),(0,F.jsx)(`td`,{className:`semiont-table__cell semiont-table__text--secondary`,children:e.lastLogin?new Date(e.lastLogin).toLocaleDateString():r.never}),(0,F.jsx)(`td`,{className:`semiont-table__cell semiont-table__text--secondary`,children:new Date(e.created).toLocaleDateString()}),(0,F.jsx)(`td`,{className:`semiont-table__cell semiont-table__cell--actions`,children:(0,F.jsxs)(`div`,{className:`semiont-table__actions`,children:[(0,F.jsx)(`button`,{onClick:()=>t(e.id,{isAdmin:!e.isAdmin}),className:`semiont-action-button semiont-action-button--info`,title:e.isAdmin?r.removeAdmin:r.makeAdmin,children:(0,F.jsx)(h0,{className:`semiont-action-button__icon`})}),(0,F.jsx)(`button`,{onClick:()=>t(e.id,{isActive:!e.isActive}),className:`semiont-action-button semiont-action-button--warning`,title:e.isActive?r.deactivateUser:r.activateUser,children:(0,F.jsx)(l0,{className:`semiont-action-button__icon`})}),(0,F.jsx)(`button`,{onClick:()=>n(e.id),className:`semiont-action-button semiont-action-button--danger`,title:r.deleteUser,children:(0,F.jsx)(y0,{className:`semiont-action-button__icon`})})]})})]})}function I0({users:e,userStats:t,isLoadingUsers:n,isLoadingStats:r,onUpdateUser:i,onDeleteUser:a,onAddUser:o,onExportUsers:s,theme:c,showLineNumbers:l,activePanel:d,translations:f,ToolbarPanels:p,Toolbar:m,buttonStyles:h}){let[g,_]=(0,u.useState)(``),[v,y]=(0,u.useState)(`all`),[b,x]=(0,u.useState)(`all`),S=e.filter(e=>{let t=(e.name||``).toLowerCase().includes(g.toLowerCase())||e.email.toLowerCase().includes(g.toLowerCase()),n=e.isAdmin?`admin`:`user`,r=e.isActive?`active`:`inactive`;return t&&(v===`all`||n===v)&&(b===`all`||r===b)});return(0,F.jsxs)(`div`,{className:`semiont-page${d&&C0.includes(d)?` semiont-page--panel-open`:``}`,children:[(0,F.jsx)(`div`,{className:`semiont-page__content`,children:(0,F.jsxs)(`div`,{className:`semiont-page__sections`,children:[(0,F.jsxs)(`div`,{className:`semiont-page__header-with-action`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h1`,{className:`semiont-page__title`,children:f.title}),(0,F.jsx)(`p`,{className:`semiont-page__subtitle`,children:f.subtitle})]}),(0,F.jsxs)(`button`,{onClick:o,className:h.primary.base,children:[(0,F.jsx)(d0,{className:`semiont-button__icon`}),f.addUser]})]}),(0,F.jsx)(`div`,{className:`semiont-admin__stats-grid`,children:r?[,,,,].fill(0).map((e,t)=>(0,F.jsx)(`div`,{className:`semiont-stat-card semiont-stat-card--loading`,children:(0,F.jsxs)(`div`,{className:`semiont-stat-card__content`,children:[(0,F.jsx)(`div`,{className:`semiont-skeleton semiont-skeleton--icon`}),(0,F.jsxs)(`div`,{className:`semiont-stat-card__text`,children:[(0,F.jsx)(`div`,{className:`semiont-skeleton semiont-skeleton--text`}),(0,F.jsx)(`div`,{className:`semiont-skeleton semiont-skeleton--number`})]})]})},t)):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`div`,{className:`semiont-stat-card`,children:(0,F.jsxs)(`div`,{className:`semiont-stat-card__content`,children:[(0,F.jsx)(`div`,{className:`semiont-stat-card__icon-wrapper`,children:(0,F.jsx)(x0,{className:`semiont-stat-card__icon semiont-stat-card__icon--primary`})}),(0,F.jsxs)(`div`,{className:`semiont-stat-card__text`,children:[(0,F.jsx)(`p`,{className:`semiont-stat-card__label`,children:f.totalUsers}),(0,F.jsx)(`p`,{className:`semiont-stat-card__value`,children:t?.totalUsers??0})]})]})}),(0,F.jsx)(`div`,{className:`semiont-stat-card`,children:(0,F.jsxs)(`div`,{className:`semiont-stat-card__content`,children:[(0,F.jsx)(`div`,{className:`semiont-stat-card__icon-wrapper`,children:(0,F.jsx)(`div`,{className:`semiont-stat-card__status-indicator semiont-stat-card__status-indicator--active`,children:(0,F.jsx)(`div`,{className:`semiont-stat-card__status-dot`})})}),(0,F.jsxs)(`div`,{className:`semiont-stat-card__text`,children:[(0,F.jsx)(`p`,{className:`semiont-stat-card__label`,children:f.activeUsers}),(0,F.jsx)(`p`,{className:`semiont-stat-card__value`,children:t?.activeUsers??0})]})]})}),(0,F.jsx)(`div`,{className:`semiont-stat-card`,children:(0,F.jsxs)(`div`,{className:`semiont-stat-card__content`,children:[(0,F.jsx)(`div`,{className:`semiont-stat-card__icon-wrapper`,children:(0,F.jsx)(h0,{className:`semiont-stat-card__icon semiont-stat-card__icon--danger`})}),(0,F.jsxs)(`div`,{className:`semiont-stat-card__text`,children:[(0,F.jsx)(`p`,{className:`semiont-stat-card__label`,children:f.administrators}),(0,F.jsx)(`p`,{className:`semiont-stat-card__value`,children:t?.adminUsers??0})]})]})}),(0,F.jsx)(`div`,{className:`semiont-stat-card`,children:(0,F.jsxs)(`div`,{className:`semiont-stat-card__content`,children:[(0,F.jsx)(`div`,{className:`semiont-stat-card__icon-wrapper`,children:(0,F.jsx)($1,{className:`semiont-stat-card__icon semiont-stat-card__icon--warning`})}),(0,F.jsxs)(`div`,{className:`semiont-stat-card__text`,children:[(0,F.jsx)(`p`,{className:`semiont-stat-card__label`,children:f.recentUsers}),(0,F.jsx)(`p`,{className:`semiont-stat-card__value`,children:t?.recentSignups?.length??0})]})]})})]})}),(0,F.jsx)(`div`,{className:`semiont-admin__filters-card`,children:(0,F.jsxs)(`div`,{className:`semiont-admin__filters-grid`,children:[(0,F.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,F.jsx)(`label`,{htmlFor:`search`,className:`semiont-form__label`,children:f.searchUsers}),(0,F.jsxs)(`div`,{className:`semiont-search-input`,children:[(0,F.jsx)(`div`,{className:`semiont-search-input__icon`,children:(0,F.jsx)(s0,{className:`semiont-icon semiont-icon--small`})}),(0,F.jsx)(`input`,{type:`text`,id:`search`,className:`semiont-search-input__field`,placeholder:f.searchPlaceholder,value:g,onChange:e=>_(e.target.value)})]})]}),(0,F.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,F.jsx)(`label`,{htmlFor:`role`,className:`semiont-form__label`,children:f.role}),(0,F.jsxs)(`select`,{id:`role`,className:`semiont-select`,value:v,onChange:e=>y(e.target.value),children:[(0,F.jsx)(`option`,{value:`all`,children:f.allRoles}),(0,F.jsx)(`option`,{value:`admin`,children:f.admin}),(0,F.jsx)(`option`,{value:`user`,children:f.user})]})]}),(0,F.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,F.jsx)(`label`,{htmlFor:`status`,className:`semiont-form__label`,children:f.status}),(0,F.jsxs)(`select`,{id:`status`,className:`semiont-select`,value:b,onChange:e=>x(e.target.value),children:[(0,F.jsx)(`option`,{value:`all`,children:f.allStatus}),(0,F.jsx)(`option`,{value:`active`,children:f.active}),(0,F.jsx)(`option`,{value:`inactive`,children:f.inactive})]})]}),(0,F.jsx)(`div`,{className:`semiont-form__field semiont-form__field--align-end`,children:(0,F.jsx)(`button`,{onClick:s,className:`${h.secondary.base} semiont-button--full-width`,children:f.exportUsers})})]})}),(0,F.jsxs)(`div`,{className:`semiont-admin__table-card`,children:[(0,F.jsx)(`div`,{className:`semiont-table-container`,children:n?(0,F.jsxs)(`div`,{className:`semiont-loading-state`,children:[(0,F.jsx)(`div`,{className:`semiont-spinner`}),(0,F.jsx)(`p`,{className:`semiont-loading-state__text`,children:f.loadingUsers})]}):(0,F.jsxs)(`table`,{className:`semiont-table`,children:[(0,F.jsx)(`thead`,{className:`semiont-table__head`,children:(0,F.jsxs)(`tr`,{children:[(0,F.jsx)(`th`,{className:`semiont-table__header`,children:f.userColumn}),(0,F.jsx)(`th`,{className:`semiont-table__header`,children:f.domainColumn}),(0,F.jsx)(`th`,{className:`semiont-table__header`,children:f.roleColumn}),(0,F.jsx)(`th`,{className:`semiont-table__header`,children:f.statusColumn}),(0,F.jsx)(`th`,{className:`semiont-table__header`,children:f.lastLoginColumn}),(0,F.jsx)(`th`,{className:`semiont-table__header`,children:f.joinedColumn}),(0,F.jsx)(`th`,{className:`semiont-table__header semiont-table__header--actions`,children:f.actionsColumn})]})}),(0,F.jsx)(`tbody`,{className:`semiont-table__body`,children:S.map(e=>(0,F.jsx)(F0,{user:e,onUpdate:i,onDelete:a,translations:f},e.id))})]})}),!n&&S.length===0&&(0,F.jsxs)(`div`,{className:`semiont-empty-state`,children:[(0,F.jsx)(x0,{className:`semiont-empty-state__icon`}),(0,F.jsx)(`h3`,{className:`semiont-empty-state__title`,children:f.noUsersFound}),(0,F.jsx)(`p`,{className:`semiont-empty-state__description`,children:f.noUsersFoundDescription})]})]})]})}),(0,F.jsxs)(`div`,{className:`semiont-page__sidebar`,children:[(0,F.jsx)(p,{activePanel:d,theme:c,showLineNumbers:l}),(0,F.jsx)(m,{context:`simple`,activePanel:d})]})]})}function L0(){return(0,F.jsxs)(`svg`,{className:`semiont-icon semiont-icon--small semiont-icon--inline`,viewBox:`0 0 24 24`,children:[(0,F.jsx)(`path`,{fill:`currentColor`,d:`M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z`}),(0,F.jsx)(`path`,{fill:`currentColor`,d:`M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z`}),(0,F.jsx)(`path`,{fill:`currentColor`,d:`M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z`}),(0,F.jsx)(`path`,{fill:`currentColor`,d:`M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z`})]})}function R0({onSignUp:e,Link:t,translations:n}){let[r,i]=(0,u.useState)(!1);return(0,F.jsx)(`main`,{className:`semiont-auth__main`,role:`main`,children:(0,F.jsx)(`div`,{className:`semiont-auth__container`,children:(0,F.jsxs)(`div`,{className:`semiont-auth__content`,children:[(0,F.jsxs)(`section`,{"aria-labelledby":`signup-heading`,className:`semiont-auth__branding`,children:[(0,F.jsx)(`h1`,{id:`signup-heading`,className:`sr-only`,children:n.pageTitle}),(0,F.jsx)(F1,{t:e=>n[e]||e,size:`xl`,animated:!0,className:`semiont-auth__logo`}),(0,F.jsx)(`p`,{className:`semiont-auth__welcome`,children:n.pageTitle}),(0,F.jsx)(`p`,{className:`semiont-auth__subtitle`,children:n.signUpPrompt})]}),(0,F.jsxs)(`div`,{className:`semiont-auth__forms`,children:[(0,F.jsxs)(`button`,{onClick:async()=>{i(!0);try{await e()}catch(e){console.error(`Failed to initiate Google sign-up:`,e),i(!1)}},disabled:r,className:`${BE.primary.base} semiont-button--full-width`,children:[r?(0,F.jsx)(`div`,{className:`semiont-auth__spinner`}):(0,F.jsx)(L0,{}),r?n.creatingAccount:n.signUpWithGoogle]}),(0,F.jsxs)(`div`,{className:`semiont-auth__info`,children:[n.approvedDomainsInfo,(0,F.jsx)(`br`,{}),n.termsAgreement]})]}),(0,F.jsxs)(`div`,{className:`semiont-auth__links`,children:[(0,F.jsx)(t,{href:`/`,className:BE.secondary.base,children:n.backToHome}),(0,F.jsx)(t,{href:`/auth/signin`,className:BE.primary.base,children:n.alreadyHaveAccount})]})]})})})}function z0(e,t){switch(e){case`Configuration`:return t.errorConfiguration;case`AccessDenied`:return t.errorAccessDenied;case`Verification`:return t.errorVerification;default:return t.errorGeneric}}function B0({errorType:e,Link:t,translations:n}){let r=z0(e,n);return(0,F.jsx)(`div`,{className:`semiont-auth-error-display`,children:(0,F.jsxs)(`div`,{className:`semiont-auth-error-display__container`,children:[(0,F.jsx)(`div`,{children:(0,F.jsx)(`h2`,{className:`semiont-auth-error-display__title`,children:n.pageTitle})}),(0,F.jsx)(`div`,{className:`semiont-auth-error-display__error-box`,children:(0,F.jsx)(`div`,{className:`semiont-auth-error-display__error-message`,children:r})}),(0,F.jsx)(`div`,{className:`semiont-auth-error-display__actions`,children:(0,F.jsx)(t,{href:`/auth/signin`,className:`semiont-auth-error-display__link`,children:n.tryAgain})})]})})}function V0({userName:e,status:t,isProcessing:n,onAccept:r,onDecline:i,translations:a,PageLayout:o,Link:s}){return t===`loading`?(0,F.jsx)(o,{className:`semiont-welcome-page__layout`,children:(0,F.jsx)(`div`,{className:`semiont-welcome-page__loading`,children:(0,F.jsxs)(`div`,{className:`semiont-welcome-page__loading-content`,children:[(0,F.jsx)(`div`,{className:`semiont-welcome-page__spinner`}),(0,F.jsx)(`p`,{className:`semiont-welcome-page__loading-text`,children:a.loading})]})})}):t===`accepted`?(0,F.jsx)(o,{className:`semiont-welcome-page__layout`,children:(0,F.jsx)(`div`,{className:`semiont-welcome-page__accepted`,children:(0,F.jsxs)(`div`,{className:`semiont-welcome-page__accepted-content`,children:[(0,F.jsx)(`div`,{className:`semiont-welcome-page__accepted-icon`,children:(0,F.jsx)(`svg`,{className:`semiont-welcome-page__accepted-checkmark`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,F.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M5 13l4 4L19 7`})})}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h2`,{className:`semiont-welcome-page__accepted-title`,children:a.welcomeTitle}),(0,F.jsx)(`p`,{className:`semiont-welcome-page__accepted-subtitle`,children:a.thanksForAccepting})]})]})})}):(0,F.jsx)(o,{className:`semiont-welcome-page__layout`,children:(0,F.jsx)(`div`,{className:`semiont-welcome-page__form-wrapper`,children:(0,F.jsxs)(`div`,{className:`semiont-welcome-page__form`,children:[(0,F.jsxs)(`div`,{className:`semiont-welcome-page__form-header`,children:[(0,F.jsx)(`div`,{className:`semiont-welcome-page__form-icon`,children:(0,F.jsx)(`svg`,{className:`semiont-welcome-page__form-icon-svg`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,F.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z`})})}),(0,F.jsx)(`h1`,{className:`semiont-welcome-page__form-title`,children:a.welcomeUser.replace(`{firstName}`,e||``)}),(0,F.jsx)(`p`,{className:`semiont-welcome-page__form-subtitle`,children:a.reviewTermsPrompt})]}),(0,F.jsx)(`div`,{className:`semiont-welcome-page__terms-content`,children:(0,F.jsxs)(`div`,{className:`semiont-welcome-page__prose`,children:[(0,F.jsx)(`h3`,{children:a.termsSummaryTitle}),(0,F.jsx)(`p`,{children:a.termsSummaryIntro}),(0,F.jsx)(`h4`,{children:a.acceptableUseTitle}),(0,F.jsxs)(`ul`,{children:[(0,F.jsx)(`li`,{children:a.acceptableUseResponsible}),(0,F.jsx)(`li`,{children:a.acceptableUseRespect}),(0,F.jsx)(`li`,{children:a.acceptableUseConduct})]}),(0,F.jsx)(`h4`,{children:a.prohibitedContentTitle}),(0,F.jsx)(`p`,{children:a.prohibitedContentIntro}),(0,F.jsxs)(`ul`,{children:[(0,F.jsx)(`li`,{children:a.prohibitedIllegal}),(0,F.jsx)(`li`,{children:a.prohibitedAdult}),(0,F.jsx)(`li`,{children:a.prohibitedHate}),(0,F.jsx)(`li`,{children:a.prohibitedViolence}),(0,F.jsx)(`li`,{children:a.prohibitedMisinformation}),(0,F.jsx)(`li`,{children:a.prohibitedPrivacy}),(0,F.jsx)(`li`,{children:a.prohibitedCopyright}),(0,F.jsx)(`li`,{children:a.prohibitedMalware}),(0,F.jsx)(`li`,{children:a.prohibitedSpam})]}),(0,F.jsx)(`h4`,{children:a.conductTitle}),(0,F.jsxs)(`p`,{children:[a.conductDescription,` `,(0,F.jsx)(`a`,{href:`https://ai-alliance.cdn.prismic.io/ai-alliance/Zl-MG5m069VX1dgH_AIAllianceCodeofConduct.pdf`,target:`_blank`,rel:`noopener noreferrer`,className:`semiont-link`,children:a.conductLink}),a.conductPromotion]}),(0,F.jsx)(`h4`,{children:a.responsibilitiesTitle}),(0,F.jsxs)(`ul`,{children:[(0,F.jsx)(`li`,{children:a.responsibilitiesSecure}),(0,F.jsx)(`li`,{children:a.responsibilitiesReport}),(0,F.jsx)(`li`,{children:a.responsibilitiesAccurate}),(0,F.jsx)(`li`,{children:a.responsibilitiesComply})]}),(0,F.jsx)(`p`,{className:`semiont-welcome-page__warning`,children:a.violationsWarning})]})}),(0,F.jsxs)(`div`,{className:`semiont-welcome-page__actions`,children:[(0,F.jsxs)(`p`,{className:`semiont-welcome-page__legal-links`,children:[a.readFullTerms,` `,(0,F.jsx)(s,{href:`/terms`,target:`_blank`,className:`semiont-welcome-page__link`,children:a.termsOfService}),` `,a.and,` `,(0,F.jsx)(s,{href:`/privacy`,target:`_blank`,className:`semiont-welcome-page__link`,children:a.privacyPolicy})]}),(0,F.jsxs)(`div`,{className:`semiont-welcome-page__buttons`,children:[(0,F.jsx)(`button`,{onClick:i,disabled:n,className:`semiont-welcome-page__button semiont-welcome-page__button--secondary`,children:a.declineAndSignOut}),(0,F.jsx)(`button`,{onClick:r,disabled:n,className:`semiont-welcome-page__button semiont-welcome-page__button--primary`,children:n?a.processing:a.acceptAndContinue})]}),(0,F.jsx)(`p`,{className:`semiont-welcome-page__legal-notice`,children:a.legallyBound})]})]})})})}function H0({entityTypes:e,error:t,newTag:n,onNewTagChange:r,onAddTag:i,isAddingTag:a,theme:o,showLineNumbers:s,activePanel:c,translations:l,ToolbarPanels:u,Toolbar:d}){return(0,F.jsxs)(`div`,{className:`semiont-page${c&&C0.includes(c)?` semiont-page--panel-open`:``}`,children:[(0,F.jsxs)(`div`,{className:`semiont-page__content`,children:[(0,F.jsxs)(`div`,{className:`semiont-page__header`,children:[(0,F.jsx)(`h1`,{className:`semiont-page__title`,children:l.pageTitle}),(0,F.jsx)(`p`,{className:`semiont-page__subtitle`,children:l.pageDescription})]}),(0,F.jsxs)(`div`,{className:`semiont-card`,children:[(0,F.jsxs)(`div`,{className:`semiont-entity-tags__header`,children:[(0,F.jsx)(`div`,{className:`semiont-entity-tags__icon-box`,children:(0,F.jsx)(_0,{className:`semiont-entity-tags__icon`})}),(0,F.jsxs)(`div`,{className:`semiont-entity-tags__content`,children:[(0,F.jsx)(`h3`,{className:`semiont-entity-tags__title`,children:l.sectionTitle}),(0,F.jsx)(`p`,{className:`semiont-entity-tags__description`,children:l.sectionDescription})]})]}),(0,F.jsx)(`div`,{className:`semiont-entity-tags__tags-section`,children:(0,F.jsx)(`div`,{className:`semiont-tags`,children:e.map(e=>(0,F.jsx)(`span`,{className:`semiont-tag semiont-tag--info semiont-tag--rounded-md`,children:e},e))})}),(0,F.jsxs)(`div`,{className:`semiont-entity-tags__input-group`,children:[(0,F.jsx)(`input`,{type:`text`,value:n,onChange:e=>r(e.target.value),onKeyDown:e=>{e.key===`Enter`&&i()},placeholder:l.inputPlaceholder,className:`semiont-entity-tags__input`,disabled:a}),(0,F.jsx)(`button`,{onClick:i,disabled:a||!n.trim(),className:`semiont-button semiont-button--primary`,children:a?l.adding:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(d0,{className:`semiont-icon semiont-icon--small semiont-icon--inline`}),l.addTag]})})]}),t&&(0,F.jsxs)(`div`,{className:`semiont-entity-tags__error`,children:[(0,F.jsx)(Z1,{className:`semiont-entity-tags__error-icon`}),t]})]})]}),(0,F.jsxs)(`div`,{className:`semiont-page__sidebar`,children:[(0,F.jsx)(u,{activePanel:c,theme:o,showLineNumbers:s}),(0,F.jsx)(d,{context:`simple`,activePanel:c})]})]})}function U0({isLoading:e,theme:t,showLineNumbers:n,activePanel:r,translations:i,ToolbarPanels:a,Toolbar:o}){return e?(0,F.jsx)(`div`,{className:`semiont-page__loading`,children:(0,F.jsx)(`p`,{className:`semiont-page__loading-text`,children:i.loading})}):(0,F.jsxs)(`div`,{className:`semiont-page${r&&C0.includes(r)?` semiont-page--panel-open`:``}`,children:[(0,F.jsxs)(`div`,{className:`semiont-page__content`,children:[(0,F.jsxs)(`div`,{className:`semiont-page__header`,children:[(0,F.jsx)(`h1`,{className:`semiont-page__title`,children:i.pageTitle}),(0,F.jsx)(`p`,{className:`semiont-page__subtitle`,children:i.pageDescription})]}),(0,F.jsxs)(`div`,{className:`semiont-card`,children:[(0,F.jsxs)(`div`,{className:`semiont-recent-docs__header`,children:[(0,F.jsx)(`div`,{className:`semiont-recent-docs__icon-box`,children:(0,F.jsx)(q1,{className:`semiont-recent-docs__icon`})}),(0,F.jsxs)(`div`,{className:`semiont-recent-docs__content`,children:[(0,F.jsx)(`h3`,{className:`semiont-recent-docs__title`,children:i.sectionTitle}),(0,F.jsx)(`p`,{className:`semiont-recent-docs__description`,children:i.sectionDescription})]})]}),(0,F.jsxs)(`div`,{className:`semiont-recent-docs__empty-state`,children:[(0,F.jsx)(`svg`,{className:`semiont-recent-docs__empty-icon`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,F.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z`})}),(0,F.jsx)(`p`,{className:`semiont-recent-docs__empty-message`,children:i.noDocuments}),(0,F.jsx)(`p`,{className:`semiont-recent-docs__empty-hint`,children:i.activityWillAppear})]})]})]}),(0,F.jsxs)(`div`,{className:`semiont-page__sidebar`,children:[(0,F.jsx)(a,{activePanel:r,theme:t,showLineNumbers:n}),(0,F.jsx)(o,{context:`simple`,activePanel:r})]})]})}var W0={legal:p0,scientific:U1,general:a0},G0={legal:`semiont-schema-domain--legal`,scientific:`semiont-schema-domain--scientific`,general:`semiont-schema-domain--general`};function K0({schemas:e,isLoading:t,theme:n,showLineNumbers:r,activePanel:i,translations:a,ToolbarPanels:o,Toolbar:s}){return t?(0,F.jsx)(`div`,{className:`semiont-page__loading`,children:(0,F.jsx)(`p`,{className:`semiont-page__loading-text`,children:a.loading})}):(0,F.jsxs)(`div`,{className:`semiont-page${i&&C0.includes(i)?` semiont-page--panel-open`:``}`,children:[(0,F.jsxs)(`div`,{className:`semiont-page__content`,children:[(0,F.jsxs)(`div`,{className:`semiont-page__header`,children:[(0,F.jsx)(`h1`,{className:`semiont-page__title`,children:a.pageTitle}),(0,F.jsx)(`p`,{className:`semiont-page__subtitle`,children:a.pageDescription})]}),(0,F.jsx)(`div`,{className:`semiont-card-grid semiont-card-grid--two-columns`,children:e.map(e=>{let t=W0[e.domain]||a0,n=G0[e.domain]||G0.general;return(0,F.jsxs)(`div`,{className:`semiont-card`,children:[(0,F.jsxs)(`div`,{className:`semiont-schema__header`,children:[(0,F.jsx)(`div`,{className:`semiont-schema__icon-wrapper ${n}`,children:t&&(0,F.jsx)(t,{className:`semiont-schema__icon`})}),(0,F.jsxs)(`div`,{className:`semiont-schema__content`,children:[(0,F.jsx)(`h3`,{className:`semiont-schema__title`,children:e.name}),(0,F.jsx)(`p`,{className:`semiont-schema__description`,children:e.description}),(0,F.jsx)(`span`,{className:`semiont-schema__badge ${n}`,children:e.domain})]})]}),(0,F.jsxs)(`div`,{className:`semiont-schema__categories`,children:[(0,F.jsx)(`h4`,{className:`semiont-schema__categories-title`,children:a.categories}),e.tags.map(e=>(0,F.jsxs)(`div`,{className:`semiont-schema__category`,children:[(0,F.jsx)(`div`,{className:`semiont-schema__category-name`,children:e.name}),(0,F.jsx)(`div`,{className:`semiont-schema__category-description`,children:e.description}),(0,F.jsxs)(`div`,{className:`semiont-schema__examples`,children:[e.examples.slice(0,2).map((e,t)=>(0,F.jsx)(`span`,{className:`semiont-schema__example`,children:e},t)),e.examples.length>2&&(0,F.jsxs)(`span`,{className:`semiont-schema__example-more`,children:[`+`,e.examples.length-2,` more`]})]})]},e.name))]})]},e.id)})})]}),(0,F.jsxs)(`div`,{className:`semiont-page__sidebar`,children:[(0,F.jsx)(o,{activePanel:i,theme:n,showLineNumbers:r}),(0,F.jsx)(s,{context:`simple`,activePanel:i})]})]})}function q0(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${(e/(1024*1024*1024)).toFixed(2)} GB`}function J0({progress:e,label:t=`Upload`}){if(!e)return null;if(e.phase===`started`)return(0,F.jsxs)(`div`,{className:`semiont-progress-wrapper`,role:`status`,"aria-live":`polite`,children:[(0,F.jsx)(`div`,{className:`semiont-progress__label`,children:(0,F.jsxs)(`span`,{children:[t,`: starting…`]})}),(0,F.jsx)(`div`,{className:`semiont-progress semiont-progress--indeterminate`,children:(0,F.jsx)(`div`,{className:`semiont-progress__fill`})})]});if(e.phase===`progress`){let n=e.totalBytes<=0,r=n?0:Math.min(100,Math.round(e.bytesUploaded/e.totalBytes*100));return(0,F.jsxs)(`div`,{className:`semiont-progress-wrapper`,role:`status`,"aria-live":`polite`,children:[(0,F.jsx)(`div`,{className:`semiont-progress__label`,children:n?(0,F.jsxs)(`span`,{children:[t,`: `,q0(e.bytesUploaded),`…`]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`span`,{children:[t,`: `,r,`%`]}),(0,F.jsxs)(`span`,{children:[q0(e.bytesUploaded),` / `,q0(e.totalBytes)]})]})}),(0,F.jsx)(`div`,{className:`semiont-progress${n?` semiont-progress--indeterminate`:``}`,role:`progressbar`,"aria-valuemin":0,"aria-valuemax":n?void 0:100,"aria-valuenow":n?void 0:r,children:(0,F.jsx)(`div`,{className:`semiont-progress__fill`,style:n?void 0:{width:`${r}%`}})})]})}return(0,F.jsxs)(`div`,{className:`semiont-progress-wrapper`,role:`status`,"aria-live":`polite`,children:[(0,F.jsx)(`div`,{className:`semiont-progress__label`,children:(0,F.jsxs)(`span`,{children:[t,`: uploaded`]})}),(0,F.jsx)(`div`,{className:`semiont-progress`,role:`progressbar`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":100,children:(0,F.jsx)(`div`,{className:`semiont-progress__fill semiont-progress__fill--success`,style:{width:`100%`}})})]})}var Y0=Object.values(Rs).map(e=>e.extension).join(`,`);function X0(e){if(e.type&&Vs(e.type))return e.type;if(e.name.includes(`.`)){let t=Ks(e.name.slice(e.name.lastIndexOf(`.`)));if(t)return t}return`application/octet-stream`}function Z0({mode:e,cloneData:t,referenceData:n,gatheredContext:r,availableEntityTypes:i,initialLocale:a,theme:o,showLineNumbers:s,hoverDelayMs:c,activePanel:l,onSaveResource:d,onCancel:f,uploadProgress:p=null,translations:m,ToolbarPanels:h,Toolbar:g}){let{announceFormSubmitting:_,announceFormSuccess:v,announceFormError:y}=zL(),[b,x]=(0,u.useState)(``),[S,C]=(0,u.useState)(``),[w,T]=(0,u.useState)([]),[E,D]=(0,u.useState)(!1),[O,k]=(0,u.useState)(`write`),[A,j]=(0,u.useState)(null),[ee,M]=(0,u.useState)(`text/markdown`),[N,te]=(0,u.useState)(null),[ne,re]=(0,u.useState)(`text/markdown`),[ie,ae]=(0,u.useState)(a),[oe,se]=(0,u.useState)(``),[ce,P]=(0,u.useState)(``),[le,ue]=(0,u.useState)(!0);(0,u.useEffect)(()=>{e===`clone`&&t?(x(t.sourceResource.name),C(t.sourceContent)):e===`reference`&&n&&(x(n.name),n.entityTypes.length>0&&T(n.entityTypes))},[e,t,n]);let de=e=>{let t=e.target.files?.[0];if(!t)return;let n=X0(t);j(t),M(n),k(`upload`),b||x(t.name.replace(/\.[^/.]+$/,``));let r=Hs(n)?.render;if(r===`image`||r===`pdf`)te(URL.createObjectURL(t));else{let e=new FileReader;e.onload=e=>{let t=e.target?.result;C(t)},e.readAsText(t)}};(0,u.useEffect)(()=>()=>{N&&URL.revokeObjectURL(N)},[N]);let fe=async t=>{if(t.preventDefault(),b.trim()){D(!0),_();try{let t={mode:e,name:b,storageUri:`file://${ce}`,content:S,format:A?ee:ne,entityTypes:w,language:ie};A&&(t.file=A),oe&&(t.charset=oe),e===`clone`&&(t.archiveOriginal=le),n?.annotationUri&&(t.annotationUri=n.annotationUri),n?.sourceDocumentId&&(t.sourceDocumentId=n.sourceDocumentId),await d(t),v(e===`clone`?`Resource cloned successfully`:e===`reference`?`Reference completed successfully`:`Resource created successfully`)}catch(e){throw y(`Failed to save resource. Please try again.`),e}finally{D(!1)}}},pe=e===`clone`,me=e===`reference`,he=r?.focus.kind===`annotation`?r.focus:null,ge=r&&he?Xs(r.graph,String(he.sourceResource.id)).connections:[];return(0,F.jsxs)(`div`,{className:`semiont-page${l&&C0.includes(l)?` semiont-page--panel-open`:``}`,children:[(0,F.jsxs)(`div`,{className:`semiont-page__content semiont-page__compose`,children:[(0,F.jsxs)(`div`,{className:`semiont-page__header`,children:[(0,F.jsx)(`h1`,{className:`semiont-page__title`,children:pe?m.titleEditClone:me?m.titleCompleteReference:m.title}),(pe||me)&&(0,F.jsx)(`p`,{className:`semiont-page__subtitle`,children:pe?m.subtitleClone:m.subtitleReference}),me&&(0,F.jsx)(`div`,{className:`semiont-page__reference-notice`,children:(0,F.jsx)(`p`,{className:`semiont-page__reference-notice-text`,children:m.linkedNoticePrefix})})]}),r&&(0,F.jsxs)(`div`,{className:`semiont-form__field`,style:{marginBottom:`1.5rem`,padding:`1rem`,backgroundColor:`var(--semiont-bg-secondary)`,borderRadius:`var(--semiont-radius-md)`,border:`1px solid var(--semiont-border-primary)`},children:[(0,F.jsx)(`h3`,{className:`semiont-form__label`,style:{marginBottom:`0.75rem`},children:`Gathered Context`}),he?.selected&&(0,F.jsx)(`div`,{style:{padding:`0.75rem`,backgroundColor:`var(--semiont-bg-primary)`,borderRadius:`var(--semiont-radius-md)`,border:`1px solid var(--semiont-border-primary)`,maxHeight:`150px`,overflowY:`auto`,marginBottom:`0.5rem`},children:(0,F.jsxs)(`div`,{style:{fontSize:`var(--semiont-text-sm)`,fontFamily:`monospace`,whiteSpace:`pre-wrap`,color:`var(--semiont-text-secondary)`},children:[he.selected.before&&(0,F.jsx)(`span`,{children:he.selected.before}),(0,F.jsx)(`span`,{style:{backgroundColor:`var(--semiont-color-primary-100)`,padding:`0 0.25rem`,fontWeight:600,color:`var(--semiont-color-primary-900)`},children:he.selected.text}),he.selected.after&&(0,F.jsx)(`span`,{children:he.selected.after})]})}),ge.length>0&&(0,F.jsxs)(`div`,{style:{padding:`0.5rem 0`,fontSize:`var(--semiont-text-sm)`,color:`var(--semiont-text-secondary)`},children:[(0,F.jsx)(`span`,{style:{fontSize:`var(--semiont-text-xs)`,fontWeight:500,marginRight:`0.5rem`},children:`Connections:`}),ge.map(e=>(0,F.jsx)(`span`,{className:`semiont-chip`,style:{fontSize:`var(--semiont-text-xs)`,padding:`0.125rem 0.5rem`,marginRight:`0.25rem`},children:e.resourceName},e.resourceId))]})]}),(0,F.jsx)(`div`,{className:`semiont-form`,children:(0,F.jsxs)(`form`,{onSubmit:fe,className:`semiont-form__fields semiont-compose-grid`,children:[(0,F.jsxs)(`div`,{className:`semiont-compose-grid__meta`,children:[(0,F.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,F.jsx)(`label`,{htmlFor:`docName`,className:`semiont-form__label`,children:m.resourceName}),(0,F.jsx)(`input`,{id:`docName`,type:`text`,value:b,onChange:e=>x(e.target.value),placeholder:m.resourceNamePlaceholder,className:`semiont-input`,required:!0,disabled:E})]}),(0,F.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,F.jsx)(`label`,{htmlFor:`storagePath`,className:`semiont-form__label`,children:`Save location`}),(0,F.jsxs)(`div`,{className:`semiont-input-addon`,children:[(0,F.jsx)(`span`,{className:`semiont-input-addon__prefix`,children:`file://`}),(0,F.jsx)(`input`,{id:`storagePath`,type:`text`,value:ce,onChange:e=>P(e.target.value),placeholder:`docs/my-resource.md`,required:!0,className:`semiont-input semiont-input--addon`,disabled:E})]})]}),(!me||w.length===0)&&(0,F.jsxs)(`div`,{className:`semiont-form__field semiont-form__entity-types`,children:[(0,F.jsx)(`div`,{className:`semiont-form__label`,children:m.entityTypes}),(0,F.jsx)(`div`,{className:`semiont-form__entity-type-buttons`,role:`group`,"aria-describedby":`entity-types-description`,children:i.map(e=>{let t=w.includes(e);return(0,F.jsx)(`button`,{type:`button`,onClick:()=>{T(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},className:`semiont-form__entity-type-button`,"data-selected":t,disabled:E,"aria-pressed":t,"aria-label":`${e} entity type, ${t?`selected`:`not selected`}`,children:e},e)})}),w.length>0&&(0,F.jsxs)(`div`,{className:`sr-only`,"aria-live":`polite`,"aria-atomic":`true`,children:[w.length,` entity type`,w.length===1?``:`s`,` selected: `,w.join(`, `)]})]}),me&&w.length>0&&(0,F.jsxs)(`div`,{className:`semiont-form__field semiont-form__entity-types-display`,role:`region`,"aria-labelledby":`selected-entity-types-label`,children:[(0,F.jsx)(`h3`,{id:`selected-entity-types-label`,className:`semiont-form__label`,children:m.entityTypes}),(0,F.jsx)(`div`,{className:`semiont-form__entity-type-tags`,role:`list`,children:w.map(e=>(0,F.jsx)(`span`,{role:`listitem`,className:`semiont-form__entity-type-tag`,"aria-label":`Entity type: ${e}`,children:e},e))}),(0,F.jsx)(`p`,{className:`semiont-form__helper-text`,id:`reference-entity-types-description`,children:`These entity types were selected when creating the reference`})]}),(0,F.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,F.jsx)(`label`,{htmlFor:`language-select`,className:`semiont-form__label`,children:m.language}),(0,F.jsx)(`select`,{id:`language-select`,value:ie,onChange:e=>ae(e.target.value),disabled:E,className:`semiont-select`,children:Ss.map(e=>(0,F.jsx)(`option`,{value:e.code,children:e.nativeName},e.code))})]})]}),(0,F.jsxs)(`div`,{className:`semiont-compose-grid__content`,children:[!pe&&!me&&(0,F.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,F.jsx)(`label`,{className:`semiont-form__label`,children:m.contentSource}),(0,F.jsxs)(`div`,{className:`semiont-form__content-source-toggle`,children:[(0,F.jsxs)(`button`,{type:`button`,onClick:()=>k(`upload`),disabled:E,className:`semiont-form__content-source-button`,"data-active":O===`upload`,children:[(0,F.jsxs)(`div`,{className:`semiont-form__content-source-icon-wrapper`,children:[(0,F.jsx)(`span`,{className:`semiont-form__content-source-icon`,children:`📎`}),(0,F.jsx)(`span`,{className:`semiont-form__content-source-label`,children:m.uploadFile})]}),(0,F.jsx)(`div`,{className:`semiont-form__content-source-description`,children:m.uploadFileDescription})]}),(0,F.jsxs)(`button`,{type:`button`,onClick:()=>k(`write`),disabled:E,className:`semiont-form__content-source-button`,"data-active":O===`write`,children:[(0,F.jsxs)(`div`,{className:`semiont-form__content-source-icon-wrapper`,children:[(0,F.jsx)(`span`,{className:`semiont-form__content-source-icon`,children:`✍️`}),(0,F.jsx)(`span`,{className:`semiont-form__content-source-label`,children:m.writeContent})]}),(0,F.jsx)(`div`,{className:`semiont-form__content-source-description`,children:m.writeContentDescription})]})]})]}),!pe&&!me&&O===`upload`&&(0,F.jsxs)(`div`,{className:`semiont-form__upload-section`,children:[(0,F.jsx)(`div`,{children:(0,F.jsxs)(`div`,{className:`semiont-form__upload-container`,children:[(0,F.jsx)(`label`,{className:`semiont-form__upload-dropzone`,children:(0,F.jsxs)(`div`,{className:`semiont-form__upload-area`,children:[(0,F.jsx)(`input`,{type:`file`,accept:Y0,onChange:de,className:`semiont-form__upload-input`,disabled:E}),(0,F.jsx)(`p`,{className:`semiont-form__upload-text`,children:A?A.name:m.dropFileOrClick}),(0,F.jsx)(`p`,{className:`semiont-form__upload-hint`,children:m.supportedFormats})]})}),A&&(0,F.jsx)(`button`,{type:`button`,onClick:()=>{j(null),te(null),M(`text/markdown`)},className:`semiont-button semiont-button--danger semiont-button--small`,disabled:E,children:`Clear`})]})}),A&&(0,F.jsxs)(`div`,{className:`semiont-form__media-type`,children:[(0,F.jsxs)(`span`,{className:`semiont-form__media-type-label`,children:[m.mediaType,`:`]}),(0,F.jsx)(`code`,{className:`semiont-form__media-type-value`,children:ee}),(0,F.jsx)(`span`,{className:`semiont-form__media-type-lock`,title:m.autoDetected,children:`🔒`})]}),A&&N&&Hs(ee)?.render===`image`&&(0,F.jsxs)(`div`,{className:`semiont-form__image-preview`,children:[(0,F.jsx)(`p`,{className:`semiont-form__image-preview-label`,children:`Preview:`}),(0,F.jsx)(`div`,{className:`semiont-form__image-preview-container`,children:(0,F.jsx)(`img`,{src:N,alt:`Upload preview`,className:`semiont-form__image-preview-img`})})]})]}),(pe||me||O===`write`)&&(0,F.jsxs)(`div`,{className:`semiont-form__write-section`,children:[!pe&&!me&&(0,F.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,F.jsx)(`label`,{htmlFor:`format-select`,className:`semiont-form__label`,children:m.format}),(0,F.jsx)(`select`,{id:`format-select`,value:ne,onChange:e=>re(e.target.value),disabled:E,className:`semiont-select`,children:Ys.map(e=>(0,F.jsxs)(`option`,{value:e,children:[Hs(e)?.label??e,` (`,e,`)`]},e))})]}),(0,F.jsxs)(`div`,{className:`semiont-form__field semiont-form__editor`,children:[(0,F.jsx)(`label`,{className:`semiont-form__label`,children:pe?m.resourceContent:m.content}),(0,F.jsx)(`div`,{className:`semiont-form__editor-wrapper`,lang:ie,children:(0,F.jsx)(rG,{content:S,editable:!E,sourceView:!0,showLineNumbers:s,hoverDelayMs:c,onChange:e=>C(e)})})]}),!pe&&!me&&(0,F.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,F.jsx)(`label`,{htmlFor:`charset-select`,className:`semiont-form__label`,children:m.encoding}),(0,F.jsxs)(`select`,{id:`charset-select`,value:oe,onChange:e=>se(e.target.value),disabled:E,className:`semiont-select`,children:[(0,F.jsx)(`option`,{value:``,children:`UTF-8 (default)`}),(0,F.jsx)(`option`,{value:`iso-8859-1`,children:`ISO-8859-1 (Latin-1)`}),(0,F.jsx)(`option`,{value:`windows-1252`,children:`Windows-1252`}),(0,F.jsx)(`option`,{value:`ascii`,children:`ASCII`}),(0,F.jsx)(`option`,{value:`utf-16le`,children:`UTF-16LE`})]})]})]}),pe&&(0,F.jsxs)(`div`,{className:`semiont-form__checkbox-field`,children:[(0,F.jsx)(`input`,{id:`archiveOriginal`,type:`checkbox`,checked:le,onChange:e=>ue(e.target.checked),className:`semiont-checkbox`,disabled:E}),(0,F.jsx)(`label`,{htmlFor:`archiveOriginal`,className:`semiont-form__checkbox-label`,children:m.archiveOriginal})]})]}),(0,F.jsxs)(`div`,{className:`semiont-form__actions`,children:[(0,F.jsx)(`button`,{type:`button`,onClick:f,disabled:E||p!==null,className:BE.tertiary.base,children:m.cancel}),(0,F.jsx)(`button`,{type:`submit`,disabled:E||p!==null||!b.trim(),className:BE.primary.base,children:E?pe?m.saving:me?m.creatingAndLinking:m.creating:pe?m.saveClonedResource:me?m.createAndLinkResource:m.createResource})]}),(0,F.jsx)(J0,{progress:p})]})})]}),(0,F.jsxs)(`div`,{className:`semiont-page__sidebar`,children:[(0,F.jsx)(h,{activePanel:l,theme:o,showLineNumbers:s}),(0,F.jsx)(g,{context:`simple`,activePanel:l})]})]})}var Q0=u.memo(({resource:e,onOpen:t,tabIndex:n=0,archivedLabel:r,createdLabel:i})=>(0,F.jsxs)(`div`,{onClick:()=>t(e),onKeyDown:n=>{(n.key===`Enter`||n.key===` `)&&(n.preventDefault(),t(e))},role:`button`,tabIndex:n,"aria-label":`Open resource: ${e.name}`,className:`semiont-resource-card`,children:[(0,F.jsxs)(`div`,{className:`semiont-resource-card__header`,children:[(0,F.jsx)(`h4`,{className:`semiont-resource-card__title`,children:e.name}),e.archived&&(0,F.jsx)(`span`,{className:`semiont-resource-card__badge`,"data-type":`archived`,children:r})]}),(0,F.jsxs)(`div`,{className:`semiont-resource-card__metadata`,children:[(0,F.jsxs)(`span`,{className:`semiont-resource-card__date`,children:[i,` `,e.dateCreated?new Date(e.dateCreated).toLocaleDateString():`N/A`]}),e.entityTypes&&e.entityTypes.length>0&&(0,F.jsxs)(`div`,{className:`semiont-tags`,children:[e.entityTypes.slice(0,2).map(e=>(0,F.jsx)(`span`,{className:`semiont-tag semiont-tag--secondary semiont-tag--compact semiont-tag--rounded-sm`,children:e},e)),e.entityTypes.length>2&&(0,F.jsxs)(`span`,{className:`semiont-tag semiont-tag--secondary semiont-tag--compact semiont-tag--rounded-sm`,children:[`+`,e.entityTypes.length-2]})]})]})]}));Q0.displayName=`ResourceCard`;function $0({recentDocuments:e,searchDocuments:t,entityTypes:n,isLoadingRecent:r,isSearching:i,searchQuery:a,onSearchQueryChange:o,selectedEntityType:s,onSelectedEntityTypeChange:c,theme:l,showLineNumbers:d,activePanel:f,onNavigateToResource:p,onNavigateToCompose:m,translations:h,ToolbarPanels:g}){let _=a.trim()!==``,v=_?t:e,y=vL(n.length+1,{orientation:`horizontal`}),b=vL(v.length,{orientation:`grid`,cols:2}),x=(0,u.useRef)(p);x.current=p;let S=(0,u.useCallback)(e=>{c(e)},[c]),C=(0,u.useCallback)(e=>{let t=ls(e);t&&x.current(t)},[]);if(r)return(0,F.jsx)(`div`,{className:`semiont-page__loading`,children:(0,F.jsx)(`p`,{className:`semiont-page__loading-text`,children:h.loadingKnowledgeBase})});let w=_&&t.length===0&&!i;return(0,F.jsxs)(`div`,{className:`semiont-page${f&&C0.includes(f)?` semiont-page--panel-open`:``}`,children:[(0,F.jsxs)(`div`,{className:`semiont-page__content`,children:[(0,F.jsxs)(`div`,{className:`semiont-page__header`,children:[(0,F.jsx)(`h1`,{className:`semiont-page__title`,children:h.title}),(0,F.jsx)(`p`,{className:`semiont-page__subtitle`,children:h.subtitle})]}),(0,F.jsxs)(`div`,{className:`semiont-card`,children:[(0,F.jsx)(`div`,{className:`semiont-card__search-form`,children:(0,F.jsxs)(`div`,{className:`semiont-card__search-wrapper`,children:[(0,F.jsx)(`input`,{type:`text`,value:a,onChange:e=>o(e.target.value),placeholder:h.searchPlaceholder,className:`semiont-card__search-input`,"aria-label":h.searchPlaceholder}),i&&(0,F.jsx)(`span`,{className:`semiont-card__search-status`,"aria-live":`polite`,children:h.searching})]})}),n.length>0&&(0,F.jsxs)(`div`,{className:`semiont-card__filters`,children:[(0,F.jsx)(`h3`,{className:`semiont-card__filters-label`,children:h.filterByEntityType}),(0,F.jsxs)(`div`,{ref:y.containerRef,onKeyDown:y.handleKeyDown,className:`semiont-card__filter-buttons`,role:`group`,"aria-label":`Entity type filters`,children:[(0,F.jsx)(`button`,{onClick:()=>S(``),tabIndex:0,"aria-pressed":s===``,className:`semiont-card__filter-button`,"data-active":s===``,children:h.all}),n.map(e=>(0,F.jsx)(`button`,{onClick:()=>S(e),tabIndex:-1,"aria-pressed":s===e,className:`semiont-card__filter-button`,"data-active":s===e,children:e},e))]})]}),(0,F.jsxs)(`div`,{className:`semiont-card__documents`,children:[(0,F.jsx)(`h3`,{className:`semiont-card__documents-label`,children:_&&t.length>0?h.searchResults(t.length):s?h.documentsTaggedWith(s):h.recentResources}),w&&(0,F.jsx)(`div`,{className:`semiont-card__warning`,children:(0,F.jsx)(`p`,{className:`semiont-card__warning-text`,children:h.noResultsFound(a)})}),v.length>0?(0,F.jsx)(`div`,{ref:b.containerRef,onKeyDown:b.handleKeyDown,className:`semiont-card-grid`,role:`group`,"aria-label":`Document grid`,children:v.map((e,t)=>(0,F.jsx)(Q0,{resource:e,onOpen:C,tabIndex:t===0?0:-1,archivedLabel:h.archived,createdLabel:h.created},ls(e)))}):(0,F.jsxs)(`div`,{className:`semiont-card__empty`,children:[(0,F.jsx)(`p`,{className:`semiont-card__empty-text`,children:h.noResourcesAvailable}),!_&&(0,F.jsx)(`button`,{onClick:m,className:`semiont-card__empty-button`,children:h.composeFirstResource})]})]})]})]}),(0,F.jsxs)(`div`,{className:`semiont-page__sidebar`,children:[(0,F.jsx)(g,{activePanel:f,theme:l,showLineNumbers:d}),(0,F.jsx)(uG,{context:`simple`,activePanel:f})]})]})}var e2=ni(Tg(),1),t2={open:!1,annotationId:null,resourceId:null,defaultTitle:``,entityTypes:[]};function n2(e,t,n,r,i){let a=ff(),o=mf(e),s=bf(e,t),c=gf(e,t),l=_f(e,t),u=vf(e,t,n);a.add(o),a.add(s),a.add(c),a.add(l),a.add(u);let d=e.browse.annotations(t).pipe((0,e2.map)(e=>e??[])),f=d.pipe((0,e2.map)(EL)),p=e.browse.entityTypes().pipe((0,e2.map)(e=>e??[])),m=e.browse.events(t).pipe((0,e2.map)(e=>e??[])),h=e.browse.referencedBy(t).pipe((0,e2.map)(e=>e??[])),g=new e2.BehaviorSubject(``),_=new e2.BehaviorSubject(!1),v=new e2.BehaviorSubject(null),y=i?.mediaType||`text/plain`,b=qs(y)!==`decode`;!b&&y&&(_.next(!0),e.browse.resourceRepresentation(t).then(({data:e,contentType:t})=>{g.next(Fs(e,t)),_.next(!1)}).catch(()=>{_.next(!1)})),b&&e.auth.mediaToken(t).then(({token:e})=>v.next(e)).catch(()=>{});let x=new e2.BehaviorSubject(t2),S=e.bus.get(`bind:initiate`).subscribe(t=>{x.next({open:!0,annotationId:t.annotationId,resourceId:t.resourceId,defaultTitle:t.defaultTitle,entityTypes:t.entityTypes}),e.bus.get(`gather:requested`).next({correlationId:crypto.randomUUID(),annotationId:t.annotationId,resourceId:t.resourceId,options:{contextWindow:2e3}})});return a.add(()=>S.unsubscribe()),{beckon:o,browse:r,mark:s,gather:c,yield:u,annotations$:d,annotationGroups$:f,entityTypes$:p,events$:m,referencedBy$:h,content$:g.asObservable(),contentLoading$:_.asObservable(),mediaToken$:v.asObservable(),wizard$:x.asObservable(),closeWizard:()=>x.next(t2),dispose:()=>{x.complete(),g.complete(),_.complete(),v.complete(),a.dispose()}}}function r2(){return typeof window>`u`?null:localStorage.getItem(`activeToolbarPanel`)||`knowledge-base`}function i2(e){typeof window>`u`||(e?localStorage.setItem(`activeToolbarPanel`,e):localStorage.removeItem(`activeToolbarPanel`))}function a2(){let e=kg();return cL(()=>T0(e,{initialPanel:r2(),onPanelChange:i2}))}function o2({resource:e,rUri:t,locale:n,Link:r,routes:i,ToolbarPanels:a,refetchDocument:o,streamStatus:s,knowledgeBaseName:c}){let l=Lg(`ReferenceWizard`),d=Lg(`ResourceGenerate`),f=kg(),p=Z(f.activeSession$),m=p?.client,h=gL(),g=(0,u.useCallback)(e=>{h(`/know/resource/${e}`,{resourceId:e})},[h]),_=(0,u.useCallback)(e=>{f.emit(`panel:open`,e)},[f]),{showError:v,showSuccess:y,showInfo:b}=Ug(),{theme:x,setTheme:S}=SL(),{showLineNumbers:C,toggleLineNumbers:w}=pL(),{hoverDelayMs:T}=hL(),{triggerSparkleAnimation:E,clearNewAnnotationId:D,newAnnotationIds:O}=UL(),k=ds(e)||`text/plain`,A=ML(JI(k)),j=A.annotateMode,ee=Hs(k)?.render,M=ee===`image`||ee===`pdf`,{content:N,loading:te,error:ne}=wL(m??null,t,e,!M);(0,u.useEffect)(()=>{ne&&v(`Failed to load resource representation`)},[ne,v]);let{token:re,loading:ie}=DL(m??null,t),ae=M&&re&&m?`${m.baseUrl}/api/resources/${t}?token=${re}`:``,oe=M?ae:N,se=M?ie:te,ce=a2(),P=cL(()=>n2(m,t,n,ce)),le=Z(P.annotations$)??[],ue=Z(P.annotationGroups$),de=Z(P.entityTypes$)??[],fe=Z(P.referencedBy$),pe=fe??[],me=fe===void 0,he=Z(P.beckon.hoveredAnnotationId$)??null,ge=Z(P.mark.pendingAnnotation$)??null,_e=Z(P.mark.assistingMotivation$)??null,ve=Z(P.mark.progress$)??null,ye=Z(P.browse.activePanel$)??null,be=Z(P.browse.scrollToAnnotationId$)??null,xe=Z(P.browse.panelInitialTab$)??null,Se=P.browse.onScrollCompleted,Ce=Z(P.yield.progress$)??null,we=Z(P.gather.context$)??null,Te=Z(P.gather.loading$)??!1,Ee=Z(P.gather.error$)??null,De=Z(P.wizard$),Oe=De?.open??!1,ke=De?.annotationId??null,Ae=De?.resourceId??null,je=De?.defaultTitle??``,Me=De?.entityTypes??[],[Ne,Pe]=(0,u.useState)(!1),Fe=(0,u.useCallback)(()=>{P.closeWizard()},[P]),Ie=(0,u.useCallback)((t,n)=>{D(Eo(t)),P.yield.generate(t,{title:n.title,storageUri:n.storagePath,prompt:n.prompt,language:n.language,sourceLanguage:fs(e),temperature:n.temperature,maxTokens:n.maxTokens,context:n.context})},[P,D,e]),Le=(0,u.useCallback)((t,n)=>{P.yield.generateFromResource({title:n.title,storageUri:n.storagePath,...n.prompt?{prompt:n.prompt}:{},language:n.language,sourceLanguage:fs(e),temperature:n.temperature,maxTokens:n.maxTokens,context:n.context})},[P,e]),Re=(0,u.useCallback)(async(e,n)=>{if(m)try{await m.bind.body(t,Eo(e),[{op:`add`,item:{type:`SpecificResource`,source:n,purpose:`linking`}}]),y(`Reference linked successfully`)}catch(e){v(`Failed to link reference: ${e instanceof Error?e.message:String(e)}`)}},[t,m,y,v]),ze=(0,u.useCallback)((e,t,n,r,i)=>{sessionStorage.setItem(`gather-context:${t}`,JSON.stringify(e));let a=new URLSearchParams({annotationUri:t,sourceDocumentId:n,name:r,entityTypes:i.join(`,`)});f.emit(`nav:push`,{path:`/know/compose?${a.toString()}`,reason:`compose-from-wizard`})},[p]);(0,u.useEffect)(()=>{if(e&&t){let n=ds(e);f.addOpenResource(t,e.name,n||void 0,e.storageUri),typeof localStorage<`u`&&localStorage.setItem(`lastViewedDocumentId`,t)}},[e,t,f]),(0,u.useEffect)(()=>{ge&&f.emit(`panel:open`,{panel:`annotations`})},[ge,f]),PL({"mark:archive":(0,u.useCallback)(async()=>{if(m)try{await m.mark.archive(t),await o()}catch(e){console.error(`Failed to archive document:`,e),v(`Failed to archive document`)}},[m,t,o,v]),"mark:unarchive":(0,u.useCallback)(async()=>{if(m)try{await m.mark.unarchive(t),await o()}catch(e){console.error(`Failed to unarchive document:`,e),v(`Failed to unarchive document`)}},[m,t,o,v]),"yield:clone":(0,u.useCallback)(async()=>{if(m)try{let e=(await m.yield.cloneToken(t)).token;f.emit(`nav:push`,{path:`/know/compose?mode=clone&token=${e}`,reason:`clone`})}catch(e){console.error(`Failed to generate clone token:`,e),v(`Failed to generate clone link`)}},[m,t,v,p]),"beckon:sparkle":(0,u.useCallback)(({annotationId:e})=>{E(e)},[E]),"mark:added":(0,u.useCallback)(e=>{E(e.payload.annotation.id)},[E]),"mark:create-failed":(0,u.useCallback)(({message:e})=>v(`Failed to create annotation: ${e||`unknown error`}`),[v]),"mark:delete-failed":(0,u.useCallback)(({message:e})=>v(`Failed to delete annotation: ${e||`unknown error`}`),[v]),"mark:body-updated":(0,u.useCallback)(()=>{},[]),"bind:body-update-failed":(0,u.useCallback)(({message:e})=>v(`Failed to update reference: ${e}`),[v]),"settings:theme-changed":(0,u.useCallback)(({theme:e})=>S(e),[S]),"settings:line-numbers-toggled":w,"job:complete":(0,u.useCallback)(t=>{if(t.resourceId===e.id)if(t.jobType===`generation`){let e=t.result?.resourceName;y(e?`Resource "${e}" created successfully!`:`Resource created successfully!`)}else y(`Annotation complete`)},[e.id,y]),"job:fail":(0,u.useCallback)(t=>{t.resourceId===e.id&&(t.jobType===`generation`?v(`Resource generation failed: ${t.error}`):v(t.error||`Annotation failed`))},[e.id,v]),"mark:assist-cancelled":()=>b(`Annotation cancelled`),"browse:reference-navigate":(0,u.useCallback)(({resourceId:e})=>{if(i.resourceDetail){let t=i.resourceDetail(e);f.emit(`nav:push`,{path:t,reason:`reference-link`})}},[i.resourceDetail,p]),"browse:entity-type-clicked":(0,u.useCallback)(({entityType:e})=>{if(i.know){let t=`${i.know}?entityType=${encodeURIComponent(e)}`;f.emit(`nav:push`,{path:t,reason:`entity-type-filter`})}},[i.know,p])});let{announceResourceLoading:Be,announceResourceLoaded:Ve}=RL();(0,u.useEffect)(()=>{se?Be(e.name):oe&&Ve(e.name)},[se,oe,e.name,Be,Ve]);let He=e.entityTypes||[],Ue=us(e),We=Ue?.mediaType,Ge=Ue?.byteSize,Ke={...e,content:oe},qe=(0,u.useCallback)(e=>{e&&p?.client.beckon.sparkle(Eo(e))},[p]),Je=(0,u.useCallback)(e=>{},[]);return(0,F.jsxs)(`div`,{className:`semiont-document-viewer${ye?` semiont-document-viewer--panel-open`:``}`,children:[(0,F.jsxs)(`div`,{className:`semiont-document-viewer__main`,children:[(0,F.jsxs)(`div`,{className:`semiont-document-viewer__content`,children:[(0,F.jsx)(`div`,{className:`semiont-document-viewer__header`,children:(0,F.jsx)(`div`,{className:`semiont-document-viewer__header-inner`,children:(0,F.jsx)(`h2`,{className:`semiont-document-viewer__title`,children:e.name})})}),Ce&&!Ce.annotationId&&(0,F.jsx)(iG,{progress:Ce,annotationType:`generation`,cancelJobType:`generation`,translations:{title:d(`progressTitle`),cancel:d(`progressCancel`),inProgress:d(`progressInProgress`),complete:d(`progressComplete`),failed:d(`progressFailed`)}}),(0,F.jsx)(`div`,{className:`semiont-document-viewer__scrollable-body`,lang:fs(e)||void 0,children:(0,F.jsx)(aG,{fallback:(e,t)=>(0,F.jsxs)(`div`,{className:`semiont-document-viewer__error`,children:[(0,F.jsx)(`h3`,{className:`semiont-document-viewer__error-title`,children:`Error loading document viewer`}),(0,F.jsx)(`p`,{className:`semiont-document-viewer__error-message`,children:e.message}),(0,F.jsx)(`button`,{onClick:t,className:`semiont-document-viewer__error-button`,children:`Try again`})]}),children:se?(0,F.jsx)(`div`,{className:`semiont-document-viewer__loading`,children:`Loading document content...`}):(0,F.jsx)(mX,{resource:Ke,annotations:ue??{highlights:[],comments:[],assessments:[],references:[],tags:[]},session:p??null,onOpenResource:g,onOpenPanel:_,annotateMode:A.annotateMode,onAnnotateModeChange:A.setAnnotateMode,clickAction:A.clickAction,onClickActionChange:A.setClickAction,selectionMotivation:A.selectionMotivation,onSelectionMotivationChange:A.setSelectionMotivation,shape:A.shape,onShapeChange:A.setShape,newAnnotationIds:O,generatingReferenceId:Ce?.annotationId??null,showLineNumbers:C,hoverDelayMs:T,hoveredAnnotationId:he})})})]}),(0,F.jsxs)(`div`,{className:`semiont-document-viewer__sidebar`,children:[(0,F.jsxs)(a,{activePanel:ye,theme:x,showLineNumbers:C,width:ye===`jsonld`?`w-[600px]`:ye===`annotations`?`w-[400px]`:`w-64`,children:[j&&e.archived&&(0,F.jsx)(`div`,{className:`semiont-document-viewer__archived-status`,children:(0,F.jsx)(`div`,{className:`semiont-document-viewer__archived-text`,children:`📦 Archived`})}),ye===`annotations`&&!e.archived&&(0,F.jsx)(qX,{annotations:le,annotators:zE,annotateMode:j,assistingMotivation:_e,progress:ve,pendingAnnotation:ge,allEntityTypes:de,generatingReferenceId:Ce?.annotationId??null,referencedBy:pe,referencedByLoading:me,resourceId:t,locale:n,sourceLanguage:fs(e),scrollToAnnotationId:be,hoveredAnnotationId:he,onScrollCompleted:Se,initialTab:xe?.tab,initialTabGeneration:xe?.generation,Link:r,routes:i}),ye===`history`&&(0,F.jsx)(aX,{rUri:t,hoveredAnnotationId:he,onEventHover:qe,onEventClick:Je,Link:r,routes:i}),ye===`info`&&(0,F.jsx)(VX,{resourceId:t,documentEntityTypes:He,documentLocale:fs(e),primaryMediaType:We,primaryByteSize:Ge,storageUri:e.storageUri,isArchived:e.archived??!1,dateCreated:e.dateCreated,dateModified:e.dateModified,wasAttributedTo:e.wasAttributedTo,wasDerivedFrom:e.wasDerivedFrom,generator:e.generator,onGenerate:()=>Pe(!0)}),ye===`collaboration`&&(0,F.jsx)(wX,{state:s,eventCount:0,knowledgeBaseName:c}),ye===`jsonld`&&(0,F.jsx)(NX,{resourceId:t})]}),(0,F.jsx)(uG,{context:`document`,activePanel:ye,isArchived:e.archived??!1})]})]}),(0,F.jsx)(T1,{isOpen:Oe,onClose:Fe,annotationId:ke,resourceId:Ae,defaultTitle:je,entityTypes:Me,locale:n,context:we,contextLoading:Te,contextError:Ee,onGenerateSubmit:Ie,onLinkResource:Re,onComposeNavigate:ze,translations:{gatherTitle:l(`gatherTitle`),configureGenerationTitle:l(`configureGenerationTitle`),configureSearchTitle:l(`configureSearchTitle`),searchResultsTitle:l(`searchResultsTitle`),sourceContextLabel:l(`sourceContextLabel`),connectionsLabel:l(`connectionsLabel`),citedByLabel:l(`citedByLabel`),userHintLabel:l(`userHintLabel`),userHintPlaceholder:l(`userHintPlaceholder`),loadingContext:l(`loadingContext`),failedContext:l(`failedContext`),cancel:l(`cancel`),search:l(`search`),searching:l(`searching`),generate:l(`generate`),compose:l(`compose`),resolutionStrategyLabel:l(`resolutionStrategyLabel`),back:l(`back`),link:l(`link`),score:l(`score`),noResults:l(`noResults`),resourceTitle:l(`resourceTitle`),resourceTitlePlaceholder:l(`resourceTitlePlaceholder`),additionalInstructions:l(`additionalInstructions`),additionalInstructionsPlaceholder:l(`additionalInstructionsPlaceholder`),language:l(`language`),languageHelp:l(`languageHelp`),creativity:l(`creativity`),creativityFocused:l(`creativityFocused`),creativityCreative:l(`creativityCreative`),maxLength:l(`maxLength`),maxLengthHelp:l(`maxLengthHelp`),maxResults:l(`maxResults`),semanticScoring:l(`semanticScoring`),semanticScoringHelp:l(`semanticScoringHelp`)}}),(0,F.jsx)(D1,{isOpen:Ne,onClose:()=>Pe(!1),resourceId:t,defaultTitle:``,locale:n,onGenerateSubmit:Le,translations:{gatherTitle:d(`gatherTitle`),reviewTitle:d(`reviewTitle`),configureTitle:d(`configureTitle`),next:d(`next`),back:d(`back`),cancel:d(`cancel`),gatherIntro:d(`gatherIntro`),includeContent:d(`includeContent`),includeSummary:d(`includeSummary`),gatherDepth:d(`gatherDepth`),gatherMaxResources:d(`gatherMaxResources`),gatherButton:d(`gatherButton`),excludeLabel:d(`excludeLabel`),loadingContext:d(`loadingContext`),failedContext:d(`failedContext`),sourceContextLabel:d(`sourceContextLabel`),connectionsLabel:d(`connectionsLabel`),citedByLabel:d(`citedByLabel`),resourceTitle:d(`resourceTitle`),resourceTitlePlaceholder:d(`resourceTitlePlaceholder`),additionalInstructions:d(`additionalInstructions`),additionalInstructionsPlaceholder:d(`additionalInstructionsPlaceholder`),language:d(`language`),languageHelp:d(`languageHelp`),creativity:d(`creativity`),creativityFocused:d(`creativityFocused`),creativityCreative:d(`creativityCreative`),maxLength:d(`maxLength`),maxLengthHelp:d(`maxLengthHelp`),generate:d(`generate`)}})]})}var s2=ni(Tg(),1);function c2(e){let t=new s2.BehaviorSubject(!1);return{isLoggingOut$:t.asObservable(),logout:async()=>{t.next(!0);try{await e.auth.logout()}catch{}finally{t.next(!1)}},dispose:()=>{t.complete()}}}var l2=ni(Tg(),1);function u2(e,t,n,r){let i=ff(),a=!!(n.annotationUri&&n.sourceDocumentId&&n.name),o=n.mode===`clone`&&!!n.token,s=o?`clone`:a?`reference`:`new`,c=new l2.BehaviorSubject(s),l=new l2.BehaviorSubject(!0),u=new l2.BehaviorSubject(null),d=new l2.BehaviorSubject(null),f=new l2.BehaviorSubject(null),p=new l2.BehaviorSubject(null),m=e.browse.entityTypes().pipe((0,l2.map)(e=>e??[]));if(a){let e=n.entityTypes?n.entityTypes.split(`,`):[];if(d.next({annotationUri:n.annotationUri,sourceDocumentId:n.sourceDocumentId,name:n.name,entityTypes:e}),n.storedContext)try{f.next(JSON.parse(n.storedContext))}catch{}l.next(!1)}else o?(async()=>{try{let t=await e.yield.fromToken(n.token);if(t&&r){let n=To(t[`@id`]),{data:r,contentType:i}=await e.browse.resourceRepresentation(n),a=Fs(r,i);u.next({sourceResource:t,sourceContent:a})}}catch{}l.next(!1)})():l.next(!1);return{browse:t,mode$:c.asObservable(),loading$:l.asObservable(),cloneData$:u.asObservable(),referenceData$:d.asObservable(),gatheredContext$:f.asObservable(),entityTypes$:m,uploadProgress$:p.asObservable(),save:async t=>{if(t.mode===`clone`)return(await e.yield.createFromToken({token:n.token,name:t.name,content:t.content,archiveOriginal:t.archiveOriginal??!0})).resourceId;let r,i;if(t.file)r=t.file,i=t.format??`application/octet-stream`;else{let e=new Blob([t.content||``],{type:t.format??`application/octet-stream`}),n=Us(t.format??`application/octet-stream`);r=new File([e],t.name+n,{type:t.format??`application/octet-stream`}),i=t.format??`application/octet-stream`}let a=t.charset&&!t.file?`${i}; charset=${t.charset}`:i,o=await new Promise((n,i)=>{e.yield.resource({name:t.name,file:r,format:a,entityTypes:t.entityTypes||[],language:t.language,storageUri:t.storageUri}).subscribe({next:e=>{p.next(e),e.phase===`finished`&&n(e.resourceId)},error:e=>{p.next(null),i(e)},complete:()=>p.next(null)})});return t.mode===`reference`&&t.annotationUri&&t.sourceDocumentId&&await e.bind.body(To(t.sourceDocumentId),Eo(t.annotationUri),[{op:`add`,item:{type:`SpecificResource`,source:o,purpose:`linking`}}]),o},dispose:()=>{c.complete(),l.complete(),u.complete(),d.complete(),f.complete(),p.complete(),i.dispose()}}}var d2=ni(Tg(),1);function f2(e,t){let n=e.browse.resource(t);return{resource$:n,isLoading$:n.pipe((0,d2.map)(e=>e===void 0)),invalidate:()=>e.browse.invalidateResourceDetail(t),dispose:()=>{}}}var p2=ni(Tg(),1);function m2(e,t){let n=ff(),r=new p2.BehaviorSubject([]),i=new p2.BehaviorSubject(null),a=new p2.BehaviorSubject(!0),o=new p2.BehaviorSubject(!0),s=()=>{a.next(!0),e.admin.users().then(e=>{r.next(e.users??[]),a.next(!1)}).catch(()=>a.next(!1))},c=()=>{o.next(!0),e.admin.userStats().then(e=>{i.next(e.stats??null),o.next(!1)}).catch(()=>o.next(!1))};return s(),c(),{browse:t,users$:r.asObservable(),stats$:i.asObservable(),usersLoading$:a.asObservable(),statsLoading$:o.asObservable(),updateUser:async(t,n)=>{await e.admin.updateUser(So(t),n),s(),c()},dispose:()=>{r.complete(),i.complete(),a.complete(),o.complete(),n.dispose()}}}var h2=ni(Tg(),1);function g2(e,t){let n=ff(),r=new h2.BehaviorSubject([]),i=new h2.BehaviorSubject([]),a=new h2.BehaviorSubject(!0);return e.admin.oauthConfig().then(e=>{let t=e;r.next(t.providers??[]),i.next(t.allowedDomains??[]),a.next(!1)}).catch(()=>a.next(!1)),{browse:t,providers$:r.asObservable(),allowedDomains$:i.asObservable(),isLoading$:a.asObservable(),dispose:()=>{r.complete(),i.complete(),a.complete(),n.dispose()}}}var _2=ni(Tg(),1),v2=ni(RE(),1);function y2(e,t,n){let r=ff(),i=new _2.BehaviorSubject(null),a=new _2.BehaviorSubject(null),o=new _2.BehaviorSubject(null),s=new _2.BehaviorSubject(void 0),c=new _2.BehaviorSubject(void 0),l=new _2.BehaviorSubject(!1),u=new _2.BehaviorSubject(!1);return{browse:e,selectedFile$:i.asObservable(),preview$:a.asObservable(),importPhase$:o.asObservable(),importMessage$:s.asObservable(),importResult$:c.asObservable(),isExporting$:l.asObservable(),isImporting$:u.asObservable(),selectFile:e=>{i.next(e),o.next(null),s.next(void 0),c.next(void 0),a.next({format:e.name.endsWith(`.tar.gz`)||e.name.endsWith(`.gz`)?`semiont-linked-data`:`unknown`,version:1,sourceUrl:``,stats:{}})},cancelImport:()=>{i.next(null),a.next(null),o.next(null),s.next(void 0),c.next(void 0)},doExport:async()=>{l.next(!0);try{let e=await t();return{blob:await new Response(e.stream).blob(),filename:e.filename??`semiont-export-${Date.now()}.tar.gz`}}finally{l.next(!1)}},doImport:async()=>{let e=i.getValue();if(e){u.next(!0),o.next(`started`),s.next(void 0),c.next(void 0);try{await(0,_2.lastValueFrom)(n(e).pipe((0,v2.tap)(e=>{o.next(e.phase),s.next(e.message),e.result&&c.next(e.result)})))}finally{u.next(!1)}}},dispose:()=>{i.complete(),a.complete(),o.complete(),s.complete(),c.complete(),l.complete(),u.complete(),r.dispose()}}}var b2=ni(Tg(),1);function x2(e){let t=ff(),n=new b2.BehaviorSubject(null),r=new b2.BehaviorSubject(!1);return e.auth.me().then(e=>n.next(e)).catch(()=>{}),{userData$:n.asObservable(),isProcessing$:r.asObservable(),acceptTerms:async()=>{r.next(!0);try{await e.auth.acceptTerms(),n.next({...n.getValue(),termsAcceptedAt:new Date().toISOString()})}finally{r.next(!1)}},dispose:()=>{n.complete(),r.complete(),t.dispose()}}}var S2=ni(Tg(),1),C2=ni(RE(),1),w2=10,T2=20,E2=250;function D2(e,t){let n=ff(),r=new S2.BehaviorSubject(``);n.add(()=>r.complete());let i=new S2.Subject;n.add(()=>i.complete());let a=r.pipe((0,C2.switchMap)(t=>e.browse.resources({limit:w2,archived:!1,...t?{entityType:t}:{}})),(0,C2.shareReplay)({bufferSize:1,refCount:!0})),o=a.pipe((0,C2.map)(e=>e??[])),s=a.pipe((0,C2.map)(e=>e===void 0)),c=e.browse.entityTypes().pipe((0,C2.map)(e=>e??[])),l=i.pipe((0,C2.startWith)(``),(0,C2.debounceTime)(E2),(0,C2.distinctUntilChanged)()),u=(0,S2.combineLatest)([l,r]).pipe((0,C2.switchMap)(([t,n])=>{let r=t.trim();return r?e.browse.resources({search:r,limit:T2,...n?{entityType:n}:{}}).pipe((0,C2.map)(e=>({results:e??[],isSearching:e===void 0})),(0,C2.startWith)({results:[],isSearching:!0})):(0,S2.of)({results:[],isSearching:!1})}),(0,C2.shareReplay)({bufferSize:1,refCount:!0}));return{browse:t,search:{query$:i.pipe((0,C2.startWith)(``)),state$:u,setQuery:e=>i.next(e)},recentResources$:o,entityTypes$:c,isLoadingRecent$:s,selectedEntityType$:r.asObservable(),setSelectedEntityType:e=>r.next(e),dispose:()=>n.dispose()}}var O2=ni(Tg(),1);function k2(e,t){let n=ff(),r=new O2.BehaviorSubject(``),i=new O2.BehaviorSubject(``),a=new O2.BehaviorSubject(!1),o=e.browse.entityTypes();return{browse:t,entityTypes$:o.pipe((0,O2.map)(e=>e??[])),isLoading$:o.pipe((0,O2.map)(e=>e===void 0)),newTag$:r.asObservable(),error$:i.asObservable(),isAdding$:a.asObservable(),setNewTag:e=>r.next(e),addTag:async()=>{let t=r.getValue().trim();if(t){i.next(``),a.next(!0);try{await e.frame.addEntityType(t),r.next(``)}catch(e){i.next(e instanceof Error?e.message:`Failed to add entity type`)}finally{a.next(!1)}}},dispose:()=>{r.complete(),i.complete(),a.complete(),n.dispose()}}}function A2({children:e}){return(0,F.jsxs)(sG,{resetKeys:[rt().pathname],children:[(0,F.jsx)(HY,{}),(0,F.jsx)(VY,{}),e]})}var j2=u.lazy(()=>h(()=>import(`./layout-DTmqSMaD.js`),__vite__mapDeps([4,1,2,3,5,6]))),M2=u.lazy(()=>h(()=>import(`./page-CW-IRz2J.js`),__vite__mapDeps([7,1,2,3,6]))),N2=u.lazy(()=>h(()=>import(`./page-Bc9V6mf9.js`),__vite__mapDeps([8,1,2,3,5,6,9,10,11]))),P2=u.lazy(()=>h(()=>import(`./page-CwVdaXSz.js`),__vite__mapDeps([12,1,2,3,5,6,9,10,11]))),F2=u.lazy(()=>h(()=>import(`./page-CECOHOJV2.js`),__vite__mapDeps([13,1,2,3,5,6,9,10,11]))),I2=u.lazy(()=>h(()=>import(`./page-D3S88nw6.js`),__vite__mapDeps([14,1,2,6,3]))),L2=u.lazy(()=>h(()=>import(`./page-CFCQC-1H.js`),__vite__mapDeps([15,1,2,3,5,6,9,10,11]))),R2=u.lazy(()=>h(()=>import(`./page-C-3mAlWS.js`),__vite__mapDeps([16,1,2,3,5,6,9,10,11]))),z2=u.lazy(()=>h(()=>import(`./page-DtiXtJ-l.js`),__vite__mapDeps([17,1,2,3,6]))),B2=u.lazy(()=>h(()=>import(`./layout-Du8P32Vd.js`),__vite__mapDeps([18,1,2,3,5,6,9,10,19,20,11]))),V2=u.lazy(()=>h(()=>import(`./page-BbIr9jHP.js`),__vite__mapDeps([21,1,2,3,6]))),H2=u.lazy(()=>h(()=>import(`./page-DA_80CZf.js`),__vite__mapDeps([22,1,2,3,19,10,6]))),U2=u.lazy(()=>h(()=>import(`./page-RGbKfKB9.js`),__vite__mapDeps([23,1,2,3,19,10,6]))),W2=u.lazy(()=>h(()=>import(`./page-B5mEdf46.js`),__vite__mapDeps([24,1,2,3,19,10,6,11]))),G2=u.lazy(()=>h(()=>import(`./layout-vhDZbfjy.js`),__vite__mapDeps([25,1,2,3,5,6,9,10,26,20,27,11]))),K2=u.lazy(()=>h(()=>import(`./page-BJR7WHXg.js`),__vite__mapDeps([28,3,1,2,6]))),q2=u.lazy(()=>h(()=>import(`./client-DwyJWkCL.js`),__vite__mapDeps([29,1,2,3,19,10,6]))),J2=u.lazy(()=>h(()=>import(`./client-C7bo_8D-.js`),__vite__mapDeps([30,1,2,3,19,10,6]))),Y2=u.lazy(()=>h(()=>import(`./client-BrDEpGKw.js`),__vite__mapDeps([31,1,2,3,19,10,6]))),X2=u.lazy(()=>h(()=>import(`./page-ChXxpqyF.js`),__vite__mapDeps([32,1,2,3,19,10,6,27]))),Z2=u.lazy(()=>h(()=>import(`./layout-bfsd3hAb.js`),__vite__mapDeps([33,1,2,3,5,6,9,10,26,20,11]))),Q2=u.lazy(()=>h(()=>import(`./page-B2mIxjOM.js`),__vite__mapDeps([34,1,2,3,6]))),$2=u.lazy(()=>h(()=>import(`./page-Baj4wmy7.js`),__vite__mapDeps([35,1,2,3,19,10,6]))),e4=u.lazy(()=>h(()=>import(`./page-DrjzWWIE.js`),__vite__mapDeps([36,1,2,3,19,10,6]))),t4=u.lazy(()=>h(()=>import(`./page-lMAxop92.js`),__vite__mapDeps([37,1,2,3,19,10,6]))),n4=u.lazy(()=>h(()=>import(`./client-szDQ4r9k.js`),__vite__mapDeps([38,1,2,3,19,10,6]))),r4=u.lazy(()=>h(()=>import(`./not-found-Bvki2-z5.js`),__vite__mapDeps([39,2,1,3,6])));function i4({children:e}){let{locale:t}=ut(),{i18n:n}=i();return(0,u.useEffect)(()=>{if(!t)return;let e=xr(t)?t:`en`;n.language!==e&&n.changeLanguage(e)},[t,n]),!t||!xr(t)?(0,F.jsx)(Pt,{to:`/en`,replace:!0}):(0,F.jsx)(F.Fragment,{children:e})}function a4(){return(0,F.jsx)(A2,{children:(0,F.jsx)(Ft,{})})}function o4(){let e=ot();return(0,u.useEffect)(()=>{let t=navigator.language.split(`-`)[0]??`en`;e(`/${xr(t)?t:`en`}`,{replace:!0})},[e]),null}function s4(){return(0,F.jsx)(u.Suspense,{fallback:null,children:(0,F.jsxs)(Rt,{children:[(0,F.jsx)(It,{path:`/`,element:(0,F.jsx)(o4,{})}),(0,F.jsxs)(It,{path:`/:locale`,element:(0,F.jsx)(i4,{children:(0,F.jsx)(j2,{})}),children:[(0,F.jsx)(It,{index:!0,element:(0,F.jsx)(M2,{})}),(0,F.jsx)(It,{path:`about`,element:(0,F.jsx)(N2,{})}),(0,F.jsx)(It,{path:`privacy`,element:(0,F.jsx)(P2,{})}),(0,F.jsx)(It,{path:`terms`,element:(0,F.jsx)(F2,{})}),(0,F.jsx)(It,{path:`auth/connect`,element:(0,F.jsx)(I2,{})}),(0,F.jsx)(It,{path:`auth/signup`,element:(0,F.jsx)(L2,{})}),(0,F.jsx)(It,{path:`auth/error`,element:(0,F.jsx)(R2,{})}),(0,F.jsxs)(It,{element:(0,F.jsx)(a4,{}),children:[(0,F.jsx)(It,{path:`auth/welcome`,element:(0,F.jsx)(z2,{})}),(0,F.jsxs)(It,{path:`know`,element:(0,F.jsx)(B2,{}),children:[(0,F.jsx)(It,{index:!0,element:(0,F.jsx)(V2,{})}),(0,F.jsx)(It,{path:`discover`,element:(0,F.jsx)(H2,{})}),(0,F.jsx)(It,{path:`compose`,element:(0,F.jsx)(U2,{})}),(0,F.jsx)(It,{path:`resource/:id`,element:(0,F.jsx)(W2,{})})]}),(0,F.jsxs)(It,{path:`admin`,element:(0,F.jsx)(G2,{}),children:[(0,F.jsx)(It,{index:!0,element:(0,F.jsx)(K2,{})}),(0,F.jsx)(It,{path:`users`,element:(0,F.jsx)(q2,{})}),(0,F.jsx)(It,{path:`security`,element:(0,F.jsx)(J2,{})}),(0,F.jsx)(It,{path:`exchange`,element:(0,F.jsx)(Y2,{})}),(0,F.jsx)(It,{path:`devops`,element:(0,F.jsx)(X2,{})})]}),(0,F.jsxs)(It,{path:`moderate`,element:(0,F.jsx)(Z2,{}),children:[(0,F.jsx)(It,{index:!0,element:(0,F.jsx)(Q2,{})}),(0,F.jsx)(It,{path:`recent`,element:(0,F.jsx)($2,{})}),(0,F.jsx)(It,{path:`entity-tags`,element:(0,F.jsx)(e4,{})}),(0,F.jsx)(It,{path:`tag-schemas`,element:(0,F.jsx)(t4,{})}),(0,F.jsx)(It,{path:`linked-data`,element:(0,F.jsx)(n4,{})})]})]}),(0,F.jsx)(It,{path:`*`,element:(0,F.jsx)(r4,{})})]}),(0,F.jsx)(It,{path:`*`,element:(0,F.jsx)(Pt,{to:`/en`,replace:!0})})]})})}Cr(`/assets/pdf.worker.min-DEtVeC4l.mjs`);var c4={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_OTEL_OTLP_ENDPOINT;c4&&h(async()=>{let{initObservabilityWeb:e}=await import(`./web-BE6xPuyf.js`);return{initObservabilityWeb:e}},[]).then(({initObservabilityWeb:e})=>{e({serviceName:`semiont-frontend`,otlpEndpoint:c4})});var l4=document.getElementById(`root`);if(!l4)throw Error(`Root element not found`);d.createRoot(l4).render((0,F.jsx)(u.StrictMode,{children:(0,F.jsx)(On,{children:(0,F.jsx)(s4,{})})}));export{_L as $,Ir as $t,P1 as A,os as At,k2 as B,Vr as Bt,o2 as C,ou as Ct,R0 as D,Ml as Dt,dG as E,Nl as Et,BE as F,Br as Ft,lL as G,Rr as Gt,f2 as H,Nr as Ht,g2 as I,Wr as It,PL as J,Hr as Jt,sL as K,Gr as Kt,m2 as L,jr as Lt,xL as M,Yo as Mt,uG as N,ss as Nt,XX as O,Dl as Ot,V0 as P,To as Pt,Z as Q,Or as Qt,u2 as R,Pr as Rt,B1 as S,su as St,F1 as T,Pl as Tt,c2 as U,zr as Ut,y2 as V,Mr as Vt,x2 as W,Kr as Wt,dL as X,Lr as Xt,hL as Y,Ur as Yt,pL as Z,Fr as Zt,lG as _,ju as _t,B0 as a,Pt as an,Hg as at,$0 as b,bu as bt,z1 as c,ot as cn,Ug as ct,BY as d,h as dn,Xd as dt,qr as en,yL as et,L1 as f,Qd as ft,U0 as g,Uu as gt,R1 as h,Gu as ht,I0 as i,An as in,Og as it,K0 as j,cs as jt,N1 as k,wo as kt,H0 as l,ut as ln,Id as lt,LL as m,fd as mt,M0 as n,Dr as nn,cL as nt,C0 as o,Ft as on,Ig as ot,P0 as p,pd as pt,fL as q,kr as qt,N0 as r,xr as rn,SL as rt,y1 as s,rt as sn,kg as st,E0 as t,Er as tn,a2 as tt,JX as u,Rn as un,hf as ut,HL as v,Au as vt,M1 as w,$l as wt,V1 as x,vu as xt,Z0 as y,ku as yt,D2 as z,Ar as zt};
|
|
140
|
+
//# sourceMappingURL=index-qVNtMzC0.js.map
|